Skip to content

Conversation

@sedited
Copy link
Owner

@sedited sedited commented Jan 23, 2026

This adds a BlockHeader struct and functions for creating it from other existing data structures, like blocks, and block tree entries, as well as from raw bytes. Also adds accessors to its various fields.

A block header may be processed by a chainstate manager to extend the longest chain and validate it against existing data. This can be used by external clients to implement headers-first sync.

Introduce a new owned BlockValidationState struct that gets to return the validation state of a block header after processing.

…b8c204275aa

5b8c204275aa Merge bitcoin/bitcoin#34384: Remove epoch logic from mempool
891030ac8b9e Merge bitcoin/bitcoin#33822: kernel: Add block header support and validation
0871e104a26d Merge bitcoin/bitcoin#34242: Prepare string and net utils for future HTTP operations
1b079becf14d Merge bitcoin/bitcoin#34317: fuzz: Exclude too expensive inputs in descriptor_parse targets
cdb42a8df8cd Merge bitcoin/bitcoin#34380: test: Fix P2PK script test
40735450c00b Remove unused epochguard.h
1a8494d16c7b Rework CTxMemPool::GetChildren() to not use epochs
7b48b09b7f77 Merge bitcoin/bitcoin#34376: bench/test: clarify merkle bench and witness test intent
fab2f3df4beb fuzz: Exclude too expensive inputs in descriptor_parse targets
1911db8c6dc6 string: add LineReader
ee62405cce2b time: implement and test RFC1123 timestamp string
eea38787b9be string: add AsciiCaseInsensitive{KeyEqual, Hash} for unordered map
1d8cb78d5b1c Merge bitcoin/bitcoin#34309: guix: stop passing depends sources to codesigning
4e300df7123a string: add `base` argument for ToIntegral to operate on hexadecimal
0b0d9125c19c Modernize GetBindAddress()
7041648ee5bd Merge bitcoin/bitcoin#34375: doc: mempool: fix  `removeUnchecked` incorrect comment
9a9d797ef6ed kernel: Add support for block headers
1137debb8530 doc: mempool: fix  `removeUnchecked` incorrect comment
c9ce1c7c4a12 test: Fix P2PK script test
691dc830c669 Merge bitcoin/bitcoin#34377: test: Rename wallet in restore attempt in wallet_assumeutxo
d7fd8c6952f2 Merge bitcoin/bitcoin#34090: net: Fix `-Wmissing-braces`
1fbbdd20cde9 Merge bitcoin/bitcoin#34355: doc: Fix wrong code in WITH_LOCK doxygen comment
9016858282b6 Merge bitcoin/bitcoin#34297: p2p: add validation checks for initial self-announcement
e1dc4afeeb6b test: Rename wallet name in restore attempt in wallet_assumeutxo
8b9d30e3facf bench/test: clarify merkle bench and witness test intent
5715748333fe Merge bitcoin/bitcoin#34366: test: switch order of error code and message check
2a1234001c46 Merge bitcoin/bitcoin#34269: wallet: disallow creating new or restoring to an unnamed (default) wallet
3ea2b6fe180e Merge bitcoin/bitcoin#34369: test: Scale NetworkThread close timeout with timeout_factor
fab055c907f1 test: Scale NetworkThread close timeout with timeout_factor
e324925d1990 Merge bitcoin/bitcoin#34363: Update libmultiprocess subtree to avoid occasional rpc_misc.py timeout
fa267551c4ea Merge bitcoin/bitcoin#34353: refactor: Use std::bind_front over std::bind
b851ff6cae71  kernel: Add Handle/View pattern for BlockValidationState
fa61fadad1c3 doc: Fix wrong code in WITH_LOCK doxygen comment
52096de2121d Merge bitcoin/bitcoin#34032: util: Add some more Unexpected and Expected methods
0aba464ce765 test: switch order of error code and message check
8c07800b193e Merge bitcoin/bitcoin#32497: merkle: pre‑reserve leaves to prevent reallocs with odd vtx count
a365c9fe1fc3 Merge bitcoin/bitcoin#33738: log: avoid collecting `GetSerializeSize` data when compact block logging is disabled
bc3c4cd8b235 Merge bitcoin/bitcoin#32724: Musig2 tests
f7e88e298aed Merge bitcoin/bitcoin#32471: wallet/rpc: fix listdescriptors RPC fails to return descriptors with private key information when wallet contains descriptors missing any key
7f5ebef56a0f Merge bitcoin/bitcoin#34302: fuzz: Restore SendMessages coverage in process_message(s) fuzz targets
a6e8cd306eae Merge bitcoin/bitcoin#34310: iwyu: Add missed line to IWYU patch
f4413706f9d4 Merge bitcoin/bitcoin#34344: ci: update GitHub Actions versions
faa18dceba1d refactor: Use std::bind_front over std::bind
c84c752506d7 Merge bitcoin/bitcoin#34319: Drop some `IWYU pragma: export` and document IWYU usage
38f951f8287d Merge bitcoin/bitcoin#34308: doc: Document IWYU workaround
ab80588f52b4 Merge bitcoin/bitcoin#34345: clang-format: use AngleBracket for main includes
977be171f2aa Merge bitcoin/bitcoin#34188: test: Add multiple transactions and error handling tests for getreceivedbyaddress
347840164faf Merge bitcoin/bitcoin#32143: Fix 11-year-old mis-categorized error code in OP_IF evaluation
969c840db52d log,blocks: avoid `ComputeTotalSize` and `GetHash` work when logging is disabled
babfda332b6a log,net: avoid `ComputeTotalSize` when logging is disabled
1658b8f82b99 refactor: rename `CTransaction::GetTotalSize` to signal that it's not cached
75b704df9d5c wallettool: Disallow creating new unnamed wallets
5875a9c50263 wallet: disallow unnamed wallets in createwallet and restorewallet
0dafc0d83c3e clang-format: use AngleBracket for main includes
03f363d37884 doc: Document IWYU workaround
d938947b3a89 doc: Add "Using IWYU" to Developer Notes
e1a90bcecc82 iwyu: Do not export `crypto/hex_base.h` header
19a2edde50c3 iwyu: Do not export C++ headers in most cases
9482f00df0b0 chore: Update outdated GitHub Actions versions
898e8d3a2d35 Merge bitcoin/bitcoin#34296: refactor: [move-only] Merge core_io module, remove from libkernel
faf07bd1ab26 doc: Fix typo found by LLM
faf66673ac60 refactor: [move-only] Merge core_io module
fa6947f4915f kernel: Remove unused core_read.cpp from kernel
5e49f5d63c74 Merge bitcoin/bitcoin#33779: ci, iwyu: Fix warnings in `src/kernel` and treat them as errors
c57fbbe99d8f Merge bitcoin/bitcoin#31650: refactor: Avoid copies by using const references or by move-construction
d45ec3fba905 test: Add getreceivedbyaddress coverage to wallet_listreceivedby
22bde74d1d8f Merge bitcoin-core/gui#924: Show an error message if the restored wallet name is empty
81bf4209e9dc Merge bitcoin/bitcoin#34318: contrib: Revert "verify-commits sha1 exceptions"
a5a8c4139c81 ci, iwyu: Fix warnings in `src/kernel` and treat them as errors
fa38ffac6ff5 contrib: [refactor] Use shorter read_text from pathlib
fab8bc03082d contrib: Revert "verify-commits sha1 exceptions"
de509c6df979 iwyu: Add missed line to IWYU patch
faa59b367985 util: Add Expected::swap()
fabb47e4e3db util: Implement Expected::operator*()&&
d94d7b1a4b70 guix: stop passing depends sources to codesigning
0ffb20dee178 Merge bitcoin/bitcoin#34282: qa: Fix Windows logging bug
fab9721430aa util: Implement Expected::value()&& and Expected::error()&&
fac480095986 util: Add Expected<void, E> specialization
fa6575d6c2d2 util: Make Expected::value() throw
697bc7f6a2dc Merge bitcoin/bitcoin#34300: test: use ephemeral ports in p2p_private_broadcast.py
37cb2092777e Merge bitcoin/bitcoin#34238: wallet: remove erroneous-on-reorg Assume()
fabf8d1c5bdb fuzz: Restore SendMessages coverage in process_message(s) fuzz targets
fac7fed397f0 refactor: Use std::reference_wrapper<AddrMan> in Connman
d08c1b3ed934 Merge bitcoin/bitcoin#34288: fuzz: Exclude too expensive inputs in miniscript_string target
6a8dbf9b9352 p2p: add validation check for initial self-announcement
baa554f7089d Merge bitcoin/bitcoin#34259: Find minimal chunks in SFL
3e340672ecad test: use ephemeral ports in p2p_private_broadcast.py
9d2b8fddad46 Merge bitcoin/bitcoin#34210: bench: Remove -priority-level= option
ae3b5a99f826 Merge bitcoin/bitcoin#34186: test: use dynamic port allocation in proxy tests
f4364cedb321 Merge bitcoin/bitcoin#33728: test: Add bitcoin-chainstate test for assumeutxo functionality
80c4c2df3f52 Merge bitcoin/bitcoin#34146: p2p: send first addr self-announcement in separate message 🎄
fa64d8424b8d refactor: Enforce readability-avoid-const-params-in-decls
faf0c2d942c8 refactor: Avoid copies by using const references or by move-construction
cd0959ce9b7c Merge bitcoin/bitcoin#34185: test: fix `feature_pruning` when built without wallet
b0b65336e761 Merge bitcoin/bitcoin#32740: refactor: Header sync optimisations & simplifications
fac70ea8b5bb fuzz: Exclude too expensive inputs in miniscript_string target
fa9078647860 iwyu: Fix includes for test/fuzz/util/descriptor module
c0219f6beaa0 Merge bitcoin/bitcoin#34285: ci: Install `pyzmq` for functional tests on Windows
f62568c97cbb ci: Install `pyzmq` for functional tests on Windows
2d380aee43cd Merge bitcoin/bitcoin#34243: doc: validation: fix `PackageMempoolChecks` incorrect comment
db6e576710ad Merge bitcoin/bitcoin#34279: test: Fail on self-check warnings in test_runner.py
c447eea43d5a Merge bitcoin/bitcoin#34145: test: Add unit test for OP_NUMEQUALVERIFY
979d41bfab24 qa: Fix Windows logging bug
28f70c571bd4 Merge bitcoin/bitcoin#34240: ci: Run feature_unsupported_utxo_db.py on Windows
fa2959e16d8c test: Fail on self-check warnings in test_runner.py
ac76d94117be Merge bitcoin/bitcoin#34109: refactor: Use uint64_t over size_t for serialize corruption check in fees.dat
fa5032f0e4d4 ci: Run feature_unsupported_utxo_db.py on Windows
57350c5352fa Merge bitcoin/bitcoin#34272: psbt: Fix `PSBTInputSignedAndVerified` bounds `assert`
88a7294356e7 Merge bitcoin/bitcoin#34260: contrib: Remove unused functions
8e8d8f29a822 Merge bitcoin/bitcoin#33775: guix: use GCC 14.3.0 over 13.3.0
d20037893ad0 Merge bitcoin/bitcoin#34244: test: Prevent loop from running out of utxos in bip68 test
4aa80c3b5eae Merge bitcoin/bitcoin#34230: fuzz: Reject too large descriptor leaf sizes in scriptpubkeyman target
72e0999ddbee Merge bitcoin/bitcoin#34099: test: Improve code coverage for pubkey checks
377c6dbc3ced Merge bitcoin/bitcoin#34224: init: Return EXIT_SUCCESS on interrupt
c094a966d6d6 Merge bitcoin/bitcoin#34246: verify-commits: Allow specific commits to allow sha1
c352d3c51cf7 Merge bitcoin/bitcoin#34168: qa: Require `--exclude` for each excluded test
d30ad4a9129d wallet, rpc: Use HandleWalletError in createwallet
7fc465ece882 doc: fix incorrect description of `PackageMempoolChecks`
62557c95298d Merge bitcoin/bitcoin#33819: mining: getCoinbase() returns struct instead of raw tx
73d0fe62d3db Merge commit '7562e2aeed95b0dc627e8e3a849941992f0189bb' into pr/subtree-7
7562e2aeed95 Squashed 'src/ipc/libmultiprocess/' changes from a4f92969649..1fc65008f7d
2f5b1c5f8059 psbt: Fix `PSBTInputSignedAndVerified` bounds `assert`
fa3df5271232 bench: Require semicolon after BENCHMARK(foo)
fa8938f08c9a bench: Remove incorrect __LINE__ in BENCHMARK macro
fa51a28a948d scripted-diff: Remove priority_level from BENCHMARK macro
fa790c3eeaae bench: Remove -priority-level= option
dd904298c13b gui: Show an error message if the restored wallet name is empty
3c8d389a84d2 Merge bitcoin/bitcoin#34249: doc: archive v30.2 release notes
5e98a6a470e3 Merge bitcoin/bitcoin#34266: release note: cpfp carveout removed in 31.0
61726483e1c2 release note: cpfp carveout removed in 31.0
da56ef239b12 clusterlin: minimize chunks (feature)
d09a19fd41cb test: add coverage for issue 34206
a0ca851d26f8 Make GetBindAddress() callable from outside net.cpp
796f18e559d6 Merge bitcoin/bitcoin#29415: Broadcast own transactions only via short-lived Tor or I2P connections
facaf5621446 contrib: Remove unused functions
abc6a3a4eb98 Merge bitcoin/bitcoin#34252: doc: add 433 (Pay to Anchor) to bips.md
44b12cdb11f0 doc: add 433 (Pay to Anchor) to bips.md
f664860e52e1 doc: archive v30.2 release notes
ce63d37ebee8 test: use dynamic port allocation to avoid test conflicts
8ac134be5e57 contrib: verify-commits sha1 exceptions
ab41492c6ba7 test: Prevent loop from running out of utxos in bip68 test
aeaa67a9eac0 Merge bitcoin/bitcoin#33428: depends: Boost 1.90.0
1412b779ad0a refactor: execute `PackageMempoolChecks` during package rbf only
4c7cfd37ad95 wallet: remove erroneous-on-reorg Assume()
8fb5e5f41ddf test: check wallet rescan properly in feature_pruning
595504a43209 Merge bitcoin/bitcoin#34236: Add sedited to trusted-keys
5c724f3b0455 Merge bitcoin/bitcoin#34235: miniminer: stop assuming ancestor fees >= self fees
2d87afcf7dff Merge bitcoin/bitcoin#34227: guix: Fix `osslsigncode` tests
7b17fb78fa3a Merge bitcoin/bitcoin#34226: wallet: test: Relative wallet failed migration cleanup
eeaf28dbe0e0 wallet: test: Failed migration cleanup
997e7b4d7cf7 init: Fix non-zero code on interrupt
d1b227f3ad19 Add sedited to trusted-keys
6c3fb719d1a8 Merge bitcoin-core/gui#921: Remove deprecated "Starting Block" from Peer Detail
2cade5d5d170 [miniminer] stop assuming ancestor fees >= self fees
fa8d56f9f092 fuzz: Reject too large descriptor leaf sizes in scriptpubkeyman target
fabac1b3950e fuzz: Reject some more "expensive" descriptors in the scriptpubkeyman target
194114daf385 guix: Fix `osslsigncode` tests
333333356f43 fuzz: [refactor] Use std::span over FuzzBufferType in descriptor utils
8d5700ab0f12 Merge bitcoin/bitcoin#34221: test: migration, avoid backup name mismatch in default_wallet_failure
cbf0bd35bbf3 test: migration, avoid backup name mismatch in default_wallet_failure
cd6e4c9235f7 Merge bitcoin/bitcoin#34215: wallettool: fix unnamed createfromdump failure walletsdir deletion
90d651a81f51 Merge bitcoin/bitcoin#34156: wallet: fix unnamed legacy wallet migration failure
9c7e4771b13d test: Test listdescs with priv works even with missing priv keys
ed945a685473 walletrpc: reject listdes with priv key on w-only wallets
9e5e9824f11b descriptor: ToPrivateString() pass if  at least 1 priv key exists
5c4db25b61d4 descriptor: refactor ToPrivateString for providers
2dc74e3f4e5e wallet/migration: use HavePrivateKeys in place of ToPrivateString
e842eb90bb6d descriptors: add HavePrivateKeys()
f78f6f1dc8e1 wallettool: do not use fs::remove_all in createfromdump cleanup
a9daa6dbd3ae Merge bitcoin/bitcoin#34135: rpc: [wallet] Use unsigned type for tx version in sendall
a3c71c720158 [test] Add BIP 328 test vectors for Musig2
b7c34d08dd95 test: coverage for migration failure when last sync is beyond prune height
82caa8193a3e wallet: migration, fix watch-only and solvables wallets names
d70b159c4200 wallet: improve post-migration logging
f011e0f0680a test: restorewallet, coverage for existing dirs, unnamed wallet and prune failure
36093bde6328 test: add coverage for unnamed wallet migration failure
f4c7e28e80bf wallet: fix unnamed wallet migration failure
4ed0693a3f2a wallet: RestoreWallet failure, erase only what was created
c60f9cb66ee7 Merge bitcoin/bitcoin#34085: cluster mempool: exploit SFL properties in txgraph
2a746500fa76 ci: migrate some jobs to Debian Trixie, use GCC 14
fb0e6edfe881 guix: Apply SSA generation patch to maintain determinism
34909799fe60 guix: use GCC 14.3.0 over 13.3.0
47be9122a7f5 guix: disable gprofng in GCC
ea29329eb706 guix: build GCC with --enable-host-bind-now
6f54e267d01d guix: disable libquadmath in GCC
7735901ed266 guix: disable building libgomp in GCC
114901c0655d Merge bitcoin/bitcoin#34203: doc: p2p: replace last remaining "command" terminology with "message type"
d7cbdfa090b2 Merge bitcoin/bitcoin#34204: test: fix intermittent failure in p2p_addr_selfannouncement
301d9eea66ca qt: Remove "Starting Block" from Peer Detail. Following Deprecation in `bitcoin#34197`
0ad4376a49fa Merge bitcoin/bitcoin#33142: test: Run bench sanity checks in parallel with functional tests
c267b3a2c695 Merge bitcoin/bitcoin#34197: rpc, net: deprecate `startingheight` field of `getpeerinfo` RPC
d6a6afd955b5 Merge bitcoin/bitcoin#34010: psbt: detect invalid MuSig2 pubkeys in deserialization
5b7bf47f9b92 doc: p2p: replace last remaining "command" terminology with "message type"
1808b5aaf7c4 clusterlin: remove unused FixLinearization (cleanup)
34a77138b7a6 txgraph: permit non-topological clusters to defer fixing (optimization)
3380e0cbb59b txgraph: use PostLinearize less prior to linearizing
62dd88624a7f txgraph: drop NEEDS_SPLIT_ACCEPTABLE (simplification)
01ffcf464a46 clusterlin: support fixing linearizations (feature)
755f0900a28a Merge bitcoin/bitcoin#34136: test: Allow mempool_updatefromblock.py to run on 32-bit
5805a8b54083 psbt: detect invalid MuSig2 pubkeys in deserialization
792e2edf57ab p2p: first addr self-announcement in separate msg
31852057ea39 test: fix intermittent failure in p2p_addr_selfannouncement
48f57bb35bbd mining: add new getCoinbaseTx() returning a struct
bd4f4782f23b Merge bitcoin/bitcoin#34154: test: Enable ruff E713 lint
4ce3f4a26565 rpc, net: deprecate `startingheight` field of `getpeerinfo` RPC
ab233255d444 Merge bitcoin/bitcoin#33866: refactor: Let CCoinsViewCache::BatchWrite return void
2628de7479f0 Merge bitcoin/bitcoin#33135: wallet: warn against accidental unsafe older() import
9b57c8d2bd15 test: fix feature_pruning when built without wallet
c631553732f9 Merge bitcoin/bitcoin#34191: doc: archive release notes for v30.1
bd730cb0a1ec doc: archive release notes for v30.1
c5825d4b7fe9 qa: Require `--exclude` for each excluded test
6ed2cf5184fc Merge bitcoin/bitcoin#34169: fuzz: change fuzz runner test_runner.py to be cwd independent
fb49d62d8f69 Merge bitcoin/bitcoin#34177: policy/refactor: remove constant parameter from `IsWellFormedPackage`
fa65bc0e79da test: Run bench sanity checks in parallel with functional tests
fa9fdbce7928 test: Pass bench exe into test framework utils
adbb4b320834 Merge bitcoin/bitcoin#34174: doc: update copyright year to 2026
891aed2f7505 Merge bitcoin/bitcoin#34172: Fix intermittent issue in p2p_1p1c_network.py
7590a72a5e17 Merge bitcoin/bitcoin#34182: doc: Update OpenBSD Build Guide
a50d7a7929d3 Merge bitcoin/bitcoin#34183: doc: fix double-word typos in comments
2bff9ebeff87 Merge bitcoin/bitcoin#34102: depends: capnp 1.3.0
08ed802babb5 doc: fix double-word typos in comments
84d8c5266254 doc: Update OpenBSD Build Guide
77c9b3c08f5f change test_runner.py to be cwd independent by calling subprocess.run with cwd arg.
658d38106a39 policy: remove constant parameter from `IsWellFormedPackage`
b23b901363c5 doc: update copyright year
95ef0fc5e781 test: ensure clean orphanage before continuing
25e84d377202 test: change low fee parents to 0-fee
2bcb3f64648a Merge bitcoin/bitcoin#34112: rpc: [mempool] Remove erroneous Univalue integral casts
7249bcc4f899 Merge bitcoin/bitcoin#34119: contrib: remove `copyright_header.py`
0f6a526f4330 Merge bitcoin/bitcoin#34160: policy: Remove stale rationale paragraph
337b4a23690b Remove stale rationale paragraph
fab300b37894 test: Enable ruff E713 lint
b7625387569a test: Add unit test for SCRIPT_ERR_NUMEQUALVERIFY
3dd815f048c8 validation: pre-reserve leaves to prevent reallocs with odd vtx count
7fd47e0e5608 bench: make `MerkleRoot` benchmark more representative
fac5a1b10a69 test: Allow mempool_updatefromblock.py to run on 32-bit
fafbc70d48e1 rpc: [wallet] Use unsigned type for tx version in sendall
ba6315d2f6fe contrib: remove copyright_header.py
3e4765ee10a6 scripted-diff: [doc] Unify stale copyright headers
fab1f4b800d0 rpc: [mempool] Remove erroneous Univalue integral casts
d59b4cdb5772 mining: rename getCoinbaseTx() to ..RawTx()
fa1d17d56c83 refactor: Use uint64_t over size_t for serialize corruption check in fees.dat
7b5d256af4a0 test: Add bitcoin-chainstate test for assumeutxo functionality
2bc326564985 Fix `ChainstateManager::AddChainstate()` assertion crash
5f3d6bdb6659 Add regtest support to bitcoin-chainstate tool
719158db5cd5 depends: capnp 1.3.0
6bb66fcccb5b test: Improve code coverage for pubkey checks
f46e3ec0f956 net: Fix `-Wmissing-braces`
89372213048a doc: add release notes for 29415
582016fa5f01 test: add unit test for the private broadcast storage
e74d54e04896 test: add functional test for private broadcast
818b780a05db rpc: use private broadcast from sendrawtransaction RPC if -privatebroadcast is ON
eab595f9cf13 net_processing: retry private broadcast
37b79f9c39db net_processing: stop private broadcast of a transaction after round-trip
2de53eee742d net_processing: handle ConnectionType::PRIVATE_BROADCAST connections
30a9853ad353 net_processing: move a debug check in VERACK processing earlier
d1092e5d48ce net_processing: modernize PushNodeVersion()
9937a12a2fd5 net_processing: move the debug log about receiving VERSION earlier
a098f37b9e24 net_processing: reorder the code that handles the VERSION message
679ce3a0b8df net_processing: store transactions for private broadcast in PeerManager
a3faa6f944a6 node: extend node::TxBroadcast with a 3rd option
95c051e21051 net_processing: rename RelayTransaction() to better describe what it does
bb49d26032c5 net: implement opening PRIVATE_BROADCAST connections
01dad4efe2b3 net: introduce a new connection type for private broadcast
94aaa5d31b6f init: introduce a new option to enable/disable private broadcast
d6ee490e0a9a log: introduce a new category for private broadcast
6da6f503a6dd refactor: Let CCoinsViewCache::BatchWrite return void
f0a218310874 test: adjust `ComputeMerkleRoot` tests
fa1de1103fe5 util: Add Unexpected::error()
faa109f8be7f test: refactor: Use BOOST_CHECK_EQUAL over BOOST_CHECK ==
fad4a9fe2b8d Set bugprone-unused-return-value.AllowCastToVoid
ca4a844eed48 depends: Boost 1.90.0
76c092ff8058 wallet: warn against accidental unsafe older() import
592157b75946 test: move SEQUENCE_LOCKTIME flags to script
de4242f47476 refactor: Use reference for chain_start in HeadersSyncState
e37555e5401f refactor: Use initializer list in CompressedHeader
0488bdfefe92 refactor: Remove unused parameter in ReportHeadersPresync
256246a9fa5b refactor: Remove redundant parameter from CheckHeadersPoW
ca0243e3a6d7 refactor: Remove useless CBlock::GetBlockHeader
456865222245 refactor: Use std::span in HasValidProofOfWork
4066bfe561a4 refactor: Compute work from headers without CBlockIndex
0bf6139e194f p2p: Avoid an IsAncestorOfBestHeaderOrTip call
a7b581423e44 Fix 11-year-old mis-categorized error code in OP_IF evaluation

git-subtree-dir: libbitcoinkernel-sys/bitcoin
git-subtree-split: 5b8c204275aa1335fe9c336a2bd1d397b49a8ac6
@sedited sedited force-pushed the process_block_headers branch 2 times, most recently from eeeb1bb to 1880d0b Compare January 23, 2026 21:40
Copy link
Contributor

@alexanderwiederin alexanderwiederin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Main suggestions are around API ergonomics and consistency with other types.

@sedited sedited force-pushed the process_block_headers branch 3 times, most recently from a86dea6 to bed34d0 Compare January 26, 2026 09:11
@sedited
Copy link
Owner Author

sedited commented Jan 26, 2026

Thanks for the review, pushed to address your comments @alexanderwiederin.

This adds a BlockHeader struct and functions for creating it from other
existing data structures, like blocks, and block tree entries, as well
as from raw bytes. Also adds accessors to its various fields.

A block header may be processed by a chainstate manager to extend the
longest chain and validate it against existing data. This can be used by
external clients to implement headers-first sync.

Introduce a new owned BlockValidationState struct that gets to return
the validation state of a block header after processing.
@sedited sedited force-pushed the process_block_headers branch from bed34d0 to c5cd6f4 Compare January 26, 2026 12:57
@sedited
Copy link
Owner Author

sedited commented Jan 26, 2026

Pushed to address further comments from @alexanderwiederin .

Copy link
Contributor

@alexanderwiederin alexanderwiederin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK c5cd6f4

@sedited
Copy link
Owner Author

sedited commented Jan 26, 2026

Thanks for the review!

@sedited sedited merged commit ecde0d4 into master Jan 26, 2026
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants