eth/filters: check history pruning cutoff in GetFilterLogs (#33823)
Some checks are pending
/ Linux Build (push) Waiting to run
/ Linux Build (arm) (push) Waiting to run
/ Keeper Build (push) Waiting to run
/ Windows Build (push) Waiting to run
/ Docker Image (push) Waiting to run

Return proper error for the log filters going beyond pruning
point on a node with expired history.
This commit is contained in:
vickkkkkyy 2026-03-13 20:26:20 +08:00 committed by GitHub
parent dba741fd31
commit 189f9d0b17
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -536,6 +536,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)
}