-
Notifications
You must be signed in to change notification settings - Fork 37.7k
Add src/node/
and src/wallet/
code to node::
and wallet::
namespaces
#23497
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
Updated 768b695 -> 8c85a48 ( |
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. |
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.
tACK 8c85a48
The use of namespaces makes the code more organized and clearer.
TODO doesn't really make sense. It would turn some public global variables into private global variables, but really they shouldn't be global variables at all. They should be block manager member variables or chainstate manager member variables. TODO was added by MarcoFalke <falke.marco@gmail.com> in fa247a3 in bitcoin#21727 and noticed by Samuel Dobson <dobsonsa68@gmail.com> bitcoin#23497 (comment)
Rebased 76e3dda -> 4ee6861 ( |
If you remove the last commit, a conflict with #23974 can be avoided |
Sure, dropped commit. Updated 4ee6861 -> c776907 ( |
…_node.a 172096e scripted-diff: Rename libbitcoin_server.a to libbitcoin_node.a (Russell Yanofsky) Pull request description: Goal along with namespacing PR #23497 is to make code organization more obvious and have `src/node/` code in `node::` namespace in `libbitcoin_node.a` library ACKs for top commit: MarcoFalke: cr ACK 172096e Tree-SHA512: a2e787eeaa3ab769b0f5376473072cae584d237aa8b67b677bea833bb36b0134a0eca17eb01722389639473b8463f4953bc3a5e4801a6b2c8965ac1075cba005
CBlockFileInfo class is declared in src/chain.h, so move ToString definition to src/chain.cpp instead of src/node/blockstorage.cpp
ACK e5b6aef |
Concept ACK e5b6aef 🍨 Show signatureSignature:
|
Updated auxpow code for the new namespaces (e.g. where it uses miner functions that are now in node::), and added the wallet/rpc/auxpow code to the wallet:: namespace. This is in relation to upstream bitcoin/bitcoin#23497.
Updated name code for the new namespaces from upstream bitcoin/bitcoin#23497. The wallet/rpc/name code was added to wallet::.
Goal along with namespacing PR bitcoin#23497 is to have src/node/ code in node:: namespace in libbitcoin_node.a library -BEGIN VERIFY SCRIPT- bash -c ' # Bash shell needed for brace expansion {a,b} git mv build_msvc/libbitcoin_{server,node} git mv build_msvc/libbitcoin_node/libbitcoin_{server,node}.vcxproj.in ren() { git grep -l "$1" src build_msvc | xargs sed -i "s/$1/$2/g"; } ren LIBBITCOIN_{SERVER,NODE} ren libbitcoin_{server,node} ' -END VERIFY SCRIPT-
Goal along with namespacing PR bitcoin#23497 is to have src/node/ code in node:: namespace in libbitcoin_node.a library -BEGIN VERIFY SCRIPT- bash -c ' # Bash shell needed for brace expansion {a,b} git mv build_msvc/libbitcoin_{server,node} git mv build_msvc/libbitcoin_node/libbitcoin_{server,node}.vcxproj.in ren() { git grep -l "$1" src build_msvc | xargs sed -i "s/$1/$2/g"; } ren LIBBITCOIN_{SERVER,NODE} ren libbitcoin_{server,node} ' -END VERIFY SCRIPT-
Summary: Overall PR: > There are no code changes, this is just adding namespace and `using` declarations and `node::` or `wallet::` qualifiers in some places. > > Motivations for this change are: > > - To make it easier to see when node and wallet code is being accessed places where it shouldn't be. For example if GUI code is accessing node and wallet internals or if wallet and node code are referencing each other. > - To make source code organization clearer (core#15732), being able to know that `wallet::` code is in `src/wallet/`, `node:: code` is in `src/node/`, `init::` code is in `src/init/`, `util::` code is in `src/util/`, etc. > Notes: - CBlockIndexWorkComparator is not part of the node namespace for Bitcoin ABC because it is defined in its own header file rather than src/node/blockstorage.h - some fuzzers and minisketchwrapper.* changes are not applicable due to missing backports (see [[bitcoin/bitcoin#23114 | core#23114]]). This is a partial backport of [[bitcoin/bitcoin#23497 | core#23497]] bitcoin/bitcoin@90fc8b0 Test Plan: `ninja all check-all bitcoin-fuzzers bench-bitcoin` Reviewers: #bitcoin_abc, Fabien Reviewed By: #bitcoin_abc, Fabien Differential Revision: https://reviews.bitcoinabc.org/D12763
Summary: > CBlockFileInfo class is declared in src/chain.h, so move ToString > definition to src/chain.cpp instead of src/node/blockstorage.cpp `CBlockFileInfo` was moved to its own header file in D1654, so "where class is declared" is a new blockfileinfo.cpp file. The class is used in txdb.h and validation.h, which are both in the `server` library, so put this new file in this library as well. This is a partial backport of [[bitcoin/bitcoin#23497 | core#23497]] bitcoin/bitcoin@e5b6aef Test Plan: `ninja all check-all` Reviewers: #bitcoin_abc, sdulfari Reviewed By: #bitcoin_abc, sdulfari Differential Revision: https://reviews.bitcoinabc.org/D12768
There are no code changes, this is just adding
namespace
andusing
declarations andnode::
orwallet::
qualifiers in some places.Motivations for this change are:
wallet::
code is insrc/wallet/
,node::
code is insrc/node/
,init::
code is insrc/init/
,util::
code is insrc/util/
, etc.Reviewing with
git log -p -n1 -U0 --word-diff-regex=.
can be helpful to verify this is only updating declarations, not changing code.