Skip to content

Rust-core port follow-ups#77

Open
pgherveou wants to merge 9 commits into
codex/bulletin-preimage-in-core-dotlifrom
codex/dotli-rust-port-follow-ups
Open

Rust-core port follow-ups#77
pgherveou wants to merge 9 commits into
codex/bulletin-preimage-in-core-dotlifrom
codex/dotli-rust-port-follow-ups

Conversation

@pgherveou

@pgherveou pgherveou commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

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 Swith 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 Swith to Rust core #70 directly; this branch layers cleanly on top.

@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.78 MB 137.2 KB 333.5 KB
host/assets/smoldot.js 2.95 MB 2.20 MB 2.21 MB
host/assets/smoldot_worker.js 2.92 MB 2.19 MB 2.20 MB
host/assets/wasm/web/truapi_server_bg.wasm 1.95 MB 614.4 KB 808.7 KB
Total 15.72 MB (+5.06 MB) 8.03 MB (+2.85 MB) (-49%) 8.67 MB (+3.06 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 51.5 KB (+46.2 KB) 14.3 KB (+12.5 KB) 16.1 KB (+14.0 KB)
host/assets/browser.js 22.9 KB (-10 B) 7.6 KB (+13 B) 8.6 KB (-8 B)
host/assets/client.js 100.1 KB (+7.1 KB) 29.4 KB (+2.1 KB) 32.4 KB (+2.3 KB)
host/assets/dist.js 30.3 KB (+5.5 KB) 10.5 KB (+2.7 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 150.4 KB (+43.8 KB) 41.5 KB (+12.5 KB) 48.7 KB (+14.8 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 (-63 B) 7.9 KB (-64 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 19.7 KB 4.8 KB 5.4 KB
host/assets/previewnet.smol.json 1.78 MB 137.2 KB 333.5 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 (-16 B) 1.1 KB (-34 B)
host/assets/shared-mode.js 1.8 KB (-82 B) 751 B (-42 B) 851 B (-46 B)
host/assets/smoldot.js 2.95 MB 2.20 MB 2.21 MB
host/assets/smoldot_worker.js 2.92 MB 2.19 MB 2.20 MB
host/assets/src.js 1.8 KB (-119 B) 864 B (-26 B) 946 B (-53 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.95 MB 614.4 KB 808.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.5 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 (-872 B) 8.2 KB (-921 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 (-14 B) 1.2 KB (-11 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 (-66 B) 5.4 KB (-71 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 (+6 B) 3.5 KB (+3 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 (-1 B)
sandbox/assets/index.js 118.0 KB 33.7 KB (-32 B) 39.6 KB (+3 B)
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 581 B (-1 B) 786 B (-1 B)
Total 15.72 MB (+5.06 MB) 8.03 MB (+2.85 MB) (-49%) 8.67 MB (+3.06 MB)

Commit: 0d29ff7

@pgherveou pgherveou changed the title Post-port hardening, diagnostics, and UX polish Rust-core port follow-ups Jul 15, 2026
…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.
@pgherveou pgherveou force-pushed the codex/dotli-rust-port-follow-ups branch from b808f13 to 7728508 Compare July 15, 2026 14:59
@github-actions

github-actions Bot commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

E2E Product suite failed on 77285088a0a78824f32c86332bd7ec49a16d0e0b — 26 passed, 35 failed, 1 skipped.

Failed tests:

  • Product is ready
  • Get Product Account
  • Product Signer
  • Account Connection Status
  • Product Account Alias
  • Request Login
  • Get User Identity
  • Subscribe Theme
  • Derive Entropy
  • Well-Known Chains
  • StatementStore Allowance
  • Bulletin Allowance
  • Smart-Contract Allowance
  • All Allowances
  • String Write & Read
  • Bytes Write & Read
  • JSON Write & Read
  • Clear
  • Factory
  • Feature Check
  • Remote: HTTP/WS
  • Remote: WebRTC
  • Remote: Chain Submit
  • Remote: Preimage Submit
  • Remote: Statement Submit
  • Create Proof Authorized
  • Legacy Submit Is Unavailable
  • Subscribe Match All
  • Subscribe Match Any
  • HTTP URL
  • Polkadot URL
  • In-App
  • Chain Spec: Genesis Hash
  • Chain Spec: Chain Name
  • Chain Spec: Properties

Logs: https://github.com/paritytech/dotli-community/actions/runs/29426103952
Artifacts: e2e-product-results (uploaded above) — open the failed test's trace.zip with npx playwright show-trace.

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.

1 participant