Skip to content

Commit

Permalink
fixup! BlobSidecarsByRoot RPC handler
Browse files Browse the repository at this point in the history
  • Loading branch information
kasey committed Jun 6, 2023
1 parent a647024 commit 6c95c4b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions beacon-chain/sync/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ go_library(
"//cache/lru:go_default_library",
"//cmd/beacon-chain/flags:go_default_library",
"//config/features:go_default_library",
"//config/fieldparams:go_default_library",
"//config/params:go_default_library",
"//consensus-types/blocks:go_default_library",
"//consensus-types/interfaces:go_default_library",
Expand Down
8 changes: 4 additions & 4 deletions beacon-chain/sync/blobs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ func generateTestBlockWithSidecars(t *testing.T, parent [32]byte, slot types.Slo
Timestamp: 0,
ExtraData: make([]byte, 0),
BaseFeePerGas: bytesutil.PadTo([]byte("baseFeePerGas"), fieldparams.RootLength),
ExcessDataGas: bytesutil.PadTo([]byte("excessDataGas"), fieldparams.RootLength),
ExcessDataGas: 0,
BlockHash: blockHash[:],
Transactions: encodedBinaryTxs,
}
Expand Down Expand Up @@ -163,7 +163,7 @@ func (c *blobsTestCase) setup(t *testing.T) (*Service, []*ethpb.BlobSidecar, fun
cleanup := func() {
require.NoError(t, undo())
}
maxBlobs := int(params.BeaconConfig().MaxBlobsPerBlock)
maxBlobs := fieldparams.MaxBlobsPerBlock
chain, clock := defaultMockChain(t)
if c.chain == nil {
c.chain = chain
Expand Down Expand Up @@ -201,7 +201,7 @@ func (c *blobsTestCase) setup(t *testing.T) (*Service, []*ethpb.BlobSidecar, fun
rateLimiter: newRateLimiter(client),
}

byRootRate := params.BeaconNetworkConfig().MaxRequestBlobsSidecars * params.BeaconConfig().MaxBlobsPerBlock
byRootRate := params.BeaconNetworkConfig().MaxRequestBlobsSidecars * fieldparams.MaxBlobsPerBlock
s.setRateCollector(p2p.RPCBlobSidecarsByRootTopicV1, leakybucket.NewCollector(0.000001, int64(byRootRate), time.Second, false))

return s, sidecars, cleanup
Expand Down Expand Up @@ -318,7 +318,7 @@ func TestRoundTripDenebSave(t *testing.T) {
c.clock = clock
oldest, err := slots.EpochStart(blobMinReqEpoch(c.chain.FinalizedCheckPoint.Epoch, slots.ToEpoch(c.clock.CurrentSlot())))
require.NoError(t, err)
maxBlobs := int(params.BeaconConfig().MaxBlobsPerBlock)
maxBlobs := fieldparams.MaxBlobsPerBlock
block, bsc := generateTestBlockWithSidecars(t, parentRoot, oldest, maxBlobs)
require.Equal(t, len(block.Block.Body.BlobKzgCommitments), len(bsc))
require.Equal(t, maxBlobs, len(bsc))
Expand Down

0 comments on commit 6c95c4b

Please sign in to comment.