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

deps: update webrtc to 0.11.0 #5448

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

deps: update webrtc to 0.11.0 #5448

wants to merge 2 commits into from

Conversation

jxs
Copy link
Member

@jxs jxs commented Jun 6, 2024

Description

Also update rcgen to 0.13.1 as a direct dependency.

@b-zee
Copy link
Contributor

b-zee commented Jul 18, 2024

EDIT: Solved, see later comment.

Hey @jxs, I saw this PR as I was debugging some weird aarch64 cross compilation error for a outdated ring dependency. Following the dependency tree it appeared that my libp2p_webrtc dependency pulls that in, so it appears this PR fixes that 👍 .

However, I get the following error now and I can't quite figure it out:

error[E0599]: the method `map` exists for struct `Transport`, but its trait bounds were not satisfied
   --> src/network/mod.rs:155:14
    |
151 |               Ok(libp2p_webrtc::tokio::Transport::new(
    |  ________________-
152 | |                 key.clone(),
153 | |                 libp2p_webrtc::tokio::Certificate::generate(&mut rand::thread_rng())?,
154 | |             )
155 | |             .map(|(peer_id, conn), _| (peer_id, StreamMuxerBox::new(conn))))
    | |             -^^^ method cannot be called on `Transport` due to unsatisfied trait bounds
    | |_____________|
    | 
    |
   ::: /home/b-zee/.cargo/git/checkouts/rust-libp2p-bd8662eba582499b/3180f88/transports/webrtc/src/tokio/transport.rs:49:1
    |
49  |   pub struct Transport {
    |   -------------------- doesn't satisfy 5 bounds
    |
    = note: the following trait bounds were not satisfied:
            `libp2p_webrtc::tokio::Transport: futures::Future`
            which is required by `libp2p_webrtc::tokio::Transport: futures::FutureExt`
            `libp2p_webrtc::tokio::Transport: futures::Stream`
            which is required by `libp2p_webrtc::tokio::Transport: futures::StreamExt`
            `&libp2p_webrtc::tokio::Transport: futures::Future`
            which is required by `&libp2p_webrtc::tokio::Transport: futures::FutureExt`
            `&libp2p_webrtc::tokio::Transport: futures::Stream`
            which is required by `&libp2p_webrtc::tokio::Transport: futures::StreamExt`
            `&mut libp2p_webrtc::tokio::Transport: futures::Future`
            which is required by `&mut libp2p_webrtc::tokio::Transport: futures::FutureExt`
            `&mut libp2p_webrtc::tokio::Transport: futures::Stream`
            which is required by `&mut libp2p_webrtc::tokio::Transport: futures::StreamExt`
            `libp2p_webrtc::tokio::Transport: Iterator`
            which is required by `&mut libp2p_webrtc::tokio::Transport: Iterator`
    = help: items from traits can only be used if the trait is in scope
help: trait `Transport` which provides `map` is implemented but not in scope; perhaps you want to import it
    |
1   + use libp2p_core::transport::Transport;
    |

It's basically from the SwarmBuilder::with_other_transport:

        // ...
        .with_other_transport(|key| {
            Ok(libp2p_webrtc::tokio::Transport::new(
                key.clone(),
                libp2p_webrtc::tokio::Certificate::generate(&mut rand::thread_rng())?,
            )
            .map(|(peer_id, conn), _| (peer_id, StreamMuxerBox::new(conn))))
        })

I confirmed that this is only happening when switching from 0.7.1-alpha to this PR's 0.7.2-alpha. Using the following in Cargo.toml:

[patch.crates-io]
libp2p-webrtc = { git = "https://github.com/jxs/rust-libp2p", branch = "update-webrtc" }

@b-zee
Copy link
Contributor

b-zee commented Jul 19, 2024

Sorry for the previous comment. Seems like it was a distraction not related to this PR. I also had to patch the libp2p dep. Presumably otherwise the traits/structs do not line up. This is something the Rust compiler doesn't clearly convey yet apparently.

[patch.crates-io]
libp2p = { git = "https://github.com/jxs/rust-libp2p", branch = "update-webrtc" }
libp2p-webrtc = { git = "https://github.com/jxs/rust-libp2p", branch = "update-webrtc" }
libp2p-webrtc-websys = { git = "https://github.com/jxs/rust-libp2p", branch = "update-webrtc" }

@jxs jxs mentioned this pull request Sep 5, 2024
4 tasks
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.

2 participants