From 0eedc071e7036c95163b8d34e314bf8e4cdd0a64 Mon Sep 17 00:00:00 2001 From: Zach Kolodny Date: Tue, 7 May 2024 14:06:27 -0400 Subject: [PATCH 1/3] chore(contracts): remove usage of ergs --- l2-contracts/src/upgrade-bridge-impl.ts | 2 +- system-contracts/contracts/Constants.sol | 2 +- system-contracts/contracts/GasBoundCaller.sol | 4 ++-- .../contracts/test-contracts/GasBoundCallerTester.sol | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/l2-contracts/src/upgrade-bridge-impl.ts b/l2-contracts/src/upgrade-bridge-impl.ts index 99c7475c7..af21fbac0 100644 --- a/l2-contracts/src/upgrade-bridge-impl.ts +++ b/l2-contracts/src/upgrade-bridge-impl.ts @@ -352,7 +352,7 @@ async function main() { REQUIRED_L1_TO_L2_GAS_PER_PUBDATA_LIMIT ); - console.log(`Base cost for priority tx with max ergs: ${ethers.utils.formatEther(neededValue)} ETH`); + console.log(`Base cost for priority tx with max gas: ${ethers.utils.formatEther(neededValue)} ETH`); }); await program.parseAsync(process.argv); diff --git a/system-contracts/contracts/Constants.sol b/system-contracts/contracts/Constants.sol index 0f8e2307f..fde7a5de5 100644 --- a/system-contracts/contracts/Constants.sol +++ b/system-contracts/contracts/Constants.sol @@ -35,7 +35,7 @@ address constant ECMUL_SYSTEM_CONTRACT = address(0x07); address constant ECPAIRING_SYSTEM_CONTRACT = address(0x08); -/// @dev The number of ergs that need to be spent for a single byte of pubdata regardless of the pubdata price. +/// @dev The number of gas that need to be spent for a single byte of pubdata regardless of the pubdata price. /// This variable is used to ensure the following: /// - That the long-term storage of the operator is compensated properly. /// - That it is not possible that the pubdata counter grows too high without spending proportional amount of computation. diff --git a/system-contracts/contracts/GasBoundCaller.sol b/system-contracts/contracts/GasBoundCaller.sol index d45f64163..67a43883e 100644 --- a/system-contracts/contracts/GasBoundCaller.sol +++ b/system-contracts/contracts/GasBoundCaller.sol @@ -13,10 +13,10 @@ import {REAL_SYSTEM_CONTEXT_CONTRACT} from "./Constants.sol"; * system contracts have and it can relay call to any contract, breaking potential trust in system contracts. */ contract GasBoundCaller { - /// @notice We assume that no more than `CALL_ENTRY_OVERHEAD` ergs are used for the O(1) operations at the start + /// @notice We assume that no more than `CALL_ENTRY_OVERHEAD` gas are used for the O(1) operations at the start /// of execution of the contract, such as abi decoding the parameters, jumping to the correct function, etc. uint256 constant CALL_ENTRY_OVERHEAD = 800; - /// @notice We assume that no more than `CALL_RETURN_OVERHEAD` ergs are used for the O(1) operations at the end of the execution, + /// @notice We assume that no more than `CALL_RETURN_OVERHEAD` gas are used for the O(1) operations at the end of the execution, /// as such relaying the return. uint256 constant CALL_RETURN_OVERHEAD = 200; diff --git a/system-contracts/contracts/test-contracts/GasBoundCallerTester.sol b/system-contracts/contracts/test-contracts/GasBoundCallerTester.sol index 351a55f46..8a86c2e39 100644 --- a/system-contracts/contracts/test-contracts/GasBoundCallerTester.sol +++ b/system-contracts/contracts/test-contracts/GasBoundCallerTester.sol @@ -50,8 +50,8 @@ contract GasBoundCallerTester is GasBoundCaller { lastRecordedGasLeft = gasbefore - gasleft(); } - function spender(uint32 _ergsToBurn, uint32 _pubdataToUse) external { - SystemContractHelper.burnGas(_ergsToBurn, _pubdataToUse); + function spender(uint32 _gasToBurn, uint32 _pubdataToUse) external { + SystemContractHelper.burnGas(_gasToBurn, _pubdataToUse); } function gasBoundCallRelayer( From 15217773cc680b1095cab8a1d57020c8a7819785 Mon Sep 17 00:00:00 2001 From: Zach Kolodny Date: Tue, 7 May 2024 14:15:26 -0400 Subject: [PATCH 2/3] update contract hashes --- system-contracts/SystemContractsHashes.json | 54 ++++++++++----------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/system-contracts/SystemContractsHashes.json b/system-contracts/SystemContractsHashes.json index eeb4a80f3..79fba0a88 100644 --- a/system-contracts/SystemContractsHashes.json +++ b/system-contracts/SystemContractsHashes.json @@ -3,49 +3,49 @@ "contractName": "AccountCodeStorage", "bytecodePath": "artifacts-zk/contracts-preprocessed/AccountCodeStorage.sol/AccountCodeStorage.json", "sourceCodePath": "contracts-preprocessed/AccountCodeStorage.sol", - "bytecodeHash": "0x0100007549287362e4263ea5b204f01fc3c7f2ac09d71e6eb21029698220f01a", + "bytecodeHash": "0x01000075076d9e9ca73d51f8ef0af1bb2e7f74fd8377876ab6bc470a2900a4bf", "sourceCodeHash": "0xfbf66e830201c4b7fda14f0ddf28a53beb7fbb48a8406392bcfd0ef7ea9265c8" }, { "contractName": "BootloaderUtilities", "bytecodePath": "artifacts-zk/contracts-preprocessed/BootloaderUtilities.sol/BootloaderUtilities.json", "sourceCodePath": "contracts-preprocessed/BootloaderUtilities.sol", - "bytecodeHash": "0x010007d1e53f2dca05f7e27ae5b7062291ed3a1470ca511140b8e786aae7eb77", + "bytecodeHash": "0x010007d1e60e441b0b776e8f6b1c8a9e0fdd787a944a9d851cd093a3b65b3daa", "sourceCodeHash": "0x9ff5a2da00acfa145ee4575381ad386587d96b6a0309d05015974f4726881132" }, { "contractName": "ComplexUpgrader", "bytecodePath": "artifacts-zk/contracts-preprocessed/ComplexUpgrader.sol/ComplexUpgrader.json", "sourceCodePath": "contracts-preprocessed/ComplexUpgrader.sol", - "bytecodeHash": "0x01000055c1f27b8316ba61bf07959b11cf3b2a418aa357ccc5531c0914a2da27", + "bytecodeHash": "0x0100005576cef4b90577db7ca2e5cc02340a0b56ee9473b34756502963551a97", "sourceCodeHash": "0x0aa5d7ed159e783acde47856b13801b7f2268ba39b2fa50807fe3d705c506e96" }, { "contractName": "Compressor", "bytecodePath": "artifacts-zk/contracts-preprocessed/Compressor.sol/Compressor.json", "sourceCodePath": "contracts-preprocessed/Compressor.sol", - "bytecodeHash": "0x01000179842b5aa1c76036f5b90652fe614dacb28438a89649d6ca48131bd402", + "bytecodeHash": "0x0100017924bee877f2ab925cfb1c161ef3c19a8a3034da5d4fd76d0c377a3749", "sourceCodeHash": "0xd43ac120a50398e0d6bdcfcf807154bfeece0c231509a0eb2e00bcad744e60cd" }, { "contractName": "ContractDeployer", "bytecodePath": "artifacts-zk/contracts-preprocessed/ContractDeployer.sol/ContractDeployer.json", "sourceCodePath": "contracts-preprocessed/ContractDeployer.sol", - "bytecodeHash": "0x010005215fda00bfbf95847a13078bd16cdcb1b875534261c1dda9940c7754fe", + "bytecodeHash": "0x010005217819daf0124b7ccb96aca43053d0d13c0c8ad8ae7568d811eecbc3bf", "sourceCodeHash": "0x635301b824f927b4d17b3d9974cf6abbf979dda49e610805637db7c677d5f522" }, { "contractName": "Create2Factory", "bytecodePath": "artifacts-zk/contracts-preprocessed/Create2Factory.sol/Create2Factory.json", "sourceCodePath": "contracts-preprocessed/Create2Factory.sol", - "bytecodeHash": "0x0100004bc85f45ebf0f0bf004752bcbff1bb99792d6cc6494227970ec77fe53b", + "bytecodeHash": "0x0100004b3ac74b1706466d4b2f2b401addad6f17fabb7c8b979cea2fe700cbaf", "sourceCodeHash": "0x217e65f55c8add77982171da65e0db8cc10141ba75159af582973b332a4e098a" }, { "contractName": "DefaultAccount", "bytecodePath": "artifacts-zk/contracts-preprocessed/DefaultAccount.sol/DefaultAccount.json", "sourceCodePath": "contracts-preprocessed/DefaultAccount.sol", - "bytecodeHash": "0x01000563374c277a2c1e34659a2a1e87371bb6d852ce142022d497bfb50b9e32", + "bytecodeHash": "0x01000563e438856e95e453dd4380fbcbb2d8657320ebe7b067f88d7e7898d6bb", "sourceCodeHash": "0xa42423712ddaa8f357d26e46825fda80a9a870d0ac7ff52c98884355f1173ec7" }, { @@ -59,63 +59,63 @@ "contractName": "GasBoundCaller", "bytecodePath": "artifacts-zk/contracts-preprocessed/GasBoundCaller.sol/GasBoundCaller.json", "sourceCodePath": "contracts-preprocessed/GasBoundCaller.sol", - "bytecodeHash": "0x010000b5e930829f22bd5df4fac3cb37b599cf9733554124bfb7e717fa4a726b", - "sourceCodeHash": "0x68db837d79ab575450f9123d97c7e566f311fb2e8d91c0d43dc9769ca895ccd3" + "bytecodeHash": "0x010000b51b2bae505be6deb2294505457c6e8df65d6b8d08f32d0d85f8610c60", + "sourceCodeHash": "0xd6877ecfd598bcf8abe26ec344949ae8f992d9a8ab1ac8d529a21da521f77923" }, { "contractName": "ImmutableSimulator", "bytecodePath": "artifacts-zk/contracts-preprocessed/ImmutableSimulator.sol/ImmutableSimulator.json", "sourceCodePath": "contracts-preprocessed/ImmutableSimulator.sol", - "bytecodeHash": "0x0100003de00c5ceaa3fdf4566a9822ce94abe676f68b17a6ae11c453e14455fd", + "bytecodeHash": "0x0100003dc7171a0acf2c4290f0ed222e9d2496b02a47202862e2b2dc70436c4a", "sourceCodeHash": "0x30df621c72cb35b8820b902b91057f72d0214a0e4a6b7ad4c0847e674e8b9df8" }, { "contractName": "KnownCodesStorage", "bytecodePath": "artifacts-zk/contracts-preprocessed/KnownCodesStorage.sol/KnownCodesStorage.json", "sourceCodePath": "contracts-preprocessed/KnownCodesStorage.sol", - "bytecodeHash": "0x0100007d82d4a2eb62e539e3c89cc641f507132b247022ba05ef1ddfed2b0073", + "bytecodeHash": "0x0100007d6f907a56f64d3c054ae5e4a8f73499e1d9fdfea09684fc9de9542941", "sourceCodeHash": "0x51d388adc58f67ef975a94a7978caa60ed8a0df9d3bd9ac723dfcfc540286c70" }, { "contractName": "L1Messenger", "bytecodePath": "artifacts-zk/contracts-preprocessed/L1Messenger.sol/L1Messenger.json", "sourceCodePath": "contracts-preprocessed/L1Messenger.sol", - "bytecodeHash": "0x010002b97ebf3c481ead775617590ffca139bee428e443aa49eb38b6a5b83657", + "bytecodeHash": "0x010002b9ed3fe658cc5fbc4c2d8b4b5325f47a417f9df02e7dba4360f290141c", "sourceCodeHash": "0x35c189f3babf5c7a9ce2590bed9eb62b59766e358b7733fdb1bc33f4c232f765" }, { "contractName": "L2BaseToken", "bytecodePath": "artifacts-zk/contracts-preprocessed/L2BaseToken.sol/L2BaseToken.json", "sourceCodePath": "contracts-preprocessed/L2BaseToken.sol", - "bytecodeHash": "0x010001039329e4bb55b24531c7e7d27ed40d2c82ad145033fdd5ed5b8ea86cf3", + "bytecodeHash": "0x010001035dc295d66d39f6f5ae560801400c6ac1141fd1556acabff84c79c22c", "sourceCodeHash": "0x76ac95c12820d9a02cd1f177eab59092d99463816f2616e1e0f44637bf791a43" }, { "contractName": "MsgValueSimulator", "bytecodePath": "artifacts-zk/contracts-preprocessed/MsgValueSimulator.sol/MsgValueSimulator.json", "sourceCodePath": "contracts-preprocessed/MsgValueSimulator.sol", - "bytecodeHash": "0x010000695a1e821b6d5fcb25e25793b81de0bdca3ff8277e3ac93a38e729e0a1", + "bytecodeHash": "0x01000069227f9b9d7666a4fc7ac51a280f33fd92021f2e8f06a2d5a458930563", "sourceCodeHash": "0x3f9e0af527875bebcdc20ca4ecb6822305877fd6038e4c4c58854d000b9ac115" }, { "contractName": "NonceHolder", "bytecodePath": "artifacts-zk/contracts-preprocessed/NonceHolder.sol/NonceHolder.json", "sourceCodePath": "contracts-preprocessed/NonceHolder.sol", - "bytecodeHash": "0x010000e563d4ad7b4822cc19d8f74f2c41ee3d3153379be4b02b27d4498d52b6", + "bytecodeHash": "0x010000e5e7614688d2be15699477b56c66e3596a16b60c206f3c3e8a4763e6b4", "sourceCodeHash": "0x91847512344ac5026e9fd396189c23ad9e253f22cb6e2fe65805c20c915797d4" }, { "contractName": "PubdataChunkPublisher", "bytecodePath": "artifacts-zk/contracts-preprocessed/PubdataChunkPublisher.sol/PubdataChunkPublisher.json", "sourceCodePath": "contracts-preprocessed/PubdataChunkPublisher.sol", - "bytecodeHash": "0x01000049eb6d79244e74e5286ed4d3f6eef2b5eb746b67d98691dbc28fa16984", + "bytecodeHash": "0x01000049d12af64a260c7dbfa32b778e60fe6793b73d50388cfdb0d38df4a97c", "sourceCodeHash": "0xbc62d673c2cf9ba2d2148e5e2f99ea577cd357c6fd3ad7d248f670c750050faa" }, { "contractName": "SystemContext", "bytecodePath": "artifacts-zk/contracts-preprocessed/SystemContext.sol/SystemContext.json", "sourceCodePath": "contracts-preprocessed/SystemContext.sol", - "bytecodeHash": "0x010001b3f2c3a6bdd5ad00ae29a7cbbb32dca3c31fb608b5cd52f8f3056a3847", + "bytecodeHash": "0x010001b38acd12ee43d880840d48bd0474c519a8076cf28c8930489117e9bc73", "sourceCodeHash": "0xb90284d78f48a958d082c4c877fc91ec292d05f0e388c6c78e6cce6d3b069a63" }, { @@ -185,35 +185,35 @@ "contractName": "bootloader_test", "bytecodePath": "bootloader/build/artifacts/bootloader_test.yul.zbin", "sourceCodePath": "bootloader/build/bootloader_test.yul", - "bytecodeHash": "0x010003cb722f6b3ac4928fadcb3ad05bb76a7e2497a5635efffb7bbc40f23d29", - "sourceCodeHash": "0x818032f314539edf7b5569c70099f27e2336199ce24313a3f1968e27082c18ae" + "bytecodeHash": "0x010003cb38a53b3466209bf803fc2cacd06f9dc4ff9b123a38f6ba41928f735b", + "sourceCodeHash": "0xd5b248e75ad4a0a433c47de88b5a6eb30c3b7b540e0a716e953c07903233c2d1" }, { "contractName": "fee_estimate", "bytecodePath": "bootloader/build/artifacts/fee_estimate.yul.zbin", "sourceCodePath": "bootloader/build/fee_estimate.yul", - "bytecodeHash": "0x01000951a10ba35cd1fd7ea05039e53a06037213a162e6a3cfddf81ff6e54ad5", - "sourceCodeHash": "0x2cadacf92b4db89ecd699426b769526e5482e565d6d86ed287c9cc36cfe2cc2f" + "bytecodeHash": "0x010009519002105dd21a44bde50b697ffbc607baf3196d2eac80ad06f99e0f4c", + "sourceCodeHash": "0xbecdcccce351008db583c0447c7e1c7e8c69b5806abee65f22119e699e908e9d" }, { "contractName": "gas_test", "bytecodePath": "bootloader/build/artifacts/gas_test.yul.zbin", "sourceCodePath": "bootloader/build/gas_test.yul", - "bytecodeHash": "0x010008d750d8f3fa01d99a747a5113d133594b72f26f0dce3243b225f5b91f9a", - "sourceCodeHash": "0x9a3aead2fe745861da43b8f43028821f7d592ffd16da70f38af19d3b24ae5ef7" + "bytecodeHash": "0x010008d7d5b5c05e49761c406b847fe3ad0db839525b3e4370e9a5b86f2062af", + "sourceCodeHash": "0x533349c05727f117c00727ddcc25814055571afe74827a1d7130b037e131362b" }, { "contractName": "playground_batch", "bytecodePath": "bootloader/build/artifacts/playground_batch.yul.zbin", "sourceCodePath": "bootloader/build/playground_batch.yul", - "bytecodeHash": "0x010009579942207c3a46a48ad0e66d9f73b6141bb5a2435a8fdce6ee8dfdd17d", - "sourceCodeHash": "0x2302636e39803befa5438f557bfc24b7e1587cfd8edead02dc41a0bb4002f15f" + "bytecodeHash": "0x01000957163c0f203bb8a7d3eda31cd9024e0572d212cdefc3046d740cd35afc", + "sourceCodeHash": "0xcf9c1d03c4d5c087b5c80b2ced7eff33067121a9ae78e1b0ff4b3eba4b5fbe1d" }, { "contractName": "proved_batch", "bytecodePath": "bootloader/build/artifacts/proved_batch.yul.zbin", "sourceCodePath": "bootloader/build/proved_batch.yul", - "bytecodeHash": "0x010008e7f0f15ed191392960117f88fe371348982b28a033c7207ed2c09bc0f4", - "sourceCodeHash": "0x55ce91a28b1d143ecba38dfe1b64d4877ad8f510256f47e5155fd4fd138840ea" + "bytecodeHash": "0x010008e7d48764fc25121571a4139372fb3dbfd326416ed4bf5c5857cb7affc4", + "sourceCodeHash": "0x5acea8e48b7e840467552341bcf15670856fa5d671614b398e6bd7141052671d" } ] From 1a6513bfd9279c8ff46707d0d9d47e498d8c6c14 Mon Sep 17 00:00:00 2001 From: Zach Kolodny Date: Mon, 13 May 2024 17:08:24 -0400 Subject: [PATCH 3/3] fix slither yaml --- .github/workflows/slither.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/slither.yaml b/.github/workflows/slither.yaml index 652822dfd..fa253e159 100644 --- a/.github/workflows/slither.yaml +++ b/.github/workflows/slither.yaml @@ -43,4 +43,6 @@ jobs: rm -rf ./l1-contracts/contracts/dev-contracts/test/VerifierRecursiveTest.sol - name: Run Slither - run: slither --config ./l1-contracts/slither.config.json ./l1-contracts + run: | + cd l1-contracts + slither --config ./slither.config.json .