Skip to content

Commit 4b4384f

Browse files
committed
increase check_zero_blocks_created period
1 parent 9dd2f75 commit 4b4384f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

modules/alert_bot.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,9 @@ def init_alerts():
7676
),
7777
"zero_block_created": Alert(
7878
"critical",
79-
f"Validator has not created any blocks in the {int(VALIDATION_PERIOD // 6 // 3600)} hours",
79+
"Validator has not created any blocks in the last few hours",
8080
"Validator has not created any blocks in the last <b>{hours} hours</b>.",
81-
VALIDATION_PERIOD // 6
81+
int(VALIDATION_PERIOD / 2.3)
8282
),
8383
"validator_slashed": Alert(
8484
"high",
@@ -355,7 +355,7 @@ def check_zero_blocks_created(self):
355355
if not self.ton.using_validator():
356356
return
357357
ts = get_timestamp()
358-
period = VALIDATION_PERIOD // 6 # 3h for mainnet, 40m for testnet
358+
period = int(VALIDATION_PERIOD / 2.3) # ~ 8h for mainnet, 100m for testnet
359359
start, end = ts - period, ts - 60
360360
config34 = self.ton.GetConfig34()
361361
if start < config34.startWorkTime: # round started recently
@@ -364,7 +364,7 @@ def check_zero_blocks_created(self):
364364
validator = self.validator_module.find_myself(validators)
365365
if validator is None or validator.blocks_created > 0:
366366
return
367-
self.send_alert("zero_block_created", hours=round(period // 3600, 1))
367+
self.send_alert("zero_block_created", hours=round(period / 3600))
368368

369369
def check_slashed(self):
370370
if not self.ton.using_validator():

0 commit comments

Comments
 (0)