celestiaorg / celestiaorg/go-header
p2p: PeerTracker. rework scoring system
- Dominant language
- Go
- Stars
- 21
- Forks
- 33
- Avg merge
- 5d 20h
- Merged PRs (30d)
- 7
Description
Currently, the score is calculated as an average value between the current request and the previous average value. I believe we can do better. For example, [here](https://github.com/ipfs/boxo/blob/221dbc488fd559b60739d7cb386deae976cd7cee/bitswap/server/internal/decision/scoreledger.go#L123-L140C1) they are using [EVMA](https://corporatefinanceinstitute.com/resources/capital-markets/exponentially-weighted-moving-average-ewma/).
TLDR:
This is a way of calculating the average value where previous values have a lower `weight` on some alpha(from 0.1 to 1) than a new one.
We should also consider this approach and try to test it.
Contributor guide
Research direction
Start by locating the PeerTracker scoring implementation and compare its current averaging behavior with the referenced scoreledger.go example. Define the alpha weighting and expected scoring outcomes, then add tests demonstrating the selected behavior; the issue is done when the scoring approach is implemented and covered by tests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- networking
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100