static_assert(std::numeric_limits<uint8_t>::max()>=(config::max_producers*2/3)+1,"8bit confirmations may not be able to hold all of the needed confirmations");
dpos_irreversible=0,///< this block has already been applied before by this node and is considered irreversible by DPOS standards
bft_irreversible=1,///< this block has already been applied before by this node and is considered irreversible by BFT standards (but not yet DPOS standards)
validated_block=2,///< this is a complete block signed by a valid producer and has been previously applied by this node and therefore validated but it is not yet irreversible
completed_block=3,///< this is a complete block signed by a valid producer but is not yet irreversible nor has it yet been applied by this node
producing_block=4,///< this is an incomplete block that is being produced by a valid producer for their time slot and will be signed by them after the block is completed
speculative_block=5///< this is an incomplete block that is only being speculatively produced by the node (whether it is the node of an active producer or not)
};
block_statusstatus=speculative_block;
boolis_active_producer=false;///< whether the node applying the block is an active producer (this further modulates behavior when the block status is completed_block)
uint32_ttarget_block_net_usage_pct;///< the target percent (1% == 100, 100%= 10,000) of maximum net usage; exceeding this triggers congestion handling
uint32_tmax_transaction_net_usage;///< the maximum objectively measured net usage that the chain will allow regardless of account limits
uint32_tbase_per_transaction_net_usage;///< the base amount of net usage billed for a transaction to cover incidentals
uint64_tcontext_free_discount_net_usage_num;///< the numerator for the discount on net usage of context-free data
uint64_tcontext_free_discount_net_usage_den;///< the denominator for the discount on net usage of context-free data
uint32_tnet_usage_leeway;
uint32_tcontext_free_discount_net_usage_num;///< the numerator for the discount on net usage of context-free data
uint32_tcontext_free_discount_net_usage_den;///< the denominator for the discount on net usage of context-free data
uint64_tmax_block_cpu_usage;///< the maxiumum cpu usage in instructions for a block
uint32_tmax_block_cpu_usage;///< the maxiumum cpu usage in instructions for a block
uint32_ttarget_block_cpu_usage_pct;///< the target percent (1% == 100, 100%= 10,000) of maximum cpu usage; exceeding this triggers congestion handling
uint32_tmax_transaction_cpu_usage;///< the maximum objectively measured cpu usage that the chain will allow regardless of account limits
uint32_tbase_per_transaction_cpu_usage;///< the base amount of cpu usage billed for a transaction to cover incidentals
uint32_tbase_per_action_cpu_usage;///< the base amount of cpu usage billed for an action to cover incidentals
uint32_tbase_setcode_cpu_usage;///< the base amount of cpu usage billed for a setcode action to cover compilation/etc
uint32_tper_signature_cpu_usage;///< the cpu usage billed for every signature on a transaction
uint64_tcontext_free_discount_cpu_usage_num;///< the numerator for the discount on cpu usage of context-free actions
uint64_tcontext_free_discount_cpu_usage_den;///< the denominator for the discount on cpu usage of context-free actions
uint32_tcpu_usage_leeway;
uint32_tcontext_free_discount_cpu_usage_num;///< the numerator for the discount on cpu usage of context-free actions
uint32_tcontext_free_discount_cpu_usage_den;///< the denominator for the discount on cpu usage of context-free actions
uint32_tmax_transaction_lifetime;///< the maximum number of seconds that an input transaction's expiration can be ahead of the time of the block in which it is first included
uint32_tdeferred_trx_expiration_window;///< the number of seconds after the time a deferred transaction can first execute until it expires
...
...
@@ -48,6 +50,7 @@ struct chain_config {
<<"Target Block Net Usage Percent: "<<((double)c.target_block_net_usage_pct/(double)config::percent_1)<<"%, "
<<"Max Transaction Net Usage: "<<c.max_transaction_net_usage<<", "
<<"Base Per-Transaction Net Usage: "<<c.base_per_transaction_net_usage<<", "
<<"Net Usage Leeway: "<<c.net_usage_leeway<<", "
<<"Context-Free Data Net Usage Discount: "<<(double)c.context_free_discount_net_usage_num*100.0/(double)c.context_free_discount_net_usage_den<<"% , "
<<"Max Block CPU Usage: "<<c.max_block_cpu_usage<<", "
...
...
@@ -57,6 +60,7 @@ struct chain_config {
<<"Base Per-Action CPU Usage: "<<c.base_per_action_cpu_usage<<", "
<<"Base Setcode CPU Usage: "<<c.base_setcode_cpu_usage<<", "
<<"Per-Signature CPU Usage: "<<c.per_signature_cpu_usage<<", "
<<"CPU Usage Leeway: "<<c.cpu_usage_leeway<<", "
<<"Context-Free Action CPU Usage Discount: "<<(double)c.context_free_discount_cpu_usage_num*100.0/(double)c.context_free_discount_cpu_usage_den<<"% , "
conststaticuint32_tdefault_base_per_transaction_net_usage=12;// 12 bytes (11 bytes for worst case of transaction_receipt_header + 1 byte for static_variant tag)
conststaticuint64_tdefault_context_free_discount_net_usage_num=20;// TODO: is this reasonable?
uint64_tmax_net=0;/// the maximum number of network usage bytes the transaction can consume
uint64_tmax_cpu=0;/// the maximum number of CPU instructions the transaction may consume
/// the maximum number of network usage bytes the transaction can consume (ignoring what billable accounts can pay and ignoring the remaining usage available in the block)
uint64_tmax_net=0;
uint64_teager_net_limit=0;///< net usage limit (in bytes) to check against eagerly
/// the maximum number of virtual CPU instructions the transaction may consume (ignoring what billable accounts can pay and ignoring the remaining usage available in the block)
uint64_tmax_cpu=0;
uint64_teager_cpu_limit=0;///< cpu usage limit (in virtual CPU instructions) to check against eagerly
/// the maximum number of virtual CPU instructions of the transaction that can be safely billed to the billable accounts
("enable-stale-production,e",boost::program_options::bool_switch()->notifier([this](boole){my->_production_enabled=e;}),"Enable block production, even if the chain is stale.")