-
Notifications
You must be signed in to change notification settings - Fork 523
Improve Bandwidth Estimation in Txnsync #3096
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
Improve Bandwidth Estimation in Txnsync #3096
Conversation
|
could you please rebase this PR ? |
tsachiherman
left a comment
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.
overall, I think that it looks good. Two small comments -
- The current code is calling
s.node.GetPeerLatencyon every incoming message. That's not horrible wrong, but it would make more sense to cache the latency at thePeerobject, and refresh it only on new round and/or new peer. - You've added quite many debug messages; while there is nothing wrong with that, I don't believe that there is a need to keep these on production code. Specifically for the transaction sync, it has its own logger - and the should be the way to log messages if we find that those are needed. ( I'm not sure if we really would get much value from the log messages added in this PR once we'll be over with these optimizations. ).
|
Yep, the log messages are only in the branch for testing purposes. I will remove them when I'm done testing. |
Codecov Report
@@ Coverage Diff @@
## master #3096 +/- ##
==========================================
- Coverage 43.70% 43.69% -0.02%
==========================================
Files 391 391
Lines 86830 86841 +11
==========================================
- Hits 37946 37942 -4
- Misses 42849 42861 +12
- Partials 6035 6038 +3
Continue to review full report at Codecov.
|
3c4033a to
3a1a43e
Compare
tsachiherman
left a comment
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.
Two small nits, but I think that this one is ready to be merged.
|
could you please go-lint over the changes ? |
This reverts commit 3a1a43e.
91f5e80 to
364e328
Compare
This reverts commit 364e328.
tsachiherman
left a comment
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.
looks good.
## Summary Improve the bandwidth estimation within the transaction sync by having the estimation account for latency, transaction compression time, and time spent waiting in the incoming queue. ## Test Plan Wrote unit tests for correctness, ran network on mainnet model and observed measured bandwidths. Before the bandwidth would converge to the minimum over time as well have erratic inaccuracies. Now the numbers look much more in range, at most a factor of 2 off.
This reverts commit b93ad64.
Summary
Improve the bandwidth estimation within the transaction sync by having the estimation account for latency, transaction compression time, and time spent waiting in the incoming queue.
Test Plan
Wrote unit tests for correctness, ran network on mainnet model and observed measured bandwidths. Before the bandwidth would converge to the minimum over time as well have erratic inaccuracies. Now the numbers look much more in range, at most a factor of 2 off.