-
Notifications
You must be signed in to change notification settings - Fork 746
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
Upgrade libp2p to 0.52.4 #1631
Upgrade libp2p to 0.52.4 #1631
Conversation
Co-authored-by: Anton <anton.kalyaev@gmail.com>
Recent optimization in `V1Lazy` caused syncing to stall if if a request was sent to a peer who didn't support the request-response protocol.
Addresses getting removed from Kademlia for completely innocuous reasons such as keep-alive timeouts are causing the node to have a lot of dial failures. The dial failures happen because when `ProtocolController` tries to connect to a node, and when the address is trying to be fetched from from `Discovery`, it returns an empty vector since `Kademlia` no longer holds any addresses for the peer.
bot fmt |
@altonen https://gitlab.parity.io/parity/mirrors/polkadot-sdk/-/jobs/3740116 was started for your command Comment |
@altonen Command |
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.
Looks good! Could you remind why we had to comment-out the tests in Notifications
?
Co-authored-by: Dmitry Markin <dmitry@markin.tech>
This libp2p upgrade updates
This can also be reproduced if |
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.
Looking forward for this to land. Ping me if you need any help!
@altonen it appears that the |
This PR is now a security issue due to dalek-cryptography/curve25519-dalek#659 |
Thanks for reporting! Bumped |
The CI pipeline was cancelled due to failure one of the required jobs. |
Co-authored-by: Bastian Köcher <git@kchr.de>
self.identify.on_swarm_event(FromSwarm::NewExternalAddrCandidate(e)); | ||
|
||
// Manually confirm all external address candidates. | ||
// TODO: consider adding [AutoNAT protocol](https://docs.rs/libp2p/0.52.3/libp2p/autonat/index.html) |
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.
This sounds like a good proposal, do we have an issue for this?
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.
I'm not 100% sure we need it — this would change the polkadot protocol, and at the same time we are able to detect external addresses with the heuristic litep2p uses: if the address is reported by 3 or more peers, it's considered external.
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.
May be we can create an issue for implementing this heuristic with libp2p backend, but I don't think it's a high priority. And we would need to handle Identify
protocol events directly instead of using libp2p mechanism of external address detection, if we go this route.
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! Nicely done here 🚀
great work folks! 🚀 hopefully the upgrade to |
…ritytech#4198) This PR introduces custom types / substrate wrappers for `Multiaddr`, `multiaddr::Protocol`, `Multihash`, `ed25519::*` and supplementary types like errors and iterators. This is needed to unblock `libp2p` upgrade PR paritytech#1631 after paritytech#2944 was merged. `libp2p` and `litep2p` currently depend on different versions of `multiaddr` crate, and introduction of this "common ground" types is needed to support independent version upgrades of `multiaddr` and dependent crates in `libp2p` & `litep2p`. While being just convenient to not tie versions of `libp2p` & `litep2p` dependencies together, it's currently not even possible to keep `libp2p` & `litep2p` dependencies updated to the same versions as `multiaddr` in `libp2p` depends on `libp2p-identity` that we can't include as a dependency of `litep2p`, which has it's own `PeerId` type. In the future, to keep things updated on `litep2p` side, we will likely need to fork `multiaddr` and make it use `litep2p` `PeerId` as a payload of `/p2p/...` protocol. With these changes, common code in substrate uses these custom types, and `litep2p` & `libp2p` backends use corresponding libraries types.
Upgrade libp2p to 0.52.4, including a fix: * Set Kademlia to server mode (paritytech/substrate#14703) ### TODO - [x] Fix 3 zombienet tests failing: - [x] `zombienet-substrate-0002-validators-warp-sync` - [ ] ~`zombienet-polkadot-functional-0005-parachains-disputes-past-session`~ The test is also flaky in other PRs and is not required for CI to succeed. - [x] `zombienet-polkadot-functional-0009-approval-voting-coalescing` - [x] Uncomment and update to the actual libp2p API tests in [`substrate/client/network/src/protocol/notifications/handler.rs`](https://github.com/paritytech/polkadot-sdk/blob/7331f1796f1a0b0e9fb0cd7bf441239ad9664595/substrate/client/network/src/protocol/notifications/handler.rs#L1009). - [x] When upgrading `multihash` crate as part of libp2p upgrade to version v0.19.1, uncomment the conversion code at https://github.com/paritytech/polkadot-sdk/blob/7547c4942a887029c11cbcfd5103f6d8315ab95c/substrate/client/network/types/src/multihash.rs#L159 - [x] Perform a burn-in. --------- Co-authored-by: Anton <anton.kalyaev@gmail.com> Co-authored-by: command-bot <> Co-authored-by: Dmitry Markin <dmitry@markin.tech> Co-authored-by: Bastian Köcher <git@kchr.de>
Upgrade libp2p to 0.52.4, including a fix: * Set Kademlia to server mode (paritytech/substrate#14703) ### TODO - [x] Fix 3 zombienet tests failing: - [x] `zombienet-substrate-0002-validators-warp-sync` - [ ] ~`zombienet-polkadot-functional-0005-parachains-disputes-past-session`~ The test is also flaky in other PRs and is not required for CI to succeed. - [x] `zombienet-polkadot-functional-0009-approval-voting-coalescing` - [x] Uncomment and update to the actual libp2p API tests in [`substrate/client/network/src/protocol/notifications/handler.rs`](https://github.com/paritytech/polkadot-sdk/blob/7331f1796f1a0b0e9fb0cd7bf441239ad9664595/substrate/client/network/src/protocol/notifications/handler.rs#L1009). - [x] When upgrading `multihash` crate as part of libp2p upgrade to version v0.19.1, uncomment the conversion code at https://github.com/paritytech/polkadot-sdk/blob/7547c4942a887029c11cbcfd5103f6d8315ab95c/substrate/client/network/types/src/multihash.rs#L159 - [x] Perform a burn-in. --------- Co-authored-by: Anton <anton.kalyaev@gmail.com> Co-authored-by: command-bot <> Co-authored-by: Dmitry Markin <dmitry@markin.tech> Co-authored-by: Bastian Köcher <git@kchr.de>
Upgrade libp2p to 0.52.4, including a fix:
TODO
zombienet-substrate-0002-validators-warp-sync
The test is also flaky in other PRs and is not required for CI to succeed.zombienet-polkadot-functional-0005-parachains-disputes-past-session
zombienet-polkadot-functional-0009-approval-voting-coalescing
substrate/client/network/src/protocol/notifications/handler.rs
.multihash
crate as part of libp2p upgrade to version v0.19.1, uncomment the conversion code atpolkadot-sdk/substrate/client/network/types/src/multihash.rs
Line 159 in 7547c49