Skip to content

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
mainfrom
feature/emb-462-solana-bundle-shape-routing
Open

fix(sdk-provider-solana): route Solana bundles by data shape and fix Jito RPC detection (EMB-462)#409
chybisov wants to merge 1 commit into
mainfrom
feature/emb-462-solana-bundle-shape-routing

Conversation

@chybisov

Copy link
Copy Markdown
Member

Summary

Fixes Solana → EVM execution failing when the backend returns a Jito bundle (EMB-462). Two coordinated fixes in @lifi/sdk-provider-solana:

  1. Route by data shape, not transaction count. The executor now decides submission method from the shape of the backend's transactionRequest.data:

    • array → Jito bundle → sendBundle
    • string → single transaction → sendTransaction

    Previously the choice came from shouldUseJitoBundle using signedTransactions.length > 1, so a single-transaction Jito bundle (array of length 1) was misrouted to sendTransaction and failed — exactly the ticket symptom ("submits the bundle through a regular sendTransaction").

  2. Detect Jito-capable RPCs via getBundleStatuses, not getTipAccounts. isJitoRpc previously probed getTipAccounts(). Helius supports sendBundle/getBundleStatuses but does not expose getTipAccounts, so the old probe wrongly classified it as non-Jito → getJitoRpcs() returned empty → sendAndConfirmBundle threw No Jito-enabled RPC connection available. The new probe uses getBundleStatuses, the method actually used during bundle confirmation.

Endpoint evidence

Probed the integrator's live Solana RPCs:

Endpoint getTipAccounts (old probe) getBundleStatuses (new probe) sendBundle Old code detects This PR detects
QuickNode (Lil' JIT)
Helius (bundle-enabled) ❌ Method not found {value:[]} bug fixed
Helius (no bundle plan) -32403 plan-gated -32403 ❌ (correct)

The 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 — compute isBundleExecution = Array.isArray(data), propagate via context
  • core/tasks/SolanaWaitForTransactionTask.ts — branch on context.isBundleExecution
  • types.ts — add isBundleExecution?: boolean to SolanaTaskContext
  • rpc/registry.tsisJitoRpc probes getBundleStatuses([id])
  • Removed unused utils/shouldUseJitoBundle.ts (+ spec)
  • Added unit tests: shape detection/propagation, wait-task routing, RPC probe

Testing

  • check:types ✅ · test:unit 55/55 ✅ · biome ✅ · no circular deps ✅
  • Empirically validated isJitoRpc against the three live endpoints above.

Notes / follow-ups (not in this PR)

  • isJitoRpc's catch { 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.
  • The No Jito-enabled RPC connection available error is opaque for plan/config issues; consider rewording.

Closes EMB-462

…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-bot

changeset-bot Bot commented Jun 24, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: a9175a6

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@lifi/sdk-provider-solana Patch

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

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