-
Notifications
You must be signed in to change notification settings - Fork 221
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
Increased ProviderAddrTTL from RFM17.1 isn't applied #868
Comments
This is how it worked initially: 3b37c43 for _, pi := range pinfos {
if pi.ID != p {
// we should ignore this provider reccord! not from originator.
// (we chould sign them and check signature later...)
log.Errorf("handleAddProvider received provider %s from %s. Ignore.", pi.ID, p)
continue
}
if len(pi.Addrs) < 1 {
log.Errorf("got no valid addresses for provider %s. Ignore.", p)
continue
}
log.Infof("received provider %s for %s (addrs: %s)", p, key, pi.Addrs)
for _, maddr := range pi.Addrs {
// add the received addresses to our peerstore.
dht.peerstore.AddAddress(p, maddr)
}
dht.providers.AddProvider(key, p)
} That's where it capsized: 7724838 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Looking through the code, I believe that the increased
ProviderAddrTTL
doesn’t have any effect. We increased that value as a result of RFM 17.1.In this line we pass the new provider of a certain key to the
ProviderManager
:The value that we're passing is just
peer.AddrInfo{ID: p}
, so there are no addresses attached to it. In theProviderManger
this value gets handledhere
:provInfo
is thepeer.AddrInfo{ID: p}
from above. This means theAddrs
field will be always empty, so, I believe,ProviderAddrTTL
won't have any effect.However, we're still keeping the addresses around for a bit because the peer that stores the records with us gets added to the peerstore just because it connected to us - the TTL of their addresses will just be different. I think the values are
ConnectedAddrTTL
while we're connected to that peer (basically infinite TTL) andTempAddrTTL
after we have disconnected. The latter value is set to 2 minutes.cc @cortze
The text was updated successfully, but these errors were encountered: