Skip to content

fix: switch ICP polling to DB-based RegisterStrategy#3309

Merged
davidleomay merged 3 commits intodevelopfrom
fix/icp-polling-to-register-strategy
Mar 3, 2026
Merged

fix: switch ICP polling to DB-based RegisterStrategy#3309
davidleomay merged 3 commits intodevelopfrom
fix/icp-polling-to-register-strategy

Conversation

@bernd2022
Copy link
Collaborator

Summary

  • Replace in-memory block tracking (PollingStrategy) with DB-based block height lookups (RegisterStrategy) to prevent skipping archived blocks after API restarts
  • Align ICP with the Cardano/Citrea pattern using getActiveDepositAddresses(), pollAddress() and per-address block filtering
  • Change cron interval from EVERY_SECOND to EVERY_MINUTE (consistent with other RegisterStrategy implementations)

Test plan

  • TypeCheck passes (npx tsc --noEmit)
  • All 61 test suites pass (839 tests)
  • Prettier formatting verified
  • E2E: Buy-ICP flow (EUR → ICP) processes correctly after API restart
  • E2E: Sell-ICP flow (ICP → EUR) detects deposits via PayIn cron
  • E2E: Token transfers (ckUSDT) detected with correct inTxId format (canisterId:blockIndex)
  • E2E: Verify no archived blocks skipped after API restart

Replace in-memory block tracking (PollingStrategy) with DB-based block
height lookups (RegisterStrategy) to prevent skipping archived blocks
after API restarts. Aligns ICP with the Cardano/Citrea pattern using
getActiveDepositAddresses() and per-address block filtering.
Replace global query_blocks scan with Rosetta /search/transactions
per account_identifier. This avoids stalling when thousands of
unrelated blocks separate the last known crypto_input from the
current chain tip.

Remove token PayIn code (not in use), consolidate Rosetta DTOs.
@davidleomay davidleomay merged commit 5eba6f7 into develop Mar 3, 2026
8 checks passed
@davidleomay davidleomay deleted the fix/icp-polling-to-register-strategy branch March 3, 2026 10:14
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.

2 participants