Skip to content

Ensuring sufficient gas for L1 determinism#232

Merged
Jinglan merged 3 commits intomasterfrom
feat/YAS562/ensure-sufficient-gas
Aug 27, 2020
Merged

Ensuring sufficient gas for L1 determinism#232
Jinglan merged 3 commits intomasterfrom
feat/YAS562/ensure-sufficient-gas

Conversation

@ben-chain
Copy link
Collaborator

Description

This ticket was originally to cover preventing max call depth inconsistency between L1 and L2. However, it turns out due to EIP 150, there is already an implicit upper bound on the call stack due to an exponential dropoff of max allottable gas per CALL.

This ticket enforces that sufficient gas is provided to the fraud proof so that EIP150 does not allow for multiple execution results based on input gas.

Note: this logic might be better off directly within executeTransaction (would remove the need for MAX_EXECUTE_TRANSACTION_OVERHEAD in STioner), but that breaks a ton of tests. We can revisit next time tests get an overhaul.

Metadata

Fixes

  • Fixes YAS 562

Contributing Agreement

Copy link

@willmeister willmeister left a comment

Choose a reason for hiding this comment

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

Looks good!

Will want to move away from the hard-coded max, but working > not working. Ship it 🚢

uint gasLeft = gasleft();
require(
gasLeft > ((_transactionData.gasLimit + MAX_EXECUTE_TRANSACTION_GAS_OVERHEAD + 10000) * 64 / 63),
"Insufficient gas supplied to ensure L1 execution will not run out of gas before OVM transaction gas limit."

Choose a reason for hiding this comment

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

Would change the error message or add a comment specifically saying why the 63/64 logic is in there (maybe with a link?)

@Jinglan Jinglan merged commit 775af3a into master Aug 27, 2020
@gakonst gakonst deleted the feat/YAS562/ensure-sufficient-gas branch March 18, 2021 15:02
bap2pecs pushed a commit to babylonlabs-io/optimism that referenced this pull request Jul 31, 2024
xibao-nr pushed a commit to node-real/combo-optimism that referenced this pull request Feb 19, 2025
theochap pushed a commit that referenced this pull request Dec 10, 2025
Implements several more hint routes in the host program
Zena-park added a commit to tokamak-network/optimism that referenced this pull request Dec 30, 2025
Zena-park added a commit to tokamak-network/optimism that referenced this pull request Dec 30, 2025
theochap pushed a commit that referenced this pull request Jan 15, 2026
### Description

Adds an examples for transforming `Frame`s into `Batch`es and the
reverse.
emhane pushed a commit that referenced this pull request Feb 3, 2026
Fixes #225 (does not track errors as these are fatal currently)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants