Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.

Conversation

@montekki
Copy link
Contributor

Fixes #1694

@montekki montekki added A0-please_review Pull request needs code review. B0-silent Changes should not be mentioned in any release notes C1-low PR touches the given topic and has a low impact on builders. labels Sep 21, 2020
@montekki montekki changed the title Fs collator protocol followup Collator protocol followup Sep 21, 2020
Copy link

@ordian ordian left a comment

Choose a reason for hiding this comment

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

Metrics-related comments.

/// If `id` is `None` this is a validator side of the protocol.
pub fn new(id: Option<CollatorId>) -> Self {
/// Caller must provide a registry for prometheus metrics.
pub fn new(id: Option<CollatorId>, registry: &prometheus::Registry)
Copy link

Choose a reason for hiding this comment

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

I think &Registry is not always available, real_overseer accepts Option<&Registry>. we could do the same and call register function instead of try_register.

Wouldn't it be better to make ProtocolSide public and pass it here instead?

ProtocolSide could have two constructors:

impl ProtocolSide {
    pub fn validator(registry: Option<&Registry>) -> Result<Self> {
        ...
    }
    pub fn collator(id: CollatorId, registry: Option<&Registry>) -> Result<Self> {
        ...
    }
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In the original PR there were grumbles agains it

Copy link

Choose a reason for hiding this comment

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

But how was it resolved? We still are making a choice at startup depending on whether id is None or not?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yep, I see no other options

Copy link

@ordian ordian left a comment

Choose a reason for hiding this comment

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

Looks good, just a couple of questions.

Copy link
Contributor

@coriolinus coriolinus left a comment

Choose a reason for hiding this comment

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

I think that the recently_removed_heads thing is nice, though it necessarily limits us to precisely one update-duration of leeway for late blocks. As has already been discussed, we're implicitly assuming that we get precisely one of these updates per block, and I'm not certain that's a formal requirement for the overseer.

That said, I don't see a better way of dealing with this until we change the ActiveLeavesUpdate to explicitly name parent-child relationships, which would allow us to specify a particular duration to keep the leaves.

{
type Metrics = Metrics;
// The actual `Metrics` type depends on whether we're on the collator or validator side.
type Metrics = ();
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't really understand why we expose the Metrics type in the trait if it's ok to just fake it and use a different type internally. I assume this is fine as @ordian has already approved this PR, but it may be worth considering whether we could remove type Metrics from trait Subsystem.

If on the other hand there's a reason to publish this type, then we really should be distributing it via an enum.

@montekki
Copy link
Contributor Author

bot merge

@ghost
Copy link

ghost commented Sep 28, 2020

Trying merge.

@ghost ghost merged commit b8905d1 into paritytech:master Sep 28, 2020
ordian pushed a commit that referenced this pull request Sep 28, 2020
* master:
  Collator protocol followup (#1741)
  Revert "Remove Old Service, 2nd try (#1732)" (#1758)
  Remove Old Service, 2nd try (#1732)
  collation-generation: guide and tidying (#1753)
  Companion for #7111 (Introduce `cancel_proposal` and `blacklist`) (#1728)
  Parachains: Introduce a dummy module to include the Origin. (#1749)
  provisioner tests: remove tokio from dev-dependencies (#1745)
This pull request was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

A0-please_review Pull request needs code review. B0-silent Changes should not be mentioned in any release notes C1-low PR touches the given topic and has a low impact on builders.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Collator protocol follow ups.

3 participants