Skip to content

fix(sdk-coin-polyx): transferAllowDeath in getFee and remove double Ed25519 prefix - #9655

Merged
vibhavgo merged 1 commit into
masterfrom
WCI-1437-fix-polyx-double-ed25519-prefix
Sep 4, 2026
Merged

fix(sdk-coin-polyx): transferAllowDeath in getFee and remove double Ed25519 prefix#9655
vibhavgo merged 1 commit into
masterfrom
WCI-1437-fix-polyx-double-ed25519-prefix

Conversation

@vibhavgo

@vibhavgo vibhavgo commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Summary

Two bugs that together block POLYX MPCv2 recovery end-to-end, discovered during WCI-1437 staging tests.

Linear: WCI-1437

Changes

1. getFee: balances.transferbalances.transferAllowDeath

Polymesh v8 renamed balances.transfer to balances.transferAllowDeath (same call slot 0x0500). The old name no longer exists on the runtime, causing TypeError: api.tx.balances.transfer is not a function at fee estimation — preventing any recovery JSON from being produced. Already documented in polyx/src/lib/iface.ts:72. This is a dry-run .paymentInfo() call only, not a transaction submission.

2. Remove double Ed25519 discriminant in MPCv2 signing path

Transaction#constructSignedPayload in abstract-substrate already prepends 0x00 (the MultiSignature::Ed25519 variant byte) to whatever buffer is passed to addSignature. The MPCv2 path in polyx.ts was also manually prepending 0x00, producing a double discriminant. This shifted the on-wire signature by one byte, dropped the last byte of sigma, and caused 1010: Invalid Transaction: Transaction has a bad signature on broadcast. Mirrors the fix applied to abstractSubstrateCoin.ts in WCI-1454 — POLYX overrides recover() entirely so it was not covered by that fix.

Test Plan

  • 235 unit tests passing
  • Regression test added: stubs signSubstrateMpcV2Recovery to return a controlled 64-byte buffer and asserts addSignature receives exactly that buffer (no prefix)
  • End-to-end POLYX MPCv2 recovery tested in WRW against Polymesh testnet — transaction successfully broadcast

…d25519 prefix

Two bugs that together block POLYX MPCv2 recovery end-to-end:

1. getFee used api.tx.balances.transfer which was renamed
   transferAllowDeath in Polymesh v8 (same call slot 0x0500).
   Blocked recovery at fee estimation with TypeError before any
   transaction was produced.

2. MPCv2 signing path manually prepended the Ed25519 MultiSignature
   discriminant (0x00) to rawSig before addSignature, but
   Transaction#constructSignedPayload already prepends that byte.
   The double prefix shifted the on-wire signature by one byte and
   dropped the last byte of sigma, causing 1010: Bad signature.
   Mirrors the fix applied to abstractSubstrateCoin in WCI-1454.

Ticket: WCI-1437
@linear-code

linear-code Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

WCI-1437

@github-actions

github-actions Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

⚠️ Unit tests are failing on Node 26.x (Current release line, non-blocking). This is not an LTS version yet, so it does not block merge, but it signals an incompatibility to fix before Node 26.x becomes LTS.

View run

@vibhavgo
vibhavgo marked this pull request as ready for review September 4, 2026 10:49
@vibhavgo
vibhavgo requested a review from a team as a code owner September 4, 2026 10:49
@vibhavgo
vibhavgo merged commit fa21c28 into master Sep 4, 2026
25 checks passed
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.

2 participants