fix(eth/filters): return -32602 when exceeding the block range limit #34647#2429
fix(eth/filters): return -32602 when exceeding the block range limit #34647#2429gzliudan wants to merge 1 commit into
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Pull request overview
This PR aligns eth/filters range-limit failures with JSON-RPC semantics by returning an Invalid params RPC error (code -32602) when a log query exceeds the configured block range limit.
Changes:
- Replace the plain
fmt.Errorfrange-limit error inFilter.Logswith an RPC-compatibleinvalidParamsErr(code-32602). - Update
TestRangeLimitto assert both RPC error code-32602and the exact error message.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| eth/filters/filter.go | Returns an RPC invalid-params error when the requested block span exceeds rangeLimit. |
| eth/filters/filter_test.go | Strengthens the test to verify the returned error is an rpc.Error with code -32602 and the expected message. |
9285a46 to
3c881ad
Compare
Proposed changes
Ref: ethereum#34647
Types of changes
What types of changes does your code introduce to XDC network?
Put an
✅in the boxes that applyImpacted Components
Which parts of the codebase does this PR touch?
Put an
✅in the boxes that applyChecklist
Put an
✅in the boxes once you have confirmed below actions (or provide reasons on not doing so) that