Skip to content

Commit

Permalink
fix(interop): rename webrtc to webrtc-direct (#166)
Browse files Browse the repository at this point in the history
See multiformats/multiaddr#150 (comment)
for context on discussion.

- Renames the `webrtc` transport identifier to `webrtc-direct`.
- Re-enables `webrtc-direct` support for rust-libp2p v0.51. Previously disabled
  in #160. See
  libp2p/rust-libp2p#3781 for corresponding change on
  the rust-libp2p side.
- Leaves JS v0.41 and v0.42 untouched. To be done in a follow-up alongside JS
  dependency updates.
  • Loading branch information
mxinden authored Apr 19, 2023
1 parent b80483a commit e07ffab
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 8 deletions.
2 changes: 2 additions & 0 deletions multidim-interop/impl/go/v0.24/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,8 @@ func main() {
case "webtransport":
fallthrough
case "webrtc":
fallthrough
case "webrtc-direct":
skipMuxer = true
skipSecureChannel = true
}
Expand Down
2 changes: 1 addition & 1 deletion multidim-interop/impl/rust/v0.51/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
image_name := rust-v0.51
commitSha := 1a9cf4f7760724032b729c43165716c7ecd842ad
commitSha := 0d5cac0cb595702567e50221fed9ae525b4c6f20

all: image.json

Expand Down
12 changes: 6 additions & 6 deletions multidim-interop/src/generator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export async function buildTestSpecs(versions: Array<Version>): Promise<Array<Co
AND ma.muxer == mb.muxer
-- quic only uses its own muxer/securechannel
AND a.transport != "webtransport"
AND a.transport != "webrtc"
AND a.transport != "webrtc-direct"
AND a.transport != "quic"
AND a.transport != "quic-v1";`);
const quicQueryResults =
Expand All @@ -85,13 +85,13 @@ export async function buildTestSpecs(versions: Array<Version>): Promise<Array<Co
AND NOT b.onlyDial
-- Only webtransport transports
AND a.transport == "webtransport";`);
const webrtcQueryResults =
const webrtcDirectQueryResults =
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
AND NOT b.onlyDial
-- Only webrtc transports
AND a.transport == "webrtc";`);
-- Only webrtc-direct transports
AND a.transport == "webrtc-direct";`);
await db.close();

const testSpecs = queryResults.map((test): ComposeSpecification => (
Expand All @@ -115,7 +115,7 @@ export async function buildTestSpecs(versions: Array<Version>): Promise<Array<Co
transport: test.transport,
extraEnv: buildExtraEnv(timeoutOverride, test.id1, test.id2)
})))
.concat(webrtcQueryResults
.concat(webrtcDirectQueryResults
.map((test): ComposeSpecification => buildSpec(containerImages, {
name: `${test.id1} x ${test.id2} (${test.transport})`,
dialerID: test.id1,
Expand Down Expand Up @@ -172,4 +172,4 @@ function buildSpec(containerImages: { [key: string]: string }, { name, dialerID,

function normalizeTransport(transport: string | { name: string, onlyDial: boolean }): { name: string, onlyDial: boolean } {
return typeof transport === "string" ? { name: transport, onlyDial: false } : transport
}
}
2 changes: 1 addition & 1 deletion multidim-interop/versions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export const versions: Array<Version> = [
{
id: "rust-v0.51.0",
containerImageID: rustv051.imageID,
transports: ["ws", "tcp", "quic-v1"],
transports: ["ws", "tcp", "quic-v1", "webrtc-direct"],
secureChannels: ["tls", "noise"],
muxers: ["mplex", "yamux"],
},
Expand Down

0 comments on commit e07ffab

Please sign in to comment.