diff options
author | fanquake <fanquake@gmail.com> | 2023-03-16 13:55:46 +0000 |
---|---|---|
committer | fanquake <fanquake@gmail.com> | 2023-03-16 13:56:35 +0000 |
commit | e695d8536e534f1e59de4a62a0d87a93e7a73456 (patch) | |
tree | 9315297636ff7e86123f09a74cd454c7243d542c /src/validation.cpp | |
parent | ebb15ea75ad1e9c270ecf52e4a0cb67dc0199366 (diff) | |
parent | b3e78dc91d01e364b77aacd9fb9a2f88688ab8a6 (diff) |
Merge bitcoin/bitcoin#26177: refactor / kernel: Move non-gArgs chainparams functionality to kernel
b3e78dc91d01e364b77aacd9fb9a2f88688ab8a6 refactor: Don't use global chainparams in chainstatemanager method (TheCharlatan)
382b692a503355df7347efd9c128aff465b5583e Split non/kernel chainparams (Carl Dong)
edabbc78a3bc272b2b802e1dbab73d6ed8e31e96 Add factory functions for Main/Test/Sig/Reg chainparams (Carl Dong)
d938098398814f37fed9b018b44716179cfa4b03 Remove UpdateVersionBitsParameters (Carl Dong)
84b85786f0f5cb23cc257a4464ae345e1d372313 Decouple RegTestChainParams from ArgsManager (Carl Dong)
76cd4e7c96242398172989609f1b9a8843c404b4 Decouple SigNetChainParams from ArgsManager (Carl Dong)
Pull request description:
This pull request is part of the `libbitcoinkernel` project https://github.com/bitcoin/bitcoin/issues/24303 https://github.com/bitcoin/bitcoin/projects/18 and more specifically its "Step 2: Decouple most non-consensus code from libbitcoinkernel". dongcarl is the original author of this patchset, these commits were taken from https://github.com/dongcarl/bitcoin/tree/2022-03-libbitcoinkernel-chainparams-args-only.
#### Context
The bitcoin kernel library currently relies on code containing user configurations through the `ArgsManager`. This is not optimal, since as a stand-alone library it should not rely on bitcoind's argument parsing logic. Instead, its interfaces should accept control and options structs that control the kernel library's desired configuration.
Similar work towards decoupling the `ArgsManager` from the kernel has been done in
https://github.com/bitcoin/bitcoin/pull/25290, https://github.com/bitcoin/bitcoin/pull/25487, https://github.com/bitcoin/bitcoin/pull/25527 and https://github.com/bitcoin/bitcoin/pull/25862.
#### Changes
By moving the `CChainParams` class definition into the kernel and giving it new factory functions `CChainParams::{RegTest,SigNet,Main,TestNet}`it can be constructed without an `ArgsManager` reference, unlike the current factory function `CreateChainParams`.
The first few commits remove uses of `ArgsManager` within `CChainParams`. Then the `CChainParams` definition is moved to a new file in the `kernel/` subdirectory.
ACKs for top commit:
MarcoFalke:
re-ACK b3e78dc91d01e364b77aacd9fb9a2f88688ab8a6 🛁
ryanofsky:
Code review ACK b3e78dc91d01e364b77aacd9fb9a2f88688ab8a6. Only changes since last review were recent review suggestions.
ajtowns:
ACK b3e78dc91d01e364b77aacd9fb9a2f88688ab8a6
Tree-SHA512: 3835aca1d3e3c75cc3303dd584bab3a77e58f6c678724a5e359fe4b0e17e0763a00931ee6191f516b9fde50496f59cc691f0709c0254206db3863bbf7ab2cacd
Diffstat (limited to 'src/validation.cpp')
-rw-r--r-- | src/validation.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/validation.cpp b/src/validation.cpp index 47355b0850..5b3a099dfc 100644 --- a/src/validation.cpp +++ b/src/validation.cpp @@ -10,7 +10,6 @@ #include <arith_uint256.h> #include <chain.h> -#include <chainparams.h> #include <checkqueue.h> #include <consensus/amount.h> #include <consensus/consensus.h> @@ -22,6 +21,7 @@ #include <flatfile.h> #include <fs.h> #include <hash.h> +#include <kernel/chainparams.h> #include <kernel/mempool_entry.h> #include <logging.h> #include <logging/timer.h> @@ -5429,7 +5429,7 @@ SnapshotCompletionResult ChainstateManager::MaybeCompleteSnapshotValidation( CCoinsViewDB& ibd_coins_db = m_ibd_chainstate->CoinsDB(); m_ibd_chainstate->ForceFlushStateToDisk(); - auto maybe_au_data = ExpectedAssumeutxo(curr_height, ::Params()); + auto maybe_au_data = ExpectedAssumeutxo(curr_height, m_options.chainparams); if (!maybe_au_data) { LogPrintf("[snapshot] assumeutxo data not found for height " /* Continued */ "(%d) - refusing to validate snapshot\n", curr_height); |