From 5478f0bbeace430c71f2590afd15f653a71ce495 Mon Sep 17 00:00:00 2001 From: krlosMata Date: Wed, 1 Mar 2023 23:12:56 +0100 Subject: [PATCH] constructor revert --- .../calldata/revert-constructor_0.json | 99 +++++++ inputs-executor/calldata/revert-simple_0.json | 242 ++++++++++++++++++ .../calldata/revert-constructor.json | 71 +++++ state-transition/calldata/revert-simple.json | 86 +++++++ .../evm/contracts/RevertConstructor.sol | 8 + tools-calldata/evm/contracts/RevertSimple.sol | 8 + .../gen-revert-constructor.json | 73 ++++++ .../gen-revert-simple.json | 80 ++++++ 8 files changed, 667 insertions(+) create mode 100644 inputs-executor/calldata/revert-constructor_0.json create mode 100644 inputs-executor/calldata/revert-simple_0.json create mode 100644 state-transition/calldata/revert-constructor.json create mode 100644 state-transition/calldata/revert-simple.json create mode 100644 tools-calldata/evm/contracts/RevertConstructor.sol create mode 100644 tools-calldata/evm/contracts/RevertSimple.sol create mode 100644 tools-calldata/evm/generate-test-vectors/gen-revert-constructor.json create mode 100644 tools-calldata/evm/generate-test-vectors/gen-revert-simple.json diff --git a/inputs-executor/calldata/revert-constructor_0.json b/inputs-executor/calldata/revert-constructor_0.json new file mode 100644 index 00000000000..46c303e9dd1 --- /dev/null +++ b/inputs-executor/calldata/revert-constructor_0.json @@ -0,0 +1,99 @@ +{ + "oldStateRoot": "0x4a9bfcb163ec91c5beb22e6aca41592433092c8c7821b01d37fd0de483f9265d", + "newStateRoot": "0xd6f6c9f754cf2458cec0ccffe7adf02df20b5f023a3e0477e41a687710f009c1", + "oldAccInputHash": "0x0000000000000000000000000000000000000000000000000000000000000000", + "newAccInputHash": "0xc78feb6c8a67bb6995a6f29866713d89868631b05a351712331a156d767b7b60", + "newLocalExitRoot": "0x0000000000000000000000000000000000000000000000000000000000000000", + "oldNumBatch": 0, + "newNumBatch": 1, + "chainID": 1000, + "forkID": 1, + "batchL2Data": "0xf8d480843b9aca00839896808080b8c16080604052348015600f57600080fd5b506040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016040906068565b60405180910390fd5b600060546014836086565b9150605d826097565b602082019050919050565b60006020820190508181036000830152607f816049565b9050919050565b600082825260208201905092915050565b7f546f646179206973206e6f74206a7565726e657300000000000000000000000060008201525056fe8203e88080f58a0d0e5335c20fe4f551610676f182e6e03d9177a99a35b260c60b8d4947031f0aee056fc2ded1898aae060b9ac8702b97c11811323db490251f1f88a549fa1c", + "globalExitRoot": "0x090bcaf734c4f06c93954a827b45a6e8c67b8e0fd1e0a35a1c5982d6961828f9", + "timestamp": 1944498031, + "sequencerAddr": "0x617b3a3528F9cDd6630fd3301B9c8911F7Bf063D", + "batchHashData": "0xeffd2af06c87c971c2dcb18ba2de4d39c5052ab56973320d4e706540a856682c", + "contractsBytecode": { + "0xa72217948ea7d968a64c77f83908cea136bbf964": "0xfa7dd6c9fa5837f60349993f31818bc9cc371fc70fd59d9a65fdde4733d55234", + "0x617b3a3528f9cdd6630fd3301b9c8911f7bf063d": "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x4d5cf5032b2a844602278b01199ed191a86c93ff": "0x0000000000000000000000000000000000000000000000000000000000000000" + }, + "db": { + "0x4a9bfcb163ec91c5beb22e6aca41592433092c8c7821b01d37fd0de483f9265d": [ + "0000000000000000", + "0000000000000000", + "0000000000000000", + "0000000000000000", + "9ec300ed8bd3f934", + "389b06b4dc13fc14", + "72715e7972ca0eaa", + "7782f27412c48d2c", + "0000000000000000", + "0000000000000000", + "0000000000000000", + "0000000000000000" + ], + "0x7782f27412c48d2c72715e7972ca0eaa389b06b4dc13fc149ec300ed8bd3f934": [ + "597bb4307b5e299f", + "f5029596ddb82f37", + "3daa688690ceee05", + "06b719f2bf4cb5e9", + "ebb05ed2082602b9", + "c538204eb07f3d6c", + "a5ed480ede7b8f0e", + "52621f81fded9c35", + "0000000000000000", + "0000000000000000", + "0000000000000000", + "0000000000000000" + ], + "0x06b719f2bf4cb5e93daa688690ceee05f5029596ddb82f37597bb4307b5e299f": [ + "16dde42596b907f0", + "49015d7e991a1528", + "94dd9dadd060910b", + "60b4d5e9af514018", + "494f9491c8507dc3", + "e92914c00b37a1cd", + "f6b613135380bd5f", + "b487e2e7e1d98168", + "0000000000000001", + "0000000000000000", + "0000000000000000", + "0000000000000000" + ], + "0xb487e2e7e1d98168f6b613135380bd5fe92914c00b37a1cd494f9491c8507dc3": [ + "00000000c6200000", + "00000000d78ebc5a", + "000000000000000a", + "0000000000000000", + "0000000000000000", + "0000000000000000", + "0000000000000000", + "0000000000000000" + ], + "0x52621f81fded9c35a5ed480ede7b8f0ec538204eb07f3d6cebb05ed2082602b9": [ + "66ee2be0687eea76", + "6926f8ca8796c78a", + "4c2f3e938869b82d", + "649e63bfe1247ba4", + "35f28afeae0ff489", + "b6d75a1b213c2f7c", + "521f1ce7fca92f45", + "2afffacb569cf689", + "0000000000000001", + "0000000000000000", + "0000000000000000", + "0000000000000000" + ], + "0x2afffacb569cf689521f1ce7fca92f45b6d75a1b213c2f7c35f28afeae0ff489": [ + "0000000063100000", + "000000006bc75e2d", + "0000000000000005", + "0000000000000000", + "0000000000000000", + "0000000000000000", + "0000000000000000", + "0000000000000000" + ] + } +} \ No newline at end of file diff --git a/inputs-executor/calldata/revert-simple_0.json b/inputs-executor/calldata/revert-simple_0.json new file mode 100644 index 00000000000..f8eb36f6374 --- /dev/null +++ b/inputs-executor/calldata/revert-simple_0.json @@ -0,0 +1,242 @@ +{ + "oldStateRoot": "0xc2fea87018bc90b2bc7abee92940b463528e88ef47915afc2fdf1310a4eadffe", + "newStateRoot": "0xbbb91fd87100680ef0219728b89c208695949c8e79b05af717594c1cfa73457b", + "oldAccInputHash": "0x0000000000000000000000000000000000000000000000000000000000000000", + "newAccInputHash": "0xe19e83984375e37d5b001992ea52d85eec4c71fe084ce5483e26f230b1408826", + "newLocalExitRoot": "0x0000000000000000000000000000000000000000000000000000000000000000", + "oldNumBatch": 0, + "newNumBatch": 1, + "chainID": 1000, + "forkID": 1, + "batchL2Data": "0xea80843b9aca00830186a0941275fbb540c8efc58b812ba83b0d0b8b9917ae9880844abbb40a8203e8808025a540812367c78cdeeb91eeb38536c79b4bd97b94d1f9ef4f60b37e00b4de434d842b60ab341406d472bd0351eca66b7ffa9ea6fc86fd34b605aaafe93cfc011b", + "globalExitRoot": "0x090bcaf734c4f06c93954a827b45a6e8c67b8e0fd1e0a35a1c5982d6961828f9", + "timestamp": 1944498031, + "sequencerAddr": "0x617b3a3528F9cDd6630fd3301B9c8911F7Bf063D", + "batchHashData": "0x36edc8b9409bb327056e635980a95f3a6874e9ce0f23703fa8b680947dee8dfd", + "contractsBytecode": { + "0xe1f8ee0dac21f4c2282e0b1f64eae8d9bb5522203dc020aa04e08f42cbc265fb": "0x6080604052348015600f57600080fd5b506004361060285760003560e01c80634abbb40a14602d575b600080fd5b60336035565b005b6040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401606590608d565b60405180910390fd5b6000607960148360ab565b915060828260bc565b602082019050919050565b6000602082019050818103600083015260a481606e565b9050919050565b600082825260208201905092915050565b7f546f646179206973206e6f74206a7565726e657300000000000000000000000060008201525056fea2646970667358221220291d09b121208353cf28702a3314e7ae7b990e668a206939fec5413344354cca64736f6c63430008070033", + "0x617b3a3528f9cdd6630fd3301b9c8911f7bf063d": "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x4d5cf5032b2a844602278b01199ed191a86c93ff": "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x1275fbb540c8efc58b812ba83b0d0b8b9917ae98": "0xe1f8ee0dac21f4c2282e0b1f64eae8d9bb5522203dc020aa04e08f42cbc265fb" + }, + "db": { + "0xc2fea87018bc90b2bc7abee92940b463528e88ef47915afc2fdf1310a4eadffe": [ + "300a2065f2a39e16", + "49510627efd6b597", + "4057eff3625231cd", + "42fbff0f9f3c74a5", + "10efe1569d09aa02", + "4755831ae3115be5", + "2a8964ccdcedcbac", + "70bbd8a3e3c8996e", + "0000000000000000", + "0000000000000000", + "0000000000000000", + "0000000000000000" + ], + "0x42fbff0f9f3c74a54057eff3625231cd49510627efd6b597300a2065f2a39e16": [ + "0000000000000000", + "0000000000000000", + "0000000000000000", + "0000000000000000", + "d0a402d7d8225bc0", + "76ad9c2fea8548f9", + "d7c883425ee74ec1", + "68b1ec0979d89121", + "0000000000000000", + "0000000000000000", + "0000000000000000", + "0000000000000000" + ], + "0x68b1ec0979d89121d7c883425ee74ec176ad9c2fea8548f9d0a402d7d8225bc0": [ + "1baeee07cadec004", + "99f5931a96dacdaa", + "fc3570bcf0bf7c9e", + "ca0f755a7f970e76", + "d546b011b3a3fe7c", + "530d245fb5e6fa47", + "c9448cd3b0fc02ee", + "fe1b60486d4ef353", + "0000000000000000", + "0000000000000000", + "0000000000000000", + "0000000000000000" + ], + "0xca0f755a7f970e76fc3570bcf0bf7c9e99f5931a96dacdaa1baeee07cadec004": [ + "25928440032faa48", + "7603eeedd4b5445e", + "553f6707e9e92083", + "c86ee7583a0df9c1", + "d074b8cee5dcf415", + "2346a1b4c0f390e8", + "47969c1f5a6a25b1", + "da62fdf84a21108e", + "0000000000000001", + "0000000000000000", + "0000000000000000", + "0000000000000000" + ], + "0xda62fdf84a21108e47969c1f5a6a25b12346a1b4c0f390e8d074b8cee5dcf415": [ + "0000000000000001", + "0000000000000000", + "0000000000000000", + "0000000000000000", + "0000000000000000", + "0000000000000000", + "0000000000000000", + "0000000000000000" + ], + "0xfe1b60486d4ef353c9448cd3b0fc02ee530d245fb5e6fa47d546b011b3a3fe7c": [ + "14945417c9b957d1", + "1af1a1e389f5d2bf", + "33fbf3cd8d9bb1e0", + "13060509db26d4ff", + "f9c7d661f551dc6c", + "a1c5b2d179fb0ff6", + "8f599e52072eb220", + "c55554e58809d7a9", + "0000000000000001", + "0000000000000000", + "0000000000000000", + "0000000000000000" + ], + "0xc55554e58809d7a98f599e52072eb220a1c5b2d179fb0ff6f9c7d661f551dc6c": [ + "000000000000011b", + "0000000000000000", + "0000000000000000", + "0000000000000000", + "0000000000000000", + "0000000000000000", + "0000000000000000", + "0000000000000000" + ], + "0x70bbd8a3e3c8996e2a8964ccdcedcbac4755831ae3115be510efe1569d09aa02": [ + "556265a3204292c8", + "d104b8ed12d415ab", + "e62d1a0b4cd1bdaf", + "d12514197ae408fb", + "ebb05ed2082602b9", + "c538204eb07f3d6c", + "a5ed480ede7b8f0e", + "52621f81fded9c35", + "0000000000000000", + "0000000000000000", + "0000000000000000", + "0000000000000000" + ], + "0xd12514197ae408fbe62d1a0b4cd1bdafd104b8ed12d415ab556265a3204292c8": [ + "0000000000000000", + "0000000000000000", + "0000000000000000", + "0000000000000000", + "b6fabdf5c9193d18", + "802bbf2b13910cf2", + "ab1840f2b40d4e86", + "94f23a4c87584233", + "0000000000000000", + "0000000000000000", + "0000000000000000", + "0000000000000000" + ], + "0x94f23a4c87584233ab1840f2b40d4e86802bbf2b13910cf2b6fabdf5c9193d18": [ + "b85ec568f4a3ce19", + "30e6c4b99099750a", + "ba290511a0f2ae86", + "a3bc483177cb1579", + "0000000000000000", + "0000000000000000", + "0000000000000000", + "0000000000000000", + "0000000000000000", + "0000000000000000", + "0000000000000000", + "0000000000000000" + ], + "0xa3bc483177cb1579ba290511a0f2ae8630e6c4b99099750ab85ec568f4a3ce19": [ + "356d68ec105e113b", + "b8c3ecf7ffd766d9", + "ecaae95d07bded7f", + "25ed1f939564a14f", + "db519f21ecdfd484", + "917149c9d4e5992a", + "532bd62416fc519c", + "5b0141b95c331984", + "0000000000000000", + "0000000000000000", + "0000000000000000", + "0000000000000000" + ], + "0x25ed1f939564a14fecaae95d07bded7fb8c3ecf7ffd766d9356d68ec105e113b": [ + "0b6ef212cb5c83f8", + "49015d7e991a1528", + "4a6eced6e8304885", + "305a6af4d7a8a00c", + "494f9491c8507dc3", + "e92914c00b37a1cd", + "f6b613135380bd5f", + "b487e2e7e1d98168", + "0000000000000001", + "0000000000000000", + "0000000000000000", + "0000000000000000" + ], + "0xb487e2e7e1d98168f6b613135380bd5fe92914c00b37a1cd494f9491c8507dc3": [ + "00000000c6200000", + "00000000d78ebc5a", + "000000000000000a", + "0000000000000000", + "0000000000000000", + "0000000000000000", + "0000000000000000", + "0000000000000000" + ], + "0x5b0141b95c331984532bd62416fc519c917149c9d4e5992adb519f21ecdfd484": [ + "3220d02477c5569c", + "0dfe002ac222af8c", + "6f01200bb557e8ae", + "2890f215f2c6b9f7", + "f355d2183e689261", + "386e14be09c81b52", + "793628da9cd611f3", + "cfb1e389ba04cbfd", + "0000000000000001", + "0000000000000000", + "0000000000000000", + "0000000000000000" + ], + "0xcfb1e389ba04cbfd793628da9cd611f3386e14be09c81b52f355d2183e689261": [ + "00000000cbc265fb", + "0000000004e08f42", + "000000003dc020aa", + "00000000bb552220", + "0000000064eae8d9", + "00000000282e0b1f", + "00000000ac21f4c2", + "00000000e1f8ee0d" + ], + "0x52621f81fded9c35a5ed480ede7b8f0ec538204eb07f3d6cebb05ed2082602b9": [ + "66ee2be0687eea76", + "6926f8ca8796c78a", + "4c2f3e938869b82d", + "649e63bfe1247ba4", + "35f28afeae0ff489", + "b6d75a1b213c2f7c", + "521f1ce7fca92f45", + "2afffacb569cf689", + "0000000000000001", + "0000000000000000", + "0000000000000000", + "0000000000000000" + ], + "0x2afffacb569cf689521f1ce7fca92f45b6d75a1b213c2f7c35f28afeae0ff489": [ + "0000000063100000", + "000000006bc75e2d", + "0000000000000005", + "0000000000000000", + "0000000000000000", + "0000000000000000", + "0000000000000000", + "0000000000000000" + ] + } +} \ No newline at end of file diff --git a/state-transition/calldata/revert-constructor.json b/state-transition/calldata/revert-constructor.json new file mode 100644 index 00000000000..817f2776c7d --- /dev/null +++ b/state-transition/calldata/revert-constructor.json @@ -0,0 +1,71 @@ +[ + { + "id": 0, + "description": "Deployment Test", + "arity": 4, + "chainIdSequencer": 1001, + "defaultChainId": 1000, + "sequencerAddress": "0x617b3a3528F9cDd6630fd3301B9c8911F7Bf063D", + "sequencerPvtKey": "0x28b2b0318721be8c8339199172cd7cc8f5e273800a35616ec893083a4b32c02e", + "genesis": [ + { + "address": "0x617b3a3528F9cDd6630fd3301B9c8911F7Bf063D", + "nonce": "0", + "balance": "100000000000000000000", + "pvtKey": "0x28b2b0318721be8c8339199172cd7cc8f5e273800a35616ec893083a4b32c02e" + }, + { + "address": "0x4d5Cf5032B2a844602278b01199ED191A86c93ff", + "nonce": "0", + "balance": "200000000000000000000", + "pvtKey": "0x4d27a600dce8c29b7bd080e29a26972377dbb04d7a27d919adbb602bf13cfd23" + } + ], + "expectedOldRoot": "0x4a9bfcb163ec91c5beb22e6aca41592433092c8c7821b01d37fd0de483f9265d", + "txs": [ + { + "from": "0x4d5Cf5032B2a844602278b01199ED191A86c93ff", + "to": "0x", + "nonce": "0", + "value": "0", + "data": "0x6080604052348015600f57600080fd5b506040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016040906068565b60405180910390fd5b600060546014836086565b9150605d826097565b602082019050919050565b60006020820190508181036000830152607f816049565b9050919050565b600082825260208201905092915050565b7f546f646179206973206e6f74206a7565726e657300000000000000000000000060008201525056fe", + "gasLimit": 10000000, + "gasPrice": "1000000000", + "chainId": 1000, + "deployedBytecode": "0x6080604052600080fdfea2646970667358221220a2e4dc4bccee192470b56958f3c8544f7ff0b9992d10bd0b53afa92cb80bde0064736f6c63430008070033" + } + ], + "expectedNewRoot": "0xd6f6c9f754cf2458cec0ccffe7adf02df20b5f023a3e0477e41a687710f009c1", + "expectedNewLeafs": { + "0x617b3a3528F9cDd6630fd3301B9c8911F7Bf063D": { + "balance": "100000055877000000000", + "nonce": "0", + "storage": null, + "hashBytecode": "0x0000000000000000000000000000000000000000000000000000000000000000", + "bytecodeLength": 0 + }, + "0x4d5Cf5032B2a844602278b01199ED191A86c93ff": { + "balance": "199999944123000000000", + "nonce": "1", + "storage": null, + "hashBytecode": "0x0000000000000000000000000000000000000000000000000000000000000000", + "bytecodeLength": 0 + }, + "0xA72217948Ea7D968A64c77F83908cea136bBF964": { + "balance": "0", + "nonce": "0", + "storage": null, + "hashBytecode": "0x0000000000000000000000000000000000000000000000000000000000000000", + "bytecodeLength": 0 + } + }, + "timestamp": 1944498031, + "newLocalExitRoot": "0x0000000000000000000000000000000000000000000000000000000000000000", + "batchHashData": "0xeffd2af06c87c971c2dcb18ba2de4d39c5052ab56973320d4e706540a856682c", + "globalExitRoot": "0x090bcaf734c4f06c93954a827b45a6e8c67b8e0fd1e0a35a1c5982d6961828f9", + "batchL2Data": "0xf8d480843b9aca00839896808080b8c16080604052348015600f57600080fd5b506040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016040906068565b60405180910390fd5b600060546014836086565b9150605d826097565b602082019050919050565b60006020820190508181036000830152607f816049565b9050919050565b600082825260208201905092915050565b7f546f646179206973206e6f74206a7565726e657300000000000000000000000060008201525056fe8203e88080f58a0d0e5335c20fe4f551610676f182e6e03d9177a99a35b260c60b8d4947031f0aee056fc2ded1898aae060b9ac8702b97c11811323db490251f1f88a549fa1c", + "chainID": 1000, + "oldAccInputHash": "0x0000000000000000000000000000000000000000000000000000000000000000", + "forkID": 1 + } +] \ No newline at end of file diff --git a/state-transition/calldata/revert-simple.json b/state-transition/calldata/revert-simple.json new file mode 100644 index 00000000000..9fc7564e3b5 --- /dev/null +++ b/state-transition/calldata/revert-simple.json @@ -0,0 +1,86 @@ +[ + { + "id": 0, + "description": "STOP opcode", + "arity": 4, + "chainIdSequencer": 1001, + "defaultChainId": 1000, + "sequencerAddress": "0x617b3a3528F9cDd6630fd3301B9c8911F7Bf063D", + "sequencerPvtKey": "0x28b2b0318721be8c8339199172cd7cc8f5e273800a35616ec893083a4b32c02e", + "genesis": [ + { + "address": "0x617b3a3528F9cDd6630fd3301B9c8911F7Bf063D", + "nonce": "0", + "balance": "100000000000000000000", + "pvtKey": "0x28b2b0318721be8c8339199172cd7cc8f5e273800a35616ec893083a4b32c02e" + }, + { + "address": "0x4d5Cf5032B2a844602278b01199ED191A86c93ff", + "nonce": "0", + "balance": "200000000000000000000", + "pvtKey": "0x4d27a600dce8c29b7bd080e29a26972377dbb04d7a27d919adbb602bf13cfd23" + }, + { + "address": "0x1275fbb540c8efc58b812ba83b0d0b8b9917ae98", + "nonce": 1, + "balance": 0, + "bytecode": "0x6080604052348015600f57600080fd5b506004361060285760003560e01c80634abbb40a14602d575b600080fd5b60336035565b005b6040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401606590608d565b60405180910390fd5b6000607960148360ab565b915060828260bc565b602082019050919050565b6000602082019050818103600083015260a481606e565b9050919050565b600082825260208201905092915050565b7f546f646179206973206e6f74206a7565726e657300000000000000000000000060008201525056fea2646970667358221220291d09b121208353cf28702a3314e7ae7b990e668a206939fec5413344354cca64736f6c63430008070033", + "abi": [ + { + "inputs": [], + "name": "generateError", + "outputs": [], + "stateMutability": "pure", + "type": "function" + } + ], + "storage": {} + } + ], + "expectedOldRoot": "0xc2fea87018bc90b2bc7abee92940b463528e88ef47915afc2fdf1310a4eadffe", + "txs": [ + { + "from": "0x4d5Cf5032B2a844602278b01199ED191A86c93ff", + "to": "0x1275fbb540c8efc58b812ba83b0d0b8b9917ae98", + "nonce": "0", + "value": "0", + "data": "0x4abbb40a", + "gasLimit": 100000, + "gasPrice": "1000000000", + "chainId": 1000 + } + ], + "expectedNewRoot": "0xbbb91fd87100680ef0219728b89c208695949c8e79b05af717594c1cfa73457b", + "expectedNewLeafs": { + "0x617b3a3528F9cDd6630fd3301B9c8911F7Bf063D": { + "balance": "100000021476000000000", + "nonce": "0", + "storage": null, + "hashBytecode": "0x0000000000000000000000000000000000000000000000000000000000000000", + "bytecodeLength": 0 + }, + "0x4d5Cf5032B2a844602278b01199ED191A86c93ff": { + "balance": "199999978524000000000", + "nonce": "1", + "storage": null, + "hashBytecode": "0x0000000000000000000000000000000000000000000000000000000000000000", + "bytecodeLength": 0 + }, + "0x1275fbb540c8efc58b812ba83b0d0b8b9917ae98": { + "balance": "0", + "nonce": "1", + "storage": {}, + "hashBytecode": "0xe1f8ee0dac21f4c2282e0b1f64eae8d9bb5522203dc020aa04e08f42cbc265fb", + "bytecodeLength": 283 + } + }, + "timestamp": 1944498031, + "newLocalExitRoot": "0x0000000000000000000000000000000000000000000000000000000000000000", + "batchHashData": "0x36edc8b9409bb327056e635980a95f3a6874e9ce0f23703fa8b680947dee8dfd", + "globalExitRoot": "0x090bcaf734c4f06c93954a827b45a6e8c67b8e0fd1e0a35a1c5982d6961828f9", + "batchL2Data": "0xea80843b9aca00830186a0941275fbb540c8efc58b812ba83b0d0b8b9917ae9880844abbb40a8203e8808025a540812367c78cdeeb91eeb38536c79b4bd97b94d1f9ef4f60b37e00b4de434d842b60ab341406d472bd0351eca66b7ffa9ea6fc86fd34b605aaafe93cfc011b", + "chainID": 1000, + "oldAccInputHash": "0x0000000000000000000000000000000000000000000000000000000000000000", + "forkID": 1 + } +] \ No newline at end of file diff --git a/tools-calldata/evm/contracts/RevertConstructor.sol b/tools-calldata/evm/contracts/RevertConstructor.sol new file mode 100644 index 00000000000..3e94d006b73 --- /dev/null +++ b/tools-calldata/evm/contracts/RevertConstructor.sol @@ -0,0 +1,8 @@ +// SPDX-License-Identifier: GPL-3.0 +pragma solidity 0.8.7; + +contract RevertConstructor { + constructor () { + revert("Today is not juernes"); + } +} \ No newline at end of file diff --git a/tools-calldata/evm/contracts/RevertSimple.sol b/tools-calldata/evm/contracts/RevertSimple.sol new file mode 100644 index 00000000000..7b695380f21 --- /dev/null +++ b/tools-calldata/evm/contracts/RevertSimple.sol @@ -0,0 +1,8 @@ +// SPDX-License-Identifier: GPL-3.0 +pragma solidity ^0.8.4; + +contract RevertSimple { + function generateError() public pure { + revert("Today is not juernes"); + } +} \ No newline at end of file diff --git a/tools-calldata/evm/generate-test-vectors/gen-revert-constructor.json b/tools-calldata/evm/generate-test-vectors/gen-revert-constructor.json new file mode 100644 index 00000000000..59ee1c21a12 --- /dev/null +++ b/tools-calldata/evm/generate-test-vectors/gen-revert-constructor.json @@ -0,0 +1,73 @@ +[ + { + "id": 0, + "description": "Deployment Test", + "arity": 4, + "chainIdSequencer": 1001, + "defaultChainId": 1000, + "sequencerAddress": "0x617b3a3528F9cDd6630fd3301B9c8911F7Bf063D", + "sequencerPvtKey": "0x28b2b0318721be8c8339199172cd7cc8f5e273800a35616ec893083a4b32c02e", + "genesis": { + "accounts": [ + { + "address": "0x617b3a3528F9cDd6630fd3301B9c8911F7Bf063D", + "pvtKey": "0x28b2b0318721be8c8339199172cd7cc8f5e273800a35616ec893083a4b32c02e", + "balance": "100000000000000000000", + "nonce": "0" + }, + { + "address": "0x4d5Cf5032B2a844602278b01199ED191A86c93ff", + "pvtKey": "0x4d27a600dce8c29b7bd080e29a26972377dbb04d7a27d919adbb602bf13cfd23", + "balance": "200000000000000000000", + "nonce": "0" + } + ] + }, + "expectedOldRoot": "0x4a9bfcb163ec91c5beb22e6aca41592433092c8c7821b01d37fd0de483f9265d", + "txs": [ + { + "from": "0x4d5Cf5032B2a844602278b01199ED191A86c93ff", + "to": "deploy", + "nonce": "0", + "value": "0", + "contractName": "RevertConstructor", + "params": [], + "gasLimit": 10000000, + "gasPrice": "1000000000", + "chainId": 1000 + } + ], + "expectedNewRoot": "0xd6f6c9f754cf2458cec0ccffe7adf02df20b5f023a3e0477e41a687710f009c1", + "expectedNewLeafs": { + "0x617b3a3528F9cDd6630fd3301B9c8911F7Bf063D": { + "balance": "100000055877000000000", + "nonce": "0", + "storage": null, + "hashBytecode": "0x0000000000000000000000000000000000000000000000000000000000000000", + "bytecodeLength": 0 + }, + "0x4d5Cf5032B2a844602278b01199ED191A86c93ff": { + "balance": "199999944123000000000", + "nonce": "1", + "storage": null, + "hashBytecode": "0x0000000000000000000000000000000000000000000000000000000000000000", + "bytecodeLength": 0 + }, + "0xA72217948Ea7D968A64c77F83908cea136bBF964": { + "balance": "0", + "nonce": "0", + "storage": null, + "hashBytecode": "0x0000000000000000000000000000000000000000000000000000000000000000", + "bytecodeLength": 0 + } + }, + "timestamp": 1944498031, + "newLocalExitRoot": "0x0000000000000000000000000000000000000000000000000000000000000000", + "batchHashData": "0xeffd2af06c87c971c2dcb18ba2de4d39c5052ab56973320d4e706540a856682c", + "globalExitRoot": "0x090bcaf734c4f06c93954a827b45a6e8c67b8e0fd1e0a35a1c5982d6961828f9", + "batchL2Data": "0xf8d480843b9aca00839896808080b8c16080604052348015600f57600080fd5b506040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016040906068565b60405180910390fd5b600060546014836086565b9150605d826097565b602082019050919050565b60006020820190508181036000830152607f816049565b9050919050565b600082825260208201905092915050565b7f546f646179206973206e6f74206a7565726e657300000000000000000000000060008201525056fe8203e88080f58a0d0e5335c20fe4f551610676f182e6e03d9177a99a35b260c60b8d4947031f0aee056fc2ded1898aae060b9ac8702b97c11811323db490251f1f88a549fa1c", + "chainID": 1000, + "oldAccInputHash": "0x0000000000000000000000000000000000000000000000000000000000000000", + "forkID": 1 + } +] \ No newline at end of file diff --git a/tools-calldata/evm/generate-test-vectors/gen-revert-simple.json b/tools-calldata/evm/generate-test-vectors/gen-revert-simple.json new file mode 100644 index 00000000000..6e4eebff835 --- /dev/null +++ b/tools-calldata/evm/generate-test-vectors/gen-revert-simple.json @@ -0,0 +1,80 @@ +[ + { + "id": 0, + "description": "STOP opcode", + "arity": 4, + "chainIdSequencer": 1001, + "defaultChainId": 1000, + "sequencerAddress": "0x617b3a3528F9cDd6630fd3301B9c8911F7Bf063D", + "sequencerPvtKey": "0x28b2b0318721be8c8339199172cd7cc8f5e273800a35616ec893083a4b32c02e", + "genesis": { + "accounts": [ + { + "address": "0x617b3a3528F9cDd6630fd3301B9c8911F7Bf063D", + "pvtKey": "0x28b2b0318721be8c8339199172cd7cc8f5e273800a35616ec893083a4b32c02e", + "balance": "100000000000000000000", + "nonce": "0" + }, + { + "address": "0x4d5Cf5032B2a844602278b01199ED191A86c93ff", + "pvtKey": "0x4d27a600dce8c29b7bd080e29a26972377dbb04d7a27d919adbb602bf13cfd23", + "balance": "200000000000000000000", + "nonce": "0" + } + ], + "contracts": [ + { + "contractName": "RevertSimple", + "paramsDeploy": {} + } + ] + }, + "expectedOldRoot": "0xc2fea87018bc90b2bc7abee92940b463528e88ef47915afc2fdf1310a4eadffe", + "txs": [ + { + "from": "0x4d5Cf5032B2a844602278b01199ED191A86c93ff", + "to": "contract", + "nonce": "0", + "value": "0", + "contractName": "RevertSimple", + "function": "generateError", + "params": [], + "gasLimit": 100000, + "gasPrice": "1000000000", + "chainId": 1000 + } + ], + "expectedNewRoot": "0xbbb91fd87100680ef0219728b89c208695949c8e79b05af717594c1cfa73457b", + "expectedNewLeafs": { + "0x617b3a3528F9cDd6630fd3301B9c8911F7Bf063D": { + "balance": "100000021476000000000", + "nonce": "0", + "storage": null, + "hashBytecode": "0x0000000000000000000000000000000000000000000000000000000000000000", + "bytecodeLength": 0 + }, + "0x4d5Cf5032B2a844602278b01199ED191A86c93ff": { + "balance": "199999978524000000000", + "nonce": "1", + "storage": null, + "hashBytecode": "0x0000000000000000000000000000000000000000000000000000000000000000", + "bytecodeLength": 0 + }, + "0x1275fbb540c8efc58b812ba83b0d0b8b9917ae98": { + "balance": "0", + "nonce": "1", + "storage": {}, + "hashBytecode": "0xe1f8ee0dac21f4c2282e0b1f64eae8d9bb5522203dc020aa04e08f42cbc265fb", + "bytecodeLength": 283 + } + }, + "timestamp": 1944498031, + "newLocalExitRoot": "0x0000000000000000000000000000000000000000000000000000000000000000", + "batchHashData": "0x36edc8b9409bb327056e635980a95f3a6874e9ce0f23703fa8b680947dee8dfd", + "globalExitRoot": "0x090bcaf734c4f06c93954a827b45a6e8c67b8e0fd1e0a35a1c5982d6961828f9", + "batchL2Data": "0xea80843b9aca00830186a0941275fbb540c8efc58b812ba83b0d0b8b9917ae9880844abbb40a8203e8808025a540812367c78cdeeb91eeb38536c79b4bd97b94d1f9ef4f60b37e00b4de434d842b60ab341406d472bd0351eca66b7ffa9ea6fc86fd34b605aaafe93cfc011b", + "chainID": 1000, + "oldAccInputHash": "0x0000000000000000000000000000000000000000000000000000000000000000", + "forkID": 1 + } +] \ No newline at end of file