fix(peer-store): copy observation times from the matching address#3574
Merged
tabcat merged 3 commits intoJul 17, 2026
Conversation
The lookup callback shadowed the address being stamped, so every address inherited the first stored address's observation time instead of its own.
tabcat
marked this pull request as ready for review
July 17, 2026 22:11
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Each stored address is stamped with an
observedtimestamp, copied from thematching existing address so a re-stored address keeps its original time. The
lookup for the matching address named its callback parameter
addr, shadowingthe address being stamped, so it compared an address to itself and always
matched the first stored address. Every address therefore inherited the first
stored address's
observedtime instead of its own, so a newly added multiaddrcould be expired early by
maxAddressAgedespite having just been observed.Rename the callback parameter so the lookup matches by multiaddr.
Change checklist