-
Notifications
You must be signed in to change notification settings - Fork 43
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
Add webrtc transport multidim interop #100
Add webrtc transport multidim interop #100
Conversation
63efd23
to
eb1ab42
Compare
🚀 let me know once this is ready for a review. |
e26ca25
to
ffdaea7
Compare
@mxinden thanks, ready! @MarcoPolo the tests are failing because of the "js-v0.41.0 x js-v0.41.0 (ws, noise, yamux)" which this PR doesn't affect afaict do you know what might it be? |
Can you rebase please. The ping succeeded, but the test failed. I think it’s because it failed when closing the Redis client (which is fine). |
c0a5ace
to
03721b7
Compare
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.
Minor comments. Good to merge from my end.
let timeout = Duration::from_secs(5); | ||
|
||
match secure_channel_param { | ||
"noise" => builder |
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.
As an aside, I suggest using enum
s here long-term instead of passing around strings. clap
should make this reasonably easy. Neither important nor urgent.
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.
yup, awesome idea! Updated ptal Max
multidim-interop/src/generator.ts
Outdated
await db.all(`SELECT DISTINCT a.id as id1, b.id as id2, a.transport | ||
FROM transports a, transports b | ||
WHERE a.transport == b.transport | ||
-- Only webtransport transports |
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.
-- Only webtransport transports | |
-- Only webrtc transports |
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.
Thanks! 🙏
CC @thomaseizinger you also probably want to take a look, as this builds on your work on the previous interop tests |
6ffa98e
to
f999445
Compare
to allow us add the WebRTC transport test (which is only available with the tokio runtime) Clean up the test and update Cargo.toml to 0.2.0 to avoid conflicting with the older tests, and allow us to import lib.rs on the rust-libp2p repo and have the master tests there.
with KeepAlive Behaviour
webrtc instead of webtransport.
fe8e932
to
b251928
Compare
b251928
to
396c327
Compare
multidim-interop/src/generator.ts
Outdated
listenerID: test.id2, | ||
transport: test.transport, | ||
muxer: "quic", | ||
security: "tls", |
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.
@MarcoPolo what do you think of this change? It doesn't break Go quic
tests, and allows Rust to have one less Variant in the enum. Plus I'd say it makes sense semantically.
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 don’t think it makes sense. In every other context tls means add a tls encryption layer on top of the transport.
I know quic uses tls underneath and that isn’t a hardcoded decision (some different encryption layer could be possible in the future). But for now I think we should keep tls meaning add a tls security layer to the transport.
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.
yeah you are right Marco, I reverted it int this PR so we can merge and address the rust-libp2p
interop. But I also agree with @thomaseizinger on #100 (comment) if you agree we can submit a PR not using muxer nor transport for quic
and webrtc
cases
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.
Some thoughts, otherwise LGTM.
let transport_param: testplan::Transport = env::var("transport") | ||
.context("transport environment variable is not set")? | ||
.parse() | ||
.context("unsupported transport")?; | ||
|
||
let secure_channel_param: testplan::SecProtocol = env::var("security") | ||
.context("security environment variable is not set")? | ||
.parse() | ||
.context("unsupported secure channel")?; | ||
|
||
let muxer_param: Muxer = env::var("muxer") | ||
.context("muxer environment variable is not set")? | ||
.parse() | ||
.context("unsupported muxer")?; |
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.
Until we move the test to our repository (where we deduplicate the test using Git revisions), I don't think it makes much sense to be typed here because we have to repeat it in every test.
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.
it's now all on the testplans lib, which we can depend on the rust-libp2p
repo and use from there wdyt?
update: wrote this before reading libp2p/rust-libp2p#3331 (comment) let's continue there.
muxer: "quic", | ||
security: "quic", |
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 a bit odd, I think leaving these blank would make the most sense. It requires the tests to parse the variables in steps but I don't see why that is necessarily a problem.
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.
Yeah agree Thomas, commented on #100 (comment)
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 think this makes sense to me. We can make this change in a future PR so we do it across all impls
use std::env; | ||
use std::time::Duration; | ||
use testplan::{run_ping_redis, PingSwarm}; | ||
use testplan::{run_ping, Muxer, PingSwarm, SecProtocol, Transport}; | ||
|
||
fn build_builder<T, C>( |
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 function doesn't have much value because the type constraints are so insane. You are likely better off by just inlining things and accepting the duplication between the different invocations.
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 still feel it's more lines of code and repetition, but feel free to submit a PR addressing that after Thomas
multidim-interop/rust/src/lib.rs
Outdated
Quic, | ||
Webrtc, |
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.
These aren't strictly muxers. I think we should leave the muxer variable empty when we don't explicitly set one. IMO, that will be cleaner implementation.
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.
yeah makes sense, thanks Thomas addressed :)
- undo generator changes, let's do that later on - don't parse muxer and sec protocol where we don't need it
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.
Changes here look good to me. Ready to merge from my end.
@MarcoPolo any objections?
multidim-interop/src/generator.ts
Outdated
security: "quic", | ||
}))) | ||
.concat(webrtcQueryResults | ||
.map((test): ComposeSpecification => buildSpec(containerImages, { |
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.
Can we indent this line? The map applies to webrtcQueryResults
not the concat(...)
expression like above.
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.
yup makes sense Marco, updated :)
@jxs two approvals, all checks are green. Please merge once this is ready from your end. |
- Added in libp2p#2622 - Interoperability tests added in libp2p/test-plans#100
- Added in #2622 - Interoperability tests added in libp2p/test-plans#100
No description provided.