v1.17: Treat super low staked as unstaked in streamer QOS (backport of #701)#732
Merged
lijunwangs merged 4 commits intov1.17from Apr 11, 2024
Merged
v1.17: Treat super low staked as unstaked in streamer QOS (backport of #701)#732lijunwangs merged 4 commits intov1.17from
lijunwangs merged 4 commits intov1.17from
Conversation
* Treat super low staked with QOS of unstaked * simplify * address some comment from Pankaj (cherry picked from commit 92ebf0f) # Conflicts: # streamer/src/nonblocking/quic.rs # streamer/src/nonblocking/stream_throttle.rs
Author
|
Cherry-pick of 92ebf0f has failed: To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally |
pgarg66
reviewed
Apr 11, 2024
| |(pubkey, stake, total_stake, max_stake, min_stake)| { | ||
| // The heuristic is that the stake should be large engouh to have 1 stream pass throuh within one throttle | ||
| // interval during which we allow max (MAX_STREAMS_PER_100MS * 100) streams. | ||
| let min_stake_ratio = 1_f64 / (MAX_STREAMS_PER_100MS * 100) as f64; |
There was a problem hiding this comment.
We should not multiply with 100 here. The constant MAX_STREAMS_PER_100MS already accounts for that.
pgarg66
approved these changes
Apr 11, 2024
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## v1.17 #732 +/- ##
=======================================
Coverage 81.6% 81.6%
=======================================
Files 806 806
Lines 219284 219290 +6
=======================================
+ Hits 179014 179058 +44
+ Misses 40270 40232 -38 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
staked nodes with low stakes can abuse the system to get disproportional bandwidth.
Summary of Changes
Treat it as unstaked node for the with stake ratio stake/total_stake < 1 / (max packet per 100 ms)
Fixes #
This is an automatic backport of pull request #701 done by [Mergify](https://mergify.com).