Skip to content

Add local sequencer integration tests#140

Open
3esmit wants to merge 1 commit into
mainfrom
issue-134-local-sequencer-integration-tests
Open

Add local sequencer integration tests#140
3esmit wants to merge 1 commit into
mainfrom
issue-134-local-sequencer-integration-tests

Conversation

@3esmit

@3esmit 3esmit commented Jun 5, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Replace the custom local-sequencer helper crate with scaffold-managed test-node integration.
  • Add scaffold.toml and depend on logos-scaffold so local-sequencer tests use the scaffold Rust API for node lifecycle, transaction outcomes, block context, account reads, and proof reads.
  • Keep only a small RocksDB seed adapter in the integration harness so each TestState can start a scaffold test node from full-fidelity V03State.
  • Update CI, cache paths, and README usage for the scaffold-backed local-sequencer-tests flow.

Closes #134.

Tests

  • cargo +nightly fmt --all -- --check
  • taplo fmt --check .
  • git diff --check
  • RISC0_SKIP_BUILD=1 cargo +1.94.0 clippy --workspace --all-targets -- -D warnings
  • RISC0_SKIP_BUILD=1 cargo +1.94.0 clippy -p integration_tests --all-targets --features local-sequencer-tests -- -D warnings
  • RISC0_DEV_MODE=1 cargo +1.94.0 test --workspace --exclude integration_tests
  • RISC0_DEV_MODE=1 cargo +1.94.0 test -p integration_tests
  • RISC0_DEV_MODE=1 RUST_TEST_THREADS=1 cargo +1.94.0 test -p integration_tests --features local-sequencer-tests -- --nocapture
  • cargo +1.94.0 build -p idl-gen --release
  • IDL drift check for every */methods/guest/src/bin/*.rs

Copilot AI review requested due to automatic review settings June 5, 2026 03:53

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-sequencer to manage a pinned LEZ checkout, circuits caching, and a setup/test workflow.
  • Adds a local-sequencer-tests feature to integration_tests that swaps V03State usage behind a TestState wrapper 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.

Comment thread tools/local-sequencer/src/main.rs Outdated
Comment thread tools/local-sequencer/src/main.rs Outdated
Comment thread programs/integration_tests/src/local_sequencer.rs Outdated
@3esmit

3esmit commented Jun 5, 2026

Copy link
Copy Markdown
Collaborator Author

logos-co/scaffold is the right upstream home for this long-term, instead of a local-sequencer wrapper, but it does not currently provide the batteries-included surface needed here. This PR still needs the local harness/tool for now; if the scaffold test-node API and CI commands land later, this repo can replace the custom harness with direct scaffold API/command usage.

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:

  • logos-co/scaffold#195 merged: locks in standalone sequencer build mode. Useful prerequisite, but not a test harness.
  • logos-co/scaffold#173 open: circuits auto-fetch/pinning. Useful setup piece, but does not cover seeded test state or transaction outcomes.
  • logos-co/scaffold#172 open: lgs run lifecycle hooks. Useful orchestration, but not isolated per-test nodes or machine-readable receipts.
  • logos-co/scaffold#34 open: daemonizes localnet. Good for developer localnet, but integration tests need clean stop-on-exit behavior.
  • logos-co/scaffold#141 and logos-co/scaffold#159 merged: localnet config hardening. Helpful, but still localnet plumbing.
  • logos-co/scaffold#196 merged: template E2E CI. Validates scaffold templates, not downstream program state parity.
  • logos-co/scaffold#25 closed and logos-co/scaffold#32 closed unmerged: scaffold still does not expose its current command features as a Rust API, which means Rust tests would need subprocess calls and output parsing.

Missing pieces were submitted as issues as follow-up scaffold requirements:

  • logos-co/scaffold#202 expose current scaffold command features as a public Rust API. This should land first so later test-node commands have a typed API boundary instead of a CLI-only surface.
  • logos-co/scaffold#203 isolated local sequencer test nodes, with CLI and Rust API surfaces.
  • logos-co/scaffold#204 caller-provided state seeding for test nodes, with CLI and Rust API surfaces.
  • logos-co/scaffold#205 structured transaction outcomes for test nodes, with CLI and Rust API surfaces.
  • logos-co/scaffold#206 deterministic block and clock context for test-node replay, with CLI and Rust API surfaces.
  • logos-co/scaffold#207 stable account and proof snapshots for parity assertions, with CLI and Rust API surfaces.
  • logos-co/scaffold#208 caller project LEZ and circuits pins for test nodes, with CLI and Rust API surfaces.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 14 out of 15 changed files in this pull request and generated 3 comments.

Comment thread tools/local-sequencer/src/main.rs Outdated
Comment thread tools/local-sequencer/src/main.rs Outdated
Comment thread tools/local-sequencer/src/main.rs Outdated
@3esmit 3esmit force-pushed the issue-134-local-sequencer-integration-tests branch from 9b66271 to 6c0caa8 Compare June 18, 2026 22:17
@3esmit 3esmit force-pushed the issue-134-local-sequencer-integration-tests branch from 6c0caa8 to eb5c7f8 Compare June 19, 2026 15:53
@3esmit

3esmit commented Jun 19, 2026

Copy link
Copy Markdown
Collaborator Author

Now this PR uses scaffold.
The initial implementation of this PR used a local spawning script for the sequencer, which configured it with fastblocks.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Setup integration tests agains local sequencer

2 participants