optimism

module
v1.19.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 26, 2026 License: MIT

README



Optimism

Optimism is Ethereum, scaled.


Table of Contents

What is Optimism?

Optimism is a project dedicated to scaling Ethereum's technology and expanding its ability to coordinate people from across the world to build effective decentralized economies and governance systems. The Optimism Collective builds open-source software that powers scalable blockchains and aims to address key governance and economic challenges in the wider Ethereum ecosystem. Optimism operates on the principle of impact=profit, the idea that individuals who positively impact the Collective should be proportionally rewarded with profit. Change the incentives and you change the world.

In this repository you'll find numerous core components of the OP Stack, the decentralized software stack maintained by the Optimism Collective that powers Optimism and forms the backbone of blockchains like OP Mainnet and Base. The OP Stack is designed to be aggressively open-source — you are welcome to explore, modify, and extend this code.

Documentation

Specification

Detailed specifications for the OP Stack can be found within the OP Stack Specs repository.

Community

General discussion happens most frequently on the Optimism discord. Governance discussion can also be found on the Optimism Governance Forum.

Contributing

The OP Stack is a collaborative project. By collaborating on free, open software and shared standards, the Optimism Collective aims to prevent siloed software development and rapidly accelerate the development of the Ethereum ecosystem. Come contribute, build the future, and redefine power, together.

CONTRIBUTING.md contains a detailed explanation of the contributing process for this repository. Make sure to use the Developer Quick Start to properly set up your development environment.

Good First Issues are a great place to look for tasks to tackle if you're not sure where to start, and see CONTRIBUTING.md for info on larger projects.

Security Policy and Vulnerability Reporting

Please refer to the canonical Security Policy document for detailed information about how to report vulnerabilities in this codebase. Bounty hunters are encouraged to check out the Optimism Immunefi bug bounty program. The Optimism Immunefi program offers up to $2,000,042 for in-scope critical vulnerabilities.

Directory Structure

├── cannon: Onchain MIPS instruction emulator for fault proofs
├── docs: A collection of documents including audits and post-mortems
│   └── public-docs: Public developer documentation for docs.optimism.io
├── op-acceptance-tests: Acceptance tests and configuration for OP Stack
├── op-alt-da: Alternative Data Availability mode (beta)
├── op-batcher: L2-Batch Submitter, submits bundles of batches to L1
├── op-chain-ops: State surgery utilities
├── op-challenger: Dispute game challenge agent
├── op-conductor: High-availability sequencer service
├── op-deployer: CLI tool for deploying and upgrading OP Stack smart contracts
├── op-devstack: Flexible test frontend for integration and acceptance testing
├── op-dispute-mon: Off-chain service to monitor dispute games
├── op-dripper: Controlled token distribution service
├── op-e2e: End-to-End testing of all bedrock components in Go
├── op-faucet: Dev-faucet with support for multiple chains
├── op-fetcher: Data fetching utilities
├── op-interop-mon: Interoperability monitoring service
├── op-node: Rollup consensus-layer client
├── op-preimage: Go bindings for Preimage Oracle
├── op-proposer: L2-Output Submitter, submits proposals to L1
├── op-service: Common codebase utilities
├── op-supervisor: Service to monitor chains and determine cross-chain message safety
├── op-sync-tester: Sync testing utilities
├── op-test-sequencer: Test sequencer for development
├── op-up: Deployment and management utilities
├── op-wheel: Database utilities
├── ops: Various operational packages
├── packages
│   ├── contracts-bedrock: OP Stack smart contracts

Development and Release Process

Overview

Please read this section carefully if you're planning to fork or make frequent PRs into this repository.

Production Releases

Production releases are always tags, versioned as <component-name>/v<semver>. For example, an op-node release might be versioned as op-node/v1.1.2, and smart contract releases might be versioned as op-contracts/v1.0.0. Release candidates are versioned in the format op-node/v1.1.2-rc.1. We always start with rc.1 rather than rc.

For contract releases, refer to the GitHub release notes for a given release which will list the specific contracts being released. Not all contracts are considered production ready within a release and many are under active development.

Tags of the form v<semver>, such as v1.1.4, indicate releases of all Go code only, and DO NOT include smart contracts. This naming scheme is required by Golang. In the above list, this means these v<semver> releases contain all op-* components and exclude all contracts-* components.

op-geth embeds upstream geth’s version inside its own version as follows: vMAJOR.GETH_MAJOR GETH_MINOR GETH_PATCH.PATCH. Basically, geth’s version is our minor version. For example if geth is at v1.12.0, the corresponding op-geth version would be v1.101200.0. Note that we pad out to three characters for the geth minor version and two characters for the geth patch version. Since we cannot left-pad with zeroes, the geth major version is not padded.

See the GitHub releases page for more information about releases for the latest node components.

The full set of components that have releases are:

  • op-batcher
  • op-contracts
  • op-challenger
  • op-node
  • op-proposer

All other components and packages should be considered development components only and do not have releases.

Development branch

The primary development branch is develop. develop contains the most up-to-date software that remains backwards compatible with the latest experimental network deployments. If you're making a backwards compatible change, please direct your pull request towards develop.

Changes to contracts within packages/contracts-bedrock/src are usually NOT considered backwards compatible. Some exceptions to this rule exist for cases in which we absolutely must deploy some new contract after a tag has already been fully deployed. If you're changing or adding a contract and you're unsure about which branch to make a PR into, default to using a feature branch. Feature branches are typically used when there are conflicts between 2 projects touching the same code, to avoid conflicts from merging both into develop.

Downloading & Shallow-Cloning the Monorepo

If you want to use the monorepo as a dependency, e.g. in CI, you can greatly speed up the fetching process by either downloading it directly as an archive from Github instead of cloning as a git repository or shallow-cloning it. This avoids downloading the full monorepo git history, which is unfortunately a few GBs in size, but which also isn't needed for many use cases, like CI.

To fetch the monorepo at a specific commit/branch/tag $REF, download and unpack with

curl -L https://github.com/ethereum-optimism/optimism/archive/$REF.tar.gz | tar xz

Note that if you need any of its submodules, you'd need to manually download those too.

If you want a shallow git clone of latest develop, you can just do

git clone --depth 1 --shallow-submodules https://github.com/ethereum-optimism/optimism.git

which takes only a few seconds on a good internet connection.

If you want to shallow-checkout a specific branch or tag $REF, do

git clone --no-checkout --depth 1 --shallow-submodules https://github.com/ethereum-optimism/optimism.git
cd optimism
git fetch --depth 1 origin "$REF"
git checkout "$REF"

which should also only take a few seconds.

License

All other files within this repository are licensed under the MIT License unless stated otherwise.

Directories

Path Synopsis
bss-core module
cmd
multicannon command
gas-oracle module
go
bss-core module
gas-oracle module
indexer module
op-exporter module
op_exporter module
proxyd module
stackman module
teleportr module
indexer module
l2geth module
linter
op-acceptance-tests
tests/custom_gas_token
op-acceptance-tests/tests/custom_gas_token/helpers.go
op-acceptance-tests/tests/custom_gas_token/helpers.go
tests/interop/loadtest
Package loadtest contains interop load tests that run against sysgo networks satisfying the SimpleInterop spec.
Package loadtest contains interop load tests that run against sysgo networks satisfying the SimpleInterop spec.
cmd/daserver command
op-batcher module
cmd command
rpc
op-bindings module
op-chain-ops module
cmd/check-fjord command
cmd/check-karst command
cmd/check-karst/karsttest
Package karsttest implements the post-Karst conformance checks shared between the op-acceptance-tests acceptance suite and the check-karst CLI.
Package karsttest implements the post-Karst conformance checks shared between the op-acceptance-tests acceptance suite and the check-karst CLI.
cmd/gnosis command
cmd/op-simulate command
cmd/sdm-devnet command
cmd/withdrawal command
crossdomain
Package crossdomain provides libraries useful for managing L1 <> L2 cross domain communication.
Package crossdomain provides libraries useful for managing L1 <> L2 cross domain communication.
interopbridge
Package interopbridge implements the canonical cross-chain ETH bridge used by the interop test tools (check-lagoon and interop-smoke): it sends ETH through the SuperchainETHBridge predeploy, relays the resulting message itself, and verifies the recipient was credited.
Package interopbridge implements the canonical cross-chain ETH bridge used by the interop test tools (check-lagoon and interop-smoke): it sends ETH through the SuperchainETHBridge predeploy, relays the resulting message itself, and verifies the recipient was credited.
interopsmoke
Package interopsmoke implements interop smoke tests that run against the RPCs of two live interoperable L2 chains: chain identity, ETH transfers, cross-chain ETH bridging, and valid/invalid executing-message checks.
Package interopsmoke implements interop smoke tests that run against the RPCs of two live interoperable L2 chains: chain identity, ETH transfers, cross-chain ETH bridging, and valid/invalid executing-message checks.
opcmregistry
Package opcmregistry provides utilities for loading OPCM (OP Contracts Manager) information from the superchain-registry.
Package opcmregistry provides utilities for loading OPCM (OP Contracts Manager) information from the superchain-registry.
script
AUTO-GENERATED - DO NOT EDIT
AUTO-GENERATED - DO NOT EDIT
cmd command
op-conductor
cmd command
rpc
op-core
fees
Package fees implements the OP-Stack L1 data-availability cost and operator-fee calculations.
Package fees implements the OP-Stack L1 data-availability cost and operator-fee calculations.
nuts/state
Package state provides the frozen pre-fork L2 predeploy state artifacts that the NUT bundle activation test boots from.
Package state provides the frozen pre-fork L2 predeploy state artifacts that the NUT bundle activation test boots from.
params
Package params holds the OP-Stack-specific chain configuration types.
Package params holds the OP-Stack-specific chain configuration types.
types
Package types holds the OP-Stack-specific transaction and receipt types.
Package types holds the OP-Stack-specific transaction and receipt types.
op-deployer
cmd/op-deployer command
pkg/deployer/upgrade/v3_0_0
Package v3_0_0 implements the upgrade to v3.0.0 (U14).
Package v3_0_0 implements the upgrade to v3.0.0 (U14).
pkg/deployer/upgrade/v4_0_0
Package v4_0_0 implements the upgrade to v4.0.0 (U16).
Package v4_0_0 implements the upgrade to v4.0.0 (U16).
pkg/deployer/upgrade/v4_1_0
Package v4_1_0 implements the upgrade to v4.1.0 (U16a).
Package v4_1_0 implements the upgrade to v4.1.0 (U16a).
pkg/deployer/upgrade/v5_0_0
Package v5_0_0 implements the upgrade to v5.0.0 (U17).
Package v5_0_0 implements the upgrade to v5.0.0 (U17).
op-devstack
dsl
Package dsl provides DSL (domain specific language) to interact with a devstack system.
Package dsl provides DSL (domain specific language) to interact with a devstack system.
sysgo
Moved from fb_OPRbuilderNode_real.go
Moved from fb_OPRbuilderNode_real.go
cmd command
mon
op-dripper
cmd command
e2eutils/el
Package el is the single construction seam for op-e2e's L2 execution layer.
Package el is the single construction seam for op-e2e's L2 execution layer.
e2eutils/reth
Package reth runs op-reth as an external subprocess and exposes it as a services.EthInstance, so op-e2e can use op-reth as the L2 execution layer.
Package reth runs op-reth as an external subprocess and exposes it as a services.EthInstance, so op-e2e can use op-reth as the L2 execution layer.
op-exporter module
op-faucet
cmd command
op-fetcher
cmd command
op-heartbeat module
op-interop-filter
cmd command
op-interop-mon
cmd command
cmd command
cmd/interop-deposits-dump command
Command interop-deposits-dump prints Interop activation deposits and upgrade gas; paired with the kona-hardforks `interop-deposits-dump` example for cross-language diffing.
Command interop-deposits-dump prints Interop activation deposits and upgrade gas; paired with the kona-hardforks `interop-deposits-dump` example for cross-language diffing.
metrics
Package metrics provides a set of metrics for the op-node.
Package metrics provides a set of metrics for the op-node.
p2p
rollup/derive
Package derive provides the data transformation functions that take L1 data and turn it into L2 blocks and results.
Package derive provides the data transformation functions that take L1 data and turn it into L2 blocks and results.
rollup/sync
Package sync is responsible for reconciling L1 and L2.
Package sync is responsible for reconciling L1 and L2.
op-proposer module
cmd command
apis
Package apis provides Go interfaces for most RPC / HTTP APIs used in the OP-Stack.
Package apis provides Go interfaces for most RPC / HTTP APIs used in the OP-Stack.
clock
Package clock provides an abstraction for time to enable testing of functionality that uses time as an input.
Package clock provides an abstraction for time to enable testing of functionality that uses time as an input.
ctxinterrupt
Implements interrupts: events that normally signal intent to cancel a Context, but may be repeated to encourage closure of new Contexts used to clean up resources.
Implements interrupts: events that normally signal intent to cancel a Context, but may be repeated to encourage closure of new Contexts used to clean up resources.
eth
github/release
Package release provides helpers to download and verify binaries released on GitHub.
Package release provides helpers to download and verify binaries released on GitHub.
kzg
log
log/logfilter
Package logfilter provides a declarative log filtering framework for structured logging.
Package logfilter provides a declarative log filtering framework for structured logging.
ptr
Package ptr provides helper functions for working with pointers.
Package ptr provides helper functions for working with pointers.
rpc
sources
Package sources exports a number of clients used to access ethereum chain data.
Package sources exports a number of clients used to access ethereum chain data.
testlog
Package testlog provides a log handler for unit tests.
Package testlog provides a log handler for unit tests.
tls
This file contains CLI and env TLS configurations that can be used by clients or servers
This file contains CLI and env TLS configurations that can be used by clients or servers
tls/certman
Package certman provides live reloading of the certificate and key files used by the standard library http.Server.
Package certman provides live reloading of the certificate and key files used by the standard library http.Server.
tri
Kleene’s three-valued logic (K3) enlarges classical logic with an “undefined” value ⊥ alongside true (T) and false (F) to model partial or indeterminate statements.
Kleene’s three-valued logic (K3) enlarges classical logic with an “undefined” value ⊥ alongside true (T) and false (F) to model partial or indeterminate statements.
op-signer module
op-supernode
cmd command
supernode/activity/interop/raftwallogdb
Package raftwallogdb implements LogsDB on top of hashicorp/raft-wal.
Package raftwallogdb implements LogsDB on top of hashicorp/raft-wal.
op-sync-tester
cmd command
op-test-sequencer
cmd command
op-ufm module
cmd command
ops
scripts/prefork-state-dump command
Command prefork-state-dump writes the predeploy-scoped L2 state for a given fork level to a JSON file.
Command prefork-state-dump writes the predeploy-scoped L2 state for a given fork level to a JSON file.
packages
contracts-bedrock/scripts/check-runner command
check-runner is a parallel check execution tool for contracts-bedrock.
check-runner is a parallel check execution tool for contracts-bedrock.
proxyd module
rust
teleportr module

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL