forked from cerc-io/stack-orchestrator
feat: rolling incremental snapshot download loop
After the full snapshot downloads, continuously re-probe all fast sources for newer incrementals until the best available is within convergence_slots (default 500) of head. Each iteration finds the highest-slot incremental matching our full snapshot's base slot, downloads it (replacing any previous), and checks the gap to mainnet head. - Extract probe_incremental() from inline re-probe code - Add convergence_slots param to download_best_snapshot() (default 500) - Add --convergence-slots CLI arg - Pass SNAPSHOT_CONVERGENCE_SLOTS env var from entrypoint.py Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
1 parent
bd38c1b791
commit
bfde58431e
2 files changed
+122
-33
No files matched your search
@@ -158,7 +158,8 @@ def maybe_download_snapshot(snapshots_dir: str) -> None:
|
||||
sys.path.insert(0, str(script_dir))
|
||||
from snapshot_download import download_best_snapshot
|
||||
|
||||
ok = download_best_snapshot(snapshots_dir)
|
||||
convergence = int(env("SNAPSHOT_CONVERGENCE_SLOTS", "500"))
|
||||
ok = download_best_snapshot(snapshots_dir, convergence_slots=convergence)
|
||||
if not ok:
|
||||
log.error("Snapshot download failed — starting without fresh snapshot")
|
||||
|
||||
|
||||
Reference in new issue
Block a user