From dc25db9a0f65b87d6157edfb390f1e6421845831 Mon Sep 17 00:00:00 2001 From: Vicky Date: Wed, 11 Feb 2026 22:46:22 +0800 Subject: [PATCH] eth/filters: check history pruning cutoff in GetFilterLogs --- eth/filters/api.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/eth/filters/api.go b/eth/filters/api.go index f4bed35b26..60abb22f5b 100644 --- a/eth/filters/api.go +++ b/eth/filters/api.go @@ -532,6 +532,9 @@ func (api *FilterAPI) GetFilterLogs(ctx context.Context, id rpc.ID) ([]*types.Lo if f.crit.ToBlock != nil { end = f.crit.ToBlock.Int64() } + if begin >= 0 && begin < int64(api.events.backend.HistoryPruningCutoff()) { + return nil, &history.PrunedHistoryError{} + } // Construct the range filter filter = api.sys.NewRangeFilter(begin, end, f.crit.Addresses, f.crit.Topics, api.rangeLimit) }