Skip to content

feat(transport): visor accepts WebTransport + registers its cert hash with the AR#3303

Merged
0pcom merged 1 commit into
skycoin:developfrom
0pcom:feat/wt-accept-register
Jun 26, 2026
Merged

feat(transport): visor accepts WebTransport + registers its cert hash with the AR#3303
0pcom merged 1 commit into
skycoin:developfrom
0pcom:feat/wt-accept-register

Conversation

@0pcom

@0pcom 0pcom commented Jun 26, 2026

Copy link
Copy Markdown
Collaborator

Second PR of the WebTransport carrier build (after #3302, the AR cert-hash foundation).

Every native visor now starts a WebTransport server and advertises it so browser (wasm) visors — which can only reach a visor over WS/WT/WebRTC — can dial it:

  • initWTClient (module wt, depends on the transport module like ws/quic) calls InitClient(types.WT). The WT server binds its own ephemeral UDP port, generates a self-signed cert, and serves HTTP/3 WebTransport.
  • The WT client gets the AR (held as any, mirroring wsClient.ar). On serve it registers the endpoint + the cert's SHA-256 hash via BindWT (feat(address-resolver): WebTransport bind/resolve with cert-hash (WT discovery foundation) #3302) and keeps the entry alive with a 90s re-register (retry-with-backoff like stcpr/quic).

wtClient.Dial already guards a nil table, so no tp add -t wt crash before the dial-resolution PR lands.

Verified live

The WT server starts, binds UDP (port 7777), mints a cert (74d836a3…), and BindWT retries — 404 until the AR redeploys #3302 — visor stays alive throughout.

Next PRs: dial-side resolution (resolve the peer's WT endpoint+hash from the AR, pin the cert) → WS/WT multi-type autoconnect.

🤖 Generated with Claude Code

… with the AR

Second PR of the WT carrier build. Every native visor now starts a WebTransport
server and advertises it so browser (wasm) visors — which can only reach a visor
over WS/WT/WebRTC — can dial it:

- initWTClient (module "wt", depends on the transport module like ws/quic) calls
  InitClient(types.WT). The WT server binds its own ephemeral UDP port, generates
  a self-signed cert, and serves HTTP/3 WebTransport.
- The WT client gets the AR (held as `any`, mirroring wsClient.ar). On serve it
  registers the endpoint + the cert's SHA-256 hash via BindWT (skycoin#3302) and keeps
  the entry alive with a 90s re-register (retry-with-backoff like stcpr/quic).

wtClient.Dial already guards a nil table (no crash on `tp add -t wt` before the
dial-resolution PR lands). Verified live: the WT server starts, binds UDP, mints
a cert, and BindWT retries (404 until the AR redeploys skycoin#3302); visor stays alive.

Next: dial-side resolution (resolve the peer's WT endpoint+hash from the AR and
pin) + WS/WT multi-type autoconnect.
@0pcom
0pcom merged commit aa59b78 into skycoin:develop Jun 26, 2026
3 of 5 checks passed
0pcom added a commit that referenced this pull request Jun 26, 2026
…h via the AR (#3304)

Third PR of the WT carrier build. A native `tp add -t wt <pk>` (and the dial side
generally) had only the WTTable to find a peer's WebTransport endpoint, so a
native visor returned ErrWTEntryNotFound. Now, on a table miss, wtClient.Dial
resolves the peer's WT record from the address resolver — the endpoint
(https://host:port/skywire) AND the pinned self-signed cert hash that BindWT
(#3302/#3303) stored — and dials with the pin. Mirrors the native WS resolution.

Build-tagged like the WS resolver (real on !tinygo via addrresolver, no-op stub
on tinygo); browser build unaffected (table hit first, nil AR). End-to-end
native↔native WT needs #3302 (AR) + #3303 (accept) deployed so peers have WT
records; this is the dial half.
0pcom added a commit that referenced this pull request Jun 26, 2026
…lic visor (#3306)

A native visor makes BOTH stcpr and sudph to the same public visors (autoconnect.go)
for redundancy + path diversity. The browser analog is WS (TCP) + WT (QUIC); until
now the wasm autoconnect dialed only WS.

The autoconnect now dials both carriers to each public visor:
- WS rides the stcpr cmux port (resolve stcpr IP, ws://ip:port/) — unchanged.
- WT: new arDmsg.resolveWT fetches the peer's AR WT record (/resolve/wt) — the
  https://host:port/skywire endpoint + the pinned self-signed cert hash (stored by
  BindWT) — sets the wtTable entry and SaveTransport(WT). Needs the browser-native
  WT dial (#3305) and the AR WT records (#3302/#3303 deployed).

Counts DISTINCT visors now (a peer may hold both a WS and a WT transport), and a
peer with no WT record (404) just gets WS — graceful until the fleet registers WT.
Refreshes the committed wasm blob.
0pcom added a commit that referenced this pull request Jul 7, 2026
… with the AR (#3303)

Second PR of the WT carrier build. Every native visor now starts a WebTransport
server and advertises it so browser (wasm) visors — which can only reach a visor
over WS/WT/WebRTC — can dial it:

- initWTClient (module "wt", depends on the transport module like ws/quic) calls
  InitClient(types.WT). The WT server binds its own ephemeral UDP port, generates
  a self-signed cert, and serves HTTP/3 WebTransport.
- The WT client gets the AR (held as `any`, mirroring wsClient.ar). On serve it
  registers the endpoint + the cert's SHA-256 hash via BindWT (#3302) and keeps
  the entry alive with a 90s re-register (retry-with-backoff like stcpr/quic).

wtClient.Dial already guards a nil table (no crash on `tp add -t wt` before the
dial-resolution PR lands). Verified live: the WT server starts, binds UDP, mints
a cert, and BindWT retries (404 until the AR redeploys #3302); visor stays alive.

Next: dial-side resolution (resolve the peer's WT endpoint+hash from the AR and
pin) + WS/WT multi-type autoconnect.
0pcom added a commit that referenced this pull request Jul 7, 2026
…h via the AR (#3304)

Third PR of the WT carrier build. A native `tp add -t wt <pk>` (and the dial side
generally) had only the WTTable to find a peer's WebTransport endpoint, so a
native visor returned ErrWTEntryNotFound. Now, on a table miss, wtClient.Dial
resolves the peer's WT record from the address resolver — the endpoint
(https://host:port/skywire) AND the pinned self-signed cert hash that BindWT
(#3302/#3303) stored — and dials with the pin. Mirrors the native WS resolution.

Build-tagged like the WS resolver (real on !tinygo via addrresolver, no-op stub
on tinygo); browser build unaffected (table hit first, nil AR). End-to-end
native↔native WT needs #3302 (AR) + #3303 (accept) deployed so peers have WT
records; this is the dial half.
0pcom added a commit that referenced this pull request Jul 7, 2026
…lic visor (#3306)

A native visor makes BOTH stcpr and sudph to the same public visors (autoconnect.go)
for redundancy + path diversity. The browser analog is WS (TCP) + WT (QUIC); until
now the wasm autoconnect dialed only WS.

The autoconnect now dials both carriers to each public visor:
- WS rides the stcpr cmux port (resolve stcpr IP, ws://ip:port/) — unchanged.
- WT: new arDmsg.resolveWT fetches the peer's AR WT record (/resolve/wt) — the
  https://host:port/skywire endpoint + the pinned self-signed cert hash (stored by
  BindWT) — sets the wtTable entry and SaveTransport(WT). Needs the browser-native
  WT dial (#3305) and the AR WT records (#3302/#3303 deployed).

Counts DISTINCT visors now (a peer may hold both a WS and a WT transport), and a
peer with no WT record (404) just gets WS — graceful until the fleet registers WT.
Refreshes the committed wasm blob.
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.

1 participant