Expand description
Block validation functions from Orange Paper Section 5.3 Section 5.3
Performance optimizations:
- Parallel transaction validation (production feature)
- Batch UTXO operations
- Assume-Valid Blocks - skip validation for trusted checkpoints
Structs§
- Block
Validation Context - Block validation context: time, network, fork activation, and optional rule data.
- Utxo
Delta Inner - Overlay delta for disk sync. Returned by connect_block_ibd when BLVM_USE_OVERLAY_DELTA=1.
Node converts to SyncBatch and calls apply_sync_batch instead of sync_block_to_batch.
Arc
in additions avoids clone in apply_sync_batch hot path.
Functions§
- apply_
transaction - ApplyTransaction (Orange Paper 5.3.1)
- block_
validation_ context_ for_ connect_ ibd - Forwards to
BlockValidationContext::from_connect_block_ibd_argswith BIP54 activation override and boundary timestamps set toNone. - calculate_
base_ script_ flags_ for_ block_ network - Convenience: base script flags from (height, network) when no context is available (e.g. mempool).
- calculate_
script_ flags_ for_ block_ network - Convenience: script flags from (height, network) when no context is available (e.g. mempool, bench tools).
- calculate_
tx_ id - Calculate transaction ID using proper Bitcoin double SHA256
- compute_
block_ tx_ ids - compute_
block_ tx_ ids_ into - Compute transaction IDs for a block (extracted for reuse). Produces {Hash(tx) : tx ∈ block.transactions} for ComputeMerkleRoot input (Orange Paper 8.4.1). Public so node layer can compute once and share between collect_gaps and connect_block_ibd (#21).
- compute_
block_ tx_ ids_ spec - Compute
{ Hash(tx) : tx ∈ block.transactions }for ComputeMerkleRoot (Orange Paper §8.4.1). - connect_
block - ConnectBlock: ℬ × 𝒲* × 𝒰𝒮 × ℕ × ℋ* → {valid, invalid} × 𝒰𝒮
- connect_
block_ ibd - ConnectBlock variant optimized for IBD that returns transaction IDs instead of undo log.
- get_
assume_ valid_ height