diff --git a/.cicd/docker-tag.sh b/.cicd/docker-tag.sh new file mode 100755 index 00000000000..d9f03c06a52 --- /dev/null +++ b/.cicd/docker-tag.sh @@ -0,0 +1,22 @@ +#!/bin/bash +set -eo pipefail +echo '+++ :evergreen_tree: Configuring Environment' +REPO='eosio/ci-contracts-builder' +PREFIX='base-ubuntu-18.04' +IMAGE="$REPO:$PREFIX-$BUILDKITE_COMMIT" +SANITIZED_BRANCH=$(echo "$BUILDKITE_BRANCH" | tr '/' '_') +SANITIZED_TAG=$(echo "$BUILDKITE_TAG" | tr '/' '_') +echo '+++ :arrow_down: Pulling Container' +echo "Pulling \"$IMAGE\"" +docker pull "$IMAGE" +echo '+++ :label: Tagging Container' +docker tag "$IMAGE" "$REPO:$PREFIX-$SANITIZED_BRANCH" +echo "Tagged \"$REPO:$PREFIX-$SANITIZED_BRANCH\"." +[[ -z "$BUILDKITE_TAG" ]] || docker tag "$IMAGE" "$REPO:$PREFIX-$SANITIZED_TAG" && echo "Tagged \"$REPO:$PREFIX-$SANITIZED_TAG\"." +echo '+++ :arrow_up: Pushing Container' +docker push "$REPO:$PREFIX-$SANITIZED_BRANCH" +[[ -z "$BUILDKITE_TAG" ]] || docker push "$REPO:$PREFIX-$SANITIZED_TAG" +echo '+++ :put_litter_in_its_place: Cleaning Up' +docker rmi "$REPO:$PREFIX-$SANITIZED_BRANCH" +[[ -z "$BUILDKITE_TAG" ]] || docker rmi "$REPO:$PREFIX-$SANITIZED_TAG" +docker rmi "$IMAGE" \ No newline at end of file diff --git a/.cicd/generate-pipeline.sh b/.cicd/generate-pipeline.sh index 53749b9ca2a..96aeb22643e 100755 --- a/.cicd/generate-pipeline.sh +++ b/.cicd/generate-pipeline.sh @@ -142,8 +142,21 @@ EOF EOF fi done -echo ' - wait' -echo '' +cat <, "INT16_MAX based on int16_t" ); - if( sent_handshake_count == INT16_MAX ) sent_handshake_count = 1; // do not wrap - last_handshake_sent.generation = ++sent_handshake_count; - fc_ilog( logger, "Sending handshake generation ${g} to ${ep}, lib ${lib}, head ${head}, id ${id}", - ("g", last_handshake_sent.generation)("ep", peer_name()) - ("lib", last_handshake_sent.last_irreversible_block_num) - ("head", last_handshake_sent.head_num)("id", last_handshake_sent.head_id.str().substr( 8, 16 )) ); - enqueue( last_handshake_sent ); - } + handshake_initializer::populate(last_handshake_sent); + static_assert( std::is_same_v, "INT16_MAX based on int16_t" ); + if( sent_handshake_count == INT16_MAX ) sent_handshake_count = 1; // do not wrap + last_handshake_sent.generation = ++sent_handshake_count; + fc_ilog( logger, "Sending handshake generation ${g} to ${ep}, lib ${lib}, head ${head}, id ${id}", + ("g", last_handshake_sent.generation)("ep", peer_name()) + ("lib", last_handshake_sent.last_irreversible_block_num) + ("head", last_handshake_sent.head_num)("id", last_handshake_sent.head_id.str().substr(8,16)) ); + enqueue(last_handshake_sent); } void connection::send_time() { @@ -2591,8 +2590,7 @@ namespace eosio { controller &cc = chain_plug->chain(); block_id_type blk_id = msg->id(); uint32_t blk_num = msg->block_num(); - fc_dlog( logger, "received block ${num}, id ${id}..., canceling wait on ${p}", - ("num", blk_num)("id", blk_id.str().substr(8,16))("p", c->peer_name()) ); + fc_dlog(logger, "canceling wait on ${p}", ("p",c->peer_name())); c->cancel_wait(); try { @@ -2871,10 +2869,9 @@ namespace eosio { return chain::signature_type(); } - bool + void handshake_initializer::populate( handshake_message &hello) { namespace sc = std::chrono; - bool send = true; hello.network_version = net_version_base + net_version; hello.chain_id = my_impl->chain_id; hello.node_id = my_impl->node_id; @@ -2898,8 +2895,6 @@ namespace eosio { hello.agent = my_impl->user_agent_name; - auto prev_head_id = hello.head_id; - auto prev_lib_id = hello.last_irreversible_block_id; controller& cc = my_impl->chain_plug->chain(); hello.head_id = fc::sha256(); hello.last_irreversible_block_id = fc::sha256(); @@ -2912,7 +2907,6 @@ namespace eosio { catch( const unknown_block_exception &ex) { fc_wlog( logger, "caught unkown_block" ); hello.last_irreversible_block_num = 0; - send = false; } } if( hello.head_num ) { @@ -2921,13 +2915,8 @@ namespace eosio { } catch( const unknown_block_exception &ex) { hello.head_num = 0; - send = false; } } - - if( send && hello.last_irreversible_block_id == prev_lib_id && hello.head_id == prev_head_id ) send = false; - - return send; } net_plugin::net_plugin() diff --git a/plugins/producer_plugin/producer_plugin.cpp b/plugins/producer_plugin/producer_plugin.cpp index c02bc7f27b9..f207602aee6 100644 --- a/plugins/producer_plugin/producer_plugin.cpp +++ b/plugins/producer_plugin/producer_plugin.cpp @@ -378,7 +378,6 @@ class producer_plugin_impl : public std::enable_shared_from_this().publish( priority::medium, block ); + throw; } catch ( const std::bad_alloc& ) { chain_plugin::handle_bad_alloc(); } catch ( boost::interprocess::bad_alloc& ) { chain_plugin::handle_db_exhaustion(); } - if( except ) { - app().get_channel().publish( priority::medium, block ); - return; - } - const auto& hbs = chain.head_block_state(); if( hbs->header.timestamp.next().to_time_point() >= fc::time_point::now() ) { _production_enabled = true;