[−][src]Module grin_core::global
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
CHAIN_TYPE |
The mining parameter mode |
POW_CONTEXT_TYPE |
PoW context type to instantiate |
Enums
ChainTypes |
Types of chain a server can run with, dictates the genesis block and and mining parameters used. |
PoWContextTypes |
PoW test mining and verifier context |
Constants
AUTOMATED_TESTING_COINBASE_MATURITY |
Automated testing coinbase maturity |
AUTOMATED_TESTING_MIN_EDGE_BITS |
Define these here, as they should be developer-set, not really tweakable by users Automated testing edge_bits |
AUTOMATED_TESTING_PROOF_SIZE |
Automated testing proof size |
COMPACTION_CHECK |
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. |
PEER_EXPIRATION_REMOVE_TIME |
Constant that expresses defunct peer timeout in seconds to be used in checks. |
STUCK_PEER_KICK_TIME |
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 |
Testing cut through horizon in blocks |
TESTING_INITIAL_DIFFICULTY |
Testing initial block difficulty |
TESTING_INITIAL_GRAPH_WEIGHT |
Testing initial graph weight |
TESTNET2_INITIAL_DIFFICULTY |
Testnet 2 initial block difficulty, high to see how it goes |
TESTNET3_INITIAL_DIFFICULTY |
Testnet 3 initial block difficulty, moderately high, taking into account a 30x Cuckoo adjustment factor |
TESTNET4_INITIAL_DIFFICULTY |
Testnet 4 initial block difficulty 1_000 times natural scale factor for cuckatoo29 |
USER_TESTING_COINBASE_MATURITY |
User testing coinbase maturity |
USER_TESTING_MIN_EDGE_BITS |
User testing edge_bits |
USER_TESTING_PROOF_SIZE |
User testing proof size |
Functions
base_edge_bits |
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. |
coinbase_maturity |
Coinbase maturity for coinbases to be spent |
create_pow_context |
Return either a cuckoo context or a cuckatoo context Single change point |
cut_through_horizon |
Horizon at which we can cut-through and do full local pruning |
difficulty_data_to_vector |
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_genesis_nonce |
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 |
initial_block_difficulty |
Initial mining difficulty |
initial_graph_weight |
Initial mining secondary scale |
is_automated_testing_mode |
Are we in automated testing mode? |
is_production_mode |
Are we in production mode (a live public network)? |
is_user_testing_mode |
Are we in user testing mode? |
min_edge_bits |
The minimum acceptable edge_bits |
pow_type |
Return the type of the pos |
proofsize |
The proofsize |
set_mining_mode |
Set the mining mode |