Services used within Optimistic Rollup to keep Ethereum and Optimistic Ethereum nodes in sync
1.9K
Optimism is a Public Benefit Corporation dedicated to scaling Ethereum in a way that enshrines fair access to public goods. Optimism is focused on implementing a production-level Optimistic Rollup implementation that integrates with the Optimistic Virtual Machine (OVM) to scale arbitrary Solidity smart contracts.
To get involved, follow us on Twitter, join our Discord, and try out our OVM tutorial!
rollup-services is the Optimism docker image that runs all services, other than the Optimistic Ethereum Node, that are required to run the Optimistic Rollup Sequencer. It can also be configured to run the subset of the services that are required to run an Optimistic Ethereum Verifier. Below are the different services that may be configured to run.
L2 Geth Submission Queuer to the Optimistic Ethereum Geth node.Canonical Chain Batch Creator to the Canonical Transaction Chain contract on Ethereum, monitoring the submission until it is final.State Commitment Chain Batch Creator to the State Commitment Chain contract on Ethereum, monitoring the submission until it is final.This image, whether configured as a Sequencer or a Verifier, requires the following:
All configuration of this image is handled through environment variables. Below is information on all relevant environment variables, grouped by service:
LOG_NEW_LINES (optional) Set this to anything to log new lines instead of the string <\n> in log messages.CLEAR_DATA_KEY (optional) If this value is changed from the last time this image was started, all service data stored on the filesystem will be purged.STARTUP_WAIT_TIMEOUT (optional) The number of seconds to attempt to connect to L2 geth before failing (set to -1 if not to wait for L2 geth).DEBUG (optional) The debug configuration for log statements. Common options are error*, info*, warn*, and debug*.POSTGRES_HOST (required) The host url / IP for the postgres DB to use.POSTGRES_PORT (required) The port of the postgres DB. This will probably be 5432.POSTGRES_USER (required) The username to use to connect to the postgres DB.POSTGRES_PASSWORD (required) The password to use to connect to the postgres DB.POSTGRES_DATABASE (required) The database to connect to. This will almost definitely be rollup.POSTGRES_CONNECTION_POOL_SIZE (optional) The connection pool size for postgres (defaults to 20).POSTGRES_USE_SSL (optional) Set to anything to indicate that SSL should be used in the connection.Note: either L1_NODE_WEB3_URL or both L1_NODE_INFURA_NETWORK and L1_NODE_INFURA_PROJECT_ID must be configured
L1_NODE_WEB3_URL (optional) The url, including port, of the node used to connect to Ethereum.L1_NODE_INFURA_NETWORK (optional) Used in conjunction with L1_NODE_INFURA_PROJECT_ID to use Infura to connect to Ethereum.L1_NODE_INFURA_PROJECT_ID (optional) Used in conjunction with L1_NODE_INFURA_NETWORK to use Infura to connect to Ethereum.FINALITY_DELAY_IN_BLOCKS (required) The number of block confirmations required to consider a transaction final on Ethereum.L2_NODE_WEB3_URL (required) The Optimistic Ethereum node url, including the port.L1_SEQUENCER_PRIVATE_KEY(required) The private key to use to submit Sequencer Transaction BatchesL1_STATE_ROOT_SUBMITTER_PRIVATE_KEY (required) The private key to use to submit State Root Batches (will cause nonce issues if the same as the L1_SEQUENCER_PRIVATE_KEY key)CANONICAL_TRANSACTION_CHAIN_CONTRACT_ADDRESS (required) The address of the CanonicalTransactionChain contract on Ethereum (L1 node).STATE_COMMITMENT_CHAIN_CONTRACT_ADDRESS (required) The address of the StateCommitmentChain contract on Ethereum (L1 node).L1_TO_L2_TRANSACTION_QUEUE_CONTRACT_ADDRESS (required) The address of the L1ToL2TransactionQueue contract on Ethereum (L1 node).SAFETY_TRANSACTION_QUEUE_CONTRACT_ADDRESS (required) The address of the SafetyTransactionQueue contract on Ethereum (L1 node).L1_CHAIN_DATA_PERSISTER_DB_PATH (required) The filepath where to locate (or create) the L1 Chain Data Persister LevelDB databaseL1_EARLIEST_BLOCK (required) The earliest block to sync on Ethereum (L1 Node) to start persisting data. This should be a block no later than the block in which the first Optimistic Rollup contract was deployed.L2_CHAIN_DATA_PERSISTER_DB_PATH (required) The filepath where to locate (or create) the L2 Chain Data Persister LevelDB databaseIS_SEQUENCER_STACK (optional) Set to anything if this is queueing Geth submissions for a sequencer (and not just a verifier).GETH_SUBMISSION_QUEUER_PERIOD_MILLIS (optional) The period in milliseconds at which the Geth Submission Queuer should attempt to queue an L2 Geth submission (defaults to 10,000).SUBMIT_TO_L2_PRIVATE_KEY (required) The private key to use to sign batches to send to L2 Geth (deprecated). Must match the key configured in Geth.QUEUED_GETH_SUBMITTER_PERIOD_MILLIS (optional) The period in milliseconds at which the Queued Geth Submitter should attempt to send L2 Geth submissions (defaults to 10,000)CANONICAL_CHAIN_BATCH_MIN_CALLDATA_BYTES (optional) The minimum number of rollup transaction calldata bytes required to build a rollup batch -- if there aren't enough bytes of calldata ready (from txs to rollup), a batch will not be created (defaults to 0).CANONICAL_CHAIN_BATCH_MAX_CALLDATA_BYTES (optional) The maximum number of rollup transaction calldata bytes to be included in a rollup batch -- if there are more than this number of bytes of calldata ready (from txs to rollup), they will be split into multiple batches of at most this size (defaults to 125_000).CANONICAL_CHAIN_BATCH_CREATOR_PERIOD_MILLIS (optional) The period in milliseconds at which the Canonical Chain Batch Creator should attempt to create Canonical Chain Batches (defaults to 10,000).CANONICAL_CHAIN_BATCH_SUBMITTER_PERIOD_MILLIS (optional) The period in milliseconds at which the Canonical Chain Batch Creator should attempt to create Canonical Chain Batches (defaults to 10,000).STATE_COMMITMENT_CHAIN_MIN_BATCH_SIZE (optional) The minimum state root batch size to build -- if fewer than this number of transaction state roots are ready, a batch will not be created (defaults to 10).STATE_COMMITMENT_CHAIN_MAX_BATCH_SIZE (optional) The maximum state root batch size to build -- if more than this number of transaction state roots are ready, they will be split into multiple batches of at most this size (defaults to 100).STATE_COMMITMENT_CHAIN_BATCH_CREATOR_PERIOD_MILLIS (optional) The period in milliseconds at which the State Commitment Chain Batch Creator should attempt to create StateCommitmentChain Batches (defaults to 10,000).STATE_COMMITMENT_CHAIN_BATCH_SUBMITTER_PERIOD_MILLIS (optional) The period in milliseconds at which the State Commitment Chain Batch Submitter should attempt to submit pending StateCommitmentChain Batches (defaults to 10,000).FRAUD_DETECTOR_PERIOD_MILLIS (optional) The period in milliseconds at which the Fraud Detector should run (defaults to 10,000).REALERT_ON_UNRESOLVED_FRAUD_EVERY_N_FRAUD_DETECTOR_RUNS (optional) The number of runs after which a detected fraud, if still present, should re-alert (via error logs) (defaults to 10).Set the following environment variables to any truthy value to configure the associated service to run:
RUN_L1_CHAIN_DATA_PERSISTERRUN_L2_CHAIN_DATA_PERSISTERRUN_GETH_SUBMISSION_QUEUERRUN_QUEUED_GETH_SUBMITTERRUN_CANONICAL_CHAIN_BATCH_CREATORRUN_CANONICAL_CHAIN_BATCH_SUBMITTERRUN_STATE_COMMITMENT_CHAIN_BATCH_CREATORRUN_STATE_COMMITMENT_CHAIN_BATCH_SUBMITTERRUN_FRAUD_DETECTORdocker pull ethereumoptimism/rollup-services:latest