Skip to content

Move slashing protection failure metric out of ValidatorDB - #17414

Open
syjn99 wants to merge 3 commits into
developfrom
chore/vc-metrics-increment
Open

Move slashing protection failure metric out of ValidatorDB#17414
syjn99 wants to merge 3 commits into
developfrom
chore/vc-metrics-increment

Conversation

@syjn99

@syjn99 syjn99 commented Aug 26, 2026

Copy link
Copy Markdown
Member

What type of PR is this?

Other

What does this PR do? Why is it needed?

Introduced in:

SlashableAttestationCheck and SlashableProposalCheck both have two arguments: a metric (ValidatorAttestFailVec, ValidatorProposeFailVec) and a flag (v.emitAccountMetrics). Validator*FailVec is incremented conditionally (and bit inconsistently) inside those methods.

This PR completely moves failure metrics out of ValidatorDB, and handles them consistently, after each call. This PR also removes double counting problem for ValidatorProposeFailVec: It can be first incremented in SlashableProposalCheck and then incremented again at the caller side.

I guess it was a mechnical change in order to preserve the same semantics regarding metrics, but as 1) we already have the double counting issue in proposal metrics 2) for sake of consistency and 3) it should be considered as "failure" when slashing protection check fails, I'd suggest to handle like this PR.

Which issue(s) does this PR fix?

N/A

Other notes for review

Acknowledgements

  • I have read CONTRIBUTING.md.
  • I have included a uniquely named changelog fragment file.
  • I have added a description with sufficient context for reviewers to understand this PR.
  • I have tested that my changes work as expected and I added a testing plan to the PR description (if applicable).

@syjn99
syjn99 force-pushed the chore/vc-metrics-increment branch from 1adaf2c to 6ae2c90 Compare August 31, 2026 11:11
@syjn99
syjn99 requested a review from a team as a code owner August 31, 2026 11:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant