Skip to content

Commit

Permalink
fix: chainstack block limit exceeded (#2974)
Browse files Browse the repository at this point in the history
## What ❔

Added support for chainstack developer and growth plan. 

## Why ❔

I was getting the below error with chainstack's growth plan when I tried
run self deployed zksync hyperchain. To fix this, I have added
appropriate changes to the code.

```
ERROR zksync_eth_watch: Failed to process new blocks: Eth client error: JSON-RPC request get_logs(filter=Filter { from_block: Some(Number(6732838)), to_block: Some(Number(6757429)), block_hash: None, address: Some(ValueOrArray([0xadd82b0c015be3fb7e8410061b4f15d577b4207f, 0xd6ee28b24f87c1d634540699b00e9c37fdc7b3bd, 0x41b75786db38a486c99972c8322fcb14c4f000a2, 0x5d300908338b85bee3f30f2e0ad196fc1587b70d])), topics: Some([Some(ValueOrArray([0x4531cd5795773d7101c17bdeb9f5ab7f47d7056017506f937083be5d6e77a382, 0x23bc9f5dc037eb49c162fd08c2a4d43dfe70063149e140d502273168da0a0625, 0xd50ef21701c8ef211433b140724b8d6de471e7d822c8a616c3d424fe2d0e98a9]))]), limit: None }) failed: ErrorObject { code: InvalidParams, message: "Block range limit exceeded. See more details at https://docs.chainstack.com/docs/limits#evm-range-limits", data: None }
```

## Checklist

<!-- Check your PR fulfills the following items. -->
<!-- For draft PRs check the boxes as you complete them. -->

- [x] PR title corresponds to the body of PR (we generate changelog
entries from PRs).
- [x] Tests for the changes have been added / updated.
- [x] Documentation comments have been added / updated.
- [x] Code has been formatted via `zk fmt` and `zk lint`.
  • Loading branch information
sachanayush47 committed Sep 27, 2024
1 parent 2dc65f0 commit 4ffbf42
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions core/node/eth_watch/src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ pub const RETRY_LIMIT: usize = 5;
const TOO_MANY_RESULTS_INFURA: &str = "query returned more than";
const TOO_MANY_RESULTS_ALCHEMY: &str = "response size exceeded";
const TOO_MANY_RESULTS_RETH: &str = "query exceeds max block range";
const TOO_MANY_RESULTS_CHAINSTACK: &str = "range limit exceeded";

/// Implementation of [`EthClient`] based on HTTP JSON-RPC (encapsulated via [`EthInterface`]).
#[derive(Debug, Clone)]
Expand Down Expand Up @@ -148,6 +149,7 @@ impl EthHttpQueryClient {
if err_message.contains(TOO_MANY_RESULTS_INFURA)
|| err_message.contains(TOO_MANY_RESULTS_ALCHEMY)
|| err_message.contains(TOO_MANY_RESULTS_RETH)
|| err_message.contains(TOO_MANY_RESULTS_CHAINSTACK)
{
// get the numeric block ids
let from_number = match from {
Expand Down

0 comments on commit 4ffbf42

Please sign in to comment.