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§
- CHAINID
- node chain id (to avoid replay attacks)
- END_
TIMESTAMP - TESTNET: time when the blockclique is ended.
- GENESIS_
KEY KeyPairto sign genesis blocks.- GENESIS_
TIMESTAMP - 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
- POS_
MISS_ RATE_ DEACTIVATION_ THRESHOLD - number of cycle misses (strictly) above which stakers are deactivated
- VERSION
- node version
Constants§
- ASYNC_
MSG_ CST_ GAS_ COST - Constant cost applied to asynchronous messages (to take into account some costs related to snapshot)
- BASE_
OPERATION_ GAS_ COST - Gas used by a base operation (transaction, roll buy, roll sell)
- BLOCK_
REWARD - Block reward is given for each block creation
- BOOTSTRAP_
BATCH_ ENTRY_ OVERHEAD - Rough in-memory cost of one
(key, value)entry of a received bootstrap batch, on top of the bytes it carries: theBTreeMapnode slot it occupies, the twoVecheaders, and allocator rounding. Deliberately an over-estimate, so that the budget below is reached before the allocator actually is. - BOOTSTRAP_
MESSAGE_ LEN_ PREFIX_ MAX - Bound the bootstrap message length prefix is encoded against, in both directions.
- BOOTSTRAP_
MESSAGE_ LEN_ PREFIX_ SIZE_ BYTES - The number of bytes needed to encode
BOOTSTRAP_MESSAGE_LEN_PREFIX_MAX - BOOTSTRAP_
RANDOMNESS_ SIZE_ BYTES - Size of the random bytes array used for the bootstrap, safe to import
- CHANNEL_
SIZE - 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 - COMMUNITY_
CHARTER_ CONTENT - Massa Community charter content
- CONSENSUS_
BOOTSTRAP_ PART_ SIZE - Maximum number of consensus blocks in a bootstrap batch
- DEFERRED_
CALL_ BASE_ FEE_ MAX_ CHANGE_ DENOMINATOR - max change denominator
- DEFERRED_
CALL_ CST_ GAS_ COST - deferred call call gas cost
- DEFERRED_
CALL_ GLOBAL_ OVERBOOKING_ PENALTY - deferred call global overbooking penalty
- DEFERRED_
CALL_ MAX_ ASYNC_ GAS - maximum gas for deferred call
- DEFERRED_
CALL_ MAX_ FUTURE_ SLOTS - Maximum size of deferred call future slots (1 week)
- DEFERRED_
CALL_ MAX_ POOL_ CHANGES - Maximum size of deferred call pool changes
- DEFERRED_
CALL_ MIN_ GAS_ COST - deferred call min gas cost (10 nanomassa)
- DEFERRED_
CALL_ MIN_ GAS_ INCREMENT - deferred call min gas increment (1 nanomassa)
- DEFERRED_
CALL_ SLOT_ OVERBOOKING_ PENALTY - deferred call slot overbooking penalty
- DELTA_
F0 - Threshold for fitness.
- DENUNCIATION_
EXPIRE_ PERIODS - denunciation expiration delta
- ENDORSEMENT_
COUNT - Number of endorsement
- HANDSHAKE_
RANDOMNESS_ SIZE_ BYTES - Length of the handshake random signature
- INITIAL_
DRAW_ SEED - Proof of stake seed for the initial draw
- IP_
LIST_ MAX_ SIZE - Max size of the IP list
- KEEP_
EXECUTED_ HISTORY_ EXTRA_ PERIODS - Number of periods of executed operation and denunciation history to keep
- LEDGER_
COST_ PER_ BYTE - Cost to store one byte in the ledger
- LEDGER_
ENTRY_ BASE_ COST - Cost for a base entry default 0.01 MASSA
- LEDGER_
ENTRY_ DATASTORE_ BASE_ SIZE - Base size of a empty datastore entry (not counting the key nor the value)
- MAX_
ADVERTISE_ LENGTH - Limit on the number of peers we advertise to others.
- MAX_
ASYNC_ GAS - 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. - MAX_
ASYNC_ POOL_ LENGTH - Maximum capacity of the asynchronous messages pool
- MAX_
BLOCK_ SIZE - Maximum block size in bytes
- MAX_
BOOTSTRAP_ ASYNC_ POOL_ CHANGES - Max async pool changes
- MAX_
BOOTSTRAP_ BLOCKS - Max number of blocks we provide/ take into account while bootstrapping
- MAX_
BOOTSTRAP_ CHILDREN - Max number of child nodes
- MAX_
BOOTSTRAP_ CLIQUES - max bootstrapped cliques
- MAX_
BOOTSTRAP_ DEPS - max bootstrapped dependencies
- MAX_
BOOTSTRAP_ ERROR_ LENGTH - Max size of the printed error
- MAX_
BOOTSTRAP_ FINAL_ STATE_ PARTS_ SIZE - Max bytes in final states parts
- MAX_
BOOTSTRAP_ MESSAGE_ FROM_ CLIENT_ SIZE - 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.
- MAX_
BOOTSTRAP_ MESSAGE_ FROM_ SERVER_ SIZE - Max message size for bootstrap Note: Update sizes are not limited, the 190Mb constant is to take them into account.
- MAX_
BOOTSTRAP_ MESSAGE_ FROM_ SERVER_ SIZE_ BYTES - The number of bytes needed to encode
MAX_BOOTSTRAP_MESSAGE_FROM_SERVER_SIZE - MAX_
BOOTSTRAP_ POS_ CYCLES - Max number of cycles in PoS bootstrap
- MAX_
BOOTSTRAP_ VERSIONING_ ELEMENTS_ SIZE - Max bytes in final states parts
- MAX_
BYTECODE_ LENGTH - Maximum length of a smart contract bytecode
- MAX_
CONSENSUS_ BLOCKS_ IDS - Max block ids in the client consensus reconnect ask. Larger local graphs are fine in-session; only the ask is capped (newest finals), and the graph is pruned to match on reconnect.
- MAX_
DATASTORE_ ENTRY_ COUNT - Maximum number of key/values in the datastore of a ledger entry
- MAX_
DATASTORE_ KEY_ LENGTH - Maximum length of a datastore key
- MAX_
DATASTORE_ VALUE_ LENGTH - Maximum length of a datastore value
- MAX_
DEFERRED_ CREDITS_ LENGTH - Maximum size proof-of-stake deferred credits
- MAX_
DENUNCIATIONS_ PER_ BLOCK_ HEADER - Max number of denunciations that can be included in a block header
- MAX_
DENUNCIATION_ CHANGES_ LENGTH - Maximum size of executed denunciations
- MAX_
DUPLEX_ BUFFER_ SIZE - max duplex buffer size
- MAX_
ENDORSEMENTS_ PER_ MESSAGE - Max number of endorsements per message
- MAX_
ENDORSEMENTS_ PER_ SLOT_ INDEX - Maximum number of endorsements kept for a given
(slot, index)draw, whatever the endorsed block is. Enforced both by the endorsement pool and by the protocol propagation path, which share this bound so that neither becomes the tighter of the two. - MAX_
EVENT_ DATA_ SIZE - Maximum event size in bytes
- MAX_
EVENT_ DATA_ SIZE_ V0 - Maximum event size in bytes
- MAX_
EVENT_ PER_ OPERATION - Maximum event number that can be emitted for an operation
- MAX_
EXECUTED_ OPS_ CHANGES_ LENGTH - Maximum size of executed ops changes
- MAX_
EXECUTED_ OPS_ LENGTH - Maximum size of executed ops
- MAX_
FUNCTION_ NAME_ LENGTH - Maximum length function name in call SC
- MAX_
GAS_ PER_ BLOCK - Maximum of GAS allowed for a block
- MAX_
LEDGER_ CHANGES_ COUNT - Maximum ledger changes count
- MAX_
LEDGER_ CHANGES_ PER_ SLOT - Maximum ledger changes in a block
- MAX_
LISTENERS_ PER_ PEER - Maximum number of listeners for a peer
- MAX_
MESSAGE_ SIZE - Maximum message length in bytes
- MAX_
OPERATIONS_ COUNT_ PREFIX_ SIZE - Maximum size in bytes of the varint prefix holding the number of operations of a serialized
operation list. That count is a
u32varint, and a varint carries 7 bits of payload per byte, henceceil(32 / 7) = 5bytes at most. - MAX_
OPERATIONS_ PER_ BLOCK - Maximum number of operations per block
- MAX_
OPERATIONS_ PER_ MESSAGE - Max number of operations per message
- MAX_
OPERATION_ DATASTORE_ ENTRY_ COUNT - Maximum number of key/values in the datastore of a
ExecuteSCoperation - MAX_
OPERATION_ DATASTORE_ KEY_ LENGTH - Maximum length of an operation datastore key
- MAX_
OPERATION_ DATASTORE_ VALUE_ LENGTH - Maximum length of an operation datastore value
- MAX_
OPERATION_ STORAGE_ TIME - Maximum of time we keep the operations in the storage of the propagation thread
- MAX_
PARAMETERS_ SIZE - Maximum size of parameters in call SC
- MAX_
PEERS_ IN_ ANNOUNCEMENT_ LIST - Maximum number of peer in a announcement list of peer
- MAX_
PRODUCTION_ EVENTS_ PER_ BLOCK - Maximum production events in a block
- MAX_
PRODUCTION_ STATS_ LENGTH - Maximum size of proof-of-stake production stats
- MAX_
RECURSIVE_ CALLS_ DEPTH - Maximum number of recursion for calls
- MAX_
RNG_ SEED_ LENGTH - Maximum length of
rng_seedin thread cycle - MAX_
ROLLS_ COUNT_ LENGTH - Maximum size of proof-of-stake rolls
- MAX_
RUNTIME_ MODULE_ CUSTOM_ SECTION_ DATA_ LEN - Maximum length for the custom section data
- MAX_
RUNTIME_ MODULE_ CUSTOM_ SECTION_ LEN - Maximum number of custom section data
- MAX_
RUNTIME_ 🔒MODULE_ DEFINED_ FUNCTIONS - CondomMiddleware limits see test_condom_middleware_calibrate in massa-sc-runtime for origin of values. Maximum number of function defined in a smart contract
- MAX_
RUNTIME_ MODULE_ EXPORTS - Maximum number of exports for a smart contract module (function and globals)
- MAX_
RUNTIME_ MODULE_ FUNCTIONS - Maximum number of function used by a smart contract
- MAX_
RUNTIME_ 🔒MODULE_ FUNCTION_ ARGS - Maximum number of arguments to a function
- MAX_
RUNTIME_ 🔒MODULE_ FUNCTION_ IMPORTS - Maximum number of functions a module can import
- MAX_
RUNTIME_ MODULE_ FUNCTION_ NAME_ LEN - Maximum length for the name of a function defined in a smart contract
- MAX_
RUNTIME_ 🔒MODULE_ FUNCTION_ RETURN_ VALUES - Maximum number of value a function can return
- MAX_
RUNTIME_ MODULE_ GLOBAL_ INITIALIZER - Maximum number of global initializer in a smart contract
- MAX_
RUNTIME_ MODULE_ IMPORTS - Maximum number of elements a module can import
- MAX_
RUNTIME_ MODULE_ MEMORIES - Maximum number of memories in a smart contract
- MAX_
RUNTIME_ 🔒MODULE_ MEMORY_ IMPORTS - Maximum number of memory a module can import
- MAX_
RUNTIME_ MODULE_ NAME_ LEN - Maximum length for the name of a smart contract
- MAX_
RUNTIME_ MODULE_ PASSIVE_ DATA - Maximum number of passive data in a smart contract
- MAX_
RUNTIME_ MODULE_ PASSIVE_ ELEMENT - Maximum number of passive element in a smart contract
- MAX_
RUNTIME_ MODULE_ SIGNATURE_ LEN - Maximum signature length (total number of arguments and return values) for a function of a smart contract module
- MAX_
RUNTIME_ MODULE_ TABLE - Maximum number of table in a smart contract
- MAX_
RUNTIME_ MODULE_ TABLE_ INITIALIZER - Maximum number of table initializer in a smart contract
- MAX_
SIZE_ CHANNEL_ COMMANDS_ CONNECTIVITY - Maximum size of channel used for commands in connectivity thread
- MAX_
SIZE_ CHANNEL_ COMMANDS_ PEERS - Maximum size of channel used for commands in peers management thread
- MAX_
SIZE_ CHANNEL_ COMMANDS_ PEER_ TESTERS - Maximum size of channel used for commands in peer testers thread
- MAX_
SIZE_ CHANNEL_ COMMANDS_ PROPAGATION_ BLOCKS - Maximum size of channel used for commands in propagation thread of block
- MAX_
SIZE_ CHANNEL_ COMMANDS_ PROPAGATION_ ENDORSEMENTS - Maximum size of channel used for commands in propagation thread of endorsements
- MAX_
SIZE_ CHANNEL_ COMMANDS_ PROPAGATION_ OPERATIONS - Maximum size of channel used for commands in propagation thread of operations
- MAX_
SIZE_ CHANNEL_ COMMANDS_ RETRIEVAL_ BLOCKS - Maximum size of channel used for commands in retrieval thread of block
- MAX_
SIZE_ CHANNEL_ COMMANDS_ RETRIEVAL_ ENDORSEMENTS - Maximum size of channel used for commands in retrieval thread of endorsements
- MAX_
SIZE_ CHANNEL_ COMMANDS_ RETRIEVAL_ OPERATIONS - Maximum size of channel used for commands in retrieval thread of operations
- MAX_
SIZE_ CHANNEL_ NETWORK_ TO_ BLOCK_ HANDLER - Maximum size of channel used to send network events to the block handler
- MAX_
SIZE_ CHANNEL_ NETWORK_ TO_ ENDORSEMENT_ HANDLER - Maximum size of channel used to send network events to the endorsement handler
- MAX_
SIZE_ CHANNEL_ NETWORK_ TO_ OPERATION_ HANDLER - Maximum size of channel used to send network events to the operation handler
- MAX_
SIZE_ CHANNEL_ NETWORK_ TO_ PEER_ HANDLER - Maximum size of channel used to send network events to the peer handler
- MIN_
EXPECTED_ BOOTSTRAP_ ELEMENT_ WIRE_ SIZE - Smallest wire size a real
(key, value)entry of a bootstrap batch is expected to have. - MIP_
STORE_ STATS_ BLOCK_ CONSIDERED - Block count to process in MipStoreStats (for state change threshold)
- NETWORK_
CONTROLLER_ CHANNEL_ SIZE - network controller communication channel size
- NETWORK_
EVENT_ CHANNEL_ SIZE - network event channel size
- NETWORK_
NODE_ COMMAND_ CHANNEL_ SIZE - network node command channel size
- NETWORK_
NODE_ EVENT_ CHANNEL_ SIZE - network node event channel size
- NODE_
SEND_ CHANNEL_ SIZE - node send channel size
- OPERATION_
VALIDITY_ PERIODS - Maximum operation validity period count
- PERIODS_
PER_ CYCLE - cycle duration in periods
- POS_
SAVED_ CYCLES - Number of cycles saved in
PoSFinalState - PROTOCOL_
CONTROLLER_ CHANNEL_ SIZE - Protocol controller channel size
- PROTOCOL_
EVENT_ CHANNEL_ SIZE - Protocol event channel size
- ROLL_
COUNT_ TO_ SLASH_ ON_ DENUNCIATION - Number of roll to remove per denunciation
- ROLL_
PRICE - Price of a roll in the network
- SELECTOR_
DRAW_ CACHE_ SIZE - Number of cycle draws saved in the selector cache
- SIGNATURE_
DESER_ SIZE - IMPORTANNT TODO: should be removed after the bootstrap messages refacto
- T0
- Time between the periods in the same thread.
- THREAD_
COUNT - Number of threads
- VERSIONING_
ACTIVATION_ DELAY_ MIN - Minimum value allowed for activation delay (in MIP info)
- VERSIONING_
THRESHOLD_ TRANSITION_ ACCEPTED - Threshold to accept a new versioning
Functions§
- bootstrap_
batch_ allocation_ budget - Budget for the in-memory footprint of one received bootstrap batch section, derived from the wire size that section is already bounded by.
- get_
period_ from_ args - Helper function to parse args for lazy_static evaluations
- operations_
payload_ size - Size of the serialized operation list holding operations of aggregate size
operations_size: the operations themselves, plus the varint prefix holding their count. Use it to turn an operations size budget (such asmax_serialized_operations_size_per_block) into the payload size a peer is allowed to send us.