Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/target
.idea/
testnet/
.vscode/*
.nvim.lua
.DS_Store

# cargo-fuzz build artifacts + generated corpus / crashes
fuzz/target/
Expand Down
13 changes: 8 additions & 5 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ The `testnet` binary spins up a multi-node network locally — this is the main
```bash
ln -s /path/to/seismic-reth ~/.cargo/bin/reth
```
Alternatively, set the `SRETH_BIN` env var to the path of a specific binary; it takes precedence over PATH.

### Quick start

Expand Down Expand Up @@ -143,9 +144,9 @@ cd testnet && ./reset.sh

### Config files (`testnet/`)

- `dev.json` — Ethereum genesis with pre-funded test accounts
- `jwt.hex` — Engine API auth token
- `node{0-3}/` — per-node keys (`consensus_key.pem`, `node_key.pem`) and data directories
- `bin/` — the `testnet` launcher crate
- `../example_genesis.toml` (repo root) — the genesis the launcher points nodes at

## Binaries

Expand All @@ -163,15 +164,15 @@ cd testnet && ./reset.sh
## Project Layout

```
node/ Main binary crate (summit, testnet)
node/ Main binary crate (summit)
src/engine.rs Central coordinator — component lifecycle, message routing
src/args.rs CLI argument parsing (clap)
src/config.rs Channel sizes, timeouts, default paths
src/keys.rs Key management (generate/show)
src/genesis.rs Genesis file utilities (set-validators/digest)
src/test_harness/ Shared test harness for e2e tests
src/tests/ Integration tests (syncer, checkpointing, execution requests)
src/bin/ Additional binaries (testnet, e2e, bench)
src/bin/ Additional binaries (e2e, bench)

application/ Consensus interface — implements Simplex Automaton + Relay traits
src/actor.rs Propose, verify, broadcast blocks
Expand Down Expand Up @@ -203,7 +204,9 @@ types/ Shared types & engine client
src/scheme.rs BLS12-381 multisig scheme

docs/ Architecture docs, protocol descriptions
testnet/ Local testnet config (4 validators, genesis JSON)
testnet/ Local-network home: per-node keys, reset.sh
bin/ The `testnet` launcher (own crate so the reth spawn
machinery stays out of production builds)
```

## Architecture
Expand Down
49 changes: 14 additions & 35 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[workspace]
members = [ "application", "node", "rpc", "types", "finalizer", "orchestrator", "syncer"]
members = [ "application", "node", "rpc", "types", "finalizer", "orchestrator", "syncer", "testnet/bin"]
resolver = "3"

[workspace.package]
Expand Down Expand Up @@ -32,7 +32,6 @@ alloy-consensus = "1.0.12"
alloy-eips = { version = "1.0.19", features = ["ssz"] }
alloy-genesis = "1.0.9"
alloy-network = "1.0.9"
alloy-node-bindings = "1.0.9"
alloy-rpc-client = { version = "1.0.9", features = [
"hyper",
"alloy-transport-http",
Expand Down
2 changes: 1 addition & 1 deletion docs/running-local-network.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Easiest way to run a network locally is to use the testnet bin. This will start

## Prerequisites

1. Make sure you have a `reth` binary installed and in your `PATH`. The testnet bin passes Seismic-specific flags (e.g. `--enclave.endpoint-port`) to the execution client, so a vanilla upstream `reth` will not work - build `seismic-reth`:
1. Make sure you have a `reth` binary installed and in your `PATH` (or point the `SRETH_BIN` env var at a specific binary). The testnet bin passes Seismic-specific flags (e.g. `--seismic.purpose-keys-source`) to the execution client, so a vanilla upstream `reth` will not work - build `seismic-reth`:
```bash
git clone https://github.com/SeismicSystems/seismic-reth.git && cd seismic-reth && cargo build --release
```
Expand Down
5 changes: 0 additions & 5 deletions node/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@ name = "summit"
version.workspace = true
edition.workspace = true

[[bin]]
name = "testnet"
path = "src/bin/testnet.rs"

[[bin]]
name = "stake-and-checkpoint"
path = "src/bin/stake_and_checkpoint.rs"
Expand Down Expand Up @@ -82,7 +78,6 @@ ethereum_ssz.workspace = true
jsonrpsee.workspace = true

# testnet bin deps
alloy-node-bindings.workspace = true
alloy-network = { workspace = true }
alloy-primitives.workspace = true
alloy-provider = { version = "1.0.30", features = ["reqwest-rustls-tls"] }
Expand Down
32 changes: 3 additions & 29 deletions node/src/bin/observer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ use summit_types::consensus_state::ConsensusState;
use summit_types::ext_private_key::derive_child_public;
use summit_types::genesis::Genesis;
use summit_types::header::FinalizedHeader;
use summit_types::reth::Reth;
use summit_types::reth::reth_spawner;
use summit_types::rpc::CheckpointRes;
use summit_types::scheme::MultisigScheme;
use tokio::sync::mpsc;
Expand Down Expand Up @@ -134,20 +134,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
let data_dir = format!("{}/node{}/data/reth_db", args.data_dir, x);
fs::create_dir_all(&data_dir).expect("Failed to create data directory");

let reth_builder = Reth::new()
.instance(x + 1)
.keep_stdout()
.data_dir(data_dir)
.arg("--enclave.mock-server")
.arg("--enclave.endpoint-port")
.arg(format!("1744{x}"))
.arg("--auth-ipc")
.arg("--auth-ipc.path")
.arg(format!("/tmp/reth_engine_api{x}.ipc"))
.arg("--metrics")
.arg(format!("0.0.0.0:{}", 9001 + x));

let mut reth = reth_builder.spawn();
let mut reth = reth_spawner(x, data_dir).spawn();
let stdout = reth.stdout().expect("Failed to get stdout");
let log_dir = args.log_dir.clone();
context.clone().spawn(async move |_| {
Expand Down Expand Up @@ -247,20 +234,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
.expect("Failed to write observer BLS key");

println!("******* STARTING RETH FOR OBSERVER");
let observer_reth_builder = Reth::new()
.instance(OBSERVER_SLOT as u16 + 1)
.keep_stdout()
.data_dir(observer_reth_data_dir)
.arg("--enclave.mock-server")
.arg("--enclave.endpoint-port")
.arg(format!("1744{}", OBSERVER_SLOT))
.arg("--auth-ipc")
.arg("--auth-ipc.path")
.arg(format!("/tmp/reth_engine_api{}.ipc", OBSERVER_SLOT))
.arg("--metrics")
.arg(format!("0.0.0.0:{}", 9001 + OBSERVER_SLOT));

let mut observer_reth = observer_reth_builder.spawn();
let mut observer_reth = reth_spawner(OBSERVER_SLOT as u16, observer_reth_data_dir).spawn();
let observer_stdout = observer_reth.stdout().expect("Failed to get observer stdout");
let log_dir = args.log_dir.clone();
context.clone().spawn(async move |_| {
Expand Down
18 changes: 2 additions & 16 deletions node/src/bin/protocol_params.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ use std::{
use summit::args::{RunFlags, run_node_local};
use summit_rpc::SummitApiClient;
use summit_types::genesis::Genesis;
use summit_types::reth::Reth;
use summit_types::reth::reth_spawner;
use tokio::sync::mpsc;
use tracing::Level;

Expand Down Expand Up @@ -113,21 +113,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
fs::create_dir_all(&data_dir).expect("Failed to create data directory");

// Build and spawn reth instance
let reth_builder = Reth::new()
.instance(x + 1)
.keep_stdout()
// .genesis(serde_json::from_str(&genesis_str).expect("invalid genesis"))
.data_dir(data_dir)
.arg("--enclave.mock-server")
.arg("--enclave.endpoint-port")
.arg(format!("1744{x}"))
.arg("--auth-ipc")
.arg("--auth-ipc.path")
.arg(format!("/tmp/reth_engine_api{x}.ipc"))
.arg("--metrics")
.arg(format!("0.0.0.0:{}", 9001 + x));

let mut reth = reth_builder.spawn();
let mut reth = reth_spawner(x, data_dir).spawn();

// Get stdout handle
let stdout = reth.stdout().expect("Failed to get stdout");
Expand Down
48 changes: 4 additions & 44 deletions node/src/bin/stake_and_checkpoint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ use summit_types::consensus_state::ConsensusState;
use summit_types::deposit_signature_domain;
use summit_types::execution_request::DepositRequest;
use summit_types::genesis::Genesis;
use summit_types::reth::Reth;
use summit_types::reth::reth_spawner;
use tokio::sync::mpsc;
use tracing::Level;

Expand Down Expand Up @@ -130,21 +130,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
fs::create_dir_all(&data_dir).expect("Failed to create data directory");

// Build and spawn reth instance
let reth_builder = Reth::new()
.instance(x + 1)
.keep_stdout()
// .genesis(serde_json::from_str(&genesis_str).expect("invalid genesis"))
.data_dir(data_dir)
.arg("--enclave.mock-server")
.arg("--enclave.endpoint-port")
.arg(format!("1744{x}"))
.arg("--auth-ipc")
.arg("--auth-ipc.path")
.arg(format!("/tmp/reth_engine_api{x}.ipc"))
.arg("--metrics")
.arg(format!("0.0.0.0:{}", 9001 + x));

let mut reth = reth_builder.spawn();
let mut reth = reth_spawner(x, data_dir).spawn();

// Get stdout handle
let stdout = reth.stdout().expect("Failed to get stdout");
Expand Down Expand Up @@ -403,20 +389,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
.expect("Failed to copy static_files directory");

// Restart nodeß's reth instance
//let reth_builder = Reth::new()
// .instance((source_node + 1) as u16)
// .keep_stdout()
// // .genesis(serde_json::from_str(&genesis_str).expect("invalid genesis"))
// .data_dir(source_data_dir.clone())
// .arg("--enclave.mock-server")
// .arg("--enclave.endpoint-port")
// .arg(format!("1744{source_node}"))
// .arg("--auth-ipc")
// .arg("--auth-ipc.path")
// .arg(format!("/tmp/reth_engine_api{source_node}.ipc"))
// .arg("--metrics")
// .arg(format!("0.0.0.0:{}", 9001 + source_node));
//let reth = reth_builder.spawn();
//let reth = reth_spawner(source_node as u16, source_data_dir.clone()).spawn();
//handles.push_front(reth);

// Restart node0's consensus engine in a new runtime/thread
Expand Down Expand Up @@ -455,20 +428,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
//node_runtimes.insert(source_node, NodeRuntime { thread, stop_tx });

// Start node4's reth instance
let reth_builder = Reth::new()
.instance(x + 1)
.keep_stdout()
.data_dir(data_dir)
.arg("--enclave.mock-server")
.arg("--enclave.endpoint-port")
.arg(format!("1744{x}"))
.arg("--auth-ipc")
.arg("--auth-ipc.path")
.arg(format!("/tmp/reth_engine_api{x}.ipc"))
.arg("--metrics")
.arg(format!("0.0.0.0:{}", 9001 + x));

let mut reth = reth_builder.spawn();
let mut reth = reth_spawner(x, data_dir).spawn();

let stdout = reth.stdout().expect("Failed to get stdout");

Expand Down
Loading
Loading