-
Notifications
You must be signed in to change notification settings - Fork 159
add: p2p suffixes to multiaddrs from identify #110
Conversation
not verified but indirectly used by the conformance tests when dialing a peer with an expected peerid.
1d821fe
to
3f743f2
Compare
Yoink! Assuming control of this one 😄. Since we can now connect using |
I don't think I can approve this, please do so @ljedrz. The conformance test failure was:
Not yet sure what this is. Ok so the first one expects that after disconnect the peer disappears immediatedly. I wonder if I missed this change in #303, I did try to add warnings around it when I last wasted time on it.... Nope, the warning is still in place. The second test should not be enabled at all... Though I do think there should not be that error though. |
I'll check if I'm seeing those locally. |
Signed-off-by: ljedrz <ljedrz@gmail.com>
Signed-off-by: ljedrz <ljedrz@gmail.com>
Signed-off-by: ljedrz <ljedrz@gmail.com>
a48ff24
to
eb88977
Compare
Ok, so this initially simple change has led to some more serious stuff after all. A bit of an explanation first: the conformance suite uses Since we have been planning to disallow connecting to a
Also, as a drive-by, |
…P2p in IpfsEvents Signed-off-by: ljedrz <ljedrz@gmail.com>
d9f3dfc
to
2c4fbe8
Compare
Comments addressed 👌. |
let peer_id = public_key.clone().into_peer_id(); | ||
|
||
for addr in &mut addresses { | ||
addr.push(Protocol::P2p(peer_id.clone().into())) |
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.
now that this is done here I wonder how should it be reflected in the return type (if at all) -- probably not, since there's no way to go from peerid -> publickey.
If this is moved here I think it should def be taken into account on this method doc, as it might be quite surprising for going in the other direction as rust-libp2p in general by appending the peer id. If we decide to keep this at this level (in ipfs::Ipfs::identity
) we should get rid of the http append_p2p impl as well.
My reason for adding this initially only on http level was to keep the "rust stuff" aligned to rust-libp2p and only at http level "be like rest of ipfs."
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.
so I guess the decision is: do we keep aligning to rust-libp2p or not? I don't think there are many places where libp2p can leak but the decision around this seems unavoidable. ConnectionTarget may had been a path towards unifying and accepting both.
(PeerId, Multiaddr)
with runtime check that the multiaddr doesnt end inp2p/peer_id
Multiaddr
with runtime check to make sure it ends inp2p/peer_id
I am not actually sure if it's possible to filter out the end. relay addresses look at the moment like: (/ip4/7.7.7.7/tcp/55555/p2p/QmRelay)?/p2p-circuit/p2p/QmAlice
(regexified by me to signal that it might be missing) which means that it is in fact possible to filter regarding the tail since there's the /p2p-circuit/
in between.
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.
Chatted about this: going ahead with Multiaddr with runtime checks here, upgrading those to MultiaddrWithPeerId and MultiaddrWithoutPeerId in a follow-up to centralize conversions and checks.
Signed-off-by: ljedrz <ljedrz@gmail.com>
Signed-off-by: ljedrz <ljedrz@gmail.com>
Signed-off-by: ljedrz <ljedrz@gmail.com>
As chatted lets go ahead with this one, transition towards |
oops forgot: bors r+ |
Build succeeded: |
not verified but indirectly used by the conformance tests when dialing a peer with an expected peerid.
Not 100% sure if this should be done, at least long as #105 is done at least to accept the multiaddrs with
/p2p/
.