Files
bitcoin/src/test/kernel/test_kernel.cpp
Ava Chow 59199fa5ea Merge bitcoin/bitcoin#33908: kernel: add context‑free block validation API (btck_check_block_context_free) with POW/Merkle flags
0587c56091 kernel: Expose context-free block validation (w0xlt)
71f827c3c2 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 0587c56091
  achow101:
    ACK 0587c56091
  sedited:
    ACK 0587c56091

Tree-SHA512: 6bd53e4964909335d1f2fee30ff96c95a8dd2c84bcdfe11c50ba369301822e5dea9bbe2376bb6d6b4652875152071eb0446657042b00429f29581da4fcea71a9
2026-04-02 15:28:07 -07:00

55 KiB