You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .claude/CLAUDE.md
+98-28Lines changed: 98 additions & 28 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,10 +1,8 @@
1
-
# CLAUDE.md
1
+
# Signet Block Builder Development Guide
2
2
3
-
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
3
+
## Crate Summary
4
4
5
-
## Project Overview
6
-
7
-
Signet Block Builder - a Rust application that simulates transactions and bundles against rollup state to create valid Signet rollup blocks, then submits them to Ethereum as EIP-4844 blob transactions via Flashbots.
5
+
Single-crate Rust application (not a workspace) that builds Signet rollup blocks. Actor-based async task system: watches host/rollup chains, ingests transactions and bundles, simulates them against rollup state, then submits valid blocks to Ethereum as EIP-4844 blob transactions via Flashbots. Built on alloy, trevm, tokio, and the `signet-*` SDK crates. Binary: `zenith-builder-example`. Minimum Rust 1.88, Edition 2024.
8
6
9
7
## Build Commands
10
8
@@ -17,43 +15,115 @@ make fmt # Format code
17
15
make clippy # Lint with warnings denied
18
16
```
19
17
20
-
Equivalent cargo commands work directly (`cargo build`, `cargo test`, etc.).
18
+
Always lint before committing. The Makefile provides shortcuts (`make fmt`, `make clippy`, `make test`)
21
19
22
20
## Architecture
23
21
24
-
The builder uses an actor-based async task system with five main tasks communicating via channels:
2.**CacheTasks** (`src/tasks/cache/`) - `TxPoller` and `BundlePoller` ingest transactions/bundles into a shared `SimCache`.
26
+
3.**SimulatorTask** (`src/tasks/block/sim.rs`) - Receives `SimEnv`, clones the cache, builds a `BlockBuild` with a slot-derived deadline, produces `SimResult`.
27
+
4.**FlashbotsTask** (`src/tasks/submit/flashbots.rs`) - Receives `SimResult`, prepares signed EIP-4844 blob transaction via `SubmitPrep` + Quincey, bundles with host txs, submits to Flashbots relay.
28
+
5.**MetricsTask** (`src/tasks/metrics.rs`) - Tracks tx mining status and records metrics.
- Global static config: `CONFIG: OnceLock<BuilderConfig>` initialized via `config_from_env()`. Tasks access config via `crate::config()`.
69
+
- Provider type aliases: `HostProvider`, `RuProvider`, `FlashbotsProvider`, `ZenithInstance` are defined in `config.rs` and used throughout.
70
+
-`connect_*` methods on `BuilderConfig` use `OnceCell`/`OnceLock` for memoization -- providers and signers are connected once, then cloned.
71
+
- Internal macros: `span_scoped!`, `span_debug/info/warn/error!` log within an unentered span. `res_unwrap_or_continue!` and `opt_unwrap_or_continue!` unwrap-or-log-and-continue in loops.
72
+
- Quincey has two modes: `Remote` (HTTP/OAuth for production) and `Owned` (local/AWS KMS for dev). Configured by presence of `SEQUENCER_KEY` env var.
0 commit comments