Skip to content

fix(sdk-core): preserve tokenName and add SOL no-recipient intents - #9388

Open
bitgo-ai-agent-dev[bot] wants to merge 1 commit into
masterfrom
wci-1110-fix-resolve-effective-tx-params-sol
Open

fix(sdk-core): preserve tokenName and add SOL no-recipient intents#9388
bitgo-ai-agent-dev[bot] wants to merge 1 commit into
masterfrom
wci-1110-fix-resolve-effective-tx-params-sol

Conversation

@bitgo-ai-agent-dev

@bitgo-ai-agent-dev bitgo-ai-agent-dev Bot commented Jul 30, 2026

Copy link
Copy Markdown

Description

resolveEffectiveTxParams in recipientUtils.ts now accepts an optional chainName parameter and uses it to correctly derive tokenName for the effective recipient:

  • Prefers intentRecipient.tokenData?.tokenName when present.
  • Falls back to amount.symbol only when chainName is explicitly passed and differs from it.
  • Existing ECDSA callers (ecdsa.ts, ecdsaMPCv2.ts) never pass chainName, so their behavior is unchanged — this is additive, not a behavior change for current callers.

Also adds 'deactivate' to NO_RECIPIENT_TX_TYPES (alongside the pre-existing 'delegate'), since SolDeactivateIntent has no recipients field. This is prep for wiring resolveEffectiveTxParams into the SOL EdDSA signing path (sibling ticket WCI-1111)

Issue Number

WCI-1110

Type of change

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

Added/updated unit tests in recipientUtils.ts test file covering: tokenName preservation with and without chainName, the empty-string-symbol edge case, and the new 'deactivate' no-recipient path (plus a regression test confirming 'stakingAuthorize'-type intents still throw).

Ticket: WCI-1110

@linear-code

linear-code Bot commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

WCI-1110

@ralph-bitgo
ralph-bitgo Bot force-pushed the wci-1110-fix-resolve-effective-tx-params-sol branch from 13fb3a5 to ace42a1 Compare July 30, 2026 07:33
@bitgo-ai-agent-dev
bitgo-ai-agent-dev Bot force-pushed the wci-1110-fix-resolve-effective-tx-params-sol branch from ace42a1 to 345d3d6 Compare July 30, 2026 07:33
@ralph-bitgo
ralph-bitgo Bot force-pushed the wci-1110-fix-resolve-effective-tx-params-sol branch from 4b79462 to 4b081db Compare July 30, 2026 07:51
@bitgo-ai-agent-dev
bitgo-ai-agent-dev Bot force-pushed the wci-1110-fix-resolve-effective-tx-params-sol branch from 4b081db to 290f30a Compare July 30, 2026 08:50
@ralph-bitgo
ralph-bitgo Bot force-pushed the wci-1110-fix-resolve-effective-tx-params-sol branch from 290f30a to 907a783 Compare July 30, 2026 08:50
@bitgo-ai-agent-dev
bitgo-ai-agent-dev Bot force-pushed the wci-1110-fix-resolve-effective-tx-params-sol branch from 907a783 to 34d4e18 Compare July 30, 2026 08:53
@ralph-bitgo
ralph-bitgo Bot force-pushed the wci-1110-fix-resolve-effective-tx-params-sol branch from 34d4e18 to af6b667 Compare July 30, 2026 08:53
@bitgo-ai-agent-dev
bitgo-ai-agent-dev Bot force-pushed the wci-1110-fix-resolve-effective-tx-params-sol branch from af6b667 to 26550db Compare July 30, 2026 08:56
@ralph-bitgo
ralph-bitgo Bot force-pushed the wci-1110-fix-resolve-effective-tx-params-sol branch from 26550db to 2e44d7a Compare July 30, 2026 08:56
@bitgo-ai-agent-dev
bitgo-ai-agent-dev Bot force-pushed the wci-1110-fix-resolve-effective-tx-params-sol branch from 2e44d7a to fff9cd3 Compare July 30, 2026 08:56
@Marzooqa Marzooqa changed the title fix(sdk-core): preserve tokenName in resolveEffectiveTxParams; add SOL no-recipient intent types fix(sdk-core): preserve tokenName and add SOL no-recipient intents Jul 30, 2026
@bitgo-ai-agent-dev
bitgo-ai-agent-dev Bot force-pushed the wci-1110-fix-resolve-effective-tx-params-sol branch from 5829934 to cd7129d Compare July 30, 2026 09:02
@ralph-bitgo
ralph-bitgo Bot force-pushed the wci-1110-fix-resolve-effective-tx-params-sol branch from cd7129d to 187be6c Compare July 30, 2026 09:02
@bitgo-ai-agent-dev
bitgo-ai-agent-dev Bot force-pushed the wci-1110-fix-resolve-effective-tx-params-sol branch from 187be6c to a814d7e Compare July 30, 2026 09:13
@ralph-bitgo
ralph-bitgo Bot force-pushed the wci-1110-fix-resolve-effective-tx-params-sol branch from a814d7e to 50cc94e Compare July 30, 2026 09:13
@bitgo-ai-agent-dev
bitgo-ai-agent-dev Bot force-pushed the wci-1110-fix-resolve-effective-tx-params-sol branch 2 times, most recently from 1016ca9 to 95e9486 Compare July 30, 2026 09:35
@ralph-bitgo
ralph-bitgo Bot force-pushed the wci-1110-fix-resolve-effective-tx-params-sol branch from 95e9486 to 38918c9 Compare July 30, 2026 09:35
@bitgo-ai-agent-dev
bitgo-ai-agent-dev Bot force-pushed the wci-1110-fix-resolve-effective-tx-params-sol branch from 38918c9 to 6b7da7f Compare July 30, 2026 10:34
@ralph-bitgo
ralph-bitgo Bot force-pushed the wci-1110-fix-resolve-effective-tx-params-sol branch from 6b7da7f to 974c1b5 Compare July 30, 2026 10:34
@bitgo-ai-agent-dev
bitgo-ai-agent-dev Bot force-pushed the wci-1110-fix-resolve-effective-tx-params-sol branch from 974c1b5 to 7568d18 Compare July 30, 2026 10:38
@ralph-bitgo
ralph-bitgo Bot force-pushed the wci-1110-fix-resolve-effective-tx-params-sol branch from 7568d18 to c686500 Compare July 30, 2026 10:38
@bitgo-ai-agent-dev
bitgo-ai-agent-dev Bot force-pushed the wci-1110-fix-resolve-effective-tx-params-sol branch 2 times, most recently from 6bcaa0c to 8fa8032 Compare July 31, 2026 06:54
@ralph-bitgo
ralph-bitgo Bot force-pushed the wci-1110-fix-resolve-effective-tx-params-sol branch from 8fa8032 to 78c5d52 Compare July 31, 2026 06:55
@bitgo-ai-agent-dev
bitgo-ai-agent-dev Bot force-pushed the wci-1110-fix-resolve-effective-tx-params-sol branch 2 times, most recently from 900fe0e to 5c562b8 Compare July 31, 2026 06:56
@ralph-bitgo
ralph-bitgo Bot force-pushed the wci-1110-fix-resolve-effective-tx-params-sol branch from 5c562b8 to c48150b Compare July 31, 2026 06:57
@bitgo-ai-agent-dev
bitgo-ai-agent-dev Bot force-pushed the wci-1110-fix-resolve-effective-tx-params-sol branch from c48150b to b17b207 Compare July 31, 2026 07:07
@ralph-bitgo
ralph-bitgo Bot force-pushed the wci-1110-fix-resolve-effective-tx-params-sol branch from b17b207 to e1afce9 Compare July 31, 2026 07:07
@bitgo-ai-agent-dev
bitgo-ai-agent-dev Bot force-pushed the wci-1110-fix-resolve-effective-tx-params-sol branch 2 times, most recently from 31b83f9 to a3386a8 Compare July 31, 2026 07:10
@ralph-bitgo
ralph-bitgo Bot force-pushed the wci-1110-fix-resolve-effective-tx-params-sol branch from a3386a8 to 3db2886 Compare July 31, 2026 07:10
@Marzooqa
Marzooqa marked this pull request as ready for review July 31, 2026 07:44
@Marzooqa
Marzooqa requested review from a team as code owners July 31, 2026 07:44
What changed:
- resolveEffectiveTxParams now accepts an optional chainName parameter and
  preserves tokenName when mapping intent recipients from the persisted intent.
  Prefers intentRecipient.tokenData?.tokenName (structured field); falls back
  to amount.symbol when truthy and different from the native chain symbol —
  identical to the existing txParamsFromIntent logic in baseTSSUtils.ts.
- NO_RECIPIENT_TX_TYPES: added three SOL EdDSA no-recipient intent types:
  stakingDelegate, stakingDeactivate, closeAssociatedTokenAccount.
  stakingAuthorize is intentionally NOT listed (high-risk authority change;
  must be validated at the coin layer, not bypassed here).
- Tests: WCN-196 regression suite covering the tsol:usdc sendMany path that
  caused PR #9117 to be reverted; per-type tests for each new SOL allowlist
  entry; explicit assertion that stakingAuthorize still throws; edge cases for
  empty-string tokenName, mixed native+token recipients, data field preservation,
  and legacy ECDSA callers with tokenData.

Why:
resolveEffectiveTxParams dropped tokenName when building recipients from the
persisted intent. SOL token sendMany (e.g. tsol:usdc) requires tokenName so
verifyTransaction can derive the Associated Token Account address for
comparison; without it every token transfer fails with 'Tx outputs does not
match'. This was the root cause of the production incident in WCN-196 that
caused PR #9117 to be reverted (commit 96658f1).

The three new SOL entries cover intent types WP issues with no on-chain
recipient (staking delegation, deactivation, and ATA-close). Without them the
fail-closed guard would throw on every staking/ATA-close operation for SOL
MPCv2 wallets once resolveEffectiveTxParams is wired into the EdDSA signing
path (sibling ticket WCI-1111).

Existing ECDSA callers (ecdsaMPCv2.ts, ecdsa.ts) do not pass chainName so
their behavior is unchanged.

References: WCI-1110, WCI-1100, WCN-196
Session-Id: 94a72c0d-fce8-4672-a6a4-26df25a64dfc
Task-Id: 76f4312b-c52c-4478-94f6-457913e8c0b7
@Marzooqa
Marzooqa force-pushed the wci-1110-fix-resolve-effective-tx-params-sol branch from 3db2886 to 287564d Compare July 31, 2026 07:53

@s84krish s84krish left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm!

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