Switch to Rust core#70
Conversation
Bundle Size ReportChunks over 500 KB:
All files
Commit: 2a478cf |
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
⚡ Performance Report
|
fca2d01 to
ede458e
Compare
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.
ff8115e to
95b810c
Compare
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.
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.
|
Hi, I have created this tracking issue. If you happen to find any bugs while testing this branch please add it on the issue so we can investigate. Please add details, steps to reproduce, etc. |
There was a problem hiding this comment.
Approved. I still have some issues when using smoldot as described here, but I think we should merge it. It seems the main branch is no longer compatible with a few methods, as their enum values have changed.
Nice thanks we will look into these extra smoldot issues. |
…ge-in-core-dotli # Conflicts: # packages/metrics/src/sentry.ts
TarikGul
left a comment
There was a problem hiding this comment.
Did one more code review - looks solid from that perspective.
|
I'm fine if you want to merge I can keep investigating the smoldot issues on the side |
1edd74e
TarikGul
left a comment
There was a problem hiding this comment.
Okay so worked back and forth with claude for a while investigating 2 bugs, and instead of just writing per line I had the reproducible and fixes documented, they are shared here with some other nits: https://gist.github.com/TarikGul/df0ec350fc436449846bf779ec9ee7d3
TarikGul
left a comment
There was a problem hiding this comment.
Chatted with @valentinfernandez1 about the gist above. BR-1 good for a follow up - LGTM lets get it merged :)
Port the dot.li web host to the shared TrUAPI Rust core
This supersedes #54 and keeps its Rust-runtime port while adding the Bulletin preimage path now owned by the core. dot.li moves off the
@novasamatech/host-apistack and onto the shared TrUAPI Rust core. Protocol logic previously maintained in TypeScript now lives once intruapi-server(Rust -> WASM); the web host becomes a byte transport plus typed platform callbacks.Architecture
A product iframe speaks TrUAPI over a
MessageChannel. The host forwards SCALE frames to a Web Worker runningtruapi-serverWASM without decoding the protocol. The core executes protocol logic and calls typedtruapi-platformcallbacks for browser capabilities.The same core is embedded by native hosts over UniFFI, keeping protocol behavior and wire formats aligned across platforms.
Changed surface
packages/auth, the old Nova container/statement-store adapters, allowance-signer bridge, wallet queue, and related@novasamatech/*dependencies.@parity/truapi-hostand@parity/truapi.Permission grants are core-owned state. The dot.li topbar admin screen projects them into browser-specific iframe permissions and reload behavior rather than maintaining a second protocol policy store.
Legacy product compatibility
Existing applications such as
host-playgroundstill use the Nova host wrapper. Nova exposes synthetic PAPI chain-head follow IDs such asfollow_0, while the Rust core intentionally requires the exact wire request ID from the follow subscription start frame. Passing the synthetic ID through makes otherwise valid legacy header, body, storage, call, unpin, continue, and stop-operation requests fail core validation.The legacy window bridge now tracks active follow wire IDs per genesis hash and rewrites only those follow-bound legacy frames. Modern
MessagePortproducts are unchanged, and strict subscription-ID validation remains in the shared Rust core. Keeping this compatibility at the deprecated boundary also avoids a new TrUAPI package release solely for a host-specific migration shim.Packages
This branch depends on the published
@parity/truapi@0.4.0and@parity/truapi-host@0.1.0.bun run link:truapiswaps them for symlinks to a sibling TrUAPI checkout (andunlink:truapirestores the published packages), so the parent truapi repo'smake e2e-dotliruns against this branch directly while a direct dotli checkout installs and tests the published packages.Scope
The primary PR contains only the Nova-stack removal, the typed Rust-runtime host architecture, the Bulletin preimage integration, and the permission-lifecycle behavior required to keep Rust callback requests alive. Everything else is consolidated in the stacked follow-up #77: preimage lookup retries, protocol-broker hardening, login-failure UX copy, permission-prompt rate limiting, allowance-key at-rest encryption, the per-frame wire debug tap, debug-panel fixes, resolver dependency hygiene, and chainSend flush error surfacing.
Deferred architecture work: SharedWorker topology, eliminating the per-CID
*.app.dot.lisandbox iframe, and moving content fetching into Rust behind thePreimageHostboundary.Left before merge
@parity/truapiand@parity/truapi-host, and depend on the published versions.Related
Verification
Primary branch:
bun install --frozen-lockfilebun run format:checkbunx --bun turbo run lint --forcebunx --bun turbo run typecheck --forcebunx --bun turbo run test --forcebunx --bun turbo run build:prod --forcebun auditCompatibility patch:
make testpasses.make e2e-dotliruns each completed 43 methods successfully, including everyChain/*legacy compatibility method. The sole failure in both runs wasPreimage/lookup_subscribe: the external signer-bot authority request timed out at its 45-second boundary. A subsequent authority request in each run succeeded, isolating the failure from the chain bridge patch.