Skip to content

Commit

Permalink
GH-2125 Move get_activated_protocol_features to block_header_state[_l…
Browse files Browse the repository at this point in the history
…egacy]
  • Loading branch information
heifner committed Feb 14, 2024
1 parent 29ddf49 commit 57371bd
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion libraries/chain/fork_database.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ namespace eosio::chain {
const auto& pfa = exts.lower_bound(protocol_feature_activation::extension_id())->second;
const auto& new_protocol_features = std::get<protocol_feature_activation>(pfa).protocol_features;
validator(n->timestamp(),
static_cast<bs*>(prev_bh.get())->get_activated_protocol_features()->protocol_features,
prev_bh.get()->get_activated_protocol_features()->protocol_features,
new_protocol_features);
}
}
Expand Down
2 changes: 1 addition & 1 deletion libraries/chain/include/eosio/chain/block_header_state.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ struct block_header_state {
const block_id_type& previous() const { return header.previous; }
uint32_t block_num() const { return block_header::num_from_id(previous()) + 1; }
const producer_authority_schedule& active_schedule_auth() const { return active_proposer_policy->proposer_schedule; }
const protocol_feature_activation_set_ptr& get_activated_protocol_features() const { return activated_protocol_features; }

block_header_state next(block_header_state_input& data) const;

Expand All @@ -84,7 +85,6 @@ struct block_header_state {
return qc.block_num > core.last_qc_block_num;
}

flat_set<digest_type> get_activated_protocol_features() const { return activated_protocol_features->protocol_features; }
const vector<digest_type>& get_new_protocol_feature_activations() const;
producer_authority get_scheduled_producer(block_timestamp_type t) const;
uint32_t active_schedule_version() const;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ struct block_header_state_legacy : public detail::block_header_state_legacy_comm

uint32_t calc_dpos_last_irreversible( account_name producer_of_next_block )const;

const protocol_feature_activation_set_ptr& get_activated_protocol_features() const { return activated_protocol_features; }
producer_authority get_scheduled_producer( block_timestamp_type t )const;
const block_id_type& prev()const { return header.previous; }
digest_type sig_digest()const;
Expand Down
1 change: 0 additions & 1 deletion libraries/chain/include/eosio/chain/block_state.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ struct block_state : public block_header_state { // block_header_state provi
std::optional<quorum_certificate> get_best_qc() const;
bool is_best_qc_strong() const;

protocol_feature_activation_set_ptr get_activated_protocol_features() const { return block_header_state::activated_protocol_features; }
bool is_pub_keys_recovered() const { return pub_keys_recovered; }
deque<transaction_metadata_ptr> extract_trxs_metas();
void set_trxs_metas(deque<transaction_metadata_ptr>&& trxs_metas, bool keys_recovered);
Expand Down
1 change: 0 additions & 1 deletion libraries/chain/include/eosio/chain/block_state_legacy.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ namespace eosio::chain {
bool is_valid() const { return validated; }
void set_valid(bool b) { validated = b; }

protocol_feature_activation_set_ptr get_activated_protocol_features() const { return activated_protocol_features; }
const producer_authority_schedule& active_schedule_auth() const { return block_header_state_legacy_common::active_schedule; }
const producer_authority_schedule* pending_schedule_auth() const { return &block_header_state_legacy::pending_schedule.schedule; }
const deque<transaction_metadata_ptr>& trxs_metas() const { return _cached_trxs; }
Expand Down

0 comments on commit 57371bd

Please sign in to comment.