mirror of
https://github.com/logos-messaging/logos-delivery.git
synced 2026-07-22 20:50:22 +00:00
Peer-exchange responds with ENRs read from the PeerStore ENRBook, which is fed add-only by the discv5 search loop and only pruned on capacity, never on staleness. discv5 revalidates its routing table and evicts unreachable nodes within seconds, but those evictions were not propagated to the peer store, so PX kept advertising ENRs of dead peers (only peers we personally failed to dial -> CannotConnect were skipped; disconnected peers are CanConnect and discovered-but-unconnected peers are NotConnected, both of which were still served). Reconcile the peer store against the live routing table at the end of each discv5 search iteration: drop Discv5-origin, non-connected peers that discv5 no longer knows about. Peers discovered in the same round are preserved. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>