From 562b266403cf37df85853eff40c1d41dd26df340 Mon Sep 17 00:00:00 2001 From: Joan Esteban <129153821+joanestebanr@users.noreply.github.com> Date: Fri, 23 Feb 2024 16:09:01 +0100 Subject: [PATCH] to decode ETROG processBatches use ETROG contract (#3360) * decode old ETROG processBatches use ETROG contract * fix sanity genesis --- etherman/etherman.go | 2 +- synchronizer/synchronizer.go | 7 ++----- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/etherman/etherman.go b/etherman/etherman.go index d77f444ff2..12d2b71838 100644 --- a/etherman/etherman.go +++ b/etherman/etherman.go @@ -1358,7 +1358,7 @@ func decodeSequencesElderberry(txData []byte, lastBatchNumber uint64, sequencer func decodeSequencesEtrog(txData []byte, lastBatchNumber uint64, sequencer common.Address, txHash common.Hash, nonce uint64, l1InfoRoot common.Hash) ([]SequencedBatch, error) { // Extract coded txs. // Load contract ABI - smcAbi, err := abi.JSON(strings.NewReader(polygonzkevm.PolygonzkevmABI)) + smcAbi, err := abi.JSON(strings.NewReader(etrogpolygonzkevm.EtrogpolygonzkevmABI)) if err != nil { return nil, err } diff --git a/synchronizer/synchronizer.go b/synchronizer/synchronizer.go index ac7554282d..6e49c064b5 100644 --- a/synchronizer/synchronizer.go +++ b/synchronizer/synchronizer.go @@ -419,7 +419,7 @@ func (s *ClientSynchronizer) RequestAndProcessRollupGenesisBlock(dbTx pgx.Tx, la } func sanityCheckForGenesisBlockRollupInfo(blocks []etherman.Block, order map[common.Hash][]etherman.Order) error { - if len(blocks) != 1 || len(order) != 1 || len(order[blocks[0].BlockHash]) != 2 { + if len(blocks) != 1 || len(order) < 1 || len(order[blocks[0].BlockHash]) < 1 { log.Errorf("error getting rollupInfoByBlockRange after set the genesis. Expected 1 block with 2 orders") return fmt.Errorf("error getting rollupInfoByBlockRange after set the genesis. Expected 1 block with 2 orders") } @@ -427,10 +427,7 @@ func sanityCheckForGenesisBlockRollupInfo(blocks []etherman.Block, order map[com log.Errorf("error getting rollupInfoByBlockRange after set the genesis. Expected ForkIDsOrder, got %s", order[blocks[0].BlockHash][0].Name) return fmt.Errorf("error getting rollupInfoByBlockRange after set the genesis. Expected ForkIDsOrder") } - if order[blocks[0].BlockHash][1].Name != etherman.InitialSequenceBatchesOrder { - log.Errorf("error getting rollupInfoByBlockRange after set the genesis. Expected InitialSequenceBatchesOrder, got %s", order[blocks[0].BlockHash][0].Name) - return fmt.Errorf("error getting rollupInfoByBlockRange after set the genesis. Expected InitialSequenceBatchesOrder") - } + return nil }