Skip to content

PIBD peers fix#3823

Merged
DavidBurkett merged 13 commits into
mimblewimble:masterfrom
ardocrat:pibd_peers_fix
Jun 11, 2026
Merged

PIBD peers fix#3823
DavidBurkett merged 13 commits into
mimblewimble:masterfrom
ardocrat:pibd_peers_fix

Conversation

@ardocrat

@ardocrat ardocrat commented Mar 30, 2026

Copy link
Copy Markdown
Contributor
  • choose peers based on minimal height (minimal 2 blocks behind max tip)
  • temporary block peers for stale segments disconnecting only outbound:
    • 1st time for 1 min.,
    • 2nd time for 3 min.,
    • 3rd time for 10min.
  • force request for output and rangeproof segments to avoid stuck
  • do not check for max cached segments on selecting next desired segment for request (stuck happened when peer got disconnected and we reached max segments cache size, so not tried to make another request).

@syntaxjak

Copy link
Copy Markdown

IMG_5687

@wiesche89 wiesche89 changed the base branch from master to staging May 12, 2026 17:58

@wiesche89 wiesche89 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for working on this. I found three points that I think should be checked before merging.

Comment thread chain/src/txhashset/desegmenter.rs Outdated
Comment thread p2p/src/peers.rs Outdated
Comment thread servers/src/grin/sync/state_sync.rs
Comment thread servers/src/grin/sync/state_sync.rs
Comment thread servers/src/grin/sync/state_sync.rs Outdated
Comment thread servers/src/grin/sync/state_sync.rs Outdated
Comment thread chain/src/types.rs
Comment thread chain/src/txhashset/desegmenter.rs
wiesche89 added a commit to wiesche89/grin that referenced this pull request May 15, 2026
- force request of next required output/rangeproof/kernel segments
- add PIBD peer height slack filtering
- temporarily block peers after PIBD segment timeouts
- disconnect timed-out outbound PIBD peers
- use escalating temporary block durations
- keep existing retry/refresh logic instead of clearing pending requests
@wiesche89 wiesche89 changed the base branch from staging to master May 17, 2026 06:54
@ardocrat ardocrat closed this Jun 11, 2026
@ardocrat ardocrat reopened this Jun 11, 2026
Comment thread servers/src/grin/sync/state_sync.rs
Comment thread chain/src/pibd_params.rs
@DavidBurkett

Copy link
Copy Markdown
Member

The description says “outbound resetting counter after reconnect”... Is that intended? I don’t see reconnect clearing the blocked entry, so outbound peers appear to keep their timeout count until unblock_peers() clears all PIBD blocks.

@ardocrat

Copy link
Copy Markdown
Contributor Author

The description says “outbound resetting counter after reconnect”... Is that intended? I don’t see reconnect clearing the blocked entry, so outbound peers appear to keep their timeout count until unblock_peers() clears all PIBD blocks.

fixed at last commits, fixed description

@DavidBurkett DavidBurkett merged commit 2e0d827 into mimblewimble:master Jun 11, 2026
12 checks passed
wiesche89 added a commit that referenced this pull request Jun 12, 2026
* pibd: bound segment decoding allocations (#3850)

* Add fountainoffairfortune seeds

* Clarifies the blinding factor range proof explanation and includes the remaining typo fixes (#3840)

* Bump version to v5.4.1

* PIBD peers fix (#3823)

* pibd: choose peers based on minimal height, temporary block peers for stale segments disconnecting only outbound, force request for output and rangeproof segments to avoid stuck at this case

* fix: add missing method clear_pibd_requests to commit

* peer: block only non-blocked to not increase times for several requests

* p2p: ignore last connection attempt when there is not enough outbound peers

* pibd: do not check for max cached segments on selecting next desired segment for request

* pibd: check if segment not exists at request when selecting next required

* fix: add segment to request if not exists

* fix: peers iterator to unblock blocked

* peers: keep blocked list into memory till restart or pibd finish

* sync: blocked filter

* lmdb: do not include blocked peers in selection of peer, count also blocked peers to use fallback .zip download

* pibd: increase timeout for .zip fallback

* merge master into staging

---------

Co-authored-by: David Burkett <davidburkett38@gmail.com>
Co-authored-by: ardocrat <ardocrat@gri.mw>
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.

4 participants