46 namespace graphene {
namespace protocol {
struct predicate_result; } }
48 namespace graphene {
namespace chain {
52 class transaction_evaluation_state;
53 class proposal_object;
54 class operation_history_object;
55 class chain_property_object;
56 class witness_schedule_object;
58 class force_settlement_object;
59 class limit_order_object;
60 class collateral_bid_object;
61 class call_order_object;
80 skip_witness_signature = 1 << 0,
81 skip_transaction_signatures = 1 << 1,
82 skip_transaction_dupe_check = 1 << 2,
83 skip_block_size_check = 1 << 4,
84 skip_tapos_check = 1 << 5,
86 skip_merkle_check = 1 << 7,
87 skip_assert_evaluation = 1 << 8,
88 skip_undo_history_check = 1 << 9,
89 skip_witness_schedule_check = 1 << 10
107 const std::string& db_version );
125 void wipe(
const fc::path& data_dir,
bool include_blocks);
126 void close(
bool rewind =
true);
144 witness_id_type get_scheduled_witness(uint32_t slot_num)
const;
170 uint32_t witness_participation_rate()
const;
172 uint32_t update_witness_missed_blocks(
const signed_block& b );
174 void update_witness_schedule();
191 uint32_t head_block_num()
const;
193 witness_id_type head_block_witness()
const;
207 vector<authority> get_viable_custom_authorities(
208 account_id_type account,
const operation& op,
211 uint32_t last_non_undoable_block_num()
const;
223 bool force_by_collateral_index )
const;
229 void initialize_indexes();
231 void initialize_evaluators();
234 template<
typename EvaluatorType>
235 void register_evaluator()
237 const auto op_type = operation::tag<typename EvaluatorType::operation_type>::value;
238 FC_ASSERT( op_type >= 0,
"Negative operation type" );
239 FC_ASSERT( op_type < _operation_evaluators.size(),
240 "The operation type (${a}) must be smaller than the size of _operation_evaluators (${b})",
241 (
"a", op_type)(
"b", _operation_evaluators.size()) );
242 _operation_evaluators[op_type] = std::make_unique<op_evaluator_impl<EvaluatorType>>();
255 asset get_balance(account_id_type owner, asset_id_type asset_id)
const;
264 void adjust_balance(account_id_type account,
asset delta);
266 void deposit_market_fee_vesting_balance(
const account_id_type &account_id,
const asset &delta);
273 asset get_market_fee_vesting_balance(
const account_id_type &account_id,
const asset_id_type &asset_id);
291 uint32_t req_vesting_seconds,
293 account_id_type req_owner,
294 bool require_vesting );
306 void apply_debug_updates();
317 void globally_settle_asset(
const asset_object& bitasset,
const price& settle_price,
318 bool check_margin_calls =
false );
321 bool create_virtual_op =
true,
322 bool skip_cancel_fee =
false );
330 bool check_for_blackswan(
const asset_object& mia,
bool enable_black_swan =
true,
332 template<
typename IndexType>
333 void globally_settle_asset_impl(
const asset_object& bitasset,
334 const price& settle_price,
335 const IndexType& call_index,
336 bool check_margin_calls =
false );
359 const price& match_price,
361 const asset& max_settlement,
362 const price& fill_price,
363 bool is_margin_call =
false,
364 bool settle_order_is_taker =
true );
393 bool check_call_orders(
const asset_object& mia,
bool enable_black_swan =
true,
394 bool for_new_limit_order =
false,
396 bool mute_exceptions =
false,
397 bool skip_matching_settle_orders =
false );
404 only_taker_filled = 1,
405 only_maker_filled = 2,
417 const price& trade_price );
419 const price& trade_price );
421 const price& trade_price );
433 const price& trade_price,
435 const price& call_pays_price);
438 const price& trade_price,
440 return match(taker, maker, trade_price, bitasset, trade_price);
457 const price& match_price,
459 const asset& max_settlement,
460 const price& fill_price,
461 bool is_margin_call =
false );
474 const price& match_price,
476 const asset& max_settlement,
477 const price& fill_price );
490 bool cull_if_small,
const price& fill_price,
const bool is_maker );
504 const price& fill_price,
const bool is_maker,
const asset& margin_fee,
505 bool reduce_current_supply =
true );
509 const price& fill_price,
const bool is_maker,
510 bool reduce_current_supply =
true )
512 return fill_call_order( order, pays, receives, fill_price, is_maker,
asset(0, pays.
asset_id),
513 reduce_current_supply );
517 const price& fill_price,
bool is_maker,
bool pay_force_settle_fee =
true );
531 const bool& is_maker )
const;
533 const bool& is_maker,
const optional<asset>& calculated_market_fees = {});
546 block_id_type get_block_id_for_num( uint32_t block_num )
const;
547 optional<signed_block> fetch_block_by_id(
const block_id_type&
id )
const;
548 optional<signed_block> fetch_block_by_number( uint32_t num )
const;
550 std::vector<block_id_type> get_block_ids_on_fork(
block_id_type head_of_fork)
const;
552 void add_checkpoints(
const flat_map<uint32_t,block_id_type>& checkpts );
553 const flat_map<uint32_t,block_id_type>
get_checkpoints()
const {
return _checkpoints; }
554 bool before_last_checkpoint()
const;
556 bool push_block(
const signed_block& b, uint32_t skip = skip_nothing );
568 witness_id_type witness_id,
575 witness_id_type witness_id,
581 void clear_pending();
594 uint32_t push_applied_operation(
const operation& op,
bool is_virtual =
true );
595 void set_applied_operation_result( uint32_t op_id,
const operation_result& r );
596 const vector<optional< operation_history_object > >& get_applied_operations()
const;
630 const vector<const object*>&,
const flat_set<account_id_type>&)> removed_objects;
668 template<
typename Trx>
669 void _precompute_parallel(
const Trx* trx,
const size_t count,
const uint32_t skip )
const;
677 optional<undo_database::session> _pending_tx_session;
678 vector< unique_ptr<op_evaluator> > _operation_evaluators;
680 template<
class Index>
681 vector<std::reference_wrapper<const typename Index::object_type>> sort_votable_objects(
size_t count)
const;
685 void apply_block(
const signed_block& next_block, uint32_t skip = skip_nothing );
688 bool is_virtual =
true );
700 void update_witnesses(
fork_item& fork_entry )
const;
701 void create_block_summary(
const signed_block& next_block);
708 void notify_changed_objects();
717 bool skip_median_update =
false );
719 void update_global_dynamic_data(
const signed_block& b,
const uint32_t missed_blocks );
721 void update_last_irreversible_block();
722 void clear_expired_transactions();
723 void clear_expired_proposals();
724 void clear_expired_orders();
725 void clear_expired_force_settlements();
726 void update_expired_feeds();
727 void update_core_exchange_rates();
728 void update_maintenance_flag(
bool new_maintenance_flag );
729 void update_withdraw_permissions();
730 void update_credit_offers_and_deals();
731 void clear_expired_htlcs();
739 void process_budget();
741 void perform_chain_maintenance(
const signed_block& next_block );
742 void update_active_witnesses();
743 void update_active_committee_members();
744 void update_worker_votes();
746 void process_bitassets();
749 void perform_account_maintenance( Type tally_helper );
753 vector< processed_transaction > _pending_tx;
773 vector<optional<operation_history_object> > _applied_ops;
777 uint32_t _current_block_num = 0;
779 uint16_t _current_trx_in_block = 0;
780 uint16_t _current_op_in_trx = 0;
781 uint32_t _current_virtual_op = 0;
783 vector<uint64_t> _vote_tally_buffer;
784 vector<uint64_t> _witness_count_histogram_buffer;
785 vector<uint64_t> _committee_count_histogram_buffer;
786 std::array<uint64_t,2> _total_voting_stake;
789 flat_map<uint32_t,block_id_type> _checkpoints;
795 bool _track_standby_votes =
true;
804 bool _opened =
false;
807 uint32_t _push_proposal_nesting_depth = 0;
810 flat_set<asset_id_type> _issue_453_affected_assets;
map< custom_authority_id_type, rejected_predicate > rejected_predicate_map
contains properties that only apply to bitassets (market issued assets)
fc::signal< void(const signed_block &)> applied_block
contains all of the parameters necessary to calculate the fee for any operation
This class represents an account on the object graphAccounts are the primary unit of authority on the...
Maintains global state information (committee_member list, current fees)This is an implementation det...
tracks the blockchain state in an extensible manner
An order-perserving dictionary of variant's.
tracks debt and call price information
fc::static_variant< transfer_operation, limit_order_create_operation, limit_order_cancel_operation, call_order_update_operation, fill_order_operation, account_create_operation, account_update_operation, account_whitelist_operation, account_upgrade_operation, account_transfer_operation, asset_create_operation, asset_update_operation, asset_update_bitasset_operation, asset_update_feed_producers_operation, asset_issue_operation, asset_reserve_operation, asset_fund_fee_pool_operation, asset_settle_operation, asset_global_settle_operation, asset_publish_feed_operation, witness_create_operation, witness_update_operation, proposal_create_operation, proposal_update_operation, proposal_delete_operation, withdraw_permission_create_operation, withdraw_permission_update_operation, withdraw_permission_claim_operation, withdraw_permission_delete_operation, committee_member_create_operation, committee_member_update_operation, committee_member_update_global_parameters_operation, vesting_balance_create_operation, vesting_balance_withdraw_operation, worker_create_operation, custom_operation, assert_operation, balance_claim_operation, override_transfer_operation, transfer_to_blind_operation, blind_transfer_operation, transfer_from_blind_operation, asset_settle_cancel_operation, asset_claim_fees_operation, fba_distribute_operation, bid_collateral_operation, execute_bid_operation, asset_claim_pool_operation, asset_update_issuer_operation, htlc_create_operation, htlc_redeem_operation, htlc_redeemed_operation, htlc_extend_operation, htlc_refund_operation, custom_authority_create_operation, custom_authority_update_operation, custom_authority_delete_operation, ticket_create_operation, ticket_update_operation, liquidity_pool_create_operation, liquidity_pool_delete_operation, liquidity_pool_deposit_operation, liquidity_pool_withdraw_operation, liquidity_pool_exchange_operation, samet_fund_create_operation, samet_fund_delete_operation, samet_fund_update_operation, samet_fund_borrow_operation, samet_fund_repay_operation, credit_offer_create_operation, credit_offer_delete_operation, credit_offer_update_operation, credit_offer_accept_operation, credit_deal_repay_operation, credit_deal_expired_operation >
const flat_map< uint32_t, block_id_type > get_checkpoints() const
fc::signal< void(const signed_transaction &)> on_pending_transaction
Contains per-node database configuration.
std::string to_pretty_string(int64_t)
The price struct stores asset prices in the BitShares system.
maintains a set of indexed objects that can be modified with multi-level rollback support ...
tracks bitassets scheduled for force settlement at some point in the future.
#define FC_ASSERT(TEST,...)
Checks a condition and throws an assert_exception if the test is FALSE.
adds a signature to a transaction
tracks the asset information that changes frequentlyBecause the asset_object is very large it doesn't...
bids of collateral for debt after a black swan
tracks the parameters of an assetAll assets have a globally unique symbol name that controls how they...
std::deque< precomputable_transaction > _popped_tx
defines market parameters for margin positions
void enable_standby_votes_tracking(bool enable)
Enable or disable tracking of votes of standby witnesses and committee members.
Maintains global state information (committee_member list, current fees)This is an implementation det...
boost::signals2::signal< T > signal
base for all database objects
an elliptic curve private key.
wraps boost::filesystem::path to provide platform independent path manipulation.
captures the result of evaluating the operations contained in the transaction
uint8_t block_interval
interval in seconds between blocks
fc::time_point_sec _current_block_time
an offer to sell an amount of an asset at a specified exchange rate by a certain timeThe objects are ...
tracks the approval of a partially approved transaction