Module stack_test_epic_core::global
source · [−]Expand description
Values that should be shared across all modules, without necessarily having to pass them all over the place, but aren’t consensus values. should be used sparingly.
Structs
The mining parameter mode
Store the current epic version being executed
The path to the file that contains the foundation
Store the timeout for the header sync
The policy parameters
PoW context type to instantiate
Strcut that store the major and minor release versions
Enums
Types of chain a server can run with, dictates the genesis block and and mining parameters used.
PoW test mining and verifier context
Constants
Automated testing coinbase maturity
Automated testing edge_bits
Automated testing proof size
Trigger compaction check on average every day for all nodes. Randomized per node - roll the dice on every block to decide. Will compact the txhashset to remove pruned data. Will also remove old blocks and associated data from the database. For a node configured as “archival_mode = true” only the txhashset will be compacted.
Foonet coinbase maturity
Constant that expresses defunct peer timeout in seconds to be used in checks.
Define these here, as they should be developer-set, not really tweakable by users The default “local” protocol version for this node. We negotiate compatible versions with each peer via Hand/Shake. Note: We also use a specific (possible different) protocol version for both the backend database and MMR data files. This defines the p2p layer protocol version for this node.
If a peer’s last updated difficulty is 2 hours ago and its difficulty’s lower than ours, we’re sure this peer is a stuck node, and we will kick out such kind of stuck peers.
Testing cut through horizon in blocks
Testing initial block difficulty
Testing initial graph weight
Testing max_block_weight (artifically low, just enough to support a few txs).
Testing state sync threshold in blocks
Number of blocks to reuse a txhashset zip for (automated testing and user testing).
Number of blocks to reuse a txhashset zip for.
User testing coinbase maturity
User testing edge_bits
User testing proof size
Functions
Reference edge_bits used to compute factor on higher Cuck(at)oo graph sizes, while the min_edge_bits can be changed on a soft fork, changing base_edge_bits is a hard fork.
Short name representing the current chain type (“floo”, “main”, etc.)
Coinbase maturity for coinbases to be spent
Return either a cuckoo context or a cuckatoo context Single change point
Horizon at which we can cut-through and do full local pruning
Converts an iterator of block difficulty data to more a more manageable vector and pads if needed (which will) only be needed for the first few blocks after genesis
Get the version of the current epic executable
Get the current path to the foundation.json file (file with the foundation wallet outputs/kernels)
Helper function to get a nonce known to create a valid POW on the genesis block, to prevent it taking ages. Should be fine for now as the genesis block POW solution turns out to be the same for every new block chain at the moment
Get the current Timeout without the verification of the existence of more headers to be synced, after all header were processed
Get the policy configuration that is being used by the blockchain
Initial mining difficulty
Initial mining secondary scale
Are we in automated testing mode?
Are we in floonet? Note: We do not have a corresponding is_mainnet() as we want any tests to be as close as possible to “mainnet” configuration as possible. We want to avoid missing any mainnet only code paths.
Are we for real?
Are we in production mode? Production defined as a live public network, testnet[n] or mainnet.
Are we in user testing mode?
Maximum allowed block weight.
The minimum acceptable edge_bits
The proofsize
Set the version of the current epic executable
Set the path to the foundation.json file (file with the foundation wallet outputs/kernels)
Set the current Timeout without the verification of the existence of more headers to be synced, after all header were processed
Set the mining mode
Set the policy configuration that will be used by the blockchain
Threshold at which we can request a txhashset (and full blocks from)
Number of blocks to reuse a txhashset zip for.
Check if the foundation.json exists in the directory appointed by the .toml file, if not, use the alternative path ../../debian/foundation.json relative to the folder where the executable is in. If we are running floonet, it will look for the file foundation_floonet.json .