$ show taikoxyz/taiko-mono
This monorepo implements the Taiko protocol, a based rollup (Layer 2) for Ethereum. It is a production-grade infrastructure system comprising multiple services: a Go client (taiko-client) for block proposal, proving, and chain derivation; a Rust client (taiko-client-rs) for the same with additional preconfirmation support; a bridge UI (Svelte/TypeScript) for cross-chain token transfers; an event indexer (Go) that indexes on-chain events into a MySQL database with REST API; a relayer (Go) that processes bridge messages via RabbitMQ; an ejector (Rust) that monitors operator liveness and handles reorgs; and a balance monitor (Go) exporting Prometheus metrics. The architecture is microservice-oriented with shared protocol contracts (Solidity) in the protocol package. Key entry points include CLI binaries for each service, the bridge UI frontend, and deployment scripts for smart contracts. Data flows: L1 events are indexed by the eventindexer and relayer; the relayer processes bridge messages and submits claims; the driver derives L2 blocks from L1 proposals (blob sidecars) and syncs the execution engine; the prover generates and submits proofs (SGX, RISC0, SP1). External dependencies include Ethereum L1/L2 nodes, MySQL, RabbitMQ, IPFS gateways, and beacon chain APIs. The codebase is actively maintained with frequent releases and multiple audit reports.
The LLM identified 7 files worth highlighting for reuse:
Implements a reorg-aware batch block iterator that can rewind on state-sync events and uses separate backoff strategies for normal vs state-sync retries. The pattern is self-contained, depending only on standard interfaces, and could be reused in any blockchain-related project needing robust block iteration.
An HTTP transport wrapper that handles 429 rate limit responses with exponential backoff, parsing the Retry-After header and X-RateLimit-Reset timestamp. It is a drop-in replacement for http.Transport and is reusable in any Go application needing resilient HTTP calls.
A utility that converts IPFS URIs to HTTP gateway URLs and attempts retrieval from multiple gateways with per-attempt timeout and overall budget. It is generic and can be extracted for any frontend or backend needing decentralized storage access.
Implements a deterministic fixed-k ECDSA signer for secp256k1 that matches Go-generated test vectors, ensuring cross-language signature consistency. The signer is isolated, uses only alloy primitives, and is reusable in any Rust project requiring reproducible signing.
Provides a reusable L2 block poller with reorg detection logic. It maintains a validated history as a VecDeque, classifies head updates, and generates fetch plans. The pattern is self-contained and can be adapted for any chain monitoring task.
Encodes hop proofs for cross-chain message verification, handling multiple hops (up to 3). It is a self-contained utility that could be reused in any bridging or cross-chain protocol that needs to aggregate and encode proof chains.
Implements an LRU eviction cache for preconfirmation envelopes with Prometheus metrics (size, hit rate). It is generic and could be extracted for any system needing a bounded, observable cache with configurable eviction policy.