Prepare `sc-network` for `ProtocolController`/`NotificationService` (#14080)
* Prepare `sc-network` for `ProtocolController`/`NotificationService` The upcoming notification protocol refactoring requires that protocols are able to communicate with `sc-network` over unique and direct links. This means that `sc-network` side of the link has to be created before `sc-network` is initialized and that it is allowed to consume the object as the receiver half of the link may not implement `Clone`. Remove request-response and notification protocols from `NetworkConfiguration` and create a new object that contains the configurations of these protocols and which is consumable by `sc-network`. This is needed needed because, e.g., the receiver half of `NotificationService` is not clonable so `sc-network` must consume it when it's initializing the protocols in `Notifications`. Similar principe applies to `PeerStore`/`ProtocolController`: as per current design, protocols are created before the network so `Protocol` cannot be the one creating the `PeerStore` object. `FullNetworkConfiguration` will be used to store the objects that `sc-network` will use to communicate with protocols and it will also allow protocols to allocate handles so they can directly communicate with `sc-network`. * Fixes * Update client/service/src/builder.rs Co-authored-by:Dmitry Markin <dmitry@markin.tech> * Updates * Doc updates + cargo-fmt --------- Co-authored-by:
Dmitry Markin <dmitry@markin.tech>
Showing
- substrate/Cargo.lock 1 addition, 0 deletionssubstrate/Cargo.lock
- substrate/bin/node-template/node/Cargo.toml 1 addition, 0 deletionssubstrate/bin/node-template/node/Cargo.toml
- substrate/bin/node-template/node/src/service.rs 7 additions, 5 deletionssubstrate/bin/node-template/node/src/service.rs
- substrate/bin/node/cli/src/service.rs 8 additions, 6 deletionssubstrate/bin/node/cli/src/service.rs
- substrate/client/cli/src/params/network_params.rs 0 additions, 2 deletionssubstrate/client/cli/src/params/network_params.rs
- substrate/client/consensus/beefy/src/communication/mod.rs 1 addition, 1 deletionsubstrate/client/consensus/beefy/src/communication/mod.rs
- substrate/client/consensus/grandpa/src/lib.rs 1 addition, 1 deletionsubstrate/client/consensus/grandpa/src/lib.rs
- substrate/client/network/src/config.rs 41 additions, 13 deletionssubstrate/client/network/src/config.rs
- substrate/client/network/src/protocol.rs 5 additions, 4 deletionssubstrate/client/network/src/protocol.rs
- substrate/client/network/src/service.rs 86 additions, 99 deletionssubstrate/client/network/src/service.rs
- substrate/client/network/sync/src/engine.rs 26 additions, 21 deletionssubstrate/client/network/sync/src/engine.rs
- substrate/client/network/test/src/lib.rs 27 additions, 25 deletionssubstrate/client/network/test/src/lib.rs
- substrate/client/network/test/src/service.rs 41 additions, 24 deletionssubstrate/client/network/test/src/service.rs
- substrate/client/service/src/builder.rs 57 additions, 51 deletionssubstrate/client/service/src/builder.rs
Please register or sign in to comment