Optimism 백서

Optimism

원문

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

his guide shows how to check and adjust the fee-related parameters on your chain's `SystemConfig` contract, and when each adjustment makes sense. It applies to the Jovian and following hardforks. * For how each fee component is calculated, see [transaction fees on OP Mainnet](https://docs.optimism.io/op-stack/transactions/fees#transaction-fees-on-op-mainnet). * For the full parameter catalogue — types, setters, and the OP Mainnet values — see the [fee parameters reference](/chain-operators/reference/fee-parameters). On an OP Stack chain a transaction's **Total Fee** is made of three main components: `Total Fee = L2 Fee + L1 Fee + Operator Fee` Fees are gathered in dedicated contract [fee vaults](/op-stack/transactions/fee-vaults) that collect the different fee components (for example `BaseFeeVault`, `SequencerFeeVault`, etc.). See the [fee vault operations guide](/chain-operators/guides/management/fee-vaults) for how to manage and withdraw from these vaults. ## Before you start <Info> Only the [SystemConfig owner](/op-stack/protocol/privileged-roles) can change these parameters. </Info> Export the values used by all the commands below: ```bash theme={null} export L1_RPC=<L1_RPC> export SYSTEM_CONFIG=<SYSTEM_CONFIG_ADDRESS> export PK=<SYSTEM_CONFIG_OWNER_PRIVATE_KEY> ``` ## Tune the L2 fee The L2 fee is the EVM execution cost: `gasUsed * (baseFee + priorityFee)`. The `baseFee` is computed with the EIP-1559 mechanism and is **collected in the BaseFeeVault (not burned)** on OP Stack. You can tune L2 fee dynamics on the SystemConfig via: * `eip1559Denominator`: EIP-1559 max-change denominator, it appears in the denominator of the per-block base fee delta. Lower = faster response, so base fee adjusts faster but results in more volatility. * `eip1559Elasticity`: elasticity multiplier, sets the target relative to gasLimit. As `gas_target = gasLimit / elasticity`, a **smaller gas target** (larger elasticity) means the base fee will start increasing at a lower block gas usage (i.e., base fee increases sooner under load). * `gasLimit`: max gas per block. Lower `gasLimit` = less available gas per block (less supply), which makes base fees more sensitive to demand and can cause the base fee to move more easily. * `minBaseFee`: minimum floor on base fee, in wei (it can be 0). See [setting the minimum base fee](/chain-operators/guides/features/setting-min-base-fee). ### Check current values ```bash theme={null} cast call --rpc-url $L1_RPC $SYSTEM_CONFIG "eip1559Denominator()" cast call --rpc-url $L1_RPC $SYSTEM_CONFIG "eip1559Elasticity()" cast call --rpc-url $L1_RPC $SYSTEM_CONFIG "minBaseFee()" cast call --rpc-url $L1_RPC $SYSTEM_CONFIG "gasLimit()" ``` ### Set values ```bash theme={null} cast send --rpc-url $L1_RPC --private-key $PK \ $SYSTEM_CONFIG "setEIP1559Params(uint32,uint32)" <denominator> <elasticity> cast send --rpc-url $L1_RPC --private-key $PK \ $SYSTEM_CONFIG "setMinBaseFee(uint64)" <minBaseFeeWei> cast send --rpc-url $L1_RPC --private-key $PK \ $SYSTEM_CONFIG "setGasLimit(uint64)" <gasLimit> ``` ## Tune the L1 fee The L1 fee charges for posting L2 data to L1: the transaction's estimated compressed (FastLZ) size is multiplied by a scalar-weighted L1 price. See the [fee parameters reference](/chain-operators/reference/fee-parameters#fee-formulas) for the formula. Reasons to tweak it: * Modify margin charged on top of expected costs * Adjust FastLZ estimates to reflect costs * Differentiate charges for per-byte vs per-blob costs to reflect actual L1 pricing The knobs: * `basefeeScalar`: scales the `l1BaseFee` contribution to the L1 data fee (per-byte). * `blobBaseFeeScalar`: scales the `l1BlobBaseFee` contribution (per-blob). ### Check current values ```bash theme={null} cast call --rpc-url $L1_RPC $SYSTEM_CONFIG "basefeeScalar()" cast call --rpc-url $L1_RPC $SYSTEM_CONFIG "blobbasefeeScalar()" ``` ### Set values ```bash theme={null} cast send --rpc-url $L1_RPC --private-key $PK \ $SYSTEM_CONFIG "setGasConfigEcotone(uint32,uint32)" <basefeeScalar> <blobBaseFeeScalar> ``` ## Tune the operator fee The operator fee is a discretionary, non-standard fee charged per transaction: `(gasUsed * operatorFeeScalar * 100) + operatorFeeConstant`. See [setting the operator fee](/chain-operators/guides/features/setting-operator-fee) for a dedicated guide. * `operatorFeeScalar`: per-gas operator margin. * `operatorFeeConstant`: flat per-transaction operator fee, in wei. <Warning> Any non-zero operator fee makes the chain configuration [non-standard](/op-stack/protocol/superchain-registry#what-is-a-standard-chain). </Warning> ### Check current values ```bash theme={null} cast call --rpc-url $L1_RPC $SYSTEM_CONFIG "operatorFeeScalar()" cast call --rpc-url $L1_RPC $SYSTEM_CONFIG "operatorFeeConstant()" ``` ### Set values ```bash theme={null} cast send --rpc-url $L1_RPC --private-key $PK \ $SYSTEM_CONFIG "setOperatorFeeScalars(uint32,uint64)" <operatorFeeScalar> <operatorFeeConstant> ``` ## Tune the DA footprint limit The `daFootprintGasScalar` is an in-protocol limit on estimated DA usage to prevent DA spam and priority fee auctions. See [how the DA footprint block limit works](/chain-operators/reference/da-footprint) for the concept and the [DA footprint setup guide](/chain-operators/guides/features/setting-da-footprint) for a dedicated walkthrough. * Default value is **400** * A value of **0** is treated as **400** * Setting it to **1** effectively disables DA footprint limiting ### Check current value ```bash theme={null} cast call --rpc-url $L1_RPC $SYSTEM_CONFIG "daFootprintGasScalar()" ``` ### Set value ```bash theme={null} cast send --rpc-url $L1_RPC --private-key $PK \ $SYSTEM_CONFIG "setDAFootprintGasScalar(uint16)" <daFootprintGasScalar> ``` ## Example scenarios ### Normal traffic / below EIP-1559 target **What you'll see** * If blocks stay below the EIP-1559 target, `baseFee` trends toward the `minBaseFee` floor. * When L1 data usage is low, the L2 execution fee (`gasUsed * (baseFee + priorityFee)`) is typically the largest cost component. * The L1 data fee remains low/steady if calldata per transaction is small. **What to tweak** * Usually nothing. * If you need a revenue floor set/increase `minBaseFee`. **Tradeoff** * **Pros:** `minBaseFee` prevents prolonged low base fees and provides a predictable minimum (can be left at 0 to improve UX). * **Cons:** If set too high, it raises inclusion cost for low-value transactions and can negatively impact UX/accessibility. *** ### Busy blocks / congestion **What you'll see** * `baseFee` rises when blocks exceed the target: `gas_target = gasLimit / eip1559Elasticity` * Transactions with low priority tips may experience slower inclusion during congestion. **What to tweak** * `eip1559Elasticity` and `eip1559Denominator` : * To increase responsiveness: decrease `eip1559Denominator` and/or increase `eip1559Elasticity` (smaller target → baseFee increases sooner). * To decrease volatility: increase `eip1559Denominator` and/or reduce aggressiveness in `eip1559Elasticity`. **Tradeoff** * **Pros:** Faster base fee response better captures demand; elasticity provides direct control over the gas target. * **Cons:** Smaller denominator and/or aggressive elasticity increases per-block swings and increases fee volatility. *** ### Calldata-heavy transactions **What you'll see** * L1 data fee becomes a larger share of total cost for calldata heavy transactions (the L1 fee scales with compressed calldata size). * Increasing `basefeeScalar` increases the per-byte L1 charge, making calldata heavy transactions more expensive. **What to tweak** * `basefeeScalar` and `blobBaseFeeScalar`: * Increase them if you need to recover more L1/DA posting costs from data heavy transactions. * Decrease them if you want to reduce user cost for calldata/blob-heavy workloads. **Tradeoff** * **Pros:** Enables proportional recovery of L1/DA posting costs. * **Cons:** Penalizes calldata/blob-heavy dapps/users. Aggressive values can impact UX and reduce activity. *** ### Predictable operator revenue **What you'll see** * Introducing or increasing `operatorFeeScalar` raises the per-gas operator charge and increases predictable revenue per transaction. * `operatorFeeConstant` adds a flat per-transaction fee regardless of gas usage. **What to tweak** * `operatorFeeScalar` and `operatorFeeConstant`: * Use when you want direct, predictable operator revenue independent of congestion and L1 fee dynamics. **Tradeoff** * **Pros:** Direct and predictable revenue per transaction. * **Cons:** May discourage low-value transactions and changes transaction economics; should be used carefully. Any non-zero operator fee makes the chain configuration non-standard. *** ### DA-heavy workloads / DA-spam resistance **What you'll see** * DA footprint can limit how much transaction data fits into a block through scaled accounting of compressed DA usage. * Increasing `daFootprintGasScalar` raises the gas charged per DA-byte footprint, reducing DA capacity for the same byte footprint and deterring DA-heavy patterns. **What to tweak** * `daFootprintGasScalar`: * Default is **400**, and `0` is treated as the default. * Setting it to **1** disables the DA footprint limiting behavior. **Tradeoff** * **Pros:** Deters DA spam and makes DA costs explicit in block accounting. * **Cons:** Increasing it reduces DA capacity and may throttle the batcher or exclude legitimate DA-heavy workloads if set too aggressively. *** ## Summary 1. Make sure to check your current hardfork, this doc applies to Jovian and following hardforks. 2. Check the current fee parameters on your SystemConfig contract (see the [fee parameters reference](/chain-operators/reference/fee-parameters) for the expected values on OP Mainnet). 3. Make small changes and observe: vault balances, inclusion times, dropped txs, DA throttling, etc. 4. Extensively test all changes on a staging/testnet. 5. Communicate changes to dapp/wallet teams (gas estimation will change). *** ## References * [Fee parameters reference](/chain-operators/reference/fee-parameters) * [Transaction fees on OP Mainnet](https://docs.optimism.io/op-stack/transactions/fees#transaction-fees-on-op-mainnet) * [Operator fee](https://docs.optimism.io/op-stack/transactions/fees#operator-fee) * [L1 data fee](https://docs.optimism.io/op-stack/transactions/fees#l1-data-fee) * [SystemConfig interface](https://github.com/ethereum-optimism/optimism/blob/develop/packages/contracts-bedrock/interfaces/L1/ISystemConfig.sol) * [DA footprint](https://docs.optimism.io/notices/archive/upgrade-17#block-header-changes) * [EIP-1559](https://docs.optimism.io/op-stack/protocol/differences#eip-1559-parameters) * [OP Mainnet values](https://etherscan.io/address/0x229047fed2591dbec1eF1118d64F7aF3dB9EB290#readProxyContract) # Troubleshooting chain operations Source: https://docs.optimism.io/chain-operators/guides/management/troubleshooting Learn solutions to common problems when troubleshooting chain operations. This page lists common troubleshooting scenarios and solutions for chain operators. ## EvmError in contract deployment L1 smart contract deployment fails with the following error: ```text theme={null} EvmError: Revert ``` ### Solution The OP Stack uses deterministic smart contract deployments to guarantee that all contract addresses can be computed ahead of time based on a "salt" value that is provided at deployment time. Each OP Stack chain must have a unique salt value to ensure that the contract addresses do not collide with other OP Stack chains. You can avoid this error by changing the salt used when deploying the L1 smart contracts. The salt value is set by the `IMPL_SALT` environment variable when deploying the contracts. The `IMPL_SALT` value must be a 32 byte hex string. You can generate a random salt value using the following command: ```bash theme={null} export IMPL_SALT=$(openssl rand -hex 32) ``` ## Failed to find the L2 Heads to start from `op-node` fails to execute the derivation process with the following error: ```text theme={null} WARN [02-16|21:22:02.868] Derivation process temporary error attempts=14 err="stage 0 failed resetting: temp: failed to find the L2 Heads to start from: failed to fetch L2 block by hash 0x0000000000000000000000000000000000000000000000000000000000000000: failed to determine block-hash of hash 0x0000000000000000000000000000000000000000000000000000000000000000, could not get payload: not found" ``` ### Solution This error can occur when the data directory for `op-reth` becomes corrupted (for example, as a result of a computer crash). You will need to reinitialize the data directory. If you are following the tutorial for [Creating Your Own L2 Rollup](/chain-operators/tutorials/create-l2-rollup), make sure to rerun the commands within the [Spin up sequencer](/chain-operators/tutorials/create-l2-rollup/op-reth-setup) section. If you are not following the tutorial, make sure to take the following steps: 1. Stop `op-node` and `op-reth`. 2. Delete the corresponding `op-reth` data directory. 3. Reinitialize `op-reth` with the `genesis.json` file: `op-reth init --chain=./genesis.json --datadir=./datadir`. 4. Restart `op-reth` and `op-node`. ## Batcher unable to publish transaction `op-batcher` fails to publish transactions with the following error: ```text theme={null} INFO [03-21|14:22:32.754] publishing transaction service=batcher txHash=2ace6d..7eb248 nonce=2516 gasTipCap=2,340,741 gasFeeCap=172,028,434,515 ERROR[03-21|14:22:32.844] unable to publish transaction service=batcher txHash=2ace6d..7eb248 nonce=2516 gasTipCap=2,340,741 gasFeeCap=172,028,434,515 err="insufficient funds for gas * price + value" ``` ### Solution You will observe this error if the `op-batcher` runs out of ETH to publish transactions to L1. This problem can be resolved by sending additional ETH to the `op-batcher` address. # Chain operators Source: https://docs.optimism.io/chain-operators/index Routes chain operators to the quickstart, guides, tutorials, tools, and reference for launching and running an OP Stack chain. You are launching or operating your own OP Stack chain. Deploy first, then use the guides, tools, and reference material to run it in production. <CardGroup> <Card title="Deploy a chain" href="/chain-operators/quickstart"> Launch your first OP Stack chain with op-deployer. </Card> <Card title="Configure and manage your chain" href="/chain-operators/guides/configuration/getting-started"> Set up the batcher, proposer, and challenger, enable features, and follow production best practices. </Card> <Card title="Work through a tutorial" href="/chain-operators/tutorials/create-l2-rollup"> Build a rollup component by component, upgrade L1 contracts, and customize your chain step by step. </Card> <Card title="Run the supporting tools" href="/chain-operators/tools/op-deployer/overview"> Operate op-deployer, op-conductor, chain monitoring, and the RPC frontends that keep a chain healthy. </Card> <Card title="Look up configuration reference" href="/chain-operators/reference/batcher-configuration"> Check flag-level reference for the batcher, challenger, deployment configuration, and fee parameters. </Card> <Card title="Not running your own chain?" href="/"> Route by role from the documentation home: app developers, node operators, and protocol learners each have their own section. </Card> </CardGroup> # Choose how to run your chain Source: https://docs.optimism.io/chain-operators/launch-paths The spectrum between running an OP Stack chain yourself and having it operated for you, and what your team owns at each point on it. Every team launching an OP Stack chain lands somewhere on the same spectrum. At one end, your team runs every service and holds every key. At the other end, someone runs them for you. The choice is not about capability: it is about which parts of a standing operation your team wants to own. This page describes the spectrum and what falls to your team at each point on it. It does not pick a point for you. The pages linked below document the whole system regardless of who operates it. ## The spectrum | | Run it yourself | Run it with engineering support | Have it operated for you | | - | - | - | - | | Sequencer cluster | Your team | Your team, with OP Labs engineering behind it | OP Enterprise | | Fault-proof defense | Your team | Your team, with OP Labs engineering behind it | OP Enterprise | | Upgrade execution | Your team | Your team, with OP Labs engineering behind it | OP Enterprise | | Incident response | Your team | Your team, with OP Labs engineering behind it | OP Enterprise | | These docs | The reference for what you run | The reference for what you run | The reference for what runs on your behalf | ## Run it yourself Your team runs every service, holds every key, and owns every incident. These docs cover all of it, and every destination below is one click away. What that ownership includes, stated the way the docs themselves state it: ### The services you run * **The sequencer.** A single sequencer is a single point of failure for the whole chain: when it stops, no new unsafe blocks exist for anyone. The high-availability answer is a sequencer cluster managed by [op-conductor](/chain-operators/tools/op-conductor), with its nodes in separate failure domains. The design is not Byzantine fault tolerant: it assumes every node in the cluster is honest and operated by you, so it protects against crashes and partitions, not against a malicious cluster member. See [the launch guide's sequencer topology step](/use-cases/launch-a-chain-with-fault-proofs-and-ha-sequencing#step-3-design-the-sequencer-topology). * **The defense.** The defense is a service you run and a set of decisions your team staffs. The [`op-challenger`](/op-stack/fault-proofs/challenger) is a service that monitors every game, defends valid proposals, challenges invalid ones, resolves games, and claims bonds. Starting it is not the whole job. Every claim it posts carries a bond sent as transaction value; correct claims are refunded, incorrect ones pay the counter-claimer, and bonds from won games pay out only after a delay, so capital stays locked while games resolve. How much the challenger's account holds, how quickly you can top it up during an active dispute, and which absolute prestate it plays with are operational answers your team owns; the challenger refuses to interact with games whose prestate it does not have. See [Run a fault-proof challenger](/use-cases/run-a-fault-proof-challenger). * **The monitoring.** Watching the chain is a separate set of services from running it. `op-dispute-mon` tracks the status of every dispute game and is how you learn that your challenger is acting; `monitorism` carries the onchain security monitors, whose security-integrity group exists to check that the bridges between L2 and L1 behave as expected, including the faultproof withdrawal monitor that watches `ProvenWithdrawals` events on the `OptimismPortal` and flags invariant violations. Your own components need their metrics endpoints scraped alongside that: `op-node`, `op-batcher`, `op-proposer`, and `op-challenger` each expose one. Peer count belongs on that list too, because an `op-node` without peers cannot sync unsafe blocks and falls behind the sequencer. See [Chain monitoring options](/chain-operators/tools/chain-monitoring) and [the important node metrics](/node-operators/guides/monitoring/metrics#important-metrics). * **The RPC endpoints.** Every service in the stack depends on RPC, and not only on L1. Each sequencer's op-node derives the chain from an L1 RPC and an L1 beacon endpoint, and the batcher, proposer, and challenger read and transact against L1; `op-challenger` additionally needs an L2 archive node (`--l2-eth-rpc`) and a rollup node wit
프로젝트로 돌아가기