Skip to content

feat(sdk-core): forward SOL intent wire version (Refs: CHALO-1603) - #10027

Merged
bhavidhingra merged 1 commit into
masterfrom
bhavi/sol-v1-intent-version
Oct 22, 2026
Merged

bhavidhingra merged 1 commit into
masterfrom
bhavi/sol-v1-intent-version

Conversation

@bhavidhingra

@bhavidhingra bhavidhingra commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Description

Solana v1 (SIMD-0296/0385) payments never reached Wallet Platform as v1: Wallet.prebuildTransaction / sendMany build the txRequest intent from an explicit literal (modules/sdk-core/src/bitgo/wallet/wallet.ts:4531), so a caller-supplied version: 1 was dropped before populateIntent and every request silently produced a v0 envelope — no error, no warning.

This PR forwards the marker:

  • version?: 0 | 1 on PrebuildTransactionOptions (wallet/iWallet.ts), PrebuildTransactionWithIntentOptions and PopulatedIntent (utils/tss/baseTypes.ts)
  • version: params.version in the payment intent literal (wallet/wallet.ts)
  • Sol.setCoinSpecificFieldsInIntent copies it onto the intent (sdk-coin-sol/src/sol.ts:2248) — the only coin-level seam populateIntent exposes (utils/mpcUtils.ts:118 ends with that hook)

Wallet Platform already consumes it: isStructuredPaymentV1Intent (intentType === 'payment' && intent.version === 1) selects buildStructuredV1Payment, which builds the envelope server-side via getV1PaymentBuilder(). The intent contract exists in public-types (SolVersionMarker).

Scope note: no example scripts are included — the manifest and broadcast evidence below came from throwaway local scripts, which are not tested and do not belong in the repo.

Issue Number

CHALO-1603

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

  • modules/sdk-coin-sol: 889 passing, including 3 new cases in test/unit/solIntentVersion.ts (forwards 1, forwards 0, leaves the key absent when unset).
  • modules/sdk-core: mpcUtils.wrapApprove + mpcUtils.unwrap intent suites, 9 passing.
  • Manual, devnet (throwaway script): SDK-built v1 payment confirmed twice (346Keirjtcp84XQJ8i8Bbp1szrBetyv3vB4nRhKujwdyrhaRg1pyqyNrsEciEAd3sQ9vQKSPenj3V5c22v89aHgd, 27RSCHiVZeDpTUfDJB6idaNBRKzWu1eNrzUyhLqMbCbmBJNBWwkrqpLjojsXHorsVdb9KZWL8JMPdx1bqSP8rMco); getTransaction reports version: 1, fee 10,000 (5,000 base + 5,000 priority from the v1 config).
  • Manual, staging BitGo path: tsol hot wallet builds a 411-byte 0x81 envelope whose persisted intent carries version: 1, and signs to readyToSend. POST /tx/send then returns 500 Failed to deserialize transaction: io error: unexpected end of file — the send/assembly path cannot parse v1 yet; tracked in CHALO-1603, not introduced here.

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • My code compiles correctly for both Node and Browser environments
  • I have commented my code, particularly in hard-to-understand areas
  • My commits follow Conventional Commits and I have properly described any BREAKING CHANGES
  • The ticket or github issue was included in the commit message as a reference
  • I have made corresponding changes to the documentation and on any new/updated functions and/or methods - jsdoc
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

@linear-code

linear-code Bot commented Oct 22, 2026

Copy link
Copy Markdown
Contributor

CHALO-1603

@github-actions

github-actions Bot commented Oct 22, 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

@bhavidhingra
bhavidhingra force-pushed the bhavi/sol-v1-intent-version branch from 78853b9 to 9b2a4c8 Compare October 22, 2026 08:42

@MohammedRyaan786 MohammedRyaan786 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

prebuildTransaction builds the payment intent from an explicit literal, so
version was dropped before populateIntent and every v1 payment request
silently built a v0 envelope.

Add version (0 | 1) to PrebuildTransactionOptions,
PrebuildTransactionWithIntentOptions and PopulatedIntent, forward it in the
payment literal, and copy it onto the intent in Sol.setCoinSpecificFieldsInIntent
(the only coin-level seam populateIntent exposes).
@bhavidhingra
bhavidhingra merged commit 2d436f0 into master Oct 22, 2026
26 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