-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve observed address handling #585
Conversation
allocates and eats a lot of cpu time under the lock; let a background worker gc periodically.
I think we can improve further by using a read/write lock, as there is now a single writer and many readers. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. We may want to expose this information via an atomically updating snapshot but we can do that later.
p2p/protocol/identify/obsaddr.go
Outdated
oas := &ObservedAddrSet{ | ||
addrs: make(map[string][]*ObservedAddr), | ||
ttl: pstore.OwnObservedAddrTTL, | ||
wch: make(chan newObservation, 1), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's make this longer, like 64 or something (or at least 16). We want as many observed addrs as we can on initial start.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, will set to 16 (= 4 * activation-threshold)
Overhauls the observed address set to be more friendly to relays:
Closes #584