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§
- GLOBAL_
ACCEPT_ FEE_ BASE - Global acccept fee base that must be initialized once on node startup. This is accessed via get_acccept_fee_base() which allows the global value to be overridden on a per-thread basis (for testing).
- GLOBAL_
CHAIN_ TYPE - Global chain_type that must be initialized once on node startup. This is accessed via get_chain_type() which allows the global value to be overridden on a per-thread basis (for testing).
- GLOBAL_
FUTURE_ TIME_ LIMIT - Global future time limit that must be initialized once on node startup. This is accessed via get_future_time_limit() which allows the global value to be overridden on a per-thread basis (for testing).
- GLOBAL_
NRD_ FEATURE_ ENABLED - Global feature flag for NRD kernel support. If enabled NRD kernels are treated as valid after HF3 (based on header version). If disabled NRD kernels are invalid regardless of header version or block height.
Enums§
- Chain
Types - Types of chain a server can run with, dictates the genesis block and and mining parameters used.
Constants§
- ACCEPT_
FEE_ BASE - minimum transaction fee per unit of transaction weight for mempool acceptance
- AUTOMATED_
TESTING_ COINBASE_ MATURITY - Automated testing coinbase maturity
- AUTOMATED_
TESTING_ CUT_ THROUGH_ HORIZON - Testing cut through horizon in blocks
- AUTOMATED_
TESTING_ MIN_ EDGE_ BITS - Automated testing edge_bits
- AUTOMATED_
TESTING_ PROOF_ SIZE - Automated testing proof size
- CHAIN_
TYPE - Mainnet|Testnet|UserTesting|AutomatedTesting
- 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.
- DEFAULT_
ACCEPT_ FEE_ BASE - Default unit of fee per tx weight, making each output cost about a Grincent
- DEFAULT_
FUTURE_ TIME_ LIMIT - default Future Time Limit (FTL) of 5 minutes
- FUTURE_
TIME_ LIMIT - maximum number of seconds into future for timestamp of block to be acceptable
- NRD_
FEATURE_ ENABLED - Local feature flag for NRD kernel support.
- PEER_
EXPIRATION_ REMOVE_ TIME - Constant that expresses defunct peer timeout in seconds to be used in checks.
- PROTOCOL_
VERSION - An enum collecting sets of parameters used throughout the code wherever mining is needed. This should allow for different sets of parameters for different purposes, e.g. CI, User testing, production values 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.
- 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_
INITIAL_ DIFFICULTY - Testing initial block difficulty
- TESTING_
MAX_ BLOCK_ WEIGHT - Testing max_block_weight (artifically low, just enough to support a few txs).
- TESTING_
STATE_ SYNC_ THRESHOLD - Testing state sync threshold in blocks
- TESTING_
TXHASHSET_ ARCHIVE_ INTERVAL - Number of blocks to reuse a txhashset zip for (automated testing and user testing).
- TXHASHSET_
ARCHIVE_ INTERVAL - Number of blocks to reuse a txhashset zip for.
- USER_
TESTING_ COINBASE_ MATURITY - User testing coinbase maturity
- USER_
TESTING_ CUT_ THROUGH_ HORIZON - Testing cut through horizon in blocks
- 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 cuckaroo* 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_
accept_ fee_ base - Accept Fee Base Look at thread local config first. If not set fallback to global config. Default to grin-cent/20 if global config unset.
- get_
chain_ type - Get the chain type via thread_local, fallback to global chain_type.
- get_
future_ time_ limit - Future Time Limit (FTL) Look at thread local config first. If not set fallback to global config. Default to false if global config unset.
- get_
genesis_ block - Return genesis block for the active chain type
- header_
size_ bytes - Calculates the size of a header (in bytes) given a number of edge bits in the PoW
- init_
global_ accept_ fee_ base - One time initialization of the global accept fee base Will panic if we attempt to re-initialize this (via OneTime).
- init_
global_ chain_ type - One time initialization of the global chain_type. Will panic if we attempt to re-initialize this (via OneTime).
- init_
global_ future_ time_ limit - One time initialization of the global future time limit Will panic if we attempt to re-initialize this (via OneTime).
- init_
global_ nrd_ enabled - One time initialization of the global NRD feature flag. Will panic if we attempt to re-initialize this (via OneTime).
- initial_
block_ difficulty - Initial mining difficulty
- initial_
graph_ weight - Initial mining secondary scale
- is_
nrd_ enabled - Is the NRD feature flag enabled? Look at thread local config first. If not set fallback to global config. Default to false if global config unset.
- is_
production_ mode - Are we in production mode? Production defined as a live public network, testnet[n] or mainnet.
- is_
testnet - Are we in testnet? 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.
- max_
block_ weight - Maximum allowed block weight.
- max_
tx_ weight - Maximum allowed transaction weight (1 weight unit ~= 32 bytes)
- min_
edge_ bits - The minimum acceptable edge_bits
- min_
wtema_ graph_ weight - Minimum valid graph weight post HF4
- proofsize
- The proofsize
- set_
global_ accept_ fee_ base - The global accept fee base may be reset using override.
- set_
global_ chain_ type - Set the global chain_type using an override
- set_
global_ future_ time_ limit - The global future time limit may be reset again using the override
- set_
global_ nrd_ enabled - Set the global NRD feature flag using override.
- set_
local_ accept_ fee_ base - Set the accept fee base on a per-thread basis via thread_local storage.
- set_
local_ chain_ type - Set the chain type on a per-thread basis via thread_local storage.
- set_
local_ future_ time_ limit - Set the future time limit on a per-thread basis via thread_local storage.
- set_
local_ nrd_ enabled - Explicitly enable the local NRD feature flag.
- state_
sync_ threshold - Threshold at which we can request a txhashset (and full blocks from)
- txhashset_
archive_ interval - Number of blocks to reuse a txhashset zip for.