Refactor peer scorer into peerdata + scorers (#7452)

* updates comment

* manager -> service

* rename receiver

* refacgtor bad_responses

* refactor store

* update status service

* extends data service

* status service test

* refactor block provider scorer

* misc updates

* fix tests

* data -> peerdata

* gazelle

* peerdata/store test

* limit the visibility scope

* Nishant's suggestion

Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
This commit is contained in:
Victor Farazdagi
2020-10-07 16:08:51 +03:00
committed by GitHub
parent ae78546323
commit 9ce64e2428
28 changed files with 722 additions and 480 deletions

View File

@@ -2,12 +2,10 @@ package peers_test
import (
"io/ioutil"
"math"
"os"
"testing"
"github.com/prysmaticlabs/prysm/beacon-chain/flags"
"github.com/prysmaticlabs/prysm/beacon-chain/p2p/peers"
"github.com/prysmaticlabs/prysm/shared/featureconfig"
"github.com/sirupsen/logrus"
)
@@ -35,8 +33,3 @@ func TestMain(m *testing.M) {
flags.Init(resetFlags)
os.Exit(code)
}
// roundScore returns score rounded in accordance with the score manager's rounding factor.
func roundScore(score float64) float64 {
return math.Round(score*peers.ScoreRoundingFactor) / peers.ScoreRoundingFactor
}