BitShares-Core  7.0.2
BitShares blockchain node software and command-line wallet software
chain_parameters.hpp
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2015 Cryptonomex, Inc., and contributors.
3  *
4  * The MIT License
5  *
6  * Permission is hereby granted, free of charge, to any person obtaining a copy
7  * of this software and associated documentation files (the "Software"), to deal
8  * in the Software without restriction, including without limitation the rights
9  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10  * copies of the Software, and to permit persons to whom the Software is
11  * furnished to do so, subject to the following conditions:
12  *
13  * The above copyright notice and this permission notice shall be included in
14  * all copies or substantial portions of the Software.
15  *
16  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22  * THE SOFTWARE.
23  */
24 #pragma once
25 
26 #include <memory>
28 
29 namespace graphene { namespace protocol {
30  struct fee_schedule;
31 
32  struct htlc_options
33  {
34  uint32_t max_timeout_secs;
36  };
37 
39  {
44  };
45 
47  {
49  std::shared_ptr<const fee_schedule> current_fees;
51  fee_schedule& get_mutable_fees() { FC_ASSERT(current_fees); return const_cast<fee_schedule&>(*current_fees); }
52 
71  bool count_non_member_votes = true;
81 
82  struct ext
83  {
88  };
89 
91 
92  void validate()const;
93 
95  chain_parameters(const chain_parameters& other);
99 
102  uint16_t get_market_fee_network_percent() const;
103 
106  uint16_t get_maker_fee_discount_percent() const;
107 
108  private:
109  static void safe_copy(chain_parameters& to, const chain_parameters& from);
110  };
111 
112 } } // graphene::protocol
113 
115  (max_timeout_secs)
116  (max_preimage_size)
117 )
118 
120  (max_custom_authority_lifetime_seconds)
121  (max_custom_authorities_per_account)
122  (max_custom_authorities_per_account_op)
123  (max_custom_authority_restrictions)
124 )
125 
127  (updatable_htlc_options)
128  (custom_authority_options)
129  (market_fee_network_percent)
130  (maker_fee_discount_percent)
131 )
132 
134  (current_fees)
135  (block_interval)
136  (maintenance_interval)
137  (maintenance_skip_slots)
138  (committee_proposal_review_period)
139  (maximum_transaction_size)
140  (maximum_block_size)
141  (maximum_time_until_expiration)
142  (maximum_proposal_lifetime)
143  (maximum_asset_whitelist_authorities)
144  (maximum_asset_feed_publishers)
145  (maximum_witness_count)
146  (maximum_committee_count)
147  (maximum_authority_membership)
148  (reserve_percent_of_fee)
149  (network_percent_of_fee)
150  (lifetime_referrer_percent_of_fee)
151  (cashback_vesting_period_seconds)
152  (cashback_vesting_threshold)
153  (count_non_member_votes)
154  (allow_non_member_whitelists)
155  (witness_pay_per_block)
156  (worker_budget_per_day)
157  (max_predicate_opcode)
158  (fee_liquidation_threshold)
159  (accounts_per_fee_scale)
160  (account_fee_scale_bitshifts)
161  (max_authority_depth)
162  (extensions)
163  )
164 
GRAPHENE_DEFAULT_WORKER_BUDGET_PER_DAY
#define GRAPHENE_DEFAULT_WORKER_BUDGET_PER_DAY
Definition: config.hpp:96
graphene::protocol::chain_parameters::maximum_proposal_lifetime
uint32_t maximum_proposal_lifetime
maximum lifetime in seconds for proposed transactions to be kept, before expiring
Definition: chain_parameters.hpp:60
graphene::protocol::extension
Definition: ext.hpp:36
GRAPHENE_DEFAULT_MAX_AUTHORITY_MEMBERSHIP
#define GRAPHENE_DEFAULT_MAX_AUTHORITY_MEMBERSHIP
Definition: config.hpp:73
graphene::protocol::fee_schedule
contains all of the parameters necessary to calculate the fee for any operation
Definition: fee_schedule.hpp:173
graphene::protocol::chain_parameters::lifetime_referrer_percent_of_fee
uint16_t lifetime_referrer_percent_of_fee
percent of fee which should go to lifetime referrer
Definition: chain_parameters.hpp:68
graphene::protocol::chain_parameters::ext::market_fee_network_percent
optional< uint16_t > market_fee_network_percent
Definition: chain_parameters.hpp:86
GRAPHENE_DEFAULT_WITNESS_PAY_PER_BLOCK
#define GRAPHENE_DEFAULT_WITNESS_PAY_PER_BLOCK
Definition: config.hpp:94
GRAPHENE_DEFAULT_ACCOUNTS_PER_FEE_SCALE
#define GRAPHENE_DEFAULT_ACCOUNTS_PER_FEE_SCALE
Definition: config.hpp:90
GRAPHENE_DEFAULT_BURN_PERCENT_OF_FEE
#define GRAPHENE_DEFAULT_BURN_PERCENT_OF_FEE
Definition: config.hpp:87
GRAPHENE_DEFAULT_MAX_CUSTOM_AUTHORITY_RESTRICTIONS
#define GRAPHENE_DEFAULT_MAX_CUSTOM_AUTHORITY_RESTRICTIONS
Maximum number of restrictions a custom authority can contain.
Definition: config.hpp:164
GRAPHENE_DEFAULT_MAX_BLOCK_SIZE
#define GRAPHENE_DEFAULT_MAX_BLOCK_SIZE
Definition: config.hpp:64
graphene::protocol::custom_authority_options_type::max_custom_authority_restrictions
uint32_t max_custom_authority_restrictions
Definition: chain_parameters.hpp:43
graphene::protocol::chain_parameters::maintenance_skip_slots
uint8_t maintenance_skip_slots
number of block_intervals to skip at maintenance time
Definition: chain_parameters.hpp:55
GRAPHENE_DEFAULT_CASHBACK_VESTING_THRESHOLD
#define GRAPHENE_DEFAULT_CASHBACK_VESTING_THRESHOLD
Definition: config.hpp:86
graphene::protocol::chain_parameters::get_maker_fee_discount_percent
uint16_t get_maker_fee_discount_percent() const
Definition: chain_parameters.cpp:122
GRAPHENE_DEFAULT_MAINTENANCE_INTERVAL
#define GRAPHENE_DEFAULT_MAINTENANCE_INTERVAL
Definition: config.hpp:66
GRAPHENE_DEFAULT_COMMITTEE_PROPOSAL_REVIEW_PERIOD_SEC
#define GRAPHENE_DEFAULT_COMMITTEE_PROPOSAL_REVIEW_PERIOD_SEC
Definition: config.hpp:82
graphene::protocol::chain_parameters::witness_pay_vesting_seconds
uint32_t witness_pay_vesting_seconds
vesting_seconds parameter for witness VBO's
Definition: chain_parameters.hpp:74
graphene::protocol::chain_parameters::get_current_fees
const fee_schedule & get_current_fees() const
Definition: chain_parameters.hpp:50
GRAPHENE_DEFAULT_MAX_ASSET_WHITELIST_AUTHORITIES
#define GRAPHENE_DEFAULT_MAX_ASSET_WHITELIST_AUTHORITIES
Definition: config.hpp:74
GRAPHENE_MAX_SIG_CHECK_DEPTH
#define GRAPHENE_MAX_SIG_CHECK_DEPTH
Definition: config.hpp:43
graphene::protocol::chain_parameters::chain_parameters
chain_parameters()
Definition: chain_parameters.cpp:7
GRAPHENE_DEFAULT_MAX_ASSET_FEED_PUBLISHERS
#define GRAPHENE_DEFAULT_MAX_ASSET_FEED_PUBLISHERS
Definition: config.hpp:75
GRAPHENE_DEFAULT_CASHBACK_VESTING_PERIOD_SEC
#define GRAPHENE_DEFAULT_CASHBACK_VESTING_PERIOD_SEC
1 year
Definition: config.hpp:85
graphene::protocol::custom_authority_options_type::max_custom_authority_lifetime_seconds
uint32_t max_custom_authority_lifetime_seconds
Definition: chain_parameters.hpp:40
graphene::protocol::chain_parameters::maximum_transaction_size
uint32_t maximum_transaction_size
maximum allowable size in bytes for a transaction
Definition: chain_parameters.hpp:57
graphene::protocol::chain_parameters::cashback_vesting_period_seconds
uint32_t cashback_vesting_period_seconds
time after cashback rewards are accrued before they become liquid
Definition: chain_parameters.hpp:69
graphene::protocol::chain_parameters::allow_non_member_whitelists
bool allow_non_member_whitelists
true if non-member accounts may set whitelists and blacklists; false otherwise
Definition: chain_parameters.hpp:72
graphene::protocol::htlc_options::max_preimage_size
uint32_t max_preimage_size
Definition: chain_parameters.hpp:35
GRAPHENE_DEFAULT_MAX_TRANSACTION_SIZE
#define GRAPHENE_DEFAULT_MAX_TRANSACTION_SIZE
Definition: config.hpp:63
graphene::protocol::chain_parameters::network_percent_of_fee
uint16_t network_percent_of_fee
percent of transaction fees paid to network
Definition: chain_parameters.hpp:67
GRAPHENE_DEFAULT_MAINTENANCE_SKIP_SLOTS
#define GRAPHENE_DEFAULT_MAINTENANCE_SKIP_SLOTS
Definition: config.hpp:67
graphene::protocol::chain_parameters::account_fee_scale_bitshifts
uint8_t account_fee_scale_bitshifts
number of times to left bitshift account registration fee at each scaling
Definition: chain_parameters.hpp:79
graphene::protocol::chain_parameters::extensions
extension< ext > extensions
Definition: chain_parameters.hpp:90
graphene::protocol::htlc_options::max_timeout_secs
uint32_t max_timeout_secs
Definition: chain_parameters.hpp:34
graphene::protocol::chain_parameters::ext
Definition: chain_parameters.hpp:82
graphene::protocol::chain_parameters::accounts_per_fee_scale
uint16_t accounts_per_fee_scale
number of accounts between fee scalings
Definition: chain_parameters.hpp:78
graphene::protocol::chain_parameters::validate
void validate() const
Definition: chain_parameters.cpp:81
GRAPHENE_DEFAULT_ACCOUNT_FEE_SCALE_BITSHIFTS
#define GRAPHENE_DEFAULT_ACCOUNT_FEE_SCALE_BITSHIFTS
Definition: config.hpp:91
graphene::protocol::chain_parameters::maximum_committee_count
uint16_t maximum_committee_count
maximum number of active committee_members
Definition: chain_parameters.hpp:64
GRAPHENE_DEFAULT_MAX_CUSTOM_AUTHORITIES_PER_ACCOUNT_OP
#define GRAPHENE_DEFAULT_MAX_CUSTOM_AUTHORITIES_PER_ACCOUNT_OP
Maximum number of custom authorities a particular account can set for a particular operation.
Definition: config.hpp:162
GRAPHENE_DEFAULT_WITNESS_PAY_VESTING_SECONDS
#define GRAPHENE_DEFAULT_WITNESS_PAY_VESTING_SECONDS
Definition: config.hpp:95
graphene::protocol::chain_parameters::get_market_fee_network_percent
uint16_t get_market_fee_network_percent() const
Definition: chain_parameters.cpp:116
graphene::protocol::chain_parameters::ext::custom_authority_options
optional< custom_authority_options_type > custom_authority_options
Definition: chain_parameters.hpp:85
GRAPHENE_DEFAULT_MAX_COMMITTEE
#define GRAPHENE_DEFAULT_MAX_COMMITTEE
Definition: config.hpp:80
GRAPHENE_DECLARE_EXTERNAL_SERIALIZATION
#define GRAPHENE_DECLARE_EXTERNAL_SERIALIZATION(type)
Definition: types.hpp:85
graphene::protocol::chain_parameters::witness_pay_per_block
share_type witness_pay_per_block
CORE to be allocated to witnesses (per block)
Definition: chain_parameters.hpp:73
graphene::protocol::chain_parameters
Definition: chain_parameters.hpp:46
GRAPHENE_DEFAULT_MAX_CUSTOM_AUTHORITIES_PER_ACCOUNT
#define GRAPHENE_DEFAULT_MAX_CUSTOM_AUTHORITIES_PER_ACCOUNT
Maximum number of custom authorities a particular account can set.
Definition: config.hpp:160
graphene::protocol::chain_parameters::max_authority_depth
uint8_t max_authority_depth
Definition: chain_parameters.hpp:80
graphene::protocol::chain_parameters::committee_proposal_review_period
uint32_t committee_proposal_review_period
minimum time in seconds that a proposed transaction requiring committee authority may not be signed,...
Definition: chain_parameters.hpp:56
graphene::protocol::chain_parameters::maximum_witness_count
uint16_t maximum_witness_count
maximum number of active witnesses
Definition: chain_parameters.hpp:63
GRAPHENE_DEFAULT_MAX_ASSERT_OPCODE
#define GRAPHENE_DEFAULT_MAX_ASSERT_OPCODE
Definition: config.hpp:88
graphene::protocol::htlc_options
Definition: chain_parameters.hpp:32
graphene::protocol::chain_parameters::maximum_asset_whitelist_authorities
uint8_t maximum_asset_whitelist_authorities
maximum number of accounts which an asset may list as authorities for its whitelist OR blacklist
Definition: chain_parameters.hpp:61
graphene::protocol::custom_authority_options_type::max_custom_authorities_per_account_op
uint32_t max_custom_authorities_per_account_op
Definition: chain_parameters.hpp:42
GRAPHENE_DEFAULT_LIFETIME_REFERRER_PERCENT_OF_FEE
#define GRAPHENE_DEFAULT_LIFETIME_REFERRER_PERCENT_OF_FEE
Definition: config.hpp:84
GRAPHENE_DEFAULT_FEE_LIQUIDATION_THRESHOLD
#define GRAPHENE_DEFAULT_FEE_LIQUIDATION_THRESHOLD
Definition: config.hpp:89
graphene::protocol::chain_parameters::ext::maker_fee_discount_percent
optional< uint16_t > maker_fee_discount_percent
Definition: chain_parameters.hpp:87
graphene::protocol::chain_parameters::fee_liquidation_threshold
share_type fee_liquidation_threshold
value in CORE at which accumulated fees in blockchain-issued market assets should be liquidated
Definition: chain_parameters.hpp:77
graphene::protocol::chain_parameters::cashback_vesting_threshold
share_type cashback_vesting_threshold
the maximum cashback that can be received without vesting
Definition: chain_parameters.hpp:70
FC_ASSERT
#define FC_ASSERT(TEST,...)
Checks a condition and throws an assert_exception if the test is FALSE.
Definition: exception.hpp:345
graphene::protocol::chain_parameters::count_non_member_votes
bool count_non_member_votes
set to false to restrict voting privlegages to member accounts
Definition: chain_parameters.hpp:71
graphene::protocol::chain_parameters::operator=
chain_parameters & operator=(const chain_parameters &other)
Definition: chain_parameters.cpp:19
base.hpp
graphene::protocol::chain_parameters::current_fees
std::shared_ptr< const fee_schedule > current_fees
current schedule of fees
Definition: chain_parameters.hpp:49
graphene::protocol::chain_parameters::reserve_percent_of_fee
uint16_t reserve_percent_of_fee
the percentage of the network's allocation of a fee that is taken out of circulation
Definition: chain_parameters.hpp:66
graphene::protocol::chain_parameters::maintenance_interval
uint32_t maintenance_interval
interval in sections between blockchain maintenance events
Definition: chain_parameters.hpp:54
graphene::protocol::chain_parameters::get_mutable_fees
fee_schedule & get_mutable_fees()
Definition: chain_parameters.hpp:51
graphene::protocol::chain_parameters::ext::updatable_htlc_options
optional< htlc_options > updatable_htlc_options
Definition: chain_parameters.hpp:84
graphene::protocol::chain_parameters::max_predicate_opcode
uint16_t max_predicate_opcode
predicate_opcode must be less than this number
Definition: chain_parameters.hpp:76
FC_REFLECT
#define FC_REFLECT(TYPE, MEMBERS)
Specializes fc::reflector for TYPE.
Definition: reflect.hpp:388
GRAPHENE_DEFAULT_MAX_PROPOSAL_LIFETIME_SEC
#define GRAPHENE_DEFAULT_MAX_PROPOSAL_LIFETIME_SEC
Definition: config.hpp:81
graphene::protocol::chain_parameters::maximum_block_size
uint32_t maximum_block_size
maximum allowable size in bytes for a block
Definition: chain_parameters.hpp:58
GRAPHENE_DEFAULT_NETWORK_PERCENT_OF_FEE
#define GRAPHENE_DEFAULT_NETWORK_PERCENT_OF_FEE
Definition: config.hpp:83
graphene::protocol::chain_parameters::maximum_asset_feed_publishers
uint8_t maximum_asset_feed_publishers
the maximum number of feed publishers for a given asset
Definition: chain_parameters.hpp:62
GRAPHENE_DEFAULT_MAX_CUSTOM_AUTHORITY_LIFETIME_SECONDS
#define GRAPHENE_DEFAULT_MAX_CUSTOM_AUTHORITY_LIFETIME_SECONDS
Maximum duration before a custom authority can expire (1 month)
Definition: config.hpp:158
fc::optional
provides stack-based nullable value similar to boost::optional
Definition: optional.hpp:20
graphene::protocol::custom_authority_options_type
Definition: chain_parameters.hpp:38
GRAPHENE_DEFAULT_MAX_TIME_UNTIL_EXPIRATION
#define GRAPHENE_DEFAULT_MAX_TIME_UNTIL_EXPIRATION
Definition: config.hpp:65
graphene::protocol::chain_parameters::worker_budget_per_day
share_type worker_budget_per_day
CORE to be allocated to workers (per day)
Definition: chain_parameters.hpp:75
graphene::protocol::custom_authority_options_type::max_custom_authorities_per_account
uint32_t max_custom_authorities_per_account
Definition: chain_parameters.hpp:41
GRAPHENE_DEFAULT_MAX_WITNESSES
#define GRAPHENE_DEFAULT_MAX_WITNESSES
Definition: config.hpp:79
graphene
Definition: api.cpp:48
graphene::protocol::chain_parameters::maximum_authority_membership
uint16_t maximum_authority_membership
largest number of keys/accounts an authority can have
Definition: chain_parameters.hpp:65
graphene::protocol::chain_parameters::maximum_time_until_expiration
uint32_t maximum_time_until_expiration
maximum lifetime in seconds for transactions to be valid, before expiring
Definition: chain_parameters.hpp:59
graphene::protocol::chain_parameters::block_interval
uint8_t block_interval
interval in seconds between blocks
Definition: chain_parameters.hpp:53
GRAPHENE_DEFAULT_BLOCK_INTERVAL
#define GRAPHENE_DEFAULT_BLOCK_INTERVAL
Definition: config.hpp:62
fc::safe
Definition: safe.hpp:26