Skip to content

Rust-core port follow-ups#77

Open
pgherveou wants to merge 57 commits into
mainfrom
codex/dotli-rust-port-follow-ups
Open

Rust-core port follow-ups#77
pgherveou wants to merge 57 commits into
mainfrom
codex/dotli-rust-port-follow-ups

Conversation

@pgherveou

@pgherveou pgherveou commented Jul 15, 2026

Copy link
Copy Markdown
Collaborator

Summary

All follow-up work for the Rust-core port (#70), consolidated into a single stacked PR. Each commit is an independent unit with its context in the commit message:

  • feat(topbar) — friendly login-failure explanations (statement-store slot exhaustion, rejected registration transactions, JSON-RPC failures) with the raw reason as a detail line; permissions-popover stale-render guard and unavailable-state fallback.
  • feat(debug) — per-frame TrUAPI wire tap feeding the debug panel timeline. Without this commit the panel's TrUAPI lane receives no events.
  • feat(ui) — AllowanceKeys slots are AES-GCM encrypted at rest. ⚠️ To resolve before merge: derive a random per-write nonce (the current fixed nonce is obfuscation, not encryption) and accept the plain-hex format written by Switch to Rust core #70 as a read fallback.
  • feat(ui) — permission and notification prompts share a 20-per-10s sliding window so a hostile product cannot flood the host with modals.
  • fix(debug) — dock offset matches the 56px topbar iframe, system flows close on exact layer:event names (setup_ready no longer false-matches the ready suffix), @dotli/config declared where chain-registry imports it.
  • chore(resolver) — drops unused @polkadot-api/signer and @polkadot-labs/hdkd{,-helpers}; adds unit coverage for pre-existing chain support checks.
  • fix(protocol)chainSend messages flushed after chainConnect surface send failures as JSON-RPC error responses, matching the direct-send path.
  • fix(ui) — preimage lookup subscriptions keep polling after backend read failures; gateway mode logs that sandbox bitswap is unavailable.
  • fix(protocol) — broker ref-counts upstream tokens shared by local sessions and buffers subscription events that arrive before their token response.

Base

Stacked on #70. Supersedes #73, #74, and #76.

Verification

  • bun install --frozen-lockfile
  • bun run format:check
  • bunx --bun turbo run lint typecheck test build:prod --force
  • bun audit
  • make e2e-dotli from the parent truapi checkout runs against Switch to Rust core #70 directly; this branch layers cleanly on top.

pgherveou added 14 commits July 15, 2026 11:03
Replace the Nova host-container, auth, and signing path with the worker-backed Rust core. Keep dotli responsible only for browser policy, persistence, UI, and physical chain transports.
Notification grants do not alter iframe Permissions Policy. Reloading disposed the in-flight Rust request before its response reached the product.
The pending-message flush drops send failures silently, matching the
pre-port behavior. Surfacing them as JSON-RPC errors moves to a
follow-up PR with test coverage.
…follow-up

Keep @polkadot-api/signer and @polkadot-labs/hdkd{,-helpers} declared
(unused since before the port) and limit rpc-chain tests to the new
core gateway provider surface. Removing the dead deps and adding
coverage for pre-existing chain checks moves to a follow-up PR.
Keep the base panel top offset and suffix-based terminator matching
(minus the removed host-papp events). The offset correction, the
exact-match terminator set, and the @dotli/config dependency
declaration move to a follow-up PR.
Prompts always reach the modal, matching the pre-port behavior. The
sliding-window limiter returns in a follow-up PR together with the
denied-path semantics and a test that trips the window.
AllowanceKeys persist as plain hex through the same path as every
other core storage key. The at-rest cipher moves to a follow-up PR
where the scheme (per-write nonce, plain-hex read fallback) can get a
focused security review.
The bridge emits only the first_inbound/first_outbound lifecycle
events. The per-frame TrUAPI tap that feeds the debug panel timeline
returns in a follow-up PR; the panel's truapi event handling stays in
place and receives no events until then.
… follow-up

Login failures fall back to the raw reason except for the base
OriginPersonProviderError mapping, and the permissions popover renders
last-write-wins without a staleness guard or unavailable-state hint.
The failure-message pack and popover hardening move to a follow-up PR.
…i-host 0.1.0

The published packages replace the temporary personal-scope npm
aliases used while the port was in review.
@github-actions

Copy link
Copy Markdown
Contributor

⚡ Performance Report

⚠️ No baseline found on main. This PR's results are recorded but cannot be compared.
Merge to main to establish a baseline.

@github-actions

github-actions Bot commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Bundle Size Report

Chunks over 500 KB:

File Raw Brotli Gzip
host/assets/paseo.smol-DboPaEh1.json 1.84 MB 941.7 KB 1019.4 KB
host/assets/paseo-people-next.smol.json 3.36 MB 1.68 MB 1.82 MB
host/assets/previewnet.smol.json 1.88 MB 181.4 KB 353.0 KB
host/assets/smoldot.js 2.98 MB 2.21 MB 2.22 MB
host/assets/smoldot_worker.js 2.95 MB 2.21 MB 2.21 MB
host/assets/wasm/web/truapi_server_bg.wasm 1.96 MB 617.3 KB 812.7 KB
Total 15.91 MB (+5.12 MB) 8.11 MB (+2.88 MB) (-49%) 8.74 MB (+3.09 MB)
All files
File Raw Brotli Gzip
host/.well-known/apple-app-site-association 738 B 738 B 738 B
host/.well-known/assetlinks.json 1.3 KB 317 B 391 B
host/assets/bridge.js 75.2 KB (+69.8 KB) 20.3 KB (+18.5 KB) 23.3 KB (+21.3 KB)
host/assets/browser.js 22.9 KB (-10 B) 7.6 KB (-12 B) 8.6 KB (-9 B)
host/assets/client.js 100.1 KB (+6.9 KB) 29.4 KB (+2.0 KB) 32.5 KB (+2.2 KB)
host/assets/dist.js 30.3 KB (+5.5 KB) 10.5 KB (+2.8 KB) 11.7 KB (+3.1 KB)
host/assets/dotli-debug-bus.js 710 B (+215 B) 710 B (+215 B) 710 B (+215 B)
host/assets/get-sync-provider.js 2.8 KB 1.1 KB 1.2 KB
host/assets/hex.js 154 B 154 B 154 B
host/assets/index.js 155.6 KB (+49.0 KB) 42.9 KB (+13.7 KB) 50.3 KB (+16.4 KB)
host/assets/index.css 44.8 KB (-3.1 KB) 7.1 KB (-382 B) 7.9 KB (-423 B)
host/assets/manifest.js 22.5 KB (-130 B) 7.2 KB (-31 B) 7.9 KB (-76 B)
host/assets/panel.js 72.6 KB (-12.2 KB) 19.7 KB (-3.3 KB) 22.3 KB (-4.0 KB)
host/assets/paseo.smol-DboPaEh1.json 1.84 MB 941.7 KB 1019.4 KB
host/assets/paseo-people-next.smol.json 3.36 MB 1.68 MB 1.82 MB
host/assets/paseo.smol.json 25.4 KB 4.9 KB 5.6 KB
host/assets/previewnet.smol.json 1.88 MB 181.4 KB 353.0 KB
host/assets/resolve.js 128 B (-24 B) 128 B (-24 B) 128 B (-24 B)
host/assets/rpc-resolve.js 2.4 KB (-71 B) 1.0 KB (-39 B) 1.1 KB (-31 B)
host/assets/shared-mode.js 1.8 KB (-82 B) 748 B (-45 B) 849 B (-46 B)
host/assets/smoldot.js 2.98 MB 2.21 MB 2.22 MB
host/assets/smoldot_worker.js 2.95 MB 2.21 MB 2.21 MB
host/assets/src.js 1.8 KB (-119 B) 848 B (-42 B) 944 B (-57 B)
host/assets/styles.css 15.1 KB 3.2 KB 3.8 KB
host/assets/wasm/web/README.md 10.9 KB 10.9 KB 10.9 KB
host/assets/wasm/web/package.json 371 B 371 B 371 B
host/assets/wasm/web/truapi_server.d.ts 6.9 KB 6.9 KB 6.9 KB
host/assets/wasm/web/truapi_server.js 35.6 KB 6.2 KB 7.2 KB
host/assets/wasm/web/truapi_server_bg.wasm 1.96 MB 617.3 KB 812.7 KB
host/assets/wasm/web/truapi_server_bg.wasm.d.ts 2.5 KB 2.5 KB 2.5 KB
host/assets/web.js 13.2 KB 3.6 KB 4.0 KB
host/assets/worker-runtime.js 6.3 KB 1.6 KB 1.8 KB
host/assets/worker-runtime.js 106 B 106 B 106 B
host/assets/ws.js 23.1 KB (-2.8 KB) 7.5 KB (-877 B) 8.2 KB (-940 B)
host/dotli.png 11.5 KB 11.5 KB 11.5 KB
host/favicon.svg 1.8 KB 1.8 KB 1.8 KB
host/host-sw.js 2.7 KB (-110 B) 1.1 KB 1.2 KB (-10 B)
host/icon-192.png 12.5 KB 12.5 KB 12.5 KB
host/icon-512.png 42.8 KB 42.8 KB 42.8 KB
host/index.html 19.9 KB (-320 B) 4.4 KB (-69 B) 5.4 KB (-72 B)
host/manifest.webmanifest 441 B 441 B 441 B
host/workbox.js 14.8 KB 4.6 KB 5.1 KB
sandbox/app-sw.js 9.6 KB 3.1 KB (+8 B) 3.5 KB (+2 B)
sandbox/assets/bitswap-bridge.js 840 B 840 B 840 B
sandbox/assets/fetch.js 3.4 KB 1.2 KB 1.4 KB
sandbox/assets/index.js 118.0 KB 33.7 KB (+2 B) 39.6 KB
sandbox/assets/index.css 44.8 KB (-3.1 KB) 7.1 KB (-382 B) 7.9 KB (-423 B)
sandbox/favicon.svg 1.8 KB 1.8 KB 1.8 KB
sandbox/index.html 1.7 KB 582 B (-2 B) 786 B (-1 B)
Total 15.91 MB (+5.12 MB) 8.11 MB (+2.88 MB) (-49%) 8.74 MB (+3.09 MB)

Commit: 4775909

pgherveou and others added 26 commits July 20, 2026 11:40
PAPI registers Function.prototype as a WebSocket no-op. Sentry's BrowserApiErrors wrapper then marks the prototype and makes later event listeners resolve to that no-op.
Resolve the dependency audit advisories by locking patched fast-uri and brace-expansion releases within existing dependency ranges.
Independent providers drained the same smoldot response queue, allowing
concurrent Statement Store calls to steal replies.
Override AJV's transitive fast-uri to 3.1.4 to address
GHSA-v2hh-gcrm-f6hx.
…ge-in-core-dotli

# Conflicts:
#	packages/metrics/src/sentry.ts
…ermissions popover

Map slot-exhaustion, rejected-transaction, and JSON-RPC registration
failures to actionable copy with the raw reason as a detail line, and
guard the async permissions popover against stale renders with an
unavailable-state fallback.
Wrap each core provider so every inbound/outbound wire frame is
decoded and emitted on the dotli debug bus when the panel is
listening, restoring per-frame protocol traffic in the timeline.
AllowanceKeys slots are AES-GCM encrypted before hitting localStorage.
Known issues to resolve before merge: derive a random per-write nonce
(the current fixed nonce is obfuscation, not encryption) and accept
the plain-hex format written before this change as a read fallback.
Prompt-driven host callbacks share a 20-per-10s sliding window so a
hostile product cannot flood the host with modal prompts.
Align the docked panel with the 56px topbar iframe, close system flows
by exact layer:event names so setup_ready no longer false-matches the
ready suffix, and declare the @dotli/config dependency that
chain-registry already imports.
Remove @polkadot-api/signer and @polkadot-labs/hdkd{,-helpers}, which
nothing in the resolver imports, and cover isChainSupported and the
pre-existing rpc-chain provider behavior with unit tests.
Failed sends flushed after chainConnect resolve to JSON-RPC error
responses, matching the direct send path, so polkadot-api's client
sees the failure instead of hanging.
Backend read failures no longer push a terminal error into the
preimage lookup subscription, so the stream keeps polling and slow
Bulletin/IPFS propagation surfaces as a late result instead of a
permanent failure. Gateway mode logs that sandbox bitswap is
unavailable rather than advertising the Bulletin chain.
Ref-count upstream tokens shared by local sessions and buffer
subscription events that arrive before their token response. Broker
transport hardening kept separate from the Rust host migration.
@valentinfernandez1
valentinfernandez1 force-pushed the codex/dotli-rust-port-follow-ups branch from 7728508 to a33bfdb Compare July 23, 2026 18:17
Base automatically changed from codex/bulletin-preimage-in-core-dotli to main July 24, 2026 01:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants