Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
This repository was archived by the owner on Nov 15, 2023. It is now read-only.

client/authority-discovery: Add option to specify relevant authority set #6595

@mxinden

Description

@mxinden

Today the Substrate authority discovery module retrieves the AuthorityIds of all validators of the current validator set from the authorities() runtime API.

Polkadot Collators don't want to connect to all nodes within the current validator set, but instead only to those nodes that are currently assigned as validators of their parachain.

This issue suggests to make AuthorityDiscovery listen on a channel for incoming Commands where the only enum variant would be Command::SetAuthorities(Vec<AuthorityId>) (for now). Instead of considering all validator nodes for the peer set priority group it would then only consider the subset.

The channel can be an implementation detail by wrapping it in a AuthorityDiscoveryClient:

struct AuthorityDiscoveryClient(Sender<Command>)

impl AuthorityDiscoveryClient {
  async fn set_authorities(authorities: Vec<AuthorityId>) {
    self.0.send(Command::SetAuthorities(authorities)).await;
  }
}

FAQ

  • Why not introduce a new method set_authorities on the AuthorityDiscovery struct?

    The AuthorityDiscovery struct is spawned as a Future onto an executor. Thus there is no way to call such method after spawning.

Metadata

Metadata

Assignees

Labels

J0-enhancementAn additional feature request.U2-some_time_soonIssue is worth doing soon.Z2-mediumCan be fixed by a coder with good Rust knowledge but little knowledge of the codebase.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions