forked from 0xPolygonHermez/zkevm-node
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Sequencer L2 block parallel processing improvements (0xPolygonHermez#…
…3604) (0xPolygonHermez#3637) * 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
- Loading branch information
Showing
46 changed files
with
1,470 additions
and
752 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,8 @@ | ||
-- +migrate Up | ||
|
||
-- the update below fix the wrong receipt TX indexes | ||
WITH map_fix_tx_index AS ( | ||
SELECT t.l2_block_num AS block_num | ||
, t.hash AS tx_hash | ||
, r.tx_index AS current_index | ||
, (ROW_NUMBER() OVER (PARTITION BY t.l2_block_num ORDER BY r.tx_index))-1 AS correct_index | ||
FROM state.receipt r | ||
INNER JOIN state."transaction" t | ||
ON t.hash = r.tx_hash | ||
) | ||
UPDATE state.receipt AS r | ||
SET tx_index = m.correct_index | ||
FROM map_fix_tx_index m | ||
WHERE m.block_num = r.block_num | ||
AND m.tx_hash = r.tx_hash | ||
AND m.current_index = r.tx_index | ||
AND m.current_index != m.correct_index; | ||
|
||
ALTER TABLE state.batch | ||
ADD COLUMN high_reserved_counters JSONB; | ||
|
||
-- +migrate Down | ||
|
||
-- no action is needed, the data fixed by the | ||
-- migrate up must remain fixed | ||
ALTER TABLE state.batch | ||
DROP COLUMN high_reserved_counters; | ||
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,25 @@ | ||
-- +migrate Up | ||
|
||
-- +migrate Up | ||
ALTER TABLE state.exit_root | ||
ADD COLUMN IF NOT EXISTS l1_info_tree_recursive_index BIGINT DEFAULT NULL UNIQUE; | ||
CREATE INDEX IF NOT EXISTS idx_exit_root_l1_info_tree_recursive_index ON state.exit_root (l1_info_tree_recursive_index); | ||
-- the update below fix the wrong receipt TX indexes | ||
WITH map_fix_tx_index AS ( | ||
SELECT t.l2_block_num AS block_num | ||
, t.hash AS tx_hash | ||
, r.tx_index AS current_index | ||
, (ROW_NUMBER() OVER (PARTITION BY t.l2_block_num ORDER BY r.tx_index))-1 AS correct_index | ||
FROM state.receipt r | ||
INNER JOIN state."transaction" t | ||
ON t.hash = r.tx_hash | ||
) | ||
UPDATE state.receipt AS r | ||
SET tx_index = m.correct_index | ||
FROM map_fix_tx_index m | ||
WHERE m.block_num = r.block_num | ||
AND m.tx_hash = r.tx_hash | ||
AND m.current_index = r.tx_index | ||
AND m.current_index != m.correct_index; | ||
|
||
|
||
-- +migrate Down | ||
ALTER TABLE state.exit_root | ||
DROP COLUMN IF EXISTS l1_info_tree_recursive_index; | ||
DROP INDEX IF EXISTS state.idx_exit_root_l1_info_tree_recursive_index; | ||
|
||
-- no action is needed, the data fixed by the | ||
-- migrate up must remain fixed |
Oops, something went wrong.