Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
nebula
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
exchain
nebula
Commits
4022f9b6
Commit
4022f9b6
authored
Mar 22, 2023
by
Andreas Bigger
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
reset wiped bands not scores
parent
1e5a6e7d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
2 additions
and
7 deletions
+2
-7
p2p_flags.go
op-node/flags/p2p_flags.go
+1
-0
peer_scorer.go
op-node/p2p/peer_scorer.go
+0
-7
docker-compose.yml
ops-bedrock/docker-compose.yml
+1
-0
No files found.
op-node/flags/p2p_flags.go
View file @
4022f9b6
...
...
@@ -286,6 +286,7 @@ var p2pFlags = []cli.Flag{
P2PPrivPath
,
P2PPrivRaw
,
PeerScoring
,
PeerScoreBands
,
Banning
,
TopicScoring
,
ListenIP
,
...
...
op-node/p2p/peer_scorer.go
View file @
4022f9b6
...
...
@@ -137,17 +137,10 @@ func NewScorer(peerGater PeerGater, peerStore Peerstore, metricer GossipMetricer
// The returned [pubsub.ExtendedPeerScoreInspectFn] is called with a mapping of peer IDs to peer score snapshots.
func
(
s
*
scorer
)
SnapshotHook
()
pubsub
.
ExtendedPeerScoreInspectFn
{
return
func
(
m
map
[
peer
.
ID
]
*
pubsub
.
PeerScoreSnapshot
)
{
// Reset the score bands
s
.
bandScoreThresholds
.
Reset
()
// First clear the peer score bands
scoreMap
:=
make
(
map
[
string
]
float64
)
for
id
,
snap
:=
range
m
{
// Increment the bucket for the peer's score
band
:=
s
.
bandScoreThresholds
.
Bucket
(
snap
.
Score
)
scoreMap
[
band
]
+=
1
// Update with the peer gater
s
.
gater
.
Update
(
id
,
snap
.
Score
)
}
s
.
metricer
.
SetPeerScores
(
scoreMap
)
...
...
ops-bedrock/docker-compose.yml
View file @
4022f9b6
...
...
@@ -63,6 +63,7 @@ services:
--p2p.listen.udp=9003
--p2p.scoring.peers=light
--p2p.ban.peers=true
--p2p.score.bands="-40:graylist;-20:restricted;0:nopx;20:friend;"
--snapshotlog.file=/op_log/snapshot.log
--p2p.priv.path=/config/p2p-node-key.txt
--metrics.enabled
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment