substrate
substrate copied to clipboard
Merge `Protocol` and `Notifications`
After #12828, Protocol has no role in the networking stack anymore as the syncing protocol now lives above sc-network and the low-level API used for sync is no longer used. Notification-related events can be sent directly from Notifications.
Tasks:
- [ ] Remove
HARDCODED_PEERSET_SYNCand all functionality that references the hardcodedPeersetentry - [ ] Move handshake decoding to protocol handlers [1]
- [ ] Add implementations for functions such as
add_peers_to_setanddisconnect_peerforNotifications - [ ] Remove the
block_announce_configfromParamsinsrc/config.rsand treat it instead as any otherNotificationsprotocol
[1] "By coincidence", https://github.com/paritytech/substrate/pull/12441 converted the default empty handshake to send the role of the node as the default handshake. This means that each protocol now has the capability of learning the role of remote peer by decoding the handshake, meaning that this logic can be moved out of Protocol and the BlockAnnouncesHandshake decoding can also moved to SyncingEngine.