From 1794527d9785cf19fbc59abe69c3b99c0001fc1f Mon Sep 17 00:00:00 2001 From: Morty Date: Sat, 27 Jul 2024 01:32:29 +0800 Subject: [PATCH 1/2] docs: manual deployment document --- .gitignore | 2 + docker/config-example.toml | 2 +- docs/manual-deployment.md | 85 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 88 insertions(+), 1 deletion(-) create mode 100644 docs/manual-deployment.md diff --git a/.gitignore b/.gitignore index 88e59a6..ecf447b 100644 --- a/.gitignore +++ b/.gitignore @@ -19,3 +19,5 @@ broadcast # Visual Studio Code .vscode + +volume \ No newline at end of file diff --git a/docker/config-example.toml b/docker/config-example.toml index 06786a6..66e1884 100644 --- a/docker/config-example.toml +++ b/docker/config-example.toml @@ -8,7 +8,7 @@ CHAIN_ID_L2 = 222222 MAX_TX_IN_CHUNK = 100 MAX_BLOCK_IN_CHUNK = 100 -MAX_L1_MESSAGE_GAS_LIMIT = 10000 +MAX_L1_MESSAGE_GAS_LIMIT = 10000000 L1_CONTRACT_DEPLOYMENT_BLOCK = 0 diff --git a/docs/manual-deployment.md b/docs/manual-deployment.md new file mode 100644 index 0000000..313a921 --- /dev/null +++ b/docs/manual-deployment.md @@ -0,0 +1,85 @@ +# Manual Deployment @scroll-tech/scroll-contracts + +## Overview + +This document will guide you through manually deploying Scroll contracts to both Layer 1 and Layer 2 networks. + +### Requirements + +This repository requires `node` version>=20.12.2, `yarn` and `foundry` to be previously installed. + +- **Node.js:** https://nodejs.org/en/download/package-manager +- **Yarn:** https://www.npmjs.com/package/yarn +- **Foundry:** https://book.getfoundry.sh/getting-started/installation + +### Config + +1. Create directory `volume` on the root directory of the repo (all config file will be put or generated under this directory) + +```bash +mkdir volume +``` + +2. Create config file, and copy config variables from example file `./docker/config-example.toml` + +```bash +cp ./docker/config-example.toml ./volume/config.toml +``` + +If you've previously launched Scroll chain cocomponents using Scroll-SDK, you may already have a config.toml file. If so directly copy it to `./volume/config.toml`. +**Important Note: If you are launching a scroll chain through scroll-sdk, make sure this config.toml file stay same as the one used in scroll-sdk.** + +Details about the some important variables you may want to change: + +| Configuration Variable | Description | +| -------------------------------- | ---------------------------------------------------------------------------------------- | +| L1_RPC_ENDPOINT | The RPC endpoint for the Layer 1 network | +| L2_RPC_ENDPOINT | The RPC endpoint for the Layer 2 network | +| CHAIN_ID_L1 | The chain ID of the Layer 1 network | +| CHAIN_ID_L2 | The chain ID of the Layer 2 network | +| DEPLOYER_PRIVATE_KEY | The private key of the deployer on both Layer 1 and Layer 2 | +| OWNER_PRIVATE_KEY | The private key of the owner of Scroll contracts on both Layer 1 and Layer 2 | +| L1_COMMIT_SENDER_PRIVATE_KEY | The private key of the commit sender (sequencer) on Layer 1 | +| L1_FINALIZE_SENDER_PRIVATE_KEY | The private key of the finalize sender (prover) on Layer 1 | +| L1_GAS_ORACLE_SENDER_PRIVATE_KEY | The private key of the gas oracle sender on Layer 1 | +| L2_GAS_ORACLE_SENDER_PRIVATE_KEY | The private key of the gas oracle sender on Layer 2 | +| DEPLOYER_ADDR | The address of the deployer on both Layer 1 and Layer 2 | +| OWNER_ADDR | The address of the owner of Scroll contracts on both Layer 1 and Layer 2 | +| L1_COMMIT_SENDER_ADDR | The address of the commit sender (sequencer) on Layer 1 | +| L1_FINALIZE_SENDER_ADDR | The address of the finalize sender (prover) on Layer 1 | +| L1_GAS_ORACLE_SENDER_ADDR | The address of the gas oracle sender on Layer 1 | +| L2_GAS_ORACLE_SENDER_ADDR | The address of the gas oracle sender on Layer 2 | +| DEPLOYMENT_SALT | The salt used to deploy contracts, make it unique to prevent contract address collisions | + +### Deploy + +1. Install packages + +```bash +yarn install +``` + +2. Initialize git submodules. + +```bash +git submodule update --init --recursive +``` + +3. Set and export environment variables (Change the RPCs to the one you are using) + +```bash +export L1_RPC_ENDPOINT=http://l1-devnet.scrollsdk +export L2_RPC_ENDPOINT=http://l2-rpc.scrollsdk +``` + +4. Generate predicted contract addresses (This step required mainly because we are checking if every contracts deployed as we expected) + +```bash +forge script scripts/deterministic/DeployScroll.s.sol:DeployScroll --sig "run(string,string)" "none" "write-config" +``` + +5. Deploy contracts on both layer1 and layer2 (Deployment may be interrupted by errors. Rerun the command to resume in such cases.) + +```bash +./docker/scripts/deploy.sh +``` From 21d757cebafb8f53d2ae6feabd1bff9b7ea9a763 Mon Sep 17 00:00:00 2001 From: Morty Date: Mon, 29 Jul 2024 15:52:10 +0800 Subject: [PATCH 2/2] docs: L1_CONTRACT_DEPLOYMENT_BLOCK config variable --- docs/manual-deployment.md | 35 ++++++++++++++++++----------------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/docs/manual-deployment.md b/docs/manual-deployment.md index 313a921..e33164b 100644 --- a/docs/manual-deployment.md +++ b/docs/manual-deployment.md @@ -2,7 +2,7 @@ ## Overview -This document will guide you through manually deploying Scroll contracts to both Layer 1 and Layer 2 networks. +This document will guide you through manually deploying Scroll contracts to both layer 1 and layer 2 networks. ### Requirements @@ -33,23 +33,24 @@ Details about the some important variables you may want to change: | Configuration Variable | Description | | -------------------------------- | ---------------------------------------------------------------------------------------- | -| L1_RPC_ENDPOINT | The RPC endpoint for the Layer 1 network | -| L2_RPC_ENDPOINT | The RPC endpoint for the Layer 2 network | -| CHAIN_ID_L1 | The chain ID of the Layer 1 network | -| CHAIN_ID_L2 | The chain ID of the Layer 2 network | -| DEPLOYER_PRIVATE_KEY | The private key of the deployer on both Layer 1 and Layer 2 | -| OWNER_PRIVATE_KEY | The private key of the owner of Scroll contracts on both Layer 1 and Layer 2 | -| L1_COMMIT_SENDER_PRIVATE_KEY | The private key of the commit sender (sequencer) on Layer 1 | -| L1_FINALIZE_SENDER_PRIVATE_KEY | The private key of the finalize sender (prover) on Layer 1 | -| L1_GAS_ORACLE_SENDER_PRIVATE_KEY | The private key of the gas oracle sender on Layer 1 | -| L2_GAS_ORACLE_SENDER_PRIVATE_KEY | The private key of the gas oracle sender on Layer 2 | -| DEPLOYER_ADDR | The address of the deployer on both Layer 1 and Layer 2 | -| OWNER_ADDR | The address of the owner of Scroll contracts on both Layer 1 and Layer 2 | -| L1_COMMIT_SENDER_ADDR | The address of the commit sender (sequencer) on Layer 1 | -| L1_FINALIZE_SENDER_ADDR | The address of the finalize sender (prover) on Layer 1 | -| L1_GAS_ORACLE_SENDER_ADDR | The address of the gas oracle sender on Layer 1 | -| L2_GAS_ORACLE_SENDER_ADDR | The address of the gas oracle sender on Layer 2 | +| L1_RPC_ENDPOINT | The RPC endpoint for the layer 1 network | +| L2_RPC_ENDPOINT | The RPC endpoint for the layer 2 network | +| CHAIN_ID_L1 | The chain ID of the layer 1 network | +| CHAIN_ID_L2 | The chain ID of the layer 2 network | +| DEPLOYER_PRIVATE_KEY | The private key of the deployer on both layer 1 and layer 2 | +| OWNER_PRIVATE_KEY | The private key of the owner of Scroll contracts on both layer 1 and layer 2 | +| L1_COMMIT_SENDER_PRIVATE_KEY | The private key of the commit sender (sequencer) on layer 1 | +| L1_FINALIZE_SENDER_PRIVATE_KEY | The private key of the finalize sender (prover) on layer 1 | +| L1_GAS_ORACLE_SENDER_PRIVATE_KEY | The private key of the gas oracle sender on layer 1 | +| L2_GAS_ORACLE_SENDER_PRIVATE_KEY | The private key of the gas oracle sender on layer 2 | +| DEPLOYER_ADDR | The address of the deployer on both layer 1 and layer 2 | +| OWNER_ADDR | The address of the owner of Scroll contracts on both layer 1 and layer 2 | +| L1_COMMIT_SENDER_ADDR | The address of the commit sender (sequencer) on layer 1 | +| L1_FINALIZE_SENDER_ADDR | The address of the finalize sender (prover) on layer 1 | +| L1_GAS_ORACLE_SENDER_ADDR | The address of the gas oracle sender on layer 1 | +| L2_GAS_ORACLE_SENDER_ADDR | The address of the gas oracle sender on layer 2 | | DEPLOYMENT_SALT | The salt used to deploy contracts, make it unique to prevent contract address collisions | +| L1_CONTRACT_DEPLOYMENT_BLOCK | The block that l2-sequencer and bridge-history-fetcher start to sync contracts event | ### Deploy