mirror of
https://github.com/logos-messaging/logos-delivery.git
synced 2026-07-26 06:23:14 +00:00
PX serves ENRs from the add-only PeerStore ENRBook, whose only liveness gate was CannotConnect. Disconnected/never-dialed discv5 peers stayed NotConnected and were advertised indefinitely (#3933). Instead of deleting peer-store state against the bounded discv5 routing table (which can false-prune a live peer evicted from a full k-bucket), track an ENR last-seen Moment and gate the PX read path on it: - EnrLastSeenBook + EnrFreshnessTTL; touchEnrSeen stamps freshness. - Refresh-only liveness: stamped on ENR (re)write, on connect, and from the revalidated routing table each discv5 round. Membership never deletes state, so a live-but-bucket-evicted peer just ages out of PX rather than being purged. - getEnrsFromStore skips non-Connected ENRs older than the TTL; a Connected peer is always considered fresh. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>