router, sdk/js: a browser reaches a router by IP over WebTransport #920
All Vouch review confidence checks passed
Residual risk 0.19 = Change Risk (0.48) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.48 · 525 lines diff across 6 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.375
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #920"
general
weight: 0.35
aojea
A browser can now join the testnets. A page reaches a router only over WebSocket or WebTransport, and the testnet routers offered neither: they listen on TCP and QUIC and lease only their
--external-addr/dnsaddr, whose TXT records hold TCP and QUIC addresses.wsswould need a hostname and a CA certificate per router.WebTransport needs neither. The browser checks the router's self-signed certificate against the
certhashin the router's address, so it dials the router by IP.What changes
--external-addr, the router also leases a/webtransportaddress for each of its external QUIC addresses. It appends the/webtransport/certhash/…end of its own WebTransport listen address to the QUIC address. The certhash changes with the certificate about every two weeks, so no operator can configure the address. The relay circuit addresses the router hands to members follow the lease, so they carry this address too.--external-addr, by IP or by name, or one found under the router's peer ID in a/dnsaddr--external-addr. The router looks up the/dnsaddrbefore each lease, with a 5-second limit. A failed lookup keeps the last result, so a DNS outage does not withdraw a leased address./udp/4501/quic-v1/webtransport. It shares the QUIC socket, so no new port or firewall rule is needed.@libp2p/webtransport).Nothing changes for a router that does not listen on WebTransport: it makes no DNS lookup and leases the same addresses as before. The router's default
--listenis TCP only. A router without--external-addrleases all its host addresses as before, and those include its WebTransport listen addresses.Testing
TestRouterLeasesWebTransportForItsExternalQUICAddrschecks the leased WebTransport addresses for an external QUIC address by public IP, by private IP and by name, for the router's own entry in a/dnsaddr, and for the same address given twice. It also checks that the router leases none for a/dnsaddrwithout a record, for TCP-only addresses, for an IPv6 address with an IPv4 listener, and without a WebTransport listener.TestRouterCircuitAddrsFollowTheExternalAddrschecks that the circuit addresses carry the WebTransport address.agentmesh-one) and oneagentmesh-routerthat listens on QUIC and WebTransport on one UDP port, with--external-addr /ip4/<LAN IP>/udp/<port>/quic-v1and no other member. The router log and/infolisted/ip4/<LAN IP>/udp/<port>/quic-v1/webtransport/certhash/…. A headless Chromium 158 page running the JS SDK browser example joined, held an open WebTransport connection to that router and passed the mesh handshake./dnsaddrpath is covered by the unit test with a mock resolver only. The JS transport change has no automated test.Notes
/mesh/auth, so unauthenticated peers would count as observers.--control-plane-sync-interval./dnsaddrrecord.@libp2p/webtransportdepends on@libp2p/noise, the same project as@chainsafe/libp2p-noiseunder its new name, so the browser bundle carries both.https:inconnect-src: WebTransport dialshttps://<ip>:<port>.