Skip to content

fix(sdk-coin-sui): guard precomputedMaterial shape in signRecoveryTx - #9654

Merged
vibhavgo merged 1 commit into
masterfrom
WCI-1439-fix-sui-precomputed-material
Sep 4, 2026
Merged

fix(sdk-coin-sui): guard precomputedMaterial shape in signRecoveryTx#9654
vibhavgo merged 1 commit into
masterfrom
WCI-1439-fix-sui-precomputed-material

Conversation

@vibhavgo

@vibhavgo vibhavgo commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Summary

Guards against non-EddsaSigningMaterial values being passed as precomputedMaterial in signRecoveryTransaction. WRW passes openSSLBytes (an ArrayBuffer) as the second positional arg to recover() for EVM coins; after PR #9496 added precomputedMaterial as the second arg to SUI's recover(), that ArrayBuffer was being consumed as signing material — producing JSON.parse(undefined) at runtime.

Linear: WCI-1439

Changes

  • Add shape validation for precomputedMaterial in signRecoveryTransaction before using it
  • Falls back to getEddsaSigningMaterial when the value is not a valid EddsaSigningMaterial

Test Plan

  • yarn unit-test in modules/sdk-coin-sui — 155 passing
  • recoverConsolidations is unaffected: its only caller passes undefined or the return value of getEddsaSigningMaterial (always a valid shape)
  • Verified end-to-end SUI MPCv1 recovery in WRW with this fix applied

@linear-code

linear-code Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

WCI-1439

@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

WRW passes openSSLBytes as the second positional arg to recover() for
EVM coins. SUI's recoverConsolidations PR added precomputedMaterial as
the second arg, causing the ArrayBuffer to be consumed as signing
material — resulting in JSON.parse(undefined) at runtime.

Ticket: WCI-1439
@vibhavgo
vibhavgo force-pushed the WCI-1439-fix-sui-precomputed-material branch from 3d4bca7 to f508e14 Compare September 4, 2026 08:28
@vibhavgo
vibhavgo marked this pull request as ready for review September 4, 2026 08:28
@vibhavgo
vibhavgo requested a review from a team as a code owner September 4, 2026 08:28
@vibhavgo
vibhavgo merged commit 9d6586e 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