Skip to content

Fix introduce retries if usdc tx fetching exceeds limits#275

Merged
sisou merged 11 commits into
masterfrom
iicruz/fix-usdc-max-tx-fetching
Aug 5, 2025
Merged

Fix introduce retries if usdc tx fetching exceeds limits#275
sisou merged 11 commits into
masterfrom
iicruz/fix-usdc-max-tx-fetching

Conversation

@ii-cruz

@ii-cruz ii-cruz commented Jul 15, 2025

Copy link
Copy Markdown
Member

Introduces a mechanism to retry the request with a smaller block interval if there is an error.

This is an example of the error message we get where no more tx are fetched afterwards.
Query timeout exceeded. Consider reducing your block range. Based on your parameters and the response size limit, this block range should work: [0x42b950f, 0x435784f]

Alchemy restricts log responses to 10k if the block range is >2000. So the safe query filter is tried with the provided block range, and if it fails, it attempts with a 2000 block range. If that still fails, it halves the range. https://www.alchemy.com/docs/deep-dive-into-eth_getlogs

@ii-cruz
ii-cruz requested a review from nibhar July 15, 2025 17:51
@ii-cruz ii-cruz self-assigned this Jul 15, 2025
@ii-cruz
ii-cruz marked this pull request as draft July 16, 2025 13:36
@ii-cruz
ii-cruz force-pushed the iicruz/fix-usdc-max-tx-fetching branch from 4be36be to b456665 Compare July 16, 2025 16:26
@ii-cruz
ii-cruz marked this pull request as ready for review July 17, 2025 13:06

@sisou sisou left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @ii-cruz!

I'll make some adjustments and then try to get it out ASAP 👍

Comment thread src/ethers.ts Outdated
Comment thread src/ethers.ts Outdated
Comment thread src/ethers.ts Outdated
Comment thread src/ethers.ts Outdated
Comment thread src/ethers.ts Outdated
Comment thread src/ethers.ts Outdated
Comment thread src/ethers.ts Outdated
Comment thread src/ethers.ts Outdated
sisou added 3 commits August 5, 2025 10:54
Until the documented maximum no-log-limit range of 2000.
Recently, all queries with the old range started to fail and recommended this smaller range instead.
@sisou
sisou force-pushed the iicruz/fix-usdc-max-tx-fetching branch from 19293d6 to 32b21bc Compare August 5, 2025 11:56
@sisou
sisou merged commit c4c0a1d into master Aug 5, 2025
1 check passed
@sisou
sisou deleted the iicruz/fix-usdc-max-tx-fetching branch August 5, 2025 11:59
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