Skip to main content

Module block

Module block 

Source

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<UTXO> in additions avoids clone in apply_sync_batch hot path.

Functions§

apply_transaction
ApplyTransaction (Orange Paper 5.3.2)
block_header_hash
Double-SHA256 hash of an 80-byte serialized block header (Bitcoin block id).
block_validation_context_for_connect_ibd
Forwards to BlockValidationContext::from_connect_block_ibd_args with no BIP54 activation override and no boundary timestamps. Does not invent time or headers; pass the same values you would pass to the underlying constructor.
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.
connect_block_ibd_with_undo
Like connect_block_ibd but also returns the undo log for reorg support after IBD.
connect_block_with_chainwork
ConnectBlock with explicit chainwork for assume-valid gating. Non-IBD mode: the returned UtxoSet is fully updated (outputs added, inputs removed) just like connect_block. The only difference from connect_block is that best_header_chainwork is forwarded to the assume-valid gate so scripts are skipped when height < assume_valid_height.
get_assume_valid_height
get_block_script_flags
Orange Paper §5.2.6: exception table wins when defined; otherwise per-tx CalculateScriptFlags.
get_block_script_verify_flags_core
Bitcoin Core GetBlockScriptFlags (validation.cpp): start from SCRIPT_VERIFY_P2SH | SCRIPT_VERIFY_WITNESS | SCRIPT_VERIFY_TAPROOT, replace with the script-flag exception entry when present, then OR buried deployments (BIP66, BIP65, CSV, BIP147-at-SegWit). Same block-level bitmask is passed to script checks for every non-coinbase transaction.
script_flag_exceptions_lookup
Consensus script-flag override for block_hash on network, if any (partial map entry).
tx_has_nonempty_input_witness
True when any input witness stack in a block has a non-empty element.
tx_requires_witness_script_flags
Input to per-tx SCRIPT_VERIFY_WITNESS gating (Orange Paper §5.2.5 FlagCondition).
validate_prev_block_hash
H08 (§5.3.1): child.prev_block_hash MUST equal block_header_hash(parent).

Type Aliases§

UtxoDelta