Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
block_header_state.hpp
Go to the documentation of this file.
1#pragma once
7#include <future>
8
9namespace sysio { namespace chain {
10
46
47using signer_callback_type = std::function<std::vector<signature_type>(const digest_type&)>;
48
50
51namespace detail {
63
69
71 const protocol_feature_set& pfs,
72 builtin_protocol_feature_t feature_codename );
73}
74
84
86 const checksum256_type& action_mroot,
87 const std::optional<producer_authority_schedule>& new_producers,
88 vector<digest_type>&& new_protocol_feature_activations,
89 const protocol_feature_set& pfs,
90 const std::optional<s_header>& s_header)const;
91
93 vector<signature_type>&& additional_signatures,
94 const protocol_feature_set& pfs,
95 const std::function<void( block_timestamp_type,
96 const flat_set<digest_type>&,
97 const vector<digest_type>& )>& validator,
98 bool skip_validate_signee = false )&&;
99
101 const protocol_feature_set& pfs,
102 const std::function<void( block_timestamp_type,
103 const flat_set<digest_type>&,
104 const vector<digest_type>& )>& validator,
105 const signer_callback_type& signer )&&;
106
107protected:
109 const protocol_feature_set& pfs,
110 const std::function<void( block_timestamp_type,
111 const flat_set<digest_type>&,
112 const vector<digest_type>& )>& validator )&&;
113};
114
125
128 flat_multimap<uint16_t, block_header_extension> header_exts;
129
131
133 :detail::block_header_state_common( std::move(base) )
134 {}
135
137
138 pending_block_header_state next( block_timestamp_type when, uint16_t num_prev_blocks_to_confirm )const;
139
142 const protocol_feature_set& pfs,
143 const std::function<void( block_timestamp_type,
144 const flat_set<digest_type>&,
145 const vector<digest_type>& )>& validator,
146 bool skip_validate_signee = false )const;
147
149 uint32_t calc_dpos_last_irreversible( account_name producer_of_next_block )const;
150
152 const block_id_type& prev()const { return header.previous; }
153 digest_type sig_digest()const;
154 void sign( const signer_callback_type& signer );
155 void verify_signee()const;
156
158};
159
160using block_header_state_ptr = std::shared_ptr<block_header_state>;
161
162} }
163
165 (block_num)
166 (dpos_proposed_irreversible_blocknum)
167 (dpos_irreversible_blocknum)
168 (active_schedule)
169 (blockroot_merkle)
170 (producer_to_last_produced)
171 (producer_to_last_implied_irb)
172 (valid_block_signing_authority)
173 (confirm_count)
174)
175
177 (schedule_lib_num)
178 (schedule_hash)
179 (schedule)
180)
181
183 (id)
184 (header)
185 (pending_schedule)
186 (activated_protocol_features)
187 (additional_signatures)
188)
189
190
192 ( schedule_lib_num )
193 ( schedule_hash )
194 ( schedule )
195)
196
197
199 ( block_num )
200 ( dpos_proposed_irreversible_blocknum )
201 ( dpos_irreversible_blocknum )
202 ( active_schedule )
203 ( blockroot_merkle )
204 ( producer_to_last_produced )
205 ( producer_to_last_implied_irb )
206 ( block_signing_key )
207 ( confirm_count )
208 ( id )
209 ( header )
210 ( pending_schedule )
211 ( activated_protocol_features )
212)
Definition name.hpp:106
bool is_builtin_activated(const protocol_feature_activation_set_ptr &pfa, const protocol_feature_set &pfs, builtin_protocol_feature_t feature_codename)
std::function< std::vector< signature_type >(const digest_type &)> signer_callback_type
std::variant< block_signing_authority_v0 > block_signing_authority
std::shared_ptr< block_header_state > block_header_state_ptr
std::shared_ptr< protocol_feature_activation_set > protocol_feature_activation_set_ptr
#define FC_REFLECT(TYPE, MEMBERS)
Specializes fc::reflector for TYPE.
Definition reflect.hpp:311
#define FC_REFLECT_DERIVED(TYPE, INHERITS, MEMBERS)
Specializes fc::reflector for TYPE where type inherits other reflected classes.
Definition reflect.hpp:298
unsigned short uint16_t
Definition stdint.h:125
unsigned int uint32_t
Definition stdint.h:126
defines the minimum state necessary to validate transaction headers
block_header_state(detail::block_header_state_common &&base)
protocol_feature_activation_set_ptr activated_protocol_features
flat_multimap< uint16_t, block_header_extension > header_exts
pending_block_header_state next(block_timestamp_type when, uint16_t num_prev_blocks_to_confirm) const
producer_authority get_scheduled_producer(block_timestamp_type t) const
uint32_t calc_dpos_last_irreversible(account_name producer_of_next_block) const
const block_id_type & prev() const
vector< signature_type > additional_signatures
const vector< digest_type > & get_new_protocol_feature_activations() const
void sign(const signer_callback_type &signer)
static constexpr uint32_t minimum_compatible_version
flat_map< account_name, uint32_t > producer_to_last_implied_irb
flat_map< account_name, uint32_t > producer_to_last_produced
producer_authority_schedule schedule
digest_type schedule_hash
last irr block num
uint32_t block_num
from block_header_state_common
flat_map< account_name, uint32_t > producer_to_last_implied_irb
flat_map< account_name, uint32_t > producer_to_last_produced
protocol_feature_activation_set_ptr activated_protocol_features
Immutable except for fc::from_variant.
Definition name.hpp:43
block_header_state finish_next(const signed_block_header &h, vector< signature_type > &&additional_signatures, const protocol_feature_set &pfs, const std::function< void(block_timestamp_type, const flat_set< digest_type > &, const vector< digest_type > &)> &validator, bool skip_validate_signee=false) &&
signed_block_header make_block_header(const checksum256_type &transaction_mroot, const checksum256_type &action_mroot, const std::optional< producer_authority_schedule > &new_producers, vector< digest_type > &&new_protocol_feature_activations, const protocol_feature_set &pfs, const std::optional< s_header > &s_header) const
block_header_state _finish_next(const signed_block_header &h, const protocol_feature_set &pfs, const std::function< void(block_timestamp_type, const flat_set< digest_type > &, const vector< digest_type > &)> &validator) &&
protocol_feature_activation_set_ptr prev_activated_protocol_features