nimbus-eth2 icon indicating copy to clipboard operation
nimbus-eth2 copied to clipboard

Gossip sub attestation subnet scoring

Open Menduist opened this issue 2 years ago • 3 comments

Completely reworked scoring in gossipsub

First goal was to also score peers in the attestation subnet. Previously, we only scored peers in global topics which was an issue when running with many peers, since we would only have a few of them in global topics, and the majority of peers wouldn't have a score, which would break, amongst other things, the opportunistic grafting.

The scoring system in gossipsub 1.1 is heavily convoluted, I tried my best to explain it in layman terms, and add helpers functions which allows to input "understable" data to generate the params. I've not tweaked this yet, so WIP

Menduist avatar Oct 26 '21 13:10 Menduist

Unit Test Results

     12 files  ±0     764 suites  ±0   33m 4s :stopwatch: - 1m 19s 1 540 tests ±0  1 524 :heavy_check_mark: ±0  16 :zzz: ±0  0 :x: ±0  9 256 runs  ±0  9 192 :heavy_check_mark: ±0  64 :zzz: ±0  0 :x: ±0 

Results for commit ad74b5d2. ± Comparison against base commit d32c25ea.

:recycle: This comment has been updated with latest results.

github-actions[bot] avatar Oct 26 '21 14:10 github-actions[bot]

Before we merge this, we should likely do 2 things:

  • add an option in nimbus to enable/disable it
  • add metrics in libp2p to monitor the outcome of the parameter settings

arnetheduck avatar Oct 27 '21 06:10 arnetheduck

I've been running this for a while, and it seem to give reasonable scores.

Only weird thing I saw, we often give invalid message penalties to peer on beacon_aggregate_and_proof, which could indicate a incompatibility somewhere (or malicious peer, maybe)

add an option in nimbus to enable/disable it

I'm not sure we need it in this case, because the impact is very minimal (we almost never kick peers because of it, we just prune inactive peers for a while)

I'll continue to monitor it, add the dynamic validator count, and should be GTG. Scoring metrics in libp2p indeed need to be improved, I've added it to https://github.com/status-im/nim-libp2p/issues/633

Menduist avatar Nov 03 '21 09:11 Menduist