feat(server): build, sign, and submit Bulletin preimages in the core#270
Merged
Conversation
Adds the canonical testing module (api/testing.rs) and its v01/v02/versioned wiring used by the Rust host runtime and generated clients.
New crate defining the host syscall traits (storage, navigation, consent, permissions, ...) that host runtimes implement. Types are re-exported from truapi::versioned/v01 rather than redefined.
WASM host runtime that hosts implement: dispatcher, SCALE frames, subscription streams, chain runtime, host logic (sessions, SSO pairing, permissions, statement store, dotns) and the wasm bindings. Includes the committed generated dispatcher/wire-table under src/generated/.
…backs Extends the rustdoc-JSON code generator to emit the Rust dispatcher and wire table consumed by truapi-server, plus the TS host-callbacks adapter. Golden tests pin the emitted shapes.
New WASM-backed host runtime package embedding the Rust core, with web iframe and Web Worker entry points. Updates the @parity/truapi client (SCALE, sandbox, transport) and drops the obsolete explorer 0.3.2 codegen snapshot.
Updates CLAUDE.md/README, CI workflows, Makefile, deny.toml, changesets, and linguist attributes for generated code, and bumps the dotli submodule to the host integration that consumes the WASM runtime.
Adds the canonical testing module (api/testing.rs) and its v01/v02/versioned wiring used by the Rust host runtime and generated clients.
New crate defining the host syscall traits (storage, navigation, consent, permissions, ...) that host runtimes implement. Types are re-exported from truapi::versioned/v01 rather than redefined.
…backs Extends the rustdoc-JSON code generator to emit the Rust dispatcher and wire table consumed by truapi-server, plus the TS host-callbacks adapter. Golden tests pin the emitted shapes.
…core # Conflicts: # .github/workflows/ci.yml # .github/workflows/release.yml # .gitignore # CLAUDE.md # Makefile # hosts/dotli # js/packages/truapi-host/scripts/build-wasm.mjs # js/packages/truapi-host/src/adapter-support.ts # js/packages/truapi-host/src/host-callbacks-adapter.test.ts # js/packages/truapi-host/src/runtime.ts # js/packages/truapi-host/src/web/create-iframe-host.test.ts # js/packages/truapi-host/src/web/create-iframe-host.ts # js/packages/truapi-host/src/web/create-worker-host-runtime.ts # js/packages/truapi-host/src/web/worker-provider.test.ts # js/packages/truapi-host/src/worker-protocol.ts # js/packages/truapi-host/src/worker-runtime.ts # js/packages/truapi/src/sandbox.ts # playground/src/lib/auto-test.ts # playground/tests/e2e/dotli-diagnosis.ts # playground/tests/e2e/dotli/helpers/signer-bot.ts # rust/crates/truapi-codegen/src/rust/wasm_bridge.rs # rust/crates/truapi-codegen/src/ts/host_callbacks.rs # rust/crates/truapi-codegen/tests/golden/host-callbacks-adapter.ts # rust/crates/truapi-codegen/tests/golden/host-callbacks.ts # rust/crates/truapi-codegen/tests/golden/wasm_bridge.rs # rust/crates/truapi-codegen/tests/golden/worker-callbacks.ts # rust/crates/truapi-codegen/tests/golden_rust_emit.rs # rust/crates/truapi-server/src/runtime.rs # rust/crates/truapi-server/src/wasm.rs # rust/crates/truapi-server/src/wasm/generated_bridge.rs
Keep physical provider ownership in hosts while moving shared chain behavior and Subxt-backed handling into Rust. Harden Bulletin retries and host lifecycle coverage.
valentinfernandez1
approved these changes
Jul 13, 2026
valentinfernandez1
left a comment
Collaborator
There was a problem hiding this comment.
Overall looks good to me just some small nits.
Apply propagation waits per block so scheduling delay cannot race the block-limit test. Keep allowance allocation, refresh, and submission within one 60-second deadline.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Preimage submission to the Bulletin chain now happens entirely inside the Rust core (
truapi-server).The core builds, signs, and submits the
TransactionStorage.storeextrinsic itself, routing chain traffic through the host's existingchain.connectJSON-RPC pipe.Previously the core handed the host a signing capability and the host built and submitted the transaction with PAPI.
That seam is gone. As a result:
Ownership: before vs after
The topology is unchanged (the core still reaches the network only through the host).
What changes is ownership.
Before, the secret bytes were core-owned but the capability to use them, and the decision of what gets signed, was host-owned:
After, everything signing-related sits on the core side; during submission the host just forwards opaque JSON-RPC text:
Submit flow
Changed surface
host_logic/extrinsic.rs: offline subxt assembler (config-pinnedSubstrateConfig, sr25519 signer, metadata / validity / events / header decoders).host_logic/bulletin.rs:store{data}build + sign; the call is resolved by name from the fetched metadata, with a hard check that thedataargument really is a byte sequence.runtime/bulletin_rpc.rs: the submit flow above + typed errors.runtime.rs:Preimage::submitordering with one allowance refresh + retry on rejection;lookup_subscribecache + integrity check.truapi-platform:PreimageHostkeeps onlylookupPreimage;BulletinAllowanceKeyzeroized on drop; host configs require the Bulletin genesis hash (runtimeConfig.bulletin.genesisHashon the TS side).@parity/truapi-host) + dotli submodule: signer bridge removed; dotli keeps content lookup only (smoldotbitswap_v1_get, or IPFS gateway in RPC-gateway mode) and serves Bulletinchain.connecton both its light-client and RPC-gateway backends.