Skip to content

Add aptos-waypoint-extractor: parallel epoch-chain verification and waypoint output - #444

Open
movement-sm wants to merge 3 commits into
m1from
feat/waypoint-extractor
Open

movement-sm wants to merge 3 commits into
m1from
feat/waypoint-extractor

Conversation

@movement-sm

@movement-sm movement-sm commented Oct 30, 2026 •

Copy link
Copy Markdown
Collaborator

Adds aptos-waypoint-extractor (storage/backup/waypoint-extractor/): it extracts every epoch-ending ledger info from a node's backup service, verifies the chain from a trusted waypoint in parallel, and prints verified waypoints. New nodes can then start from a recent waypoint instead of walking the full epoch chain (Movement mainnet is at ~10.8M epochs).

What it does

  • Fetches /epoch_ending_ledger_infos/<start>/<end> in concurrent range requests, so download overlaps verification. Each range also fetches its predecessor epoch, so chunks verify independently.
  • Verifies signatures on rayon across all cores against the previous epoch's next_epoch_state, caching the aggregated key per validator set.
  • Then links the chain in order: contiguous epochs, rising versions, and the first ledger info matching the trusted waypoint.
  • Treats a short response from the backup service as an error, not a shorter chain.
  • Prints the latest verified version:hash. Optionally writes <epoch> <waypoint> lines every N epochs, so later runs can start from an earlier result.
  • Depends only on light crates (aptos-types, aptos-crypto, bcs, rayon, tokio, reqwest), with no aptos-db.

Image

  • Build Version gains an aptos-waypoint-extractor binary and a ghcr.io/movement-network/aptos-waypoint-extractor container job.
  • The Dockerfile in docker/aptos-waypoint-extractor/ mirrors aptos-debugger's.

Tests

  • cargo test -p aptos-waypoint-extractor --release: 23 passed, 1 ignored (the throughput benchmark).
  • Valid chains with rotating validator sets.
  • Invalid chains: bad, missing or insufficient signatures; gaps; the wrong validator set; a waypoint mismatch; ledger infos that don't end an epoch; version regressions; empty validator sets.
  • Tampered chunk boundaries.
  • Framing, and an end-to-end run over a localhost HTTP mock.
  • Clippy is clean for the crate.

Not yet verified

  • No run against a real backup service.
  • The local Docker build wasn't run: this machine has no buildx. CI builds the image.
  • Booting a node from the output also needs the fork's state_sync.state_sync_driver.start_epoch set to the waypoint's epoch, as well as base.waypoint. The README covers it. A testnet trial comes next.

🤖 Generated with Claude Code


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.

movement-sm and others added 3 commits October 30, 2026 12:29
…a backup service

Fetches epoch-ending ledger infos over the backup service HTTP API in many
concurrent range requests, verifies each against its predecessor's next epoch
state on all cores, links the chunks sequentially from a trusted waypoint and
emits verified waypoints. Includes unit tests and a mock-server HTTP test.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@movement-sm
movement-sm requested a review from Primata as a code owner October 30, 2026 19:33
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.

1 participant