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

Chunk endorsement by shard metrics must use shards chunks-endorsed, instead of shard chunks-produced #11950

Closed
tayfunelmas opened this issue Aug 15, 2024 · 0 comments · Fixed by #12442
Assignees

Comments

@tayfunelmas
Copy link
Contributor

Currently the shard ids in the epoch validator info are the shards produced by the chunk producer. But the shards for which the node generates endorsements will be different and a larger set. We should update the metrics near_validators_chunk_endorsements_produced_by_shard and near_validators_chunk_endorsements_expected_by_shard to consider the shards for which chunks are endorsed instead of the shards for which the chunks are produced.

@tayfunelmas tayfunelmas self-assigned this Aug 15, 2024
@tayfunelmas tayfunelmas changed the title Chunk endorsement by shard metrics use produced shards, instead of endorsed shards Chunk endorsement by shard metrics must use shards chunks-endorsed, instead of shard chunks-produced Aug 15, 2024
github-merge-queue bot pushed a commit that referenced this issue Nov 14, 2024
…k production and endorsements (#12442)

Fixes #11950.

Change the `get_validator_info` function to use the correct set of
shards for chunk endorsements. This function is used for the
`validator_info` RPC and updating the prometheus metrics.

Today, there is `shards` field in `CurrentEpochValidatorInfo` that
contains the set of shards the validator is supposed to produce chunks
for (chunks-expected > 0). This field is used to update the prometheus
metrics for block/chunk production stats as well as endorsement stats
(ie. for each shard in this set, update the production and endorsement
metrics).

However, the set of shards that a validator validates chunks is not
equal to the shard it produces chunks for (the former is a larger set).
As a result, we see less dimensions for endorsement metrics.

In this PR, we rename `shards` to `shards_produced` and add another
field `shards_endorsed` in order to track these two different sets of
shards. We also populate these fields by looking at the aggragator's
chunk-stats (checking is expected > 0) instead of chunk-producer
assignments.

Note that, this PR only fixes the input with
`ValidatorInfoIdentifier::BlockHash` where the per-shard stats are
available. `ValidatorInfoIdentifier::EpochId` is not fixed, since it
does not have per-shard statistics.

Testing: Ran a mainnet RPC node with the changes and compared the result
of "validator" RPC for the node and the mainnet canary RPC (without the
changes).

---------

Co-authored-by: Aleksandr Logunov <the.alex.logunov@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant