Skip to content

feat: migrate to product-sdk 0.9 (createTransaction signing, SDK allowances, cloud-storage, contracts 0.7)#245

Merged
UtkarshBhardwaj007 merged 14 commits into
mainfrom
feat/product-sdk-0.9-migration
Jun 3, 2026
Merged

feat: migrate to product-sdk 0.9 (createTransaction signing, SDK allowances, cloud-storage, contracts 0.7)#245
UtkarshBhardwaj007 merged 14 commits into
mainfrom
feat/product-sdk-0.9-migration

Conversation

@UtkarshBhardwaj007
Copy link
Copy Markdown
Member

Summary

  • Session signer now routes tx signing through host-papp createTransaction (RFC-0020) via @parity/product-sdk-terminal@0.3.0 — the wallet builds and signs the extrinsic, so chain-declared signed extensions (AsPgas, AuthorizeValueTransfer, …) are forwarded verbatim, structurally eliminating the "PJS does not support this signed-extension" failures. The CLI keeps deriving the product-account key (sessionSigner.ts) and always feeds it to the SDK signer.
  • RFC-0010 allowances move wholesale to @parity/product-sdk-terminal/host: the SDK's slot-key cache (~/.polkadot-apps/<appId>_AllowanceKeys.json) replaces our local shim, grant markers (~/.polkadot/allowances.json) and slot-key store (allowance-keys.json). All three resources (Bulletin, Statement Store, smart-contract gas) are requested in one dialog; getBulletinAllowanceSigner keeps the on-chain quota check with a single Increase retry.
  • @parity/product-sdk-bulletin@parity/product-sdk-cloud-storage (its successor; calculateCid, checkAuthorization, CloudStorageApi).
  • Contracts 0.7.0: flat cdm.json + ContractManager.fromLiveClient replaces the hand-rolled live address resolution. Registry address and "@w3s/playground-registry": "latest" stay identical to playground-app — runtime convergence via the live CDM registry.
  • bulletin-deploy 0.7.29 → 0.8.1 (verified additive for every surface we touch). polkadot-api deduped to a single 2.1.5. postinstall WASM patch removed (obsolete).

The novasama pin (read before touching overrides)

@novasamatech/* is force-pinned to 0.7.9 via pnpm.overrides, with a small pnpm patch on product-sdk-terminal restoring the metadataUrl option:

  • host-papp 0.8 emits a V2 pairing QR (SCALE discriminant 0x01) that the mobile app cannot decode — its native handshake codec is V1-only, verified at app build 1227 and Android repo HEAD. Scanning shows "Invalid QR code".
  • Upstream guidance (host-papp maintainers): stay on 0.7.9 for now — the V2 handshake ships with multi-device support, which is not merged yet.
  • host-papp 0.7.9 keeps the V1 QR while exposing a byte-identical createTransaction codec, so the signing fix is unaffected.
  • The V1 QR embeds a metadata URL the phone fetches for the Sign-In screen; terminal 0.3.0 dropped that option, hence patches/@parity__product-sdk-terminal.patch + TERMINAL_METADATA_URL. Without it pairing fails with "Failed to load pairing request".
  • Drop the pin + patch + TERMINAL_METADATA_URL together, only when the mobile app ships V2 pairing, and re-verify on a real phone first. Details in CLAUDE.md.

User-visible

Existing logins keep working (no re-pair). Resource allowances are re-requested once in a single phone dialog (cache moved to the SDK store). Changeset: minor.

Verification

  • pnpm format:check / pnpm lint:license / pnpm test (579) / pnpm build
  • e2e session suite (4/4) + smoke tier (25 passed; the only failure is the GH_TOKEN-gated moddable cell, environmental)
  • pnpm install --frozen-lockfile applies the terminal patch from its recorded hash
  • QR pairing reaches the Sign-In screen on app build 1227

⚠️ Merge gate: on-device validation pending

Mobile signing is currently broken app-side, so these remain unverified on a real device and must be checked before release (or accepted as a known risk):

  1. One real createTransaction signature round-trip (Revive.map_account or a deploy approval)
  2. The one-dialog allowance grant for all three resources
  3. "No re-pair" confirmed on an existing stored session

host-papp 0.8 emits a V2 pairing proposal (SCALE discriminant 0x01) that the
Polkadot mobile app's native handshake codec (V1-only, EnumIndex(0)) rejects
as 'Invalid QR code'. host-papp 0.7.9 final keeps the V1 QR while providing
the same byte-identical createTransaction (RFC-0020) wire codec terminal
0.3.0 signs through, so the signed-extension fixes are unaffected. Drop the
pin when the mobile app ships V2 pairing support.
The phone fetches the V1 offer's metadata field as a URL to render the
Sign-In screen; terminal 0.3.0 dropped the option (host-papp 0.8 carries
structured metadata inside the V2 proposal instead), so the field encoded
as an empty string and pairing failed with 'Failed to load pairing
request'. A pnpm patch on product-sdk-terminal restores the metadataUrl
pass-through for the duration of the novasama 0.7.9 mobile-compat pin.
…7.9 pin

The defensive session-decode translation no longer guards an active 0.8
incompatibility (the pin keeps the wire at 0.7.9, matching what released
CLIs wrote); reframe its comments and message accordingly. Soften the
changeset's end-to-end claim pending on-device signing validation, and
record upstream's guidance that 0.7.9 is the recommended line until
multi-device support ships V2 pairing.
@UtkarshBhardwaj007 UtkarshBhardwaj007 merged commit b5b4c95 into main Jun 3, 2026
17 of 19 checks passed
@UtkarshBhardwaj007 UtkarshBhardwaj007 deleted the feat/product-sdk-0.9-migration branch June 3, 2026 17:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant