op-validator
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. 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
git clone https://github.com/ethereum-optimism/optimism.gitBuild the op-validator binary
cd optimism/op-validator
just buildRun the op-validator binary
./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" \
--failUnderstanding the output
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 |
|-----------------|--------------------------------|
| 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 foundUsage
The validator supports different protocol versions through subcommands:
op-validator validate [version] [flags]Choose a version based on your op-contracts version:
v1.8.0- For validatingop-contracts/1.8.0v2.0.0- For validatingop-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 |
--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
op-validator validate v2.0.0 \
--l1-rpc-url "L1_RPC_URL" \
--absolute-prestate "0x1234..." \
--proxy-admin "0xabcd..." \