network: fix outgoing HTTP rate limiting#6118
Merged
algorandskiy merged 1 commit intoalgorand:masterfrom Sep 3, 2024
Merged
Conversation
4bffd2e to
8cec779
Compare
cce
reviewed
Aug 30, 2024
cce
reviewed
Aug 30, 2024
cce
approved these changes
Aug 30, 2024
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #6118 +/- ##
=======================================
Coverage 56.20% 56.21%
=======================================
Files 492 494 +2
Lines 69829 69899 +70
=======================================
+ Hits 39248 39291 +43
- Misses 27915 27941 +26
- Partials 2666 2667 +1 ☔ View full report in Codecov by Sentry. |
gmalouf
reviewed
Sep 3, 2024
gmalouf
reviewed
Sep 3, 2024
gmalouf
reviewed
Sep 3, 2024
Contributor
gmalouf
left a comment
There was a problem hiding this comment.
Asked a few questions, mostly looks good.
gmalouf
approved these changes
Sep 3, 2024
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.
Summary
While working on rate limiting functionality for libp2p HTTP clients in #5939 the existing WS net functionality was broken and never caught. This PR restores the functionality by making the
RateLimitingTransportRateLimitingBoundTransport- i.e. requiring and enforcing the target peer address (either host:port or peerID). This makes sense since HTTP clients constructed as part ofwsPeerCoreare intended to be used against only this peer. This also means there is no sharedwn.transportandRateLimitingBoundTransportobjectare constructed on demand for http clients.Fixes #6117
Test Plan
RoundTripandGetHTTPClientunit tests