fix: use i64 instead of u64 in limit exceed error to avoid conversion#6872
fix: use i64 instead of u64 in limit exceed error to avoid conversion#6872akaladarshi merged 1 commit intomainfrom
i64 instead of u64 in limit exceed error to avoid conversion#6872Conversation
WalkthroughThis pull request changes the block range limit error handling in Ethereum RPC methods from unsigned 64-bit ( Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Possibly related PRs
Suggested labels
Suggested reviewers
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
✨ Simplify code
Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/rpc/methods/eth/errors.rs (1)
46-50: Add a doc comment tolimit_exceeded.This helper is now the single entry point for the signed range error, so a short note about the expected units/semantics would make future call sites clearer. As per coding guidelines "Document public functions and structs with doc comments".
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/rpc/methods/eth/errors.rs` around lines 46 - 50, Add a doc comment to the public helper function limit_exceeded describing its purpose and the semantics/units of its parameters and returned error: state that limit_exceeded(max_block_range: i64, given: i64) constructs a BlockRangeExceeded error where both parameters are signed i64 representing a block-range size (number of blocks in the requested range, not absolute block numbers), clarify whether the range is inclusive/exclusive if relevant, and note that the message uses these counts; attach the comment directly above the limit_exceeded function so callers of limit_exceeded and users of the BlockRangeExceeded variant understand the expected units and behavior.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@src/rpc/methods/eth/errors.rs`:
- Around line 46-50: Add a doc comment to the public helper function
limit_exceeded describing its purpose and the semantics/units of its parameters
and returned error: state that limit_exceeded(max_block_range: i64, given: i64)
constructs a BlockRangeExceeded error where both parameters are signed i64
representing a block-range size (number of blocks in the requested range, not
absolute block numbers), clarify whether the range is inclusive/exclusive if
relevant, and note that the message uses these counts; attach the comment
directly above the limit_exceeded function so callers of limit_exceeded and
users of the BlockRangeExceeded variant understand the expected units and
behavior.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 2f3674a8-15a3-4cec-9472-42154771823b
📒 Files selected for processing (3)
src/rpc/methods/eth.rssrc/rpc/methods/eth/errors.rssrc/rpc/methods/eth/filter/mod.rs
Codecov Report❌ Patch coverage is
Additional details and impacted files
... and 21 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
Summary of changes
Changes introduced in this pull request:
i64instead ofu64to avoid castingReference issue to close (if applicable)
Closes
Other information and links
Change checklist
Outside contributions
Summary by CodeRabbit