-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Improve priority groups #6087
Comments
I have followed the discussion on #6078 and I have the same opinion. Here's what I think some of the behavior should be:
There are some questions though, given that the priority group has a maximum number of slots how does the peerset make an intelligent decision regarding who to connect to? This logic must exist in some higher layer (e.g. the authority discovery module will be able to distinguish between sentries for the same node), does the user of the peerset just provide some peer rank for ordering the list (not sure if this will be enough)? Also given that the priority group is capped will the peerset also use the normal reputation logic for these peers now as well? I am also thinking that if priority groups have slots what is the distinction exactly from the normal "non-priority"/global group? I guess if we add slots to the priority group then we can just call them peer groups (or whatever), and the global peers just have their own group as well. Does the peerset need to have a global view among all peers in all groups, or just needs to care about each group distinctly? (we might need some global view for synchronization among the different groups, e.g. we might discover an authority through the normal DHT discovery as well as it being added to the authority discovery priority group). |
Initially, the way I intended to design things (being priority groups were introduced) is that multiple different peersets instances would exist at the same time. In Polkadot, if I'm not mistaken, we have several overlay networks:
For example a relay chain validator would maintain three peersets (relay chain validators, relay chain nodes, parachain), or four during parachain transitions. The advantage is that we can for example use the peerset for the relay chain, but actually replace with peerset with something and use mechanisms other than reputations for the relay chain validators or the parachain, if it is ever needed. |
Going by the above comment, I am a bit worried that this is trying to shoehorn multiple things into the wrong abstraction. The first two overly networks you mention are effectively the same thing, they are running the same protocol, it is only for various security concerns that I suggested having an additional topology that connects the validators together. However, the parachain networking is running a completely different protocol, and the structure and data flow characteristics are very different.
So, reusing the same abstraction for these 2 different protocols, is a hard & dangerous task. I'm not saying it's impossible but I do want to make it clear that not reusing some common abstraction, is also a perfectly fine option and possibly even easier. |
Also, slightly unsure what the word "priority" means in relation to all the other stuff being discussed here. "Groups" is obvious. |
To give some context, here's some explanation of how the code works at the moment:
At the moment, there exists one global peerset for everything. In other words, if the peerset says yes to a connection then we gossip on it with all protocols, and if the peerset says no then we don't gossip on it. This could be changed by having multiple peersets, one for each overlay network, but we could also bypass the concept of peerset. (disclaimer: at the moment enabling gossiping protocols is an all-or-nothing not only because of the single peerset but also because of backwards-compatibility reasons with the legacy substream, cc #5670) |
While I've previously been in favour of having multiple peersets, after some more brainstorming/prototyping I'm now more in favour of teaching a single peerset about the various set of the peers that we might want to be connected to. I'm afraid that we will run into design issues later on if we create multiple peersets. The state of the peerset would therefore consist in a list of
The list of all possible overlay networks would be passed at initialization when configuring the Rather than adding the authorities to a priority group, the authority-discovery system would inform the Slots exist only in the context of a specific overlay network. In other words, the |
Priority groups API should allow specifying maximum slots for a group and a strategy for picking peers. (E.g ordered or based on reputation).
See discussion in #6078
The text was updated successfully, but these errors were encountered: