From 4810934d9069332a9c7cd9d84ba10d17b3fc2626 Mon Sep 17 00:00:00 2001 From: Laia Soler Date: Fri, 2 Aug 2024 12:13:27 +0200 Subject: [PATCH 1/2] update fork-12 --- .../block-info/block-info-batches.json | 6 ++-- .../test-vectors/block-info/block-info.json | 2 +- .../end-to-end/state-transition-e2e.json | 2 +- .../inputs-executor/input_executor.json | 2 +- .../processor/state-transition-etrog.json | 8 ++--- .../processor/state-transition.json | 30 +++++++++---------- .../selfdestruct/selfdestruct.json | 2 +- .../test-vectors/zkevm-db/recursive.json | 2 +- .../zkevm-db/state-transition.json | 2 +- test/zkevm-db.test.js | 2 +- 10 files changed, 29 insertions(+), 29 deletions(-) diff --git a/test/helpers/test-vectors/block-info/block-info-batches.json b/test/helpers/test-vectors/block-info/block-info-batches.json index c875e40a..d54bd1c6 100644 --- a/test/helpers/test-vectors/block-info/block-info-batches.json +++ b/test/helpers/test-vectors/block-info/block-info-batches.json @@ -3,7 +3,7 @@ "id": 0, "description": "Get timestamp", "chainID": 1000, - "forkID": 9, + "forkID": 12, "sequencerAddress": "0x617b3a3528F9cDd6630fd3301B9c8911F7Bf063D", "sequencerPvtKey": "0x28b2b0318721be8c8339199172cd7cc8f5e273800a35616ec893083a4b32c02e", "genesis": [ @@ -536,7 +536,7 @@ "id": 1, "description": "Verify skip flags", "chainID": 1000, - "forkID": 9, + "forkID": 12, "sequencerAddress": "0x617b3a3528F9cDd6630fd3301B9c8911F7Bf063D", "sequencerPvtKey": "0x28b2b0318721be8c8339199172cd7cc8f5e273800a35616ec893083a4b32c02e", "genesis": [ @@ -828,7 +828,7 @@ "id": 2, "description": "Previous batch partition in just one batch", "chainID": 1000, - "forkID": 9, + "forkID": 12, "sequencerAddress": "0x617b3a3528F9cDd6630fd3301B9c8911F7Bf063D", "sequencerPvtKey": "0x28b2b0318721be8c8339199172cd7cc8f5e273800a35616ec893083a4b32c02e", "genesis": [ diff --git a/test/helpers/test-vectors/block-info/block-info.json b/test/helpers/test-vectors/block-info/block-info.json index 81fb4fd1..ea6cf6c3 100644 --- a/test/helpers/test-vectors/block-info/block-info.json +++ b/test/helpers/test-vectors/block-info/block-info.json @@ -3,7 +3,7 @@ "id": 0, "description": "Get timestamp", "chainID": 1000, - "forkID": 9, + "forkID": 12, "sequencerAddress": "0x617b3a3528F9cDd6630fd3301B9c8911F7Bf063D", "sequencerPvtKey": "0x28b2b0318721be8c8339199172cd7cc8f5e273800a35616ec893083a4b32c02e", "genesis": [ diff --git a/test/helpers/test-vectors/end-to-end/state-transition-e2e.json b/test/helpers/test-vectors/end-to-end/state-transition-e2e.json index 27e8b2fe..b4c74206 100644 --- a/test/helpers/test-vectors/end-to-end/state-transition-e2e.json +++ b/test/helpers/test-vectors/end-to-end/state-transition-e2e.json @@ -4,7 +4,7 @@ "description": "Test end to end", "bridgeDeployed": true, "chainID": 1000, - "forkID": 9, + "forkID": 12, "sequencerAddress": "0x617b3a3528F9cDd6630fd3301B9c8911F7Bf063D", "sequencerPvtKey": "0x28b2b0318721be8c8339199172cd7cc8f5e273800a35616ec893083a4b32c02e", "genesis": [ diff --git a/test/helpers/test-vectors/inputs-executor/input_executor.json b/test/helpers/test-vectors/inputs-executor/input_executor.json index 1dad5ddc..68be7920 100644 --- a/test/helpers/test-vectors/inputs-executor/input_executor.json +++ b/test/helpers/test-vectors/inputs-executor/input_executor.json @@ -7,7 +7,7 @@ "oldNumBatch": 0, "newNumBatch": 1, "chainID": 1000, - "forkID": 9, + "forkID": 12, "forcedBlockHashL1": "0x0000000000000000000000000000000000000000000000000000000000000000", "batchL2Data": "0x0b73e6af6e00000001ee80843b9aca00830186a0944d5cf5032b2a844602278b01199ed191a86c93ff88016345785d8a0000808203e880801cee7e01dc62f69a12c3510c6d64de04ee6346d84b6a017f3e786c7d87f963e75d8cc91fa983cd6d9cf55fff80d73bd26cd333b0f098acc1e58edb1fd484ad731bff0b0000000100000002", "l1InfoRoot": "0x462ed3d694d640f04f637e5e3893e8d12f407a53f50201401fd992bb5ab0faf0", diff --git a/test/helpers/test-vectors/processor/state-transition-etrog.json b/test/helpers/test-vectors/processor/state-transition-etrog.json index cf43bd87..d8b00f37 100644 --- a/test/helpers/test-vectors/processor/state-transition-etrog.json +++ b/test/helpers/test-vectors/processor/state-transition-etrog.json @@ -3,7 +3,7 @@ "id": 0, "description": "2 accounts and 1 valid transaction.", "chainID": 1000, - "forkID": 9, + "forkID": 12, "sequencerAddress": "0x617b3a3528F9cDd6630fd3301B9c8911F7Bf063D", "timestampLimit": 1944498031, "forcedBlockHashL1": "0x0000000000000000000000000000000000000000000000000000000000000000", @@ -181,7 +181,7 @@ "id": 1, "description": "Forced batch: 2 accounts and 1 valid transaction", "chainID": 1000, - "forkID": 9, + "forkID": 12, "sequencerAddress": "0x617b3a3528F9cDd6630fd3301B9c8911F7Bf063D", "timestampLimit": 1944498031, "forcedBlockHashL1": "0xd4e56740f876aef8c010b86a40d5f56745a118d0906a34e69aec8c0db1cb8fa3", @@ -265,7 +265,7 @@ "id": 2, "description": "Forced batch: starts with changeL2Block --> invalid batch", "chainID": 1000, - "forkID": 9, + "forkID": 12, "sequencerAddress": "0x617b3a3528F9cDd6630fd3301B9c8911F7Bf063D", "timestampLimit": 1944498031, "forcedBlockHashL1": "0xd4e56740f876aef8c010b86a40d5f56745a118d0906a34e69aec8c0db1cb8fa3", @@ -416,7 +416,7 @@ "id": 3, "description": "invalid l1 info tree index", "chainID": 1000, - "forkID": 9, + "forkID": 12, "sequencerAddress": "0x617b3a3528F9cDd6630fd3301B9c8911F7Bf063D", "timestampLimit": 1944498031, "forcedBlockHashL1": "0x0000000000000000000000000000000000000000000000000000000000000000", diff --git a/test/helpers/test-vectors/processor/state-transition.json b/test/helpers/test-vectors/processor/state-transition.json index 5bbb32c8..f4e9a7ad 100644 --- a/test/helpers/test-vectors/processor/state-transition.json +++ b/test/helpers/test-vectors/processor/state-transition.json @@ -3,7 +3,7 @@ "id": 0, "description": "2 accounts and 1 valid transaction.", "chainID": 1000, - "forkID": 9, + "forkID": 12, "sequencerAddress": "0x617b3a3528F9cDd6630fd3301B9c8911F7Bf063D", "timestampLimit": 1944498031, "genesis": [ @@ -89,7 +89,7 @@ "id": 1, "description": "5 accounts. 2 valid tx, 3 invalid tx (same amount as balance, invalid nonce, invalid chain id 1)", "chainID": 1000, - "forkID": 9, + "forkID": 12, "sequencerAddress": "0x617b3a3528F9cDd6630fd3301B9c8911F7Bf063D", "genesis": [ { @@ -266,7 +266,7 @@ "id": 2, "description": "2 accounts and 1 invalid tx (tx with more value than balance). Old root equals new root.", "chainID": 1000, - "forkID": 9, + "forkID": 12, "sequencerAddress": "0x617b3a3528F9cDd6630fd3301B9c8911F7Bf063D", "genesis": [ { @@ -348,7 +348,7 @@ "id": 3, "description": "2 accounts and 4 invalid transactions. Two of the transactions have invalid from and to address so no rawTx is provided for them, can be ignored.Tx with same amount than balance and tx with invalid chain id (different chain id than sequencer). Old root equals new root", "chainID": 1000, - "forkID": 9, + "forkID": 12, "sequencerAddress": "0x617b3a3528F9cDd6630fd3301B9c8911F7Bf063D", "genesis": [ { @@ -465,7 +465,7 @@ "id": 4, "description": "2 accounts and 1 invalid transaction. Wrong encode of the tx (invalid signature). Old root equals new root", "chainID": 1000, - "forkID": 9, + "forkID": 12, "sequencerAddress": "0x617b3a3528F9cDd6630fd3301B9c8911F7Bf063D", "genesis": [ { @@ -536,7 +536,7 @@ "id": 5, "description": "2 accounts and 1 valid transaction, from and to are the same", "chainID": 1000, - "forkID": 9, + "forkID": 12, "sequencerAddress": "0x4d5Cf5032B2a844602278b01199ED191A86c93ff", "genesis": [ { @@ -622,7 +622,7 @@ "id": 6, "description": "2 accounts. 1 valid tx, 3 invalid tx (same amount as balance, invalid nonce, invalid chain id", "chainID": 1000, - "forkID": 9, + "forkID": 12, "sequencerAddress": "0x4d5Cf5032B2a844602278b01199ED191A86c93ff", "genesis": [ { @@ -747,7 +747,7 @@ "id": 7, "description": "2 accounts and 1 valid transaction, from, to and sequencer are the same", "chainID": 1000, - "forkID": 9, + "forkID": 12, "sequencerAddress": "0x617b3a3528F9cDd6630fd3301B9c8911F7Bf063D", "genesis": [ { @@ -833,7 +833,7 @@ "id": 8, "description": "2 accounts and 2 valid transaction, sequencer is able to do the transaction because the fees are payed at the end of every tx", "chainID": 1000, - "forkID": 9, + "forkID": 12, "sequencerAddress": "0x617b3a3528F9cDd6630fd3301B9c8911F7Bf063D", "genesis": [ { @@ -932,7 +932,7 @@ "id": 9, "description": "2 accounts and 4 valid transaction, 4 transactions from the same account", "chainID": 1000, - "forkID": 9, + "forkID": 12, "sequencerAddress": "0x4d5Cf5032B2a844602278b01199ED191A86c93ff", "genesis": [ { @@ -1057,7 +1057,7 @@ "id": 10, "description": "2 accounts + 1 contract + and 2 valid transaction.", "chainID": 1000, - "forkID": 9, + "forkID": 12, "sequencerAddress": "0x617b3a3528F9cDd6630fd3301B9c8911F7Bf063D", "sequencerPvtKey": "0x28b2b0318721be8c8339199172cd7cc8f5e273800a35616ec893083a4b32c02e", "genesis": [ @@ -1184,7 +1184,7 @@ "id": 11, "description": "2 accounts + 2 contract + and 1 tx to contract + contract call ", "chainID": 1000, - "forkID": 9, + "forkID": 12, "sequencerAddress": "0x617b3a3528F9cDd6630fd3301B9c8911F7Bf063D", "sequencerPvtKey": "0x28b2b0318721be8c8339199172cd7cc8f5e273800a35616ec893083a4b32c02e", "genesis": [ @@ -1306,7 +1306,7 @@ "id": 12, "description": "2 accounts + 2 contract with constructor + and 1 tx to contract + 1 contract call", "chainID": 1000, - "forkID": 9, + "forkID": 12, "sequencerAddress": "0x617b3a3528F9cDd6630fd3301B9c8911F7Bf063D", "sequencerPvtKey": "0x28b2b0318721be8c8339199172cd7cc8f5e273800a35616ec893083a4b32c02e", "genesis": [ @@ -1439,7 +1439,7 @@ "id": 13, "description": "2 accounts + and 1 tx to contract deploy + 1 call to deplyed contract", "chainID": 1000, - "forkID": 9, + "forkID": 12, "sequencerAddress": "0x617b3a3528F9cDd6630fd3301B9c8911F7Bf063D", "sequencerPvtKey": "0x28b2b0318721be8c8339199172cd7cc8f5e273800a35616ec893083a4b32c02e", "genesis": [ @@ -1572,7 +1572,7 @@ "id": 14, "description": "2 accounts and 3 valid transactions", "chainID": 1000, - "forkID": 9, + "forkID": 12, "sequencerAddress": "0x617b3a3528F9cDd6630fd3301B9c8911F7Bf063D", "timestampLimit": 1944498031, "genesis": [ diff --git a/test/helpers/test-vectors/selfdestruct/selfdestruct.json b/test/helpers/test-vectors/selfdestruct/selfdestruct.json index 1b2b00c4..e806fbce 100644 --- a/test/helpers/test-vectors/selfdestruct/selfdestruct.json +++ b/test/helpers/test-vectors/selfdestruct/selfdestruct.json @@ -3,7 +3,7 @@ "id": 0, "description": "Selfdestruct", "chainID": 1000, - "forkID": 9, + "forkID": 12, "sequencerAddress": "0x617b3a3528F9cDd6630fd3301B9c8911F7Bf063D", "sequencerPvtKey": "0x28b2b0318721be8c8339199172cd7cc8f5e273800a35616ec893083a4b32c02e", "genesis": [ diff --git a/test/helpers/test-vectors/zkevm-db/recursive.json b/test/helpers/test-vectors/zkevm-db/recursive.json index f85b9f65..f3023d14 100644 --- a/test/helpers/test-vectors/zkevm-db/recursive.json +++ b/test/helpers/test-vectors/zkevm-db/recursive.json @@ -3,7 +3,7 @@ "id": 0, "description": "2 accounts and 1 valid transaction.", "chainID": 1000, - "forkID": 9, + "forkID": 12, "sequencerAddress": "0x617b3a3528F9cDd6630fd3301B9c8911F7Bf063D", "l1InfoRoot": "0x090bcaf734c4f06c93954a827b45a6e8c67b8e0fd1e0a35a1c5982d6961828f9", "oldAccInputHash": "0x0000000000000000000000000000000000000000000000000000000000000000", diff --git a/test/helpers/test-vectors/zkevm-db/state-transition.json b/test/helpers/test-vectors/zkevm-db/state-transition.json index 95f30c46..52ee10e8 100644 --- a/test/helpers/test-vectors/zkevm-db/state-transition.json +++ b/test/helpers/test-vectors/zkevm-db/state-transition.json @@ -3,7 +3,7 @@ "id": 0, "description": "2 accounts and 1 valid transaction.", "chainID": 1000, - "forkID": 9, + "forkID": 12, "sequencerAddress": "0x617b3a3528F9cDd6630fd3301B9c8911F7Bf063D", "genesis": [ { diff --git a/test/zkevm-db.test.js b/test/zkevm-db.test.js index 9427d048..08b1af51 100644 --- a/test/zkevm-db.test.js +++ b/test/zkevm-db.test.js @@ -46,7 +46,7 @@ describe('ZkEVMDB', function () { const genesis = []; const db = new MemDB(F); const chainID = 1000; - const forkID = 9; + const forkID = 12; // create a zkEVMDB and build a batch const zkEVMDB = await ZkEVMDB.newZkEVM( From 31a4957ee9dce61ed226a87b32ad01b2cfa0793e Mon Sep 17 00:00:00 2001 From: Laia Soler Date: Fri, 2 Aug 2024 12:29:54 +0200 Subject: [PATCH 2/2] update testing fork.12 --- package.json | 2 +- test/contract-utils.test.js | 2 +- test/helpers/test-vectors/zkevm-db/recursive.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 1e022646..fdf8a730 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,7 @@ "test:selfdestruct": "npx mocha ./test/processor.test.js --selfdestruct", "eslint": "npx eslint src/** test/*.test.js && npx eslint tools", "eslint:fix": "npx eslint src/** test/*.test.js --fix && npx eslint tools --fix", - "test:update": "./tools/update-tests/update-tests.sh", + "test:update": "cd test && npx hardhat compile && cd .. && ./tools/update-tests/update-tests.sh", "test:database": "npx mocha ./test/database.test.js", "build:inputs": "npx mocha ./test/processor.test.js --update --geninputs && npx mocha ./test/processor.test.js --etrog --update --geninputs" }, diff --git a/test/contract-utils.test.js b/test/contract-utils.test.js index 79ff370a..703058a3 100644 --- a/test/contract-utils.test.js +++ b/test/contract-utils.test.js @@ -13,7 +13,7 @@ describe('contractUtils', function () { const expectedBatchHashData = '0x5e7875ab198c4d93379c92990a5d0111af59a0e62b2c4a0e3898e5bd24a18e58'; // TODO: input taken from pil-stark const expectedStarkHashExecutor = '0xcfae2cfa3b8f3f12abce1bccd90e9b203dfdbe56c0c412114f2d3e67c9a897db'; - const expectedSnarkInputHash = '14744991293971375789164639158836701110243288198095088376701471320299286035170'; + const expectedSnarkInputHash = '19704504443275424030853930423657339055467823429269903357094355701515609372092'; before(async () => { testVector = JSON.parse(fs.readFileSync(path.join(pathTestVectors, 'inputs-executor/input_executor.json'))); diff --git a/test/helpers/test-vectors/zkevm-db/recursive.json b/test/helpers/test-vectors/zkevm-db/recursive.json index f3023d14..e60e3215 100644 --- a/test/helpers/test-vectors/zkevm-db/recursive.json +++ b/test/helpers/test-vectors/zkevm-db/recursive.json @@ -214,6 +214,6 @@ "finalLocalExitRoot": "0x0000000000000000000000000000000000000000000000000000000000000000", "finalAccInputHash": "0xe2d4571827432a99c09609d8f95dc8b207bfd6010b08e22462cf717597f788ff", "finalNumBatch": 2, - "inputSnark": "0x0d0c2dbe320dac28e92bc27bff78a5dc2a6e77a97ddbb3d6e6818a49c4fb3f64" + "inputSnark": "0x1d2f2dc2f3a9b2a6957bcd5c5bc7c18c5410ed74a3b0621dab79f61697346246" } ] \ No newline at end of file