mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2024-12-25 12:57:18 +00:00
Adds BlockBatchLimitBurstFactor flag (#5825)
* adds BlockBatchLimitBurstFactor flag * Merge branch 'master' into burst-factor-flag
This commit is contained in:
parent
79ce15df63
commit
baf9ec60eb
@ -124,6 +124,12 @@ var (
|
||||
Usage: "The amount of blocks the local peer is bounded to request and respond to in a batch.",
|
||||
Value: 64,
|
||||
}
|
||||
// BlockBatchLimitBurstFactor specifies the factor by which block batch size may increase.
|
||||
BlockBatchLimitBurstFactor = &cli.IntFlag{
|
||||
Name: "block-batch-limit-burst-factor",
|
||||
Usage: "The factor by which block batch limit may increase on burst.",
|
||||
Value: 10,
|
||||
}
|
||||
// EnableDebugRPCEndpoints as /v1/beacon/state.
|
||||
EnableDebugRPCEndpoints = &cli.BoolFlag{
|
||||
Name: "enable-debug-rpc-endpoints",
|
||||
|
@ -19,6 +19,7 @@ type GlobalFlags struct {
|
||||
MaxPageSize int
|
||||
DeploymentBlock int
|
||||
BlockBatchLimit int
|
||||
BlockBatchLimitBurstFactor int
|
||||
}
|
||||
|
||||
var globalConfig *GlobalFlags
|
||||
@ -59,6 +60,7 @@ func ConfigureGlobalFlags(ctx *cli.Context) {
|
||||
cfg.DisableDiscv5 = true
|
||||
}
|
||||
cfg.BlockBatchLimit = ctx.Int(BlockBatchLimit.Name)
|
||||
cfg.BlockBatchLimitBurstFactor = ctx.Int(BlockBatchLimitBurstFactor.Name)
|
||||
cfg.MaxPageSize = ctx.Int(RPCMaxPageSize.Name)
|
||||
cfg.DeploymentBlock = ctx.Int(ContractDeploymentBlock.Name)
|
||||
configureMinimumPeers(ctx, cfg)
|
||||
|
@ -41,6 +41,7 @@ var appFlags = []cli.Flag{
|
||||
flags.UnsafeSync,
|
||||
flags.DisableDiscv5,
|
||||
flags.BlockBatchLimit,
|
||||
flags.BlockBatchLimitBurstFactor,
|
||||
flags.InteropMockEth1DataVotesFlag,
|
||||
flags.InteropGenesisStateFlag,
|
||||
flags.InteropNumValidatorsFlag,
|
||||
|
@ -110,7 +110,7 @@ type Service struct {
|
||||
func NewRegularSync(cfg *Config) *Service {
|
||||
// Intialize block limits.
|
||||
allowedBlocksPerSecond = float64(flags.Get().BlockBatchLimit)
|
||||
allowedBlocksBurst = int64(10 * allowedBlocksPerSecond)
|
||||
allowedBlocksBurst = int64(flags.Get().BlockBatchLimitBurstFactor * flags.Get().BlockBatchLimit)
|
||||
|
||||
ctx, cancel := context.WithCancel(context.Background())
|
||||
r := &Service{
|
||||
|
@ -96,6 +96,7 @@ var appHelpFlagGroups = []flagGroup{
|
||||
flags.SlotsPerArchivedPoint,
|
||||
flags.DisableDiscv5,
|
||||
flags.BlockBatchLimit,
|
||||
flags.BlockBatchLimitBurstFactor,
|
||||
flags.EnableDebugRPCEndpoints,
|
||||
},
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user