Skip to content
This repository was archived by the owner on Feb 17, 2025. It is now read-only.

Conversation

joanestebanr
Copy link
Contributor

@joanestebanr joanestebanr commented Mar 12, 2024

Closes #3451

What does this PR do?

Check incomming Forkid against Database:

  • if equal is skipped
  • If equal but differ in BlockNumber, the blockNumber is updated on database

Reviewers

Main reviewers:

Codeowner reviewers:

  • @-Alice
  • @-Bob

@joanestebanr joanestebanr added this to the v0.6.3 milestone Mar 12, 2024
@joanestebanr joanestebanr self-assigned this Mar 12, 2024
@cla-bot cla-bot bot added the cla-signed label Mar 12, 2024
@joanestebanr joanestebanr changed the base branch from develop to release/v0.6.3 March 12, 2024 12:54
@joanestebanr joanestebanr merged commit 8ffd1dc into release/v0.6.3 Mar 13, 2024
@joanestebanr joanestebanr deleted the feature/3451-sync-accept_old_forkids branch March 13, 2024 09:42
joanestebanr added a commit that referenced this pull request Mar 19, 2024
* #3451 accept same forkid from L1
* if same forkid recived and is the last one and same FromBatchNumber update blockNumber
joanestebanr added a commit that referenced this pull request Mar 19, 2024
* Synchronizer accept forkids that are the same as in database (#3452)

* #3451 accept same forkid from L1
* if same forkid recived and is the last one and same FromBatchNumber update blockNumber

* fix conflicts
Stefan-Ethernal added a commit to 0xPolygon/cdk-validium-node that referenced this pull request Mar 25, 2024
* check unsupported precompiles  (0xPolygon#3264)

* check unsupported precompiles

* downgrade prover

* restore solc version

* update SC

* new errors

* fix as workaround to close batch on tx oog (0xPolygon#3271)

Co-authored-by: agnusmor <[email protected]>

* handle executor close batch

* added sanity check closing an empty batch

* change log

---------

Co-authored-by: agnusmor <[email protected]>

* fix RPC closebatch executor error (0xPolygon#3272)

* fix RPC closebatch executor error

* fix close batch

* fix close batch

* fix close batch

* fix close batch

* fix close batch

---------

Co-authored-by: agnusmor <[email protected]>

* fix executor error closebatch (0xPolygon#3276)

* fix executor error closebatch

* fix linter

---------

Co-authored-by: agnusmor <[email protected]>

* add oog2 checks for all the oog cheks (0xPolygon#3277)

* fix oog2 in internal gas estimation (0xPolygon#3280)

* fix oog2

* fix oog2 for estimateGas

---------

Co-authored-by: tclemos <[email protected]>

* execution mode (0xPolygon#3285)

* execution mode

* execution mode

* execution mode

* update prover image (0xPolygon#3286)

* fix log when error on batch sanity check (0xPolygon#3287)

* update prover image to v4.0.13 (0xPolygon#3289)

* update prover image (0xPolygon#3290)

* fix deltaTimestamp when debug tx (0xPolygon#3291)

* fix deltaTimestamp when debug tx

* fix deltaTimeStamp for unsigned txs execution for specific block

* fix deltaTimeStamp for unsigned txs execution for specific block

* Revert "fix deltaTimeStamp for unsigned txs execution for specific block"

This reverts commit eb77e04.

* Revert "fix deltaTimeStamp for unsigned txs execution for specific block"

This reverts commit d2cfa78.

* fix debug trace l1 info tree index and add l1 info tree data

* move MockL1InfoRoot from sequencer to state to allow multiple components to use the same value

---------

Co-authored-by: agnusmor <[email protected]>

* fix checkStateInconsistency when starting sequencer (0xPolygon#3294)

* disable delete addrQueue if empty as a workaround (0xPolygon#3295)

* add aggregator.BatchProofL1BlockConfirmations config parameter (0xPolygon#3302) (0xPolygon#3313)

* Feature remove executor errors (0xPolygon#3317)

* remove executor errors

* readd check

* support to elderberry fork (0xPolygon#3301)

* add new sequenceBatches parameters
* update SMC Elderberry, contract dockers and genesis
* elderberry seq-sender (0xPolygon#3312)
* elderberry seq-sender
* updated prover  image to v5.0.0-RC4
* increase timeout  to e2e-group7

---------

Co-authored-by: Toni Ramírez <[email protected]>
Co-authored-by: dPunisher <[email protected]>

* update prover image (0xPolygon#3322)

* update prover image

* udpate prover docker memory limits

* downgrade prover

* upgrade prover

* Get last l2 block in a batch by batch number (0xPolygon#3335)

* last l2 block by batch number

* optimization

* change returned err in query

* add selector for trusted sync to prevent from executing from an old trusted node  (0xPolygon#3336)

* add selector for trusted sync to check that batches  correspond to the supported forkids

* synchronizer adopt GetLastL2BlockByBatchNumber to check elderberry tstamp baches (0xPolygon#3340)

* synchronizer adopt GetLastL2BlockByBatchNumber to check elderberry bacthes tstamp

* reserved zk counters (0xPolygon#3343)

* reserved zk counters

* new prover image

* udpate counters names

* udpate counters names

* add gas used to reserved zkCounters

* add ReservedZKCounters to pool trasactions

* Add reserved zk counters to pool transactions (0xPolygon#3346)

* add reserved zk counters to pool transaction

* add reserved zk counters to pool transaction

* correct migration test

* Merge v0.5.13 into v0.6.0 (0xPolygon#3350)

* Update reserved counters with used in pool db during migration (0xPolygon#3352)

* return used if reserved counters are 0

* refactor

* refactor

* fix initial sequenced batch event (0xPolygon#3347)

* fix initial sequenced batch event

* Add executor reserved ZK counters (0xPolygon#3348)

* add executor reserved ZK counters

* update prover image to v5.0.0-RC6

* fix typos

* add check reserved counters when executing L2 block

* remove closeBatch

* update prover image v5.0.0-RC7

* fixes and logs improvements

* update prover image v5.0.0-RC8

* fix return on node OOC. Fix logs (0xPolygon#3359)

* to decode ETROG processBatches use ETROG contract (0xPolygon#3360)

* decode old ETROG processBatches use ETROG contract
* fix sanity genesis

* Synchronized inform field state.batch.closing_reason from DB

* Add reasons to the field `state.batch.closing_reason` (issue 0xPolygon#3243)

* remove unnecessary eventlog call when processing unsigned txs (0xPolygon#3365)

* Fix batch 0 timestamp (0xPolygon#3364)

* ignore forkid events from another rollup (0xPolygon#3383)

* Add l2block/interval metrics. Use timeoutCond when waiting for worker readyTxs (0xPolygon#3380)

* Feature/cherry pick 3370 3374 synchronizer, fix bugs, ReprocessFullBatchOnClose and AcceptEmptyClosedBatches (0xPolygon#3384)

* synchronizer accepts empty closed batches from trusted depending on config (0xPolygon#3370)

* accept empty closed batches depending on config
* if trusted synchronization dont create L2 sync classes

* sync reprocess full batch on close, check GER, and fix minor bugs (0xPolygon#3374)

* sync reprocess full batch on close
* reduce the of live of batch cache from 1hour to 5min
* fix reprocess, check virtualBatch before reseting state
* 0xPolygon#3376 - check GlobalExitRoot before working on a batch
* update same data as updateWIPBatch do in the cache of batches

* set Synchronizer.L2Synchronization.ReprocessFullBatchOnClose to false

* update documentation

* fix metrics cleanUp (0xPolygon#3385)

* fix check poseidonHashes exhausted (0xPolygon#3393)

* remove execution mode (0xPolygon#3395)

* fix metrics estimatedTxsPerSec (0xPolygon#3396)

* Fix metrics estimatedTxsPerSec division (0xPolygon#3398)

* fix metrics estimatedTxsPerSec div

* remove unneeded cast

* Get IM State root from receipt for data stream. (0xPolygon#3400)

* get im state root from receipt

* get im state root from receipt

* get im state root from receipt

* Add gas per second estimation in metrics (0xPolygon#3401)

* add gas estimation in metrics

* fix linter

* Feature/cherry pick 3375 sync add check l2block hash (0xPolygon#3406)

* check L2Block hash on closed batch during sync from TrustedNode (0xPolygon#3390)

* update prover image to v5.0.3 (0xPolygon#3407)

* keep empty RPC.SequencerNodeURI config parameter to get node URI from the SC (0xPolygon#3430)

* add log0 debug trace e2e tests (0xPolygon#3422)

* add log0 debug trace e2e tests

* add log0 debug trace e2e tests

* Elderberry blockhash adjustments (0xPolygon#3424)

* remove intermediate state root from receipts after Etrog

* use receipt state returned by executor instead of checking the RomError

* use receipt status from executor only after Etrog

* fix gasLimit and cumulativeGasUsed for Elderberry txs (0xPolygon#3428)

* keep im state root in db (0xPolygon#3427)

* generate receipt refactor (0xPolygon#3436)

* generate receipt refactor

* update prover image

* downgrade prover image

---------

Co-authored-by: agnusmor <[email protected]>
Co-authored-by: Toni Ramírez <[email protected]>

* update prover to v5.0.6 (0xPolygon#3437)

* remove intermediate state root from receipts after Etrog

* use receipt state returned by executor instead of checking the RomError

* use receipt status from executor only after Etrog

* fix gasLimit and cumulativeGasUsed for Elderberry txs (0xPolygon#3428)

* keep im state root in db (0xPolygon#3427)

* generate receipt refactor (0xPolygon#3436)

* generate receipt refactor

* update prover image

* downgrade prover image

* update prover

* adapt test

* undo adapt test

* upgrade prover

---------

Co-authored-by: tclemos <[email protected]>
Co-authored-by: agnusmor <[email protected]>

* use empty byte array instead of all zeros for receipt poststate (0xPolygon#3449)

* L1 Synchronization process check some L2Blocks from TrustedNode (0xPolygon#3445)

* L1 Synchronization process check some L2Blocks from TrustedNode

* l1sync: if local batch is WIP need to be reprocess (0xPolygon#3443)

* Synchronizer accept forkids that are the same as in database (0xPolygon#3452)

* 0xPolygon#3451 accept same forkid from L1
* if same forkid recived and is the last one and same FromBatchNumber update blockNumber

* remove unnecessary eventlog call when estimating tx gas (0xPolygon#3457)

* Update diff

---------

Co-authored-by: Toni Ramírez <[email protected]>
Co-authored-by: agnusmor <[email protected]>
Co-authored-by: Joan Esteban <[email protected]>
Co-authored-by: Thiago Coimbra Lemos <[email protected]>
Co-authored-by: tclemos <[email protected]>
Co-authored-by: agnusmor <[email protected]>
Co-authored-by: dPunisher <[email protected]>
Stefan-Ethernal added a commit to 0xPolygon/cdk-validium-node that referenced this pull request Mar 26, 2024
* check unsupported precompiles  (0xPolygon#3264)

* check unsupported precompiles

* downgrade prover

* restore solc version

* update SC

* new errors

* fix as workaround to close batch on tx oog (0xPolygon#3271)

Co-authored-by: agnusmor <[email protected]>

* handle executor close batch

* added sanity check closing an empty batch

* change log

---------

Co-authored-by: agnusmor <[email protected]>

* fix RPC closebatch executor error (0xPolygon#3272)

* fix RPC closebatch executor error

* fix close batch

* fix close batch

* fix close batch

* fix close batch

* fix close batch

---------

Co-authored-by: agnusmor <[email protected]>

* fix executor error closebatch (0xPolygon#3276)

* fix executor error closebatch

* fix linter

---------

Co-authored-by: agnusmor <[email protected]>

* add oog2 checks for all the oog cheks (0xPolygon#3277)

* fix oog2 in internal gas estimation (0xPolygon#3280)

* fix oog2

* fix oog2 for estimateGas

---------

Co-authored-by: tclemos <[email protected]>

* execution mode (0xPolygon#3285)

* execution mode

* execution mode

* execution mode

* update prover image (0xPolygon#3286)

* fix log when error on batch sanity check (0xPolygon#3287)

* update prover image to v4.0.13 (0xPolygon#3289)

* update prover image (0xPolygon#3290)

* fix deltaTimestamp when debug tx (0xPolygon#3291)

* fix deltaTimestamp when debug tx

* fix deltaTimeStamp for unsigned txs execution for specific block

* fix deltaTimeStamp for unsigned txs execution for specific block

* Revert "fix deltaTimeStamp for unsigned txs execution for specific block"

This reverts commit eb77e04.

* Revert "fix deltaTimeStamp for unsigned txs execution for specific block"

This reverts commit d2cfa78.

* fix debug trace l1 info tree index and add l1 info tree data

* move MockL1InfoRoot from sequencer to state to allow multiple components to use the same value

---------

Co-authored-by: agnusmor <[email protected]>

* fix checkStateInconsistency when starting sequencer (0xPolygon#3294)

* disable delete addrQueue if empty as a workaround (0xPolygon#3295)

* add aggregator.BatchProofL1BlockConfirmations config parameter (0xPolygon#3302) (0xPolygon#3313)

* Feature remove executor errors (0xPolygon#3317)

* remove executor errors

* readd check

* support to elderberry fork (0xPolygon#3301)

* add new sequenceBatches parameters
* update SMC Elderberry, contract dockers and genesis
* elderberry seq-sender (0xPolygon#3312)
* elderberry seq-sender
* updated prover  image to v5.0.0-RC4
* increase timeout  to e2e-group7

---------

Co-authored-by: Toni Ramírez <[email protected]>
Co-authored-by: dPunisher <[email protected]>

* update prover image (0xPolygon#3322)

* update prover image

* udpate prover docker memory limits

* downgrade prover

* upgrade prover

* Get last l2 block in a batch by batch number (0xPolygon#3335)

* last l2 block by batch number

* optimization

* change returned err in query

* add selector for trusted sync to prevent from executing from an old trusted node  (0xPolygon#3336)

* add selector for trusted sync to check that batches  correspond to the supported forkids

* synchronizer adopt GetLastL2BlockByBatchNumber to check elderberry tstamp baches (0xPolygon#3340)

* synchronizer adopt GetLastL2BlockByBatchNumber to check elderberry bacthes tstamp

* reserved zk counters (0xPolygon#3343)

* reserved zk counters

* new prover image

* udpate counters names

* udpate counters names

* add gas used to reserved zkCounters

* add ReservedZKCounters to pool trasactions

* Add reserved zk counters to pool transactions (0xPolygon#3346)

* add reserved zk counters to pool transaction

* add reserved zk counters to pool transaction

* correct migration test

* Merge v0.5.13 into v0.6.0 (0xPolygon#3350)

* Update reserved counters with used in pool db during migration (0xPolygon#3352)

* return used if reserved counters are 0

* refactor

* refactor

* fix initial sequenced batch event (0xPolygon#3347)

* fix initial sequenced batch event

* Add executor reserved ZK counters (0xPolygon#3348)

* add executor reserved ZK counters

* update prover image to v5.0.0-RC6

* fix typos

* add check reserved counters when executing L2 block

* remove closeBatch

* update prover image v5.0.0-RC7

* fixes and logs improvements

* update prover image v5.0.0-RC8

* fix return on node OOC. Fix logs (0xPolygon#3359)

* to decode ETROG processBatches use ETROG contract (0xPolygon#3360)

* decode old ETROG processBatches use ETROG contract
* fix sanity genesis

* Synchronized inform field state.batch.closing_reason from DB

* Add reasons to the field `state.batch.closing_reason` (issue 0xPolygon#3243)

* remove unnecessary eventlog call when processing unsigned txs (0xPolygon#3365)

* Fix batch 0 timestamp (0xPolygon#3364)

* ignore forkid events from another rollup (0xPolygon#3383)

* Add l2block/interval metrics. Use timeoutCond when waiting for worker readyTxs (0xPolygon#3380)

* Feature/cherry pick 3370 3374 synchronizer, fix bugs, ReprocessFullBatchOnClose and AcceptEmptyClosedBatches (0xPolygon#3384)

* synchronizer accepts empty closed batches from trusted depending on config (0xPolygon#3370)

* accept empty closed batches depending on config
* if trusted synchronization dont create L2 sync classes

* sync reprocess full batch on close, check GER, and fix minor bugs (0xPolygon#3374)

* sync reprocess full batch on close
* reduce the of live of batch cache from 1hour to 5min
* fix reprocess, check virtualBatch before reseting state
* 0xPolygon#3376 - check GlobalExitRoot before working on a batch
* update same data as updateWIPBatch do in the cache of batches

* set Synchronizer.L2Synchronization.ReprocessFullBatchOnClose to false

* update documentation

* fix metrics cleanUp (0xPolygon#3385)

* fix check poseidonHashes exhausted (0xPolygon#3393)

* remove execution mode (0xPolygon#3395)

* fix metrics estimatedTxsPerSec (0xPolygon#3396)

* Fix metrics estimatedTxsPerSec division (0xPolygon#3398)

* fix metrics estimatedTxsPerSec div

* remove unneeded cast

* Get IM State root from receipt for data stream. (0xPolygon#3400)

* get im state root from receipt

* get im state root from receipt

* get im state root from receipt

* Add gas per second estimation in metrics (0xPolygon#3401)

* add gas estimation in metrics

* fix linter

* Feature/cherry pick 3375 sync add check l2block hash (0xPolygon#3406)

* check L2Block hash on closed batch during sync from TrustedNode (0xPolygon#3390)

* update prover image to v5.0.3 (0xPolygon#3407)

* keep empty RPC.SequencerNodeURI config parameter to get node URI from the SC (0xPolygon#3430)

* add log0 debug trace e2e tests (0xPolygon#3422)

* add log0 debug trace e2e tests

* add log0 debug trace e2e tests

* Elderberry blockhash adjustments (0xPolygon#3424)

* remove intermediate state root from receipts after Etrog

* use receipt state returned by executor instead of checking the RomError

* use receipt status from executor only after Etrog

* fix gasLimit and cumulativeGasUsed for Elderberry txs (0xPolygon#3428)

* keep im state root in db (0xPolygon#3427)

* generate receipt refactor (0xPolygon#3436)

* generate receipt refactor

* update prover image

* downgrade prover image

---------

Co-authored-by: agnusmor <[email protected]>
Co-authored-by: Toni Ramírez <[email protected]>

* update prover to v5.0.6 (0xPolygon#3437)

* remove intermediate state root from receipts after Etrog

* use receipt state returned by executor instead of checking the RomError

* use receipt status from executor only after Etrog

* fix gasLimit and cumulativeGasUsed for Elderberry txs (0xPolygon#3428)

* keep im state root in db (0xPolygon#3427)

* generate receipt refactor (0xPolygon#3436)

* generate receipt refactor

* update prover image

* downgrade prover image

* update prover

* adapt test

* undo adapt test

* upgrade prover

---------

Co-authored-by: tclemos <[email protected]>
Co-authored-by: agnusmor <[email protected]>

* use empty byte array instead of all zeros for receipt poststate (0xPolygon#3449)

* L1 Synchronization process check some L2Blocks from TrustedNode (0xPolygon#3445)

* L1 Synchronization process check some L2Blocks from TrustedNode

* l1sync: if local batch is WIP need to be reprocess (0xPolygon#3443)

* Synchronizer accept forkids that are the same as in database (0xPolygon#3452)

* 0xPolygon#3451 accept same forkid from L1
* if same forkid recived and is the last one and same FromBatchNumber update blockNumber

* remove unnecessary eventlog call when estimating tx gas (0xPolygon#3457)

* fix debug trace for injected tx (0xPolygon#3469) (0xPolygon#3473)

* Add sanity-check on checkL1InfoTreeUpdate to check state L1 blockhash matches ethereum blockhash (L1 reorg check) (0xPolygon#3480)

* Add sanity check on checkL1InfoTreeUpdate to check state L1 blockhash matches ethereum blockhash (L1 reorg check)

* fix L1 block is 0 (empty l1infotree)

* Update Prover image to v5.0.9

* support forkid 9 (0xPolygon#3496)

* fix aggregator l1 info tree (0xPolygon#3490) (0xPolygon#3491) (0xPolygon#3484)  (0xPolygon#3495)

* fix aggregator l1 info tree (0xPolygon#3491)

* fix aggregator l1 info tree

* Fix case you want to proof a 0 (0xPolygon#3492)

* Fix case you want to proof a 0

* init timestamp

---------

Co-authored-by: Toni Ramírez <[email protected]>

* force forkid 9

* update prover

---------

Co-authored-by: Jordi Baylina <[email protected]>
Co-authored-by: agnusmor <[email protected]>

* fix debug trace receipt index (0xPolygon#3490)

* conflicts

* fix ooc

* fix tx index calculation on receipt (0xPolygon#3488)

* remove 3495

---------

Co-authored-by: Jordi Baylina <[email protected]>
Co-authored-by: agnusmor <[email protected]>

* Update the diff file

* Align trace.go with the upstream

---------

Co-authored-by: Toni Ramírez <[email protected]>
Co-authored-by: agnusmor <[email protected]>
Co-authored-by: Joan Esteban <[email protected]>
Co-authored-by: Thiago Coimbra Lemos <[email protected]>
Co-authored-by: tclemos <[email protected]>
Co-authored-by: agnusmor <[email protected]>
Co-authored-by: dPunisher <[email protected]>
Co-authored-by: Jordi Baylina <[email protected]>
@joanestebanr joanestebanr added the cherry-picked Content has been cherry-picked into a higher version branch label Apr 23, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
cherry-picked Content has been cherry-picked into a higher version branch cla-signed synchronizer zkevm-bridge-sync-rpc
Projects
None yet
Development

Successfully merging this pull request may close these issues.

synchronizer allows to reprocess forkids if are the same as stored on DB
2 participants