You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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
…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>
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
andnear_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.The text was updated successfully, but these errors were encountered: