-
Notifications
You must be signed in to change notification settings - Fork 39
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 Peer Score Algorithm #248
Conversation
d80b3c9
to
9362881
Compare
9362881
to
aa2f098
Compare
aa2f098
to
9222988
Compare
…i-tendermint into yiren/peer-score * 'yiren/peer-score' of https://github.com/sei-protocol/sei-tendermint: rever block sync logic
9222988
to
7ec96bf
Compare
…i-tendermint into yiren/peer-score * 'yiren/peer-score' of https://github.com/sei-protocol/sei-tendermint: rever block sync logic
MutableScore int64 // updated by router | ||
MutableScore PeerScore // updated by router | ||
|
||
ConsecSuccessfulBlocks int64 |
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.
Maybe add another one called NumOfTimeouts?
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.
the timeout will trigger the Disconnected() method which has counted to decrease score. the flow is:
timeout detection -> peer.didTimeout = true -> pool.removePeer(id, true) -> peerManager.Disconnected()
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #248 +/- ##
==========================================
- Coverage 58.22% 58.18% -0.05%
==========================================
Files 249 249
Lines 34512 34549 +37
==========================================
+ Hits 20094 20101 +7
- Misses 12827 12856 +29
- Partials 1591 1592 +1
|
* feat: improve peer scoring algo * debug * debug * more debug * debug TryDiaNext * remove log * fix score type * rever block sync logic * rever block sync logic * rever block sync logic * Add block request log * Add apply block latency * add processEpeerEvent log back * update unit test * update unit test --------- Co-authored-by: yzang2019 <zymfrank@gmail.com>
* feat: improve peer scoring algo * debug * debug * more debug * debug TryDiaNext * remove log * fix score type * rever block sync logic * rever block sync logic * rever block sync logic * Add block request log * Add apply block latency * add processEpeerEvent log back * update unit test * update unit test --------- Co-authored-by: yzang2019 <zymfrank@gmail.com>
* Reduce noisy tendermint logs * Suppress logs for all entering Use peermanager scores for blocksync peers and don't error out on block mismatch (#162) * Use peermanager scores for blocksync peers * Add debug * Randomize * debug * use state to filter * debug * debug * debug * debug * add comments * don't err * revert timeout * Add missing param * Remove flaky test * fix nil * debug * debug * debug * debug --------- Co-authored-by: Yiming Zang <50607998+yzang2019@users.noreply.github.com> Perf: Increase buffer size for pubsub server to boost performance (#167) * Increase buffer size for pubsub server * Add more timeout for test failure * Add more timeout * Fix test split scripts * Fix test split * Fix unit test * Unit test * Unit test [P2P] Optimize block pool requester retry and peer pick up logic (#170) * P2P Improvements: Fix block sync reactor and block pool retry logic Fix block sync auto restart not working as expected (#175) Fix edge case for blocksync (#178) Replay events during restart to avoid tx missing (#211) Add a new config to speed up block sync (#244) * Never switch to consensus due to timeout * Add blocksync peer config to speed up block sync rate * Fix config parsing * Add some logs feat: Exclude unconditional peers when connection limit checking (#245) Improve Peer Score Algorithm (#248) * feat: improve peer scoring algo * debug * debug * more debug * debug TryDiaNext * remove log * fix score type * rever block sync logic * rever block sync logic * rever block sync logic * Add block request log * Add apply block latency * add processEpeerEvent log back * update unit test * update unit test --------- Co-authored-by: yzang2019 <zymfrank@gmail.com>
* Reduce noisy tendermint logs * Suppress logs for all entering Use peermanager scores for blocksync peers and don't error out on block mismatch (#162) * Use peermanager scores for blocksync peers * Add debug * Randomize * debug * use state to filter * debug * debug * debug * debug * add comments * don't err * revert timeout * Add missing param * Remove flaky test * fix nil * debug * debug * debug * debug --------- Co-authored-by: Yiming Zang <50607998+yzang2019@users.noreply.github.com> Perf: Increase buffer size for pubsub server to boost performance (#167) * Increase buffer size for pubsub server * Add more timeout for test failure * Add more timeout * Fix test split scripts * Fix test split * Fix unit test * Unit test * Unit test [P2P] Optimize block pool requester retry and peer pick up logic (#170) * P2P Improvements: Fix block sync reactor and block pool retry logic Fix block sync auto restart not working as expected (#175) Fix edge case for blocksync (#178) Replay events during restart to avoid tx missing (#211) Add a new config to speed up block sync (#244) * Never switch to consensus due to timeout * Add blocksync peer config to speed up block sync rate * Fix config parsing * Add some logs feat: Exclude unconditional peers when connection limit checking (#245) Improve Peer Score Algorithm (#248) * feat: improve peer scoring algo * debug * debug * more debug * debug TryDiaNext * remove log * fix score type * rever block sync logic * rever block sync logic * rever block sync logic * Add block request log * Add apply block latency * add processEpeerEvent log back * update unit test * update unit test --------- Co-authored-by: yzang2019 <zymfrank@gmail.com>
The current peer score algorithm is not working effectively. Introducing a new peer score algorithm: