hashgraph / hedera-json-rpc-relay

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

feat: remove transactions with status `INVALID_ACCOUNT_ID` from block-specific routes #3177

Closed natanasow closed 2 weeks ago

natanasow commented 2 weeks ago

Description:

Currently, there are transactions that hadn't entered the evm (reverted due to hedera-specific validations) but are included in a generated record file, also they are imported in the mirror node db. These transactions must be excluded from the response to block-related routes.

Solutions:

We should hook in here https://github.com/hashgraph/hedera-json-rpc-relay/pull/3158/files#diff-dd8c7990f7764960d05dcb4c1b5ae7eee48b425b1b83d6dcc7e7ccc442330ef0R2303 and add a type for INVALID_ACCOUNT_ID as well.

These checks must be defined as an environment variable (as an array) and we could be able easily to add/remove transaction statuses.

Related issue(s):

Fixes #3171

Notes for reviewer:

Checklist

github-actions[bot] commented 2 weeks ago

🚨 Memory Leak Detected 🚨

A potential memory leak has been detected in the test titled validates enforcement of request id. This may impact the application's performance and stability.

Details

πŸ“Š Memory Leak Detection Report πŸ“Š

GC Type: MarkSweepCompact Cost: 30,549.4 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 2 weeks ago

Test Results

 17 files   -β€Šβ€‡β€‡3  229 suites   -β€Š42   28m 51s :stopwatch: - 11m 43s 603 tests  -β€Šβ€‡β€‡1  599 :white_check_mark: +  4  4 :zzz: Β±0  0 :x:  -β€Š5  619 runsβ€Š  -β€Š114  615 :white_check_mark:  -β€Š108  4 :zzz:  -β€Š1  0 :x:  -β€Š5 

Results for commit a41beb1b. ± Comparison against base commit 7fea98c0.

This pull request removes 1 test. ``` "before all" hook for "should execute "eth_getCode" for hts token" ‑ RPC Server Acceptance Tests Acceptance tests @api-batch-2 RPC Server Acceptance Tests eth_getCode "before all" hook for "should execute "eth_getCode" for hts token" ```

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

sonarcloud[bot] commented 2 weeks 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

codecov[bot] commented 5 hours ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 82.80%. Comparing base (7fea98c) to head (a41beb1). Report is 34 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #3177 +/- ## ========================================== - Coverage 83.35% 82.80% -0.56% ========================================== Files 66 69 +3 Lines 4290 4477 +187 Branches 837 883 +46 ========================================== + Hits 3576 3707 +131 - Misses 473 501 +28 - Partials 241 269 +28 ``` | [Flag](https://app.codecov.io/gh/hashgraph/hedera-json-rpc-relay/pull/3177/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=hashgraph) | Coverage Ξ” | | |---|---|---| | [config-service](https://app.codecov.io/gh/hashgraph/hedera-json-rpc-relay/pull/3177/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=hashgraph) | `98.14% <ΓΈ> (ΓΈ)` | | | [relay](https://app.codecov.io/gh/hashgraph/hedera-json-rpc-relay/pull/3177/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=hashgraph) | `85.23% <100.00%> (-0.31%)` | :arrow_down: | | [server](https://app.codecov.io/gh/hashgraph/hedera-json-rpc-relay/pull/3177/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=hashgraph) | `83.52% <ΓΈ> (ΓΈ)` | | | [ws-server](https://app.codecov.io/gh/hashgraph/hedera-json-rpc-relay/pull/3177/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=hashgraph) | `36.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/3177?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=hashgraph) | Coverage Ξ” | | |---|---|---| | [...ckages/config-service/src/services/globalConfig.ts](https://app.codecov.io/gh/hashgraph/hedera-json-rpc-relay/pull/3177?src=pr&el=tree&filepath=packages%2Fconfig-service%2Fsrc%2Fservices%2FglobalConfig.ts&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=hashgraph#diff-cGFja2FnZXMvY29uZmlnLXNlcnZpY2Uvc3JjL3NlcnZpY2VzL2dsb2JhbENvbmZpZy50cw==) | `100.00% <ΓΈ> (ΓΈ)` | | | [packages/relay/src/lib/eth.ts](https://app.codecov.io/gh/hashgraph/hedera-json-rpc-relay/pull/3177?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=) | `83.33% <100.00%> (+1.00%)` | :arrow_up: | | [packages/relay/src/utils.ts](https://app.codecov.io/gh/hashgraph/hedera-json-rpc-relay/pull/3177?src=pr&el=tree&filepath=packages%2Frelay%2Fsrc%2Futils.ts&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=hashgraph#diff-cGFja2FnZXMvcmVsYXkvc3JjL3V0aWxzLnRz) | `100.00% <100.00%> (ΓΈ)` | | ... and [15 files with indirect coverage changes](https://app.codecov.io/gh/hashgraph/hedera-json-rpc-relay/pull/3177/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=hashgraph)

🚨 Try these New Features: