-
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
fix: enhanced reliability of eth RPC methods with null checks and retry mechanisms #3349
Conversation
Test Results 20 files - 4 312 suites - 49 38m 13s ⏱️ - 22m 7s For more details on these failures, see this check. Results for commit 051f326. ± Comparison against base commit 90739e1. This pull request removes 6 tests.
♻️ This comment has been updated with latest results. |
675eb4a
to
d265305
Compare
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.
Good catch.
Some considerations
packages/relay/src/lib/services/ethService/ethCommonService/index.ts
Outdated
Show resolved
Hide resolved
936f1e9
to
b959fc7
Compare
19d9838
to
e1c8fd0
Compare
3b96fc4
to
aad493c
Compare
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>
a5a0e1f
to
78fa644
Compare
…Contract MN methods Signed-off-by: Logan Nguyen <logan.nguyen@swirldslabs.com>
bac3c74
to
d7f5829
Compare
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> Revert "fix: reverted licenses" This reverts commit d3c860a. Reapply "fix: reverted licenses" This reverts commit 50a9acd5031490f3f805042a70bfdae7c589146d.
Signed-off-by: Logan Nguyen <logan.nguyen@swirldslabs.com>
d6756f0
to
8687322
Compare
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, one question/thought that might be resolved before merging.
…k_hash is empty Signed-off-by: Logan Nguyen <logan.nguyen@swirldslabs.com>
9f2e473
to
051f326
Compare
Quality Gate failedFailed conditions |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3349 +/- ##
==========================================
- Coverage 85.30% 84.83% -0.47%
==========================================
Files 69 69
Lines 4688 4721 +33
Branches 1050 1063 +13
==========================================
+ Hits 3999 4005 +6
- Misses 374 399 +25
- Partials 315 317 +2
Flags with carried forward coverage won't be shown. Click here to find out more.
|
…ry mechanisms (#3349) * fix: fixed flaky precheck test Signed-off-by: Logan Nguyen <logan.nguyen@swirldslabs.com> * fix: handle log null entities more gracefully in getBlock() Signed-off-by: Logan Nguyen <logan.nguyen@swirldslabs.com> * fix: added null check to root hash builder Signed-off-by: Logan Nguyen <logan.nguyen@swirldslabs.com> * fix: modified getContractResultWithRetry() to accept more general getContract MN methods Signed-off-by: Logan Nguyen <logan.nguyen@swirldslabs.com> * fix: reused getContractResultWithRetry for getContractResults Signed-off-by: Logan Nguyen <logan.nguyen@swirldslabs.com> * fix: added getContractResultsLogsWithRetry() Signed-off-by: Logan Nguyen <logan.nguyen@swirldslabs.com> * fix: reverted licenses Signed-off-by: Logan Nguyen <logan.nguyen@swirldslabs.com> Revert "fix: reverted licenses" This reverts commit d3c860a. Reapply "fix: reverted licenses" This reverts commit 50a9acd5031490f3f805042a70bfdae7c589146d. * fix: checked empty blockHash for getHistoricalBlockResponse() Signed-off-by: Logan Nguyen <logan.nguyen@swirldslabs.com> * fix: throw error if log.block_number or log.index is null or log.block_hash is empty Signed-off-by: Logan Nguyen <logan.nguyen@swirldslabs.com> --------- Signed-off-by: Logan Nguyen <logan.nguyen@swirldslabs.com>
…ds with null checks and retry mechanisms to release/0.63 (#3363) fix: enhanced reliability of eth RPC methods with null checks and retry mechanisms (#3349) * fix: fixed flaky precheck test * fix: handle log null entities more gracefully in getBlock() * fix: added null check to root hash builder * fix: modified getContractResultWithRetry() to accept more general getContract MN methods * fix: reused getContractResultWithRetry for getContractResults * fix: added getContractResultsLogsWithRetry() * fix: reverted licenses Revert "fix: reverted licenses" This reverts commit d3c860a. Reapply "fix: reverted licenses" This reverts commit 50a9acd5031490f3f805042a70bfdae7c589146d. * fix: checked empty blockHash for getHistoricalBlockResponse() * fix: throw error if log.block_number or log.index is null or log.block_hash is empty --------- Signed-off-by: Logan Nguyen <logan.nguyen@swirldslabs.com>
Description:
Numerous requests for
eth_getBlockByNumber
andeth_getBlockByHash
have been reported as failing with errors such asCannot read properties of null
andReceived an invalid integer type: null
.Additionally,
eth_getTransactionReceipt
is also reported to be failing withError invoking RPC: Invalid parameter: hashOrNumber
.These issues stem from regressions in the
getBlock()
method, which lacks adequate null checks in certain areas. This pull request addresses the problem by implementing proper null checks and enhancing fallback mechanisms and error handling.Partially, the results of contracts and log responses from the Mirror Node occasionally contain undefined fields, such as transaction_index, block_hash, block_number, and log_index. This issue may arise because the Mirror Node database does not have sufficient time to save all the information before it is fetched. This PR adds a retry mechanism to the fetching methods that checks for these cases, waits for a specified duration, and then retries the fetch operation.
Related issue(s):
Fixes #3345
Fixes #3351
Notes for reviewer:
Checklist