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

Add node authority status metric #4699

Merged
merged 21 commits into from
Jan 13, 2022

Conversation

sandreim
Copy link
Contributor

Fixes #4675

Signed-off-by: Andrei Sandu <andrei-mihail@parity.io>
Signed-off-by: Andrei Sandu <andrei-mihail@parity.io>
@sandreim sandreim 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 Jan 12, 2022
@sandreim sandreim requested review from drahnr and eskimor January 12, 2022 10:14
Copy link
Member

@eskimor eskimor left a comment

Choose a reason for hiding this comment

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

While there is no "perfect" subsystem to add these generic logs, I would prefer to use one where we are already doing the check. gossip-support would make the "most" sense to me. Any reason why you added the logs to chain selection in particular?

Signed-off-by: Andrei Sandu <andrei-mihail@parity.io>
@sandreim
Copy link
Contributor Author

sandreim commented Jan 12, 2022

While there is no "perfect" subsystem to add these generic logs, I would prefer to use one where we are already doing the check. gossip-support would make the "most" sense to me. Any reason why you added the logs to chain selection in particular?

It was path of least resistance given the fact that I tried overseer, runtime-api and a new tiny subsystem just for this.

That being said, you are right and I totally missed this - gossip support seems the way to go here as the check is already done in there.

Copy link
Member

@bkchr bkchr left a comment

Choose a reason for hiding this comment

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

I'm still not convinced that we need this. However, if you really insist on this, why not add a prometheus metric for this?

node/core/chain-selection/src/lib.rs Outdated Show resolved Hide resolved
node/core/chain-selection/src/lib.rs Outdated Show resolved Hide resolved
@ordian
Copy link
Member

ordian commented Jan 12, 2022

That being said, you are right and I totally missed this - gossip support seems the way to go here as the check is already done in there.

Note that in gossip-support we're querying discovery_keys, which also past session validators. To check only the current session, we can also query the current n_validators (e.g. by querying util::request_validators) and check if our_index is < n_validators.

The previous suggestion was incorrect since we query not from session_info. Validator::new is the way to go.

@ordian
Copy link
Member

ordian commented Jan 12, 2022

Would it be good to add a prometheus metric for this as well?

@sandreim
Copy link
Contributor Author

sandreim commented Jan 12, 2022

Would it be good to add a prometheus metric for this as well?

IMO the log is enough, but if folks think this is useful I'll add it.

Signed-off-by: Andrei Sandu <andrei-mihail@parity.io>
This reverts commit 5bd56bb.
This reverts commit ffea18f.
@sandreim sandreim changed the title Check if the node is an authority on each block import and log changes Add node authority status metric Jan 12, 2022
Signed-off-by: Andrei Sandu <andrei-mihail@parity.io>
Signed-off-by: Andrei Sandu <andrei-mihail@parity.io>
Signed-off-by: Andrei Sandu <andrei-mihail@parity.io>
Signed-off-by: Andrei Sandu <andrei-mihail@parity.io>
Copy link
Member

@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.

LGTM

Signed-off-by: Andrei Sandu <andrei-mihail@parity.io>
Copy link
Contributor

@drahnr drahnr left a comment

Choose a reason for hiding this comment

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

Minor bike shed nit, other than that, LGTM 👍

Signed-off-by: Andrei Sandu <andrei-mihail@parity.io>
Signed-off-by: Andrei Sandu <andrei-mihail@parity.io>
Signed-off-by: Andrei Sandu <andrei-mihail@parity.io>
@sandreim sandreim requested review from eskimor and ordian January 13, 2022 15:51
primitives/src/v2/mod.rs Outdated Show resolved Hide resolved
primitives/src/v2/mod.rs Outdated Show resolved Hide resolved
Signed-off-by: Andrei Sandu <andrei-mihail@parity.io>
Signed-off-by: Andrei Sandu <andrei-mihail@parity.io>
Signed-off-by: Andrei Sandu <andrei-mihail@parity.io>
Signed-off-by: Andrei Sandu <andrei-mihail@parity.io>
Signed-off-by: Andrei Sandu <andrei-mihail@parity.io>
@ordian
Copy link
Member

ordian commented Jan 13, 2022

bot merge

Signed-off-by: Andrei Sandu <andrei-mihail@parity.io>
@paritytech-processbot
Copy link

Waiting for commit status.

@paritytech-processbot
Copy link

Merge cancelled due to error. Error: Head SHA changed from 4633e8c to 541ad6d

@ordian
Copy link
Member

ordian commented Jan 13, 2022

bot merge

@paritytech-processbot
Copy link

Waiting for commit status.

@paritytech-processbot paritytech-processbot bot merged commit 095cc29 into master Jan 13, 2022
@paritytech-processbot paritytech-processbot bot deleted the sandreim/log_auth_status_change_try2 branch January 13, 2022 17:41
Wizdave97 pushed a commit to ComposableFi/polkadot that referenced this pull request Feb 3, 2022
* Check authority status on active leaves update

Signed-off-by: Andrei Sandu <andrei-mihail@parity.io>

* cargo changes

Signed-off-by: Andrei Sandu <andrei-mihail@parity.io>

* Fix tests

Signed-off-by: Andrei Sandu <andrei-mihail@parity.io>

* Add metric for authority status

Signed-off-by: Andrei Sandu <andrei-mihail@parity.io>

* Revert "Fix tests"

This reverts commit 5bd56bb.

* Revert "cargo changes"

This reverts commit ffea18f.

* Revert "Check authority status on active leaves update"

This reverts commit 55a30ac.

* Test fixups

Signed-off-by: Andrei Sandu <andrei-mihail@parity.io>

* fix

Signed-off-by: Andrei Sandu <andrei-mihail@parity.io>

* update

Signed-off-by: Andrei Sandu <andrei-mihail@parity.io>

* undo damage

Signed-off-by: Andrei Sandu <andrei-mihail@parity.io>

* dont update status on runtime errors

Signed-off-by: Andrei Sandu <andrei-mihail@parity.io>

* Fix tests

Signed-off-by: Andrei Sandu <andrei-mihail@parity.io>

* fix inconsistency

Signed-off-by: Andrei Sandu <andrei-mihail@parity.io>

* Review feedback

Signed-off-by: Andrei Sandu <andrei-mihail@parity.io>

* Dont derive primitive Default

Signed-off-by: Andrei Sandu <andrei-mihail@parity.io>

* add dummy_session_info helper

Signed-off-by: Andrei Sandu <andrei-mihail@parity.io>

* unset parachain validator status if no longer authority

Signed-off-by: Andrei Sandu <andrei-mihail@parity.io>

* update

Signed-off-by: Andrei Sandu <andrei-mihail@parity.io>

* damn

Signed-off-by: Andrei Sandu <andrei-mihail@parity.io>

* 🤦

Signed-off-by: Andrei Sandu <andrei-mihail@parity.io>
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.

Add explicit logs for node authority status changes.
5 participants