You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This commit was created on GitHub.com and signed with GitHub’s verified signature.
Added
Added Nix package outputs for Android with bundled NDK r24, Rust toolchains, Boost, and cmake.
Added Block::check to perform context-free validation of a block (size, weight, coinbase, transactions, sigops), with optional proof-of-work and merkle-root checks toggled via the BLOCK_CHECK_BASE / _POW / _MERKLE / _ALL flags. Returns a BlockCheckResult enum carrying the validation state on failure.
Implemented Debug for BlockValidationResult, BlockValidationStateRef, ProcessBlockHeaderResult and BlockCheckResult, enabling inspection via {:?} in logs and test output.
Added #[must_use] to BlockCheckResult and ProcessBlockHeaderResult to warn when validation results are silently ignored.
Added ScriptPubkeyExt::as_bytes to return a zero-copy slice into kernel-managed memory. Unlike to_bytes, this does not allocate.
Added Transaction::check for context-free consensus validation of a transaction. Returns TxCheckResult::Valid on success or TxCheckResult::Invalid(TxValidationResult) on failure.
Added TxValidationResult enum with all transaction validation result variants.
Added ChainParams::new_signet and ContextBuilder::signet to configure a custom signet from a user-provided challenge.
Added TxIn::witness_stack() (via TxInExt) to retrieve a transaction input's witness stack. Returns a WitnessStackRef borrowing from the input.
Added WitnessStack and WitnessStackRef types for holding a transaction input's witness stack, along with the shared WitnessStackExt trait exposing len(), is_empty() and item(index). item returns the raw bytes of the item at the given index, or Err(KernelError::OutOfBounds) if the index is invalid.
Added WitnessStackExt::items() returning a WitnessStackIter that yields each witness stack item as an owned Vec<u8> in order. Implements Iterator and ExactSizeIterator.
Added TxIn::script_sig() (via TxInExt) to retrieve an input's scriptSig as a serialized Vec<u8>. Returns Err(KernelError::SerializationFailed) if serialization fails
Changed
The verify function's flags parameter now uses ScriptVerificationFlags instead of u32, making the type explicit in the public API.
BlockHeader::new now returns Err(KernelError::InvalidLength) when passed a buffer that is not exactly 80 bytes, rather than delegating the check to the underlying library.
ChainstateManager::process_block_header now returns Result<ProcessBlockHeaderResult, KernelError> instead of ProcessBlockHeaderResult directly. Err indicates an internal failure; Ok(ProcessBlockHeaderResult::Invalid(state)) indicates the header failed validation.
ProcessBlockHeaderResult::Success and ProcessBlockHeaderResult::Failed renamed to ProcessBlockHeaderResult::Valid and ProcessBlockHeaderResult::Invalid respectively. Valid no longer carries a BlockValidationState.
Fixed
verify now uses an infallible conversion for the internal ScriptVerifyStatus, since an unrecognized status can only indicate a build-time mismatch between the bindings and the vendored libbitcoinkernel subtree rather than a runtime condition.
ChainstateManager::get_block_tree_entry now resolves the requested block instead of returning None for every input. It passed the address of the BlockHash wrapper to the kernel rather than the block hash handle the wrapper owns, so no lookup ever matched an entry in the block tree.
TxOutIter::size_hint returned the transaction's input count instead of its output count, giving an incorrect hint (and an incorrect ExactSizeIterator::len).