$ show tempoxyz/tempo
Tempo is a custom Ethereum-compatible L1 blockchain built in Rust, offering a full node client with validator and follower modes. It diverges from standard Ethereum by introducing account abstraction (AA) as the default transaction type, 2D nonces, fee token mechanisms, and a novel consensus protocol using the Commonware framework with BLS threshold signatures and distributed key generation (DKG). The execution layer is based on revm (Rust EVM) with extensive use of hardfork-gated precompiled contracts (TIP20 tokens, stablecoin DEX, fee manager, storage credits, etc.), replacing many ERC standards. The architecture is actor-based, with separate crates for consensus, execution, payload building, transaction pool, and node orchestration. It includes a rich CLI, localnet dev environment, and extensive benchmarking and testing infrastructure. While primarily an application, it has strong research elements in consensus design, gas modeling, and economic experiments (e.g., fee AMM arb bot).
The LLM identified 4 files worth highlighting for reuse:
A standalone proc-macro crate that generates Solidity-compatible storage slot handlers, dispatch functions, and packing/unpacking logic for precompile contracts. The `#[contract]` macro automatically produces typed field accessors, slot constants, and ABI dispatch tables with hardfork gating. It also includes `#[derive(Storable)]` for Rust-to-EVM storage serialization. This crate has no internal workspace dependencies and could be extracted to generate storage layers for any EVM-compatible chain, demonstrating advanced macro design.
Implements a dual-database storage backend that combines a prunable archive (for historical blocks) with a source-of-truth database (reth). Provides transparent read access, section-based eviction driven by execution-layer finality, gap detection, and stale put handling. This pattern is generalizable to any blockchain needing efficient historical data pruning while retaining full block data for a configurable window. The module is self-contained with clear trait boundaries for the underlying databases.
A minimal utility crate providing helpers for metric registration and management, including a convenience function `register_meter` that returns a `meter` instance from a global meter provider. Designed for workspace-internal reuse, it could be extracted as a lightweight dependency for any Rust application needing consistent OpenTelemetry metric setup with lazy initialization.
Contains `TempoBlockAssembler`, a builder that constructs Ethereum-compatible blocks with Tempo-specific header fields (general_gas_limit, shared_gas_limit, timestamp_millis_part, consensus_context). It encapsulates block body construction, state root computation via `StateProvider`, and proof-of-stake extra data management. This module's clean separation of assembly logic from execution could be reused in any EVM fork that needs custom block header extensions.