Skip to content

Conversation

zerosnacks
Copy link
Member

@zerosnacks zerosnacks commented Aug 26, 2025

Motivation

Closes: #11348

Solution

Enforcing of tx gas limit is disabled by default as this is what users would expect, allow users to enforce the tx gas limit imposed by Osaka (EIP-7825). If there are further changes that change this tx gas limit we can make expand this to be EVM version specific.

Adds clarifying alias to block_gas_limit / disable_block_gas_limit to be block specific, retaining original alias for backwards compatibility

Breaking changes

Renamed TransactionExecutionOutcome::Exhausted => TransactionExecutionOutcome::BlockGasExhausted for clarity, expecting this to have no impact on regular users

PR Checklist

  • Added Tests
  • Added Documentation
  • Breaking changes

@zerosnacks zerosnacks changed the title chore: make enabling of tx_gas limit as enforced in Osaka possible feat(forge): loosen tx gas limit restrictions ahead of Osaka + make enforceable w/ --enable-tx-gas-limit Aug 26, 2025
@@ -265,6 +265,7 @@ impl CallArgs {

// modify settings that usually set in eth_call
env.evm_env.cfg_env.disable_block_gas_limit = true;
env.evm_env.cfg_env.tx_gas_limit_cap = Some(u64::MAX);
Copy link
Member Author

@zerosnacks zerosnacks Aug 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this makes sense to me, do not enforce tx gas limit when simulating the behavior of an eth_call

@@ -1558,6 +1559,7 @@ impl Backend {
// we want to disable this in eth_call, since this is common practice used by other node
// impls and providers <https://github.com/foundry-rs/foundry/issues/4388>
env.evm_env.cfg_env.disable_block_gas_limit = true;
env.evm_env.cfg_env.tx_gas_limit_cap = Some(u64::MAX);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here, makes sense to avoid enforcing a tx gas limit cap here

}

// check that we comply with the transaction's gas limit as imposed by Osaka (EIP-7825)
if env.evm_env.cfg_env.tx_gas_limit_cap.is_none()
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

feat(forge): loosen tx gas limit restrictions ahead of Osaka + make enforceable w/ --enable-tx-gas-limit
1 participant