KeeperHub / KeeperHub/keeperhub
fix: successful Solana SPL transfers are reconciled as terminally failed
- Dominant language
- TypeScript
- Stars
- 24
- Forks
- 93
- Avg merge
- 1d 8h
- Merged PRs (30d)
- 266
Description
`plugins/web3/steps/transfer-spl-token-core.ts:514-520` returns `transactionHash` with no `chainId` on its result type. The `isTransactionResult` gate at `app/api/execute/node/route.ts:174-188` requires only a string `transactionHash` and a string `gasUsed`, both of which are present, so `completeExecution` receives `chainId: undefined` by a reachable path.
The idempotency consequence is already handled: `completeExecution` returns `unconfirmed` there rather than `failed`, so the key is held instead of being freed for an SPL transfer that succeeded. That part is settled in #2372.
What is not handled is what happens to the row afterwards.
The resulting row has a hash, no receipts and a null `completedAt`, so it passes the reconciler's eligibility filter. `resolveChainId` falls through to `Number(execution.network)`, and the node route stores the caller's raw config string. `Number("solana")` is `NaN`, so `reconcileOne` stamps a terminal `failed` with "chain could not be resolved" without ever reading a receipt. `tests/unit/reconcile-executions.test.ts:255-266` pins that behaviour today, asserting the verifier is never called.
The effect is that a successful Solana SPL transfer is recorded as terminally failed.
Worth noting that `tests/unit/step-transaction-hash-chain-id.test.ts:33-37` already allowlists the Solana cores as hash-without-`chainId`, on the grounds that "these outputs never reach reconciliation". That is true for the workflow path's filter and not for `/api/execute/node`.
The fix is a `chainId` on that core's success return, which has nothing to do with idempotency and is why this is filed separately rather than carried on the #2372 branch.
Raised by @suisuss in review on #2372 and on #2373; filing it so it is not lost with that PR.
Contributor guide
Research direction
Start in plugins/web3/steps/transfer-spl-token-core.ts:514-520 and inspect the success return for the SPL transfer core. Read app/api/execute/node/route.ts:174-188 and the reconciliation path to understand how the result is consumed. Update the success return with the required chainId, then run tests/unit/reconcile-executions.test.ts:255-266 and tests/unit/step-transaction-hash-chain-id.test.ts:33-37; done means successful SPL transfers are not stamped terminally failed.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- blockchain
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 78/100