-
Notifications
You must be signed in to change notification settings - Fork 38.1k
src/node/miner cleanups, follow-ups for #26695 #26883
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
Avoid confusion with the global gArgs
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. ReviewsSee the guideline for information on the review process.
If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update. 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. |
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.
thanks for the followup, light review ACK c14cf65
Add Options as a member to BlockAssembler to avoid having to assign all the options individually. Additionally brings the struct more in line with how we typically define default and ArgManager values, as e.g. with ChainstateManager::Options and and CTxMemPool::Options
ApplyArgsManOptions does not need to set default values for missing arguments, these are already defined in the BlockAssembler::Options. This commit changes the interface of ApplyArgsManOptions(). If ApplyArgsManOptions() is called again after a option is changed, this option will no longer be reset to the default value. There is no observed behaviour change due to how ApplyArgsManOptions() is currently used, and the new interface is consistent with e.g. ValidationCacheSizes and MemPoolLimits.
c14cf65
to
6a5e88e
Compare
Force pushed to address review comments (thank you @ajtowns):
|
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.
Light code review ACK 6a5e88e
#ifndef BITCOIN_NODE_MINER_H | ||
#define BITCOIN_NODE_MINER_H | ||
|
||
#include <policy/policy.h> |
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.
Nit: IWYU says you can now remove this include from miner.cpp
ACK 6a5e88e |
Two follow-ups for #26695, both refactoring and no observed (*) behaviour change:
gArgs
toargs
because it's not actually a globalBlockAssembler::Options
as a (private) member toBlockAssembler
to avoid having to assign all the options individually, essentially duplicating themReduces LoC and makes the code more readable, in my opinion.
(*) as pointed out by ajtowns, this PR changes the interface of
ApplyArgsManOptions()
, making this not a pure refactoring PR. In practice,ApplyArgsManOptions()
is never called in such a way that this leads to observed behaviour change. Regardless, I've carved out the potential behaviour change into a separate commit and would be okay with dropping it, should it turn out to be controversial.