hashgraph / hedera-json-rpc-relay

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

test: added HBAR Limiter e2e tests for multiple users across different tiers #3163

Closed quiet-node closed 2 weeks ago

quiet-node commented 3 weeks ago

Description:

Fixes #3068 Fixes #3188

Notes for reviewer:

Checklist

github-actions[bot] commented 3 weeks ago

Test Results

 20 files   -  3  280 suites   - 8   31m 28s :stopwatch: - 5m 9s 608 tests ± 0  600 :white_check_mark: +7  4 :zzz: ±0  4 :x:  - 7  773 runs   - 16  765 :white_check_mark:  - 7  4 :zzz:  - 2  4 :x:  - 7 

For more details on these failures, see this check.

Results for commit 6e267f56. ± Comparison against base commit 6606c385.

This pull request removes 6 and adds 6 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" Should eventually exhaust the hbar limit for EXTENDED user ‑ RPC Server Acceptance Tests Acceptance tests @hbarlimiter HBAR Limiter Acceptance Tests HBAR Rate Limit Tests HBAR Rate Limit For Different Spending Plan Tiers @hbarlimiter-batch2 Preconfigured Tiers EXTENDED Tier Should eventually exhaust the hbar limit for EXTENDED user Should eventually exhaust the hbar limit for PRIVILEGED user ‑ RPC Server Acceptance Tests Acceptance tests @hbarlimiter HBAR Limiter Acceptance Tests HBAR Rate Limit Tests HBAR Rate Limit For Different Spending Plan Tiers @hbarlimiter-batch2 Preconfigured Tiers PRIVILEGED Tier Should eventually exhaust the hbar limit for PRIVILEGED user ``` ``` "after all" hook in "@web-socket-batch-2 eth_getTransactionByHash" ‑ RPC Server Acceptance Tests Acceptance tests @web-socket-batch-2 eth_getTransactionByHash "after all" hook in "@web-socket-batch-2 eth_getTransactionByHash" "before all" hook in "@api-batch-2 RPC Server Acceptance Tests" ‑ RPC Server Acceptance Tests Acceptance tests @api-batch-2 RPC Server Acceptance Tests "before all" hook in "@api-batch-2 RPC Server Acceptance Tests" Should eventually exhaust the hbar limit for EXTENDED user and still allow another EXTENDED user to make calls ‑ RPC Server Acceptance Tests Acceptance tests @hbarlimiter HBAR Limiter Acceptance Tests HBAR Rate Limit Tests HBAR Rate Limit For Different Spending Plan Tiers @hbarlimiter-batch2 Preconfigured Tiers EXTENDED Tier Should eventually exhaust the hbar limit for EXTENDED user and still allow another EXTENDED user to make calls Should eventually exhaust the hbar limit for PRIVILEGED user and still allow another PRIVILEGED user to make calls ‑ RPC Server Acceptance Tests Acceptance tests @hbarlimiter HBAR Limiter Acceptance Tests HBAR Rate Limit Tests HBAR Rate Limit For Different Spending Plan Tiers @hbarlimiter-batch2 Preconfigured Tiers PRIVILEGED Tier Should eventually exhaust the hbar limit for PRIVILEGED user and still allow another PRIVILEGED user to make calls Should eventually exhaust the total HBAR limits after many large contract deployments by different tiered users ‑ RPC Server Acceptance Tests Acceptance tests @hbarlimiter HBAR Limiter Acceptance Tests HBAR Rate Limit Tests HBAR Rate Limit For Different Spending Plan Tiers @hbarlimiter-batch2 Multiple users with different tiers Should eventually exhaust the total HBAR limits after many large contract deployments by different tiered users should individually update amountSpents of different spending plans ‑ RPC Server Acceptance Tests Acceptance tests @hbarlimiter HBAR Limiter Acceptance Tests HBAR Rate Limit Tests HBAR Rate Limit For Different Spending Plan Tiers @hbarlimiter-batch2 Multiple users with different tiers should individually update amountSpents of different spending plans ```

: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 "net_peerCount". This may impact the application's performance and stability.

Details

📊 Memory Leak Detection Report 📊

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

🚨 Memory Leak Detected 🚨

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

Details

📊 Memory Leak Detection Report 📊

GC Type: MarkSweepCompact Cost: 28,550.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 not execute batch request when disabled. This may impact the application's performance and stability.

Details

📊 Memory Leak Detection Report 📊

GC Type: MarkSweepCompact Cost: 27,607 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 valid block number. This may impact the application's performance and stability.

Details

📊 Memory Leak Detection Report 📊

GC Type: MarkSweepCompact Cost: 29,336.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: 29,951.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 validates Transactionvalueparam is hex. This may impact the application's performance and stability.

Details

📊 Memory Leak Detection Report 📊

GC Type: MarkSweepCompact Cost: 25,241.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 validates parameter 2 is array. This may impact the application's performance and stability.

Details

📊 Memory Leak Detection Report 📊

GC Type: MarkSweepCompact Cost: 29,381.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 validates parameter 0 is valid block tag. This may impact the application's performance and stability.

Details

📊 Memory Leak Detection Report 📊

GC Type: MarkSweepCompact Cost: 26,410.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 execute HTTP OPTIONS cors preflight check. This may impact the application's performance and stability.

Details

📊 Memory Leak Detection Report 📊

GC Type: MarkSweepCompact Cost: 30,350.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 metrics collection. This may impact the application's performance and stability.

Details

📊 Memory Leak Detection Report 📊

GC Type: Scavenge Cost: 3,503.09 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 valid hash, no TracerType and no TracerConfig. This may impact the application's performance and stability.

Details

📊 Memory Leak Detection Report 📊

GC Type: MarkSweepCompact Cost: 25,784.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 execute with empty TracerConfigWrapper.tracerConfig. This may impact the application's performance and stability.

Details

📊 Memory Leak Detection Report 📊

GC Type: MarkSweepCompact Cost: 36,856.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, valid tracer type and invalid tracer configuration. This may impact the application's performance and stability.

Details

📊 Memory Leak Detection Report 📊

GC Type: MarkSweepCompact Cost: 30,592.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 address is other type. This may impact the application's performance and stability.

Details

📊 Memory Leak Detection Report 📊

GC Type: MarkSweepCompact Cost: 26,699.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 throws error if block number is decimal. This may impact the application's performance and stability.

Details

📊 Memory Leak Detection Report 📊

GC Type: MarkSweepCompact Cost: 36,173.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 throws an error if the param is not an Object. This may impact the application's performance and stability.

Details

📊 Memory Leak Detection Report 📊

GC Type: MarkSweepCompact Cost: 26,561.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 does not throw an error for input: {"tracer":"opcodeLogger","tracerConfig":{"enableMemory":true,"disableStack":false,"disableStorage":true,"unknownParam":true}}. This may impact the application's performance and stability.

Details

📊 Memory Leak Detection Report 📊

GC Type: MarkSweepCompact Cost: 26,361.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 if Filter Object param contains unexpected param. This may impact the application's performance and stability.

Details

📊 Memory Leak Detection Report 📊

GC Type: MarkSweepCompact Cost: 40,680.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 return true when REQUEST_ID_IS_OPTIONAL is set to true. This may impact the application's performance and stability.

Details

📊 Memory Leak Detection Report 📊

GC Type: MarkSweepCompact Cost: 38,114.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 validates enforcement of request id. This may impact the application's performance and stability.

Details

📊 Memory Leak Detection Report 📊

GC Type: MarkSweepCompact Cost: 20,627.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.

sonarcloud[bot] commented 2 weeks ago

Quality Gate Failed Quality Gate failed

Failed conditions
1 Security Hotspot

See analysis details on SonarCloud

codecov[bot] commented 2 weeks ago

Codecov Report

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

Project coverage is 83.39%. Comparing base (6606c38) to head (6e267f5).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #3163 +/- ## ======================================= Coverage 83.39% 83.39% ======================================= Files 66 66 Lines 4283 4283 Branches 835 835 ======================================= Hits 3572 3572 Misses 471 471 Partials 240 240 ``` | [Flag](https://app.codecov.io/gh/hashgraph/hedera-json-rpc-relay/pull/3163/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/3163/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/3163/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=hashgraph) | `85.60% <ø> (ø)` | | | [server](https://app.codecov.io/gh/hashgraph/hedera-json-rpc-relay/pull/3163/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/3163/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.