Skip to content

fix: marinade multisig dapp requests by preserving original message bytes WPN-1035#608

Open
taran-a wants to merge 1 commit into
mainfrom
fix/marinade-multisig-messages
Open

fix: marinade multisig dapp requests by preserving original message bytes WPN-1035#608
taran-a wants to merge 1 commit into
mainfrom
fix/marinade-multisig-messages

Conversation

@taran-a

@taran-a taran-a commented Jun 5, 2026

Copy link
Copy Markdown

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.
Screen.Recording.2026-06-04.at.19.54.59.mov

Note

High Risk
Changes signing semantics for all external dapp origins (marked BREAKING) and touches core transaction encoding—incorrect byte handling could break multisig or produce invalid signatures.

Overview
Fixes multisig and dapp signing (e.g. Marinade) by not recompiling transaction payloads from external origins.

For non–MetaMask origins, signTransaction and signAndSendTransaction now pass preserveMessageBytes: true into signing. The snap decodes the base64 payload as a transaction (full serialized tx or bare compiled message via new fromUnknowBase64StringToTransaction / fromBase64StringCompiledMessageToTransaction helpers) and only adds the wallet’s signature, leaving messageBytes, existing signatures, and account ordering unchanged. The MetaMask-origin path still uses the prior flow (fee payer, blockhash, compute budget, etc.).

Changelog calls this BREAKING for dapp-origin sign flows because behavior differs from before when messages were normalized. Manifest shasum updated; tests cover codecs, signer preservation, and origin gating.

Reviewed by Cursor Bugbot for commit 74941d7. Bugbot is set up for automated code reviews on this repo. Configure here.

@taran-a taran-a requested a review from a team as a code owner June 5, 2026 13:28
@taran-a

taran-a commented Jun 5, 2026

Copy link
Copy Markdown
Author

@metamaskbot publish-preview

Comment thread packages/snap/CHANGELOG.md
@taran-a taran-a force-pushed the fix/marinade-multisig-messages branch from b0d9245 to 74941d7 Compare June 5, 2026 14:44
@taran-a taran-a requested a review from Battambang June 5, 2026 14:46
@sonarqubecloud

sonarqubecloud Bot commented Jun 5, 2026

Copy link
Copy Markdown

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