substrate icon indicating copy to clipboard operation
substrate copied to clipboard

Merge `Protocol` and `Notifications`

Open altonen opened this issue 2 years ago • 2 comments

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_SYNC and all functionality that references the hardcoded Peerset entry
  • [ ] Move handshake decoding to protocol handlers [1]
  • [ ] Add implementations for functions such as add_peers_to_set and disconnect_peer for Notifications
  • [ ] Remove the block_announce_config from Params in src/config.rs and treat it instead as any other Notifications protocol

[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.

altonen avatar Mar 06 '23 09:03 altonen