Page MenuHomePhabricator

walletdb: Move BDB specific things into bdb.{cpp/h}
ClosedPublic

Authored by Fabien on Dec 7 2020, 10:53.

Details

Reviewers
majcosta
Group Reviewers
Restricted Project
Commits
rABCbde835206696: walletdb: Move BDB specific things into bdb.{cpp/h}
Summary
Leave wallet/db.{cpp/h} for generic WalletDatabase stuff. The BDB
specific stuff goes into bdb.{cpp/h}

Completes backport (5/5) of core PR19290:
https://github.com/bitcoin/bitcoin/pull/19290/commits/61c16339da4e80b1320a6296df6d96cd7a84bb4e

Depends on D8614.

Test Plan
ninja all check-all

Event Timeline

Fabien requested review of this revision.Dec 7 2020, 10:53

Re-add missing interruption point

Tail of the build log:

[331/495] Linking C static library src/secp256k1/libsecp256k1.a
[332/495] Building CXX object src/test/CMakeFiles/testutil.dir/util/str.cpp.o
[333/495] Linking C executable src/secp256k1/internal-bench
[334/495] Linking C executable src/secp256k1/ecmult-bench
[335/495] Linking C executable src/secp256k1/sign-bench
[336/495] Linking C executable src/secp256k1/verify-bench
[337/495] Building CXX object src/test/CMakeFiles/testutil.dir/util/transaction_utils.cpp.o
[338/495] Building CXX object src/CMakeFiles/script.dir/script/descriptor.cpp.o
[339/495] Building CXX object src/CMakeFiles/script.dir/script/signingprovider.cpp.o
[340/495] Linking C executable src/secp256k1/recover-bench
[341/495] Linking CXX static library src/libscript.a
[342/495] Building CXX object src/test/CMakeFiles/testutil.dir/util/logging.cpp.o
[343/495] Linking CXX static library src/libcommon.a
[344/495] Building CXX object src/wallet/CMakeFiles/wallet.dir/context.cpp.o
[345/495] Linking CXX static library src/libbitcoinconsensus.a
[346/495] Linking CXX executable src/bitcoin-cli
[347/495] Linking CXX shared library src/libbitcoinconsensus.so.0.22.9
[348/495] Creating library symlink src/libbitcoinconsensus.so.0 src/libbitcoinconsensus.so
[349/495] Building CXX object src/CMakeFiles/bitcoin-tx.dir/bitcoin-tx.cpp.o
[350/495] Linking CXX executable src/bitcoin-tx
[351/495] Building CXX object src/wallet/CMakeFiles/wallet.dir/coinselection.cpp.o
[352/495] Building CXX object src/test/CMakeFiles/testutil.dir/util/blockfilter.cpp.o
[353/495] Building CXX object src/wallet/CMakeFiles/wallet.dir/bdb.cpp.o
FAILED: src/wallet/CMakeFiles/wallet.dir/bdb.cpp.o 
/usr/bin/cmake -E __run_co_compile --launcher=/usr/bin/ccache --tidy="/usr/bin/clang-tidy-8;-warnings-as-errors=*" --source=../../src/wallet/bdb.cpp -- /usr/bin/clang++  -DBOOST_AC_USE_STD_ATOMIC -DBOOST_SP_USE_STD_ATOMIC -DBUILD_BITCOIN_INTERNAL -DENABLE_AVX2 -DENABLE_SHANI -DENABLE_SSE41 -DHAVE_BUILD_INFO -DHAVE_CONFIG_H -DHAVE_CONSENSUS_LIB -I../../src/. -Isrc -I../../src/univalue/include -Isrc/crypto/.. -I../../src/secp256k1/include -isystem /usr/include/jemalloc -g -O2 -fPIC -fvisibility=hidden   -fstack-protector-all -Wstack-protector -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -Wall -Wextra -Wformat -Wvla -Wcast-align -Wunused-parameter -Wmissing-braces -Wthread-safety -Wshadow -Wshadow-field -Wrange-loop-analysis -Wredundant-decls -Wformat-security -Wredundant-move -Wno-unused-parameter -Wno-implicit-fallthrough -pthread -std=gnu++17 -MD -MT src/wallet/CMakeFiles/wallet.dir/bdb.cpp.o -MF src/wallet/CMakeFiles/wallet.dir/bdb.cpp.o.d -o src/wallet/CMakeFiles/wallet.dir/bdb.cpp.o -c ../../src/wallet/bdb.cpp
/work/abc-ci-builds/build-clang-tidy/../../src/wallet/bdb.cpp:457:19: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]
    if (activeTxn) return;
                  ^
                   {
3207 warnings generated.
Suppressed 3206 warnings (3206 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
1 warning treated as error
[354/495] Building CXX object src/wallet/CMakeFiles/wallet.dir/coincontrol.cpp.o
[355/495] Building CXX object src/test/CMakeFiles/testutil.dir/util/mining.cpp.o
[356/495] Building CXX object src/wallet/CMakeFiles/wallet.dir/crypter.cpp.o
[357/495] Building CXX object src/test/CMakeFiles/testutil.dir/util/setup_common.cpp.o
[358/495] Building CXX object src/wallet/CMakeFiles/wallet.dir/db.cpp.o
[359/495] Building CXX object src/CMakeFiles/server.dir/wallet/init.cpp.o
[360/495] Building CXX object src/seeder/CMakeFiles/seeder.dir/bitcoin.cpp.o
[361/495] Building CXX object src/wallet/CMakeFiles/wallet.dir/walletutil.cpp.o
[362/495] Building CXX object src/seeder/CMakeFiles/seeder.dir/dns.cpp.o
[363/495] Building CXX object src/seeder/CMakeFiles/seeder.dir/db.cpp.o
[364/495] Linking CXX static library src/seeder/libseeder.a
[365/495] Building CXX object src/CMakeFiles/bitcoin-wallet.dir/bitcoin-wallet.cpp.o
[366/495] Building CXX object src/seeder/CMakeFiles/bitcoin-seeder.dir/main.cpp.o
[367/495] Linking CXX executable src/seeder/bitcoin-seeder
[368/495] Building CXX object src/test/CMakeFiles/testutil.dir/util/wallet.cpp.o
[369/495] Building CXX object src/wallet/CMakeFiles/wallet.dir/fees.cpp.o
[370/495] Building CXX object src/wallet/CMakeFiles/wallet.dir/load.cpp.o
[371/495] Building CXX object src/wallet/CMakeFiles/wallet-tool.dir/wallettool.cpp.o
[372/495] Building CXX object src/wallet/CMakeFiles/wallet.dir/salvage.cpp.o
[373/495] Building CXX object src/wallet/CMakeFiles/wallet.dir/__/interfaces/wallet.cpp.o
[374/495] Building CXX object src/wallet/CMakeFiles/wallet.dir/walletdb.cpp.o
[375/495] Building CXX object src/wallet/CMakeFiles/wallet.dir/scriptpubkeyman.cpp.o
[376/495] Building CXX object src/wallet/CMakeFiles/wallet.dir/rpcdump.cpp.o
[377/495] Building CXX object src/wallet/CMakeFiles/wallet.dir/wallet.cpp.o
[378/495] Building CXX object src/wallet/CMakeFiles/wallet.dir/rpcwallet.cpp.o
ninja: build stopped: cannot make progress due to previous errors.
Build build-clang-tidy failed with exit code 1

Tail of the build log:

[331/495] Building CXX object src/CMakeFiles/bitcoinconsensus.dir/util/strencodings.cpp.o
[332/495] Building CXX object src/CMakeFiles/bitcoinconsensus.dir/pubkey.cpp.o
[333/495] Building CXX object src/CMakeFiles/bitcoin-tx.dir/bitcoin-tx.cpp.o
[334/495] Building CXX object src/wallet/CMakeFiles/wallet.dir/context.cpp.o
[335/495] Building CXX object src/test/CMakeFiles/testutil.dir/util/logging.cpp.o
[336/495] Building CXX object src/test/CMakeFiles/testutil.dir/util/transaction_utils.cpp.o
[337/495] Building CXX object src/wallet/CMakeFiles/wallet.dir/bdb.cpp.o
FAILED: src/wallet/CMakeFiles/wallet.dir/bdb.cpp.o 
/usr/bin/cmake -E __run_co_compile --launcher=/usr/bin/ccache --tidy="/usr/bin/clang-tidy-8;-warnings-as-errors=*" --source=../../src/wallet/bdb.cpp -- /usr/bin/clang++  -DBOOST_AC_USE_STD_ATOMIC -DBOOST_SP_USE_STD_ATOMIC -DBUILD_BITCOIN_INTERNAL -DENABLE_AVX2 -DENABLE_SHANI -DENABLE_SSE41 -DHAVE_BUILD_INFO -DHAVE_CONFIG_H -DHAVE_CONSENSUS_LIB -I../../src/. -Isrc -I../../src/univalue/include -Isrc/crypto/.. -I../../src/secp256k1/include -isystem /usr/include/jemalloc -g -O2 -fPIC -fvisibility=hidden   -fstack-protector-all -Wstack-protector -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -Wall -Wextra -Wformat -Wvla -Wcast-align -Wunused-parameter -Wmissing-braces -Wthread-safety -Wshadow -Wshadow-field -Wrange-loop-analysis -Wredundant-decls -Wformat-security -Wredundant-move -Wno-unused-parameter -Wno-implicit-fallthrough -pthread -std=gnu++17 -MD -MT src/wallet/CMakeFiles/wallet.dir/bdb.cpp.o -MF src/wallet/CMakeFiles/wallet.dir/bdb.cpp.o.d -o src/wallet/CMakeFiles/wallet.dir/bdb.cpp.o -c ../../src/wallet/bdb.cpp
/work/abc-ci-builds/build-clang-tidy/../../src/wallet/bdb.cpp:457:19: error: statement should be inside braces [readability-braces-around-statements,-warnings-as-errors]
    if (activeTxn) return;
                  ^
                   {
3207 warnings generated.
Suppressed 3206 warnings (3206 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
1 warning treated as error
[338/495] Building CXX object src/CMakeFiles/util.dir/util/time.cpp.o
[339/495] Building CXX object src/wallet/CMakeFiles/wallet.dir/db.cpp.o
[340/495] Building CXX object src/test/CMakeFiles/testutil.dir/util/blockfilter.cpp.o
[341/495] Building CXX object src/wallet/CMakeFiles/wallet.dir/coincontrol.cpp.o
[342/495] Building CXX object src/wallet/CMakeFiles/wallet.dir/coinselection.cpp.o
[343/495] Building CXX object src/wallet/CMakeFiles/wallet.dir/crypter.cpp.o
[344/495] Building CXX object src/test/CMakeFiles/testutil.dir/util/mining.cpp.o
[345/495] Building CXX object src/test/CMakeFiles/testutil.dir/util/wallet.cpp.o
[346/495] Building CXX object src/CMakeFiles/util.dir/util/system.cpp.o
[347/495] Linking CXX static library src/libutil.a
[348/495] Linking CXX static library src/libscript.a
[349/495] Linking CXX static library src/libcommon.a
[350/495] Linking CXX static library src/librpcclient.a
[351/495] Linking CXX executable src/bitcoin-cli
[352/495] Linking CXX static library src/libbitcoinconsensus.a
[353/495] Linking CXX shared library src/libbitcoinconsensus.so.0.22.9
[354/495] Creating library symlink src/libbitcoinconsensus.so.0 src/libbitcoinconsensus.so
[355/495] Building CXX object src/zmq/CMakeFiles/zmq.dir/zmqabstractnotifier.cpp.o
[356/495] Linking CXX executable src/bitcoin-tx
[357/495] Building CXX object src/wallet/CMakeFiles/wallet.dir/fees.cpp.o
[358/495] Building CXX object src/test/CMakeFiles/testutil.dir/util/setup_common.cpp.o
[359/495] Building CXX object src/wallet/CMakeFiles/wallet.dir/load.cpp.o
[360/495] Building CXX object src/wallet/CMakeFiles/wallet-tool.dir/wallettool.cpp.o
[361/495] Building CXX object src/seeder/CMakeFiles/seeder.dir/dns.cpp.o
[362/495] Building CXX object src/seeder/CMakeFiles/seeder.dir/bitcoin.cpp.o
[363/495] Building CXX object src/wallet/CMakeFiles/wallet.dir/walletutil.cpp.o
[364/495] Building CXX object src/zmq/CMakeFiles/zmq.dir/zmqnotificationinterface.cpp.o
[365/495] Building CXX object src/seeder/CMakeFiles/seeder.dir/db.cpp.o
[366/495] Linking CXX static library src/seeder/libseeder.a
[367/495] Building CXX object src/zmq/CMakeFiles/zmq.dir/zmqpublishnotifier.cpp.o
[368/495] Building CXX object src/wallet/CMakeFiles/wallet.dir/__/interfaces/wallet.cpp.o
[369/495] Building CXX object src/wallet/CMakeFiles/wallet.dir/salvage.cpp.o
[370/495] Building CXX object src/zmq/CMakeFiles/zmq.dir/zmqrpc.cpp.o
[371/495] Linking CXX static library src/zmq/libzmq.a
[372/495] Building CXX object src/seeder/CMakeFiles/bitcoin-seeder.dir/main.cpp.o
[373/495] Linking CXX executable src/seeder/bitcoin-seeder
[374/495] Building CXX object src/wallet/CMakeFiles/wallet.dir/scriptpubkeyman.cpp.o
[375/495] Building CXX object src/wallet/CMakeFiles/wallet.dir/walletdb.cpp.o
[376/495] Building CXX object src/wallet/CMakeFiles/wallet.dir/rpcdump.cpp.o
[377/495] Building CXX object src/wallet/CMakeFiles/wallet.dir/rpcwallet.cpp.o
[378/495] Building CXX object src/wallet/CMakeFiles/wallet.dir/wallet.cpp.o
ninja: build stopped: cannot make progress due to previous errors.
Build build-clang-tidy failed with exit code 1

Failed tests logs:

====== Bitcoin ABC functional tests: p2p_timeouts.py ======

------- Stdout: -------
2020-12-07T11:18:36.530000Z TestFramework (INFO): Initializing test directory /work/abc-ci-builds/build-without-wallet/test/tmp/test_runner_₿₵_  _20201207_111752/p2p_timeouts_94
2020-12-07T11:18:41.866000Z TestFramework (ERROR): Assertion failed
Traceback (most recent call last):
  File "/work/test/functional/test_framework/test_framework.py", line 120, in main
    self.run_test()
  File "/work/test/functional/p2p_timeouts.py", line 89, in run_test
    assert not no_verack_node.is_connected
AssertionError
2020-12-07T11:18:45.633000Z TestFramework (INFO): Stopping nodes
2020-12-07T11:18:52.304000Z TestFramework (WARNING): Not cleaning up dir /work/abc-ci-builds/build-without-wallet/test/tmp/test_runner_₿₵_  _20201207_111752/p2p_timeouts_94
2020-12-07T11:18:52.304000Z TestFramework (ERROR): Test failed. Test logging available at /work/abc-ci-builds/build-without-wallet/test/tmp/test_runner_₿₵_  _20201207_111752/p2p_timeouts_94/test_framework.log
2020-12-07T11:18:52.305000Z TestFramework (ERROR): Hint: Call /work/test/functional/combine_logs.py '/work/abc-ci-builds/build-without-wallet/test/tmp/test_runner_₿₵_  _20201207_111752/p2p_timeouts_94' to consolidate all logs

Each failure log is accessible here:
Bitcoin ABC functional tests: p2p_timeouts.py

Various formatting nits

This revision is now accepted and ready to land.Dec 7 2020, 14:46