Skip to content

Commit

Permalink
Merge pull request #850 from AntelopeIO/fix_produced_time
Browse files Browse the repository at this point in the history
[1.0.2] Fix reported time for produced blocks and fix confusing reported time name
  • Loading branch information
linh2931 authored Oct 1, 2024
2 parents 4648fba + ebbf8d5 commit 9a3260e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions libraries/chain/controller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3459,7 +3459,7 @@ struct controller_impl {
fc::time_point now = fc::time_point::now();

ilog("Produced block ${id}... #${n} @ ${t} signed by ${p} "
"[trxs: ${count}, lib: ${lib}${confs}, net: ${net}, cpu: ${cpu}, elapsed: ${et} us, time: ${tt} us]",
"[trxs: ${count}, lib: ${lib}${confs}, net: ${net}, cpu: ${cpu} us, elapsed: ${et} us, producing time: ${tt} us]",
("p", new_b->producer)("id", id.str().substr(8, 16))("n", new_b->block_num())("t", new_b->timestamp)
("count", new_b->transactions.size())("lib", chain_head.irreversible_blocknum())("net", br.total_net_usage)
("cpu", br.total_cpu_usage_us)("et", br.total_elapsed_time)("tt", now - br.start_time)
Expand Down Expand Up @@ -3623,7 +3623,7 @@ struct controller_impl {
fc::time_point now = fc::time_point::now();
if (now - bsp->timestamp() < fc::minutes(5) || (bsp->block_num() % 1000 == 0)) {
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", bsp->producer())("id", bsp->id().str().substr(8, 16))("n", bsp->block_num())("t", bsp->timestamp())
("count", bsp->block->transactions.size())("lib", bsp->irreversible_blocknum())
("net", br.total_net_usage)("cpu", br.total_cpu_usage_us)
Expand Down
2 changes: 1 addition & 1 deletion libraries/chain/include/eosio/chain/controller.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ namespace eosio::chain {
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()};
};

void assemble_and_complete_block( block_report& br, const signer_callback_type& signer_callback );
Expand Down

0 comments on commit 9a3260e

Please sign in to comment.