Optimism 백서

Optimism

원문

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

the op-proposer. You can customize the metrics port and address via the `--metrics.port` and `--metrics.addr` flags, respectively. You can find more information about these flags in our [Proposer configuration doc](/operators/chain-operators/configuration/proposer#metricsenabled). ### `op-batcher` To enable metrics, pass the `--metrics.enabled` flag to the op-batcher. You can customize the metrics port and address via the `--metrics.port` and `--metrics.addr` flags, respectively. You can find more information about these flags in our [Batcher configuration doc](/operators/chain-operators/configuration/proposer#metricsenabled). ### `op-challenger` The `op-challenger` operates as the *honest actor* in the fault dispute system and defends the chain by securing the `OptimismPortal` and ensuring the game always resolves to the correct state of the chain. For verifying the legitimacy of claims, `op-challenger` relies on a synced, trusted rollup node as well as a trace provider (e.g., [Cannon](/op-stack/fault-proofs/cannon)). See the [OP-Challenger Explainer](/op-stack/fault-proofs/challenger) for more information on this service. To enable metrics, pass the `--metrics.enabled` flag to `op-challenger` and follow the steps above for customization options. ``` --metrics.addr value (default: "0.0.0.0") ($OP_CHALLENGER_METRICS_ADDR) Metrics listening address --metrics.enabled (default: false) ($OP_CHALLENGER_METRICS_ENABLED) Enable the metrics server --metrics.port value (default: 7300) ($OP_CHALLENGER_METRICS_PORT) Metrics listening port ``` ## Next steps * If you encounter difficulties at any stage of this process, please reach out to [developer support](https://github.com/ethereum-optimism/developers/discussions). # Blockscout block explorer Source: https://docs.optimism.io/chain-operators/tools/explorer Blockscout an open source block explorer for the OP Stack. [Blockscout](https://www.blockscout.com/) is an open source block explorer that supports OP Stack chains. Keep reading for a quick overview on how to deploy Blockscout for your OP Stack chain. <Info> Check out the [Blockscout documentation](https://docs.blockscout.com) for up-to-date information on how to deploy and maintain a Blockscout instance. </Info> ## Dependencies * [Docker](https://docs.docker.com/get-docker/) ## Create an archive node Blockscout needs access to an [archive node](https://www.alchemy.com/overviews/archive-nodes#archive-nodes) for your OP Stack chain to properly index transactions, blocks, and internal interactions. If using `op-geth`, you can run a node in archive mode with the `--gcmode=archive` flag. <Info> Archive nodes take up significantly more disk space than full nodes. You may need to have 2-4 terabytes of disk space available (ideally SSD) if you intend to run an archive node for a production OP Stack chain. 1-200 gigabytes of disk space may be sufficient for a development chain. </Info> ## Installation Blockscout can be started from its source code on GitHub. ```sh theme={null} git clone https://github.com/blockscout/blockscout.git -b production-optimism cd blockscout/docker-compose ``` ## Configuration Review the configuration files within the `envs` directory and make any necessary changes. In particular, make sure to review `envs/common-blockscout.env` and `envs/common-frontend.env`. ## Starting Blockscout Start Blockscout with the following command: ```sh theme={null} DOCKER_REPO=blockscout-optimism docker compose -f geth.yml up ``` ## Usage ### Explorer After Blockscout is started, browse to [http://localhost](http://localhost) to view the user interface. Note that this URL may differ if you have changed the Blockscout configuration. ### API Blockscout provides both a REST API and a GraphQL API. Refer to the [API documentation](https://docs.blockscout.com/for-users/api) for more information. # OP Conductor Source: https://docs.optimism.io/chain-operators/tools/op-conductor Understand how op-conductor keeps an OP Stack sequencer highly available, the guarantees it provides, and how its Raft-based design works. This page explains what the `op-conductor` service is and how it works at a high level. To add it to an existing network, follow the [setup guide](/chain-operators/tools/op-conductor/setup). For the full flag and RPC catalogue, see the [configuration and RPC reference](/chain-operators/tools/op-conductor/reference). ## Enhancing sequencer reliability and availability The [op-conductor](https://github.com/ethereum-optimism/optimism/tree/develop/op-conductor) is an auxiliary service designed to enhance the reliability and availability of a sequencer within high-availability setups. By minimizing the risks associated with a single point of failure, the op-conductor ensures that the sequencer remains operational and responsive. ### Assumptions It is important to note that the `op-conductor` does not incorporate Byzantine fault tolerance (BFT). This means the system operates under the assumption that all participating nodes are honest and act correctly. ### Summary of guarantees The design of the `op-conductor` provides the following guarantees: * **No Unsafe Reorgs** * **No Unsafe Head Stall During Network Partition** * **100% Uptime with No More Than 1 Node Failure** ## Design <img alt="op-conductor." /> **On a high level, `op-conductor` serves the following functions:** ### Raft consensus layer participation * **Leader determination:** Participates in the Raft consensus algorithm to determine the leader among sequencers. * **State management:** Stores the latest unsafe block ensuring consistency across the system. ### RPC request handling * **Admin RPC:** Provides administrative RPCs for manual recovery scenarios, including, but not limited to: stopping the leadership vote and removing itself from the cluster. * **Health RPC:** Offers health RPCs for the `op-node` to determine whether it should allow the publishing of transactions and unsafe blocks. ### Sequencer health monitoring * Continuously monitors the health of the sequencer (op-node) to ensure optimal performance and reliability. ### Control loop management * Implements a control loop to manage the status of the sequencer (op-node), including starting and stopping operations based on different scenarios and health checks. ## Conductor state transition The following is a state machine diagram of how the op-conductor manages the sequencers Raft consensus. <img alt="op-conductor-state-transition." /> **Helpful tips:** To better understand the graph, focus on one node at a time, understand what can be transitioned to this current state and how it can transition to other states. This way you could understand how we handle the state transitions. ## Next steps * Follow the [setup guide](/chain-operators/tools/op-conductor/setup) to add op-conductor to an existing multi-sequencer network without downtime. * Look up flags and admin RPCs in the [configuration and RPC reference](/chain-operators/tools/op-conductor/reference). * Checkout [op-conductor-mon](https://github.com/ethereum-optimism/infra): which monitors multiple op-conductor instances and provides a unified interface for reporting metrics. * Get familiar with [op-conductor-ops](https://github.com/ethereum-optimism/infra/tree/main/op-conductor-ops) to interact with op-conductor. # Configuration and RPCs Source: https://docs.optimism.io/chain-operators/tools/op-conductor/reference Reference for op-conductor configuration flags, environment variables, and conductor namespace RPC methods. This page catalogues op-conductor's configuration options and its admin RPC methods. For how the service works, see [OP Conductor](/chain-operators/tools/op-conductor); to add it to a running network, follow the [setup guide](/chain-operators/tools/op-conductor/setup). ## Configuration options <ConfigReferencePreamble /> Generated from [`op-conductor/v0.9.4`](https://github.com/ethereum-optimism/optimism/releases/tag/op-conductor%2Fv0.9.4) flag definitions. 61 flags: 9 required, 52 optional. ### Required flags | Flag | Description | Environment variable | | - | - | - | | `--consensus.addr` | Address (excluding port) to listen for consensus connections. | `OP_CONDUCTOR_CONSENSUS_ADDR` | | `--consensus.port` | Port to listen for consensus connections. May be 0 to let the system select a port. | `OP_CONDUCTOR_CONSENSUS_PORT` | | `--execution.rpc` | HTTP provider URL for execution layer | `OP_CONDUCTOR_EXECUTION_RPC` | | `--healthcheck.interval` | Interval between health checks | `OP_CONDUCTOR_HEALTHCHECK_INTERVAL` | | `--healthcheck.min-peer-count` | Minimum number of peers required to be considered healthy | `OP_CONDUCTOR_HEALTHCHECK_MIN_PEER_COUNT` | | `--healthcheck.unsafe-interval` | Interval allowed between unsafe head and now measured in seconds | `OP_CONDUCTOR_HEALTHCHECK_UNSAFE_INTERVAL` | | `--node.rpc` | HTTP provider URL for op-node | `OP_CONDUCTOR_NODE_RPC` | | `--raft.server.id` | Unique ID for this server used by raft consensus | `OP_CONDUCTOR_RAFT_SERVER_ID` | | `--raft.storage.dir` | Directory to store raft data | `OP_CONDUCTOR_RAFT_STORAGE_DIR` | ### Optional flags | Flag | Description | Default | Environment variable | | - | - | - | - | | `--consensus.advertised` | Full address (host and port) for other peers to contact the consensus server. Optional: if left empty, the local address is advertised. | — | `OP_CONDUCTOR_CONSENSUS_ADVERTISED` | | `--healthcheck.execution-p2p-check-api` | Type of EL P2P check to perform. If not set, the default `net` type will be used corresponding to the `net_peerCount` RPC call. | `"net"` | `OP_CONDUCTOR_HEALTHCHECK_EXECUTION_P2P_CHECK_API` | | `--healthcheck.execution-p2p-enabled` | Whether to enable EL P2P checks | `false` | `OP_CONDUCTOR_HEALTHCHECK_EXECUTION_P2P_ENABLED` | | `--healthcheck.execution-p2p-min-peer-count` | Minimum number of EL P2P peers required to be considered healthy | `0` | `OP_CONDUCTOR_HEALTHCHECK_EXECUTION_P2P_MIN_PEER_COUNT` | | `--healthcheck.execution-p2p-rpc-url` | URL override for the execution layer RPC client for the sake of p2p healthcheck. If not set, the execution RPC URL will be used. | — | `OP_CONDUCTOR_HEALTHCHECK_EXECUTION_P2P_RPC_URL` | | `--healthcheck.rollup-boost-partial-healthiness-tolerance-interval-seconds` | The time frame within which rollup-boost partial healthiness tolerance is evaluated | `0` | `OP_CONDUCTOR_HEALTHCHECK_ROLLUP_BOOST_PARTIAL_HEALTHINESS_TOLERANCE_INTERVAL_SECONDS` | | `--healthcheck.rollup-boost-partial-healthiness-tolerance-limit` | Sets the count of rollup-boost partial healthiness failures to occur before marking op-conducto as unhealthy. Default is 0 with which a single occurrence of rollup-boost partial healthiness is enough to set op-conductor as unhealthy | `0` | `OP_CONDUCTOR_HEALTHCHECK_ROLLUP_BOOST_PARTIAL_HEALTHINESS_TOLERANCE_LIMIT` | | `--healthcheck.safe-enabled` | Whether to enable safe head progression checks | `false` | `OP_CONDUCTOR_HEALTHCHECK_SAFE_ENABLED` | | `--healthcheck.safe-interval` | Interval between safe head progression measured in seconds | `1200` | `OP_CONDUCTOR_HEALTHCHECK_SAFE_INTERVAL` | | `--log.color` | Color the log output if in terminal mode | `false` | `OP_CONDUCTOR_LOG_COLOR` | | `--log.format` | Format the log output. Supported formats: text, terminal, logfmt, logfmtms, json, jsonms | `text` | `OP_CONDUCTOR_LOG_FORMAT` | | `--log.level` | The lowest log level that will be output | `INFO` | `OP_CONDUCTOR_LOG_LEVEL` | | `--log.pid` | Show pid in the log | `false` | `OP_CONDUCTOR_LOG_PID` | | `--metrics.addr` | Metrics listening address | `"0.0.0.0"` | `OP_CONDUCTOR_METRICS_ADDR` | | `--metrics.enabled` | Enable the metrics server | `false` | `OP_CONDUCTOR_METRICS_ENABLED` | | `--metrics.port` | Metrics listening port | `7300` | `OP_CONDUCTOR_METRICS_PORT` | | `--network` | Predefined network selection. Available networks: every chain bundled from the [superchain-registry](https://github.com/ethereum-optimism/superchain-registry) at the release; run `op-conductor --help` for the exact list | — | `OP_CONDUCTOR_NETWORK` | | `--override.canyon` | Manually specify the canyon fork timestamp, overriding the bundled setting | `0` | `OP_CONDUCTOR_OVERRIDE_CANYON` | | `--override.delta` | Manually specify the delta fork timestamp, overriding the bundled setting | `0` | `OP_CONDUCTOR_OVERRIDE_DELTA` | | `--override.ecotone` | Manually specify the ecotone fork timestamp, overriding the bundled setting | `0` | `OP_CONDUCTOR_OVERRIDE_ECOTONE` | | `--override.fjord` | Manually specify the fjord fork timestamp, overriding the bundled setting | `0` | `OP_CONDUCTOR_OVERRIDE_FJORD` | | `--override.granite` | Manually specify the granite fork timestamp, overriding the bundled setting | `0` | `OP_CONDUCTOR_OVERRIDE_GRANITE` | | `--override.holocene` | Manually specify the holocene fork timestamp, overriding the bundled setting | `0` | `OP_CONDUCTOR_OVERRIDE_HOLOCENE` | | `--override.interop` | Manually specify the interop fork timestamp, overriding the bundled setting | `0` | `OP_CONDUCTOR_OVERRIDE_INTEROP` | | `--override.isthmus` | Manually specify the isthmus fork timestamp, overriding the bundled setting | `0` | `OP_CONDUCTOR_OVERRIDE_ISTHMUS` | | `--override.jovian` | Manually specify the jovian fork timestamp, overriding the bundled setting | `0` | `OP_CONDUCTOR_OVERRIDE_JOVIAN` | | `--override.karst` | Manually specify the karst fork timestamp, overriding the bundled setting | `0` | `OP_CONDUCTOR_OVERRIDE_KARST` | | `--override.pectrablobschedule` | Manually specify the pectrablobschedule fork timestamp, overriding the bundled setting | `0` | `OP_CONDUCTOR_OVERRIDE_PECTRABLOBSCHEDULE` | | `--paused` | Whether the conductor is paused | `false` | `OP_CONDUCTOR_PAUSED` | | `--pprof.addr` | pprof listening address | `"0.0.0.0"` | `OP_CONDUCTOR_PPROF_ADDR` | | `--pprof.enabled` | Enable the pprof server | `false` | `OP_CONDUCTOR_PPROF_ENABLED` | | `--pprof.path` | pprof file path. If it is a directory, the path is \{dir}/\{profileType}.prof | — | `OP_CONDUCTOR_PPROF_PATH` | | `--pprof.port` | pprof listening port | `6060` | `OP_CONDUCTOR_PPROF_PORT` | | `--pprof.type` | pprof profile type. One of cpu, heap, goroutine, threadcreate, block, mutex, allocs | — | `OP_CONDUCTOR_PPROF_TYPE` | | `--raft.bootstrap` | If this node should bootstrap a new raft cluster | `false` | `OP_CONDUCTOR_RAFT_BOOTSTRAP` | | `--raft.heartbeat-timeout` | Heartbeat interval timeout | `1s` | `OP_CONDUCTOR_RAFT_HEARTBEAT_TIMEOUT` | | `--raft.lease-timeout` | Leader lease timeout | `500ms` | `OP_CONDUCTOR_RAFT_LEASE_TIMEOUT` | | `--raft.round-robin-leader-transfer` | Enable deterministic round-robin leader transfer instead of Raft's default log-based selection. Must be enabled on all conductors in the cluster. | `false` | `OP_CONDUCTOR_RAFT_ROUND_ROBIN_LEADER_TRANSFER` | | `--raft.snapshot-interval` | The interval to check if a snapshot should be taken. | `2m0s` | `OP_CONDUCTOR_RAFT_SNAPSHOT_INTERVAL` | | `--raft.snapshot-threshold` | Number of logs to trigger a snapshot | `8192` | `OP_CONDUCTOR_RAFT_SNAPSHOT_THRESHOLD` | | `--raft.trailing-logs` | Number of logs to keep after a snapshot | `10240` | `OP_CONDUCTOR_RAFT_TRAILING_LOGS` | | `--rollup-boost.enabled` | Enable the rollup-boost healthcheck that uses HTTP status codes (200/206/503). Healthchecks are performed against execution.rpc + '/healthz' (path appended automatically). Mutually exclusive with rollup-boost.next-enabled. | `false` | `OP_CONDUCTOR_ROLLUP_BOOST_ENABLED` | | `--rollup-boost.healthcheck-timeout` | Timeout for rollup-boost healthchecks (applies to both standard and next) | `5s` | `OP_CONDUCTOR_ROLLUP_BOOST_HEALTHCHECK_TIMEOUT` | | `--rollup-boost.next-enabled` | Enable rollup-boost healthcheck using JSON response parsing. Requires rollup-boost.next-healthcheck-url. Mutually exclusive with rollup-boost.enabled. | `false` | `OP_CONDUCTOR_ROLLUP_BOOST_NEXT_ENABLED` | | `--rollup-boost.next-healthcheck-url` | Full URL including path for the rollup-boost health endpoint (e.g., '[http://localhost:8080/healthz](http://localhost:8080/healthz)'). Required when rollup-boost.next-enabled is true. | — | `OP_CONDUCTOR_ROLLUP_BOOST_NEXT_HEALTHCHECK_URL` | | `--rollup.config` | Rollup chain parameters | — | `OP_CONDUCTOR_ROLLUP_CONFIG` | | `--rollupboost.ws-url` | WebSocket URL for the rollup boost to listen for payload streams. | — | `OP_CONDUCTOR_ROLLUPBOOST_WS_URL` | | `--rpc.addr` | rpc listening address | `"0.0.0.0"` | `OP_CONDUCTOR_RPC_ADDR` | | `--rpc.enable-admin` | Enable the admin API | `false` | `OP_CONDUCTOR_RPC_ENABLE_ADMIN` | | `--rpc.enable-proxy` | Enable the RPC proxy to underlying sequencer services | `true` | `OP_CONDUCTOR_RPC_ENABLE_PROXY` | | `--rpc.port` | rpc listening port | `8545` | `OP_CONDUCTOR_RPC_PORT` | | `--websocket.server-port` | Port for the conductor to run a WebSocket server that pushes payload streams out. | `8546` | `OP_CONDUCTOR_WEBSOCKET_SERVER_PORT` | ## Notes on selected flags ### raft.bootstrap <Info> For bootstrapping a new cluster. This should only be used on the sequencer that is currently active and can only be started once with this flag, otherwise the flag has to be removed or the raft log must be deleted before re-bootstrapping the cluster. </Info> ### paused <Info> There is no configuration state, so if you unpause via RPC and then restart, it will start paused again. </Info> ## RPCs Conductor exposes [admin RPCs](https://github.com/ethereum-optimism/optimism/blob/develop/op-conductor/rpc/api.go#L17) on the `conductor` namespace. ### conductor\_overrideLeader `OverrideLeader` is used to override the leader status, this is only used to return true for `Leader()` & `LeaderWithID()` calls. It does not impact the actual raft consensus leadership status. It is supposed to be used when the cluster is unhealthy and the node is the only one up, to allow batcher to be able to connect to the node so that it could download blocks from the manually started sequencer. <Tabs> <Tab title="curl"> ```sh theme={null} curl -X POST -H "Content-Type: application/json" --data \ '{"jsonrpc":"2.0","method":"conductor_overrideLeader","params":[],"id":1}' \ http://127.0.0.1:8547 ``` </Tab> <Tab title="cast"> ```sh theme={null} cast rpc conductor_overrideLeader --rpc-url http://127.0.0.1:8547 ``` </Tab> </Tabs> ### conductor\_pause `Pause` pauses op-conductor. <Tabs> <Tab title="curl"> ```sh theme={null} curl -X POST -H "Content-Type: application/json" --data \ '{"jsonrpc":"2.0","method":"conductor_pause","params":[],"id":1}' \ http://127.0.0.1:8547 ``` </Tab> <Tab title="cast"> ```sh theme={null} cast rpc conductor_pause --rpc-url http://127.0.0.1:8547 ``` </Tab> </Tabs> ### conductor\_resume `Resume` resumes op-conductor. <Tabs> <Tab title="curl"> ```sh theme={null} curl -X POST -H "Content-Type: application/json" --data \ '{"jsonrpc":"2.0","method":"conductor_resume","params":[],"id":1}' \ http://127.0.0.1:8547 ``` </Tab> <Tab title="cast"> ```sh theme={null} cast rpc conductor_resume --rpc-url http://127.0.0.1:8547 ``` </Tab> </Tabs> ### conductor\_paused Paused returns true if the op-conductor is paused. <Tabs> <Tab title="curl"> ```sh theme={null} curl -X POST -H "Content-Type: application/json" --data \ '{"jsonrpc":"2.0","method":"conductor_paused","params":[],"id":1}' \ http://127.0.0.1:8547 ``` </Tab> <Tab title="cast"> ```sh theme={null} cast rpc conductor_paused --rpc-url http://127.0.0.1:8547 ``` </Tab> </Tabs> ### conductor\_stopped Stopped returns true if the op-conductor is stopped. <Tabs> <Tab title="curl"> ```sh theme={null} curl -X POST -H "Content-Type: application/json" --data \ '{"jsonrpc":"2.0","method":"conductor_stopped","params":[],"id":1}' \ http://127.0.0.1:8547 ``` </Tab> <Tab title="cast"> ```sh theme={null} cast rpc conductor_stopped --
프로젝트로 돌아가기