-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Collator connection management #5388
Collator connection management #5388
Conversation
With this more precise information, we can also trigger an early announcement of a collation. (Not yet implemented)
- Basic connection management logic, at least data wise. - "Prepared" for async backing already
/// | ||
/// The values of this map are the group/session combinations we want to be connected for the | ||
/// given block height. | ||
required_connections: HashMap<BlockNumber, HashSet<(SessionIndex, GroupIndex)>>, |
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.
indentation
/// | ||
/// The values of this map are the group/session combinations we want to be connected for the | ||
/// given block height. | ||
required_connections: HashMap<BlockNumber, HashSet<(SessionIndex, GroupIndex)>>, |
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.
could this be a BTreeMap? might make pruning easier (prune all up to X)
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.
I was thinking about that, but for the time it looks like it is not needed.
// | ||
// - insert message | ||
// - send to all already connected peers if in view. | ||
// -> View still relevant with async backing? Likely only when it comes to height. |
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.
View is still relevant - view determines their 'implicit view', which is the view-head + some ancestry (described in more detail here: #5054 (comment))
/// If the above is not possible, but a collator is aware it's going to produce a candidate | ||
/// based **on relay parent**, should also return `true`. | ||
/// 1. Collators who can't know in advance whether they are going to have a collation, shall | ||
/// return `None` on every call. |
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.
Why not have something like CollationForecast::Uknown
? Then we don't need the option?
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.
I think, I just liked the explicit separation between supporting collators and those which don't. Anyhow, flattening might indeed be the better option.
Still WIP
Goals:
AdvertiseCollation
messages, so we can do that round trip while preparing the collation already.cumulus companion: paritytech/cumulus#1255