Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parachain multiplexing #295

Merged
merged 7 commits into from
Dec 16, 2020
Merged

Parachain multiplexing #295

merged 7 commits into from
Dec 16, 2020

Conversation

maciejhirsz
Copy link
Contributor

@maciejhirsz maciejhirsz commented Oct 30, 2020

Companion PR to paritytech/substrate#7463

Expects id field on messages (defaults to 0 if absent), messages sent with different ids are treated as separate connections and can push the node to different chains.

  • Check if we need to limit number of chains per node connector.
  • Check if we need a way to broadcast a single message to all chains per node connector.

Unrelated: fixed continuation frames that sometimes errors on current build.

Copy link
Contributor

@dvdplm dvdplm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like this will be fairly painless. :)

backend/src/node/connector.rs Show resolved Hide resolved
Comment on lines 28 to 35
backlog: Vec<NodeMessage>,
backlogs: BTreeMap<ConnId, Vec<NodeMessage>>,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unrelated to this PR, but is it ok that the backlog is unbounded? Maybe we could re-work this into a bounded queue?
EDIT: I see it is bounded to 10 below. Let's document that.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, it's bounded. I'm more worried about the number of ConnId being unbounded atm.

backlog.remove(0);
}

backlog.push(msg);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So this is the fix here?

Copy link
Contributor Author

@maciejhirsz maciejhirsz Nov 4, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The issue was that I had a separate backlog and Addr<Chain> per ConnId, but was using a single NodeId. Now the NodeId is tied to ConnId, everything else (using the enum for ConnMultiplex) is a refactor to make the intent clearer, and to avoid having 3 separate BTreeMaps for no good reason (one for chain address, one for backlog, one for node id).

@maciejhirsz maciejhirsz marked this pull request as ready for review December 4, 2020 11:23
@maciejhirsz maciejhirsz merged commit 81cd70c into master Dec 16, 2020
@maciejhirsz maciejhirsz deleted the mh-id-multiplexing branch December 16, 2020 20:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants