diff --git a/.cicd/generate-pipeline.sh b/.cicd/generate-pipeline.sh index a8126dad88c..d33a0e681d6 100755 --- a/.cicd/generate-pipeline.sh +++ b/.cicd/generate-pipeline.sh @@ -348,8 +348,7 @@ cat < my; + std::shared_ptr my; }; } diff --git a/plugins/net_plugin/net_plugin.cpp b/plugins/net_plugin/net_plugin.cpp index 9744918f96c..b35b38a0da8 100644 --- a/plugins/net_plugin/net_plugin.cpp +++ b/plugins/net_plugin/net_plugin.cpp @@ -1441,6 +1441,8 @@ namespace eosio { // // 3 my head block num < peer head block num - update sync state and send a catchup request // 4 my head block num >= peer block num send a notice catchup if this is not the first generation + // 4.1 if peer appears to be on a different fork ( our_id_for( msg.head_num ) != msg.head_id ) + // then request peer's blocks // //----------------------------- @@ -1499,10 +1501,12 @@ namespace eosio { c->enqueue( note ); } c->syncing = true; - request_message req; - req.req_blocks.mode = catch_up; - req.req_trx.mode = none; - c->enqueue( req ); + if( cc.get_block_id_for_num( msg.head_num ) != msg.head_id ) { + request_message req; + req.req_blocks.mode = catch_up; + req.req_trx.mode = none; + c->enqueue( req ); + } return; } fc_elog( logger, "sync check failed to resolve status" ); @@ -1519,13 +1523,13 @@ namespace eosio { } } if( req.req_blocks.mode == catch_up ) { - c->fork_head = id; - c->fork_head_num = num; fc_ilog( logger, "got a catch_up notice while in ${s}, fork head num = ${fhn} target LIB = ${lib} next_expected = ${ne}", ("s",stage_str(state))("fhn",num)("lib",sync_known_lib_num)("ne", sync_next_expected_num) ); if (state == lib_catchup) return false; set_state(head_catchup); + c->fork_head = id; + c->fork_head_num = num; } else { c->fork_head = block_id_type(); @@ -2909,7 +2913,7 @@ namespace eosio { ( "connection-cleanup-period", bpo::value()->default_value(def_conn_retry_wait), "number of seconds to wait before cleaning up dead connections") ( "max-cleanup-time-msec", bpo::value()->default_value(10), "max connection cleanup time per cleanup call in millisec") ( "network-version-match", bpo::value()->default_value(false), - "True to require exact match of peer network version.") + "DEPRECATED, needless restriction. True to require exact match of peer network version.") ( "net-threads", bpo::value()->default_value(my->thread_pool_size), "Number of worker threads in net_plugin thread pool" ) ( "sync-fetch-span", bpo::value()->default_value(def_sync_fetch_span), "number of blocks to retrieve in a chunk from any individual peer during synchronization") @@ -2938,6 +2942,8 @@ namespace eosio { peer_log_format = options.at( "peer-log-format" ).as(); my->network_version_match = options.at( "network-version-match" ).as(); + if( my->network_version_match ) + wlog( "network-version-match is DEPRECATED as it is a needless restriction" ); my->sync_master.reset( new sync_manager( options.at( "sync-fetch-span" ).as())); my->dispatcher.reset( new dispatch_manager ); @@ -3118,6 +3124,9 @@ namespace eosio { if( my->thread_pool ) { my->thread_pool->stop(); } + + app().post( 0, [me = my](){} ); // keep my pointer alive until queue is drained + fc_ilog( logger, "exit shutdown" ); } FC_CAPTURE_AND_RETHROW() diff --git a/plugins/producer_plugin/producer_plugin.cpp b/plugins/producer_plugin/producer_plugin.cpp index 16ed5de41eb..4291dffaeb6 100644 --- a/plugins/producer_plugin/producer_plugin.cpp +++ b/plugins/producer_plugin/producer_plugin.cpp @@ -852,9 +852,8 @@ void producer_plugin::plugin_shutdown() { if( my->_thread_pool ) { my->_thread_pool->stop(); } - my->_accepted_block_connection.reset(); - my->_accepted_block_header_connection.reset(); - my->_irreversible_block_connection.reset(); + + app().post( 0, [me = my](){} ); // keep my pointer alive until queue is drained } void producer_plugin::handle_sighup() { diff --git a/programs/cleos/main.cpp b/programs/cleos/main.cpp index 59fc67679e6..104fdec9989 100644 --- a/programs/cleos/main.cpp +++ b/programs/cleos/main.cpp @@ -2329,6 +2329,7 @@ int main( int argc, char** argv ) { setlocale(LC_ALL, ""); bindtextdomain(locale_domain, locale_path); textdomain(locale_domain); + fc::logger::get(DEFAULT_LOGGER).set_log_level(fc::log_level::debug); context = eosio::client::http::create_http_context(); wallet_url = default_wallet_url; diff --git a/tests/Cluster.py b/tests/Cluster.py index e5c8d25b937..ae5a2f19ae4 100644 --- a/tests/Cluster.py +++ b/tests/Cluster.py @@ -1289,10 +1289,14 @@ def bootstrap(self, biosNode, totalNodes, prodCount, totalProducers, pfSetupPoli if not biosNode.waitForTransInBlock(transId): Utils.Print("ERROR: Failed to validate transaction %s got rolled into a block on server port %d." % (transId, biosNode.port)) return None - action="init" - data="{\"version\":0,\"core\":\"4,%s\"}" % (CORE_SYMBOL) - opts="--permission %s@active" % (eosioAccount.name) - trans=biosNode.pushMessage(eosioAccount.name, action, data, opts) + + # Only call init if the system contract is loaded + if loadSystemContract: + action="init" + data="{\"version\":0,\"core\":\"4,%s\"}" % (CORE_SYMBOL) + opts="--permission %s@active" % (eosioAccount.name) + trans=biosNode.pushMessage(eosioAccount.name, action, data, opts) + Utils.Print("Cluster bootstrap done.") return biosNode