Skip to content

0.8.2: add SCALE-compact length prefix to v4 extrinsic on the wire - #23

Merged
mordamax merged 1 commit into
mainfrom
mak/0.8.2
May 14, 2026
Merged

0.8.2: add SCALE-compact length prefix to v4 extrinsic on the wire#23
mordamax merged 1 commit into
mainfrom
mak/0.8.2

Conversation

@mordamax

Copy link
Copy Markdown
Collaborator

host-api-test-sdk 0.8.2

Bumps @novasamatech/* to 0.7.9-4 and fixes handleCreateTransaction to return a real signed v4 extrinsic on the wire. Earlier 0.8.x releases either echoed callData back or returned the inner extrinsic frame without its SCALE-compact length prefix — both of which fail the moment a product tries to submit the bytes through polkadot-api / RPC.

What changed

  • handleCreateTransaction / handleCreateTransactionWithLegacyAccount — the request is now a flat object (signer, genesisHash, callData, extensions, txExtVersion); no more tuple wrapping, no context block, all fields are Uint8Array. Exports VersionedPublicTxPayload / TxPayloadV1Public are gone — use ProductAccountTransaction / LegacyTransaction.
  • The handler signs callData || extras || additionalSigned with sr25519 and returns the full v4 wire form: [compact len][0x84][MultiAddress::Id + AccountId32][Sr25519 + sig][extras][callData]. v5 is not emitted yet (paseo-asset-hub-next runs extrinsic.version: [4] only).
  • Upstream also removed the attestation service and simplified SSO; @novasamatech/product-sdk is being renamed to @novasamatech/host-api-wrapper (0.7.9-5+ is under the new name; we stay on product-sdk@0.7.9-4 for this release).

What you need to do

  • Upgrade to 0.8.2. No product-side code change required — the wrapper API didn't move.
  • If you constructed createTransaction requests by hand, switch to the flat ProductAccountTransaction shape and include genesisHash.
  • If your tests asserted on the bytes being equal to callData, drop that assumption and decode the response as a v4 extrinsic instead.
  • If your runtime negotiates v5 general extrinsics, file an issue — v5 support is a follow-up.

0.8.0 and 0.8.1 are superseded; skip straight to 0.8.2.


In 0.8.1 the handler returned the bare inner frame
[0x84][signer][sig][extras][callData] — but RPC and polkadot-api
decoders expect the outer wire form with a leading compact length,
so byte 0 (0x84) was read as part of the length and decoding failed.

Prepend compactToU8a(inner.length) to the returned bytes so the
extrinsic is wire-ready. Updated integration test #45 to strip the
compact prefix before asserting on the v4 frame; the assertion now
also verifies that the compact-decoded length matches the inner
body length.
@mordamax
mordamax merged commit 00428a1 into main May 14, 2026
5 checks passed
@mordamax mordamax self-assigned this May 18, 2026
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