lsilva01
commented at 9:36 PM on November 5, 2021:
contributor
This PR removes calls to global Params() in validation layer (except in the CChainState constructor).
Motivation: Reducing the use of global variables makes code more predictable.
Requires #23437 as it changes the visibility of CChainState::m_params to public.
DrahtBot added the label P2P on Nov 5, 2021
DrahtBot added the label RPC/REST/ZMQ on Nov 5, 2021
DrahtBot added the label Utils/log/libs on Nov 5, 2021
DrahtBot added the label Validation on Nov 5, 2021
DrahtBot
commented at 10:12 AM on November 6, 2021:
contributor
<!--e57a25ab6845829454e8d69fc972939a-->
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
<!--174a7506f384e20aa4161008e828411d-->
Conflicts
Reviewers, this pull request conflicts with the following ones:
#23581 (Move BlockManager to node/blockstorage by MarcoFalke)
#23174 (validation: have LoadBlockIndex account for snapshot use by jamesob)
#22674 (validation: mempool validation and submission for packages of 1 child + parents by glozow)
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.
DrahtBot added the label Needs rebase on Nov 9, 2021
stratospher
commented at 6:03 AM on November 26, 2021:
contributor
Concept ACK.
aac6548
CChainParams m_params is made a public member of class CChainState.
chainstate.m_params is used instead of global Params() in AcceptToMemoryPool in validation.cpp. (with changes in fuzz/tx_pool.cpp done in PR 23465)
20df92b
chainstate.m_params is used instead of global Params() in validation.cpp inside functions like ProcessNewPackage(), ProcessNewBlockHeaders(), LoadMempool() and PopulateAndValidateSnapshot().
The function signature of LoadBlockIndexDB() is changed to include the first argument as Consensus::Params and call site updated in order to avoid the global call to Params() within the function.
I'm also curious to know if there's any added advantage in making m_params public (in comparison with using getters/setters)?
Remove calls to global Params() in validation layer8d44624839
lsilva01 force-pushed on Dec 2, 2021
DrahtBot removed the label Needs rebase on Dec 2, 2021
This is a metadata mirror of the GitHub repository
bitcoin/bitcoin.
This site is not affiliated with GitHub.
Content is generated from a GitHub metadata backup.
generated: 2026-05-20 06:53 UTC