Skip to content

fix: resolve @solana/kit version split causing Solana payment simulation failures#74

Merged
1bcMax merged 1 commit intomainfrom
fix/solana-transaction-simulation-failed
Mar 6, 2026
Merged

fix: resolve @solana/kit version split causing Solana payment simulation failures#74
1bcMax merged 1 commit intomainfrom
fix/solana-transaction-simulation-failed

Conversation

@1bcMax
Copy link
Member

@1bcMax 1bcMax commented Mar 6, 2026

Summary

  • Pinned @solana/kit from ^6.0.0 to ^5.0.0, deduplicating to a single v5.5.1 across the dependency tree (removed 42 redundant packages)
  • Added transaction_simulation_failed error handling in proxy with user-friendly messaging and debug logging
  • Added simulation failures to payment error detection so the fallback chain skips to the free model immediately

Root Cause

ClawRouter had @solana/kit@6.1.0 at top-level while @x402/svm internally used @solana/kit@5.5.1. This created two separate runtime copies of @solana/signers and @solana/transactions. Signers created with v6 and passed to @x402/svm's v5 ExactSvmScheme produced cross-version incompatible signatures during partiallySignTransactionMessageWithSigners, causing the PayAI facilitator to fail simulation with transaction_simulation_failed.

Test plan

  • npm run build succeeds
  • npm test — 297 passed, 0 failed
  • Verified single @solana/kit@5.5.1 across entire node_modules tree
  • E2E: confirm Solana x402 payments settle successfully on mainnet

Summary by CodeRabbit

  • Bug Fixes
    • Improved handling of Solana transaction simulation failures
    • Enhanced payment error detection and automatic fallback mechanisms when payment processing encounters issues

…ion failures

ClawRouter had @solana/kit@^6.0.0 (v6.1.0) while @x402/svm depended on
@solana/kit@^5.0.0 (v5.5.1), creating two separate runtime copies of
@solana/signers and @solana/transactions. Signers created with v6 and
passed to @x402/svm's v5 ExactSvmScheme produced cross-version
incompatible signatures, causing the facilitator to fail with
transaction_simulation_failed.

- Pin @solana/kit to ^5.0.0, deduplicating to single v5.5.1
- Add transaction_simulation_failed error handling in proxy
- Detect simulation failures as payment errors for fallback chain
@coderabbitai
Copy link

coderabbitai bot commented Mar 6, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 1ac23764-e333-4744-a0e6-2aaa52d26e9f

📥 Commits

Reviewing files that changed from the base of the PR and between 960e72c and de61b8a.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (2)
  • package.json
  • src/proxy.ts

📝 Walkthrough

Walkthrough

Updated Solana Kit dependency from version 6 to version 5 in package.json and enhanced payment error handling in the proxy module to detect and respond to Solana transaction simulation failures with fallback behavior to the free model when applicable.

Changes

Cohort / File(s) Summary
Dependency Update
package.json
Downgraded @solana/kit from ^6.0.0 to ^5.0.0.
Payment Error Handling
src/proxy.ts
Added detection of transaction_simulation_failed errors in payment error validation regex and transformPaymentError function. Expanded settlement error detection to include simulation failures. Implemented fallback logic to jump to free model when transaction simulation fails on non-free models, with handling for both streaming and non-streaming request paths.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~15 minutes

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/solana-transaction-simulation-failed

Comment @coderabbitai help to get the list of available commands and usage tips.

@1bcMax 1bcMax merged commit f2b1de6 into main Mar 6, 2026
2 of 4 checks passed
@1bcMax 1bcMax deleted the fix/solana-transaction-simulation-failed branch March 6, 2026 13:12
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