$ show OffchainLabs/arbitrum-classic
This monorepo implements the classic Arbitrum optimistic rollup Layer-2 solution. The system consists of a custom Arbitrum Virtual Machine (AVM) written in C++, a Go-based node that provides an Ethereum-compatible RPC interface, sequencer/validator functionality, and Solidity smart contracts on L1 for bridge, rollup, challenge, and staking logic. Key data flows: the inbox reader ingests sequencer batches and delayed messages from L1, delivers them to the AVM for execution, and produces state updates and transaction results that are served via the RPC API. The architecture supports multiple node modes (forwarder, aggregator, sequencer, validator) with Redis-based lockout for sequencer exclusivity and optional Fireblocks integration for external signing. Despite being classified as 'classic' and superseded by the Nitro upgrade, the codebase continues to receive active maintenance and contains production-grade infrastructure for running Arbitrum nodes.
The LLM identified 3 files worth highlighting for reuse:
Provides a generic `TransactAuth` interface that abstracts transaction signing and submission for Ethereum transactions. Includes implementations for local keystore signing, Fireblocks API signing, and a simulated backend. This pattern is cleanly separated and can be extracted into any Go project that needs to support multiple Ethereum signing backends with minimal modification.
Implements a composed machine cache using `BasicMachineCache`, `LRUMachineCache`, and `TimedMachineCache` via the `MachineCache` interface. This demonstrates a reusable caching composition pattern where multiple strategies are combined and centrally managed. The design is self-contained and could be applied to any stateful object caching in C++ with minimal adaptation.
A WebSocket broadcast server with client connection management, ping/timeout handling, and a catchup buffer for reconnection. It abstracts the mechanics of broadcasting messages to multiple clients and supports configurable client limits and per-client backpressure. This is a general-purpose server component that could be reused for any real-time data feed application.