[pull] master from bitcoin:master#1579
Merged
pull[bot] merged 11 commits intoAll-Blockchains:masterfrom Apr 3, 2026
Merged
Conversation
Library users currently need to maintain a full context object to perform context-free block validation. Exposing an opaque `btck_ConsensusParams` struct allows callers to supply only the required consensus parameters, resulting in a lighter-weight API and a clearer expression of the actual validation behavior. Co-authored-by: yuvicc <yuvichh01@gmail.com>
This introduces a context-free validation entry point for full blocks in the kernel C and C++ APIs. * Add `btck_block_check`, a C function that wraps `CheckBlock` and runs header and body checks for a `btck_Block` using `btck_ConsensusParams`. Callers provide a `btck_BlockValidationState` to receive the result and supply a `btck_BlockCheckFlags` bitmask to control POW and merkle-root verification. * Add `btck_BlockCheckFlags` in the C API, plus the corresponding `BlockCheckFlags` scoped enum in the C++ wrapper, including a `*_ALL` convenience value. * Add `Block::Check()` to the C++ wrapper to mirror the new C function and return a bool while filling a `BlockValidationState`. * Add a test `(btck_check_block_context_free)` that verifies a known valid mainnet block passes with `BlockCheckFlags::ALL` and that truncated block data fails deserialization. Co-authored-by: yuvicc <yuvichh01@gmail.com>
This was overlooked in #34896.
Type will be used for reading the cookie in next commit. Also corrects ERR/ERROR mismatch in docstring in request.h, and changes to CamelCase to avoid potential collision with Windows headers (#34965 (comment)).
Co-authored-by: MarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz>
…eck_block_context_free`) with POW/Merkle flags 0587c56 kernel: Expose context-free block validation (w0xlt) 71f827c kernel: Expose consensus parameters (`btck_ConsensusParams`) (w0xlt) Pull request description: This PR exposes Bitcoin Core’s context‑free block checks to library users via a new C API entry point, `btck_check_block_context_free`. Callers can validate a block’s structure (size/weight, coinbase rules, per‑tx context‑free checks) and optionally re‑run Proof‑of‑Work and Merkle‑root verification without touching chainstate, the block index, or the UTXO set. Rationale Clients embedding the kernel need a pure block sanity check without requiring node state or disk writes (candidate block validation, for example). This API offers that surface in a single call, with optional PoW/Merkle toggles to avoid redundant work when the header has already been validated or when Merkle verification is deferred. ACKs for top commit: yuvicc: re-ACK 0587c56 achow101: ACK 0587c56 sedited: ACK 0587c56 Tree-SHA512: 6bd53e4964909335d1f2fee30ff96c95a8dd2c84bcdfe11c50ba369301822e5dea9bbe2376bb6d6b4652875152071eb0446657042b00429f29581da4fcea71a9
…errors 8b49e2d ci, iwyu: Fix warnings in `src/util` and treat them as errors (Hennadii Stepanov) 6953363 refactor: Move license info into new module (Hennadii Stepanov) eb750d2 iwyu: Remove workaround for issue that has been fixed upstream (Hennadii Stepanov) Pull request description: This PR [continues](#33725 (comment)) the ongoing effort to enforce IWYU warnings. See [Developer Notes](https://github.com/bitcoin/bitcoin/blob/master/doc/developer-notes.md#using-iwyu). ACKs for top commit: achow101: ACK 8b49e2d maflcko: review ACK 8b49e2d 👘 BrandonOdiwuor: Code Review ACK 8b49e2d Tree-SHA512: f6a21d58947f714be7ad3c230857a7c974ac4c1b5099f1e8e8db9b6e3e01ba12270481e39a1c3cb8d93f326cea4f33c662becc65c80e46a38c6b49bb0c2f523f
257769a qa: Improve error message (Hodlinator) 20a94c1 cli: Clearer error messages on authentication failure (Hodlinator) 84c3f8d refactor(rpc): GenerateAuthCookieResult -> AuthCookieResult (Hodlinator) Pull request description: Increases precision of error messages to help the user correct authentication issues. Inspired by #34935. ACKs for top commit: davidgumberg: utACK 257769a maflcko: review ACK 257769a 🦇 achow101: ACK 257769a janb84: concept ACK 257769a Tree-SHA512: 1799db4b2c0ab3b67ed3d768da08c6be4f4beaad91a77406884b73950b420c8264c70b8e60a26a9e6fac058370f6accdb73c821d19bebb6edfbc8d7b84d01232
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
See Commits and Changes for more details.
Created by
pull[bot] (v2.0.0-alpha.4)
Can you help keep this open source service alive? 💖 Please sponsor : )