Skip to content

perf(share/discovery): Exponential backoff on peer loss - #5155

Draft
renaynay wants to merge 1 commit into
celestiaorg:feature/shrex-eds-optimisationfrom
renaynay:rene/exponential-disc-backoff
Draft

perf(share/discovery): Exponential backoff on peer loss#5155
renaynay wants to merge 1 commit into
celestiaorg:feature/shrex-eds-optimisationfrom
renaynay:rene/exponential-disc-backoff

Conversation

@renaynay

@renaynay renaynay commented Aug 5, 2026

Copy link
Copy Markdown
Member

Replaces the fixed 10m discovery backoff with an exponential one: 10s doubling to a 10m cap. A peer lost transiently is re-dialable in 10s instead of being locked out for 10 minutes, which keeps the discovered peer pool from shrinking during EDS sync.

Part of PROTOCO-2120

Replaces the fixed 10m discovery backoff with an exponential one:
10s doubling to a 10m cap. A peer lost transiently is re-dialable in
10s instead of being locked out for 10 minutes, which keeps the
discovered peer pool from shrinking during EDS sync.

Two supporting changes are required for the escalation to be real:

- GC retains a peer's cache entry for maxBackoff past its expiry.
  Deleting on expiry (as before) destroyed the BackoffStrategy holding
  the attempt counter, so growth never survived a 60s GC tick.
- A successful dial resets the accumulated delay, so growth tracks
  failures only and does not penalize peers churned by ConnManager or
  closed by the remote side.

NoJitter is used rather than FullJitter: the latter draws uniformly in
[min, computed), so a peer at the 10m cap could be handed a 10s delay.

Part of PROTOCO-2120.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 92.85714% with 1 line in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (feature/shrex-eds-optimisation@f767ee8). Learn more about missing BASE report.

Files with missing lines Patch % Lines
share/shwap/p2p/discovery/backoff.go 92.85% 1 Missing ⚠️
Additional details and impacted files
@@                        Coverage Diff                        @@
##             feature/shrex-eds-optimisation    #5155   +/-   ##
=================================================================
  Coverage                                  ?   37.29%           
=================================================================
  Files                                     ?      311           
  Lines                                     ?    21597           
  Branches                                  ?        0           
=================================================================
  Hits                                      ?     8055           
  Misses                                    ?    12531           
  Partials                                  ?     1011           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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