Skip to content

streamsync: speed up stream rediscovery and recover faster from local outages - #5091

Draft
GheisMohammadi wants to merge 1 commit into
devfrom
enhance/streamsync
Draft

streamsync: speed up stream rediscovery and recover faster from local outages#5091
GheisMohammadi wants to merge 1 commit into
devfrom
enhance/streamsync

Conversation

@GheisMohammadi

Copy link
Copy Markdown
Collaborator

This PR Improves stream sync recovery when peers drop or the node briefly loses network, so sync can restart without long stalls or a process restart.

What changed

  • Lower mainnet peer floors so sync can start with fewer streams (MinPeers=4, boot InitStreams=5, hard/soft discovery caps aligned).
  • Shorter recovery timers: discovery watchdog 30m (was 75m), max removal cooldown 15m (was 60m).
  • Advertise timing: use MaxAdvertiseWaitTime (mainnet 15m) as the real cap between advertise cycles.
  • Fix DHT skip race: wait for trusted streams to actually register before skipping DHT discovery.
  • Mass-disconnect detection: if many streams die quickly, treat it as a local network outage, allow fast reconnect for connection-loss failures, then rediscover after a short holdoff.
  • Keep punishing bad peers: protocol/bad-data removals still get full critical cooldowns, even during a local outage; local-outage mode is also rate-limited (once per 10m).

How this helps

  • Faster recovery after brief internet drops or peer flaps, without waiting over an hour for watchdog/cooldowns.
  • Better discovery by not skipping DHT too early and by advertising more often when needed.
  • Safer stream failure handling by distinguishing connection-loss from malicious/buggy peer behavior.

@GheisMohammadi GheisMohammadi self-assigned this Jul 31, 2026
@GheisMohammadi
GheisMohammadi marked this pull request as draft July 31, 2026 16:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant