3namespace fc {
class variant; }
22 std::optional<boost::signals2::scoped_connection> _accepted_block_connection;
23 std::optional<boost::signals2::scoped_connection> _irreversible_block_connection;
27 bool _clean_producer_sequence{
false};
28 bool _started_production_round{
false};
29 bool _track_lib{
false};
30 bool _track_head{
false};
34 _irreversible_block_connection.emplace(
36 applied_irreversible_block( bs );
38 _accepted_block_connection =
45 _accepted_block_connection.reset();
46 _irreversible_block_connection.reset();
51 process_next_block_state(bsp);
56 process_next_block_state(bsp);
62 const auto& producer_authority = bsp->get_scheduled_producer(block_time);
64 const auto slot = bsp->block->timestamp.slot % chain::config::producer_repetitions;
66 if( _producer !=
producer_name ) _clean_producer_sequence =
true;
67 if( _clean_producer_sequence ) {
68 ilog(
"producer ${cprod} slot ${pslot}, looking for ${lprod} slot ${slot}",
69 (
"cprod",
producer_name)(
"pslot",
slot)(
"lprod", _producer)(
"slot", _where_in_sequence) );
71 ilog(
"producer ${cprod} slot ${pslot}, looking for start of ${lprod} production round",
77 if( _clean_producer_sequence && (
producer_name == _producer || _started_production_round) ) {
78 _started_production_round =
true;
82 if( current_slot >= _where_in_sequence ||
producer_name != _producer ) {
83 ilog(
"shutting down");
92 _where_in_sequence = where_in_seq;
93 _clean_producer_sequence =
false;
94 _started_production_round =
false;
101 _where_in_sequence = where_in_seq;
102 _clean_producer_sequence =
false;
103 _started_production_round =
false;
116 ilog(
"test_control_plugin starting up");
123 ilog(
"test_control_plugin shutting down");
126namespace test_control_apis {
129 if (
params.based_on_lib) {
130 ilog(
"kill on lib for producer: ${p} at their ${s} slot in sequence", (
"p",
params.producer.to_string())(
"s",
params.where_in_sequence));
131 my->kill_on_lib(
params.producer,
params.where_in_sequence);
133 ilog(
"kill on head for producer: ${p} at their ${s} slot in sequence", (
"p",
params.producer.to_string())(
"s",
params.where_in_sequence));
134 my->kill_on_head(
params.producer,
params.where_in_sequence);
signal< void(const block_state_ptr &)> accepted_block
signal< void(const block_state_ptr &)> irreversible_block
time_point head_block_time() const
kill_node_on_producer_results kill_node_on_producer(const kill_node_on_producer_params ¶ms) const
test_control_plugin_impl(chain::controller &c)
void kill_on_lib(account_name prod, uint32_t where_in_seq)
void kill_on_head(account_name prod, uint32_t where_in_seq)
virtual void set_program_options(options_description &cli, options_description &cfg) override
void plugin_initialize(const variables_map &options)
block_timestamp< config::block_interval_ms, config::block_timestamp_epoch > block_timestamp_type
std::shared_ptr< block_state > block_state_ptr
producer_name(block_signing_key)) FC_REFLECT(producer_set_def
Immutable except for fc::from_variant.
yubihsm_pkcs11_slot * slot