Open
Conversation
a6c331f to
c9bb6d7
Compare
AndreiEres
approved these changes
May 7, 2026
Contributor
AndreiEres
left a comment
There was a problem hiding this comment.
Statement store tests still work :-)
skunert
reviewed
May 7, 2026
Contributor
There was a problem hiding this comment.
Not sure if you are aware of this, but chainHead_v1_followEvent emits on subscription first the finalized head and then a newBlock event per already known block. So if we want to count real new blocks since subscription time, we would need to wait for the initial burst. Just a thing to consider.
Contributor
Author
There was a problem hiding this comment.
Good catch 😄
Updated
Refactor smoke.rs onto a ScenarioConfig API admitting fresh/cold/warm cases (cold/warm stubbed). Replace the 50-block warp-gap pre-wait with a first-finalized gate; smoldot now resolves the warp-sync gate via normal finality (6b3cfe2). Plan in e2e-tests/docs/smoke-scenarios.md.
Spawns westend-local + people-westend-local from genesis, waits for the
relay to reach a target finalized block, then produces:
- relaychain-db.tgz / parachain-db.tgz (validator-0 / alice data dirs)
- relay-spec.json (sync_state_genSyncSpec; bootNodes stripped)
- para-spec.json (zombienet-emitted; bootNodes stripped)
- smoldot-db/{relay,para}.json (chainHead_unstable_finalizedDatabase)
- sha256 manifest with snapshot.rs constants
Run with `cargo run --bin generate_snapshots -- --out DIR
--target-finalized N`. Defaults to N=100; bump to ~1500 for the real v1
artifact set. Validated end-to-end at N=20 in ~5 min.
Implement the cold/warm branches that were stubbed in the scenario module:
- Parse finalized height from chain-spec lightSyncState and from smoldot
databaseContent JSONs (smoldot::header::decode).
- Inject current bootnode multiaddrs into runtime spec copies, since the
committed artifacts have empty bootNodes (port-agnostic by design).
- Pass committed specs to zombienet via with_chain_spec_path.
Add e2e-tests/src/snapshot.rs as the artifact resolver: env-override path
takes priority, then ~/.cache/smoldot-e2e/{version} cache, then GCS
download with sha256 verification. SHA constants are placeholder (empty)
until the v1 artifact set is published — until then only env override is
accepted.
Add tests/smoke_cold.rs and tests/smoke_warm.rs scaffolds.
- Add --spec-at-finalized M; capture relay spec at #M, snapshot DBs at #N. Default M = N/2 so the M..N gap exceeds smoldot's warp_sync_minimum_gap (32) and smoldot exercises real warp sync — needed to traverse GRANDPA authority-set rotations between checkpoint and snapshot. - Add --relay-db-snapshot / --para-db-snapshot to resume from a prior run's tarballs instead of starting from genesis. - Pre-stage per-node copies of the snapshot tarballs to dodge the TOCTOU race in zombienet-provider's `with_db_snapshot` cache (sibling nodes sharing one source path corrupt the partially-written file).
Sibling nodes consuming the same snapshot would end up with the source node's session keys in their keystore (zombienet inserts per-node keys via author_insertKey on top, but doesn't remove pre-existing ones). Multiple nodes then try to author for the same slot — chain stalls under BABE/Aura/GRANDPA equivocation.
- network.rs: stage per-node copies of the snapshot tarballs to dodge
the TOCTOU race in zombienet's with_db_snapshot cache; tolerate
smoldot-db hex headers without 0x prefix.
- snapshot.rs: all six artifacts (tarballs, specs, smoldot-db JSONs)
resolved via GCS + ~/.cache/smoldot-e2e + sha256 verify. SHA constants
pinned for v1. Single ARTIFACTS_DIR_OVERRIDE env points at a local
generator output dir for dev iteration.
- smoke_{cold,warm}.rs: ? on the resolver calls.
- docs/smoke-scenarios.md: updated layout and override docs.
- Generator now produces a light-sync-state copy of each chain spec (genesis.raw → genesis.stateRootHash) alongside the full one. Smoldot loads the small spec; substrate keeps using the full one. Cuts smoldot init time and shrinks the artifact ~30x for these specs. - All published artifacts are wrapped into a single bundle.tar.gz on GCS; snapshot.rs downloads + sha-verifies once per ARTIFACTS_VERSION and extracts in place. Single SHA constant replaces the per-file matrix. - Reset BUNDLE_SHA256 to placeholder; will be filled in once the regen with the new shape lands. - Trimmed docs/smoke-scenarios.md to scenario summary, bundle layout, and regeneration procedure (drops content already in source).
ISO 8601 prefix on smoldot logCallback output and PASS/FAIL report lines, so cross-correlating with Rust-side env_logger entries during test debugging stops being a guessing game.
Tarring before the smoldot dump captured the network DBs at an earlier point than smoldot's persisted finalized. When the test later spawned from the snapshot, smoldot's persisted block didn't yet exist in the validator's DB and smoldot stalled on storage-proof-request-error trying to fetch the runtime there.
…zedHead Smoldot blocks legacy JSON-RPC functions until the warp-sync gate has opened, so calling chain_getFinalizedHead right after addChain races the gate and the warm path times out. Subscribe chainHead_v1_follow on the relay, wait for the `initialized` event (which fires after warp sync), grab the newest finalized block hash, fetch its header via chainHead_v1_header, and decode the block number from the SCALE compact-encoded number. Also bump the para chainHead deadline to 180s so warm-path catch-up has headroom.
The lower-bound assertion on smoldot's first reported finalized block exists to prove smoldot honoured the artifact's checkpoint (didn't fall back to genesis). The new name says what it is and what's expected of it. Rust finalized_floor -> expected_initial_finalized JS finalizedFloor -> expectedInitialFinalized env FINALIZED_FLOOR -> EXPECTED_INITIAL_FINALIZED
Promote network::extract_emitted_specs to public spawned_chain_spec_paths and drop the near-identical helper in statement.rs.
Move src/bin/generate_snapshots.rs to tests/smoke_generate_snapshots.rs as a #[tokio::test] #[ignore], driven by SMOKE_SNAPSHOT_* env vars instead of CLI flags. Bumps DEFAULT_TARGET_FINALIZED 100 -> 2500.
Show ZOMBIE_PROVIDER=native and TARGET_FINALIZED=2500/SPEC_AT_FINALIZED=1250 in the genesis-run example, and fix the stale tests/generate_snapshots.rs path to tests/smoke_generate_snapshots.rs.
Renumbers existing rows to 0001-0006 to keep the sequence tight.
71146d8 to
b2f2f58
Compare
BigTava
added a commit
that referenced
this pull request
May 7, 2026
Avoids matrix-slot collision with PR #3242 (more smoke tests), which takes 0004-0006.
gab8i
approved these changes
May 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
e2e-tests/tests/:smoke_fresh(genesis),smoke_cold(snapshot +lightSyncState, no smoldot DB),smoke_warm(snapshot +lightSyncState+ persisteddatabaseContent).gs://zombienet-db-snaps/zombienet/smoldot_smoke_db/v1/bundle.tar.gz, SHA-pinned insrc/snapshot.rs.ARTIFACTS_DIR_OVERRIDEskips download for local iterationsmoke_generate_snapshotsFull description in
e2e-tests/docs/smoke-scenarios.md