Skip to content

Commit

Permalink
Add logging to get statistics
Browse files Browse the repository at this point in the history
  • Loading branch information
HoOngEe committed Jan 23, 2020
1 parent b4304fa commit 7ecb713
Showing 1 changed file with 24 additions and 4 deletions.
28 changes: 24 additions & 4 deletions core/src/consensus/tendermint/worker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -709,20 +709,33 @@ impl Worker {
let parent_block_hash = self.prev_block_hash();
if let Some(priority_info) = self.signer_priority_info(parent_block_hash) {
if let TwoThirdsMajority::Lock(lock_view, locked_block_hash) = self.last_two_thirds_majority {
cinfo!(ENGINE, "I am eligible to be a proposer, I'll re-propose a locked block");
cinfo!(ENGINE, "I am eligible to be a proposer, round-info {}-{} and {}. I'll re-propose a locked block with priority",
self.height,
self.view,
priority_info,
);
match self.locked_proposal_block(lock_view, locked_block_hash) {
Ok(block) => self.repropose_block(priority_info, block),
Err(error_msg) => cwarn!(ENGINE, "{}", error_msg),
}
} else {
cinfo!(ENGINE, "I am eligible to be a proposer, I'll create a block");
cinfo!(ENGINE, "I am eligible to be a proposer, round-info {}-{} and {}. I'll create a block with priority",
self.height,
self.view,
priority_info,
);
self.update_sealing(parent_block_hash);
self.step.wait_block_generation(priority_info, parent_block_hash);
}
} else {
let sortition_round = vote_step.into();
let round_highest_priority = self.votes.get_highest_priority(sortition_round);
cinfo!(ENGINE, "I am not eligible to be a proposer, I'll request a proposal");
cinfo!(
ENGINE,
"I am not eligible to be a proposer, round-info {}-{}. I'll request a proposal",
self.height,
self.view,
);
self.request_proposal_to_superiors(sortition_round, round_highest_priority);
}
}
Expand Down Expand Up @@ -1736,7 +1749,14 @@ impl Worker {
let block_view = BlockView::new(&bytes);
let header_view = block_view.header();
let number = header_view.number();
cinfo!(ENGINE, "Proposal received for {}-{:?}", number, header_view.hash());
cinfo!(
ENGINE,
"Proposal received for ({},{})-{:?}. The priority info is {}",
number,
proposed_view,
header_view.hash(),
priority_info,
);

let parent_hash = header_view.parent_hash();
{
Expand Down

0 comments on commit 7ecb713

Please sign in to comment.