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

Optional metric for era points of specified validator #2361

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

ErakhtinB
Copy link
Contributor

Referenced issues

If validator-id is provided by cli, metric of it's era points in current era appears. Info about active era, list of validators in it and their points are taken from storage. Once a minute it's set in gauge in same registry as other metrics. If id is not validator anymore it's era points number is considered 0.

Description of the Change

Possible Drawbacks

Checklist Before Opening a PR

Before you open a Pull Request (PR), please make sure you've completed the following steps and confirm by answering 'Yes' to each item:

  1. Code is formatted: Have you run your code through clang-format to ensure it adheres to the project's coding standards? [Yes|No]
  2. Code is documented: Have you added comments and documentation to your code according to the guidelines in the project's contributing guidelines? [Yes|No]
  3. Self-review: Have you reviewed your own code to ensure it is free of typos, syntax errors, logical errors, and unresolved TODOs or FIXME without linking to an issue? [Yes|No]
  4. Zombienet Tests: Have you ensured that the zombienet tests are passing? Zombienet is a network simulation and testing tool used in this project. It's important to ensure that these tests pass to maintain the stability and reliability of the project. [Yes|No]

@@ -786,6 +786,7 @@ namespace kagome::application {
"The global log level can be set with -l<level>.")
("validator", "Enable validator node")
("config-file,c", po::value<std::string>(), "Filepath to load configuration from.")
("validator-address", po::value<std::string>(), "SS58 address, if provided, erapoints of current era for it will be sent as metric\n")
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
("validator-address", po::value<std::string>(), "SS58 address, if provided, erapoints of current era for it will be sent as metric\n")
("validator-address", po::value<std::string>(), "SS58 address, if provided, erapoints of current era for it will be sent as metric")


namespace kagome::state_metrics {

static constexpr auto SET_ERA_POINTS_PERIOD = 60;
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
static constexpr auto SET_ERA_POINTS_PERIOD = 60;
static constexpr auto SET_ERA_POINTS_PERIOD = 60; // in seconds

std::move(registry),
std::move(hasher));
}
return nullptr;
Copy link
Contributor

Choose a reason for hiding this comment

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

I strongly disagree with the case of sptr being initialized with nullptr.
A possible solution could be wrapping it with an optional.

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.

2 participants