Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
b42f20f
feat: implement sequencer recovery for stale batches
GCdePaula Mar 29, 2026
77b4bfd
refactor: rework storage module
GCdePaula Apr 15, 2026
d347526
refactor: refine inclusion lane module
GCdePaula Apr 15, 2026
bd1172f
refactor: refactor api module
GCdePaula Apr 15, 2026
3fb7511
refactor: reorganize modules structure
GCdePaula Apr 15, 2026
95e2104
feat: re-add health check
GCdePaula Apr 15, 2026
6e03399
docs: rework agents, claude, readme, docs
GCdePaula Apr 15, 2026
891092d
fix: address 712 domain bug, harden implementation
GCdePaula Apr 16, 2026
c393e64
fix: fix wallclock danger detection for tip batch
GCdePaula Apr 17, 2026
2dee3da
tests: improve test coverage and harness
GCdePaula Apr 17, 2026
b7d3204
refactor: make storage batch lifecycle structural
GCdePaula Apr 17, 2026
aeef6c2
test: add thorough e2e tests and unit tests
GCdePaula Apr 18, 2026
dcd2e86
fix: fix wallclock recovery path
GCdePaula Apr 22, 2026
b63df2b
refactor: make safe_accepted_batches an invariant of append_safe_inputs
GCdePaula Apr 23, 2026
dd3a554
refactor: rework submitter worker loop
GCdePaula Apr 23, 2026
d63dda2
refactor: simplify submitter-to-recovery cycle
GCdePaula Apr 23, 2026
4a592fe
refactor: restructure storage module
GCdePaula Apr 23, 2026
2816ffb
refactor(recovery): split detect_and_recover by startup path
GCdePaula May 7, 2026
a58eb4e
feat(recovery): improve danger zone detection with L1 staleness
GCdePaula May 8, 2026
7b2271e
refactor: cleanup startup and workers
GCdePaula May 11, 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
5 changes: 5 additions & 0 deletions .github/actions/setup-guest-toolchain/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ inputs:
description: "Foundry version tag"
required: false
default: "v1.4.3"
rust-toolchain:
description: "Rust toolchain version or channel"
required: false
default: "1.95.0"
rust-components:
description: "Extra rustup components (comma-separated)"
required: false
Expand Down Expand Up @@ -109,6 +113,7 @@ runs:
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
toolchain: ${{ inputs.rust-toolchain }}
components: ${{ inputs.rust-components }}

- name: Cache Rust artifacts
Expand Down
13 changes: 12 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
pull_request:

env:
RUST_TOOLCHAIN: "1.95.0"
XGENEXT2FS_VERSION: v1.5.6
XGENEXT2FS_SHA256_AMD64: 996e4e68a638b5dc5967d3410f92ecb8d2f41e32218bbe0f8b4c4474d7eebc59
XGENEXT2FS_SHA256_ARM64: e5aca81164b762bbe5447bacef41e4fa9e357fd9c8f44e519c5206227d43144d
Expand All @@ -25,13 +26,16 @@ jobs:
run: |
sudo apt-get update
sudo apt-get install -y \
faketime \
libfaketime \
lua5.4 \
liblua5.4-dev \
libslirp-dev

- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
toolchain: ${{ env.RUST_TOOLCHAIN }}
components: rustfmt, clippy

- name: Cache Rust artifacts
Expand All @@ -53,7 +57,7 @@ jobs:

- name: Test
timeout-minutes: 15
run: RUN_ANVIL_TESTS=1 cargo test --workspace --all-targets --all-features --locked
run: cargo test --workspace --all-targets --all-features --locked

canonical-guest:
runs-on: ubuntu-latest
Expand All @@ -67,6 +71,7 @@ jobs:
- name: Setup guest toolchain
uses: ./.github/actions/setup-guest-toolchain
with:
rust-toolchain: ${{ env.RUST_TOOLCHAIN }}
xgenext2fs-version: ${{ env.XGENEXT2FS_VERSION }}
xgenext2fs-sha256-amd64: ${{ env.XGENEXT2FS_SHA256_AMD64 }}
xgenext2fs-sha256-arm64: ${{ env.XGENEXT2FS_SHA256_ARM64 }}
Expand All @@ -92,6 +97,7 @@ jobs:
- name: Setup guest toolchain
uses: ./.github/actions/setup-guest-toolchain
with:
rust-toolchain: ${{ env.RUST_TOOLCHAIN }}
xgenext2fs-version: ${{ env.XGENEXT2FS_VERSION }}
xgenext2fs-sha256-amd64: ${{ env.XGENEXT2FS_SHA256_AMD64 }}
xgenext2fs-sha256-arm64: ${{ env.XGENEXT2FS_SHA256_ARM64 }}
Expand All @@ -100,5 +106,10 @@ jobs:
cartesi-machine-sha256-arm64: ${{ env.CARTESI_MACHINE_SHA256_ARM64 }}
install-foundry: "true"

- name: Install faketime
run: |
sudo apt-get update
sudo apt-get install -y faketime libfaketime

- name: Run rollups E2E tests
run: just test-rollups-e2e
3 changes: 3 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ permissions:
contents: write

env:
RUST_TOOLCHAIN: "1.95.0"
XGENEXT2FS_VERSION: v1.5.6
XGENEXT2FS_SHA256_AMD64: 996e4e68a638b5dc5967d3410f92ecb8d2f41e32218bbe0f8b4c4474d7eebc59
XGENEXT2FS_SHA256_ARM64: e5aca81164b762bbe5447bacef41e4fa9e357fd9c8f44e519c5206227d43144d
Expand Down Expand Up @@ -59,6 +60,7 @@ jobs:
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
toolchain: ${{ env.RUST_TOOLCHAIN }}
targets: ${{ matrix.target }}

- name: Cache Rust artifacts
Expand Down Expand Up @@ -123,6 +125,7 @@ jobs:
- name: Setup guest toolchain
uses: ./.github/actions/setup-guest-toolchain
with:
rust-toolchain: ${{ env.RUST_TOOLCHAIN }}
xgenext2fs-version: ${{ env.XGENEXT2FS_VERSION }}
xgenext2fs-sha256-amd64: ${{ env.XGENEXT2FS_SHA256_AMD64 }}
xgenext2fs-sha256-arm64: ${{ env.XGENEXT2FS_SHA256_ARM64 }}
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ sequencer.db-wal
/out/
/.DS_Store
soljson-latest.js
**/states/
387 changes: 262 additions & 125 deletions AGENTS.md

Large diffs are not rendered by default.

57 changes: 57 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# 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).

## 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/` — main sequencer binary and library.
- `sequencer-core/` — shared domain types consumed by both sequencer and scheduler.
- `examples/app-core/` — placeholder wallet app implementing `Application`.
- `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.

- `runtime/` — bootstrap, config, shutdown, shared clock.
- `ingress/` — public write path: `api.rs` (`POST /tx`) + `inclusion_lane/` (hot path).
- `egress/` — internal read path: `api/` (WS subscribe + health) + `l2_tx_feed/`.
- `l1/` — reader, submitter, 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.

## Before You Start Real Work

- **[`AGENTS.md`](AGENTS.md)** — mission, requirements, invariants, duality, recovery, conventions, rules.
- **[`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.
2 changes: 2 additions & 0 deletions Cargo.lock

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

Loading