From 92df61edae3be9437bbe1b77a24a5e2e42d4e12c Mon Sep 17 00:00:00 2001 From: krofax Date: Thu, 15 May 2025 15:48:36 +0100 Subject: [PATCH 01/23] Updated the absolute prestate docs --- pages/operators/chain-operators/tutorials.mdx | 6 +- .../chain-operators/tutorials/_meta.json | 2 + .../tutorials/absolute-prestate.mdx | 209 ++++++++++++++++++ 3 files changed, 215 insertions(+), 2 deletions(-) create mode 100644 pages/operators/chain-operators/tutorials/absolute-prestate.mdx diff --git a/pages/operators/chain-operators/tutorials.mdx b/pages/operators/chain-operators/tutorials.mdx index 2e31df92a..e18dc82c9 100644 --- a/pages/operators/chain-operators/tutorials.mdx +++ b/pages/operators/chain-operators/tutorials.mdx @@ -36,12 +36,14 @@ This section provides information on adding attributes to the derivation functio - - + + + + diff --git a/pages/operators/chain-operators/tutorials/_meta.json b/pages/operators/chain-operators/tutorials/_meta.json index 807ecbed1..9168131fe 100644 --- a/pages/operators/chain-operators/tutorials/_meta.json +++ b/pages/operators/chain-operators/tutorials/_meta.json @@ -5,5 +5,7 @@ "modifying-predeploys": "Modifying predeployed contracts", "integrating-da-layer": "Integrating a new DA layer", "migrating-permissionless": "Migrating to permissionless fault proofs on OP Stack", + "dispute-games":"Deploying new dispute games with OPCM", + "absolute-prestate":"Generating absolute prestate and preimage files", "chain-dev-net": "Running a local network environment" } \ No newline at end of file diff --git a/pages/operators/chain-operators/tutorials/absolute-prestate.mdx b/pages/operators/chain-operators/tutorials/absolute-prestate.mdx new file mode 100644 index 000000000..b70bfffa2 --- /dev/null +++ b/pages/operators/chain-operators/tutorials/absolute-prestate.mdx @@ -0,0 +1,209 @@ +--- +title: Generating absolute prestate and preimage files +description: A guide for chain operators on how to generate the absolute prestate and preimage files necessary for running cannon/permissionless proofs. +lang: en-US +content_type: tutorial +topic: generating absolute prestate files +personas: +- chain-operator +categories: +- fault proofs +- cannon +- permissionless proofs +- proof system +is_imported_content: 'false' +--- + +import { Callout, Steps } from 'nextra/components' + +# Overview + +This guide will show chain operators how to generate the absolute prestate and preimage files necessary for running cannon/permissionless proofs. + +Permissionless fault proofs are a critical component of the OP Stack's security model. They allow anyone to challenge invalid state proposals, ensuring the correctness of L2 to L1 withdrawals without relying on trusted third parties. +To enable this functionality, chain operators must generate and maintain the necessary absolute prestate and preimage files. +The absolute prestate is a commitment to the initial state of the fault proof program, and the preimage is the serialized binary representation of this program state. +These files are essential for the op-challenger tool to participate in dispute games when challenging invalid claims. + +## Prerequisites + +Before starting, ensure you have: + +* Run `op-contracts/v2.0.0` or higher on your chain +* You have sufficient system resources (memory and disk space) + +## Using the latest AP and multi-threaded Cannon + +As of the latest releases, OP Stack chains should utilize the `64-bit` MIPS multi-threaded version of Cannon. +This upgrade offers several advantages: + +* Improved performance through parallelized execution +* Enhanced fault proof VM capabilities +* Support for the latest network upgrades + + + Beginning with [Upgrade 14](/notices/upgrade-14), all chains should use the `64-bit` multi-threaded version of Cannon. + The absolute prestate files for this version typically have the format `prestate-mt64.bin.gz`. + + +## Generating the absolute prestate + + + ### Clone and checkout the tagged version + + First, clone the Optimism monorepo and check out the appropriate release tag for op-program: + + ```bash + git clone https://github.com/ethereum-optimism/optimism.git + cd optimism + git checkout op-program/v1.6.0-rc.2 # Use the latest tagged version + + ``` + + + Always use a specific tagged version of op-program as specified in the Superchain registry or official release notes. Current releases use versions like `op-program/v1.6.0-rc.2` for Isthmus hardfork support. + + + ### Initialize the repository + + Initialize the repository with all necessary dependencies: + + ```bash + make devnet-genesis + ``` + + Generate the absolute prestate by running: + + ```bash + cd op-program + make cannon-prestate + ``` + + This command will: + + 1. Compile the op-program + 2. Generate the absolute prestate hash + 3. Create the preimage file + + ### Verify the generated prestate + + Verify the absolute prestate by checking the hash: + + ```bash + cd ..# Return to monorepo root + ./op-program/bin/op-program --version + ``` + + The output should display three prestate hashes: + + * Cannon absolute prestate hash (legacy) + * Cannon64 absolute prestate hash (64-bit version) + * CannonInterop absolute prestate hash (for interoperability) + + For permissionless fault proofs, you'll primarily use the Cannon64 absolute prestate hash. + + ### Prepare the preimage file + + The preimage file is located at `op-program/bin/prestate-mt64.bin.gz`. Rename it to match the prestate hash: + + ```bash + cd op-program/bin + mv prestate-mt64.bin.gz 0x[CANNON64_PRESTATE_HASH].bin.gz + ``` + + Replace `[CANNON64_PRESTATE_HASH]` with the actual `Cannon64` absolute prestate hash value from the output. + + +## Official prestate hashes for Superchain registry chains + +The Superchain registry maintains official absolute prestate hashes for chains that are part of the registry. +These prestates include the configurations of all chains in the Superchain registry. + + + For chains listed in the Superchain registry, you should use the official prestate hashes rather than generating your own. + + +You can find the latest prestate tags in the [Superchain registry](https://github.com/ethereum-optimism/superchain-registry/blob/main/validation/standard/standard-prestates.toml). + +Current official prestate hashes for Isthmus hardfork (as of writing): + +* Sepolia chains: `0x03682932cec7ce0a3874b19675a6bbc923054a7b321efc7d3835187b172494b6` (using op-program/v1.6.0-rc.2) + +## Handling unannounced chain configurations + +If your chain is not included in the Superchain registry, you'll need to generate a custom prestate with your specific chain configuration. This applies to: + +* New chains +* Chains with custom configurations +* "Stealth launches" or other unannounced chains + +For these cases, follow these additional steps: + +### For chains not in the Superchain registry + + + ### Prepare configuration files + + Ensure your chain's rollup configuration and L2 genesis file are accessible + + ### Generate custom prestate + Generate the absolute prestate using your specific configuration: + + ```bash + cd op-program + make cannon-prestate ROLLUP_CONFIG=/path/to/your/rollup.json L2_GENESIS=/path/to/your/genesis-l2.json + ``` + + ### Process and verify + + Verify and prepare the preimage file as described in Steps 4-5 above + + + + The initial prestate used for permissioned games doesn't include the necessary chain configuration for the Fault proof system. + The assumption is that the chain operator, the single permissioned actor, will not challenge their own games. + So the absolute prestate on the initial `PermissionedDisputeGame` will never be used. + + When deploying a new chain, you must first deploy the L1 contracts and then retrieve the artifacts. + These are inputs to the creation of the absolute prestate and this circular dependency is the reason chains cannot be deployed directly to the permissionless Fault Proof System. + + +## Deploying and configuring with the absolute prestate + +After generating the absolute prestate and preimage files, you'll need to: + + + ### Upload preimage file + + Upload the preimage file to a location accessible by your op-challenger instances + + ### Configure op-challenger + + Configure the op-challenger to use this prestate: + + ```bash + op-challenger \ + --trace-type permissioned,cannon \ + --prestates-url \ + --l1-eth-rpc \ + --game-factory-address \ + --network + ``` + + Replace `` with the URL where you've stored your prestate files. + + + +## Next Steps + +After successfully generating and deploying the absolute prestate: + +1. Monitor your op-challenger service to ensure it can properly participate in dispute games +2. Consider setting up redundant challenger instances for enhanced reliability +3. Keep track of future upgrades that may require new absolute prestates + +For more information, refer to the following resources: + +* [Migrating to Permissionless Fault Proofs Guide](/operators/chain-operators/tutorials/migrating-permissionless) +* [Deploying New Dispute Games with OPCM](/operators/chain-operators/tutorials/dispute-games) +* [Fault Proofs Explainer](/stack/fault-proofs/explainer) From e89951422a1b93c6dd01ddd5ac662ba5f790dca8 Mon Sep 17 00:00:00 2001 From: krofax Date: Thu, 15 May 2025 15:55:12 +0100 Subject: [PATCH 02/23] updated title --- .../operators/chain-operators/tutorials/absolute-prestate.mdx | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/pages/operators/chain-operators/tutorials/absolute-prestate.mdx b/pages/operators/chain-operators/tutorials/absolute-prestate.mdx index b70bfffa2..31aba8f6e 100644 --- a/pages/operators/chain-operators/tutorials/absolute-prestate.mdx +++ b/pages/operators/chain-operators/tutorials/absolute-prestate.mdx @@ -1,6 +1,6 @@ --- title: Generating absolute prestate and preimage files -description: A guide for chain operators on how to generate the absolute prestate and preimage files necessary for running cannon/permissionless proofs. +description: A high-level guide on how to generate the absolute prestate and preimage necessary for running cannon/permissionless proofs. lang: en-US content_type: tutorial topic: generating absolute prestate files @@ -18,8 +18,6 @@ import { Callout, Steps } from 'nextra/components' # Overview -This guide will show chain operators how to generate the absolute prestate and preimage files necessary for running cannon/permissionless proofs. - Permissionless fault proofs are a critical component of the OP Stack's security model. They allow anyone to challenge invalid state proposals, ensuring the correctness of L2 to L1 withdrawals without relying on trusted third parties. To enable this functionality, chain operators must generate and maintain the necessary absolute prestate and preimage files. The absolute prestate is a commitment to the initial state of the fault proof program, and the preimage is the serialized binary representation of this program state. From 9bcd1d6dd73a1aed417fe69a51815cf02fd2f40e Mon Sep 17 00:00:00 2001 From: krofax Date: Thu, 15 May 2025 16:03:01 +0100 Subject: [PATCH 03/23] update the release --- pages/operators/chain-operators/tutorials/absolute-prestate.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/operators/chain-operators/tutorials/absolute-prestate.mdx b/pages/operators/chain-operators/tutorials/absolute-prestate.mdx index 31aba8f6e..a1963dbcd 100644 --- a/pages/operators/chain-operators/tutorials/absolute-prestate.mdx +++ b/pages/operators/chain-operators/tutorials/absolute-prestate.mdx @@ -54,7 +54,7 @@ This upgrade offers several advantages: ```bash git clone https://github.com/ethereum-optimism/optimism.git cd optimism - git checkout op-program/v1.6.0-rc.2 # Use the latest tagged version + git checkout op-program/v1.6.0-rc.1 # Use the latest tagged version ``` From 465691218d6ce9eaebbc1cfea84b7790464539e2 Mon Sep 17 00:00:00 2001 From: krofax Date: Thu, 15 May 2025 16:03:30 +0100 Subject: [PATCH 04/23] fix release tag --- pages/operators/chain-operators/tutorials/absolute-prestate.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/operators/chain-operators/tutorials/absolute-prestate.mdx b/pages/operators/chain-operators/tutorials/absolute-prestate.mdx index a1963dbcd..39488ff5f 100644 --- a/pages/operators/chain-operators/tutorials/absolute-prestate.mdx +++ b/pages/operators/chain-operators/tutorials/absolute-prestate.mdx @@ -54,7 +54,7 @@ This upgrade offers several advantages: ```bash git clone https://github.com/ethereum-optimism/optimism.git cd optimism - git checkout op-program/v1.6.0-rc.1 # Use the latest tagged version + git checkout op-program/v1.6.1-rc.1 # Use the latest tagged version ``` From 757c2badbf5f9ce566bac3fa4db856472ff07ddc Mon Sep 17 00:00:00 2001 From: krofax Date: Thu, 15 May 2025 16:03:56 +0100 Subject: [PATCH 05/23] add link to release tags --- pages/operators/chain-operators/tutorials/absolute-prestate.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/operators/chain-operators/tutorials/absolute-prestate.mdx b/pages/operators/chain-operators/tutorials/absolute-prestate.mdx index 39488ff5f..d8da563f5 100644 --- a/pages/operators/chain-operators/tutorials/absolute-prestate.mdx +++ b/pages/operators/chain-operators/tutorials/absolute-prestate.mdx @@ -49,7 +49,7 @@ This upgrade offers several advantages: ### Clone and checkout the tagged version - First, clone the Optimism monorepo and check out the appropriate release tag for op-program: + First, clone the Optimism monorepo and check out the appropriate [release tag](https://github.com/ethereum-optimism/optimism/tags) for op-program: ```bash git clone https://github.com/ethereum-optimism/optimism.git From 6a0c94f9e96c9f4ef36a38c527f874fc188486cf Mon Sep 17 00:00:00 2001 From: krofax Date: Thu, 15 May 2025 16:29:11 +0100 Subject: [PATCH 06/23] updated the steps --- .../tutorials/absolute-prestate.mdx | 56 +++++++++++-------- 1 file changed, 34 insertions(+), 22 deletions(-) diff --git a/pages/operators/chain-operators/tutorials/absolute-prestate.mdx b/pages/operators/chain-operators/tutorials/absolute-prestate.mdx index d8da563f5..b20faa939 100644 --- a/pages/operators/chain-operators/tutorials/absolute-prestate.mdx +++ b/pages/operators/chain-operators/tutorials/absolute-prestate.mdx @@ -55,42 +55,54 @@ This upgrade offers several advantages: git clone https://github.com/ethereum-optimism/optimism.git cd optimism git checkout op-program/v1.6.1-rc.1 # Use the latest tagged version + git submodule update --init --recursive - ``` +``` - + Always use a specific tagged version of op-program as specified in the Superchain registry or official release notes. Current releases use versions like `op-program/v1.6.0-rc.2` for Isthmus hardfork support. - ### Initialize the repository +### Build the op-program - Initialize the repository with all necessary dependencies: +Build the op-program binary: - ```bash - make devnet-genesis - ``` +```bash +make op-program +``` - Generate the absolute prestate by running: +### Generate the absolute prestate - ```bash - cd op-program - make cannon-prestate - ``` +Generate the prestate by running the op-program binary directly: - This command will: +```bash - 1. Compile the op-program - 2. Generate the absolute prestate hash - 3. Create the preimage file +bash +./op-program/bin/op-program prestate - ### Verify the generated prestate +``` - Verify the absolute prestate by checking the hash: +For older versions (prior to Upgrade 14), you might use: - ```bash - cd ..# Return to monorepo root - ./op-program/bin/op-program --version - ``` +```bash +cd op-program +make reproducible-prestate +cd .. + +``` + + + The exact command may vary based on the specific version you're using. Check the available commands with `./op-program/bin/op-program --help` or `make -C op-program help`. + + +### Verify the generated prestate + +Verify the absolute prestate by checking the hash: + +```bash +./op-program/bin/op-program --version + +``` The output should display three prestate hashes: From 507563ff78d14bd17cd419c88e458afd9f14977b Mon Sep 17 00:00:00 2001 From: krofax Date: Fri, 16 May 2025 14:51:00 +0100 Subject: [PATCH 07/23] updated docs --- .../operators/chain-operators/tutorials/absolute-prestate.mdx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pages/operators/chain-operators/tutorials/absolute-prestate.mdx b/pages/operators/chain-operators/tutorials/absolute-prestate.mdx index b20faa939..76b9e9b30 100644 --- a/pages/operators/chain-operators/tutorials/absolute-prestate.mdx +++ b/pages/operators/chain-operators/tutorials/absolute-prestate.mdx @@ -28,6 +28,7 @@ These files are essential for the op-challenger tool to participate in dispute g Before starting, ensure you have: * Run `op-contracts/v2.0.0` or higher on your chain +* Have [docker](https://docs.docker.com/engine/install/) running * You have sufficient system resources (memory and disk space) ## Using the latest AP and multi-threaded Cannon @@ -76,8 +77,6 @@ make op-program Generate the prestate by running the op-program binary directly: ```bash - -bash ./op-program/bin/op-program prestate ``` From e85b2245b2f2f78136f0cefc5a3b2df09e075a37 Mon Sep 17 00:00:00 2001 From: krofax Date: Fri, 16 May 2025 18:31:11 +0100 Subject: [PATCH 08/23] updated the instruction --- .../tutorials/absolute-prestate.mdx | 47 +++++++------------ 1 file changed, 16 insertions(+), 31 deletions(-) diff --git a/pages/operators/chain-operators/tutorials/absolute-prestate.mdx b/pages/operators/chain-operators/tutorials/absolute-prestate.mdx index 76b9e9b30..412644e21 100644 --- a/pages/operators/chain-operators/tutorials/absolute-prestate.mdx +++ b/pages/operators/chain-operators/tutorials/absolute-prestate.mdx @@ -77,37 +77,35 @@ make op-program Generate the prestate by running the op-program binary directly: ```bash -./op-program/bin/op-program prestate - +cd op-program +make reproducible-prestate +cd .. ``` -For older versions (prior to Upgrade 14), you might use: +The output should look like this: ```bash -cd op-program -make reproducible-prestate -cd .. -``` +-------------------- Production Prestates -------------------- - - The exact command may vary based on the specific version you're using. Check the available commands with `./op-program/bin/op-program --help` or `make -C op-program help`. - +Cannon64 Absolute prestate hash: +0x03eb07101fbdeaf3f04d9fb76526362c1eea2824e4c6e970bdb19675b72e4fc8 -### Verify the generated prestate +-------------------- Experimental Prestates -------------------- -Verify the absolute prestate by checking the hash: +CannonInterop Absolute prestate hash: +0x03fc3b4d091527d53f1ff369ea8ed65e5e17cc7fc98ebf75380238151cdc949c -```bash -./op-program/bin/op-program --version +Cannon64Next Absolute prestate hash: +0x03eb07101fbdeaf3f04d9fb76526362c1eea2824e4c6e970bdb19675b72e4fc8 ``` The output should display three prestate hashes: - * Cannon absolute prestate hash (legacy) - * Cannon64 absolute prestate hash (64-bit version) - * CannonInterop absolute prestate hash (for interoperability) + * `Cannon64`: The current production absolute prestate hash for the 64-bit version of Cannon + * `CannonInterop`: The absolute prestate hash used for interoperability + * `Cannon64Next`: The next state version for Cannon with in-progress features (like Go 1.24 support) For permissionless fault proofs, you'll primarily use the Cannon64 absolute prestate hash. @@ -127,24 +125,16 @@ Verify the absolute prestate by checking the hash: The Superchain registry maintains official absolute prestate hashes for chains that are part of the registry. These prestates include the configurations of all chains in the Superchain registry. - - - For chains listed in the Superchain registry, you should use the official prestate hashes rather than generating your own. - +For chains listed in the Superchain registry, you should use the official prestate hashes rather than generating your own. You can find the latest prestate tags in the [Superchain registry](https://github.com/ethereum-optimism/superchain-registry/blob/main/validation/standard/standard-prestates.toml). -Current official prestate hashes for Isthmus hardfork (as of writing): - -* Sepolia chains: `0x03682932cec7ce0a3874b19675a6bbc923054a7b321efc7d3835187b172494b6` (using op-program/v1.6.0-rc.2) - ## Handling unannounced chain configurations If your chain is not included in the Superchain registry, you'll need to generate a custom prestate with your specific chain configuration. This applies to: * New chains * Chains with custom configurations -* "Stealth launches" or other unannounced chains For these cases, follow these additional steps: @@ -163,19 +153,14 @@ For these cases, follow these additional steps: make cannon-prestate ROLLUP_CONFIG=/path/to/your/rollup.json L2_GENESIS=/path/to/your/genesis-l2.json ``` - ### Process and verify - - Verify and prepare the preimage file as described in Steps 4-5 above - The initial prestate used for permissioned games doesn't include the necessary chain configuration for the Fault proof system. The assumption is that the chain operator, the single permissioned actor, will not challenge their own games. So the absolute prestate on the initial `PermissionedDisputeGame` will never be used. When deploying a new chain, you must first deploy the L1 contracts and then retrieve the artifacts. These are inputs to the creation of the absolute prestate and this circular dependency is the reason chains cannot be deployed directly to the permissionless Fault Proof System. - ## Deploying and configuring with the absolute prestate From 6825305016f87530a637ec93b2ecc1cead552683 Mon Sep 17 00:00:00 2001 From: krofax Date: Mon, 19 May 2025 18:24:28 +0100 Subject: [PATCH 09/23] updated the docs content --- .../tutorials/absolute-prestate.mdx | 118 ++++++++++++------ 1 file changed, 82 insertions(+), 36 deletions(-) diff --git a/pages/operators/chain-operators/tutorials/absolute-prestate.mdx b/pages/operators/chain-operators/tutorials/absolute-prestate.mdx index 412644e21..08a8fd400 100644 --- a/pages/operators/chain-operators/tutorials/absolute-prestate.mdx +++ b/pages/operators/chain-operators/tutorials/absolute-prestate.mdx @@ -27,9 +27,8 @@ These files are essential for the op-challenger tool to participate in dispute g Before starting, ensure you have: -* Run `op-contracts/v2.0.0` or higher on your chain -* Have [docker](https://docs.docker.com/engine/install/) running -* You have sufficient system resources (memory and disk space) +* [Docker](https://docs.docker.com/engine/install/) running +* Have sufficient disk space and memory ## Using the latest AP and multi-threaded Cannon @@ -56,14 +55,10 @@ This upgrade offers several advantages: git clone https://github.com/ethereum-optimism/optimism.git cd optimism git checkout op-program/v1.6.1-rc.1 # Use the latest tagged version - git submodule update --init --recursive + git submodule update --init --recursive # Initialize submodules ``` - - Always use a specific tagged version of op-program as specified in the Superchain registry or official release notes. Current releases use versions like `op-program/v1.6.0-rc.2` for Isthmus hardfork support. - - ### Build the op-program Build the op-program binary: @@ -111,6 +106,9 @@ Cannon64Next Absolute prestate hash: ### Prepare the preimage file + After generating the prestate, find the preimage file. + You should see a file named `prestate-mt64.bin.gz` or similar (the exact name might vary based on the version). + Rename this file to include the prestate hash: The preimage file is located at `op-program/bin/prestate-mt64.bin.gz`. Rename it to match the prestate hash: ```bash @@ -119,6 +117,7 @@ Cannon64Next Absolute prestate hash: ``` Replace `[CANNON64_PRESTATE_HASH]` with the actual `Cannon64` absolute prestate hash value from the output. + This file needs to be uploaded to a location that's accessible by your op-challenger instances. ## Official prestate hashes for Superchain registry chains @@ -138,29 +137,71 @@ If your chain is not included in the Superchain registry, you'll need to generat For these cases, follow these additional steps: -### For chains not in the Superchain registry - - ### Prepare configuration files - Ensure your chain's rollup configuration and L2 genesis file are accessible +### Create a directory for your custom chain configuration +```bash +mkdir -p op-program/chainconfig/configs +``` - ### Generate custom prestate - Generate the absolute prestate using your specific configuration: +### Copy your chain configuration files to this directory - ```bash - cd op-program - make cannon-prestate ROLLUP_CONFIG=/path/to/your/rollup.json L2_GENESIS=/path/to/your/genesis-l2.json - ``` +First, you need to obtain your chain's configuration files. These are typically generated when you [deploy your L2 chain](/operators/chain-operators/deploy/smart-contracts) with op-deployer: - +* ***rollup.json**: The rollup configuration file +* **genesis.json**: The L2 genesis file + +Name them according to the required format: + +```bash +# Replace 67865 with your actual chain ID +cp /path/to/rollup.json op-program/chainconfig/configs/67865-rollup.json +cp /path/to/genesis.json op-program/chainconfig/configs/67865-genesis-l2.json +``` +Note: The naming format is critical - the files must be named as: + +* `-rollup.json` +* `-genesis-l2.json` + +These files are outputs from your L2 chain deployment process using op-deployer. + +### Generate the prestate + +From the root of the monorepo, run: + +```bash +make reproducible-prestate +``` +Alternatively, you can also specify the paths directly: + +```bash +make reproducible-prestate ROLLUP_CONFIG=/path/to/67865-rollup.json L2_GENESIS=/path/to/67865-genesis-l2.json +``` + +This should generate output containing three prestate hashes: + +```bash +-------------------- Production Prestates -------------------- + +Cannon64 Absolute prestate hash: +0x03eb07101fbdeaf3f04d9fb76526362c1eea2824e4c6e970bdb19675b72e4fc8 + +-------------------- Experimental Prestates -------------------- + +CannonInterop Absolute prestate hash: +0x03fc3b4d091527d53f1ff369ea8ed65e5e17cc7fc98ebf75380238151cdc949c + +Cannon64Next Absolute prestate hash: +0x03eb07101fbdeaf3f04d9fb76526362c1eea2824e4c6e970bdb19675b72e4fc8 + +``` - The initial prestate used for permissioned games doesn't include the necessary chain configuration for the Fault proof system. - The assumption is that the chain operator, the single permissioned actor, will not challenge their own games. - So the absolute prestate on the initial `PermissionedDisputeGame` will never be used. +For current production use, you should use the `Cannon64` Absolute prestate hash. - When deploying a new chain, you must first deploy the L1 contracts and then retrieve the artifacts. - These are inputs to the creation of the absolute prestate and this circular dependency is the reason chains cannot be deployed directly to the permissionless Fault Proof System. +### Locate and prepare the preimage File +Follow this [step](/operators/chain-operators/tutorials/absolute-prestate#prepare-the-preimage-file) + + ## Deploying and configuring with the absolute prestate @@ -180,24 +221,29 @@ After generating the absolute prestate and preimage files, you'll need to: --trace-type permissioned,cannon \ --prestates-url \ --l1-eth-rpc \ + --rollup-rpc \ --game-factory-address \ - --network + --cannon-rollup-config /path/to/your/-rollup.json \ + --cannon-l2-genesis /path/to/your/-genesis-l2.json \ + --network \ + --datadir ``` + Replace `` with the URL where you've stored your prestate files. + The `--prestates-url` should point to the directory where you've uploaded the renamed prestate file from step 3. -## Next Steps - -After successfully generating and deploying the absolute prestate: - -1. Monitor your op-challenger service to ensure it can properly participate in dispute games -2. Consider setting up redundant challenger instances for enhanced reliability -3. Keep track of future upgrades that may require new absolute prestates + +Ensure you're using the latest op-challenger version, see the [release page](https://github.com/ethereum-optimism/optimism/release) +The dispute game factory address must be manually specified via the `--game-factory-address` option. +If your chain uses interoperability features, you'll need to add a `depsets.json` file to the `op-program/chainconfig/configs` directory. +This file contains dependency set configurations in the same format as the op-supervisor's configs. You can extract this from your existing op-supervisor setup. + -For more information, refer to the following resources: +## Next Steps -* [Migrating to Permissionless Fault Proofs Guide](/operators/chain-operators/tutorials/migrating-permissionless) -* [Deploying New Dispute Games with OPCM](/operators/chain-operators/tutorials/dispute-games) -* [Fault Proofs Explainer](/stack/fault-proofs/explainer) +* [Deploying new dispute games with OPCM](/operators/chain-operators/tutorials/dispute-games) +* [Migrating to permissionless fault proofs](/operators/chain-operators/tutorials/migrating-permissionless) +* [Fault proofs explainer](/stack/fault-proofs/explainer) From d3fd8a65dea804addb80e6957729f5417d3c5d98 Mon Sep 17 00:00:00 2001 From: Blessing Krofegha Date: Mon, 19 May 2025 10:31:34 -0700 Subject: [PATCH 10/23] Update pages/operators/chain-operators/tutorials/absolute-prestate.mdx Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> --- pages/operators/chain-operators/tutorials/absolute-prestate.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/operators/chain-operators/tutorials/absolute-prestate.mdx b/pages/operators/chain-operators/tutorials/absolute-prestate.mdx index 08a8fd400..4ac30a4fc 100644 --- a/pages/operators/chain-operators/tutorials/absolute-prestate.mdx +++ b/pages/operators/chain-operators/tutorials/absolute-prestate.mdx @@ -30,7 +30,7 @@ Before starting, ensure you have: * [Docker](https://docs.docker.com/engine/install/) running * Have sufficient disk space and memory -## Using the latest AP and multi-threaded Cannon +## Using the latest absolute prestate and multi-threaded Cannon As of the latest releases, OP Stack chains should utilize the `64-bit` MIPS multi-threaded version of Cannon. This upgrade offers several advantages: From 33ac6d396f8c8c49504cd8e6d3b4d80fdbcc53e1 Mon Sep 17 00:00:00 2001 From: krofax Date: Tue, 20 May 2025 17:55:36 +0100 Subject: [PATCH 11/23] updated the configs to use op challengers --- .../tutorials/absolute-prestate.mdx | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/pages/operators/chain-operators/tutorials/absolute-prestate.mdx b/pages/operators/chain-operators/tutorials/absolute-prestate.mdx index 4ac30a4fc..493c3cbb9 100644 --- a/pages/operators/chain-operators/tutorials/absolute-prestate.mdx +++ b/pages/operators/chain-operators/tutorials/absolute-prestate.mdx @@ -217,16 +217,15 @@ After generating the absolute prestate and preimage files, you'll need to: Configure the op-challenger to use this prestate: ```bash - op-challenger \ - --trace-type permissioned,cannon \ - --prestates-url \ - --l1-eth-rpc \ - --rollup-rpc \ - --game-factory-address \ - --cannon-rollup-config /path/to/your/-rollup.json \ - --cannon-l2-genesis /path/to/your/-genesis-l2.json \ - --network \ - --datadir + docker run -d --name op-challenger \ + -e OP_CHALLENGER_TRACE_TYPE=permissioned,cannon \ + -e OP_CHALLENGER_PRESTATES_URL= \ + -e OP_CHALLENGER_L1_ETH_RPC= \ + -e OP_CHALLENGER_GAME_FACTORY_ADDRESS= \ + -e OP_CHALLENGER_PRIVATE_KEY= \ + -e OP_CHALLENGER_NETWORK= \ + -v /path/to/local/prestates:/prestates \ + us-docker.pkg.dev/oplabs-tools-artifacts/images/op-challenger:latest #use the latest version ``` From 0d6f667bfefa798948e543f53fe4190bcae3476f Mon Sep 17 00:00:00 2001 From: krofax Date: Tue, 20 May 2025 18:56:41 +0100 Subject: [PATCH 12/23] update the command --- pages/operators/chain-operators/tutorials/absolute-prestate.mdx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pages/operators/chain-operators/tutorials/absolute-prestate.mdx b/pages/operators/chain-operators/tutorials/absolute-prestate.mdx index 493c3cbb9..248301f5d 100644 --- a/pages/operators/chain-operators/tutorials/absolute-prestate.mdx +++ b/pages/operators/chain-operators/tutorials/absolute-prestate.mdx @@ -224,6 +224,8 @@ After generating the absolute prestate and preimage files, you'll need to: -e OP_CHALLENGER_GAME_FACTORY_ADDRESS= \ -e OP_CHALLENGER_PRIVATE_KEY= \ -e OP_CHALLENGER_NETWORK= \ + -e OP_CHALLENGER_CANNON_ROLLUP_CONFIG= \ + -e OP_CHALLENGER_CANNON_L2_GENESIS= \ -v /path/to/local/prestates:/prestates \ us-docker.pkg.dev/oplabs-tools-artifacts/images/op-challenger:latest #use the latest version ``` From 8e325c2d4719bb61e79b1a38503a139dbc82a372 Mon Sep 17 00:00:00 2001 From: Blessing Krofegha Date: Wed, 21 May 2025 14:03:21 +0100 Subject: [PATCH 13/23] Update pages/operators/chain-operators/tutorials/absolute-prestate.mdx Co-authored-by: Adrian Sutton --- pages/operators/chain-operators/tutorials/absolute-prestate.mdx | 1 - 1 file changed, 1 deletion(-) diff --git a/pages/operators/chain-operators/tutorials/absolute-prestate.mdx b/pages/operators/chain-operators/tutorials/absolute-prestate.mdx index 248301f5d..443910be1 100644 --- a/pages/operators/chain-operators/tutorials/absolute-prestate.mdx +++ b/pages/operators/chain-operators/tutorials/absolute-prestate.mdx @@ -72,7 +72,6 @@ make op-program Generate the prestate by running the op-program binary directly: ```bash -cd op-program make reproducible-prestate cd .. ``` From 28676fa9ef57f76115f081b8906c69e37bff68b7 Mon Sep 17 00:00:00 2001 From: Blessing Krofegha Date: Wed, 21 May 2025 14:03:36 +0100 Subject: [PATCH 14/23] update the command --- .../chain-operators/tutorials/absolute-prestate.mdx | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/pages/operators/chain-operators/tutorials/absolute-prestate.mdx b/pages/operators/chain-operators/tutorials/absolute-prestate.mdx index 248301f5d..415dfdcce 100644 --- a/pages/operators/chain-operators/tutorials/absolute-prestate.mdx +++ b/pages/operators/chain-operators/tutorials/absolute-prestate.mdx @@ -54,19 +54,14 @@ This upgrade offers several advantages: ```bash git clone https://github.com/ethereum-optimism/optimism.git cd optimism - git checkout op-program/v1.6.1-rc.1 # Use the latest tagged version + # For production chains, use the latest finalized release (not an rc) + git checkout op-program/v1.6.1 # Use the latest stable version + # For testnets and devnets, you might use: + git checkout op-program/v1.6.1-rc.1 git submodule update --init --recursive # Initialize submodules ``` -### Build the op-program - -Build the op-program binary: - -```bash -make op-program -``` - ### Generate the absolute prestate Generate the prestate by running the op-program binary directly: From 930155f75265037acb51b793630f862ac50afbe8 Mon Sep 17 00:00:00 2001 From: Blessing Krofegha Date: Wed, 21 May 2025 14:04:35 +0100 Subject: [PATCH 15/23] Auto-fix: Update breadcrumbs, spelling dictionary and other automated fixes --- words.txt | 230 +++++++++++++++++++++++++++--------------------------- 1 file changed, 115 insertions(+), 115 deletions(-) diff --git a/words.txt b/words.txt index ead225f77..1b1791a8e 100644 --- a/words.txt +++ b/words.txt @@ -1,7 +1,7 @@ -accountqueue ACCOUNTQUEUE -accountslots +accountqueue ACCOUNTSLOTS +accountslots ACDC ADDI ADDIU @@ -9,58 +9,58 @@ ADDU airgap Allnodes allocs -alphanet Alphanet -alphanets +alphanet Alphanets +alphanets altda ANDI Ankr Apeworx Arweave authrpc -autorelay Autorelay +autorelay autorelayer basefee bcde -betanet Betanet -betanets +betanet Betanets +betanets BGEZ BGTZ Biconomy BLEZ -blobpool BLOBPOOL +blobpool blobspace Blockdaemon blockhash blocklists -blocklogs BLOCKLOGS -blockprofilerate +blocklogs BLOCKPROFILERATE +blockprofilerate Blockscout -blockspace Blockspace +blockspace blocktime -blocktimes Blocktimes -bloomfilter +blocktimes BLOOMFILTER +bloomfilter BLTZ Bootcamp bootnode -bootnodes -Bootnodes BOOTNODES +Bootnodes +bootnodes bottlenecked -brotli Brotli -callouts +brotli Callouts +callouts CCIP cdef Celestia @@ -72,65 +72,65 @@ chaosnet Chugsplash Clabby codebases -collateralized Collateralized +collateralized compr Comprensive -computependingblock COMPUTEPENDINGBLOCK +computependingblock confs Consen corsdomain counterfactually -crosschain Crosschain +crosschain Crossmint Dapphub daserver -datacap DATACAP -datadir +datacap DATADIR +datadir devdocs -devnet Devnet -devnets +devnet Devnets +devnets direnv -disabletxpoolgossip DISABLETXPOOLGOSSIP -discv +disabletxpoolgossip Discv +discv DIVU Drand dripcheck Drippie Eigen EIPs -enabledeprecatedpersonal ENABLEDEPRECATEDPERSONAL +enabledeprecatedpersonal enginekind -erigon Erigon -etherbase +erigon ETHERBASE +etherbase Ethernity Ethernow -ethstats ETHSTATS -evmtimeout +ethstats EVMTIMEOUT +evmtimeout excercise executability exfiltrate -exitwhensynced EXITWHENSYNCED -extradata +exitwhensynced EXTRADATA +extradata Farcaster Faultproof -fdlimit FDLIMIT +fdlimit Flashblocks Flashbots forkable @@ -141,52 +141,52 @@ Fraxtal funcationality Funct gameplay -gascap GASCAP +gascap gaslessly -gcmode GCMODE +gcmode Gelato gifs -globalqueue GLOBALQUEUE -globalslots +globalqueue GLOBALSLOTS +globalslots gokzg growthepie hardfork hardforks -healthcheck HEALTHCHECK +healthcheck healthchecks -historicalrpc HISTORICALRPC -historicalrpctimeout +historicalrpc HISTORICALRPCTIMEOUT -holesky -Holesky +historicalrpctimeout HOLESKY +Holesky +holesky IERC -ignoreprice IGNOREPRICE +ignoreprice Immunefi -inator Inator -influxdbv +inator INFLUXDBV +influxdbv initcode -ipcdisable IPCDISABLE +ipcdisable ipcfile -ipcpath IPCPATH +ipcpath IPFS Isthumus JALR -journalremotes JOURNALREMOTES -jspath +journalremotes JSPATH +jspath jwtsecret Keccak leveldb @@ -195,34 +195,34 @@ Lisk logfile logfmt Mainnets -maxage MAXAGE -maxbackups +maxage MAXBACKUPS -maxpeers +maxbackups MAXPEERS -maxpendpeers +maxpeers MAXPENDPEERS -maxprice +maxpendpeers MAXPRICE -memprofilerate +maxprice MEMPROFILERATE -merkle +memprofilerate Merkle +merkle MFHI MFLO Mgas Minato -minfreedisk MINFREEDISK -minsuggestedpriorityfee +minfreedisk MINSUGGESTEDPRIORITYFEE +minsuggestedpriorityfee Mintable Mintplex MIPSEVM Mitigations -monitorism Monitorism +monitorism Moralis Mordor mountpoint @@ -232,44 +232,44 @@ MTHI MTLO MULT multiaddr -multichain Multichain +multichain multiclient multisigs MULTU nethermind -netrestrict NETRESTRICT -networkid +netrestrict NETWORKID -newpayload +networkid NEWPAYLOAD +newpayload nextra -nocompaction NOCOMPACTION -nodekey +nocompaction NODEKEY -nodekeyhex +nodekey NODEKEYHEX +nodekeyhex nodename Nodies -nodiscover NODISCOVER -nolocals +nodiscover NOLOCALS -noprefetch +nolocals NOPREFETCH -nopruning +noprefetch NOPRUNING -nosyncserve +nopruning NOSYNCSERVE +nosyncserve Numba -offchain Offchain +offchain opchaina opchainb -opcm OPCM +opcm Openfort oplabs opnode's @@ -277,96 +277,96 @@ opstack outfile Pausability pcscdpath -pectra Pectra +pectra Pectra's -peerstore Peerstore +peerstore peerstores -permissioned Permissioned -permissionless +permissioned Permissionless +permissionless permissionlessly Perps Peta Pimlico POAP POAPs -pprof PPROF -precommitments +pprof Precommitments +precommitments preconfigured predeploy -predeployed Predeployed -predeploys +predeployed Predeploys +predeploys prefunded -preimage Preimage -preimages +preimage PREIMAGES +preimages preinstall -preinstalls Preinstalls -prestate +preinstalls Prestate +prestate prestates PREVRANDAO -pricebump PRICEBUMP -pricelimit +pricebump PRICELIMIT +pricelimit productionize productionized Protip Proxied -proxyd Proxyd +proxyd Pyth Pyth's QRNG -quicknode Quicknode +quicknode quickstarts rebalancing -regenesis Regenesis +regenesis Reimagine -rejournal REJOURNAL -remotedb +rejournal REMOTEDB +remotedb Reown Reown's replayability replayor reposts reproven -requiredblocks REQUIREDBLOCKS +requiredblocks rollouts -rollups Rollups +rollups Routescan rpckind -rpcprefix RPCPREFIX +rpcprefix rpcs RPGF -runbooks Runbooks +runbooks RWAs safedb Schnorr -sepolia -Sepolia SEPOLIA +Sepolia +sepolia seqnr -sequencerhttp SEQUENCERHTTP +sequencerhttp serv signup SLLV @@ -375,16 +375,16 @@ SLTIU SLTU smartcard snapshotlog -snapsync Snapsync +snapsync Solana Soneium soyboy Spearbit SRAV SRLV -stablecoins Stablecoins +stablecoins statefulset structs subcomponents @@ -393,21 +393,21 @@ subheaders subsecond SUBU Sunnyside -superchain -Superchain SUPERCHAIN +Superchain +superchain Superchain's superchainerc Superlend Superloans Superscan Superseed -supersim Supersim -syncmode +supersim SYNCMODE -synctarget +syncmode SYNCTARGET +synctarget syscalls SYSCON thirdweb @@ -420,8 +420,8 @@ Twei txfeecap txmgr txns -txpool TXPOOL +txpool txproxy txproxyd uncensorable @@ -432,21 +432,21 @@ Unprotect unsubmitted UPNP upstreaming -verkle VERKLE -vhosts +verkle VHOSTS -viem +vhosts Viem -viem's +viem Viem's -vmdebug +viem's VMDEBUG -vmodule +vmdebug VMODULE +vmodule xlarge XORI ZKPs ZKVM -zora Zora +zora From fce41f4aaf7fc99c2054581c01ce37d5afb92bbc Mon Sep 17 00:00:00 2001 From: Blessing Krofegha Date: Wed, 21 May 2025 14:12:04 +0100 Subject: [PATCH 16/23] Update pages/operators/chain-operators/tutorials/absolute-prestate.mdx Co-authored-by: Adrian Sutton --- .../operators/chain-operators/tutorials/absolute-prestate.mdx | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/pages/operators/chain-operators/tutorials/absolute-prestate.mdx b/pages/operators/chain-operators/tutorials/absolute-prestate.mdx index 443910be1..a20df936b 100644 --- a/pages/operators/chain-operators/tutorials/absolute-prestate.mdx +++ b/pages/operators/chain-operators/tutorials/absolute-prestate.mdx @@ -105,10 +105,8 @@ Cannon64Next Absolute prestate hash: ### Prepare the preimage file - After generating the prestate, find the preimage file. - You should see a file named `prestate-mt64.bin.gz` or similar (the exact name might vary based on the version). + After generating the prestate, the preimage file will be located in `op-program/bin/prestate-mt64.bin.gz`. The exact name might vary based on the version. Rename this file to include the prestate hash: - The preimage file is located at `op-program/bin/prestate-mt64.bin.gz`. Rename it to match the prestate hash: ```bash cd op-program/bin From 4c478a93afd0b71e00f3d886a130d5fc012adf88 Mon Sep 17 00:00:00 2001 From: Blessing Krofegha Date: Wed, 21 May 2025 15:13:23 +0100 Subject: [PATCH 17/23] update the docs based on reviews --- .../tutorials/absolute-prestate.mdx | 49 ++++++++++++------- 1 file changed, 31 insertions(+), 18 deletions(-) diff --git a/pages/operators/chain-operators/tutorials/absolute-prestate.mdx b/pages/operators/chain-operators/tutorials/absolute-prestate.mdx index 415dfdcce..305af801b 100644 --- a/pages/operators/chain-operators/tutorials/absolute-prestate.mdx +++ b/pages/operators/chain-operators/tutorials/absolute-prestate.mdx @@ -64,14 +64,14 @@ This upgrade offers several advantages: ### Generate the absolute prestate -Generate the prestate by running the op-program binary directly: +After placing your configuration files in the proper location, run the following command from the root of the monorepo: ```bash -cd op-program make reproducible-prestate -cd .. ``` +The command will automatically detect and use the configuration files you placed in the `op-program/chainconfig/configs` directory. + The output should look like this: ```bash @@ -91,13 +91,12 @@ Cannon64Next Absolute prestate hash: ``` - The output should display three prestate hashes: - - * `Cannon64`: The current production absolute prestate hash for the 64-bit version of Cannon - * `CannonInterop`: The absolute prestate hash used for interoperability - * `Cannon64Next`: The next state version for Cannon with in-progress features (like Go 1.24 support) + The output will display production and experimental prestate hashes: - For permissionless fault proofs, you'll primarily use the Cannon64 absolute prestate hash. + * **Production prestates**: Contains the `Cannon64` prestate, which is the current production absolute prestate hash for the 64-bit version of Cannon. + This is the hash you should use for permissionless fault proofs. + + * **Experimental prestates**: These contain prestates for versions that are in development and not yet ready for production use. ### Prepare the preimage file @@ -118,8 +117,17 @@ Cannon64Next Absolute prestate hash: ## Official prestate hashes for Superchain registry chains The Superchain registry maintains official absolute prestate hashes for chains that are part of the registry. -These prestates include the configurations of all chains in the Superchain registry. -For chains listed in the Superchain registry, you should use the official prestate hashes rather than generating your own. +These prestates include the configurations of chains that were in the Superchain registry at the time the prestate was created. + + + Important: A prestate listed in the Superchain registry may not be suitable for your chain if: + * Your chain was added to the registry after the prestate was created + * The configuration for your chain has been updated since the prestate was created + + Before using a prestate from the registry, verify that it contains the latest configuration for your chain. + + When in doubt, generating your own prestate with your specific chain configuration is the safest approach. + You can find the latest prestate tags in the [Superchain registry](https://github.com/ethereum-optimism/superchain-registry/blob/main/validation/standard/standard-prestates.toml). @@ -134,11 +142,16 @@ For these cases, follow these additional steps: -### Create a directory for your custom chain configuration +### Verify the chain configuration directory exists +The directory for custom chain configurations already exists in a valid checkout of the monorepo: + ```bash -mkdir -p op-program/chainconfig/configs +# Verify the directory exists +ls -la op-program/chainconfig/configs ``` +If this directory doesn't exist, you may be using a version of the monorepo that doesn't support custom configs. + ### Copy your chain configuration files to this directory First, you need to obtain your chain's configuration files. These are typically generated when you [deploy your L2 chain](/operators/chain-operators/deploy/smart-contracts) with op-deployer: @@ -159,19 +172,19 @@ Note: The naming format is critical - the files must be named as: * `-genesis-l2.json` These files are outputs from your L2 chain deployment process using op-deployer. +For long-term preservation and reproducibility, commit these configuration files to a git branch in your own fork of the monorepo. +This ensures you can always rebuild the prestate in the future by checking out that branch and running `make reproducible-prestate`, even if your original files are lost. + ### Generate the prestate -From the root of the monorepo, run: +After placing your configuration files in the proper location, run the following command from the root of the monorepo: ```bash make reproducible-prestate ``` -Alternatively, you can also specify the paths directly: -```bash -make reproducible-prestate ROLLUP_CONFIG=/path/to/67865-rollup.json L2_GENESIS=/path/to/67865-genesis-l2.json -``` +The command will automatically detect and use the configuration files you placed in the `op-program/chainconfig/configs` directory. This should generate output containing three prestate hashes: From 51ad3353edde62558ccccc7b96b8066066fa31d3 Mon Sep 17 00:00:00 2001 From: Blessing Krofegha Date: Wed, 21 May 2025 15:51:47 +0100 Subject: [PATCH 18/23] updated the contents from suggestions --- .../tutorials/absolute-prestate.mdx | 38 +++++++++++++++---- 1 file changed, 31 insertions(+), 7 deletions(-) diff --git a/pages/operators/chain-operators/tutorials/absolute-prestate.mdx b/pages/operators/chain-operators/tutorials/absolute-prestate.mdx index 305af801b..64a37594c 100644 --- a/pages/operators/chain-operators/tutorials/absolute-prestate.mdx +++ b/pages/operators/chain-operators/tutorials/absolute-prestate.mdx @@ -222,12 +222,37 @@ After generating the absolute prestate and preimage files, you'll need to: ### Configure op-challenger - Configure the op-challenger to use this prestate: + Configure the op-challenger to use the generated prestate. There are two ways to provide prestates: + + + ### Option 1: Using HTTP URL (Recommended for production) + If your prestate files are hosted on a web server, you can simply provide the URL to the directory containing those files: + + ```bash + docker run -d --name op-challenger \ + -e OP_CHALLENGER_TRACE_TYPE=permissioned,cannon \ + -e OP_CHALLENGER_PRESTATES_URL= \ + -e OP_CHALLENGER_L1_ETH_RPC= \ + -e OP_CHALLENGER_GAME_FACTORY_ADDRESS= \ + -e OP_CHALLENGER_PRIVATE_KEY= \ + -e OP_CHALLENGER_NETWORK= \ + -e OP_CHALLENGER_CANNON_ROLLUP_CONFIG= \ + -e OP_CHALLENGER_CANNON_L2_GENESIS= \ + us-docker.pkg.dev/oplabs-tools-artifacts/images/op-challenger:latest + ``` + + + When using an HTTP URL, no volume mount is required. The challenger will download the prestate files as needed. + + + ### Option 2: Using local files + + If you have prestate files stored locally, you'll need to mount them as a volume and use the `file://` protocol: ```bash docker run -d --name op-challenger \ -e OP_CHALLENGER_TRACE_TYPE=permissioned,cannon \ - -e OP_CHALLENGER_PRESTATES_URL= \ + -e OP_CHALLENGER_PRESTATES_URL=file:///prestates \ -e OP_CHALLENGER_L1_ETH_RPC= \ -e OP_CHALLENGER_GAME_FACTORY_ADDRESS= \ -e OP_CHALLENGER_PRIVATE_KEY= \ @@ -235,13 +260,12 @@ After generating the absolute prestate and preimage files, you'll need to: -e OP_CHALLENGER_CANNON_ROLLUP_CONFIG= \ -e OP_CHALLENGER_CANNON_L2_GENESIS= \ -v /path/to/local/prestates:/prestates \ - us-docker.pkg.dev/oplabs-tools-artifacts/images/op-challenger:latest #use the latest version + us-docker.pkg.dev/oplabs-tools-artifacts/images/op-challenger:latest ``` - - Replace `` with the URL where you've stored your prestate files. - The `--prestates-url` should point to the directory where you've uploaded the renamed prestate file from step 3. - + + When using local files, ensure your prestate files are in the mounted directory and properly named with their hash (e.g., `0x03eb07101fbdeaf3f04d9fb76526362c1eea2824e4c6e970bdb19675b72e4fc8.bin.gz`). + From 43e471d6d8824322ecffc4e2913f6be27d43363e Mon Sep 17 00:00:00 2001 From: Blessing Krofegha Date: Wed, 21 May 2025 16:03:56 +0100 Subject: [PATCH 19/23] Update pages/operators/chain-operators/tutorials/absolute-prestate.mdx Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> --- pages/operators/chain-operators/tutorials/absolute-prestate.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/operators/chain-operators/tutorials/absolute-prestate.mdx b/pages/operators/chain-operators/tutorials/absolute-prestate.mdx index a20df936b..e6cceddca 100644 --- a/pages/operators/chain-operators/tutorials/absolute-prestate.mdx +++ b/pages/operators/chain-operators/tutorials/absolute-prestate.mdx @@ -145,7 +145,7 @@ mkdir -p op-program/chainconfig/configs First, you need to obtain your chain's configuration files. These are typically generated when you [deploy your L2 chain](/operators/chain-operators/deploy/smart-contracts) with op-deployer: -* ***rollup.json**: The rollup configuration file +* **rollup.json**: The rollup configuration file * **genesis.json**: The L2 genesis file Name them according to the required format: From 0ae315a1ca6e98d8deac2b8d2d05095c6602a06b Mon Sep 17 00:00:00 2001 From: Blessing Krofegha Date: Wed, 21 May 2025 16:14:16 +0100 Subject: [PATCH 20/23] fix lint issues --- .../tutorials/absolute-prestate.mdx | 165 +++++++++--------- words.txt | 3 +- 2 files changed, 85 insertions(+), 83 deletions(-) diff --git a/pages/operators/chain-operators/tutorials/absolute-prestate.mdx b/pages/operators/chain-operators/tutorials/absolute-prestate.mdx index 64a37594c..12b403a57 100644 --- a/pages/operators/chain-operators/tutorials/absolute-prestate.mdx +++ b/pages/operators/chain-operators/tutorials/absolute-prestate.mdx @@ -18,9 +18,9 @@ import { Callout, Steps } from 'nextra/components' # Overview -Permissionless fault proofs are a critical component of the OP Stack's security model. They allow anyone to challenge invalid state proposals, ensuring the correctness of L2 to L1 withdrawals without relying on trusted third parties. +Permissionless fault proofs are a critical component of the OP Stack's security model. They allow anyone to challenge invalid state proposals, ensuring the correctness of L2 to L1 withdrawals without relying on trusted third parties. To enable this functionality, chain operators must generate and maintain the necessary absolute prestate and preimage files. -The absolute prestate is a commitment to the initial state of the fault proof program, and the preimage is the serialized binary representation of this program state. +The absolute prestate is a commitment to the initial state of the fault proof program, and the preimage is the serialized binary representation of this program state. These files are essential for the op-challenger tool to participate in dispute games when challenging invalid claims. ## Prerequisites @@ -32,7 +32,7 @@ Before starting, ensure you have: ## Using the latest absolute prestate and multi-threaded Cannon -As of the latest releases, OP Stack chains should utilize the `64-bit` MIPS multi-threaded version of Cannon. +As of the latest releases, OP Stack chains should utilize the `64-bit` MIPS multi-threaded version of Cannon. This upgrade offers several advantages: * Improved performance through parallelized execution @@ -40,7 +40,7 @@ This upgrade offers several advantages: * Support for the latest network upgrades - Beginning with [Upgrade 14](/notices/upgrade-14), all chains should use the `64-bit` multi-threaded version of Cannon. + Beginning with [Upgrade 14](/notices/upgrade-14), all chains should use the `64-bit` multi-threaded version of Cannon. The absolute prestate files for this version typically have the format `prestate-mt64.bin.gz`. @@ -60,43 +60,43 @@ This upgrade offers several advantages: git checkout op-program/v1.6.1-rc.1 git submodule update --init --recursive # Initialize submodules -``` + ``` -### Generate the absolute prestate + ### Generate the absolute prestate -After placing your configuration files in the proper location, run the following command from the root of the monorepo: + After placing your configuration files in the proper location, run the following command from the root of the monorepo: -```bash -make reproducible-prestate -``` + ```bash + make reproducible-prestate + ``` -The command will automatically detect and use the configuration files you placed in the `op-program/chainconfig/configs` directory. + The command will automatically detect and use the configuration files you placed in the `op-program/chainconfig/configs` directory. -The output should look like this: + The output should look like this: -```bash + ```bash --------------------- Production Prestates -------------------- + -------------------- Production Prestates -------------------- -Cannon64 Absolute prestate hash: -0x03eb07101fbdeaf3f04d9fb76526362c1eea2824e4c6e970bdb19675b72e4fc8 + Cannon64 Absolute prestate hash: + 0x03eb07101fbdeaf3f04d9fb76526362c1eea2824e4c6e970bdb19675b72e4fc8 --------------------- Experimental Prestates -------------------- + -------------------- Experimental Prestates -------------------- -CannonInterop Absolute prestate hash: -0x03fc3b4d091527d53f1ff369ea8ed65e5e17cc7fc98ebf75380238151cdc949c + CannonInterop Absolute prestate hash: + 0x03fc3b4d091527d53f1ff369ea8ed65e5e17cc7fc98ebf75380238151cdc949c -Cannon64Next Absolute prestate hash: -0x03eb07101fbdeaf3f04d9fb76526362c1eea2824e4c6e970bdb19675b72e4fc8 + Cannon64Next Absolute prestate hash: + 0x03eb07101fbdeaf3f04d9fb76526362c1eea2824e4c6e970bdb19675b72e4fc8 -``` + ``` The output will display production and experimental prestate hashes: - * **Production prestates**: Contains the `Cannon64` prestate, which is the current production absolute prestate hash for the 64-bit version of Cannon. - This is the hash you should use for permissionless fault proofs. - - * **Experimental prestates**: These contain prestates for versions that are in development and not yet ready for production use. + * **Production prestates**: Contains the `Cannon64` prestate, which is the current production absolute prestate hash for the 64-bit version of Cannon. + This is the hash you should use for permissionless fault proofs. + + * **Experimental prestates**: These contain prestates for versions that are in development and not yet ready for production use. ### Prepare the preimage file @@ -116,16 +116,17 @@ Cannon64Next Absolute prestate hash: ## Official prestate hashes for Superchain registry chains -The Superchain registry maintains official absolute prestate hashes for chains that are part of the registry. +The Superchain registry maintains official absolute prestate hashes for chains that are part of the registry. These prestates include the configurations of chains that were in the Superchain registry at the time the prestate was created. Important: A prestate listed in the Superchain registry may not be suitable for your chain if: - * Your chain was added to the registry after the prestate was created - * The configuration for your chain has been updated since the prestate was created - - Before using a prestate from the registry, verify that it contains the latest configuration for your chain. - + + * Your chain was added to the registry after the prestate was created + * The configuration for your chain has been updated since the prestate was created + + Before using a prestate from the registry, verify that it contains the latest configuration for your chain. + When in doubt, generating your own prestate with your specific chain configuration is the safest approach. @@ -141,74 +142,74 @@ If your chain is not included in the Superchain registry, you'll need to generat For these cases, follow these additional steps: + ### Verify the chain configuration directory exists -### Verify the chain configuration directory exists -The directory for custom chain configurations already exists in a valid checkout of the monorepo: + The directory for custom chain configurations already exists in a valid checkout of the monorepo: -```bash -# Verify the directory exists -ls -la op-program/chainconfig/configs -``` + ```bash + # Verify the directory exists + ls -la op-program/chainconfig/configs + ``` -If this directory doesn't exist, you may be using a version of the monorepo that doesn't support custom configs. + If this directory doesn't exist, you may be using a version of the monorepo that doesn't support custom configs. -### Copy your chain configuration files to this directory + ### Copy your chain configuration files to this directory -First, you need to obtain your chain's configuration files. These are typically generated when you [deploy your L2 chain](/operators/chain-operators/deploy/smart-contracts) with op-deployer: + First, you need to obtain your chain's configuration files. These are typically generated when you [deploy your L2 chain](/operators/chain-operators/deploy/smart-contracts) with op-deployer: -* ***rollup.json**: The rollup configuration file -* **genesis.json**: The L2 genesis file + * \***rollup.json**: The rollup configuration file + * **genesis.json**: The L2 genesis file -Name them according to the required format: + Name them according to the required format: -```bash -# Replace 67865 with your actual chain ID -cp /path/to/rollup.json op-program/chainconfig/configs/67865-rollup.json -cp /path/to/genesis.json op-program/chainconfig/configs/67865-genesis-l2.json -``` -Note: The naming format is critical - the files must be named as: + ```bash + # Replace 67865 with your actual chain ID + cp /path/to/rollup.json op-program/chainconfig/configs/67865-rollup.json + cp /path/to/genesis.json op-program/chainconfig/configs/67865-genesis-l2.json + ``` -* `-rollup.json` -* `-genesis-l2.json` + Note: The naming format is critical - the files must be named as: -These files are outputs from your L2 chain deployment process using op-deployer. -For long-term preservation and reproducibility, commit these configuration files to a git branch in your own fork of the monorepo. -This ensures you can always rebuild the prestate in the future by checking out that branch and running `make reproducible-prestate`, even if your original files are lost. + * `-rollup.json` + * `-genesis-l2.json` + These files are outputs from your L2 chain deployment process using op-deployer. + For long-term preservation and reproducibility, commit these configuration files to a git branch in your own fork of the monorepo. + This ensures you can always rebuild the prestate in the future by checking out that branch and running `make reproducible-prestate`, even if your original files are lost. -### Generate the prestate + ### Generate the prestate -After placing your configuration files in the proper location, run the following command from the root of the monorepo: + After placing your configuration files in the proper location, run the following command from the root of the monorepo: -```bash -make reproducible-prestate -``` + ```bash + make reproducible-prestate + ``` -The command will automatically detect and use the configuration files you placed in the `op-program/chainconfig/configs` directory. + The command will automatically detect and use the configuration files you placed in the `op-program/chainconfig/configs` directory. -This should generate output containing three prestate hashes: + This should generate output containing three prestate hashes: -```bash --------------------- Production Prestates -------------------- + ```bash + -------------------- Production Prestates -------------------- -Cannon64 Absolute prestate hash: -0x03eb07101fbdeaf3f04d9fb76526362c1eea2824e4c6e970bdb19675b72e4fc8 + Cannon64 Absolute prestate hash: + 0x03eb07101fbdeaf3f04d9fb76526362c1eea2824e4c6e970bdb19675b72e4fc8 --------------------- Experimental Prestates -------------------- + -------------------- Experimental Prestates -------------------- -CannonInterop Absolute prestate hash: -0x03fc3b4d091527d53f1ff369ea8ed65e5e17cc7fc98ebf75380238151cdc949c + CannonInterop Absolute prestate hash: + 0x03fc3b4d091527d53f1ff369ea8ed65e5e17cc7fc98ebf75380238151cdc949c -Cannon64Next Absolute prestate hash: -0x03eb07101fbdeaf3f04d9fb76526362c1eea2824e4c6e970bdb19675b72e4fc8 + Cannon64Next Absolute prestate hash: + 0x03eb07101fbdeaf3f04d9fb76526362c1eea2824e4c6e970bdb19675b72e4fc8 -``` + ``` -For current production use, you should use the `Cannon64` Absolute prestate hash. + For current production use, you should use the `Cannon64` Absolute prestate hash. -### Locate and prepare the preimage File -Follow this [step](/operators/chain-operators/tutorials/absolute-prestate#prepare-the-preimage-file) + ### Locate and prepare the preimage File + Follow this [step](/operators/chain-operators/tutorials/absolute-prestate#prepare-the-preimage-file) ## Deploying and configuring with the absolute prestate @@ -223,10 +224,12 @@ After generating the absolute prestate and preimage files, you'll need to: ### Configure op-challenger Configure the op-challenger to use the generated prestate. There are two ways to provide prestates: + - ### Option 1: Using HTTP URL (Recommended for production) - If your prestate files are hosted on a web server, you can simply provide the URL to the directory containing those files: + ### Option 1: Using HTTP URL (Recommended for production) + + If your prestate files are hosted on a web server, you can simply provide the URL to the directory containing those files: ```bash docker run -d --name op-challenger \ @@ -269,10 +272,10 @@ After generating the absolute prestate and preimage files, you'll need to: -Ensure you're using the latest op-challenger version, see the [release page](https://github.com/ethereum-optimism/optimism/release) -The dispute game factory address must be manually specified via the `--game-factory-address` option. -If your chain uses interoperability features, you'll need to add a `depsets.json` file to the `op-program/chainconfig/configs` directory. -This file contains dependency set configurations in the same format as the op-supervisor's configs. You can extract this from your existing op-supervisor setup. + * Ensure you're using the latest op-challenger version, see the [release page](https://github.com/ethereum-optimism/optimism/release). + * The dispute game factory address must be manually specified via the `--game-factory-address` option. + * If your chain uses interoperability features, you'll need to add a `depsets.json` file to the `op-program/chainconfig/configs` directory. + * This file contains dependency set configurations in the same format as the op-supervisor's configs. You can extract this from your existing op-supervisor setup. ## Next Steps diff --git a/words.txt b/words.txt index f2d1ff61c..5dbe5bf14 100644 --- a/words.txt +++ b/words.txt @@ -85,7 +85,6 @@ counterfactually Crosschain crosschain Crossmint -custom-bridge Dapphub daserver DATACAP @@ -94,8 +93,8 @@ DATADIR datadir devdocs Devnet -Devnets devnet +Devnets devnets direnv DISABLETXPOOLGOSSIP From 009d611095b9636038700087efd59589142f4d11 Mon Sep 17 00:00:00 2001 From: Blessing Krofegha Date: Wed, 21 May 2025 16:27:35 +0100 Subject: [PATCH 21/23] fix word --- words.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/words.txt b/words.txt index 5dbe5bf14..f2d1ff61c 100644 --- a/words.txt +++ b/words.txt @@ -85,6 +85,7 @@ counterfactually Crosschain crosschain Crossmint +custom-bridge Dapphub daserver DATACAP @@ -93,8 +94,8 @@ DATADIR datadir devdocs Devnet -devnet Devnets +devnet devnets direnv DISABLETXPOOLGOSSIP From 5b52306d7b25016c99ee4b231c28847341e3a08e Mon Sep 17 00:00:00 2001 From: Blessing Krofegha Date: Wed, 21 May 2025 16:27:58 +0100 Subject: [PATCH 22/23] Auto-fix: Update breadcrumbs, spelling dictionary and other automated fixes --- words.txt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/words.txt b/words.txt index f2d1ff61c..5dbe5bf14 100644 --- a/words.txt +++ b/words.txt @@ -85,7 +85,6 @@ counterfactually Crosschain crosschain Crossmint -custom-bridge Dapphub daserver DATACAP @@ -94,8 +93,8 @@ DATADIR datadir devdocs Devnet -Devnets devnet +Devnets devnets direnv DISABLETXPOOLGOSSIP From ad1eb576751fd9e847b67c2ab0a789a73f30abf3 Mon Sep 17 00:00:00 2001 From: Blessing Krofegha Date: Wed, 21 May 2025 16:36:26 +0100 Subject: [PATCH 23/23] remove a list --- pages/operators/chain-operators/tutorials/absolute-prestate.mdx | 1 - 1 file changed, 1 deletion(-) diff --git a/pages/operators/chain-operators/tutorials/absolute-prestate.mdx b/pages/operators/chain-operators/tutorials/absolute-prestate.mdx index 26a903322..757e50041 100644 --- a/pages/operators/chain-operators/tutorials/absolute-prestate.mdx +++ b/pages/operators/chain-operators/tutorials/absolute-prestate.mdx @@ -271,7 +271,6 @@ After generating the absolute prestate and preimage files, you'll need to: * Ensure you're using the latest op-challenger version, see the [release page](https://github.com/ethereum-optimism/optimism/release). - * The dispute game factory address must be manually specified via the `--game-factory-address` option. * If your chain uses interoperability features, you'll need to add a `depsets.json` file to the `op-program/chainconfig/configs` directory. * This file contains dependency set configurations in the same format as the op-supervisor's configs. You can extract this from your existing op-supervisor setup.