ethereum / consensus-specs

Ethereum Proof-of-Stake Consensus Specifications
Creative Commons Zero v1.0 Universal
3.57k stars 975 forks source link

Gossipsub v1.1 new parameters #2009

Open wemeetagain opened 4 years ago

wemeetagain commented 4 years ago

Gossipsub v1.1 introduces many new configurable parameters: https://github.com/libp2p/specs/blob/master/pubsub/gossipsub/gossipsub-v1.1.md#overview-of-new-parameters

Should we standardize on some/all of these values? left to client discretion? Perhaps this would require further testing for standardization.

In any case, I think it would be helpful to add some clarification to our p2p spec. Eg:

djrtwo commented 4 years ago

I'm going to dig into these today and also take a look at the gossipsub v1.1 paper for better clarity and any recs

blacktemplar commented 4 years ago

Lighthouse is shortly before enabling gossipsub scores (https://github.com/sigp/lighthouse/pull/1668).

We defined the parameters depending on the number of active validators (since this influences the number of expected messages in the network) via a python script. This script uses constants from the executable spec and hopefully the python script can at some point be used as a standardization of the parameters (maybe we need to simplify it, currently it has some helper functions that compute exact values which could easily also be approximated).

This is the script we are currently using: https://gist.github.com/blacktemplar/5c1862cb3f0e32a1a7fb0b25e79e6e2c#file-generate-scoring-params-py

You can use print_testground_toml to print the parameters in a format that is usable by testground or ignore that function and look at get_scoring_params if you are only interested in the spec of the parameters.

Basically the python script gives a framework to compute topic parameters based on the expected message flow in the network. This framework is then used in lines 219-239 with concrete values.