Skip to content

Files

Latest commit

34a1ff9 · Jul 31, 2025

History

History
This branch is 3 commits behind ethereum-optimism/optimism:develop.

op-service

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
Jun 23, 2025
Jul 30, 2025
Mar 28, 2025
Jul 15, 2025
Jun 13, 2025
Aug 30, 2024
Jul 30, 2025
Jun 13, 2025
Jul 12, 2024
Apr 25, 2025
Sep 21, 2024
Aug 30, 2024
Jul 30, 2025
Apr 25, 2025
Aug 21, 2023
Jun 14, 2024
Jul 15, 2025
Jul 29, 2025
Jun 14, 2025
Jul 18, 2025
Apr 14, 2025
Jul 31, 2025
Oct 31, 2024
Feb 21, 2025
Jul 10, 2025
May 23, 2025
Jun 18, 2025
Sep 19, 2024
Apr 10, 2025
Apr 10, 2025
Oct 2, 2024
May 21, 2025
Jun 18, 2025
Jun 17, 2024
Jun 23, 2025
Oct 2, 2024
Mar 14, 2025
May 1, 2025
Mar 5, 2025
Jul 30, 2025
Feb 18, 2025
May 20, 2025
Jun 12, 2025
Jun 2, 2025
Jul 31, 2025
Jul 14, 2025
Jun 12, 2025
Jun 23, 2025
Jul 17, 2025
Jun 25, 2025
Jun 2, 2025
Jan 13, 2025
Jun 18, 2025
Mar 28, 2025
Dec 14, 2024
Sep 21, 2024
Oct 24, 2023
Oct 24, 2023

README.md

op-service

Issues: monorepo

Pull requests: monorepo

op-service is a collection of Go utilities to build OP-Stack services with.

├── accounting      - accounting utilities
├── apis            - interfaces for client / server RPC and misc. APIs
├── bigs            - big-int utils
├── cliapp          - Flag and lifecycle handling for a Urfave v2 CLI app.
├── client          - RPC and HTTP client utils
├── clock           - Clock interface, system clock, tickers, mock/test time utils
├── closer          - Convenience methods / patterns for closing resources
├── crypto          - Cryptography utils, complements geth crypto package
├── ctxinterrupt    - Blocking/Interrupt handling
├── dial            - Dialing util functions for RPC clients
├── endpoint        - Abstracts away type of RPC endpoint
├── enum            - Utils to create enums
├── errutil         - Utils to work with customized errors
├── eth             - Common Ethereum data types and OP-Stack extension types
├── event           - Broadcast event system
├── flags           - Utils and flag types for CLI usage
├── httputil        - Utils to create enhanced HTTP Server
├── ioutil          - File utils, including atomic files and compression
├── jsonutil        - JSON encoding/decoding utils
├── locks           - Lock utils, like read-write wrapped types
├── log             - Logging CLI and middleware utils
├── logfilter       - Logging filters
├── logmods         - Log handler wrapping/unwrapping utils
├── metrics         - Metrics types, metering abstractions, server utils
├── oppprof         - P-Prof CLI types and server setup
├── plan            - Utils to create a lazy evaluated value following dependencies
├── predeploys      - OP-Stack predeploy definitions
├── queue           - Generic queue implementation
├── retry           - Function retry utils
├── rpc             - RPC server utils
├── safego          - Utils to make Go memory more safe
├── safemath        - Utils to do math safely
├── serialize       - Binary serialization abstractions
├── signer          - CLI flags and bindings to work with a remote signer
├── solabi          - Utils to encode/decode Solidity ABI formatted data
├── sources         - RPC client bindings
├── tasks           - Err-group with panic handling
├── testreq         - Extension and improvement of the common `testify/require` package.
├── testlog         - Test logger and log-capture utils for testing
├── testutils       - Simplified Ethereum types, mock RPC bindings, utils for testing.
├── tls             - CLI flags and utils to work with TLS connections
├── txmgr           - Transaction manager: automated nonce, fee and confirmation handling.
├── txplan          - PlannedTx to declaratively build/execute/wait transactions
├── txinclude       - txinclude.Includer is a txplan-friendly txmgr
├── txintent        - IntentTx builds upon PlannedTx to prepare tx and digest the result.
└── *.go            - Miscellaneous utils (soon to be deprecated / moved)

Usage

From op-service dir:

# Run Go tests
make test
# Run Go fuzz tests
make fuzz

Product

Optimization target

Provide solid reusable building blocks for all OP-Stack Go services.

Vision

  • Remove unused utilities: op-service itself needs to stay maintainable.
  • Make all Go services consistent: op-service modules can be used to simplify and improve more Go services.

Design principles

  • Reduce boilerplate in Go services: provide service building utils ranging from CLI to testing.
  • Protect devs from sharp edges in the Go std-lib: think of providing missing composition, proper resource-closing, well set up network-binding, safe concurrency utils.

Testing

Each op-service package has its own unit-testing. More advanced utils, such as the transaction manager, are covered in op-e2e as well.