Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

Commit

Permalink
Merge pull request #9223 from EOSIO/pend-prod-2.0
Browse files Browse the repository at this point in the history
Fix log of pending block producer - 2.0
  • Loading branch information
heifner authored Jun 19, 2020
2 parents 39d8dd5 + de123a3 commit 4a8d637
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions plugins/producer_plugin/producer_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,7 @@ class producer_plugin_impl : public std::enable_shared_from_this<producer_plugin
if (_pending_block_mode == pending_block_mode::producing) {
fc_dlog(_trx_trace_log, "[TRX_TRACE] Block ${block_num} for producer ${prod} is REJECTING tx: ${txid} : ${why} ",
("block_num", chain.head_block_num() + 1)
("prod", chain.pending_block_producer())
("prod", get_pending_block_producer())
("txid", trx->id())
("why",response.get<fc::exception_ptr>()->what()));
} else {
Expand All @@ -502,7 +502,7 @@ class producer_plugin_impl : public std::enable_shared_from_this<producer_plugin
if (_pending_block_mode == pending_block_mode::producing) {
fc_dlog(_trx_trace_log, "[TRX_TRACE] Block ${block_num} for producer ${prod} is ACCEPTING tx: ${txid}",
("block_num", chain.head_block_num() + 1)
("prod", chain.pending_block_producer())
("prod", get_pending_block_producer())
("txid", trx->id()));
} else {
fc_dlog(_trx_trace_log, "[TRX_TRACE] Speculative execution is ACCEPTING tx: ${txid}",
Expand Down Expand Up @@ -550,7 +550,7 @@ class producer_plugin_impl : public std::enable_shared_from_this<producer_plugin
if( _pending_block_mode == pending_block_mode::producing ) {
fc_dlog( _trx_trace_log, "[TRX_TRACE] Block ${block_num} for producer ${prod} COULD NOT FIT, tx: ${txid} RETRYING ",
("block_num", chain.head_block_num() + 1)
("prod", chain.pending_block_producer())
("prod", get_pending_block_producer())
("txid", trx->id()));
} else {
fc_dlog( _trx_trace_log, "[TRX_TRACE] Speculative execution COULD NOT FIT tx: ${txid} RETRYING",
Expand Down Expand Up @@ -592,6 +592,15 @@ class producer_plugin_impl : public std::enable_shared_from_this<producer_plugin
}
}

account_name get_pending_block_producer() {
auto& chain = chain_plug->chain();
if (chain.is_building_block()) {
return chain.pending_block_producer();
} else {
return {};
}
}

bool production_disabled_by_policy() {
return !_production_enabled || _pause_production || (_max_irreversible_block_age_us.count() >= 0 && get_irreversible_block_age() >= _max_irreversible_block_age_us);
}
Expand Down Expand Up @@ -1648,7 +1657,8 @@ bool producer_plugin_impl::remove_expired_persisted_trxs( const fc::time_point&
if( pbm == pending_block_mode::producing ) {
fc_dlog( _trx_trace_log,
"[TRX_TRACE] Block ${block_num} for producer ${prod} is EXPIRING PERSISTED tx: ${txid}",
("block_num", chain.head_block_num() + 1)("prod", chain.pending_block_producer())("txid", txid));
("block_num", chain.head_block_num() + 1)("txid", txid)
("prod", chain.is_building_block() ? chain.pending_block_producer() : name()) );
} else {
fc_dlog( _trx_trace_log, "[TRX_TRACE] Speculative execution is EXPIRING PERSISTED tx: ${txid}", ("txid", txid));
}
Expand Down

0 comments on commit 4a8d637

Please sign in to comment.