Skip to content

Commit

Permalink
fix: return previous rule of missed proposes calculation
Browse files Browse the repository at this point in the history
As the number of missed proposes must never be greater than 1000, it
doesn't make sense to have a minimal absolute threshold for this rule.
  • Loading branch information
AlexanderLukin committed Mar 25, 2024
1 parent a5a0be7 commit 9080501
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/common/alertmanager/alerts/CriticalMissedProposes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@ import { RegistrySourceOperator } from 'validators-registry';

import { Alert, AlertRequestBody, AlertRuleResult } from './BasicAlert';

const validatorsWithMissedProposalsCountThreshold = (quantity: number) => {
return Math.min(quantity / 3, 1000);
};
const VALIDATORS_WITH_MISSED_PROPOSALS_COUNT_THRESHOLD = 1 / 3;

export class CriticalMissedProposes extends Alert {
constructor(config: ConfigService, storage: ClickhouseService, operators: RegistrySourceOperator[]) {
Expand All @@ -27,7 +25,7 @@ export class CriticalMissedProposes extends Alert {
(a) => a.val_nos_id != null && +a.val_nos_module_id == operator.module && +a.val_nos_id == operator.index,
);
if (!proposeStats) continue;
if (proposeStats.missed > validatorsWithMissedProposalsCountThreshold(proposeStats.all)) {
if (proposeStats.missed > proposeStats.all * VALIDATORS_WITH_MISSED_PROPOSALS_COUNT_THRESHOLD) {
result[operator.name] = { all: proposeStats.all, missed: proposeStats.missed };
}
}
Expand Down

0 comments on commit 9080501

Please sign in to comment.