You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Address management is actually a really complicated issue.
We can have:
user-given local listen addrs -- the user-given addrs to listen on (these may be unspecified -- /ip4/0.0.0.0/tcp/0)
os assigned local listener addrs-- these are os-assigned version of (1)
interface resolved local listener addrs -- these are per-interface resolved version of (2)
remote peer listen addrs -- the addrs remote peers know they're listening at
observed remote peer addrs -- addrs we've observed the remote peer to dial from (6 + 7)
observed remote peer listen addrs -- subset of (5) that corresponds to addrs in remote's (3)
observed remote peer dial-ephemeral addrs -- addrs in (5-6)
As a node, we should be advertising our own addrs in (3) and those we learn in (6) in the dht. And some of these sets may change over time (i.e. 3 can change as machine interfaces go up and down), be location dependent (5-7), and even go stale quickly (5-7).
The super basic peerstore.AddressBook is really not working well to deal with this level of complexity. It could do a lot of heavy lifting rather than have all this logic spread out all over the codebase (in p2p/net, in routing/dht, in core).
And it likely should be differentiated from peer.Peerstore to avoid baking in the crazy complexity into what's supposed to be a simple object. (peer.Peerstore maybe should just expose an AddressBook() AddressBook)
Activity
jbenet commentedon Mar 28, 2015
this seems to be in a good place now. i'll reopen if needed
Merge pull request ipfs#603 from libp2p/bug/queryeventmerge