Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
sysio::chain::chain_config_v0 Struct Reference

Producer-voted blockchain configuration parameters. More...

#include <chain_config.hpp>

Inheritance diagram for sysio::chain::chain_config_v0:

Public Types

enum  {
  max_block_net_usage_id , target_block_net_usage_pct_id , max_transaction_net_usage_id , base_per_transaction_net_usage_id ,
  net_usage_leeway_id , context_free_discount_net_usage_num_id , context_free_discount_net_usage_den_id , max_block_cpu_usage_id ,
  target_block_cpu_usage_pct_id , max_transaction_cpu_usage_id , min_transaction_cpu_usage_id , max_transaction_lifetime_id ,
  deferred_trx_expiration_window_id , max_transaction_delay_id , max_inline_action_size_id , max_inline_action_depth_id ,
  max_authority_depth_id , PARAMS_COUNT
}
 

Public Member Functions

void validate () const
 
const chain_config_v0v0 () const
 

Public Attributes

uint64_t max_block_net_usage
 the maxiumum net usage in instructions for a block
 
uint32_t target_block_net_usage_pct
 the target percent (1% == 100, 100%= 10,000) of maximum net usage; exceeding this triggers congestion handling
 
uint32_t max_transaction_net_usage
 the maximum objectively measured net usage that the chain will allow regardless of account limits
 
uint32_t base_per_transaction_net_usage
 the base amount of net usage billed for a transaction to cover incidentals
 
uint32_t net_usage_leeway
 
uint32_t context_free_discount_net_usage_num
 the numerator for the discount on net usage of context-free data
 
uint32_t context_free_discount_net_usage_den
 the denominator for the discount on net usage of context-free data
 
uint32_t max_block_cpu_usage
 the maxiumum billable cpu usage (in microseconds) for a block
 
uint32_t target_block_cpu_usage_pct
 the target percent (1% == 100, 100%= 10,000) of maximum cpu usage; exceeding this triggers congestion handling
 
uint32_t max_transaction_cpu_usage
 the maximum billable cpu usage (in microseconds) that the chain will allow regardless of account limits
 
uint32_t min_transaction_cpu_usage
 the minimum billable cpu usage (in microseconds) that the chain requires
 
uint32_t max_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_t deferred_trx_expiration_window
 the number of seconds after the time a deferred transaction can first execute until it expires
 
uint32_t max_transaction_delay
 the maximum number of seconds that can be imposed as a delay requirement by authorization checks
 
uint32_t max_inline_action_size
 maximum allowed size (in bytes) of an inline action
 
uint16_t max_inline_action_depth
 recursion depth limit on sending inline actions
 
uint16_t max_authority_depth
 recursion depth limit for checking if an authority is satisfied
 

Protected Member Functions

template<typename Stream >
Streamlog (Stream &out) const
 

Friends

template<typename Stream >
Streamoperator<< (Stream &out, const chain_config_v0 &c)
 
bool operator== (const chain_config_v0 &lhs, const chain_config_v0 &rhs)
 
bool operator!= (const chain_config_v0 &lhs, const chain_config_v0 &rhs)
 

Detailed Description

This object stores the blockchain configuration, which is set by the block producers. Block producers each vote for their preference for each of the parameters in this object, and the blockchain runs according to the median of the values specified by the producers.

Definition at line 16 of file chain_config.hpp.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
max_block_net_usage_id 
target_block_net_usage_pct_id 
max_transaction_net_usage_id 
base_per_transaction_net_usage_id 
net_usage_leeway_id 
context_free_discount_net_usage_num_id 
context_free_discount_net_usage_den_id 
max_block_cpu_usage_id 
target_block_cpu_usage_pct_id 
max_transaction_cpu_usage_id 
min_transaction_cpu_usage_id 
max_transaction_lifetime_id 
deferred_trx_expiration_window_id 
max_transaction_delay_id 
max_inline_action_size_id 
max_inline_action_depth_id 
max_authority_depth_id 
PARAMS_COUNT 

Definition at line 19 of file chain_config.hpp.

19 {
38 };

Member Function Documentation

◆ log()

template<typename Stream >
Stream & sysio::chain::chain_config_v0::log ( Stream & out) const
inlineprotected

Definition at line 115 of file chain_config.hpp.

115 {
116 return out << "Max Block Net Usage: " << max_block_net_usage << ", "
117 << "Target Block Net Usage Percent: " << ((double)target_block_net_usage_pct / (double)config::percent_1) << "%, "
118 << "Max Transaction Net Usage: " << max_transaction_net_usage << ", "
119 << "Base Per-Transaction Net Usage: " << base_per_transaction_net_usage << ", "
120 << "Net Usage Leeway: " << net_usage_leeway << ", "
121 << "Context-Free Data Net Usage Discount: " << (double)context_free_discount_net_usage_num * 100.0 / (double)context_free_discount_net_usage_den << "% , "
122
123 << "Max Block CPU Usage: " << max_block_cpu_usage << ", "
124 << "Target Block CPU Usage Percent: " << ((double)target_block_cpu_usage_pct / (double)config::percent_1) << "%, "
125 << "Max Transaction CPU Usage: " << max_transaction_cpu_usage << ", "
126 << "Min Transaction CPU Usage: " << min_transaction_cpu_usage << ", "
127
128 << "Max Transaction Lifetime: " << max_transaction_lifetime << ", "
129 << "Deferred Transaction Expiration Window: " << deferred_trx_expiration_window << ", "
130 << "Max Transaction Delay: " << max_transaction_delay << ", "
131 << "Max Inline Action Size: " << max_inline_action_size << ", "
132 << "Max Inline Action Depth: " << max_inline_action_depth << ", "
133 << "Max Authority Depth: " << max_authority_depth;
134 }
uint16_t max_inline_action_depth
recursion depth limit on sending inline actions
uint32_t max_transaction_lifetime
the maximum number of seconds that an input transaction's expiration can be ahead of the time of the ...
uint32_t target_block_net_usage_pct
the target percent (1% == 100, 100%= 10,000) of maximum net usage; exceeding this triggers congestion...
uint32_t context_free_discount_net_usage_num
the numerator for the discount on net usage of context-free data
uint32_t max_transaction_cpu_usage
the maximum billable cpu usage (in microseconds) that the chain will allow regardless of account limi...
uint32_t max_block_cpu_usage
the maxiumum billable cpu usage (in microseconds) for a block
uint32_t min_transaction_cpu_usage
the minimum billable cpu usage (in microseconds) that the chain requires
uint32_t deferred_trx_expiration_window
the number of seconds after the time a deferred transaction can first execute until it expires
uint64_t max_block_net_usage
the maxiumum net usage in instructions for a block
uint32_t context_free_discount_net_usage_den
the denominator for the discount on net usage of context-free data
uint32_t max_transaction_net_usage
the maximum objectively measured net usage that the chain will allow regardless of account limits
uint16_t max_authority_depth
recursion depth limit for checking if an authority is satisfied
uint32_t base_per_transaction_net_usage
the base amount of net usage billed for a transaction to cover incidentals
uint32_t max_transaction_delay
the maximum number of seconds that can be imposed as a delay requirement by authorization checks
uint32_t target_block_cpu_usage_pct
the target percent (1% == 100, 100%= 10,000) of maximum cpu usage; exceeding this triggers congestion...
uint32_t max_inline_action_size
maximum allowed size (in bytes) of an inline action
Here is the caller graph for this function:

◆ v0()

const chain_config_v0 & sysio::chain::chain_config_v0::v0 ( ) const
inline

Definition at line 62 of file chain_config.hpp.

62 {
63 return *this;
64 }

◆ validate()

void sysio::chain::chain_config_v0::validate ( ) const

Definition at line 7 of file chain_config.cpp.

7 {
9 "target block net usage percentage cannot exceed 100%" );
11 "target block net usage percentage must be at least 0.1%" );
13 "target block cpu usage percentage cannot exceed 100%" );
15 "target block cpu usage percentage must be at least 0.1%" );
16
18 "max transaction net usage must be less than max block net usage" );
20 "max transaction cpu usage must be less than max block cpu usage" );
21
23 "base net usage per transaction must be less than the max transaction net usage" );
24 SYS_ASSERT( (max_transaction_net_usage - base_per_transaction_net_usage) >= config::min_net_usage_delta_between_base_and_max_for_trx,
26 "max transaction net usage must be at least ${delta} bytes larger than base net usage per transaction",
27 ("delta", config::min_net_usage_delta_between_base_and_max_for_trx) );
29 "net usage discount ratio for context free data cannot have a 0 denominator" );
31 "net usage discount ratio for context free data cannot exceed 1" );
32
34 "min transaction cpu usage cannot exceed max transaction cpu usage" );
36 "max transaction cpu usage must be at less than the difference between the max block cpu usage and the min transaction cpu usage" );
37
39 "max authority depth should be at least 1" );
40}
#define SYS_ASSERT(expr, exc_type, FORMAT,...)
Definition exceptions.hpp:7
key Invalid authority Invalid transaction Invalid block ID Invalid packed transaction Invalid chain ID Invalid symbol Signature type is not a currently activated type Block can not be found Unlinkable block Block does not guarantee concurrent execution without conflicts Block exhausted allowed resources Block is from the future Block is not signed by expected producer Block includes an ill formed protocol feature activation extension Block includes an ill formed additional block signature extension Error decompressing transaction Transaction should have at least one required authority Expired Transaction Invalid Reference Block Duplicate deferred transaction The transaction can not be found Transaction is too big Invalid transaction extension Transaction includes disallowed Transaction exceeded transient resource limit action_validate_exception
Here is the caller graph for this function:

Friends And Related Symbol Documentation

◆ operator!=

bool operator!= ( const chain_config_v0 & lhs,
const chain_config_v0 & rhs )
friend

Definition at line 111 of file chain_config.hpp.

111{ return !(lhs == rhs); }

◆ operator<<

template<typename Stream >
Stream & operator<< ( Stream & out,
const chain_config_v0 & c )
friend

Definition at line 67 of file chain_config.hpp.

67 {
68 return c.log(out) << "\n";
69 }

◆ operator==

bool operator== ( const chain_config_v0 & lhs,
const chain_config_v0 & rhs )
friend

Definition at line 71 of file chain_config.hpp.

71 {
72 return std::tie( lhs.max_block_net_usage,
73 lhs.target_block_net_usage_pct,
74 lhs.max_transaction_net_usage,
75 lhs.base_per_transaction_net_usage,
76 lhs.net_usage_leeway,
77 lhs.context_free_discount_net_usage_num,
78 lhs.context_free_discount_net_usage_den,
79 lhs.max_block_cpu_usage,
80 lhs.target_block_cpu_usage_pct,
81 lhs.max_transaction_cpu_usage,
82 lhs.max_transaction_cpu_usage,
83 lhs.max_transaction_lifetime,
84 lhs.deferred_trx_expiration_window,
85 lhs.max_transaction_delay,
86 lhs.max_inline_action_size,
87 lhs.max_inline_action_depth,
88 lhs.max_authority_depth
89 )
90 ==
91 std::tie( rhs.max_block_net_usage,
92 rhs.target_block_net_usage_pct,
93 rhs.max_transaction_net_usage,
94 rhs.base_per_transaction_net_usage,
95 rhs.net_usage_leeway,
96 rhs.context_free_discount_net_usage_num,
97 rhs.context_free_discount_net_usage_den,
98 rhs.max_block_cpu_usage,
99 rhs.target_block_cpu_usage_pct,
100 rhs.max_transaction_cpu_usage,
101 rhs.max_transaction_cpu_usage,
102 rhs.max_transaction_lifetime,
103 rhs.deferred_trx_expiration_window,
104 rhs.max_transaction_delay,
105 rhs.max_inline_action_size,
106 rhs.max_inline_action_depth,
107 rhs.max_authority_depth
108 );
109 };

Member Data Documentation

◆ base_per_transaction_net_usage

uint32_t sysio::chain::chain_config_v0::base_per_transaction_net_usage

Definition at line 43 of file chain_config.hpp.

◆ context_free_discount_net_usage_den

uint32_t sysio::chain::chain_config_v0::context_free_discount_net_usage_den

Definition at line 46 of file chain_config.hpp.

◆ context_free_discount_net_usage_num

uint32_t sysio::chain::chain_config_v0::context_free_discount_net_usage_num

Definition at line 45 of file chain_config.hpp.

◆ deferred_trx_expiration_window

uint32_t sysio::chain::chain_config_v0::deferred_trx_expiration_window

Definition at line 54 of file chain_config.hpp.

◆ max_authority_depth

uint16_t sysio::chain::chain_config_v0::max_authority_depth

Definition at line 58 of file chain_config.hpp.

◆ max_block_cpu_usage

uint32_t sysio::chain::chain_config_v0::max_block_cpu_usage

Definition at line 48 of file chain_config.hpp.

◆ max_block_net_usage

uint64_t sysio::chain::chain_config_v0::max_block_net_usage

Definition at line 40 of file chain_config.hpp.

◆ max_inline_action_depth

uint16_t sysio::chain::chain_config_v0::max_inline_action_depth

Definition at line 57 of file chain_config.hpp.

◆ max_inline_action_size

uint32_t sysio::chain::chain_config_v0::max_inline_action_size

Definition at line 56 of file chain_config.hpp.

◆ max_transaction_cpu_usage

uint32_t sysio::chain::chain_config_v0::max_transaction_cpu_usage

Definition at line 50 of file chain_config.hpp.

◆ max_transaction_delay

uint32_t sysio::chain::chain_config_v0::max_transaction_delay

Definition at line 55 of file chain_config.hpp.

◆ max_transaction_lifetime

uint32_t sysio::chain::chain_config_v0::max_transaction_lifetime

Definition at line 53 of file chain_config.hpp.

◆ max_transaction_net_usage

uint32_t sysio::chain::chain_config_v0::max_transaction_net_usage

Definition at line 42 of file chain_config.hpp.

◆ min_transaction_cpu_usage

uint32_t sysio::chain::chain_config_v0::min_transaction_cpu_usage

Definition at line 51 of file chain_config.hpp.

◆ net_usage_leeway

uint32_t sysio::chain::chain_config_v0::net_usage_leeway

Definition at line 44 of file chain_config.hpp.

◆ target_block_cpu_usage_pct

uint32_t sysio::chain::chain_config_v0::target_block_cpu_usage_pct

Definition at line 49 of file chain_config.hpp.

◆ target_block_net_usage_pct

uint32_t sysio::chain::chain_config_v0::target_block_net_usage_pct

Definition at line 41 of file chain_config.hpp.


The documentation for this struct was generated from the following files: