Skip to content

fix(sdk-coin-xtz): preserve txid when re-parsing signed origination#8664

Merged
zahin-mohammad merged 1 commit intomasterfrom
zahinmohammad/coinflp-116-tezos-xtzjs-test-is-flaky-in-ci
Apr 30, 2026
Merged

fix(sdk-coin-xtz): preserve txid when re-parsing signed origination#8664
zahin-mohammad merged 1 commit intomasterfrom
zahinmohammad/coinflp-116-tezos-xtzjs-test-is-flaky-in-ci

Conversation

@zahin-mohammad
Copy link
Copy Markdown
Contributor

@zahin-mohammad zahin-mohammad commented Apr 30, 2026

Summary

  • Fix flaky XTZ wallet creation in CI (COINFLP-116). Transaction.initFromSerializedTransaction assumed localForger.parse would always throw on signed bytes (unsigned + 64-byte signature) and only computed the txid in the catch branch. Some signature suffixes are accidentally valid Michelson contents, so parse silently succeeds, the try branch runs, and _id is left as ''. wallet-platform then fails with unable to calculate the id of the deployment transaction and SendQueue validation failed: txid: Path \txid` is required`.
  • Detect signed input by stripping the 64-byte suffix, parsing, and verifying the parsed result re-forges to those same bytes — a strict round-trip check rather than relying on parse to throw. The dead isValidSignature branch (which compared raw hex to base58-prefixed signatures) is removed.
  • Adds a deterministic regression test using a 16-byte seed (uint32 BE = 174) that produces a signed origination whose signature suffix parses as valid Michelson. Without the fix, reparsed.id === '' and the originated KT1 address is empty; with the fix the txid round-trips and the address derives correctly.

Test plan

  • yarn unit-test in modules/sdk-coin-xtz — 107 passing, including the new regression test
  • yarn lint in modules/sdk-coin-xtz — clean
  • 200-deterministic-seed stress run round-trips every signed transaction id (verified locally; not committed)
  • CI green

Ticket: COINFLP-116

🤖 Generated with Claude Code

@zahin-mohammad zahin-mohammad force-pushed the zahinmohammad/coinflp-116-tezos-xtzjs-test-is-flaky-in-ci branch 2 times, most recently from 263bf39 to 8b78899 Compare April 30, 2026 16:43
The previous initFromSerializedTransaction relied on localForger.parse
throwing on signed bytes (unsigned + 64-byte signature) to detect signed
input — but the appended signature bytes are sometimes accidentally
valid Michelson contents, so parse silently succeeds and the txid is
left empty. wallet-platform then fails XTZ wallet creation with
"unable to calculate the id of the deployment transaction" and
"SendQueue validation failed: txid: Path \`txid\` is required"
(COINFLP-116).

Detect signed input by stripping the 64-byte suffix, parsing, and
verifying the parsed result re-forges to those same bytes — a strict
round-trip check rather than relying on parse to throw.

Ticket: COINFLP-116

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@zahin-mohammad zahin-mohammad force-pushed the zahinmohammad/coinflp-116-tezos-xtzjs-test-is-flaky-in-ci branch from 8b78899 to 0bcfc61 Compare April 30, 2026 16:51
@zahin-mohammad zahin-mohammad marked this pull request as ready for review April 30, 2026 16:57
@zahin-mohammad zahin-mohammad requested review from a team as code owners April 30, 2026 16:57
@zahin-mohammad zahin-mohammad merged commit 6b45372 into master Apr 30, 2026
22 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