fix(sdk-provider-solana): route Solana bundles by data shape and fix Jito RPC detection (EMB-462)#409
Open
chybisov wants to merge 1 commit into
Open
fix(sdk-provider-solana): route Solana bundles by data shape and fix Jito RPC detection (EMB-462)#409chybisov wants to merge 1 commit into
chybisov wants to merge 1 commit into
Conversation
…Jito RPC detection (EMB-462) Route Solana submission by the shape of the backend's `transactionRequest.data`: an array is a Jito bundle and goes through `sendBundle`, a string is a single transaction and goes through `sendTransaction`. Previously the choice was inferred from the signed-transaction count (`length > 1`), so a single-tx bundle was misrouted to `sendTransaction` and failed. Detect Jito-capable RPCs by probing `getBundleStatuses` instead of `getTipAccounts`. Providers such as Helius support `sendBundle`/`getBundleStatuses` but do not expose `getTipAccounts`, so the old probe wrongly excluded them and bundle submission failed with "No Jito-enabled RPC connection available". Removes the now-unused `shouldUseJitoBundle` helper and adds unit tests for the shape routing, the wait-task branching, and the RPC probe.
🦋 Changeset detectedLatest commit: a9175a6 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes Solana → EVM execution failing when the backend returns a Jito bundle (EMB-462). Two coordinated fixes in
@lifi/sdk-provider-solana:Route by data shape, not transaction count. The executor now decides submission method from the shape of the backend's
transactionRequest.data:sendBundlesendTransactionPreviously the choice came from
shouldUseJitoBundleusingsignedTransactions.length > 1, so a single-transaction Jito bundle (array of length 1) was misrouted tosendTransactionand failed — exactly the ticket symptom ("submits the bundle through a regularsendTransaction").Detect Jito-capable RPCs via
getBundleStatuses, notgetTipAccounts.isJitoRpcpreviously probedgetTipAccounts(). Helius supportssendBundle/getBundleStatusesbut does not exposegetTipAccounts, so the old probe wrongly classified it as non-Jito →getJitoRpcs()returned empty →sendAndConfirmBundlethrewNo Jito-enabled RPC connection available. The new probe usesgetBundleStatuses, the method actually used during bundle confirmation.Endpoint evidence
Probed the integrator's live Solana RPCs:
getTipAccounts(old probe)getBundleStatuses(new probe)sendBundle{value:[]}-32403plan-gated-32403The probe correctly adds the bundle-capable Helius endpoint the old probe rejected, still detects QuickNode, and still rejects a plan-gated endpoint (can't bundle). The probe bundle id is all
1s — 64 chars, valid as both hex and base-58 — so providers don't reject it on format; both QuickNode and the bundle-enabled Helius accepted it and performed the lookup.Changes
core/tasks/SolanaSignAndExecuteTask.ts— computeisBundleExecution = Array.isArray(data), propagate via contextcore/tasks/SolanaWaitForTransactionTask.ts— branch oncontext.isBundleExecutiontypes.ts— addisBundleExecution?: booleantoSolanaTaskContextrpc/registry.ts—isJitoRpcprobesgetBundleStatuses([id])utils/shouldUseJitoBundle.ts(+ spec)Testing
check:types✅ ·test:unit55/55 ✅ · biome ✅ · no circular deps ✅isJitoRpcagainst the three live endpoints above.Notes / follow-ups (not in this PR)
isJitoRpc'scatch { return false }can't distinguish "method not found / plan-gated" from a transient error, and failures aren't cached — a flaky probe could intermittently drop a capable RPC. Worth hardening separately.No Jito-enabled RPC connection availableerror is opaque for plan/config issues; consider rewording.Closes EMB-462