Add local sequencer integration tests#140
Conversation
There was a problem hiding this comment.
Pull request overview
Adds an opt-in local sequencer integration harness to the existing Rust integration test suites, plus a local-sequencer helper tool to clone/build the pinned LEZ checkout (and circuits cache) and run the feature-gated tests in CI and locally.
Changes:
- Introduces
tools/local-sequencerto manage a pinned LEZ checkout, circuits caching, and asetup/testworkflow. - Adds a
local-sequencer-testsfeature tointegration_teststhat swapsV03Stateusage behind aTestStatewrapper that mirrors transitions through a spawned sequencer. - Wires documentation, Makefile clippy, and CI to run the local sequencer integration suite.
Reviewed changes
Copilot reviewed 14 out of 15 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| tools/local-sequencer/src/main.rs | New helper CLI to prepare LEZ checkout, circuits cache, and run feature-gated integration tests |
| tools/local-sequencer/Cargo.toml | New workspace tool crate definition |
| README.md | Documents local sequencer harness usage and stablecoin integration coverage |
| programs/integration_tests/tests/token.rs | Switches to integration_tests::TestState alias and adds local-sequencer-specific assertions |
| programs/integration_tests/tests/stablecoin.rs | Switches to integration_tests::TestState alias |
| programs/integration_tests/tests/ata.rs | Switches to integration_tests::TestState alias |
| programs/integration_tests/tests/amm.rs | Switches to integration_tests::TestState alias |
| programs/integration_tests/src/local_sequencer.rs | New feature-gated local sequencer harness (spawn, seed, submit/poll, mirror state) |
| programs/integration_tests/src/lib.rs | Feature-gated TestState export (wrapper vs type alias) |
| programs/integration_tests/Cargo.toml | Adds local-sequencer-tests feature + optional deps (base64/borsh/rocksdb/serde_json) |
| Makefile | Runs clippy for integration_tests with local-sequencer-tests enabled |
| CLAUDE.md | Updates repository structure notes to include stablecoin integration tests |
| Cargo.toml | Adds tools/local-sequencer and workspace deps for base64/rocksdb |
| Cargo.lock | Adds dependency graph entries for new optional deps (e.g., rocksdb/librocksdb-sys/bindgen) |
| .github/workflows/ci.yml | Adds CI job to run cargo run -p local-sequencer -- test with caching |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
I've found some issues/PRs and created new issues that would make the local-sequencer wrapper unnecessary and let us depend on scaffold tool directly. Existing scaffold work that is adjacent, but not enough:
Missing pieces were submitted as issues as follow-up scaffold requirements:
|
6c0caa8 to
eb5c7f8
Compare
|
Now this PR uses scaffold. Scaffold currently don't do that, and this results in tests taking too long. While this is not implemented, I won't recommend merging this PR. I opened the issue here logos-co/scaffold#227 |
|
Thank you for the update! |
eb5c7f8 to
622ce74
Compare
622ce74 to
8540c6f
Compare
| struct LocalSequencer { | ||
| _node: TestNode, | ||
| client: TestNodeClient, | ||
| } | ||
|
|
||
| impl LocalSequencer { | ||
| fn spawn(state: &nssa::V03State) -> DynResult<Self> { | ||
| ensure_risc0_dev_mode()?; | ||
| ensure_release_guest_builds()?; | ||
| let seed_dir = SeedDirGuard::from_state(state)?; | ||
| let config = TestNodeConfig { | ||
| state: Some(seed_dir.path().to_path_buf()), | ||
| timeout_sec: HEALTH_TIMEOUT.as_secs(), | ||
| ..Default::default() | ||
| }; | ||
| let node = TestNode::start(scaffold_project(), &config) | ||
| .map_err(|err| io::Error::other(format!("scaffold test-node start failed: {err}")))?; | ||
| Ok(Self { | ||
| client: node.client(), | ||
| _node: node, | ||
| }) | ||
| } |
3ddf1c7 to
51e4141
Compare
51e4141 to
4b25a3e
Compare
Summary
local-sequencerhelper crate with scaffold-managedtest-nodeintegration.scaffold.tomland depend onlogos-scaffoldso local-sequencer tests use the scaffold Rust API for node lifecycle, transaction outcomes, block context, account reads, and proof reads.TestStatecan start a scaffold test node from full-fidelityV03State.local-sequencer-testsflow.Closes #134.
Tests
cargo +nightly fmt --all -- --checktaplo fmt --check .git diff --checkRISC0_SKIP_BUILD=1 cargo +1.94.0 clippy --workspace --all-targets -- -D warningsRISC0_SKIP_BUILD=1 cargo +1.94.0 clippy -p integration_tests --all-targets --features local-sequencer-tests -- -D warningsRISC0_DEV_MODE=1 cargo +1.94.0 test --workspace --exclude integration_testsRISC0_DEV_MODE=1 cargo +1.94.0 test -p integration_testsRISC0_DEV_MODE=1 RUST_TEST_THREADS=1 cargo +1.94.0 test -p integration_tests --features local-sequencer-tests -- --nocapturecargo +1.94.0 build -p idl-gen --release*/methods/guest/src/bin/*.rs