Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
global_property_object.hpp
Go to the documentation of this file.
1#pragma once
2#include <fc/uint128.hpp>
3#include <fc/array.hpp>
4
16
17namespace sysio { namespace chain {
18
23 namespace legacy {
25 static constexpr uint32_t minimum_version = 0;
26 static constexpr uint32_t maximum_version = 2;
27 static_assert(chain_snapshot_header::minimum_compatible_version <= maximum_version, "snapshot_global_property_object_v2 is no longer needed");
28
29 std::optional<block_num_type> proposed_schedule_block_num;
32 };
34 static constexpr uint32_t minimum_version = 3;
35 static constexpr uint32_t maximum_version = 3;
36 static_assert(chain_snapshot_header::minimum_compatible_version <= maximum_version, "snapshot_global_property_object_v3 is no longer needed");
37
38 std::optional<block_num_type> proposed_schedule_block_num;
42 };
55 }
56
63 class global_property_object : public chainbase::object<global_property_object_type, global_property_object>
64 {
66
67 public:
69 std::optional<block_num_type> proposed_schedule_block_num;
75
76 void initalize_from( const legacy::snapshot_global_property_object_v2& legacy, const chain_id_type& chain_id_val, const kv_database_config& kv_config_val, const wasm_config& wasm_config_val ) {
79 configuration = legacy.configuration;
80 chain_id = chain_id_val;
81 kv_configuration = kv_config_val;
82 wasm_configuration = wasm_config_val;
83 }
84
85 void initalize_from( const legacy::snapshot_global_property_object_v3& legacy, const kv_database_config& kv_config_val, const wasm_config& wasm_config_val ) {
88 configuration = legacy.configuration;
89 chain_id = legacy.chain_id;
90 kv_configuration = kv_config_val;
91 wasm_configuration = wasm_config_val;
92 }
93
102 };
103
104
107 indexed_by<
108 ordered_unique<tag<by_id>,
109 BOOST_MULTI_INDEX_MEMBER(global_property_object, global_property_object::id_type, id)
110 >
111 >
112 >;
113
122
123 namespace detail {
124 template<>
128
130 return {value.proposed_schedule_block_num, producer_authority_schedule::from_shared(value.proposed_schedule), value.configuration, value.chain_id, value.kv_configuration, value.wasm_configuration};
131 }
132
134 value.proposed_schedule_block_num = row.proposed_schedule_block_num;
135 value.proposed_schedule = row.proposed_schedule.to_shared(value.proposed_schedule.producers.get_allocator());
136 value.configuration = row.configuration;
137 value.chain_id = row.chain_id;
138 value.kv_configuration = row.kv_configuration;
139 value.wasm_configuration = row.wasm_configuration;
140 }
141 };
142 }
143
150 class dynamic_global_property_object : public chainbase::object<dynamic_global_property_object_type, dynamic_global_property_object>
151 {
153
154 id_type id;
155 uint64_t global_action_sequence = 0;
156 };
157
160 indexed_by<
161 ordered_unique<tag<by_id>,
163 >
164 >
165 >;
166
167}}
168
172
174 (proposed_schedule_block_num)(proposed_schedule)(configuration)(chain_id)(kv_configuration)(wasm_configuration)
175 )
176
178 (proposed_schedule_block_num)(proposed_schedule)(configuration)
179 )
180
182 (proposed_schedule_block_num)(proposed_schedule)(configuration)(chain_id)
183 )
184
186 (proposed_schedule_block_num)(proposed_schedule)(configuration)(chain_id)(kv_configuration)(wasm_configuration)
187 )
188
190 (proposed_schedule_block_num)(proposed_schedule)(configuration)(chain_id)(kv_configuration)(wasm_configuration)
191 )
192
194 (global_action_sequence)
195 )
#define OBJECT_CTOR(...)
Definition types.hpp:39
#define CHAINBASE_SET_INDEX_TYPE(OBJECT_TYPE, INDEX_TYPE)
Maintains global state information that frequently change.
Maintains global state information about block producer schedules and chain configuration parameters.
void initalize_from(const legacy::snapshot_global_property_object_v3 &legacy, const kv_database_config &kv_config_val, const wasm_config &wasm_config_val)
shared_producer_authority_schedule proposed_schedule
void initalize_from(const legacy::snapshot_global_property_object_v2 &legacy, const chain_id_type &chain_id_val, const kv_database_config &kv_config_val, const wasm_config &wasm_config_val)
std::optional< block_num_type > proposed_schedule_block_num
void initalize_from(const legacy::snapshot_global_property_object_v4 &legacy)
boost::multi_index_container< Object, Args..., chainbase::node_allocator< Object > > shared_multi_index_container
chainbase::shared_multi_index_container< global_property_object, indexed_by< ordered_unique< tag< by_id >, > > > global_property_multi_index
chainbase::shared_multi_index_container< dynamic_global_property_object, indexed_by< ordered_unique< tag< by_id >, > > > dynamic_global_property_multi_index
#define value
Definition pkcs11.h:157
#define FC_REFLECT(TYPE, MEMBERS)
Specializes fc::reflector for TYPE.
Definition reflect.hpp:311
unsigned int uint32_t
Definition stdint.h:126
unsigned __int64 uint64_t
Definition stdint.h:136
Producer-voted blockchain configuration parameters.
v1 Producer-voted blockchain configuration parameters
static constexpr uint32_t minimum_compatible_version
static void from_snapshot_row(snapshot_global_property_object &&row, global_property_object &value, chainbase::database &)
static snapshot_global_property_object to_snapshot_row(const global_property_object &value, const chainbase::database &)
limits for a kv database.
Definition kv_config.hpp:15
static auto from_shared(const shared_producer_authority_schedule &src)
auto to_shared(chainbase::allocator< char > alloc) const
shared_vector< shared_producer_authority > producers
std::optional< block_num_type > proposed_schedule_block_num