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

Sequencer L2 block parallel processing improvements #3604

Merged
merged 21 commits into from
Apr 30, 2024

Conversation

agnusmor
Copy link
Contributor

What does this PR do?

  • Implements L2 block reorg mechanism when processing L2 blocks in parallel. In case an unexpected executor error happens when processing L2 block (e.g. OOC) the sequencer handles the "reorg" of the L2 block to reprocess it syncing the stateroot of the tx-by-tx process and the L2 block process, to ensure txs of that L2 block are executed using the same SR and therefore have the same execution result in both processes
  • Removes waiting to close wip batch to open a new one. Now sequencer can work with 2 batches in parallel, one that is the wip batch (tx-by-tx process) and other that is being processed (L2 blocks) and stored. This allows to increase sequencer performance.
  • Added new config parameter that allows specifiy an interval time that when reached syncs stateroot of the "tx-by-tx" process and "L2 block" process.

[Sequencer.Finalizer]
StateRootSyncInterval = "3600s"

Reviewers

Main reviewers:

@ToniRamirezM
@dpunish3r

@agnusmor agnusmor added config cherry-picked Content has been cherry-picked into a higher version branch zkevm-seq-agg labels Apr 29, 2024
@agnusmor agnusmor added this to the v0.6.7 milestone Apr 29, 2024
@agnusmor agnusmor self-assigned this Apr 29, 2024
@cla-bot cla-bot bot added the cla-signed label Apr 29, 2024
@agnusmor agnusmor merged commit 8d5cf96 into release/v0.6.7 Apr 30, 2024
30 checks passed
@agnusmor agnusmor deleted the release/l2block-reorg branch April 30, 2024 10:49
agnusmor added a commit that referenced this pull request May 21, 2024
* wip

* first implementation of parallel sequencer optmizations and L2 block reorg management

* Close sipBatch (if needed) when processing reorg. Halt when 2 consecuties reorgs (same L2 block)

* Return error when reserved counters overflow on l2 block process. Log used/reserved counters when closing wip batch

* added logs to analyze blocking issue when storing L2 block

* Fix unlock mutex in addTxTracker. Set wipTx to nil in RestoreTxsPendingToStore

* add high reserved resorces in wipBatch

* store high reserved counter on statedb.batch table

* Return contextId in ProcessBatchV2

* fix synchornizer test

* Set SequentialProcessL2Block to false by default. Update node config documentation

* fix non-e2e tests

* fix finalizer tests

* remove unused code

* test

* Fix sequencer loadFromPool gofunc. Fix docker compose variables
agnusmor added a commit that referenced this pull request May 22, 2024
* wip

* first implementation of parallel sequencer optmizations and L2 block reorg management

* Close sipBatch (if needed) when processing reorg. Halt when 2 consecuties reorgs (same L2 block)

* Return error when reserved counters overflow on l2 block process. Log used/reserved counters when closing wip batch

* added logs to analyze blocking issue when storing L2 block

* Fix unlock mutex in addTxTracker. Set wipTx to nil in RestoreTxsPendingToStore

* add high reserved resorces in wipBatch

* store high reserved counter on statedb.batch table

* Return contextId in ProcessBatchV2

* fix synchornizer test

* Set SequentialProcessL2Block to false by default. Update node config documentation

* fix non-e2e tests

* fix finalizer tests

* remove unused code

* test

* Fix sequencer loadFromPool gofunc. Fix docker compose variables
Stefan-Ethernal pushed a commit to 0xPolygon/cdk-validium-node that referenced this pull request May 24, 2024
…3604)

* wip

* first implementation of parallel sequencer optmizations and L2 block reorg management

* Close sipBatch (if needed) when processing reorg. Halt when 2 consecuties reorgs (same L2 block)

* Return error when reserved counters overflow on l2 block process. Log used/reserved counters when closing wip batch

* added logs to analyze blocking issue when storing L2 block

* Fix unlock mutex in addTxTracker. Set wipTx to nil in RestoreTxsPendingToStore

* add high reserved resorces in wipBatch

* store high reserved counter on statedb.batch table

* Return contextId in ProcessBatchV2

* fix synchornizer test

* Set SequentialProcessL2Block to false by default. Update node config documentation

* fix non-e2e tests

* fix finalizer tests

* remove unused code

* test

* Fix sequencer loadFromPool gofunc. Fix docker compose variables
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cherry-picked Content has been cherry-picked into a higher version branch cla-signed config zkevm-seq-agg
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants