-
Notifications
You must be signed in to change notification settings - Fork 964
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
feat: leverage type-safe /p2p
in multiaddr
#4037
Conversation
…-libp2p into libp2p-identity-no-multiaddr
This comment was marked as resolved.
This comment was marked as resolved.
[patch.crates-io] | ||
|
||
# Patch away `libp2p-idnentity` in our dependency tree with the workspace version. | ||
# `libp2p-identity` is a leaf dependency and used within `rust-multiaddr` which is **not** part of the workspace. | ||
# As a result, we cannot just reference the workspace version in our crates because the types would mismatch with what | ||
# we import via `rust-multiaddr`. | ||
# This is expected to stay here until we move `libp2p-identity` to a separate repository which makes the dependency relationship more obvious. | ||
libp2p-identity = { path = "identity" } |
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.
@mxinden I did not expect that we need this but it actually makes sense. We can't just depend on libp2p-idenity
via path
in here because it will mismatch with what is coming from multiaddr
.
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 makes sense. I think cargo publish
will ignore all patch
sections, thus this does not affect our published crates.
This comment was marked as resolved.
This comment was marked as resolved.
[[package]] | ||
name = "multihash-derive" | ||
version = "0.8.1" | ||
source = "registry+https://github.com/rust-lang/crates.io-index" | ||
checksum = "1d6d4752e6230d8ef7adf7bd5d8c4b1f6561c1014c5ba9a37445ccefe18aa1db" | ||
dependencies = [ | ||
"proc-macro-crate", | ||
"proc-macro-error", | ||
"proc-macro2", | ||
"quote", | ||
"syn 1.0.109", | ||
"synstructure", | ||
] |
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.
🎉
[[package]] | ||
name = "proc-macro-crate" | ||
version = "1.1.3" | ||
source = "registry+https://github.com/rust-lang/crates.io-index" | ||
checksum = "e17d47ce914bf4de440332250b0edd23ce48c005f59fab39d3335866b114f11a" | ||
dependencies = [ | ||
"thiserror", | ||
"toml", | ||
] | ||
|
||
[[package]] | ||
name = "proc-macro-error" | ||
version = "1.0.4" | ||
source = "registry+https://github.com/rust-lang/crates.io-index" | ||
checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" | ||
dependencies = [ | ||
"proc-macro-error-attr", | ||
"proc-macro2", | ||
"quote", | ||
"syn 1.0.109", | ||
"version_check", | ||
] | ||
|
||
[[package]] | ||
name = "proc-macro-error-attr" | ||
version = "1.0.4" | ||
source = "registry+https://github.com/rust-lang/crates.io-index" | ||
checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" | ||
dependencies = [ | ||
"proc-macro2", | ||
"quote", | ||
"version_check", | ||
] |
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.
🎉
@@ -11,4 +11,4 @@ async-trait = "0.1" | |||
env_logger = "0.10" | |||
futures = "0.3.28" | |||
libp2p = { path = "../../libp2p", features = ["async-std", "dns", "kad", "mdns", "noise", "macros", "tcp", "websocket", "yamux"] } | |||
multiaddr = { version = "0.17.1" } | |||
multiaddr = { workspace = true } |
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.
Oh, this one we should probably remove in favor of accessing it from libp2p
.
examples/file-sharing/Cargo.toml
Outdated
@@ -13,5 +13,5 @@ either = "1.8" | |||
env_logger = "0.10" | |||
futures = "0.3.28" | |||
libp2p = { path = "../../libp2p", features = ["async-std", "dns", "kad", "noise", "macros", "request-response", "tcp", "websocket", "yamux"] } | |||
multiaddr = { version = "0.17.1" } | |||
multiaddr = { workspace = true } |
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.
And here too!
examples/ipfs-private/Cargo.toml
Outdated
multiaddr = { workspace = true } |
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.
And here.
examples/ping-example/Cargo.toml
Outdated
multiaddr = { workspace = true } |
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.
And here.
/// The provided peer identity is invalid. | ||
InvalidPeerId(Multihash), |
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 is probably worth a changelog entry.
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.
👍 6872e90
This comment was marked as resolved.
This comment was marked as resolved.
[patch.crates-io] | ||
|
||
# Patch away `libp2p-idnentity` in our dependency tree with the workspace version. | ||
# `libp2p-identity` is a leaf dependency and used within `rust-multiaddr` which is **not** part of the workspace. | ||
# As a result, we cannot just reference the workspace version in our crates because the types would mismatch with what | ||
# we import via `rust-multiaddr`. | ||
# This is expected to stay here until we move `libp2p-identity` to a separate repository which makes the dependency relationship more obvious. | ||
libp2p-identity = { path = "identity" } |
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 makes sense. I think cargo publish
will ignore all patch
sections, thus this does not affect our published crates.
/// The provided peer identity is invalid. | ||
InvalidPeerId(Multihash), |
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.
👍 6872e90
This updates `multiaddr` to version `0.19`. Depends-On: libp2p#3656. Depends-On: multiformats/rust-multiaddr#83. Resolves: libp2p#4039. Pull-Request: libp2p#4037.
Description
This updates
multiaddr
to version0.19
.Depends-On: #3656.
Depends-On: multiformats/rust-multiaddr#83.
Resolves: #4039.
Notes & open questions
This currently does not compile becausePeerId
exported frommultiaddr
is not the same as the one we use across the workspace here. But, the resolution of all other errors shows that this will work.Change checklist