fix(parsers): encode full @solana/kit transaction to resolve KMS 500 errors (#397)#398
fix(parsers): encode full @solana/kit transaction to resolve KMS 500 errors (#397)#398Soham-ent wants to merge 1 commit into
Conversation
|
Task created — intent: multi-review, workspace provisioning started. https://autopilot-orchestrator.tools.phantom.dev/tasks/85353c5b-7880-5c1f-8940-a8992d6cb3d5 |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughUpdated Solana transaction parsing for ChangesSolana Canonical Wire Format Encoding
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
ESLint install failed: one or more packages not found in the registry. Comment |
|
Actionable comments posted: 0 |
|
PR opened by agent |
Closes #397.
Root cause: I found that the parseSolanaTransactionToBase64Url was sending only transaction.messageBytes for @solana/kit transactions. The KMS backend expects the canonical Solana wire format: a compact-u16 signature count prefix followed by the message. Sending bare message bytes causes the backend deserializer to read the message header as a signature count, producing a malformed parse and an unhandled 500.
Fix: Replaced transaction.messageBytes with getTransactionEncoder().encode(transaction) to produce the correct wire format, matching the behaviour of the existing @solana/web3.js path. Added Jest mocks to bypass strict encoder validation in unit tests.
Summary by CodeRabbit
Release Notes
Tests
Refactor