diff --git a/beacon-chain/core/peerdas/reconstruction.go b/beacon-chain/core/peerdas/reconstruction.go index b27247bc4c..5a9663bace 100644 --- a/beacon-chain/core/peerdas/reconstruction.go +++ b/beacon-chain/core/peerdas/reconstruction.go @@ -257,7 +257,7 @@ func ComputeCellsAndProofsFromStructured(blobsAndProofs []*pb.BlobAndProofV2) ([ return nil, errors.Wrap(err, "compute cells") } - kzgProofs := make([]kzg.Proof, 0, numberOfColumns*kzg.BytesPerProof) + kzgProofs := make([]kzg.Proof, 0, numberOfColumns) for _, kzgProofBytes := range blobAndProof.KzgProofs { if len(kzgProofBytes) != kzg.BytesPerProof { return nil, errors.New("wrong KZG proof size - should never happen") diff --git a/beacon-chain/core/peerdas/reconstruction_test.go b/beacon-chain/core/peerdas/reconstruction_test.go index de2791f9e8..88fe79d178 100644 --- a/beacon-chain/core/peerdas/reconstruction_test.go +++ b/beacon-chain/core/peerdas/reconstruction_test.go @@ -441,6 +441,7 @@ func TestComputeCellsAndProofsFromStructured(t *testing.T) { for i := range blobCount { require.Equal(t, len(expectedCellsAndProofs[i].Cells), len(actualCellsAndProofs[i].Cells)) require.Equal(t, len(expectedCellsAndProofs[i].Proofs), len(actualCellsAndProofs[i].Proofs)) + require.Equal(t, len(expectedCellsAndProofs[i].Proofs), cap(actualCellsAndProofs[i].Proofs)) // Compare cells for j, expectedCell := range expectedCellsAndProofs[i].Cells { diff --git a/changelog/marcopolo_push-nxynxywxtlpo.md b/changelog/marcopolo_push-nxynxywxtlpo.md new file mode 100644 index 0000000000..f450494aa7 --- /dev/null +++ b/changelog/marcopolo_push-nxynxywxtlpo.md @@ -0,0 +1,2 @@ +### Ignored +- Fix (unreleased) bug where the preallocated slice for KZG Proofs was 48x bigger than it needed to be.