From 778430a689af2ff9545ba69decbeb942243b2267 Mon Sep 17 00:00:00 2001 From: Lunor <73783151+lunargon@users.noreply.github.com> Date: Tue, 3 Jun 2025 22:13:35 +0700 Subject: [PATCH] eth/filters: fix pruned history error for genesis block (#31941) Fixes an issue where querying logs for block ranges starting from 0 would fail with an irrelevant error on a pruned node. Now the correct "history is pruned" error will be returned. --- eth/filters/api.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eth/filters/api.go b/eth/filters/api.go index 864dfd3746..f549dc4dec 100644 --- a/eth/filters/api.go +++ b/eth/filters/api.go @@ -359,7 +359,7 @@ func (api *FilterAPI) GetLogs(ctx context.Context, crit FilterCriteria) ([]*type if begin > 0 && end > 0 && begin > end { return nil, errInvalidBlockRange } - if begin > 0 && begin < int64(api.events.backend.HistoryPruningCutoff()) { + if begin >= 0 && begin < int64(api.events.backend.HistoryPruningCutoff()) { return nil, &history.PrunedHistoryError{} } // Construct the range filter