-
Notifications
You must be signed in to change notification settings - Fork 38.7k
refactor, consensus: remove calls to global Params() in validation layer
#23448
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. ConflictsReviewers, this pull request conflicts with the following ones:
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. |
stratospher
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Concept ACK.
- aac6548
CChainParams m_paramsis made a public member ofclass CChainState.chainstate.m_paramsis used instead of globalParams()in AcceptToMemoryPool in validation.cpp. (with changes in fuzz/tx_pool.cpp done in PR 23465)
- 20df92b
chainstate.m_paramsis used instead of globalParams()in validation.cpp inside functions like ProcessNewPackage(), ProcessNewBlockHeaders(), LoadMempool() and PopulateAndValidateSnapshot().- The function signature of
LoadBlockIndexDB()is changed to include the first argument asConsensus::Paramsand 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)?
20df92b to
8d44624
Compare
|
🐙 This pull request conflicts with the target branch and needs rebase. Want to unsubscribe from rebase notifications on this pull request? Just convert this pull request to a "draft". |
|
@lsilva01 are you still interested in working on this? |
|
Pretty sure this is already done in master? |
This PR removes calls to global
Params()in validation layer (except in theCChainStateconstructor).Motivation: Reducing the use of global variables makes code more predictable.
Requires #23437 as it changes the visibility of
CChainState::m_paramsto public.