Skip to content

fix(privy-integration): bound unbounded fee-payer fetch with 30s AbortSignal.timeout - #2573

Open
hermiondev wants to merge 1 commit into
alchemyplatform:v4.x.xfrom
hermiondev:fix/privy-fetch-timeout
Open

hermiondev wants to merge 1 commit into
alchemyplatform:v4.x.xfrom
hermiondev:fix/privy-fetch-timeout

Conversation

@hermiondev

@hermiondev hermiondev commented Sep 27, 2026 •

Copy link
Copy Markdown

Problem

createSolanaSponsoredTransaction (account-kit/privy-integration) POSTs to alchemy_requestFeePayer with a bare fetch — no timeout, no AbortSignal (src/util/createSolanaSponsoredTransaction.ts:60, shipped in @account-kit/privy-integration@4.88.5 dist/esm/util/createSolanaSponsoredTransaction.js:44).

If the fee-payer RPC endpoint accepts the connection but never replies, sponsored transaction construction hangs forever — no error, no timeout, the caller awaits indefinitely.

This is the same defect class fixed for the signer package in #2572; that PR covers signer/src/client/base.ts and signer/src/utils/solana.ts but the privy-integration package has its own copy of the pattern and was missed.

Reproduction

Node 20, stall server (accepts, never replies), same options shape as the source:

  • unfixed shape: request still pending at 8s watchdog (exit 124)
  • patched shape (signal: AbortSignal.timeout(3000)): TimeoutError at ~3001ms

Fix

signal: AbortSignal.timeout ? AbortSignal.timeout(30_000) : undefined added to the request options — feature-detected so runtimes without AbortSignal.timeout keep working unchanged. 1 file, +4/-0.

Validation

  • tsc -p account-kit/privy-integration/tsconfig.build.json --noEmit: error count identical pre/post-fix (40 pre-existing module-resolution errors in this workspace state, 0 new)
  • Static scan (fetch of shipped npm tarball @account-kit/privy-integration@4.88.5): UNBOUNDED before, BOUNDED after

PR-Codex overview

This PR adds a timeout feature to the fee-payer request in the createSolanaSponsoredTransaction.ts file to prevent indefinite hanging during sponsored transaction construction if the RPC endpoint does not respond.

Detailed summary

  • Added a timeout for the fee-payer request using AbortSignal.timeout.
  • The timeout is set to 30 seconds (30_000 milliseconds).
  • Included comments explaining the reason for the timeout and its feature detection for compatibility.

✨ Ask PR-Codex anything about this PR by commenting with /codex {your question}

…tSignal.timeout

createSolanaSponsoredTransaction POSTs to alchemy_requestFeePayer with a
bare fetch (no timeout/AbortSignal). A stalled Alchemy endpoint hangs
sponsored transaction construction forever. Reproduced vs a stall server:
unfixed shape pending past 8s watchdog; patched shape rejects TimeoutError
at 3001ms. Same treatment as signer base.ts/solana.ts in alchemyplatform#2572, which
missed this site (separate package). Feature-detected for runtimes without
AbortSignal.timeout.

This branch has not been deployed

No deployments
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