-
Notifications
You must be signed in to change notification settings - Fork 5
Description
Context
Currently, Acropolis supports two startup methods: starting from genesis and Mithril snapshot fetching, both of which require block replay. We want to add a third option that uses NewEpochState snapshot files which contain the entire ledger state (UTXOs, accounts, pools, etc.) for a specific set of epochs. These files will be handed loaded by the boot-strapper process, parsed and routed to the state modules for state initialization. This enables faster bootstrap to a target epoch without any block replay.
As I mentioned, these snapshots are CBOR files representing the NewEpochState structure, we've seen with Amaru that they opt to process three consecutive epochs (e.g., 507, 508, 509) in order to provide the necessary context for rewards calculation (among many other things ofc). These files are referenced by network-specific manifests stored in a data/ directory.
Problem
- Need a global
[startup]configuration section to choose between various start-up methods (genesis/mithril/snapshot) - Need orchestration logic to download the snapshot files from configured URLs before parsing
- The snapshot bootstrapper needs to verify files are present and valid before processing
- (Potentially optional) omnibus entrypoint needs conditional module registration based on bootstrap method
Acceptance Criteria
Here's a shortlist of things to have as part of this flow:
- Global
[startup]configuration section added toomnibus.tomlcontainingmethodfield supporting"genesis" | "mithril" | "snapshot" -
[bootstrap.snapshot]section withnetworkanddata_dir,pointfields -
main.rsconditionally registers necessary modules based onstartup.method - Snapshot bootstrapper downloads missing snapshot files from URLs in
snapshots.json - Files are cached in
data/<network>/directory to avoid re-downloads - Clear logging shows download progress and verification steps
- Graceful error handling if downloads fail or files are corrupted
Testing Requirements
- Test with missing snapshot files triggers download
- Test with corrupted files triggers re-download
- Test with all files present skips download
- Test with invalid network name fails gracefully
- Test download failure retries with exponential backoff
Definition of Done
- Can configure bootstrap method via
omnibus.toml - Snapshot files are automatically downloaded if missing
- Downloaded files are reused on subsequent runs