Optimism 백서

Optimism

원문

bitpro가 원문에서 글자만 모은 내용이에요. 표·그림·수식은 빠지거나 깨질 수 있어요. 전체 75쪽 중 29쪽

geth and op-program](/notices/archive/op-geth-deprecation). Both programs: * Use Cannon as the FPVM, and * Are used by the same dispute game implementation (`FaultDisputeGame.sol`). After the cannon+kona upgrade is deployed, both game types are available: * `CANNON` (0): `op-program` (end-of-support) * `CANNON_KONA` (8): `kona-client` Until you switch, the respected game type remains `CANNON` (0), meaning only those games are used for withdrawals. Because `op-program` does not support Karst, complete this switch before activating the Karst hardfork on your chain. This guide explains how to switch your chain so that Kona proofs (`CANNON_KONA`, 8) become the respected game type. <Warning> This guide assumes you have already completed the cannon+kona upgrade, including setting both `cannonPrestate` and `cannonKonaPrestate` in `OpChainConfig`, and that your fault proof infrastructure is healthy. </Warning> The high-level flow is: * Verify that cannon+kona support is correctly deployed on-chain. * Confirm that your off-chain infra (especially `op-challenger`) is Kona-ready. * Switch the respected game type to `CANNON_KONA` (8). * Update `op-proposer` to post Kona games. * Monitor the system. *** ## How to Switch to Kona Proofs <Steps> <Step title="Confirm cannon+kona support is deployed"> Before changing the respected game type, verify that your chain has been upgraded to support both `CANNON` and `CANNON_KONA` games. <Info> The required upgrade is performed via `OPCM.upgrade` with an `OpChainConfig` that sets both `cannonPrestate` and `cannonKonaPrestate`. </Info> 1. **Check `OpChainConfig` prestates** Ensure that the `OpChainConfig` used in your most recent upgrade included: * `cannonPrestate` pointing to a valid `cannon64` prestate. * `cannonKonaPrestate` pointing to a valid `cannon64-kona` prestate. Both hashes must come from the standard prestates in the superchain registry and must embed an up-to-date chain config for your chain. 2. **Verify `DisputeGameFactory` implementations** After the cannon+kona upgrade, the `DisputeGameFactory` should have: * A non-zero implementation for `CANNON` (0), and * A non-zero implementation for `CANNON_KONA` (8). Example (using [cast](https://getfoundry.sh/cast/reference/cast/)): ```bash title="cast" theme={null} # CANNON (0) implementation cast call <DISPUTE_GAME_FACTORY_ADDRESS> "gameImpl(uint8)" 0 # CANNON_KONA (8) implementation cast call <DISPUTE_GAME_FACTORY_ADDRESS> "gameImpl(uint8)" 8 ``` Both calls should return non-zero addresses. </Step> <Step title="Ensure op-challenger is Kona-ready"> Your challengers must be able to play both cannon and kona games before you change the respected game type. 1. **Trace types** If you explicitly configure trace types, ensure that `cannon-kona` is included. A typical setting is: ```bash theme={null} OP_CHALLENGER_TRACE_TYPE="cannon,cannon-kona,permissioned" # or --trace-type=cannon,cannon-kona,permissioned ``` 2. **Prestate URLs** Make sure `op-challenger` can fetch both cannon and cannon-kona prestates: * If they are at the same URL, use: ```bash theme={null} --prestates-url=<PRESTATES_URL> ``` * If they are at different locations, use: ```bash theme={null} --cannon-prestates-url=<CANNON_PRESTATES_URL> --cannon-kona-prestates-url=<CANNON_KONA_PRESTATES_URL> ``` 3. **Kona host binary** For operators not using the standard OP Labs `op-challenger` Docker images, you must also provide: ```bash theme={null} --cannon-kona-server=/path/to/kona-host # or OP_CHALLENGER_CANNON_KONA_SERVER=/path/to/kona-host ``` The `kona-host` binary is available from the Kona repository (for example under `bin/host`). Build it from the same release as the `cannon-kona` prestate you configured. </Step> <Step title="Switch the respected game type to CANNON_KONA"> Once both on-chain and off-chain pieces are ready, you can switch the respected game type so that Kona proofs become the canonical path for withdrawals. <Warning> Changing the respected game type affects which games can be used to prove withdrawals. Only perform this step once you are confident in your Kona setup. </Warning> The respected game type is configured in the `AnchorStateRegistry` contract. 1. **Encode the calldata** Use `cast calldata` to encode a call to `setRespectedGameType(uint32)` with game type `8` (which corresponds to `CANNON_KONA`): ```bash title="cast" theme={null} CALLDATA=$(cast calldata "setRespectedGameType(uint32)" 8) ``` 2. **Send the transaction** Send the transaction from the Guardian to the `AnchorStateRegistry`: ```bash title="cast" theme={null} cast send \ --rpc-url <L1_RPC_URL> \ --private-key <GUARDIAN_PRIVATE_KEY> \ <ANCHOR_STATE_REGISTRY_ADDRESS> \ "$CALLDATA" ``` 3. **Verify the new respected game type** After the transaction confirms, verify that the respected game type is now `8`: ```bash title="cast" theme={null} cast call \ --rpc-url <L1_RPC_URL> \ <ANCHOR_STATE_REGISTRY_ADDRESS> \ "respectedGameType()(uint32)" ``` The returned value should be `8`, indicating that `CANNON_KONA` is now the respected game type. </Step> <Step title="Update op-proposer to use game type 8"> With `CANNON_KONA` set as the respected game type, your proposers must create Kona games. 1. **Update the proposer game type** Change your `op-proposer` configuration from game type 0 to 8: ```bash theme={null} # Before OP_PROPOSER_GAME_TYPE=0 # or --game-type=0 # After switching to Kona OP_PROPOSER_GAME_TYPE=8 # or --game-type=8 ``` This change is not required as part of the initial cannon+kona upgrade; it is only required when you actually switch the respected game type to `CANNON_KONA`. 2. **Restart proposers** Restart your proposer processes so they pick up the new configuration. Verify in logs and metrics that they are now using game type 8. </Step> <Step title="Monitor, and validate"> After switching to Kona proofs, closely monitor your chain to ensure everything is functioning as expected. 1. **Run test withdrawals** * Perform a few small test withdrawals and ensure that: * New fault dispute games are created with game type `CANNON_KONA` (8). * Your challengers are responding correctly using `kona-host`. 2. **Observe metrics and logs** * Monitor `op-proposer` and `op-challenger` logs for errors. * Watch dispute game metrics (for example, game counts and step timings) for anomalies. </Step> </Steps> *** ## References * [OP Stack Fault Proofs Explainer](https://docs.optimism.io/op-stack/fault-proofs/explainer) * [Fault Proof Specs](https://specs.optimism.io/fault-proof/index.html) # Join the Superchain Registry Source: https://docs.optimism.io/chain-operators/guides/join-superchain-registry How to add your OP Stack chain to the Superchain Registry — prerequisites, config generation, and the pull-request process. The [Superchain Registry](https://github.com/ethereum-optimism/superchain-registry) is the source-of-truth index of who is in the OP Stack Ecosystem and how each chain is configured. This guide walks you through adding your chain. The registry repo's [operations documentation](https://github.com/ethereum-optimism/superchain-registry/blob/main/docs/ops.md) is the canonical reference for every step below — each step links the matching section, and if this page and that document ever disagree, the registry repo wins. Joining gets you more than a listing: once your chain is in the registry, its config is embedded in downstream releases of `op-node` and `op-geth`, so nodes can join your network with the `--network` / `--op-network` flags and can inherit Superchain-wide hardfork activations automatically. See the [superchain-registry explainer](/op-stack/protocol/superchain-registry) for how that works. ## Before You Start * **Chat with the Optimism Foundation.** * **Your chain ID must be registered at [ethereum-lists/chains](https://github.com/ethereum-lists/chains).** The registry's validation suite checks against it; this is a mandatory prerequisite ([ops.md](https://github.com/ethereum-optimism/superchain-registry/blob/main/docs/ops.md#adding-a-chain)). * **Standard chains must be deployed with [op-deployer](/chain-operators/tools/op-deployer/overview).** A chain is only considered standard in the registry if it was deployed with op-deployer, which also produces the `state.json` file the registry tooling consumes ([ops.md](https://github.com/ethereum-optimism/superchain-registry/blob/main/docs/ops.md#0-standard-chains-deploy-your-chain-with-op-deployer)). Chains deployed another way follow the [custom-chain path](#custom-chains) below. * **Install the tooling dependencies:** `git` (`^2`), `go` (`^1.21`), and [`just`](https://github.com/casey/just) (`^1.28.0`) ([ops.md](https://github.com/ethereum-optimism/superchain-registry/blob/main/docs/ops.md#1-install-dependencies)). ## Add Your Chain <Steps> <Step title="Fork the Registry Repository"> You will raise a pull request from your fork to the upstream repo. Start from a fresh, non-protected branch (not your fork's `main`), and add one chain per branch and PR. ([ops.md](https://github.com/ethereum-optimism/superchain-registry/blob/main/docs/ops.md#2-fork-this-repository)) </Step> <Step title="Generate a Config From Your State File"> From the root of the registry repo, run: ```bash theme={null} just create-config <shortname> <path to your state file> ``` where `<shortname>` is your chain's short name (for example `op`) and the state file is the `state.json` produced by op-deployer. This writes two files to the `.staging` directory: `<shortname>.toml` and `<shortname>.json.zst`. If you deployed with custom contracts, pass your op-deployer version as a third argument — supported values live in the registry's `versions.json`. ([ops.md](https://github.com/ethereum-optimism/superchain-registry/blob/main/docs/ops.md#3-generate-a-config-from-your-state-file)) </Step> <Step title="Fill In the Generated Config"> Most of `<shortname>.toml` is populated from your deployer state, but you must fill in the rest yourself: `name`, `superchain` (`mainnet` or `sepolia`), `public_rpc`, `sequencer_rpc`, `explorer`, and `deployment_tx_hash`. Double-check the generated values while you are in the file. ([ops.md](https://github.com/ethereum-optimism/superchain-registry/blob/main/docs/ops.md#4-update-generated-config)) </Step> <Step title="Open the Pull Request"> Commit to your fork and open one PR per chain. Check the box to [allow edits from maintainers](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/allowing-changes-to-a-pull-request-branch-created-from-a-fork) so reviewers can push to your branch. Automated checks will validate your chain and generate a report on its compliance with the standard blockchain charter. ([ops.md](https://github.com/ethereum-optimism/superchain-registry/blob/main/docs/ops.md#5-commit)) </Step> <Step title="Await Review"> A registry maintainer reviews your PR. When it is ready, the team generates code from your PR and pushes to your fork — do not run codegen yourself; it slows down review. ([ops.md](https://github.com/ethereum-optimism/superchain-registry/blob/main/docs/ops.md#6-await-review)) </Step> </Steps> ## Custom Chains If your chain was not deployed with op-deployer (for example, a heavily modified deployment), you must write the config file by hand instead of generating it: copy the example config into `.staging`, substitute every field for your chain (custom chains set `superchain_level = 0` and `governed_by_optimism = false`), and ZST-encode your genesis file with the registry's dictionary. The full field-by-field walkthrough lives in [Adding a custom chain](https://github.com/ethereum-optimism/superchain-registry/blob/main/docs/ops.md#adding-a-custom-chain). ## After You Are In To receive Superchain-wide coordinated hardfork activations automatically, set `superchain_time` in your chain's config (use `0` if your chain has activated all Superchain forks up to its genesis time) and run your nodes with the network flags. Details in the [explainer](/op-stack/protocol/superchain-registry#hard-fork-activation-inheritance-behavior) and the registry's [hardfork activation inheritance spec](https://github.com/ethereum-optimism/superchain-registry/blob/main/docs/hardfork-activation-inheritance.md). ## Next Steps * [The superchain-registry explainer](/op-stack/protocol/superchain-registry) * [Deploy your chain with op-deployer](/chain-operators/tools/op-deployer/overview) * [Registry operations documentation](https://github.com/ethereum-optimism/superchain-registry/blob/main/docs/ops.md) (canonical) # Chain operator best practices Source: https://docs.optimism.io/chain-operators/guides/management/best-practices Learn some best practices for managing the OP Stack's off-chain components. The following information has some best practices around running the OP Stack's off-chain components. ## Correct release versions Chain and node operators should always run the latest production releases of the OP Stack's off-chain components. The latest notes and changelogs can be found on GitHub: * [OP monorepo releases](https://github.com/ethereum-optimism/optimism/releases) (includes `op-node` and other Go-based OP components) * [op-geth releases](https://github.com/ethereum-optimism/op-geth/releases) (standalone repository) * [op-contracts releases](https://github.com/ethereum-optimism/optimism/releases) (look for tags starting with `op-contracts/`) Some guidelines when picking versions: * **Production releases** are always tagged with `<component-name>/v<semver>` for a specific OP component, for example: * `op-node/v1.7.5` for the `op-node` * `op-challenger/v1.0.0` for the `op-challenger` * **Monorepo releases** typically use a simple `v<semver>` format (e.g. `v1.7.7`) to indicate that all Go-based OP Stack components (in `op-*`) have been updated together. These do **not** include new L1 contract releases. * **Contracts releases** are tagged under `op-contracts/v<semver>` (e.g. `op-contracts/v1.6.0`) and contain updates to the Bedrock L1 contracts. * **`op-geth` versioning** includes upstream geth's version within its semver. For example, if upstream geth is at `v1.12.0`, an `op-geth` release might be `v1.101200.0`. The geth major version is used as our minor version (left-padded if needed), and the patch version is appended. Always consult release notes for additional details or upgrade instructions. ## Keep deployment artifacts After deploying your contracts on Ethereum, you should keep a record of all the deployment artifacts. This is will be all the [op-deployer](/chain-operators/tools/op-deployer/overview.mdx) artifacts, as well as the release tag and commit hash of `op-deployer` and `op-contracts`. You will need these artifacts to add your chain to the [Superchain Registry](/op-stack/protocol/superchain-registry). ## Incremental upgrade rollouts When upgrading your nodes, take a staggered approach. This means deploying the upgrade gradually across your infrastructure and ensuring things work as expected before making changes to every node. ## Isolate your sequencer You can isolate your sequencer node, by not connecting it directly to the internet. Instead, you could handle your ingress traffic behind a proxy. Have the proxy forward traffic to replicas and have them gossip the transactions internally. ## Improve reliability of peer-to-peer transactions These flags can improve the reliability of peer-to-peer transactions from internal replica nodes and the sequencer node. For sequencer nodes: ``` GETH_TXPOOL_JOURNAL: "" GETH_TXPOOL_JOURNALREMOTES: "false" GETH_TXPOOL_NOLOCALS: "true" ``` For replica nodes: ``` GETH_TXPOOL_JOURNALREMOTES: "true" GETH_TXPOOL_LIFETIME: "1h" GETH_TXPOOL_NOLOCALS: "true" ``` For additional information about these flags, check out our [Execution Layer Configuration Options](/node-operators/reference/op-reth-config) doc. ## Write your own runbooks Create custom runbooks to prepare for operating an OP Stack chain. You'll want to setup metrics endpoints and monitoring on your key components of the system and create runbooks to execute when something is not behaving as expected. ## Assumptions ### op-proposer assumes archive mode The `op-proposer` currently assumes that `op-geth` is being run in archive mode. This will likely be updated in a future network upgrade, but it is necessary for L2 withdrawals at the moment. <Info> **Running this in production** <OpEnterpriseCalloutBody /> </Info> # Fee vault operations Source: https://docs.optimism.io/chain-operators/guides/management/fee-vaults How to configure, monitor, and withdraw from fee vaults on your OP Stack chain. This guide covers the operational aspects of managing fee vaults on your OP Stack chain. For a conceptual overview of how fee vaults work, see [Fee vaults](/op-stack/transactions/fee-vaults). ## Prerequisites * Access to the **ProxyAdminOwner** account (required for configuration changes) * An RPC endpoint for your L2 chain * `cast` CLI tool installed ([Foundry](https://book.getfoundry.sh/getting-started/installation)) ## Fee vault addresses | Vault | Address | Collects | Introduced | | - | - | - | - | | `SequencerFeeVault` | `0x4200000000000000000000000000000000000011` | Priority fees (tips) | Legacy | | `BaseFeeVault` | `0x4200000000000000000000000000000000000019` | Base fees (not burned on L2) | Bedrock | | `L1FeeVault` | `0x420000000000000000000000000000000000001A` | L1 data fees | Bedrock | | `OperatorFeeVault` | `0x420000000000000000000000000000000000001B` | Operator fees | Isthmus | ## Checking vault state ### View current balance ```bash theme={null} export L2_RPC=<L2_RPC> export VAULT=<VAULT_ADDRESS> cast balance $VAULT --rpc-url $L2_RPC ``` ### View configuration ```bash theme={null} # Recipient address cast call $VAULT "recipient()" --rpc-url $L2_RPC # Minimum withdrawal amount (in wei) cast call $VAULT "minWithdrawalAmount()" --rpc-url $L2_RPC # Withdrawal network (0 = L1, 1 = L2) cast call $VAULT "withdrawalNetwork()" --rpc-url $L2_RPC # Total native token withdrawn historically cast call $VAULT "totalProcessed()" --rpc-url $L2_RPC ``` ## Updating configuration <Warning> Configuration changes require the **ProxyAdminOwner** account. If your chain uses a multisig as the ProxyAdminOwner, these calls must be executed through the multisig. </Warning> ### Set recipient ```bash theme={null} export L2_RPC=<L2_RPC> export VAULT=<VAULT_ADDRESS> export PK=<PROXY_ADMIN_OWNER_PRIVATE_KEY> cast send --rpc-url $L2_RPC --private-key $PK \ $VAULT "setRecipient(address)" <NEW_RECIPIENT_ADDRESS> ``` ### Set minimum withdrawal amount ```bash theme={null} cast send --rpc-url $L2_RPC --private-key $PK \ $VAULT "setMinWithdrawalAmount(uint256)" <AMOUNT_IN_WEI> ``` ### Set withdrawal network <Warning> On CGT chains, fee vaults must withdraw to L2 (`withdrawalNetwork = 1`) with an L2 recipient. Deployment rejects L1 for CGT chains, but `setWithdrawalNetwork` does not: setting it to 0 after deployment makes nonzero `withdraw()` calls revert, because `L2ToL1MessagePasser` rejects native token value on CGT chains. </Warning> ```bash theme={null} # 0 = L1, 1 = L2 cast send --rpc-url $L2_RPC --private-key $PK \ $VAULT "setWithdrawalNetwork(uint8)" <0_OR_1> ``` ## Withdrawing fees Withdrawals are **permissionless** — anyone can trigger them once the vault balance meets the minimum threshold. ### Trigger a withdrawal ```bash theme={null} cast send --rpc-url $L2_RPC --private-key $PK \ $VAULT "withdraw()" ``` This withdraws the **entire vault balance** to the configured recipient. ### Withdrawal behavior by network * **L2 withdrawal (`withdrawalNetwork = 1`)**: Funds are transferred immediately to the recipi
프로젝트로 돌아가기