foundry
foundry copied to clipboard
bug(`anvil`): `--disable-block-gas-limit` vs `--gas-limit`
Component
Anvil
Have you ensured that all of these are up to date?
- [X] Foundry
- [X] Foundryup
What version of Foundry are you on?
forge 0.2.0 (d28a337 2024-08-27T00:20:10.476146991Z)
What command(s) is the bug in?
No response
Operating System
Linux
Describe the bug
- When on a fork, for view calls,
--gas-limit=99...99doesn't work but--disable-block-gas-limitworks. - When not on a fork,
--disable-block-gas-limitdoesn't work but--gas-limit=99...99works.
By works, I mean, doesn't revert EVM error OutOfGas.
setup_fork_db_config()ignoresNodeConfig.gas_limithttps://github.com/foundry-rs/foundry/blob/2442e7a5fc165d7d0b022aa8b9f09dcdf675157b/crates/anvil/src/config.rs#L1141setup()only usesNodeConfig.gas_limitbut passesdisable_block_gas_limittoCfgEnvWithHandlerCfghttps://github.com/foundry-rs/foundry/blob/2442e7a5fc165d7d0b022aa8b9f09dcdf675157b/crates/anvil/src/config.rs#L949-L959- not clear if
disable_block_gas_limitprop is used anywhere infoundry_evmhttps://github.com/foundry-rs/foundry/blob/2442e7a5fc165d7d0b022aa8b9f09dcdf675157b/crates/evm/evm/src/executors/builder.rs#L84