-
Notifications
You must be signed in to change notification settings - Fork 38.8k
test: Replace gArgs with local argsman in bench #18662
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
fad6b6d to
facf901
Compare
-BEGIN VERIFY SCRIPT- sed -i -e 's/gArgs/argsman/g' src/bench/bench_bitcoin.cpp -END VERIFY SCRIPT-
facf901 to
fae00a7
Compare
promag
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.
Code review ACK fae00a7.
|
Concept ACK On behalf of future generations on Bitcoin Core developers: thanks for doing these cleanups - that will make their lives easier :) The short-term gain from each individual clean-up might seem small but the cumulative long-term gain will make a big difference. |
ryanofsky
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.
Code review ACK fae00a7
ryanofsky
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.
Code review ACK faf989f. Just new commit added restoring forward declaration
|
ACK faf989f. |
faf989f util: Document why ArgsManager (con/de)structor is not inline (MarcoFalke) fae00a7 bench: Remove unused argsman.ClearArgs (MarcoFalke) fa46aeb scripted-diff: Replace gArgs with local argsman in bench (MarcoFalke) fa2bc41 tools: Add unused argsman to bench_bitcoin (MarcoFalke) Pull request description: All utilities use the same gArgs global that the node uses. This is generally fine and does not lead to issues unless a bench test is going to spin up a NodeContext via the TestingSetup. In that case the two uses of gArgs conflict and currently it needs to be cleared: https://github.com/bitcoin/bitcoin/blob/544709763e1f45148d1926831e07ff03487673ee/src/bench/bench_bitcoin.cpp#L76 One solution would be to do nothing, because the current code works with that workaround. Another solution would be to not use the same global in all binaries. ACKs for top commit: promag: ACK faf989f. ryanofsky: Code review ACK faf989f. Just new commit added restoring forward declaration Tree-SHA512: 8ee4b28eee294d41c002f801fa844b0c23c919a3061f5109638701db0947b3b0ea28caa7311ae5f126fc660648bbaa0890853e6b06bdc5868692f52ba8c05f66
… args 8ed9002 refactor: use local argsmanager in CRegTestParams (Ivan Metlushko) 9b20f66 scripted-diff: Replace gArgs with local argsman (Ivan Metlushko) a316e9c refactor: add unused ArgsManager to replace gArgs (Ivan Metlushko) Pull request description: Rationale: reduce use of gArgs to decouple code and simplify future maintenance and easier unit testing. This PR is continuation of work started in #18926 and #18662 It covers only places that register args in ArgsManager with `AddArgs()` or `AddHiddenArgs()`. Closes #19511 ACKs for top commit: MarcoFalke: ACK 8ed9002 👛 Tree-SHA512: 7e6ba8e8357a48833c71e9c3942a769acb3d93bdcc6748a8ef2b7c4461a2499419b60896abf1d8b6bf8e88ee2590284cdd5da64220243ac22375300bcb8fe3e8
Summary: * tools: Add unused argsman to bench_bitcoin * scripted-diff: Replace gArgs with local argsman in bench -BEGIN VERIFY SCRIPT- sed -i -e 's/gArgs/argsman/g' src/bench/bench_bitcoin.cpp -END VERIFY SCRIPT- * bench: Remove unused argsman.ClearArgs * util: Document why ArgsManager (con/de)structor is not inline Backport of Core [[bitcoin/bitcoin#18662 | PR18662]] Test Plan: ninja bench-bitcoin Reviewers: #bitcoin_abc, Fabien Reviewed By: #bitcoin_abc, Fabien Subscribers: Fabien Differential Revision: https://reviews.bitcoinabc.org/D8079
All utilities use the same gArgs global that the node uses. This is generally fine and does not lead to issues unless a bench test is going to spin up a NodeContext via the TestingSetup. In that case the two uses of gArgs conflict and currently it needs to be cleared:
bitcoin/src/bench/bench_bitcoin.cpp
Line 76 in 5447097
One solution would be to do nothing, because the current code works with that workaround. Another solution would be to not use the same global in all binaries.