Skip to content

Commit

Permalink
Merge pull request #856 from AntelopeIO/merge_fix_produced_time
Browse files Browse the repository at this point in the history
[1.0.2 -> main ] Fix reported time for produced blocks and fix confusing reported time name
  • Loading branch information
linh2931 authored Oct 1, 2024
2 parents de91278 + 67c43ce commit d355d43
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions libraries/chain/controller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -832,7 +832,7 @@ struct block_report {
size_t total_net_usage = 0;
size_t total_cpu_usage_us = 0;
fc::microseconds total_elapsed_time;
fc::time_point start_time;
fc::time_point start_time{fc::time_point::now()};
};

struct pending_state {
Expand Down Expand Up @@ -3473,7 +3473,7 @@ struct controller_impl {
if (s == controller::block_status::incomplete) {
const auto& new_b = chain_head.block();
ilog("Produced block ${id}... #${n} @ ${t} signed by ${p} "
"[trxs: ${count}, lib: ${lib}, confirmed: ${confs}, net: ${net}, cpu: ${cpu}, elapsed: ${et} us, time: ${tt} us]",
"[trxs: ${count}, lib: ${lib}, confirmed: ${confs}, net: ${net}, cpu: ${cpu} us, elapsed: ${et} us, producing time: ${tt} us]",
("id", chain_head.id().str().substr(8, 16))("n", new_b->block_num())("p", new_b->producer)("t", new_b->timestamp)
("count", new_b->transactions.size())("lib", chain_head.irreversible_blocknum())
("confs", new_b->is_proper_svnn_block() ? "" : ", confirmed: " + std::to_string(new_b->confirmed))
Expand All @@ -3497,7 +3497,7 @@ struct controller_impl {
}

ilog("Received block ${id}... #${n} @ ${t} signed by ${p} " // "Received" instead of "Applied" so it matches existing log output
"[trxs: ${count}, lib: ${lib}, net: ${net}, cpu: ${cpu}, elapsed: ${elapsed} us, time: ${time} us, latency: ${latency} ms]",
"[trxs: ${count}, lib: ${lib}, net: ${net}, cpu: ${cpu} us, elapsed: ${elapsed} us, applying time: ${time} us, latency: ${latency} ms]",
("p", chain_head.producer())("id", chain_head.id().str().substr(8, 16))("n", chain_head.block_num())("t", chain_head.timestamp())
("count", chain_head.block()->transactions.size())("lib", chain_head.irreversible_blocknum())
("net", br.total_net_usage)("cpu", br.total_cpu_usage_us)
Expand Down

0 comments on commit d355d43

Please sign in to comment.