Skip to content

fix(ergo-sync): snapshot-bootstrap manifest liveness + latched chunk target - #220

Merged
arkadianet merged 1 commit into
mainfrom
fix/snapshot-bootstrap-manifest-liveness
Jul 18, 2026
Merged

fix(ergo-sync): snapshot-bootstrap manifest liveness + latched chunk target#220
arkadianet merged 1 commit into
mainfrom
fix/snapshot-bootstrap-manifest-liveness

Conversation

@arkadianet

Copy link
Copy Markdown
Owner

Follow-up to #213 (CodeRabbit findings #9, #10) — behavioral fixes deliberately kept out of the mechanical split.

Changes (snapshot_bootstrap/manifest.rs)

#10on_peer_disconnect immediate pending-request cleanup. If the departing peer owns the outstanding GetManifest, drop it now (evict + recompute) instead of waiting out MANIFEST_REQUEST_TIMEOUT (30s). A dead peer never replies, so the timeout only stalls rotation. Non-owner disconnects leave the pending request intact.

#9 — discovery gating + latched chunk target.

  • should_query now suppresses GetSnapshotsInfo on Selected or beyond (ManifestRequested / ManifestVerified), not only Selected — past selection the download phase owns the flow.
  • voters_for_selected_manifest targets the latched manifest (verified > pending > selected) via new latched_target(), so a post-verification vote change can't repoint chunk requests away from the verified manifest.

Validation

  • 4 new unit tests; ergo-sync suite 199 → 203 (55 in snapshot_bootstrap).
  • cargo clippy -p ergo-sync --all-targets --all-features -D warnings clean, cargo fmt --check clean.

🤖 Generated with Claude Code

…target

Two Mode-2 UTXO-snapshot bootstrap fixes (CodeRabbit review on #213):

- on_peer_disconnect: if the departing peer owns the outstanding
  GetManifest, drop the request immediately (evict + recompute) instead
  of waiting out MANIFEST_REQUEST_TIMEOUT (30s). A dead peer never
  replies, so the timeout only stalls rotation to another voter.
  Non-owner disconnects still leave the pending request intact.

- should_query: suppress GetSnapshotsInfo fan-out once discovery has
  produced a selection — Selected *or beyond* (ManifestRequested /
  ManifestVerified), not only Selected. Past selection the download
  phase owns the flow; querying a newly-seen peer would reopen a
  decision already made.

- voters_for_selected_manifest: target the latched manifest (verified >
  pending > selected) via new latched_target(), so a post-verification
  vote change can't repoint chunk requests away from the manifest whose
  bytes we already verified.

4 new unit tests; ergo-sync suite 199 -> 203 (55 snapshot_bootstrap).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kw7uCwqmiGna8fpg6TvxGi
@coderabbitai

coderabbitai Bot commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

@arkadianet, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 46 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 1fee873e-5b61-4a10-a483-7af082c9d68a

📥 Commits

Reviewing files that changed from the base of the PR and between f4ff832 and 9314b3c.

📒 Files selected for processing (2)
  • ergo-sync/src/snapshot_bootstrap/manifest.rs
  • ergo-sync/src/snapshot_bootstrap/tests.rs
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/snapshot-bootstrap-manifest-liveness

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@arkadianet
arkadianet marked this pull request as ready for review July 18, 2026 02:50
@arkadianet
arkadianet merged commit ad125d5 into main Jul 18, 2026
8 of 9 checks passed
@arkadianet
arkadianet deleted the fix/snapshot-bootstrap-manifest-liveness branch July 18, 2026 02:50
@arkadianet arkadianet mentioned this pull request Jul 18, 2026
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