-
Notifications
You must be signed in to change notification settings - Fork 55
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
Create an ObservedAddrManager and add an AddressMapper in AutonatService and AutoRelayService #871
Conversation
Co-authored-by: diegomrsantos <diego@status.im>
# Conflicts: # libp2p/connmanager.nim # libp2p/protocols/connectivity/autonat/service.nim # tests/testconnmngr.nim
88f3ae2
to
4fc7b6d
Compare
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.
We will also have to check what impact this has on the existing addressMapper in waku
# Conflicts: # libp2p/peerstore.nim
5d1b04a
to
7cb27cc
Compare
73a46a1
to
f4b34f2
Compare
let observedAddrManager = ObservedAddrManager.new(minCount = 3) | ||
|
||
# Calculate the most oberserved IP4 correctly | ||
let mostObservedIP4AndPort = MultiAddress.init("/ip4/1.2.3.0/tcp/1").get() |
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.
Can you test with invalid multiaddresses, seems like it will crash
libp2p/peerstore.nim
Outdated
## Returns the most observed IP address or none if the number of observations are less than minCount. | ||
return self.identify.getMostObservedIP(ipVersion) | ||
|
||
proc replaceMAIpByMostObserved*( |
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.
Why is this here?
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.
It is used by guessDialableAddrs
which is used in hpservice and the dcutr server.
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.
Sure, but this is unrelated to the peer store
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.
Where would you add it? I think it is related to the observed addresses.
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.
ObservedAddressManager?
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.
done
ObservedAddrManager
which keeps track of the most observed addresses reported by remote peers.AddressMapper
inAutonatService
which tries to identify the peer public IP/Port when there's a manual port forward configured.AddressMapper
inAutonRelayService
which adds the relayed address.