Skip to content
This repository was archived by the owner on Jan 20, 2026. It is now read-only.

Improve Peer Score Algorithm#248

Merged
blindchaser merged 18 commits intomainfrom
yiren/peer-score
Oct 30, 2024
Merged

Improve Peer Score Algorithm#248
blindchaser merged 18 commits intomainfrom
yiren/peer-score

Conversation

@blindchaser
Copy link
Contributor

@blindchaser blindchaser commented Oct 28, 2024

The current peer score algorithm is not working effectively. Introducing a new peer score algorithm:

  • Added block sync performance reward: The score increases for every 5 consecutive successful block syncs.
  • Introduced time-decaying penalties for connection issues:
    • The penalty for dial failures decreases over time, reducing its impact as time passes since the last failure.
    • The penalty for disconnections decreases based on the time since the last connection, minimizing its impact with prolonged stability.
  • Maintained a score cap for non-block peers to ensure fair prioritization.

@blindchaser blindchaser requested a review from yzang2019 October 28, 2024 13:22
@blindchaser blindchaser changed the title Yiren/peer score Improve Peer Score Algorithm Oct 28, 2024
MutableScore int64 // updated by router
MutableScore PeerScore // updated by router

ConsecSuccessfulBlocks int64
Copy link
Contributor

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?

Copy link
Contributor Author

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
Copy link

codecov bot commented Oct 30, 2024

Codecov Report

Attention: Patch coverage is 72.00000% with 14 lines in your changes missing coverage. Please review.

Project coverage is 58.18%. Comparing base (eab3712) to head (220ceec).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
internal/p2p/peermanager.go 78.12% 5 Missing and 2 partials ⚠️
internal/state/execution.go 16.66% 4 Missing and 1 partial ⚠️
internal/blocksync/pool.go 33.33% 2 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            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     
Files with missing lines Coverage Δ
internal/blocksync/reactor.go 51.26% <100.00%> (+0.86%) ⬆️
internal/blocksync/pool.go 78.46% <33.33%> (-0.86%) ⬇️
internal/state/execution.go 61.83% <16.66%> (-0.46%) ⬇️
internal/p2p/peermanager.go 79.39% <78.12%> (+0.06%) ⬆️

... and 19 files with indirect coverage changes

@blindchaser blindchaser merged commit e9a22c9 into main Oct 30, 2024
Kbhat1 pushed a commit that referenced this pull request Nov 13, 2024
* 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>
yzang2019 added a commit that referenced this pull request Dec 3, 2024
* 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>
yzang2019 added a commit that referenced this pull request Mar 26, 2025
* 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>
Kbhat1 pushed a commit that referenced this pull request Mar 30, 2025
* 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>
Kbhat1 pushed a commit that referenced this pull request Apr 16, 2025
* 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>
yzang2019 added a commit that referenced this pull request Apr 21, 2025
* 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>

Add logs for blocksync

Add log to debug replay

Fix

Fix setBlock true false

Add more log for dialing

Add more logs

Add logs for missing height

Fix

Fix log

Fix log

Fix log

Fix bpr pool goroutine

Fix bpr pool goroutine

Fix goroutine leak

Fix goroutine leak
yzang2019 added a commit that referenced this pull request Apr 21, 2025
* 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>

Add logs for blocksync

Add log to debug replay

Fix

Fix setBlock true false

Add more log for dialing

Add more logs

Add logs for missing height

Fix

Fix log

Fix log

Fix log

Fix bpr pool goroutine

Fix bpr pool goroutine

Fix goroutine leak

Fix goroutine leak
yzang2019 added a commit that referenced this pull request May 14, 2025
* 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>

Add logs for blocksync

Add log to debug replay

Fix

Fix setBlock true false

Add more log for dialing

Add more logs

Add logs for missing height

Fix

Fix log

Fix log

Fix log

Fix bpr pool goroutine

Fix bpr pool goroutine

Fix goroutine leak

Fix goroutine leak
yzang2019 added a commit that referenced this pull request May 14, 2025
* 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>

Add logs for blocksync

Add log to debug replay

Fix

Fix setBlock true false

Add more log for dialing

Add more logs

Add logs for missing height

Fix

Fix log

Fix log

Fix log

Fix bpr pool goroutine

Fix bpr pool goroutine

Fix goroutine leak

Fix goroutine leak
Kbhat1 pushed a commit that referenced this pull request May 30, 2025
* 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>

Add logs for blocksync

Add log to debug replay

Fix

Fix setBlock true false

Add more log for dialing

Add more logs

Add logs for missing height

Fix

Fix log

Fix log

Fix log

Fix bpr pool goroutine

Fix bpr pool goroutine

Fix goroutine leak

Fix goroutine leak
Kbhat1 pushed a commit that referenced this pull request Jun 9, 2025
* 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>

Add logs for blocksync

Add log to debug replay

Fix

Fix setBlock true false

Add more log for dialing

Add more logs

Add logs for missing height

Fix

Fix log

Fix log

Fix log

Fix bpr pool goroutine

Fix bpr pool goroutine

Fix goroutine leak

Fix goroutine leak
Kbhat1 pushed a commit that referenced this pull request Jun 13, 2025
* 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>

Add logs for blocksync

Add log to debug replay

Fix

Fix setBlock true false

Add more log for dialing

Add more logs

Add logs for missing height

Fix

Fix log

Fix log

Fix log

Fix bpr pool goroutine

Fix bpr pool goroutine

Fix goroutine leak

Fix goroutine leak
Kbhat1 pushed a commit that referenced this pull request Jun 20, 2025
* 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>

Add logs for blocksync

Add log to debug replay

Fix

Fix setBlock true false

Add more log for dialing

Add more logs

Add logs for missing height

Fix

Fix log

Fix log

Fix log

Fix bpr pool goroutine

Fix bpr pool goroutine

Fix goroutine leak

Fix goroutine leak
Kbhat1 pushed a commit that referenced this pull request Jun 30, 2025
* 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>

Add logs for blocksync

Add log to debug replay

Fix

Fix setBlock true false

Add more log for dialing

Add more logs

Add logs for missing height

Fix

Fix log

Fix log

Fix log

Fix bpr pool goroutine

Fix bpr pool goroutine

Fix goroutine leak

Fix goroutine leak
Kbhat1 pushed a commit that referenced this pull request Jul 7, 2025
* 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>

Add logs for blocksync

Add log to debug replay

Fix

Fix setBlock true false

Add more log for dialing

Add more logs

Add logs for missing height

Fix

Fix log

Fix log

Fix log

Fix bpr pool goroutine

Fix bpr pool goroutine

Fix goroutine leak

Fix goroutine leak
Kbhat1 pushed a commit that referenced this pull request Aug 15, 2025
* 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>

Add logs for blocksync

Add log to debug replay

Fix

Fix setBlock true false

Add more log for dialing

Add more logs

Add logs for missing height

Fix

Fix log

Fix log

Fix log

Fix bpr pool goroutine

Fix bpr pool goroutine

Fix goroutine leak

Fix goroutine leak
Kbhat1 pushed a commit that referenced this pull request Aug 23, 2025
* 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>

Add logs for blocksync

Add log to debug replay

Fix

Fix setBlock true false

Add more log for dialing

Add more logs

Add logs for missing height

Fix

Fix log

Fix log

Fix log

Fix bpr pool goroutine

Fix bpr pool goroutine

Fix goroutine leak

Fix goroutine leak
Kbhat1 pushed a commit that referenced this pull request Oct 22, 2025
* 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>

Add logs for blocksync

Add log to debug replay

Fix

Fix setBlock true false

Add more log for dialing

Add more logs

Add logs for missing height

Fix

Fix log

Fix log

Fix log

Fix bpr pool goroutine

Fix bpr pool goroutine

Fix goroutine leak

Fix goroutine leak
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants