Skip to content

fix(chain-submitter): bound Soroban RPC calls with a configurable timeout - #27

Open
jeffrey-graham wants to merge 1 commit into
Torrent998:mainfrom
jeffrey-graham:fix-chain-submitter-rpc-timeout-22
Open

jeffrey-graham wants to merge 1 commit into
Torrent998:mainfrom
jeffrey-graham:fix-chain-submitter-rpc-timeout-22

Conversation

@jeffrey-graham

@jeffrey-graham jeffrey-graham commented Nov 8, 2026 •

Copy link
Copy Markdown

What this changes

  • Adds a configurable timeout (timeoutMs, defaulting to DEFAULT_RPC_TIMEOUT_MS = 15_000) to SorobanRpcSubmitter in src/integrations/chain-submitter.ts that bounds both submit() (getNetwork + sendTransaction) and status() (getTransaction), and wires STELLAR_RPC_TIMEOUT_MS in src/main.ts / .env.example (rejecting non-positive or non-finite values at construction).
  • Rejects with a timeout Error when the Soroban RPC server does not respond within timeoutMs, preserving the ChainSubmitter contract where unknown network outcomes throw rather than returning { accepted: false } or "FAILED".
  • Adds test/chain-submitter.test.ts covering invalid timeoutMs rejection, fast RPC submit() / status() classification, never-resolving rpc.Server stubs on both submit() (getNetwork and sendTransaction) and status(), and IntentService keeping timed-out intents in SUBMITTED -> RECONCILING (never FAILED) across initial and repeated reconcile() ticks.

Closes #22

Why this belongs in this repository

SorobanRpcSubmitter lives in Torrent-api (src/integrations/chain-submitter.ts) and drives transaction submission and status polling for IntentService.

Other repo API/ABI impact

None — openapi/openapi.v1.json, Torrent-web request/response contracts, and the Soroban escrow ABI are unchanged.

Tests and evidence

GitHub Actions CI is awaiting maintainer workflow approval; ran the repository gates locally on Node 22.23.5:

  • npm run check (tsc --noEmit && eslint . && vitest run): 17 passed (17) test files, 117 passed | 1 skipped (118) tests (0 typecheck or ESLint errors).
  • npm run build (tsc -p tsconfig.build.json): passed (0 errors).
  • node scripts/check-docs.mjs: docs ok: 14 markdown files, all required files present, no broken relative links.
  • npm audit --omit=dev --audit-level=high: found 0 vulnerabilities.

Security/privacy and Stellar impact

Prevents a hung Soroban RPC endpoint from blocking IntentService.submit() indefinitely or stalling the reconcile() loop across pending intents, while never misclassifying an RPC timeout as a definitive on-chain rejection (accepted: false / FAILED). No secrets, signing keys, or mainnet configuration are introduced.

@jeffrey-graham
jeffrey-graham force-pushed the fix-chain-submitter-rpc-timeout-22 branch from ce3d13f to b032bd5 Compare November 12, 2026 13:11
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.

fix(chain-submitter): bound Soroban RPC calls with a timeout

1 participant