Skip to content

fix: marinade multisig dapp requests by preserving original message bytes - #156

Merged
taran-a merged 2 commits into
mainfrom
fix/marinade-multisig-messages
Aug 25, 2026
Merged

fix: marinade multisig dapp requests by preserving original message bytes#156
taran-a merged 2 commits into
mainfrom
fix/marinade-multisig-messages

Conversation

@taran-a

@taran-a taran-a commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

Explanation

Fixes multisig dapp transaction signing by preserving the original transaction payload for external dapp origins.

  • Decode dapp-origin signTransaction and signAndSendTransaction requests as transactions directly, whether the payload is a full serialized transaction or a bare compiled transaction message.
  • Append only the snap account's signature, preserving existing signatures, compiled messageBytes, account ordering, and instruction account indices.
  • Keep the existing MetaMask-origin signing flow unchanged.
  • Add coverage for codec decoding, signer byte preservation, and wallet origin handling.

References

Checklist

  • I've updated the test suite for new or updated code as appropriate
  • I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate
  • I've communicated my changes to consumers by updating changelogs for packages I've changed
  • I've introduced breaking changes in this PR and have prepared draft pull requests for clients and consumer packages to resolve them

@taran-a
taran-a requested a review from a team as a code owner August 17, 2026 13:28
@taran-a
taran-a deployed to default-branch August 17, 2026 13:29 — with GitHub Actions Active
@taran-a
taran-a force-pushed the fix/marinade-multisig-messages branch from 15b6cf8 to cb532d8 Compare August 17, 2026 13:29
@taran-a
taran-a force-pushed the fix/marinade-multisig-messages branch 2 times, most recently from 62574dd to c5b54f0 Compare August 18, 2026 09:14
@taran-a

taran-a commented Aug 18, 2026

Copy link
Copy Markdown
Contributor Author

@metamaskbot publish-preview

@github-actions

Copy link
Copy Markdown
Contributor

Preview builds have been published. Learn how to use preview builds in other projects.

Expand for full list of packages and versions.
@metamask-previews/bitcoin-wallet-snap@2.0.1-preview-c5b54f00
@metamask-previews/snap-networks-utils@1.0.0-preview-c5b54f00
@metamask-previews/solana-wallet-snap@6.0.0-preview-c5b54f00
@metamask-previews/tron-wallet-snap@3.1.0-preview-c5b54f00

@taran-a
taran-a force-pushed the fix/marinade-multisig-messages branch 3 times, most recently from ac83f38 to 682b0a7 Compare August 24, 2026 15:11
Comment thread packages/solana-wallet-snap/CHANGELOG.md Outdated

Copilot AI 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.

Pull request overview

This PR updates @metamask/solana-wallet-snap transaction signing for external (dapp) origins to preserve the original transaction/message bytes during partial signing, which is necessary for multisig workflows that depend on an unchanged signing payload.

Changes:

  • Add an origin-based switch in WalletService to request message-byte preservation for non-MetaMask origins when signing / signing+sending.
  • Extend Signer.partiallySignBase64String with a preserveMessageBytes flag and add a codec path to wrap bare compiled message bytes into a Transaction shape without altering messageBytes.
  • Add/extend Jest coverage for codec decoding and byte-preservation behavior; update snap manifest shasum and changelog.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
packages/solana-wallet-snap/src/core/services/wallet/WalletService.ts Passes an origin-derived preserveMessageBytes flag into the signer for sign + signAndSend flows.
packages/solana-wallet-snap/src/core/services/wallet/WalletService.test.ts Adds assertions that MetaMask origin does not request preservation, while dapp origins do.
packages/solana-wallet-snap/src/core/services/signer/Signer.ts Implements the preservation path by decoding to a Transaction directly and signing without message mutation.
packages/solana-wallet-snap/src/core/services/signer/Signer.test.ts Adds coverage asserting messageBytes are preserved when requested.
packages/solana-wallet-snap/src/core/sdk-extensions/codecs.ts Adds decoding for compiled message bytes into a Transaction shape and a new “unknown base64 → transaction” helper.
packages/solana-wallet-snap/src/core/sdk-extensions/codecs.test.ts Adds tests for compiled-message wrapping and full-transaction decode without changing bytes.
packages/solana-wallet-snap/snap.manifest.json Updates bundle shasum to match the new build output.
packages/solana-wallet-snap/CHANGELOG.md Adds an Unreleased entry documenting the behavioral change.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread packages/solana-wallet-snap/src/core/sdk-extensions/codecs.ts Outdated
Comment thread packages/solana-wallet-snap/CHANGELOG.md Outdated
@taran-a
taran-a force-pushed the fix/marinade-multisig-messages branch from 1495a1c to 1dda959 Compare August 25, 2026 10:31
@taran-a
taran-a requested a review from Battambang August 25, 2026 10:31

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

@taran-a
taran-a added this pull request to the merge queue Aug 25, 2026
Merged via the queue into main with commit c882999 Aug 25, 2026
53 checks passed
@taran-a
taran-a deleted the fix/marinade-multisig-messages branch August 25, 2026 11:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants