diff --git a/.github/workflows/test-unwinds.yml b/.github/workflows/test-unwinds.yml index 4e65c87018d..d809f5cedd4 100644 --- a/.github/workflows/test-unwinds.yml +++ b/.github/workflows/test-unwinds.yml @@ -3,11 +3,12 @@ on: pull_request: branches: - zkevm + - zkevm-2.60 workflow_dispatch: jobs: fixing-unwinds-tests: - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 steps: - name: Checkout cdk-erigon @@ -19,6 +20,10 @@ jobs: with: go-version: '1.21' + - name: Install dependencies on Linux + if: runner.os == 'Linux' + run: sudo apt update && sudo apt install build-essential + - name: Build run: | cd ./cdk-erigon diff --git a/cmd/integration/commands/stage_stages_zkevm.go b/cmd/integration/commands/stage_stages_zkevm.go index d6df5d1aaa9..27672741563 100644 --- a/cmd/integration/commands/stage_stages_zkevm.go +++ b/cmd/integration/commands/stage_stages_zkevm.go @@ -11,6 +11,7 @@ import ( "github.com/ledgerwatch/erigon-lib/wrap" "github.com/ledgerwatch/erigon/eth/stagedsync/stages" smtdb "github.com/ledgerwatch/erigon/smt/pkg/db" + "github.com/ledgerwatch/erigon/turbo/debug" "github.com/ledgerwatch/erigon/zk/hermez_db" "github.com/ledgerwatch/log/v3" "github.com/spf13/cobra" @@ -26,7 +27,7 @@ state_stages_zkevm --datadir=/datadirs/hermez-mainnet --unwind-batch-no=2 --chai Example: "go run ./cmd/integration state_stages_zkevm --config=... --verbosity=3 --unwind-batch-no=100", Run: func(cmd *cobra.Command, args []string) { ctx, _ := common2.RootContext() - logger := log.New() + logger := debug.SetupCobra(cmd, "integration") db, err := openDB(dbCfg(kv.ChainDB, chaindata), true, logger) if err != nil { logger.Error("Opening DB", "error", err) diff --git a/cmd/integration/commands/stages_zkevm.go b/cmd/integration/commands/stages_zkevm.go index cd59fe35224..e67466647b3 100644 --- a/cmd/integration/commands/stages_zkevm.go +++ b/cmd/integration/commands/stages_zkevm.go @@ -166,7 +166,7 @@ func newSyncZk(ctx context.Context, db kv.RwDB) (consensus.Engine, *vm.Config, * unwindOrder = stages3.ZkSequencerUnwindOrder } - sync := stagedsync.New(cfg.Sync, stages, unwindOrder, stagedsync.DefaultPruneOrder, log.New()) + sync := stagedsync.New(cfg.Sync, stages, unwindOrder, stagedsync.DefaultPruneOrder, logger) return engine, vmConfig, sync } diff --git a/erigon-lib/kv/tables.go b/erigon-lib/kv/tables.go index d52936cc170..ce8baaa5b8b 100644 --- a/erigon-lib/kv/tables.go +++ b/erigon-lib/kv/tables.go @@ -503,51 +503,50 @@ const ( StatesProcessingProgress = "StatesProcessingProgress" // zkevm - L1VERIFICATIONS = "hermez_l1Verifications" // l1blockno, batchno -> l1txhash - L1SEQUENCES = "hermez_l1Sequences" // l1blockno, batchno -> l1txhash - FORKIDS = "hermez_forkIds" // batchNo -> forkId - FORKID_BLOCK = "hermez_forkIdBlock" // forkId -> startBlock - BLOCKBATCHES = "hermez_blockBatches" // l2blockno -> batchno - GLOBAL_EXIT_ROOTS = "hermez_globalExitRootsSaved" // GER -> true - BLOCK_GLOBAL_EXIT_ROOTS = "hermez_globalExitRoots" // l2blockno -> GER - GLOBAL_EXIT_ROOTS_BATCHES = "hermez_globalExitRoots_batches" // batchkno -> GER - TX_PRICE_PERCENTAGE = "hermez_txPricePercentage" // txHash -> txPricePercentage - STATE_ROOTS = "hermez_stateRoots" // l2blockno -> stateRoot - L1_INFO_TREE_UPDATES = "l1_info_tree_updates" // index -> L1InfoTreeUpdate - L1_INFO_TREE_UPDATES_BY_GER = "l1_info_tree_updates_by_ger" // GER -> L1InfoTreeUpdate - BLOCK_L1_INFO_TREE_INDEX = "block_l1_info_tree_index" // block number -> l1 info tree index - L1_INJECTED_BATCHES = "l1_injected_batches" // index increasing by 1 -> injected batch for the start of the chain - BLOCK_INFO_ROOTS = "block_info_roots" // block number -> block info root hash - L1_BLOCK_HASHES = "l1_block_hashes" // l1 block hash -> true - BLOCK_L1_BLOCK_HASHES = "block_l1_block_hashes" // block number -> l1 block hash - L1_BLOCK_HASH_GER = "l1_block_hash_ger" // l1 block hash -> GER - INTERMEDIATE_TX_STATEROOTS = "hermez_intermediate_tx_stateRoots" // l2blockno -> stateRoot - BATCH_WITNESSES = "hermez_batch_witnesses" // batch number -> witness - BATCH_COUNTERS = "hermez_batch_counters" - L1_BATCH_DATA = "l1_batch_data" // batch number -> l1 batch data from transaction call data - REUSED_L1_INFO_TREE_INDEX = "reused_l1_info_tree_index" // block number => const 1 - LATEST_USED_GER = "latest_used_ger" // batch number -> GER latest used GER - BATCH_BLOCKS = "batch_blocks" // batch number -> block numbers (concatenated together) - SMT_DEPTHS = "smt_depths" // block number -> smt depth - L1_INFO_LEAVES = "l1_info_leaves" // l1 info tree index -> l1 info tree leaf - L1_INFO_ROOTS = "l1_info_roots" // root hash -> l1 info tree index - INVALID_BATCHES = "invalid_batches" // batch number -> true - BATCH_PARTIALLY_PROCESSED = "batch_partially_processed" // batch number -> true - LOCAL_EXIT_ROOTS = "local_exit_roots" // batch number -> local exit root - ROllUP_TYPES_FORKS = "rollup_types_forks" // rollup type id -> fork id - FORK_HISTORY = "fork_history" // index -> fork id + last verified batch - JUST_UNWOUND = "just_unwound" // batch number -> true - PLAIN_STATE_VERSION = "plain_state_version" // batch number -> true - ERIGON_VERSIONS = "erigon_versions" // erigon version -> timestamp of startup - DISCARDED_TRANSACTIONS_BY_BLOCK = "discarded_transactions_by_block" // mapping blockNum -> [txHash, ...] - DISCARDED_TRANSACTIONS_BY_HASH = "discarded_transactions_by_hash" // mapping txHash -> blockNum - TableSmt = "HermezSmt" - TableStats = "HermezSmtStats" - TableAccountValues = "HermezSmtAccountValues" - TableMetadata = "HermezSmtMetadata" - TableHashKey = "HermezSmtHashKey" - TablePoolLimbo = "PoolLimbo" - BATCH_ENDS = "batch_ends" + L1VERIFICATIONS = "hermez_l1Verifications" // l1blockno, batchno -> l1txhash + L1SEQUENCES = "hermez_l1Sequences" // l1blockno, batchno -> l1txhash + FORKIDS = "hermez_forkIds" // batchNo -> forkId + FORKID_BLOCK = "hermez_forkIdBlock" // forkId -> startBlock + BLOCKBATCHES = "hermez_blockBatches" // l2blockno -> batchno + GLOBAL_EXIT_ROOTS = "hermez_globalExitRootsSaved" // GER -> true + BLOCK_GLOBAL_EXIT_ROOTS = "hermez_globalExitRoots" // l2blockno -> GER + GLOBAL_EXIT_ROOTS_BATCHES = "hermez_globalExitRoots_batches" // batchkno -> GER + TX_PRICE_PERCENTAGE = "hermez_txPricePercentage" // txHash -> txPricePercentage + STATE_ROOTS = "hermez_stateRoots" // l2blockno -> stateRoot + L1_INFO_TREE_UPDATES = "l1_info_tree_updates" // index -> L1InfoTreeUpdate + L1_INFO_TREE_UPDATES_BY_GER = "l1_info_tree_updates_by_ger" // GER -> L1InfoTreeUpdate + BLOCK_L1_INFO_TREE_INDEX = "block_l1_info_tree_index" // block number -> l1 info tree index + BLOCK_L1_INFO_TREE_INDEX_PROGRESS = "block_l1_info_tree_progress" // block number -> l1 info tree progress + L1_INJECTED_BATCHES = "l1_injected_batches" // index increasing by 1 -> injected batch for the start of the chain + BLOCK_INFO_ROOTS = "block_info_roots" // block number -> block info root hash + BLOCK_L1_BLOCK_HASHES = "block_l1_block_hashes" // block number -> l1 block hash + INTERMEDIATE_TX_STATEROOTS = "hermez_intermediate_tx_stateRoots" // l2blockno -> stateRoot + BATCH_WITNESSES = "hermez_batch_witnesses" // batch number -> witness + BATCH_COUNTERS = "hermez_batch_counters" + L1_BATCH_DATA = "l1_batch_data" // batch number -> l1 batch data from transaction call data + REUSED_L1_INFO_TREE_INDEX = "reused_l1_info_tree_index" // block number => const 1 + LATEST_USED_GER = "latest_used_ger" // batch number -> GER latest used GER + BATCH_BLOCKS = "batch_blocks" // batch number -> block numbers (concatenated together) + SMT_DEPTHS = "smt_depths" // block number -> smt depth + L1_INFO_LEAVES = "l1_info_leaves" // l1 info tree index -> l1 info tree leaf + L1_INFO_ROOTS = "l1_info_roots" // root hash -> l1 info tree index + INVALID_BATCHES = "invalid_batches" // batch number -> true + BATCH_PARTIALLY_PROCESSED = "batch_partially_processed" // batch number -> true + LOCAL_EXIT_ROOTS = "local_exit_roots" // batch number -> local exit root + ROllUP_TYPES_FORKS = "rollup_types_forks" // rollup type id -> fork id + FORK_HISTORY = "fork_history" // index -> fork id + last verified batch + JUST_UNWOUND = "just_unwound" // batch number -> true + PLAIN_STATE_VERSION = "plain_state_version" // batch number -> true + ERIGON_VERSIONS = "erigon_versions" // erigon version -> timestamp of startup + DISCARDED_TRANSACTIONS_BY_BLOCK = "discarded_transactions_by_block" // mapping blockNum -> [txHash, ...] + DISCARDED_TRANSACTIONS_BY_HASH = "discarded_transactions_by_hash" // mapping txHash -> blockNum + TableSmt = "HermezSmt" + TableStats = "HermezSmtStats" + TableAccountValues = "HermezSmtAccountValues" + TableMetadata = "HermezSmtMetadata" + TableHashKey = "HermezSmtHashKey" + TablePoolLimbo = "PoolLimbo" + BATCH_ENDS = "batch_ends" //Diagnostics tables DiagSystemInfo = "DiagSystemInfo" DiagSyncStages = "DiagSyncStages" @@ -761,11 +760,10 @@ var ChaindataTables = []string{ L1_INFO_TREE_UPDATES, L1_INFO_TREE_UPDATES_BY_GER, BLOCK_L1_INFO_TREE_INDEX, + BLOCK_L1_INFO_TREE_INDEX_PROGRESS, L1_INJECTED_BATCHES, BLOCK_INFO_ROOTS, - L1_BLOCK_HASHES, BLOCK_L1_BLOCK_HASHES, - L1_BLOCK_HASH_GER, INTERMEDIATE_TX_STATEROOTS, BATCH_WITNESSES, BATCH_COUNTERS, diff --git a/zk/tests/unwinds/unwind.sh b/zk/tests/unwinds/unwind.sh index 6f32acc0d59..fe724fe5f97 100755 --- a/zk/tests/unwinds/unwind.sh +++ b/zk/tests/unwinds/unwind.sh @@ -83,7 +83,7 @@ for file in $(ls $dataPath/phase1-dump1); do if cmp -s $dataPath/phase1-dump1/$filename $dataPath/phase1-dump2/$filename; then echo "No difference found in $filename" else - if [ "$filename" = "Code.txt" ] || [ "$filename" = "HashedCodeHash.txt" ] || [ "$filename" = "hermez_l1Sequences.txt" ] || [ "$filename" = "hermez_l1Verifications.txt" ] || [ "$filename" = "HermezSmt.txt" ] || [ "$filename" = "PlainCodeHash.txt" ] || [ "$filename" = "SyncStage.txt" ]; then + if [ "$filename" = "Code.txt" ] || [ "$filename" = "HashedCodeHash.txt" ] || [ "$filename" = "hermez_l1Sequences.txt" ] || [ "$filename" = "hermez_l1Verifications.txt" ] || [ "$filename" = "HermezSmt.txt" ] || [ "$filename" = "PlainCodeHash.txt" ] || [ "$filename" = "SyncStage.txt" ] || [ "$filename" = "BadHeaderNumber.txt" ]; then echo "Expected differences in $filename" else echo "Unexpected differences in $filename"