fix(deploy): surface allowance approvals in the TUI, drop guessed step totals#278
Merged
Merged
Conversation
…p totals Phone-mode deploys send RFC-0010 Bulletin allowance requests (first-use slot grant, quota Increase) over the statement store outside any PolkadotSigner, so the signing proxy never saw them: the phone showed an approval dialog while the terminal sat silent. getBulletinAllowanceSigner now takes an onPrompt hook, fired only when a tap will actually happen (cache-miss probe mirrors ensureSlotAccountSigner's own decision), and deploy/decentralise thread a createApprovalPrompt built on the shared step counter into every resolution site, including the metadata-upload retry. The step counter also no longer carries a predicted total. The plan regularly drifted from what bulletin-deploy actually submitted (a predicted setUserPopStatus the runtime skipped stranded users on "step 4 of 5" with no fifth step), and allowance taps are demand-driven so they can never be counted up front. Prompts now read "approve step 1", "approve step 2", ... and the pre-deploy summary labels its count as expected, noting the possible extra Bulletin allowance approval. Init's fixed 1-of-1 callouts keep their explicit total.
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
Two related UX failures in phone-mode
playground deploy/playground decentralise(observed in field testing, 4 June):Increasetop-up) travel over the statement store outside anyPolkadotSigner, so the signing proxy never saw them. The phone showed "Product dot-cli requests resource allocation" while the terminal sat silent — users had no idea a tap was being waited on. With slot grants observed at ~10 txs / 4 MiB and chunks at 2 MiB, the Increase tap recurs on most deploys.setUserPopStatusthe runtime skipped), stranding users on "step 4 of 5" with no fifth step. Allowance taps additionally were never counted, so phone taps and the counter disagreed.Changes
signingProxy.ts: newcreateApprovalPrompt(counter, onEvent)emits the existingsign-request/sign-complete/sign-errorevents around non-signer phone taps, sharing the deploy's step counter — one continuous sequence across signing and allowance approvals.allowances/bulletin.ts:getBulletinAllowanceSignertakes an optionalonPrompt(AllowancePrompt). Fires "Grant Bulletin storage allowance" only on a real slot-key cache miss (probe mirrorsensureSlotAccountSigner's own hit/miss decision) and "Increase Bulletin storage allowance" around the quota top-up. Errors fail the prompt and rethrow; handles close exactly once on every path.resolveStorageSignerOptions(chunk-upload slot key),publishToPlayground(metadata upload incl. the Payment-error retry), in bothdeployanddecentralise, interactive TUI and headless output.createSigningCounter()no longer takes a predicted total;SigningEventcarries onlystep. Prompts read "approve step 1", "approve step 2", …PhoneApprovalCallout'stotalis now optional — init's fixed 1-of-1 flows keep passing it.Not in scope
pg initrequest redelivered by the statement store — needs an upstream mobile/host-papp fix.pg initre-requesting all three resources when only the bulletin quota is exhausted (AccountSetup.tsx) — candidate follow-up.Verification
pnpm test: 643/643 (7 new tests: prompt fires on cache miss / Increase, stays silent on cache hit, fail paths, counter continuity, dev-mode hint gating)pnpm format:check,pnpm lint:license: cleantsc --noEmit: 13 errors — exactly the pre-existing baselinesrc/utils/deploy/(RevX surface intact); no e2e consumers of the removedtotalfield