-
Notifications
You must be signed in to change notification settings - Fork 75
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: enhanced eth_getLogs with timestamp range validation and new error handling #3431
feat: enhanced eth_getLogs with timestamp range validation and new error handling #3431
Conversation
Signed-off-by: Logan Nguyen <logan.nguyen@swirldslabs.com>
Signed-off-by: Logan Nguyen <logan.nguyen@swirldslabs.com>
… and toBlock is valid Signed-off-by: Logan Nguyen <logan.nguyen@swirldslabs.com>
Signed-off-by: Logan Nguyen <logan.nguyen@swirldslabs.com>
Signed-off-by: Logan Nguyen <logan.nguyen@swirldslabs.com>
Signed-off-by: Logan Nguyen <logan.nguyen@swirldslabs.com>
Test Results 18 files - 4 236 suites - 35 33m 5s ⏱️ - 32m 38s Results for commit 6b90c41. ± Comparison against base commit 373f1dc. This pull request removes 4 and adds 8 tests. Note that renamed tests count towards both.
♻️ This comment has been updated with latest results. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good some questions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LG, some nits that can be addressed in a follow-up PR due to the urgency of this one.
packages/relay/src/lib/services/ethService/ethCommonService/index.ts
Outdated
Show resolved
Hide resolved
packages/relay/src/lib/services/ethService/ethCommonService/index.ts
Outdated
Show resolved
Hide resolved
Signed-off-by: Logan Nguyen <logan.nguyen@swirldslabs.com>
Signed-off-by: Logan Nguyen <logan.nguyen@swirldslabs.com>
Signed-off-by: Logan Nguyen <logan.nguyen@swirldslabs.com>
d8743aa
Signed-off-by: Logan Nguyen <logan.nguyen@swirldslabs.com>
…kNum Signed-off-by: Logan Nguyen <logan.nguyen@swirldslabs.com>
d8743aa
to
6b90c41
Compare
Quality Gate passedIssues Measures |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, we just have to discuss if we will limit users to 7 days or we somehow handle this limiti from the MN side
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3431 +/- ##
==========================================
+ Coverage 84.18% 85.35% +1.16%
==========================================
Files 69 69
Lines 4711 4738 +27
Branches 1048 1056 +8
==========================================
+ Hits 3966 4044 +78
+ Misses 428 394 -34
+ Partials 317 300 -17
Flags with carried forward coverage won't be shown. Click here to find out more.
|
…ror handling (#3431) * fix: returned empty array for eth_getLogs if toBlock is not found Signed-off-by: Logan Nguyen <logan.nguyen@swirldslabs.com> * feat: added new predefined error TIMESTAMP_RANGE_TOO_LARGE Signed-off-by: Logan Nguyen <logan.nguyen@swirldslabs.com> * fix: added validation to ensure the timestamp range between fromBlock and toBlock is valid Signed-off-by: Logan Nguyen <logan.nguyen@swirldslabs.com> * chore: added comments to clarify the logic Signed-off-by: Logan Nguyen <logan.nguyen@swirldslabs.com> * test: added unit test Signed-off-by: Logan Nguyen <logan.nguyen@swirldslabs.com> * test: added acceptance test Signed-off-by: Logan Nguyen <logan.nguyen@swirldslabs.com> * chore: updated a unique JsonRPC error code for TIMESTAMP_RANGE_TOO_LARGE Signed-off-by: Logan Nguyen <logan.nguyen@swirldslabs.com> * chore: updated 7 timestamp validation Signed-off-by: Logan Nguyen <logan.nguyen@swirldslabs.com> * chore: explained the logic behind MISSING_FROM_BLOCK_PARAM error Signed-off-by: Logan Nguyen <logan.nguyen@swirldslabs.com> * feat: added a dedicated validateBlockRange for eth_newFilter Signed-off-by: Logan Nguyen <logan.nguyen@swirldslabs.com> * fix: threw INVALID_BLOCK_RANGE if fromBlockNum is greater than toBlockNum Signed-off-by: Logan Nguyen <logan.nguyen@swirldslabs.com> --------- Signed-off-by: Logan Nguyen <logan.nguyen@swirldslabs.com>
…lidation and new error handling (#3431) to release/0.64 (#3434) feat: enhanced eth_getLogs with timestamp range validation and new error handling (#3431) * fix: returned empty array for eth_getLogs if toBlock is not found * feat: added new predefined error TIMESTAMP_RANGE_TOO_LARGE * fix: added validation to ensure the timestamp range between fromBlock and toBlock is valid * chore: added comments to clarify the logic * test: added unit test * test: added acceptance test * chore: updated a unique JsonRPC error code for TIMESTAMP_RANGE_TOO_LARGE * chore: updated 7 timestamp validation * chore: explained the logic behind MISSING_FROM_BLOCK_PARAM error * feat: added a dedicated validateBlockRange for eth_newFilter * fix: threw INVALID_BLOCK_RANGE if fromBlockNum is greater than toBlockNum --------- Signed-off-by: Logan Nguyen <logan.nguyen@swirldslabs.com>
Description:
This pull request improves the eth_getLogs functionality by:
params.lte
field is omitted, leading to request rejected by MN. To address this, the function now returns an empty response to the client. (Fixes [eth_getLogs Failure] Handle non-existent toBlock in validateBlockRangeAndAddTimestampToParams method #3430)Tests and comments have been added to support and clarify these changes.
Related issue(s):
Fixes #3428
Notes for reviewer:
Checklist