Skip to main content

Module constants

Module constants 

Source
Expand description

Protocol-wide limits and sentinel values for the DIG L2 block format.

Requirement: BLK-005 / NORMATIVE § BLK-005 / SPEC §2.11 (protocol constants).

Rationale: Centralizing these values avoids magic numbers in validation (crate::validation), builders (crate::builder), and hashing (crate::hash). Limits are chosen to bound worst-case block work (cost, size) and slash-proposal abuse while staying aligned with mainnet-style CLVM budgets.

Types: Numeric limits use the widths required by BLK-005 (u32 for byte/count caps, u64 for height/timestamp fields). Cost and Bytes32 are defined in crate::primitives (BLK-006).

Constants§

DFSP_ACTIVATION_HEIGHT
Block height at which DFSP (decentralized fraud/slashing protocol) features activate.
EMPTY_ROOT
Digest of the empty byte string, i.e. SHA-256 of "".
HASH_LEAF_PREFIX
Domain-separation prefix for Merkle leaf nodes (0x01).
HASH_TREE_PREFIX
Domain-separation prefix for Merkle internal nodes (0x02).
MAX_BLOCK_SIZE
Maximum serialized block size in bytes (10 MiB).
MAX_COST_PER_BLOCK
CLVM execution budget allowed in a single block.
MAX_FUTURE_TIMESTAMP_SECONDS
Maximum allowed block timestamp skew into the future (seconds).
MAX_SLASH_PROPOSALS_PER_BLOCK
Upper bound on slash-proposal payloads included in one block.
MAX_SLASH_PROPOSAL_PAYLOAD_BYTES
Maximum size of a single slash-proposal payload in bytes (64 KiB).
ZERO_HASH
32 zero bytes — a distinct sentinel from EMPTY_ROOT.