Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Upgrade to libp2p 0.44.0 #11009

Merged
merged 30 commits into from Apr 29, 2022
Merged

Upgrade to libp2p 0.44.0 #11009

merged 30 commits into from Apr 29, 2022

Conversation

kpp
Copy link
Contributor

@kpp kpp commented Mar 10, 2022

polkadot companion: paritytech/polkadot#5414
cumulus companion: paritytech/cumulus#1221

  • What does it do?

Updates libp2p to 0.44.0

Fixes #11007
Fixes #10370

@kpp kpp added A3-in_progress Pull request is in progress. No review needed at this stage. B0-silent Changes should not be mentioned in any release notes labels Mar 10, 2022
@kpp kpp added this to Triage in Networking (Outdated) via automation Mar 10, 2022
@github-actions github-actions bot added A0-please_review Pull request needs code review. and removed A3-in_progress Pull request is in progress. No review needed at this stage. labels Mar 10, 2022
@kpp kpp added the C1-low PR touches the given topic and has a low impact on builders. label Mar 15, 2022
@kpp kpp added the D3-trivial 🧸 PR contains trivial changes in a runtime directory that do not require an audit label Mar 15, 2022
@kpp kpp changed the title [WIP] update to libp2p 0.43.0 Upgrade to libp2p 0.43.0 Mar 15, 2022
Copy link
Contributor

@mxinden mxinden left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just one comment. Otherwise this looks good to me.

client/network/src/discovery.rs Outdated Show resolved Hide resolved
@kpp
Copy link
Contributor Author

kpp commented Mar 22, 2022

impl NetworkBehaviour for Notifications should be reviewed too.

@kpp
Copy link
Contributor Author

kpp commented Mar 22, 2022

Should inject_listen_failure be reviewed too?..

@kpp kpp changed the title Upgrade to libp2p 0.43.0 Upgrade to libp2p 0.44.0 Apr 14, 2022
@@ -61,12 +61,12 @@ unsigned-varint = { version = "0.6.0", features = [
"asynchronous_codec",
] }
void = "1.0.2"
zeroize = "1.5.4"
libp2p = "0.40.0"
zeroize = "1.4.3"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

zeroize is downgraded because libp2p-noise:0.35.0 depends on snow:0.9.0 which depends on chacha20poly1305:0.9.0 which depends on zeroize ">=1, < 1.5"

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But can we not just have different versions of zeroize?

Copy link
Contributor Author

@kpp kpp Apr 18, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I couldn't make it work.

-zeroize = "1.4.3"
+zeroize = "=1.5.4"

Gives this error:

error: failed to select a version for `zeroize`.
    ... required by package `chacha20poly1305 v0.9.0`
    ... which satisfies dependency `chacha20poly1305 = "^0.9"` of package `snow v0.9.0`
    ... which satisfies dependency `snow = "^0.9.0"` of package `libp2p-noise v0.35.0`
    ... which satisfies dependency `libp2p-noise = "^0.35.0"` of package `libp2p v0.44.0`
    ... which satisfies dependency `libp2p = "^0.44.0"` of package `sc-authority-discovery v0.10.0-dev (/home/kpp/parity/substrate/client/authority-discovery)`
    ... which satisfies path dependency `sc-authority-discovery` (locked to 0.10.0-dev) of package `node-cli v3.0.0-dev (/home/kpp/parity/substrate/bin/node/cli)`
    ... which satisfies path dependency `node-cli` (locked to 3.0.0-dev) of package `chain-spec-builder v2.0.0 (/home/kpp/parity/substrate/bin/utils/chain-spec-builder)`
versions that meet the requirements `>=1, <1.5` are: 1.4.3, 1.4.2, 1.4.1, 1.4.0, 1.3.0, 1.2.0, 1.1.1, 1.1.0, 1.0.0

all possible versions conflict with previously selected packages.

  previously selected package `zeroize v1.5.4`
    ... which satisfies dependency `zeroize = "=1.5.4"` of package `sc-network v0.10.0-dev (/home/kpp/parity/substrate/client/network)`
    ... which satisfies path dependency `sc-network` (locked to 0.10.0-dev) of package `beefy-gadget v4.0.0-dev (/home/kpp/parity/substrate/client/beefy)`
    ... which satisfies path dependency `beefy-gadget` (locked to 4.0.0-dev) of package `beefy-gadget-rpc v4.0.0-dev (/home/kpp/parity/substrate/client/beefy/rpc)`
    ```

Copy link
Member

@bkchr bkchr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Most of the stuff looks reasonable, but I'm mainly trusting here @mxinden

client/telemetry/src/transport.rs Outdated Show resolved Hide resolved
@@ -32,7 +32,7 @@ substrate-bip39 = { version = "0.4.4", optional = true }
tiny-bip39 = { version = "0.8.2", optional = true }
regex = { version = "1.5.4", optional = true }
num-traits = { version = "0.2.8", default-features = false }
zeroize = { version = "1.5.4", default-features = false }
zeroize = { version = "1.4.3", default-features = false }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I read your other comment, but why do we need to downgrade here as well?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

error: failed to select a version for zeroize.
    ... required by package chacha20poly1305 v0.9.0
    ... which satisfies dependency chacha20poly1305 = "^0.9" of package snow v0.9.0
    ... which satisfies dependency snow = "^0.9.0" of package libp2p-noise v0.35.0
    ... which satisfies dependency libp2p-noise = "^0.35.0" of package libp2p v0.44.0
    ... which satisfies dependency libp2p = "^0.44.0" of package sc-authority-discovery v0.10.0-dev (/home/kpp/parity/substrate/client/authority-discovery)
    ... which satisfies path dependency sc-authority-discovery (locked to 0.10.0-dev) of package node-cli v3.0.0-dev (/home/kpp/parity/substrate/bin/node/cli)
    ... which satisfies path dependency node-cli (locked to 3.0.0-dev) of package chain-spec-builder v2.0.0 (/home/kpp/parity/substrate/bin/utils/chain-spec-builder)
versions that meet the requirements >=1, <1.5 are: 1.4.3, 1.4.2, 1.4.1, 1.4.0, 1.3.0, 1.2.0, 1.1.1, 1.1.0, 1.0.0

all possible versions conflict with previously selected packages.

  previously selected package zeroize v1.5.4
    ... which satisfies dependency zeroize = "^1.5.4" of package sc-network v0.10.0-dev (/home/kpp/parity/substrate/client/network)
    ... which satisfies path dependency sc-network (locked to 0.10.0-dev) of package beefy-gadget v4.0.0-dev (/home/kpp/parity/substrate/client/beefy)
    ... which satisfies path dependency beefy-gadget (locked to 4.0.0-dev) of package beefy-gadget-rpc v4.0.0-dev (/home/kpp/parity/substrate/client/beefy/rpc)

failed to select a version for zeroize which could resolve this conflict

@tomaka
Copy link
Contributor

tomaka commented Apr 26, 2022

The conflicts need to be resolved

@kpp
Copy link
Contributor Author

kpp commented Apr 26, 2022

@tomaka done

@bkchr
Copy link
Member

bkchr commented Apr 27, 2022

@kpp could you create a polkadot companion? Should be only for fixing zeroize.

@kpp
Copy link
Contributor Author

kpp commented Apr 28, 2022

@bkchr it worked for polkadot, but not for cumulus. There is some CI magic I am not familiar with.

@bkchr bkchr merged commit 95067cc into master Apr 29, 2022
Networking (Outdated) automation moved this from Triage to Done Apr 29, 2022
@bkchr bkchr deleted the kpp-libp2p-0.43 branch April 29, 2022 08:49
godcodehunter pushed a commit to sensoriumxr/substrate that referenced this pull request Jun 22, 2022
* Update libp2p to 0.43.0, lru to 0.7.3

* Fix websoket Incoming::Data

* Rename ProtocolsHandler -> ConnectionHandler, remove inject_dis/connected, minor fixes

* Fix args for inject_connection* callbacks

* Fix DialPeer/DialAddress

* Fix debug fmt

* Add Endpoint to NetworkState

* Fix Kad::get_record by key

* Fix Sha2_256::digest

* Fix IntoConnectionHandler

* Fix borrowchk

* Fix DialError::WrongPeerId

* Remove NodeHandlerWrapperError

* Fix KademliaEvent variants

* Fix impl Add for String

* Fix tabs in network_state

* Apply cargo fmt

* Fix a typo in req/resp

* Fix tests

* Fix peer_info:entry.info_expire

* Fix PeerInfoBehaviour inject_address_change and inject_connection_closed

* Patch libp2p to 0.44.0#6cc3b4e

* Fix inject_connection_closed kad, req/resp

* Apply cargo fmt

* Use libp2p from crates.io

* Fix review notes
jiguantong added a commit to darwinia-network/darwinia-messages-substrate that referenced this pull request Jun 27, 2022
fewensa pushed a commit to darwinia-network/darwinia-messages-substrate that referenced this pull request Jun 27, 2022
* Anchor polkadot-v0.9.22

* update Cargo.lock

* Companion for paritytech/substrate#11009

* update Cargo.lock
DaviRain-Su pushed a commit to octopus-network/substrate that referenced this pull request Aug 23, 2022
* Update libp2p to 0.43.0, lru to 0.7.3

* Fix websoket Incoming::Data

* Rename ProtocolsHandler -> ConnectionHandler, remove inject_dis/connected, minor fixes

* Fix args for inject_connection* callbacks

* Fix DialPeer/DialAddress

* Fix debug fmt

* Add Endpoint to NetworkState

* Fix Kad::get_record by key

* Fix Sha2_256::digest

* Fix IntoConnectionHandler

* Fix borrowchk

* Fix DialError::WrongPeerId

* Remove NodeHandlerWrapperError

* Fix KademliaEvent variants

* Fix impl Add for String

* Fix tabs in network_state

* Apply cargo fmt

* Fix a typo in req/resp

* Fix tests

* Fix peer_info:entry.info_expire

* Fix PeerInfoBehaviour inject_address_change and inject_connection_closed

* Patch libp2p to 0.44.0#6cc3b4e

* Fix inject_connection_closed kad, req/resp

* Apply cargo fmt

* Use libp2p from crates.io

* Fix review notes
ark0f pushed a commit to gear-tech/substrate that referenced this pull request Feb 27, 2023
* Update libp2p to 0.43.0, lru to 0.7.3

* Fix websoket Incoming::Data

* Rename ProtocolsHandler -> ConnectionHandler, remove inject_dis/connected, minor fixes

* Fix args for inject_connection* callbacks

* Fix DialPeer/DialAddress

* Fix debug fmt

* Add Endpoint to NetworkState

* Fix Kad::get_record by key

* Fix Sha2_256::digest

* Fix IntoConnectionHandler

* Fix borrowchk

* Fix DialError::WrongPeerId

* Remove NodeHandlerWrapperError

* Fix KademliaEvent variants

* Fix impl Add for String

* Fix tabs in network_state

* Apply cargo fmt

* Fix a typo in req/resp

* Fix tests

* Fix peer_info:entry.info_expire

* Fix PeerInfoBehaviour inject_address_change and inject_connection_closed

* Patch libp2p to 0.44.0#6cc3b4e

* Fix inject_connection_closed kad, req/resp

* Apply cargo fmt

* Use libp2p from crates.io

* Fix review notes
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A0-please_review Pull request needs code review. B0-silent Changes should not be mentioned in any release notes C1-low PR touches the given topic and has a low impact on builders. D3-trivial 🧸 PR contains trivial changes in a runtime directory that do not require an audit
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

Update sc-authority-discovery vulnerable dependency NetworkBehaviour trait is not fully implemented
4 participants