Skip to content

Commit 638cf6c

Browse files
committed
do not use masterchain_out_of_ser if state serializer is disabled
1 parent daa1b9b commit 638cf6c

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

modules/prometheus.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ def get_validator_status_metrics(self, result: list):
4444
result.append(METRICS['master_out_of_sync'].to_format(status.masterchain_out_of_sync))
4545
if status.shardchain_out_of_sync is not None:
4646
result.append(METRICS['shard_out_of_sync'].to_format(status.shardchain_out_of_sync))
47-
if status.masterchain_out_of_ser is not None and status.stateserializermasterchainseqno != 0:
47+
if status.stateserializerenabled and status.masterchain_out_of_ser is not None and status.stateserializermasterchainseqno != 0:
4848
result.append(METRICS['out_of_ser'].to_format(status.masterchain_out_of_ser))
4949
if status.masterchainblock is not None and status.gcmasterchainblock is not None:
5050
result.append(METRICS['celldb_gc_block'].to_format(status.masterchainblock - status.gcmasterchainblock))

mytoncore/mytoncore.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -805,6 +805,7 @@ def GetValidatorStatus(self):
805805
status.out_of_sync = status.masterchain_out_of_sync if status.masterchain_out_of_sync > status.shardchain_out_of_sync else status.shardchain_out_of_sync
806806
status.out_of_ser = status.masterchain_out_of_ser
807807
status.last_deleted_mc_state = int(parse(result, "last_deleted_mc_state", '\n'))
808+
status.stateserializerenabled = parse(result, "stateserializerenabled", '\n') == "true"
808809
self.local.try_function(self.parse_stats_from_vc, args=[result, status])
809810
except Exception as ex:
810811
self.local.add_log(f"GetValidatorStatus warning: {ex}", "warning")

mytonctrl/mytonctrl.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -746,7 +746,10 @@ def PrintLocalStatus(local, ton, adnlAddr, validatorIndex, validatorEfficiency,
746746
master_out_of_sync_text = local.translate("local_status_master_out_of_sync").format(GetColorInt(validator_status.masterchain_out_of_sync, 20, logic="less", ending=" sec"))
747747
shard_out_of_sync_text = local.translate("local_status_shard_out_of_sync").format(GetColorInt(validator_status.shardchain_out_of_sync, 5, logic="less", ending=" blocks"))
748748

749-
validator_out_of_ser_text = local.translate("local_status_validator_out_of_ser").format(f'{validator_status.out_of_ser} blocks ago')
749+
validator_out_of_ser_text = None
750+
751+
if validator_status.stateserializerenabled:
752+
validator_out_of_ser_text = local.translate("local_status_validator_out_of_ser").format(f'{validator_status.out_of_ser} blocks ago')
750753

751754
dbSize_text = GetColorInt(dbSize, 1000, logic="less", ending=" Gb")
752755
dbUsage_text = GetColorInt(dbUsage, 80, logic="less", ending="%")
@@ -797,7 +800,8 @@ def PrintLocalStatus(local, ton, adnlAddr, validatorIndex, validatorEfficiency,
797800
print(validator_out_of_sync_text)
798801
print(master_out_of_sync_text)
799802
print(shard_out_of_sync_text)
800-
print(validator_out_of_ser_text)
803+
if validator_out_of_ser_text:
804+
print(validator_out_of_ser_text)
801805
print(dbStatus_text)
802806
print(mtcVersion_text)
803807
print(validatorVersion_text)

0 commit comments

Comments
 (0)