-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 It makes more sense to me to put everything related to networking (including the messages themselves) in a single place.
Co-authored-by: Pierre Krieger <[email protected]>
…/polkadot into rh-network-bridge-refactoring
|
||
```rust | ||
type RequestId = u64; | ||
type ProtocolVersion = u32; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FWIW, this is not used anywhere currently
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's fine, because we don't have more than one protocol version yet.
Co-authored-by: Sergei Shulepov <[email protected]>
bot merge |
Waiting for commit status. |
```rust | ||
enum AvailabilityDistributionV1Message { | ||
/// An erasure chunk for a given candidate hash. | ||
Chunk(Hash, ErasureChunk), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
This PR makes a few major changes to the structure of our networking subsystems and the network bridge subsystem that interacts with the lower-level substrate-network crate.
The largest change is reducing the amount of abstraction over message types. The picture of how to do protocol upgrades via the network bridge was quite fuzzy before because each subsystem was effectively its own subprotocol that accepted bytes and sent bytes out.
My proposal is that we don't actually need abstraction over the message types of the network at this level, and that the only purpose the network bridge should serve is abstracting over how exactly those messages are sent and received.
So this PR explicitly defines the message types sent and received by the network in v1 and forwards them to subsystems as concrete types. This also reduces the amount of places where we'd have to decode bytes from the network and allows our network subsystems to deal in concrete types.
The other major change this PR makes is the elaboration on multiple peer-sets in the network bridge. This change was first introduced in #1452 and I've expounded on it further here.