Skip to content

Commit 406a3ff

Browse files
authored
feat(eth-watch): split heavy get logs requests if 503 (#3706)
## What ❔ split heavy get logs requests if got error 503 ## Why ❔ We use proxyd that proxies mostly vanila reth nodes in our setup, some get_logs requests with big block range take a lot of time so they can rejected in proxyd by timeout, in this case 503 is returned. We should split such requests into smaller so they can be processed. ## Is this a breaking change? - [ ] Yes - [x] No ## Operational changes No ## 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 `zkstack dev fmt` and `zkstack dev lint`.
1 parent 606d5af commit 406a3ff

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

core/node/eth_watch/src/client.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ const TOO_MANY_RESULTS_ALCHEMY: &str = "response size exceeded";
9090
const TOO_MANY_RESULTS_RETH: &str = "length limit exceeded";
9191
const TOO_BIG_RANGE_RETH: &str = "query exceeds max block range";
9292
const TOO_MANY_RESULTS_CHAINSTACK: &str = "range limit exceeded";
93+
const REQUEST_REJECTED_503: &str = "Request rejected `503`";
9394

9495
/// Implementation of [`EthClient`] based on HTTP JSON-RPC.
9596
#[derive(Debug, Clone)]
@@ -222,6 +223,7 @@ where
222223
|| err_message.contains(TOO_MANY_RESULTS_RETH)
223224
|| err_message.contains(TOO_BIG_RANGE_RETH)
224225
|| err_message.contains(TOO_MANY_RESULTS_CHAINSTACK)
226+
|| err_message.contains(REQUEST_REJECTED_503)
225227
{
226228
// get the numeric block ids
227229
let from_number = match from {

0 commit comments

Comments
 (0)