Module massa_models::config::constants
source · Expand description
DEFAULT VALUES USED TO INITIALIZE DIVERS CONFIGURATIONS STRUCTURES
§Default hard-coded
Each crates may contains a settings.rs or a config.rs the Default
implementation of each object take the default Values from the following
file.
These values are the hard-coded values that make sens to never be modified
by a user. Generally, this values are passed with dependency injection in a cfg
parameter for each worker, that is convenient for unit tests.
A parallel file with the same constant definitions exist for the testing case.
(default_testing.rs) But as for the current file you shouldn’t modify it.
Structs§
- node chain id (to avoid replay attacks)
- TESTNET: time when the blockclique is ended.
KeyPairto sign genesis blocks.- Time in milliseconds when the blockclique started. In sandbox mode, the value depends on starting time and on the –restart-from-snapshot-at-period argument in CLI, so that the network starts or restarts 10 seconds after launch
- number of cycle misses (strictly) above which stakers are deactivated
- node version
Constants§
- Constant cost applied to asynchronous messages (to take into account some costs related to snapshot) Counted against the slot’s async gas budget on top of the message’s own
max_gas. - Gas used by a base operation (transaction, roll buy, roll sell)
- Block reward is given for each block creation
- Size of the random bytes array used for the bootstrap, safe to import
- Consensus static parameters (defined by protocol used) Changing one of the following values is considered as a breaking change Values differ in
testflavor building for faster CI and simpler scenarios - Massa Community charter content
- Maximum number of consensus blocks in a bootstrap batch
- max change denominator
- deferred call call gas cost
- deferred call global overbooking penalty
- maximum gas for deferred call
- Maximum size of deferred call future slots (1 week)
- Maximum size of deferred call pool changes
- deferred call min gas cost (10 nanomassa)
- deferred call min gas increment (1 nanomassa)
- deferred call slot overbooking penalty
- Threshold for fitness.
- denunciation expiration delta
- Number of endorsement
- Length of the handshake random signature
- Proof of stake seed for the initial draw
- Max size of the IP list
- Number of periods of executed operation and denunciation history to keep
- Cost to store one byte in the ledger
- Cost for a base entry default 0.01 MASSA
- Base size of a empty datastore entry (not counting the key nor the value)
- Limit on the number of peers we advertise to others.
- Base GAS budget for asynchronous messages execution on one slot. This is not a strict per-slot cap: since MIP-0001,
execute_slottops this budget up with the gas left unused by the block at that slot (and subtracts the gas booked by deferred calls), so async execution can exceed this value on underfilled slots. The bound that always holds isMAX_GAS_PER_BLOCK + MAX_ASYNC_GASfor the whole slot. That same bound caps what an async message may ever request: thesend_messageABI enforces no upper bound onmax_gas, so a message asking for more thanMAX_GAS_PER_BLOCK + MAX_ASYNC_GAS - ASYNC_MSG_CST_GAS_COSTis accepted but can never be scheduled, and forfeits its fee when it expires. - Maximum capacity of the asynchronous messages pool
- Maximum block size in bytes
- Max async pool changes
- Max number of blocks we provide/ take into account while bootstrapping
- Max number of child nodes
- max bootstrapped cliques
- max bootstrapped dependencies
- Max size of the printed error
- Max bytes in final states parts
- Max message size for bootstrap coming from client The worst case is a AskBootstrapPart with mostly 2 keys and MAX_CONSENSUS_BLOCKS_IDS blocks_ids.
- The number of bytes needed to encode
MAX_BOOTSTRAP_MESSAGE_FROM_CLIENT_SIZE - Max message size for bootstrap Note: Update sizes are not limited, the 190Mb constant is to take them into account.
- The number of bytes needed to encode [
MAX_BOOTSTRAP_MESSAGE_SIZE] - Max number of cycles in PoS bootstrap
- Max bytes in final states parts
- Maximum length of a datastore value
- Maximum number of consensus block ids when sending a bootstrap cursor from the client
- Maximum number of key/values in the datastore of a ledger entry
- Maximum length of a datastore key
- Maximum length of a datastore value
- Maximum size proof-of-stake deferred credits
- Max number of denunciations that can be included in a block header
- Maximum size of executed denunciations
- max duplex buffer size
- Max number of endorsements per message
- Maximum event size in bytes
- Maximum event size in bytes
- Maximum event number that can be emitted for an operation
- Maximum size of executed ops changes
- Maximum size of executed ops
- Maximum length function name in call SC
- Maximum of GAS allowed for a block
- Maximum ledger changes count
- Maximum ledger changes in a block
- Maximum number of listeners for a peer
- Maximum message length in bytes
- Maximum number of operations per block
- Max number of operations per message
- Maximum number of key/values in the datastore of a
ExecuteSCoperation - Maximum length of an operation datastore key
- Maximum length of an operation datastore value
- Maximum of time we keep the operations in the storage of the propagation thread
- Maximum size of parameters in call SC
- Maximum number of peer in a announcement list of peer
- Maximum production events in a block
- Maximum size of proof-of-stake production stats
- Maximum number of recursion for calls
- Maximum length of
rng_seedin thread cycle - Maximum size of proof-of-stake rolls
- Maximum length for the custom section data
- Maximum number of custom section data
- CondomMiddleware limits see test_condom_middleware_calibrate in massa-sc-runtime for origin of values. Maximum number of function defined in a smart contract
- Maximum number of exports for a smart contract module (function and globals)
- Maximum number of function used by a smart contract
- Maximum number of arguments to a function
- Maximum number of functions a module can import
- Maximum length for the name of a function defined in a smart contract
- Maximum number of value a function can return
- Maximum number of global initializer in a smart contract
- Maximum number of elements a module can import
- Maximum number of memories in a smart contract
- Maximum number of memory a module can import
- Maximum length for the name of a smart contract
- Maximum number of passive data in a smart contract
- Maximum number of passive element in a smart contract
- Maximum signature length (total number of arguments and return values) for a function of a smart contract module
- Maximum number of table in a smart contract
- Maximum number of table initializer in a smart contract
- Maximum size of channel used for commands in connectivity thread
- Maximum size of channel used for commands in peers management thread
- Maximum size of channel used for commands in peer testers thread
- Maximum size of channel used for commands in propagation thread of block
- Maximum size of channel used for commands in propagation thread of endorsements
- Maximum size of channel used for commands in propagation thread of operations
- Maximum size of channel used for commands in retrieval thread of block
- Maximum size of channel used for commands in retrieval thread of endorsements
- Maximum size of channel used for commands in retrieval thread of operations
- Maximum size of channel used to send network events to the block handler
- Maximum size of channel used to send network events to the endorsement handler
- Maximum size of channel used to send network events to the operation handler
- Maximum size of channel used to send network events to the peer handler
- Block count to process in MipStoreStats (for state change threshold)
- network controller communication channel size
- network event channel size
- network node command channel size
- network node event channel size
- node send channel size
- Maximum operation validity period count
- cycle duration in periods
- Number of cycles saved in
PoSFinalState - Protocol controller channel size
- Protocol event channel size
- Number of roll to remove per denunciation
- Price of a roll in the network
- Number of cycle draws saved in the selector cache
- IMPORTANNT TODO: should be removed after the bootstrap messages refacto
- Time between the periods in the same thread.
- Number of threads
- Minimum value allowed for activation delay (in MIP info)
- Threshold to accept a new versioning
Functions§
- Helper function to parse args for lazy_static evaluations