Skip to content

Commit

Permalink
Merge branch 'develop' into clean-up-tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Inspector-Butters authored Feb 6, 2025
2 parents 8a6d832 + 3439122 commit b94baf7
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 9 deletions.
4 changes: 2 additions & 2 deletions beacon-chain/core/electra/churn_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
}

Expand Down
5 changes: 2 additions & 3 deletions beacon-chain/db/kv/blocks_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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"
)

Expand Down
7 changes: 6 additions & 1 deletion beacon-chain/sync/rpc_blob_sidecars_by_range.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion beacon-chain/sync/sync_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
4 changes: 4 additions & 0 deletions changelog/nisdas_increase_electra_limits.md
Original file line number Diff line number Diff line change
@@ -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.
4 changes: 2 additions & 2 deletions cmd/beacon-chain/flags/base.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down

0 comments on commit b94baf7

Please sign in to comment.