5namespace state_history {
13 return old.payer != curr.payer;
28 old.average_block_net_usage.
value_ex != curr.average_block_net_usage.
value_ex ||
29 old.average_block_net_usage.
consumed != curr.average_block_net_usage.
consumed ||
31 old.average_block_cpu_usage.
value_ex != curr.average_block_cpu_usage.
value_ex ||
32 old.average_block_cpu_usage.
consumed != curr.average_block_cpu_usage.
consumed ||
33 old.total_net_weight != curr.total_net_weight ||
34 old.total_cpu_weight != curr.total_cpu_weight ||
35 old.total_ram_bytes != curr.total_ram_bytes ||
36 old.virtual_net_limit != curr.virtual_net_limit ||
37 old.virtual_cpu_limit != curr.virtual_cpu_limit;
42 old.name != curr.name ||
43 old.is_privileged() != curr.is_privileged() ||
44 old.last_code_update != curr.last_code_update ||
45 old.vm_type != curr.vm_type ||
46 old.vm_version != curr.vm_version ||
47 old.code_hash != curr.code_hash;
59 std::vector<table_delta> deltas;
61 std::map<uint64_t, const chain::table_id_object*> removed_table_id;
62 for (
auto& rem : table_id_index.last_undo_session().removed_values)
63 removed_table_id[rem.id._id] = &rem;
66 auto obj = table_id_index.find(tid);
69 auto it = removed_table_id.find(tid);
70 SYS_ASSERT(it != removed_table_id.end(), chain::plugin_exception,
"can not found table id ${tid}", (
"tid", tid));
75 auto pack_contract_row = [&](
auto& row) {
79 auto process_table = [&](
auto*
name,
auto& index,
auto& pack_row) {
81 if (index.indices().empty())
84 auto& delta = deltas.back();
86 for (
auto& row : index.indices())
87 delta.rows.obj.emplace_back(
true, pack_row(row));
89 auto undo = index.last_undo_session();
90 if (undo.old_values.empty() && undo.new_values.empty() && undo.removed_values.empty())
93 auto& delta = deltas.back();
95 for (
auto& old : undo.old_values) {
96 auto& row = index.get(old.id);
98 delta.rows.obj.emplace_back(
true, pack_row(row));
100 for (
auto& old : undo.removed_values)
101 delta.rows.obj.emplace_back(
false, pack_row(old));
102 for (
auto& row : undo.new_values) {
103 delta.rows.obj.emplace_back(
true, pack_row(row));
#define SYS_ASSERT(expr, exc_type, FORMAT,...)
const generic_index< MultiIndexType > & get_index() const
Maintains global state information about consensus protocol rules.
shared_vector< activated_protocol_feature > activated_protocol_features
The table_id_object class tracks the mapping of (scope, code, table) to an opaque identifier.
void pack(Stream &s, const std::deque< T > &value)
chainbase::shared_multi_index_container< resource_usage_object, indexed_by< ordered_unique< tag< by_id >, member< resource_usage_object, resource_usage_object::id_type, &resource_usage_object::id > >, ordered_unique< tag< by_owner >, member< resource_usage_object, account_name, &resource_usage_object::owner > > > > resource_usage_index
chainbase::shared_multi_index_container< resource_limits_object, indexed_by< ordered_unique< tag< by_id >, member< resource_limits_object, resource_limits_object::id_type, &resource_limits_object::id > >, ordered_unique< tag< by_owner >, composite_key< resource_limits_object, BOOST_MULTI_INDEX_MEMBER(resource_limits_object, bool, pending), > > > > resource_limits_index
chainbase::shared_multi_index_container< resource_limits_state_object, indexed_by< ordered_unique< tag< by_id >, member< resource_limits_state_object, resource_limits_state_object::id_type, &resource_limits_state_object::id > > > > resource_limits_state_index
chainbase::shared_multi_index_container< resource_limits_config_object, indexed_by< ordered_unique< tag< by_id >, member< resource_limits_config_object, resource_limits_config_object::id_type, &resource_limits_config_object::id > > > > resource_limits_config_index
chainbase::shared_multi_index_container< global_property_object, indexed_by< ordered_unique< tag< by_id >, > > > global_property_multi_index
chainbase::shared_multi_index_container< code_object, indexed_by< ordered_unique< tag< by_id >, member< code_object, code_object::id_type, &code_object::id > >, ordered_unique< tag< by_code_hash >, composite_key< code_object, member< code_object, digest_type, &code_object::code_hash >, member< code_object, uint8_t, &code_object::vm_type >, member< code_object, uint8_t, &code_object::vm_version > > > > > code_index
chainbase::shared_multi_index_container< account_object, indexed_by< ordered_unique< tag< by_id >, member< account_object, account_object::id_type, &account_object::id > >, ordered_unique< tag< by_name >, member< account_object, account_name, &account_object::name > > > > account_index
chainbase::shared_multi_index_container< permission_link_object, indexed_by< ordered_unique< tag< by_id >, >, ordered_unique< tag< by_action_name >, composite_key< permission_link_object, BOOST_MULTI_INDEX_MEMBER(permission_link_object, account_name, account), BOOST_MULTI_INDEX_MEMBER(permission_link_object, account_name, code), > >, ordered_unique< tag< by_permission_name >, composite_key< permission_link_object, BOOST_MULTI_INDEX_MEMBER(permission_link_object, account_name, account), BOOST_MULTI_INDEX_MEMBER(permission_link_object, permission_name, required_permission), > > > > permission_link_index
secondary_index< uint128_t, index128_object_type >::index_index index128_index
chainbase::shared_multi_index_container< permission_object, indexed_by< ordered_unique< tag< by_id >, member< permission_object, permission_object::id_type, &permission_object::id > >, ordered_unique< tag< by_parent >, composite_key< permission_object, member< permission_object, permission_object::id_type, &permission_object::parent >, member< permission_object, permission_object::id_type, &permission_object::id > > >, ordered_unique< tag< by_owner >, composite_key< permission_object, member< permission_object, account_name, &permission_object::owner >, member< permission_object, permission_name, &permission_object::name > > >, ordered_unique< tag< by_name >, composite_key< permission_object, member< permission_object, permission_name, &permission_object::name >, member< permission_object, permission_object::id_type, &permission_object::id > > > > > permission_index
secondary_index< float64_t, index_double_object_type, soft_double_less >::index_index index_double_index
secondary_index< uint64_t, index64_object_type >::index_index index64_index
secondary_index< key256_t, index256_object_type >::index_index index256_index
chainbase::shared_multi_index_container< generated_transaction_object, indexed_by< ordered_unique< tag< by_id >, BOOST_MULTI_INDEX_MEMBER(generated_transaction_object, generated_transaction_object::id_type, id)>, ordered_unique< tag< by_trx_id >, BOOST_MULTI_INDEX_MEMBER(generated_transaction_object, transaction_id_type, trx_id)>, ordered_unique< tag< by_expiration >, composite_key< generated_transaction_object, BOOST_MULTI_INDEX_MEMBER(generated_transaction_object, time_point, expiration), > >, ordered_unique< tag< by_delay >, composite_key< generated_transaction_object, BOOST_MULTI_INDEX_MEMBER(generated_transaction_object, time_point, delay_until), > >, ordered_unique< tag< by_sender_id >, composite_key< generated_transaction_object, BOOST_MULTI_INDEX_MEMBER(generated_transaction_object, account_name, sender), > > > > generated_transaction_multi_index
chainbase::shared_multi_index_container< key_value_object, indexed_by< ordered_unique< tag< by_id >, member< key_value_object, key_value_object::id_type, &key_value_object::id > >, ordered_unique< tag< by_scope_primary >, composite_key< key_value_object, member< key_value_object, table_id, &key_value_object::t_id >, member< key_value_object, uint64_t, &key_value_object::primary_key > >, composite_key_compare< std::less< table_id >, std::less< uint64_t > > > > > key_value_index
chainbase::shared_multi_index_container< table_id_object, indexed_by< ordered_unique< tag< by_id >, member< table_id_object, table_id_object::id_type, &table_id_object::id > >, ordered_unique< tag< by_code_scope_table >, composite_key< table_id_object, member< table_id_object, account_name, &table_id_object::code >, member< table_id_object, scope_name, &table_id_object::scope >, member< table_id_object, table_name, &table_id_object::table > > > > > table_id_multi_index
chainbase::shared_multi_index_container< protocol_state_object, indexed_by< ordered_unique< tag< by_id >, > > > protocol_state_multi_index
chainbase::shared_multi_index_container< account_metadata_object, indexed_by< ordered_unique< tag< by_id >, member< account_metadata_object, account_metadata_object::id_type, &account_metadata_object::id > >, ordered_unique< tag< by_name >, member< account_metadata_object, account_name, &account_metadata_object::name > > > > account_metadata_index
secondary_index< float128_t, index_long_double_object_type, soft_long_double_less >::index_index index_long_double_index
std::vector< table_delta > create_deltas(const chainbase::database &db, bool full_snapshot)
bool include_delta(const T &old, const T &curr)
#define T(meth, val, expected)
history_context_wrapper< std::decay_t< P >, std::decay_t< T > > make_history_context_wrapper(const chainbase::database &db, const P &context, const T &obj)
history_serial_wrapper< std::decay_t< T > > make_history_serial_wrapper(const chainbase::database &db, const T &obj)
unsigned __int64 uint64_t
uint64_t consumed
The last periods average + the current periods contribution so far.
uint64_t value_ex
The current average pre-multiplied by Precision.
uint32_t last_ordinal
The ordinal of the last period which has contributed to the average.