Skip to content

Commit 119bc8b

Browse files
committed
test(program): end-to-end chunked-STARK SBF integration test (#76)
Validates the full chunked STARK verification flow on the real solana-program-test VM, across separate transactions -- the capstone for #76's "largest Phase-3 piece". tests/chunked_stark.rs: chunked_stark_verifies_across_transactions - tx1: InitializeSession (FriStark) + AppendChunk(s) uploading a valid 4-query depth-zero proof + BeginStarkVerify (setup gate, records num_queries=4) - asserts the session persists with cursor 0/4, setup_done, finalized - tx2: StarkVerifyStep batch=2 -> cursor 2/4, still open - tx3: StarkVerifyStep batch=5 (clamps to 4) -> complete -> the session PDA is closed (rent refunded) The cursor advancing 0 -> 2 -> 4 across three transactions, and the PDA closing on completion, is the on-chain proof that the resumable verifier + checkpoint cursor compose across transaction boundaries. stark_step_before_begin_is_rejected A StarkVerifyStep before BeginStarkVerify fails with StarkVerifyNotStarted (Custom(0x38)). Observed per-instruction CU on the depth-zero scaffold: begin ~14.6K, each step ~10-12K -- trivially under the 1.4M cap. A production ~7.8M-CU proof splits into batches each well under the cap, exactly as designed. Both tests pass on the VM (borsh 1.5.7 / platform-tools v1.52). Full SBF regression: verify_proof_sbf 17 + cross_validator_determinism 4 + chunked_handlers 8 + chunked_stark 2 = 31 SBF integration tests green. CI: ci.yml test-sbf job now runs all four SBF suites (added chunked_handlers + chunked_stark) so the on-chain chunked path runs on every push. #76 chunked execution is now implemented + validated end-to-end. The remaining #76 work is the real Plonky3/Winterfell reference fixture (the prover-fixture track) + the SDK auto-chunk helper.
1 parent caccd43 commit 119bc8b

3 files changed

Lines changed: 391 additions & 1 deletion

File tree

.github/workflows/ci.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,8 @@ jobs:
128128
run: |
129129
cargo test -p mosaic-program --test verify_proof_sbf
130130
cargo test -p mosaic-program --test cross_validator_determinism
131+
cargo test -p mosaic-program --test chunked_handlers
132+
cargo test -p mosaic-program --test chunked_stark
131133
132134
lock-guard:
133135
name: lockfile guard (SBF-critical pins)

CHANGELOG.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
3333
(0x15) and `StarkVerifyStep` (0x16), that finalize the session, run
3434
the verifier setup / a query-range batch, drive the session cursor,
3535
and close the session (refunding rent) when the final query passes.
36-
Compiles to SBF; the 25 existing SBF integration tests still pass.
36+
- End-to-end SBF integration test (`tests/chunked_stark.rs`):
37+
uploads a valid 4-query STARK proof, then verifies it across THREE
38+
separate transactions (init+upload+begin, then step 0..2, then
39+
step 2..4). The session cursor persists across transactions
40+
(0 -> 2 -> 4) and completion closes the PDA -- proving the resumable
41+
verifier + checkpoint cursor compose correctly across transaction
42+
boundaries on the real VM, which is the entire point of chunked
43+
execution. A second test asserts a step before begin is rejected
44+
with `StarkVerifyNotStarted`. Both pass; the 25 pre-existing SBF
45+
tests still pass (27 total SBF integration tests now).
3746

3847
- Security disclosure contact corrected repo-wide from
3948
`security@wienerlabs.com` to the actually-monitored

0 commit comments

Comments
 (0)