Skip to content

Commit c351f2c

Browse files
authored
Merge pull request #1456 from ethereum-optimism/sb/op-verifier
adding op-verifier tutorial
2 parents 02a18c7 + 27753e4 commit c351f2c

File tree

4 files changed

+123
-3
lines changed

4 files changed

+123
-3
lines changed

pages/operators/chain-operators/tools.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ This section provides information on chain monitoring options, deploying a block
1616
<Card title="Chain monitoring options" href="/operators/chain-operators/tools/chain-monitoring" />
1717
<Card title="Fjord fee parameter calculator" href="/operators/chain-operators/tools/fee-calculator" />
1818
<Card title="Deploying a block explorer" href="/operators/chain-operators/tools/explorer" />
19+
<Card title="Validating a Standard OP Stack chain" href="/operators/chain-operators/tools/op-validator" />
1920
<Card title="How to configure challenger for your chain" href="/operators/chain-operators/tools/op-challenger" />
2021
<Card title="Conductor" href="/operators/chain-operators/tools/op-conductor" />
2122

pages/operators/chain-operators/tools/_meta.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"op-challenger": "op-challenger",
55
"op-conductor": "op-conductor",
66
"op-deployer": "op-deployer",
7+
"op-validator": "op-validator",
78
"op-txproxy": "op-txproxy",
89
"proxyd": "proxyd",
910
"fee-calculator": "Fee calculator"
Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
---
2+
title: op-validator
3+
description: Learn how to use op-validator to validate chain configurations and deployments.
4+
lang: en-US
5+
content_type: tutorial
6+
topic: op-validator
7+
personas:
8+
- chain-operator
9+
- protocol-developer
10+
categories:
11+
- tools
12+
- op-validator
13+
is_imported_content: 'false'
14+
---
15+
16+
import {Callout, Steps} from 'nextra/components'
17+
18+
# op-validator
19+
20+
<Callout type="info">
21+
Currently, `op-validator` is only available on Sepolia networks.
22+
</Callout>
23+
24+
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.
25+
26+
These checks include:
27+
28+
* Contract implementations and versions
29+
* Proxy configurations
30+
* System parameters
31+
* Cross-component relationships
32+
* Security settings
33+
34+
## How to use op-validator
35+
36+
<Steps>
37+
### Clone the monorepo
38+
39+
```bash
40+
git clone https://github.com/ethereum-optimism/optimism.git
41+
```
42+
43+
### Build the `op-validator` binary
44+
45+
```bash
46+
cd optimism/op-validator
47+
just build
48+
```
49+
50+
### Run the `op-validator` binary
51+
52+
```bash
53+
./bin/op-validator validate v1.8.0 \
54+
--l1-rpc-url "https://ethereum-sepolia-rpc.publicnode.com" \
55+
--absolute-prestate "0x03f89406817db1ed7fd8b31e13300444652cdb0b9c509a674de43483b2f83568" \
56+
--proxy-admin "0x189aBAAaa82DfC015A588A7dbaD6F13b1D3485Bc" \
57+
--system-config "0x034edD2A225f7f429A63E0f1D2084B9E0A93b538" \
58+
--l2-chain-id "11155420" \
59+
--fail
60+
```
61+
62+
### Understanding the output
63+
64+
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:
65+
66+
```
67+
| ERROR | DESCRIPTION |
68+
|-----------------|--------------------------------|
69+
| PDDG-40 | Permissioned dispute game |
70+
| | absolute prestate mismatch |
71+
| PDDG-ANCHORP-40 | Permissioned dispute game |
72+
| | anchor state registry root |
73+
| | hash mismatch |
74+
| PLDG-40 | Permissionless dispute game |
75+
| | absolute prestate mismatch |
76+
| PLDG-ANCHORP-40 | Permissionless dispute game |
77+
| | anchor state registry root |
78+
| | hash mismatch |
79+
80+
Validation errors found
81+
```
82+
</Steps>
83+
84+
## Usage
85+
86+
The validator supports different protocol versions through subcommands:
87+
88+
```bash
89+
op-validator validate [version] [flags]
90+
```
91+
92+
Choose a version based on your `op-contracts` version:
93+
94+
* `v1.8.0` - For validating `op-contracts/1.8.0`
95+
* `v2.0.0` - For validating `op-contracts/2.0.0`
96+
97+
### Flags
98+
99+
| Option | Description | Required/Optional |
100+
| --------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------- |
101+
| `--l1-rpc-url` | L1 RPC URL (can also be set via `L1_RPC_URL` environment variable) | Required |
102+
| `--absolute-prestate` | Absolute prestate as hex string | Required |
103+
| `--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 |
104+
| `--system-config` | System config proxy address as hex string | Required |
105+
| `--l2-chain-id` | L2 chain ID | Required |
106+
| `--fail` | Exit with non-zero code if validation errors are found (defaults to true) | Optional |
107+
108+
### Example
109+
110+
```bash
111+
op-validator validate v2.0.0 \
112+
--l1-rpc-url "L1_RPC_URL" \
113+
--absolute-prestate "0x1234..." \
114+
--proxy-admin "0xabcd..." \
115+
```

pages/superchain/standard-configuration.mdx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,12 +110,15 @@ The [Superchain Registry](/superchain/superchain-registry) is the authoritative
110110
Familiarize yourself with the [OP Stack specifications](https://specs.optimism.io/protocol/configurability.html) and the Blockspace Charter.
111111

112112
2. **Use op-deployer:**
113-
Leverage op-deployer to ensure your chain aligns with standard configurations.
113+
Leverage [op-deployer](/operators/chain-operators/tools/op-deployer) to ensure your chain aligns with standard configurations.
114114

115-
3. **Seek guidance:**
115+
3. **Verify deployment with op-validator:**
116+
Use [op-validator](/operators/chain-operators/tools/op-validator) to verify your chain's deployment.
117+
118+
4. **Seek guidance:**
116119
Consult the [developer support](https://github.com/ethereum-optimism/developers/discussions) team for clarifications on standardization.
117120

118-
4. **Contribute to the ecosystem:**
121+
5. **Contribute to the ecosystem:**
119122
Engage with the [Optimism Collective](https://community.optimism.io/) to share feedback and propose improvements.
120123

121124
## References

0 commit comments

Comments
 (0)