Skip to content

Bootstrap Orchestration #395

@lowhung

Description

@lowhung

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

  1. Need a global [startup] configuration section to choose between various start-up methods (genesis/mithril/snapshot)
  2. Need orchestration logic to download the snapshot files from configured URLs before parsing
  3. The snapshot bootstrapper needs to verify files are present and valid before processing
  4. (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 to omnibus.toml containing method field supporting "genesis" | "mithril" | "snapshot"
  • [bootstrap.snapshot] section with network and data_dir, point fields
  • main.rs conditionally registers necessary modules based on startup.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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions