Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
nebula
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
exchain
nebula
Commits
0d7d2242
Commit
0d7d2242
authored
Dec 05, 2023
by
EvanJRichard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
op-node: Add config flag to set max number of concurrent L1 RPC requests.
op-e2e: Add a default value to this flag in L1 setup.
parent
bc9f742f
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
16 additions
and
0 deletions
+16
-0
setup.go
op-e2e/setup.go
+1
-0
flags.go
op-node/flags/flags.go
+7
-0
client.go
op-node/node/client.go
+7
-0
service.go
op-node/service.go
+1
-0
No files found.
op-e2e/setup.go
View file @
0d7d2242
...
@@ -814,6 +814,7 @@ func configureL1(rollupNodeCfg *rollupNode.Config, l1Node EthInstance) {
...
@@ -814,6 +814,7 @@ func configureL1(rollupNodeCfg *rollupNode.Config, l1Node EthInstance) {
RateLimit
:
0
,
RateLimit
:
0
,
BatchSize
:
20
,
BatchSize
:
20
,
HttpPollInterval
:
time
.
Millisecond
*
100
,
HttpPollInterval
:
time
.
Millisecond
*
100
,
MaxConcurrency
:
10
,
}
}
}
}
...
...
op-node/flags/flags.go
View file @
0d7d2242
...
@@ -100,6 +100,12 @@ var (
...
@@ -100,6 +100,12 @@ var (
Required
:
false
,
Required
:
false
,
Hidden
:
true
,
Hidden
:
true
,
}
}
L1RPCMaxConcurrency
=
&
cli
.
IntFlag
{
Name
:
"l1.max-concurrency"
,
Usage
:
"Maximum number of concurrent RPC requests to make to the L1 RPC provider."
,
EnvVars
:
prefixEnvVars
(
"L1_MAX_CONCURRENCY"
),
Value
:
10
,
}
L1RPCRateLimit
=
&
cli
.
Float64Flag
{
L1RPCRateLimit
=
&
cli
.
Float64Flag
{
Name
:
"l1.rpc-rate-limit"
,
Name
:
"l1.rpc-rate-limit"
,
Usage
:
"Optional self-imposed global rate-limit on L1 RPC requests, specified in requests / second. Disabled if set to 0."
,
Usage
:
"Optional self-imposed global rate-limit on L1 RPC requests, specified in requests / second. Disabled if set to 0."
,
...
@@ -295,6 +301,7 @@ var optionalFlags = []cli.Flag{
...
@@ -295,6 +301,7 @@ var optionalFlags = []cli.Flag{
L1RPCProviderKind
,
L1RPCProviderKind
,
L1RPCRateLimit
,
L1RPCRateLimit
,
L1RPCMaxBatchSize
,
L1RPCMaxBatchSize
,
L1RPCMaxConcurrency
,
L1HTTPPollInterval
,
L1HTTPPollInterval
,
L2EngineJWTSecret
,
L2EngineJWTSecret
,
VerifierL1Confs
,
VerifierL1Confs
,
...
...
op-node/node/client.go
View file @
0d7d2242
...
@@ -151,6 +151,9 @@ type L1EndpointConfig struct {
...
@@ -151,6 +151,9 @@ type L1EndpointConfig struct {
// BatchSize specifies the maximum batch-size, which also applies as L1 rate-limit burst amount (if set).
// BatchSize specifies the maximum batch-size, which also applies as L1 rate-limit burst amount (if set).
BatchSize
int
BatchSize
int
// MaxConcurrency specifies the maximum number of concurrent requests to the L1 RPC.
MaxConcurrency
int
// HttpPollInterval specifies the interval between polling for the latest L1 block,
// HttpPollInterval specifies the interval between polling for the latest L1 block,
// when the RPC is detected to be an HTTP type.
// when the RPC is detected to be an HTTP type.
// It is recommended to use websockets or IPC for efficient following of the changing block.
// It is recommended to use websockets or IPC for efficient following of the changing block.
...
@@ -167,6 +170,9 @@ func (cfg *L1EndpointConfig) Check() error {
...
@@ -167,6 +170,9 @@ func (cfg *L1EndpointConfig) Check() error {
if
cfg
.
RateLimit
<
0
{
if
cfg
.
RateLimit
<
0
{
return
fmt
.
Errorf
(
"rate limit cannot be negative"
)
return
fmt
.
Errorf
(
"rate limit cannot be negative"
)
}
}
if
cfg
.
MaxConcurrency
<
1
{
return
fmt
.
Errorf
(
"max concurrent requests cannot be less than 1, was %d"
,
cfg
.
MaxConcurrency
)
}
return
nil
return
nil
}
}
...
@@ -185,6 +191,7 @@ func (cfg *L1EndpointConfig) Setup(ctx context.Context, log log.Logger, rollupCf
...
@@ -185,6 +191,7 @@ func (cfg *L1EndpointConfig) Setup(ctx context.Context, log log.Logger, rollupCf
}
}
rpcCfg
:=
sources
.
L1ClientDefaultConfig
(
rollupCfg
,
cfg
.
L1TrustRPC
,
cfg
.
L1RPCKind
)
rpcCfg
:=
sources
.
L1ClientDefaultConfig
(
rollupCfg
,
cfg
.
L1TrustRPC
,
cfg
.
L1RPCKind
)
rpcCfg
.
MaxRequestsPerBatch
=
cfg
.
BatchSize
rpcCfg
.
MaxRequestsPerBatch
=
cfg
.
BatchSize
rpcCfg
.
MaxConcurrentRequests
=
cfg
.
MaxConcurrency
return
l1Node
,
rpcCfg
,
nil
return
l1Node
,
rpcCfg
,
nil
}
}
...
...
op-node/service.go
View file @
0d7d2242
...
@@ -129,6 +129,7 @@ func NewL1EndpointConfig(ctx *cli.Context) *node.L1EndpointConfig {
...
@@ -129,6 +129,7 @@ func NewL1EndpointConfig(ctx *cli.Context) *node.L1EndpointConfig {
RateLimit
:
ctx
.
Float64
(
flags
.
L1RPCRateLimit
.
Name
),
RateLimit
:
ctx
.
Float64
(
flags
.
L1RPCRateLimit
.
Name
),
BatchSize
:
ctx
.
Int
(
flags
.
L1RPCMaxBatchSize
.
Name
),
BatchSize
:
ctx
.
Int
(
flags
.
L1RPCMaxBatchSize
.
Name
),
HttpPollInterval
:
ctx
.
Duration
(
flags
.
L1HTTPPollInterval
.
Name
),
HttpPollInterval
:
ctx
.
Duration
(
flags
.
L1HTTPPollInterval
.
Name
),
MaxConcurrency
:
ctx
.
Int
(
flags
.
L1RPCMaxConcurrency
.
Name
),
}
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment