Skip to content
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

chore: Set proper limits for the redesigned HBAR limiter #3100

Merged
merged 6 commits into from
Oct 16, 2024

Conversation

victor-yanev
Copy link
Contributor

Description:

Calculated using the formula:

$$(Total \space budget * percentage \space of \space budget \space allocated \space to \space tier) / amount \space of \space plans \space expected \space for \space tier$$
  • TOTAL: 8000 HBARs
  • BASIC: 11.2 HBARs = (8000 * 0.7) / 500
  • EXTENDED: 32 HBARs = (8000 * 0.2) / 50
  • PRIVILEGED: 80 HBARs = (8000 * 0.1) / 10

Related issue(s):

Fixes #2895

Notes for reviewer:

Checklist

  • Documented (Code comments, README, etc.)
  • Tested (unit, integration, etc.)

@victor-yanev victor-yanev added enhancement New feature or request P1 labels Oct 15, 2024
@victor-yanev victor-yanev added this to the 0.59.0 milestone Oct 15, 2024
@victor-yanev victor-yanev self-assigned this Oct 15, 2024
@victor-yanev victor-yanev changed the base branch from 2739-Redesign-of-the-hbar-rate-limiter to main October 15, 2024 08:52
@quiet-node
Copy link
Member

@victor-yanev
Q: Did I miss the conversation somewhere on how we came up with that formula and those numbers? Or were they just numbers laid out for discussion?

Also, if those numbers have been discussed and agreed upon, let’s not forget to include them in the design docs as well.

Copy link

github-actions bot commented Oct 16, 2024

🚨 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,940.2 ms

Heap Statistics (before vs after executing the test):

  • Total Heap Size: increased with 1.72 MB
  • Total Heap Size Executable: no changes
  • Total Physical Size: decreased with 86.02 KB
  • Total Available Size: increased with 3.26 MB
  • Total Global Handles Size: no changes
  • Used Global Handles Size: decreased with 64.00 bytes
  • Used Heap Size: decreased with 3.42 MB
  • Heap Size Limit: no changes
  • Malloced Memory: no changes
  • External Memory: no changes
  • Peak Malloced Memory: no changes

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

  • Old Space:

    • Space Size: increased with 2.10 MB
    • Space Used Size: increased with 2.09 MB
    • Space Available Size: increased with 80.06 KB
    • Physical Space Size: increased with 2.10 MB
  • Large Object Space:

    • Space Size: increased with 835.58 KB
    • Space Used Size: increased with 813.50 KB
    • Space Available Size: no changes
    • Physical Space Size: increased with 835.58 KB

Recommendations

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

Copy link

github-actions bot commented Oct 16, 2024

Tests

       3 files     398 suites   18s ⏱️
1 428 tests 1 427 ✔️ 1 💤 0
1 437 runs  1 436 ✔️ 1 💤 0

Results for commit 950db2f.

♻️ This comment has been updated with latest results.

…T_TOTAL"

This reverts commit 9119674.

Signed-off-by: Logan Nguyen <[email protected]>
Copy link

github-actions bot commented Oct 16, 2024

Acceptance Tests

  17 files  225 suites   27m 28s ⏱️
600 tests 595 ✔️ 4 💤 1
615 runs  610 ✔️ 4 💤 1

Results for commit 950db2f.

♻️ This comment has been updated with latest results.

Nana-EC
Nana-EC previously approved these changes Oct 16, 2024
ebadiere
ebadiere previously approved these changes Oct 16, 2024
konstantinabl
konstantinabl previously approved these changes Oct 16, 2024
Signed-off-by: Logan Nguyen <[email protected]>
Copy link

sonarcloud bot commented Oct 16, 2024

@quiet-node quiet-node modified the milestones: 0.59.0, 0.58.1 Oct 16, 2024
@ebadiere ebadiere self-requested a review October 16, 2024 19:33
@quiet-node quiet-node merged commit f12ab61 into main Oct 16, 2024
42 of 43 checks passed
@quiet-node quiet-node deleted the 2895-Set-up-proper-limits-for-hbar-limiter branch October 16, 2024 20:22
Copy link

codecov bot commented Oct 16, 2024

Codecov Report

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

Project coverage is 83.16%. Comparing base (1c8579b) to head (950db2f).
Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
packages/relay/src/lib/constants.ts 60.00% 0 Missing and 2 partials ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3100   +/-   ##
=======================================
  Coverage   83.16%   83.16%           
=======================================
  Files          63       63           
  Lines        4236     4236           
  Branches      830      830           
=======================================
  Hits         3523     3523           
  Misses        470      470           
  Partials      243      243           
Flag Coverage Δ
relay 85.59% <60.00%> (ø)
server 83.48% <ø> (ø)
ws-server 33.91% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
packages/relay/src/lib/constants.ts 92.00% <60.00%> (ø)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request P1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[HBAR Rate Limit Redesign] Set proper daily limits for subscription tiers
5 participants