diff --git a/aggregator/aggregator.go b/aggregator/aggregator.go index efe8befed4..d87ad0576a 100644 --- a/aggregator/aggregator.go +++ b/aggregator/aggregator.go @@ -39,6 +39,8 @@ const ( ethTxManagerOwner = "aggregator" monitoredIDFormat = "proof-from-%v-to-%v" + + forkId9 = uint64(9) ) type finalProofMsg struct { @@ -194,7 +196,7 @@ func (a *Aggregator) Channel(stream prover.AggregatorService_ChannelServer) erro log.Info("Establishing stream connection with prover") // Check if prover supports the required Fork ID - if !prover.SupportsForkID(a.cfg.ForkId) { + if !prover.SupportsForkID(forkId9) { err := errors.New("prover does not support required fork ID") log.Warn(FirstToUpper(err.Error())) return err @@ -1149,9 +1151,13 @@ func (a *Aggregator) buildInputProver(ctx context.Context, batchToVerify *state. for _, l2blockRaw := range batchRawData.Blocks { _, contained := l1InfoTreeData[l2blockRaw.IndexL1InfoTree] if !contained && l2blockRaw.IndexL1InfoTree != 0 { - l1InfoTreeExitRootStorageEntry, err := a.State.GetL1InfoRootLeafByIndex(ctx, l2blockRaw.IndexL1InfoTree, nil) - if err != nil { - return nil, err + l1InfoTreeExitRootStorageEntry := state.L1InfoTreeExitRootStorageEntry{} + l1InfoTreeExitRootStorageEntry.Timestamp = time.Unix(0, 0) + if l2blockRaw.IndexL1InfoTree <= leaves[len(leaves)-1].L1InfoTreeIndex { + l1InfoTreeExitRootStorageEntry, err = a.State.GetL1InfoRootLeafByIndex(ctx, l2blockRaw.IndexL1InfoTree, nil) + if err != nil { + return nil, err + } } // Calculate smt proof @@ -1204,7 +1210,7 @@ func (a *Aggregator) buildInputProver(ctx context.Context, batchToVerify *state. OldAccInputHash: previousBatch.AccInputHash.Bytes(), OldBatchNum: previousBatch.BatchNumber, ChainId: a.cfg.ChainID, - ForkId: a.cfg.ForkId, + ForkId: forkId9, BatchL2Data: batchToVerify.BatchL2Data, L1InfoRoot: l1InfoRoot.Bytes(), TimestampLimit: uint64(batchToVerify.Timestamp.Unix()), diff --git a/docker-compose.yml b/docker-compose.yml index 102c693d11..7ae42c26c9 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.6 + image: hermeznetwork/zkevm-prover:v6.0.0 depends_on: zkevm-state-db: condition: service_healthy diff --git a/docs/diff/diff.html b/docs/diff/diff.html index c4ebaa5073..95ea6d0571 100644 --- a/docs/diff/diff.html +++ b/docs/diff/diff.html @@ -54,7 +54,7 @@

zkEVM node vs CDK validium node

zkevm-node version: v0.6.0

- Files changed (112) + Files changed (81) hide show
@@ -151,7 +151,7 @@

zkEVM node vs CDK validium node

zkevm-node version: v0.6.0

{/home/stefan/go/src/Polygon/zkevm-node → .}/cmd/run.go +115 - -15 + -14 @@ -210,7 +210,7 @@

zkEVM node vs CDK validium node

zkevm-node version: v0.6.0

{/home/stefan/go/src/Polygon/zkevm-node → .}/config/default.go - +7 + +5 -0 @@ -347,18 +347,6 @@

zkEVM node vs CDK validium node

zkevm-node version: v0.6.0

-
  • - - {/home/stefan/go/src/Polygon/zkevm-node → .}/db/migrations/state/0017.sql - - +9 - -0 - - -
  • zkevm-node version: v0.6.0

  • -
  • - - {/home/stefan/go/src/Polygon/zkevm-node → .}/docker-compose.yml - - +1 - -1 - - -
  • zkevm-node version: v0.6.0

    {/home/stefan/go/src/Polygon/zkevm-node → .}/etherman/etherman.go - +170 + +198 -144
    @@ -534,8 +510,8 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    {/home/stefan/go/src/Polygon/zkevm-node → .}/jsonrpc/endpoints_eth_test.go - +236 - -1 + +235 + -0
  • @@ -551,18 +527,6 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    -
  • - - {/home/stefan/go/src/Polygon/zkevm-node → .}/jsonrpc/endpoints_zkevm_test.go - - +1 - -1 - - -
  • zkevm-node version: v0.6.0

    {/home/stefan/go/src/Polygon/zkevm-node → .}/jsonrpc/types/types.go - +23 - -2 + +17 + -0
  • @@ -690,7 +654,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    {/home/stefan/go/src/Polygon/zkevm-node → .}/proto/src/proto/executor/v1/executor.proto - +3 + +1 -0 @@ -779,86 +743,14 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    -
  • - - {/home/stefan/go/src/Polygon/zkevm-node → .}/state/convertersV2.go - - +1 - -0 - - -
  • -
  • - - {/home/stefan/go/src/Polygon/zkevm-node → .}/state/datastream.go - - +6 - -0 - - -
  • {/home/stefan/go/src/Polygon/zkevm-node → .}/state/genesis.go - - +5 - -3 - - -
  • -
  • - - {/home/stefan/go/src/Polygon/zkevm-node → .}/state/helper.go - - +22 - -14 - - -
  • -
  • - - {/home/stefan/go/src/Polygon/zkevm-node → .}/state/interfaces.go - - +6 - -3 - - -
  • -
  • - - {/home/stefan/go/src/Polygon/zkevm-node → .}/state/pgstatestorage/datastream.go +4 - -1 - - -
  • -
  • - - {/home/stefan/go/src/Polygon/zkevm-node → .}/state/pgstatestorage/forkid.go - - +21 -2 @@ -868,10 +760,10 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    {/home/stefan/go/src/Polygon/zkevm-node → .}/state/pgstatestorage/l2block.go + {/home/stefan/go/src/Polygon/zkevm-node → .}/state/interfaces.go - +3 - -3 + +2 + -0
  • @@ -894,20 +786,8 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    {/home/stefan/go/src/Polygon/zkevm-node → .}/state/pgstatestorage/pgstatestorage_test.go - +88 - -6 - - - -
  • - - {/home/stefan/go/src/Polygon/zkevm-node → .}/state/pgstatestorage/transaction.go - - +8 - -8 + +80 + -1
  • @@ -923,210 +803,18 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    -
  • - - {/home/stefan/go/src/Polygon/zkevm-node → .}/state/runtime/executor/errors.go - - +4 - -0 - - -
  • -
  • - - {/home/stefan/go/src/Polygon/zkevm-node → .}/state/runtime/runtime.go - - +2 - -0 - - -
  • -
  • - - {/home/stefan/go/src/Polygon/zkevm-node → .}/state/test/forkid_dragonfruit/dragonfruit_test.go - - +2 - -1 - - -
  • -
  • - - {/home/stefan/go/src/Polygon/zkevm-node → .}/state/test/forkid_independent/independent_test.go - - +2 - -1 - - -
  • -
  • - - {/home/stefan/go/src/Polygon/zkevm-node → .}/state/trace.go - - +39 - -0 - - -
  • {/home/stefan/go/src/Polygon/zkevm-node → .}/state/transaction.go - - +21 - -8 - - -
  • -
  • - - {/home/stefan/go/src/Polygon/zkevm-node → .}/state/types.go +2 -0
  • -
  • - - {/home/stefan/go/src/Polygon/zkevm-node → .}/synchronizer/actions/check_l2block.go - - +139 - -0 - - -
  • -
  • - - {/home/stefan/go/src/Polygon/zkevm-node → .}/synchronizer/actions/check_l2block_processor_decorator.go - - +34 - -0 - - -
  • -
  • - - {/home/stefan/go/src/Polygon/zkevm-node → .}/synchronizer/actions/check_l2block_test.go - - +131 - -0 - - -
  • -
  • - - {/home/stefan/go/src/Polygon/zkevm-node → .}/synchronizer/actions/etrog/processor_l1_sequence_batches.go - - +5 - -0 - - -
  • -
  • - - {/home/stefan/go/src/Polygon/zkevm-node → .}/synchronizer/actions/incaberry/processor_l1_forkid.go - - +124 - -38 - - -
  • -
  • - - {/home/stefan/go/src/Polygon/zkevm-node → .}/synchronizer/actions/incaberry/processor_l1_forkid_test.go - - +147 - -0 - - -
  • -
  • - - {/home/stefan/go/src/Polygon/zkevm-node → .}/synchronizer/common/syncinterfaces/state.go - - +3 - -0 - - -
  • -
  • - - {/home/stefan/go/src/Polygon/zkevm-node → .}/synchronizer/common/syncinterfaces/zkevm_rpc.go - - +5 - -0 - - -
  • -
  • - - {/home/stefan/go/src/Polygon/zkevm-node → .}/synchronizer/config.go - - +6 - -0 - - -
  • -
  • - - {/home/stefan/go/src/Polygon/zkevm-node → .}/synchronizer/default_l1processors.go - - +6 - -6 - - -
  • zkevm-node version: v0.6.0

    {/home/stefan/go/src/Polygon/zkevm-node → .}/synchronizer/synchronizer.go - +54 - -6 + +35 + -5
  • @@ -1199,18 +887,6 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    -
  • - - {/home/stefan/go/src/Polygon/zkevm-node → .}/test/contracts/auto/Log0.sol - - +23 - -0 - - -
  • zkevm-node version: v0.6.0

  • -
  • - - {/home/stefan/go/src/Polygon/zkevm-node → .}/test/contracts/bin/Log0/Log0.go - - +266 - -0 - - -
  • zkevm-node version: v0.6.0

    {/home/stefan/go/src/Polygon/zkevm-node → .}/test/docker-compose.yml - +55 - -5 + +53 + -3
  • @@ -1271,42 +935,6 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    -
  • - - {/home/stefan/go/src/Polygon/zkevm-node → .}/test/e2e/debug_calltracer_test.go - - +3 - -0 - - -
  • -
  • - - {/home/stefan/go/src/Polygon/zkevm-node → .}/test/e2e/debug_shared.go - - +69 - -0 - - -
  • -
  • - - {/home/stefan/go/src/Polygon/zkevm-node → .}/test/e2e/debug_test.go - - +3 - -0 - - -
  • zkevm-node version: v0.6.0

    {/home/stefan/go/src/Polygon/zkevm-node → .}/test/Makefile - +47 - -5 + +46 + -4
  • @@ -1500,11 +1128,11 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    -
    @@ -65,6 +69,9 @@
    +
    @@ -67,6 +71,9 @@
    - 65 + 67
    @@ -1514,7 +1142,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 66 + 68
    @@ -1524,7 +1152,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 67 + 69
    @@ -1564,7 +1192,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 68 + 70
    @@ -1574,7 +1202,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 69 + 71
    @@ -1584,7 +1212,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 70 + 72
    @@ -1595,11 +1223,11 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    -
    @@ -73,6 +80,8 @@
    +
    @@ -75,6 +82,8 @@
    - 73 + 75
    @@ -1609,7 +1237,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 74 + 76
    @@ -1619,7 +1247,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 75 + 77
    @@ -1649,7 +1277,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 76 + 78
    @@ -1659,7 +1287,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 77 + 79
    @@ -1669,7 +1297,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 78 + 80
    @@ -1680,11 +1308,11 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    -
    @@ -94,6 +103,9 @@
    +
    @@ -96,6 +105,9 @@
    - 94 + 96
    @@ -1694,7 +1322,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 95 + 97
    @@ -1704,7 +1332,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 96 + 98
    @@ -1744,7 +1372,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 97 + 99
    @@ -1754,7 +1382,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 98 + 100
    @@ -1764,7 +1392,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 99 + 101
    @@ -1775,11 +1403,11 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    -
    @@ -267,34 +279,139 @@
    +
    @@ -269,34 +281,139 @@
    - 267 + 269
    @@ -1789,7 +1417,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 268 + 270
    @@ -1799,7 +1427,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 269 + 271
    @@ -1809,7 +1437,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 270 + 272
    @@ -1819,7 +1447,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 271 + 273
    @@ -1829,7 +1457,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 272 + 274
    @@ -1839,7 +1467,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 273 + 275
    @@ -1849,7 +1477,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 274 + 276
    @@ -1859,7 +1487,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 275 + 277
    @@ -1869,7 +1497,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 276 + 278
    @@ -1879,7 +1507,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 277 + 279
    @@ -1889,7 +1517,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 278 + 280
    @@ -1899,7 +1527,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 279 + 281
    @@ -1909,7 +1537,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 280 + 282
    @@ -1919,7 +1547,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 281 + 283
    @@ -1929,7 +1557,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 282 + 284
    @@ -1939,7 +1567,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 283 + 285
    @@ -1949,7 +1577,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 284 + 286
    @@ -1959,7 +1587,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 285 + 287
    @@ -1969,7 +1597,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 286 + 288
    @@ -1979,7 +1607,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 287 + 289
    @@ -1989,7 +1617,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 288 + 290
    @@ -1999,7 +1627,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 289 + 291
    @@ -2009,7 +1637,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 290 + 292
    @@ -2019,7 +1647,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 291 + 293
    @@ -2029,7 +1657,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 292 + 294
    @@ -2039,7 +1667,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 293 + 295
    @@ -2049,7 +1677,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 294 + 296
    @@ -2059,7 +1687,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 295 + 297
    @@ -2069,7 +1697,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 296 + 298
    @@ -2079,7 +1707,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 297 + 299
    @@ -3249,7 +2877,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 298 + 300
    @@ -3259,7 +2887,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 299 + 301
    @@ -3269,7 +2897,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 300 + 302
    @@ -3368,7 +2996,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 69 + 71
    @@ -3378,7 +3006,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 70 + 72
    @@ -3388,7 +3016,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 71 + 73
    @@ -3398,7 +3026,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 72 + 74
    @@ -3408,7 +3036,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 73 + 75
    @@ -3418,7 +3046,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 74 + 76
    @@ -3428,7 +3056,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 75 + 77
    @@ -3438,7 +3066,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 76 + 78
    @@ -3448,7 +3076,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 77 + 79
    @@ -3463,7 +3091,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 80 + 82
    @@ -3473,7 +3101,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 81 + 83
    @@ -3483,7 +3111,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 82 + 84
    @@ -3493,7 +3121,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 83 + 85
    @@ -3503,7 +3131,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 84 + 86
    @@ -3513,7 +3141,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 85 + 87
    @@ -3523,7 +3151,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 86 + 88
    @@ -3533,7 +3161,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 87 + 89
    @@ -3548,7 +3176,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 103 + 105
    @@ -3558,7 +3186,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 104 + 106
    @@ -3568,7 +3196,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 105 + 107
    @@ -3578,7 +3206,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 106 + 108
    @@ -3588,7 +3216,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 107 + 109
    @@ -3598,7 +3226,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 108 + 110
    @@ -3608,7 +3236,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 109 + 111
    @@ -3618,7 +3246,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 110 + 112
    @@ -3628,7 +3256,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 111 + 113
    @@ -3643,7 +3271,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 279 + 281
    @@ -3653,7 +3281,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 280 + 282
    @@ -3663,7 +3291,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 281 + 283
    @@ -3673,7 +3301,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 282 + 284
    @@ -3683,7 +3311,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 283 + 285
    @@ -3693,7 +3321,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 284 + 286
    @@ -3703,7 +3331,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 285 + 287
    @@ -3713,7 +3341,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 286 + 288
    @@ -3723,7 +3351,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 287 + 289
    @@ -3733,7 +3361,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 288 + 290
    @@ -3743,7 +3371,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 289 + 291
    @@ -3753,7 +3381,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 290 + 292
    @@ -3823,7 +3451,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 291 + 293
    @@ -3833,7 +3461,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 292 + 294
    @@ -3893,7 +3521,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 293 + 295
    @@ -3903,7 +3531,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 294 + 296
    @@ -3913,7 +3541,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 295 + 297
    @@ -3923,7 +3551,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 296 + 298
    @@ -3933,7 +3561,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 297 + 299
    @@ -3943,7 +3571,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 298 + 300
    @@ -3953,7 +3581,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 299 + 301
    @@ -3963,7 +3591,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 300 + 302
    @@ -3973,7 +3601,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 301 + 303
    @@ -3983,7 +3611,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 302 + 304
    @@ -3993,7 +3621,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 303 + 305
    @@ -4003,7 +3631,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 304 + 306
    @@ -4013,7 +3641,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 305 + 307
    @@ -4023,7 +3651,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 306 + 308
    @@ -4033,7 +3661,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 307 + 309
    @@ -4043,7 +3671,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 308 + 310
    @@ -4053,7 +3681,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 309 + 311
    @@ -4063,7 +3691,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 310 + 312
    @@ -4073,7 +3701,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 311 + 313
    @@ -4083,7 +3711,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 312 + 314
    @@ -4093,7 +3721,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 313 + 315
    @@ -4103,7 +3731,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 314 + 316
    @@ -4113,7 +3741,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 315 + 317
    @@ -4123,7 +3751,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 316 + 318
    @@ -4133,7 +3761,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 317 + 319
    @@ -4143,7 +3771,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 318 + 320
    @@ -4153,7 +3781,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 319 + 321
    @@ -4163,7 +3791,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 320 + 322
    @@ -4173,7 +3801,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 321 + 323
    @@ -4183,7 +3811,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 322 + 324
    @@ -4193,7 +3821,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 323 + 325
    @@ -4203,7 +3831,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 324 + 326
    @@ -4213,7 +3841,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 325 + 327
    @@ -4223,7 +3851,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 326 + 328
    @@ -4233,7 +3861,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 327 + 329
    @@ -4243,7 +3871,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 328 + 330
    @@ -4253,7 +3881,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 329 + 331
    @@ -4263,7 +3891,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 330 + 332
    @@ -4273,7 +3901,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 331 + 333
    @@ -4283,7 +3911,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 332 + 334
    @@ -4293,7 +3921,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 333 + 335
    @@ -4303,7 +3931,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 334 + 336
    @@ -4313,7 +3941,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 335 + 337
    @@ -4323,7 +3951,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 336 + 338
    @@ -4333,7 +3961,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 337 + 339
    @@ -4343,7 +3971,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 338 + 340
    @@ -4353,7 +3981,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 339 + 341
    @@ -4363,7 +3991,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 340 + 342
    @@ -4373,7 +4001,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 341 + 343
    @@ -4383,7 +4011,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 342 + 344
    @@ -4393,7 +4021,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 343 + 345
    @@ -4403,7 +4031,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 344 + 346
    @@ -4413,7 +4041,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 345 + 347
    @@ -4423,7 +4051,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 346 + 348
    @@ -4433,7 +4061,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 347 + 349
    @@ -4443,7 +4071,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 348 + 350
    @@ -4453,7 +4081,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 349 + 351
    @@ -4463,7 +4091,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 350 + 352
    @@ -4473,7 +4101,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 351 + 353
    @@ -4483,7 +4111,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 352 + 354
    @@ -4493,7 +4121,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 353 + 355
    @@ -4503,7 +4131,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 354 + 356
    @@ -4513,7 +4141,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 355 + 357
    @@ -4523,7 +4151,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 356 + 358
    @@ -4533,7 +4161,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 357 + 359
    @@ -4543,7 +4171,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 358 + 360
    @@ -4553,7 +4181,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 359 + 361
    @@ -4563,7 +4191,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 360 + 362
    @@ -4573,7 +4201,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 361 + 363
    @@ -4583,7 +4211,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 362 + 364
    @@ -4593,7 +4221,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 363 + 365
    @@ -4603,7 +4231,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 364 + 366
    @@ -4613,7 +4241,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 365 + 367
    @@ -4623,7 +4251,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 366 + 368
    @@ -4633,7 +4261,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 367 + 369
    @@ -4643,7 +4271,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 368 + 370
    @@ -4653,7 +4281,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 369 + 371
    @@ -4663,7 +4291,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 370 + 372
    @@ -4673,7 +4301,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 371 + 373
    @@ -4683,7 +4311,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 372 + 374
    @@ -4693,7 +4321,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 373 + 375
    @@ -4703,7 +4331,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 374 + 376
    @@ -4713,7 +4341,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 375 + 377
    @@ -4723,7 +4351,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 376 + 378
    @@ -4733,7 +4361,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 377 + 379
    @@ -4743,7 +4371,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 378 + 380
    @@ -4753,7 +4381,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 379 + 381
    @@ -4763,7 +4391,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 380 + 382
    @@ -4773,7 +4401,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 381 + 383
    @@ -4783,7 +4411,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 382 + 384
    @@ -4793,7 +4421,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 383 + 385
    @@ -4803,7 +4431,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 384 + 386
    @@ -4813,7 +4441,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 385 + 387
    @@ -4823,7 +4451,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 386 + 388
    @@ -4833,7 +4461,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 387 + 389
    @@ -4843,7 +4471,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 388 + 390
    @@ -4853,7 +4481,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 389 + 391
    @@ -4863,7 +4491,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 390 + 392
    @@ -4873,7 +4501,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 391 + 393
    @@ -4883,7 +4511,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 392 + 394
    @@ -4893,7 +4521,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 393 + 395
    @@ -4903,7 +4531,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 394 + 396
    @@ -4913,7 +4541,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 395 + 397
    @@ -4923,7 +4551,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 396 + 398
    @@ -4933,7 +4561,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 397 + 399
    @@ -4943,7 +4571,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 398 + 400
    @@ -4953,7 +4581,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 399 + 401
    @@ -4963,7 +4591,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 400 + 402
    @@ -4973,7 +4601,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 401 + 403
    @@ -4983,7 +4611,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 402 + 404
    @@ -4993,7 +4621,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 403 + 405
    @@ -5003,7 +4631,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 404 + 406
    @@ -5013,7 +4641,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 405 + 407
    @@ -5023,7 +4651,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 406 + 408
    @@ -5033,7 +4661,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 407 + 409
    @@ -5043,7 +4671,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 408 + 410
    @@ -5053,7 +4681,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 409 + 411
    @@ -5063,7 +4691,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 410 + 412
    @@ -5073,7 +4701,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 411 + 413
    @@ -5083,7 +4711,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 412 + 414
    @@ -5093,7 +4721,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 413 + 415
    @@ -5103,7 +4731,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 414 + 416
    @@ -5113,7 +4741,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 415 + 417
    @@ -5123,7 +4751,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 416 + 418
    @@ -5133,7 +4761,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 417 + 419
    @@ -15031,62 +14659,12 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    -
    @@ -296,12 +380,11 @@
    - - - - 296 - - -
    -   - log.Info("trustedSequencerURL ", trustedSequencerURL) -
    - - - - 297 - - -
    -   - } -
    - - - - 298 - - -
    -   - zkEVMClient := client.NewClient(trustedSequencerURL) -
    - - - - 299 - - -
    - - -
    -
    +
    @@ -300,7 +384,7 @@
    300 - -
    -   - etherManForL1 := []syncinterfaces.EthermanFullInterface{} -
    - - - - 301 -
      @@ -15095,7 +14673,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 302 + 301
    @@ -15105,7 +14683,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 303 + 302
    @@ -15115,7 +14693,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 304 + 303
    @@ -15125,7 +14703,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 305 + 304
    @@ -15135,7 +14713,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 306 + 305
    @@ -15145,7 +14723,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 307 + 306
    @@ -15156,11 +14734,11 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    -
    @@ -404,12 +487,12 @@
    +
    @@ -403,12 +487,12 @@
    - 404 + 403
    @@ -15170,7 +14748,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 405 + 404
    @@ -15180,7 +14758,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 406 + 405
    @@ -15190,7 +14768,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 407 + 406
    @@ -15200,7 +14778,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 408 + 407
    @@ -15210,7 +14788,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 409 + 408
    @@ -15220,7 +14798,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 410 + 409
    @@ -15230,7 +14808,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 411 + 410
    @@ -15240,7 +14818,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 412 + 411
    @@ -15250,7 +14828,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 413 + 412
    @@ -15260,7 +14838,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 414 + 413
    @@ -15270,7 +14848,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 415 + 414
    @@ -15281,11 +14859,11 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    -
    @@ -419,7 +502,12 @@
    +
    @@ -418,7 +502,12 @@
    - 419 + 418
    @@ -15295,7 +14873,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 420 + 419
    @@ -15305,7 +14883,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 421 + 420
    @@ -15315,7 +14893,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 422 + 421
    @@ -15375,7 +14953,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 423 + 422
    @@ -15385,7 +14963,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 424 + 423
    @@ -15395,7 +14973,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 425 + 424
    @@ -15406,11 +14984,11 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    -
    @@ -428,7 +516,23 @@
    +
    @@ -427,7 +516,23 @@
    - 428 + 427
    @@ -15420,7 +14998,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 429 + 428
    @@ -15430,7 +15008,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 430 + 429
    @@ -15440,7 +15018,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 431 + 430
    @@ -15610,7 +15188,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 432 + 431
    @@ -15620,7 +15198,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 433 + 432
    @@ -15630,7 +15208,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 434 + 433
    @@ -15641,11 +15219,11 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    -
    @@ -498,7 +602,7 @@
    +
    @@ -497,7 +602,7 @@
    - 498 + 497
    @@ -15655,7 +15233,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 499 + 498
    @@ -15665,7 +15243,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 500 + 499
    @@ -15675,7 +15253,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 501 + 500
    @@ -15685,7 +15263,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 502 + 501
    @@ -15695,7 +15273,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 503 + 502
    @@ -15705,7 +15283,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 504 + 503
    @@ -15716,11 +15294,11 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    -
    @@ -521,13 +625,13 @@
    +
    @@ -520,13 +625,13 @@
    - 521 + 520
    @@ -15730,7 +15308,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 522 + 521
    @@ -15740,7 +15318,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 523 + 522
    @@ -15750,7 +15328,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 524 + 523
    @@ -15760,7 +15338,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 525 + 524
    @@ -15770,7 +15348,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 526 + 525
    @@ -15780,7 +15358,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 527 + 526
    @@ -15790,7 +15368,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 528 + 527
    @@ -15800,7 +15378,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 529 + 528
    @@ -15810,7 +15388,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 530 + 529
    @@ -15820,7 +15398,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 531 + 530
    @@ -15830,7 +15408,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 532 + 531
    @@ -15840,7 +15418,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 533 + 532
    @@ -17027,56 +16605,6 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

     
    - - - 380 - - -
    -   - log.Info("trustedSequencerURL ", trustedSequencerURL) -
    - - - - 381 - - -
    -   - } -
    - - - - 382 - - -
    -   - zkEVMClient := client.NewClient(trustedSequencerURL) -
    - - - - - - -
    -   -
    -
    - - - - 383 - - -
    -   - etherManForL1 := []syncinterfaces.EthermanFullInterface{} -
    - 384 @@ -23331,96 +22859,11 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    -
    @@ -103,6 +103,8 @@
    +
    @@ -160,6 +160,7 @@
    - 103 - - -
    -   - SyncChunkSize = 100 -
    - - - - 104 - - -
    -   - TrustedSequencerURL = "" # If it is empty or not specified, then the value is read from the smc -
    - - - - 105 - - -
    -   - L1SynchronizationMode = "sequential" -
    - - - - - - -
    -   -
    -
    - - - - - - -
    -   -
    -
    - - - - 106 - - -
    -   - [Synchronizer.L1ParallelSynchronization] -
    - - - - 107 - - -
    -   - MaxClients = 10 -
    - - - - 108 - - -
    -   - MaxPendingNoProcessedBlocks = 25 -
    - - - - -
    @@ -158,6 +160,7 @@
    - - - - 158 + 160
    @@ -23430,7 +22873,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 159 + 161
    @@ -23440,7 +22883,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 160 + 162
    @@ -23460,7 +22903,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 161 + 163
    @@ -23470,7 +22913,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 162 + 164
    @@ -23480,7 +22923,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 163 + 165
    @@ -23491,11 +22934,11 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    -
    @@ -172,6 +175,10 @@
    +
    @@ -174,6 +175,10 @@
    - 172 + 174
    @@ -23505,7 +22948,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 173 + 175
    @@ -23515,7 +22958,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 174 + 176
    @@ -23565,7 +23008,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 175 + 177
    @@ -23575,7 +23018,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 176 + 178
    @@ -23585,7 +23028,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 177 + 179
    @@ -23607,91 +23050,6 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

     
    - - - 103 - - -
    -   - SyncChunkSize = 100 -
    - - - - 104 - - -
    -   - TrustedSequencerURL = "" # If it is empty or not specified, then the value is read from the smc -
    - - - - 105 - - -
    -   - L1SynchronizationMode = "sequential" -
    - - - - 106 - - -
    - + - L1SyncCheckL2BlockHash = true -
    - - - - 107 - - -
    - + - L1SyncCheckL2BlockNumberhModulus = 30 -
    - - - - 108 - - -
    -   - [Synchronizer.L1ParallelSynchronization] -
    - - - - 109 - - -
    -   - MaxClients = 10 -
    - - - - 110 - - -
    -   - MaxPendingNoProcessedBlocks = 25 -
    - - - - -
     
    - 160 @@ -43957,229 +43315,6 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    -
    -
    - - {/home/stefan/go/src/Polygon/zkevm-node → .}/db/migrations/state/0017.sql - RENAMED - -
    -
    -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    @@ -0,0 +1,9 @@
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    -
    -
    -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
     
    -
    - 1 - -
    - + - -- +migrate Up -
    -
    - 2 - -
    - + - ALTER TABLE state.receipt -
    -
    - 3 - -
    - + - ADD COLUMN IF NOT EXISTS im_state_root BYTEA; -
    -
    - 4 - -
    - + -
    -
    -
    - 5 - -
    - + - 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)); -
    -
    - 6 - -
    - + -
    -
    -
    - 7 - -
    - + - -- +migrate Down -
    -
    - 8 - -
    - + - ALTER TABLE state.receipt -
    -
    - 9 - -
    - + - DROP COLUMN IF EXISTS im_state_root; -
    -
    -
    -
    -
    -
    @@ -45163,189 +44298,6 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    -
    -
    - - {/home/stefan/go/src/Polygon/zkevm-node → .}/docker-compose.yml - RENAMED - -
    -
    -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    @@ -107,7 +107,7 @@
    -
    - 107 - -
    -   - zkevm-prover: -
    -
    - 108 - -
    -   - container_name: zkevm-prover -
    -
    - 109 - -
    -   - restart: unless-stopped -
    -
    - 110 - -
    - - - image: hermeznetwork/zkevm-prover:v5.0.3 -
    -
    - 111 - -
    -   - depends_on: -
    -
    - 112 - -
    -   - zkevm-state-db: -
    -
    - 113 - -
    -   - condition: service_healthy -
    -
    -
    -
    -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
     
    -
    - 107 - -
    -   - zkevm-prover: -
    -
    - 108 - -
    -   - container_name: zkevm-prover -
    -
    - 109 - -
    -   - restart: unless-stopped -
    -
    - 110 - -
    - + - image: hermeznetwork/zkevm-prover:v5.0.6 -
    -
    - 111 - -
    -   - depends_on: -
    -
    - 112 - -
    -   - zkevm-state-db: -
    -
    - 113 - -
    -   - condition: service_healthy -
    -
    -
    -
    -
    -
    @@ -48812,7 +47764,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    -
    @@ -1375,32 +1315,95 @@
    +
    @@ -1375,32 +1315,123 @@
    @@ -48911,7 +47863,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - - if err != nil { + if err != nil {
    @@ -48921,7 +47873,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - - return nil, err + return nil, err
    @@ -48941,7 +47893,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - - coinbase := (data[1]).(common.Address) + coinbase := (data[1]).(common.Address)
    @@ -48951,7 +47903,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - - sequencedBatches := make([]SequencedBatch, len(sequences)) + sequencedBatches := make([]SequencedBatch, len(sequences))
    @@ -48961,7 +47913,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - - for i, seq := range sequences { + for i, seq := range sequences {
    @@ -48971,7 +47923,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - - bn := lastBatchNumber - uint64(len(sequences)-(i+1)) + bn := lastBatchNumber - uint64(len(sequences)-(i+1))
    @@ -48981,7 +47933,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - - s := seq + s := seq
    @@ -48991,7 +47943,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - - sequencedBatches[i] = SequencedBatch{ + sequencedBatches[i] = SequencedBatch{
    @@ -49011,7 +47963,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - - L1InfoRoot: &l1InfoRoot, + L1InfoRoot: &l1InfoRoot,
    @@ -49021,7 +47973,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - - SequencerAddr: sequencer, + SequencerAddr: sequencer,
    @@ -49031,37 +47983,47 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - - TxHash: txHash, + TxHash: txHash,
    - + 1397 - +
    - - Nonce: nonce, + Nonce: nonce,
    - + 1398 - +
    - - Coinbase: coinbase, + Coinbase: coinbase,
    - + 1399 - +
    - - PolygonRollupBaseEtrogBatchData: &s, + PolygonRollupBaseEtrogBatchData: &s, +
    + + + + 1400 + + +
    +   + }
    @@ -49695,13 +48657,313 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - - 1400 + + - -
    + +
      - } +
    +
    + + + + + + +
    +   +
    +
    + + + + + + +
    +   +
    +
    + + + + + + +
    +   +
    +
    + + + + + + +
    +   +
    +
    + + + + + + +
    +   +
    +
    + + + + + + +
    +   +
    +
    + + + + + + +
    +   +
    +
    + + + + + + +
    +   +
    +
    + + + + + + +
    +   +
    +
    + + + + + + +
    +   +
    +
    + + + + + + +
    +   +
    +
    + + + + + + +
    +   +
    +
    + + + + + + +
    +   +
    +
    + + + + + + +
    +   +
    +
    + + + + + + +
    +   +
    +
    + + + + + + +
    +   +
    +
    + + + + + + +
    +   +
    +
    + + + + + + +
    +   +
    +
    + + + + + + +
    +   +
    +
    + + + + + + +
    +   +
    +
    + + + + + + +
    +   +
    +
    + + + + + + +
    +   +
    +
    + + + + + + +
    +   +
    +
    + + + + + + +
    +   +
    +
    + + + + + + +
    +   +
    +
    + + + + + + +
    +   +
    +
    + + + + + + +
    +   +
    +
    + + + + + + +
    +   +
    +
    + + + + + + +
    +   +
    +
    + + + + + + +
    +   +
    @@ -49777,7 +49039,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    -
    @@ -1872,15 +1875,15 @@
    +
    @@ -1872,15 +1903,15 @@
    @@ -49932,7 +49194,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    -
    @@ -1901,20 +1904,20 @@
    +
    @@ -1901,20 +1932,20 @@
    @@ -50137,7 +49399,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    -
    @@ -1942,3 +1945,28 @@
    +
    @@ -1942,3 +1973,28 @@
    @@ -53450,7 +52712,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    + - switch method.Name { + var (
    @@ -53460,7 +52722,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    + - case "sequenceBatches": + maxSequenceTimestamp uint64
    @@ -53470,7 +52732,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    + - var sequences []polygonzkevm.PolygonRollupBaseEtrogBatchData + initSequencedBatchNumber uint64
    @@ -53480,7 +52742,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    + - err := json.Unmarshal(bytedata, &sequences) + coinbase common.Address
    @@ -53490,7 +52752,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    + - if err != nil { + dataAvailabilityMsg []byte
    @@ -53500,7 +52762,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    + - return nil, err + )
    @@ -53510,7 +52772,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    + - } +
    @@ -53520,7 +52782,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    + - maxSequenceTimestamp := data[1].(uint64) + switch method.Name {
    @@ -53530,7 +52792,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    + - initSequencedBatchNumber := data[2].(uint64) + case "sequenceBatches":
    @@ -53540,7 +52802,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    + - coinbase := data[3].(common.Address) + var sequences []polygonzkevm.PolygonRollupBaseEtrogBatchData
    @@ -53550,7 +52812,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    + - sequencedBatches := make([]SequencedBatch, len(sequences)) + err := json.Unmarshal(bytedata, &sequences)
    @@ -53560,7 +52822,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    + - for i, seq := range sequences { + if err != nil {
    @@ -53570,37 +52832,67 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    + - bn := lastBatchNumber - uint64(len(sequences)-(i+1)) + return nil, err
    - + + + + +
    +   +
    +
    + + + + + + +
    +   +
    +
    + + + + + + +
    +   +
    +
    + + + 1336 - +
    - + - s := seq +   + }
    - + 1337 - +
    + - batch := SequencedBatch{ +
    - + 1338 - +
    + - BatchNumber: bn, + switch forkID {
    @@ -53610,7 +52902,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    + - L1InfoRoot: &l1InfoRoot, + case state.FORKID_ETROG:
    @@ -53620,7 +52912,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    + - SequencerAddr: sequencer, + coinbase = data[1].(common.Address)
    @@ -53630,7 +52922,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    + - TxHash: txHash, +
    @@ -53640,7 +52932,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    + - Nonce: nonce, + case state.FORKID_ELDERBERRY:
    @@ -53650,7 +52942,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    + - Coinbase: coinbase, + maxSequenceTimestamp = data[1].(uint64)
    @@ -53660,7 +52952,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    + - PolygonRollupBaseEtrogBatchData: &s, + initSequencedBatchNumber = data[2].(uint64)
    @@ -53670,7 +52962,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    + - } + coinbase = data[3].(common.Address)
    @@ -53680,7 +52972,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    + - if forkID >= state.FORKID_ELDERBERRY { + }
    @@ -53690,7 +52982,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    + - batch.SequencedBatchElderberryData = &SequencedBatchElderberryData{ +
    @@ -53700,7 +52992,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    + - MaxSequenceTimestamp: maxSequenceTimestamp, + sequencedBatches := make([]SequencedBatch, len(sequences))
    @@ -53710,7 +53002,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    + - InitSequencedBatchNumber: initSequencedBatchNumber, + for i, seq := range sequences {
    @@ -53720,7 +53012,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    + - } + bn := lastBatchNumber - uint64(len(sequences)-(i+1))
    @@ -53730,7 +53022,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    + - } + s := seq
    @@ -53740,7 +53032,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    + - sequencedBatches[i] = batch + batch := SequencedBatch{
    @@ -53750,7 +53042,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    + - } + BatchNumber: bn,
    @@ -53760,7 +53052,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    + -
    + L1InfoRoot: &l1InfoRoot,
    @@ -53770,7 +53062,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    + - return sequencedBatches, nil + SequencerAddr: sequencer,
    @@ -53780,7 +53072,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    + - case "sequenceBatchesValidium": + TxHash: txHash,
    @@ -53790,7 +53082,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    + - var sequencesValidium []polygonzkevm.PolygonValidiumEtrogValidiumBatchData + Nonce: nonce,
    @@ -53800,7 +53092,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    + - err := json.Unmarshal(bytedata, &sequencesValidium) + Coinbase: coinbase,
    @@ -53810,7 +53102,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    + - if err != nil { + PolygonRollupBaseEtrogBatchData: &s,
    @@ -53820,7 +53112,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    + - return nil, err + }
    @@ -53830,7 +53122,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    + - } + if forkID >= state.FORKID_ELDERBERRY {
    @@ -53840,7 +53132,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    + - maxSequenceTimestamp := data[1].(uint64) + batch.SequencedBatchElderberryData = &SequencedBatchElderberryData{
    @@ -53850,7 +53142,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    + - initSequencedBatchNumber := data[2].(uint64) + MaxSequenceTimestamp: maxSequenceTimestamp,
    @@ -53860,7 +53152,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    + - coinbase := data[3].(common.Address) + InitSequencedBatchNumber: initSequencedBatchNumber,
    @@ -53870,7 +53162,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    + - dataAvailabilityMessage := (data[4]).([]byte) + }
    @@ -53880,7 +53172,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    + - sequencedBatches := make([]SequencedBatch, len(sequencesValidium)) + }
    @@ -53890,7 +53182,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    + - var batchNums []uint64 + sequencedBatches[i] = batch
    @@ -53900,7 +53192,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    + - var hashes []common.Hash + }
    @@ -53910,7 +53202,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    + - for i, validiumData := range sequencesValidium { +
    @@ -53920,7 +53212,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    + - bn := lastBatchNumber - uint64(len(sequencesValidium)-(i+1)) + return sequencedBatches, nil
    @@ -53930,7 +53222,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    + - batchNums = append(batchNums, bn) + case "sequenceBatchesValidium":
    @@ -53940,7 +53232,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    + - hashes = append(hashes, validiumData.TransactionsHash) + var sequencesValidium []polygonzkevm.PolygonValidiumEtrogValidiumBatchData
    @@ -53950,7 +53242,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    + - } + err := json.Unmarshal(bytedata, &sequencesValidium)
    @@ -53960,7 +53252,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    + - batchL2Data, err := da.GetBatchL2Data(batchNums, hashes, dataAvailabilityMessage) + if err != nil {
    @@ -53970,7 +53262,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    + - if err != nil { + return nil, err
    @@ -53980,7 +53272,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    + - return nil, err + }
    @@ -53990,7 +53282,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    + - } +
    @@ -54000,7 +53292,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    + - for i, bn := range batchNums { + switch forkID {
    @@ -54010,7 +53302,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    + - s := polygonzkevm.PolygonRollupBaseEtrogBatchData{ + case state.FORKID_ETROG:
    @@ -54020,7 +53312,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    + - Transactions: batchL2Data[i], + coinbase = data[1].(common.Address)
    @@ -54030,7 +53322,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    + - ForcedGlobalExitRoot: sequencesValidium[i].ForcedGlobalExitRoot, + dataAvailabilityMsg = data[2].([]byte)
    @@ -54040,7 +53332,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    + - ForcedTimestamp: sequencesValidium[i].ForcedTimestamp, +
    @@ -54050,7 +53342,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    + - ForcedBlockHashL1: sequencesValidium[i].ForcedBlockHashL1, + case state.FORKID_ELDERBERRY:
    @@ -54060,7 +53352,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    + - } + maxSequenceTimestamp = data[1].(uint64)
    @@ -54070,7 +53362,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    + - batch := SequencedBatch{ + initSequencedBatchNumber = data[2].(uint64)
    @@ -54080,7 +53372,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    + - BatchNumber: bn, + coinbase = data[3].(common.Address)
    @@ -54090,7 +53382,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    + - L1InfoRoot: &l1InfoRoot, + dataAvailabilityMsg = data[4].([]byte)
    @@ -54100,7 +53392,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    + - SequencerAddr: sequencer, + }
    @@ -54110,7 +53402,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    + - TxHash: txHash, +
    @@ -54120,7 +53412,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    + - Nonce: nonce, + sequencedBatches := make([]SequencedBatch, len(sequencesValidium))
    @@ -54130,7 +53422,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    + - Coinbase: coinbase, +
    @@ -54140,7 +53432,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    + - PolygonRollupBaseEtrogBatchData: &s, + var (
    @@ -54150,7 +53442,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    + - } + batchNums []uint64
    @@ -54160,7 +53452,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    + - if forkID >= state.FORKID_ELDERBERRY { + hashes []common.Hash
    @@ -54170,7 +53462,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    + - elderberry := &SequencedBatchElderberryData{ + )
    @@ -54180,7 +53472,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    + - MaxSequenceTimestamp: maxSequenceTimestamp, +
    @@ -54190,7 +53482,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    + - InitSequencedBatchNumber: initSequencedBatchNumber, + for i, validiumData := range sequencesValidium {
    @@ -54200,7 +53492,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    + - } + bn := lastBatchNumber - uint64(len(sequencesValidium)-(i+1))
    @@ -54210,7 +53502,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    + - batch.SequencedBatchElderberryData = elderberry + batchNums = append(batchNums, bn)
    @@ -54220,7 +53512,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    + - } + hashes = append(hashes, validiumData.TransactionsHash)
    @@ -54230,23 +53522,303 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    + - sequencedBatches[i] = batch + }
    - + 1402 - +
    -   - } + + + batchL2Data, err := da.GetBatchL2Data(batchNums, hashes, dataAvailabilityMsg)
    1403 + +
    + + + if err != nil { +
    + + + + 1404 + + +
    + + + return nil, err +
    + + + + 1405 + + +
    + + + } +
    + + + + 1406 + + +
    + + + for i, bn := range batchNums { +
    + + + + 1407 + + +
    + + + s := polygonzkevm.PolygonRollupBaseEtrogBatchData{ +
    + + + + 1408 + + +
    + + + Transactions: batchL2Data[i], +
    + + + + 1409 + + +
    + + + ForcedGlobalExitRoot: sequencesValidium[i].ForcedGlobalExitRoot, +
    + + + + 1410 + + +
    + + + ForcedTimestamp: sequencesValidium[i].ForcedTimestamp, +
    + + + + 1411 + + +
    + + + ForcedBlockHashL1: sequencesValidium[i].ForcedBlockHashL1, +
    + + + + 1412 + + +
    + + + } +
    + + + + 1413 + + +
    + + + batch := SequencedBatch{ +
    + + + + 1414 + + +
    + + + BatchNumber: bn, +
    + + + + 1415 + + +
    + + + L1InfoRoot: &l1InfoRoot, +
    + + + + 1416 + + +
    + + + SequencerAddr: sequencer, +
    + + + + 1417 + + +
    + + + TxHash: txHash, +
    + + + + 1418 + + +
    + + + Nonce: nonce, +
    + + + + 1419 + + +
    + + + Coinbase: coinbase, +
    + + + + 1420 + + +
    + + + PolygonRollupBaseEtrogBatchData: &s, +
    + + + + 1421 + + +
    + + + } +
    + + + + 1422 + + +
    + + + if forkID >= state.FORKID_ELDERBERRY { +
    + + + + 1423 + + +
    + + + elderberry := &SequencedBatchElderberryData{ +
    + + + + 1424 + + +
    + + + MaxSequenceTimestamp: maxSequenceTimestamp, +
    + + + + 1425 + + +
    + + + InitSequencedBatchNumber: initSequencedBatchNumber, +
    + + + + 1426 + + +
    + + + } +
    + + + + 1427 + + +
    + + + batch.SequencedBatchElderberryData = elderberry +
    + + + + 1428 + + +
    + + + } +
    + + + + 1429 + + +
    + + + sequencedBatches[i] = batch +
    + + + + 1430 + + +
    + + + } +
    + + + + 1431 +
    + @@ -54255,7 +53827,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 1404 + 1432
    @@ -54265,7 +53837,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 1405 + 1433
    @@ -54275,7 +53847,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 1406 + 1434
    @@ -54285,7 +53857,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 1407 + 1435
    @@ -54295,7 +53867,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 1408 + 1436
    @@ -54305,7 +53877,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 1409 + 1437
    @@ -54320,7 +53892,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 1875 + 1903
    @@ -54330,7 +53902,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 1876 + 1904
    @@ -54340,7 +53912,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 1877 + 1905
    @@ -54350,7 +53922,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 1878 + 1906
    @@ -54360,7 +53932,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 1879 + 1907
    @@ -54370,7 +53942,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 1880 + 1908
    @@ -54380,7 +53952,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 1881 + 1909
    @@ -54390,7 +53962,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 1882 + 1910
    @@ -54400,7 +53972,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 1883 + 1911
    @@ -54410,7 +53982,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 1884 + 1912
    @@ -54420,7 +53992,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 1885 + 1913
    @@ -54430,7 +54002,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 1886 + 1914
    @@ -54440,7 +54012,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 1887 + 1915
    @@ -54450,7 +54022,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 1888 + 1916
    @@ -54460,7 +54032,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 1889 + 1917
    @@ -54475,7 +54047,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 1904 + 1932
    @@ -54485,7 +54057,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 1905 + 1933
    @@ -54495,7 +54067,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 1906 + 1934
    @@ -54505,7 +54077,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 1907 + 1935
    @@ -54515,7 +54087,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 1908 + 1936
    @@ -54525,7 +54097,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 1909 + 1937
    @@ -54535,7 +54107,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 1910 + 1938
    @@ -54545,7 +54117,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 1911 + 1939
    @@ -54555,7 +54127,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 1912 + 1940
    @@ -54565,7 +54137,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 1913 + 1941
    @@ -54575,7 +54147,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 1914 + 1942
    @@ -54585,7 +54157,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 1915 + 1943
    @@ -54595,7 +54167,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 1916 + 1944
    @@ -54605,7 +54177,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 1917 + 1945
    @@ -54615,7 +54187,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 1918 + 1946
    @@ -54625,7 +54197,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 1919 + 1947
    @@ -54635,7 +54207,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 1920 + 1948
    @@ -54645,7 +54217,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 1921 + 1949
    @@ -54655,7 +54227,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 1922 + 1950
    @@ -54665,7 +54237,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 1923 + 1951
    @@ -54680,7 +54252,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 1945 + 1973
    @@ -54690,7 +54262,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 1946 + 1974
    @@ -54700,7 +54272,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 1947 + 1975
    @@ -54710,7 +54282,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 1948 + 1976
    @@ -54720,7 +54292,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 1949 + 1977
    @@ -54730,7 +54302,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 1950 + 1978
    @@ -54740,7 +54312,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 1951 + 1979
    @@ -54750,7 +54322,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 1952 + 1980
    @@ -54760,7 +54332,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 1953 + 1981
    @@ -54770,7 +54342,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 1954 + 1982
    @@ -54780,7 +54352,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 1955 + 1983
    @@ -54790,7 +54362,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 1956 + 1984
    @@ -54800,7 +54372,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 1957 + 1985
    @@ -54810,7 +54382,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 1958 + 1986
    @@ -54820,7 +54392,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 1959 + 1987
    @@ -54830,7 +54402,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 1960 + 1988
    @@ -54840,7 +54412,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 1961 + 1989
    @@ -54850,7 +54422,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 1962 + 1990
    @@ -54860,7 +54432,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 1963 + 1991
    @@ -54870,7 +54442,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 1964 + 1992
    @@ -54880,7 +54452,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 1965 + 1993
    @@ -54890,7 +54462,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 1966 + 1994
    @@ -54900,7 +54472,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 1967 + 1995
    @@ -54910,7 +54482,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 1968 + 1996
    @@ -54920,7 +54492,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 1969 + 1997
    @@ -54930,7 +54502,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 1970 + 1998
    @@ -54940,7 +54512,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 1971 + 1999
    @@ -54950,7 +54522,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 1972 + 2000
    @@ -64634,81 +64206,6 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    "time"
    - - - -
    @@ -3311,7 +3312,7 @@
    - - - - 3311 - - -
    -   - receipt.Bloom = ethTypes.CreateBloom(ethTypes.Receipts{receipt}) -
    - - - - 3312 - - -
    -   -
    -
    - - - - 3313 - - -
    -   - rpcReceipt := types.Receipt{ -
    - - - - 3314 - - -
    - - - Root: stateRoot, -
    - - - - 3315 - - -
    -   - CumulativeGasUsed: types.ArgUint64(receipt.CumulativeGasUsed), -
    - - - - 3316 - - -
    -   - LogsBloom: receipt.Bloom, -
    - - - - 3317 - - -
    -   - Logs: receipt.Logs, -
    - @@ -67173,81 +66670,6 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

     
    - - - 3312 - - -
    -   - receipt.Bloom = ethTypes.CreateBloom(ethTypes.Receipts{receipt}) -
    - - - - 3313 - - -
    -   -
    -
    - - - - 3314 - - -
    -   - rpcReceipt := types.Receipt{ -
    - - - - 3315 - - -
    - + - Root: &stateRoot, -
    - - - - 3316 - - -
    -   - CumulativeGasUsed: types.ArgUint64(receipt.CumulativeGasUsed), -
    - - - - 3317 - - -
    -   - LogsBloom: receipt.Bloom, -
    - - - - 3318 - - -
    -   - Logs: receipt.Logs, -
    - - - - -
     
    - 5417 @@ -70508,189 +69930,6 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    -
    -
    - - {/home/stefan/go/src/Polygon/zkevm-node → .}/jsonrpc/endpoints_zkevm_test.go - RENAMED - -
    -
    -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    @@ -2260,7 +2260,7 @@
    -
    - 2260 - -
    -   - receipt.Bloom = ethTypes.CreateBloom(ethTypes.Receipts{receipt}) -
    -
    - 2261 - -
    -   -
    -
    -
    - 2262 - -
    -   - rpcReceipt := types.Receipt{ -
    -
    - 2263 - -
    - - - Root: stateRoot, -
    -
    - 2264 - -
    -   - CumulativeGasUsed: types.ArgUint64(receipt.CumulativeGasUsed), -
    -
    - 2265 - -
    -   - LogsBloom: receipt.Bloom, -
    -
    - 2266 - -
    -   - Logs: receipt.Logs, -
    -
    -
    -
    -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
     
    -
    - 2260 - -
    -   - receipt.Bloom = ethTypes.CreateBloom(ethTypes.Receipts{receipt}) -
    -
    - 2261 - -
    -   -
    -
    -
    - 2262 - -
    -   - rpcReceipt := types.Receipt{ -
    -
    - 2263 - -
    - + - Root: &stateRoot, -
    -
    - 2264 - -
    -   - CumulativeGasUsed: types.ArgUint64(receipt.CumulativeGasUsed), -
    -
    - 2265 - -
    -   - LogsBloom: receipt.Bloom, -
    -
    - 2266 - -
    -   - Logs: receipt.Logs, -
    -
    -
    -
    -
    -
    @@ -72742,271 +71981,6 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    Hash *common.Hash
    - - - -
    @@ -601,7 +618,7 @@
    - - - - 601 - - -
    -   -
    -
    - - - - 602 - - -
    -   - // Receipt structure -
    - - - - 603 - - -
    -   - type Receipt struct { -
    - - - - 604 - - -
    - - - Root common.Hash `json:"root"` -
    - - - - 605 - - -
    -   - CumulativeGasUsed ArgUint64 `json:"cumulativeGasUsed"` -
    - - - - 606 - - -
    -   - LogsBloom types.Bloom `json:"logsBloom"` -
    - - - - 607 - - -
    -   - Logs []*types.Log `json:"logs"` -
    - - - - -
    @@ -643,7 +660,6 @@
    - - - - 643 - - -
    -   - return Receipt{}, err -
    - - - - 644 - - -
    -   - } -
    - - - - 645 - - -
    -   - receipt := Receipt{ -
    - - - - 646 - - -
    - - - Root: common.BytesToHash(r.PostState), -
    - - - - 647 - - -
    -   - CumulativeGasUsed: ArgUint64(r.CumulativeGasUsed), -
    - - - - 648 - - -
    -   - LogsBloom: r.Bloom, -
    - - - - 649 - - -
    -   - Logs: logs, -
    - - - - -
    @@ -659,6 +675,11 @@
    - - - - 659 - - -
    -   - Type: ArgUint64(r.Type), -
    - - - - 660 - - -
    -   - TxL2Hash: l2Hash, -
    - - - - 661 - - -
    -   - } -
    - - - - - - -
    -   -
    -
    - - - - - - -
    -   -
    -
    - - - - - - -
    -   -
    -
    - - - - - - -
    -   -
    -
    - - - - - - -
    -   -
    -
    - - - - 662 - - -
    -   - if r.EffectiveGasPrice != nil { -
    - - - - 663 - - -
    -   - egp := ArgBig(*r.EffectiveGasPrice) -
    - - - - 664 - - -
    -   - receipt.EffectiveGasPrice = &egp -
    - @@ -73251,271 +72225,6 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    Hash *common.Hash
    - - - -
     
    - - - - 618 - - -
    -   -
    -
    - - - - 619 - - -
    -   - // Receipt structure -
    - - - - 620 - - -
    -   - type Receipt struct { -
    - - - - 621 - - -
    - + - Root *common.Hash `json:"root,omitempty"` -
    - - - - 622 - - -
    -   - CumulativeGasUsed ArgUint64 `json:"cumulativeGasUsed"` -
    - - - - 623 - - -
    -   - LogsBloom types.Bloom `json:"logsBloom"` -
    - - - - 624 - - -
    -   - Logs []*types.Log `json:"logs"` -
    - - - - -
     
    - - - - 660 - - -
    -   - return Receipt{}, err -
    - - - - 661 - - -
    -   - } -
    - - - - 662 - - -
    -   - receipt := Receipt{ -
    - - - - - - -
    -   -
    -
    - - - - 663 - - -
    -   - CumulativeGasUsed: ArgUint64(r.CumulativeGasUsed), -
    - - - - 664 - - -
    -   - LogsBloom: r.Bloom, -
    - - - - 665 - - -
    -   - Logs: logs, -
    - - - - -
     
    - - - - 675 - - -
    -   - Type: ArgUint64(r.Type), -
    - - - - 676 - - -
    -   - TxL2Hash: l2Hash, -
    - - - - 677 - - -
    -   - } -
    - - - - 678 - - -
    - + - if len(r.PostState) > 0 { -
    - - - - 679 - - -
    - + - root := common.BytesToHash(r.PostState) -
    - - - - 680 - - -
    - + - receipt.Root = &root -
    - - - - 681 - - -
    - + - } -
    - - - - 682 - - -
    - + -
    -
    - - - - 683 - - -
    -   - if r.EffectiveGasPrice != nil { -
    - - - - 684 - - -
    -   - egp := ArgBig(*r.EffectiveGasPrice) -
    - - - - 685 - - -
    -   - receipt.EffectiveGasPrice = &egp -
    - @@ -81233,71 +79942,6 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    message L1DataV2 {
    - - - -
    @@ -872,4 +873,6 @@
    - - - - 872 - - -
    -   - EXECUTOR_ERROR_INVALID_DATA_STREAM = 115; -
    - - - - 873 - - -
    -   - // EXECUTOR_ERROR_INVALID_UPDATE_MERKLE_TREE indicates that the provided update merkle tree is invalid, e.g. because the executor is configured not to write to database -
    - - - - 874 - - -
    -   - EXECUTOR_ERROR_INVALID_UPDATE_MERKLE_TREE = 116; -
    - - - - - - -
    -   -
    -
    - - - - - - -
    -   -
    -
    - - - - 875 - - -
    -   - } -
    - @@ -81382,71 +80026,6 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    message L1DataV2 {
    - - - -
     
    - - - - 873 - - -
    -   - EXECUTOR_ERROR_INVALID_DATA_STREAM = 115; -
    - - - - 874 - - -
    -   - // EXECUTOR_ERROR_INVALID_UPDATE_MERKLE_TREE indicates that the provided update merkle tree is invalid, e.g. because the executor is configured not to write to database -
    - - - - 875 - - -
    -   - EXECUTOR_ERROR_INVALID_UPDATE_MERKLE_TREE = 116; -
    - - - - 876 - - -
    - + - // EXECUTOR_ERROR_SM_MAIN_INVALID_TX_STATUS_ERROR indicates that a TX has an invalid status-error combination -
    - - - - 877 - - -
    - + - EXECUTOR_ERROR_SM_MAIN_INVALID_TX_STATUS_ERROR = 117; -
    - - - - 878 - - -
    -   - } -
    - @@ -81474,11 +80053,11 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    -
    @@ -363,6 +363,7 @@
    +
    @@ -390,6 +390,7 @@
    - 363 + 390
    @@ -81488,7 +80067,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 364 + 391
    @@ -81498,7 +80077,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 365 + 392
    @@ -81518,7 +80097,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 366 + 393
    @@ -81528,7 +80107,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 367 + 394
    @@ -81538,7 +80117,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 368 + 395
    @@ -81562,7 +80141,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 363 + 390
    @@ -81572,7 +80151,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 364 + 391
    @@ -81582,7 +80161,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 365 + 392
    @@ -81592,7 +80171,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 366 + 393
    @@ -81602,7 +80181,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 367 + 394
    @@ -81612,7 +80191,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 368 + 395
    @@ -81622,7 +80201,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 369 + 396
    @@ -86485,12 +85064,12 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    -
    +
    {/home/stefan/go/src/Polygon/zkevm-node → .}/state/convertersV2.go + {/home/stefan/go/src/Polygon/zkevm-node → .}/state/genesis.go RENAMED
    -
    +
    {/home/stefan/go/src/Polygon/zkevm-node → .}/state/datastream.go + {/home/stefan/go/src/Polygon/zkevm-node → .}/state/interfaces.go RENAMED
    +
    +
    +
    + + + - - - - - - - - + + +
    -
    @@ -553,6 +554,9 @@
    +
     
    - 553 + 150
      - } + GetBlockByNumber(ctx context.Context, blockNumber uint64, dbTx pgx.Tx) (*Block, error)
    - 554 + 151
      -
    + GetVirtualBatchParentHash(ctx context.Context, batchNumber uint64, dbTx pgx.Tx) (common.Hash, error)
    - 555 + 152
      - for _, tx := range l2Block.Txs { -
    -
    - - -
    -   -
    + GetForcedBatchParentHash(ctx context.Context, forcedBatchNumber uint64, dbTx pgx.Tx) (common.Hash, error)
    - + + 153 -
    -   -
    +
    +
    + + + GetBatchL2DataByNumber(ctx context.Context, batchNumber uint64, dbTx pgx.Tx) ([]byte, error)
    - + + 154 -
    -   -
    +
    +
    + + + GetBatchL2DataByNumbers(ctx context.Context, batchNumbers []uint64, dbTx pgx.Tx) (map[uint64][]byte, error)
    - 556 + 155
      - if l2Block.ForkID < FORKID_ETROG { + GetLatestBatchGlobalExitRoot(ctx context.Context, dbTx pgx.Tx) (common.Hash, error)
    - 557 + 156
      - // Populate intermediate state root with information from the system SC (or cache if available) + GetL2TxHashByTxHash(ctx context.Context, hash common.Hash, dbTx pgx.Tx) (*common.Hash, error)
    - 558 + 157
      - if imStateRoots == nil || (*imStateRoots)[blockStart.L2BlockNumber] == nil { + GetSyncInfoData(ctx context.Context, dbTx pgx.Tx) (SyncInfoDataOnStorage, error)
    +
    +
    +
    +
    +
    +
    + + {/home/stefan/go/src/Polygon/zkevm-node → .}/state/pgstatestorage/pgstatestorage.go + RENAMED + +
    +
    +
    +
    + + + @@ -86911,376 +85583,323 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - - - - - - - - -
    -
    @@ -565,6 +569,8 @@
    +
    @@ -355,3 +355,49 @@
    - 565 + 355
      - } else { + }
    - 566 + 356
      - tx.StateRoot = common.BytesToHash((*imStateRoots)[blockStart.L2BlockNumber]) + return nativeBlockHashes, nil
    - 567 + 357
      - } + }
    - 568 + + -
    +
    +
      - } +
    - 569 + + -
    +
    +
     
    - 570 + + -
    +
    +
      - _, err = streamServer.AddStreamEntry(EntryTypeL2Tx, tx.Encode()) -
    -
    -
    +
    -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
     
    - 118 + + -
    +
    +
      - // DSL2Transaction represents a data stream L2 transaction +
    - 119 + + -
    +
    +
      - type DSL2Transaction struct { +
    - 120 + + -
    +
    +
      - L2BlockNumber uint64 // Not included in the encoded data +
    - 121 + + -
    - + - ImStateRoot common.Hash // Not included in the encoded data +
    +
    +   +
    - 122 + + -
    +
    +
      - EffectiveGasPricePercentage uint8 // 1 byte +
    - 123 + + -
    +
    +
      - IsValid uint8 // 1 byte +
    - 124 + + -
    +
    +
      - StateRoot common.Hash // 32 bytes +
    -
     
    -
    - 554 + + -
    +
    +
      - } +
    - 555 + + -
    +
    +
     
    - 556 + + -
    +
    +
      - for _, tx := range l2Block.Txs { +
    - 557 + + -
    - + - // < ETROG => IM State root is retrieved from the system SC (using cache is available) +
    +
    +   +
    - 558 + + -
    - + - // = ETROG => IM State root is retrieved from the receipt.post_state => Do nothing +
    +
    +   +
    - 559 + + -
    - + - // > ETROG => IM State root is retrieved from the receipt.im_state_root +
    +
    +   +
    - 560 + + -
    +
    +
      - if l2Block.ForkID < FORKID_ETROG { +
    - 561 + + -
    +
    +
      - // Populate intermediate state root with information from the system SC (or cache if available) +
    - 562 + + -
    +
    +
      - if imStateRoots == nil || (*imStateRoots)[blockStart.L2BlockNumber] == nil { +
    -
     
    -
    - 569 + + -
    +
    +
      - } else { +
    - 570 + + -
    +
    +
      - tx.StateRoot = common.BytesToHash((*imStateRoots)[blockStart.L2BlockNumber]) +
    - 571 + + -
    +
    +
      - } +
    - 572 + + -
    - + - } else if l2Block.ForkID > FORKID_ETROG { +
    +
    +   +
    - 573 + + -
    - + - tx.StateRoot = tx.ImStateRoot +
    +
    +   +
    - 574 + + -
    +
    +
      - } +
    - 575 + + -
    +
    +
     
    - 576 + + -
    +
    +
      - _, err = streamServer.AddStreamEntry(EntryTypeL2Tx, tx.Encode()) -
    -
    -
    +
    -
    -
    -
    -
    - - {/home/stefan/go/src/Polygon/zkevm-node → .}/state/genesis.go - RENAMED - -
    -
    -
    -
    - - - - - - - - - - - - - - - @@ -87304,108 +85923,103 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - - - - - - - - - - - - - - - - - - - - - - - @@ -87424,501 +86038,571 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - - - - - - - - - - - - + - - - - - - + + + + + + + + + - - - - - - - - - - -
    -
    @@ -19,8 +19,10 @@
    - 19 + + -
    +
    +
     
    - 20 + + -
    +
    +
      - // Genesis contains the information to populate state on creation +
    - 21 + + -
    +
    +
      - type Genesis struct { +
    - 22 + + -
    - - - // BlockNumber is the block number where the polygonZKEVM smc was deployed on L1 +
    +
    +   +
    - 23 + + -
    - - - BlockNumber uint64 +
    +
    +   +
    - 24 + + -
    +
    +
      - // Root hash of the genesis block +
    - 25 + + -
    +
    +
      - Root common.Hash +
    - 26 + + -
    +
    +
      - // Actions is the data to populate into the state trie +
    -
    @@ -204,7 +206,7 @@
    -
    - 204 + + -
    +
    +
      - storeTxsEGPData := []StoreTxEGPData{} +
    - 205 + + -
    +
    +
      - txsL2Hash := []common.Hash{} +
    - 206 + + -
    +
    +
     
    - 207 + + -
    - - - err = s.AddL2Block(ctx, batch.BatchNumber, l2Block, receipts, txsL2Hash, storeTxsEGPData, dbTx) +
    +
    +   +
    - 208 + + -
    +
    +
      - if err != nil { +
    - 209 + + -
    +
    +
      - return common.Hash{}, err +
    - 210 + + -
    +
    +
      - } +
    - 19 + 355
      -
    + }
    - 20 + 356
      - // Genesis contains the information to populate state on creation + return nativeBlockHashes, nil
    - 21 + 357
      - type Genesis struct { + }
    - 22 + + 358 +
    + - // RollupBlockNumber is the block number where the polygonZKEVM smc was deployed on L1 +
    - 23 + + 359 +
    + - RollupBlockNumber uint64 + // GetBatchL2DataByNumber returns the batch L2 data of the given batch number.
    - 24 + 360
    + - // RollupManagerBlockNumber is the block number where the RollupManager smc was deployed on L1 + func (p *PostgresStorage) GetBatchL2DataByNumber(ctx context.Context, batchNumber uint64, dbTx pgx.Tx) ([]byte, error) {
    - 25 + 361
    + - RollupManagerBlockNumber uint64 + batchData, err := p.GetBatchL2DataByNumbers(ctx, []uint64{batchNumber}, dbTx)
    - 26 + + 362 +
    -   - // Root hash of the genesis block + + + if err != nil {
    - 27 + + 363 +
    -   - Root common.Hash + + + return nil, err
    - 28 + + 364 +
    -   - // Actions is the data to populate into the state trie + + + }
    -
     
    +
    + 365 + +
    + + + data, ok := batchData[batchNumber] +
    - 206 + + 366 +
    -   - storeTxsEGPData := []StoreTxEGPData{} + + + if !ok {
    - 207 + + 367 +
    -   - txsL2Hash := []common.Hash{} + + + return nil, state.ErrNotFound
    - 208 + + 368 +
    -   + + + } +
    +
    + 369 + +
    + + + return data, nil +
    +
    + 370 + +
    + + + } +
    +
    + 371 + +
    + +
    - 209 + + 372 +
    + - err = s.AddL2Block(ctx, batch.BatchNumber, l2Block, receipts, txsL2Hash, storeTxsEGPData, []common.Hash{}, dbTx) + // GetBatchL2DataByNumbers returns the batch L2 data of the given batch numbers. The data is a union of state.batch and state.forced_batch tables.
    - 210 + + 373 +
    -   - if err != nil { + + + func (p *PostgresStorage) GetBatchL2DataByNumbers(ctx context.Context, batchNumbers []uint64, dbTx pgx.Tx) (map[uint64][]byte, error) {
    - 211 + + 374 +
    -   - return common.Hash{}, err + + + const getBatchL2DataByBatchNumber = `
    - 212 + + 375 +
    -   - } + + + SELECT batch_num, raw_txs_data FROM state.batch WHERE batch_num = ANY($1)
    -
    + + + 376 + + +
    + + + UNION
    -
    -
    -
    -
    - - {/home/stefan/go/src/Polygon/zkevm-node → .}/state/helper.go - RENAMED - -
    -
    -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + - - - - - - - - + + + + +
    -
    @@ -279,19 +279,23 @@
    - 279 + + 377 +
    -   - } + + + SELECT forced_batch_num, convert_from(decode(raw_txs_data, 'hex'), 'UTF8')::bytea FROM state.forced_batch WHERE forced_batch_num = ANY($2)
    - 280 + + 378 +
    -   -
    + + + `
    - 281 + + 379 +
    -   - // GenerateReceipt generates a receipt from a processed transaction + + + q := p.getExecQuerier(dbTx)
    - 282 + + 380 +
    - - - func GenerateReceipt(blockNumber *big.Int, processedTx *ProcessTransactionResponse, txIndex uint) *types.Receipt { + + + rows, err := q.Query(ctx, getBatchL2DataByBatchNumber, batchNumbers, batchNumbers)
    - 283 + + 381 +
    -   - receipt := &types.Receipt{ + + + if errors.Is(err, pgx.ErrNoRows) {
    - 284 + + 382 +
    - - - Type: uint8(processedTx.Type), + + + return nil, state.ErrNotFound
    - 285 + + 383 +
    - - - PostState: processedTx.StateRoot.Bytes(), + + + } else if err != nil {
    - 286 + + 384 +
    - - - CumulativeGasUsed: processedTx.GasUsed, + + + return nil, err
    - 287 + + 385 +
    - - - BlockNumber: blockNumber, + + + }
    - 288 + + 386 +
    - - - GasUsed: processedTx.GasUsed, + + + defer rows.Close()
    - 289 + + 387 +
    - - - TxHash: processedTx.Tx.Hash(), + + + batchL2DataMap := make(map[uint64][]byte)
    - 290 + + 388 +
    - - - TransactionIndex: txIndex, + + + for rows.Next() {
    - 291 + + 389 +
    - - - ContractAddress: processedTx.CreateAddress, + + + var (
    - 292 + + 390 +
    - - - Logs: processedTx.Logs, + + + batchNum uint64
    - + + 391 -
    -   -
    +
    +
    + + + batchL2Data []byte
    - + + 392 -
    -   -
    +
    +
    + + + )
    - + + 393 -
    -   -
    +
    +
    + + + err := rows.Scan(&batchNum, &batchL2Data)
    - + + 394 -
    -   -
    +
    +
    + + + if err != nil {
    - + + 395 -
    -   -
    +
    +
    + + + return nil, err
    - 293 + + 396 +
    -   + + + } +
    +
    + 397 + +
    + + + batchL2DataMap[batchNum] = batchL2Data +
    +
    + 398 + +
    + + }
    - 294 + + 399 +
    - - -
    + + + if len(batchL2DataMap) == 0 {
    - 295 + + 400 +
    -   - if processedTx.EffectiveGasPrice != "" { + + + return nil, state.ErrNotFound
    - 296 + + 401 +
    -   - effectiveGasPrice, ok := big.NewInt(0).SetString(processedTx.EffectiveGasPrice, 0) + + + }
    - 297 + + 402 +
    -   - if !ok { + + + return batchL2DataMap, nil
    + 403 + +
    + + + } +
    +
    +
    +
    +
    +
    +
    +
    + + {/home/stefan/go/src/Polygon/zkevm-node → .}/state/pgstatestorage/pgstatestorage_test.go + RENAMED + +
    +
    +
    +
    + + + - - - - @@ -87962,267 +86646,263 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - - - - - - - - - - - - -
    -
    @@ -309,10 +313,14 @@
    +
    @@ -1132,6 +1132,82 @@
    - 309 + 1132
      - for i := 0; i < len(receipt.Logs); i++ { + require.NoError(t, dbTx.Commit(ctx))
    - 310 + 1133
      - receipt.Logs[i].TxHash = processedTx.Tx.Hash() + }
    - 311 + 1134
      - } +
    - 312 + + -
    - - - if processedTx.RomError == nil { +
    +
    +   +
    - 313 + + -
    - - - receipt.Status = types.ReceiptStatusSuccessful +
    +
    +   +
    - 314 + + -
    +
    +
      - } else { +
    - 315 + + -
    - - - receipt.Status = types.ReceiptStatusFailed +
    +
    +   +
    - 316 + + -
    +
    +
      - } +
    - 317 + + -
    +
    +
     
    - 318 + + -
    +
    +
      - return receipt +
    -
    + + + + + +
    +   +
    -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -88236,397 +86916,343 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
     
    - 279 + + -
    +
    +
      - } +
    - 280 + + -
    +
    +
     
    - 281 + + -
    +
    +
      - // GenerateReceipt generates a receipt from a processed transaction +
    - 282 + + -
    - + - func GenerateReceipt(blockNumber *big.Int, processedTx *ProcessTransactionResponse, txIndex uint, forkID uint64) *types.Receipt { +
    +
    +   +
    - 283 + + -
    +
    +
      - receipt := &types.Receipt{ +
    - 284 + + -
    - + - Type: uint8(processedTx.Type), +
    +
    +   +
    - 285 + + -
    - + - BlockNumber: blockNumber, +
    +
    +   +
    - 286 + + -
    - + - GasUsed: processedTx.GasUsed, +
    +
    +   +
    - 287 + + -
    - + - TxHash: processedTx.Tx.Hash(), +
    +
    +   +
    - 288 + + -
    - + - TransactionIndex: txIndex, +
    +
    +   +
    - 289 + + -
    - + - ContractAddress: processedTx.CreateAddress, +
    +
    +   +
    - 290 + + -
    - + - Logs: processedTx.Logs, +
    +
    +   +
    - 291 + + -
    - + - } +
    +
    +   +
    - 292 + + -
    - + - if forkID <= FORKID_ETROG { +
    +
    +   +
    - 293 + + -
    - + - receipt.PostState = processedTx.StateRoot.Bytes() +
    +
    +   +
    - 294 + + -
    - + - receipt.CumulativeGasUsed = processedTx.GasUsed +
    +
    +   +
    - 295 + + -
    - + - } else { +
    +
    +   +
    - 296 + + -
    - + - receipt.PostState = []byte{} +
    +
    +   +
    - 297 + + -
    - + - receipt.CumulativeGasUsed = processedTx.CumulativeGasUsed +
    +
    +   +
    - 298 + + -
    +
    +
      - } +
    - 299 + + -
    +
    +
      - if processedTx.EffectiveGasPrice != "" { +
    - 300 + + -
    +
    +
      - effectiveGasPrice, ok := big.NewInt(0).SetString(processedTx.EffectiveGasPrice, 0) +
    - 301 + + -
    +
    +
      - if !ok { +
    -
     
    -
    - 313 + + -
    +
    +
      - for i := 0; i < len(receipt.Logs); i++ { +
    - 314 + + -
    +
    +
      - receipt.Logs[i].TxHash = processedTx.Tx.Hash() +
    - 315 + + -
    +
    +
      - } +
    - 316 + + -
    - + - if forkID <= FORKID_ETROG { +
    +
    +   +
    - 317 + + -
    - + - if processedTx.RomError == nil { +
    +
    +   +
    - 318 + + -
    - + - receipt.Status = types.ReceiptStatusSuccessful +
    +
    +   +
    - 319 + + -
    - + - } else { +
    +
    +   +
    - 320 + + -
    - + - receipt.Status = types.ReceiptStatusFailed +
    +
    +   +
    - 321 + + -
    - + - } +
    +
    +   +
    - 322 + + -
    +
    +
      - } else { +
    - 323 + + -
    - + - receipt.Status = uint64(processedTx.Status) +
    +
    +   +
    - 324 + + -
    +
    +
      - } +
    - 325 + + -
    +
    +
     
    - 326 + + -
    +
    +
      - return receipt -
    -
    -
    +
    -
    -
    -
    -
    - - {/home/stefan/go/src/Polygon/zkevm-node → .}/state/interfaces.go - RENAMED - -
    -
    -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -88640,68 +87266,63 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - - - - - - - - - - - - - - - @@ -88726,1168 +87347,1166 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - - -
    -
    @@ -72,7 +72,7 @@
    - 72 + + -
    +
    +
      - GetL2BlockTransactionCountByHash(ctx context.Context, blockHash common.Hash, dbTx pgx.Tx) (uint64, error) +
    - 73 + + -
    +
    +
      - GetL2BlockTransactionCountByNumber(ctx context.Context, blockNumber uint64, dbTx pgx.Tx) (uint64, error) +
    - 74 + + -
    +
    +
      - GetTransactionEGPLogByHash(ctx context.Context, transactionHash common.Hash, dbTx pgx.Tx) (*EffectiveGasPriceLog, error) +
    - 75 + + -
    - - - AddL2Block(ctx context.Context, batchNumber uint64, l2Block *L2Block, receipts []*types.Receipt, txsL2Hash []common.Hash, txsEGPData []StoreTxEGPData, dbTx pgx.Tx) error +
    +
    +   +
    - 76 + + -
    +
    +
      - GetLastVirtualizedL2BlockNumber(ctx context.Context, dbTx pgx.Tx) (uint64, error) +
    - 77 + + -
    +
    +
      - GetLastConsolidatedL2BlockNumber(ctx context.Context, dbTx pgx.Tx) (uint64, error) +
    - 78 + + -
    +
    +
      - GetLastVerifiedL2BlockNumberUntilL1Block(ctx context.Context, l1FinalizedBlockNumber uint64, dbTx pgx.Tx) (uint64, error) +
    -
    @@ -93,7 +93,7 @@
    -
    - 93 + + -
    +
    +
      - IsL2BlockConsolidated(ctx context.Context, blockNumber uint64, dbTx pgx.Tx) (bool, error) +
    - 94 + + -
    +
    +
      - IsL2BlockVirtualized(ctx context.Context, blockNumber uint64, dbTx pgx.Tx) (bool, error) +
    - 95 + + -
    +
    +
      - GetLogs(ctx context.Context, fromBlock uint64, toBlock uint64, addresses []common.Address, topics [][]common.Hash, blockHash *common.Hash, since *time.Time, dbTx pgx.Tx) ([]*types.Log, error) -
    -
    - 96 - -
    - - - AddReceipt(ctx context.Context, receipt *types.Receipt, dbTx pgx.Tx) error +
    - 97 + + -
    +
    +
      - AddLog(ctx context.Context, l *types.Log, dbTx pgx.Tx) error +
    - 98 + + -
    +
    +
      - GetExitRootByGlobalExitRoot(ctx context.Context, ger common.Hash, dbTx pgx.Tx) (*GlobalExitRoot, error) +
    - 99 + + -
    +
    +
      - AddSequence(ctx context.Context, sequence Sequence, dbTx pgx.Tx) error +
    -
    @@ -121,7 +121,8 @@
    -
    - 121 + + -
    +
    +
      - GetBatchByForcedBatchNum(ctx context.Context, forcedBatchNumber uint64, dbTx pgx.Tx) (*Batch, error) +
    - 122 + + -
    +
    +
      - AddForkID(ctx context.Context, forkID ForkIDInterval, dbTx pgx.Tx) error +
    - 123 + + -
    +
    +
      - GetForkIDs(ctx context.Context, dbTx pgx.Tx) ([]ForkIDInterval, error) +
    - 124 + + -
    - - - UpdateForkID(ctx context.Context, forkID ForkIDInterval, dbTx pgx.Tx) error +
    +
    +   +
    - 125 + + -
    +
    +
      - GetNativeBlockHashesInRange(ctx context.Context, fromBlock, toBlock uint64, dbTx pgx.Tx) ([]common.Hash, error) +
    - 126 + + -
    +
    +
      - GetDSGenesisBlock(ctx context.Context, dbTx pgx.Tx) (*DSL2Block, error) +
    - 127 + + -
    +
    +
      - GetDSBatches(ctx context.Context, firstBatchNumber, lastBatchNumber uint64, readWIPBatch bool, dbTx pgx.Tx) ([]*DSBatch, error) +
    -
    @@ -149,6 +150,8 @@
    -
    - 149 + + -
    +
    +
      - GetBlockByNumber(ctx context.Context, blockNumber uint64, dbTx pgx.Tx) (*Block, error) +
    - 150 + + -
    +
    +
      - GetVirtualBatchParentHash(ctx context.Context, batchNumber uint64, dbTx pgx.Tx) (common.Hash, error) +
    - 151 + + -
    +
    +
      - GetForcedBatchParentHash(ctx context.Context, forcedBatchNumber uint64, dbTx pgx.Tx) (common.Hash, error) +
    - 152 + 1135
      - GetLatestBatchGlobalExitRoot(ctx context.Context, dbTx pgx.Tx) (common.Hash, error) + func createL1InfoTreeExitRootStorageEntryForTest(blockNumber uint64, index uint32) *state.L1InfoTreeExitRootStorageEntry {
    - 153 + 1136
      - GetL2TxHashByTxHash(ctx context.Context, hash common.Hash, dbTx pgx.Tx) (*common.Hash, error) + exitRoot := state.L1InfoTreeExitRootStorageEntry{
    - 154 + 1137
      - GetSyncInfoData(ctx context.Context, dbTx pgx.Tx) (SyncInfoDataOnStorage, error) + L1InfoTreeLeaf: state.L1InfoTreeLeaf{
    -
    -
    -
    -
    - - - + - - - - - - - - - - - - + - + + + + + - + + +
    -
     
    +
    @@ -1333,6 +1409,10 @@
    - 72 + 1333
      - GetL2BlockTransactionCountByHash(ctx context.Context, blockHash common.Hash, dbTx pgx.Tx) (uint64, error) + require.Equal(t, uint64(2002), fb.BlockNumber)
    - 73 + 1334
      - GetL2BlockTransactionCountByNumber(ctx context.Context, blockNumber uint64, dbTx pgx.Tx) (uint64, error) + require.Equal(t, "0x717e05de47a87a7d1679e183f1c224150675f6302b7da4eaab526b2b91ae0761", fb.GlobalExitRoot.String())
    - 74 + 1335
      - GetTransactionEGPLogByHash(ctx context.Context, transactionHash common.Hash, dbTx pgx.Tx) (*EffectiveGasPriceLog, error) + require.Equal(t, []byte{0xb}, fb.RawTxsData)
    - 75 + + -
    - + - AddL2Block(ctx context.Context, batchNumber uint64, l2Block *L2Block, receipts []*types.Receipt, txsL2Hash []common.Hash, txsEGPData []StoreTxEGPData, imStateRoots []common.Hash, dbTx pgx.Tx) error +
    +
    +   +
    - 76 + + -
    +
    +
      - GetLastVirtualizedL2BlockNumber(ctx context.Context, dbTx pgx.Tx) (uint64, error) +
    - 77 + + -
    +
    +
      - GetLastConsolidatedL2BlockNumber(ctx context.Context, dbTx pgx.Tx) (uint64, error) +
    - 78 + + -
    +
    +
      - GetLastVerifiedL2BlockNumberUntilL1Block(ctx context.Context, l1FinalizedBlockNumber uint64, dbTx pgx.Tx) (uint64, error) +
    -
     
    -
    - 93 + 1336
      - IsL2BlockConsolidated(ctx context.Context, blockNumber uint64, dbTx pgx.Tx) (bool, error) + }
    - 94 + 1337
      - IsL2BlockVirtualized(ctx context.Context, blockNumber uint64, dbTx pgx.Tx) (bool, error) +
    - 95 + 1338
      - GetLogs(ctx context.Context, fromBlock uint64, toBlock uint64, addresses []common.Address, topics [][]common.Hash, blockHash *common.Hash, since *time.Time, dbTx pgx.Tx) ([]*types.Log, error) + func TestGetLastGER(t *testing.T) {
    - 96 + +
    @@ -1409,5 +1489,4 @@
    +
    + 1409 +
    - + - AddReceipt(ctx context.Context, receipt *types.Receipt, imStateRoot common.Hash, dbTx pgx.Tx) error +   + ger, err = testState.GetLatestBatchGlobalExitRoot(ctx, dbTx)
    - 97 + 1410
      - AddLog(ctx context.Context, l *types.Log, dbTx pgx.Tx) error + require.NoError(t, err)
    - 98 + 1411
      - GetExitRootByGlobalExitRoot(ctx context.Context, ger common.Hash, dbTx pgx.Tx) (*GlobalExitRoot, error) + require.Equal(t, common.HexToHash("0x2").String(), ger.String()) +
    +
    + 1412 + +
    + - +
    - 99 + 1413
      - AddSequence(ctx context.Context, sequence Sequence, dbTx pgx.Tx) error + }
    +
    +
    +
    +
    + + + - - - - - - - - - - - - - - - - - - - - - - - - - -
     
    - 121 + 1132
      - GetBatchByForcedBatchNum(ctx context.Context, forcedBatchNumber uint64, dbTx pgx.Tx) (*Batch, error) + require.NoError(t, dbTx.Commit(ctx))
    - 122 + 1133
      - AddForkID(ctx context.Context, forkID ForkIDInterval, dbTx pgx.Tx) error + }
    - 123 + 1134
      - GetForkIDs(ctx context.Context, dbTx pgx.Tx) ([]ForkIDInterval, error) +
    - 124 + + 1135 +
    + - UpdateForkIDToBatchNumber(ctx context.Context, forkID ForkIDInterval, dbTx pgx.Tx) error + func TestGetBatchL2DataByNumber(t *testing.T) {
    - 125 + 1136
    + - UpdateForkIDBlockNumber(ctx context.Context, forkdID uint64, newBlockNumber uint64, updateMemCache bool, dbTx pgx.Tx) error + // Init database instance
    - 126 + + 1137 +
    -   - GetNativeBlockHashesInRange(ctx context.Context, fromBlock, toBlock uint64, dbTx pgx.Tx) ([]common.Hash, error) + + + initOrResetDB()
    - 127 + + 1138 +
    -   - GetDSGenesisBlock(ctx context.Context, dbTx pgx.Tx) (*DSL2Block, error) + + + ctx := context.Background()
    - 128 + + 1139 +
    -   - GetDSBatches(ctx context.Context, firstBatchNumber, lastBatchNumber uint64, readWIPBatch bool, dbTx pgx.Tx) ([]*DSBatch, error) + + + tx, err := testState.BeginStateTransaction(ctx)
    -
     
    -
    - 150 + + 1140 +
    -   - GetBlockByNumber(ctx context.Context, blockNumber uint64, dbTx pgx.Tx) (*Block, error) + + + require.NoError(t, err)
    - 151 + + 1141 +
    -   - GetVirtualBatchParentHash(ctx context.Context, batchNumber uint64, dbTx pgx.Tx) (common.Hash, error) + + + defer func() { require.NoError(t, tx.Commit(ctx)) }()
    - 152 + + 1142 +
    -   - GetForcedBatchParentHash(ctx context.Context, forcedBatchNumber uint64, dbTx pgx.Tx) (common.Hash, error) + + +
    - 153 + 1143
    + - GetBatchL2DataByNumber(ctx context.Context, batchNumber uint64, dbTx pgx.Tx) ([]byte, error) + // empty case
    - 154 + 1144
    + - GetBatchL2DataByNumbers(ctx context.Context, batchNumbers []uint64, dbTx pgx.Tx) (map[uint64][]byte, error) + var batchNum uint64 = 4
    - 155 + + 1145 +
    -   - GetLatestBatchGlobalExitRoot(ctx context.Context, dbTx pgx.Tx) (common.Hash, error) + + + const openBatchSQL = "INSERT INTO state.batch (batch_num, raw_txs_data, wip) VALUES ($1, $2, false)"
    - 156 + + 1146 +
    -   - GetL2TxHashByTxHash(ctx context.Context, hash common.Hash, dbTx pgx.Tx) (*common.Hash, error) + + + _, err = tx.Exec(ctx, openBatchSQL, batchNum, nil)
    - 157 + + 1147 +
    -   - GetSyncInfoData(ctx context.Context, dbTx pgx.Tx) (SyncInfoDataOnStorage, error) -
    -
    -
    + + + require.NoError(t, err)
    -
    -
    -
    -
    - - {/home/stefan/go/src/Polygon/zkevm-node → .}/state/pgstatestorage/datastream.go - RENAMED - -
    -
    -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    @@ -91,7 +91,7 @@
    - 91 + + 1148 +
    -   -
    + + + data, err := testState.GetBatchL2DataByNumber(ctx, batchNum, tx)
    - 92 + + 1149 +
    -   - // GetDSL2Transactions returns the L2 transactions + + + require.NoError(t, err)
    - 93 + + 1150 +
    -   - func (p *PostgresStorage) GetDSL2Transactions(ctx context.Context, firstL2Block, lastL2Block uint64, dbTx pgx.Tx) ([]*state.DSL2Transaction, error) { + + + assert.Nil(t, data)
    - 94 + + 1151 +
    - - - const l2TxSQL = `SELECT l2_block_num, t.effective_percentage, t.encoded, r.post_state + + +
    - 95 + + 1152 +
    -   - FROM state.transaction t, state.receipt r + + + // not empty case
    - 96 + + 1153 +
    -   - WHERE l2_block_num BETWEEN $1 AND $2 AND r.tx_hash = t.hash + + + expectedData := []byte("foo bar")
    - 97 + + 1154 +
    -   - ORDER BY t.l2_block_num ASC, r.tx_index ASC` + + + batchNum = 5
    -
    @@ -120,11 +120,13 @@
    -
    - 120 + + 1155 +
    -   - l2Transaction := state.DSL2Transaction{} + + + _, err = tx.Exec(ctx, openBatchSQL, batchNum, expectedData)
    - 121 + + 1156 +
    -   - encoded := []byte{} + + + require.NoError(t, err)
    - 122 + + 1157 +
    -   - postState := []byte{} + + + actualData, err := testState.GetBatchL2DataByNumber(ctx, batchNum, tx)
    - + + 1158 -
    -   -
    +
    +
    + + + require.NoError(t, err)
    - 123 + + 1159 +
    -   - if err := row.Scan( + + + assert.Equal(t, expectedData, actualData)
    - 124 + + 1160 +
    -   - &l2Transaction.L2BlockNumber, + + +
    - 125 + + 1161 +
    -   - &l2Transaction.EffectiveGasPricePercentage, + + + multiGet := []uint64{uint64(4), uint64(5), uint64(6)}
    - 126 + + 1162 +
    -   - &encoded, + + + allData, err := testState.GetBatchL2DataByNumbers(ctx, multiGet, tx)
    - 127 + + 1163 +
    -   - &postState, + + + require.NoError(t, err)
    - + + 1164 -
    -   -
    +
    +
    + + + require.Equal(t, expectedData, allData[uint64(5)])
    - 128 + + 1165 +
    -   - ); err != nil { + + + }
    - 129 + + 1166 +
    -   - return nil, err + + +
    - 130 + + 1167 +
    -   - } + + + func TestGetBatchL2DataByNumbers(t *testing.T) {
    -
    @@ -142,6 +144,7 @@
    -
    - 142 + + 1168 +
    -   - l2Transaction.EncodedLength = uint32(len(l2Transaction.Encoded)) + + + initOrResetDB()
    - 143 + + 1169 +
    -   - l2Transaction.IsValid = 1 + + + ctx := context.Background()
    - 144 + + 1170 +
    -   - l2Transaction.StateRoot = common.BytesToHash(postState) + + + tx, err := testState.BeginStateTransaction(ctx)
    - + + 1171 -
    -   -
    +
    +
    + + + require.NoError(t, err)
    - 145 + + 1172 +
    -   - return &l2Transaction, nil + + + defer func() { require.NoError(t, tx.Commit(ctx)) }()
    - 146 + + 1173 +
    -   - } + + +
    - 147 + + 1174 +
    -   -
    + + + var i1, i2, i3, i4, i5 = uint64(1), uint64(2), uint64(3), uint64(4), uint64(5)
    -
    + + + 1175 + + +
    + + + var d1, d2, d4 = []byte("foobar"), []byte("dingbat"), []byte{0xb}
    -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
     
    - 91 + + 1176 +
    -   + +
    - 92 + + 1177 +
    -   - // GetDSL2Transactions returns the L2 transactions + + + const insertBatch = "INSERT INTO state.batch (batch_num, raw_txs_data) VALUES ($1, $2)"
    - 93 + + 1178 +
    -   - func (p *PostgresStorage) GetDSL2Transactions(ctx context.Context, firstL2Block, lastL2Block uint64, dbTx pgx.Tx) ([]*state.DSL2Transaction, error) { + + + _, err = tx.Exec(ctx, insertBatch, i1, d1)
    - 94 + + 1179 +
    + - const l2TxSQL = `SELECT l2_block_num, t.effective_percentage, t.encoded, r.post_state, r.im_state_root + require.NoError(t, err)
    - 95 + + 1180 +
    -   - FROM state.transaction t, state.receipt r + + + _, err = tx.Exec(ctx, insertBatch, i2, d2)
    - 96 + + 1181 +
    -   - WHERE l2_block_num BETWEEN $1 AND $2 AND r.tx_hash = t.hash + + + require.NoError(t, err)
    - 97 + + 1182 +
    -   - ORDER BY t.l2_block_num ASC, r.tx_index ASC` + + + _, err = tx.Exec(ctx, insertBatch, i3, nil)
    -
     
    -
    - 120 + + 1183 +
    -   - l2Transaction := state.DSL2Transaction{} + + + require.NoError(t, err)
    - 121 + + 1184 +
    -   - encoded := []byte{} + + +
    - 122 + + 1185 +
    -   - postState := []byte{} + + + // Add a forced batch too, needs a block
    - 123 + 1186
    + - imStateRoot := []byte{} + block1 := *block
    - 124 + + 1187 +
    -   - if err := row.Scan( + + + block1.BlockNumber = 1000
    - 125 + + 1188 +
    -   - &l2Transaction.L2BlockNumber, + + + err = testState.AddBlock(ctx, &block1, tx)
    - 126 + + 1189 +
    -   - &l2Transaction.EffectiveGasPricePercentage, + + + require.NoError(t, err)
    - 127 + + 1190 +
    -   - &encoded, + + + err = tx.Commit(ctx)
    - 128 + + 1191 +
    -   - &postState, + + + require.NoError(t, err)
    - 129 + 1192
    + - &imStateRoot, +
    - 130 + + 1193 +
    -   - ); err != nil { + + + tx, err = testState.BeginStateTransaction(ctx)
    - 131 + + 1194 +
    -   - return nil, err + + + require.NoError(t, err)
    - 132 + + 1195 +
    -   - } + + +
    -
     
    -
    - 144 + + 1196 +
    -   - l2Transaction.EncodedLength = uint32(len(l2Transaction.Encoded)) + + + const insertForcedBatch = "INSERT INTO state.forced_batch (forced_batch_num, timestamp, raw_txs_data, block_num) VALUES (4, now(),'0b', 1000)"
    - 145 + + 1197 +
    -   - l2Transaction.IsValid = 1 + + + _, err = testState.Exec(ctx, insertForcedBatch)
    - 146 + + 1198 +
    -   - l2Transaction.StateRoot = common.BytesToHash(postState) + + + require.NoError(t, err)
    - 147 + 1199
    + - l2Transaction.ImStateRoot = common.BytesToHash(imStateRoot) +
    - 148 + + 1200 +
    -   - return &l2Transaction, nil + + + allData, err := testState.GetBatchL2DataByNumbers(ctx, []uint64{i1, i2, i3, i4, i5}, tx)
    - 149 + + 1201 +
    -   - } + + + require.NoError(t, err)
    - 150 + + 1202 +
    -   -
    -
    -
    -
    + + + assert.Equal(t, d1, allData[i1])
    -
    -
    -
    -
    - - {/home/stefan/go/src/Polygon/zkevm-node → .}/state/pgstatestorage/forkid.go - RENAMED - -
    -
    -
    -
    - - - - - - - - - - - - - - - - - + + + + + + + + + + + + - - - - + + + + + + + + + - - - - - + - + + - - - - @@ -89901,41 +88520,70 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - - + + +
    -
    @@ -51,7 +51,7 @@
    - 51 + + 1203 +
    -   - } + + + assert.Equal(t, d2, allData[i2])
    - 52 + + 1204 +
    -   -
    + + + assert.Nil(t, allData[i3])
    - 53 + + 1205 +
    -   - // UpdateForkID updates the forkID stored in db + + + assert.Equal(t, d4, allData[i4])
    - 54 + + 1206 +
    - - - func (p *PostgresStorage) UpdateForkID(ctx context.Context, forkID state.ForkIDInterval, dbTx pgx.Tx) error { + + +
    - 55 + + 1207 +
    -   - const updateForkIDSQL = "UPDATE state.fork_id SET to_batch_num = $1 WHERE fork_id = $2" + + + _, ok := allData[i5]
    - 56 + + 1208 +
    -   - e := p.getExecQuerier(dbTx) + + + assert.False(t, ok) +
    +
    + 1209 + +
    + + + } +
    +
    + 1210 + +
    + + +
    - 57 + 1211 + +
    +   + func createL1InfoTreeExitRootStorageEntryForTest(blockNumber uint64, index uint32) *state.L1InfoTreeExitRootStorageEntry { +
    +
    + 1212
      - if _, err := e.Exec(ctx, updateForkIDSQL, forkID.ToBatchNumber, forkID.ForkId); err != nil { + exitRoot := state.L1InfoTreeExitRootStorageEntry{ +
    +
    + 1213 + +
    +   + L1InfoTreeLeaf: state.L1InfoTreeLeaf{
    -
    @@ -60,6 +60,25 @@
    +
     
    - 60 + 1409
      - return nil + require.Equal(t, uint64(2002), fb.BlockNumber)
    - 61 + 1410
      - } + require.Equal(t, "0x717e05de47a87a7d1679e183f1c224150675f6302b7da4eaab526b2b91ae0761", fb.GlobalExitRoot.String())
    - 62 + 1411
      -
    + require.Equal(t, []byte{0xb}, fb.RawTxsData)
    - + + 1412 -
    -   +
    +
    + +
    - + + 1413 -
    +
    +
    + + + fbData, err := testState.GetBatchL2DataByNumber(ctx, 1, dbTx) +
    +
    + 1414 + +
    + + + require.NoError(t, err) +
    +
    + 1415 + +
    + + + require.Equal(t, []byte{0xb}, fbData) +
    +
    + 1416 + +
      -
    + }
    - + + 1417 -
    +
    +
     
    - + + 1418 -
    +
    +
      -
    + func TestGetLastGER(t *testing.T) {
    - + +
     
    -
    +
    + 1489 + +
      -
    + ger, err = testState.GetLatestBatchGlobalExitRoot(ctx, dbTx)
    - + + 1490 -
    +
    +
      -
    + require.NoError(t, err)
    - + + 1491 -
    +
    +
      -
    + require.Equal(t, common.HexToHash("0x2").String(), ger.String())
    - + + 1492 -
    +
    +
      -
    + } +
    +
    +
    +
    +
    +
    +
    + + {/home/stefan/go/src/Polygon/zkevm-node → .}/state/runtime/executor/client.go + RENAMED + +
    +
    +
    +
    + + + + + - - - - - - - + + +
    +
    @@ -10,6 +10,13 @@
    - + + 10 -
    +
    +
      -
    + "google.golang.org/grpc/credentials/insecure"
    - + + 11 -
    +
    +
      -
    + )
    - + + 12 -
    +
    +
     
    @@ -90012,107 +88660,176 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 63 + 13
      - // UpdateForkIDIntervalsInMemory updates the forkID intervals in memory + // NewExecutorClient is the executor client constructor.
    - 64 + 14
      - func (p *PostgresStorage) UpdateForkIDIntervalsInMemory(intervals []state.ForkIDInterval) { + func NewExecutorClient(ctx context.Context, c Config) (ExecutorServiceClient, *grpc.ClientConn, context.CancelFunc) {
    - 65 + 15
      - log.Infof("Updating forkIDs. Setting %d forkIDs", len(intervals)) + opts := []grpc.DialOption{
    +
    +
    +
    +
    + + + - - + + + + + + + + + + + + + + + + + + @@ -90120,6 +88837,21 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    -
    @@ -88,7 +107,7 @@
    +
     
    - 88 + 10
      - return err + "google.golang.org/grpc/credentials/insecure"
    - 89 + 11
      - } + )
    - 90 + 12
      - forkIDs[len(forkIDs)-1].ToBatchNumber = newForkID.FromBatchNumber - 1 +
    - 91 + + 13 +
    - - - err := p.UpdateForkID(ctx, forkIDs[len(forkIDs)-1], dbTx) + + + const ( +
    +
    + 14 + +
    + + + // ExecutionMode0 is the execution mode for the sequencer and RPC, default one +
    +
    + 15 + +
    + + + ExecutionMode0 = uint64(0) +
    +
    + 16 + +
    + + + // ExecutionMode1 is the execution mode for the synchronizer +
    +
    + 17 + +
    + + + ExecutionMode1 = uint64(1) +
    +
    + 18 + +
    + + + ) +
    +
    + 19 + +
    + + +
    - 92 + 20
      - if err != nil { + // NewExecutorClient is the executor client constructor.
    - 93 + 21
      - log.Errorf("error updating forkID: %d. Error: %v", forkIDs[len(forkIDs)-1].ForkId, err) + func NewExecutorClient(ctx context.Context, c Config) (ExecutorServiceClient, *grpc.ClientConn, context.CancelFunc) {
    - 94 + 22
      - return err + opts := []grpc.DialOption{
    +
    +
    +
    +
    + + {/home/stefan/go/src/Polygon/zkevm-node → .}/state/transaction.go + RENAMED + +
    +
    @@ -90127,406 +88859,493 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - - - - - - - - - - - - - + +
    -
     
    +
    @@ -536,6 +536,7 @@
    - 51 + 536
      - } + TimestampLimit: uint64(time.Now().Unix()),
    - 52 + 537
      -
    + SkipFirstChangeL2Block: cFalse,
    - 53 + 538
      - // UpdateForkID updates the forkID stored in db + SkipWriteBlockInfoRoot: cTrue,
    - 54 + + -
    - + - func (p *PostgresStorage) UpdateForkIDToBatchNumber(ctx context.Context, forkID state.ForkIDInterval, dbTx pgx.Tx) error { +
    +
    +   +
    - 55 + 539
      - const updateForkIDSQL = "UPDATE state.fork_id SET to_batch_num = $1 WHERE fork_id = $2" + }
    - 56 + 540
      - e := p.getExecQuerier(dbTx) + if noZKEVMCounters {
    - 57 + 541
      - if _, err := e.Exec(ctx, updateForkIDSQL, forkID.ToBatchNumber, forkID.ForkId); err != nil { + processBatchRequestV2.NoCounters = cTrue
    -
     
    +
    @@ -1013,6 +1014,7 @@
    - 60 + 1013
      - return nil + TimestampLimit: uint64(time.Now().Unix()),
    - 61 + 1014
      - } + SkipFirstChangeL2Block: cTrue,
    - 62 + 1015
      -
    + SkipWriteBlockInfoRoot: cTrue,
    - 63 + + -
    - + - // UpdateForkID updates the forkID stored in db +
    +
    +   +
    - 64 + + 1016 +
    - + - func (p *PostgresStorage) UpdateForkIDBlockNumber(ctx context.Context, forkdID uint64, newBlockNumber uint64, updateMemCache bool, dbTx pgx.Tx) error { +   + }
    - 65 + + 1017 +
    - + - const sql = "UPDATE state.fork_id SET block_num = $1 WHERE fork_id = $2" +   +
    - 66 + + 1018 +
    - + - e := p.getExecQuerier(dbTx) +   + log.Debugf("EstimateGas[processBatchRequestV2.From]: %v", processBatchRequestV2.From)
    - 67 - -
    - + - if _, err := e.Exec(ctx, sql, forkdID, newBlockNumber); err != nil { +
    +
    +
    +
    + + + + + - - - - - - - - - - - - - + - + + - - - - + + + - - - - + + +
    +
     
    - 68 + + 536 +
    - + - return err +   + TimestampLimit: uint64(time.Now().Unix()),
    - 69 + + 537 +
    - + - } +   + SkipFirstChangeL2Block: cFalse,
    - 70 + + 538 +
    - + - if updateMemCache { +   + SkipWriteBlockInfoRoot: cTrue,
    - 71 + 539
    + - log.Debugf("Updating forkID %d in memory", forkdID) + ExecutionMode: executor.ExecutionMode0,
    - 72 + + 540 +
    - + - forkIDs, err := p.GetForkIDs(ctx, dbTx) +   + }
    - 73 + + 541 +
    - + - if err != nil { +   + if noZKEVMCounters {
    - 74 + + 542 +
    - + - log.Error("error getting oldForkIDs. Error: ", err) +   + processBatchRequestV2.NoCounters = cTrue
    - 75 + +
     
    +
    + 1014 +
    - + - return err +   + TimestampLimit: uint64(time.Now().Unix()),
    - 76 + + 1015 +
    - + - } +   + SkipFirstChangeL2Block: cTrue,
    - 77 + + 1016 +
    - + - p.UpdateForkIDIntervalsInMemory(forkIDs) +   + SkipWriteBlockInfoRoot: cTrue,
    - 78 + 1017
    + + ExecutionMode: executor.ExecutionMode0, +
    +
    + 1018 + +
    +   }
    - 79 + + 1019 +
    - + - return nil +   +
    - 80 + + 1020 +
    - + - } +   + log.Debugf("EstimateGas[processBatchRequestV2.From]: %v", processBatchRequestV2.From)
    +
    +
    +
    +
    +
    +
    + + {/home/stefan/go/src/Polygon/zkevm-node → .}/synchronizer/l1_parallel_sync/l1_worker_etherman_test.go + RENAMED + +
    +
    +
    +
    + + + + + - - + + + + + + + + + + +
    +
    @@ -31,7 +31,7 @@
    +
    - 81 + + 31 +
    - + -
    +   + GlobalExitRootManagerAddr: common.HexToAddress("0x8A791620dd6260079BF849Dc5567aDC3F2FdC318"),
    - 82 + 32
      - // UpdateForkIDIntervalsInMemory updates the forkID intervals in memory + }
    - 83 + 33
      - func (p *PostgresStorage) UpdateForkIDIntervalsInMemory(intervals []state.ForkIDInterval) { +
    +
    +
    + 34 + +
    + - + ethermanClient, err := etherman.NewClient(cfg, l1Config)
    - 84 + 35 + +
    +   + require.NoError(t, err) +
    +
    + 36
      - log.Infof("Updating forkIDs. Setting %d forkIDs", len(intervals)) + worker := newWorker(ethermanClient)
    + 37 + +
    +   + ch := make(chan responseRollupInfoByBlockRange) +
    +
    +
    +
    +
    +
    + + + @@ -90536,12 +89355,12 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    -
    +
    {/home/stefan/go/src/Polygon/zkevm-node → .}/state/pgstatestorage/l2block.go + {/home/stefan/go/src/Polygon/zkevm-node → .}/synchronizer/l2_sync/l2_sync_etrog/executor_trusted_batch_sync.go RENAMED
    - - - - - - + + +
     
    - 107 + 31
      - return err + GlobalExitRootManagerAddr: common.HexToAddress("0x8A791620dd6260079BF849Dc5567aDC3F2FdC318"),
    - 108 + 32
      - } + }
    - 109 + 33
      - forkIDs[len(forkIDs)-1].ToBatchNumber = newForkID.FromBatchNumber - 1 +
    - 110 + 34
    + - err := p.UpdateForkIDToBatchNumber(ctx, forkIDs[len(forkIDs)-1], dbTx) + ethermanClient, err := etherman.NewClient(cfg, l1Config, nil)
    - 111 + 35
      - if err != nil { + require.NoError(t, err)
    - 112 + 36
      - log.Errorf("error updating forkID: %d. Error: %v", forkIDs[len(forkIDs)-1].ForkId, err) + worker := newWorker(ethermanClient)
    - 113 + 37
      - return err + ch := make(chan responseRollupInfoByBlockRange)
    -
    @@ -169,8 +169,8 @@
    +
    @@ -429,6 +430,7 @@
    - 169 + 429
      - } + Transactions: data.TrustedBatch.BatchL2Data,
    - 170 + 430
      -
    + ForkID: b.state.GetForkIDByBatchNumber(uint64(data.TrustedBatch.Number)),
    - 171 + 431
      - // AddL2Block adds a new L2 block to the State Store -
    -
    - 172 - -
    - - - func (p *PostgresStorage) AddL2Block(ctx context.Context, batchNumber uint64, l2Block *state.L2Block, receipts []*types.Receipt, txsL2Hash []common.Hash, txsEGPData []state.StoreTxEGPData, dbTx pgx.Tx) error { + SkipVerifyL1InfoRoot_V2: true,
    - 173 + + -
    - - - //TODO: Optmize this function using only one SQL (with several values) to insert all the txs, receips and logs +
    +
    +   +
    - 174 + 432
      - log.Debugf("[AddL2Block] adding L2 block %d", l2Block.NumberU64()) + }
    - 175 + 433
      - start := time.Now() + return request
    - 176 + 434
      -
    + }
    +
    +
    +
    +
    + + + - - @@ -90718,6 +89536,21 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    -
    @@ -255,7 +255,7 @@
    +
     
    - 255 + 430
      - } + Transactions: data.TrustedBatch.BatchL2Data,
    - 256 + 431
      -
    + ForkID: b.state.GetForkIDByBatchNumber(uint64(data.TrustedBatch.Number)),
    - 257 + 432
      - if len(receipts) > 0 { + SkipVerifyL1InfoRoot_V2: true,
    - 258 + + 433 +
    - - - p.AddReceipts(ctx, receipts, dbTx) + + + ExecutionMode: executor.ExecutionMode1,
    - 259 + 434
      -
    + }
    - 260 + 435
      - var logs []*types.Log + return request
    - 261 + 436
      - for _, receipt := range receipts { + }
    +
    +
    +
    +
    + + {/home/stefan/go/src/Polygon/zkevm-node → .}/synchronizer/l2_sync/l2_sync_incaberry/sync_trusted_state.go + RENAMED + +
    +
    @@ -90725,161 +89558,160 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - - - - - - + + +
    -
     
    +
    @@ -196,6 +196,7 @@
    - 169 + 196
      - } + OldAccInputHash: batches[1].AccInputHash,
    - 170 + 197
      -
    + Coinbase: common.HexToAddress(trustedBatch.Coinbase.String()),
    - 171 + 198
      - // AddL2Block adds a new L2 block to the State Store -
    -
    - 172 - -
    - + - func (p *PostgresStorage) AddL2Block(ctx context.Context, batchNumber uint64, l2Block *state.L2Block, receipts []*types.Receipt, txsL2Hash []common.Hash, txsEGPData []state.StoreTxEGPData, imStateRoots []common.Hash, dbTx pgx.Tx) error { + Timestamp_V1: time.Unix(int64(trustedBatch.Timestamp), 0),
    - 173 + + -
    - + - // TODO: Optimize this function using only one SQL (with several values) to insert all the txs, receipts and logs +
    +
    +   +
    - 174 + 199
      - log.Debugf("[AddL2Block] adding L2 block %d", l2Block.NumberU64()) + }
    - 175 + 200
      - start := time.Now() + // check if batch needs to be synchronized
    - 176 + 201
      -
    + if batches[0] != nil {
    +
    +
    +
    +
    + + + - - @@ -90889,12 +89721,12 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    -
    +
    {/home/stefan/go/src/Polygon/zkevm-node → .}/state/pgstatestorage/pgstatestorage.go + {/home/stefan/go/src/Polygon/zkevm-node → .}/synchronizer/synchronizer.go RENAMED
    - - - - - - - - - + - + + - - - - - - - - @@ -91322,43 +90159,43 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - - - - - - - - @@ -91372,871 +90209,876 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - - - - - - - - -
     
    - 255 + 196
      - } + OldAccInputHash: batches[1].AccInputHash,
    - 256 + 197
      -
    + Coinbase: common.HexToAddress(trustedBatch.Coinbase.String()),
    - 257 + 198
      - if len(receipts) > 0 { + Timestamp_V1: time.Unix(int64(trustedBatch.Timestamp), 0),
    - 258 + + 199 +
    + - p.AddReceipts(ctx, receipts, imStateRoots, dbTx) + ExecutionMode: executor.ExecutionMode1,
    - 259 + 200
      -
    + }
    - 260 + 201
      - var logs []*types.Log + // check if batch needs to be synchronized
    - 261 + 202
      - for _, receipt := range receipts { + if batches[0] != nil {
    -
    @@ -355,3 +355,49 @@
    +
    @@ -234,7 +234,7 @@
    - 355 + 234
      - } + if err != nil {
    - 356 + 235
      - return nativeBlockHashes, nil + if errors.Is(err, state.ErrStateNotSynchronized) {
    - 357 + 236
      - } + log.Info("State is empty, verifying genesis block")
    - + + 237 -
    -   -
    +
    +
    + - + valid, err := s.etherMan.VerifyGenBlockNumber(s.ctx, s.genesis.BlockNumber)
    - + + 238 -
    +
    +
      -
    + if err != nil {
    - + + 239 -
    +
    +
      -
    + log.Error("error checking genesis block number. Error: ", err)
    - + + 240 -
    +
    +
      -
    + return rollback(s.ctx, dbTx, err)
    - + +
    @@ -242,12 +242,42 @@
    -
    +
    + 242 + +
      -
    + log.Error("genesis Block number configured is not valid. It is required the block number where the PolygonZkEVM smc was deployed")
    - + + 243 -
    +
    +
      -
    + return rollback(s.ctx, dbTx, fmt.Errorf("genesis Block number configured is not valid. It is required the block number where the PolygonZkEVM smc was deployed"))
    - + + 244 -
    +
    +
      -
    + }
    - + + 245 -
    -   -
    +
    +
    + - + log.Info("Setting genesis block")
    - + + 246 -
    -   -
    +
    +
    + - + header, err := s.etherMan.HeaderByNumber(s.ctx, big.NewInt(0).SetUint64(s.genesis.BlockNumber))
    - + + 247 -
    +
    +
      -
    + if err != nil {
    - + + 248 -
    -   -
    +
    +
    + - + log.Errorf("error getting l1 block header for block %d. Error: %v", s.genesis.BlockNumber, err)
    - + + 249 -
    +
    +
      -
    + return rollback(s.ctx, dbTx, err)
    - + + 250 -
    +
    +
      -
    + }
    - + + 251 -
    +
    +
      -
    + lastEthBlockSynced = &state.Block{
    - + + 252 -
    +
    +
      -
    + BlockNumber: header.Number.Uint64(),
    - + + 253 -
    +
    +
      -
    + BlockHash: header.Hash(),
    -
    -
    -
    -
    - - - + - - - - - - - - + + +
    -
     
    +
    @@ -736,7 +766,7 @@
    - 355 + 736
      - } + return nil, err
    - 356 + 737
      - return nativeBlockHashes, nil + }
    - 357 + 738
      - } + // Compare hashes
    - 358 + + 739 +
    - + -
    + - + if (block.Hash() != latestBlock.BlockHash || block.ParentHash() != latestBlock.ParentHash) && latestBlock.BlockNumber > s.genesis.BlockNumber {
    - 359 + + 740 +
    - + - // GetBatchL2DataByNumber returns the batch L2 data of the given batch number. +   + log.Infof("checkReorg: Bad block %d hashOk %t parentHashOk %t", latestBlock.BlockNumber, block.Hash() == latestBlock.BlockHash, block.ParentHash() == latestBlock.ParentHash)
    - 360 + + 741 +
    - + - func (p *PostgresStorage) GetBatchL2DataByNumber(ctx context.Context, batchNumber uint64, dbTx pgx.Tx) ([]byte, error) { +   + log.Debug("[checkReorg function] => latestBlockNumber: ", latestBlock.BlockNumber)
    - 361 + + 742 +
    - + - batchData, err := p.GetBatchL2DataByNumbers(ctx, []uint64{batchNumber}, dbTx) +   + log.Debug("[checkReorg function] => latestBlockHash: ", latestBlock.BlockHash) +
    +
    +
    +
    +
    + + + + + - - - - - - - - - - - - - - - - + - - - - - - - - - - - - -
    +
     
    - 362 + + 234 +
    - + +   if err != nil {
    - 363 + + 235 +
    - + - return nil, err +   + if errors.Is(err, state.ErrStateNotSynchronized) {
    - 364 + + 236 +
    - + - } +   + log.Info("State is empty, verifying genesis block")
    - 365 + + 237 +
    + - data, ok := batchData[batchNumber] + valid, err := s.etherMan.VerifyGenBlockNumber(s.ctx, s.genesis.RollupBlockNumber)
    - 366 + + 238 +
    - + - if !ok { +   + if err != nil {
    - 367 + + 239 +
    - + - return nil, state.ErrNotFound +   + log.Error("error checking genesis block number. Error: ", err)
    - 368 + + 240 +
    - + - } +   + return rollback(s.ctx, dbTx, err)
    - 369 - -
    - + - return data, nil -
    +
    +
     
    - 370 + + 242 +
    - + - } +   + log.Error("genesis Block number configured is not valid. It is required the block number where the PolygonZkEVM smc was deployed")
    - 371 + + 243 +
    - + -
    +   + return rollback(s.ctx, dbTx, fmt.Errorf("genesis Block number configured is not valid. It is required the block number where the PolygonZkEVM smc was deployed"))
    - 372 + + 244 +
    - + - // GetBatchL2DataByNumbers returns the batch L2 data of the given batch numbers. The data is a union of state.batch and state.forced_batch tables. +   + }
    - 373 + + 245 +
    + - func (p *PostgresStorage) GetBatchL2DataByNumbers(ctx context.Context, batchNumbers []uint64, dbTx pgx.Tx) (map[uint64][]byte, error) { +
    - 374 + + 246 +
    + - const getBatchL2DataByBatchNumber = ` + // Sync events from RollupManager that happen before rollup creation
    - 375 + 247
    + - SELECT batch_num, raw_txs_data FROM state.batch WHERE batch_num = ANY($1) + log.Info("synchronizing events from RollupManager that happen before rollup creation")
    - 376 + 248
    + - UNION + for i := s.genesis.RollupManagerBlockNumber; true; i += s.cfg.SyncChunkSize {
    - 377 + 249
    + - SELECT forced_batch_num, convert_from(decode(raw_txs_data, 'hex'), 'UTF8')::bytea FROM state.forced_batch WHERE forced_batch_num = ANY($2) + toBlock := min(i+s.cfg.SyncChunkSize-1, s.genesis.RollupBlockNumber-1)
    - 378 + 250
    + - ` + blocks, order, err := s.etherMan.GetRollupInfoByBlockRange(s.ctx, i, &toBlock)
    - 379 + 251
    + - q := p.getExecQuerier(dbTx) + if err != nil {
    - 380 + 252
    + - rows, err := q.Query(ctx, getBatchL2DataByBatchNumber, batchNumbers, batchNumbers) + log.Error("error getting rollupInfoByBlockRange before rollup genesis: ", err)
    - 381 + 253
    + - if errors.Is(err, pgx.ErrNoRows) { + rollbackErr := dbTx.Rollback(s.ctx)
    - 382 + 254
    + - return nil, state.ErrNotFound + if rollbackErr != nil {
    - 383 + 255
    + - } else if err != nil { + log.Errorf("error rolling back state. RollbackErr: %v, err: %s", rollbackErr, err.Error())
    - 384 + 256
    + - return nil, err + return rollbackErr
    - 385 + 257
    + - } + }
    - 386 + 258
    + - defer rows.Close() + return err
    - 387 + 259
    + - batchL2DataMap := make(map[uint64][]byte) + }
    - 388 + 260
    + - for rows.Next() { + err = s.ProcessBlockRange(blocks, order)
    - 389 + 261
    + - var ( + if err != nil {
    - 390 + 262
    + - batchNum uint64 + log.Error("error processing blocks before the genesis: ", err)
    - 391 + 263
    + - batchL2Data []byte + rollbackErr := dbTx.Rollback(s.ctx)
    - 392 + 264
    + - ) + if rollbackErr != nil {
    - 393 + 265
    + - err := rows.Scan(&batchNum, &batchL2Data) + log.Errorf("error rolling back state. RollbackErr: %v, err: %s", rollbackErr, err.Error())
    - 394 + 266
    + - if err != nil { + return rollbackErr
    - 395 + 267
    + - return nil, err + }
    - 396 + 268
    + - } + return err
    - 397 + 269
    + - batchL2DataMap[batchNum] = batchL2Data + }
    - 398 + 270
    + - } + if toBlock == s.genesis.RollupBlockNumber-1 {
    - 399 + 271
    + - if len(batchL2DataMap) == 0 { + break
    - 400 + 272
    + - return nil, state.ErrNotFound + }
    - 401 + 273
    + - } + }
    - 402 + 274
    + - return batchL2DataMap, nil +
    - 403 + 275
    + - } -
    -
    -
    + header, err := s.etherMan.HeaderByNumber(s.ctx, big.NewInt(0).SetUint64(s.genesis.RollupBlockNumber))
    -
    -
    -
    -
    - - {/home/stefan/go/src/Polygon/zkevm-node → .}/state/pgstatestorage/pgstatestorage_test.go - RENAMED - -
    -
    -
    -
    - - - - - + + + - - - - - + + +
    -
    @@ -188,6 +188,7 @@
    - 188 + 276
      - transactions := []*types.Transaction{tx} + if err != nil { +
    +
    + 277 + +
    + + + log.Errorf("error getting l1 block header for block %d. Error: %v", s.genesis.RollupBlockNumber, err)
    - 189 + 278
      -
    + return rollback(s.ctx, dbTx, err)
    - 190 + 279
      - receipts := []*types.Receipt{receipt} + }
    - + + 280 -
    -   -
    +
    +
    + + + log.Info("synchronizing rollup creation block")
    - 191 + 281
      -
    + lastEthBlockSynced = &state.Block{
    - 192 + 282
      - // Create block to be able to calculate its hash + BlockNumber: header.Number.Uint64(),
    - 193 + 283
      - st := trie.NewStackTrie(nil) + BlockHash: header.Hash(),
    -
    @@ -202,7 +203,7 @@
    +
     
    - 202 + 766
      - txsL2Hash[i] = common.HexToHash(fmt.Sprintf("0x%d", i)) + return nil, err
    - 203 + 767
      - } + }
    - 204 + 768
      -
    + // Compare hashes
    - 205 + + 769 +
    - - - err = pgStateStorage.AddL2Block(ctx, batchNumber, l2Block, receipts, txsL2Hash, storeTxsEGPData, dbTx) + + + if (block.Hash() != latestBlock.BlockHash || block.ParentHash() != latestBlock.ParentHash) && latestBlock.BlockNumber > s.genesis.RollupBlockNumber {
    - 206 + 770
      - require.NoError(t, err) + log.Infof("checkReorg: Bad block %d hashOk %t parentHashOk %t", latestBlock.BlockNumber, block.Hash() == latestBlock.BlockHash, block.ParentHash() == latestBlock.ParentHash)
    - 207 + 771
      - result, err := pgStateStorage.BatchNumberByL2BlockNumber(ctx, l2Block.Number().Uint64(), dbTx) + log.Debug("[checkReorg function] => latestBlockNumber: ", latestBlock.BlockNumber)
    - 208 + 772
      - require.NoError(t, err) + log.Debug("[checkReorg function] => latestBlockHash: ", latestBlock.BlockHash)
    +
    +
    +
    +
    +
    +
    + + {/home/stefan/go/src/Polygon/zkevm-node → .}/synchronizer/synchronizer_test.go + RENAMED + +
    +
    +
    +
    + + + - - - + + +
    -
    @@ -657,7 +658,7 @@
    +
    @@ -119,7 +119,7 @@
    - 657 + 119
      - require.Equal(t, forks[i].Version, forkId.Version) + // but it used a feature that is not implemented in new one that is asking beyond the last block on L1
    - 658 + 120
      - } + func TestForcedBatchEtrog(t *testing.T) {
    - 659 + 121
      - forkID3.ToBatchNumber = 18446744073709551615 + genesis := state.Genesis{
    - 660 + 122
    - - err = testState.UpdateForkID(ctx, forkID3, dbTx) + BlockNumber: uint64(123456),
    - 661 + 123
      - require.NoError(t, err) + }
    - 662 + 124
      -
    + cfg := Config{
    - 663 + 125
      - forkIDs, err = testState.GetForkIDs(ctx, dbTx) + SyncInterval: cfgTypes.Duration{Duration: 1 * time.Second},
    -
    @@ -724,7 +725,7 @@
    +
    @@ -372,7 +372,7 @@
    - 724 + 372
      - txsL2Hash[i] = common.HexToHash(fmt.Sprintf("0x%d", i)) + // but it used a feature that is not implemented in new one that is asking beyond the last block on L1
    - 725 + 373
      - } + func TestSequenceForcedBatchIncaberry(t *testing.T) {
    - 726 + 374
      -
    + genesis := state.Genesis{
    - 727 + 375
    - - err = testState.AddL2Block(ctx, batchNumber, l2Block, []*types.Receipt{}, txsL2Hash, storeTxsEGPData, dbTx) + BlockNumber: uint64(123456),
    - 728 + 376
      - require.NoError(t, err) + }
    - 729 + 377
      -
    + cfg := Config{
    - 730 + 378
      - virtualBatch := state.VirtualBatch{BlockNumber: blockNumber, BatchNumber: batchNumber, Coinbase: addr, SequencerAddr: addr, TxHash: hash} + SyncInterval: cfgTypes.Duration{Duration: 1 * time.Second},
    -
    @@ -923,6 +924,7 @@
    +
    @@ -611,7 +611,7 @@
    - 923 + 611
    @@ -92246,320 +91088,333 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 924 + 612
      - transactions := []*types.Transaction{tx} + func setupGenericTest(t *testing.T) (*state.Genesis, *Config, *mocks) {
    - 925 + 613
      - receipts := []*types.Receipt{receipt} + genesis := state.Genesis{
    - + + 614 -
    -   -
    +
    +
    + - + BlockNumber: uint64(123456),
    - 926 + 615
      -
    + }
    - 927 + 616
      - header := state.NewL2Header(&types.Header{ + cfg := Config{
    - 928 + 617
      - Number: big.NewInt(int64(i) + 1), + SyncInterval: cfgTypes.Duration{Duration: 1 * time.Second},
    +
    +
    +
    +
    + + + - - - - - - - + + +
    -
    @@ -948,7 +950,7 @@
    +
     
    - 948 + 119
      - txsL2Hash[i] = common.HexToHash(fmt.Sprintf("0x%d", i)) + // but it used a feature that is not implemented in new one that is asking beyond the last block on L1
    - 949 + 120
      - } + func TestForcedBatchEtrog(t *testing.T) {
    - 950 + 121
      -
    + genesis := state.Genesis{
    - 951 + + 122 +
    - - - err = testState.AddL2Block(ctx, batchNumber, l2Block, receipts, txsL2Hash, storeTxsEGPData, dbTx) + + + RollupBlockNumber: uint64(123456),
    - 952 + 123
      - require.NoError(t, err) + }
    - 953 + 124
      - } + cfg := Config{
    - 954 + 125
      -
    + SyncInterval: cfgTypes.Duration{Duration: 1 * time.Second},
    -
    @@ -1054,6 +1056,7 @@
    +
     
    - 1054 + 372
      -
    + // but it used a feature that is not implemented in new one that is asking beyond the last block on L1
    - 1055 + 373
      - transactions := []*types.Transaction{tx} + func TestSequenceForcedBatchIncaberry(t *testing.T) {
    - 1056 + 374
      - receipts := []*types.Receipt{receipt} + genesis := state.Genesis{
    - + + 375 -
    -   -
    +
    +
    + + + RollupBlockNumber: uint64(123456),
    - 1057 + 376
      -
    + }
    - 1058 + 377
      - header := state.NewL2Header(&types.Header{ + cfg := Config{
    - 1059 + 378
      - Number: big.NewInt(int64(i) + 1), + SyncInterval: cfgTypes.Duration{Duration: 1 * time.Second},
    -
    @@ -1079,7 +1082,7 @@
    +
     
    - 1079 + 611
      - txsL2Hash[i] = common.HexToHash(fmt.Sprintf("0x%d", i)) +
    - 1080 + 612
      - } + func setupGenericTest(t *testing.T) (*state.Genesis, *Config, *mocks) {
    - 1081 + 613
      -
    + genesis := state.Genesis{
    - 1082 + + 614 +
    - - - err = testState.AddL2Block(ctx, batchNumber, l2Block, receipts, txsL2Hash, storeTxsEGPData, dbTx) + + + RollupBlockNumber: uint64(123456),
    - 1083 + 615
      - require.NoError(t, err) + }
    - 1084 + 616
      -
    + cfg := Config{
    - 1085 + 617
      - nativeBlockHashes = append(nativeBlockHashes, l2Block.Header().Root) + SyncInterval: cfgTypes.Duration{Duration: 1 * time.Second},
    +
    +
    +
    +
    +
    +
    + + {/home/stefan/go/src/Polygon/zkevm-node → .}/test/contracts/auto/customModExp.sol + RENAMED + +
    +
    +
    +
    + + + - - - - - - - - + + +
    -
    @@ -1129,6 +1132,82 @@
    -
    - 1129 - -
    -   - require.NoError(t, dbTx.Commit(ctx)) -
    -
    - 1130 - -
    -   - } -
    +
    @@ -0,0 +1,24 @@
    - 1131 + + -
    +
    +
     
    @@ -92794,56 +91649,289 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0


    +
    +
    +
    +
    + + + + + + + + - - + + + - - + + + + + + + + + + + + + + + - - + + + - - + + + + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
     
    +
    + 1 + +
    + + + // SPDX-License-Identifier: MIT +
    +
    - + + 2 -
    -   +
    +
    + + + pragma solidity >=0.7.0 <0.9.0; +
    +
    + 3 + +
    + +
    - + + 4 -
    -   +
    +
    + + + contract customModExp { +
    +
    + 5 + +
    + + + bytes32 hashResult; +
    +
    + 6 + +
    + + + address retEcrecover; +
    +
    + 7 + +
    + + + bytes dataResult; +
    +
    + 8 + +
    + + + uint256 dataRes; +
    +
    + 9 + +
    + +
    - + + 10 -
    -   +
    +
    + + + bytes32[10] arrayStorage; +
    +
    + 11 + +
    + +
    - + + 12 -
    -   +
    +
    + + + function modExpGeneric(bytes memory input) public { +
    +
    + 13 + +
    + + + bytes32[10] memory output; +
    +
    + 14 + +
    + +
    - + + 15 -
    -   +
    +
    + + + assembly { +
    +
    + 16 + +
    + + + let success := staticcall(gas(), 0x05, add(input, 32), mload(input), output, 0x140) +
    +
    + 17 + +
    + + + sstore(0x00, success) +
    +
    + 18 + +
    + + + } +
    +
    + 19 + +
    + +
    + 20 + +
    + + + for (uint i = 0; i < 10; i++) { +
    +
    + 21 + +
    + + + arrayStorage[i] = output[i]; +
    +
    + 22 + +
    + + + } +
    +
    + 23 + +
    + + + } +
    +
    + 24 + +
    + + + } +
    +
    +
    +
    +
    +
    +
    +
    + + {/home/stefan/go/src/Polygon/zkevm-node → .}/test/contracts/bin/customModExp/customModExp.go + RENAMED + +
    +
    +
    +
    + + + + + - - - - - - - - - - - - - - - @@ -93430,1662 +92513,1623 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - - - - - - - - - - - - - - - - - - - - - -
    +
    @@ -0,0 +1,224 @@
    +
    @@ -93325,68 +92413,63 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 1132 + + -
    +
    +
      - func createL1InfoTreeExitRootStorageEntryForTest(blockNumber uint64, index uint32) *state.L1InfoTreeExitRootStorageEntry { +
    - 1133 + + -
    +
    +
      - exitRoot := state.L1InfoTreeExitRootStorageEntry{ +
    - 1134 + + -
    +
    +
      - L1InfoTreeLeaf: state.L1InfoTreeLeaf{ +
    -
    @@ -1330,6 +1409,10 @@
    -
    - 1330 + + -
    +
    +
      - require.Equal(t, uint64(2002), fb.BlockNumber) +
    - 1331 + + -
    +
    +
      - require.Equal(t, "0x717e05de47a87a7d1679e183f1c224150675f6302b7da4eaab526b2b91ae0761", fb.GlobalExitRoot.String()) +
    - 1332 + + -
    +
    +
      - require.Equal(t, []byte{0xb}, fb.RawTxsData) +
    - 1333 + + -
    +
    +
      - } +
    - 1334 + + -
    +
    +
     
    - 1335 + + -
    +
    +
      - func TestGetLastGER(t *testing.T) { +
    -
    @@ -1406,5 +1489,4 @@
    -
    - 1406 + + -
    +
    +
      - ger, err = testState.GetLatestBatchGlobalExitRoot(ctx, dbTx) +
    - 1407 + + -
    +
    +
      - require.NoError(t, err) +
    - 1408 + + -
    +
    +
      - require.Equal(t, common.HexToHash("0x2").String(), ger.String()) +
    - 1409 + + -
    - - +
    +
    +  
    - 1410 + + -
    +
    +
      - } -
    -
    -
    +
    -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - - - - - - - - - - - - - - - - - - - - - + - - - - - - @@ -95099,13 +94143,33 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - - + + + + + + @@ -95113,21 +94177,6 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    -
     
    - 188 + + -
    +
    +
      - transactions := []*types.Transaction{tx} +
    - 189 + + -
    +
    +
     
    - 190 + + -
    +
    +
      - receipts := []*types.Receipt{receipt} +
    - 191 + + -
    - + - imStateRoots := []common.Hash{state.ZeroHash} +
    +
    +   +
    - 192 + + -
    +
    +
     
    - 193 + + -
    +
    +
      - // Create block to be able to calculate its hash +
    - 194 + + -
    +
    +
      - st := trie.NewStackTrie(nil) +
    -
     
    -
    - 203 + + -
    +
    +
      - txsL2Hash[i] = common.HexToHash(fmt.Sprintf("0x%d", i)) +
    - 204 + + -
    +
    +
      - } +
    - 205 + + -
    +
    +
     
    - 206 + + -
    - + - err = pgStateStorage.AddL2Block(ctx, batchNumber, l2Block, receipts, txsL2Hash, storeTxsEGPData, imStateRoots, dbTx) +
    +
    +   +
    - 207 + + -
    +
    +
      - require.NoError(t, err) +
    - 208 + + -
    +
    +
      - result, err := pgStateStorage.BatchNumberByL2BlockNumber(ctx, l2Block.Number().Uint64(), dbTx) +
    - 209 + + -
    +
    +
      - require.NoError(t, err) +
    -
     
    -
    - 658 + + -
    +
    +
      - require.Equal(t, forks[i].Version, forkId.Version) +
    - 659 + + -
    +
    +
      - } +
    - 660 + + -
    +
    +
      - forkID3.ToBatchNumber = 18446744073709551615 +
    - 661 + + -
    - + - err = testState.UpdateForkIDToBatchNumber(ctx, forkID3, dbTx) +
    +
    +   +
    - 662 + + -
    +
    +
      - require.NoError(t, err) +
    - 663 + + -
    +
    +
     
    - 664 + + -
    +
    +
      - forkIDs, err = testState.GetForkIDs(ctx, dbTx) +
    -
     
    -
    - 725 + + -
    +
    +
      - txsL2Hash[i] = common.HexToHash(fmt.Sprintf("0x%d", i)) +
    - 726 + + -
    +
    +
      - } +
    - 727 + + -
    +
    +
     
    - 728 + + -
    - + - err = testState.AddL2Block(ctx, batchNumber, l2Block, []*types.Receipt{}, txsL2Hash, storeTxsEGPData, []common.Hash{}, dbTx) +
    +
    +   +
    - 729 + + -
    +
    +
      - require.NoError(t, err) +
    - 730 + + -
    +
    +
     
    - 731 + + -
    +
    +
      - virtualBatch := state.VirtualBatch{BlockNumber: blockNumber, BatchNumber: batchNumber, Coinbase: addr, SequencerAddr: addr, TxHash: hash} +
    -
     
    +
    + + +
    +   +
    +
    - 924 + + -
    +
    +
     
    - 925 + + -
    +
    +
      - transactions := []*types.Transaction{tx} +
    - 926 + + -
    +
    +
      - receipts := []*types.Receipt{receipt} +
    - 927 + + -
    - + - stateRoots := []common.Hash{state.ZeroHash} +
    +
    +   +
    - 928 + + -
    +
    +
     
    - 929 + + -
    +
    +
      - header := state.NewL2Header(&types.Header{ +
    - 930 + + -
    +
    +
      - Number: big.NewInt(int64(i) + 1), +
    -
     
    -
    - 950 + + -
    +
    +
      - txsL2Hash[i] = common.HexToHash(fmt.Sprintf("0x%d", i)) +
    - 951 + + -
    +
    +
      - } +
    - 952 + + -
    +
    +
     
    - 953 + + -
    - + - err = testState.AddL2Block(ctx, batchNumber, l2Block, receipts, txsL2Hash, storeTxsEGPData, stateRoots, dbTx) +
    +
    +   +
    - 954 + + -
    +
    +
      - require.NoError(t, err) +
    - 955 + + -
    +
    +
      - } +
    - 956 + + -
    +
    +
     
    -
     
    -
    - 1056 + + -
    +
    +
     
    - 1057 + + -
    +
    +
      - transactions := []*types.Transaction{tx} +
    - 1058 + + -
    +
    +
      - receipts := []*types.Receipt{receipt} +
    - 1059 + + -
    - + - stateRoots := []common.Hash{state.ZeroHash} +
    +
    +   +
    - 1060 + + -
    +
    +
     
    - 1061 + + -
    +
    +
      - header := state.NewL2Header(&types.Header{ +
    - 1062 + + -
    +
    +
      - Number: big.NewInt(int64(i) + 1), +
    -
     
    -
    - 1082 + + -
    +
    +
      - txsL2Hash[i] = common.HexToHash(fmt.Sprintf("0x%d", i)) +
    - 1083 + + -
    +
    +
      - } +
    - 1084 + + -
    +
    +
     
    - 1085 + + -
    - + - err = testState.AddL2Block(ctx, batchNumber, l2Block, receipts, txsL2Hash, storeTxsEGPData, stateRoots, dbTx) +
    +
    +   +
    - 1086 + + -
    +
    +
      - require.NoError(t, err) +
    - 1087 + + -
    +
    +
     
    - 1088 + + -
    +
    +
      - nativeBlockHashes = append(nativeBlockHashes, l2Block.Header().Root) +
    -
     
    -
    - 1132 + + -
    +
    +
      - require.NoError(t, dbTx.Commit(ctx)) +
    - 1133 + + -
    +
    +
      - } +
    - 1134 + + -
    +
    +
     
    - 1135 + + -
    - + - func TestGetBatchL2DataByNumber(t *testing.T) { +
    +
    +   +
    - 1136 + + -
    - + - // Init database instance +
    +
    +   +
    - 1137 + + -
    - + - initOrResetDB() +
    +
    +   +
    - 1138 + + -
    - + - ctx := context.Background() +
    +
    +   +
    - 1139 + + -
    - + - tx, err := testState.BeginStateTransaction(ctx) +
    +
    +   +
    - 1140 + + -
    - + - require.NoError(t, err) +
    +
    +   +
    - 1141 + + -
    - + - defer func() { require.NoError(t, tx.Commit(ctx)) }() +
    +
    +   +
    - 1142 + + -
    - + +
    +
    +  
    - 1143 + + -
    - + - // empty case +
    +
    +   +
    - 1144 + + -
    - + - var batchNum uint64 = 4 +
    +
    +   +
    - 1145 + + -
    - + - const openBatchSQL = "INSERT INTO state.batch (batch_num, raw_txs_data, wip) VALUES ($1, $2, false)" +
    +
    +   +
    - 1146 + + -
    - + - _, err = tx.Exec(ctx, openBatchSQL, batchNum, nil) +
    +
    +   +
    - 1147 + + -
    - + - require.NoError(t, err) +
    +
    +   +
    - 1148 + + -
    - + - data, err := testState.GetBatchL2DataByNumber(ctx, batchNum, tx) +
    +
    +   +
    - 1149 + + -
    - + - require.NoError(t, err) +
    +
    +   +
    - 1150 + + -
    - + - assert.Nil(t, data) +
    +
    +   +
    - 1151 + + -
    - + +
    +
    +  
    - 1152 + + -
    - + - // not empty case +
    +
    +   +
    - 1153 + + -
    - + - expectedData := []byte("foo bar") +
    +
    +   +
    - 1154 + + -
    - + - batchNum = 5 +
    +
    +   +
    - 1155 + + -
    - + - _, err = tx.Exec(ctx, openBatchSQL, batchNum, expectedData) +
    +
    +   +
    - 1156 + + -
    - + - require.NoError(t, err) +
    +
    +   +
    - 1157 + + -
    - + - actualData, err := testState.GetBatchL2DataByNumber(ctx, batchNum, tx) +
    +
    +   +
    - 1158 + + -
    - + - require.NoError(t, err) +
    +
    +   +
    - 1159 + + -
    - + - assert.Equal(t, expectedData, actualData) +
    +
    +   +
    - 1160 + + -
    - + +
    +
    +  
    - 1161 + + -
    - + - multiGet := []uint64{uint64(4), uint64(5), uint64(6)} +
    +
    +   +
    - 1162 + + -
    - + - allData, err := testState.GetBatchL2DataByNumbers(ctx, multiGet, tx) +
    +
    +   +
    - 1163 + + -
    - + - require.NoError(t, err) +
    +
    +   +
    - 1164 + + -
    - + - require.Equal(t, expectedData, allData[uint64(5)]) +
    +
    +   +
    - 1165 + + -
    - + - } +
    +
    +   +
    - 1166 + + -
    - + +
    +
    +  
    - 1167 + + -
    - + - func TestGetBatchL2DataByNumbers(t *testing.T) { +
    +
    +   +
    - 1168 + + -
    - + - initOrResetDB() +
    +
    +   +
    - 1169 + + -
    - + - ctx := context.Background() +
    +
    +   +
    - 1170 + + -
    - + - tx, err := testState.BeginStateTransaction(ctx) +
    +
    +   +
    - 1171 + + -
    - + - require.NoError(t, err) +
    +
    +   +
    - 1172 + + -
    - + - defer func() { require.NoError(t, tx.Commit(ctx)) }() +
    +
    +   +
    - 1173 + + -
    - + +
    +
    +  
    - 1174 + + -
    - + - var i1, i2, i3, i4, i5 = uint64(1), uint64(2), uint64(3), uint64(4), uint64(5) +
    +
    +   +
    - 1175 + + -
    - + - var d1, d2, d4 = []byte("foobar"), []byte("dingbat"), []byte{0xb} +
    +
    +   +
    - 1176 + + -
    - + +
    +
    +  
    - 1177 + + -
    - + - const insertBatch = "INSERT INTO state.batch (batch_num, raw_txs_data) VALUES ($1, $2)" +
    +
    +   +
    - 1178 + + -
    - + - _, err = tx.Exec(ctx, insertBatch, i1, d1) +
    +
    +   +
    - 1179 + + -
    - + - require.NoError(t, err) +
    +
    +   +
    - 1180 + + -
    - + - _, err = tx.Exec(ctx, insertBatch, i2, d2) +
    +
    +   +
    - 1181 + + -
    - + - require.NoError(t, err) +
    +
    +   +
    - 1182 + + -
    - + - _, err = tx.Exec(ctx, insertBatch, i3, nil) +
    +
    +   +
    - 1183 + + -
    - + - require.NoError(t, err) +
    +
    +   +
    - 1184 + + -
    - + +
    +
    +  
    - 1185 + + -
    - + - // Add a forced batch too, needs a block +
    +
    +   +
    - 1186 + + -
    - + - block1 := *block +
    +
    +   +
    - 1187 + + -
    - + - block1.BlockNumber = 1000 +
    +
    +   +
    - 1188 + + -
    - + - err = testState.AddBlock(ctx, &block1, tx) +
    +
    +   +
    - 1189 + + -
    - + - require.NoError(t, err) +
    +
    +   +
    - 1190 + + -
    - + - err = tx.Commit(ctx) +
    +
    +   +
    - 1191 + + -
    - + - require.NoError(t, err) +
    +
    +   +
    - 1192 + + -
    - + +
    +
    +  
    - 1193 + + -
    - + - tx, err = testState.BeginStateTransaction(ctx) +
    +
    +   +
    - 1194 + + -
    - + - require.NoError(t, err) +
    +
    +   +
    - 1195 + + -
    - + +
    +
    +  
    - 1196 + + -
    - + - const insertForcedBatch = "INSERT INTO state.forced_batch (forced_batch_num, timestamp, raw_txs_data, block_num) VALUES (4, now(),'0b', 1000)" +
    +
    +   +
    - 1197 + + -
    - + - _, err = testState.Exec(ctx, insertForcedBatch) +
    +
    +   +
    - 1198 + + -
    - + - require.NoError(t, err) +
    +
    +   +
    - 1199 + + -
    - + +
    +
    +  
    - 1200 + + -
    - + - allData, err := testState.GetBatchL2DataByNumbers(ctx, []uint64{i1, i2, i3, i4, i5}, tx) +
    +
    +   +
    - 1201 + + -
    - + - require.NoError(t, err) +
    +
    +   +
    - 1202 + + -
    - + - assert.Equal(t, d1, allData[i1]) +
    +
    +   +
    - 1203 + + -
    - + - assert.Equal(t, d2, allData[i2]) +
    +
    +   +
    - 1204 + + -
    - + - assert.Nil(t, allData[i3]) +
    +
    +   +
    - 1205 + + -
    - + - assert.Equal(t, d4, allData[i4]) +
    +
    +   +
    - 1206 + + -
    - + +
    +
    +  
    - 1207 + + -
    - + - _, ok := allData[i5] +
    +
    +   +
    - 1208 + + -
    - + - assert.False(t, ok) +
    +
    +   +
    - 1209 + + -
    - + - } +
    +
    +   +
    - 1210 + + -
    - + +
    +
    +  
    - 1211 + + -
    +
    +
      - func createL1InfoTreeExitRootStorageEntryForTest(blockNumber uint64, index uint32) *state.L1InfoTreeExitRootStorageEntry { +
    - 1212 + + -
    +
    +
      - exitRoot := state.L1InfoTreeExitRootStorageEntry{ +
    - 1213 + + -
    +
    +
      - L1InfoTreeLeaf: state.L1InfoTreeLeaf{ +
    -
     
    +
    + + +
    +   +
    +
    - 1409 + + -
    +
    +
      - require.Equal(t, uint64(2002), fb.BlockNumber) +
    - 1410 + + -
    +
    +
      - require.Equal(t, "0x717e05de47a87a7d1679e183f1c224150675f6302b7da4eaab526b2b91ae0761", fb.GlobalExitRoot.String()) +
    - 1411 + + -
    +
    +
      - require.Equal(t, []byte{0xb}, fb.RawTxsData) +
    - 1412 + + -
    - + +
    +
    +  
    - 1413 + + -
    - + - fbData, err := testState.GetBatchL2DataByNumber(ctx, 1, dbTx) +
    +
    +   +
    - 1414 + + -
    - + - require.NoError(t, err) +
    +
    +   +
    - 1415 + + -
    - + - require.Equal(t, []byte{0xb}, fbData) +
    +
    +   +
    - 1416 + + -
    +
    +
      - } +
    - 1417 + + -
    +
    +
     
    - 1418 + + -
    +
    +
      - func TestGetLastGER(t *testing.T) { +
    -
     
    +
    + + +
    +   +
    +
    - 1489 + + -
    +
    +
      - ger, err = testState.GetLatestBatchGlobalExitRoot(ctx, dbTx) +
    - 1490 + + -
    +
    +
      - require.NoError(t, err) +
    - 1491 + + -
    +
    +
      - require.Equal(t, common.HexToHash("0x2").String(), ger.String()) +
    - 1492 + + -
    +
    +
      - } +
    +
    +
    + + +
    +   +
    +
    +
    + + +
    +   +
    -
    -
    -
    -
    - - {/home/stefan/go/src/Polygon/zkevm-node → .}/state/pgstatestorage/transaction.go - RENAMED - -
    -
    @@ -95135,1058 +94184,991 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    @@ -515,7 +515,7 @@
    +
     
    - 515 + + 1 +
    -   - } + + + // Code generated - DO NOT EDIT.
    - 516 + + 2 +
    -   -
    + + + // This file is a generated binding and any manual changes will be lost.
    - 517 + + 3 +
    -   - // AddReceipt adds a new receipt to the State Store + + +
    - 518 + + 4 +
    - - - func (p *PostgresStorage) AddReceipt(ctx context.Context, receipt *types.Receipt, dbTx pgx.Tx) error { + + + package customModExp
    - 519 + + 5 +
    -   - e := p.getExecQuerier(dbTx) + + +
    - 520 + + 6 +
    -   -
    + + + import (
    - 521 + + 7 +
    -   - var effectiveGasPrice *uint64 + + + "errors"
    -
    @@ -526,31 +526,31 @@
    -
    - 526 + + 8 +
    -   - } + + + "math/big"
    - 527 + + 9 +
    -   -
    + + + "strings"
    - 528 + + 10 +
    -   - const addReceiptSQL = ` + + +
    - 529 + + 11 +
    - - - INSERT INTO state.receipt (tx_hash, type, post_state, status, cumulative_gas_used, gas_used, effective_gas_price, block_num, tx_index, contract_address) + + + ethereum "github.com/ethereum/go-ethereum"
    - 530 + + 12 +
    - - - VALUES ( $1, $2, $3, $4, $5, $6, $7, $8, $9, $10)` + + + "github.com/ethereum/go-ethereum/accounts/abi"
    - 531 + + 13 +
    - - - _, err := e.Exec(ctx, addReceiptSQL, receipt.TxHash.String(), receipt.Type, receipt.PostState, receipt.Status, receipt.CumulativeGasUsed, receipt.GasUsed, effectiveGasPrice, receipt.BlockNumber.Uint64(), receipt.TransactionIndex, receipt.ContractAddress.String()) + + + "github.com/ethereum/go-ethereum/accounts/abi/bind"
    - 532 + + 14 +
    -   - return err + + + "github.com/ethereum/go-ethereum/common"
    - 533 + + 15 +
    -   - } + + + "github.com/ethereum/go-ethereum/core/types"
    - 534 + + 16 +
    -   -
    + + + "github.com/ethereum/go-ethereum/event"
    - 535 + + 17 +
    -   - // AddReceipts adds a list of receipts to the State Store + + + )
    - 536 + + 18 +
    - - - func (p *PostgresStorage) AddReceipts(ctx context.Context, receipts []*types.Receipt, dbTx pgx.Tx) error { + + +
    - 537 + + 19 +
    -   - if len(receipts) == 0 { + + + // Reference imports to suppress errors if they are not otherwise used.
    - 538 + + 20 +
    -   - return nil + + + var (
    - 539 - + + 21 +
    -   - } + + + _ = errors.New
    - 540 + + 22 +
    -   -
    + + + _ = big.NewInt
    - 541 + + 23 +
    -   - receiptRows := [][]interface{}{} + + + _ = strings.NewReader
    - 542 + + 24 +
    -   -
    + + + _ = ethereum.NotFound
    - 543 + + 25 +
    - - - for _, receipt := range receipts { + + + _ = bind.Bind
    - 544 + + 26 +
    -   - var egp uint64 + + + _ = common.Big1
    - 545 + + 27 +
    -   - if receipt.EffectiveGasPrice != nil { + + + _ = types.BloomLookup
    - 546 + + 28 +
    -   - egp = receipt.EffectiveGasPrice.Uint64() + + + _ = event.NewSubscription
    - 547 + + 29 +
    -   - } + + + _ = abi.ConvertType
    - 548 + + 30 +
    - - - receiptRow := []interface{}{receipt.TxHash.String(), receipt.Type, receipt.PostState, receipt.Status, receipt.CumulativeGasUsed, receipt.GasUsed, egp, receipt.BlockNumber.Uint64(), receipt.TransactionIndex, receipt.ContractAddress.String()} + + + )
    - 549 + + 31 +
    -   - receiptRows = append(receiptRows, receiptRow) + + +
    - 550 + + 32 +
    -   - } + + + // CustomModExpMetaData contains all meta data concerning the CustomModExp contract.
    - 551 + + 33 +
    -   -
    + + + var CustomModExpMetaData = &bind.MetaData{
    - 552 + + 34 +
    -   - _, err := dbTx.CopyFrom(ctx, pgx.Identifier{"state", "receipt"}, + + + ABI: "[{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"input\",\"type\":\"bytes\"}],\"name\":\"modExpGeneric\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]",
    - 553 + + 35 +
    - - - []string{"tx_hash", "type", "post_state", "status", "cumulative_gas_used", "gas_used", "effective_gas_price", "block_num", "tx_index", "contract_address"}, + + + Bin: "0x608060405234801561001057600080fd5b50610208806100206000396000f3fe608060405234801561001057600080fd5b506004361061002b5760003560e01c8063d5665d6f14610030575b600080fd5b61004361003e3660046100e2565b610045565b005b61004d6100ad565b6101408183516020850160055afa60009081555b600a8110156100a8578181600a811061007c5761007c610193565b6020020151600482600a811061009457610094610193565b0155806100a0816101a9565b915050610061565b505050565b604051806101400160405280600a906020820280368337509192915050565b634e487b7160e01b600052604160045260246000fd5b6000602082840312156100f457600080fd5b813567ffffffffffffffff8082111561010c57600080fd5b818401915084601f83011261012057600080fd5b813581811115610132576101326100cc565b604051601f8201601f19908116603f0116810190838211818310171561015a5761015a6100cc565b8160405282815287602084870101111561017357600080fd5b826020860160208301376000928101602001929092525095945050505050565b634e487b7160e01b600052603260045260246000fd5b60006000198214156101cb57634e487b7160e01b600052601160045260246000fd5b506001019056fea26469706673582212206c4940b4c9a7086754420734c8b4921cdb547ec8b31fc3bf8cd884ad9778a5b364736f6c634300080c0033",
    - 554 + + 36 +
    -   - pgx.CopyFromRows(receiptRows)) + + + }
    - 555 + + 37 +
    -   + +
    - 556 + + 38 +
    -   - return err + + + // CustomModExpABI is the input ABI used to generate the binding from.
    -
    + + + 39 + + +
    + + + // Deprecated: Use CustomModExpMetaData.ABI instead.
    -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
     
    - 515 + + 40 +
    -   - } + + + var CustomModExpABI = CustomModExpMetaData.ABI
    - 516 + + 41 +
    -   + +
    - 517 + + 42 +
    -   - // AddReceipt adds a new receipt to the State Store + + + // CustomModExpBin is the compiled bytecode used for deploying new contracts.
    - 518 + + 43 +
    + - func (p *PostgresStorage) AddReceipt(ctx context.Context, receipt *types.Receipt, imStateRoot common.Hash, dbTx pgx.Tx) error { + // Deprecated: Use CustomModExpMetaData.Bin instead.
    - 519 + + 44 +
    -   - e := p.getExecQuerier(dbTx) + + + var CustomModExpBin = CustomModExpMetaData.Bin
    - 520 + + 45 +
    -   + +
    - 521 + + 46 +
    -   - var effectiveGasPrice *uint64 + + + // DeployCustomModExp deploys a new Ethereum contract, binding an instance of CustomModExp to it.
    -
     
    -
    - 526 + + 47 +
    -   - } + + + func DeployCustomModExp(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *CustomModExp, error) {
    - 527 + + 48 +
    -   -
    + + + parsed, err := CustomModExpMetaData.GetAbi()
    - 528 + + 49 +
    -   - const addReceiptSQL = ` + + + if err != nil {
    - 529 + + 50 +
    + - INSERT INTO state.receipt (tx_hash, type, post_state, status, cumulative_gas_used, gas_used, effective_gas_price, block_num, tx_index, contract_address, im_state_root) + return common.Address{}, nil, nil, err
    - 530 + + 51 +
    + - VALUES ( $1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11)` + }
    - 531 + + 52 +
    + - _, err := e.Exec(ctx, addReceiptSQL, receipt.TxHash.String(), receipt.Type, receipt.PostState, receipt.Status, receipt.CumulativeGasUsed, receipt.GasUsed, effectiveGasPrice, receipt.BlockNumber.Uint64(), receipt.TransactionIndex, receipt.ContractAddress.String(), imStateRoot.Bytes()) + if parsed == nil {
    - 532 + + 53 +
    -   - return err + + + return common.Address{}, nil, nil, errors.New("GetABI returned nil")
    - 533 + + 54 +
    -   - } + + + }
    - 534 + + 55 +
    -   + +
    - 535 + + 56 +
    -   - // AddReceipts adds a list of receipts to the State Store + + + address, tx, contract, err := bind.DeployContract(auth, *parsed, common.FromHex(CustomModExpBin), backend)
    - 536 + + 57 +
    + - func (p *PostgresStorage) AddReceipts(ctx context.Context, receipts []*types.Receipt, imStateRoots []common.Hash, dbTx pgx.Tx) error { + if err != nil {
    - 537 + + 58 +
    -   - if len(receipts) == 0 { + + + return common.Address{}, nil, nil, err
    - 538 + + 59 +
    -   - return nil + + + }
    - 539 + + 60 +
    -   - } + + + return address, tx, &CustomModExp{CustomModExpCaller: CustomModExpCaller{contract: contract}, CustomModExpTransactor: CustomModExpTransactor{contract: contract}, CustomModExpFilterer: CustomModExpFilterer{contract: contract}}, nil
    - 540 + + 61 +
    -   -
    + + + }
    - 541 + + 62 +
    -   - receiptRows := [][]interface{}{} + + +
    - 542 + + 63 +
    -   -
    + + + // CustomModExp is an auto generated Go binding around an Ethereum contract.
    - 543 + + 64 +
    + - for i, receipt := range receipts { + type CustomModExp struct {
    - 544 + + 65 +
    -   - var egp uint64 + + + CustomModExpCaller // Read-only binding to the contract
    - 545 + + 66 +
    -   - if receipt.EffectiveGasPrice != nil { + + + CustomModExpTransactor // Write-only binding to the contract
    - 546 + + 67 +
    -   - egp = receipt.EffectiveGasPrice.Uint64() + + + CustomModExpFilterer // Log filterer for contract events
    - 547 + + 68 +
    -   - } + + + }
    - 548 + + 69 +
    + - receiptRow := []interface{}{receipt.TxHash.String(), receipt.Type, receipt.PostState, receipt.Status, receipt.CumulativeGasUsed, receipt.GasUsed, egp, receipt.BlockNumber.Uint64(), receipt.TransactionIndex, receipt.ContractAddress.String(), imStateRoots[i].Bytes()} +
    - 549 + + 70 +
    -   - receiptRows = append(receiptRows, receiptRow) + + + // CustomModExpCaller is an auto generated read-only Go binding around an Ethereum contract.
    - 550 + + 71 +
    -   - } + + + type CustomModExpCaller struct {
    - 551 + + 72 +
    -   -
    + + + contract *bind.BoundContract // Generic contract wrapper for the low level calls
    - 552 + + 73 +
    -   - _, err := dbTx.CopyFrom(ctx, pgx.Identifier{"state", "receipt"}, + + + }
    - 553 + + 74 +
    + - []string{"tx_hash", "type", "post_state", "status", "cumulative_gas_used", "gas_used", "effective_gas_price", "block_num", "tx_index", "contract_address", "im_state_root"}, +
    - 554 + + 75 +
    -   - pgx.CopyFromRows(receiptRows)) + + + // CustomModExpTransactor is an auto generated write-only Go binding around an Ethereum contract.
    - 555 + + 76 +
    -   -
    + + + type CustomModExpTransactor struct {
    - 556 + + 77 -
    -   - return err -
    -
    -
    -
    -
    -
    -
    -
    - - {/home/stefan/go/src/Polygon/zkevm-node → .}/state/runtime/executor/client.go - RENAMED - -
    -
    -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    @@ -10,6 +10,13 @@
    -
    - 10 - +
    -   - "google.golang.org/grpc/credentials/insecure" + + + contract *bind.BoundContract // Generic contract wrapper for the low level calls
    - 11 + + 78 +
    -   - ) + + + }
    - 12 + + 79 +
    -   + +
    - + + 80 -
    -   -
    +
    +
    + + + // CustomModExpFilterer is an auto generated log filtering Go binding around an Ethereum contract events.
    - + + 81 -
    -   -
    +
    +
    + + + type CustomModExpFilterer struct {
    - + + 82 -
    -   -
    +
    +
    + + + contract *bind.BoundContract // Generic contract wrapper for the low level calls
    - + + 83 -
    -   -
    +
    +
    + + + }
    - + + 84 -
    -   +
    +
    + +
    - + + 85 -
    -   -
    +
    +
    + + + // CustomModExpSession is an auto generated Go binding around an Ethereum contract,
    - + + 86 -
    -   -
    +
    +
    + + + // with pre-set call and transact options.
    - 13 + + 87 +
    -   - // NewExecutorClient is the executor client constructor. + + + type CustomModExpSession struct {
    - 14 + + 88 +
    -   - func NewExecutorClient(ctx context.Context, c Config) (ExecutorServiceClient, *grpc.ClientConn, context.CancelFunc) { + + + Contract *CustomModExp // Generic contract binding to set the session for
    - 15 + + 89 +
    -   - opts := []grpc.DialOption{ -
    -
    -
    + + + CallOpts bind.CallOpts // Call options to use throughout this session
    -
    -
    - - - - - - - - - - - - - - - - - - - -
    -
     
    - 10 + + 90 +
    -   - "google.golang.org/grpc/credentials/insecure" + + + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session
    - 11 + + 91 +
    -   - ) + + + }
    - 12 + + 92 +
    -   + +
    - 13 + 93
    + - const ( + // CustomModExpCallerSession is an auto generated read-only Go binding around an Ethereum contract,
    - 14 + 94
    + - // ExecutionMode0 is the execution mode for the sequencer and RPC, default one + // with pre-set call options.
    - 15 + 95
    + - ExecutionMode0 = uint64(0) + type CustomModExpCallerSession struct {
    - 16 + 96
    + - // ExecutionMode1 is the execution mode for the synchronizer + Contract *CustomModExpCaller // Generic contract caller binding to set the session for
    - 17 + 97
    + - ExecutionMode1 = uint64(1) + CallOpts bind.CallOpts // Call options to use throughout this session
    - 18 + 98
    + - ) + }
    - 19 + 99
    @@ -96195,1769 +95177,1645 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 20 + + 100 +
    -   - // NewExecutorClient is the executor client constructor. + + + // CustomModExpTransactorSession is an auto generated write-only Go binding around an Ethereum contract,
    - 21 + + 101 +
    -   - func NewExecutorClient(ctx context.Context, c Config) (ExecutorServiceClient, *grpc.ClientConn, context.CancelFunc) { + + + // with pre-set transact options.
    - 22 + + 102 +
    -   - opts := []grpc.DialOption{ -
    -
    -
    + + + type CustomModExpTransactorSession struct {
    -
    -
    -
    -
    - - {/home/stefan/go/src/Polygon/zkevm-node → .}/state/runtime/executor/errors.go - RENAMED - -
    -
    -
    -
    - - - - - - - - - - - - - - - - - - - - - - - + - - - - - - - - - - - - - - - - - - -
    -
    @@ -454,6 +454,8 @@
    - 454 + + 103 +
    -   - return runtime.ErrExecutorErrorInvalidDataStream + + + Contract *CustomModExpTransactor // Generic contract transactor binding to set the session for
    - 455 + + 104 +
    -   - case ExecutorError_EXECUTOR_ERROR_INVALID_UPDATE_MERKLE_TREE: + + + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session
    - 456 + + 105 +
    -   - return runtime.ErrExecutorErrorInvalidUpdateMerkleTree + + + }
    - + + 106 -
    -   +
    +
    + +
    - + + 107 -
    -   -
    +
    +
    + + + // CustomModExpRaw is an auto generated low-level Go binding around an Ethereum contract.
    - 457 + + 108 +
    -   - } + + + type CustomModExpRaw struct {
    - 458 + + 109 +
    -   - return ErrExecutorUnknown + + + Contract *CustomModExp // Generic contract binding to access the raw methods on
    - 459 + + 110 +
    -   + + }
    -
    @@ -694,6 +696,8 @@
    +
    + 111 + +
    + + +
    +
    - 694 + + 112 +
    -   - return ExecutorError_EXECUTOR_ERROR_INVALID_DATA_STREAM + + + // CustomModExpCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract.
    - 695 + + 113 +
    -   - case runtime.ErrExecutorErrorInvalidUpdateMerkleTree: + + + type CustomModExpCallerRaw struct {
    - 696 + + 114 +
    -   - return ExecutorError_EXECUTOR_ERROR_INVALID_UPDATE_MERKLE_TREE + + + Contract *CustomModExpCaller // Generic read-only contract binding to access the raw methods on
    - + + 115 -
    -   -
    +
    +
    + + + }
    - + + 116 -
    -   +
    +
    + +
    - 697 + + 117 +
    -   - } + + + // CustomModExpTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract.
    - 698 + + 118 +
    -   -
    + + + type CustomModExpTransactorRaw struct {
    - 699 + + 119 +
    -   - return ErrCodeExecutorUnknown -
    -
    -
    + + + Contract *CustomModExpTransactor // Generic write-only contract binding to access the raw methods on
    -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
     
    - 454 + + 120 +
    -   - return runtime.ErrExecutorErrorInvalidDataStream + + + }
    - 455 + + 121 +
    -   - case ExecutorError_EXECUTOR_ERROR_INVALID_UPDATE_MERKLE_TREE: + + +
    - 456 + + 122 +
    -   - return runtime.ErrExecutorErrorInvalidUpdateMerkleTree + + + // NewCustomModExp creates a new instance of CustomModExp, bound to a specific deployed contract.
    - 457 + 123
    + - case ExecutorError_EXECUTOR_ERROR_SM_MAIN_INVALID_TX_STATUS_ERROR: + func NewCustomModExp(address common.Address, backend bind.ContractBackend) (*CustomModExp, error) {
    - 458 + 124
    + - return runtime.ErrExecutorErrorSMMainInvalidTxStatusError + contract, err := bindCustomModExp(address, backend, backend, backend)
    - 459 - -
    -   - } -
    -
    - 460 + + 125 +
    -   - return ErrExecutorUnknown + + + if err != nil {
    - 461 + + 126 +
    -   - } + + + return nil, err
    -
     
    -
    - 696 + + 127 +
    -   - return ExecutorError_EXECUTOR_ERROR_INVALID_DATA_STREAM + + + }
    - 697 + + 128 +
    -   - case runtime.ErrExecutorErrorInvalidUpdateMerkleTree: + + + return &CustomModExp{CustomModExpCaller: CustomModExpCaller{contract: contract}, CustomModExpTransactor: CustomModExpTransactor{contract: contract}, CustomModExpFilterer: CustomModExpFilterer{contract: contract}}, nil
    - 698 + + 129 +
    -   - return ExecutorError_EXECUTOR_ERROR_INVALID_UPDATE_MERKLE_TREE + + + }
    - 699 + 130
    + - case runtime.ErrExecutorErrorSMMainInvalidTxStatusError: +
    - 700 + 131
    + - return ExecutorError_EXECUTOR_ERROR_SM_MAIN_INVALID_TX_STATUS_ERROR + // NewCustomModExpCaller creates a new read-only instance of CustomModExp, bound to a specific deployed contract.
    - 701 + + 132 +
    -   - } + + + func NewCustomModExpCaller(address common.Address, caller bind.ContractCaller) (*CustomModExpCaller, error) {
    - 702 + + 133 +
    -   -
    + + + contract, err := bindCustomModExp(address, caller, nil, nil)
    - 703 + + 134 +
    -   - return ErrCodeExecutorUnknown -
    -
    -
    + + + if err != nil {
    -
    -
    -
    -
    - - {/home/stefan/go/src/Polygon/zkevm-node → .}/state/runtime/runtime.go - RENAMED - -
    -
    -
    -
    - - - - - - - - - - - - - - - - - - - - - - - -
    -
    @@ -319,6 +319,8 @@
    - 319 + + 135 +
    -   - ErrExecutorErrorInvalidDataStream = errors.New("invalid data stream") + + + return nil, err
    - 320 + + 136 +
    -   - // ErrExecutorErrorInvalidUpdateMerkleTree indicates that the input parameter update merkle tree is invalid + + + }
    - 321 + + 137 +
    -   - ErrExecutorErrorInvalidUpdateMerkleTree = errors.New("invalid update merkle tree") + + + return &CustomModExpCaller{contract: contract}, nil
    - + + 138 -
    -   -
    +
    +
    + + + }
    - + + 139 -
    -   +
    +
    + +
    - 322 + + 140 +
    -   -
    + + + // NewCustomModExpTransactor creates a new write-only instance of CustomModExp, bound to a specific deployed contract.
    - 323 + + 141 +
    -   - // GRPC ERRORS + + + func NewCustomModExpTransactor(address common.Address, transactor bind.ContractTransactor) (*CustomModExpTransactor, error) {
    - 324 + + 142 +
    -   - // =========== -
    -
    -
    + + + contract, err := bindCustomModExp(address, nil, transactor, nil)
    -
    -
    - - - - - - - - - - - - - - - - - - - -
    -
     
    - 319 + + 143 +
    -   - ErrExecutorErrorInvalidDataStream = errors.New("invalid data stream") + + + if err != nil {
    - 320 + + 144 +
    -   - // ErrExecutorErrorInvalidUpdateMerkleTree indicates that the input parameter update merkle tree is invalid + + + return nil, err
    - 321 + + 145 +
    -   - ErrExecutorErrorInvalidUpdateMerkleTree = errors.New("invalid update merkle tree") + + + }
    - 322 + 146
    + - // ErrExecutorErrorSMMainInvalidTxStatusError indicates that the TX has an invalid status-error combination + return &CustomModExpTransactor{contract: contract}, nil
    - 323 + 147
    + - ErrExecutorErrorSMMainInvalidTxStatusError = errors.New("tx has an invalid status-error combination") + }
    - 324 + + 148 +
    -   + +
    - 325 + + 149 +
    -   - // GRPC ERRORS + + + // NewCustomModExpFilterer creates a new log filterer instance of CustomModExp, bound to a specific deployed contract.
    - 326 + + 150 +
    -   - // =========== -
    -
    -
    + + + func NewCustomModExpFilterer(address common.Address, filterer bind.ContractFilterer) (*CustomModExpFilterer, error) {
    -
    -
    -
    -
    - - {/home/stefan/go/src/Polygon/zkevm-node → .}/state/test/forkid_dragonfruit/dragonfruit_test.go - RENAMED - -
    -
    -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    @@ -1486,6 +1486,7 @@
    - 1486 + + 151 +
    -   - }) + + + contract, err := bindCustomModExp(address, nil, nil, filterer)
    - 1487 + + 152 +
    -   -
    + + + if err != nil {
    - 1488 + + 153 +
    -   - receipts := []*types.Receipt{receipt, receipt1} + + + return nil, err
    - + + 154 -
    -   -
    +
    +
    + + + }
    - 1489 + + 155 +
    -   -
    + + + return &CustomModExpFilterer{contract: contract}, nil
    - 1490 + + 156 +
    -   - transactions := []*types.Transaction{signedTx0, signedTx1} + + + }
    - 1491 + + 157 +
    -   + +
    -
    @@ -1505,7 +1506,7 @@
    -
    - 1505 + + 158 +
    -   - txsL2Hash[i] = common.HexToHash(fmt.Sprintf("0x%d", i)) + + + // bindCustomModExp binds a generic wrapper to an already deployed contract.
    - 1506 + + 159 +
    -   - } + + + func bindCustomModExp(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) {
    - 1507 + + 160 +
    -   -
    + + + parsed, err := CustomModExpMetaData.GetAbi()
    - 1508 + + 161 +
    - - - err = testState.AddL2Block(ctx, 0, l2Block, receipts, txsL2Hash, storeTxsEGPData, dbTx) + + + if err != nil {
    - 1509 + + 162 +
    -   - require.NoError(t, err) + + + return nil, err
    - 1510 + + 163 +
    -   - l2Block, err = testState.GetL2BlockByHash(ctx, l2Block.Hash(), dbTx) + + + }
    - 1511 + + 164 +
    -   - require.NoError(t, err) -
    -
    -
    + + + return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil
    -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
     
    - 1486 + + 165 +
    -   - }) + + + }
    - 1487 + + 166 +
    -   + +
    - 1488 + + 167 +
    -   - receipts := []*types.Receipt{receipt, receipt1} + + + // Call invokes the (constant) contract method with params as input values and
    - 1489 + 168
    + - imStateRoots := []common.Hash{common.BytesToHash(processBatchResponse.Responses[0].StateRoot), common.BytesToHash(processBatchResponse.Responses[1].StateRoot)} + // sets the output to result. The result type might be a single field for simple
    - 1490 + + 169 +
    -   -
    + + + // returns, a slice of interfaces for anonymous returns and a struct for named
    - 1491 + + 170 +
    -   - transactions := []*types.Transaction{signedTx0, signedTx1} + + + // returns.
    - 1492 + + 171 +
    -   -
    + + + func (_CustomModExp *CustomModExpRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error {
    -
     
    -
    - 1506 + + 172 +
    -   - txsL2Hash[i] = common.HexToHash(fmt.Sprintf("0x%d", i)) + + + return _CustomModExp.Contract.CustomModExpCaller.contract.Call(opts, result, method, params...)
    - 1507 + + 173 +
    -   - } + + + }
    - 1508 + + 174 +
    -   + +
    - 1509 + + 175 +
    + - err = testState.AddL2Block(ctx, 0, l2Block, receipts, txsL2Hash, storeTxsEGPData, imStateRoots, dbTx) + // Transfer initiates a plain transaction to move funds to the contract, calling
    - 1510 + + 176 +
    -   - require.NoError(t, err) + + + // its default method if one is available.
    - 1511 + + 177 +
    -   - l2Block, err = testState.GetL2BlockByHash(ctx, l2Block.Hash(), dbTx) + + + func (_CustomModExp *CustomModExpRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) {
    - 1512 + + 178 +
    -   - require.NoError(t, err) -
    -
    -
    + + + return _CustomModExp.Contract.CustomModExpTransactor.contract.Transfer(opts)
    -
    -
    -
    -
    - - {/home/stefan/go/src/Polygon/zkevm-node → .}/state/test/forkid_independent/independent_test.go - RENAMED - -
    -
    -
    -
    - - - - - - - - - - - - - - - - - - - - - + - - - - - - - - - - - - - - - - -
    -
    @@ -643,6 +643,7 @@
    - 643 + + 179 +
    -   - transactions := []*types.Transaction{tx} + + + }
    - 644 + + 180 +
    -   + +
    - 645 + + 181 +
    -   - receipts := []*types.Receipt{receipt} + + + // Transact invokes the (paid) contract method with params as input values.
    - + + 182 -
    -   -
    +
    +
    + + + func (_CustomModExp *CustomModExpRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) {
    - 646 + + 183 +
    -   -
    + + + return _CustomModExp.Contract.CustomModExpTransactor.contract.Transact(opts, method, params...)
    - 647 + + 184 +
    -   - // Create block to be able to calculate its hash + + + }
    - 648 + + 185 +
    -   - st := trie.NewStackTrie(nil) + + +
    -
    @@ -659,7 +660,7 @@
    +
    + 186 + +
    + + + // Call invokes the (constant) contract method with params as input values and +
    - 659 + + 187 +
    -   - txsL2Hash[i] = common.HexToHash(fmt.Sprintf("0x%d", i)) + + + // sets the output to result. The result type might be a single field for simple
    - 660 + + 188 +
    -   - } + + + // returns, a slice of interfaces for anonymous returns and a struct for named
    - 661 + + 189 +
    -   -
    + + + // returns.
    - 662 + + 190 +
    - - - err = testState.AddL2Block(ctx, batchNumber, l2Block, receipts, txsL2Hash, storeTxsEGPData, dbTx) + + + func (_CustomModExp *CustomModExpCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error {
    - 663 + + 191 +
    -   - require.NoError(t, err) + + + return _CustomModExp.Contract.contract.Call(opts, result, method, params...)
    - 664 + + 192 +
    -   - result, err := testState.GetL2BlockByHash(ctx, l2Block.Hash(), dbTx) + + + }
    - 665 + + 193 +
    -   - require.NoError(t, err) + + +
    -
    + + + 194 + + +
    + + + // Transfer initiates a plain transaction to move funds to the contract, calling
    -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
     
    - 643 + + 195 +
    -   - transactions := []*types.Transaction{tx} + + + // its default method if one is available.
    - 644 + + 196 +
    -   -
    + + + func (_CustomModExp *CustomModExpTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) {
    - 645 + + 197 +
    -   - receipts := []*types.Receipt{receipt} + + + return _CustomModExp.Contract.contract.Transfer(opts)
    - 646 + 198
    + - imStateRoots := []common.Hash{state.ZeroHash} + }
    - 647 + + 199 +
    -   + +
    - 648 + + 200 +
    -   - // Create block to be able to calculate its hash + + + // Transact invokes the (paid) contract method with params as input values.
    - 649 + + 201 +
    -   - st := trie.NewStackTrie(nil) + + + func (_CustomModExp *CustomModExpTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) {
    -
     
    -
    - 660 + + 202 +
    -   - txsL2Hash[i] = common.HexToHash(fmt.Sprintf("0x%d", i)) + + + return _CustomModExp.Contract.contract.Transact(opts, method, params...)
    - 661 + + 203 +
    -   - } + + + }
    - 662 + + 204 +
    -   + +
    - 663 + + 205 +
    + - err = testState.AddL2Block(ctx, batchNumber, l2Block, receipts, txsL2Hash, storeTxsEGPData, imStateRoots, dbTx) + // ModExpGeneric is a paid mutator transaction binding the contract method 0xd5665d6f.
    - 664 + + 206 +
    -   - require.NoError(t, err) + + + //
    - 665 + + 207 +
    -   - result, err := testState.GetL2BlockByHash(ctx, l2Block.Hash(), dbTx) + + + // Solidity: function modExpGeneric(bytes input) returns()
    - 666 + + 208 +
    -   - require.NoError(t, err) -
    -
    -
    + + + func (_CustomModExp *CustomModExpTransactor) ModExpGeneric(opts *bind.TransactOpts, input []byte) (*types.Transaction, error) {
    -
    -
    -
    -
    - - {/home/stefan/go/src/Polygon/zkevm-node → .}/state/trace.go - RENAMED - -
    -
    -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - - - - - + + +
    -
    @@ -242,6 +242,7 @@
    - 242 + + 209 +
    -   - TimestampLimit: uint64(time.Now().Unix()), + + + return _CustomModExp.contract.Transact(opts, "modExpGeneric", input)
    - 243 + + 210 +
    -   - SkipFirstChangeL2Block: cFalse, + + + }
    - 244 + + 211 +
    -   - SkipWriteBlockInfoRoot: cTrue, + + +
    - + + 212 -
    -   -
    +
    +
    + + + // ModExpGeneric is a paid mutator transaction binding the contract method 0xd5665d6f.
    - 245 + + 213 +
    -   - } + + + //
    - 246 + + 214 +
    -   -
    + + + // Solidity: function modExpGeneric(bytes input) returns()
    - 247 + + 215 +
    -   - // gets the L1InfoTreeData for the transactions + + + func (_CustomModExp *CustomModExpSession) ModExpGeneric(input []byte) (*types.Transaction, error) {
    -
    @@ -249,6 +250,44 @@
    -
    - 249 + + 216 +
    -   - if err != nil { + + + return _CustomModExp.Contract.ModExpGeneric(&_CustomModExp.TransactOpts, input)
    - 250 + + 217 +
    -   - return nil, err + + + }
    - 251 + + 218 +
    -   - } + + +
    - + + 219 -
    -   -
    +
    +
    + + + // ModExpGeneric is a paid mutator transaction binding the contract method 0xd5665d6f.
    - + + 220 -
    -   -
    +
    +
    + + + //
    - - -
    -   -
    +
    + 221 + +
    + + + // Solidity: function modExpGeneric(bytes input) returns()
    - + + 222 -
    -   -
    +
    +
    + + + func (_CustomModExp *CustomModExpTransactorSession) ModExpGeneric(input []byte) (*types.Transaction, error) {
    - + + 223 -
    -   -
    +
    +
    + + + return _CustomModExp.Contract.ModExpGeneric(&_CustomModExp.TransactOpts, input)
    - + + 224 -
    -   -
    +
    +
    + + + } +
    +
    +
    +
    +
    +
    +
    + + {/home/stefan/go/src/Polygon/zkevm-node → .}/test/contracts/bin/triggerErrors/triggerErrors.go + RENAMED + +
    +
    +
    +
    + + + + + - - - - - - - - - - - - - - + + +
    +
    @@ -32,7 +32,7 @@
    - + + 32 -
    +
    +
      -
    + // TriggerErrorsMetaData contains all meta data concerning the TriggerErrors contract.
    - + + 33 -
    +
    +
      -
    + var TriggerErrorsMetaData = &bind.MetaData{
    - + + 34 -
    +
    +
      -
    + ABI: "[{\"inputs\":[],\"name\":\"count\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"outOfCountersKeccaks\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"test\",\"type\":\"bytes32\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"outOfCountersPoseidon\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"outOfCountersSteps\",\"outputs\":[],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"outOfGas\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]",
    - + + 35 -
    -   -
    +
    +
    + - + Bin: "0x60806040526000805534801561001457600080fd5b5061016c806100246000396000f3fe608060405234801561001057600080fd5b50600436106100575760003560e01c806306661abd1461005c5780632621002a1461007757806331fe52e8146100835780638bd7b5381461008d578063cb4e8cd114610095575b600080fd5b61006560005481565b60405190815260200160405180910390f35b620f4240600020610065565b61008b61009d565b005b61008b6100c3565b61008b6100e9565b60005b60648110156100c0578060005580806100b89061010d565b9150506100a0565b50565b60005b620186a08110156100c0576104d2600052806100e18161010d565b9150506100c6565b60005b61c3508110156100c0578060005580806101059061010d565b9150506100ec565b600060001982141561012f57634e487b7160e01b600052601160045260246000fd5b506001019056fea264697066735822122097beacfaa873e4896937143dfea406cc278b929a28023f7e7020b6dea6e9fc7364736f6c634300080c0033",
    - + + 36 -
    +
    +
      -
    + }
    - + + 37 -
    +
    +
     
    - + + 38 -
    +
    +
      -
    + // TriggerErrorsABI is the input ABI used to generate the binding from. +
    +
    +
    +
    +
    + + + + + - - - - - - - - - - - - - - + + +
    +
     
    - + + 32 -
    +
    +
      -
    + // TriggerErrorsMetaData contains all meta data concerning the TriggerErrors contract.
    - + + 33 -
    +
    +
      -
    + var TriggerErrorsMetaData = &bind.MetaData{
    - + + 34 -
    +
    +
      -
    + ABI: "[{\"inputs\":[],\"name\":\"count\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"outOfCountersKeccaks\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"test\",\"type\":\"bytes32\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"outOfCountersPoseidon\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"outOfCountersSteps\",\"outputs\":[],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"outOfGas\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]",
    - + + 35 -
    -   -
    +
    +
    + + + Bin: "0x60806040526000805534801561001457600080fd5b5061016c806100246000396000f3fe608060405234801561001057600080fd5b50600436106100575760003560e01c806306661abd1461005c5780632621002a1461007757806331fe52e8146100835780638bd7b5381461008d578063cb4e8cd114610095575b600080fd5b61006560005481565b60405190815260200160405180910390f35b620f4240600020610065565b61008b61009d565b005b61008b6100c3565b61008b6100e9565b60005b60648110156100c0578060005580806100b89061010d565b9150506100a0565b50565b60005b620186a08110156100c0576104d2600052806100e18161010d565b9150506100c6565b60005b61c3508110156100c0578060005580806101059061010d565b9150506100ec565b600060001982141561012f57634e487b7160e01b600052601160045260246000fd5b506001019056fea26469706673582212208f01c5dc055b1f376f5da5deb33e2c96ee776174bf48874c5ebba0f606de2ac564736f6c634300080c0033",
    - + + 36 -
    +
    +
      -
    + }
    - + + 37 -
    +
    +
     
    - + + 38 -
    +
    +
      -
    + // TriggerErrorsABI is the input ABI used to generate the binding from. +
    +
    +
    +
    +
    +
    +
    + + {/home/stefan/go/src/Polygon/zkevm-node → .}/test/docker-compose.yml + RENAMED + +
    +
    +
    +
    + + + + + - - - - - - - - - - - - - - - + - + + - - - - - - + + + - - - - - + - + + - - - - @@ -97982,618 +96840,580 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - - -
    +
    @@ -2,7 +2,7 @@
    - + + 2 -
    +
    +
      -
    + networks:
    - + + 3 -
    +
    +
      -
    + default:
    - + + 4 -
    +
    +
      -
    + name: zkevm
    - + + 5 -
    -   -
    +
    +
    + - +
    - + + 6 -
    +
    +
      -
    + services:
    - + + 7 -
    +
    +
      -
    + grafana:
    - + + 8 -
    +
    +
      -
    + container_name: grafana
    - + +
    @@ -453,7 +453,7 @@
    -
    +
    + 453 + +
     
    - + + 454 -
    +
    +
      -
    + zkevm-mock-l1-network:
    - + + 455 -
    +
    +
      -
    + container_name: zkevm-mock-l1-network
    - + + 456 -
    +
    +
    + - + image: hermeznetwork/geth-zkevm-contracts:v2.1.3-fork.8-geth1.12.0 +
    +
    + 457 + +
      -
    + ports:
    - + + 458 -
    +
    +
      -
    + - 8545:8545
    - + + 459 -
    +
    +
      -
    + - 8546:8546
    - + +
    @@ -519,6 +519,8 @@
    -
    +
    + 519 + +
      -
    + - 50071:50071 # Executor
    - + + 520 -
    +
    +
      -
    + volumes:
    - + + 521 -
    +
    +
      -
    + - ./config/test.prover.config.json:/usr/src/app/config.json
    - 252 + 522
      -
    + command: >
    - 253 + 523
      - // In case we have any l1InfoTreeData, add them to the request + zkProver -c /usr/src/app/config.json
    - 254 + 524
      - if len(l1InfoTreeData) > 0 { +
    -
    -
    -
    -
    - - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
     
    +
    @@ -628,7 +630,7 @@
    - 242 + 628
      - TimestampLimit: uint64(time.Now().Unix()), + zkevm-sh:
    - 243 + 629
      - SkipFirstChangeL2Block: cFalse, + container_name: zkevm-sh
    - 244 + 630
      - SkipWriteBlockInfoRoot: cTrue, + image: zkevm-node
    - 245 + + 631 +
    - + - ExecutionMode: executor.ExecutionMode0, + - + stdin_open: true
    - 246 + 632
      - } + tty: true
    - 247 + 633
      -
    + environment:
    - 248 + 634
      - // gets the L1InfoTreeData for the transactions + - ZKEVM_NODE_STATE_DB_HOST=zkevm-state-db
    -
     
    +
    @@ -638,3 +640,51 @@
    - 250 + 638
      - if err != nil { + - ./config/test.genesis.config.json:/app/genesis.json
    - 251 + 639
      - return nil, err + command:
    - 252 + 640
      - } + - "/bin/sh"
    - 253 + + -
    - + -
    +
    +
    +   +
    - 254 + + -
    - + - // In case we have any l1InfoTreeData, add them to the request +
    +
    +   +
    - 255 + + -
    - + - if len(l1InfoTreeData) > 0 { +
    +
    +   +
    - 256 + + -
    - + - processBatchRequestV2.L1InfoTreeData = map[uint32]*executor.L1DataV2{} +
    +
    +   +
    - 257 + + -
    - + - processBatchRequestV2.SkipVerifyL1InfoRoot = cTrue +
    +
    +   +
    - 258 + + -
    - + - for k, v := range l1InfoTreeData { +
    +
    +   +
    - 259 + + -
    - + - processBatchRequestV2.L1InfoTreeData[k] = &executor.L1DataV2{ +
    +
    +   +
    - 260 + + -
    - + - GlobalExitRoot: v.GlobalExitRoot.Bytes(), +
    +
    +   +
    - 261 + + -
    - + - BlockHashL1: v.BlockHashL1.Bytes(), +
    +
    +   +
    - 262 + + -
    - + - MinTimestamp: v.MinTimestamp, +
    +
    +   +
    - 263 + + -
    - + - } +
    +
    +   +
    - 264 + + -
    - + - } +
    +
    +   +
    - 265 + + -
    - + - } +
    +
    +   +
    - 266 + + -
    - + +
    +
    +  
    - 267 + + -
    - + - // gets the L1InfoTreeData for the transactions +
    +
    +   +
    - 268 + + -
    - + - l1InfoTreeData, _, _, err = s.GetL1InfoTreeDataFromBatchL2Data(ctx, transactions, dbTx) +
    +
    +   +
    - 269 + + -
    - + - if err != nil { +
    +
    +   +
    - 270 + + -
    - + - return nil, err +
    +
    +   +
    - 271 + + -
    - + - } +
    +
    +   +
    - 272 + + -
    - + +
    +
    +  
    - 273 + + -
    - + - // In case we have any l1InfoTreeData, add them to the request +
    +
    +   +
    - 274 + + -
    - + - if len(l1InfoTreeData) > 0 { +
    +
    +   +
    - 275 + + -
    - + - processBatchRequestV2.L1InfoTreeData = map[uint32]*executor.L1DataV2{} +
    +
    +   +
    - 276 + + -
    - + - processBatchRequestV2.SkipVerifyL1InfoRoot = cTrue +
    +
    +   +
    - 277 + + -
    - + - for k, v := range l1InfoTreeData { +
    +
    +   +
    - 278 + + -
    - + - processBatchRequestV2.L1InfoTreeData[k] = &executor.L1DataV2{ +
    +
    +   +
    - 279 + + -
    - + - GlobalExitRoot: v.GlobalExitRoot.Bytes(), +
    +
    +   +
    - 280 + + -
    - + - BlockHashL1: v.BlockHashL1.Bytes(), +
    +
    +   +
    - 281 + + -
    - + - MinTimestamp: v.MinTimestamp, +
    +
    +   +
    - 282 + + -
    - + - } +
    +
    +   +
    - 283 + + -
    - + - } +
    +
    +   +
    - 284 + + -
    - + - } +
    +
    +   +
    - 285 + + -
    - + +
    +
    +  
    - 286 + + -
    - + - // gets the L1InfoTreeData for the transactions +
    +
    +   +
    - 287 + + -
    - + - l1InfoTreeData, _, _, err = s.GetL1InfoTreeDataFromBatchL2Data(ctx, transactions, dbTx) +
    +
    +   +
    - 288 + + -
    - + - if err != nil { +
    +
    +   +
    - 289 + + -
    - + - return nil, err +
    +
    +   +
    - 290 + + -
    - + - } +
    +
    +   +
    - 291 + + -
    +
    +
     
    - 292 + + -
    +
    +
      - // In case we have any l1InfoTreeData, add them to the request +
    - 293 + + -
    +
    +
      - if len(l1InfoTreeData) > 0 { -
    -
    -
    +
    -
    -
    -
    -
    - - {/home/stefan/go/src/Polygon/zkevm-node → .}/state/transaction.go - RENAMED - -
    -
    -
    -
    - - - - - - - - - - - - - - - - - - + +
    -
    @@ -117,6 +117,8 @@
    - 117 + + -
    +
    +
      - return ErrBatchAlreadyClosed +
    - 118 + + -
    +
    +
      - } +
    - 119 + + -
    +
    +
     
    @@ -98619,343 +97439,262 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 120 + + -
    +
    +
      - for _, processedBlock := range processedBlocks { +
    - 121 + + -
    +
    +
      - processedTxs := processedBlock.TransactionResponses +
    - 122 - -
    -   - // check existing txs vs parameter txs +
    +
    - - +
    +
    + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - - - - - + + +
    -
    @@ -167,11 +169,12 @@
    -
    - 167 - -
    -   - header.BlockInfoRoot = processedBlock.BlockInfoRoot -
    -
    - 168 - -
    -   - transactions := []*types.Transaction{&processedTx.Tx} -
    -
    - 169 - -
    -   -
    -
    -
    - 170 - -
    - - - receipt := GenerateReceipt(header.Number, processedTx, uint(i)) -
    +
     
    - 171 + 2
      - if !CheckLogOrder(receipt.Logs) { + networks:
    - 172 + 3
      - return fmt.Errorf("error: logs received from executor are not in order") + default:
    - 173 + 4
      - } + name: zkevm
    - 174 + + 5 +
    -   - receipts := []*types.Receipt{receipt} -
    -
    - - -
    -   + +
    - 175 + 6
      -
    + services:
    - 176 + 7
      - // Create l2Block to be able to calculate its hash + grafana:
    - 177 + 8
      - st := trie.NewStackTrie(nil) + container_name: grafana
    -
    @@ -187,7 +190,7 @@
    +
     
    - 187 + 453
      - txsL2Hash := []common.Hash{processedTx.TxHashL2_V2} +
    - 188 + 454
      -
    + zkevm-mock-l1-network:
    - 189 + 455
      - // Store L2 block and its transaction + container_name: zkevm-mock-l1-network
    - 190 + + 456 +
    - - - if err := s.AddL2Block(ctx, batchNumber, l2Block, receipts, txsL2Hash, storeTxsEGPData, dbTx); err != nil { + + + image: 0xpolygon/cdk-validium-contracts:forkId8
    - 191 + 457
      - return err + ports:
    - 192 + 458
      - } + - 8545:8545
    - 193 + 459
      - } + - 8546:8546
    -
    @@ -209,8 +212,11 @@
    +
     
    - 209 + 519
      - return err + - 50071:50071 # Executor
    - 210 + 520
      - } + volumes:
    - 211 + 521
      -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    + - ./config/test.prover.config.json:/usr/src/app/config.json
    - 212 + + 522 +
    -   - gasLimit := l2Block.GasLimit + + + environment:
    - 213 + + 523 +
    - - - if gasLimit > MaxL2BlockGasLimit { -
    -
    - - -
    -   -
    + + + - EXPERIMENTAL_DOCKER_DESKTOP_FORCE_QEMU=1
    - 214 + 524
      - gasLimit = MaxL2BlockGasLimit + command: >
    - 215 + 525
      - } + zkProver -c /usr/src/app/config.json
    - 216 + 526
    @@ -98966,622 +97705,621 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    -
    @@ -234,6 +240,8 @@
    +
     
    - 234 + 630
      - storeTxsEGPData := make([]StoreTxEGPData, 0, numTxs) + zkevm-sh:
    - 235 + 631
      - receipts := make([]*types.Receipt, 0, numTxs) + container_name: zkevm-sh
    - 236 + 632
      - txsL2Hash := make([]common.Hash, 0, numTxs) -
    -
    - - -
    -   -
    + image: zkevm-node
    - + + 633 -
    -   -
    +
    +
    + + + stdin_open: true
    - 237 + 634
      -
    + tty: true
    - 238 + 635
      - for i, txResponse := range l2Block.TransactionResponses { + environment:
    - 239 + 636
      - // if the transaction has an intrinsic invalid tx error it means + - ZKEVM_NODE_STATE_DB_HOST=zkevm-state-db
    -
    @@ -256,8 +264,9 @@
    +
     
    - 256 + 640
      -
    + - ./config/test.genesis.config.json:/app/genesis.json
    - 257 + 641
      - storeTxsEGPData = append(storeTxsEGPData, storeTxEGPData) + command:
    - 258 + 642
      -
    + - "/bin/sh"
    - 259 + + 643 +
    - - - receipt := GenerateReceipt(header.Number, txResponse, uint(i)) + + +
    - 260 + + 644 +
    -   - receipts = append(receipts, receipt) + + + zkevm-node-forced-DAC:
    - + + 645 -
    -   -
    +
    +
    + + + container_name: zkevm-node-forced-DAC
    - 261 + + 646 +
    -   - } + + + image: zkevm-node
    - 262 + + 647 +
    -   -
    + + + ports:
    - 263 + + 648 +
    -   - // Create block to be able to calculate its hash + + + - 8125:8125
    -
    @@ -270,7 +279,7 @@
    -
    - 270 + + 649 +
    -   - } + + + environment:
    - 271 + + 650 +
    -   -
    + + + - ZKEVM_NODE_ISTRUSTEDSEQUENCER=false
    - 272 + + 651 +
    -   - // Store L2 block and its transactions + + + - ZKEVM_NODE_STATEDB_USER=test_user
    - 273 + + 652 +
    - - - if err := s.AddL2Block(ctx, batchNumber, block, receipts, txsL2Hash, storeTxsEGPData, dbTx); err != nil { + + + - ZKEVM_NODE_STATEDB_PASSWORD=test_password
    - 274 + + 653 +
    -   - return err + + + - ZKEVM_NODE_STATEDB_NAME=state_db
    - 275 + + 654 +
    -   - } + + + - ZKEVM_NODE_STATEDB_HOST=zkevm-permissionless-db
    - 276 + + 655 +
    -   -
    + + + - ZKEVM_NODE_POOL_DB_USER=test_user
    -
    @@ -529,6 +538,7 @@
    -
    - 529 + + 656 +
    -   - TimestampLimit: uint64(time.Now().Unix()), + + + - ZKEVM_NODE_POOL_DB_PASSWORD=test_password
    - 530 + + 657 +
    -   - SkipFirstChangeL2Block: cFalse, + + + - ZKEVM_NODE_POOL_DB_NAME=pool_db
    - 531 + + 658 +
    -   - SkipWriteBlockInfoRoot: cTrue, + + + - ZKEVM_NODE_POOL_DB_HOST=zkevm-permissionless-db
    - + + 659 -
    -   -
    +
    +
    + + + - ZKEVM_NODE_RPC_PORT=8125
    - 532 + + 660 +
    -   - } + + + - ZKEVM_NODE_RPC_SEQUENCERNODEURI=http://zkevm-node-json-rpc:8123
    - 533 + + 661 +
    -   - if noZKEVMCounters { + + + - ZKEVM_NODE_SYNCHRONIZER_TRUSTEDSEQUENCERURL=http://you-cant-touch-this:8123
    - 534 + + 662 +
    -   - processBatchRequestV2.NoCounters = cTrue + + + - ZKEVM_NODE_MTCLIENT_URI=zkevm-permissionless-prover:50061
    -
    @@ -642,6 +652,8 @@
    -
    - 642 + + 663 +
    -   - return nil, err + + + - ZKEVM_NODE_EXECUTOR_URI=zkevm-permissionless-prover:50071
    - 643 + + 664 +
    -   - } + + + volumes:
    - 644 + + 665 +
    -   -
    + + + - ./config/test.node.config.toml:/app/config.toml
    - + + 666 -
    -   -
    +
    +
    + + + - ./config/test.genesis.config.json:/app/genesis.json
    - + + 667 -
    -   -
    +
    +
    + + + command:
    - 645 + + 668 +
    -   - header := NewL2Header(&types.Header{ + + + - "/bin/sh"
    - 646 + + 669 +
    -   - Number: new(big.Int).SetUint64(lastL2Block.Number().Uint64() + 1), + + + - "-c"
    - 647 + + 670 +
    -   - ParentHash: lastL2Block.Hash(), + + + - "/app/zkevm-node run --network custom --custom-network-file /app/genesis.json --cfg /app/config.toml --components \"rpc,synchronizer\""
    -
    @@ -655,8 +667,9 @@
    -
    - 655 + + 671 +
    -   - header.BlockInfoRoot = blockInfoRoot + + +
    - 656 + + 672 +
    -   - transactions := []*types.Transaction{&processedTx.Tx} + + + zkevm-data-node-db:
    - 657 + + 673 +
    -   -
    + + + container_name: zkevm-data-node-db
    - 658 + + 674 +
    - - - receipt := GenerateReceipt(header.Number, processedTx, 0) + + + restart: unless-stopped
    - 659 + + 675 +
    -   - receipts := []*types.Receipt{receipt} + + + image: postgres
    - + + 676 -
    -   -
    +
    +
    + + + healthcheck:
    - 660 + + 677 +
    -   -
    + + + test: ["CMD-SHELL", "pg_isready -d $${POSTGRES_DB} -U $${POSTGRES_USER}"]
    - 661 + + 678 +
    -   - // Create l2Block to be able to calculate its hash + + + interval: 10s
    - 662 + + 679 +
    -   - st := trie.NewStackTrie(nil) + + + timeout: 5s
    -
    @@ -669,7 +682,7 @@
    -
    - 669 + + 680 +
    -   - txsL2Hash := []common.Hash{processedTx.TxHashL2_V2} + + + retries: 5
    - 670 + + 681 +
    -   -
    + + + ports:
    - 671 + + 682 +
    -   - // Store L2 block and its transaction + + + - 5444:5432
    - 672 + + 683 +
    - - - if err := s.AddL2Block(ctx, batchNumber, l2Block, receipts, txsL2Hash, storeTxsEGPData, dbTx); err != nil { + + + environment:
    - 673 + + 684 +
    -   - return nil, err + + + - POSTGRES_USER=committee_user
    - 674 + + 685 +
    -   - } + + + - POSTGRES_PASSWORD=committee_password
    - 675 + + 686 +
    -   -
    + + + - POSTGRES_DB=committee_db
    -
    @@ -1003,6 +1016,7 @@
    +
    + 687 + +
    + + + command: +
    - 1003 + + 688 +
    -   - TimestampLimit: uint64(time.Now().Unix()), + + + - "postgres"
    - 1004 + + 689 +
    -   - SkipFirstChangeL2Block: cTrue, + + + - "-N"
    - 1005 + + 690 +
    -   - SkipWriteBlockInfoRoot: cTrue, + + + - "500" +
    +
    +
    +
    +
    +
    +
    + + {/home/stefan/go/src/Polygon/zkevm-node → .}/test/e2e/datacommittee_test.go + RENAMED + +
    +
    +
    +
    + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - -
    +
    @@ -0,0 +1,270 @@
    @@ -99594,1212 +98332,1183 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 1006 + + -
    +
    +
      - } +
    - 1007 + + -
    +
    +
     
    - 1008 + + -
    +
    +
      - log.Debugf("EstimateGas[processBatchRequestV2.From]: %v", processBatchRequestV2.From) +
    -
    @@ -1034,7 +1048,6 @@
    -
    - 1034 + + -
    +
    +
      - } +
    - 1035 + + -
    +
    +
      - if processBatchResponseV2.ErrorRom != executor.RomError_ROM_ERROR_NO_ERROR { +
    - 1036 + + -
    +
    +
      - err = executor.RomErr(processBatchResponseV2.ErrorRom) +
    - 1037 + + -
    - - - s.eventLog.LogExecutorErrorV2(ctx, processBatchResponseV2.Error, processBatchRequestV2) +
    +
    +   +
    - 1038 + + -
    +
    +
      - return false, false, gasUsed, nil, err +
    - 1039 + + -
    +
    +
      - } +
    - 1040 + + -
    +
    +
     
    -
    -
    -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - - - - - - - - - - - - - - - - - - - + - - - - - - - - - - - - - - - - + - - - - - - - - - - - - - - - - + - - - - - - @@ -100813,92 +99522,73 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - - - - - - - - -
    -
     
    -
    - 117 + + -
    +
    +
      - return ErrBatchAlreadyClosed +
    - 118 + + -
    +
    +
      - } +
    - 119 + + -
    +
    +
     
    - 120 + + -
    - + - forkID := s.GetForkIDByBatchNumber(batchNumber) +
    +
    +   +
    - 121 + + -
    - + +
    +
    +  
    - 122 + + -
    +
    +
      - for _, processedBlock := range processedBlocks { +
    - 123 + + -
    +
    +
      - processedTxs := processedBlock.TransactionResponses +
    - 124 + + -
    +
    +
      - // check existing txs vs parameter txs +
    -
     
    -
    - 169 + + -
    +
    +
      - header.BlockInfoRoot = processedBlock.BlockInfoRoot +
    - 170 + + -
    +
    +
      - transactions := []*types.Transaction{&processedTx.Tx} +
    - 171 + + -
    +
    +
     
    - 172 + + -
    - + - receipt := GenerateReceipt(header.Number, processedTx, uint(i), forkID) +
    +
    +   +
    - 173 + + -
    +
    +
      - if !CheckLogOrder(receipt.Logs) { +
    - 174 + + -
    +
    +
      - return fmt.Errorf("error: logs received from executor are not in order") +
    - 175 + + -
    +
    +
      - } +
    - 176 + + -
    +
    +
      - receipts := []*types.Receipt{receipt} +
    - 177 + + -
    - + - imStateRoots := []common.Hash{processedTx.StateRoot} +
    +
    +   +
    - 178 + + -
    +
    +
     
    - 179 + + -
    +
    +
      - // Create l2Block to be able to calculate its hash +
    - 180 + + -
    +
    +
      - st := trie.NewStackTrie(nil) +
    -
     
    -
    - 190 + + -
    +
    +
      - txsL2Hash := []common.Hash{processedTx.TxHashL2_V2} +
    - 191 + + -
    +
    +
     
    - 192 + + -
    +
    +
      - // Store L2 block and its transaction +
    - 193 + + -
    - + - if err := s.AddL2Block(ctx, batchNumber, l2Block, receipts, txsL2Hash, storeTxsEGPData, imStateRoots, dbTx); err != nil { +
    +
    +   +
    - 194 + + -
    +
    +
      - return err +
    - 195 + + -
    +
    +
      - } +
    - 196 + + -
    +
    +
      - } +
    -
     
    -
    - 212 + + -
    +
    +
      - return err +
    - 213 + + -
    +
    +
      - } +
    - 214 + + -
    +
    +
     
    - 215 + + -
    - + - forkID := s.GetForkIDByBatchNumber(batchNumber) +
    +
    +   +
    - 216 + + -
    - + +
    +
    +  
    - 217 + + -
    +
    +
      - gasLimit := l2Block.GasLimit +
    - 218 + + -
    - + - // We check/set the maximum value of gasLimit for batches <= to ETROG fork. For batches >= to ELDERBERRY fork we use always the value returned by the executor +
    +
    +   +
    - 219 + + -
    - + - if forkID <= FORKID_ETROG && gasLimit > MaxL2BlockGasLimit { +
    +
    +   +
    - 220 + + -
    +
    +
      - gasLimit = MaxL2BlockGasLimit +
    - 221 + + -
    +
    +
      - } +
    - 222 + + -
    +
    +
     
    -
     
    -
    - 240 + + -
    +
    +
      - storeTxsEGPData := make([]StoreTxEGPData, 0, numTxs) +
    - 241 + + -
    +
    +
      - receipts := make([]*types.Receipt, 0, numTxs) +
    - 242 + + -
    +
    +
      - txsL2Hash := make([]common.Hash, 0, numTxs) +
    - 243 + + -
    - + - imStateRoots := make([]common.Hash, 0, numTxs) +
    +
    +   +
    - 244 + + -
    - + - var receipt *types.Receipt +
    +
    +   +
    - 245 + + -
    +
    +
     
    - 246 + + -
    +
    +
      - for i, txResponse := range l2Block.TransactionResponses { +
    - 247 + + -
    +
    +
      - // if the transaction has an intrinsic invalid tx error it means +
    -
     
    -
    - 264 + + -
    +
    +
     
    - 265 + + -
    +
    +
      - storeTxsEGPData = append(storeTxsEGPData, storeTxEGPData) +
    - 266 + + -
    +
    +
     
    - 267 + + -
    - + - receipt = GenerateReceipt(header.Number, txResponse, uint(i), forkID) +
    +
    +   +
    - 268 + + -
    +
    +
      - receipts = append(receipts, receipt) +
    - 269 + + -
    - + - imStateRoots = append(imStateRoots, txResp.StateRoot) +
    +
    +   +
    - 270 + + -
    +
    +
      - } +
    - 271 + + -
    +
    +
     
    - 272 + + -
    +
    +
      - // Create block to be able to calculate its hash +
    -
     
    -
    - 279 + + -
    +
    +
      - } +
    - 280 + + -
    +
    +
     
    - 281 + + -
    +
    +
      - // Store L2 block and its transactions +
    - 282 + + -
    - + - if err := s.AddL2Block(ctx, batchNumber, block, receipts, txsL2Hash, storeTxsEGPData, imStateRoots, dbTx); err != nil { +
    +
    +   +
    - 283 + + -
    +
    +
      - return err +
    - 284 + + -
    +
    +
      - } +
    - 285 + + -
    +
    +
     
    -
     
    +
    + + +
    +   +
    +
    - 538 + + -
    +
    +
      - TimestampLimit: uint64(time.Now().Unix()), +
    - 539 + + -
    +
    +
      - SkipFirstChangeL2Block: cFalse, +
    - 540 + + -
    +
    +
      - SkipWriteBlockInfoRoot: cTrue, +
    - 541 + + -
    - + - ExecutionMode: executor.ExecutionMode0, +
    +
    +   +
    - 542 + + -
    +
    +
      - } +
    - 543 + + -
    +
    +
      - if noZKEVMCounters { +
    - 544 + + -
    +
    +
      - processBatchRequestV2.NoCounters = cTrue +
    -
     
    -
    - 652 + + -
    +
    +
      - return nil, err +
    - 653 + + -
    +
    +
      - } +
    - 654 + + -
    +
    +
     
    - 655 + + -
    - + - forkID := s.GetForkIDByBatchNumber(batchNumber) +
    +
    +   +
    - 656 + + -
    - + +
    +
    +  
    - 657 + + -
    +
    +
      - header := NewL2Header(&types.Header{ +
    - 658 + + -
    +
    +
      - Number: new(big.Int).SetUint64(lastL2Block.Number().Uint64() + 1), +
    - 659 + + -
    +
    +
      - ParentHash: lastL2Block.Hash(), +
    -
     
    +
    + + +
    +   +
    +
    - 667 + + -
    +
    +
      - header.BlockInfoRoot = blockInfoRoot +
    - 668 + + -
    +
    +
      - transactions := []*types.Transaction{&processedTx.Tx} +
    - 669 + + -
    +
    +
     
    - 670 + + -
    - + - receipt := GenerateReceipt(header.Number, processedTx, 0, forkID) +
    +
    +   +
    - 671 + + -
    +
    +
      - receipts := []*types.Receipt{receipt} +
    - 672 + + -
    - + - imStateRoots := []common.Hash{processedTx.StateRoot} +
    +
    +   +
    - 673 + + -
    +
    +
     
    - 674 + + -
    +
    +
      - // Create l2Block to be able to calculate its hash +
    - 675 + + -
    +
    +
      - st := trie.NewStackTrie(nil) +
    -
     
    +
    + + +
    +   +
    +
    - 682 + + -
    +
    +
      - txsL2Hash := []common.Hash{processedTx.TxHashL2_V2} +
    - 683 + + -
    +
    +
     
    - 684 + + -
    +
    +
      - // Store L2 block and its transaction +
    - 685 + + -
    - + - if err := s.AddL2Block(ctx, batchNumber, l2Block, receipts, txsL2Hash, storeTxsEGPData, imStateRoots, dbTx); err != nil { +
    +
    +   +
    - 686 + + -
    +
    +
      - return nil, err +
    - 687 + + -
    +
    +
      - } +
    - 688 + + -
    +
    +
     
    -
     
    +
    + + +
    +   +
    +
    - 1016 + + -
    +
    +
      - TimestampLimit: uint64(time.Now().Unix()), +
    - 1017 + + -
    +
    +
      - SkipFirstChangeL2Block: cTrue, +
    - 1018 + + -
    +
    +
      - SkipWriteBlockInfoRoot: cTrue, +
    - 1019 + + -
    - + - ExecutionMode: executor.ExecutionMode0, +
    +
    +   +
    - 1020 + + -
    +
    +
      - } +
    - 1021 + + -
    +
    +
     
    - 1022 + + -
    +
    +
      - log.Debugf("EstimateGas[processBatchRequestV2.From]: %v", processBatchRequestV2.From) +
    -
     
    +
    + + +
    +   +
    +
    - 1048 + + -
    +
    +
      - } +
    - 1049 + + -
    +
    +
      - if processBatchResponseV2.ErrorRom != executor.RomError_ROM_ERROR_NO_ERROR { +
    - 1050 + + -
    +
    +
      - err = executor.RomErr(processBatchResponseV2.ErrorRom) +
    - 1051 + + -
    +
    +
      - return false, false, gasUsed, nil, err +
    - 1052 + + -
    +
    +
      - } +
    - 1053 + + -
    +
    +
     
    -
    + + + + + +
    +   +
    -
    -
    -
    -
    - - {/home/stefan/go/src/Polygon/zkevm-node → .}/state/types.go - RENAMED - -
    -
    -
    -
    - - - - - - - - - - - @@ -100922,166 +99612,33 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - - - - - - - - -
    -
    @@ -100,6 +100,8 @@
    - 100 + + -
    +
    +
      - GasLeft uint64 +
    - 101 + + -
    +
    +
      - // GasUsed is the total gas used as result of execution or gas estimation +
    - 102 + + -
    +
    +
      - GasUsed uint64 +
    - 103 + + -
    +
    +
      - // GasRefunded is the total gas refunded as result of execution +
    - 104 + + -
    +
    +
      - GasRefunded uint64 +
    - 105 + + -
    +
    +
      - // RomError represents any error encountered during the execution -
    -
    -
    -
    -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
     
    -
    - 100 - -
    -   - GasLeft uint64 -
    -
    - 101 - -
    -   - // GasUsed is the total gas used as result of execution or gas estimation -
    -
    - 102 - -
    -   - GasUsed uint64 -
    -
    - 103 - -
    - + - // CumulativeGasUsed is the accumulated gas used (sum of tx GasUsed and CumulativeGasUsed of the previous tx in the L2 block) -
    -
    - 104 - -
    - + - CumulativeGasUsed uint64 -
    -
    - 105 - -
    -   - // GasRefunded is the total gas refunded as result of execution -
    -
    - 106 - -
    -   - GasRefunded uint64 -
    -
    - 107 - -
    -   - // RomError represents any error encountered during the execution -
    -
    -
    -
    -
    -
    -
    -
    - - {/home/stefan/go/src/Polygon/zkevm-node → .}/synchronizer/actions/check_l2block.go - RENAMED - -
    -
    -
    -
    - - - - - - - - @@ -102485,33715 +101042,152 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    @@ -0,0 +1,139 @@
    -
    - - -
    -   -
    +
    + - package actions -
    -
    - 2 - -
    - + -
    -
    -
    - 3 - -
    - + - import ( -
    -
    - 4 - -
    - + - "context" -
    -
    - 5 - -
    - + - "errors" -
    -
    - 6 - -
    - + - "fmt" -
    -
    - 7 - -
    - + - "math/big" -
    -
    - 8 - -
    - + -
    -
    -
    - 9 - -
    - + - "github.com/0xPolygonHermez/zkevm-node/jsonrpc/types" -
    -
    - 10 - -
    - + - "github.com/0xPolygonHermez/zkevm-node/log" -
    -
    - 11 - -
    - + - "github.com/0xPolygonHermez/zkevm-node/state" -
    -
    - 12 - -
    - + - "github.com/jackc/pgx/v4" -
    -
    - 13 - -
    - + - ) -
    -
    - 14 - -
    - + -
    -
    -
    - 15 - -
    - + - // Implements PostClosedBatchChecker -
    -
    - 16 - -
    - + -
    -
    -
    - 17 - -
    - + - type stateGetL2Block interface { -
    -
    - 18 - -
    - + - GetL2BlockByNumber(ctx context.Context, blockNumber uint64, dbTx pgx.Tx) (*state.L2Block, error) -
    -
    - 19 - -
    - + - GetLastL2BlockNumber(ctx context.Context, dbTx pgx.Tx) (uint64, error) -
    -
    - 20 - -
    - + - } -
    -
    - 21 - -
    - + -
    -
    -
    - 22 - -
    - + - type trustedRPCGetL2Block interface { -
    -
    - 23 - -
    - + - BlockByNumber(ctx context.Context, number *big.Int) (*types.Block, error) -
    -
    - 24 - -
    - + - } -
    -
    - 25 - -
    - + -
    -
    -
    - 26 - -
    - + - // CheckL2BlockHash is a struct that implements a checker of L2Block hash -
    -
    - 27 - -
    - + - type CheckL2BlockHash struct { -
    -
    - 28 - -
    - + - state stateGetL2Block -
    -
    - 29 - -
    - + - trustedClient trustedRPCGetL2Block -
    -
    - 30 - -
    - + - lastL2BlockChecked uint64 -
    -
    - 31 - -
    - + - // Is a modulus used to choose the l2block to check -
    -
    - 32 - -
    - + - modulusL2BlockToCheck uint64 -
    -
    - 33 - -
    - + - } -
    -
    - 34 - -
    - + -
    -
    -
    - 35 - -
    - + - // NewCheckL2BlockHash creates a new CheckL2BlockHash -
    -
    - 36 - -
    - + - func NewCheckL2BlockHash(state stateGetL2Block, -
    -
    - 37 - -
    - + - trustedClient trustedRPCGetL2Block, -
    -
    - 38 - -
    - + - initialL2BlockNumber uint64, -
    -
    - 39 - -
    - + - modulusBlockNumber uint64) *CheckL2BlockHash { -
    -
    - 40 - -
    - + - return &CheckL2BlockHash{ -
    -
    - 41 - -
    - + - state: state, -
    -
    - 42 - -
    - + - trustedClient: trustedClient, -
    -
    - 43 - -
    - + - lastL2BlockChecked: initialL2BlockNumber, -
    -
    - 44 - -
    - + - modulusL2BlockToCheck: modulusBlockNumber, -
    -
    - 45 - -
    - + - } -
    -
    - 46 - -
    - + - } -
    -
    - 47 - -
    - + -
    -
    -
    - 48 - -
    - + - // CheckL2Block checks the L2Block hash between the local and the trusted -
    -
    - 49 - -
    - + - func (p *CheckL2BlockHash) CheckL2Block(ctx context.Context, dbTx pgx.Tx) error { -
    -
    - 50 - -
    - + - lastLocalL2BlockNumber, err := p.state.GetLastL2BlockNumber(ctx, dbTx) -
    -
    - 51 - -
    - + - if errors.Is(err, state.ErrNotFound) || errors.Is(err, state.ErrStateNotSynchronized) { -
    -
    - 52 - -
    - + - log.Debugf("checkL2block:No L2Block in database. err: %s", err.Error()) -
    -
    - 53 - -
    - + - return nil -
    -
    - 54 - -
    - + - } -
    -
    - 55 - -
    - + - if err != nil { -
    -
    - 56 - -
    - + - log.Errorf("checkL2block: Error getting last L2Block from the database. err: %s", err.Error()) -
    -
    - 57 - -
    - + - return err -
    -
    - 58 - -
    - + - } -
    -
    - 59 - -
    - + - shouldCheck, l2BlockNumber := p.GetNextL2BlockToCheck(lastLocalL2BlockNumber, p.GetMinimumL2BlockToCheck()) -
    -
    - 60 - -
    - + - if !shouldCheck { -
    -
    - 61 - -
    - + - return nil -
    -
    - 62 - -
    - + - } -
    -
    - 63 - -
    - + - err = p.iterationCheckL2Block(ctx, l2BlockNumber, dbTx) -
    -
    - 64 - -
    - + - if err != nil { -
    -
    - 65 - -
    - + - return err -
    -
    - 66 - -
    - + - } -
    -
    - 67 - -
    - + - return nil -
    -
    - 68 - -
    - + - } -
    -
    - 69 - -
    - + -
    -
    -
    - 70 - -
    - + - // GetNextL2BlockToCheck returns true is need to check and the blocknumber -
    -
    - 71 - -
    - + - func (p *CheckL2BlockHash) GetNextL2BlockToCheck(lastLocalL2BlockNumber, minL2BlockNumberToCheck uint64) (bool, uint64) { -
    -
    - 72 - -
    - + - l2BlockNumber := max(minL2BlockNumberToCheck, lastLocalL2BlockNumber) -
    -
    - 73 - -
    - + - if l2BlockNumber > lastLocalL2BlockNumber { -
    -
    - 74 - -
    - + - log.Infof("checkL2block: skip check L2block (next to check: %d) currently LastL2BlockNumber: %d", minL2BlockNumberToCheck, lastLocalL2BlockNumber) -
    -
    - 75 - -
    - + - return false, 0 -
    -
    - 76 - -
    - + - } -
    -
    - 77 - -
    - + - return true, l2BlockNumber -
    -
    - 78 - -
    - + - } -
    -
    - 79 - -
    - + -
    -
    -
    - 80 - -
    - + - // GetMinimumL2BlockToCheck returns the minimum L2Block to check -
    -
    - 81 - -
    - + - func (p *CheckL2BlockHash) GetMinimumL2BlockToCheck() uint64 { -
    -
    - 82 - -
    - + - if p.modulusL2BlockToCheck == 0 { -
    -
    - 83 - -
    - + - return p.lastL2BlockChecked + 1 -
    -
    - 84 - -
    - + - } -
    -
    - 85 - -
    - + - return ((p.lastL2BlockChecked / p.modulusL2BlockToCheck) + 1) * p.modulusL2BlockToCheck -
    -
    - 86 - -
    - + - } -
    -
    - 87 - -
    - + -
    -
    -
    - 88 - -
    - + - // GetL2Blocks returns localL2Block and trustedL2Block -
    -
    - 89 - -
    - + - func (p *CheckL2BlockHash) GetL2Blocks(ctx context.Context, blockNumber uint64, dbTx pgx.Tx) (*state.L2Block, *types.Block, error) { -
    -
    - 90 - -
    - + - localL2Block, err := p.state.GetL2BlockByNumber(ctx, blockNumber, dbTx) -
    -
    - 91 - -
    - + - if err != nil { -
    -
    - 92 - -
    - + - log.Debugf("checkL2block: Error getting L2Block %d from the database. err: %s", blockNumber, err.Error()) -
    -
    - 93 - -
    - + - return nil, nil, err -
    -
    - 94 - -
    - + - } -
    -
    - 95 - -
    - + - trustedL2Block, err := p.trustedClient.BlockByNumber(ctx, big.NewInt(int64(blockNumber))) -
    -
    - 96 - -
    - + - if err != nil { -
    -
    - 97 - -
    - + - log.Errorf("checkL2block: Error getting L2Block %d from the Trusted RPC. err:%s", blockNumber, err.Error()) -
    -
    - 98 - -
    - + - return nil, nil, err -
    -
    - 99 - -
    - + - } -
    -
    - 100 - -
    - + - return localL2Block, trustedL2Block, nil -
    -
    - 101 - -
    - + - } -
    -
    - 102 - -
    - + -
    -
    -
    - 103 - -
    - + - // CheckPostClosedBatch checks the last L2Block hash on close batch -
    -
    - 104 - -
    - + - func (p *CheckL2BlockHash) iterationCheckL2Block(ctx context.Context, l2BlockNumber uint64, dbTx pgx.Tx) error { -
    -
    - 105 - -
    - + - prefixLogs := fmt.Sprintf("checkL2block: L2BlockNumber: %d ", l2BlockNumber) -
    -
    - 106 - -
    - + - localL2Block, trustedL2Block, err := p.GetL2Blocks(ctx, l2BlockNumber, dbTx) -
    -
    - 107 - -
    - + - if errors.Is(err, state.ErrNotFound) || errors.Is(err, state.ErrStateNotSynchronized) { -
    -
    - 108 - -
    - + - log.Debugf("%s not found in the database", prefixLogs, l2BlockNumber) -
    -
    - 109 - -
    - + - return nil -
    -
    - 110 - -
    - + - } -
    -
    - 111 - -
    - + - if err != nil { -
    -
    - 112 - -
    - + - log.Errorf("%s Error getting from the database and trusted. err: %s", prefixLogs, err.Error()) -
    -
    - 113 - -
    - + - return err -
    -
    - 114 - -
    - + - } -
    -
    - 115 - -
    - + - if localL2Block == nil || trustedL2Block == nil { -
    -
    - 116 - -
    - + - log.Errorf("%s localL2Block or trustedL2Block is nil", prefixLogs, l2BlockNumber) -
    -
    - 117 - -
    - + - return nil -
    -
    - 118 - -
    - + - } -
    -
    - 119 - -
    - + -
    -
    -
    - 120 - -
    - + - if err := compareL2Blocks(prefixLogs, localL2Block, trustedL2Block); err != nil { -
    -
    - 121 - -
    - + - log.Errorf("%s Error comparing L2Blocks from the database and trusted. err: %s", prefixLogs, err.Error()) -
    -
    - 122 - -
    - + - return err -
    -
    - 123 - -
    - + - } -
    -
    - 124 - -
    - + -
    -
    -
    - 125 - -
    - + - log.Infof("%s checked L2Block in the database and the trusted batch are the same %s", prefixLogs, localL2Block.Hash().String()) -
    -
    - 126 - -
    - + - // Compare the two blocks -
    -
    - 127 - -
    - + - p.lastL2BlockChecked = l2BlockNumber -
    -
    - 128 - -
    - + - return nil -
    -
    - 129 - -
    - + - } -
    -
    - 130 - -
    - + -
    -
    -
    - 131 - -
    - + - func compareL2Blocks(prefixLogs string, localL2Block *state.L2Block, trustedL2Block *types.Block) error { -
    -
    - 132 - -
    - + - if localL2Block == nil || trustedL2Block == nil || trustedL2Block.Hash == nil { -
    -
    - 133 - -
    - + - return fmt.Errorf("%s localL2Block or trustedL2Block or trustedHash are nil", prefixLogs) -
    -
    - 134 - -
    - + - } -
    -
    - 135 - -
    - + - if localL2Block.Hash() != *trustedL2Block.Hash { -
    -
    - 136 - -
    - + - return fmt.Errorf("%s localL2Block.Hash %s and trustedL2Block.Hash %s are different", prefixLogs, localL2Block.Hash().String(), (*trustedL2Block.Hash).String()) -
    -
    - 137 - -
    - + - } -
    -
    - 138 - -
    - + - return nil -
    -
    - 139 - -
    - + - } -
    -
    -
    -
    -
    -
    -
    -
    - - {/home/stefan/go/src/Polygon/zkevm-node → .}/synchronizer/actions/check_l2block_processor_decorator.go - RENAMED - -
    -
    -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    @@ -0,0 +1,34 @@
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    -
    -
    -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
     
    -
    - 1 - -
    - + - package actions -
    -
    - 2 - -
    - + -
    -
    -
    - 3 - -
    - + - import ( -
    -
    - 4 - -
    - + - "context" -
    -
    - 5 - -
    - + -
    -
    -
    - 6 - -
    - + - "github.com/0xPolygonHermez/zkevm-node/etherman" -
    -
    - 7 - -
    - + - "github.com/jackc/pgx/v4" -
    -
    - 8 - -
    - + - ) -
    -
    - 9 - -
    - + -
    -
    -
    - 10 - -
    - + - // CheckL2BlockProcessorDecorator This class is just a decorator to call CheckL2Block -
    -
    - 11 - -
    - + - type CheckL2BlockProcessorDecorator struct { -
    -
    - 12 - -
    - + - L1EventProcessor -
    -
    - 13 - -
    - + - l2blockChecker *CheckL2BlockHash -
    -
    - 14 - -
    - + - } -
    -
    - 15 - -
    - + -
    -
    -
    - 16 - -
    - + - // NewCheckL2BlockDecorator creates a new CheckL2BlockDecorator -
    -
    - 17 - -
    - + - func NewCheckL2BlockDecorator(l1EventProcessor L1EventProcessor, l2blockChecker *CheckL2BlockHash) *CheckL2BlockProcessorDecorator { -
    -
    - 18 - -
    - + - return &CheckL2BlockProcessorDecorator{ -
    -
    - 19 - -
    - + - L1EventProcessor: l1EventProcessor, -
    -
    - 20 - -
    - + - l2blockChecker: l2blockChecker, -
    -
    - 21 - -
    - + - } -
    -
    - 22 - -
    - + - } -
    -
    - 23 - -
    - + -
    -
    -
    - 24 - -
    - + - // Process wraps the real Process and after check the L2Blocks -
    -
    - 25 - -
    - + - func (p *CheckL2BlockProcessorDecorator) Process(ctx context.Context, order etherman.Order, l1Block *etherman.Block, dbTx pgx.Tx) error { -
    -
    - 26 - -
    - + - res := p.L1EventProcessor.Process(ctx, order, l1Block, dbTx) -
    -
    - 27 - -
    - + - if res != nil { -
    -
    - 28 - -
    - + - return res -
    -
    - 29 - -
    - + - } -
    -
    - 30 - -
    - + - if p.l2blockChecker == nil { -
    -
    - 31 - -
    - + - return nil -
    -
    - 32 - -
    - + - } -
    -
    - 33 - -
    - + - return p.l2blockChecker.CheckL2Block(ctx, dbTx) -
    -
    - 34 - -
    - + - } -
    -
    -
    -
    -
    -
    -
    -
    - - {/home/stefan/go/src/Polygon/zkevm-node → .}/synchronizer/actions/check_l2block_test.go - RENAMED - -
    -
    -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    @@ -0,0 +1,131 @@
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    -
    -
    -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
     
    -
    - 1 - -
    - + - package actions_test -
    -
    - 2 - -
    - + -
    -
    -
    - 3 - -
    - + - import ( -
    -
    - 4 - -
    - + - "context" -
    -
    - 5 - -
    - + - "math/big" -
    -
    - 6 - -
    - + - "testing" -
    -
    - 7 - -
    - + -
    -
    -
    - 8 - -
    - + - rpctypes "github.com/0xPolygonHermez/zkevm-node/jsonrpc/types" -
    -
    - 9 - -
    - + - "github.com/0xPolygonHermez/zkevm-node/state" -
    -
    - 10 - -
    - + - "github.com/0xPolygonHermez/zkevm-node/synchronizer/actions" -
    -
    - 11 - -
    - + - mock_syncinterfaces "github.com/0xPolygonHermez/zkevm-node/synchronizer/common/syncinterfaces/mocks" -
    -
    - 12 - -
    - + - "github.com/ethereum/go-ethereum/common" -
    -
    - 13 - -
    - + - "github.com/ethereum/go-ethereum/core/types" -
    -
    - 14 - -
    - + - "github.com/stretchr/testify/assert" -
    -
    - 15 - -
    - + - "github.com/stretchr/testify/mock" -
    -
    - 16 - -
    - + - "github.com/stretchr/testify/require" -
    -
    - 17 - -
    - + - ) -
    -
    - 18 - -
    - + -
    -
    -
    - 19 - -
    - + - type CheckL2BlocksTestData struct { -
    -
    - 20 - -
    - + - sut *actions.CheckL2BlockHash -
    -
    - 21 - -
    - + - mockState *mock_syncinterfaces.StateFullInterface -
    -
    - 22 - -
    - + - zKEVMClient *mock_syncinterfaces.ZKEVMClientInterface -
    -
    - 23 - -
    - + - } -
    -
    - 24 - -
    - + -
    -
    -
    - 25 - -
    - + - func TestCheckL2BlockHash_GetMinimumL2BlockToCheck(t *testing.T) { -
    -
    - 26 - -
    - + - // Create an instance of CheckL2BlockHash -
    -
    - 27 - -
    - + - values := []struct { -
    -
    - 28 - -
    - + - initial uint64 -
    -
    - 29 - -
    - + - modulus uint64 -
    -
    - 30 - -
    - + - expected uint64 -
    -
    - 31 - -
    - + - }{ -
    -
    - 32 - -
    - + - {0, 10, 10}, -
    -
    - 33 - -
    - + - {1, 10, 10}, -
    -
    - 34 - -
    - + - {9, 10, 10}, -
    -
    - 35 - -
    - + - {10, 10, 20}, -
    -
    - 36 - -
    - + - {0, 0, 1}, -
    -
    - 37 - -
    - + - {1, 0, 2}, -
    -
    - 38 - -
    - + - } -
    -
    - 39 - -
    - + - for _, data := range values { -
    -
    - 40 - -
    - + - // Call the GetNextL2BlockToCheck method -
    -
    - 41 - -
    - + - checkL2Block := actions.NewCheckL2BlockHash(nil, nil, data.initial, data.modulus) -
    -
    - 42 - -
    - + - nextL2Block := checkL2Block.GetMinimumL2BlockToCheck() -
    -
    - 43 - -
    - + -
    -
    -
    - 44 - -
    - + - // Assert the expected result -
    -
    - 45 - -
    - + - assert.Equal(t, data.expected, nextL2Block) -
    -
    - 46 - -
    - + - } -
    -
    - 47 - -
    - + - } -
    -
    - 48 - -
    - + -
    -
    -
    - 49 - -
    - + - func TestCheckL2BlockHashNotEnoughBlocksToCheck(t *testing.T) { -
    -
    - 50 - -
    - + - data := newCheckL2BlocksTestData(t, 0, 10) -
    -
    - 51 - -
    - + - // Call the CheckL2Block method -
    -
    - 52 - -
    - + - data.mockState.EXPECT().GetLastL2BlockNumber(mock.Anything, mock.Anything).Return(uint64(0), nil) -
    -
    - 53 - -
    - + - err := data.sut.CheckL2Block(context.Background(), nil) -
    -
    - 54 - -
    - + - require.NoError(t, err) -
    -
    - 55 - -
    - + - } -
    -
    - 56 - -
    - + -
    -
    -
    - 57 - -
    - + - func newCheckL2BlocksTestData(t *testing.T, initialL2Block, modulus uint64) CheckL2BlocksTestData { -
    -
    - 58 - -
    - + - res := CheckL2BlocksTestData{ -
    -
    - 59 - -
    - + - mockState: mock_syncinterfaces.NewStateFullInterface(t), -
    -
    - 60 - -
    - + - zKEVMClient: mock_syncinterfaces.NewZKEVMClientInterface(t), -
    -
    - 61 - -
    - + - } -
    -
    - 62 - -
    - + - res.sut = actions.NewCheckL2BlockHash(res.mockState, res.zKEVMClient, initialL2Block, modulus) -
    -
    - 63 - -
    - + - return res -
    -
    - 64 - -
    - + - } -
    -
    - 65 - -
    - + - func TestCheckL2BlockHash_GetNextL2BlockToCheck(t *testing.T) { -
    -
    - 66 - -
    - + - values := []struct { -
    -
    - 67 - -
    - + - lastLocalL2BlockNumber uint64 -
    -
    - 68 - -
    - + - minL2BlockNumberToCheck uint64 -
    -
    - 69 - -
    - + - expectedShouldCheck bool -
    -
    - 70 - -
    - + - expectedNextL2BlockNumber uint64 -
    -
    - 71 - -
    - + - }{ -
    -
    - 72 - -
    - + - {0, 10, false, 0}, -
    -
    - 73 - -
    - + - {10, 10, true, 10}, -
    -
    - 74 - -
    - + - {9, 10, false, 0}, -
    -
    - 75 - -
    - + - {10, 10, true, 10}, -
    -
    - 76 - -
    - + - {0, 0, true, 0}, -
    -
    - 77 - -
    - + - {1, 0, true, 1}, -
    -
    - 78 - -
    - + - } -
    -
    - 79 - -
    - + -
    -
    -
    - 80 - -
    - + - for _, data := range values { -
    -
    - 81 - -
    - + - checkL2Block := actions.NewCheckL2BlockHash(nil, nil, 0, 0) -
    -
    - 82 - -
    - + - shouldCheck, nextL2Block := checkL2Block.GetNextL2BlockToCheck(data.lastLocalL2BlockNumber, data.minL2BlockNumberToCheck) -
    -
    - 83 - -
    - + -
    -
    -
    - 84 - -
    - + - assert.Equal(t, data.expectedShouldCheck, shouldCheck, data) -
    -
    - 85 - -
    - + - assert.Equal(t, data.expectedNextL2BlockNumber, nextL2Block, data) -
    -
    - 86 - -
    - + - } -
    -
    - 87 - -
    - + - } -
    -
    - 88 - -
    - + -
    -
    -
    - 89 - -
    - + - func TestCheckL2BlockHashMatch(t *testing.T) { -
    -
    - 90 - -
    - + - data := newCheckL2BlocksTestData(t, 1, 10) -
    -
    - 91 - -
    - + - lastL2Block := uint64(14) -
    -
    - 92 - -
    - + - lastL2BlockBigInt := big.NewInt(int64(lastL2Block)) -
    -
    - 93 - -
    - + - gethHeader := types.Header{ -
    -
    - 94 - -
    - + - Number: big.NewInt(int64(lastL2Block)), -
    -
    - 95 - -
    - + - } -
    -
    - 96 - -
    - + - stateBlock := state.NewL2Block(state.NewL2Header(&gethHeader), nil, nil, nil, nil) -
    -
    - 97 - -
    - + -
    -
    -
    - 98 - -
    - + - data.mockState.EXPECT().GetLastL2BlockNumber(mock.Anything, mock.Anything).Return(lastL2Block, nil) -
    -
    - 99 - -
    - + - data.mockState.EXPECT().GetL2BlockByNumber(mock.Anything, lastL2Block, mock.Anything).Return(stateBlock, nil) -
    -
    - 100 - -
    - + - l2blockHash := stateBlock.Hash() -
    -
    - 101 - -
    - + - rpcL2Block := rpctypes.Block{ -
    -
    - 102 - -
    - + - Hash: &l2blockHash, -
    -
    - 103 - -
    - + - Number: rpctypes.ArgUint64(lastL2Block), -
    -
    - 104 - -
    - + - } -
    -
    - 105 - -
    - + -
    -
    -
    - 106 - -
    - + - data.zKEVMClient.EXPECT().BlockByNumber(mock.Anything, lastL2BlockBigInt).Return(&rpcL2Block, nil) -
    -
    - 107 - -
    - + - err := data.sut.CheckL2Block(context.Background(), nil) -
    -
    - 108 - -
    - + - require.NoError(t, err) -
    -
    - 109 - -
    - + - } -
    -
    - 110 - -
    - + -
    -
    -
    - 111 - -
    - + - func TestCheckL2BlockHashMissmatch(t *testing.T) { -
    -
    - 112 - -
    - + - data := newCheckL2BlocksTestData(t, 1, 10) -
    -
    - 113 - -
    - + - lastL2Block := uint64(14) -
    -
    - 114 - -
    - + - lastL2BlockBigInt := big.NewInt(int64(lastL2Block)) -
    -
    - 115 - -
    - + - gethHeader := types.Header{ -
    -
    - 116 - -
    - + - Number: big.NewInt(int64(lastL2Block)), -
    -
    - 117 - -
    - + - } -
    -
    - 118 - -
    - + - stateBlock := state.NewL2Block(state.NewL2Header(&gethHeader), nil, nil, nil, nil) -
    -
    - 119 - -
    - + -
    -
    -
    - 120 - -
    - + - data.mockState.EXPECT().GetLastL2BlockNumber(mock.Anything, mock.Anything).Return(lastL2Block, nil) -
    -
    - 121 - -
    - + - data.mockState.EXPECT().GetL2BlockByNumber(mock.Anything, lastL2Block, mock.Anything).Return(stateBlock, nil) -
    -
    - 122 - -
    - + - l2blockHash := common.HexToHash("0x1234") -
    -
    - 123 - -
    - + - rpcL2Block := rpctypes.Block{ -
    -
    - 124 - -
    - + - Hash: &l2blockHash, -
    -
    - 125 - -
    - + - Number: rpctypes.ArgUint64(lastL2Block), -
    -
    - 126 - -
    - + - } -
    -
    - 127 - -
    - + -
    -
    -
    - 128 - -
    - + - data.zKEVMClient.EXPECT().BlockByNumber(mock.Anything, lastL2BlockBigInt).Return(&rpcL2Block, nil) -
    -
    - 129 - -
    - + - err := data.sut.CheckL2Block(context.Background(), nil) -
    -
    - 130 - -
    - + - require.Error(t, err) -
    -
    - 131 - -
    - + - } -
    -
    -
    -
    -
    -
    -
    -
    - - {/home/stefan/go/src/Polygon/zkevm-node → .}/synchronizer/actions/etrog/processor_l1_sequence_batches.go - RENAMED - -
    -
    -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    @@ -381,6 +381,11 @@
    -
    - 381 - -
    -   - log.Warnf(errMsg) -
    -
    - 382 - -
    -   - reorgReasons.WriteString(errMsg) -
    -
    - 383 - -
    -   - } -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - 384 - -
    -   -
    -
    -
    - 385 - -
    -   - if reorgReasons.Len() > 0 { -
    -
    - 386 - -
    -   - reason := reorgReasons.String() -
    -
    -
    -
    -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
     
    -
    - 381 - -
    -   - log.Warnf(errMsg) -
    -
    - 382 - -
    -   - reorgReasons.WriteString(errMsg) -
    -
    - 383 - -
    -   - } -
    -
    - 384 - -
    - + - if tBatch.WIP { -
    -
    - 385 - -
    - + - errMsg := batchNumStr + "Trusted batch is WIP\n" -
    -
    - 386 - -
    - + - log.Warnf(errMsg) -
    -
    - 387 - -
    - + - reorgReasons.WriteString(errMsg) -
    -
    - 388 - -
    - + - } -
    -
    - 389 - -
    -   -
    -
    -
    - 390 - -
    -   - if reorgReasons.Len() > 0 { -
    -
    - 391 - -
    -   - reason := reorgReasons.String() -
    -
    -
    -
    -
    -
    -
    -
    - - {/home/stefan/go/src/Polygon/zkevm-node → .}/synchronizer/actions/incaberry/processor_l1_forkid.go - RENAMED - -
    -
    -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    @@ -5,6 +5,7 @@
    -
    - 5 - -
    -   - "errors" -
    -
    - 6 - -
    -   - "fmt" -
    -
    - 7 - -
    -   - "math" -
    -
    - - -
    -   -
    -
    -
    - 8 - -
    -   -
    -
    -
    - 9 - -
    -   - "github.com/0xPolygonHermez/zkevm-node/etherman" -
    -
    - 10 - -
    -   - "github.com/0xPolygonHermez/zkevm-node/log" -
    -
    -
    @@ -18,6 +19,7 @@
    -
    - 18 - -
    -   - GetForkIDs(ctx context.Context, dbTx pgx.Tx) ([]state.ForkIDInterval, error) -
    -
    - 19 - -
    -   - AddForkIDInterval(ctx context.Context, newForkID state.ForkIDInterval, dbTx pgx.Tx) error -
    -
    - 20 - -
    -   - ResetForkID(ctx context.Context, batchNumber uint64, dbTx pgx.Tx) error -
    -
    - - -
    -   -
    -
    -
    - 21 - -
    -   - } -
    -
    - 22 - -
    -   -
    -
    -
    - 23 - -
    -   - type syncProcessorForkIdInterface interface { -
    -
    -
    @@ -44,9 +46,86 @@
    -
    - 44 - -
    -   -
    -
    -
    - 45 - -
    -   - // Process process event -
    -
    - 46 - -
    -   - func (p *ProcessorForkId) Process(ctx context.Context, order etherman.Order, l1Block *etherman.Block, dbTx pgx.Tx) error { -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - 47 - -
    -   - return p.processForkID(ctx, l1Block.ForkIDs[order.Pos], l1Block.BlockNumber, dbTx) -
    -
    - 48 - -
    -   - } -
    -
    - 49 - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - 50 - -
    -   - func (s *ProcessorForkId) processForkID(ctx context.Context, forkID etherman.ForkID, blockNumber uint64, dbTx pgx.Tx) error { -
    -
    - 51 - -
    -   - fID := state.ForkIDInterval{ -
    -
    - 52 - -
    -   - FromBatchNumber: forkID.BatchNumber + 1, -
    -
    -
    @@ -55,74 +134,81 @@
    -
    - 55 - -
    -   - Version: forkID.Version, -
    -
    - 56 - -
    -   - BlockNumber: blockNumber, -
    -
    - 57 - -
    -   - } -
    -
    - 58 - -
    - - -
    -
    -
    - 59 - -
    -   - // If forkID affects to a batch from the past. State must be reseted. -
    -
    - 60 - -
    - - - log.Debugf("ForkID: %d, synchronization must use the new forkID since batch: %d", forkID.ForkID, forkID.BatchNumber+1) -
    -
    - 61 - -
    -   - fIds, err := s.state.GetForkIDs(ctx, dbTx) -
    -
    - 62 - -
    -   - if err != nil { -
    -
    - 63 - -
    - - - log.Error("error getting ForkIDTrustedReorg. Error: ", err) -
    -
    - 64 - -
    - - - rollbackErr := dbTx.Rollback(ctx) -
    -
    - 65 - -
    - - - if rollbackErr != nil { -
    -
    - 66 - -
    - - - log.Errorf("error rolling back state get forkID trusted state. BlockNumber: %d, rollbackErr: %s, error : %v", blockNumber, rollbackErr.Error(), err) -
    -
    - 67 - -
    - - - return rollbackErr -
    -
    - 68 - -
    - - - } -
    -
    - 69 - -
    -   - return err -
    -
    - 70 - -
    -   - } -
    -
    - 71 - -
    - - - if len(fIds) != 0 && fIds[len(fIds)-1].ForkId == fID.ForkId { // If the forkID reset was already done -
    -
    - 72 - -
    - - - return nil -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - 73 - -
    -   - } -
    -
    - - -
    -   -
    -
    -
    - 74 - -
    -   - //If the forkID.batchnumber is a future batch -
    -
    - 75 - -
    -   - latestBatchNumber, err := s.state.GetLastBatchNumber(ctx, dbTx) -
    -
    - 76 - -
    -   - if err != nil && !errors.Is(err, state.ErrStateNotSynchronized) { -
    -
    - 77 - -
    - - - log.Error("error getting last batch number. Error: ", err) -
    -
    - 78 - -
    - - - rollbackErr := dbTx.Rollback(ctx) -
    -
    - 79 - -
    - - - if rollbackErr != nil { -
    -
    - 80 - -
    - - - log.Errorf("error rolling back state. BlockNumber: %d, rollbackErr: %s, error : %v", blockNumber, rollbackErr.Error(), err) -
    -
    - 81 - -
    - - - return rollbackErr -
    -
    - 82 - -
    - - - } -
    -
    - 83 - -
    -   - return err -
    -
    - 84 - -
    -   - } -
    -
    - 85 - -
    - - - // Add new forkID to the state -
    -
    - 86 - -
    -   - err = s.state.AddForkIDInterval(ctx, fID, dbTx) -
    -
    - 87 - -
    -   - if err != nil { -
    -
    - 88 - -
    - - - log.Error("error adding new forkID interval to the state. Error: ", err) -
    -
    - 89 - -
    - - - rollbackErr := dbTx.Rollback(ctx) -
    -
    - 90 - -
    - - - if rollbackErr != nil { -
    -
    - 91 - -
    - - - log.Errorf("error rolling back state to store block. BlockNumber: %d, rollbackErr: %s, error : %v", blockNumber, rollbackErr.Error(), err) -
    -
    - 92 - -
    - - - return rollbackErr -
    -
    - 93 - -
    - - - } -
    -
    - 94 - -
    -   - return err -
    -
    - 95 - -
    -   - } -
    -
    - 96 - -
    - - - if latestBatchNumber <= forkID.BatchNumber || s.sync.IsTrustedSequencer() { //If the forkID will start in a future batch or isTrustedSequencer -
    -
    - 97 - -
    - - - log.Infof("Just adding forkID. Skipping reset forkID. ForkID: %+v.", fID) -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - 98 - -
    -   - return nil -
    -
    - 99 - -
    -   - } -
    -
    - 100 - -
    -   -
    -
    -
    - 101 - -
    - - - log.Info("ForkID received in the permissionless node that affects to a batch from the past") -
    -
    - 102 - -
    -   - //Reset DB only if permissionless node -
    -
    - 103 - -
    - - - log.Debugf("ForkID: %d, Reverting synchronization to batch: %d", forkID.ForkID, forkID.BatchNumber+1) -
    -
    - 104 - -
    -   - err = s.state.ResetForkID(ctx, forkID.BatchNumber+1, dbTx) -
    -
    - 105 - -
    -   - if err != nil { -
    -
    - 106 - -
    - - - log.Error("error resetting the state. Error: ", err) -
    -
    - 107 - -
    - - - rollbackErr := dbTx.Rollback(ctx) -
    -
    - 108 - -
    - - - if rollbackErr != nil { -
    -
    - 109 - -
    - - - log.Errorf("error rolling back state to store block. BlockNumber: %d, rollbackErr: %s, error : %v", blockNumber, rollbackErr.Error(), err) -
    -
    - 110 - -
    - - - return rollbackErr -
    -
    - 111 - -
    - - - } -
    -
    - 112 - -
    -   - return err -
    -
    - 113 - -
    -   - } -
    -
    - 114 - -
    -   -
    -
    -
    - 115 - -
    -   - // Commit because it returns an error to force the resync -
    -
    - 116 - -
    - - - err = dbTx.Commit(ctx) -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - 117 - -
    -   - if err != nil { -
    -
    - 118 - -
    - - - log.Error("error committing the resetted state. Error: ", err) -
    -
    - 119 - -
    -   - rollbackErr := dbTx.Rollback(ctx) -
    -
    - 120 - -
    -   - if rollbackErr != nil { -
    -
    - 121 - -
    - - - log.Errorf("error rolling back state to store block. BlockNumber: %d, rollbackErr: %s, error : %v", blockNumber, rollbackErr.Error(), err) -
    -
    - 122 - -
    -   - return rollbackErr -
    -
    - 123 - -
    -   - } -
    -
    - 124 - -
    -   - return err -
    -
    - 125 - -
    -   - } -
    -
    - 126 - -
    - - -
    -
    -
    - 127 - -
    - - - return fmt.Errorf("new ForkID detected, reseting synchronizarion") -
    -
    - 128 - -
    -   - } -
    -
    -
    -
    -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
     
    -
    - 5 - -
    -   - "errors" -
    -
    - 6 - -
    -   - "fmt" -
    -
    - 7 - -
    -   - "math" -
    -
    - 8 - -
    - + - "sort" -
    -
    - 9 - -
    -   -
    -
    -
    - 10 - -
    -   - "github.com/0xPolygonHermez/zkevm-node/etherman" -
    -
    - 11 - -
    -   - "github.com/0xPolygonHermez/zkevm-node/log" -
    -
    -
     
    -
    - 19 - -
    -   - GetForkIDs(ctx context.Context, dbTx pgx.Tx) ([]state.ForkIDInterval, error) -
    -
    - 20 - -
    -   - AddForkIDInterval(ctx context.Context, newForkID state.ForkIDInterval, dbTx pgx.Tx) error -
    -
    - 21 - -
    -   - ResetForkID(ctx context.Context, batchNumber uint64, dbTx pgx.Tx) error -
    -
    - 22 - -
    - + - UpdateForkIDBlockNumber(ctx context.Context, forkdID uint64, newBlockNumber uint64, updateMemCache bool, dbTx pgx.Tx) error -
    -
    - 23 - -
    -   - } -
    -
    - 24 - -
    -   -
    -
    -
    - 25 - -
    -   - type syncProcessorForkIdInterface interface { -
    -
    -
     
    -
    - 46 - -
    -   -
    -
    -
    - 47 - -
    -   - // Process process event -
    -
    - 48 - -
    -   - func (p *ProcessorForkId) Process(ctx context.Context, order etherman.Order, l1Block *etherman.Block, dbTx pgx.Tx) error { -
    -
    - 49 - -
    - + - if l1Block == nil { -
    -
    - 50 - -
    - + - return errors.New("nil l1Block") -
    -
    - 51 - -
    - + - } -
    -
    - 52 - -
    - + - if len(l1Block.ForkIDs) <= order.Pos { -
    -
    - 53 - -
    - + - return fmt.Errorf("ForkIDsOrder index out of range. BlockNumber: %d, ForkIDsOrder index: %d", l1Block.BlockNumber, order.Pos) -
    -
    - 54 - -
    - + - } -
    -
    - 55 - -
    -   - return p.processForkID(ctx, l1Block.ForkIDs[order.Pos], l1Block.BlockNumber, dbTx) -
    -
    - 56 - -
    -   - } -
    -
    - 57 - -
    -   -
    -
    -
    - 58 - -
    - + - func getForkdFromSlice(fIds []state.ForkIDInterval, forkId uint64) (bool, state.ForkIDInterval) { -
    -
    - 59 - -
    - + - if len(fIds) == 0 { -
    -
    - 60 - -
    - + - return false, state.ForkIDInterval{} -
    -
    - 61 - -
    - + - } -
    -
    - 62 - -
    - + - for _, f := range fIds { -
    -
    - 63 - -
    - + - if f.ForkId == forkId { -
    -
    - 64 - -
    - + - return true, f -
    -
    - 65 - -
    - + - } -
    -
    - 66 - -
    - + - } -
    -
    - 67 - -
    - + - return false, state.ForkIDInterval{} -
    -
    - 68 - -
    - + - } -
    -
    - 69 - -
    - + -
    -
    -
    - 70 - -
    - + - func isForksSameFromBatchNumber(f1, f2 state.ForkIDInterval) bool { -
    -
    - 71 - -
    - + - return f1.ForkId == f2.ForkId && f1.FromBatchNumber == f2.FromBatchNumber -
    -
    - 72 - -
    - + - } -
    -
    - 73 - -
    - + -
    -
    -
    - 74 - -
    - + - func isIncommingForkIdGreatestThanLastOne(incommingForkID state.ForkIDInterval, fIds []state.ForkIDInterval) bool { -
    -
    - 75 - -
    - + - if len(fIds) == 0 { -
    -
    - 76 - -
    - + - return true -
    -
    - 77 - -
    - + - } -
    -
    - 78 - -
    - + - last := lastForkID(fIds) -
    -
    - 79 - -
    - + - // Must be greater than the last one -
    -
    - 80 - -
    - + - return incommingForkID.ForkId > last -
    -
    - 81 - -
    - + - } -
    -
    - 82 - -
    - + -
    -
    -
    - 83 - -
    - + - func lastForkID(fIds []state.ForkIDInterval) uint64 { -
    -
    - 84 - -
    - + - if len(fIds) == 0 { -
    -
    - 85 - -
    - + - return 0 -
    -
    - 86 - -
    - + - } -
    -
    - 87 - -
    - + - sort.Slice(fIds, func(i, j int) bool { -
    -
    - 88 - -
    - + - return fIds[i].ForkId > fIds[j].ForkId -
    -
    - 89 - -
    - + - }) -
    -
    - 90 - -
    - + - return fIds[0].ForkId -
    -
    - 91 - -
    - + - } -
    -
    - 92 - -
    - + -
    -
    -
    - 93 - -
    - + - // return true if have been update or false if it's a new one -
    -
    - 94 - -
    - + - func (s *ProcessorForkId) updateForkIDIfNeeded(ctx context.Context, forkIDincomming state.ForkIDInterval, forkIDsInState []state.ForkIDInterval, dbTx pgx.Tx) (bool, error) { -
    -
    - 95 - -
    - + - found, dbForkID := getForkdFromSlice(forkIDsInState, forkIDincomming.ForkId) -
    -
    - 96 - -
    - + - if !found { -
    -
    - 97 - -
    - + - // Is a new forkid -
    -
    - 98 - -
    - + - return false, nil -
    -
    - 99 - -
    - + - } -
    -
    - 100 - -
    - + - if isForksSameFromBatchNumber(forkIDincomming, dbForkID) { -
    -
    - 101 - -
    - + - if forkIDincomming.BlockNumber != dbForkID.BlockNumber { -
    -
    - 102 - -
    - + - isLastForkId := lastForkID(forkIDsInState) == forkIDincomming.ForkId -
    -
    - 103 - -
    - + - log.Infof("ForkID: %d, received again: same fork_id but different blockNumber old: %d, new: %d", forkIDincomming.ForkId, dbForkID.BlockNumber, forkIDincomming.BlockNumber) -
    -
    - 104 - -
    - + - if isLastForkId { -
    -
    - 105 - -
    - + - log.Warnf("ForkID: %d is the last one in the state. Updating BlockNumber from %d to %d", forkIDincomming.ForkId, dbForkID.BlockNumber, forkIDincomming.BlockNumber) -
    -
    - 106 - -
    - + - err := s.state.UpdateForkIDBlockNumber(ctx, forkIDincomming.ForkId, forkIDincomming.BlockNumber, true, dbTx) -
    -
    - 107 - -
    - + - if err != nil { -
    -
    - 108 - -
    - + - log.Errorf("error updating forkID: %d blocknumber. Error: %v", forkIDincomming.ForkId, err) -
    -
    - 109 - -
    - + - return true, err -
    -
    - 110 - -
    - + - } -
    -
    - 111 - -
    - + - return true, nil -
    -
    - 112 - -
    - + - } -
    -
    - 113 - -
    - + - err := fmt.Errorf("ForkID: %d, already in the state but with different blockNumber and is not last ForkID, so can't update BlockNumber. DB ForkID: %+v. New ForkID: %+v", forkIDincomming.ForkId, dbForkID, forkIDincomming) -
    -
    - 114 - -
    - + - log.Error(err.Error()) -
    -
    - 115 - -
    - + - return true, err -
    -
    - 116 - -
    - + - } -
    -
    - 117 - -
    - + - log.Infof("ForkID: %d, already in the state. Skipping . ForkID: %+v.", forkIDincomming.ForkId, forkIDincomming) -
    -
    - 118 - -
    - + - return true, nil -
    -
    - 119 - -
    - + - } -
    -
    - 120 - -
    - + - err := fmt.Errorf("ForkID: %d, already in the state but with different starting BatchNumber. DB ForkID: %+v. New ForkID: %+v", forkIDincomming.ForkId, dbForkID, forkIDincomming) -
    -
    - 121 - -
    - + - log.Error(err.Error()) -
    -
    - 122 - -
    - + - return true, err -
    -
    - 123 - -
    - + - } -
    -
    - 124 - -
    - + -
    -
    -
    - 125 - -
    - + - func isForkIdAffectingOnlyFuturesBatches(fID state.ForkIDInterval, latestBatchNumber uint64) bool { -
    -
    - 126 - -
    - + - return latestBatchNumber < fID.FromBatchNumber -
    -
    - 127 - -
    - + - } -
    -
    - 128 - -
    - + -
    -
    -
    - 129 - -
    -   - func (s *ProcessorForkId) processForkID(ctx context.Context, forkID etherman.ForkID, blockNumber uint64, dbTx pgx.Tx) error { -
    -
    - 130 - -
    -   - fID := state.ForkIDInterval{ -
    -
    - 131 - -
    -   - FromBatchNumber: forkID.BatchNumber + 1, -
    -
    -
     
    -
    - 134 - -
    -   - Version: forkID.Version, -
    -
    - 135 - -
    -   - BlockNumber: blockNumber, -
    -
    - 136 - -
    -   - } -
    -
    - 137 - -
    - + - debugPrefix := fmt.Sprintf("ForkID: %d, BlockNumber:%d, ", forkID.ForkID, blockNumber) -
    -
    - 138 - -
    -   - // If forkID affects to a batch from the past. State must be reseted. -
    -
    - 139 - -
    - + - log.Debugf("%s synchronization must use the new forkID since batch: %d", debugPrefix, forkID.BatchNumber+1) -
    -
    - 140 - -
    -   - fIds, err := s.state.GetForkIDs(ctx, dbTx) -
    -
    - 141 - -
    -   - if err != nil { -
    -
    - 142 - -
    - + - log.Errorf("error getting forkIDs. Error: %v", err) -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - 143 - -
    -   - return err -
    -
    - 144 - -
    -   - } -
    -
    - 145 - -
    - + - isUpdate, err := s.updateForkIDIfNeeded(ctx, fID, fIds, dbTx) -
    -
    - 146 - -
    - + - if err != nil { -
    -
    - 147 - -
    - + - log.Errorf("%s error updating forkID . Error: %v", debugPrefix, err) -
    -
    - 148 - -
    - + - return err -
    -
    - 149 - -
    - + - } -
    -
    - 150 - -
    - + - if isUpdate { -
    -
    - 151 - -
    - + - return nil // The calling function is doing the commit -
    -
    - 152 - -
    - + - } -
    -
    - 153 - -
    - + -
    -
    -
    - 154 - -
    - + - if !isIncommingForkIdGreatestThanLastOne(fID, fIds) { -
    -
    - 155 - -
    - + - err = fmt.Errorf("%s received don't fit sequence, last forkid:%d ", debugPrefix, lastForkID(fIds)) -
    -
    - 156 - -
    - + - log.Error(err.Error()) -
    -
    - 157 - -
    - + - return err -
    -
    - 158 - -
    -   - } -
    -
    - 159 - -
    - + -
    -
    -
    - 160 - -
    -   - //If the forkID.batchnumber is a future batch -
    -
    - 161 - -
    -   - latestBatchNumber, err := s.state.GetLastBatchNumber(ctx, dbTx) -
    -
    - 162 - -
    -   - if err != nil && !errors.Is(err, state.ErrStateNotSynchronized) { -
    -
    - 163 - -
    - + - log.Errorf("%s error getting last batch number. Error: %v", debugPrefix, err) -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - 164 - -
    -   - return err -
    -
    - 165 - -
    -   - } -
    -
    - 166 - -
    - + - // Add new forkID to the state. This function take care of chaning previous ForkID ToBatchNumber -
    -
    - 167 - -
    -   - err = s.state.AddForkIDInterval(ctx, fID, dbTx) -
    -
    - 168 - -
    -   - if err != nil { -
    -
    - 169 - -
    - + - log.Errorf("%s error adding new forkID interval to state. Error: %v", debugPrefix, err) -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - 170 - -
    -   - return err -
    -
    - 171 - -
    -   - } -
    -
    - 172 - -
    - + - if isForkIdAffectingOnlyFuturesBatches(fID, latestBatchNumber) { -
    -
    - 173 - -
    - + - log.Infof("%s Just adding forkID for future batches. Skipping reset forkID. ForkID: %+v.", debugPrefix, fID) -
    -
    - 174 - -
    - + - return nil -
    -
    - 175 - -
    - + - } -
    -
    - 176 - -
    - + -
    -
    -
    - 177 - -
    - + - if s.sync.IsTrustedSequencer() { //If the forkID will start in a future batch and IsTrustedSequencer -
    -
    - 178 - -
    - + - log.Warnf("%s received forkid that affects to a batch from the past %d, last Batch: %d. Is a trusted Node, so we accept it with no modifications", debugPrefix, fID.FromBatchNumber, latestBatchNumber) -
    -
    - 179 - -
    -   - return nil -
    -
    - 180 - -
    -   - } -
    -
    - 181 - -
    -   -
    -
    -
    - 182 - -
    - + - log.Warnf("%s received in the permissionless node that affects to a batch from the past %d, last Batch: %d. Reverting state", debugPrefix, fID.FromBatchNumber, latestBatchNumber) -
    -
    - 183 - -
    -   - //Reset DB only if permissionless node -
    -
    - 184 - -
    - + - log.Debugf("%s Reverting synchronization to batch: %d", debugPrefix, forkID.BatchNumber+1) -
    -
    - 185 - -
    -   - err = s.state.ResetForkID(ctx, forkID.BatchNumber+1, dbTx) -
    -
    - 186 - -
    -   - if err != nil { -
    -
    - 187 - -
    - + - log.Errorf("%s error resetting forkID. Error: %v", debugPrefix, err) -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - 188 - -
    -   - return err -
    -
    - 189 - -
    -   - } -
    -
    - 190 - -
    -   -
    -
    -
    - 191 - -
    -   - // Commit because it returns an error to force the resync -
    -
    - 192 - -
    - + - err = s.commit(ctx, debugPrefix, dbTx) -
    -
    - 193 - -
    - + - if err != nil { -
    -
    - 194 - -
    - + - log.Errorf("%s error committing forkId. Error: %v", debugPrefix, err) -
    -
    - 195 - -
    - + - return err -
    -
    - 196 - -
    - + - } -
    -
    - 197 - -
    - + - log.Infof("%s new ForkID detected, committed reverting state", debugPrefix) -
    -
    - 198 - -
    - + -
    -
    -
    - 199 - -
    - + - return fmt.Errorf("new ForkID detected, reseting synchronizarion") -
    -
    - 200 - -
    - + - } -
    -
    - 201 - -
    - + -
    -
    -
    - 202 - -
    - + - func (s *ProcessorForkId) commit(ctx context.Context, debugPrefix string, dbTx pgx.Tx) error { -
    -
    - 203 - -
    - + - err := dbTx.Commit(ctx) -
    -
    - 204 - -
    -   - if err != nil { -
    -
    - 205 - -
    - + - log.Errorf("%s error committing forkId. Error: %s", debugPrefix, err.Error()) -
    -
    - 206 - -
    -   - rollbackErr := dbTx.Rollback(ctx) -
    -
    - 207 - -
    -   - if rollbackErr != nil { -
    -
    - 208 - -
    - + - log.Errorf("%s error rolling back state to store block. rollbackErr: %s, error : %v", debugPrefix, rollbackErr.Error(), err) -
    -
    - 209 - -
    -   - return rollbackErr -
    -
    - 210 - -
    -   - } -
    -
    - 211 - -
    -   - return err -
    -
    - 212 - -
    -   - } -
    -
    - 213 - -
    - + - return nil -
    -
    - - -
    -   -
    -
    -
    - 214 - -
    -   - } -
    -
    -
    -
    -
    -
    -
    -
    - - {/home/stefan/go/src/Polygon/zkevm-node → .}/synchronizer/actions/incaberry/processor_l1_forkid_test.go - RENAMED - -
    -
    -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    @@ -0,0 +1,147 @@
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    -
    -
    -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
     
    -
    - 1 - -
    - + - package incaberry_test -
    -
    - 2 - -
    - + -
    -
    -
    - 3 - -
    - + - import ( -
    -
    - 4 - -
    - + - "context" -
    -
    - 5 - -
    - + - "testing" -
    -
    - 6 - -
    - + -
    -
    -
    - 7 - -
    - + - "github.com/0xPolygonHermez/zkevm-node/etherman" -
    -
    - 8 - -
    - + - "github.com/0xPolygonHermez/zkevm-node/state" -
    -
    - 9 - -
    - + - "github.com/0xPolygonHermez/zkevm-node/synchronizer/actions/incaberry" -
    -
    - 10 - -
    - + - mock_syncinterfaces "github.com/0xPolygonHermez/zkevm-node/synchronizer/common/syncinterfaces/mocks" -
    -
    - 11 - -
    - + - syncMocks "github.com/0xPolygonHermez/zkevm-node/synchronizer/mocks" -
    -
    - 12 - -
    - + - "github.com/stretchr/testify/mock" -
    -
    - 13 - -
    - + - "github.com/stretchr/testify/require" -
    -
    - 14 - -
    - + - ) -
    -
    - 15 - -
    - + -
    -
    -
    - 16 - -
    - + - type mockForkdIdTest struct { -
    -
    - 17 - -
    - + - mockState *mock_syncinterfaces.StateFullInterface -
    -
    - 18 - -
    - + - mockSync *mock_syncinterfaces.SynchronizerIsTrustedSequencer -
    -
    - 19 - -
    - + - mockDbTx *syncMocks.DbTxMock -
    -
    - 20 - -
    - + - } -
    -
    - 21 - -
    - + -
    -
    -
    - 22 - -
    - + - func newMockForkdIdTest(t *testing.T) *mockForkdIdTest { -
    -
    - 23 - -
    - + - mockState := mock_syncinterfaces.NewStateFullInterface(t) -
    -
    - 24 - -
    - + - mockSync := mock_syncinterfaces.NewSynchronizerIsTrustedSequencer(t) -
    -
    - 25 - -
    - + - mockDbTx := syncMocks.NewDbTxMock(t) -
    -
    - 26 - -
    - + - return &mockForkdIdTest{mockState, mockSync, mockDbTx} -
    -
    - 27 - -
    - + - } -
    -
    - 28 - -
    - + -
    -
    -
    - 29 - -
    - + - func newL1Block(blockNumber uint64, forkId uint64, fromBatchNumber uint64, version string) *etherman.Block { -
    -
    - 30 - -
    - + - return &etherman.Block{ -
    -
    - 31 - -
    - + - SequencedBatches: [][]etherman.SequencedBatch{}, -
    -
    - 32 - -
    - + - BlockNumber: blockNumber, -
    -
    - 33 - -
    - + - ForkIDs: []etherman.ForkID{{ForkID: forkId, BatchNumber: fromBatchNumber, Version: version}}, -
    -
    - 34 - -
    - + - } -
    -
    - 35 - -
    - + - } -
    -
    - 36 - -
    - + -
    -
    -
    - 37 - -
    - + - func TestReceiveExistingForkIdAnotherFromBatchNumber(t *testing.T) { -
    -
    - 38 - -
    - + - mocks := newMockForkdIdTest(t) -
    -
    - 39 - -
    - + - sut := incaberry.NewProcessorForkId(mocks.mockState, mocks.mockSync) -
    -
    - 40 - -
    - + - forkIdsOnState := []state.ForkIDInterval{ -
    -
    - 41 - -
    - + - {FromBatchNumber: 1, ToBatchNumber: 100, ForkId: 6, Version: "1.0.0", BlockNumber: 123}, -
    -
    - 42 - -
    - + - {FromBatchNumber: 101, ToBatchNumber: 200, ForkId: 7, Version: "1.0.0", BlockNumber: 123}, -
    -
    - 43 - -
    - + - } -
    -
    - 44 - -
    - + - mocks.mockState.EXPECT().GetForkIDs(mock.Anything, mock.Anything).Return(forkIdsOnState, nil) -
    -
    - 45 - -
    - + - err := sut.Process(context.Background(), etherman.Order{Pos: 0}, newL1Block(123, 6, 500, "1.0.0"), mocks.mockDbTx) -
    -
    - 46 - -
    - + - require.Error(t, err) -
    -
    - 47 - -
    - + - } -
    -
    - 48 - -
    - + -
    -
    -
    - 49 - -
    - + - func TestReceiveExistsForkIdSameBatchNumberSameBlockNumber(t *testing.T) { -
    -
    - 50 - -
    - + - mocks := newMockForkdIdTest(t) -
    -
    - 51 - -
    - + - sut := incaberry.NewProcessorForkId(mocks.mockState, mocks.mockSync) -
    -
    - 52 - -
    - + - forkIdsOnState := []state.ForkIDInterval{ -
    -
    - 53 - -
    - + - {FromBatchNumber: 1, ToBatchNumber: 100, ForkId: 6, Version: "1.0.0", BlockNumber: 123}, -
    -
    - 54 - -
    - + - {FromBatchNumber: 101, ToBatchNumber: 200, ForkId: 7, Version: "1.0.0", BlockNumber: 123}, -
    -
    - 55 - -
    - + - } -
    -
    - 56 - -
    - + - mocks.mockState.EXPECT().GetForkIDs(mock.Anything, mock.Anything).Return(forkIdsOnState, nil) -
    -
    - 57 - -
    - + -
    -
    -
    - 58 - -
    - + - err := sut.Process(context.Background(), etherman.Order{Pos: 0}, newL1Block(123, 6, 0, "1.0.0"), mocks.mockDbTx) -
    -
    - 59 - -
    - + - require.NoError(t, err) -
    -
    - 60 - -
    - + - } -
    -
    - 61 - -
    - + -
    -
    -
    - 62 - -
    - + - func TestReceiveExistsForkIdSameBatchNumberAnotherBlockNumberAndNotLastForkId(t *testing.T) { -
    -
    - 63 - -
    - + - mocks := newMockForkdIdTest(t) -
    -
    - 64 - -
    - + - sut := incaberry.NewProcessorForkId(mocks.mockState, mocks.mockSync) -
    -
    - 65 - -
    - + - forkIdsOnState := []state.ForkIDInterval{ -
    -
    - 66 - -
    - + - {FromBatchNumber: 1, ToBatchNumber: 100, ForkId: 6, Version: "1.0.0", BlockNumber: 123}, -
    -
    - 67 - -
    - + - {FromBatchNumber: 101, ToBatchNumber: 200, ForkId: 7, Version: "1.0.0", BlockNumber: 123}, -
    -
    - 68 - -
    - + - } -
    -
    - 69 - -
    - + - mocks.mockState.EXPECT().GetForkIDs(mock.Anything, mock.Anything).Return(forkIdsOnState, nil) -
    -
    - 70 - -
    - + - //mocks.mockDbTx.EXPECT().Rollback(mock.Anything).Return(nil) -
    -
    - 71 - -
    - + - err := sut.Process(context.Background(), etherman.Order{Pos: 0}, newL1Block(456, 6, 0, "1.0.0"), mocks.mockDbTx) -
    -
    - 72 - -
    - + - require.Error(t, err) -
    -
    - 73 - -
    - + - } -
    -
    - 74 - -
    - + -
    -
    -
    - 75 - -
    - + - func TestReceiveAForkIdWithIdPreviousToCurrentOnState(t *testing.T) { -
    -
    - 76 - -
    - + - mocks := newMockForkdIdTest(t) -
    -
    - 77 - -
    - + - sut := incaberry.NewProcessorForkId(mocks.mockState, mocks.mockSync) -
    -
    - 78 - -
    - + - forkIdsOnState := []state.ForkIDInterval{ -
    -
    - 79 - -
    - + - {FromBatchNumber: 100, ToBatchNumber: 200, ForkId: 6, Version: "1.0.0", BlockNumber: 123}, -
    -
    - 80 - -
    - + - {FromBatchNumber: 201, ToBatchNumber: 300, ForkId: 7, Version: "1.0.0", BlockNumber: 123}, -
    -
    - 81 - -
    - + - } -
    -
    - 82 - -
    - + - mocks.mockState.EXPECT().GetForkIDs(mock.Anything, mock.Anything).Return(forkIdsOnState, nil) -
    -
    - 83 - -
    - + - err := sut.Process(context.Background(), etherman.Order{Pos: 0}, newL1Block(456, 5, 0, "1.0.0"), mocks.mockDbTx) -
    -
    - 84 - -
    - + - require.Error(t, err) -
    -
    - 85 - -
    - + - } -
    -
    - 86 - -
    - + -
    -
    -
    - 87 - -
    - + - func TestReceiveExistsForkIdSameBatchNumberAnotherBlockNumberAndLastForkId(t *testing.T) { -
    -
    - 88 - -
    - + - mocks := newMockForkdIdTest(t) -
    -
    - 89 - -
    - + - sut := incaberry.NewProcessorForkId(mocks.mockState, mocks.mockSync) -
    -
    - 90 - -
    - + - forkIdsOnState := []state.ForkIDInterval{ -
    -
    - 91 - -
    - + - {FromBatchNumber: 1, ToBatchNumber: 100, ForkId: 6, Version: "1.0.0", BlockNumber: 123}, -
    -
    - 92 - -
    - + - {FromBatchNumber: 101, ToBatchNumber: 200, ForkId: 7, Version: "1.0.0", BlockNumber: 123}, -
    -
    - 93 - -
    - + - } -
    -
    - 94 - -
    - + - mocks.mockState.EXPECT().GetForkIDs(mock.Anything, mock.Anything).Return(forkIdsOnState, nil) -
    -
    - 95 - -
    - + - mocks.mockState.EXPECT().UpdateForkIDBlockNumber(mock.Anything, uint64(7), uint64(456), true, mock.Anything).Return(nil) -
    -
    - 96 - -
    - + - //mocks.mockDbTx.EXPECT().Commit(mock.Anything).Return(nil) -
    -
    - 97 - -
    - + - err := sut.Process(context.Background(), etherman.Order{Pos: 0}, newL1Block(456, 7, 100, "1.0.0"), mocks.mockDbTx) -
    -
    - 98 - -
    - + - require.NoError(t, err) -
    -
    - 99 - -
    - + - } -
    -
    - 100 - -
    - + -
    -
    -
    - 101 - -
    - + - func TestReceiveNewForkIdAffectFutureBatch(t *testing.T) { -
    -
    - 102 - -
    - + - mocks := newMockForkdIdTest(t) -
    -
    - 103 - -
    - + - sut := incaberry.NewProcessorForkId(mocks.mockState, mocks.mockSync) -
    -
    - 104 - -
    - + - forkIdsOnState := []state.ForkIDInterval{ -
    -
    - 105 - -
    - + - {FromBatchNumber: 1, ToBatchNumber: 100, ForkId: 6, Version: "1.0.0", BlockNumber: 123}, -
    -
    - 106 - -
    - + - {FromBatchNumber: 101, ToBatchNumber: 200, ForkId: 7, Version: "1.0.0", BlockNumber: 123}, -
    -
    - 107 - -
    - + - } -
    -
    - 108 - -
    - + - mocks.mockState.EXPECT().GetForkIDs(mock.Anything, mock.Anything).Return(forkIdsOnState, nil) -
    -
    - 109 - -
    - + - mocks.mockState.EXPECT().GetLastBatchNumber(mock.Anything, mock.Anything).Return(uint64(101), nil) -
    -
    - 110 - -
    - + - mocks.mockState.EXPECT().AddForkIDInterval(mock.Anything, state.ForkIDInterval{FromBatchNumber: 102, ToBatchNumber: ^uint64(0), ForkId: 8, Version: "2.0.0", BlockNumber: 456}, mock.Anything).Return(nil) -
    -
    - 111 - -
    - + - //mocks.mockDbTx.EXPECT().Commit(mock.Anything).Return(nil) -
    -
    - 112 - -
    - + - err := sut.Process(context.Background(), etherman.Order{Pos: 0}, newL1Block(456, 8, 101, "2.0.0"), mocks.mockDbTx) -
    -
    - 113 - -
    - + - require.NoError(t, err) -
    -
    - 114 - -
    - + - } -
    -
    - 115 - -
    - + -
    -
    -
    - 116 - -
    - + - func TestReceiveNewForkIdAffectPastBatchTrustedNode(t *testing.T) { -
    -
    - 117 - -
    - + - mocks := newMockForkdIdTest(t) -
    -
    - 118 - -
    - + - sut := incaberry.NewProcessorForkId(mocks.mockState, mocks.mockSync) -
    -
    - 119 - -
    - + - forkIdsOnState := []state.ForkIDInterval{ -
    -
    - 120 - -
    - + - {FromBatchNumber: 1, ToBatchNumber: 100, ForkId: 6, Version: "1.0.0", BlockNumber: 123}, -
    -
    - 121 - -
    - + - {FromBatchNumber: 101, ToBatchNumber: 200, ForkId: 7, Version: "1.0.0", BlockNumber: 123}, -
    -
    - 122 - -
    - + - } -
    -
    - 123 - -
    - + - mocks.mockState.EXPECT().GetForkIDs(mock.Anything, mock.Anything).Return(forkIdsOnState, nil) -
    -
    - 124 - -
    - + - mocks.mockState.EXPECT().GetLastBatchNumber(mock.Anything, mock.Anything).Return(uint64(101), nil) -
    -
    - 125 - -
    - + - mocks.mockState.EXPECT().AddForkIDInterval(mock.Anything, state.ForkIDInterval{FromBatchNumber: 101, ToBatchNumber: ^uint64(0), ForkId: 8, Version: "2.0.0", BlockNumber: 456}, mock.Anything).Return(nil) -
    -
    - 126 - -
    - + - mocks.mockSync.EXPECT().IsTrustedSequencer().Return(true) -
    -
    - 127 - -
    - + - err := sut.Process(context.Background(), etherman.Order{Pos: 0}, newL1Block(456, 8, 100, "2.0.0"), mocks.mockDbTx) -
    -
    - 128 - -
    - + - require.NoError(t, err) -
    -
    - 129 - -
    - + - } -
    -
    - 130 - -
    - + -
    -
    -
    - 131 - -
    - + - func TestReceiveNewForkIdAffectPastBatchPermissionlessNode(t *testing.T) { -
    -
    - 132 - -
    - + - mocks := newMockForkdIdTest(t) -
    -
    - 133 - -
    - + - sut := incaberry.NewProcessorForkId(mocks.mockState, mocks.mockSync) -
    -
    - 134 - -
    - + - forkIdsOnState := []state.ForkIDInterval{ -
    -
    - 135 - -
    - + - {FromBatchNumber: 1, ToBatchNumber: 100, ForkId: 6, Version: "1.0.0", BlockNumber: 123}, -
    -
    - 136 - -
    - + - {FromBatchNumber: 101, ToBatchNumber: 200, ForkId: 7, Version: "1.0.0", BlockNumber: 123}, -
    -
    - 137 - -
    - + - } -
    -
    - 138 - -
    - + - mocks.mockState.EXPECT().GetForkIDs(mock.Anything, mock.Anything).Return(forkIdsOnState, nil) -
    -
    - 139 - -
    - + - mocks.mockState.EXPECT().GetLastBatchNumber(mock.Anything, mock.Anything).Return(uint64(101), nil) -
    -
    - 140 - -
    - + - mocks.mockState.EXPECT().AddForkIDInterval(mock.Anything, state.ForkIDInterval{FromBatchNumber: 101, ToBatchNumber: ^uint64(0), ForkId: 8, Version: "2.0.0", BlockNumber: 456}, mock.Anything).Return(nil) -
    -
    - 141 - -
    - + - mocks.mockSync.EXPECT().IsTrustedSequencer().Return(false) -
    -
    - 142 - -
    - + - mocks.mockState.EXPECT().ResetForkID(mock.Anything, uint64(101), mock.Anything).Return(nil) -
    -
    - 143 - -
    - + - mocks.mockDbTx.EXPECT().Commit(mock.Anything).Return(nil) -
    -
    - 144 - -
    - + - err := sut.Process(context.Background(), etherman.Order{Pos: 0}, newL1Block(456, 8, 100, "2.0.0"), mocks.mockDbTx) -
    -
    - 145 - -
    - + - require.Error(t, err) -
    -
    - 146 - -
    - + - require.Equal(t, "new ForkID detected, reseting synchronizarion", err.Error()) -
    -
    - 147 - -
    - + - } -
    -
    -
    -
    -
    -
    -
    -
    - - {/home/stefan/go/src/Polygon/zkevm-node → .}/synchronizer/common/syncinterfaces/state.go - RENAMED - -
    -
    -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    @@ -70,4 +70,7 @@
    -
    - 70 - -
    -   - GetExitRootByGlobalExitRoot(ctx context.Context, ger common.Hash, dbTx pgx.Tx) (*state.GlobalExitRoot, error) -
    -
    - 71 - -
    -   - GetForkIDInMemory(forkId uint64) *state.ForkIDInterval -
    -
    - 72 - -
    -   - GetLastL2BlockByBatchNumber(ctx context.Context, batchNumber uint64, dbTx pgx.Tx) (*state.L2Block, error) -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - 73 - -
    -   - } -
    -
    -
    -
    -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
     
    -
    - 70 - -
    -   - GetExitRootByGlobalExitRoot(ctx context.Context, ger common.Hash, dbTx pgx.Tx) (*state.GlobalExitRoot, error) -
    -
    - 71 - -
    -   - GetForkIDInMemory(forkId uint64) *state.ForkIDInterval -
    -
    - 72 - -
    -   - GetLastL2BlockByBatchNumber(ctx context.Context, batchNumber uint64, dbTx pgx.Tx) (*state.L2Block, error) -
    -
    - 73 - -
    - + - UpdateForkIDBlockNumber(ctx context.Context, forkdID uint64, newBlockNumber uint64, updateMemCache bool, dbTx pgx.Tx) error -
    -
    - 74 - -
    - + - GetLastL2BlockNumber(ctx context.Context, dbTx pgx.Tx) (uint64, error) -
    -
    - 75 - -
    - + - GetL2BlockByNumber(ctx context.Context, blockNumber uint64, dbTx pgx.Tx) (*state.L2Block, error) -
    -
    - 76 - -
    -   - } -
    -
    -
    -
    -
    -
    -
    -
    - - {/home/stefan/go/src/Polygon/zkevm-node → .}/synchronizer/common/syncinterfaces/zkevm_rpc.go - RENAMED - -
    -
    -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    @@ -19,7 +19,12 @@
    -
    - 19 - -
    -   - ExitRootsByGER(ctx context.Context, globalExitRoot common.Hash) (*types.ExitRoots, error) -
    -
    - 20 - -
    -   - } -
    -
    - 21 - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - 22 - -
    -   - type ZKEVMClientInterface interface { -
    -
    - 23 - -
    -   - ZKEVMClientTrustedBatchesGetter -
    -
    - 24 - -
    -   - ZKEVMClientGlobalExitRootGetter -
    -
    - - -
    -   -
    -
    -
    - 25 - -
    -   - } -
    -
    -
    -
    -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
     
    -
    - 19 - -
    -   - ExitRootsByGER(ctx context.Context, globalExitRoot common.Hash) (*types.ExitRoots, error) -
    -
    - 20 - -
    -   - } -
    -
    - 21 - -
    -   -
    -
    -
    - 22 - -
    - + - type ZKEVMClientGetL2BlockByNumber interface { -
    -
    - 23 - -
    - + - BlockByNumber(ctx context.Context, number *big.Int) (*types.Block, error) -
    -
    - 24 - -
    - + - } -
    -
    - 25 - -
    - + -
    -
    -
    - 26 - -
    -   - type ZKEVMClientInterface interface { -
    -
    - 27 - -
    -   - ZKEVMClientTrustedBatchesGetter -
    -
    - 28 - -
    -   - ZKEVMClientGlobalExitRootGetter -
    -
    - 29 - -
    - + - ZKEVMClientGetL2BlockByNumber -
    -
    - 30 - -
    -   - } -
    -
    -
    -
    -
    -
    -
    -
    - - {/home/stefan/go/src/Polygon/zkevm-node → .}/synchronizer/config.go - RENAMED - -
    -
    -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    @@ -14,6 +14,12 @@
    -
    - 14 - -
    -   - // TrustedSequencerURL is the rpc url to connect and sync the trusted state -
    -
    - 15 - -
    -   - TrustedSequencerURL string `mapstructure:"TrustedSequencerURL"` -
    -
    - 16 - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - 17 - -
    -   - // L1SynchronizationMode define how to synchronize with L1: -
    -
    - 18 - -
    -   - // - parallel: Request data to L1 in parallel, and process sequentially. The advantage is that executor is not blocked waiting for L1 data -
    -
    - 19 - -
    -   - // - sequential: Request data to L1 and execute -
    -
    -
    -
    -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
     
    -
    - 14 - -
    -   - // TrustedSequencerURL is the rpc url to connect and sync the trusted state -
    -
    - 15 - -
    -   - TrustedSequencerURL string `mapstructure:"TrustedSequencerURL"` -
    -
    - 16 - -
    -   -
    -
    -
    - 17 - -
    - + - // L1SyncCheckL2BlockHash if is true when a batch is closed is force to check L2Block hash against trustedNode (only apply for permissionless) -
    -
    - 18 - -
    - + - L1SyncCheckL2BlockHash bool `mapstructure:"L1SyncCheckL2BlockHash"` -
    -
    - 19 - -
    - + - // L1SyncCheckL2BlockNumberhModulus is the modulus used to choose the l2block to check -
    -
    - 20 - -
    - + - // a modules 5, for instance, means check all l2block multiples of 5 (10,15,20,...) -
    -
    - 21 - -
    - + - L1SyncCheckL2BlockNumberhModulus uint64 `mapstructure:"L1SyncCheckL2BlockNumberhModulus"` -
    -
    - 22 - -
    - + -
    -
    -
    - 23 - -
    -   - // L1SynchronizationMode define how to synchronize with L1: -
    -
    - 24 - -
    -   - // - parallel: Request data to L1 in parallel, and process sequentially. The advantage is that executor is not blocked waiting for L1 data -
    -
    - 25 - -
    -   - // - sequential: Request data to L1 and execute -
    -
    -
    -
    -
    -
    -
    -
    - - {/home/stefan/go/src/Polygon/zkevm-node → .}/synchronizer/default_l1processors.go - RENAMED - -
    -
    -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    @@ -8,19 +9,19 @@
    -
    - 8 - -
    -   - "github.com/0xPolygonHermez/zkevm-node/synchronizer/common" -
    -
    - 9 - -
    -   - ) -
    -
    - 10 - -
    -   -
    -
    -
    - 11 - -
    - - - func defaultsL1EventProcessors(sync *ClientSynchronizer) *processor_manager.L1EventProcessors { -
    -
    - 12 - -
    -   - p := processor_manager.NewL1EventProcessorsBuilder() -
    -
    - 13 - -
    -   - p.Register(incaberry.NewProcessorL1GlobalExitRoot(sync.state)) -
    -
    - 14 - -
    - - - p.Register(incaberry.NewProcessorL1SequenceBatches(sync.state, sync.etherMan, sync.pool, sync.eventLog, sync)) -
    -
    - 15 - -
    - - - p.Register(incaberry.NewProcessL1ForcedBatches(sync.state)) -
    -
    - 16 - -
    - - - p.Register(incaberry.NewProcessL1SequenceForcedBatches(sync.state, sync)) -
    -
    - 17 - -
    -   - p.Register(incaberry.NewProcessorForkId(sync.state, sync)) -
    -
    - 18 - -
    -   - p.Register(etrog.NewProcessorL1InfoTreeUpdate(sync.state)) -
    -
    - 19 - -
    -   - sequenceBatchesProcessor := etrog.NewProcessorL1SequenceBatches(sync.state, sync, common.DefaultTimeProvider{}, sync.halter) -
    -
    - 20 - -
    - - - p.Register(sequenceBatchesProcessor) -
    -
    - 21 - -
    -   - p.Register(incaberry.NewProcessorL1VerifyBatch(sync.state)) -
    -
    - 22 - -
    -   - p.Register(etrog.NewProcessorL1UpdateEtrogSequence(sync.state, sync, common.DefaultTimeProvider{})) -
    -
    - 23 - -
    - - - p.Register(elderberry.NewProcessorL1SequenceBatchesElderberry(sequenceBatchesProcessor, sync.state)) -
    -
    - 24 - -
    -   - // intialSequence is process in ETROG by the same class, this is just a wrapper to pass directly to ETROG -
    -
    - 25 - -
    -   - p.Register(elderberry.NewProcessorL1InitialSequenceBatchesElderberry(sequenceBatchesProcessor)) -
    -
    - 26 - -
    -   - return p.Build() -
    -
    -
    -
    -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
     
    -
    - 9 - -
    -   - "github.com/0xPolygonHermez/zkevm-node/synchronizer/common" -
    -
    - 10 - -
    -   - ) -
    -
    - 11 - -
    -   -
    -
    -
    - 12 - -
    - + - func defaultsL1EventProcessors(sync *ClientSynchronizer, l2Blockchecker *actions.CheckL2BlockHash) *processor_manager.L1EventProcessors { -
    -
    - 13 - -
    -   - p := processor_manager.NewL1EventProcessorsBuilder() -
    -
    - 14 - -
    -   - p.Register(incaberry.NewProcessorL1GlobalExitRoot(sync.state)) -
    -
    - 15 - -
    - + - p.Register(actions.NewCheckL2BlockDecorator(incaberry.NewProcessorL1SequenceBatches(sync.state, sync.etherMan, sync.pool, sync.eventLog, sync), l2Blockchecker)) -
    -
    - 16 - -
    - + - p.Register(actions.NewCheckL2BlockDecorator(incaberry.NewProcessL1ForcedBatches(sync.state), l2Blockchecker)) -
    -
    - 17 - -
    - + - p.Register(actions.NewCheckL2BlockDecorator(incaberry.NewProcessL1SequenceForcedBatches(sync.state, sync), l2Blockchecker)) -
    -
    - 18 - -
    -   - p.Register(incaberry.NewProcessorForkId(sync.state, sync)) -
    -
    - 19 - -
    -   - p.Register(etrog.NewProcessorL1InfoTreeUpdate(sync.state)) -
    -
    - 20 - -
    -   - sequenceBatchesProcessor := etrog.NewProcessorL1SequenceBatches(sync.state, sync, common.DefaultTimeProvider{}, sync.halter) -
    -
    - 21 - -
    - + - p.Register(actions.NewCheckL2BlockDecorator(sequenceBatchesProcessor, l2Blockchecker)) -
    -
    - 22 - -
    -   - p.Register(incaberry.NewProcessorL1VerifyBatch(sync.state)) -
    -
    - 23 - -
    -   - p.Register(etrog.NewProcessorL1UpdateEtrogSequence(sync.state, sync, common.DefaultTimeProvider{})) -
    -
    - 24 - -
    - + - p.Register(actions.NewCheckL2BlockDecorator(elderberry.NewProcessorL1SequenceBatchesElderberry(sequenceBatchesProcessor, sync.state), l2Blockchecker)) -
    -
    - 25 - -
    -   - // intialSequence is process in ETROG by the same class, this is just a wrapper to pass directly to ETROG -
    -
    - 26 - -
    -   - p.Register(elderberry.NewProcessorL1InitialSequenceBatchesElderberry(sequenceBatchesProcessor)) -
    -
    - 27 - -
    -   - return p.Build() -
    -
    -
    -
    -
    -
    -
    -
    - - {/home/stefan/go/src/Polygon/zkevm-node → .}/synchronizer/l1_parallel_sync/l1_worker_etherman_test.go - RENAMED - -
    -
    -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    @@ -31,7 +31,7 @@
    -
    - 31 - -
    -   - GlobalExitRootManagerAddr: common.HexToAddress("0x8A791620dd6260079BF849Dc5567aDC3F2FdC318"), -
    -
    - 32 - -
    -   - } -
    -
    - 33 - -
    -   -
    -
    -
    - 34 - -
    - - - ethermanClient, err := etherman.NewClient(cfg, l1Config) -
    -
    - 35 - -
    -   - require.NoError(t, err) -
    -
    - 36 - -
    -   - worker := newWorker(ethermanClient) -
    -
    - 37 - -
    -   - ch := make(chan responseRollupInfoByBlockRange) -
    -
    -
    -
    -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
     
    -
    - 31 - -
    -   - GlobalExitRootManagerAddr: common.HexToAddress("0x8A791620dd6260079BF849Dc5567aDC3F2FdC318"), -
    -
    - 32 - -
    -   - } -
    -
    - 33 - -
    -   -
    -
    -
    - 34 - -
    - + - ethermanClient, err := etherman.NewClient(cfg, l1Config, nil) -
    -
    - 35 - -
    -   - require.NoError(t, err) -
    -
    - 36 - -
    -   - worker := newWorker(ethermanClient) -
    -
    - 37 - -
    -   - ch := make(chan responseRollupInfoByBlockRange) -
    -
    -
    -
    -
    -
    -
    -
    - - {/home/stefan/go/src/Polygon/zkevm-node → .}/synchronizer/l2_sync/l2_sync_etrog/executor_trusted_batch_sync.go - RENAMED - -
    -
    -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    @@ -429,6 +430,7 @@
    -
    - 429 - -
    -   - Transactions: data.TrustedBatch.BatchL2Data, -
    -
    - 430 - -
    -   - ForkID: b.state.GetForkIDByBatchNumber(uint64(data.TrustedBatch.Number)), -
    -
    - 431 - -
    -   - SkipVerifyL1InfoRoot_V2: true, -
    -
    - - -
    -   -
    -
    -
    - 432 - -
    -   - } -
    -
    - 433 - -
    -   - return request -
    -
    - 434 - -
    -   - } -
    -
    -
    -
    -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
     
    -
    - 430 - -
    -   - Transactions: data.TrustedBatch.BatchL2Data, -
    -
    - 431 - -
    -   - ForkID: b.state.GetForkIDByBatchNumber(uint64(data.TrustedBatch.Number)), -
    -
    - 432 - -
    -   - SkipVerifyL1InfoRoot_V2: true, -
    -
    - 433 - -
    - + - ExecutionMode: executor.ExecutionMode1, -
    -
    - 434 - -
    -   - } -
    -
    - 435 - -
    -   - return request -
    -
    - 436 - -
    -   - } -
    -
    -
    -
    -
    -
    -
    -
    - - {/home/stefan/go/src/Polygon/zkevm-node → .}/synchronizer/l2_sync/l2_sync_incaberry/sync_trusted_state.go - RENAMED - -
    -
    -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    @@ -196,6 +196,7 @@
    -
    - 196 - -
    -   - OldAccInputHash: batches[1].AccInputHash, -
    -
    - 197 - -
    -   - Coinbase: common.HexToAddress(trustedBatch.Coinbase.String()), -
    -
    - 198 - -
    -   - Timestamp_V1: time.Unix(int64(trustedBatch.Timestamp), 0), -
    -
    - - -
    -   -
    -
    -
    - 199 - -
    -   - } -
    -
    - 200 - -
    -   - // check if batch needs to be synchronized -
    -
    - 201 - -
    -   - if batches[0] != nil { -
    -
    -
    -
    -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
     
    -
    - 196 - -
    -   - OldAccInputHash: batches[1].AccInputHash, -
    -
    - 197 - -
    -   - Coinbase: common.HexToAddress(trustedBatch.Coinbase.String()), -
    -
    - 198 - -
    -   - Timestamp_V1: time.Unix(int64(trustedBatch.Timestamp), 0), -
    -
    - 199 - -
    - + - ExecutionMode: executor.ExecutionMode1, -
    -
    - 200 - -
    -   - } -
    -
    - 201 - -
    -   - // check if batch needs to be synchronized -
    -
    - 202 - -
    -   - if batches[0] != nil { -
    -
    -
    -
    -
    -
    -
    -
    - - {/home/stefan/go/src/Polygon/zkevm-node → .}/synchronizer/synchronizer.go - RENAMED - -
    -
    -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    @@ -130,7 +130,25 @@
    -
    - 130 - -
    -   - uint64(state.FORKID_ELDERBERRY): syncTrustedStateEtrog, -
    -
    - 131 - -
    -   - }, res.state) -
    -
    - 132 - -
    -   - } -
    -
    - 133 - -
    - - - res.l1EventProcessors = defaultsL1EventProcessors(res) -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - 134 - -
    -   - switch cfg.L1SynchronizationMode { -
    -
    - 135 - -
    -   - case ParallelMode: -
    -
    - 136 - -
    -   - log.Info("L1SynchronizationMode is parallel") -
    -
    -
    @@ -215,7 +233,7 @@
    -
    - 215 - -
    -   - if err != nil { -
    -
    - 216 - -
    -   - if errors.Is(err, state.ErrStateNotSynchronized) { -
    -
    - 217 - -
    -   - log.Info("State is empty, verifying genesis block") -
    -
    - 218 - -
    - - - valid, err := s.etherMan.VerifyGenBlockNumber(s.ctx, s.genesis.BlockNumber) -
    -
    - 219 - -
    -   - if err != nil { -
    -
    - 220 - -
    -   - log.Error("error checking genesis block number. Error: ", err) -
    -
    - 221 - -
    -   - return rollback(s.ctx, dbTx, err) -
    -
    -
    @@ -223,12 +241,42 @@
    -
    - 223 - -
    -   - log.Error("genesis Block number configured is not valid. It is required the block number where the PolygonZkEVM smc was deployed") -
    -
    - 224 - -
    -   - return rollback(s.ctx, dbTx, fmt.Errorf("genesis Block number configured is not valid. It is required the block number where the PolygonZkEVM smc was deployed")) -
    -
    - 225 - -
    -   - } -
    -
    - 226 - -
    - - - log.Info("Setting genesis block") -
    -
    - 227 - -
    - - - header, err := s.etherMan.HeaderByNumber(s.ctx, big.NewInt(0).SetUint64(s.genesis.BlockNumber)) -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - 228 - -
    -   - if err != nil { -
    -
    - 229 - -
    - - - log.Errorf("error getting l1 block header for block %d. Error: %v", s.genesis.BlockNumber, err) -
    -
    - 230 - -
    -   - return rollback(s.ctx, dbTx, err) -
    -
    - 231 - -
    -   - } -
    -
    - - -
    -   -
    -
    -
    - 232 - -
    -   - lastEthBlockSynced = &state.Block{ -
    -
    - 233 - -
    -   - BlockNumber: header.Number.Uint64(), -
    -
    - 234 - -
    -   - BlockHash: header.Hash(), -
    -
    -
    @@ -717,7 +765,7 @@
    -
    - 717 - -
    -   - return nil, err -
    -
    - 718 - -
    -   - } -
    -
    - 719 - -
    -   - // Compare hashes -
    -
    - 720 - -
    - - - if (block.Hash() != latestBlock.BlockHash || block.ParentHash() != latestBlock.ParentHash) && latestBlock.BlockNumber > s.genesis.BlockNumber { -
    -
    - 721 - -
    -   - log.Infof("checkReorg: Bad block %d hashOk %t parentHashOk %t", latestBlock.BlockNumber, block.Hash() == latestBlock.BlockHash, block.ParentHash() == latestBlock.ParentHash) -
    -
    - 722 - -
    -   - log.Debug("[checkReorg function] => latestBlockNumber: ", latestBlock.BlockNumber) -
    -
    - 723 - -
    -   - log.Debug("[checkReorg function] => latestBlockHash: ", latestBlock.BlockHash) -
    -
    -
    -
    -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
     
    -
    - 130 - -
    -   - uint64(state.FORKID_ELDERBERRY): syncTrustedStateEtrog, -
    -
    - 131 - -
    -   - }, res.state) -
    -
    - 132 - -
    -   - } -
    -
    - 133 - -
    - + - var l1checkerL2Blocks *actions.CheckL2BlockHash -
    -
    - 134 - -
    - + - if cfg.L1SyncCheckL2BlockHash { -
    -
    - 135 - -
    - + - if !isTrustedSequencer { -
    -
    - 136 - -
    - + - log.Infof("Permissionless: L1SyncCheckL2BlockHash is enabled") -
    -
    - 137 - -
    - + - initialL2Block, err := res.state.GetLastL2BlockNumber(res.ctx, nil) -
    -
    - 138 - -
    - + - if errors.Is(err, state.ErrStateNotSynchronized) { -
    -
    - 139 - -
    - + - initialL2Block = 1 -
    -
    - 140 - -
    - + - log.Info("State is empty, can't get last L2Block number. Using %d as initial L2Block number", initialL2Block) -
    -
    - 141 - -
    - + - } else if err != nil { -
    -
    - 142 - -
    - + - log.Errorf("error getting last L2Block number from state. Error: %v", err) -
    -
    - 143 - -
    - + - return nil, err -
    -
    - 144 - -
    - + - } -
    -
    - 145 - -
    - + - l1checkerL2Blocks = actions.NewCheckL2BlockHash(res.state, res.zkEVMClient, initialL2Block, cfg.L1SyncCheckL2BlockNumberhModulus) -
    -
    - 146 - -
    - + - } else { -
    -
    - 147 - -
    - + - log.Infof("Trusted Node can't check L2Block hash, ignoring parameter") -
    -
    - 148 - -
    - + - } -
    -
    - 149 - -
    - + - } -
    -
    - 150 - -
    - + -
    -
    -
    - 151 - -
    - + - res.l1EventProcessors = defaultsL1EventProcessors(res, l1checkerL2Blocks) -
    -
    - 152 - -
    -   - switch cfg.L1SynchronizationMode { -
    -
    - 153 - -
    -   - case ParallelMode: -
    -
    - 154 - -
    -   - log.Info("L1SynchronizationMode is parallel") -
    -
    -
     
    -
    - 233 - -
    -   - if err != nil { -
    -
    - 234 - -
    -   - if errors.Is(err, state.ErrStateNotSynchronized) { -
    -
    - 235 - -
    -   - log.Info("State is empty, verifying genesis block") -
    -
    - 236 - -
    - + - valid, err := s.etherMan.VerifyGenBlockNumber(s.ctx, s.genesis.RollupBlockNumber) -
    -
    - 237 - -
    -   - if err != nil { -
    -
    - 238 - -
    -   - log.Error("error checking genesis block number. Error: ", err) -
    -
    - 239 - -
    -   - return rollback(s.ctx, dbTx, err) -
    -
    -
     
    -
    - 241 - -
    -   - log.Error("genesis Block number configured is not valid. It is required the block number where the PolygonZkEVM smc was deployed") -
    -
    - 242 - -
    -   - return rollback(s.ctx, dbTx, fmt.Errorf("genesis Block number configured is not valid. It is required the block number where the PolygonZkEVM smc was deployed")) -
    -
    - 243 - -
    -   - } -
    -
    - 244 - -
    - + -
    -
    -
    - 245 - -
    - + - // Sync events from RollupManager that happen before rollup creation -
    -
    - 246 - -
    - + - log.Info("synchronizing events from RollupManager that happen before rollup creation") -
    -
    - 247 - -
    - + - for i := s.genesis.RollupManagerBlockNumber; true; i += s.cfg.SyncChunkSize { -
    -
    - 248 - -
    - + - toBlock := min(i+s.cfg.SyncChunkSize-1, s.genesis.RollupBlockNumber-1) -
    -
    - 249 - -
    - + - blocks, order, err := s.etherMan.GetRollupInfoByBlockRange(s.ctx, i, &toBlock) -
    -
    - 250 - -
    - + - if err != nil { -
    -
    - 251 - -
    - + - log.Error("error getting rollupInfoByBlockRange before rollup genesis: ", err) -
    -
    - 252 - -
    - + - rollbackErr := dbTx.Rollback(s.ctx) -
    -
    - 253 - -
    - + - if rollbackErr != nil { -
    -
    - 254 - -
    - + - log.Errorf("error rolling back state. RollbackErr: %v, err: %s", rollbackErr, err.Error()) -
    -
    - 255 - -
    - + - return rollbackErr -
    -
    - 256 - -
    - + - } -
    -
    - 257 - -
    - + - return err -
    -
    - 258 - -
    - + - } -
    -
    - 259 - -
    - + - err = s.ProcessBlockRange(blocks, order) -
    -
    - 260 - -
    - + - if err != nil { -
    -
    - 261 - -
    - + - log.Error("error processing blocks before the genesis: ", err) -
    -
    - 262 - -
    - + - rollbackErr := dbTx.Rollback(s.ctx) -
    -
    - 263 - -
    - + - if rollbackErr != nil { -
    -
    - 264 - -
    - + - log.Errorf("error rolling back state. RollbackErr: %v, err: %s", rollbackErr, err.Error()) -
    -
    - 265 - -
    - + - return rollbackErr -
    -
    - 266 - -
    - + - } -
    -
    - 267 - -
    - + - return err -
    -
    - 268 - -
    - + - } -
    -
    - 269 - -
    - + - if toBlock == s.genesis.RollupBlockNumber-1 { -
    -
    - 270 - -
    - + - break -
    -
    - 271 - -
    - + - } -
    -
    - 272 - -
    - + - } -
    -
    - 273 - -
    - + -
    -
    -
    - 274 - -
    - + - header, err := s.etherMan.HeaderByNumber(s.ctx, big.NewInt(0).SetUint64(s.genesis.RollupBlockNumber)) -
    -
    - 275 - -
    -   - if err != nil { -
    -
    - 276 - -
    - + - log.Errorf("error getting l1 block header for block %d. Error: %v", s.genesis.RollupBlockNumber, err) -
    -
    - 277 - -
    -   - return rollback(s.ctx, dbTx, err) -
    -
    - 278 - -
    -   - } -
    -
    - 279 - -
    - + - log.Info("synchronizing rollup creation block") -
    -
    - 280 - -
    -   - lastEthBlockSynced = &state.Block{ -
    -
    - 281 - -
    -   - BlockNumber: header.Number.Uint64(), -
    -
    - 282 - -
    -   - BlockHash: header.Hash(), -
    -
    -
     
    -
    - 765 - -
    -   - return nil, err -
    -
    - 766 - -
    -   - } -
    -
    - 767 - -
    -   - // Compare hashes -
    -
    - 768 - -
    - + - if (block.Hash() != latestBlock.BlockHash || block.ParentHash() != latestBlock.ParentHash) && latestBlock.BlockNumber > s.genesis.RollupBlockNumber { -
    -
    - 769 - -
    -   - log.Infof("checkReorg: Bad block %d hashOk %t parentHashOk %t", latestBlock.BlockNumber, block.Hash() == latestBlock.BlockHash, block.ParentHash() == latestBlock.ParentHash) -
    -
    - 770 - -
    -   - log.Debug("[checkReorg function] => latestBlockNumber: ", latestBlock.BlockNumber) -
    -
    - 771 - -
    -   - log.Debug("[checkReorg function] => latestBlockHash: ", latestBlock.BlockHash) -
    -
    -
    -
    -
    -
    -
    -
    - - {/home/stefan/go/src/Polygon/zkevm-node → .}/synchronizer/synchronizer_test.go - RENAMED - -
    -
    -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    @@ -119,7 +119,7 @@
    -
    - 119 - -
    -   - // but it used a feature that is not implemented in new one that is asking beyond the last block on L1 -
    -
    - 120 - -
    -   - func TestForcedBatchEtrog(t *testing.T) { -
    -
    - 121 - -
    -   - genesis := state.Genesis{ -
    -
    - 122 - -
    - - - BlockNumber: uint64(123456), -
    -
    - 123 - -
    -   - } -
    -
    - 124 - -
    -   - cfg := Config{ -
    -
    - 125 - -
    -   - SyncInterval: cfgTypes.Duration{Duration: 1 * time.Second}, -
    -
    -
    @@ -372,7 +372,7 @@
    -
    - 372 - -
    -   - // but it used a feature that is not implemented in new one that is asking beyond the last block on L1 -
    -
    - 373 - -
    -   - func TestSequenceForcedBatchIncaberry(t *testing.T) { -
    -
    - 374 - -
    -   - genesis := state.Genesis{ -
    -
    - 375 - -
    - - - BlockNumber: uint64(123456), -
    -
    - 376 - -
    -   - } -
    -
    - 377 - -
    -   - cfg := Config{ -
    -
    - 378 - -
    -   - SyncInterval: cfgTypes.Duration{Duration: 1 * time.Second}, -
    -
    -
    @@ -611,7 +611,7 @@
    -
    - 611 - -
    -   -
    -
    -
    - 612 - -
    -   - func setupGenericTest(t *testing.T) (*state.Genesis, *Config, *mocks) { -
    -
    - 613 - -
    -   - genesis := state.Genesis{ -
    -
    - 614 - -
    - - - BlockNumber: uint64(123456), -
    -
    - 615 - -
    -   - } -
    -
    - 616 - -
    -   - cfg := Config{ -
    -
    - 617 - -
    -   - SyncInterval: cfgTypes.Duration{Duration: 1 * time.Second}, -
    -
    -
    -
    -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
     
    -
    - 119 - -
    -   - // but it used a feature that is not implemented in new one that is asking beyond the last block on L1 -
    -
    - 120 - -
    -   - func TestForcedBatchEtrog(t *testing.T) { -
    -
    - 121 - -
    -   - genesis := state.Genesis{ -
    -
    - 122 - -
    - + - RollupBlockNumber: uint64(123456), -
    -
    - 123 - -
    -   - } -
    -
    - 124 - -
    -   - cfg := Config{ -
    -
    - 125 - -
    -   - SyncInterval: cfgTypes.Duration{Duration: 1 * time.Second}, -
    -
    -
     
    -
    - 372 - -
    -   - // but it used a feature that is not implemented in new one that is asking beyond the last block on L1 -
    -
    - 373 - -
    -   - func TestSequenceForcedBatchIncaberry(t *testing.T) { -
    -
    - 374 - -
    -   - genesis := state.Genesis{ -
    -
    - 375 - -
    - + - RollupBlockNumber: uint64(123456), -
    -
    - 376 - -
    -   - } -
    -
    - 377 - -
    -   - cfg := Config{ -
    -
    - 378 - -
    -   - SyncInterval: cfgTypes.Duration{Duration: 1 * time.Second}, -
    -
    -
     
    -
    - 611 - -
    -   -
    -
    -
    - 612 - -
    -   - func setupGenericTest(t *testing.T) (*state.Genesis, *Config, *mocks) { -
    -
    - 613 - -
    -   - genesis := state.Genesis{ -
    -
    - 614 - -
    - + - RollupBlockNumber: uint64(123456), -
    -
    - 615 - -
    -   - } -
    -
    - 616 - -
    -   - cfg := Config{ -
    -
    - 617 - -
    -   - SyncInterval: cfgTypes.Duration{Duration: 1 * time.Second}, -
    -
    -
    -
    -
    -
    -
    -
    - - {/home/stefan/go/src/Polygon/zkevm-node → .}/test/contracts/auto/customModExp.sol - RENAMED - -
    -
    -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    @@ -0,0 +1,24 @@
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    -
    -
    -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
     
    -
    - 1 - -
    - + - // SPDX-License-Identifier: MIT -
    -
    - 2 - -
    - + - pragma solidity >=0.7.0 <0.9.0; -
    -
    - 3 - -
    - + -
    -
    -
    - 4 - -
    - + - contract customModExp { -
    -
    - 5 - -
    - + - bytes32 hashResult; -
    -
    - 6 - -
    - + - address retEcrecover; -
    -
    - 7 - -
    - + - bytes dataResult; -
    -
    - 8 - -
    - + - uint256 dataRes; -
    -
    - 9 - -
    - + -
    -
    -
    - 10 - -
    - + - bytes32[10] arrayStorage; -
    -
    - 11 - -
    - + -
    -
    -
    - 12 - -
    - + - function modExpGeneric(bytes memory input) public { -
    -
    - 13 - -
    - + - bytes32[10] memory output; -
    -
    - 14 - -
    - + -
    -
    -
    - 15 - -
    - + - assembly { -
    -
    - 16 - -
    - + - let success := staticcall(gas(), 0x05, add(input, 32), mload(input), output, 0x140) -
    -
    - 17 - -
    - + - sstore(0x00, success) -
    -
    - 18 - -
    - + - } -
    -
    - 19 - -
    - + -
    -
    -
    - 20 - -
    - + - for (uint i = 0; i < 10; i++) { -
    -
    - 21 - -
    - + - arrayStorage[i] = output[i]; -
    -
    - 22 - -
    - + - } -
    -
    - 23 - -
    - + - } -
    -
    - 24 - -
    - + - } -
    -
    -
    -
    -
    -
    -
    -
    - - {/home/stefan/go/src/Polygon/zkevm-node → .}/test/contracts/auto/Log0.sol - RENAMED - -
    -
    -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    @@ -0,0 +1,23 @@
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    -
    -
    -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
     
    -
    - 1 - -
    - + - // SPDX-License-Identifier: GPL-3.0 -
    -
    - 2 - -
    - + - pragma solidity >=0.7.0 <0.9.0; -
    -
    - 3 - -
    - + -
    -
    -
    - 4 - -
    - + - contract Log0 { -
    -
    - 5 - -
    - + - // opcode 0xa0 -
    -
    - 6 - -
    - + - function opLog0() public payable { -
    -
    - 7 - -
    - + - assembly { -
    -
    - 8 - -
    - + - log0(0, 32) -
    -
    - 9 - -
    - + - } -
    -
    - 10 - -
    - + - } -
    -
    - 11 - -
    - + -
    -
    -
    - 12 - -
    - + - function opLog00() public payable { -
    -
    - 13 - -
    - + - assembly { -
    -
    - 14 - -
    - + - log0(0, 0) -
    -
    - 15 - -
    - + - } -
    -
    - 16 - -
    - + - } -
    -
    - 17 - -
    - + -
    -
    -
    - 18 - -
    - + - function opLog01() public payable { -
    -
    - 19 - -
    - + - assembly { -
    -
    - 20 - -
    - + - log0(0, 28) -
    -
    - 21 - -
    - + - } -
    -
    - 22 - -
    - + - } -
    -
    - 23 - -
    - + - } -
    -
    -
    -
    -
    -
    -
    -
    - - {/home/stefan/go/src/Polygon/zkevm-node → .}/test/contracts/bin/customModExp/customModExp.go - RENAMED - -
    -
    -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    @@ -0,0 +1,224 @@
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    -
    -
    -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
     
    -
    - 1 - -
    - + - // Code generated - DO NOT EDIT. -
    -
    - 2 - -
    - + - // This file is a generated binding and any manual changes will be lost. -
    -
    - 3 - -
    - + -
    -
    -
    - 4 - -
    - + - package customModExp -
    -
    - 5 - -
    - + -
    -
    -
    - 6 - -
    - + - import ( -
    -
    - 7 - -
    - + - "errors" -
    -
    - 8 - -
    - + - "math/big" -
    -
    - 9 - -
    - + - "strings" -
    -
    - 10 - -
    - + -
    -
    -
    - 11 - -
    - + - ethereum "github.com/ethereum/go-ethereum" -
    -
    - 12 - -
    - + - "github.com/ethereum/go-ethereum/accounts/abi" -
    -
    - 13 - -
    - + - "github.com/ethereum/go-ethereum/accounts/abi/bind" -
    -
    - 14 - -
    - + - "github.com/ethereum/go-ethereum/common" -
    -
    - 15 - -
    - + - "github.com/ethereum/go-ethereum/core/types" -
    -
    - 16 - -
    - + - "github.com/ethereum/go-ethereum/event" -
    -
    - 17 - -
    - + - ) -
    -
    - 18 - -
    - + -
    -
    -
    - 19 - -
    - + - // Reference imports to suppress errors if they are not otherwise used. -
    -
    - 20 - -
    - + - var ( -
    -
    - 21 - -
    - + - _ = errors.New -
    -
    - 22 - -
    - + - _ = big.NewInt -
    -
    - 23 - -
    - + - _ = strings.NewReader -
    -
    - 24 - -
    - + - _ = ethereum.NotFound -
    -
    - 25 - -
    - + - _ = bind.Bind -
    -
    - 26 - -
    - + - _ = common.Big1 -
    -
    - 27 - -
    - + - _ = types.BloomLookup -
    -
    - 28 - -
    - + - _ = event.NewSubscription -
    -
    - 29 - -
    - + - _ = abi.ConvertType -
    -
    - 30 - -
    - + - ) -
    -
    - 31 - -
    - + -
    -
    -
    - 32 - -
    - + - // CustomModExpMetaData contains all meta data concerning the CustomModExp contract. -
    -
    - 33 - -
    - + - var CustomModExpMetaData = &bind.MetaData{ -
    -
    - 34 - -
    - + - ABI: "[{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"input\",\"type\":\"bytes\"}],\"name\":\"modExpGeneric\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", -
    -
    - 35 - -
    - + - Bin: "0x608060405234801561001057600080fd5b50610208806100206000396000f3fe608060405234801561001057600080fd5b506004361061002b5760003560e01c8063d5665d6f14610030575b600080fd5b61004361003e3660046100e2565b610045565b005b61004d6100ad565b6101408183516020850160055afa60009081555b600a8110156100a8578181600a811061007c5761007c610193565b6020020151600482600a811061009457610094610193565b0155806100a0816101a9565b915050610061565b505050565b604051806101400160405280600a906020820280368337509192915050565b634e487b7160e01b600052604160045260246000fd5b6000602082840312156100f457600080fd5b813567ffffffffffffffff8082111561010c57600080fd5b818401915084601f83011261012057600080fd5b813581811115610132576101326100cc565b604051601f8201601f19908116603f0116810190838211818310171561015a5761015a6100cc565b8160405282815287602084870101111561017357600080fd5b826020860160208301376000928101602001929092525095945050505050565b634e487b7160e01b600052603260045260246000fd5b60006000198214156101cb57634e487b7160e01b600052601160045260246000fd5b506001019056fea26469706673582212206c4940b4c9a7086754420734c8b4921cdb547ec8b31fc3bf8cd884ad9778a5b364736f6c634300080c0033", -
    -
    - 36 - -
    - + - } -
    -
    - 37 - -
    - + -
    -
    -
    - 38 - -
    - + - // CustomModExpABI is the input ABI used to generate the binding from. -
    -
    - 39 - -
    - + - // Deprecated: Use CustomModExpMetaData.ABI instead. -
    -
    - 40 - -
    - + - var CustomModExpABI = CustomModExpMetaData.ABI -
    -
    - 41 - -
    - + -
    -
    -
    - 42 - -
    - + - // CustomModExpBin is the compiled bytecode used for deploying new contracts. -
    -
    - 43 - -
    - + - // Deprecated: Use CustomModExpMetaData.Bin instead. -
    -
    - 44 - -
    - + - var CustomModExpBin = CustomModExpMetaData.Bin -
    -
    - 45 - -
    - + -
    -
    -
    - 46 - -
    - + - // DeployCustomModExp deploys a new Ethereum contract, binding an instance of CustomModExp to it. -
    -
    - 47 - -
    - + - func DeployCustomModExp(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *CustomModExp, error) { -
    -
    - 48 - -
    - + - parsed, err := CustomModExpMetaData.GetAbi() -
    -
    - 49 - -
    - + - if err != nil { -
    -
    - 50 - -
    - + - return common.Address{}, nil, nil, err -
    -
    - 51 - -
    - + - } -
    -
    - 52 - -
    - + - if parsed == nil { -
    -
    - 53 - -
    - + - return common.Address{}, nil, nil, errors.New("GetABI returned nil") -
    -
    - 54 - -
    - + - } -
    -
    - 55 - -
    - + -
    -
    -
    - 56 - -
    - + - address, tx, contract, err := bind.DeployContract(auth, *parsed, common.FromHex(CustomModExpBin), backend) -
    -
    - 57 - -
    - + - if err != nil { -
    -
    - 58 - -
    - + - return common.Address{}, nil, nil, err -
    -
    - 59 - -
    - + - } -
    -
    - 60 - -
    - + - return address, tx, &CustomModExp{CustomModExpCaller: CustomModExpCaller{contract: contract}, CustomModExpTransactor: CustomModExpTransactor{contract: contract}, CustomModExpFilterer: CustomModExpFilterer{contract: contract}}, nil -
    -
    - 61 - -
    - + - } -
    -
    - 62 - -
    - + -
    -
    -
    - 63 - -
    - + - // CustomModExp is an auto generated Go binding around an Ethereum contract. -
    -
    - 64 - -
    - + - type CustomModExp struct { -
    -
    - 65 - -
    - + - CustomModExpCaller // Read-only binding to the contract -
    -
    - 66 - -
    - + - CustomModExpTransactor // Write-only binding to the contract -
    -
    - 67 - -
    - + - CustomModExpFilterer // Log filterer for contract events -
    -
    - 68 - -
    - + - } -
    -
    - 69 - -
    - + -
    -
    -
    - 70 - -
    - + - // CustomModExpCaller is an auto generated read-only Go binding around an Ethereum contract. -
    -
    - 71 - -
    - + - type CustomModExpCaller struct { -
    -
    - 72 - -
    - + - contract *bind.BoundContract // Generic contract wrapper for the low level calls -
    -
    - 73 - -
    - + - } -
    -
    - 74 - -
    - + -
    -
    -
    - 75 - -
    - + - // CustomModExpTransactor is an auto generated write-only Go binding around an Ethereum contract. -
    -
    - 76 - -
    - + - type CustomModExpTransactor struct { -
    -
    - 77 - -
    - + - contract *bind.BoundContract // Generic contract wrapper for the low level calls -
    -
    - 78 - -
    - + - } -
    -
    - 79 - -
    - + -
    -
    -
    - 80 - -
    - + - // CustomModExpFilterer is an auto generated log filtering Go binding around an Ethereum contract events. -
    -
    - 81 - -
    - + - type CustomModExpFilterer struct { -
    -
    - 82 - -
    - + - contract *bind.BoundContract // Generic contract wrapper for the low level calls -
    -
    - 83 - -
    - + - } -
    -
    - 84 - -
    - + -
    -
    -
    - 85 - -
    - + - // CustomModExpSession is an auto generated Go binding around an Ethereum contract, -
    -
    - 86 - -
    - + - // with pre-set call and transact options. -
    -
    - 87 - -
    - + - type CustomModExpSession struct { -
    -
    - 88 - -
    - + - Contract *CustomModExp // Generic contract binding to set the session for -
    -
    - 89 - -
    - + - CallOpts bind.CallOpts // Call options to use throughout this session -
    -
    - 90 - -
    - + - TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session -
    -
    - 91 - -
    - + - } -
    -
    - 92 - -
    - + -
    -
    -
    - 93 - -
    - + - // CustomModExpCallerSession is an auto generated read-only Go binding around an Ethereum contract, -
    -
    - 94 - -
    - + - // with pre-set call options. -
    -
    - 95 - -
    - + - type CustomModExpCallerSession struct { -
    -
    - 96 - -
    - + - Contract *CustomModExpCaller // Generic contract caller binding to set the session for -
    -
    - 97 - -
    - + - CallOpts bind.CallOpts // Call options to use throughout this session -
    -
    - 98 - -
    - + - } -
    -
    - 99 - -
    - + -
    -
    -
    - 100 - -
    - + - // CustomModExpTransactorSession is an auto generated write-only Go binding around an Ethereum contract, -
    -
    - 101 - -
    - + - // with pre-set transact options. -
    -
    - 102 - -
    - + - type CustomModExpTransactorSession struct { -
    -
    - 103 - -
    - + - Contract *CustomModExpTransactor // Generic contract transactor binding to set the session for -
    -
    - 104 - -
    - + - TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session -
    -
    - 105 - -
    - + - } -
    -
    - 106 - -
    - + -
    -
    -
    - 107 - -
    - + - // CustomModExpRaw is an auto generated low-level Go binding around an Ethereum contract. -
    -
    - 108 - -
    - + - type CustomModExpRaw struct { -
    -
    - 109 - -
    - + - Contract *CustomModExp // Generic contract binding to access the raw methods on -
    -
    - 110 - -
    - + - } -
    -
    - 111 - -
    - + -
    -
    -
    - 112 - -
    - + - // CustomModExpCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. -
    -
    - 113 - -
    - + - type CustomModExpCallerRaw struct { -
    -
    - 114 - -
    - + - Contract *CustomModExpCaller // Generic read-only contract binding to access the raw methods on -
    -
    - 115 - -
    - + - } -
    -
    - 116 - -
    - + -
    -
    -
    - 117 - -
    - + - // CustomModExpTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. -
    -
    - 118 - -
    - + - type CustomModExpTransactorRaw struct { -
    -
    - 119 - -
    - + - Contract *CustomModExpTransactor // Generic write-only contract binding to access the raw methods on -
    -
    - 120 - -
    - + - } -
    -
    - 121 - -
    - + -
    -
    -
    - 122 - -
    - + - // NewCustomModExp creates a new instance of CustomModExp, bound to a specific deployed contract. -
    -
    - 123 - -
    - + - func NewCustomModExp(address common.Address, backend bind.ContractBackend) (*CustomModExp, error) { -
    -
    - 124 - -
    - + - contract, err := bindCustomModExp(address, backend, backend, backend) -
    -
    - 125 - -
    - + - if err != nil { -
    -
    - 126 - -
    - + - return nil, err -
    -
    - 127 - -
    - + - } -
    -
    - 128 - -
    - + - return &CustomModExp{CustomModExpCaller: CustomModExpCaller{contract: contract}, CustomModExpTransactor: CustomModExpTransactor{contract: contract}, CustomModExpFilterer: CustomModExpFilterer{contract: contract}}, nil -
    -
    - 129 - -
    - + - } -
    -
    - 130 - -
    - + -
    -
    -
    - 131 - -
    - + - // NewCustomModExpCaller creates a new read-only instance of CustomModExp, bound to a specific deployed contract. -
    -
    - 132 - -
    - + - func NewCustomModExpCaller(address common.Address, caller bind.ContractCaller) (*CustomModExpCaller, error) { -
    -
    - 133 - -
    - + - contract, err := bindCustomModExp(address, caller, nil, nil) -
    -
    - 134 - -
    - + - if err != nil { -
    -
    - 135 - -
    - + - return nil, err -
    -
    - 136 - -
    - + - } -
    -
    - 137 - -
    - + - return &CustomModExpCaller{contract: contract}, nil -
    -
    - 138 - -
    - + - } -
    -
    - 139 - -
    - + -
    -
    -
    - 140 - -
    - + - // NewCustomModExpTransactor creates a new write-only instance of CustomModExp, bound to a specific deployed contract. -
    -
    - 141 - -
    - + - func NewCustomModExpTransactor(address common.Address, transactor bind.ContractTransactor) (*CustomModExpTransactor, error) { -
    -
    - 142 - -
    - + - contract, err := bindCustomModExp(address, nil, transactor, nil) -
    -
    - 143 - -
    - + - if err != nil { -
    -
    - 144 - -
    - + - return nil, err -
    -
    - 145 - -
    - + - } -
    -
    - 146 - -
    - + - return &CustomModExpTransactor{contract: contract}, nil -
    -
    - 147 - -
    - + - } -
    -
    - 148 - -
    - + -
    -
    -
    - 149 - -
    - + - // NewCustomModExpFilterer creates a new log filterer instance of CustomModExp, bound to a specific deployed contract. -
    -
    - 150 - -
    - + - func NewCustomModExpFilterer(address common.Address, filterer bind.ContractFilterer) (*CustomModExpFilterer, error) { -
    -
    - 151 - -
    - + - contract, err := bindCustomModExp(address, nil, nil, filterer) -
    -
    - 152 - -
    - + - if err != nil { -
    -
    - 153 - -
    - + - return nil, err -
    -
    - 154 - -
    - + - } -
    -
    - 155 - -
    - + - return &CustomModExpFilterer{contract: contract}, nil -
    -
    - 156 - -
    - + - } -
    -
    - 157 - -
    - + -
    -
    -
    - 158 - -
    - + - // bindCustomModExp binds a generic wrapper to an already deployed contract. -
    -
    - 159 - -
    - + - func bindCustomModExp(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { -
    -
    - 160 - -
    - + - parsed, err := CustomModExpMetaData.GetAbi() -
    -
    - 161 - -
    - + - if err != nil { -
    -
    - 162 - -
    - + - return nil, err -
    -
    - 163 - -
    - + - } -
    -
    - 164 - -
    - + - return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil -
    -
    - 165 - -
    - + - } -
    -
    - 166 - -
    - + -
    -
    -
    - 167 - -
    - + - // Call invokes the (constant) contract method with params as input values and -
    -
    - 168 - -
    - + - // sets the output to result. The result type might be a single field for simple -
    -
    - 169 - -
    - + - // returns, a slice of interfaces for anonymous returns and a struct for named -
    -
    - 170 - -
    - + - // returns. -
    -
    - 171 - -
    - + - func (_CustomModExp *CustomModExpRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { -
    -
    - 172 - -
    - + - return _CustomModExp.Contract.CustomModExpCaller.contract.Call(opts, result, method, params...) -
    -
    - 173 - -
    - + - } -
    -
    - 174 - -
    - + -
    -
    -
    - 175 - -
    - + - // Transfer initiates a plain transaction to move funds to the contract, calling -
    -
    - 176 - -
    - + - // its default method if one is available. -
    -
    - 177 - -
    - + - func (_CustomModExp *CustomModExpRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { -
    -
    - 178 - -
    - + - return _CustomModExp.Contract.CustomModExpTransactor.contract.Transfer(opts) -
    -
    - 179 - -
    - + - } -
    -
    - 180 - -
    - + -
    -
    -
    - 181 - -
    - + - // Transact invokes the (paid) contract method with params as input values. -
    -
    - 182 - -
    - + - func (_CustomModExp *CustomModExpRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { -
    -
    - 183 - -
    - + - return _CustomModExp.Contract.CustomModExpTransactor.contract.Transact(opts, method, params...) -
    -
    - 184 - -
    - + - } -
    -
    - 185 - -
    - + -
    -
    -
    - 186 - -
    - + - // Call invokes the (constant) contract method with params as input values and -
    -
    - 187 - -
    - + - // sets the output to result. The result type might be a single field for simple -
    -
    - 188 - -
    - + - // returns, a slice of interfaces for anonymous returns and a struct for named -
    -
    - 189 - -
    - + - // returns. -
    -
    - 190 - -
    - + - func (_CustomModExp *CustomModExpCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { -
    -
    - 191 - -
    - + - return _CustomModExp.Contract.contract.Call(opts, result, method, params...) -
    -
    - 192 - -
    - + - } -
    -
    - 193 - -
    - + -
    -
    -
    - 194 - -
    - + - // Transfer initiates a plain transaction to move funds to the contract, calling -
    -
    - 195 - -
    - + - // its default method if one is available. -
    -
    - 196 - -
    - + - func (_CustomModExp *CustomModExpTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { -
    -
    - 197 - -
    - + - return _CustomModExp.Contract.contract.Transfer(opts) -
    -
    - 198 - -
    - + - } -
    -
    - 199 - -
    - + -
    -
    -
    - 200 - -
    - + - // Transact invokes the (paid) contract method with params as input values. -
    -
    - 201 - -
    - + - func (_CustomModExp *CustomModExpTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { -
    -
    - 202 - -
    - + - return _CustomModExp.Contract.contract.Transact(opts, method, params...) -
    -
    - 203 - -
    - + - } -
    -
    - 204 - -
    - + -
    -
    -
    - 205 - -
    - + - // ModExpGeneric is a paid mutator transaction binding the contract method 0xd5665d6f. -
    -
    - 206 - -
    - + - // -
    -
    - 207 - -
    - + - // Solidity: function modExpGeneric(bytes input) returns() -
    -
    - 208 - -
    - + - func (_CustomModExp *CustomModExpTransactor) ModExpGeneric(opts *bind.TransactOpts, input []byte) (*types.Transaction, error) { -
    -
    - 209 - -
    - + - return _CustomModExp.contract.Transact(opts, "modExpGeneric", input) -
    -
    - 210 - -
    - + - } -
    -
    - 211 - -
    - + -
    -
    -
    - 212 - -
    - + - // ModExpGeneric is a paid mutator transaction binding the contract method 0xd5665d6f. -
    -
    - 213 - -
    - + - // -
    -
    - 214 - -
    - + - // Solidity: function modExpGeneric(bytes input) returns() -
    -
    - 215 - -
    - + - func (_CustomModExp *CustomModExpSession) ModExpGeneric(input []byte) (*types.Transaction, error) { -
    -
    - 216 - -
    - + - return _CustomModExp.Contract.ModExpGeneric(&_CustomModExp.TransactOpts, input) -
    -
    - 217 - -
    - + - } -
    -
    - 218 - -
    - + -
    -
    -
    - 219 - -
    - + - // ModExpGeneric is a paid mutator transaction binding the contract method 0xd5665d6f. -
    -
    - 220 - -
    - + - // -
    -
    - 221 - -
    - + - // Solidity: function modExpGeneric(bytes input) returns() -
    -
    - 222 - -
    - + - func (_CustomModExp *CustomModExpTransactorSession) ModExpGeneric(input []byte) (*types.Transaction, error) { -
    -
    - 223 - -
    - + - return _CustomModExp.Contract.ModExpGeneric(&_CustomModExp.TransactOpts, input) -
    -
    - 224 - -
    - + - } -
    -
    -
    -
    -
    -
    -
    -
    - - {/home/stefan/go/src/Polygon/zkevm-node → .}/test/contracts/bin/Log0/Log0.go - RENAMED - -
    -
    -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    @@ -0,0 +1,266 @@
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    -
    -
    -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
     
    -
    - 1 - -
    - + - // Code generated - DO NOT EDIT. -
    -
    - 2 - -
    - + - // This file is a generated binding and any manual changes will be lost. -
    -
    - 3 - -
    - + -
    -
    -
    - 4 - -
    - + - package Log0 -
    -
    - 5 - -
    - + -
    -
    -
    - 6 - -
    - + - import ( -
    -
    - 7 - -
    - + - "errors" -
    -
    - 8 - -
    - + - "math/big" -
    -
    - 9 - -
    - + - "strings" -
    -
    - 10 - -
    - + -
    -
    -
    - 11 - -
    - + - ethereum "github.com/ethereum/go-ethereum" -
    -
    - 12 - -
    - + - "github.com/ethereum/go-ethereum/accounts/abi" -
    -
    - 13 - -
    - + - "github.com/ethereum/go-ethereum/accounts/abi/bind" -
    -
    - 14 - -
    - + - "github.com/ethereum/go-ethereum/common" -
    -
    - 15 - -
    - + - "github.com/ethereum/go-ethereum/core/types" -
    -
    - 16 - -
    - + - "github.com/ethereum/go-ethereum/event" -
    -
    - 17 - -
    - + - ) -
    -
    - 18 - -
    - + -
    -
    -
    - 19 - -
    - + - // Reference imports to suppress errors if they are not otherwise used. -
    -
    - 20 - -
    - + - var ( -
    -
    - 21 - -
    - + - _ = errors.New -
    -
    - 22 - -
    - + - _ = big.NewInt -
    -
    - 23 - -
    - + - _ = strings.NewReader -
    -
    - 24 - -
    - + - _ = ethereum.NotFound -
    -
    - 25 - -
    - + - _ = bind.Bind -
    -
    - 26 - -
    - + - _ = common.Big1 -
    -
    - 27 - -
    - + - _ = types.BloomLookup -
    -
    - 28 - -
    - + - _ = event.NewSubscription -
    -
    - 29 - -
    - + - _ = abi.ConvertType -
    -
    - 30 - -
    - + - ) -
    -
    - 31 - -
    - + -
    -
    -
    - 32 - -
    - + - // Log0MetaData contains all meta data concerning the Log0 contract. -
    -
    - 33 - -
    - + - var Log0MetaData = &bind.MetaData{ -
    -
    - 34 - -
    - + - ABI: "[{\"inputs\":[],\"name\":\"opLog0\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"opLog00\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"opLog01\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"}]", -
    -
    - 35 - -
    - + - Bin: "0x6080604052348015600f57600080fd5b5060938061001e6000396000f3fe60806040526004361060305760003560e01c80633e2d0b8514603557806357e4605514603d578063ecc5544a146043575b600080fd5b603b6049565b005b603b6050565b603b6056565b601c6000a0565b600080a0565b60206000a056fea26469706673582212209aba01a729d89e6da96ac8ca0b8f1940565356ed4f7849c9af7a95f5188d22d964736f6c634300080c0033", -
    -
    - 36 - -
    - + - } -
    -
    - 37 - -
    - + -
    -
    -
    - 38 - -
    - + - // Log0ABI is the input ABI used to generate the binding from. -
    -
    - 39 - -
    - + - // Deprecated: Use Log0MetaData.ABI instead. -
    -
    - 40 - -
    - + - var Log0ABI = Log0MetaData.ABI -
    -
    - 41 - -
    - + -
    -
    -
    - 42 - -
    - + - // Log0Bin is the compiled bytecode used for deploying new contracts. -
    -
    - 43 - -
    - + - // Deprecated: Use Log0MetaData.Bin instead. -
    -
    - 44 - -
    - + - var Log0Bin = Log0MetaData.Bin -
    -
    - 45 - -
    - + -
    -
    -
    - 46 - -
    - + - // DeployLog0 deploys a new Ethereum contract, binding an instance of Log0 to it. -
    -
    - 47 - -
    - + - func DeployLog0(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *Log0, error) { -
    -
    - 48 - -
    - + - parsed, err := Log0MetaData.GetAbi() -
    -
    - 49 - -
    - + - if err != nil { -
    -
    - 50 - -
    - + - return common.Address{}, nil, nil, err -
    -
    - 51 - -
    - + - } -
    -
    - 52 - -
    - + - if parsed == nil { -
    -
    - 53 - -
    - + - return common.Address{}, nil, nil, errors.New("GetABI returned nil") -
    -
    - 54 - -
    - + - } -
    -
    - 55 - -
    - + -
    -
    -
    - 56 - -
    - + - address, tx, contract, err := bind.DeployContract(auth, *parsed, common.FromHex(Log0Bin), backend) -
    -
    - 57 - -
    - + - if err != nil { -
    -
    - 58 - -
    - + - return common.Address{}, nil, nil, err -
    -
    - 59 - -
    - + - } -
    -
    - 60 - -
    - + - return address, tx, &Log0{Log0Caller: Log0Caller{contract: contract}, Log0Transactor: Log0Transactor{contract: contract}, Log0Filterer: Log0Filterer{contract: contract}}, nil -
    -
    - 61 - -
    - + - } -
    -
    - 62 - -
    - + -
    -
    -
    - 63 - -
    - + - // Log0 is an auto generated Go binding around an Ethereum contract. -
    -
    - 64 - -
    - + - type Log0 struct { -
    -
    - 65 - -
    - + - Log0Caller // Read-only binding to the contract -
    -
    - 66 - -
    - + - Log0Transactor // Write-only binding to the contract -
    -
    - 67 - -
    - + - Log0Filterer // Log filterer for contract events -
    -
    - 68 - -
    - + - } -
    -
    - 69 - -
    - + -
    -
    -
    - 70 - -
    - + - // Log0Caller is an auto generated read-only Go binding around an Ethereum contract. -
    -
    - 71 - -
    - + - type Log0Caller struct { -
    -
    - 72 - -
    - + - contract *bind.BoundContract // Generic contract wrapper for the low level calls -
    -
    - 73 - -
    - + - } -
    -
    - 74 - -
    - + -
    -
    -
    - 75 - -
    - + - // Log0Transactor is an auto generated write-only Go binding around an Ethereum contract. -
    -
    - 76 - -
    - + - type Log0Transactor struct { -
    -
    - 77 - -
    - + - contract *bind.BoundContract // Generic contract wrapper for the low level calls -
    -
    - 78 - -
    - + - } -
    -
    - 79 - -
    - + -
    -
    -
    - 80 - -
    - + - // Log0Filterer is an auto generated log filtering Go binding around an Ethereum contract events. -
    -
    - 81 - -
    - + - type Log0Filterer struct { -
    -
    - 82 - -
    - + - contract *bind.BoundContract // Generic contract wrapper for the low level calls -
    -
    - 83 - -
    - + - } -
    -
    - 84 - -
    - + -
    -
    -
    - 85 - -
    - + - // Log0Session is an auto generated Go binding around an Ethereum contract, -
    -
    - 86 - -
    - + - // with pre-set call and transact options. -
    -
    - 87 - -
    - + - type Log0Session struct { -
    -
    - 88 - -
    - + - Contract *Log0 // Generic contract binding to set the session for -
    -
    - 89 - -
    - + - CallOpts bind.CallOpts // Call options to use throughout this session -
    -
    - 90 - -
    - + - TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session -
    -
    - 91 - -
    - + - } -
    -
    - 92 - -
    - + -
    -
    -
    - 93 - -
    - + - // Log0CallerSession is an auto generated read-only Go binding around an Ethereum contract, -
    -
    - 94 - -
    - + - // with pre-set call options. -
    -
    - 95 - -
    - + - type Log0CallerSession struct { -
    -
    - 96 - -
    - + - Contract *Log0Caller // Generic contract caller binding to set the session for -
    -
    - 97 - -
    - + - CallOpts bind.CallOpts // Call options to use throughout this session -
    -
    - 98 - -
    - + - } -
    -
    - 99 - -
    - + -
    -
    -
    - 100 - -
    - + - // Log0TransactorSession is an auto generated write-only Go binding around an Ethereum contract, -
    -
    - 101 - -
    - + - // with pre-set transact options. -
    -
    - 102 - -
    - + - type Log0TransactorSession struct { -
    -
    - 103 - -
    - + - Contract *Log0Transactor // Generic contract transactor binding to set the session for -
    -
    - 104 - -
    - + - TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session -
    -
    - 105 - -
    - + - } -
    -
    - 106 - -
    - + -
    -
    -
    - 107 - -
    - + - // Log0Raw is an auto generated low-level Go binding around an Ethereum contract. -
    -
    - 108 - -
    - + - type Log0Raw struct { -
    -
    - 109 - -
    - + - Contract *Log0 // Generic contract binding to access the raw methods on -
    -
    - 110 - -
    - + - } -
    -
    - 111 - -
    - + -
    -
    -
    - 112 - -
    - + - // Log0CallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. -
    -
    - 113 - -
    - + - type Log0CallerRaw struct { -
    -
    - 114 - -
    - + - Contract *Log0Caller // Generic read-only contract binding to access the raw methods on -
    -
    - 115 - -
    - + - } -
    -
    - 116 - -
    - + -
    -
    -
    - 117 - -
    - + - // Log0TransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. -
    -
    - 118 - -
    - + - type Log0TransactorRaw struct { -
    -
    - 119 - -
    - + - Contract *Log0Transactor // Generic write-only contract binding to access the raw methods on -
    -
    - 120 - -
    - + - } -
    -
    - 121 - -
    - + -
    -
    -
    - 122 - -
    - + - // NewLog0 creates a new instance of Log0, bound to a specific deployed contract. -
    -
    - 123 - -
    - + - func NewLog0(address common.Address, backend bind.ContractBackend) (*Log0, error) { -
    -
    - 124 - -
    - + - contract, err := bindLog0(address, backend, backend, backend) -
    -
    - 125 - -
    - + - if err != nil { -
    -
    - 126 - -
    - + - return nil, err -
    -
    - 127 - -
    - + - } -
    -
    - 128 - -
    - + - return &Log0{Log0Caller: Log0Caller{contract: contract}, Log0Transactor: Log0Transactor{contract: contract}, Log0Filterer: Log0Filterer{contract: contract}}, nil -
    -
    - 129 - -
    - + - } -
    -
    - 130 - -
    - + -
    -
    -
    - 131 - -
    - + - // NewLog0Caller creates a new read-only instance of Log0, bound to a specific deployed contract. -
    -
    - 132 - -
    - + - func NewLog0Caller(address common.Address, caller bind.ContractCaller) (*Log0Caller, error) { -
    -
    - 133 - -
    - + - contract, err := bindLog0(address, caller, nil, nil) -
    -
    - 134 - -
    - + - if err != nil { -
    -
    - 135 - -
    - + - return nil, err -
    -
    - 136 - -
    - + - } -
    -
    - 137 - -
    - + - return &Log0Caller{contract: contract}, nil -
    -
    - 138 - -
    - + - } -
    -
    - 139 - -
    - + -
    -
    -
    - 140 - -
    - + - // NewLog0Transactor creates a new write-only instance of Log0, bound to a specific deployed contract. -
    -
    - 141 - -
    - + - func NewLog0Transactor(address common.Address, transactor bind.ContractTransactor) (*Log0Transactor, error) { -
    -
    - 142 - -
    - + - contract, err := bindLog0(address, nil, transactor, nil) -
    -
    - 143 - -
    - + - if err != nil { -
    -
    - 144 - -
    - + - return nil, err -
    -
    - 145 - -
    - + - } -
    -
    - 146 - -
    - + - return &Log0Transactor{contract: contract}, nil -
    -
    - 147 - -
    - + - } -
    -
    - 148 - -
    - + -
    -
    -
    - 149 - -
    - + - // NewLog0Filterer creates a new log filterer instance of Log0, bound to a specific deployed contract. -
    -
    - 150 - -
    - + - func NewLog0Filterer(address common.Address, filterer bind.ContractFilterer) (*Log0Filterer, error) { -
    -
    - 151 - -
    - + - contract, err := bindLog0(address, nil, nil, filterer) -
    -
    - 152 - -
    - + - if err != nil { -
    -
    - 153 - -
    - + - return nil, err -
    -
    - 154 - -
    - + - } -
    -
    - 155 - -
    - + - return &Log0Filterer{contract: contract}, nil -
    -
    - 156 - -
    - + - } -
    -
    - 157 - -
    - + -
    -
    -
    - 158 - -
    - + - // bindLog0 binds a generic wrapper to an already deployed contract. -
    -
    - 159 - -
    - + - func bindLog0(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { -
    -
    - 160 - -
    - + - parsed, err := Log0MetaData.GetAbi() -
    -
    - 161 - -
    - + - if err != nil { -
    -
    - 162 - -
    - + - return nil, err -
    -
    - 163 - -
    - + - } -
    -
    - 164 - -
    - + - return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil -
    -
    - 165 - -
    - + - } -
    -
    - 166 - -
    - + -
    -
    -
    - 167 - -
    - + - // Call invokes the (constant) contract method with params as input values and -
    -
    - 168 - -
    - + - // sets the output to result. The result type might be a single field for simple -
    -
    - 169 - -
    - + - // returns, a slice of interfaces for anonymous returns and a struct for named -
    -
    - 170 - -
    - + - // returns. -
    -
    - 171 - -
    - + - func (_Log0 *Log0Raw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { -
    -
    - 172 - -
    - + - return _Log0.Contract.Log0Caller.contract.Call(opts, result, method, params...) -
    -
    - 173 - -
    - + - } -
    -
    - 174 - -
    - + -
    -
    -
    - 175 - -
    - + - // Transfer initiates a plain transaction to move funds to the contract, calling -
    -
    - 176 - -
    - + - // its default method if one is available. -
    -
    - 177 - -
    - + - func (_Log0 *Log0Raw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { -
    -
    - 178 - -
    - + - return _Log0.Contract.Log0Transactor.contract.Transfer(opts) -
    -
    - 179 - -
    - + - } -
    -
    - 180 - -
    - + -
    -
    -
    - 181 - -
    - + - // Transact invokes the (paid) contract method with params as input values. -
    -
    - 182 - -
    - + - func (_Log0 *Log0Raw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { -
    -
    - 183 - -
    - + - return _Log0.Contract.Log0Transactor.contract.Transact(opts, method, params...) -
    -
    - 184 - -
    - + - } -
    -
    - 185 - -
    - + -
    -
    -
    - 186 - -
    - + - // Call invokes the (constant) contract method with params as input values and -
    -
    - 187 - -
    - + - // sets the output to result. The result type might be a single field for simple -
    -
    - 188 - -
    - + - // returns, a slice of interfaces for anonymous returns and a struct for named -
    -
    - 189 - -
    - + - // returns. -
    -
    - 190 - -
    - + - func (_Log0 *Log0CallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { -
    -
    - 191 - -
    - + - return _Log0.Contract.contract.Call(opts, result, method, params...) -
    -
    - 192 - -
    - + - } -
    -
    - 193 - -
    - + -
    -
    -
    - 194 - -
    - + - // Transfer initiates a plain transaction to move funds to the contract, calling -
    -
    - 195 - -
    - + - // its default method if one is available. -
    -
    - 196 - -
    - + - func (_Log0 *Log0TransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { -
    -
    - 197 - -
    - + - return _Log0.Contract.contract.Transfer(opts) -
    -
    - 198 - -
    - + - } -
    -
    - 199 - -
    - + -
    -
    -
    - 200 - -
    - + - // Transact invokes the (paid) contract method with params as input values. -
    -
    - 201 - -
    - + - func (_Log0 *Log0TransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { -
    -
    - 202 - -
    - + - return _Log0.Contract.contract.Transact(opts, method, params...) -
    -
    - 203 - -
    - + - } -
    -
    - 204 - -
    - + -
    -
    -
    - 205 - -
    - + - // OpLog0 is a paid mutator transaction binding the contract method 0xecc5544a. -
    -
    - 206 - -
    - + - // -
    -
    - 207 - -
    - + - // Solidity: function opLog0() payable returns() -
    -
    - 208 - -
    - + - func (_Log0 *Log0Transactor) OpLog0(opts *bind.TransactOpts) (*types.Transaction, error) { -
    -
    - 209 - -
    - + - return _Log0.contract.Transact(opts, "opLog0") -
    -
    - 210 - -
    - + - } -
    -
    - 211 - -
    - + -
    -
    -
    - 212 - -
    - + - // OpLog0 is a paid mutator transaction binding the contract method 0xecc5544a. -
    -
    - 213 - -
    - + - // -
    -
    - 214 - -
    - + - // Solidity: function opLog0() payable returns() -
    -
    - 215 - -
    - + - func (_Log0 *Log0Session) OpLog0() (*types.Transaction, error) { -
    -
    - 216 - -
    - + - return _Log0.Contract.OpLog0(&_Log0.TransactOpts) -
    -
    - 217 - -
    - + - } -
    -
    - 218 - -
    - + -
    -
    -
    - 219 - -
    - + - // OpLog0 is a paid mutator transaction binding the contract method 0xecc5544a. -
    -
    - 220 - -
    - + - // -
    -
    - 221 - -
    - + - // Solidity: function opLog0() payable returns() -
    -
    - 222 - -
    - + - func (_Log0 *Log0TransactorSession) OpLog0() (*types.Transaction, error) { -
    -
    - 223 - -
    - + - return _Log0.Contract.OpLog0(&_Log0.TransactOpts) -
    -
    - 224 - -
    - + - } -
    -
    - 225 - -
    - + -
    -
    -
    - 226 - -
    - + - // OpLog00 is a paid mutator transaction binding the contract method 0x57e46055. -
    -
    - 227 - -
    - + - // -
    -
    - 228 - -
    - + - // Solidity: function opLog00() payable returns() -
    -
    - 229 - -
    - + - func (_Log0 *Log0Transactor) OpLog00(opts *bind.TransactOpts) (*types.Transaction, error) { -
    -
    - 230 - -
    - + - return _Log0.contract.Transact(opts, "opLog00") -
    -
    - 231 - -
    - + - } -
    -
    - 232 - -
    - + -
    -
    -
    - 233 - -
    - + - // OpLog00 is a paid mutator transaction binding the contract method 0x57e46055. -
    -
    - 234 - -
    - + - // -
    -
    - 235 - -
    - + - // Solidity: function opLog00() payable returns() -
    -
    - 236 - -
    - + - func (_Log0 *Log0Session) OpLog00() (*types.Transaction, error) { -
    -
    - 237 - -
    - + - return _Log0.Contract.OpLog00(&_Log0.TransactOpts) -
    -
    - 238 - -
    - + - } -
    -
    - 239 - -
    - + -
    -
    -
    - 240 - -
    - + - // OpLog00 is a paid mutator transaction binding the contract method 0x57e46055. -
    -
    - 241 - -
    - + - // -
    -
    - 242 - -
    - + - // Solidity: function opLog00() payable returns() -
    -
    - 243 - -
    - + - func (_Log0 *Log0TransactorSession) OpLog00() (*types.Transaction, error) { -
    -
    - 244 - -
    - + - return _Log0.Contract.OpLog00(&_Log0.TransactOpts) -
    -
    - 245 - -
    - + - } -
    -
    - 246 - -
    - + -
    -
    -
    - 247 - -
    - + - // OpLog01 is a paid mutator transaction binding the contract method 0x3e2d0b85. -
    -
    - 248 - -
    - + - // -
    -
    - 249 - -
    - + - // Solidity: function opLog01() payable returns() -
    -
    - 250 - -
    - + - func (_Log0 *Log0Transactor) OpLog01(opts *bind.TransactOpts) (*types.Transaction, error) { -
    -
    - 251 - -
    - + - return _Log0.contract.Transact(opts, "opLog01") -
    -
    - 252 - -
    - + - } -
    -
    - 253 - -
    - + -
    -
    -
    - 254 - -
    - + - // OpLog01 is a paid mutator transaction binding the contract method 0x3e2d0b85. -
    -
    - 255 - -
    - + - // -
    -
    - 256 - -
    - + - // Solidity: function opLog01() payable returns() -
    -
    - 257 - -
    - + - func (_Log0 *Log0Session) OpLog01() (*types.Transaction, error) { -
    -
    - 258 - -
    - + - return _Log0.Contract.OpLog01(&_Log0.TransactOpts) -
    -
    - 259 - -
    - + - } -
    -
    - 260 - -
    - + -
    -
    -
    - 261 - -
    - + - // OpLog01 is a paid mutator transaction binding the contract method 0x3e2d0b85. -
    -
    - 262 - -
    - + - // -
    -
    - 263 - -
    - + - // Solidity: function opLog01() payable returns() -
    -
    - 264 - -
    - + - func (_Log0 *Log0TransactorSession) OpLog01() (*types.Transaction, error) { -
    -
    - 265 - -
    - + - return _Log0.Contract.OpLog01(&_Log0.TransactOpts) -
    -
    - 266 - -
    - + - } -
    -
    -
    -
    -
    -
    -
    -
    - - {/home/stefan/go/src/Polygon/zkevm-node → .}/test/contracts/bin/triggerErrors/triggerErrors.go - RENAMED - -
    -
    -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    @@ -32,7 +32,7 @@
    -
    - 32 - -
    -   - // TriggerErrorsMetaData contains all meta data concerning the TriggerErrors contract. -
    -
    - 33 - -
    -   - var TriggerErrorsMetaData = &bind.MetaData{ -
    -
    - 34 - -
    -   - ABI: "[{\"inputs\":[],\"name\":\"count\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"outOfCountersKeccaks\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"test\",\"type\":\"bytes32\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"outOfCountersPoseidon\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"outOfCountersSteps\",\"outputs\":[],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"outOfGas\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", -
    -
    - 35 - -
    - - - Bin: "0x60806040526000805534801561001457600080fd5b5061016c806100246000396000f3fe608060405234801561001057600080fd5b50600436106100575760003560e01c806306661abd1461005c5780632621002a1461007757806331fe52e8146100835780638bd7b5381461008d578063cb4e8cd114610095575b600080fd5b61006560005481565b60405190815260200160405180910390f35b620f4240600020610065565b61008b61009d565b005b61008b6100c3565b61008b6100e9565b60005b60648110156100c0578060005580806100b89061010d565b9150506100a0565b50565b60005b620186a08110156100c0576104d2600052806100e18161010d565b9150506100c6565b60005b61c3508110156100c0578060005580806101059061010d565b9150506100ec565b600060001982141561012f57634e487b7160e01b600052601160045260246000fd5b506001019056fea264697066735822122097beacfaa873e4896937143dfea406cc278b929a28023f7e7020b6dea6e9fc7364736f6c634300080c0033", -
    -
    - 36 - -
    -   - } -
    -
    - 37 - -
    -   -
    -
    -
    - 38 - -
    -   - // TriggerErrorsABI is the input ABI used to generate the binding from. -
    -
    -
    -
    -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
     
    -
    - 32 - -
    -   - // TriggerErrorsMetaData contains all meta data concerning the TriggerErrors contract. -
    -
    - 33 - -
    -   - var TriggerErrorsMetaData = &bind.MetaData{ -
    -
    - 34 - -
    -   - ABI: "[{\"inputs\":[],\"name\":\"count\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"outOfCountersKeccaks\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"test\",\"type\":\"bytes32\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"outOfCountersPoseidon\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"outOfCountersSteps\",\"outputs\":[],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"outOfGas\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", -
    -
    - 35 - -
    - + - Bin: "0x60806040526000805534801561001457600080fd5b5061016c806100246000396000f3fe608060405234801561001057600080fd5b50600436106100575760003560e01c806306661abd1461005c5780632621002a1461007757806331fe52e8146100835780638bd7b5381461008d578063cb4e8cd114610095575b600080fd5b61006560005481565b60405190815260200160405180910390f35b620f4240600020610065565b61008b61009d565b005b61008b6100c3565b61008b6100e9565b60005b60648110156100c0578060005580806100b89061010d565b9150506100a0565b50565b60005b620186a08110156100c0576104d2600052806100e18161010d565b9150506100c6565b60005b61c3508110156100c0578060005580806101059061010d565b9150506100ec565b600060001982141561012f57634e487b7160e01b600052601160045260246000fd5b506001019056fea26469706673582212208f01c5dc055b1f376f5da5deb33e2c96ee776174bf48874c5ebba0f606de2ac564736f6c634300080c0033", -
    -
    - 36 - -
    -   - } -
    -
    - 37 - -
    -   -
    -
    -
    - 38 - -
    -   - // TriggerErrorsABI is the input ABI used to generate the binding from. -
    -
    -
    -
    -
    -
    -
    -
    - - {/home/stefan/go/src/Polygon/zkevm-node → .}/test/docker-compose.yml - RENAMED - -
    -
    -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    @@ -2,7 +2,7 @@
    -
    - 2 - -
    -   - networks: -
    -
    - 3 - -
    -   - default: -
    -
    - 4 - -
    -   - name: zkevm -
    -
    - 5 - -
    - - - -
    -
    - 6 - -
    -   - services: -
    -
    - 7 - -
    -   - grafana: -
    -
    - 8 - -
    -   - container_name: grafana -
    -
    -
    @@ -453,7 +453,7 @@
    -
    - 453 - -
    -   -
    -
    -
    - 454 - -
    -   - zkevm-mock-l1-network: -
    -
    - 455 - -
    -   - container_name: zkevm-mock-l1-network -
    -
    - 456 - -
    - - - image: hermeznetwork/geth-zkevm-contracts:v2.1.3-fork.8-geth1.12.0 -
    -
    - 457 - -
    -   - ports: -
    -
    - 458 - -
    -   - - 8545:8545 -
    -
    - 459 - -
    -   - - 8546:8546 -
    -
    -
    @@ -513,12 +513,14 @@
    -
    - 513 - -
    -   -
    -
    -
    - 514 - -
    -   - zkevm-prover: -
    -
    - 515 - -
    -   - container_name: zkevm-prover -
    -
    - 516 - -
    - - - image: hermeznetwork/zkevm-prover:v5.0.3 -
    -
    - 517 - -
    -   - ports: -
    -
    - 518 - -
    -   - - 50061:50061 # MT -
    -
    - 519 - -
    -   - - 50071:50071 # Executor -
    -
    - 520 - -
    -   - volumes: -
    -
    - 521 - -
    -   - - ./config/test.prover.config.json:/usr/src/app/config.json -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - 522 - -
    -   - command: > -
    -
    - 523 - -
    -   - zkProver -c /usr/src/app/config.json -
    -
    - 524 - -
    -   -
    -
    -
    -
    @@ -602,7 +604,7 @@
    -
    - 602 - -
    -   -
    -
    -
    - 603 - -
    -   - zkevm-permissionless-prover: -
    -
    - 604 - -
    -   - container_name: zkevm-permissionless-prover -
    -
    - 605 - -
    - - - image: hermeznetwork/zkevm-prover:v5.0.3 -
    -
    - 606 - -
    -   - ports: -
    -
    - 607 - -
    -   - # - 50058:50058 # Prover -
    -
    - 608 - -
    -   - - 50059:50052 # Mock prover -
    -
    -
    @@ -628,7 +630,7 @@
    -
    - 628 - -
    -   - zkevm-sh: -
    -
    - 629 - -
    -   - container_name: zkevm-sh -
    -
    - 630 - -
    -   - image: zkevm-node -
    -
    - 631 - -
    - - - stdin_open: true -
    -
    - 632 - -
    -   - tty: true -
    -
    - 633 - -
    -   - environment: -
    -
    - 634 - -
    -   - - ZKEVM_NODE_STATE_DB_HOST=zkevm-state-db -
    -
    -
    @@ -638,3 +640,51 @@
    -
    - 638 - -
    -   - - ./config/test.genesis.config.json:/app/genesis.json -
    -
    - 639 - -
    -   - command: -
    -
    - 640 - -
    -   - - "/bin/sh" -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    -
    -
    -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
     
    -
    - 2 - -
    -   - networks: -
    -
    - 3 - -
    -   - default: -
    -
    - 4 - -
    -   - name: zkevm -
    -
    - 5 - -
    - + -
    -
    -
    - 6 - -
    -   - services: -
    -
    - 7 - -
    -   - grafana: -
    -
    - 8 - -
    -   - container_name: grafana -
    -
    -
     
    -
    - 453 - -
    -   -
    -
    -
    - 454 - -
    -   - zkevm-mock-l1-network: -
    -
    - 455 - -
    -   - container_name: zkevm-mock-l1-network -
    -
    - 456 - -
    - + - image: 0xpolygon/cdk-validium-contracts:forkId8 -
    -
    - 457 - -
    -   - ports: -
    -
    - 458 - -
    -   - - 8545:8545 -
    -
    - 459 - -
    -   - - 8546:8546 -
    -
    -
     
    -
    - 513 - -
    -   -
    -
    -
    - 514 - -
    -   - zkevm-prover: -
    -
    - 515 - -
    -   - container_name: zkevm-prover -
    -
    - 516 - -
    - + - image: hermeznetwork/zkevm-prover:v5.0.6 -
    -
    - 517 - -
    -   - ports: -
    -
    - 518 - -
    -   - - 50061:50061 # MT -
    -
    - 519 - -
    -   - - 50071:50071 # Executor -
    -
    - 520 - -
    -   - volumes: -
    -
    - 521 - -
    -   - - ./config/test.prover.config.json:/usr/src/app/config.json -
    -
    - 522 - -
    - + - environment: -
    -
    - 523 - -
    - + - - EXPERIMENTAL_DOCKER_DESKTOP_FORCE_QEMU=1 -
    -
    - 524 - -
    -   - command: > -
    -
    - 525 - -
    -   - zkProver -c /usr/src/app/config.json -
    -
    - 526 - -
    -   -
    -
    -
    -
     
    -
    - 604 - -
    -   -
    -
    -
    - 605 - -
    -   - zkevm-permissionless-prover: -
    -
    - 606 - -
    -   - container_name: zkevm-permissionless-prover -
    -
    - 607 - -
    - + - image: hermeznetwork/zkevm-prover:v5.0.6 -
    -
    - 608 - -
    -   - ports: -
    -
    - 609 - -
    -   - # - 50058:50058 # Prover -
    -
    - 610 - -
    -   - - 50059:50052 # Mock prover -
    -
    -
     
    -
    - 630 - -
    -   - zkevm-sh: -
    -
    - 631 - -
    -   - container_name: zkevm-sh -
    -
    - 632 - -
    -   - image: zkevm-node -
    -
    - 633 - -
    - + - stdin_open: true -
    -
    - 634 - -
    -   - tty: true -
    -
    - 635 - -
    -   - environment: -
    -
    - 636 - -
    -   - - ZKEVM_NODE_STATE_DB_HOST=zkevm-state-db -
    -
    -
     
    -
    - 640 - -
    -   - - ./config/test.genesis.config.json:/app/genesis.json -
    -
    - 641 - -
    -   - command: -
    -
    - 642 - -
    -   - - "/bin/sh" -
    -
    - 643 - -
    - + -
    -
    -
    - 644 - -
    - + - zkevm-node-forced-DAC: -
    -
    - 645 - -
    - + - container_name: zkevm-node-forced-DAC -
    -
    - 646 - -
    - + - image: zkevm-node -
    -
    - 647 - -
    - + - ports: -
    -
    - 648 - -
    - + - - 8125:8125 -
    -
    - 649 - -
    - + - environment: -
    -
    - 650 - -
    - + - - ZKEVM_NODE_ISTRUSTEDSEQUENCER=false -
    -
    - 651 - -
    - + - - ZKEVM_NODE_STATEDB_USER=test_user -
    -
    - 652 - -
    - + - - ZKEVM_NODE_STATEDB_PASSWORD=test_password -
    -
    - 653 - -
    - + - - ZKEVM_NODE_STATEDB_NAME=state_db -
    -
    - 654 - -
    - + - - ZKEVM_NODE_STATEDB_HOST=zkevm-permissionless-db -
    -
    - 655 - -
    - + - - ZKEVM_NODE_POOL_DB_USER=test_user -
    -
    - 656 - -
    - + - - ZKEVM_NODE_POOL_DB_PASSWORD=test_password -
    -
    - 657 - -
    - + - - ZKEVM_NODE_POOL_DB_NAME=pool_db -
    -
    - 658 - -
    - + - - ZKEVM_NODE_POOL_DB_HOST=zkevm-permissionless-db -
    -
    - 659 - -
    - + - - ZKEVM_NODE_RPC_PORT=8125 -
    -
    - 660 - -
    - + - - ZKEVM_NODE_RPC_SEQUENCERNODEURI=http://zkevm-node-json-rpc:8123 -
    -
    - 661 - -
    - + - - ZKEVM_NODE_SYNCHRONIZER_TRUSTEDSEQUENCERURL=http://you-cant-touch-this:8123 -
    -
    - 662 - -
    - + - - ZKEVM_NODE_MTCLIENT_URI=zkevm-permissionless-prover:50061 -
    -
    - 663 - -
    - + - - ZKEVM_NODE_EXECUTOR_URI=zkevm-permissionless-prover:50071 -
    -
    - 664 - -
    - + - volumes: -
    -
    - 665 - -
    - + - - ./config/test.node.config.toml:/app/config.toml -
    -
    - 666 - -
    - + - - ./config/test.genesis.config.json:/app/genesis.json -
    -
    - 667 - -
    - + - command: -
    -
    - 668 - -
    - + - - "/bin/sh" -
    -
    - 669 - -
    - + - - "-c" -
    -
    - 670 - -
    - + - - "/app/zkevm-node run --network custom --custom-network-file /app/genesis.json --cfg /app/config.toml --components \"rpc,synchronizer\"" -
    -
    - 671 - -
    - + -
    -
    -
    - 672 - -
    - + - zkevm-data-node-db: -
    -
    - 673 - -
    - + - container_name: zkevm-data-node-db -
    -
    - 674 - -
    - + - restart: unless-stopped -
    -
    - 675 - -
    - + - image: postgres -
    -
    - 676 - -
    - + - healthcheck: -
    -
    - 677 - -
    - + - test: ["CMD-SHELL", "pg_isready -d $${POSTGRES_DB} -U $${POSTGRES_USER}"] -
    -
    - 678 - -
    - + - interval: 10s -
    -
    - 679 - -
    - + - timeout: 5s -
    -
    - 680 - -
    - + - retries: 5 -
    -
    - 681 - -
    - + - ports: -
    -
    - 682 - -
    - + - - 5444:5432 -
    -
    - 683 - -
    - + - environment: -
    -
    - 684 - -
    - + - - POSTGRES_USER=committee_user -
    -
    - 685 - -
    - + - - POSTGRES_PASSWORD=committee_password -
    -
    - 686 - -
    - + - - POSTGRES_DB=committee_db -
    -
    - 687 - -
    - + - command: -
    -
    - 688 - -
    - + - - "postgres" -
    -
    - 689 - -
    - + - - "-N" -
    -
    - 690 - -
    - + - - "500" -
    -
    -
    -
    -
    -
    -
    -
    - - {/home/stefan/go/src/Polygon/zkevm-node → .}/test/e2e/datacommittee_test.go - RENAMED - -
    -
    -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    @@ -0,0 +1,270 @@
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    -
    -
    -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
     
    -
    - 1 - -
    - + - package e2e -
    -
    - 2 - -
    - + -
    -
    -
    - 3 - -
    - + - import ( -
    -
    - 4 - -
    - + - "context" -
    -
    - 5 - -
    - + - "crypto/ecdsa" -
    -
    - 6 - -
    - + - "encoding/json" -
    -
    - 7 - -
    - + - "fmt" -
    -
    - 8 - -
    - + - "math/big" -
    -
    - 9 - -
    - + - "os" -
    -
    - 10 - -
    - + - "os/exec" -
    -
    - 11 - -
    - + - "sort" -
    -
    - 12 - -
    - + - "strconv" -
    -
    - 13 - -
    - + - "strings" -
    -
    - 14 - -
    - + - "testing" -
    -
    - 15 - -
    - + - "time" -
    -
    - 16 - -
    - + -
    -
    -
    - 17 - -
    - + - "github.com/0xPolygon/cdk-data-availability/config" -
    -
    - 18 - -
    - + - cTypes "github.com/0xPolygon/cdk-data-availability/config/types" -
    -
    - 19 - -
    - + - "github.com/0xPolygon/cdk-data-availability/db" -
    -
    - 20 - -
    - + - "github.com/0xPolygon/cdk-data-availability/rpc" -
    -
    - 21 - -
    - + - "github.com/0xPolygonHermez/zkevm-node/etherman/smartcontracts/polygondatacommittee" -
    -
    - 22 - -
    - + - "github.com/0xPolygonHermez/zkevm-node/log" -
    -
    - 23 - -
    - + - "github.com/0xPolygonHermez/zkevm-node/test/operations" -
    -
    - 24 - -
    - + - "github.com/ethereum/go-ethereum" -
    -
    - 25 - -
    - + - eTypes "github.com/ethereum/go-ethereum/core/types" -
    -
    - 26 - -
    - + -
    -
    -
    - 27 - -
    - + - "github.com/ethereum/go-ethereum/accounts/keystore" -
    -
    - 28 - -
    - + - "github.com/ethereum/go-ethereum/common" -
    -
    - 29 - -
    - + - "github.com/ethereum/go-ethereum/crypto" -
    -
    - 30 - -
    - + - "github.com/ethereum/go-ethereum/ethclient" -
    -
    - 31 - -
    - + - "github.com/stretchr/testify/assert" -
    -
    - 32 - -
    - + - "github.com/stretchr/testify/require" -
    -
    - 33 - -
    - + - ) -
    -
    - 34 - -
    - + -
    -
    -
    - 35 - -
    - + - func TestDataCommittee(t *testing.T) { -
    -
    - 36 - -
    - + - const ( -
    -
    - 37 - -
    - + - nSignatures = 4 -
    -
    - 38 - -
    - + - mMembers = 5 -
    -
    - 39 - -
    - + - ksFile = "/tmp/pkey" -
    -
    - 40 - -
    - + - cfgFile = "/tmp/dacnodeconfigfile.json" -
    -
    - 41 - -
    - + - ksPass = "pass" -
    -
    - 42 - -
    - + - dacNodeContainer = "hermeznetwork/cdk-data-availability:v0.0.4" -
    -
    - 43 - -
    - + - ) -
    -
    - 44 - -
    - + -
    -
    -
    - 45 - -
    - + - // Setup -
    -
    - 46 - -
    - + - var err error -
    -
    - 47 - -
    - + - if testing.Short() { -
    -
    - 48 - -
    - + - t.Skip() -
    -
    - 49 - -
    - + - } -
    -
    - 50 - -
    - + - ctx := context.Background() -
    -
    - 51 - -
    - + - defer func() { -
    -
    - 52 - -
    - + - require.NoError(t, operations.Teardown()) -
    -
    - 53 - -
    - + - }() -
    -
    - 54 - -
    - + - err = operations.Teardown() -
    -
    - 55 - -
    - + - require.NoError(t, err) -
    -
    - 56 - -
    - + - opsCfg := operations.GetDefaultOperationsConfig() -
    -
    - 57 - -
    - + - opsCfg.State.MaxCumulativeGasUsed = 80000000000 -
    -
    - 58 - -
    - + - opsman, err := operations.NewManager(ctx, opsCfg) -
    -
    - 59 - -
    - + - require.NoError(t, err) -
    -
    - 60 - -
    - + - defer func() { -
    -
    - 61 - -
    - + - require.NoError(t, opsman.StopDACDB()) -
    -
    - 62 - -
    - + - }() -
    -
    - 63 - -
    - + - err = opsman.Setup() -
    -
    - 64 - -
    - + - require.NoError(t, err) -
    -
    - 65 - -
    - + - require.NoError(t, opsman.StartDACDB()) -
    -
    - 66 - -
    - + - time.Sleep(5 * time.Second) -
    -
    - 67 - -
    - + - authL2, err := operations.GetAuth(operations.DefaultSequencerPrivateKey, operations.DefaultL2ChainID) -
    -
    - 68 - -
    - + - require.NoError(t, err) -
    -
    - 69 - -
    - + - authL1, err := operations.GetAuth(operations.DefaultSequencerPrivateKey, operations.DefaultL1ChainID) -
    -
    - 70 - -
    - + - require.NoError(t, err) -
    -
    - 71 - -
    - + - clientL2, err := ethclient.Dial(operations.DefaultL2NetworkURL) -
    -
    - 72 - -
    - + - require.NoError(t, err) -
    -
    - 73 - -
    - + - clientL1, err := ethclient.Dial(operations.DefaultL1NetworkURL) -
    -
    - 74 - -
    - + - require.NoError(t, err) -
    -
    - 75 - -
    - + - dacSC, err := polygondatacommittee.NewPolygondatacommittee( -
    -
    - 76 - -
    - + - common.HexToAddress(operations.DefaultL1DataCommitteeContract), -
    -
    - 77 - -
    - + - clientL1, -
    -
    - 78 - -
    - + - ) -
    -
    - 79 - -
    - + - require.NoError(t, err) -
    -
    - 80 - -
    - + -
    -
    -
    - 81 - -
    - + - // Register committe with N / M signatures -
    -
    - 82 - -
    - + - membs := members{} -
    -
    - 83 - -
    - + - addrsBytes := []byte{} -
    -
    - 84 - -
    - + - urls := []string{} -
    -
    - 85 - -
    - + - for i := 0; i < mMembers; i++ { -
    -
    - 86 - -
    - + - pk, err := crypto.GenerateKey() -
    -
    - 87 - -
    - + - require.NoError(t, err) -
    -
    - 88 - -
    - + - membs = append(membs, member{ -
    -
    - 89 - -
    - + - addr: crypto.PubkeyToAddress(pk.PublicKey), -
    -
    - 90 - -
    - + - pk: pk, -
    -
    - 91 - -
    - + - url: fmt.Sprintf("http://cdk-data-availability-%d:420%d", i, i), -
    -
    - 92 - -
    - + - i: i, -
    -
    - 93 - -
    - + - }) -
    -
    - 94 - -
    - + - } -
    -
    - 95 - -
    - + - sort.Sort(membs) -
    -
    - 96 - -
    - + - for _, m := range membs { -
    -
    - 97 - -
    - + - addrsBytes = append(addrsBytes, m.addr.Bytes()...) -
    -
    - 98 - -
    - + - urls = append(urls, m.url) -
    -
    - 99 - -
    - + - } -
    -
    - 100 - -
    - + - tx, err := dacSC.SetupCommittee(authL1, big.NewInt(nSignatures), urls, addrsBytes) -
    -
    - 101 - -
    - + - for _, m := range membs { -
    -
    - 102 - -
    - + - fmt.Println(m.addr) -
    -
    - 103 - -
    - + - } -
    -
    - 104 - -
    - + - require.NoError(t, err) -
    -
    - 105 - -
    - + - err = operations.WaitTxToBeMined(ctx, clientL1, tx, operations.DefaultTimeoutTxToBeMined) -
    -
    - 106 - -
    - + - require.NoError(t, err) -
    -
    - 107 - -
    - + -
    -
    -
    - 108 - -
    - + - // Spin up M DAC nodes -
    -
    - 109 - -
    - + - dacNodeConfig := config.Config{ -
    -
    - 110 - -
    - + - L1: config.L1Config{ -
    -
    - 111 - -
    - + - RpcURL: "http://zkevm-mock-l1-network:8545", -
    -
    - 112 - -
    - + - WsURL: "ws://zkevm-mock-l1-network:8546", -
    -
    - 113 - -
    - + - PolygonValidiumAddress: operations.DefaultL1ZkEVMSmartContract, -
    -
    - 114 - -
    - + - DataCommitteeAddress: operations.DefaultL1DataCommitteeContract, -
    -
    - 115 - -
    - + - Timeout: cTypes.Duration{Duration: time.Second}, -
    -
    - 116 - -
    - + - RetryPeriod: cTypes.Duration{Duration: time.Second}, -
    -
    - 117 - -
    - + - }, -
    -
    - 118 - -
    - + - PrivateKey: cTypes.KeystoreFileConfig{ -
    -
    - 119 - -
    - + - Path: ksFile, -
    -
    - 120 - -
    - + - Password: ksPass, -
    -
    - 121 - -
    - + - }, -
    -
    - 122 - -
    - + - DB: db.Config{ -
    -
    - 123 - -
    - + - Name: "committee_db", -
    -
    - 124 - -
    - + - User: "committee_user", -
    -
    - 125 - -
    - + - Password: "committee_password", -
    -
    - 126 - -
    - + - Host: "zkevm-data-node-db", -
    -
    - 127 - -
    - + - Port: "5432", -
    -
    - 128 - -
    - + - EnableLog: false, -
    -
    - 129 - -
    - + - MaxConns: 10, -
    -
    - 130 - -
    - + - }, -
    -
    - 131 - -
    - + - RPC: rpc.Config{ -
    -
    - 132 - -
    - + - Host: "0.0.0.0", -
    -
    - 133 - -
    - + - MaxRequestsPerIPAndSecond: 100, -
    -
    - 134 - -
    - + - }, -
    -
    - 135 - -
    - + - } -
    -
    - 136 - -
    - + - defer func() { -
    -
    - 137 - -
    - + - // Remove tmp files -
    -
    - 138 - -
    - + - assert.NoError(t, -
    -
    - 139 - -
    - + - exec.Command("rm", cfgFile).Run(), -
    -
    - 140 - -
    - + - ) -
    -
    - 141 - -
    - + - assert.NoError(t, -
    -
    - 142 - -
    - + - exec.Command("rmdir", ksFile+"_").Run(), -
    -
    - 143 - -
    - + - ) -
    -
    - 144 - -
    - + - assert.NoError(t, -
    -
    - 145 - -
    - + - exec.Command("rm", ksFile).Run(), -
    -
    - 146 - -
    - + - ) -
    -
    - 147 - -
    - + - // Stop DAC nodes -
    -
    - 148 - -
    - + - for i := 0; i < mMembers; i++ { -
    -
    - 149 - -
    - + - assert.NoError(t, exec.Command( -
    -
    - 150 - -
    - + - "docker", "kill", "cdk-data-availability-"+strconv.Itoa(i), -
    -
    - 151 - -
    - + - ).Run()) -
    -
    - 152 - -
    - + - assert.NoError(t, exec.Command( -
    -
    - 153 - -
    - + - "docker", "rm", "cdk-data-availability-"+strconv.Itoa(i), -
    -
    - 154 - -
    - + - ).Run()) -
    -
    - 155 - -
    - + - } -
    -
    - 156 - -
    - + - // Stop permissionless node -
    -
    - 157 - -
    - + - require.NoError(t, opsman.StopPermissionlessNodeForcedToSYncThroughDAC()) -
    -
    - 158 - -
    - + - }() -
    -
    - 159 - -
    - + - // Start permissionless node -
    -
    - 160 - -
    - + - require.NoError(t, opsman.StartPermissionlessNodeForcedToSYncThroughDAC()) -
    -
    - 161 - -
    - + - // Star DAC nodes -
    -
    - 162 - -
    - + - for _, m := range membs { -
    -
    - 163 - -
    - + - // Set correct port -
    -
    - 164 - -
    - + - port := 4200 + m.i -
    -
    - 165 - -
    - + - dacNodeConfig.RPC.Port = port -
    -
    - 166 - -
    - + - // Write config file -
    -
    - 167 - -
    - + - file, err := json.MarshalIndent(dacNodeConfig, "", " ") -
    -
    - 168 - -
    - + - require.NoError(t, err) -
    -
    - 169 - -
    - + - err = os.WriteFile(cfgFile, file, 0644) -
    -
    - 170 - -
    - + - require.NoError(t, err) -
    -
    - 171 - -
    - + - // Write private key keystore file -
    -
    - 172 - -
    - + - err = createKeyStore(m.pk, ksFile, ksPass) -
    -
    - 173 - -
    - + - require.NoError(t, err) -
    -
    - 174 - -
    - + - // Run DAC node -
    -
    - 175 - -
    - + - cmd := exec.Command( + package e2e
    - 176 + 2
    + - "docker", "run", "-d", +
    - 177 + 3
    + - "--name", "cdk-data-availability-"+strconv.Itoa(m.i), + import (
    - 178 + 4
    + - "-v", cfgFile+":/app/config.json", + "context"
    - 179 + 5
    + - "-v", ksFile+":"+ksFile, + "crypto/ecdsa"
    - 180 + 6
    + - "--network", "zkevm", + "encoding/json"
    - 181 + 7
    + - dacNodeContainer, + "fmt"
    - 182 + 8
    + - "/bin/sh", "-c", + "math/big"
    - 183 + 9
    + - "/app/cdk-data-availability run --cfg /app/config.json", + "os"
    - 184 + 10
    + - ) + "os/exec"
    - 185 + 11
    + - out, err := cmd.CombinedOutput() + "sort"
    - 186 + 12
    + - require.NoError(t, err, string(out)) + "strconv"
    - 187 + 13
    + - log.Infof("DAC node %d started", m.i) + "strings"
    - 188 + 14
    + - time.Sleep(time.Second * 5) + "testing"
    - 189 + 15
    + - } + "time"
    - 190 + 16
    @@ -136203,177 +101197,177 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 191 + 17
    + - // Send txs + "github.com/0xPolygon/cdk-data-availability/config"
    - 192 + 18
    + - nTxs := 10 + cTypes "github.com/0xPolygon/cdk-data-availability/config/types"
    - 193 + 19
    + - amount := big.NewInt(10000) + "github.com/0xPolygon/cdk-data-availability/db"
    - 194 + 20
    + - toAddress := common.HexToAddress("0x70997970C51812dc3A010C7d01b50e0d17dc79C8") + "github.com/0xPolygon/cdk-data-availability/rpc"
    - 195 + 21
    + - _, err = clientL2.BalanceAt(ctx, authL2.From, nil) + "github.com/0xPolygonHermez/zkevm-node/etherman/smartcontracts/polygondatacommittee"
    - 196 + 22
    + - require.NoError(t, err) + "github.com/0xPolygonHermez/zkevm-node/log"
    - 197 + 23
    + - _, err = clientL2.PendingNonceAt(ctx, authL2.From) + "github.com/0xPolygonHermez/zkevm-node/test/operations"
    - 198 + 24
    + - require.NoError(t, err) + "github.com/ethereum/go-ethereum"
    - 199 + 25
    + -
    + eTypes "github.com/ethereum/go-ethereum/core/types"
    - 200 + 26
    + - gasLimit, err := clientL2.EstimateGas(ctx, ethereum.CallMsg{From: authL2.From, To: &toAddress, Value: amount}) +
    - 201 + 27
    + - require.NoError(t, err) + "github.com/ethereum/go-ethereum/accounts/keystore"
    - 202 + 28
    + -
    + "github.com/ethereum/go-ethereum/common"
    - 203 + 29
    + - gasPrice, err := clientL2.SuggestGasPrice(ctx) + "github.com/ethereum/go-ethereum/crypto"
    - 204 + 30
    + - require.NoError(t, err) + "github.com/ethereum/go-ethereum/ethclient"
    - 205 + 31
    + -
    + "github.com/stretchr/testify/assert"
    - 206 + 32
    + - nonce, err := clientL2.PendingNonceAt(ctx, authL2.From) + "github.com/stretchr/testify/require"
    - 207 + 33
    + - require.NoError(t, err) + )
    - 208 + 34
    @@ -136383,597 +101377,597 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 209 + 35
    + - txs := make([]*eTypes.Transaction, 0, nTxs) + func TestDataCommittee(t *testing.T) {
    - 210 + 36
    + - for i := 0; i < nTxs; i++ { + const (
    - 211 + 37
    + - tx := eTypes.NewTransaction(nonce+uint64(i), toAddress, amount, gasLimit, gasPrice, nil) + nSignatures = 4
    - 212 + 38
    + - log.Infof("generating tx %d / %d: %s", i+1, nTxs, tx.Hash().Hex()) + mMembers = 5
    - 213 + 39
    + - txs = append(txs, tx) + ksFile = "/tmp/pkey"
    - 214 + 40
    + - } + cfgFile = "/tmp/dacnodeconfigfile.json"
    - 215 + 41
    + -
    + ksPass = "pass"
    - 216 + 42
    + - // Wait for verification + dacNodeContainer = "hermeznetwork/cdk-data-availability:v0.0.4"
    - 217 + 43
    + - _, err = operations.ApplyL2Txs(ctx, txs, authL2, clientL2, operations.VerifiedConfirmationLevel) + )
    - 218 + 44
    + - require.NoError(t, err) +
    - 219 + 45
    + -
    + // Setup
    - 220 + 46
    + - // Assert that he permissionless node is fully synced (through the DAC) + var err error
    - 221 + 47
    + - time.Sleep(30 * time.Second) // Give some time for the permissionless node to get synced + if testing.Short() {
    - 222 + 48
    + - clientL2Permissionless, err := ethclient.Dial(operations.PermissionlessL2NetworkURL) + t.Skip()
    - 223 + 49
    + - require.NoError(t, err) + }
    - 224 + 50
    + - expectedBlock, err := clientL2.BlockByNumber(ctx, nil) + ctx := context.Background()
    - 225 + 51
    + - require.NoError(t, err) + defer func() {
    - 226 + 52
    + - actualBlock, err := clientL2Permissionless.BlockByNumber(ctx, nil) + require.NoError(t, operations.Teardown())
    - 227 + 53
    + - require.NoError(t, err) + }()
    - 228 + 54
    + - // je, err := expectedBlock.Header().MarshalJSON() + err = operations.Teardown()
    - 229 + 55
    + - // require.NoError(t, err) + require.NoError(t, err)
    - 230 + 56
    + - // log.Info(string(je)) + opsCfg := operations.GetDefaultOperationsConfig()
    - 231 + 57
    + - // ja, err := actualBlock.Header().MarshalJSON() + opsCfg.State.MaxCumulativeGasUsed = 80000000000
    - 232 + 58
    + - // require.NoError(t, err) + opsman, err := operations.NewManager(ctx, opsCfg)
    - 233 + 59
    + - // log.Info(string(ja)) + require.NoError(t, err)
    - 234 + 60
    + - // require.Equal(t, string(je), string(ja)) + defer func() {
    - 235 + 61
    + - require.Equal(t, expectedBlock.Root().Hex(), actualBlock.Root().Hex()) + require.NoError(t, opsman.StopDACDB())
    - 236 + 62
    + - } + }()
    - 237 + 63
    + -
    + err = opsman.Setup()
    - 238 + 64
    + - type member struct { + require.NoError(t, err)
    - 239 + 65
    + - addr common.Address + require.NoError(t, opsman.StartDACDB())
    - 240 + 66
    + - pk *ecdsa.PrivateKey + time.Sleep(5 * time.Second)
    - 241 + 67
    + - url string + authL2, err := operations.GetAuth(operations.DefaultSequencerPrivateKey, operations.DefaultL2ChainID)
    - 242 + 68
    + - i int + require.NoError(t, err)
    - 243 + 69
    + - } + authL1, err := operations.GetAuth(operations.DefaultSequencerPrivateKey, operations.DefaultL1ChainID)
    - 244 + 70
    + - type members []member + require.NoError(t, err)
    - 245 + 71
    + -
    + clientL2, err := ethclient.Dial(operations.DefaultL2NetworkURL)
    - 246 + 72
    + - func (s members) Len() int { return len(s) } + require.NoError(t, err)
    - 247 + 73
    + - func (s members) Less(i, j int) bool { + clientL1, err := ethclient.Dial(operations.DefaultL1NetworkURL)
    - 248 + 74
    + - return strings.ToUpper(s[i].addr.Hex()) < strings.ToUpper(s[j].addr.Hex()) + require.NoError(t, err)
    - 249 + 75
    + - } + dacSC, err := polygondatacommittee.NewPolygondatacommittee(
    - 250 + 76
    + - func (s members) Swap(i, j int) { s[i], s[j] = s[j], s[i] } + common.HexToAddress(operations.DefaultL1DataCommitteeContract),
    - 251 + 77
    + -
    + clientL1,
    - 252 + 78
    + - func createKeyStore(pk *ecdsa.PrivateKey, outputDir, password string) error { + )
    - 253 + 79
    + - ks := keystore.NewKeyStore(outputDir+"_", keystore.StandardScryptN, keystore.StandardScryptP) + require.NoError(t, err)
    - 254 + 80
    + - _, err := ks.ImportECDSA(pk, password) +
    - 255 + 81
    + - if err != nil { + // Register committe with N / M signatures
    - 256 + 82
    + - return err + membs := members{}
    - 257 + 83
    + - } + addrsBytes := []byte{}
    - 258 + 84
    + - fileNameB, err := exec.Command("ls", outputDir+"_/").CombinedOutput() + urls := []string{}
    - 259 + 85
    + - fileName := strings.TrimSuffix(string(fileNameB), "\n") + for i := 0; i < mMembers; i++ {
    - 260 + 86
    + - if err != nil { + pk, err := crypto.GenerateKey()
    - 261 + 87
    + - fmt.Println(fileName) + require.NoError(t, err)
    - 262 + 88
    + - return err + membs = append(membs, member{
    - 263 + 89
    + - } + addr: crypto.PubkeyToAddress(pk.PublicKey),
    - 264 + 90
    + - out, err := exec.Command("mv", outputDir+"_/"+fileName, outputDir).CombinedOutput() + pk: pk,
    - 265 + 91
    + - if err != nil { + url: fmt.Sprintf("http://cdk-data-availability-%d:420%d", i, i),
    - 266 + 92
    + - fmt.Println(string(out)) + i: i,
    - 267 + 93
    + - return err + })
    - 268 + 94
    @@ -136983,185 +101977,122 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 269 + 95
    + - return nil + sort.Sort(membs)
    - 270 + 96
    + - } -
    -
    -
    + for _, m := range membs {
    -
    -
    -
    -
    - - {/home/stefan/go/src/Polygon/zkevm-node → .}/test/e2e/debug_calltracer_test.go - RENAMED - -
    -
    -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    @@ -104,6 +104,9 @@
    - 104 + + 97 +
    -   - {name: "memory", prepare: prepareMemory, createSignedTx: createMemorySignedTx}, + + + addrsBytes = append(addrsBytes, m.addr.Bytes()...)
    - 105 + + 98 +
    -   - {name: "bridge", prepare: prepareBridge, createSignedTx: createBridgeSignedTx}, + + + urls = append(urls, m.url)
    - 106 + + 99 +
    -   - {name: "deploy create 0", createSignedTx: createDeployCreate0SignedTx}, -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    + + + }
    - + + 100 -
    -   -
    +
    +
    + + + tx, err := dacSC.SetupCommittee(authL1, big.NewInt(nSignatures), urls, addrsBytes)
    - 107 + + 101 +
    -   -
    + + + for _, m := range membs {
    - 108 + + 102 +
    -   - // failed transactions + + + fmt.Println(m.addr)
    - 109 + + 103 +
    -   - {name: "sc deployment reverted", createSignedTx: createScDeployRevertedSignedTx}, -
    -
    -
    + + + }
    -
    -
    - - - - - - - - - - - @@ -137171,7 +102102,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    @@ -137181,7 +102112,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    @@ -137191,875 +102122,812 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - - - - - - - - -
    -
     
    + 104 +
    -   - {name: "memory", prepare: prepareMemory, createSignedTx: createMemorySignedTx}, + + + require.NoError(t, err)
    + 105 +
    -   - {name: "bridge", prepare: prepareBridge, createSignedTx: createBridgeSignedTx}, + + + err = operations.WaitTxToBeMined(ctx, clientL1, tx, operations.DefaultTimeoutTxToBeMined)
    + 106 +
    -   - {name: "deploy create 0", createSignedTx: createDeployCreate0SignedTx}, + + + require.NoError(t, err)
    + - {name: "log0 all zeros", prepare: prepareLog0, createSignedTx: createLog0AllZeros}, +
    + - {name: "log0 empty", prepare: prepareLog0, createSignedTx: createLog0Empty}, + // Spin up M DAC nodes
    + - {name: "log0 short", prepare: prepareLog0, createSignedTx: createLog0Short}, + dacNodeConfig := config.Config{
    + 110 +
    -   -
    + + + L1: config.L1Config{
    + 111 +
    -   - // failed transactions + + + RpcURL: "http://zkevm-mock-l1-network:8545",
    + 112 +
    -   - {name: "sc deployment reverted", createSignedTx: createScDeployRevertedSignedTx}, -
    -
    -
    + + + WsURL: "ws://zkevm-mock-l1-network:8546",
    -
    -
    -
    -
    - - {/home/stefan/go/src/Polygon/zkevm-node → .}/test/e2e/debug_shared.go - RENAMED - -
    -
    -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    @@ -883,3 +884,72 @@
    - 883 + + 113 +
    -   - log.Debugf("sending eth transfer: %v", signedTx.Hash().String()) + + + PolygonValidiumAddress: operations.DefaultL1ZkEVMSmartContract,
    - 884 + + 114 +
    -   - } + + + DataCommitteeAddress: operations.DefaultL1DataCommitteeContract,
    - 885 + + 115 +
    -   - } -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    + + + Timeout: cTypes.Duration{Duration: time.Second},
    - + + 116 -
    -   -
    +
    +
    + + + RetryPeriod: cTypes.Duration{Duration: time.Second},
    - + + 117 -
    -   -
    +
    +
    + + + },
    - + + 118 -
    -   -
    +
    +
    + + + PrivateKey: cTypes.KeystoreFileConfig{
    - + + 119 -
    -   -
    +
    +
    + + + Path: ksFile,
    - + + 120 -
    -   -
    +
    +
    + + + Password: ksPass,
    - + + 121 -
    -   -
    +
    +
    + + + },
    - + + 122 -
    -   -
    +
    +
    + + + DB: db.Config{
    - + + 123 -
    -   -
    +
    +
    + + + Name: "committee_db",
    - + + 124 -
    -   -
    +
    +
    + + + User: "committee_user",
    - + + 125 -
    -   -
    +
    +
    + + + Password: "committee_password",
    - + + 126 -
    -   -
    +
    +
    + + + Host: "zkevm-data-node-db",
    - + + 127 -
    -   -
    +
    +
    + + + Port: "5432",
    - + + 128 -
    -   -
    +
    +
    + + + EnableLog: false,
    - + + 129 -
    -   -
    +
    +
    + + + MaxConns: 10,
    - + + 130 -
    -   -
    +
    +
    + + + },
    - + + 131 -
    -   -
    +
    +
    + + + RPC: rpc.Config{
    - + + 132 -
    -   -
    +
    +
    + + + Host: "0.0.0.0",
    - + + 133 -
    -   -
    +
    +
    + + + MaxRequestsPerIPAndSecond: 100,
    - + + 134 -
    -   -
    +
    +
    + + + },
    - + + 135 -
    -   -
    +
    +
    + + + }
    - + + 136 -
    -   -
    +
    +
    + + + defer func() {
    - + + 137 -
    -   -
    +
    +
    + + + // Remove tmp files
    - + + 138 -
    -   -
    +
    +
    + + + assert.NoError(t,
    - + + 139 -
    -   -
    +
    +
    + + + exec.Command("rm", cfgFile).Run(),
    - + + 140 -
    -   -
    +
    +
    + + + )
    - + + 141 -
    -   -
    +
    +
    + + + assert.NoError(t,
    - + + 142 -
    -   -
    +
    +
    + + + exec.Command("rmdir", ksFile+"_").Run(),
    - + + 143 -
    -   -
    +
    +
    + + + )
    - + + 144 -
    -   -
    +
    +
    + + + assert.NoError(t,
    - + + 145 -
    -   -
    +
    +
    + + + exec.Command("rm", ksFile).Run(),
    - + + 146 -
    -   -
    +
    +
    + + + )
    - + + 147 -
    -   -
    +
    +
    + + + // Stop DAC nodes
    - + + 148 -
    -   -
    +
    +
    + + + for i := 0; i < mMembers; i++ {
    - + + 149 -
    -   -
    +
    +
    + + + assert.NoError(t, exec.Command(
    - + + 150 -
    -   -
    +
    +
    + + + "docker", "kill", "cdk-data-availability-"+strconv.Itoa(i),
    - + + 151 -
    -   -
    +
    +
    + + + ).Run())
    - + + 152 -
    -   -
    +
    +
    + + + assert.NoError(t, exec.Command(
    - + + 153 -
    -   -
    +
    +
    + + + "docker", "rm", "cdk-data-availability-"+strconv.Itoa(i),
    - + + 154 -
    -   -
    +
    +
    + + + ).Run())
    - + + 155 -
    -   -
    +
    +
    + + + }
    - + + 156 -
    -   -
    +
    +
    + + + // Stop permissionless node
    - + + 157 -
    -   -
    +
    +
    + + + require.NoError(t, opsman.StopPermissionlessNodeForcedToSYncThroughDAC())
    - + + 158 -
    -   -
    +
    +
    + + + }()
    - + + 159 -
    -   -
    +
    +
    + + + // Start permissionless node
    - + + 160 -
    -   -
    +
    +
    + + + require.NoError(t, opsman.StartPermissionlessNodeForcedToSYncThroughDAC())
    - + + 161 -
    -   -
    +
    +
    + + + // Star DAC nodes
    - + + 162 -
    -   -
    +
    +
    + + + for _, m := range membs {
    - + + 163 -
    -   -
    +
    +
    + + + // Set correct port
    - + + 164 -
    -   -
    +
    +
    + + + port := 4200 + m.i
    - + + 165 -
    -   -
    +
    +
    + + + dacNodeConfig.RPC.Port = port
    - + + 166 -
    -   -
    +
    +
    + + + // Write config file
    - + + 167 -
    -   -
    +
    +
    + + + file, err := json.MarshalIndent(dacNodeConfig, "", " ")
    - + + 168 -
    -   -
    +
    +
    + + + require.NoError(t, err)
    - + + 169 -
    -   -
    +
    +
    + + + err = os.WriteFile(cfgFile, file, 0644)
    - + + 170 -
    -   -
    +
    +
    + + + require.NoError(t, err)
    - + + 171 -
    -   -
    +
    +
    + + + // Write private key keystore file
    - + + 172 -
    -   -
    +
    +
    + + + err = createKeyStore(m.pk, ksFile, ksPass)
    - + + 173 -
    -   -
    +
    +
    + + + require.NoError(t, err)
    - + + 174 -
    -   -
    +
    +
    + + + // Run DAC node
    - + + 175 -
    -   -
    +
    +
    + + + cmd := exec.Command(
    - + + 176 -
    -   -
    +
    +
    + + + "docker", "run", "-d",
    - + + 177 -
    -   -
    +
    +
    + + + "--name", "cdk-data-availability-"+strconv.Itoa(m.i),
    - + + 178 -
    -   -
    +
    +
    + + + "-v", cfgFile+":/app/config.json",
    - + + 179 -
    -   -
    +
    +
    + + + "-v", ksFile+":"+ksFile,
    - + + 180 -
    -   -
    +
    +
    + + + "--network", "zkevm",
    - + + 181 -
    -   -
    +
    +
    + + + dacNodeContainer,
    -
    + + + 182 + + +
    + + + "/bin/sh", "-c",
    -
    -
    - - - - - - - - - - - + + + + + + - - -
    -
     
    - 884 + + 183 +
    -   - log.Debugf("sending eth transfer: %v", signedTx.Hash().String()) + + + "/app/cdk-data-availability run --cfg /app/config.json",
    - 885 + + 184 +
    -   - } + + + )
    - 886 + + 185 +
    -   - } + + + out, err := cmd.CombinedOutput()
    - 887 + 186
    + -
    + require.NoError(t, err, string(out))
    - 888 + 187
    + - func prepareLog0(t *testing.T, ctx context.Context, auth *bind.TransactOpts, client *ethclient.Client) (map[string]interface{}, error) { + log.Infof("DAC node %d started", m.i)
    - 889 + 188
    + - _, tx, sc, err := Log0.DeployLog0(auth, client) + time.Sleep(time.Second * 5)
    - 890 + 189
    + - require.NoError(t, err) + }
    - 891 + 190
    @@ -138069,117 +102937,117 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 892 + 191
    + - err = operations.WaitTxToBeMined(ctx, client, tx, operations.DefaultTimeoutTxToBeMined) + // Send txs
    - 893 + 192
    + - require.NoError(t, err) + nTxs := 10
    - 894 + 193
    + -
    + amount := big.NewInt(10000)
    - 895 + 194
    + - return map[string]interface{}{ + toAddress := common.HexToAddress("0x70997970C51812dc3A010C7d01b50e0d17dc79C8")
    - 896 + 195
    + - "sc": sc, + _, err = clientL2.BalanceAt(ctx, authL2.From, nil)
    - 897 + 196
    + - }, nil + require.NoError(t, err)
    - 898 + 197
    + - } + _, err = clientL2.PendingNonceAt(ctx, authL2.From)
    - 899 + 198
    + -
    + require.NoError(t, err)
    - 900 + 199
    + - func createLog0AllZeros(t *testing.T, ctx context.Context, auth *bind.TransactOpts, client *ethclient.Client, customData map[string]interface{}) (*ethTypes.Transaction, error) { +
    - 901 + 200
    + - scInterface := customData["sc"] + gasLimit, err := clientL2.EstimateGas(ctx, ethereum.CallMsg{From: authL2.From, To: &toAddress, Value: amount})
    - 902 + 201
    + - sc := scInterface.(*Log0.Log0) + require.NoError(t, err)
    - 903 + 202
    @@ -138189,17 +103057,17 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 904 + 203
    + - gasPrice, err := client.SuggestGasPrice(ctx) + gasPrice, err := clientL2.SuggestGasPrice(ctx)
    - 905 + 204
    @@ -138209,7 +103077,7 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 906 + 205
    @@ -138219,117 +103087,137 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 907 + 206
    + - opts := *auth + nonce, err := clientL2.PendingNonceAt(ctx, authL2.From)
    - 908 + 207
    + - opts.NoSend = true + require.NoError(t, err) +
    +
    + 208 + +
    + + +
    +
    +
    + 209 + +
    + + + txs := make([]*eTypes.Transaction, 0, nTxs)
    - 909 + 210
    + - opts.Value = big.NewInt(0).SetUint64(txValue) + for i := 0; i < nTxs; i++ {
    - 910 + 211
    + - opts.GasPrice = gasPrice + tx := eTypes.NewTransaction(nonce+uint64(i), toAddress, amount, gasLimit, gasPrice, nil)
    - 911 + 212
    + - opts.GasLimit = fixedTxGasLimit + log.Infof("generating tx %d / %d: %s", i+1, nTxs, tx.Hash().Hex())
    - 912 + 213
    + -
    + txs = append(txs, tx)
    - 913 + 214
    + - tx, err := sc.OpLog0(&opts) + }
    - 914 + 215
    + - require.NoError(t, err) +
    - 915 + 216
    + -
    + // Wait for verification
    - 916 + 217
    + - return tx, nil + _, err = operations.ApplyL2Txs(ctx, txs, authL2, clientL2, operations.VerifiedConfirmationLevel)
    - 917 + 218
    + - } + require.NoError(t, err)
    - 918 + 219
    @@ -138339,57 +103227,57 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 919 + 220
    + - func createLog0Empty(t *testing.T, ctx context.Context, auth *bind.TransactOpts, client *ethclient.Client, customData map[string]interface{}) (*ethTypes.Transaction, error) { + // Assert that he permissionless node is fully synced (through the DAC)
    - 920 + 221
    + - scInterface := customData["sc"] + time.Sleep(30 * time.Second) // Give some time for the permissionless node to get synced
    - 921 + 222
    + - sc := scInterface.(*Log0.Log0) + clientL2Permissionless, err := ethclient.Dial(operations.PermissionlessL2NetworkURL)
    - 922 + 223
    + -
    + require.NoError(t, err)
    - 923 + 224
    + - gasPrice, err := client.SuggestGasPrice(ctx) + expectedBlock, err := clientL2.BlockByNumber(ctx, nil)
    - 924 + 225
    @@ -138399,197 +103287,197 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 925 + 226
    + -
    + actualBlock, err := clientL2Permissionless.BlockByNumber(ctx, nil)
    - 926 + 227
    + - opts := *auth + require.NoError(t, err)
    - 927 + 228
    + - opts.NoSend = true + // je, err := expectedBlock.Header().MarshalJSON()
    - 928 + 229
    + - opts.Value = big.NewInt(0).SetUint64(txValue) + // require.NoError(t, err)
    - 929 + 230
    + - opts.GasPrice = gasPrice + // log.Info(string(je))
    - 930 + 231
    + - opts.GasLimit = fixedTxGasLimit + // ja, err := actualBlock.Header().MarshalJSON()
    - 931 + 232
    + -
    + // require.NoError(t, err)
    - 932 + 233
    + - tx, err := sc.OpLog00(&opts) + // log.Info(string(ja))
    - 933 + 234
    + - require.NoError(t, err) + // require.Equal(t, string(je), string(ja))
    - 934 + 235
    + -
    + require.Equal(t, expectedBlock.Root().Hex(), actualBlock.Root().Hex())
    - 935 + 236
    + - return tx, nil + }
    - 936 + 237
    + - } +
    - 937 + 238
    + -
    + type member struct {
    - 938 + 239
    + - func createLog0Short(t *testing.T, ctx context.Context, auth *bind.TransactOpts, client *ethclient.Client, customData map[string]interface{}) (*ethTypes.Transaction, error) { + addr common.Address
    - 939 + 240
    + - scInterface := customData["sc"] + pk *ecdsa.PrivateKey
    - 940 + 241
    + - sc := scInterface.(*Log0.Log0) + url string
    - 941 + 242
    + -
    + i int
    - 942 + 243
    + - gasPrice, err := client.SuggestGasPrice(ctx) + }
    - 943 + 244
    + - require.NoError(t, err) + type members []member
    - 944 + 245
    @@ -138599,57 +103487,57 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 945 + 246
    + - opts := *auth + func (s members) Len() int { return len(s) }
    - 946 + 247
    + - opts.NoSend = true + func (s members) Less(i, j int) bool {
    - 947 + 248
    + - opts.Value = big.NewInt(0).SetUint64(txValue) + return strings.ToUpper(s[i].addr.Hex()) < strings.ToUpper(s[j].addr.Hex())
    - 948 + 249
    + - opts.GasPrice = gasPrice + }
    - 949 + 250
    + - opts.GasLimit = fixedTxGasLimit + func (s members) Swap(i, j int) { s[i], s[j] = s[j], s[i] }
    - 950 + 251
    @@ -138659,275 +103547,192 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - 951 + 252
    + - tx, err := sc.OpLog01(&opts) + func createKeyStore(pk *ecdsa.PrivateKey, outputDir, password string) error {
    - 952 + 253
    + - require.NoError(t, err) + ks := keystore.NewKeyStore(outputDir+"_", keystore.StandardScryptN, keystore.StandardScryptP)
    - 953 + 254
    + -
    + _, err := ks.ImportECDSA(pk, password)
    - 954 + 255
    + - return tx, nil + if err != nil {
    - 955 + 256
    + - } -
    -
    -
    -
    -
    -
    -
    -
    - - {/home/stefan/go/src/Polygon/zkevm-node → .}/test/e2e/debug_test.go - RENAMED - -
    -
    -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    @@ -318,6 +318,9 @@
    -
    - 318 - -
    -   - {name: "memory", prepare: prepareMemory, createSignedTx: createMemorySignedTx}, + return err
    - 319 + + 257 +
    -   - {name: "bridge", prepare: prepareBridge, createSignedTx: createBridgeSignedTx}, + + + }
    - 320 + + 258 +
    -   - {name: "deploy create 0", createSignedTx: createDeployCreate0SignedTx}, -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    + + + fileNameB, err := exec.Command("ls", outputDir+"_/").CombinedOutput()
    - 321 + + 259 +
    -   -
    + + + fileName := strings.TrimSuffix(string(fileNameB), "\n")
    - 322 + + 260 +
    -   - // failed transactions + + + if err != nil {
    - 323 + + 261 +
    -   - {name: "sc deployment reverted", createSignedTx: createScDeployRevertedSignedTx}, -
    -
    -
    + + + fmt.Println(fileName)
    -
    -
    - - - - - - - - - - - - - - - - - @@ -139815,282 +104620,157 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + @@ -140115,107 +104795,157 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    + + + + + + + + + + + + + + + @@ -141212,81 +105942,6 @@

    zkEVM node vs CDK validium node

    zkevm-node version: v0.6.0

    - - - - - - - - - - - - - - - - - - - - - - - -
    -
     
    - 318 + + 262 +
    -   - {name: "memory", prepare: prepareMemory, createSignedTx: createMemorySignedTx}, + + + return err
    - 319 + + 263 +
    -   - {name: "bridge", prepare: prepareBridge, createSignedTx: createBridgeSignedTx}, + + + }
    - 320 + + 264 +
    -   - {name: "deploy create 0", createSignedTx: createDeployCreate0SignedTx}, + + + out, err := exec.Command("mv", outputDir+"_/"+fileName, outputDir).CombinedOutput()
    - 321 + 265
    + - {name: "log0 all zeros", prepare: prepareLog0, createSignedTx: createLog0AllZeros}, + if err != nil {
    - 322 + 266
    + - {name: "log0 empty", prepare: prepareLog0, createSignedTx: createLog0Empty}, + fmt.Println(string(out))
    - 323 + 267
    + - {name: "log0 short", prepare: prepareLog0, createSignedTx: createLog0Short}, + return err
    - 324 + + 268 +
    -   -
    + + + }
    - 325 + + 269 +
    -   - // failed transactions + + + return nil
    - 326 + + 270 +
    -   - {name: "sc deployment reverted", createSignedTx: createScDeployRevertedSignedTx}, + + + }
    - 113 - -
    -   - .PHONY: test-full-non-e2e -
    -
    - 114 - -
    -   - test-full-non-e2e: stop ## Runs non-e2e tests checking race conditions -
    -
    - 115 - -
    -   - $(RUNSTATEDB) -
    -
    -
    @@ -248,6 +254,17 @@
    -
    - 248 - -
    -   - docker logs $(DOCKERCOMPOSEZKPROVER) -
    -
    - 249 - -
    -   - trap '$(STOP)' EXIT; MallocNanoZone=0 go test -count=1 -failfast -race -v -p 1 -timeout 2000s ../ci/e2e-group11/... -
    -
    - 250 - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - - -
    -   -
    -
    -
    - 251 + 113
      - .PHONY: benchmark-sequencer-eth-transfers + .PHONY: test-full-non-e2e
    - 252 + 114
      - benchmark-sequencer-eth-transfers: stop + test-full-non-e2e: stop ## Runs non-e2e tests checking race conditions
    - 253 + 115
      - $(RUNL1NETWORK) + $(RUNSTATEDB)
    -
    @@ -685,10 +702,12 @@
    +
    @@ -248,6 +254,17 @@
    - 685 + 248
      - .PHONY: generate-mocks-synchronizer + docker logs $(DOCKERCOMPOSEZKPROVER)
    - 686 + 249
      - generate-mocks-synchronizer: ## Generates mocks for synchronizer , using mockery tool + trap '$(STOP)' EXIT; MallocNanoZone=0 go test -count=1 -failfast -race -v -p 1 -timeout 2000s ../ci/e2e-group11/...
    - 687 + 250
      - ## mocks for synchronizer +
    - 688 + + -
    - - - #export "GOROOT=$$(go env GOROOT)" && $$(go env GOPATH)/bin/mockery --name=EthermanInterface --dir=../synchronizer --output=../synchronizer --outpkg=synchronizer --structname=ethermanMock --filename=mock_etherman.go ${COMMON_MOCKERY_PARAMS} +
    +
    +   +
    - 689 + + -
    - - - #export "GOROOT=$$(go env GOROOT)" && $$(go env GOPATH)/bin/mockery --name=stateInterface --dir=../synchronizer --output=../synchronizer --outpkg=synchronizer --structname=StateMock --filename=mock_state.go ${COMMON_MOCKERY_PARAMS} +
    +
    +   +
    - 690 + + -
    - - - #export "GOROOT=$$(go env GOROOT)" && $$(go env GOPATH)/bin/mockery --name=ethTxManager --dir=../synchronizer --output=../synchronizer --outpkg=synchronizer --structname=ethTxManagerMock --filename=mock_ethtxmanager.go ${COMMON_MOCKERY_PARAMS} +
    +
    +   +
    - 691 + + -
    - - - #export "GOROOT=$$(go env GOROOT)" && $$(go env GOPATH)/bin/mockery --name=poolInterface --dir=../synchronizer --output=../synchronizer --outpkg=synchronizer --structname=poolMock --filename=mock_pool.go ${COMMON_MOCKERY_PARAMS} +
    +
    +   +
    +
    +
    + + +
    +   +
    +
    +
    + + +
    +   +
    +
    +
    + + +
    +   +
    +
    +
    + + +
    +   +
    +
    +
    + + +
    +   +
    - 692 + 251
      - for i in l1RollupProducerInterface l1RollupConsumerInterface worker synchronizerProcessBlockRangeInterface workersInterface L1ParallelEthermanInterface; do \ + .PHONY: benchmark-sequencer-eth-transfers
    - 693 + 252
      - camelcase=$$(echo $$i | sed 's/\([a-z0-9]\)\([A-Z]\)/\1_\2/g' | tr '[:upper:]' '[:lower:]') ; \ + benchmark-sequencer-eth-transfers: stop
    - 694 + 253
      - echo $$camelcase ; \ + $(RUNL1NETWORK)
    -
    @@ -709,7 +728,7 @@
    +
    @@ -685,10 +702,12 @@
    - 709 + 685
      - + .PHONY: generate-mocks-synchronizer
    - 710 + 686
      - + generate-mocks-synchronizer: ## Generates mocks for synchronizer , using mockery tool
    - 711 + 687
      -
    + ## mocks for synchronizer
    - 712 + 688 + +
    + - + #export "GOROOT=$$(go env GOROOT)" && $$(go env GOPATH)/bin/mockery --name=EthermanInterface --dir=../synchronizer --output=../synchronizer --outpkg=synchronizer --structname=ethermanMock --filename=mock_etherman.go ${COMMON_MOCKERY_PARAMS} +
    +
    + 689 + +
    + - + #export "GOROOT=$$(go env GOROOT)" && $$(go env GOPATH)/bin/mockery --name=stateInterface --dir=../synchronizer --output=../synchronizer --outpkg=synchronizer --structname=StateMock --filename=mock_state.go ${COMMON_MOCKERY_PARAMS} +
    +
    + 690
    - - export "GOROOT=$$(go env GOROOT)" && $$(go env GOPATH)/bin/mockery --name=Tx --srcpkg=github.com/jackc/pgx/v4 --output=../synchronizer/mocks --structname=DbTxMock --filename=mock_dbtx.go + #export "GOROOT=$$(go env GOROOT)" && $$(go env GOPATH)/bin/mockery --name=ethTxManager --dir=../synchronizer --output=../synchronizer --outpkg=synchronizer --structname=ethTxManagerMock --filename=mock_ethtxmanager.go ${COMMON_MOCKERY_PARAMS} +
    +
    + 691 + +
    + - + #export "GOROOT=$$(go env GOROOT)" && $$(go env GOPATH)/bin/mockery --name=poolInterface --dir=../synchronizer --output=../synchronizer --outpkg=synchronizer --structname=poolMock --filename=mock_pool.go ${COMMON_MOCKERY_PARAMS} +
    +
    + + +
    +   +
    +
    +
    + + +
    +   +
    - 713 + 692
      - + for i in l1RollupProducerInterface l1RollupConsumerInterface worker synchronizerProcessBlockRangeInterface workersInterface L1ParallelEthermanInterface; do \
    - 714 + 693
      - .PHONY: generate-mocks-etherman + camelcase=$$(echo $$i | sed 's/\([a-z0-9]\)\([A-Z]\)/\1_\2/g' | tr '[:upper:]' '[:lower:]') ; \
    - 715 + 694
      - generate-mocks-etherman: ## Generates mocks for etherman , using mockery tool + echo $$camelcase ; \
     
    - 728 - -
    -   - -
    -
    - 729 - -
    -   - -
    -
    - 730 - -
    -   -
    -
    -
    - 731 - -
    - + - export "GOROOT=$$(go env GOROOT)" && $$(go env GOPATH)/bin/mockery --name=Tx --srcpkg=github.com/jackc/pgx/v4 --output=../synchronizer/mocks --structname=DbTxMock --filename=mock_dbtx.go ${COMMON_MOCKERY_PARAMS} -
    -
    - 732 - -
    -   - -
    -
    - 733 - -
    -   - .PHONY: generate-mocks-etherman -
    -
    - 734 - -
    -   - generate-mocks-etherman: ## Generates mocks for etherman , using mockery tool -
    -
    -
     
    -
    741 diff --git a/l1infotree/tree.go b/l1infotree/tree.go index 5e356c164d..e0c19da6bf 100644 --- a/l1infotree/tree.go +++ b/l1infotree/tree.go @@ -84,16 +84,13 @@ func (mt *L1InfoTree) ComputeMerkleProof(gerIndex uint32, leaves [][32]byte) ([] if len(leaves)%2 == 1 { leaves = append(leaves, mt.zeroHashes[h]) } - if index%2 == 1 { //If it is odd - siblings = append(siblings, leaves[index-1]) - } else { // It is even - if len(leaves) > 1 { - if index >= uint32(len(leaves)) { - // siblings = append(siblings, mt.zeroHashes[h]) - siblings = append(siblings, leaves[index-1]) - } else { - siblings = append(siblings, leaves[index+1]) - } + if index >= uint32(len(leaves)) { + siblings = append(siblings, mt.zeroHashes[h]) + } else { + if index%2 == 1 { //If it is odd + siblings = append(siblings, leaves[index-1]) + } else { // It is even + siblings = append(siblings, leaves[index+1]) } } var ( diff --git a/sequencer/finalizer.go b/sequencer/finalizer.go index 751e71e7ab..de7f66ae32 100644 --- a/sequencer/finalizer.go +++ b/sequencer/finalizer.go @@ -222,11 +222,19 @@ func (f *finalizer) updateFlushIDs(newPendingFlushID, newStoredFlushID uint64) { func (f *finalizer) checkL1InfoTreeUpdate(ctx context.Context) { firstL1InfoRootUpdate := true + skipFirstSleep := true for { + if skipFirstSleep { + skipFirstSleep = false + } else { + time.Sleep(f.cfg.L1InfoTreeCheckInterval.Duration) + } + lastL1BlockNumber, err := f.etherman.GetLatestBlockNumber(ctx) if err != nil { log.Errorf("error getting latest L1 block number, error: %v", err) + continue } maxBlockNumber := uint64(0) @@ -246,9 +254,30 @@ func (f *finalizer) checkL1InfoTreeUpdate(ctx context.Context) { } if firstL1InfoRootUpdate || l1InfoRoot.L1InfoTreeIndex > f.lastL1InfoTree.L1InfoTreeIndex { - firstL1InfoRootUpdate = false + log.Infof("received new L1InfoRoot, l1InfoTreeIndex: %d, l1InfoTreeRoot: %s, l1Block: %d", + l1InfoRoot.L1InfoTreeIndex, l1InfoRoot.L1InfoTreeRoot, l1InfoRoot.BlockNumber) - log.Debugf("received new L1InfoRoot. L1InfoTreeIndex: %d", l1InfoRoot.L1InfoTreeIndex) + // Sanity check l1BlockState (l1InfoRoot.BlockNumber) blockhash matches blockhash on ethereum. We skip it if l1InfoRoot.BlockNumber == 0 (empty tree) + if l1InfoRoot.BlockNumber > 0 { + l1BlockState, err := f.stateIntf.GetBlockByNumber(ctx, l1InfoRoot.BlockNumber, nil) + if err != nil { + log.Errorf("error getting L1 block %d from the state, error: %v", l1InfoRoot.BlockNumber, err) + continue + } + + l1BlockEth, err := f.etherman.HeaderByNumber(ctx, new(big.Int).SetUint64(l1InfoRoot.BlockNumber)) + if err != nil { + log.Errorf("error getting L1 block %d from ethereum, error: %v", l1InfoRoot.BlockNumber, err) + continue + } + if l1BlockState.BlockHash != l1BlockEth.Hash() { + log.Warnf("skipping use of l1InfoTreeIndex %d, L1 block %d blockhash %s doesn't match blockhash on ethereum %s (L1 reorg?)", + l1InfoRoot.L1InfoTreeIndex, l1InfoRoot.BlockNumber, l1BlockState.BlockHash, l1BlockEth.Hash()) + continue + } + } + + firstL1InfoRootUpdate = false f.lastL1InfoTreeMux.Lock() f.lastL1InfoTree = l1InfoRoot @@ -261,8 +290,6 @@ func (f *finalizer) checkL1InfoTreeUpdate(ctx context.Context) { f.lastL1InfoTreeCond.L.Unlock() } } - - time.Sleep(f.cfg.L1InfoTreeCheckInterval.Duration) } } diff --git a/sequencer/interfaces.go b/sequencer/interfaces.go index 41dca25096..afe49bceb9 100644 --- a/sequencer/interfaces.go +++ b/sequencer/interfaces.go @@ -35,6 +35,7 @@ type etherman interface { TrustedSequencer() (common.Address, error) GetLatestBatchNumber() (uint64, error) GetLatestBlockNumber(ctx context.Context) (uint64, error) + HeaderByNumber(ctx context.Context, number *big.Int) (*types.Header, error) } // stateInterface gathers the methods required to interact with the state. diff --git a/sequencer/mock_etherman.go b/sequencer/mock_etherman.go index 6a2229fcfa..3169ca6f3f 100644 --- a/sequencer/mock_etherman.go +++ b/sequencer/mock_etherman.go @@ -4,10 +4,13 @@ package sequencer import ( context "context" + big "math/big" common "github.com/ethereum/go-ethereum/common" mock "github.com/stretchr/testify/mock" + + types "github.com/ethereum/go-ethereum/core/types" ) // EthermanMock is an autogenerated mock type for the etherman type @@ -71,6 +74,36 @@ func (_m *EthermanMock) GetLatestBlockNumber(ctx context.Context) (uint64, error return r0, r1 } +// HeaderByNumber provides a mock function with given fields: ctx, number +func (_m *EthermanMock) HeaderByNumber(ctx context.Context, number *big.Int) (*types.Header, error) { + ret := _m.Called(ctx, number) + + if len(ret) == 0 { + panic("no return value specified for HeaderByNumber") + } + + var r0 *types.Header + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *big.Int) (*types.Header, error)); ok { + return rf(ctx, number) + } + if rf, ok := ret.Get(0).(func(context.Context, *big.Int) *types.Header); ok { + r0 = rf(ctx, number) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*types.Header) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *big.Int) error); ok { + r1 = rf(ctx, number) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + // TrustedSequencer provides a mock function with given fields: func (_m *EthermanMock) TrustedSequencer() (common.Address, error) { ret := _m.Called() diff --git a/state/batchV2.go b/state/batchV2.go index d12ae209c7..1bfb13acbc 100644 --- a/state/batchV2.go +++ b/state/batchV2.go @@ -310,6 +310,7 @@ func (s *State) sendBatchRequestToExecutorV2(ctx context.Context, batchRequest * log.Warn(batchResponseToString) s.eventLog.LogExecutorErrorV2(ctx, batchResponse.Error, batchRequest) } else if batchResponse.ErrorRom != executor.RomError_ROM_ERROR_NO_ERROR && executor.IsROMOutOfCountersError(batchResponse.ErrorRom) { + err = executor.RomErr(batchResponse.ErrorRom) log.Warnf("executor batch %d response, ROM OOC, error: %v", newBatchNum, err) log.Warn(batchResponseToString) } else if batchResponse.ErrorRom != executor.RomError_ROM_ERROR_NO_ERROR { diff --git a/state/forkid.go b/state/forkid.go index 0db73fc996..ed035a53e1 100644 --- a/state/forkid.go +++ b/state/forkid.go @@ -17,6 +17,8 @@ const ( FORKID_ETROG = 7 // FORKID_ELDERBERRY is the fork id 8 FORKID_ELDERBERRY = 8 + // FORKID_9 is the fork id 9 + FORKID_9 = 9 ) // ForkIDInterval is a fork id interval diff --git a/state/trace.go b/state/trace.go index 9b8ec01231..0d835aa2d3 100644 --- a/state/trace.go +++ b/state/trace.go @@ -61,11 +61,22 @@ func (s *State) DebugTransaction(ctx context.Context, transactionHash common.Has } oldStateRoot = previousL2Block.Root() + count := 0 + for _, tx := range l2Block.Transactions() { + checkReceipt, err := s.GetTransactionReceipt(ctx, tx.Hash(), dbTx) + if err != nil { + return nil, err + } + if checkReceipt.TransactionIndex < receipt.TransactionIndex { + count++ + } + } + // since the executor only stores the state roots by block, we need to // execute all the txs in the block until the tx we want to trace var txsToEncode []types.Transaction var effectivePercentage []uint8 - for i := 0; i <= int(receipt.TransactionIndex); i++ { + for i := 0; i <= count; i++ { txsToEncode = append(txsToEncode, *l2Block.Transactions()[i]) effectivePercentage = append(effectivePercentage, MaxEffectivePercentage) log.Debugf("trace will reprocess tx: %v", l2Block.Transactions()[i].Hash().String()) @@ -188,41 +199,50 @@ func (s *State) DebugTransaction(ctx context.Context, transactionHash common.Has } } - // build the raw batch so we can get the index l1 info tree for the l2 block - rawBatch, err := DecodeBatchV2(batch.BatchL2Data) - if err != nil { - log.Errorf("error decoding BatchL2Data for batch %d, error: %v", batch.BatchNumber, err) - return nil, err - } + // if the l2 block number is 1, it means this is a network that started + // at least on Etrog fork, in this case the l2 block 1 will contain the + // injected tx that needs to be processed in a different way + isInjectedTx := l2Block.NumberU64() == 1 - // identify the first l1 block number so we can identify the - // current l2 block index in the block array - firstBlockNumberForBatch, err := s.GetFirstL2BlockNumberForBatchNumber(ctx, batch.BatchNumber, dbTx) - if err != nil { - log.Errorf("failed to get first l2 block number for batch %v: %v ", batch.BatchNumber, err) - return nil, err - } + var transactions, batchL2Data []byte + if isInjectedTx { + transactions = append([]byte{}, batch.BatchL2Data...) + } else { + // build the raw batch so we can get the index l1 info tree for the l2 block + rawBatch, err := DecodeBatchV2(batch.BatchL2Data) + if err != nil { + log.Errorf("error decoding BatchL2Data for batch %d, error: %v", batch.BatchNumber, err) + return nil, err + } - // computes the l2 block index - rawL2BlockIndex := l2Block.NumberU64() - firstBlockNumberForBatch - if rawL2BlockIndex > uint64(len(rawBatch.Blocks)-1) { - log.Errorf("computed rawL2BlockIndex is greater than the number of blocks we have in the batch %v: %v ", batch.BatchNumber, err) - return nil, err - } + // identify the first l1 block number so we can identify the + // current l2 block index in the block array + firstBlockNumberForBatch, err := s.GetFirstL2BlockNumberForBatchNumber(ctx, batch.BatchNumber, dbTx) + if err != nil { + log.Errorf("failed to get first l2 block number for batch %v: %v ", batch.BatchNumber, err) + return nil, err + } - // builds the ChangeL2Block transaction with the correct timestamp and IndexL1InfoTree - rawL2Block := rawBatch.Blocks[rawL2BlockIndex] - deltaTimestamp := uint32(l2Block.Time() - previousL2Block.Time()) - transactions := s.BuildChangeL2Block(deltaTimestamp, rawL2Block.IndexL1InfoTree) + // computes the l2 block index + rawL2BlockIndex := l2Block.NumberU64() - firstBlockNumberForBatch + if rawL2BlockIndex > uint64(len(rawBatch.Blocks)-1) { + log.Errorf("computed rawL2BlockIndex is greater than the number of blocks we have in the batch %v: %v ", batch.BatchNumber, err) + return nil, err + } - batchL2Data, err := EncodeTransactions(txsToEncode, effectivePercentage, forkId) - if err != nil { - log.Errorf("error encoding transaction ", err) - return nil, err - } + // builds the ChangeL2Block transaction with the correct timestamp and IndexL1InfoTree + rawL2Block := rawBatch.Blocks[rawL2BlockIndex] + deltaTimestamp := uint32(l2Block.Time() - previousL2Block.Time()) + transactions = s.BuildChangeL2Block(deltaTimestamp, rawL2Block.IndexL1InfoTree) - transactions = append(transactions, batchL2Data...) + batchL2Data, err = EncodeTransactions(txsToEncode, effectivePercentage, forkId) + if err != nil { + log.Errorf("error encoding transaction ", err) + return nil, err + } + transactions = append(transactions, batchL2Data...) + } // prepare process batch request processBatchRequestV2 := &executor.ProcessBatchRequestV2{ OldBatchNum: batch.BatchNumber - 1, @@ -242,62 +262,39 @@ func (s *State) DebugTransaction(ctx context.Context, transactionHash common.Has TimestampLimit: uint64(time.Now().Unix()), SkipFirstChangeL2Block: cFalse, SkipWriteBlockInfoRoot: cTrue, - ExecutionMode: executor.ExecutionMode0, } - // gets the L1InfoTreeData for the transactions - l1InfoTreeData, _, _, err := s.GetL1InfoTreeDataFromBatchL2Data(ctx, transactions, dbTx) - if err != nil { - return nil, err - } - - // In case we have any l1InfoTreeData, add them to the request - if len(l1InfoTreeData) > 0 { - processBatchRequestV2.L1InfoTreeData = map[uint32]*executor.L1DataV2{} - processBatchRequestV2.SkipVerifyL1InfoRoot = cTrue - for k, v := range l1InfoTreeData { - processBatchRequestV2.L1InfoTreeData[k] = &executor.L1DataV2{ - GlobalExitRoot: v.GlobalExitRoot.Bytes(), - BlockHashL1: v.BlockHashL1.Bytes(), - MinTimestamp: v.MinTimestamp, - } + if isInjectedTx { + virtualBatch, err := s.GetVirtualBatch(ctx, batch.BatchNumber, dbTx) + if err != nil { + log.Errorf("failed to load virtual batch %v", batch.BatchNumber, err) + return nil, err } - } - - // gets the L1InfoTreeData for the transactions - l1InfoTreeData, _, _, err = s.GetL1InfoTreeDataFromBatchL2Data(ctx, transactions, dbTx) - if err != nil { - return nil, err - } - - // In case we have any l1InfoTreeData, add them to the request - if len(l1InfoTreeData) > 0 { - processBatchRequestV2.L1InfoTreeData = map[uint32]*executor.L1DataV2{} - processBatchRequestV2.SkipVerifyL1InfoRoot = cTrue - for k, v := range l1InfoTreeData { - processBatchRequestV2.L1InfoTreeData[k] = &executor.L1DataV2{ - GlobalExitRoot: v.GlobalExitRoot.Bytes(), - BlockHashL1: v.BlockHashL1.Bytes(), - MinTimestamp: v.MinTimestamp, - } + l1Block, err := s.GetBlockByNumber(ctx, virtualBatch.BlockNumber, dbTx) + if err != nil { + log.Errorf("failed to load l1 block %v", virtualBatch.BlockNumber, err) + return nil, err } - } - // gets the L1InfoTreeData for the transactions - l1InfoTreeData, _, _, err = s.GetL1InfoTreeDataFromBatchL2Data(ctx, transactions, dbTx) - if err != nil { - return nil, err - } + processBatchRequestV2.ForcedBlockhashL1 = l1Block.BlockHash.Bytes() + processBatchRequestV2.SkipVerifyL1InfoRoot = 1 + } else { + // gets the L1InfoTreeData for the transactions + l1InfoTreeData, _, _, err := s.GetL1InfoTreeDataFromBatchL2Data(ctx, transactions, dbTx) + if err != nil { + return nil, err + } - // In case we have any l1InfoTreeData, add them to the request - if len(l1InfoTreeData) > 0 { - processBatchRequestV2.L1InfoTreeData = map[uint32]*executor.L1DataV2{} - processBatchRequestV2.SkipVerifyL1InfoRoot = cTrue - for k, v := range l1InfoTreeData { - processBatchRequestV2.L1InfoTreeData[k] = &executor.L1DataV2{ - GlobalExitRoot: v.GlobalExitRoot.Bytes(), - BlockHashL1: v.BlockHashL1.Bytes(), - MinTimestamp: v.MinTimestamp, + // In case we have any l1InfoTreeData, add them to the request + if len(l1InfoTreeData) > 0 { + processBatchRequestV2.L1InfoTreeData = map[uint32]*executor.L1DataV2{} + processBatchRequestV2.SkipVerifyL1InfoRoot = cTrue + for k, v := range l1InfoTreeData { + processBatchRequestV2.L1InfoTreeData[k] = &executor.L1DataV2{ + GlobalExitRoot: v.GlobalExitRoot.Bytes(), + BlockHashL1: v.BlockHashL1.Bytes(), + MinTimestamp: v.MinTimestamp, + } } } } @@ -314,15 +311,16 @@ func (s *State) DebugTransaction(ctx context.Context, transactionHash common.Has return nil, err } - // Transactions are decoded only for logging purposes - // as they are not longer needed in the convertToProcessBatchResponse function - txs, _, _, err := DecodeTxs(batchL2Data, forkId) - if err != nil && !errors.Is(err, ErrInvalidData) { - return nil, err - } - - for _, tx := range txs { - log.Debugf(tx.Hash().String()) + if !isInjectedTx { + // Transactions are decoded only for logging purposes + // as they are no longer needed in the convertToProcessBatchResponse function + txs, _, _, err := DecodeTxs(batchL2Data, forkId) + if err != nil && !errors.Is(err, ErrInvalidData) { + return nil, err + } + for _, tx := range txs { + log.Debugf(tx.Hash().String()) + } } convertedResponse, err := s.convertToProcessBatchResponseV2(processBatchResponseV2) diff --git a/state/transaction.go b/state/transaction.go index 530e498a2b..9771b91197 100644 --- a/state/transaction.go +++ b/state/transaction.go @@ -252,11 +252,9 @@ func (s *State) StoreL2Block(ctx context.Context, batchNumber uint64, l2Block *P if executor.IsInvalidL2Block(executor.RomErrorCode(txResponse.RomError)) { continue } - txResp := *txResponse transactions = append(transactions, &txResp.Tx) txsL2Hash = append(txsL2Hash, txResp.TxHashL2_V2) - storeTxEGPData := StoreTxEGPData{EGPLog: nil, EffectivePercentage: uint8(txResponse.EffectivePercentage)} if txsEGPLog != nil { storeTxEGPData.EGPLog = txsEGPLog[i] diff --git a/synchronizer/actions/forksids.go b/synchronizer/actions/forksids.go index 58b8250376..1383ef98c5 100644 --- a/synchronizer/actions/forksids.go +++ b/synchronizer/actions/forksids.go @@ -12,6 +12,8 @@ const ( ForkIDEtrog = ForkIdType(7) //nolint:gomnd // ForkIDElderberry is the forkId for Elderberry ForkIDElderberry = ForkIdType(8) //nolint:gomnd + // ForkID9 is the forkId for 9 + ForkID9 = ForkIdType(9) //nolint:gomnd ) var ( @@ -20,7 +22,7 @@ var ( ForksIdAll = []ForkIdType{WildcardForkId} // ForksIdOnlyElderberry support only elderberry forkId - ForksIdOnlyElderberry = []ForkIdType{ForkIDElderberry} + ForksIdOnlyElderberry = []ForkIdType{ForkIDElderberry, ForkID9} // ForksIdOnlyEtrog support only etrog forkId ForksIdOnlyEtrog = []ForkIdType{ForkIDEtrog} diff --git a/synchronizer/synchronizer.go b/synchronizer/synchronizer.go index e0353dbaea..2fc73808a6 100644 --- a/synchronizer/synchronizer.go +++ b/synchronizer/synchronizer.go @@ -128,6 +128,7 @@ func NewSynchronizer( res.syncTrustedStateExecutor = l2_shared.NewSyncTrustedStateExecutorSelector(map[uint64]syncinterfaces.SyncTrustedStateExecutor{ uint64(state.FORKID_ETROG): syncTrustedStateEtrog, uint64(state.FORKID_ELDERBERRY): syncTrustedStateEtrog, + uint64(state.FORKID_9): syncTrustedStateEtrog, }, res.state) } var l1checkerL2Blocks *actions.CheckL2BlockHash diff --git a/test/docker-compose.yml b/test/docker-compose.yml index 32bbb6feb6..80e25c9276 100644 --- a/test/docker-compose.yml +++ b/test/docker-compose.yml @@ -513,7 +513,7 @@ services: zkevm-prover: container_name: zkevm-prover - image: hermeznetwork/zkevm-prover:v5.0.6 + image: hermeznetwork/zkevm-prover:v6.0.0 ports: - 50061:50061 # MT - 50071:50071 # Executor @@ -604,7 +604,7 @@ services: zkevm-permissionless-prover: container_name: zkevm-permissionless-prover - image: hermeznetwork/zkevm-prover:v5.0.6 + image: hermeznetwork/zkevm-prover:v6.0.0 ports: # - 50058:50058 # Prover - 50059:50052 # Mock prover diff --git a/test/e2e/debug_test.go b/test/e2e/debug_test.go index e32802eed0..0e425b4f6e 100644 --- a/test/e2e/debug_test.go +++ b/test/e2e/debug_test.go @@ -736,6 +736,58 @@ func TestDebugTraceBlock(t *testing.T) { } } +func Test_DebugFirstBatch(t *testing.T) { + if testing.Short() { + t.Skip() + } + + const l2NetworkURL = "http://localhost:8124" + const l2ExplorerRPCComponentName = "l2-explorer-json-rpc" + + var err error + if !dockersArePreLaunchedForDebugTests { + err = operations.Teardown() + require.NoError(t, err) + + defer func() { + require.NoError(t, operations.Teardown()) + require.NoError(t, operations.StopComponent(l2ExplorerRPCComponentName)) + }() + } + + ctx := context.Background() + opsCfg := operations.GetDefaultOperationsConfig() + if !dockersArePreLaunchedForDebugTests { + opsMan, err := operations.NewManager(ctx, opsCfg) + require.NoError(t, err) + err = opsMan.Setup() + require.NoError(t, err) + + err = operations.StartComponent(l2ExplorerRPCComponentName, func() (bool, error) { return operations.NodeUpCondition(l2NetworkURL) }) + require.NoError(t, err) + } else { + log.Info("Using pre-launched dockers: no reset Database") + } + + debugOptions := map[string]interface{}{ + "tracer": "callTracer", + "tracerConfig": map[string]interface{}{ + "onlyTopCall": false, + "withLog": true, + }, + } + + response, err := client.JSONRPCCall(l2NetworkURL, "debug_traceBlockByNumber", "0x1", debugOptions) + require.NoError(t, err) + require.Nil(t, response.Error) + require.NotNil(t, response.Result) + + response, err = client.JSONRPCCall(l2NetworkURL, "debug_traceBlockByNumber", "0x1") + require.NoError(t, err) + require.Nil(t, response.Error) + require.NotNil(t, response.Result) +} + func getTxInResponseDebugTest(t *testing.T, response json.RawMessage, txIndex uint, debugPrefix string) map[string]interface{} { valueMap := []interface{}{} err := json.Unmarshal(response, &valueMap)