Skip to main content

Module block

Module block 

Source
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§

BlockValidationContext
Block validation context: time, network, fork activation, and optional rule data.
UtxoDeltaInner
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_args with BIP54 activation override and boundary timestamps set to None.
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

Type Aliases§

UtxoDelta