Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[1.0-beta4] Log when block has no QCs #434

Merged
merged 4 commits into from
Jul 30, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions libraries/chain/controller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3968,6 +3968,10 @@ struct controller_impl {
auto qc_ext = bsp_in->block->extract_extension<quorum_certificate_extension>();
const qc_t& received_qc = qc_ext.qc;

dlog("received block: #${bn} ${t} ${prod} ${id}, qc claim: ${qc}, previous: ${p}",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can also log after line 3965 if the block does not contain a QC.

("bn", bsp_in->block_num())("t", bsp_in->timestamp())("prod", bsp_in->producer())("id", bsp_in->id())
("qc", qc_ext.qc.to_qc_claim())("p", bsp_in->previous()));

block_state_ptr claimed_bsp = fork_db_fetch_bsp_on_branch_by_num( bsp_in->previous(), qc_ext.qc.block_num );
if( !claimed_bsp ) {
dlog("qc not found in forkdb, qc: ${qc} for block ${bn} ${id}, previous ${p}",
Expand Down
4 changes: 2 additions & 2 deletions libraries/chain/fork_database.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ namespace eosio::chain {
std::string r;
r += "[ last_final_block_timestamp: " + bs.last_final_block_timestamp().to_time_point().to_iso_string() + ", ";
r += "latest_qc_block_timestamp: " + bs.latest_qc_block_timestamp().to_time_point().to_iso_string() + ", ";
r += "timestamp: " + bs.timestamp().to_time_point().to_iso_string();
r += "timestamp: " + bs.timestamp().to_time_point().to_iso_string() + ", ";
r += "id: " + bs.id().str();
r += " ]";
return r;
Expand All @@ -36,7 +36,7 @@ namespace eosio::chain {
std::string r;
r += "[ irreversible_blocknum: " + std::to_string(bs.irreversible_blocknum()) + ", ";
r += "block_num: " + std::to_string(bs.block_num()) + ", ";
r += "timestamp: " + bs.timestamp().to_time_point().to_iso_string();
r += "timestamp: " + bs.timestamp().to_time_point().to_iso_string() + ", ";
r += "id: " + bs.id().str();
r += " ]";
return r;
Expand Down
4 changes: 4 additions & 0 deletions plugins/producer_plugin/producer_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -684,6 +684,10 @@ class producer_plugin_impl : public std::enable_shared_from_this<producer_plugin
auto missing = chain.missing_votes(id, qc_ext.qc);
log_missing_votes(block, id, missing);
}
} else if (block->is_proper_svnn_block()) {
fc_ilog(vote_logger, "Block ${id}... #${n} @ ${t} produced by ${p}, latency: ${l}ms has no votes",
("id", id.str().substr(8, 16))("n", block->block_num())("t", block->timestamp)("p", block->producer)
("l", (fc::time_point::now() - block->timestamp).count() / 1000));
}
}
}
Expand Down