hashgraph / hedera-json-rpc-relay

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

feat: Added ability to load spending plans from environment variable. #3153

Closed ebadiere closed 2 weeks ago

ebadiere commented 3 weeks ago

This enhancement adds the ability to load HBar Rate Limiter spending plans from an environment variable. Related issue(s):

Fixes #3152

Checklist

github-actions[bot] commented 3 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,459.7 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 3 weeks ago

Test Results

 20 files   -β€Šβ€‡β€‡3  265 suites   -β€Š23   33m 6s :stopwatch: - 3m 31s 605 tests  -β€Šβ€‡β€‡3  596 :white_check_mark: +  3  4 :zzz: Β±0  5 :x:  -β€Š6  663 runsβ€Š  -β€Š126  654 :white_check_mark:  -β€Š118  4 :zzz:  -β€Š2  5 :x:  -β€Š6 

For more details on these failures, see this check.

Results for commit c48d26f5. ± Comparison against base commit 6606c385.

This pull request removes 4 and adds 1 tests. Note that renamed tests count towards both. ``` "before all" hook for "@release should execute "eth_getTransactionCount" primary" ‑ RPC Server Acceptance Tests Acceptance tests @api-batch-3 RPC Server Acceptance Tests eth_getTransactionCount "before all" hook for "@release should execute "eth_getTransactionCount" primary" "before all" hook for "Function calling HederaTokenService.isToken(token)" ‑ RPC Server Acceptance Tests Acceptance tests @api-batch-3 RPC Server Acceptance Tests eth_call with contract that calls precompiles "before all" hook for "Function calling HederaTokenService.isToken(token)" "before all" hook in "Debug API Test Suite" ‑ RPC Server Acceptance Tests Acceptance tests @api-batch-3 RPC Server Acceptance Tests Debug API Test Suite "before all" hook in "Debug API Test Suite" "before all" hook in "RPC Server Acceptance Tests" ‑ RPC Server Acceptance Tests Acceptance tests @api-batch-1 RPC Server Acceptance Tests RPC Server Acceptance Tests "before all" hook in "RPC Server Acceptance Tests" ``` ``` "before all" hook in "@precompile-calls Tests for eth_call with HTS" ‑ RPC Server Acceptance Tests Acceptance tests @precompile-calls Tests for eth_call with HTS "before all" hook in "@precompile-calls Tests for eth_call with HTS" ```

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

github-actions[bot] commented 3 weeks ago

🚨 Memory Leak Detected 🚨

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

Details

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

GC Type: MarkSweepCompact Cost: 25,192.6 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 3 weeks 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: Scavenge Cost: 3,870.55 ms

Heap Statistics (before vs after executing the test):

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

GC Type: Scavenge Cost: 2,468.03 ms

Heap Statistics (before vs after executing the test):

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

GC Type: MarkSweepCompact Cost: 34,529.5 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 3 weeks ago

🚨 Memory Leak Detected 🚨

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

Details

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

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

🚨 Memory Leak Detected 🚨

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

Details

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

GC Type: MarkSweepCompact Cost: 37,788.9 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 3 weeks ago

🚨 Memory Leak Detected 🚨

A potential memory leak has been detected in the test titled should hit batch request limit. This may impact the application's performance and stability.

Details

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

GC Type: MarkSweepCompact Cost: 36,867.5 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 3 weeks ago

🚨 Memory Leak Detected 🚨

A potential memory leak has been detected in the test titled validates parameter 1 exists. This may impact the application's performance and stability.

Details

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

GC Type: MarkSweepCompact Cost: 32,478.5 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 3 weeks ago

🚨 Memory Leak Detected 🚨

A potential memory leak has been detected in the test titled validates parameter 1 is boolean. This may impact the application's performance and stability.

Details

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

GC Type: MarkSweepCompact Cost: 24,318 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 3 weeks ago

🚨 Memory Leak Detected 🚨

A potential memory leak has been detected in the test titled validates TransactionmaxFeePerGasparam is hex. This may impact the application's performance and stability.

Details

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

GC Type: MarkSweepCompact Cost: 28,880.9 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 3 weeks ago

🚨 Memory Leak Detected 🚨

A potential memory leak has been detected in the test titled validates parameter 0 exists. This may impact the application's performance and stability.

Details

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

GC Type: MarkSweepCompact Cost: 27,760 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 3 weeks ago

🚨 Memory Leak Detected 🚨

A potential memory leak has been detected in the test titled validates topics filter is array of topic hashes. This may impact the application's performance and stability.

Details

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

GC Type: MarkSweepCompact Cost: 27,564.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 3 weeks ago

🚨 Memory Leak Detected 🚨

A potential memory leak has been detected in the test titled should execute metrics collection. This may impact the application's performance and stability.

Details

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

GC Type: Scavenge Cost: 4,471.57 ms

Heap Statistics (before vs after executing the test):

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

GC Type: Scavenge Cost: 612.82 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 3 weeks ago

🚨 Memory Leak Detected 🚨

A potential memory leak has been detected in the test titled should execute with empty TracerConfigWrapper.tracerConfig. This may impact the application's performance and stability.

Details

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

GC Type: MarkSweepCompact Cost: 29,014.8 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 3 weeks ago

🚨 Memory Leak Detected 🚨

A potential memory leak has been detected in the test titled should fail with valid hash and invalid type for TracerConfigWrapper.tracerConfig. This may impact the application's performance and stability.

Details

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

GC Type: MarkSweepCompact Cost: 28,229.6 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 3 weeks ago

🚨 Memory Leak Detected 🚨

A potential memory leak has been detected in the test titled throws an error if block hash is smaller than 32bytes. This may impact the application's performance and stability.

Details

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

GC Type: MarkSweepCompact Cost: 26,768.1 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 3 weeks ago

🚨 Memory Leak Detected 🚨

A potential memory leak has been detected in the test titled throws an error if transactionHash is NOT 0x prefixed. This may impact the application's performance and stability.

Details

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

GC Type: MarkSweepCompact Cost: 39,433.7 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 3 weeks ago

🚨 Memory Leak Detected 🚨

A potential memory leak has been detected in the test titled throws an error for input: {"disableStack":"invalid"}. This may impact the application's performance and stability.

Details

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

GC Type: MarkSweepCompact Cost: 27,425.8 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 3 weeks ago

🚨 Memory Leak Detected 🚨

A potential memory leak has been detected in the test titled returns true for a valid opcode logger config. This may impact the application's performance and stability.

Details

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

GC Type: MarkSweepCompact Cost: 27,020.1 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 3 weeks ago

🚨 Memory Leak Detected 🚨

A potential memory leak has been detected in the test titled should create a ServerError with correct message and code within valid range. This may impact the application's performance and stability.

Details

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

GC Type: MarkSweepCompact Cost: 31,389.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.

sonarcloud[bot] commented 2 weeks ago

Quality Gate Passed Quality Gate passed

Issues
1 New issue
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 8 hours ago

Codecov Report

Attention: Patch coverage is 85.71429% with 2 lines in your changes missing coverage. Please review.

Project coverage is 83.35%. Comparing base (6606c38) to head (c48d26f). Report is 41 commits behind head on main.

Files with missing lines Patch % Lines
...ay/src/lib/config/hbarSpendingPlanConfigService.ts 84.61% 1 Missing and 1 partial :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #3153 +/- ## ========================================== - Coverage 83.39% 83.35% -0.05% ========================================== Files 66 66 Lines 4283 4290 +7 Branches 835 837 +2 ========================================== + Hits 3572 3576 +4 - Misses 471 473 +2 - Partials 240 241 +1 ``` | [Flag](https://app.codecov.io/gh/hashgraph/hedera-json-rpc-relay/pull/3153/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/3153/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/3153/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=hashgraph) | `85.54% <85.71%> (-0.06%)` | :arrow_down: | | [server](https://app.codecov.io/gh/hashgraph/hedera-json-rpc-relay/pull/3153/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/3153/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/3153?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/3153?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% <ΓΈ> (ΓΈ)` | | | [...kages/relay/src/lib/clients/cache/localLRUCache.ts](https://app.codecov.io/gh/hashgraph/hedera-json-rpc-relay/pull/3153?src=pr&el=tree&filepath=packages%2Frelay%2Fsrc%2Flib%2Fclients%2Fcache%2FlocalLRUCache.ts&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=hashgraph#diff-cGFja2FnZXMvcmVsYXkvc3JjL2xpYi9jbGllbnRzL2NhY2hlL2xvY2FsTFJVQ2FjaGUudHM=) | `93.84% <100.00%> (+0.09%)` | :arrow_up: | | [...ay/src/lib/config/hbarSpendingPlanConfigService.ts](https://app.codecov.io/gh/hashgraph/hedera-json-rpc-relay/pull/3153?src=pr&el=tree&filepath=packages%2Frelay%2Fsrc%2Flib%2Fconfig%2FhbarSpendingPlanConfigService.ts&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=hashgraph#diff-cGFja2FnZXMvcmVsYXkvc3JjL2xpYi9jb25maWcvaGJhclNwZW5kaW5nUGxhbkNvbmZpZ1NlcnZpY2UudHM=) | `95.49% <84.61%> (-2.60%)` | :arrow_down: |

🚨 Try these New Features: