File tree Expand file tree Collapse file tree 5 files changed +11
-1
lines changed Expand file tree Collapse file tree 5 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -124,6 +124,12 @@ var (
124
124
Usage : "The amount of blocks the local peer is bounded to request and respond to in a batch." ,
125
125
Value : 64 ,
126
126
}
127
+ // BlockBatchLimitBurstFactor specifies the factor by which block batch size may increase.
128
+ BlockBatchLimitBurstFactor = & cli.IntFlag {
129
+ Name : "block-batch-limit-burst-factor" ,
130
+ Usage : "The factor by which block batch limit may increase on burst." ,
131
+ Value : 10 ,
132
+ }
127
133
// EnableDebugRPCEndpoints as /v1/beacon/state.
128
134
EnableDebugRPCEndpoints = & cli.BoolFlag {
129
135
Name : "enable-debug-rpc-endpoints" ,
Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ type GlobalFlags struct {
19
19
MaxPageSize int
20
20
DeploymentBlock int
21
21
BlockBatchLimit int
22
+ BlockBatchLimitBurstFactor int
22
23
}
23
24
24
25
var globalConfig * GlobalFlags
@@ -59,6 +60,7 @@ func ConfigureGlobalFlags(ctx *cli.Context) {
59
60
cfg .DisableDiscv5 = true
60
61
}
61
62
cfg .BlockBatchLimit = ctx .Int (BlockBatchLimit .Name )
63
+ cfg .BlockBatchLimitBurstFactor = ctx .Int (BlockBatchLimitBurstFactor .Name )
62
64
cfg .MaxPageSize = ctx .Int (RPCMaxPageSize .Name )
63
65
cfg .DeploymentBlock = ctx .Int (ContractDeploymentBlock .Name )
64
66
configureMinimumPeers (ctx , cfg )
Original file line number Diff line number Diff line change @@ -41,6 +41,7 @@ var appFlags = []cli.Flag{
41
41
flags .UnsafeSync ,
42
42
flags .DisableDiscv5 ,
43
43
flags .BlockBatchLimit ,
44
+ flags .BlockBatchLimitBurstFactor ,
44
45
flags .InteropMockEth1DataVotesFlag ,
45
46
flags .InteropGenesisStateFlag ,
46
47
flags .InteropNumValidatorsFlag ,
Original file line number Diff line number Diff line change @@ -110,7 +110,7 @@ type Service struct {
110
110
func NewRegularSync (cfg * Config ) * Service {
111
111
// Intialize block limits.
112
112
allowedBlocksPerSecond = float64 (flags .Get ().BlockBatchLimit )
113
- allowedBlocksBurst = int64 (10 * allowedBlocksPerSecond )
113
+ allowedBlocksBurst = int64 (flags . Get (). BlockBatchLimitBurstFactor * flags . Get (). BlockBatchLimit )
114
114
115
115
ctx , cancel := context .WithCancel (context .Background ())
116
116
r := & Service {
Original file line number Diff line number Diff line change @@ -96,6 +96,7 @@ var appHelpFlagGroups = []flagGroup{
96
96
flags .SlotsPerArchivedPoint ,
97
97
flags .DisableDiscv5 ,
98
98
flags .BlockBatchLimit ,
99
+ flags .BlockBatchLimitBurstFactor ,
99
100
flags .EnableDebugRPCEndpoints ,
100
101
},
101
102
},
You can’t perform that action at this time.
0 commit comments