Skip to content

op-node/rollup/derive: Implement upgrade gas & upgrade block user tx omission#14797

Closed
sebastianst wants to merge 2 commits intodevelopfrom
seb/upgrade-gas
Closed

op-node/rollup/derive: Implement upgrade gas & upgrade block user tx omission#14797
sebastianst wants to merge 2 commits intodevelopfrom
seb/upgrade-gas

Conversation

@sebastianst
Copy link
Member

Description

This PR implements Upgrade Gas and the omission of user transactions in upgrade blocks per the specs at ethereum-optimism/specs#616

Tests

Added proofs action test of both features, plus unit tests for invalid batches. The omission of user tx by the sequencer is also covered by the action test.

Additional context

Metadata

Closes #14649

@codecov
Copy link

codecov bot commented Mar 11, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 81.71%. Comparing base (ac1f32d) to head (b03b5ce).
Report is 239 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff              @@
##           develop   #14797       +/-   ##
============================================
+ Coverage    46.95%   81.71%   +34.75%     
============================================
  Files         1049      174      -875     
  Lines        90854    10165    -80689     
============================================
- Hits         42660     8306    -34354     
+ Misses       45063     1691    -43372     
+ Partials      3131      168     -2963     
Flag Coverage Δ
cannon-go-tests-32 62.08% <ø> (-2.00%) ⬇️
cannon-go-tests-64 57.13% <ø> (-1.64%) ⬇️
contracts-bedrock-tests 94.40% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

see 883 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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.

LGTM.

}

func (s *L2Sequencer) ActBuildL2ToFork(t Testing, fork rollup.ForkName) {
// TODO: add check that fork is set in rollup config
Copy link
Contributor

Choose a reason for hiding this comment

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

We should either do this or reference an issue for it. Probably a simple require could be added here since we have t already.

dp.DeployConfig.ActivateForkAtGenesis(rollup.Holocene)
case Isthmus:
// Isthmus usually runs on a Prague L1 network
dp.DeployConfig.L1PragueTimeOffset = &genesisBlock
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there a helper method we already have that would ensure all the Hardforks before Prague are also enabled?

Copy link
Member Author

Choose a reason for hiding this comment

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

L1 Cancun is enabled by default. So that's currently the only L1 fork that needs to be enabled manually.

Comment on lines +580 to +581
Name: "transactions in Interop upgrade block",
L1Blocks: []eth.L1BlockRef{l1A, l1B, l1C},
Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder if we can create these automatically so we pick up new forks. We have the list of hard forks already and we could iterate through them, then for each check that they forbid user transactions unless they're in a list that explicitly allows it. Then if we add a new fork, as long as we add it to the list of forks this test will remind us to update the if statement in batches.go and prevent user transactions (or add it to the allow list if it doesn't have upgrade tx). Otherwise I can see us forgetting that.

Copy link
Member Author

Choose a reason for hiding this comment

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

Good idea, I was thinking of actually running the whole upgrade block action tests for all forks from Isthmus. But then, as you can see with the commented out code, it just failed for Interop, so I didn't follow up with this idea. Will do this in the batches tests and track it for Interop.

Comment on lines +32 to +36
) //.AddDefaultTestCases(
// upgradeBlockTestCfg{fork: rollup.Interop, numUpgradeTxs: 0},
// helpers.NewForkMatrix(helpers.Isthmus),
// testUpgradeBlock,
// )
Copy link
Contributor

@ajsutton ajsutton Mar 11, 2025

Choose a reason for hiding this comment

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

nit: Can probably remove the commented out code.

Comment on lines +90 to +94
) //.AddDefaultTestCases(
// upgradeBlockTestCfg{fork: rollup.Interop, numUpgradeTxs: 0},
// helpers.NewForkMatrix(helpers.Isthmus),
// testUpgradeBlockTxOmission,
// )
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: Uncomment or remove.

},
Expected: BatchDrop, // dropped because it could have advanced the epoch to B
},
{
Copy link
Contributor

Choose a reason for hiding this comment

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

Haven't looked at all batches tests, but in case you don't, I think it'd be worthwhile to add a test here that covers the happy path when there are no txs in the activation block to confirm this still works as intended.

Copy link
Member Author

Choose a reason for hiding this comment

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

good idea

@sebastianst
Copy link
Member Author

Moved back into draft as we'll probably move this out of Isthmus.

@sebastianst sebastianst changed the title op-node/rollup/derive: Implement Isthmus upgrade gas & upgrade block user tx omission op-node/rollup/derive: Implement upgrade gas & upgrade block user tx omission Mar 13, 2025
@tynes
Copy link
Contributor

tynes commented Mar 13, 2025

There is general consensus that this is not going into isthmus

@opgitgovernance opgitgovernance added the S-stale Status: Will be closed unless there is activity label Mar 28, 2025
@opgitgovernance
Copy link
Contributor

This pr has been automatically marked as stale and will be closed in 5 days if no updates

@tynes tynes closed this Apr 8, 2025
@tynes
Copy link
Contributor

tynes commented Apr 8, 2025

We ultimately decided to not take this approach

Copy link
Contributor

@maurelian maurelian Dec 9, 2025

Choose a reason for hiding this comment

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

Commenting here to have an easy to link for "how to increase gas for a single deposit block", as discussed in the L2 upgrades design doc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-stale Status: Will be closed unless there is activity

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Upgrade gas & upgrade block transaction omission

6 participants