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

feat: implement preemptive rate limitting logic to HbarLimitService class #2950

Conversation

quiet-node
Copy link
Member

@quiet-node quiet-node commented Sep 6, 2024

Description:
This PR implements the preemptive rate-limiting logic in HbarLimitService.shouldLimit() by comparing the total expenses with the estimated transaction fee.

Fixes #2937

@quiet-node quiet-node added the enhancement New feature or request label Sep 6, 2024
@quiet-node quiet-node added this to the 0.56.0 milestone Sep 6, 2024
@quiet-node quiet-node self-assigned this Sep 6, 2024
Copy link

github-actions bot commented Sep 6, 2024

Acceptance Tests

  18 files  253 suites   31m 41s ⏱️
601 tests 594 ✔️ 4 💤 3
770 runs  763 ✔️ 4 💤 3

Results for commit daa961b.

♻️ This comment has been updated with latest results.

Copy link

github-actions bot commented Sep 6, 2024

Tests

       3 files     274 suites   19s ⏱️
1 289 tests 1 288 ✔️ 1 💤 0
1 301 runs  1 300 ✔️ 1 💤 0

Results for commit da4d324.

♻️ This comment has been updated with latest results.

@quiet-node quiet-node force-pushed the 2937-hbar-rate-limit-redesign-implement-preemtive-rate-limit-logic-to-hbarlimitservice-II branch from d3fe68c to a60a80b Compare September 9, 2024 22:39
@quiet-node quiet-node changed the title feat: added shouldPreemptivelyLimitFileTransactions() to HbarLimitService class feat: implement preemptive rate limitting logic to HbarLimitService class Sep 10, 2024
Copy link
Contributor

@victor-yanev victor-yanev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, just a few things

ebadiere
ebadiere previously approved these changes Sep 10, 2024
Copy link
Contributor

@ebadiere ebadiere left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LG.

@quiet-node quiet-node force-pushed the 2937-hbar-rate-limit-redesign-implement-preemtive-rate-limit-logic-to-hbarlimitservice-II branch from 86afa7a to 336d55b Compare September 11, 2024 15:49
@quiet-node quiet-node force-pushed the 2937-hbar-rate-limit-redesign-implement-preemtive-rate-limit-logic-to-hbarlimitservice-II branch from daa961b to da4d324 Compare September 12, 2024 18:38
Copy link

@ebadiere ebadiere self-requested a review September 12, 2024 18:56
@quiet-node quiet-node merged commit f55c304 into main Sep 12, 2024
43 checks passed
@quiet-node quiet-node deleted the 2937-hbar-rate-limit-redesign-implement-preemtive-rate-limit-logic-to-hbarlimitservice-II branch September 12, 2024 19:02
Copy link

codecov bot commented Sep 12, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 89.54%. Comparing base (fe0c21f) to head (da4d324).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2950      +/-   ##
==========================================
- Coverage   89.64%   89.54%   -0.11%     
==========================================
  Files          40       56      +16     
  Lines        3080     3796     +716     
  Branches      633      775     +142     
==========================================
+ Hits         2761     3399     +638     
- Misses        275      350      +75     
- Partials       44       47       +3     
Flag Coverage Δ
relay 89.68% <100.00%> (+0.03%) ⬆️
server 88.15% <ø> (?)
ws-server 100.00% <ø> (?)

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

Files with missing lines Coverage Δ
...s/relay/src/lib/services/hbarLimitService/index.ts 96.00% <100.00%> (+0.08%) ⬆️

... and 17 files with indirect coverage changes

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

Successfully merging this pull request may close these issues.

[HBAR Rate Limit Redesign] implement preemptive rate limit logic to HbarLimitService
3 participants