This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Catalyst is a Rust-based preconfirmation sidecar for the Taiko Stack, implementing validator registration, lookahead submissions/disputes, and L2 block preconfirmation duties. It's a multi-crate Cargo workspace targeting Rust 1.93 (edition 2024).
# Build
cargo build --workspace
# Run all tests
cargo test --workspace --verbose
# Run a single test
cargo test -p <crate-name> <test_name>
# Lint (CI enforces -D warnings)
cargo clippy --all-features -- -D warnings
# Format check
cargo fmt --all -- --check
# Format (apply)
cargo fmt --all
# Dependency audit
cargo deny check
# Typo check
typos
# Sort dependencies (required)
cargo sort --workspace --checkThe pre-push git hook at .githooks/pre-push runs all of the above checks automatically. To activate it: git config core.hooksPath .githooks.
The node supports multiple Taiko protocol forks. The main binary (node/) reads ForkInfo from config and instantiates the appropriate node variant:
pacaya/— Pacaya fork: batch-based preconfirmations withoperator,batch_manager, andverifiershasta/— Shasta fork: addsproposal_manager,block_advancer, andlast_safe_l2_block_finderpermissionless/— Suspended; do not modify without checkingpermissionless/README.md
Shared infrastructure used by all forks:
l1/— Ethereum L1 integration: RPC provider, Beacon API, smart contract bindings, blob indexer, slot clockl2/— Taiko L2 integration: Engine API client (engine/), Taiko driverbatch_builder/— Constructs L2 block batches with configurable size/block limitschain_monitor/— Monitors L1/L2 chain eventssigner/— Key management (ECDSA private key or Web3Signer)config/— Configuration managementmetrics/— Prometheus metrics serverutils/— RPC client, watchdog, cancellation token, retry logic
- L1 slot clock triggers block production window
chain_monitorwatches for L1 events (batch proposals, validator lookahead)batch_builder/proposal_managerassembles L2 transactions into batches- L2 engine API advances the L2 head
- Batch/proposal submitted to L1 mempool via
l1/module
urc/ is a separate utility (CLI + monitor) for URC contract interactions with a MySQL backend. It has its own Makefile for database management.
Workspace-level Clippy lints (enforced as errors):
unsafe_code = "forbid"— no unsafe blocksunwrap_used = "deny"— use?or explicit error handlingcast_possible_truncation,cast_sign_loss,cast_precision_loss, etc. — all denied
Release builds have overflow-checks = true.
- Alloy (v1.7) — Ethereum RPC, signing, types
- Tokio (v1.49) — async runtime
- taiko-mono —
taiko_protocol,taiko_bindings,taiko_preconfirmation_driver,taiko_rpc(sourced from git) - alethia-reth — Taiko-modified Reth (sourced from git)
Allowed git sources in deny.toml: taiko-mono, reth, alethia-reth, kona. Adding other git dependencies requires updating deny.toml.