celestiaorg / go-header

Go library with all the services needed to request, sync and store blockchain headers.
Apache License 2.0
19 stars 18 forks source link

p2p/peer_tracker: `peerTracker` scoring may be too aggressive #130

Open renaynay opened 11 months ago

renaynay commented 11 months ago

Running a node on mainnet has shown that even though I have good connectivity (~60 peers), my node's peerTracker only contains 3 tracked peers. It's likely due to aggressive peer scoring. We may need to be more lenient with it as it's better to have more trackedPeers that may have "mid-level" scores instead of only keeping the absolute best (which may be a very small pool).

We need to consider the scoring mechanism and adjust accordingly. We can only start doing this once we have a dashboard for the metrics that have just been implemented so we can make an informed decision.

vgonkivs commented 11 months ago

We can consider EWMA. It is used in the fintech world, but could be also helpful for us. We discussed this with @Wondertan some time ago

walldiss commented 9 months ago

We can add minAmount of peer to peer tracker. If amount of connect peers is less than minAmount it should not remove connected peers. It will solve original issue and should be quick to implement and give us time to select and implement smarter scoring arithmetic.