Skip to content

fix: add timeout to bare getAccountInfo calls in crank service (M1+M2)#92

Open
0x-SquidSol wants to merge 1 commit intodcccrypto:mainfrom
0x-SquidSol:fix/m1-m2-crank-getaccountinfo-timeout
Open

fix: add timeout to bare getAccountInfo calls in crank service (M1+M2)#92
0x-SquidSol wants to merge 1 commit intodcccrypto:mainfrom
0x-SquidSol:fix/m1-m2-crank-getaccountinfo-timeout

Conversation

@0x-SquidSol
Copy link
Copy Markdown
Contributor

Summary

Two bare getAccountInfo calls in crank.ts had no timeout wrapper, allowing hung RPC nodes to block the keeper indefinitely.

M1 — HYPERP pool lookup (line 503):

  • Fetches DEX pool account to detect type (PumpSwap/Meteora/Raydium)
  • A hung RPC blocked the entire crank batch of 10 markets
  • Fix: withTimeout() + local try/catch — pool data is optional, so timeout degrades gracefully (crank proceeds without vault remaining accounts)

M2 — MARKETS_FILTER discovery (line 183):

  • Sequential getAccountInfo for each filtered slab address at startup
  • A hung RPC blocked startup indefinitely
  • Fix: withTimeout() — existing try/catch catches timeout and continues to next address

Test plan

  • All 133 tests pass
  • Both fixes use existing withTimeout() and RPC_TIMEOUT_MS (15s)

🤖 Generated with Claude Code

M1: HYPERP pool getAccountInfo (line 503) had no timeout. A hung RPC
blocked the entire crank batch. Now wrapped with withTimeout() and a
local try/catch — pool lookup is optional, so timeout degrades
gracefully (crank proceeds without remaining accounts).

M2: MARKETS_FILTER getAccountInfo (line 183) had no timeout. A hung
RPC blocked startup indefinitely. Now wrapped with withTimeout().
The existing try/catch catches the timeout and continues to the next
slab address.

Both use the existing RPC_TIMEOUT_MS (15s) and withTimeout() helper
already used by registerMarket().

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 9, 2026

Warning

Rate limit exceeded

@0x-SquidSol has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 7 minutes and 53 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 7 minutes and 53 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 02aa26ee-8470-40c6-996c-ca7b7594a8f4

📥 Commits

Reviewing files that changed from the base of the PR and between 3280971 and 4f9e38b.

📒 Files selected for processing (1)
  • src/services/crank.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

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