Skip to content

Improve PIHD sync and PIBD segment handling#3835

Open
wiesche89 wants to merge 5 commits into
mimblewimble:stagingfrom
wiesche89:staging
Open

Improve PIHD sync and PIBD segment handling#3835
wiesche89 wants to merge 5 commits into
mimblewimble:stagingfrom
wiesche89:staging

Conversation

@wiesche89
Copy link
Copy Markdown
Contributor

@wiesche89 wiesche89 commented May 16, 2026

Description

This PR adds PIHD (Parallel Initial Header Download) header segment sync support and hardens PIBD segment handling during initial sync.
It also incorporates the relevant PIBD fixes from @ardocrat #3823, including improved segment request selection, peer height slack handling, timeout handling, and safer retry behavior.

Main changes:

  • Add PIHD header segment sync flow
  • Improve PIBD segment selection and validation
  • Avoid requesting output/rangeproof/kernel segments before the required bitmap state is available
  • Track rejected PIBD segments and handle timed-out peers more defensively
  • Improve PIHD/PIBD sync logging for start, abort/fallback, and completion

Compatibility

Legacy header sync and existing fallback behavior remain available for peers that do not support PIHD/PIBD.

Testing

Tested locally on testnet with fresh sync runs.
Tested in testnet farm with grafana.
reachable gateway node grinffindor.org with port 23414, please sync :)

Also verified:

  • PIHD starts and completes
  • PIBD starts and progresses through segment download and validation
  • Invalid/unusable PIBD data is rejected earlier
  • Fallback paths remain available

Related Issues

*Fixes #3830
*Partially addresses #3082
*Partially addresses #3289
*Related to #3083
*Related to #3767
*Related to #3292

@wiesche89 wiesche89 requested a review from ardocrat May 16, 2026 06:15
Comment thread servers/src/grin/seed.rs Outdated
@wiesche89 wiesche89 requested a review from ardocrat May 18, 2026 18:00
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.

2 participants