#36283 kernel: expose transaction version
https://github.com/bitcoin/bitcoin/pull/36283 · · +29/-0 in 4 files, 1 commits · labels: Validation
Goal
- Lets libbitcoinkernel consumers inspect transaction versions directly
- Removes the need for library callers to slice and parse serialized raw bytes
Adds a C and C++ accessor (`btck_transaction_get_version` / `GetVersion()`) to expose the transaction version in the bitcoinkernel library. Also adds corresponding unit test coverage in `test_kernel`.
Problem: External consumers of `libbitcoinkernel` inspecting transactions previously had to slice and parse serialized raw bytes to access the transaction version.
Category: Kernel (libbitcoinkernel) (#14 of 18)
P3 · new feature
- P3 because it rounds out the kernel transaction inspection API without changing core behavior
- Benefit is modest convenience for external library users reading transaction data
P3 because this rounds out the kernel transaction inspection API without changing core behavior. As the author notes, it 'completes the existing set of transaction accessors allowing clients to read the transaction version without slicing serialized bytes'.
Membership: Directly expands `src/kernel/bitcoinkernel.h` and the C++ wrapper API in `src/kernel/bitcoinkernel_wrapper.h`.
Factors: security/stability 0, bug 0, performance 0, user value 2, leverage 1
Reviewability: Ready
- Ready to review
- Small and clean change with straightforward feedback on test helpers
The PR is small and clean with straightforward code review feedback on test helper usage.
Author status: active
Open concerns:
- stickies-v suggested avoiding the internal header `<crypto/common.h>` in the kernel test and folding the test case into `btck_transaction_tests`
Agreement: Strong
- Reviewers agree on exposing the transaction version to complete the API surface
- Concept approval without stated reasons (yuvicc)
- Code approval with a minor suggestion on test helper headers (stickies-v)
Strong: Concept ACK from yuvicc and code LGTM with minor test cleanup from stickies-v
Reviewers agree on the need for the accessor to complete the transaction API surface, with only minor test-level suggestions.
- yuvicc gave Concept ACK
- stickies-v noted 'Code LGTM' while suggesting avoiding crypto/common.h dependency in test_kernel
Review verdicts (DrahtBot): 0
- Concept ACK: yuvicc
Files
10 lines under test/bench/ci.
- src/test/kernel/test_kernel.cpp +10/-0
- src/kernel/bitcoinkernel.h +9/-0
- src/kernel/bitcoinkernel.cpp +5/-0
- src/kernel/bitcoinkernel_wrapper.h +5/-0
Card
Exposes transaction version in the kernel C and C++ API (`btck_transaction_get_version` and `Transaction::GetVersion`). This allows external consumers of libbitcoinkernel to read transaction version fields directly without slicing raw byte streams. Review is in a healthy early state with concept approval and code LGTM from reviewers, pending minor test cleanups.