From 75c421a9636afe12d4b37b299c07dade5a01be3f Mon Sep 17 00:00:00 2001 From: Chris Hewison Date: Wed, 23 Mar 2022 14:33:34 +0900 Subject: [PATCH] Trivial debug logging updates --- source/agora/consensus/protocol/Nominator.d | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/source/agora/consensus/protocol/Nominator.d b/source/agora/consensus/protocol/Nominator.d index 43c2e007542..d8321ee576d 100644 --- a/source/agora/consensus/protocol/Nominator.d +++ b/source/agora/consensus/protocol/Nominator.d @@ -1608,6 +1608,9 @@ extern(D): if (callback is null || timeout == 0) return; + log.dbg("{}: block {} slot idx {} timeout = {} msecs for {}", + __FUNCTION__, this.ledger.height() + 1, slot_idx, timeout, + type == 0 ? "NOMINATION_TIMER" : "BALLOT_PROTOCOL_TIMER" ); this.active_timers[type] = this.taskman.setTimer( timeout.msecs, { callCPPDelegate(callback); }); } @@ -1625,7 +1628,7 @@ extern(D): if (Height(slot_idx) > this.heighest_ballot_height) { this.heighest_ballot_height = Height(slot_idx); - log.info("Balloting started for slot idx {}", slot_idx); + log.info("{}: Balloting started for slot idx {}", __FUNCTION__, slot_idx); auto time_to_ballot = (this.clock.networkTime() - this.ledger.getExpectedBlockTime(this.heighest_ballot_height)).total!"seconds"; this.slot_stat.setMetricTo!"time_to_ballot"(time_to_ballot, assumeWontThrow(Height(slot_idx).toString())); @@ -1664,7 +1667,8 @@ extern(D): auto val_multipler = 1 + this.ledger.validatorCount(this.ledger.height()) / 8; this.round_timeout = base * val_multipler * roundNumber; const timeout = milliseconds(round_timeout.total!"msecs".to!long); - log.dbg("{}: roundNumber {} timeout = {} msecs", __FUNCTION__, roundNumber, timeout); + log.dbg("{}: block {} roundNumber {} timeout = {} msecs", + __FUNCTION__, this.ledger.height() + 1, roundNumber, timeout); return timeout; } }