reth
reth copied to clipboard
Make RPC gas cap configurable
Describe the feature
In https://github.com/paradigmxyz/reth/pull/3260 we started limiting the eth_call and call tracing RPC methods' gas limits using the constant value of 30_000_000 gas. This value should be configurable via both the CLI and config options rpc_gas_cap with the default value of 30_000_000.
Additional context
No response
Hi, I'd like to work on this :)
You said the default value should be 50_000_000 but it is set to 30_000_000 in the code. Should we update the value?
@leovct oops, that's my typo, changed to 30_000_000. Assigned you, thanks!
While working on it, I noticed that there's a similar issue already opened: https://github.com/paradigmxyz/reth/issues/3233. Is this the case or am I mistaken?
While working on it, I noticed that there's a similar issue already opened: #3233. Is this the case or am I mistaken?
It is related, but not the same. We may want to set the default value for rpc_gas_cap via the ChainSpec mentioned in #3233, but as it's not ready now, you can proceed with just using the ETHEREUM_BLOCK_GAS_LIMIT constant.
@leovct any help needed on that issue? Don't hesitate to ask any questions.
@leovct any help needed on that issue? Don't hesitate to ask any questions.
Yeah, I'm a bit stuck at the moment... I managed to add a new argument called rpc-gas-cap in bin/reth/src/args/rpc_server_args.rs and I updated the reth node book reference.
$ cargo run -- node --help
Start the node
Usage: reth node [OPTIONS]
...
RPC:
...
--rpc-gas-cap <RPC_GAS_CAP>
Maximum gas limit for `eth_call` and call tracing RPC methods
[default: 30000000]
But I can't figure out how to use this value in crates/rpc/rpc/src/eth/revm_utils.rs. I'm not familiar enough with the repository at the moment (and I'm still learning Rust) so I don't know where to look at... Any hints or doc that might help me? :)
edit: also related to the config, I'm wondering where I should add the new rpc_gas_cap field. HeadersConfig? ExecutionConfig? or somewhere else entirely?