Skip to content

Commit 7ecb713

Browse files
committed
Add logging to get statistics
1 parent b4304fa commit 7ecb713

File tree

1 file changed

+24
-4
lines changed

1 file changed

+24
-4
lines changed

core/src/consensus/tendermint/worker.rs

+24-4
Original file line numberDiff line numberDiff line change
@@ -709,20 +709,33 @@ impl Worker {
709709
let parent_block_hash = self.prev_block_hash();
710710
if let Some(priority_info) = self.signer_priority_info(parent_block_hash) {
711711
if let TwoThirdsMajority::Lock(lock_view, locked_block_hash) = self.last_two_thirds_majority {
712-
cinfo!(ENGINE, "I am eligible to be a proposer, I'll re-propose a locked block");
712+
cinfo!(ENGINE, "I am eligible to be a proposer, round-info {}-{} and {}. I'll re-propose a locked block with priority",
713+
self.height,
714+
self.view,
715+
priority_info,
716+
);
713717
match self.locked_proposal_block(lock_view, locked_block_hash) {
714718
Ok(block) => self.repropose_block(priority_info, block),
715719
Err(error_msg) => cwarn!(ENGINE, "{}", error_msg),
716720
}
717721
} else {
718-
cinfo!(ENGINE, "I am eligible to be a proposer, I'll create a block");
722+
cinfo!(ENGINE, "I am eligible to be a proposer, round-info {}-{} and {}. I'll create a block with priority",
723+
self.height,
724+
self.view,
725+
priority_info,
726+
);
719727
self.update_sealing(parent_block_hash);
720728
self.step.wait_block_generation(priority_info, parent_block_hash);
721729
}
722730
} else {
723731
let sortition_round = vote_step.into();
724732
let round_highest_priority = self.votes.get_highest_priority(sortition_round);
725-
cinfo!(ENGINE, "I am not eligible to be a proposer, I'll request a proposal");
733+
cinfo!(
734+
ENGINE,
735+
"I am not eligible to be a proposer, round-info {}-{}. I'll request a proposal",
736+
self.height,
737+
self.view,
738+
);
726739
self.request_proposal_to_superiors(sortition_round, round_highest_priority);
727740
}
728741
}
@@ -1736,7 +1749,14 @@ impl Worker {
17361749
let block_view = BlockView::new(&bytes);
17371750
let header_view = block_view.header();
17381751
let number = header_view.number();
1739-
cinfo!(ENGINE, "Proposal received for {}-{:?}", number, header_view.hash());
1752+
cinfo!(
1753+
ENGINE,
1754+
"Proposal received for ({},{})-{:?}. The priority info is {}",
1755+
number,
1756+
proposed_view,
1757+
header_view.hash(),
1758+
priority_info,
1759+
);
17401760

17411761
let parent_hash = header_view.parent_hash();
17421762
{

0 commit comments

Comments
 (0)