-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Implement past-session validator discovery APIs for Network Bridge #1461
Comments
Related: paritytech/substrate#6595 (comment) but this is probably not a blocker. Note that the network-bridge API will accept |
Having no knowledge of the runtime nor about the various types of keys, I'd appreciate some help from someone here. |
The |
The way things are laid out in my mind is:
The authority-discovery module ensures, at any time, that it holds the The idea is that in the future you would open only the collation notifications protocol with peers that have been looked up (as opposed to opening all notifications protocols with all peers right now), but this isn't possible yet without some refactoring of the peerset (paritytech/substrate#6087). |
I'd rather not have the network bridge be directly responsible for dealing with rotations but rather just receive requests to connect to validators based on validator IDs. This feature is not only for collator networking, but it is our first major use-case of it. We also need this to make PoV Distribution production-ready and for recovery of availability pieces for approval |
Like Pierre above, I am in favor of the With the above we would separate concerns, as in the authority discovery only being concerned with discovering authorities. Within ConnectToValidators(validators: Vec<AuthorityId>) => {
let multiaddress = validators.into_iter()
// `get_addresses_for_authority_id` accesses the cached addresses, thus the `await` does not take long.
.map(|id| self.authority_discovery.get_addresses_for_authority_id(id).await)
.filter(|addresses| addresses.is_some())
.collect::<HashSet<_>>();
self.network.set_priority_group(COLLATOR_PRIORITY_GROUP_NAME, multiaddresses)?;
} Within sc_network::event::Event::NotificationStreamOpened { remote, .. } => {
let authority_id: Option<AuthorityId> = self.authority_discovery.get_authority_id_for_peer_id(remote).await;
return NetworkBridgeEvent::PeerConnected {
authority_id,
peer_id: remote,
};
} What do you think @rphmeier? |
That proposal seems fine as long as there is no implied validator rotation-tracking logic in the network bridge subsystem. The network bridge shouldn't need to track validator rotations (which the subsystems would have to do anyway) or the peer-sets that would be interested in any particular validator connection - this is also the responsibility of the subsystem. The first snippet is fine, because the actual API takes a We can have the network bridge maintain a |
paritytech/substrate#6760 is merged and thus functionality suggested in #1461 (comment) can be used within |
We have the following networking subsystems which would heavily benefit from point-to-point networking between validators:
All of these, except Availability Recovery, are what I'd call "immediate" because they only have to deal with validators of the current session. For these, the priority-group approach should work, but maybe with some modification to avoid them clobbering each other. However, Availability Recovery may need to perform recovery of data from prior sessions. If we allow disputes for up to a day after inclusion, then that would be 4 full sessions. At the session boundary, validators can both change their keys or even leave the set. We will need some kind of discovery mechanism for associating old |
Implementation for address lookups of past sessions as described above is tracked in paritytech/substrate#6910. |
@rphmeier right, but only for the validators in the current session if we'll find a way to circumvent as you mentioned in #1699 (comment), we can close the issue |
Triage: session info makes this possible for other sessions. current session already implemented and functioning. Shifting milestone. |
#1452 introduced some APIs for the network bridge to enable validator discovery. Those APIs are open for discussion, but the information provided by them should stay pretty much the same: a way to signal to connect to particular validator IDs and learn the
PeerId
s associated with that set so as to be aware of when we are connected to those validators.The text was updated successfully, but these errors were encountered: