Skip to content

fix: use pallet-revive's keyless pallet account as the read-only query origin#275

Merged
UtkarshBhardwaj007 merged 1 commit into
mainfrom
fix/read-only-query-origin-revive-pallet-account
Jun 4, 2026
Merged

fix: use pallet-revive's keyless pallet account as the read-only query origin#275
UtkarshBhardwaj007 merged 1 commit into
mainfrom
fix/read-only-query-origin-revive-pallet-account

Conversation

@UtkarshBhardwaj007
Copy link
Copy Markdown
Member

What

Switch the defaultOrigin used for read-only registry queries (playground mod browse + metadata-uri lookup, registry username reads) from Alice's dev SS58 to pallet-revive's own keyless pallet account:

PalletId(*b"py/reviv").into_account_truncating()
= "modlpy/reviv" + 20 zero bytes
= 5EYCAe5ijiYfhaAUBd6H9WGRTsvwFFc7GnhQkiHvBYxdvpbV

Why

paritytech/product-sdk#152 replaced the SDK's Alice query-fallback origin with this account: it is semantically meaningful, not tied to a dev seed, and always exists on chain. That fallback never reaches us, though, because the CLI always passes an explicit defaultOrigin, so our reads kept dry-running as Alice. This aligns the CLI with the SDK's choice.

How

  • QUERY_FALLBACK_ORIGIN is not exported from @parity/product-sdk-contracts, so the 3-line derivation is mirrored in src/utils/registry.ts (verified byte-for-byte against the installed 0.7.0 dist).
  • We keep passing the origin explicitly rather than relying on the SDK fallback: the fallback path emits a log.warn per query that would leak into the Ink TUI.
  • registry.test.ts drops the ss58Encode/getDevPublicKey mocks and freezes the real SS58, so a regression back to Alice (or anything else) fails loudly.
  • Updated the stale Alice comments in src/commands/mod/index.ts and the CLAUDE.md playground mod invariant; added a patch changeset.

Test

  • pnpm format:check, pnpm lint:license, pnpm test (579/579), pnpm build all pass.
  • Live smoke: playground mod definitely-not-a-real-app.dot resolves the registry via the CDM meta-registry and the get_app dry-run returns the correct "not found in registry" with the new origin.

Follow-up idea (not in this PR): ask product-sdk to export QUERY_FALLBACK_ORIGIN so consumers can import it instead of mirroring the derivation.

…y origin

Read-only registry queries (mod browse/metadata, registry username
lookups) previously dry-ran with Alice's dev SS58 as defaultOrigin.
Switch to pallet-revive's own pallet account ("modlpy/reviv" + 20 zero
bytes, 5EYCAe5ij...), matching the QUERY_FALLBACK_ORIGIN that
@parity/product-sdk-contracts adopted in paritytech/product-sdk#152.

The SDK does not export the constant, so the derivation is mirrored
locally. We keep passing it explicitly as defaultOrigin so the SDK's
per-query 'No origin configured' warning never fires inside the TUI.
The registry test now freezes the real SS58 so a regression back to
Alice fails loudly.
@UtkarshBhardwaj007 UtkarshBhardwaj007 merged commit b6165fb into main Jun 4, 2026
18 of 19 checks passed
@UtkarshBhardwaj007 UtkarshBhardwaj007 deleted the fix/read-only-query-origin-revive-pallet-account branch June 4, 2026 09:57
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 4, 2026

E2E Test Pass · ✅ PASS

Tag: e2e-ci-pr · Branch: fix/read-only-query-origin-revive-pallet-account · Commit: 6619f0f · Run logs

Cell Result Time
pr-mod ✅ PASS 1m25s
pr-deploy-foundry ✅ PASS 0m42s
pr-install ✅ PASS 0m45s
pr-preflight ✅ PASS 2m20s
pr-deploy-frontend ✅ PASS 15m32s
pr-deploy-cdm ✅ PASS 5m48s
pr-init-session ✅ PASS 1m57s
${{ matrix.cell }} ⏭️ SKIP 0m-1s
${{ matrix.cell }} ⏭️ SKIP 0m-1s

Sentry traces: view spans for this run

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