-
Notifications
You must be signed in to change notification settings - Fork 38.1k
refactor: move policy constants to policy #25388
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
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.
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
Same question as #25388 (comment), but otherwise ed3a181 lgtm. And maybe move |
Added. |
ed3a181
to
28487b4
Compare
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. |
Concept ACK |
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.
Code Review ACK 28487b4
I've browsed few more files like txmempool,cpp
, txorphanage.cpp
, validationinterfaces.cpp
to see if we had not other random policy-related variables lost in the wrong garden.
cc @ariard, I think you had some ideas about organizing policy settings?
Sure though, I think it can be carry-on as a follow-up or elsewhere. That PR is already a step forward in term of codebase organization by sorting out policy variables from consensus/validation. It would be nice too in the future to document some missing variables like DUST_RELAY_TX_FEE
in policy/mempool-limits.md
Looks like this is 100% conflicting with:
So it might be best to figure out which approach should be taken. |
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.
ACK 28487b4
At the least it would be good to wait for a comment by @dongcarl . It seems absurd that we need to rush this change in to move some constants to one file when a later change moves all of them to a different file again. |
I think it's likely fine to move these constants to If I were to to build #25290 on top of this PR's changes (done here), we'd just have One thing we should do in this PR is to move the following static assertions in Lines 70 to 77 in e5df0ba
Perhaps we could also followup by making sure that the user doesn't supply us with limits which violate these assertions if we don't already do so. |
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.
What was the need to change the constant
s to consexpr
?
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.
Code Review ACK 28487b4
These changes also optimize the code with constexpr
and braced initialization.
@Riahiamirreza it's an optimization. |
-BEGIN VERIFY SCRIPT- sed -i -e "s/static const /static constexpr /" src/policy/policy.h -END VERIFY SCRIPT-
28487b4
to
0d8e68d
Compare
Added a commit to move these into package.h. |
Code review ACK 0d8e68d |
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.
reACK 0d8e68d
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.
ACK 0d8e68d
I think it's likely fine to move these constants to src/policy/policy.h if they indeed logically belong as part of policy
In my opinion they do.
Picks up #25295. Which was a follow up to a comment in #25254.
Moves policy constants from validation.h to policy.h.