Skip to content

feat: add deterministic replay and network isolation - #390

Merged
christabel888 merged 1 commit into
Stellar-Analysis:mainfrom
Quanwritescodes:feat/deterministic-replay-network-isolation
Aug 30, 2026
Merged

christabel888 merged 1 commit into
Stellar-Analysis:mainfrom
Quanwritescodes:feat/deterministic-replay-network-isolation

Conversation

@Quanwritescodes

Copy link
Copy Markdown

Summary

This PR adds the historical replay and multi-network isolation foundations required for deterministic audits and conflict resolution in the backend.

What changed

  • Added the snapshot pipeline under backend/src/snapshot/ with a canonical, sorted aggregation path to make the generated output deterministic.
  • Added a pinned historical model-version registry so the replay logic uses a fixed model version for a given historical range instead of drifting with the current production model.
  • Added the replay entry point under backend/src/replay/ to regenerate snapshots from raw ingested rows for historical ranges.
  • Added explicit network identity handling under backend/src/network/ with Mainnet | Testnet | Futurenet and schema validation that fails fast if a table is missing a network discriminator.
  • Added regression tests for repeated replay stability and network isolation to guard against cross-contamination and ordering-dependent output.

Why this matters

  • Audit and dispute scenarios depend on being able to regenerate the same historical snapshot from the same raw data with byte-identical output.
  • Multi-network ingestion must never mix mainnet, testnet, or futurenet data in shared caches, topics, or persisted analytics.
  • This reduces the risk of silent data contamination that is difficult to detect after the fact.

Validation

  • Added deterministic replay tests that exercise repeated historical range replays.
  • Added dual-network ingestion tests to confirm zero cross-contamination between networks.
  • Added startup schema validation to reject tables lacking the required network field.

Notes

  • The work is intentionally designed to be deterministic from the historical replay boundary onward and to keep network identity explicit at every persistence and cache layer.
  • This change establishes the deterministic replay and isolation foundation for subsequent production hardening and telemetry work.

closes #325
closes #326

@christabel888
christabel888 merged commit d8bae43 into Stellar-Analysis:main Aug 30, 2026
5 of 14 checks passed
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.

Multi-network isolation between mainnet, testnet, and futurenet Deterministic snapshot replay for audits and dispute resolution

2 participants