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

L2: validate block that's being verified in OnChainProposer #2203

Open
Tracked by #2142
xqft opened this issue Mar 11, 2025 · 0 comments
Open
Tracked by #2142

L2: validate block that's being verified in OnChainProposer #2203

xqft opened this issue Mar 11, 2025 · 0 comments
Labels
L2 Rollup client

Comments

@xqft
Copy link
Contributor

xqft commented Mar 11, 2025

The block execution proof proves that a block B was produced, which transforms an initial state S into a final state S', so it proves the statement: S' = f(S, B), where f is the block execution algorithm of ethrex. All of the data (S, B, S') are private inputs of the execution program, but the program exposes the digest of S (initial state root) and of S` (final state root) as public inputs.

Currently the verify() function does not check anything about these public inputs, so it verifies any block no matter if it's the one expected or not. It takes a blockNumber parameter but also doesn't checks it. Also it doesn't keep into account the latest validated state of the L2.

We need to:

  1. Store the current state root in the contract's storage
  2. In the verify() function:
    1. Replace the blockNumber parameter with new_state_root
    2. Check that current_state_root and new_state_root are the public inputs of the proof (initial and final)
    3. Update current_state_root = new_state_root if the verification succeeds.
@xqft xqft added the L2 Rollup client label Mar 11, 2025
@xqft xqft added this to ethrex_l2 Mar 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
L2 Rollup client
Projects
Status: No status
Status: No status
Development

No branches or pull requests

1 participant