fix: phone-mode deploy signing, slot key derivation, and session selection#276
Merged
Merged
Conversation
…ction - Bump bulletin-deploy to 0.8.3 and pass the BulletInAllowance slot key as storageSigner so Bulletin chunk uploads never route through the phone. The statement-store channel caps messages far below the 2 MiB chunk size, which surfaced as 'Mobile transaction signing rejected: message too big' with no prompt ever reaching the phone. - Derive the slot signer with schnorrkel x8 scalar normalization. The SDK's createSlotAccountSigner derives an address the chain never authorized (verified on-chain), which silently dropped storage onto the shared pool account where nonce races killed chunks with AncientBirthBlock. - Check the slot's quota against the estimated upload size before starting, with a single Increase approval on the phone when short; warn and proceed on a residual shortfall rather than blocking. - Fast-fail phone signing within ~200ms when the statement-store allowance has expired (it lapses ~2 days after login and cannot be renewed remotely), with a logout/init remedy, instead of hanging for minutes on a misleading 'transaction watcher silent' timeout. - Record the login time and warn at deploy preflight when the session is older than 2 days. - Select the newest paired session everywhere and prune stale sessions on login. Requests no longer disappear into dead sessions after re-pairing, which is what made 'pg init' allowance approvals never reach the phone. - Document the bun-does-not-typecheck reality and the current tsc error baseline in CLAUDE.md.
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
Contributor
|
Dev build ready — try this branch: |
Contributor
E2E Test Pass · ✅ PASSTag:
Sentry traces: view spans for this run |
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.
Problem
Phone-mode
pg deployfailed in three stacked ways, andpg initallowance requests could silently never reach the phone:signerroutes Bulletin STORAGE through it too. Chunk txs carry up to 2 MiB of callData; the phone signing channel (statement store) rejects messages client-side far below that (4 KiB on the pinned host-papp 0.7.9; the Android app caps statements at 256 KiB regardless), so every chunk died before the phone was contacted.AncientBirthBlockchunk failures. The SDK'screateSlotAccountSignerderives the wrong public key from phone-issued 64-byte slot keys (missing schnorrkel x8 scalar normalization). Verified on-chain: the phone's grant sits on the normalized address; the SDK-derived address has no authorization. bulletin-deploy therefore silently fell back to its shared testnet pool account, where other users' pending transactions create nonce gaps and mortal chunk txs (16-block era) expire while queued.NoAllowanceErrorwithout rejecting, so signing hung for the 180s SDK timeout under a misleading "transaction watcher silent" error.sessions[0](the OLDEST) everywhere, so after a re-pair, requests (including init's allowance approval) were sent into a session the phone no longer serves, disappearing with no error.Fixes
storageSignersupport) and thread the BulletInAllowance slot key asstorageSigner/storageSignerAddressin phone mode (resolveStorageSignerOptions, wired into deploy and decentralise). DotNS and registry publish keep the phone signer.allowances/slotSigner.ts: correct schnorrkel-normalized derivation, frozen-vector tested, byte-exact mirror of bulletin-deploy's storage-signer.correctedSlotSignerswaps the SDK signer after everyensureSlotAccountSigner/createSlotAccountSignercall, reading the cache from the adapter's own storage namespace. Fixes the storage, metadata, and contract allowance paths at once.deploy/storageQuota.ts: pre-upload quota check against the estimated upload size with a one-tap Increase when short. Warn-and-proceed on residual shortfall (whether the chain enforces the extent is unconfirmed; per the bulletin-deploy author, the authorization is what counts), never blocks.wrapSignerWithSssFastFail: detectsNoAllowanceErrorduring phone signing and rejects within ~200ms with aplayground logout/playground initremedy. Re-entrant console interception, interval cleaned up on every path.loginStamp.ts: records login time (cleared by logout); deploy preflight warns when the session is older than 2 days. Warn-only, missing stamp produces no output.newestSession()in auth.ts: all flows operate on the most recent pairing;waitForLoginbest-effort disconnects stale older sessions after a successful login.pnpm build(bun) does not typecheck and the tree carries a 13-errortsc --noEmitbaseline (burn-down + CI step is an open follow-up).Testing
pnpm format:check,pnpm lint:license,pnpm buildgreen;tsc --noEmiterror count unchanged from the pre-existing baseline (13).pg initallowance grant now arrives after re-pairing; chunk uploads sign locally with no phone prompts.Upstream follow-ups (not in this PR)
createSlotAccountSignermust normalize 64-byte schnorrkel keys (root cause of the wrong-address derivation; this PR carries a local workaround to delete once fixed).AncientBirthBlockJSON deserves a friendly message.Changeset included (
patch).