hashgraph / hedera-json-rpc-relay

Implementation of Ethereum JSON-RPC APIs for Hedera
Apache License 2.0
68 stars 72 forks source link

fix: Update `getBlockByHash` and `getBlockByNumber` to pass `timestamp` to MAPI calls #3048

Closed victor-yanev closed 1 month ago

victor-yanev commented 1 month ago

Description:

Related issue(s):

Fixes #3040

Notes for reviewer:

Checklist

github-actions[bot] commented 1 month ago

🚨 Memory Leak Detected 🚨

A potential memory leak has been detected in the test titled should execute "eth_getTransactionByHash with missing transaction". This may impact the application's performance and stability.

Details

📊 Memory Leak Detection Report 📊

GC Type: MarkSweepCompact Cost: 27,761.2 ms

Heap Statistics (before vs after executing the test):

Heap Space Statistics (before vs after executing the test):

Recommendations

Please investigate the memory allocations in this test, focusing on objects that are not being properly deallocated.

github-actions[bot] commented 1 month ago

Tests

       3 files     297 suites   19s :stopwatch: 1 353 tests 1 352 :heavy_check_mark: 1 :zzz: 0 :x: 1 362 runs  1 361 :heavy_check_mark: 1 :zzz: 0 :x:

Results for commit 9cd8081e.

:recycle: This comment has been updated with latest results.

github-actions[bot] commented 1 month ago

Acceptance Tests

  16 files  214 suites   29m 12s :stopwatch: 602 tests 598 :heavy_check_mark: 4 :zzz: 0 :x: 618 runs  614 :heavy_check_mark: 4 :zzz: 0 :x:

Results for commit 9cd8081e.

:recycle: This comment has been updated with latest results.

sonarcloud[bot] commented 1 month ago

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarCloud

victor-yanev commented 1 month ago

After discussing this with xin, it seems like those changes were not needed

codecov[bot] commented 1 month ago

Codecov Report

Attention: Patch coverage is 83.33333% with 1 line in your changes missing coverage. Please review.

Project coverage is 84.02%. Comparing base (f1794d8) to head (9cd8081).

Files with missing lines Patch % Lines
packages/relay/src/lib/clients/mirrorNodeClient.ts 75.00% 0 Missing and 1 partial :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #3048 +/- ## ========================================== - Coverage 84.83% 84.02% -0.82% ========================================== Files 59 62 +3 Lines 3937 4094 +157 Branches 786 822 +36 ========================================== + Hits 3340 3440 +100 - Misses 357 407 +50 - Partials 240 247 +7 ``` | [Flag](https://app.codecov.io/gh/hashgraph/hedera-json-rpc-relay/pull/3048/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=hashgraph) | Coverage Δ | | |---|---|---| | [relay](https://app.codecov.io/gh/hashgraph/hedera-json-rpc-relay/pull/3048/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=hashgraph) | `84.92% <83.33%> (-0.02%)` | :arrow_down: | | [server](https://app.codecov.io/gh/hashgraph/hedera-json-rpc-relay/pull/3048/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=hashgraph) | `83.43% <ø> (ø)` | | | [ws-server](https://app.codecov.io/gh/hashgraph/hedera-json-rpc-relay/pull/3048/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=hashgraph) | `97.87% <ø> (ø)` | | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=hashgraph#carryforward-flags-in-the-pull-request-comment) to find out more. | [Files with missing lines](https://app.codecov.io/gh/hashgraph/hedera-json-rpc-relay/pull/3048?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=hashgraph) | Coverage Δ | | |---|---|---| | [packages/relay/src/lib/eth.ts](https://app.codecov.io/gh/hashgraph/hedera-json-rpc-relay/pull/3048?src=pr&el=tree&filepath=packages%2Frelay%2Fsrc%2Flib%2Feth.ts&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=hashgraph#diff-cGFja2FnZXMvcmVsYXkvc3JjL2xpYi9ldGgudHM=) | `82.79% <100.00%> (+0.92%)` | :arrow_up: | | [.../lib/services/ethService/ethCommonService/index.ts](https://app.codecov.io/gh/hashgraph/hedera-json-rpc-relay/pull/3048?src=pr&el=tree&filepath=packages%2Frelay%2Fsrc%2Flib%2Fservices%2FethService%2FethCommonService%2Findex.ts&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=hashgraph#diff-cGFja2FnZXMvcmVsYXkvc3JjL2xpYi9zZXJ2aWNlcy9ldGhTZXJ2aWNlL2V0aENvbW1vblNlcnZpY2UvaW5kZXgudHM=) | `89.14% <100.00%> (ø)` | | | [packages/relay/src/lib/types/mirrorNode.ts](https://app.codecov.io/gh/hashgraph/hedera-json-rpc-relay/pull/3048?src=pr&el=tree&filepath=packages%2Frelay%2Fsrc%2Flib%2Ftypes%2FmirrorNode.ts&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=hashgraph#diff-cGFja2FnZXMvcmVsYXkvc3JjL2xpYi90eXBlcy9taXJyb3JOb2RlLnRz) | `100.00% <ø> (ø)` | | | [packages/relay/src/lib/clients/mirrorNodeClient.ts](https://app.codecov.io/gh/hashgraph/hedera-json-rpc-relay/pull/3048?src=pr&el=tree&filepath=packages%2Frelay%2Fsrc%2Flib%2Fclients%2FmirrorNodeClient.ts&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=hashgraph#diff-cGFja2FnZXMvcmVsYXkvc3JjL2xpYi9jbGllbnRzL21pcnJvck5vZGVDbGllbnQudHM=) | `89.29% <75.00%> (+0.09%)` | :arrow_up: | ... and [9 files with indirect coverage changes](https://app.codecov.io/gh/hashgraph/hedera-json-rpc-relay/pull/3048/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=hashgraph)