Skip to content

fix: bound CoinGecko price requests - #236

Open
Kewe63 wants to merge 1 commit into
t1protocol:canaryfrom
Kewe63:fix/235-coingecko-timeout
Open

Kewe63 wants to merge 1 commit into
t1protocol:canaryfrom
Kewe63:fix/235-coingecko-timeout

Conversation

@Kewe63

@Kewe63 Kewe63 commented Sep 18, 2026

Copy link
Copy Markdown

Description

  • Abort CoinGecko price requests after a bounded five-second deadline.
  • Reuse the existing fallback path when the request times out or is cancelled.
  • Clear the timeout after both successful and failed requests.
  • Add focused regression coverage for timeout fallback and timer cleanup.

Motivation and Context

ThresholdMonitor.readEthPriceFromCoingecko() awaited fetch() without a deadline. A rejected request reached the configured fallback, but a request that remained pending blocked pauseOrUnpauseIfNeeded() forever. Because each chain monitor waits for that call before its next poll, one stalled CoinGecko request permanently stopped pause/unpause evaluations for that chain.

The request now uses an AbortController with a bounded timeout. Aborts are handled by the existing error path, so the monitor uses ETH_PRICE_FALLBACK and continues polling.

Fixes #235.

This change is independent of #232 and #234. A synthetic combined tree containing all three PR heads merged without conflict and passed all seven focused intent-pauser tests.

How Has This Been Tested?

  • Pre-fix regression run: 0 passed, 2 failed; the pending request lost the 100 ms test watchdog and the successful request received no abort signal.
  • bun test test/TresholdMonitor.timeout.test.ts — 2 passed, 0 failed.
  • bun test — 2 passed, 0 failed on this branch.
  • Direct TypeScript check of the changed source and test — passed:
    • bun x tsc --noEmit --target ESNext --module Preserve --moduleResolution Bundler --types bun --skipLibCheck --allowImportingTsExtensions src/TresholdMonitor.ts test/TresholdMonitor.timeout.test.ts
  • Combined tree with open PRs fix: parse CoinGecko price response #232 and fix: preserve fractional token value #234:
    • bun test — 7 passed, 0 failed across three focused test files.
    • Direct TypeScript check of the changed source and all three test files — passed.
    • All three PR heads were verified as ancestors of the tested combined commit.
  • git diff --check — passed.
  • Independent code review — passed with no blocking findings; both non-blocking test suggestions were applied.
  • bun x tsc -p tsconfig.json --noEmit remains blocked on the unchanged base by the missing generated ../../contracts/artifacts/src/T1ERC7683.sol/T1ERC7683.json artifact; the same error reproduces on clean canary.

Types of changes (remove all unchecked types)

  • Bug fix (non-breaking change which fixes an issue)

Checklist:

  • I assessed the documentation impact; no documentation update is required.
  • I assessed the deployment-script impact; no deployment-script update is required.
  • I added focused regression coverage for timeout fallback and timer cleanup.

Abort stalled price requests after a bounded deadline and fall back so the monitor loop continues. Add regression coverage for timeout fallback and timer cleanup.\n\nFixes t1protocol#235.
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.

Intent pauser can hang indefinitely when CoinGecko request never settles

1 participant