From 6ddf19a5b5757388fe9d2392ef35813699690d94 Mon Sep 17 00:00:00 2001 From: belopash Date: Fri, 3 Jan 2025 15:29:40 +0400 Subject: [PATCH 1/2] evm: handle logs response is too big error --- evm/evm-processor/src/ds-rpc/rpc.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/evm/evm-processor/src/ds-rpc/rpc.ts b/evm/evm-processor/src/ds-rpc/rpc.ts index f5ee09862..1d7047b1e 100644 --- a/evm/evm-processor/src/ds-rpc/rpc.ts +++ b/evm/evm-processor/src/ds-rpc/rpc.ts @@ -300,7 +300,7 @@ export class Rpc { throw new RpcError(info) } }).catch(async err => { - if (isQueryReturnedMoreThanNResultsError(err)) { + if (isLogsResponseTooBigError(err)) { let range = asTryAnotherRangeError(err) if (range == null) { range = {from, to: Math.floor(from + (to - from) / 2)} @@ -746,14 +746,16 @@ class RpcProps { } } -function isQueryReturnedMoreThanNResultsError(err: unknown) { +function isLogsResponseTooBigError(err: unknown) { if (!(err instanceof RpcError)) return false - return /query returned more than/i.test(err.message) + if (/query returned more than/i.test(err.message)) return true + if (/response is too big/i.test(err.message)) return true + return false } function asTryAnotherRangeError(err: unknown): FiniteRange | undefined { if (!(err instanceof RpcError)) return - let m = /Try with this block range \[(0x[0-9a-f]+), (0x[0-9a-f]+)]/i.exec(err.message) + let m = /try with this block range \[(0x[0-9a-f]+), (0x[0-9a-f]+)]/i.exec(err.message) if (m == null) return let from = qty2Int(m[1]) let to = qty2Int(m[2]) From 7f2995777b21791f33d4416349b4cdef59c93430 Mon Sep 17 00:00:00 2001 From: belopash Date: Fri, 3 Jan 2025 15:31:00 +0400 Subject: [PATCH 2/2] changes --- .../logs-response-is-too-big_2025-01-03-11-30.json | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 common/changes/@subsquid/evm-processor/logs-response-is-too-big_2025-01-03-11-30.json diff --git a/common/changes/@subsquid/evm-processor/logs-response-is-too-big_2025-01-03-11-30.json b/common/changes/@subsquid/evm-processor/logs-response-is-too-big_2025-01-03-11-30.json new file mode 100644 index 000000000..452c6c385 --- /dev/null +++ b/common/changes/@subsquid/evm-processor/logs-response-is-too-big_2025-01-03-11-30.json @@ -0,0 +1,10 @@ +{ + "changes": [ + { + "packageName": "@subsquid/evm-processor", + "comment": "handle logs response is too big error", + "type": "minor" + } + ], + "packageName": "@subsquid/evm-processor" +} \ No newline at end of file