Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Isthmus: Updates for L2 withdrawals root in header #12848

Draft
wants to merge 17 commits into
base: vd/isthmus-config
Choose a base branch
from

Conversation

vdamle
Copy link
Contributor

@vdamle vdamle commented Nov 6, 2024

Description

This PR proposes changes to add:

  • storage root of the L2ToL1MessagePasser contract to the ExecutionPayload.
  • a new p2p gossip topic (v4) for Isthmus blocks.
  • update the SSZ encoding & gossip to account for with withdrawalsRoot.
  • Leverages the config changes to add Isthmus hard fork in Config: Add support for Isthmus #12847

Tests

Are in a separate PR

Additional context

Addresses changes to Consensus Layer to support L2 withdrawals root in the block header, as outlined in #12044

Spec changes: ethereum-optimism/specs#394
EL changes:

Metadata

None.

@vdamle
Copy link
Contributor Author

vdamle commented Nov 6, 2024

@vdamle vdamle changed the title Config: Add support for Isthmus Isthmus: Updates for L2 withdrawals root in header Nov 6, 2024
* add withdrawalsRoot to ExecutionPayload.
* add a `BlocksV4` topic to p2p gossip and check for non-empty
  withdrawalsRoot on v4 topic.
* add checks for whether block is type v4 and apply relevant
  marshal/unmarshal for l2 withdrawals root.
* attributes check
* outputV0AtBlock api update
* minor type updates
and fixes for a few failures
when computing L2OutputRoot, no need to re-compute the storage root
if Isthmus is active.
* `RPCResponseCheck` is an interface that currently has a function
that validates withdrawals.
* There's an implementation of this interface for L1 and L2
* L1's response checker validates that the withdrawals list matches
  the root in the header.
* L2's response checker validates that the withdrawals list is empty
  when the withdrawalsRoot is not nil
will move to a separate PR
* test all combinations - with/without withdrawal transaction before, at and after isthmus
@vdamle vdamle force-pushed the vd/l2-withdrawals-root branch from fc6b673 to 79609ed Compare November 13, 2024 09:55
@@ -250,7 +250,7 @@ require (
rsc.io/tmplfunc v0.0.3 // indirect
)

replace github.com/ethereum/go-ethereum v1.14.11 => github.com/ethereum-optimism/op-geth v1.101411.1-rc.6
replace github.com/ethereum/go-ethereum v1.14.11 => ../op-geth
Copy link
Contributor Author

Choose a reason for hiding this comment

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

TODO - will be changed to use a commit tag, once the op-geth PR is approved/merged

Also fix a test in rollup, with the correct expectation for sepolia
holocene time
@vdamle vdamle mentioned this pull request Dec 3, 2024
30 tasks
@@ -386,6 +395,10 @@ func BuildBlocksValidator(log log.Logger, cfg *rollup.Config, runCfg GossipRunti
return pubsub.ValidationReject
}

if blockVersion.HasWithdrawalsRoot() && payload.WithdrawalsRoot == nil {
log.Warn("payload is on v4 topic, but has nil withdrawals root", "bad_hash", payload.BlockHash.String())
Copy link
Contributor Author

Choose a reason for hiding this comment

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

return error in addition to logging a warning here.

return nil
// checkWithdrawals checks if the withdrawals list and withdrawalsRoot are as expected in the attributes and block,
// based on the active hard fork.
func checkWithdrawals(rollupCfg *rollup.Config, attrs *eth.PayloadAttributes, block *eth.ExecutionPayload) error {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Can we simplify the expression of these conditions?

@vdamle vdamle force-pushed the vd/isthmus-config branch from 2449a55 to a011f49 Compare December 4, 2024 21:53
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.

1 participant