From b02dc28c59f0ceb8f807af9b7a1ca6c5d63a7236 Mon Sep 17 00:00:00 2001 From: Ivan Litteri Date: Tue, 23 Jan 2024 12:16:50 -0300 Subject: [PATCH 1/2] Revert "Rename contracts/ to era-lambda-contracts/" This reverts commit 4fe58ca352391f29db2563495240f79de7f216f7. --- l1-contracts/scripts/initialize-bridges.ts | 2 +- l1-contracts/scripts/initialize-l2-weth-token.ts | 2 +- l1-contracts/scripts/initialize-weth-bridges.ts | 2 +- l1-contracts/scripts/utils.ts | 4 ++-- l2-contracts/src/deployL2Weth.ts | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/l1-contracts/scripts/initialize-bridges.ts b/l1-contracts/scripts/initialize-bridges.ts index 457d8a886..84862da7b 100644 --- a/l1-contracts/scripts/initialize-bridges.ts +++ b/l1-contracts/scripts/initialize-bridges.ts @@ -18,7 +18,7 @@ const provider = web3Provider(); const testConfigPath = path.join(process.env.ZKSYNC_HOME as string, "etc/test_config/constant"); const ethTestConfig = JSON.parse(fs.readFileSync(`${testConfigPath}/eth.json`, { encoding: "utf-8" })); -const contractArtifactsPath = path.join(process.env.ZKSYNC_HOME as string, "era-contracts-lambda/l2-contracts/artifacts-zk/"); +const contractArtifactsPath = path.join(process.env.ZKSYNC_HOME as string, "contracts/l2-contracts/artifacts-zk/"); const l2BridgeArtifactsPath = path.join(contractArtifactsPath, "cache-zk/solpp-generated-contracts/bridge/"); diff --git a/l1-contracts/scripts/initialize-l2-weth-token.ts b/l1-contracts/scripts/initialize-l2-weth-token.ts index bc1abfc16..c269e3cd1 100644 --- a/l1-contracts/scripts/initialize-l2-weth-token.ts +++ b/l1-contracts/scripts/initialize-l2-weth-token.ts @@ -11,7 +11,7 @@ const provider = web3Provider(); const testConfigPath = path.join(process.env.ZKSYNC_HOME as string, "etc/test_config/constant"); const ethTestConfig = JSON.parse(fs.readFileSync(`${testConfigPath}/eth.json`, { encoding: "utf-8" })); -const contractArtifactsPath = path.join(process.env.ZKSYNC_HOME as string, "era-contracts-lambda/l2-contracts/artifacts-zk/"); +const contractArtifactsPath = path.join(process.env.ZKSYNC_HOME as string, "contracts/l2-contracts/artifacts-zk/"); const l2BridgeArtifactsPath = path.join(contractArtifactsPath, "cache-zk/solpp-generated-contracts/bridge/"); const openzeppelinTransparentProxyArtifactsPath = path.join( contractArtifactsPath, diff --git a/l1-contracts/scripts/initialize-weth-bridges.ts b/l1-contracts/scripts/initialize-weth-bridges.ts index 226bdd564..5dd8b6b17 100644 --- a/l1-contracts/scripts/initialize-weth-bridges.ts +++ b/l1-contracts/scripts/initialize-weth-bridges.ts @@ -11,7 +11,7 @@ const provider = web3Provider(); const testConfigPath = path.join(process.env.ZKSYNC_HOME as string, "etc/test_config/constant"); const ethTestConfig = JSON.parse(fs.readFileSync(`${testConfigPath}/eth.json`, { encoding: "utf-8" })); -const contractArtifactsPath = path.join(process.env.ZKSYNC_HOME as string, "era-contracts-lambda/l2-contracts/artifacts-zk/"); +const contractArtifactsPath = path.join(process.env.ZKSYNC_HOME as string, "contracts/l2-contracts/artifacts-zk/"); const l2BridgeArtifactsPath = path.join(contractArtifactsPath, "cache-zk/solpp-generated-contracts/bridge/"); const openzeppelinTransparentProxyArtifactsPath = path.join( diff --git a/l1-contracts/scripts/utils.ts b/l1-contracts/scripts/utils.ts index de25a7e45..6b4f1842c 100644 --- a/l1-contracts/scripts/utils.ts +++ b/l1-contracts/scripts/utils.ts @@ -77,12 +77,12 @@ export function applyL1ToL2Alias(address: string): string { } export function readBatchBootloaderBytecode() { - const bootloaderPath = path.join(process.env.ZKSYNC_HOME as string, "era-contracts-lambda/system-contracts/bootloader"); + const bootloaderPath = path.join(process.env.ZKSYNC_HOME as string, "contracts/system-contracts/bootloader"); return fs.readFileSync(`${bootloaderPath}/build/artifacts/proved_batch.yul/proved_batch.yul.zbin`); } export function readSystemContractsBytecode(fileName: string) { - const systemContractsPath = path.join(process.env.ZKSYNC_HOME as string, "era-contracts-lambda/system-contracts"); + const systemContractsPath = path.join(process.env.ZKSYNC_HOME as string, "contracts/system-contracts"); const artifact = fs.readFileSync( `${systemContractsPath}/artifacts-zk/cache-zk/solpp-generated-contracts/${fileName}.sol/${fileName}.json` ); diff --git a/l2-contracts/src/deployL2Weth.ts b/l2-contracts/src/deployL2Weth.ts index ef0a741bd..9209993dd 100644 --- a/l2-contracts/src/deployL2Weth.ts +++ b/l2-contracts/src/deployL2Weth.ts @@ -13,7 +13,7 @@ const provider = web3Provider(); const testConfigPath = path.join(process.env.ZKSYNC_HOME as string, "etc/test_config/constant"); const ethTestConfig = JSON.parse(fs.readFileSync(`${testConfigPath}/eth.json`, { encoding: "utf-8" })); -const contractArtifactsPath = path.join(process.env.ZKSYNC_HOME as string, "era-contracts-lambda/l2-contracts/artifacts-zk/"); +const contractArtifactsPath = path.join(process.env.ZKSYNC_HOME as string, "contracts/l2-contracts/artifacts-zk/"); const l2BridgeArtifactsPath = path.join(contractArtifactsPath, "cache-zk/solpp-generated-contracts/bridge/"); const openzeppelinTransparentProxyArtifactsPath = path.join( From a07ad964b5afdb36a7a697788928bf836f5ed404 Mon Sep 17 00:00:00 2001 From: Ivan Litteri Date: Tue, 23 Jan 2024 12:18:02 -0300 Subject: [PATCH 2/2] Rename validium mode env to VALIDIUM_MODE --- l1-contracts/.env | 2 +- l1-contracts/contracts/zksync/facets/Executor.sol | 6 +++--- l1-contracts/src.ts/deploy.ts | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/l1-contracts/.env b/l1-contracts/.env index 5f63ee983..639d8863f 100644 --- a/l1-contracts/.env +++ b/l1-contracts/.env @@ -17,4 +17,4 @@ CONTRACTS_L1_ALLOW_LIST_ADDR=0x0000000000000000000000000000000000000000 CONTRACTS_CREATE2_FACTORY_ADDR=0x0000000000000000000000000000000000000000 CONTRACTS_VALIDATOR_TIMELOCK_ADDR=0x0000000000000000000000000000000000000000 CONTRACTS_VALIDATOR_TIMELOCK_EXECUTION_DELAY=0 -ETH_SENDER_SENDER_VALIDIUM_MODE=false +VALIDIUM_MODE=false diff --git a/l1-contracts/contracts/zksync/facets/Executor.sol b/l1-contracts/contracts/zksync/facets/Executor.sol index 7ceafd786..7a8cdf8df 100644 --- a/l1-contracts/contracts/zksync/facets/Executor.sol +++ b/l1-contracts/contracts/zksync/facets/Executor.sol @@ -2,7 +2,7 @@ pragma solidity 0.8.20; -// #def ETH_SENDER_SENDER_VALIDIUM_MODE true +// #def VALIDIUM_MODE true import {Base} from "./Base.sol"; import {COMMIT_TIMESTAMP_NOT_OLDER, COMMIT_TIMESTAMP_APPROXIMATION_DELTA, EMPTY_STRING_KECCAK, L2_TO_L1_LOG_SERIALIZE_SIZE, MAX_INITIAL_STORAGE_CHANGES_COMMITMENT_BYTES, MAX_REPEATED_STORAGE_CHANGES_COMMITMENT_BYTES, MAX_L2_TO_L1_LOGS_COMMITMENT_BYTES, PACKED_L2_BLOCK_TIMESTAMP_MASK, PUBLIC_INPUT_SHIFT} from "../Config.sol"; @@ -121,7 +121,7 @@ contract ExecutorFacet is Base, IExecutor { // See SystemLogKey enum in Constants.sol for ordering. uint256 processedLogs; - // #if ETH_SENDER_SENDER_VALIDIUM_MODE == false + // #if VALIDIUM_MODE == false bytes32 providedL2ToL1PubdataHash = keccak256(_newBatch.totalL2ToL1Pubdata); // #endif @@ -141,7 +141,7 @@ contract ExecutorFacet is Base, IExecutor { require(logSender == L2_TO_L1_MESSENGER_SYSTEM_CONTRACT_ADDR, "lm"); l2LogsTreeRoot = logValue; } else if (logKey == uint256(SystemLogKey.TOTAL_L2_TO_L1_PUBDATA_KEY)) { - // #if ETH_SENDER_SENDER_VALIDIUM_MODE == false + // #if VALIDIUM_MODE == false require(logSender == L2_TO_L1_MESSENGER_SYSTEM_CONTRACT_ADDR, "ln"); require(providedL2ToL1PubdataHash == logValue, "wp"); // #endif diff --git a/l1-contracts/src.ts/deploy.ts b/l1-contracts/src.ts/deploy.ts index 1e9f7c4eb..8d08f76b5 100644 --- a/l1-contracts/src.ts/deploy.ts +++ b/l1-contracts/src.ts/deploy.ts @@ -244,7 +244,7 @@ export class Deployer { const contractAddress = await this.deployViaCreate2("ExecutorFacet", [], create2Salt, ethTxOptions); if (this.verbose) { - console.log(`ETH_SENDER_SENDER_VALIDIUM_MODE=false`); + console.log(`VALIDIUM_MODE=false`); console.log(`CONTRACTS_EXECUTOR_FACET_ADDR=${contractAddress}`); } @@ -256,7 +256,7 @@ export class Deployer { const contractAddress = await this.deployViaCreate2('ValidiumExecutorFacet', [], create2Salt, ethTxOptions); if (this.verbose) { - console.log(`ETH_SENDER_SENDER_VALIDIUM_MODE=true`); + console.log(`VALIDIUM_MODE=true`); console.log(`CONTRACTS_VALIDIUM_EXECUTOR_FACET_ADDR=${contractAddress}`); }