-
Notifications
You must be signed in to change notification settings - Fork 72
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
fix: Allow the HBar Rate Limiter to be disabled. #3252
Conversation
Signed-off-by: Eric Badiere <[email protected]>
Test Results 4 files + 3 421 suites +414 27s ⏱️ -3s Results for commit bfa8093. ± Comparison against base commit ce43b76. This pull request removes 5 and adds 1494 tests. Note that renamed tests count towards both.
♻️ This comment has been updated with latest results. |
Signed-off-by: Eric Badiere <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good approach.
Question on the config changes.
Also I provided a suggestion to be a bit more strict
packages/relay/tests/lib/services/hbarLimitService/hbarLimitService.spec.ts
Show resolved
Hide resolved
trigger rate limiting, and added isEnabled() method. Signed-off-by: Eric Badiere <[email protected]>
Signed-off-by: Eric Badiere <[email protected]>
Signed-off-by: Eric Badiere <[email protected]>
Signed-off-by: Eric Badiere <[email protected]>
the workflow Signed-off-by: Eric Badiere <[email protected]>
Signed-off-by: Eric Badiere <[email protected]> fix: clean up of experimental code. Signed-off-by: Eric Badiere <[email protected]>
240a06c
to
1938973
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed and approved only this file:
.github/workflows/acceptance.yml
Signed-off-by: Eric Badiere <[email protected]>
constructor. Signed-off-by: Eric Badiere <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM jsut some comments to clean up code
Signed-off-by: Eric Badiere <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LG, see note on config issue to open
when the HBar Rate Limiter is disabled the test should not use the expenses aggregated to determine if the maxSpendingLimit has been passed, but simply use the relay operator's before and after balances. Signed-off-by: Eric Badiere <[email protected]>
Signed-off-by: Eric Badiere <[email protected]>
and renamed flag to more meaningful name. Signed-off-by: Eric Badiere <[email protected]>
Quality Gate passedIssues Measures |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Great work!
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3252 +/- ##
==========================================
+ Coverage 77.85% 81.33% +3.47%
==========================================
Files 66 69 +3
Lines 4453 4629 +176
Branches 993 1041 +48
==========================================
+ Hits 3467 3765 +298
+ Misses 613 516 -97
+ Partials 373 348 -25
Flags with carried forward coverage won't be shown. Click here to find out more.
|
* fix: Allow the HBar Rate Limiter to be disabled. Signed-off-by: Eric Badiere <[email protected]> * fix: Added acceptance test. Signed-off-by: Eric Badiere <[email protected]> * fix: Improved test by adding condition that would normally trigger rate limiting, and added isEnabled() method. Signed-off-by: Eric Badiere <[email protected]> * fix: Cleaned up and tightened test. Signed-off-by: Eric Badiere <[email protected]> * fix: Updated workflow for new tests. Signed-off-by: Eric Badiere <[email protected]> * fix: Updated comment. Signed-off-by: Eric Badiere <[email protected]> * fix: added the new hbarlimiter_batch_3 to the public_result in the workflow Signed-off-by: Eric Badiere <[email protected]> * fix: Test clean up. Signed-off-by: Eric Badiere <[email protected]> fix: clean up of experimental code. Signed-off-by: Eric Badiere <[email protected]> * fix: added isEanbled check to addExpense. Signed-off-by: Eric Badiere <[email protected]> * fix: Check totalBudget instead of remainingBudget in constructor. Signed-off-by: Eric Badiere <[email protected]> * fix: clean up. Signed-off-by: Eric Badiere <[email protected]> * fix: Test fix. Now that the addExpense is also skipped when the HBar Rate Limiter is disabled the test should not use the expenses aggregated to determine if the maxSpendingLimit has been passed, but simply use the relay operator's before and after balances. Signed-off-by: Eric Badiere <[email protected]> * fix: Added note around nullish coalescing operator. Signed-off-by: Eric Badiere <[email protected]> * fix: Added check for remaining budget at start of test and renamed flag to more meaningful name. Signed-off-by: Eric Badiere <[email protected]> --------- Signed-off-by: Eric Badiere <[email protected]>
This fix allows the HBar Rate Limiter to be disabled by setting the
HBAR_RATE_LIMIT_TINYBAR
to0
Related issue(s):
Fixes #3251
Notes for reviewer:
Checklist