From 05234faf60f0a7b0ca814059e41e30007d0c1f46 Mon Sep 17 00:00:00 2001 From: soyboy Date: Thu, 26 Sep 2024 13:14:04 -0700 Subject: [PATCH 01/13] adding first draft --- .../builders/chain-operators/tools/_meta.json | 3 +- .../chain-operators/tools/op-deployer.mdx | 64 +++++++++++++++++++ pages/stack/_meta.json | 3 +- pages/stack/experimental/_meta.json | 3 + pages/stack/experimental/opcm.mdx | 37 +++++++++++ 5 files changed, 108 insertions(+), 2 deletions(-) create mode 100644 pages/builders/chain-operators/tools/op-deployer.mdx create mode 100644 pages/stack/experimental/_meta.json create mode 100644 pages/stack/experimental/opcm.mdx diff --git a/pages/builders/chain-operators/tools/_meta.json b/pages/builders/chain-operators/tools/_meta.json index 826e2e1db..908ae60d2 100644 --- a/pages/builders/chain-operators/tools/_meta.json +++ b/pages/builders/chain-operators/tools/_meta.json @@ -1,5 +1,6 @@ { "op-challenger": "Configure Challenger For Your Chain", - "op-conductor": "op-conductor", + "op-conductor": "Conductor", + "op-deployer": "Deployer", "explorer": "Block Explorer" } diff --git a/pages/builders/chain-operators/tools/op-deployer.mdx b/pages/builders/chain-operators/tools/op-deployer.mdx new file mode 100644 index 000000000..55832c746 --- /dev/null +++ b/pages/builders/chain-operators/tools/op-deployer.mdx @@ -0,0 +1,64 @@ +--- +title: Deployer +lang: en-US +tags: ["op-deployer"] +description: Learn how op-deployer can simplify deployment of the OP Stack. +--- + +import { Callout, Steps } from 'nextra/components' + +# Deployer + +This page will teach you what the `op-deployer` tool is and how it works on a high level. The purpose of this tool is to simplify the smart contract deployment process and the genesis file creation process for new OP Stack chains. It is similar to [Terrafrom](https://www.terraform.io/) where you can create intent files to describe how you want your chain to be configured. + +## Contract Deployment + +The `op-deployer` is a golang wrapper around [OP Contracts Manager](/stack/experimental/opcm). Here's a sample of its usage: + + + +### Initalize chain + +Initializes a chain intent and state file with the following command: + +```bash +todo: confirm the command and any necessary parameters +./op-deployer init +``` + +You can then modify the configuration files. Here's an example file with a standard configuration: + +```yaml +todo: add sample file +``` + +### Applies chain intent + +Use the following command to apply a chain intent to your network: + +```bash +todo: confirm the command and any necessary parameters +./op-deployer apply +``` + +### Inspect deployment + +Use the following command to inspect the details of your deployment: + +``` +todo: confirm the command and any necessary parameters +./op-deployer inspect +``` + + + +## Genesis Creation + +todo: is this baked into the commands above? + +The `op-deployer` will take the smart contract deployment artifacts and to generate the genesis file for your layer two network. + +## Next Steps + +* For more details checkout the tool and documnetation in the [monorepo](https://github.com/ethereum-optimism/optimism/tree/develop/op-chain-ops/cmd/op-deployer) +* For more details on OP Contracts Manger checkout these [opcm docs](/stack/experimental/opcm). \ No newline at end of file diff --git a/pages/stack/_meta.json b/pages/stack/_meta.json index a56d9ee02..f781654fe 100644 --- a/pages/stack/_meta.json +++ b/pages/stack/_meta.json @@ -8,5 +8,6 @@ "protocol": "Protocol", "transactions": "Transactions", "security": "Security", - "operators": "Operators" + "operators": "Operators", + "experimental": "Experimental" } diff --git a/pages/stack/experimental/_meta.json b/pages/stack/experimental/_meta.json new file mode 100644 index 000000000..f1e860151 --- /dev/null +++ b/pages/stack/experimental/_meta.json @@ -0,0 +1,3 @@ +{ + "opcm": "OP Contracts Manager" +} \ No newline at end of file diff --git a/pages/stack/experimental/opcm.mdx b/pages/stack/experimental/opcm.mdx new file mode 100644 index 000000000..7d5c5af7a --- /dev/null +++ b/pages/stack/experimental/opcm.mdx @@ -0,0 +1,37 @@ +--- +title: OP Contracts Manager +lang: en-US +tags: ["opcm"] +description: Learn how OP Contracts Manager deploys of the OP Stack with one transaction. +--- + +import { Callout, Tabs, Steps } from 'nextra/components' + +# OP Contracts Manager + +The OP Contracts Manager is a contract that deploys the L1 contracts for an OP Stack chain in a single transaction. It provides a minimal set of user-configurable parameters to ensure that the resulting chain meets the standard configuration requirements. + +The version deployed is always a governance-approved contract release. The set of governance approved contract releases can be found on the Optimism Monorepo releases page, and is the set of releases named `op-contracts/vX.Y.Z`. + +## Problem statement + +The current L2 chain deployment approach originates from a time with Hardhat, single L1 target, and a single monolithic set of features. Since then the system has migrated to Foundry and extended for more features, but remains centered around a single monolithic deploy-config for all its features. + +The interop team needs a way to configure new multi-L2 deployments: The number of ways to compose L2s in tests grows past what a single legacy config template can support. + +Outside of interop, deployment also seems increasingly complex and opaque, while it does not have to be, due to the same configuration and composability troubles. + +## Purpose + +OPCM simplifies the L1 contract deployments for new OP Stack chains. It addresses three aspects of deploying the OP Stack's L1 contracts: + +1. **Deploy Superchain Contracts.** Superchain contracts are shared between many OP chains, so this occurs only occasionally in production, but is needed for every OP chain deployment in devnet and testnet. +1. **Deploy Shared Implementation Contracts.** This occurs once per contracts release in production, but is needed for every OP chain deployment in devnet and testnet. +1. **Deploy OP Chain Contracts.** This occurs for every OP chain deployment in production, devnet, and testnet. + +In a future iteration, it also is meant to handle upgrading the smart contracts. + +## Learn more + +* Checkout the [OPCM specs](https://specs.optimism.io/experimental/op-contracts-manager.html) +* Checkout the [OPCM design document](https://github.com/ethereum-optimism/design-docs/blob/main/protocol/op-contracts-manager-arch.md) \ No newline at end of file From 2db308b41c88af87edbd9a89221b1c8615de7f6c Mon Sep 17 00:00:00 2001 From: soyboy Date: Thu, 26 Sep 2024 13:16:24 -0700 Subject: [PATCH 02/13] linting --- .../chain-operators/tools/op-deployer.mdx | 54 +++++++++---------- pages/stack/experimental/opcm.mdx | 12 ++--- words.txt | 3 ++ 3 files changed, 35 insertions(+), 34 deletions(-) diff --git a/pages/builders/chain-operators/tools/op-deployer.mdx b/pages/builders/chain-operators/tools/op-deployer.mdx index 55832c746..7602661b8 100644 --- a/pages/builders/chain-operators/tools/op-deployer.mdx +++ b/pages/builders/chain-operators/tools/op-deployer.mdx @@ -16,49 +16,47 @@ This page will teach you what the `op-deployer` tool is and how it works on a hi The `op-deployer` is a golang wrapper around [OP Contracts Manager](/stack/experimental/opcm). Here's a sample of its usage: + ### Initialize chain -### Initalize chain + Initializes a chain intent and state file with the following command: -Initializes a chain intent and state file with the following command: + ```bash + todo: confirm the command and any necessary parameters + ./op-deployer init + ``` -```bash -todo: confirm the command and any necessary parameters -./op-deployer init -``` + You can then modify the configuration files. Here's an example file with a standard configuration: -You can then modify the configuration files. Here's an example file with a standard configuration: + ```yaml + todo: add sample file + ``` -```yaml -todo: add sample file -``` + ### Applies chain intent -### Applies chain intent + Use the following command to apply a chain intent to your network: -Use the following command to apply a chain intent to your network: + ```bash + todo: confirm the command and any necessary parameters + ./op-deployer apply + ``` -```bash -todo: confirm the command and any necessary parameters -./op-deployer apply -``` + ### Inspect deployment -### Inspect deployment - -Use the following command to inspect the details of your deployment: - -``` -todo: confirm the command and any necessary parameters -./op-deployer inspect -``` + Use the following command to inspect the details of your deployment: + ``` + todo: confirm the command and any necessary parameters + ./op-deployer inspect + ``` -## Genesis Creation +## Genesis Creation todo: is this baked into the commands above? -The `op-deployer` will take the smart contract deployment artifacts and to generate the genesis file for your layer two network. +The `op-deployer` will take the smart contract deployment artifacts and to generate the genesis file for your layer two network. ## Next Steps -* For more details checkout the tool and documnetation in the [monorepo](https://github.com/ethereum-optimism/optimism/tree/develop/op-chain-ops/cmd/op-deployer) -* For more details on OP Contracts Manger checkout these [opcm docs](/stack/experimental/opcm). \ No newline at end of file +* For more details checkout the tool and docs in the [monorepo](https://github.com/ethereum-optimism/optimism/tree/develop/op-chain-ops/cmd/op-deployer) +* For more details on OP Contracts Manger checkout these [opcm docs](/stack/experimental/opcm). diff --git a/pages/stack/experimental/opcm.mdx b/pages/stack/experimental/opcm.mdx index 7d5c5af7a..afbe37f52 100644 --- a/pages/stack/experimental/opcm.mdx +++ b/pages/stack/experimental/opcm.mdx @@ -21,17 +21,17 @@ The interop team needs a way to configure new multi-L2 deployments: The number o Outside of interop, deployment also seems increasingly complex and opaque, while it does not have to be, due to the same configuration and composability troubles. -## Purpose +## Purpose OPCM simplifies the L1 contract deployments for new OP Stack chains. It addresses three aspects of deploying the OP Stack's L1 contracts: -1. **Deploy Superchain Contracts.** Superchain contracts are shared between many OP chains, so this occurs only occasionally in production, but is needed for every OP chain deployment in devnet and testnet. -1. **Deploy Shared Implementation Contracts.** This occurs once per contracts release in production, but is needed for every OP chain deployment in devnet and testnet. -1. **Deploy OP Chain Contracts.** This occurs for every OP chain deployment in production, devnet, and testnet. +1. **Deploy Superchain Contracts.** Superchain contracts are shared between many OP chains, so this occurs only occasionally in production, but is needed for every OP chain deployment in devnet and testnet. +2. **Deploy Shared Implementation Contracts.** This occurs once per contracts release in production, but is needed for every OP chain deployment in devnet and testnet. +3. **Deploy OP Chain Contracts.** This occurs for every OP chain deployment in production, devnet, and testnet. In a future iteration, it also is meant to handle upgrading the smart contracts. ## Learn more -* Checkout the [OPCM specs](https://specs.optimism.io/experimental/op-contracts-manager.html) -* Checkout the [OPCM design document](https://github.com/ethereum-optimism/design-docs/blob/main/protocol/op-contracts-manager-arch.md) \ No newline at end of file +* Checkout the [OPCM specs](https://specs.optimism.io/experimental/op-contracts-manager.html) +* Checkout the [OPCM design document](https://github.com/ethereum-optimism/design-docs/blob/main/protocol/op-contracts-manager-arch.md) diff --git a/words.txt b/words.txt index 90467007b..615f5a43c 100644 --- a/words.txt +++ b/words.txt @@ -227,6 +227,8 @@ nosyncserve Numba Offchain offchain +OPCM +opcm Openfort oplabs opnode's @@ -340,6 +342,7 @@ syncmode SYNCTARGET synctarget syscalls +Terrafrom therealbytes Thirdweb threadcreate From eb9d990ae785b426ca1c93dfac6bb0c7d0471d67 Mon Sep 17 00:00:00 2001 From: soyboy <85043086+sbvegan@users.noreply.github.com> Date: Thu, 26 Sep 2024 13:23:47 -0700 Subject: [PATCH 03/13] Apply suggestions from code review Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> --- pages/builders/chain-operators/tools/op-deployer.mdx | 6 +++--- words.txt | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pages/builders/chain-operators/tools/op-deployer.mdx b/pages/builders/chain-operators/tools/op-deployer.mdx index 7602661b8..01966cb09 100644 --- a/pages/builders/chain-operators/tools/op-deployer.mdx +++ b/pages/builders/chain-operators/tools/op-deployer.mdx @@ -9,7 +9,7 @@ import { Callout, Steps } from 'nextra/components' # Deployer -This page will teach you what the `op-deployer` tool is and how it works on a high level. The purpose of this tool is to simplify the smart contract deployment process and the genesis file creation process for new OP Stack chains. It is similar to [Terrafrom](https://www.terraform.io/) where you can create intent files to describe how you want your chain to be configured. +This page will teach you what the `op-deployer` tool is and how it works on a high level. The purpose of this tool is to simplify the smart contract deployment process and the genesis file creation process for new OP Stack chains. It is similar to [Terraform](https://www.terraform.io/) where you can create intent files to describe how you want your chain to be configured. ## Contract Deployment @@ -58,5 +58,5 @@ The `op-deployer` will take the smart contract deployment artifacts and to gener ## Next Steps -* For more details checkout the tool and docs in the [monorepo](https://github.com/ethereum-optimism/optimism/tree/develop/op-chain-ops/cmd/op-deployer) -* For more details on OP Contracts Manger checkout these [opcm docs](/stack/experimental/opcm). +* For more details, check out the tool and documentation in the [op-deployer repository](https://github.com/ethereum-optimism/optimism/tree/develop/op-chain-ops/cmd/op-deployer). +* For more information on OP Contracts Manager, refer to the [OPCM documentation](/stack/experimental/opcm). diff --git a/words.txt b/words.txt index 615f5a43c..53e4d2a99 100644 --- a/words.txt +++ b/words.txt @@ -342,7 +342,7 @@ syncmode SYNCTARGET synctarget syscalls -Terrafrom +Terraform therealbytes Thirdweb threadcreate From 55ba456a4bbdfd3b06ac69fe26d7da0f2b27c6a6 Mon Sep 17 00:00:00 2001 From: Matthew Slipper Date: Thu, 26 Sep 2024 16:45:45 -0600 Subject: [PATCH 04/13] add more docs --- .../chain-operators/tools/op-deployer.mdx | 101 ++++++++++++------ 1 file changed, 70 insertions(+), 31 deletions(-) diff --git a/pages/builders/chain-operators/tools/op-deployer.mdx b/pages/builders/chain-operators/tools/op-deployer.mdx index 01966cb09..a20f340df 100644 --- a/pages/builders/chain-operators/tools/op-deployer.mdx +++ b/pages/builders/chain-operators/tools/op-deployer.mdx @@ -5,56 +5,95 @@ tags: ["op-deployer"] description: Learn how op-deployer can simplify deployment of the OP Stack. --- -import { Callout, Steps } from 'nextra/components' +import {Callout, Steps} from 'nextra/components' # Deployer -This page will teach you what the `op-deployer` tool is and how it works on a high level. The purpose of this tool is to simplify the smart contract deployment process and the genesis file creation process for new OP Stack chains. It is similar to [Terraform](https://www.terraform.io/) where you can create intent files to describe how you want your chain to be configured. +`op-deployer` simplifies the process of deploying the the OP Stack. It works similarly to [Terraform] +(https://www.terraform.io). Like Terraform, you define a declarative config file called an "intent," then run a +command to apply the intent to your chain. `op-deployer` will compare the state of your chain against the intent, +and make whatever changes are necessary for them to match. -## Contract Deployment +## Installation -The `op-deployer` is a golang wrapper around [OP Contracts Manager](/stack/experimental/opcm). Here's a sample of its usage: +`op-deployer` is currently under active development, and must be compiled from source. Assuming you have the Go +toolchain installed, you can install `op-deployer` by running `go install github. +com/ethereum-optimism/optimism/op-chain-ops/cmd/op-deployer@latest`. This will install the `op-deployer` binary to +your local `GOPATH`. - - ### Initialize chain +## Usage - Initializes a chain intent and state file with the following command: +### Configuring your Chain - ```bash - todo: confirm the command and any necessary parameters - ./op-deployer init - ``` +The first step to using `op-deployer` is to create an intent file. The intent file describes how you want your chain +to look when it is done being deployed. `op-deployer` has a utility for this. Run the following command to generate +an example intent file for a development chain: - You can then modify the configuration files. Here's an example file with a standard configuration: +``` +op-deployer init --l1-chain-id 11155111 --l2-chain-ids 12345 --workdir .deployer +``` - ```yaml - todo: add sample file - ``` +This command will create a directory called `.deployer` in your current working directory containing the intent file +and an empty `state.json` file. `state.json` is populated with the results of your deployment, and never needs to +be edited directly. - ### Applies chain intent +Your intent file will look something like this: - Use the following command to apply a chain intent to your network: +```toml +l1ChainID = 11155111 # The chain ID of the L1 chain you'll be deploying to +fundDevAccounts = true # Whether or not to fund dev accounts using the test... junk mnemonic on L2. +contractsRelease = "op-contracts/v1.6.0" # The version of the smart contracts to deploy. - ```bash - todo: confirm the command and any necessary parameters - ./op-deployer apply - ``` +# List of L2s to deploy. op-deployer can deploy multiple L2s at once +[[chains]] +# Your chain's ID, encoded as a 32-byte hex string +id = "0x0000000000000000000000000000000000000000000000000000000000003039" +# Various ownership roles for your chain. When you use op-deployer init, these roles are generated using the +# test... junk mnemonic. You should replace these with your own addresses for production chains. +[chains.roles] +proxyAdminOwner = "0x7759a8a43aa6a7ee9434ddb597beed64180c40fd" +systemConfigOwner = "0x8e35d9523a0c4c9ac537d254079c2398c6f3b35f" +governanceTokenOwner = "0x7759a8a43aa6a7ee9434ddb597beed64180c40fd" +unsafeBlockSigner = "0xbb19dce4ce51f353a98dbab31b5fa3bc80dc7769" +batcher = "0x0e9c62712ab826e06b16b2236ce542f711eaffaf" +proposer = "0x86dfafe0689e20685f7872e0cb264868454627bc" +challenger = "0xf1658da627dd0738c555f9572f658617511c49d5" +``` - ### Inspect deployment +See the comments for what each field does. By default, `op-deployer` will fill in all other configuration variables +with those that match our standard config. You can override these defaults by adding them to your intent file, but +that won't be covered here. - Use the following command to inspect the details of your deployment: +### Applying your Intent - ``` - todo: confirm the command and any necessary parameters - ./op-deployer inspect - ``` - +Now that you've created your intent file, you can apply it to your chain. Run the following command to do so: -## Genesis Creation +``` +op-deployer apply --workdir .deployer --l1-rpc-url --private-key +``` -todo: is this baked into the commands above? +This command will deploy the OP Stack to L1. It will deploy all L2s specified in the intent file. Superchain +configuration will be set to the Superchain-wide defaults - i.e., your chain will be opted into the Superchain pause +and will use the same protocol versions address as other chains on the Superchain. -The `op-deployer` will take the smart contract deployment artifacts and to generate the genesis file for your layer two network. +### Generating Genesis Files + +With the contracts deployed, you can generate a genesis file for any of your L2s. Run the following command to do so: + +``` +./bin/op-deployer inspect genesis --outfile genesis.json +``` + +This will write the genesis file to genesis.json. You can change the `--outfile` parameter to write it somewhere +else. You can run another member of the `inspect` family, `rollup`, to get the rollup.json file: + +``` +./bin/op-deployer inspect rollup --outfile rollup.json +``` + +## More Information + +`op-deployer` uses the OP Contracts Manager (OPCM) under the hood to deploy contracts. ## Next Steps From 6148655288b8784c21c96bbab46a93c532c39f1f Mon Sep 17 00:00:00 2001 From: soyboy Date: Thu, 26 Sep 2024 16:13:55 -0700 Subject: [PATCH 05/13] adding tags and fixing link --- pages/builders/chain-operators/tools/op-deployer.mdx | 5 ++--- pages/stack/experimental/opcm.mdx | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/pages/builders/chain-operators/tools/op-deployer.mdx b/pages/builders/chain-operators/tools/op-deployer.mdx index a20f340df..85ca637e9 100644 --- a/pages/builders/chain-operators/tools/op-deployer.mdx +++ b/pages/builders/chain-operators/tools/op-deployer.mdx @@ -1,7 +1,7 @@ --- title: Deployer lang: en-US -tags: ["op-deployer"] +tags: ["op-deployer","eng-platforms"] description: Learn how op-deployer can simplify deployment of the OP Stack. --- @@ -9,8 +9,7 @@ import {Callout, Steps} from 'nextra/components' # Deployer -`op-deployer` simplifies the process of deploying the the OP Stack. It works similarly to [Terraform] -(https://www.terraform.io). Like Terraform, you define a declarative config file called an "intent," then run a +`op-deployer` simplifies the process of deploying the the OP Stack. It works similarly to [Terraform](https://www.terraform.io). Like Terraform, you define a declarative config file called an "intent," then run a command to apply the intent to your chain. `op-deployer` will compare the state of your chain against the intent, and make whatever changes are necessary for them to match. diff --git a/pages/stack/experimental/opcm.mdx b/pages/stack/experimental/opcm.mdx index afbe37f52..46acc1e7a 100644 --- a/pages/stack/experimental/opcm.mdx +++ b/pages/stack/experimental/opcm.mdx @@ -1,7 +1,7 @@ --- title: OP Contracts Manager lang: en-US -tags: ["opcm"] +tags: ["opcm","eng-security"] description: Learn how OP Contracts Manager deploys of the OP Stack with one transaction. --- From 9b9359b891662efd14af3e7e0c943cdc8c002d28 Mon Sep 17 00:00:00 2001 From: soyboy <85043086+sbvegan@users.noreply.github.com> Date: Fri, 27 Sep 2024 10:39:33 -0700 Subject: [PATCH 06/13] Update pages/stack/experimental/opcm.mdx Co-authored-by: Matt Solomon --- pages/stack/experimental/opcm.mdx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pages/stack/experimental/opcm.mdx b/pages/stack/experimental/opcm.mdx index 46acc1e7a..0ecfd12cc 100644 --- a/pages/stack/experimental/opcm.mdx +++ b/pages/stack/experimental/opcm.mdx @@ -25,9 +25,9 @@ Outside of interop, deployment also seems increasingly complex and opaque, while OPCM simplifies the L1 contract deployments for new OP Stack chains. It addresses three aspects of deploying the OP Stack's L1 contracts: -1. **Deploy Superchain Contracts.** Superchain contracts are shared between many OP chains, so this occurs only occasionally in production, but is needed for every OP chain deployment in devnet and testnet. -2. **Deploy Shared Implementation Contracts.** This occurs once per contracts release in production, but is needed for every OP chain deployment in devnet and testnet. -3. **Deploy OP Chain Contracts.** This occurs for every OP chain deployment in production, devnet, and testnet. +1. **Deploy Superchain Contracts.** Superchain contracts are shared between many OP chains, so this occurs only occasionally in production. +2. **Deploy Shared Implementation Contracts.** This occurs once per contracts release in production. +3. **Deploy OP Chain Contracts.** This occurs for every OP chain deployment in production. In a future iteration, it also is meant to handle upgrading the smart contracts. From d53f6d59fc520012328719fc59d20e724f4973f5 Mon Sep 17 00:00:00 2001 From: Matthew Slipper Date: Sat, 28 Sep 2024 20:21:18 -0600 Subject: [PATCH 07/13] fix installation steps --- .../chain-operators/tools/op-deployer.mdx | 32 +++++++++++++++++-- 1 file changed, 29 insertions(+), 3 deletions(-) diff --git a/pages/builders/chain-operators/tools/op-deployer.mdx b/pages/builders/chain-operators/tools/op-deployer.mdx index 85ca637e9..761e941c0 100644 --- a/pages/builders/chain-operators/tools/op-deployer.mdx +++ b/pages/builders/chain-operators/tools/op-deployer.mdx @@ -16,9 +16,35 @@ and make whatever changes are necessary for them to match. ## Installation `op-deployer` is currently under active development, and must be compiled from source. Assuming you have the Go -toolchain installed, you can install `op-deployer` by running `go install github. -com/ethereum-optimism/optimism/op-chain-ops/cmd/op-deployer@latest`. This will install the `op-deployer` binary to -your local `GOPATH`. +toolchain installed, you can install `op-deployer` by following these steps: + + + ### **Clone the Monorepo**: + + Run the following command to clone the monorepo: + + ```bash + git clone https://github.com/ethereum-optimism/optimism.git + ``` + + ### **Build the Binary**: + + Run the following commands to build the binary: + + ```bash + cd op-chain-ops + make op-deployer + ``` + + ### (Optional) Move `op-deployer` Into `$PATH` + + Run the following command to move the `op-deployer` binary into your `$PATH`. Note that the path for your system + may be different: + + ```bash + sudo mv ./bin/op-deployer /usr/local/bin/op-deployer + ``` + ## Usage From 8acc82f0bbc34c0276a5f38f37b3a2d747023636 Mon Sep 17 00:00:00 2001 From: soyboy Date: Mon, 30 Sep 2024 11:07:37 -0700 Subject: [PATCH 08/13] removing problem statement section --- pages/stack/experimental/opcm.mdx | 8 -------- 1 file changed, 8 deletions(-) diff --git a/pages/stack/experimental/opcm.mdx b/pages/stack/experimental/opcm.mdx index 0ecfd12cc..49687acfb 100644 --- a/pages/stack/experimental/opcm.mdx +++ b/pages/stack/experimental/opcm.mdx @@ -13,14 +13,6 @@ The OP Contracts Manager is a contract that deploys the L1 contracts for an OP S The version deployed is always a governance-approved contract release. The set of governance approved contract releases can be found on the Optimism Monorepo releases page, and is the set of releases named `op-contracts/vX.Y.Z`. -## Problem statement - -The current L2 chain deployment approach originates from a time with Hardhat, single L1 target, and a single monolithic set of features. Since then the system has migrated to Foundry and extended for more features, but remains centered around a single monolithic deploy-config for all its features. - -The interop team needs a way to configure new multi-L2 deployments: The number of ways to compose L2s in tests grows past what a single legacy config template can support. - -Outside of interop, deployment also seems increasingly complex and opaque, while it does not have to be, due to the same configuration and composability troubles. - ## Purpose OPCM simplifies the L1 contract deployments for new OP Stack chains. It addresses three aspects of deploying the OP Stack's L1 contracts: From db530a6c29c9760be415a0282783b28c48c120ab Mon Sep 17 00:00:00 2001 From: soyboy Date: Mon, 30 Sep 2024 13:15:35 -0700 Subject: [PATCH 09/13] carving out experimental section --- pages/stack/_meta.json | 6 +++++- pages/stack/experimental/_meta.json | 3 --- pages/stack/{experimental => }/opcm.mdx | 0 3 files changed, 5 insertions(+), 4 deletions(-) delete mode 100644 pages/stack/experimental/_meta.json rename pages/stack/{experimental => }/opcm.mdx (100%) diff --git a/pages/stack/_meta.json b/pages/stack/_meta.json index f781654fe..e2e98fa27 100644 --- a/pages/stack/_meta.json +++ b/pages/stack/_meta.json @@ -9,5 +9,9 @@ "transactions": "Transactions", "security": "Security", "operators": "Operators", - "experimental": "Experimental" + "--- Experimental": { + "title": "Experimental", + "type": "separator" + }, + "opcm": "OP Contracts Manager" } diff --git a/pages/stack/experimental/_meta.json b/pages/stack/experimental/_meta.json deleted file mode 100644 index f1e860151..000000000 --- a/pages/stack/experimental/_meta.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "opcm": "OP Contracts Manager" -} \ No newline at end of file diff --git a/pages/stack/experimental/opcm.mdx b/pages/stack/opcm.mdx similarity index 100% rename from pages/stack/experimental/opcm.mdx rename to pages/stack/opcm.mdx From 0e148dfe4c9225b6ede5de857903ec68e0f05f7a Mon Sep 17 00:00:00 2001 From: Matthew Slipper Date: Tue, 1 Oct 2024 12:48:22 -0600 Subject: [PATCH 10/13] updates from review --- pages/builders/chain-operators/tools/op-deployer.mdx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pages/builders/chain-operators/tools/op-deployer.mdx b/pages/builders/chain-operators/tools/op-deployer.mdx index 761e941c0..320e39719 100644 --- a/pages/builders/chain-operators/tools/op-deployer.mdx +++ b/pages/builders/chain-operators/tools/op-deployer.mdx @@ -97,9 +97,13 @@ Now that you've created your intent file, you can apply it to your chain. Run th op-deployer apply --workdir .deployer --l1-rpc-url --private-key ``` +Using a hardware wallet is currently not supported, but this deployer key has no privileges so an ephemeral hot wallet +can be used. + This command will deploy the OP Stack to L1. It will deploy all L2s specified in the intent file. Superchain configuration will be set to the Superchain-wide defaults - i.e., your chain will be opted into the Superchain pause -and will use the same protocol versions address as other chains on the Superchain. +and will use the same [protocol versions](https://github.com/ethereum-optimism/specs/blob/main/specs/protocol/superchain-upgrades.md) +address as other chains on the Superchain. ### Generating Genesis Files From ee9e13e4951eb4759af007c66f3fc8a1424e2d73 Mon Sep 17 00:00:00 2001 From: soyboy Date: Tue, 1 Oct 2024 12:02:18 -0700 Subject: [PATCH 11/13] fixing internal link --- pages/builders/chain-operators/tools/op-deployer.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/builders/chain-operators/tools/op-deployer.mdx b/pages/builders/chain-operators/tools/op-deployer.mdx index 320e39719..a7a1d1550 100644 --- a/pages/builders/chain-operators/tools/op-deployer.mdx +++ b/pages/builders/chain-operators/tools/op-deployer.mdx @@ -127,4 +127,4 @@ else. You can run another member of the `inspect` family, `rollup`, to get the r ## Next Steps * For more details, check out the tool and documentation in the [op-deployer repository](https://github.com/ethereum-optimism/optimism/tree/develop/op-chain-ops/cmd/op-deployer). -* For more information on OP Contracts Manager, refer to the [OPCM documentation](/stack/experimental/opcm). +* For more information on OP Contracts Manager, refer to the [OPCM documentation](/stack/opcm). From 2f9f18a8d17733562dadd9610184496157f3ab77 Mon Sep 17 00:00:00 2001 From: soyboy <85043086+sbvegan@users.noreply.github.com> Date: Tue, 1 Oct 2024 12:26:30 -0700 Subject: [PATCH 12/13] Apply suggestions from code review Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> --- pages/builders/chain-operators/tools/op-deployer.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/builders/chain-operators/tools/op-deployer.mdx b/pages/builders/chain-operators/tools/op-deployer.mdx index a7a1d1550..70cef0e42 100644 --- a/pages/builders/chain-operators/tools/op-deployer.mdx +++ b/pages/builders/chain-operators/tools/op-deployer.mdx @@ -9,7 +9,7 @@ import {Callout, Steps} from 'nextra/components' # Deployer -`op-deployer` simplifies the process of deploying the the OP Stack. It works similarly to [Terraform](https://www.terraform.io). Like Terraform, you define a declarative config file called an "intent," then run a +`op-deployer` simplifies the process of deploying the OP Stack. It works similarly to [Terraform](https://www.terraform.io). Like Terraform, you define a declarative config file called an "intent," then run a command to apply the intent to your chain. `op-deployer` will compare the state of your chain against the intent, and make whatever changes are necessary for them to match. From 6a41011b5b41bd79b01c1043d0035286b5b3d79e Mon Sep 17 00:00:00 2001 From: soyboy <85043086+sbvegan@users.noreply.github.com> Date: Wed, 2 Oct 2024 22:45:44 -0700 Subject: [PATCH 13/13] Apply suggestions from code review Co-authored-by: Bradley Camacho <42678939+bradleycamacho@users.noreply.github.com> --- .../chain-operators/tools/op-deployer.mdx | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/pages/builders/chain-operators/tools/op-deployer.mdx b/pages/builders/chain-operators/tools/op-deployer.mdx index 70cef0e42..4d8edb21b 100644 --- a/pages/builders/chain-operators/tools/op-deployer.mdx +++ b/pages/builders/chain-operators/tools/op-deployer.mdx @@ -50,9 +50,7 @@ toolchain installed, you can install `op-deployer` by following these steps: ### Configuring your Chain -The first step to using `op-deployer` is to create an intent file. The intent file describes how you want your chain -to look when it is done being deployed. `op-deployer` has a utility for this. Run the following command to generate -an example intent file for a development chain: +To get started with `op-deployer`, you need to create an intent file that outlines your desired chain configuration. You can use the built-in `op-deployer` utility to generate this file. Just run the following command to create an example intent file for a development chain: ``` op-deployer init --l1-chain-id 11155111 --l2-chain-ids 12345 --workdir .deployer @@ -85,23 +83,22 @@ proposer = "0x86dfafe0689e20685f7872e0cb264868454627bc" challenger = "0xf1658da627dd0738c555f9572f658617511c49d5" ``` -See the comments for what each field does. By default, `op-deployer` will fill in all other configuration variables +See the code comments above for explanations of each field. By default, `op-deployer` will fill in all other configuration variables with those that match our standard config. You can override these defaults by adding them to your intent file, but that won't be covered here. ### Applying your Intent -Now that you've created your intent file, you can apply it to your chain. Run the following command to do so: +Now that you've created your intent file, you can apply it to your chain: ``` op-deployer apply --workdir .deployer --l1-rpc-url --private-key ``` -Using a hardware wallet is currently not supported, but this deployer key has no privileges so an ephemeral hot wallet -can be used. +Hardware wallets are not supported, but you can use ephemeral hot wallets since this deployer key has no privileges. This command will deploy the OP Stack to L1. It will deploy all L2s specified in the intent file. Superchain -configuration will be set to the Superchain-wide defaults - i.e., your chain will be opted into the Superchain pause +configuration will be set to the Superchain-wide defaults - i.e., your chain will be opted into the [Superchain pause](https://specs.optimism.io/protocol/superchain-configuration.html#pausability) and will use the same [protocol versions](https://github.com/ethereum-optimism/specs/blob/main/specs/protocol/superchain-upgrades.md) address as other chains on the Superchain. @@ -113,8 +110,8 @@ With the contracts deployed, you can generate a genesis file for any of your L2s ./bin/op-deployer inspect genesis --outfile genesis.json ``` -This will write the genesis file to genesis.json. You can change the `--outfile` parameter to write it somewhere -else. You can run another member of the `inspect` family, `rollup`, to get the rollup.json file: +This will write the genesis file to `genesis.json`. You can change the `--outfile` parameter to write it somewhere +else. You can run another member of the `inspect` family, `rollup`, to get the `rollup.json` file: ``` ./bin/op-deployer inspect rollup --outfile rollup.json