Use peermanager scores for blocksync peers and don't error out on block mismatch#162
Use peermanager scores for blocksync peers and don't error out on block mismatch#162philipsu522 merged 21 commits intomainfrom
Conversation
| "context" | ||
| "errors" | ||
| "fmt" | ||
| "github.com/tendermint/tendermint/internal/p2p" |
internal/blocksync/pool.go
Outdated
| for _, peer := range pool.peers { | ||
| // Generate a sorted list | ||
| sortedPeers := pool.getSortedPeers(pool.peers) | ||
| fmt.Printf("PSUDEBUG - block sync with sorted peers: %v\n", sortedPeers) |
There was a problem hiding this comment.
Shall we remove this debug log?
internal/blocksync/pool.go
Outdated
| fmt.Printf("PSUDEBUG - block sync with sorted peers: %v\n", sortedPeers) | ||
| for _, nodeId := range sortedPeers { | ||
| peer := pool.peers[nodeId] | ||
| pool.peerManager.Score(peer.id) |
There was a problem hiding this comment.
why do we get the score out here without using it?
| // Generate a sorted list | ||
| sortedPeers := pool.getSortedPeers(pool.peers) | ||
| fmt.Printf("PSUDEBUG - block sync with sorted peers: %v\n", sortedPeers) | ||
| for _, nodeId := range sortedPeers { |
There was a problem hiding this comment.
A few further optimizations we can do:
- We should probably avoid using the low score peers, for example the ones with score 0
- We should do some random shuffling so that we don't always targeting the same few top peers
internal/blocksync/pool.go
Outdated
| ) | ||
|
|
||
| var peerTimeout = 15 * time.Second // not const so we can override with tests | ||
| var peerTimeout = 3 * time.Second // not const so we can override with tests |
There was a problem hiding this comment.
waiting 15s for timeout is too long given we expect blocks much more frequently
internal/blocksync/pool.go
Outdated
| } else { | ||
| err := errors.New("requester is different or block already exists") | ||
| pool.sendError(err, peerID) | ||
| // Original behavior is to error out when there is a mismatch, which shuts down the entire reactor. |
There was a problem hiding this comment.
Overall LGTM, one question: do we understand why the original behavior wants to error this out and shutdown the entire reactor? Is there going to be any side effect if we change this behavior?
There was a problem hiding this comment.
let's revert this now, and when the standalone rpc falls behind again (currently it is healthly, and was upgraded to the new version), we can re-apply this patch and see if it helps
* 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>
* 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> 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
* 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
* 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
* 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
* 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
* 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
* 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
* 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
* 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
* 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
* 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
* 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
* 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
Describe your changes and provide context
Import peermanager scores to blocksync reactor and use that to determine which peers to pick for blocksync. We also don't error out on a mismatch of block height from peer who sent it
Testing performed to validate your change