-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: make rpc gas cap configurable #3458
feat: make rpc gas cap configurable #3458
Conversation
Codecov Report
... and 9 files with indirect coverage changes
Flags with carried forward coverage won't be shown. Click here to find out more.
|
@@ -132,6 +135,10 @@ pub struct RpcServerArgs { | |||
#[arg(long, value_name = "COUNT", default_value_t = RPC_DEFAULT_MAX_TRACING_REQUESTS)] | |||
pub rpc_max_tracing_requests: u32, | |||
|
|||
/// Maximum gas limit for `eth_call` and call tracing RPC methods. | |||
#[arg(long = "rpc.gascap", value_name = "GAS_CAP", default_value_t = RPC_DEFAULT_GAS_CAP)] | |||
pub rpc_gas_cap: u64, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Next, to be able to use this parameter in EVM, we need to pass it to the RPC implementations in the same way as we do with max_log_per_response
in EthFilter
:
reth/crates/rpc/rpc-builder/src/lib.rs
Line 976 in a7f32db
self.config.eth.max_logs_per_response, |
So:
- Add
rpc_gas_cap
toEthConfig
. - Pass
EthConfig.rpc_gas_cap
toEthApi
,DebugApi
andTraceApi
. - Pass the gas cap to
prepare_call_env
via new function argument.
Co-authored-by: Alexey Shekhirin <a.shekhirin@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've added some finishing touches.
this PR only integrates a gascap value but doesn't use it yet.
will be done in followup, together with default to 50M
73cc56f
to
3930e81
Compare
3930e81
to
310ac8b
Compare
Co-authored-by: Alexey Shekhirin <a.shekhirin@gmail.com> Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
Co-authored-by: Alexey Shekhirin <a.shekhirin@gmail.com> Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
Resolves #3309
rpc-gas-cap
with default value set toETHEREUM_BLOCK_GAS_LIMIT
(=30_000_000
).rpc-gas-cap
in addition to the CLI arg