Skip to content

Conversation

sebastianst
Copy link
Member

@sebastianst sebastianst commented Mar 10, 2025

Description

Adds specs for the upgrade gas feature of Isthmus, plus a new rule for omission of user transactions in upgrade blocks, which is so far only implemented in the op-node sequencer as a policy, not a consensus rule.

Additional context

See ethereum-optimism/optimism#14649

Note that upgrade gas is necessary because the system transaction max gas is only 1 Mio and upgrade transactions in total now tend to consume more, like 3.x Mio gas for Isthmus (plus there's the L1 info deposit, which only consumes 44k currently though). The only constraint by the protocol on the gas limit is: maxResourceLimit (user deposit gas, usually 2e7) + systemTxMaxGas (L1 info deposit and upgrade txs (so far), usually 1e6) <= gasLimit

This version of the specs always adds the upgrade gas, which is the total sum of all upgrade transactions' gas limits, to the block gas limit. We could implement an alternative rule where we only update the gas limit of the block if it is smaller than system transaction max gas + max resource limit + upgrade gas. This would have the property that this rule would effectively not alter the block gas limit of chains with typical gas limits (e.g. 60 Mio for OP mainnet) for Isthmus, which needs < 4 Mio upgrade gas (+20 Mio max resource +1 Mio system tx max gas).

To clarify, this change is only necessary because we allow small gas limits. Chains with typical gas limits like OPM wouldn't need this rule.

Metadata

Closes #609

Copy link
Contributor

@ajsutton ajsutton left a comment

Choose a reason for hiding this comment

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

I'm in favour of always adding the upgrade gas - it's so easy to forget otherwise. As long as L2 user transactions are not included, the increased gas limit is safe unless the upgrade transactions themselves are insanely expensive to execute in fault proofs which is extremely unlikely.

Comment on lines +40 to +46
## Omission of user transactions

Starting with Isthmus, network upgrade blocks must not contain any non-deposit transactions, to
avoid any unintended interplay of user transactions with upgrade transactions.

This is checked at the batch stage. So if a batch of an upgrade block is not empty, it is considered
invalid and the rules for dropped batches apply.
Copy link
Contributor

Choose a reason for hiding this comment

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

Why only omit non-deposit transactions? And why do we need both "upgrade gas" and "omission of user transactions"? It sounds like either of them alone would mitigate the issue

Copy link
Contributor

Choose a reason for hiding this comment

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

You can't omit deposit transactions - they must be included as part of the censorship resistance. Skipping user transactions removes the risk that the upgrade transactions don't use their full gas limit, leaving a higher than usual remaining block gas limit which could then be filled by particularly expensive L2 user transactions (ie calling precompiles that are expensive to execute in cannon). This way we know that the L1 deposit transactions have a fixed gas limit as usual (enforced on L1) and the potentially increased total gas limit is only usable by the upgrade transactions which we control so know they are fault provable.

Copy link
Member Author

@sebastianst sebastianst Mar 11, 2025

Choose a reason for hiding this comment

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

"Omission of user tx" only buys you the remainder of the block gas limit, which can be zero because the only guarantee is that maxResourceLimit + systemTxMaxGas <= gasLimit so it can be equal to the left side, which could in theory be fully exhausted.
And actually, user tx omission doesn't help at all really, because user txs are executed after all deposit txs are executed. So user txs don't pose a risk to the execution of upgrade deposit txs.

@sebastianst sebastianst marked this pull request as ready for review March 11, 2025 16:22
@sebastianst
Copy link
Member Author

Moving out of draft as I got a 👍🏻 from @ajsutton on the specified design variant to always add the upgrade gas.

@sebastianst
Copy link
Member Author

Moving back into draft as we'll probably not include this in Isthmus.

@sebastianst sebastianst marked this pull request as draft March 12, 2025 10:34
@sebastianst sebastianst self-assigned this Mar 13, 2025
@tynes tynes added the S-wontfix Status: issue won't be fixed as result of deliberate design decision label Mar 19, 2025
@tynes
Copy link
Contributor

tynes commented Apr 18, 2025

Closing this as we are not shipping this

@tynes tynes closed this Apr 18, 2025
@teddyknox
Copy link
Contributor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-wontfix Status: issue won't be fixed as result of deliberate design decision
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Upgrade block rules specs
5 participants