feat(l2): commit blocks in batches#2397
Merged
Merged
Conversation
Lines of code reportTotal lines added: Detailed view |
added 11 commits
April 3, 2025 18:13
54a1e03 to
3af5fc3
Compare
Closed
5f1ff8e to
25ec922
Compare
7a90f20 to
2facbef
Compare
fb8f0b2 to
1eeb1eb
Compare
jrchatruc
approved these changes
Apr 28, 2025
ManuelBilbao
approved these changes
Apr 29, 2025
pedrobergamini
pushed a commit
to pedrobergamini/ethrex
that referenced
this pull request
Aug 24, 2025
**Motivation** In lambdaclass#2397, we are having issues with Pico dependencies. Since we are not using it at the moment, we prefer to temporarily disable the job until we focus on it later. **Description** - Disable pico job renaming `pr-main_l2_prover_nightly.yaml` to `.github/workflows/pr-main_l2_prover_nightly.yaml.disabled`. - Create lambdaclass#2550. Closes None
pedrobergamini
pushed a commit
to pedrobergamini/ethrex
that referenced
this pull request
Aug 24, 2025
**Motivation** To reduce the number of times we go to the L1 to commit/verify blocks. **Description** - Modifies `l1_committer` to merge as many blocks as possible into a single `StateDiff` before committing, limited by the blob size. - Modifies `StateDiff` to now contain both the resulting `AccountUpdates` from executing all blocks in the batch and the header of the last block. - Adapts contracts to use `batchNumbers` instead of `blockNumbers`. - Adds a new RPC endpoint, `ethrex_getWithdrawalProof`, which returns all necessary data to claim an L1 withdrawal for a given L2 withdrawal transaction hash. - Implements `apply_account_updates` for the `ExecutionDB` to prepare the db for executing the next block in the batch. - Adds a `L2/storage` with the following tables: - `block_number` => `batch_number`: Maps block numbers to batches (used by the endpoint to locate a withdrawal's batch). - `batch_number` => `Vec<block_number>`: Lists all block numbers included in a given batch. - `batch_number` => `withdrawal_hashes`: Stores withdrawal hashes per batch (used to construct merkle proofs). Closes None Created issues: - lambdaclass#2563 - lambdaclass#2578 - lambdaclass#2579 - lambdaclass#2617 --------- Co-authored-by: Edgar <git@edgl.dev> Co-authored-by: VolodymyrBg <aqdrgg19@gmail.com> Co-authored-by: Tomás Paradelo <112426153+tomip01@users.noreply.github.com> Co-authored-by: Javier Rodríguez Chatruc <49622509+jrchatruc@users.noreply.github.com> Co-authored-by: Mauro Toscano <12560266+MauroToscano@users.noreply.github.com> Co-authored-by: Martin Paulucci <martin.c.paulucci@gmail.com> Co-authored-by: Jeremías Salomón <48994069+JereSalo@users.noreply.github.com> Co-authored-by: Lucas Fiegl <iovoid@users.noreply.github.com> Co-authored-by: Cypher Pepe <125112044+cypherpepe@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
To reduce the number of times we go to the L1 to commit/verify blocks.
Description
l1_committerto merge as many blocks as possible into a singleStateDiffbefore committing, limited by the blob size.StateDiffto now contain both the resultingAccountUpdatesfrom executing all blocks in the batch and the header of the last block.batchNumbersinstead ofblockNumbers.ethrex_getWithdrawalProof, which returns all necessary data to claim an L1 withdrawal for a given L2 withdrawal transaction hash.apply_account_updatesfor theExecutionDBto prepare the db for executing the next block in the batch.L2/storagewith the following tables:block_number=>batch_number: Maps block numbers to batches (used by the endpoint to locate a withdrawal's batch).batch_number=>Vec<block_number>: Lists all block numbers included in a given batch.batch_number=>withdrawal_hashes: Stores withdrawal hashes per batch (used to construct merkle proofs).Closes None
Created issues: