From fa0a5528f4f1a2ce4d661ee3748ed829b196fc5c Mon Sep 17 00:00:00 2001 From: soyboy Date: Wed, 5 Mar 2025 10:46:18 -0600 Subject: [PATCH 1/8] adding op-verifier tutorial --- .../chain-operators/tools/_meta.json | 1 + .../chain-operators/tools/op-validator.mdx | 117 ++++++++++++++++++ pages/superchain/standard-configuration.mdx | 9 +- 3 files changed, 124 insertions(+), 3 deletions(-) create mode 100644 pages/operators/chain-operators/tools/op-validator.mdx diff --git a/pages/operators/chain-operators/tools/_meta.json b/pages/operators/chain-operators/tools/_meta.json index 40fdb8480..cdcd24668 100644 --- a/pages/operators/chain-operators/tools/_meta.json +++ b/pages/operators/chain-operators/tools/_meta.json @@ -4,6 +4,7 @@ "op-challenger": "op-challenger", "op-conductor": "op-conductor", "op-deployer": "op-deployer", + "op-validator": "op-validator", "op-txproxy": "op-txproxy", "proxyd": "proxyd", "fee-calculator": "Fee calculator" diff --git a/pages/operators/chain-operators/tools/op-validator.mdx b/pages/operators/chain-operators/tools/op-validator.mdx new file mode 100644 index 000000000..be19e186c --- /dev/null +++ b/pages/operators/chain-operators/tools/op-validator.mdx @@ -0,0 +1,117 @@ +--- +title: op-validator +description: Learn how to use op-validator to validate chain configurations and deployments. +lang: en-US +content_type: tutorial +topic: op-validator +personas: + - chain-operator + - protocol-developer +categories: + - tools + - op-validator +is_imported_content: 'false' +--- + +import {Callout, Steps} from 'nextra/components' + + +# op-validator + + + Currently, `op-validator` is only available on Sepolia networks. + + +The `op-validator` is a tool for validating Standard OP Stack chain configurations and deployments to ensure they're in compliance with the [Standard Rollup Charter](/superchain/blockspace-charter#the-standard-rollup-charter). It works by calling into the StandardValidator smart contracts (StandardValidatorV180 and StandardValidatorV200). These then perform a set of checks, and return error codes for any issues found. These checks include: + +* Contract implementations and versions +* Proxy configurations +* System parameters +* Cross-component relationships +* Security settings + +## How to use op-validator + + + +### Clone the monorepo + +```bash +git clone https://github.com/ethereum-optimism/optimism.git +``` + +### Build the `op-validator` binary + +```bash +cd optimism/op-validator +just build +``` + +### Run the `op-validator` binary + +```bash +./bin/op-validator validate v1.8.0 \ + --l1-rpc-url "https://ethereum-sepolia-rpc.publicnode.com" \ + --absolute-prestate "0x03f89406817db1ed7fd8b31e13300444652cdb0b9c509a674de43483b2f83568" \ + --proxy-admin "0x189aBAAaa82DfC015A588A7dbaD6F13b1D3485Bc" \ + --system-config "0x034edD2A225f7f429A63E0f1D2084B9E0A93b538" \ + --l2-chain-id "11155420" \ + --fail +``` + +### Understanding the output + +In the previous command, we provided a non-standard absolute prestate. The `op-validator` returned the following output to describe the descrepancies between the provided absolute prestate and the expected prestate in the L1 smart contracts: + +``` +| ERROR | DESCRIPTION | +|-----------------|--------------------------------| +| PDDG-40 | Permissioned dispute game | +| | absolute prestate mismatch | +| PDDG-ANCHORP-40 | Permissioned dispute game | +| | anchor state registry root | +| | hash mismatch | +| PLDG-40 | Permissionless dispute game | +| | absolute prestate mismatch | +| PLDG-ANCHORP-40 | Permissionless dispute game | +| | anchor state registry root | +| | hash mismatch | + +Validation errors found +``` + + + +## Usage + +The validator supports different protocol versions through subcommands: + +```bash +op-validator validate [version] [flags] +``` + +Where version is one of: + +- `v1.8.0` - For validating `op-contracts/1.8.0` +- `v2.0.0` - For validating `op-contracts/2.0.0` + +### Required Flags + +* `--l1-rpc-url`: L1 RPC URL (can also be set via L1_RPC_URL environment variable) +* `--absolute-prestate`: Absolute prestate as hex string +* `--proxy-admin`: Proxy admin address as hex string. This should be a specific chain's proxy admin contract on L1. + It is not the proxy admin owner or the superchain proxy admin. +* `--system-config`: System config proxy address as hex string +* `--l2-chain-id`: L2 chain ID + +### Optional Flags + +* `--fail`: Exit with non-zero code if validation errors are found (defaults to true) + +### Example + +```bash +op-validator validate v2.0.0 \ + --l1-rpc-url "L1_RPC_URL" \ + --absolute-prestate "0x1234..." \ + --proxy-admin "0xabcd..." \ diff --git a/pages/superchain/standard-configuration.mdx b/pages/superchain/standard-configuration.mdx index cef55b056..b6fdcc6c7 100644 --- a/pages/superchain/standard-configuration.mdx +++ b/pages/superchain/standard-configuration.mdx @@ -110,12 +110,15 @@ The [Superchain Registry](/superchain/superchain-registry) is the authoritative Familiarize yourself with the [OP Stack specifications](https://specs.optimism.io/protocol/configurability.html) and the Blockspace Charter. 2. **Use op-deployer:** - Leverage op-deployer to ensure your chain aligns with standard configurations. + Leverage [op-deployer](/operators/chain-operators/tools/op-deployer) to ensure your chain aligns with standard configurations. -3. **Seek guidance:** +3. **Verify deployment with op-validator:** + Use [op-validator](/operators/chain-operators/tools/op-validator) to verify your chain's deployment. + +4. **Seek guidance:** Consult the [developer support](https://github.com/ethereum-optimism/developers/discussions) team for clarifications on standardization. -4. **Contribute to the ecosystem:** +5. **Contribute to the ecosystem:** Engage with the [Optimism Collective](https://community.optimism.io/) to share feedback and propose improvements. ## References From 9c708f538ea6492dec5ed8fb5bbe7a2f3c5b5238 Mon Sep 17 00:00:00 2001 From: soyboy Date: Wed, 5 Mar 2025 11:23:11 -0600 Subject: [PATCH 2/8] adding to breadcrumbs file --- pages/operators/chain-operators/tools.mdx | 1 + 1 file changed, 1 insertion(+) diff --git a/pages/operators/chain-operators/tools.mdx b/pages/operators/chain-operators/tools.mdx index 3238c2873..8940801a2 100644 --- a/pages/operators/chain-operators/tools.mdx +++ b/pages/operators/chain-operators/tools.mdx @@ -16,6 +16,7 @@ This section provides information on chain monitoring options, deploying a block + From e6ad3631020ef84a3abcefefb5eb5d8419fcb92d Mon Sep 17 00:00:00 2001 From: soyboy Date: Wed, 5 Mar 2025 11:23:27 -0600 Subject: [PATCH 3/8] Auto-fix: Update breadcrumbs, spelling dictionary and other automated fixes --- .../chain-operators/tools/op-validator.mdx | 104 +++++++++--------- words.txt | 2 + 2 files changed, 53 insertions(+), 53 deletions(-) diff --git a/pages/operators/chain-operators/tools/op-validator.mdx b/pages/operators/chain-operators/tools/op-validator.mdx index be19e186c..1b409932f 100644 --- a/pages/operators/chain-operators/tools/op-validator.mdx +++ b/pages/operators/chain-operators/tools/op-validator.mdx @@ -15,7 +15,6 @@ is_imported_content: 'false' import {Callout, Steps} from 'nextra/components' - # op-validator @@ -33,53 +32,51 @@ The `op-validator` is a tool for validating Standard OP Stack chain configuratio ## How to use op-validator - -### Clone the monorepo - -```bash -git clone https://github.com/ethereum-optimism/optimism.git -``` - -### Build the `op-validator` binary - -```bash -cd optimism/op-validator -just build -``` - -### Run the `op-validator` binary - -```bash -./bin/op-validator validate v1.8.0 \ - --l1-rpc-url "https://ethereum-sepolia-rpc.publicnode.com" \ - --absolute-prestate "0x03f89406817db1ed7fd8b31e13300444652cdb0b9c509a674de43483b2f83568" \ - --proxy-admin "0x189aBAAaa82DfC015A588A7dbaD6F13b1D3485Bc" \ - --system-config "0x034edD2A225f7f429A63E0f1D2084B9E0A93b538" \ - --l2-chain-id "11155420" \ - --fail -``` - -### Understanding the output - -In the previous command, we provided a non-standard absolute prestate. The `op-validator` returned the following output to describe the descrepancies between the provided absolute prestate and the expected prestate in the L1 smart contracts: - -``` -| ERROR | DESCRIPTION | -|-----------------|--------------------------------| -| PDDG-40 | Permissioned dispute game | -| | absolute prestate mismatch | -| PDDG-ANCHORP-40 | Permissioned dispute game | -| | anchor state registry root | -| | hash mismatch | -| PLDG-40 | Permissionless dispute game | -| | absolute prestate mismatch | -| PLDG-ANCHORP-40 | Permissionless dispute game | -| | anchor state registry root | -| | hash mismatch | - -Validation errors found -``` - + ### Clone the monorepo + + ```bash + git clone https://github.com/ethereum-optimism/optimism.git + ``` + + ### Build the `op-validator` binary + + ```bash + cd optimism/op-validator + just build + ``` + + ### Run the `op-validator` binary + + ```bash + ./bin/op-validator validate v1.8.0 \ + --l1-rpc-url "https://ethereum-sepolia-rpc.publicnode.com" \ + --absolute-prestate "0x03f89406817db1ed7fd8b31e13300444652cdb0b9c509a674de43483b2f83568" \ + --proxy-admin "0x189aBAAaa82DfC015A588A7dbaD6F13b1D3485Bc" \ + --system-config "0x034edD2A225f7f429A63E0f1D2084B9E0A93b538" \ + --l2-chain-id "11155420" \ + --fail + ``` + + ### Understanding the output + + In the previous command, we provided a non-standard absolute prestate. The `op-validator` returned the following output to describe the descrepancies between the provided absolute prestate and the expected prestate in the L1 smart contracts: + + ``` + | ERROR | DESCRIPTION | + |-----------------|--------------------------------| + | PDDG-40 | Permissioned dispute game | + | | absolute prestate mismatch | + | PDDG-ANCHORP-40 | Permissioned dispute game | + | | anchor state registry root | + | | hash mismatch | + | PLDG-40 | Permissionless dispute game | + | | absolute prestate mismatch | + | PLDG-ANCHORP-40 | Permissionless dispute game | + | | anchor state registry root | + | | hash mismatch | + + Validation errors found + ``` ## Usage @@ -92,15 +89,15 @@ op-validator validate [version] [flags] Where version is one of: -- `v1.8.0` - For validating `op-contracts/1.8.0` -- `v2.0.0` - For validating `op-contracts/2.0.0` +* `v1.8.0` - For validating `op-contracts/1.8.0` +* `v2.0.0` - For validating `op-contracts/2.0.0` ### Required Flags -* `--l1-rpc-url`: L1 RPC URL (can also be set via L1_RPC_URL environment variable) +* `--l1-rpc-url`: L1 RPC URL (can also be set via L1\_RPC\_URL environment variable) * `--absolute-prestate`: Absolute prestate as hex string -* `--proxy-admin`: Proxy admin address as hex string. This should be a specific chain's proxy admin contract on L1. - It is not the proxy admin owner or the superchain proxy admin. +* `--proxy-admin`: Proxy admin address as hex string. This should be a specific chain's proxy admin contract on L1. + It is not the proxy admin owner or the superchain proxy admin. * `--system-config`: System config proxy address as hex string * `--l2-chain-id`: L2 chain ID @@ -115,3 +112,4 @@ op-validator validate v2.0.0 \ --l1-rpc-url "L1_RPC_URL" \ --absolute-prestate "0x1234..." \ --proxy-admin "0xabcd..." \ +``` diff --git a/words.txt b/words.txt index 326d37a04..ef196f872 100644 --- a/words.txt +++ b/words.txt @@ -91,6 +91,7 @@ DATACAP datacap DATADIR datadir +descrepancies Devnet devnet Devnets @@ -115,6 +116,7 @@ ETHERBASE etherbase Ethernity Ethernow +ethpandaops ETHSTATS ethstats EVMTIMEOUT From b5f19bb2cda21b0edaca03019f8851c2e9ea266a Mon Sep 17 00:00:00 2001 From: Bradley Camacho <42678939+bradleycamacho@users.noreply.github.com> Date: Wed, 5 Mar 2025 09:35:25 -0800 Subject: [PATCH 4/8] Fixes --- .../chain-operators/tools/op-validator.mdx | 26 +++++++++---------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/pages/operators/chain-operators/tools/op-validator.mdx b/pages/operators/chain-operators/tools/op-validator.mdx index 1b409932f..b3790e1e5 100644 --- a/pages/operators/chain-operators/tools/op-validator.mdx +++ b/pages/operators/chain-operators/tools/op-validator.mdx @@ -21,7 +21,9 @@ import {Callout, Steps} from 'nextra/components' Currently, `op-validator` is only available on Sepolia networks. -The `op-validator` is a tool for validating Standard OP Stack chain configurations and deployments to ensure they're in compliance with the [Standard Rollup Charter](/superchain/blockspace-charter#the-standard-rollup-charter). It works by calling into the StandardValidator smart contracts (StandardValidatorV180 and StandardValidatorV200). These then perform a set of checks, and return error codes for any issues found. These checks include: +The `op-validator` is a tool for validating Standard OP Stack chain configurations and deployments to ensure they're in compliance with the [Standard Rollup Charter](/superchain/blockspace-charter#the-standard-rollup-charter). It works by calling into the `StandardValidator` smart contracts (`StandardValidatorV180` and `StandardValidatorV200`). These then perform a set of checks, and return error codes for any issues found. + +These checks include: * Contract implementations and versions * Proxy configurations @@ -87,23 +89,19 @@ The validator supports different protocol versions through subcommands: op-validator validate [version] [flags] ``` -Where version is one of: +Choose a version based on your `op-contracts` version: * `v1.8.0` - For validating `op-contracts/1.8.0` * `v2.0.0` - For validating `op-contracts/2.0.0` -### Required Flags - -* `--l1-rpc-url`: L1 RPC URL (can also be set via L1\_RPC\_URL environment variable) -* `--absolute-prestate`: Absolute prestate as hex string -* `--proxy-admin`: Proxy admin address as hex string. This should be a specific chain's proxy admin contract on L1. - It is not the proxy admin owner or the superchain proxy admin. -* `--system-config`: System config proxy address as hex string -* `--l2-chain-id`: L2 chain ID - -### Optional Flags - -* `--fail`: Exit with non-zero code if validation errors are found (defaults to true) +| Option | Description | Required/Optional | +| --------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------- | +| `--l1-rpc-url` | L1 RPC URL (can also be set via `L1_RPC_URL` environment variable) | Required | +| `--absolute-prestate` | Absolute prestate as hex string | Required | +| `--proxy-admin` | Proxy admin address as hex string. This should be a specific chain's proxy admin contract on L1. It is not the proxy admin owner or the superchain proxy admin. | Required | +| `--system-config` | System config proxy address as hex string | Required | +| `--l2-chain-id` | L2 chain ID | Required | +| `--fail` | Exit with non-zero code if validation errors are found (defaults to true) | Optional | ### Example From c8d42aa84c285719237549ef939a2301a6d3b957 Mon Sep 17 00:00:00 2001 From: Bradley Camacho <42678939+bradleycamacho@users.noreply.github.com> Date: Wed, 5 Mar 2025 09:36:39 -0800 Subject: [PATCH 5/8] Fix pre-push --- .husky/pre-push | 2 -- 1 file changed, 2 deletions(-) diff --git a/.husky/pre-push b/.husky/pre-push index b45405575..2caf3cbb6 100755 --- a/.husky/pre-push +++ b/.husky/pre-push @@ -1,5 +1,3 @@ -#!/usr/bin/env sh -. "$(dirname -- "$0")/_/husky.sh" echo "🔍 Running automatic fixes before pushing..." pnpm fix From 1f33ce7c164ac2f94aaab1854edb522a08249041 Mon Sep 17 00:00:00 2001 From: Bradley Camacho <42678939+bradleycamacho@users.noreply.github.com> Date: Wed, 5 Mar 2025 09:37:47 -0800 Subject: [PATCH 6/8] Revert "Fix pre-push" This reverts commit c8d42aa84c285719237549ef939a2301a6d3b957. --- .husky/pre-push | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.husky/pre-push b/.husky/pre-push index 2caf3cbb6..b45405575 100755 --- a/.husky/pre-push +++ b/.husky/pre-push @@ -1,3 +1,5 @@ +#!/usr/bin/env sh +. "$(dirname -- "$0")/_/husky.sh" echo "🔍 Running automatic fixes before pushing..." pnpm fix From d1653629c63da27d167ce24f7e7d7ac9a1be9042 Mon Sep 17 00:00:00 2001 From: soyboy Date: Wed, 5 Mar 2025 12:37:43 -0600 Subject: [PATCH 7/8] fixing spelling error --- pages/operators/chain-operators/tools/op-validator.mdx | 2 +- words.txt | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/pages/operators/chain-operators/tools/op-validator.mdx b/pages/operators/chain-operators/tools/op-validator.mdx index b3790e1e5..3c838b958 100644 --- a/pages/operators/chain-operators/tools/op-validator.mdx +++ b/pages/operators/chain-operators/tools/op-validator.mdx @@ -61,7 +61,7 @@ These checks include: ### Understanding the output - In the previous command, we provided a non-standard absolute prestate. The `op-validator` returned the following output to describe the descrepancies between the provided absolute prestate and the expected prestate in the L1 smart contracts: + In the previous command, we provided a non-standard absolute prestate. The `op-validator` returned the following output to describe the discrepancies between the provided absolute prestate and the expected prestate in the L1 smart contracts: ``` | ERROR | DESCRIPTION | diff --git a/words.txt b/words.txt index ef196f872..25d6705da 100644 --- a/words.txt +++ b/words.txt @@ -91,7 +91,6 @@ DATACAP datacap DATADIR datadir -descrepancies Devnet devnet Devnets From 27753e4b2f5ba44f5f486f5161b46b3c9ff4c6d8 Mon Sep 17 00:00:00 2001 From: Bradley Camacho <42678939+bradleycamacho@users.noreply.github.com> Date: Wed, 5 Mar 2025 11:44:47 -0800 Subject: [PATCH 8/8] Add flags header --- pages/operators/chain-operators/tools/op-validator.mdx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pages/operators/chain-operators/tools/op-validator.mdx b/pages/operators/chain-operators/tools/op-validator.mdx index 3c838b958..8b22960f2 100644 --- a/pages/operators/chain-operators/tools/op-validator.mdx +++ b/pages/operators/chain-operators/tools/op-validator.mdx @@ -94,6 +94,8 @@ Choose a version based on your `op-contracts` version: * `v1.8.0` - For validating `op-contracts/1.8.0` * `v2.0.0` - For validating `op-contracts/2.0.0` +### Flags + | Option | Description | Required/Optional | | --------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------- | | `--l1-rpc-url` | L1 RPC URL (can also be set via `L1_RPC_URL` environment variable) | Required |