Skip to content
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

Fix transport/wasm-ext fully qualified p2p multiaddr #2058

Merged
merged 5 commits into from Apr 27, 2021
Merged

Fix transport/wasm-ext fully qualified p2p multiaddr #2058

merged 5 commits into from Apr 27, 2021

Conversation

appaquet
Copy link
Contributor

Changes in 45f07bf now seem to append /p2p/<peer> to multiaddr passed to transports. The regex in transport/wasm-ext doesn't support this fully qualified format. Supporting extra suffixes in the regex fixes the issue, but I'm wondering if it it should match on \/p2p\/.* instead or just plainly accepting any suffix. Let me know what you prefer.

Copy link
Member

@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.

I am not familiar enough with this script, thus pinging @tomaka.

To fix the status quo, this seems to be a proper solution. I would be in favor of matching p2p in specific, just to play safe, though this is not my call.

@tomaka
Copy link
Member

tomaka commented Apr 26, 2021

Indeed, I would prefer to match the /p2p/ in the regex.
It doesn't make sense to interpret seperate chunks of multiaddresses. Either the whole multiaddr has a recognizable format, or not.

@appaquet
Copy link
Contributor Author

In this case, I wouldn't match on \/p2p\/.* since that would mean it would match on anything after, but as long as it has a p2p prefix. Something like ...\/p2p\/[a-zA-Z0-9]+$ would probably better to match solely on the peer id.

Copy link
Member

@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.

@appaquet if you apply the diff below, I can cut a patch release of libp2p-wasm-ext later today.

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 5848eeaa..b6a2562b 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -45,12 +45,13 @@
 
 - Update individual crates.
     - `libp2p-core`
+    - `libp2p-gossipsub`
+    - `libp2p-wasm-ext`
 
 ## Version 0.37.1 [2021-04-14]
 
 - Update individual crates.
     - `libp2p-swarm-derive`
-    - `libp2p-gossipsub`
 
 ## Version 0.37.0 [2021-04-13]
 
diff --git a/Cargo.toml b/Cargo.toml
index 1b1a5ceb..1db70370 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -79,7 +79,7 @@ libp2p-request-response = { version = "0.11.0", path = "protocols/request-respon
 libp2p-swarm = { version = "0.29.0", path = "swarm" }
 libp2p-swarm-derive = { version = "0.23.0", path = "swarm-derive" }
 libp2p-uds = { version = "0.28.0", path = "transports/uds", optional = true }
-libp2p-wasm-ext = { version = "0.28.1", path = "transports/wasm-ext", default-features = false, optional = true }
+libp2p-wasm-ext = { version = "0.28.2", path = "transports/wasm-ext", default-features = false, optional = true }
 libp2p-yamux = { version = "0.32.0", path = "muxers/yamux", optional = true }
 multiaddr = { package = "parity-multiaddr", version = "0.11.2", path = "misc/multiaddr" }
 parking_lot = "0.11.0"
diff --git a/transports/wasm-ext/CHANGELOG.md b/transports/wasm-ext/CHANGELOG.md
index 01f205eb..4db7ba5e 100644
--- a/transports/wasm-ext/CHANGELOG.md
+++ b/transports/wasm-ext/CHANGELOG.md
@@ -1,3 +1,8 @@
+# 0.28.2 [2021-04-27]
+
+- Support dialing `Multiaddr` with `/p2p` protocol [PR
+  2058](https://github.com/libp2p/rust-libp2p/pull/2058).
+
 # 0.28.1 [2021-04-01]
 
 - Require at least js-sys v0.3.50 [PR
@@ -45,4 +50,3 @@
 - Updated dependencies.
 - Support `/dns` in the websocket implementation
   ([PR 1626](https://github.com/libp2p/rust-libp2p/pull/1626))
-
diff --git a/transports/wasm-ext/Cargo.toml b/transports/wasm-ext/Cargo.toml
index 4d314573..4825256d 100644
--- a/transports/wasm-ext/Cargo.toml
+++ b/transports/wasm-ext/Cargo.toml
@@ -1,6 +1,6 @@
 [package]
 name = "libp2p-wasm-ext"
-version = "0.28.1"
+version = "0.28.2"
 authors = ["Pierre Krieger <pierre.krieger1708@gmail.com>"]
 edition = "2018"
 description = "Allows passing in an external transport in a WASM environment"

@appaquet
Copy link
Contributor Author

@mxinden Done

@mxinden mxinden merged commit d931f36 into libp2p:master Apr 27, 2021
@mxinden
Copy link
Member

mxinden commented Apr 27, 2021

Thanks @appaquet.

libp2p-wasm-ext v0.28.2 is tagged and published.

AgeManning pushed a commit to sigp/rust-libp2p that referenced this pull request May 4, 2021
…ibp2p#2058)

Changes in 45f07bf now seem to append `/p2p/<peer>` to multiaddr passed to
transports. The regex in transport/wasm-ext doesn't support this fully qualified
format. This commit adjusts the regex accordingly.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants