Headless pairing + signing hosts for local e2e (signing-bot replacement)#264
Draft
pgherveou wants to merge 4 commits into
Draft
Headless pairing + signing hosts for local e2e (signing-bot replacement)#264pgherveou wants to merge 4 commits into
pgherveou wants to merge 4 commits into
Conversation
Add a `truapi-host` binary with three roles that replace the external signing-bot for local end-to-end testing: - `relay`: an in-memory statement-store the two hosts pair over. - `pairing-host`: a seedless host (PairingHostRuntime) that presents a pairing deeplink and bridges product byte-frames over WebSocket. - `signing-host`: a wallet-local host (SigningHostRuntime) that answers the handshake and auto-signs, driven by the new SSO responder. truapi-server gains the §B responder half and the signing-host operations it needs: encode-side handshake helpers and responder codecs in `host_logic/sso/`, v4 extrinsic assembly (`host_logic/transaction.rs`), `runtime/signing_host/sso_responder.rs`, and `sign_payload` / `create_transaction` on the signing host. Product accounts and `rootUserAccountId` derive from `//wallet` (host-spec C.0/C.5) via a new sr25519 hard-junction helper. Bandersnatch ring-VRF product-account aliases (`get_account_alias`) use the `verifiable` crate, and lite-username attestation (`host_logic/attestation.rs` + CLI) registers a People-chain username so `get_user_id` resolves; the pairing host can resolve usernames from the real People chain while SSO stays on the relay (`identity_chain_genesis_hash`). The bun e2e driver (`e2e/`) runs the playground's own generated example sources against the pairing host and writes `explorer/diagnosis-reports/ headless.md`. With `E2E_LIVE_CHAIN=1` and a registered signer account it matches the browser host on every method it passes (43/44; the lone failure is a chain example that sends a deliberately-invalid operation id).
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
The stop_transaction playground example used a hardcoded placeholder operationId; it now broadcasts a transaction and stops it with the returned id, the correct usage. Also emit captured example output for passing methods in the headless diagnosis report and load the e2e signer mnemonic from a gitignored e2e/.env. Note: against the public paseo Asset Hub RPC, transaction_v1_stop rejects broadcast operation ids (-32602), so this method stays red there; it passes on hosts whose transaction API honors stop (e.g. smoldot in the browser host).
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.
Adds a
truapi-hostCLI with three roles that stand in for the externalsigning-bot in local end-to-end tests, plus the truapi-server work they need.
Roles (one
truapi-hostbinary)PairingHostRuntime; presents the pairingdeeplink and bridges product byte-frames over WebSocket.
SigningHostRuntime; answers the handshakeand auto-signs via the new SSO responder.
truapi-server additions
host_logic/sso/,runtime/signing_host/sso_responder.rs.sign_payloadandcreate_transactionon the signing host, with v4extrinsic assembly (
host_logic/transaction.rs).rootUserAccountIdnow derive from//wallet(host-spec C.0/C.5) via a new sr25519 hard-junction helper.
get_account_alias) via theverifiablecrate (native-only; wasm unaffected).
host_logic/attestation.rs+ CLI) and a decoupledidentity-lookup chain (
PairingHostConfig::identity_chain_genesis_hash) soget_user_idresolves a real People-chain username while SSO stays hermetic.E2E
rust/crates/truapi-host-cli/e2e/runs the playground's own generated examplesources against the pairing host and writes
explorer/diagnosis-reports/ headless.md(same shape asweb.md). WithE2E_LIVE_CHAIN=1and a registeredsigner account it matches the browser host on every method it passes — 43/44
non-skipped; the lone failure (
Chain/stop_transaction) is a playground examplethat sends a deliberately-invalid operation id, which the real RPC node rejects
(the browser host only passes it because smoldot tolerates unknown ids).
Verification:
cargo build/clippy -D warnings/testworkspace-wide,cargo +nightly fmt --check, andcargo check --target wasm32all green.Notes for reviewers
worktree-issue-96-rust-core-porton origin is a couplecommits behind this branch's fork point, so this PR currently shows two
parent-stack commits (
firs batch,wip) in addition to the headless-hostcommit; they drop out once the base is updated on origin.
needed only for
get_user_id) is read from a gitignorede2e/.env; it isnot committed. Ring-onboarding makes first-time attestation slow, so the e2e
uses an already-registered account.
make e2e-dotli.Draft: implementation + local e2e are complete and green; opening for review.