Skip to content

Conversation

@lowhung
Copy link
Collaborator

@lowhung lowhung commented Nov 21, 2025

Description

Implements downloading of snapshots from configured URLs within Snapshot Boostrapper, along with conditional registration of either Snapshot Bootstrapper or Mithril Snapshot Fetcher.

Related Issue(s)

#395

How was this tested?

Checklist

  • My code builds and passes local tests
  • I added/updated tests for my changes, where applicable
  • I updated documentation (if applicable)
  • CI is green for this PR

Impact / Side effects

No breaking changes. This is an additive change.

New optional config:

[startup]
method = "mithril"  # Options: "mithril" | "snapshot"

[module.snapshot-bootstrapper]
network = "mainnet"
data-dir = "./data"

Dependencies added: async-compression, reqwest, tokio-util, futures-util

Reviewer notes / Areas to focus

  • modules/snapshot_bootstrapper/bootstrapper.rs: Core bootstrap logic / orchestration
  • modules/snapshot_bootstrapper/downloader.rs: Download logic
  • modules/snapshot_bootstrapper/publisher.rs: Publishing logic
  • processes/omnibus/main.rs: Conditional registration of Mithril and Snapshot

How to run this

  1. In processes/omnibus/omnibus.toml Set startup.method = 'snapshot'
  2. Execute make run at top-level
You can see the bootstrap logs here
2025-11-23T18:10:09.310399Z  INFO acropolis_module_snapshot_bootstrapper: Bootstrap prerequisites met, starting snapshot processing
2025-11-23T18:10:09.311211Z  INFO acropolis_module_snapshot_bootstrapper: Found 3 snapshot(s) to process
2025-11-23T18:10:09.313356Z  INFO acropolis_module_tx_unpacker: Seeded registry with 14505 genesis utxos
2025-11-23T18:10:09.315501Z  INFO acropolis_module_snapshot_bootstrapper::downloader: Downloading snapshot from https://pub-b844360df4774bb092a2bb2043b888e5.r2.dev/134092758.670ca68c3de580f8469677754a725e86ca72a7be381d3108569f0704a5fca327.cbor.gz
2025-11-23T18:10:13.705662Z  INFO acropolis_module_snapshot_bootstrapper::progress_reader: Download progress: 12.2% (200 MB / 1638 MB)
2025-11-23T18:10:17.733505Z  INFO acropolis_module_snapshot_bootstrapper::progress_reader: Download progress: 24.4% (400 MB / 1638 MB)
2025-11-23T18:10:21.736792Z  INFO acropolis_module_snapshot_bootstrapper::progress_reader: Download progress: 36.6% (600 MB / 1638 MB)
2025-11-23T18:10:25.721453Z  INFO acropolis_module_snapshot_bootstrapper::progress_reader: Download progress: 48.8% (800 MB / 1638 MB)
2025-11-23T18:10:29.714086Z  INFO acropolis_module_snapshot_bootstrapper::progress_reader: Download progress: 61.0% (1000 MB / 1638 MB)
2025-11-23T18:10:33.735335Z  INFO acropolis_module_snapshot_bootstrapper::progress_reader: Download progress: 73.2% (1200 MB / 1638 MB)
2025-11-23T18:10:37.738563Z  INFO acropolis_module_snapshot_bootstrapper::progress_reader: Download progress: 85.4% (1400 MB / 1638 MB)
2025-11-23T18:10:41.724120Z  INFO acropolis_module_snapshot_bootstrapper::progress_reader: Download progress: 97.6% (1600 MB / 1638 MB)
2025-11-23T18:10:42.544075Z  INFO acropolis_module_snapshot_bootstrapper::downloader: Downloaded and decompressed snapshot to ../../modules/snapshot_bootstrapper/data/mainnet/134092758.670ca68c3de580f8469677754a725e86ca72a7be381d3108569f0704a5fca327.cbor
2025-11-23T18:10:42.544123Z  INFO acropolis_module_snapshot_bootstrapper::downloader: Downloading snapshot from https://pub-b844360df4774bb092a2bb2043b888e5.r2.dev/134524753.29011cc1320d03b3da0121236dc66e6bc391feef4bb1d506a7fb20e769d6a494.cbor.gz
2025-11-23T18:10:46.875042Z  INFO acropolis_module_snapshot_bootstrapper::progress_reader: Download progress: 12.2% (200 MB / 1644 MB)
2025-11-23T18:10:50.893368Z  INFO acropolis_module_snapshot_bootstrapper::progress_reader: Download progress: 24.3% (400 MB / 1644 MB)
2025-11-23T18:10:54.865439Z  INFO acropolis_module_snapshot_bootstrapper::progress_reader: Download progress: 36.5% (600 MB / 1644 MB)
2025-11-23T18:10:59.067876Z  INFO acropolis_module_snapshot_bootstrapper::progress_reader: Download progress: 48.7% (800 MB / 1644 MB)
2025-11-23T18:11:03.012053Z  INFO acropolis_module_snapshot_bootstrapper::progress_reader: Download progress: 60.8% (1000 MB / 1644 MB)
2025-11-23T18:11:06.869071Z  INFO acropolis_module_snapshot_bootstrapper::progress_reader: Download progress: 73.0% (1200 MB / 1644 MB)
2025-11-23T18:11:09.272316Z  INFO acropolis_module_assets_state: no state yet
2025-11-23T18:11:09.272347Z  INFO acropolis_module_drep_state::state: count=0
2025-11-23T18:11:09.272355Z  INFO acropolis_module_utxo_state::state: slot=0 number=0 immutable_utxos=14505 volatile_utxos=0 valid_utxos=14505
2025-11-23T18:11:09.272316Z  INFO acropolis_module_governance_state::state: alonzo proposal epochs: [], conway proposals: 0, conway votes: 0, drep stake msgs (size): 0 (0)
2025-11-23T18:11:09.272339Z  INFO acropolis_module_spo_state::state: num_spos=0 num_pending_deregistrations=0
2025-11-23T18:11:10.875798Z  INFO acropolis_module_snapshot_bootstrapper::progress_reader: Download progress: 85.2% (1400 MB / 1644 MB)
2025-11-23T18:11:14.868880Z  INFO acropolis_module_snapshot_bootstrapper::progress_reader: Download progress: 97.3% (1600 MB / 1644 MB)
2025-11-23T18:11:15.807742Z  INFO acropolis_module_snapshot_bootstrapper::downloader: Downloaded and decompressed snapshot to ../../modules/snapshot_bootstrapper/data/mainnet/134524753.29011cc1320d03b3da0121236dc66e6bc391feef4bb1d506a7fb20e769d6a494.cbor
2025-11-23T18:11:15.807824Z  INFO acropolis_module_snapshot_bootstrapper::downloader: Downloading snapshot from https://pub-b844360df4774bb092a2bb2043b888e5.r2.dev/134956789.6558deef007ba372a414466e49214368c17c1f8428093193fc187d1c4587053c.cbor.gz
2025-11-23T18:11:20.127783Z  INFO acropolis_module_snapshot_bootstrapper::progress_reader: Download progress: 12.2% (200 MB / 1645 MB)
2025-11-23T18:11:24.168620Z  INFO acropolis_module_snapshot_bootstrapper::progress_reader: Download progress: 24.3% (400 MB / 1645 MB)
2025-11-23T18:11:28.183922Z  INFO acropolis_module_snapshot_bootstrapper::progress_reader: Download progress: 36.5% (600 MB / 1645 MB)
2025-11-23T18:11:32.118679Z  INFO acropolis_module_snapshot_bootstrapper::progress_reader: Download progress: 48.6% (800 MB / 1645 MB)
2025-11-23T18:11:36.125782Z  INFO acropolis_module_snapshot_bootstrapper::progress_reader: Download progress: 60.8% (1000 MB / 1645 MB)
2025-11-23T18:11:40.294757Z  INFO acropolis_module_snapshot_bootstrapper::progress_reader: Download progress: 72.9% (1200 MB / 1645 MB)
2025-11-23T18:11:44.126568Z  INFO acropolis_module_snapshot_bootstrapper::progress_reader: Download progress: 85.1% (1400 MB / 1645 MB)
2025-11-23T18:11:48.187191Z  INFO acropolis_module_snapshot_bootstrapper::progress_reader: Download progress: 97.3% (1600 MB / 1645 MB)
2025-11-23T18:11:49.055888Z  INFO acropolis_module_snapshot_bootstrapper::downloader: Downloaded and decompressed snapshot to ../../modules/snapshot_bootstrapper/data/mainnet/134956789.6558deef007ba372a414466e49214368c17c1f8428093193fc187d1c4587053c.cbor
2025-11-23T18:11:49.056015Z  INFO acropolis_module_snapshot_bootstrapper: Processing snapshot for epoch 507 from ../../modules/snapshot_bootstrapper/data/mainnet/134092758.670ca68c3de580f8469677754a725e86ca72a7be381d3108569f0704a5fca327.cbor
2025-11-23T18:11:49.056022Z  INFO acropolis_module_snapshot_bootstrapper: Parsing snapshot: ../../modules/snapshot_bootstrapper/data/mainnet/134092758.670ca68c3de580f8469677754a725e86ca72a7be381d3108569f0704a5fca327.cbor
2025-11-23T18:11:50.046390Z  INFO acropolis_module_snapshot_bootstrapper::publisher: Processed 1000000 UTXOs
2025-11-23T18:11:50.046399Z  INFO acropolis_common::snapshot::streaming_snapshot: Streamed 1000000 UTXOs, buffer: 16 MB, max entry: 17708 bytes
2025-11-23T18:11:50.457970Z  INFO acropolis_module_snapshot_bootstrapper::publisher: Processed 2000000 UTXOs
2025-11-23T18:11:50.457980Z  INFO acropolis_common::snapshot::streaming_snapshot: Streamed 2000000 UTXOs, buffer: 16 MB, max entry: 17708 bytes
2025-11-23T18:11:50.877505Z  INFO acropolis_module_snapshot_bootstrapper::publisher: Processed 3000000 UTXOs
2025-11-23T18:11:50.877519Z  INFO acropolis_common::snapshot::streaming_snapshot: Streamed 3000000 UTXOs, buffer: 16 MB, max entry: 21597 bytes
2025-11-23T18:11:51.292728Z  INFO acropolis_module_snapshot_bootstrapper::publisher: Processed 4000000 UTXOs
2025-11-23T18:11:51.292741Z  INFO acropolis_common::snapshot::streaming_snapshot: Streamed 4000000 UTXOs, buffer: 16 MB, max entry: 21597 bytes
2025-11-23T18:11:51.704325Z  INFO acropolis_module_snapshot_bootstrapper::publisher: Processed 5000000 UTXOs
2025-11-23T18:11:51.704335Z  INFO acropolis_common::snapshot::streaming_snapshot: Streamed 5000000 UTXOs, buffer: 16 MB, max entry: 21597 bytes
2025-11-23T18:11:52.113117Z  INFO acropolis_module_snapshot_bootstrapper::publisher: Processed 6000000 UTXOs
2025-11-23T18:11:52.113125Z  INFO acropolis_common::snapshot::streaming_snapshot: Streamed 6000000 UTXOs, buffer: 16 MB, max entry: 21597 bytes
2025-11-23T18:11:52.522942Z  INFO acropolis_module_snapshot_bootstrapper::publisher: Processed 7000000 UTXOs
2025-11-23T18:11:52.522950Z  INFO acropolis_common::snapshot::streaming_snapshot: Streamed 7000000 UTXOs, buffer: 16 MB, max entry: 21597 bytes
2025-11-23T18:11:52.934987Z  INFO acropolis_module_snapshot_bootstrapper::publisher: Processed 8000000 UTXOs
2025-11-23T18:11:52.935003Z  INFO acropolis_common::snapshot::streaming_snapshot: Streamed 8000000 UTXOs, buffer: 16 MB, max entry: 21597 bytes
2025-11-23T18:11:53.346917Z  INFO acropolis_module_snapshot_bootstrapper::publisher: Processed 9000000 UTXOs
2025-11-23T18:11:53.346930Z  INFO acropolis_common::snapshot::streaming_snapshot: Streamed 9000000 UTXOs, buffer: 16 MB, max entry: 21597 bytes
2025-11-23T18:11:53.762019Z  INFO acropolis_module_snapshot_bootstrapper::publisher: Processed 10000000 UTXOs
2025-11-23T18:11:53.762033Z  INFO acropolis_common::snapshot::streaming_snapshot: Streamed 10000000 UTXOs, buffer: 16 MB, max entry: 22641 bytes
2025-11-23T18:11:54.183793Z  INFO acropolis_module_snapshot_bootstrapper::publisher: Processed 11000000 UTXOs
2025-11-23T18:11:54.183807Z  INFO acropolis_common::snapshot::streaming_snapshot: Streamed 11000000 UTXOs, buffer: 16 MB, max entry: 22641 bytes
2025-11-23T18:11:54.268248Z  INFO acropolis_common::snapshot::streaming_snapshot: Streaming results:
2025-11-23T18:11:54.268263Z  INFO acropolis_common::snapshot::streaming_snapshot:   UTXOs processed: 11199911
2025-11-23T18:11:54.268265Z  INFO acropolis_common::snapshot::streaming_snapshot:   Total data streamed: 1781.17 MB
2025-11-23T18:11:54.268267Z  INFO acropolis_common::snapshot::streaming_snapshot:   Peak buffer usage: 64 MB
2025-11-23T18:11:54.268269Z  INFO acropolis_common::snapshot::streaming_snapshot:   Largest single entry: 22641 bytes
2025-11-23T18:11:54.268776Z  INFO acropolis_module_snapshot_bootstrapper::publisher: Received 3095 pools
2025-11-23T18:11:54.268796Z  INFO acropolis_module_snapshot_bootstrapper::publisher: Received 278 DReps
2025-11-23T18:11:54.268800Z  INFO acropolis_module_snapshot_bootstrapper::publisher: Received 1412869 accounts
2025-11-23T18:11:54.280230Z  INFO acropolis_module_snapshot_bootstrapper::publisher: Received 0 proposals
2025-11-23T18:11:54.280237Z  INFO acropolis_module_snapshot_bootstrapper::publisher: Snapshot metadata for epoch 507
2025-11-23T18:11:54.280239Z  INFO acropolis_module_snapshot_bootstrapper::publisher:   UTXOs: Some(11199911)
2025-11-23T18:11:54.280241Z  INFO acropolis_module_snapshot_bootstrapper::publisher:   Pot balances: treasury=1528154947846618, reserves=7816251180544575, deposits=0
2025-11-23T18:11:54.280243Z  INFO acropolis_module_snapshot_bootstrapper::publisher:   - Previous epoch blocks: 1075
2025-11-23T18:11:54.280245Z  INFO acropolis_module_snapshot_bootstrapper::publisher:   - Current epoch blocks: 1037
2025-11-23T18:11:54.280246Z  INFO acropolis_module_snapshot_bootstrapper::publisher: Snapshot parsing completed
2025-11-23T18:11:54.280264Z  INFO acropolis_module_snapshot_bootstrapper::publisher: Final statistics:
2025-11-23T18:11:54.280269Z  INFO acropolis_module_snapshot_bootstrapper::publisher:   - UTXOs processed: 11199911
2025-11-23T18:11:54.280270Z  INFO acropolis_module_snapshot_bootstrapper::publisher:   - Pools: 3095
2025-11-23T18:11:54.280271Z  INFO acropolis_module_snapshot_bootstrapper::publisher:   - Accounts: 1412869
2025-11-23T18:11:54.280273Z  INFO acropolis_module_snapshot_bootstrapper::publisher:   - DReps: 278
2025-11-23T18:11:54.280274Z  INFO acropolis_module_snapshot_bootstrapper::publisher:   - Proposals: 0
2025-11-23T18:11:54.283934Z  INFO acropolis_module_snapshot_bootstrapper: Parsed snapshot in 5.23s
2025-11-23T18:11:54.283944Z  INFO acropolis_module_snapshot_bootstrapper: Processing snapshot for epoch 508 from ../../modules/snapshot_bootstrapper/data/mainnet/134524753.29011cc1320d03b3da0121236dc66e6bc391feef4bb1d506a7fb20e769d6a494.cbor
2025-11-23T18:11:54.283947Z  INFO acropolis_module_snapshot_bootstrapper: Parsing snapshot: ../../modules/snapshot_bootstrapper/data/mainnet/134524753.29011cc1320d03b3da0121236dc66e6bc391feef4bb1d506a7fb20e769d6a494.cbor
2025-11-23T18:11:55.128472Z  INFO acropolis_module_snapshot_bootstrapper::publisher: Processed 12000000 UTXOs
2025-11-23T18:11:55.211825Z  INFO acropolis_common::snapshot::streaming_snapshot: Streamed 1000000 UTXOs, buffer: 16 MB, max entry: 17708 bytes
2025-11-23T18:11:55.548351Z  INFO acropolis_module_snapshot_bootstrapper::publisher: Processed 13000000 UTXOs
2025-11-23T18:11:55.634593Z  INFO acropolis_common::snapshot::streaming_snapshot: Streamed 2000000 UTXOs, buffer: 16 MB, max entry: 17708 bytes
2025-11-23T18:11:55.972049Z  INFO acropolis_module_snapshot_bootstrapper::publisher: Processed 14000000 UTXOs
2025-11-23T18:11:56.055803Z  INFO acropolis_common::snapshot::streaming_snapshot: Streamed 3000000 UTXOs, buffer: 16 MB, max entry: 21597 bytes
2025-11-23T18:11:56.390659Z  INFO acropolis_module_snapshot_bootstrapper::publisher: Processed 15000000 UTXOs
2025-11-23T18:11:56.477213Z  INFO acropolis_common::snapshot::streaming_snapshot: Streamed 4000000 UTXOs, buffer: 16 MB, max entry: 21597 bytes
2025-11-23T18:11:56.822122Z  INFO acropolis_module_snapshot_bootstrapper::publisher: Processed 16000000 UTXOs
2025-11-23T18:11:56.908102Z  INFO acropolis_common::snapshot::streaming_snapshot: Streamed 5000000 UTXOs, buffer: 16 MB, max entry: 21597 bytes
2025-11-23T18:11:57.252452Z  INFO acropolis_module_snapshot_bootstrapper::publisher: Processed 17000000 UTXOs
2025-11-23T18:11:57.338189Z  INFO acropolis_common::snapshot::streaming_snapshot: Streamed 6000000 UTXOs, buffer: 16 MB, max entry: 21597 bytes
2025-11-23T18:11:57.681744Z  INFO acropolis_module_snapshot_bootstrapper::publisher: Processed 18000000 UTXOs
2025-11-23T18:11:57.771525Z  INFO acropolis_common::snapshot::streaming_snapshot: Streamed 7000000 UTXOs, buffer: 16 MB, max entry: 21597 bytes
2025-11-23T18:11:58.136364Z  INFO acropolis_module_snapshot_bootstrapper::publisher: Processed 19000000 UTXOs
2025-11-23T18:11:58.225431Z  INFO acropolis_common::snapshot::streaming_snapshot: Streamed 8000000 UTXOs, buffer: 16 MB, max entry: 21597 bytes
2025-11-23T18:11:58.575311Z  INFO acropolis_module_snapshot_bootstrapper::publisher: Processed 20000000 UTXOs
2025-11-23T18:11:58.660890Z  INFO acropolis_common::snapshot::streaming_snapshot: Streamed 9000000 UTXOs, buffer: 16 MB, max entry: 21597 bytes
2025-11-23T18:11:59.003124Z  INFO acropolis_module_snapshot_bootstrapper::publisher: Processed 21000000 UTXOs
2025-11-23T18:11:59.086866Z  INFO acropolis_common::snapshot::streaming_snapshot: Streamed 10000000 UTXOs, buffer: 16 MB, max entry: 22641 bytes
2025-11-23T18:11:59.418794Z  INFO acropolis_module_snapshot_bootstrapper::publisher: Processed 22000000 UTXOs
2025-11-23T18:11:59.501101Z  INFO acropolis_common::snapshot::streaming_snapshot: Streamed 11000000 UTXOs, buffer: 16 MB, max entry: 22641 bytes
2025-11-23T18:11:59.599647Z  INFO acropolis_common::snapshot::streaming_snapshot: Streaming results:
2025-11-23T18:11:59.599656Z  INFO acropolis_common::snapshot::streaming_snapshot:   UTXOs processed: 11242663
2025-11-23T18:11:59.599658Z  INFO acropolis_common::snapshot::streaming_snapshot:   Total data streamed: 1785.98 MB
2025-11-23T18:11:59.599660Z  INFO acropolis_common::snapshot::streaming_snapshot:   Peak buffer usage: 64 MB
2025-11-23T18:11:59.599662Z  INFO acropolis_common::snapshot::streaming_snapshot:   Largest single entry: 22641 bytes
2025-11-23T18:11:59.600207Z  INFO acropolis_module_snapshot_bootstrapper::publisher: Received 3094 pools
2025-11-23T18:11:59.600402Z  INFO acropolis_module_snapshot_bootstrapper::publisher: Received 365 DReps
2025-11-23T18:11:59.600412Z  INFO acropolis_module_snapshot_bootstrapper::publisher: Received 1413324 accounts
2025-11-23T18:11:59.646593Z  INFO acropolis_module_snapshot_bootstrapper::publisher: Received 0 proposals
2025-11-23T18:11:59.646601Z  INFO acropolis_module_snapshot_bootstrapper::publisher: Snapshot metadata for epoch 508
2025-11-23T18:11:59.646602Z  INFO acropolis_module_snapshot_bootstrapper::publisher:   UTXOs: Some(11242663)
2025-11-23T18:11:59.646604Z  INFO acropolis_module_snapshot_bootstrapper::publisher:   Pot balances: treasury=1532828945705969, reserves=7802782712972544, deposits=0
2025-11-23T18:11:59.646606Z  INFO acropolis_module_snapshot_bootstrapper::publisher:   - Previous epoch blocks: 1037
2025-11-23T18:11:59.646607Z  INFO acropolis_module_snapshot_bootstrapper::publisher:   - Current epoch blocks: 1026
2025-11-23T18:11:59.646648Z  INFO acropolis_module_snapshot_bootstrapper::publisher: Snapshot parsing completed
2025-11-23T18:11:59.646650Z  INFO acropolis_module_snapshot_bootstrapper::publisher: Final statistics:
2025-11-23T18:11:59.646652Z  INFO acropolis_module_snapshot_bootstrapper::publisher:   - UTXOs processed: 22442574
2025-11-23T18:11:59.646653Z  INFO acropolis_module_snapshot_bootstrapper::publisher:   - Pools: 6189
2025-11-23T18:11:59.646654Z  INFO acropolis_module_snapshot_bootstrapper::publisher:   - Accounts: 2826193
2025-11-23T18:11:59.646655Z  INFO acropolis_module_snapshot_bootstrapper::publisher:   - DReps: 643
2025-11-23T18:11:59.646657Z  INFO acropolis_module_snapshot_bootstrapper::publisher:   - Proposals: 0
2025-11-23T18:11:59.651564Z  INFO acropolis_module_snapshot_bootstrapper: Parsed snapshot in 5.37s
2025-11-23T18:11:59.651578Z  INFO acropolis_module_snapshot_bootstrapper: Processing snapshot for epoch 509 from ../../modules/snapshot_bootstrapper/data/mainnet/134956789.6558deef007ba372a414466e49214368c17c1f8428093193fc187d1c4587053c.cbor
2025-11-23T18:11:59.651580Z  INFO acropolis_module_snapshot_bootstrapper: Parsing snapshot: ../../modules/snapshot_bootstrapper/data/mainnet/134956789.6558deef007ba372a414466e49214368c17c1f8428093193fc187d1c4587053c.cbor
2025-11-23T18:12:00.420919Z  INFO acropolis_module_snapshot_bootstrapper::publisher: Processed 23000000 UTXOs
2025-11-23T18:12:00.603347Z  INFO acropolis_common::snapshot::streaming_snapshot: Streamed 1000000 UTXOs, buffer: 16 MB, max entry: 17708 bytes
2025-11-23T18:12:00.844145Z  INFO acropolis_module_snapshot_bootstrapper::publisher: Processed 24000000 UTXOs
2025-11-23T18:12:01.030138Z  INFO acropolis_common::snapshot::streaming_snapshot: Streamed 2000000 UTXOs, buffer: 16 MB, max entry: 17708 bytes
2025-11-23T18:12:01.261472Z  INFO acropolis_module_snapshot_bootstrapper::publisher: Processed 25000000 UTXOs
2025-11-23T18:12:01.443905Z  INFO acropolis_common::snapshot::streaming_snapshot: Streamed 3000000 UTXOs, buffer: 16 MB, max entry: 21597 bytes
2025-11-23T18:12:01.677629Z  INFO acropolis_module_snapshot_bootstrapper::publisher: Processed 26000000 UTXOs
2025-11-23T18:12:01.857996Z  INFO acropolis_common::snapshot::streaming_snapshot: Streamed 4000000 UTXOs, buffer: 16 MB, max entry: 21597 bytes
2025-11-23T18:12:02.088408Z  INFO acropolis_module_snapshot_bootstrapper::publisher: Processed 27000000 UTXOs
2025-11-23T18:12:02.272266Z  INFO acropolis_common::snapshot::streaming_snapshot: Streamed 5000000 UTXOs, buffer: 16 MB, max entry: 21597 bytes
2025-11-23T18:12:02.504068Z  INFO acropolis_module_snapshot_bootstrapper::publisher: Processed 28000000 UTXOs
2025-11-23T18:12:02.687941Z  INFO acropolis_common::snapshot::streaming_snapshot: Streamed 6000000 UTXOs, buffer: 16 MB, max entry: 21597 bytes
2025-11-23T18:12:02.921555Z  INFO acropolis_module_snapshot_bootstrapper::publisher: Processed 29000000 UTXOs
2025-11-23T18:12:03.104366Z  INFO acropolis_common::snapshot::streaming_snapshot: Streamed 7000000 UTXOs, buffer: 16 MB, max entry: 21597 bytes
2025-11-23T18:12:03.336251Z  INFO acropolis_module_snapshot_bootstrapper::publisher: Processed 30000000 UTXOs
2025-11-23T18:12:03.519143Z  INFO acropolis_common::snapshot::streaming_snapshot: Streamed 8000000 UTXOs, buffer: 16 MB, max entry: 21597 bytes
2025-11-23T18:12:03.752694Z  INFO acropolis_module_snapshot_bootstrapper::publisher: Processed 31000000 UTXOs
2025-11-23T18:12:03.935461Z  INFO acropolis_common::snapshot::streaming_snapshot: Streamed 9000000 UTXOs, buffer: 16 MB, max entry: 21597 bytes
2025-11-23T18:12:04.167701Z  INFO acropolis_module_snapshot_bootstrapper::publisher: Processed 32000000 UTXOs
2025-11-23T18:12:04.347683Z  INFO acropolis_common::snapshot::streaming_snapshot: Streamed 10000000 UTXOs, buffer: 16 MB, max entry: 22641 bytes
2025-11-23T18:12:04.574827Z  INFO acropolis_module_snapshot_bootstrapper::publisher: Processed 33000000 UTXOs
2025-11-23T18:12:04.757003Z  INFO acropolis_common::snapshot::streaming_snapshot: Streamed 11000000 UTXOs, buffer: 16 MB, max entry: 22641 bytes
2025-11-23T18:12:04.852257Z  INFO acropolis_common::snapshot::streaming_snapshot: Streaming results:
2025-11-23T18:12:04.852264Z  INFO acropolis_common::snapshot::streaming_snapshot:   UTXOs processed: 11234442
2025-11-23T18:12:04.852265Z  INFO acropolis_common::snapshot::streaming_snapshot:   Total data streamed: 1786.38 MB
2025-11-23T18:12:04.852268Z  INFO acropolis_common::snapshot::streaming_snapshot:   Peak buffer usage: 64 MB
2025-11-23T18:12:04.852269Z  INFO acropolis_common::snapshot::streaming_snapshot:   Largest single entry: 22641 bytes
2025-11-23T18:12:04.852777Z  INFO acropolis_module_snapshot_bootstrapper::publisher: Received 3095 pools
2025-11-23T18:12:04.852839Z  INFO acropolis_module_snapshot_bootstrapper::publisher: Received 400 DReps
2025-11-23T18:12:04.852847Z  INFO acropolis_module_snapshot_bootstrapper::publisher: Received 1413661 accounts
2025-11-23T18:12:04.874070Z  INFO acropolis_module_snapshot_bootstrapper::publisher: Received 0 proposals
2025-11-23T18:12:04.874076Z  INFO acropolis_module_snapshot_bootstrapper::publisher: Snapshot metadata for epoch 509
2025-11-23T18:12:04.874078Z  INFO acropolis_module_snapshot_bootstrapper::publisher:   UTXOs: Some(11234442)
2025-11-23T18:12:04.874080Z  INFO acropolis_module_snapshot_bootstrapper::publisher:   Pot balances: treasury=1537376975934454, reserves=7789809997399209, deposits=0
2025-11-23T18:12:04.874081Z  INFO acropolis_module_snapshot_bootstrapper::publisher:   - Previous epoch blocks: 1026
2025-11-23T18:12:04.874083Z  INFO acropolis_module_snapshot_bootstrapper::publisher:   - Current epoch blocks: 1057
2025-11-23T18:12:04.874164Z  INFO acropolis_module_snapshot_bootstrapper::publisher: Snapshot parsing completed
2025-11-23T18:12:04.874167Z  INFO acropolis_module_snapshot_bootstrapper::publisher: Final statistics:
2025-11-23T18:12:04.874168Z  INFO acropolis_module_snapshot_bootstrapper::publisher:   - UTXOs processed: 33677016
2025-11-23T18:12:04.874169Z  INFO acropolis_module_snapshot_bootstrapper::publisher:   - Pools: 9284
2025-11-23T18:12:04.874171Z  INFO acropolis_module_snapshot_bootstrapper::publisher:   - Accounts: 4239854
2025-11-23T18:12:04.874172Z  INFO acropolis_module_snapshot_bootstrapper::publisher:   - DReps: 1043
2025-11-23T18:12:04.874174Z  INFO acropolis_module_snapshot_bootstrapper::publisher:   - Proposals: 0
2025-11-23T18:12:04.877955Z  INFO acropolis_module_snapshot_bootstrapper: Parsed snapshot in 5.23s
2025-11-23T18:12:04.943529Z  INFO acropolis_module_snapshot_bootstrapper: Snapshot bootstrap completed successfully

@lowhung lowhung marked this pull request as draft November 21, 2025 06:27
@lowhung lowhung marked this pull request as ready for review November 21, 2025 18:17
@lowhung lowhung requested a review from Copilot November 21, 2025 19:07
Copilot finished reviewing on behalf of lowhung November 21, 2025 19:11
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR implements a snapshot bootstrapper module that enables Acropolis to initialize from NewEpochState CBOR snapshot files. The implementation adds an alternative bootstrap path alongside the existing genesis bootstrapper, allowing users to choose between starting from genesis or from a pre-built snapshot. The snapshot bootstrapper downloads gzip-compressed CBOR files from configured URLs, decompresses them on-the-fly, and parses them to reconstruct blockchain state.

Key changes:

  • New SnapshotBootstrapper module with download orchestration and gzip decompression
  • Dynamic bootstrap module selection based on startup.method config ("genesis" or "snapshot")
  • Configuration structure for network-specific snapshots with metadata in JSON files

Reviewed changes

Copilot reviewed 8 out of 9 changed files in this pull request and generated 11 comments.

Show a summary per file
File Description
processes/omnibus/src/main.rs Adds dynamic bootstrap module registration based on startup.method config
processes/omnibus/omnibus.toml Reorganizes config structure and adds snapshot bootstrapper configuration section
processes/omnibus/Cargo.toml Adds dependency on the new snapshot_bootstrapper module
modules/snapshot_bootstrapper/src/snapshot_bootstrapper.rs Implements core snapshot download, decompression, and parsing logic with error handling
modules/snapshot_bootstrapper/data/mainnet/snapshots.json Defines metadata for available mainnet snapshots (epochs 507-509)
modules/snapshot_bootstrapper/data/mainnet/config.json Specifies which snapshots to load and associated block points
modules/snapshot_bootstrapper/Cargo.toml Declares dependencies for HTTP client, compression, and JSON parsing
common/src/snapshot/streaming_snapshot.rs Adjusts logging format for consistency (removes emojis and extra indentation)
Cargo.lock Updates lock file with new dependencies

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 11 out of 12 changed files in this pull request and generated 8 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@lowhung lowhung changed the title feat: implement snapshot bootstrapper with cbor download + omnibus ch… feat: implement snapshot download for bootstrapper Nov 24, 2025
@lowhung lowhung requested a review from sandtreader November 24, 2025 19:00
Comment on lines +212 to +214
slot: 0,
number: 0,
hash: BlockHash::default(),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we not know the latest block produced from that restored state? I know the chainsync code needs that to work right, and I suspect other components would as well.

Copy link
Collaborator Author

@lowhung lowhung Nov 25, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good question. I've kept this as a placeholder function for now, but it won't be difficult to implement this properly.

For era we could hardcode it within our pre-existing json config files, or use an era history summary, which keeps track of stability window, each era's start/end bounds and epoch parameters (epoch_size_slots, slot_length). With that you can derive the timestamp, epoch_slot_no etc. We have slot and block_hash as we use those to name our snapshot files and are specified in our config json files.

Amaru constructs an era history summary as a history.{slot}.{hash}.json file, and uses this during their bootstrap process. They actually have some nifty commands, one of which converts ledger state from a DebugEpochState cbor dump (from a cardano-node) into said history file.

But yeh, given a slot, hash, and era history, we can derive everything except block number. Unless I'm missing something 🤔

For mainnet/preprod/preview, era history is fairly static, and can be hardcoded if we wanted to. For testnets, we'd need to include the history file alongside snapshots.

Comment on lines 41 to 58
pub fn try_load(config: &Config) -> Result<Self> {
Ok(Self {
network: config.get_string("network").unwrap_or_else(|_| "mainnet".to_string()),
data_dir: config.get_string("data-dir").unwrap_or_else(|_| "./data".to_string()),
startup_topic: config
.get_string("startup-topic")
.unwrap_or(DEFAULT_STARTUP_TOPIC.to_string()),
snapshot_topic: config
.get_string("snapshot-topic")
.unwrap_or(DEFAULT_SNAPSHOT_TOPIC.to_string()),
bootstrapped_topic: config
.get_string("bootstrapped-subscribe-topic")
.unwrap_or(DEFAULT_BOOTSTRAPPED_TOPIC.to_string()),
completion_topic: config
.get_string("completion-topic")
.unwrap_or(DEFAULT_COMPLETION_TOPIC.to_string()),
})
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we follow the pattern from PeerNetworkInterface, where default config values are stored in a config.default.toml file? Sorry to keep bringing it up, but I think it's really helpful to have a conventional place where you can see a module's default configuration (plus comments about what that configuration does).

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great suggestion, done here 15e382f

Comment on lines +54 to +58
for snapshot_meta in snapshots {
let file_path = snapshot_meta.file_path(&self.network_dir);
self.download_single(&snapshot_meta.url, &file_path).await?;
}
Ok(())
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How big are these files? Would it make sense to parallelize the downloads with try_join_all?

Copy link
Collaborator Author

@lowhung lowhung Nov 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For epochs 507, 508 and 509 they are 1638 MB, 1644 MB, 1645 MB respectively, and it takes ~2-2.5 mins total to download all 3 of them. With that in mind though, I'm fairly confident we will be able to use a single snapshot (based on our conversation with the ledger team) -- it doesn't hurt to still support an array of snapshots to process IMO.

@lowhung lowhung changed the title feat: implement snapshot download for bootstrapper feat: snapshot downloader for bootstrapper Nov 25, 2025
[dev-dependencies]
tempfile = "3.23"
config = { workspace = true }
caryatid_process = { workspace = true }
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cargo shear chore, these are only being used in tests within common/src/resolver.rs

@lowhung lowhung linked an issue Nov 25, 2025 that may be closed by this pull request
14 tasks
use tracing_subscriber::prelude::*;
use tracing_subscriber::{filter, fmt, EnvFilter, Registry};

const STARTUP_METHOD_MITHRIL: &str = "mithril";
Copy link
Collaborator Author

@lowhung lowhung Nov 25, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't love this. I could use a similiar config.default.toml file like we do in the snapshot_bootstrapper/src/configuration.

@lowhung lowhung requested a review from SupernaviX November 25, 2025 17:03
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.

Bootstrap Orchestration

3 participants