From 1962cca69ec024158f1715065fd3905cd0409f03 Mon Sep 17 00:00:00 2001 From: Justin Traglia <95511699+jtraglia@users.noreply.github.com> Date: Thu, 14 Dec 2023 22:03:45 -0600 Subject: [PATCH] Fix error string generation for missing commitments (#13338) --- beacon-chain/blockchain/receive_blob.go | 2 +- beacon-chain/db/filesystem/blob.go | 2 +- beacon-chain/sync/initial-sync/blocks_fetcher.go | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/beacon-chain/blockchain/receive_blob.go b/beacon-chain/blockchain/receive_blob.go index 110c60260e..d39850a061 100644 --- a/beacon-chain/blockchain/receive_blob.go +++ b/beacon-chain/blockchain/receive_blob.go @@ -7,7 +7,7 @@ import ( ) // SendNewBlobEvent sends a message to the BlobNotifier channel that the blob -// for the blocroot `root` is ready in the database +// for the block root `root` is ready in the database func (s *Service) sendNewBlobEvent(root [32]byte, index uint64) { s.blobNotifiers.notifyIndex(root, index) } diff --git a/beacon-chain/db/filesystem/blob.go b/beacon-chain/db/filesystem/blob.go index 38a6f4be6b..d4db679b27 100644 --- a/beacon-chain/db/filesystem/blob.go +++ b/beacon-chain/db/filesystem/blob.go @@ -27,7 +27,7 @@ import ( ) var ( - errIndexOutOfBounds = errors.New("blob index in file name > MaxBlobsPerBlock") + errIndexOutOfBounds = errors.New("blob index in file name >= MaxBlobsPerBlock") ) const ( diff --git a/beacon-chain/sync/initial-sync/blocks_fetcher.go b/beacon-chain/sync/initial-sync/blocks_fetcher.go index a01292aa99..20a391f6a5 100644 --- a/beacon-chain/sync/initial-sync/blocks_fetcher.go +++ b/beacon-chain/sync/initial-sync/blocks_fetcher.go @@ -441,7 +441,7 @@ func verifyAndPopulateBlobs(bwb []blocks2.BlockWithVerifiedBlobs, blobs []blocks } func missingCommitError(root [32]byte, slot primitives.Slot, missing [][]byte) error { - missStr := make([]string, len(missing)) + missStr := make([]string, 0, len(missing)) for k := range missing { missStr = append(missStr, fmt.Sprintf("%#x", k)) }