Expand description
Essential Bitcoin types for consensus validation
Structsยง
- Bip54
Boundary Timestamps - BIP54 timewarp: timestamps of boundary blocks for period-boundary checks.
- Block
- Block: โฌ = โ ร ๐ฏ๐ณ*
- Block
Context - Block validation context
- Block
Hash - Block hash: newtype wrapper for type safety
- Block
Header - Block Header: โ = โค ร โ ร โ ร โ ร โ ร โ
- Block
Height - Block height: newtype wrapper for type safety
- OutPoint
- OutPoint: ๐ช = โ ร โ
- Script
Context - Script execution context
- Shared
Byte String - Shareable script_pubkey for UTXO: small scripts use inline storage; longer use
Arc<[u8]>. Clone is cheap (inline copies up toSHARED_BYTE_INLINE_CAPbytes, shared isArc::clone). Serde matchesByteString. - Time
Context - Time context for consensus validation
- Transaction
- Transaction: ๐ฏ๐ณ = โ ร โ* ร ๐ฏ* ร โ
- Transaction
Input - Transaction Input: โ = ๐ช ร ๐ ร โ
- Transaction
Output - Transaction Output: ๐ฏ = โค ร ๐
- UTXO
- UTXO: ๐ฐ = โค ร ๐ ร โ
Enumsยง
- ForkId
- Stable identifier for each consensus-affecting fork (BIP or soft-fork bundle).
- Network
- Network type for consensus validation
- Validation
Result - Validation result
Constantsยง
- TX_
SLICE_ LARGE_ MAX - TX_
SLICE_ LARGE_ MIN - Inclusive jemalloc-large window that covers the 768KiB / 1.00 / 1.25 / 1.50 MiB classes.
Staticsยง
- ARC_
BLOCKHEADER_ CREATED - Total Arc
heap allocations created (each Arc::new(header) call). Compare to jemalloc bin112 curregs to see how many have been freed. - ARC_
BLOCK_ CREATED - Total Arc
heap allocations created on IBD production paths. Incremented at: download received_put(live + CHUNK_OBSOLETE drain),local_blockgap inject. Test dummies do not increment (not in MEM_REPORT). - BLOCK_
LIVE - Live
Blockvalues created viafrom_parts/ serde /Clone(IBD wire decode - LARGE_
TX_ SLICE_ BYTES - Sum of those large slice heaps (bytes).
- LARGE_
TX_ SLICE_ LIVE - Live
Box<[Transaction]>whose heap size falls in jemalloc 768KiBโ1.5MiB large classes (n_tx * size_of::<Transaction>()). dest-ba 650k bins of 1.00 / 1.25 MiB are this size class (256 B ร 4096 / 5120 txs). - SBS_
SHARED_ LIVE - Live count of SharedByteString instances using heap Arc<u8> (script > 25 bytes). Each live Shared variant holds one Arc heap allocation of (16 + script_len) bytes. If this grows unboundedly it means Arc<u8> script refs are being retained somewhere.
- SBS_
SHARED_ TOTAL - Total Shared variants ever created (never decremented).
Functionsยง
- tx_
slice_ heap_ bytes - utxo_
set_ insert - Insert owned UTXO into UtxoSet (wraps in Arc). Convenience for tests and one-off inserts.
- utxo_
set_ with_ capacity - Pre-allocate a UtxoSet for
nentries. Avoids costly reallocation spikes when loading large checkpoints (at 50M entries the HashMap table alone is ~2.5 GB; a growth-triggered realloc temporarily doubles that).