Skip to content

Commit

Permalink
feat(eth-watch): catch another reth error (#3026)
Browse files Browse the repository at this point in the history
## What ❔

<!-- What are the changes this PR brings about? -->
<!-- Example: This PR adds a PR template to the repo. -->
<!-- (For bigger PRs adding more context is appreciated) -->

## Why ❔

<!-- Why are these changes done? What goal do they contribute to? What
are the principles behind them? -->
<!-- Example: PR templates ensure PR reviewers, observers, and future
iterators are in context about the evolution of repos. -->

## Checklist

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

- [ ] PR title corresponds to the body of PR (we generate changelog
entries from PRs).
- [ ] Tests for the changes have been added / updated.
- [ ] Documentation comments have been added / updated.
- [ ] Code has been formatted via `zk_supervisor fmt` and `zk_supervisor
lint`.
  • Loading branch information
perekopskiy authored Oct 7, 2024
1 parent e984bfb commit 4640c42
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion core/node/eth_watch/src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ pub trait EthClient: 'static + fmt::Debug + Send + Sync {
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_RETH: &str = "length limit exceeded";
const TOO_BIG_RANGE_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`]).
Expand Down Expand Up @@ -149,6 +150,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_BIG_RANGE_RETH)
|| err_message.contains(TOO_MANY_RESULTS_CHAINSTACK)
{
// get the numeric block ids
Expand Down

0 comments on commit 4640c42

Please sign in to comment.