Set New Blob Limits For Electra (#14883)

* Set New Blob Limits For Electra

* Add Changelog

* Bump up blob limit
This commit is contained in:
Nishant Das
2025-02-07 00:53:39 +08:00
committed by GitHub
parent f6e5da6723
commit 3439122629
6 changed files with 17 additions and 9 deletions

View File

@@ -177,9 +177,9 @@ func TestComputeConsolidationEpochAndUpdateChurn(t *testing.T) {
require.NoError(t, err)
return s
}(t),
consolidationBalance: helpers.ConsolidationChurnLimit(32000000000000000)+1,
consolidationBalance: helpers.ConsolidationChurnLimit(32000000000000000) + 1,
expectedEpoch: 18, // Flows into another epoch.
expectedConsolidationBalanceToConsume: helpers.ConsolidationChurnLimit(32000000000000000)-1,
expectedConsolidationBalanceToConsume: helpers.ConsolidationChurnLimit(32000000000000000) - 1,
},
}

View File

@@ -3,15 +3,13 @@ package kv
import (
"context"
"fmt"
bolt "go.etcd.io/bbolt"
"testing"
"time"
"github.com/prysmaticlabs/prysm/v5/beacon-chain/state"
"github.com/ethereum/go-ethereum/common"
"github.com/pkg/errors"
"github.com/prysmaticlabs/prysm/v5/beacon-chain/db/filters"
"github.com/prysmaticlabs/prysm/v5/beacon-chain/state"
"github.com/prysmaticlabs/prysm/v5/config/params"
"github.com/prysmaticlabs/prysm/v5/consensus-types/blocks"
"github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces"
@@ -22,6 +20,7 @@ import (
"github.com/prysmaticlabs/prysm/v5/testing/assert"
"github.com/prysmaticlabs/prysm/v5/testing/require"
"github.com/prysmaticlabs/prysm/v5/testing/util"
bolt "go.etcd.io/bbolt"
"google.golang.org/protobuf/proto"
)

View File

@@ -144,9 +144,14 @@ func BlobRPCMinValidSlot(current primitives.Slot) (primitives.Slot, error) {
return slots.EpochStart(minStart)
}
// This function is used to derive what is the ideal block batch size we can serve
// blobs to the remote peer for. We compute the current limit which is the maximum
// blobs to be served to the peer every period. And then using the maximum blobs per
// block determine the block batch size satisfying this limit.
func blobBatchLimit(slot primitives.Slot) uint64 {
maxBlobsPerBlock := params.BeaconConfig().MaxBlobsPerBlock(slot)
return uint64(flags.Get().BlockBatchLimit / maxBlobsPerBlock)
maxPossibleBlobs := flags.Get().BlobBatchLimit * flags.Get().BlobBatchLimitBurstFactor
return uint64(maxPossibleBlobs / maxBlobsPerBlock)
}
func validateBlobsByRange(r *pb.BlobSidecarsByRangeRequest, current primitives.Slot) (rangeParams, error) {

View File

@@ -17,7 +17,7 @@ func TestMain(m *testing.M) {
flags.Init(&flags.GlobalFlags{
BlockBatchLimit: 64,
BlockBatchLimitBurstFactor: 10,
BlobBatchLimit: 8,
BlobBatchLimit: 32,
BlobBatchLimitBurstFactor: 2,
})
defer func() {

View File

@@ -0,0 +1,4 @@
### Changed
- Updated Blob-Batch-Limit to increase to 192 for electra.
- Updated Blob-Batch-Limit-Burst-Factor to increase to 3.
- Changed the derived batch limit when serving blobs.

View File

@@ -196,13 +196,13 @@ var (
BlobBatchLimit = &cli.IntFlag{
Name: "blob-batch-limit",
Usage: "The amount of blobs the local peer is bounded to request and respond to in a batch.",
Value: 64,
Value: 192,
}
// BlobBatchLimitBurstFactor specifies the factor by which blob batch size may increase.
BlobBatchLimitBurstFactor = &cli.IntFlag{
Name: "blob-batch-limit-burst-factor",
Usage: "The factor by which blob batch limit may increase on burst.",
Value: 2,
Value: 3,
}
// DisableDebugRPCEndpoints disables the debug Beacon API namespace.
DisableDebugRPCEndpoints = &cli.BoolFlag{