mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-06-16 11:51:35 +00:00
eth/filters: return -32602 for block range limit exceeded error
The eth_getLogs endpoint was returning -32000 (server error) when the requested block range exceeded the configured limit. This was inconsistent with other parameter validation errors in the same package which return -32602 (invalid params), and also inconsistent with Reth which returns -32602 for the same condition. This change makes the block range limit error return -32602, aligning it with the rest of the parameter validation errors in eth/filters and with other client implementations. Fixes #34646
This commit is contained in:
parent
d8cb8a962b
commit
5596261772
1 changed files with 1 additions and 1 deletions
|
|
@ -147,7 +147,7 @@ func (f *Filter) Logs(ctx context.Context) ([]*types.Log, error) {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
if f.rangeLimit != 0 && (end-begin) > f.rangeLimit {
|
if f.rangeLimit != 0 && (end-begin) > f.rangeLimit {
|
||||||
return nil, fmt.Errorf("exceed maximum block range: %d", f.rangeLimit)
|
return nil, invalidParamsErr("exceed maximum block range: %d", f.rangeLimit)
|
||||||
}
|
}
|
||||||
return f.rangeLogs(ctx, begin, end)
|
return f.rangeLogs(ctx, begin, end)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue