Skip to content

fix: support SVM v2 payments with longer seller memos - #1297

Open
mizuki0x wants to merge 1 commit into
Merit-Systems:mainfrom
mizuki0x:codex/svm-payment-compute-budget
Open

mizuki0x wants to merge 1 commit into
Merit-Systems:mainfrom
mizuki0x:codex/svm-payment-compute-budget

Conversation

@mizuki0x

Copy link
Copy Markdown

SVM v2 payments with seller-provided request-bound memos can exceed the 20,000 CU limit hardcoded by the pinned @x402/svm client. Covenant Compute preserves a 117-byte quote/request memo; its qualified payment consumed 43,642 CU, so the current browser client cannot simulate that payment successfully.

Wrap the v2 signer at the shared registration point and raise the canonical unsigned transaction limit to 60,000 CU when the encoded memo exceeds the SDK’s ordinary 32-byte nonce. The adapter changes only the compute-limit value before wallet signing. Short/default memos and v1 remain unchanged. Pre-signed or unexpected transaction shapes are rejected before wallet interaction, and modifying-wallet outputs are returned intact.

Validation: 14 focused tests against the pinned x402 2.11.0 and Solana Kit 5.3.0, scoped strict TypeScript, and Prettier pass. Tests use ephemeral keys and mocked mint/blockhash reads; they cover real SDK v2/v1 assembly, byte preservation, valid signatures, UTF-8 boundaries, batch refusal, AbortSignal/lifetime, and modifying signers. The complete app build and live browser-wallet payment were not run.

60,000 CU is a bounded workaround for this observed payment shape, not dynamic estimation for every longer memo or wallet-added instruction. Facilitator-specific policy can still reject wallet modifications.

@vercel

vercel Bot commented Oct 19, 2026

Copy link
Copy Markdown
Contributor

@mizuki0x is attempting to deploy a commit to the Merit Systems Team on Vercel.

A member of the Team first needs to authorize it.

This branch has not been deployed

No deployments
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.

1 participant