This repository was archived by the owner on Nov 15, 2023. It is now read-only.
Network Bridge Refactoring - #1535
Merged
12 commits merged intoAug 5, 2020
Merged
Conversation
rphmeier
marked this pull request as ready for review
August 4, 2020 14:26
tomaka
approved these changes
Aug 4, 2020
tomaka
left a comment
Contributor
There was a problem hiding this comment.
👍 It makes more sense to me to put everything related to networking (including the messages themselves) in a single place.
3 tasks
Co-authored-by: Pierre Krieger <pierre.krieger1708@gmail.com>
…/polkadot into rh-network-bridge-refactoring
pepyakin
reviewed
Aug 4, 2020
|
|
||
| ```rust | ||
| type RequestId = u64; | ||
| type ProtocolVersion = u32; |
Contributor
There was a problem hiding this comment.
FWIW, this is not used anywhere currently
Contributor
Author
There was a problem hiding this comment.
That's fine, because we don't have more than one protocol version yet.
Co-authored-by: Sergei Shulepov <sergei@parity.io>
Contributor
Author
|
bot merge |
|
Waiting for commit status. |
drahnr
reviewed
Aug 5, 2020
drahnr
reviewed
Aug 5, 2020
| ```rust | ||
| enum AvailabilityDistributionV1Message { | ||
| /// An erasure chunk for a given candidate hash. | ||
| Chunk(Hash, ErasureChunk), |
This pull request was closed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.