feat(cast): extend call block overrides#15745
Conversation
Expose gas limit, fee recipient, base fee, and blob base fee overrides for cast call. Forward state and block overrides consistently through eth_call, debug_traceCall, local traces, and generated curl requests while using execution-client RPC field names.
| ); | ||
|
|
||
| /// Sets the blob gas price directly. | ||
| fn set_blob_gasprice(&mut self, _blob_gasprice: u128) {} |
There was a problem hiding this comment.
Could TempoBlockEnv implement the new blob-gas-price setter instead of using the default no-op? With a Tempo test node, cast call --block.blob-base-fee 4660 returns 4660, while the same call with --trace returns 1. A Tempo parity test would catch this.
| // execute with the configured environments in that case. | ||
| let call_env = preserve_block_base_fee.then(|| { | ||
| let mut evm_env = executor.evm_env().clone(); | ||
| evm_env.cfg_env.disable_balance_check = true; |
There was a problem hiding this comment.
Could this call environment also disable REVM’s base-fee check? With --block.base-fee 100 --gas-price 2, the regular call succeeds and returns 100, while the same call with --trace fails with gas price is less than basefee. A regression test for this case would be useful.
|
|
||
| let trace = match (tx_kind, call_env) { | ||
| (TxKind::Create, Some((evm_env, tx_env))) => { | ||
| let deploy_result = executor.deploy_with_env(evm_env, tx_env, None)?; |
There was a problem hiding this comment.
Could this branch preserve traces from reverting constructors like the non-override path does? cast call --trace --create 0x60006000fd renders the CREATE/Revert trace, while adding --block.base-fee 0 exits with execution reverted without rendering it. Using TraceResult::try_from around deploy_with_env should retain the failed deployment trace, and a regression test for this case would be useful.
grandizzy
left a comment
There was a problem hiding this comment.
Request changes: The RPC paths look good, but local trace parity still has unresolved block-environment issues. In addition to the existing comments, --gas-limit overwrites --block.gas-limit; please preserve the block environment independently and add coverage for this combination.
| let preserve_block_base_fee = | ||
| block_overrides.as_ref().is_some_and(|overrides| overrides.base_fee.is_some()); |
There was a problem hiding this comment.
Could this env-preserving path also cover block gas-limit overrides? Otherwise transact_raw copies Executor.gas_limit into the block environment, so --gas-limit overwrites --block.gas-limit.
| let preserve_block_base_fee = | |
| block_overrides.as_ref().is_some_and(|overrides| overrides.base_fee.is_some()); | |
| let preserve_block_base_fee = block_overrides.as_ref().is_some_and(|overrides| { | |
| overrides.base_fee.is_some() || overrides.gas_limit.is_some() | |
| }); |
Please also add a regression test combining --block.gas-limit 100000 with --gas-limit 5000000 and asserting that GASLIMIT returns 100000.
Adds block gas limit, fee recipient, base fee, and blob base fee options to
cast call, applying them consistently to regular calls, remote debug traces, local traces, and generated curl requests. Outbound block overrides use the execution-client field names, and ordinary curl requests now retain supplied state and block overrides.This change was developed with AI assistance.