Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
e092b48
feat(ffi): add native application bridge and conformance tests
GCdePaula Sep 9, 2026
9b56dd7
feat(harness)!: support lazy fallible genesis construction
GCdePaula Sep 9, 2026
84dcdd7
test(ffi): cover output ownership and external archive builds
GCdePaula Sep 11, 2026
d19dc97
fix(runtime): contain application lifecycle failures
GCdePaula Sep 12, 2026
f8f2eba
fix(examples): handle genesis help without creating state
GCdePaula Sep 12, 2026
a4e300c
refactor(application)!: simplify the native engine contract
GCdePaula Sep 12, 2026
b18a9a8
refactor(bindings): promote reusable C integration crates
GCdePaula Sep 12, 2026
71b3b35
feat: add versioned canonical history read foundation
GCdePaula Sep 16, 2026
3e5b971
refactor: separate application history from L1 observations
GCdePaula Sep 16, 2026
7f3229f
test: validate Track 3 cold replica and canonical recovery
GCdePaula Sep 16, 2026
4b6810a
refactor: simplify host fee price estimation
GCdePaula Sep 17, 2026
254d236
docs: clarify recovery and improve agent reading paths
GCdePaula Sep 17, 2026
15f7998
docs: ground automatic recovery in implementation
GCdePaula Sep 17, 2026
3ef56ec
docs: align history snapshots and watchdog contracts
GCdePaula Sep 17, 2026
3569769
docs: retire stale reviews and define review lifecycle
GCdePaula Sep 17, 2026
b558ef5
feat: add historical replay and checkpoint compatibility
GCdePaula Sep 18, 2026
62ec150
test: cover C-host replication and recovery lifecycle
GCdePaula Sep 18, 2026
422dae4
fix: refuse finalized checkpoint exports after divergence
GCdePaula Sep 18, 2026
5ea6afd
fix: classify snapshot artifact errors through streamed reads
GCdePaula Sep 18, 2026
60966ae
fix: require recovery stop to cover the trusted checkpoint
GCdePaula Sep 18, 2026
e45fc96
fix: bound snapshot response headers by the SDK timeout
GCdePaula Sep 18, 2026
18e99e4
test: pin snapshot failure and history recovery boundaries
GCdePaula Sep 18, 2026
f504c2e
docs: reconcile recovery contracts and record stack validation
GCdePaula Sep 18, 2026
24aa976
fix: preserve registered snapshots across path aliases
GCdePaula Sep 19, 2026
c22174a
docs: require complete pending-direct recovery checkpoints
GCdePaula Sep 19, 2026
dc4dd78
test: pin recovered-prefix cutoff and clarify API contracts
GCdePaula Sep 19, 2026
8b6da04
fix: preserve snapshots across filesystem mount aliases
GCdePaula Sep 19, 2026
93e6a49
ci: preserve logs from failed rollups E2E runs
GCdePaula Sep 19, 2026
209a3b1
docs: clarify checkpoint eligibility and refresh review evidence
GCdePaula Sep 19, 2026
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
19 changes: 16 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ jobs:
sudo apt-get update
sudo apt-get install -y \
faketime \
libclang-dev \
libfaketime \
lua5.4 \
liblua5.4-dev \
Expand Down Expand Up @@ -62,6 +63,9 @@ jobs:
timeout-minutes: 15
run: cargo test --workspace --all-targets --all-features --locked

- name: C application archive and downstream consumer
run: bash scripts/ci-c-application-smoke.sh

canonical-guest:
runs-on: ubuntu-latest
needs: rust
Expand Down Expand Up @@ -115,17 +119,17 @@ jobs:
cartesi-machine-sha256-arm64: ${{ env.CARTESI_MACHINE_SHA256_ARM64 }}
install-foundry: "true"

- name: Install faketime
- name: Install native test dependencies
run: |
sudo apt-get update
sudo apt-get install -y faketime libfaketime
sudo apt-get install -y faketime libfaketime libclang-dev

- name: Build watchdog Lua deps
run: |
sudo apt-get install -y libcurl4-openssl-dev build-essential pkg-config
just watchdog-lua-deps

- name: Run rollups E2E tests
- name: Run rollups E2E tests (Rust and C hosts)
run: just test-rollups-e2e

# Runs after the e2e step so the canonical machine image is already built;
Expand All @@ -134,6 +138,15 @@ jobs:
- name: Watchdog Lua CM e2e
run: just test-watchdog-e2e

- name: Upload E2E failure logs
if: ${{ failure() }}
uses: actions/upload-artifact@v6
with:
name: rollups-e2e-logs-${{ github.run_attempt }}
path: tests/e2e/results/*.log
retention-days: 7
if-no-files-found: ignore

watchdog-docker:
name: Watchdog Docker image smoke
runs-on: ubuntu-latest
Expand Down
408 changes: 198 additions & 210 deletions AGENTS.md

Large diffs are not rendered by default.

70 changes: 4 additions & 66 deletions CLAUDE.md
Original file line number Diff line number Diff line change
@@ -1,69 +1,7 @@
# CLAUDE.md

Quick reference for working in this repository. For the full guide — architecture, duality, recovery, invariants, threat model, and rules — read [`AGENTS.md`](AGENTS.md).
Read [`AGENTS.md`](AGENTS.md) before working in this repository. It contains the
shared mental model, safety constraints, and contribution rules for all agents.

## Shell Environment

This project uses Nix + direnv. Before running any command that needs project tools (Foundry, TLA+, etc.), activate the direnv environment:

```bash
eval "$(direnv export bash 2>/dev/null)"
```

This makes `anvil`, `forge`, `cast`, `tlc`, and other Nix-provided tools available. Cargo and rustc are available without direnv.

## Commands

```bash
cargo check # compile check
cargo test --workspace --exclude canonical-test # run tests (canonical-test needs libslirp)
cargo fmt --all # format
cargo clippy --all-targets --all-features -- -D warnings # lint
cargo test -p sequencer --lib # includes Anvil-backed tests (needs Foundry on PATH)
```

## What This Is

Off-chain sequencer for an app-specific DeFi rollup. Accepts signed user operations, issues low-latency soft confirmations, and posts batches to L1. Currently backed by a placeholder wallet app (transfer, withdrawal). **Security-critical infrastructure** — handle every change accordingly.

Rust edition 2024 / Axum API / SQLite (rusqlite, WAL) / EIP-712 signing / SSZ encoding.

## Workspace Layout

- `sequencer/` — sequencer library (no binary; app crates build the binary).
- `sequencer-core/` — shared domain types consumed by both sequencer and scheduler.
- `examples/app-core/` — placeholder wallet app implementing `Application`.
- `examples/wallet-sequencer/` — binary crate: wallet app + sequencer library.
- `examples/canonical-app/` — on-chain scheduler reference implementation.
- `examples/canonical-test/` — e2e test harness for the canonical app.
- `sdk/rust-client/` — Rust client library for the sequencer API.
- `tests/{benchmarks,e2e,harness}/` — test infrastructure.

## Sequencer Module Layout

`sequencer/src/` is organized by writer role; `storage/<role>.rs` holds each role's storage half.

- `commands/` — the operator command brackets (`run/` plus its worker
supervisor, `setup/`, `flush`) and their command-scoped `config` and
`error` taxonomy (incl. exit-code projection).
- `runtime/` — the runtime authority capabilities, consumed crate-wide:
the exclusive process lock and the runtime scope/shutdown machinery.
- `ingress/` — public-facing: `api.rs` (`POST /tx`, `GET /fee`) + `inclusion_lane/` (hot path).
- `egress/` — internal read path: `api/` (WS subscribe + health) + `l2_tx_feed/`.
- `l1/` — reader, submitter, fee oracle, provider, partition helper.
- `recovery/` — startup preemptive-recovery procedure, runtime danger detector, mempool flusher.
- `storage/` — SQLite persistence, split per writer role.
- `http.rs` — shared HTTP error type + `axum::serve` orchestration; `clock.rs` — the crate-wide wall clock.

## Before You Start Real Work

- **[`AGENTS.md`](AGENTS.md)** — mission, requirements, invariants, duality, recovery, conventions, rules.
- **[`docs/protocol/`](docs/protocol/)** — the authoritative protocol contracts: [`scheduler-semantics.md`](docs/protocol/scheduler-semantics.md) (canonical acceptance algorithm) and [`application-contract.md`](docs/protocol/application-contract.md) (the `Application` FFI trait). Read before touching the scheduler, the gold frontier, the fold, or an `Application` impl.
- **[`docs/invariants.md`](docs/invariants.md)** — cross-module invariants register + the fail-loud check policy. Check it before changing anything it lists as load-bearing.
- **[`docs/review/register.md`](docs/review/register.md)** — the review register: open findings, settled decisions, refuted proposals (do-not-re-propose). Check it for open findings in code you're about to touch, and before proposing a mechanism or simplification.
- **[`docs/plans/`](docs/plans/)** — the [authority-boundary ADR](docs/plans/2026-08-authority-boundary-adr.md), active coordination tracks, and in-flight design handoffs. Check before starting work that might belong to a track.
- **[`docs/threat-model/README.md`](docs/threat-model/README.md)** — trust boundaries and in-scope threats.
- **[`docs/recovery/README.md`](docs/recovery/README.md)** — preemptive recovery design + TLA+ proofs.
- **[`docs/snapshots/lifecycle.md`](docs/snapshots/lifecycle.md)** — snapshot lifecycle design + invariants (take/promote/GC, crash-safety). Read before touching the inclusion lane's safe-frontier/snapshot path.
- **[`docs/watchdog/operator-deployment.md`](docs/watchdog/operator-deployment.md)** — watchdog on live L1 (Sepolia / mainnet, production-like).
- **[`docs/watchdog/getting-started.md`](docs/watchdog/getting-started.md)** — local dev: watchdog + `sequencer-devnet` on Anvil.
- [Shell and commands](AGENTS.md#shell-and-commands) — toolchain selection and validation commands.
- [Reading routes](AGENTS.md#reading-routes) — the contracts to read for the work at hand.
48 changes: 48 additions & 0 deletions Cargo.lock

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

4 changes: 4 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,14 @@ members = [
"sequencer",
"sequencer-core",
"sdk/rust-client",
"bindings/c-app-engine",
"bindings/c-app-sequencer",
"examples/app-core",
"examples/canonical-app",
"examples/canonical-test",
"examples/wallet-sequencer",
"examples/c-wallet-engine",
"examples/c-wallet-sequencer",
"tests/benchmarks",
"tests/harness",
"tests/e2e",
Expand Down
Loading
Loading