From 5b24d5d5a03830d6961179db404187672dd7bbb6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20Negovanovi=C4=87?= <93934272+Stefan-Ethernal@users.noreply.github.com> Date: Wed, 13 Mar 2024 13:13:34 +0100 Subject: [PATCH] Merge 0.6.2 upstream (#100) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * check unsupported precompiles (#3264) * check unsupported precompiles * downgrade prover * restore solc version * update SC * new errors * fix as workaround to close batch on tx oog (#3271) Co-authored-by: agnusmor * handle executor close batch * added sanity check closing an empty batch * change log --------- Co-authored-by: agnusmor * fix RPC closebatch executor error (#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 * fix executor error closebatch (#3276) * fix executor error closebatch * fix linter --------- Co-authored-by: agnusmor * add oog2 checks for all the oog cheks (#3277) * fix oog2 in internal gas estimation (#3280) * fix oog2 * fix oog2 for estimateGas --------- Co-authored-by: tclemos * execution mode (#3285) * execution mode * execution mode * execution mode * update prover image (#3286) * fix log when error on batch sanity check (#3287) * update prover image to v4.0.13 (#3289) * update prover image (#3290) * fix deltaTimestamp when debug tx (#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 eb77e0406d454939728feeea1021d243edde70a8. * Revert "fix deltaTimeStamp for unsigned txs execution for specific block" This reverts commit d2cfa7887721e981868a9e460e293ab436b3bd87. * 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 * fix checkStateInconsistency when starting sequencer (#3294) * disable delete addrQueue if empty as a workaround (#3295) * add aggregator.BatchProofL1BlockConfirmations config parameter (#3302) (#3313) * Feature remove executor errors (#3317) * remove executor errors * readd check * support to elderberry fork (#3301) * add new sequenceBatches parameters * update SMC Elderberry, contract dockers and genesis * elderberry seq-sender (#3312) * elderberry seq-sender * updated prover image to v5.0.0-RC4 * increase timeout to e2e-group7 --------- Co-authored-by: Toni Ramírez <58293609+ToniRamirezM@users.noreply.github.com> Co-authored-by: dPunisher * update prover image (#3322) * update prover image * udpate prover docker memory limits * downgrade prover * upgrade prover * Get last l2 block in a batch by batch number (#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 (#3336) * add selector for trusted sync to check that batches correspond to the supported forkids * synchronizer adopt GetLastL2BlockByBatchNumber to check elderberry tstamp baches (#3340) * synchronizer adopt GetLastL2BlockByBatchNumber to check elderberry bacthes tstamp * reserved zk counters (#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 (#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 (#3350) * Update reserved counters with used in pool db during migration (#3352) * return used if reserved counters are 0 * refactor * refactor * fix initial sequenced batch event (#3347) * fix initial sequenced batch event * Add executor reserved ZK counters (#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 (#3359) * to decode ETROG processBatches use ETROG contract (#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 #3243) * remove unnecessary eventlog call when processing unsigned txs (#3365) * Fix batch 0 timestamp (#3364) * ignore forkid events from another rollup (#3383) * Add l2block/interval metrics. Use timeoutCond when waiting for worker readyTxs (#3380) * Feature/cherry pick 3370 3374 synchronizer, fix bugs, ReprocessFullBatchOnClose and AcceptEmptyClosedBatches (#3384) * synchronizer accepts empty closed batches from trusted depending on config (#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 (#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 * #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 (#3385) * fix check poseidonHashes exhausted (#3393) * remove execution mode (#3395) * fix metrics estimatedTxsPerSec (#3396) * Fix metrics estimatedTxsPerSec division (#3398) * fix metrics estimatedTxsPerSec div * remove unneeded cast * Get IM State root from receipt for data stream. (#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 (#3401) * add gas estimation in metrics * fix linter * Feature/cherry pick 3375 sync add check l2block hash (#3406) * check L2Block hash on closed batch during sync from TrustedNode (#3390) * update prover image to v5.0.3 (#3407) * keep empty RPC.SequencerNodeURI config parameter to get node URI from the SC (#3430) * add log0 debug trace e2e tests (#3422) * add log0 debug trace e2e tests * add log0 debug trace e2e tests * Elderberry blockhash adjustments (#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 (#3428) * keep im state root in db (#3427) * generate receipt refactor (#3436) * generate receipt refactor * update prover image * downgrade prover image --------- Co-authored-by: agnusmor <100322135+agnusmor@users.noreply.github.com> Co-authored-by: Toni Ramírez <58293609+ToniRamirezM@users.noreply.github.com> * update prover to v5.0.6 (#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 (#3428) * keep im state root in db (#3427) * generate receipt refactor (#3436) * generate receipt refactor * update prover image * downgrade prover image * update prover * adapt test * undo adapt test * upgrade prover --------- Co-authored-by: tclemos Co-authored-by: agnusmor <100322135+agnusmor@users.noreply.github.com> * use empty byte array instead of all zeros for receipt poststate (#3449) * Update diff * Compile SCs and generate bindings for tests * Update diff --------- Co-authored-by: Toni Ramírez <58293609+ToniRamirezM@users.noreply.github.com> Co-authored-by: agnusmor Co-authored-by: Joan Esteban <129153821+joanestebanr@users.noreply.github.com> Co-authored-by: Thiago Coimbra Lemos Co-authored-by: tclemos Co-authored-by: agnusmor <100322135+agnusmor@users.noreply.github.com> Co-authored-by: dPunisher --- aggregator/prover/aggregator.pb.go | 4 +- aggregator/prover/aggregator_grpc.pb.go | 2 +- db/migrations/state/0017.sql | 9 + docker-compose.yml | 2 +- docs/diff/diff.html | 33950 +++++++++++++--- etherman/etherman.go | 2 +- etherman/smartcontracts/abi/polygonzkevm.abi | 1034 +- .../smartcontracts/bin/etrogpolygonzkevm.bin | 2 +- etherman/smartcontracts/bin/polygonzkevm.bin | 2 +- jsonrpc/endpoints_eth_test.go | 2 +- jsonrpc/endpoints_zkevm_test.go | 2 +- jsonrpc/types/types.go | 8 +- merkletree/hashdb/hashdb.pb.go | 4 +- merkletree/hashdb/hashdb_grpc.pb.go | 2 +- proto/src/proto/executor/v1/executor.proto | 2 + state/convertersV2.go | 1 + state/datastream.go | 6 + state/genesis.go | 2 +- state/helper.go | 36 +- state/interfaces.go | 4 +- state/mocks/mock_storage.go | 42 +- state/pgstatestorage/datastream.go | 5 +- state/pgstatestorage/l2block.go | 6 +- state/pgstatestorage/pgstatestorage_test.go | 11 +- state/pgstatestorage/transaction.go | 16 +- state/runtime/executor/errors.go | 4 + state/runtime/executor/executor.pb.go | 55 +- state/runtime/runtime.go | 2 + .../forkid_dragonfruit/dragonfruit_test.go | 3 +- .../forkid_independent/independent_test.go | 3 +- state/trace.go | 19 + state/transaction.go | 36 +- state/types.go | 2 + test/config/test.genesis.config.json | 2 +- test/contracts/auto/Log0.sol | 23 + test/contracts/bin/Log0/Log0.go | 266 + .../bin/customModExp/customModExp.go | 224 + .../bin/triggerErrors/triggerErrors.go | 2 +- test/docker-compose.yml | 4 +- test/e2e/debug_calltracer_test.go | 3 + test/e2e/debug_shared.go | 70 + test/e2e/debug_test.go | 3 + 42 files changed, 30141 insertions(+), 5736 deletions(-) create mode 100644 db/migrations/state/0017.sql create mode 100644 test/contracts/auto/Log0.sol create mode 100644 test/contracts/bin/Log0/Log0.go create mode 100644 test/contracts/bin/customModExp/customModExp.go diff --git a/aggregator/prover/aggregator.pb.go b/aggregator/prover/aggregator.pb.go index aae68148b1..18974b8bad 100644 --- a/aggregator/prover/aggregator.pb.go +++ b/aggregator/prover/aggregator.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.31.0 -// protoc v4.25.1 +// protoc-gen-go v1.32.0 +// protoc v4.25.3 // source: aggregator.proto package prover diff --git a/aggregator/prover/aggregator_grpc.pb.go b/aggregator/prover/aggregator_grpc.pb.go index 6930132c58..d4e0dec074 100644 --- a/aggregator/prover/aggregator_grpc.pb.go +++ b/aggregator/prover/aggregator_grpc.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: // - protoc-gen-go-grpc v1.3.0 -// - protoc v4.25.1 +// - protoc v4.25.3 // source: aggregator.proto package prover diff --git a/db/migrations/state/0017.sql b/db/migrations/state/0017.sql new file mode 100644 index 0000000000..1c06607dfe --- /dev/null +++ b/db/migrations/state/0017.sql @@ -0,0 +1,9 @@ +-- +migrate Up +ALTER TABLE state.receipt + ADD COLUMN IF NOT EXISTS im_state_root BYTEA; + +UPDATE state.receipt SET im_state_root = post_state WHERE block_num >= (SELECT MIN(block_num) FROM state.l2block WHERE batch_num >= (SELECT from_batch_num FROM state.fork_id WHERE fork_id = 7)); + +-- +migrate Down +ALTER TABLE state.receipt + DROP COLUMN IF EXISTS im_state_root; diff --git a/docker-compose.yml b/docker-compose.yml index 70a519a031..102c693d11 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -107,7 +107,7 @@ services: zkevm-prover: container_name: zkevm-prover restart: unless-stopped - image: hermeznetwork/zkevm-prover:v5.0.3 + image: hermeznetwork/zkevm-prover:v5.0.6 depends_on: zkevm-state-db: condition: service_healthy diff --git a/docs/diff/diff.html b/docs/diff/diff.html index bbc76c7d21..9699a54c83 100644 --- a/docs/diff/diff.html +++ b/docs/diff/diff.html @@ -2,7 +2,7 @@ - zkEVM node vs CDK validium node</br><h2>zkevm-node version: v0.6.0<h2/> + zkEVM node vs CDK validium node</br><h2>zkevm-node version: v0.6.2<h2/>