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
1
Clone the monorepo
2
Build the `op-validator` binary
3
Run the `op-validator` binary
4
Understanding 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:Usage
The validator supports different protocol versions through subcommands:op-contracts
version:
v1.8.0
- For validatingop-contracts/1.8.0
v2.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 |