Page MenuHomePhabricator

validation: Stricter assumeutxo error handling when renaming chainstates
ClosedPublic

Authored by PiRK on Mar 4 2024, 16:10.

Details

Summary

validation: Stricter assumeutxo error handling in LoadChainstate

Make LoadChainstate return an explicit error when snapshot validation succeeds,
but there is an error trying to replace the background chainstate with the
snapshot chainstate. Previously in this case LoadChainstate would trigger a
shutdown and return INTERRUPTED, now it will return an actual error code.

There's no real change to behavior other than error message being formatted a
little differently.

Motivation for this change is to replace error handling via callbacks with
error handling via return value ahead of
https://github.com/bitcoin/bitcoin/pull/27861

https://github.com/bitcoin/bitcoin/pull/27862/commits/1c7d08b9acd33aff343228ada7e058e606cb1062

validation: Stricter assumeutxo error handling in InvalidateCoinsDBOnDisk

Currently InvalidateCoinsDBOnDisk is calling AbortNode without an error to the
caller if it fails. Change it to return just return util::Result, and update
the caller to handle the error itself.

This causes the secondary error to be shown below the main error instead of the
other way around.

https://github.com/bitcoin/bitcoin/pull/27862/commits/1c7d08b9acd33aff343228ada7e058e606cb1062

This is a backport of core#27862

Test Plan

The only change in behavior is the order of the error messages in logs, but there are currently no tests for these error messages, and there is currently no easy way to test this.
Just check that the code still compiles and does not break existing tested behavior.
ninja all check-all

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

PiRK requested review of this revision.Mar 4 2024, 16:10

Tail of the build log:

      |     ^~~~~~~~
/usr/include/c++/9/complex:552:5: note:   template argument deduction/substitution failed:
In file included from ../../src/./fs.h:8,
                 from ../../src/./flatfile.h:9,
                 from ../../src/./blockindex.h:10,
                 from ../../src/./blockindexcomparators.h:8,
                 from ../../src/./validation.h:17,
                 from ../../src/validation.cpp:7:
../../src/./tinyformat.h:291:13: note:   ‘const bilingual_str’ is not derived from ‘const std::complex<_Tp>’
  291 |         tmp << value;
      |         ~~~~^~~~~~~~
[374/545] Building CXX object src/test/CMakeFiles/testutil.dir/util/str.cpp.o
[375/545] Building CXX object src/test/CMakeFiles/testutil.dir/util/transaction_utils.cpp.o
[376/545] Building CXX object src/CMakeFiles/server.dir/torcontrol.cpp.o
[377/545] Building CXX object src/test/CMakeFiles/testutil.dir/util/wallet.cpp.o
[378/545] Building CXX object src/wallet/CMakeFiles/wallet.dir/bdb.cpp.o
[379/545] Building CXX object src/wallet/CMakeFiles/wallet.dir/coincontrol.cpp.o
[380/545] Building CXX object src/wallet/CMakeFiles/wallet.dir/coinselection.cpp.o
[381/545] Building CXX object src/wallet/CMakeFiles/wallet.dir/context.cpp.o
[382/545] Building CXX object src/wallet/CMakeFiles/wallet.dir/crypter.cpp.o
[383/545] Building CXX object src/wallet/CMakeFiles/wallet-tool.dir/wallettool.cpp.o
[384/545] Building CXX object src/wallet/CMakeFiles/wallet.dir/db.cpp.o
[385/545] Building CXX object src/wallet/CMakeFiles/wallet.dir/fees.cpp.o
[386/545] Building CXX object src/wallet/CMakeFiles/wallet.dir/interfaces.cpp.o
[387/545] Building CXX object src/wallet/CMakeFiles/wallet.dir/load.cpp.o
[388/545] Building CXX object src/wallet/CMakeFiles/wallet.dir/receive.cpp.o
[389/545] Building CXX object src/wallet/CMakeFiles/wallet.dir/rpcwallet.cpp.o
[390/545] Building CXX object src/wallet/CMakeFiles/wallet.dir/rpc/backup.cpp.o
[391/545] Building CXX object src/wallet/CMakeFiles/wallet.dir/rpc/encrypt.cpp.o
[392/545] Building CXX object src/wallet/CMakeFiles/wallet.dir/rpc/signmessage.cpp.o
[393/545] Building CXX object src/wallet/CMakeFiles/wallet.dir/rpc/util.cpp.o
[394/545] Building CXX object src/wallet/CMakeFiles/wallet.dir/salvage.cpp.o
[395/545] Building CXX object src/wallet/CMakeFiles/wallet.dir/scriptpubkeyman.cpp.o
[396/545] Building CXX object src/wallet/CMakeFiles/wallet.dir/spend.cpp.o
[397/545] Building CXX object src/wallet/CMakeFiles/wallet.dir/sqlite.cpp.o
[398/545] Building CXX object src/wallet/CMakeFiles/wallet.dir/transaction.cpp.o
[399/545] Building CXX object src/wallet/CMakeFiles/wallet.dir/wallet.cpp.o
[400/545] Building CXX object src/wallet/CMakeFiles/wallet.dir/walletdb.cpp.o
[401/545] Building CXX object src/wallet/CMakeFiles/wallet.dir/walletutil.cpp.o
[402/545] Building CXX object src/CMakeFiles/server.dir/rpc/net.cpp.o
[403/545] Building CXX object src/CMakeFiles/server.dir/rpc/avalanche.cpp.o
[404/545] Building CXX object src/seeder/CMakeFiles/seeder-base.dir/db.cpp.o
[405/545] Building CXX object src/seeder/CMakeFiles/seeder-base.dir/dns.cpp.o
[406/545] Building CXX object src/seeder/CMakeFiles/seeder-base.dir/options.cpp.o
[407/545] Building CXX object src/seeder/CMakeFiles/bitcoin-seeder.dir/main.cpp.o
[408/545] Building CXX object src/test/CMakeFiles/testutil.dir/util/blockfilter.cpp.o
[409/545] Linking CXX static library src/wallet/libwallet.a
[410/545] Building CXX object src/CMakeFiles/server.dir/txmempool.cpp.o
[411/545] Building CXX object src/CMakeFiles/server.dir/wallet/init.cpp.o
[412/545] Building CXX object src/test/CMakeFiles/testutil.dir/util/net.cpp.o
[413/545] Building CXX object src/test/CMakeFiles/testutil.dir/util/validation.cpp.o
[414/545] Building CXX object src/test/CMakeFiles/testutil.dir/util/mining.cpp.o
[415/545] Building CXX object src/CMakeFiles/server.dir/init.cpp.o
[416/545] Building CXX object src/seeder/CMakeFiles/seeder-base.dir/bitcoin.cpp.o
[417/545] Building CXX object src/test/CMakeFiles/testutil.dir/util/setup_common.cpp.o
[418/545] Building CXX object src/CMakeFiles/server.dir/rpc/rawtransaction.cpp.o
[419/545] Building CXX object src/CMakeFiles/server.dir/net_processing.cpp.o
[420/545] Building CXX object src/CMakeFiles/server.dir/rpc/blockchain.cpp.o
ninja: build stopped: cannot make progress due to previous errors.
Build build-diff failed with exit code 1

Tail of the build log:

                 from /usr/include/boost/multi_index/hashed_index.hpp:43,
                 from ../../src/./txmempool.h:22,
                 from ../../src/./validation.h:35,
                 from ../../src/validation.cpp:7:
/usr/include/c++/9/complex:552:5: note: candidate: ‘template<class _Tp, class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(std::basic_ostream<_CharT, _Traits>&, const std::complex<_Tp>&)’
  552 |     operator<<(basic_ostream<_CharT, _Traits>& __os, const complex<_Tp>& __x)
      |     ^~~~~~~~
/usr/include/c++/9/complex:552:5: note:   template argument deduction/substitution failed:
In file included from ../../src/./fs.h:8,
                 from ../../src/./flatfile.h:9,
                 from ../../src/./blockindex.h:10,
                 from ../../src/./blockindexcomparators.h:8,
                 from ../../src/./validation.h:17,
                 from ../../src/validation.cpp:7:
../../src/./tinyformat.h:291:13: note:   ‘const bilingual_str’ is not derived from ‘const std::complex<_Tp>’
  291 |         tmp << value;
      |         ~~~~^~~~~~~~
[380/545] Building CXX object src/CMakeFiles/server.dir/torcontrol.cpp.o
[381/545] Building CXX object src/wallet/CMakeFiles/wallet.dir/context.cpp.o
[382/545] Building CXX object src/test/CMakeFiles/testutil.dir/util/transaction_utils.cpp.o
[383/545] Building CXX object src/test/CMakeFiles/testutil.dir/util/blockfilter.cpp.o
[384/545] Building CXX object src/CMakeFiles/server.dir/txmempool.cpp.o
[385/545] Linking CXX executable src/bitcoin-tx
[386/545] Building CXX object src/wallet/CMakeFiles/wallet.dir/coincontrol.cpp.o
[387/545] Building CXX object src/test/CMakeFiles/testutil.dir/util/mining.cpp.o
[388/545] Building CXX object src/wallet/CMakeFiles/wallet.dir/db.cpp.o
[389/545] Building CXX object src/wallet/CMakeFiles/wallet.dir/bdb.cpp.o
[390/545] Building CXX object src/wallet/CMakeFiles/wallet.dir/coinselection.cpp.o
[391/545] Building CXX object src/test/CMakeFiles/testutil.dir/util/validation.cpp.o
[392/545] Building CXX object src/CMakeFiles/server.dir/wallet/init.cpp.o
[393/545] Building CXX object src/test/CMakeFiles/testutil.dir/util/net.cpp.o
[394/545] Building CXX object src/wallet/CMakeFiles/wallet.dir/crypter.cpp.o
[395/545] Building CXX object src/test/CMakeFiles/testutil.dir/util/wallet.cpp.o
[396/545] Building CXX object src/test/CMakeFiles/testutil.dir/util/setup_common.cpp.o
[397/545] Building CXX object src/wallet/CMakeFiles/wallet.dir/fees.cpp.o
[398/545] Building CXX object src/wallet/CMakeFiles/wallet.dir/sqlite.cpp.o
[399/545] Building CXX object src/wallet/CMakeFiles/wallet-tool.dir/wallettool.cpp.o
[400/545] Building CXX object src/wallet/CMakeFiles/wallet.dir/load.cpp.o
[401/545] Building CXX object src/wallet/CMakeFiles/wallet.dir/receive.cpp.o
[402/545] Building CXX object src/wallet/CMakeFiles/wallet.dir/rpc/signmessage.cpp.o
[403/545] Building CXX object src/wallet/CMakeFiles/wallet.dir/rpc/encrypt.cpp.o
[404/545] Building CXX object src/wallet/CMakeFiles/wallet.dir/rpc/util.cpp.o
[405/545] Building CXX object src/wallet/CMakeFiles/wallet.dir/transaction.cpp.o
[406/545] Building CXX object src/seeder/CMakeFiles/seeder-base.dir/dns.cpp.o
[407/545] Building CXX object src/wallet/CMakeFiles/wallet.dir/salvage.cpp.o
[408/545] Building CXX object src/wallet/CMakeFiles/wallet.dir/interfaces.cpp.o
[409/545] Building CXX object src/seeder/CMakeFiles/seeder-base.dir/db.cpp.o
[410/545] Building CXX object src/wallet/CMakeFiles/wallet.dir/walletutil.cpp.o
[411/545] Building CXX object src/wallet/CMakeFiles/wallet.dir/spend.cpp.o
[412/545] Building CXX object src/seeder/CMakeFiles/seeder-base.dir/options.cpp.o
[413/545] Building CXX object src/wallet/CMakeFiles/wallet.dir/rpc/backup.cpp.o
[414/545] Building CXX object src/wallet/CMakeFiles/wallet.dir/scriptpubkeyman.cpp.o
[415/545] Building CXX object src/seeder/CMakeFiles/bitcoin-seeder.dir/main.cpp.o
[416/545] Building CXX object src/seeder/CMakeFiles/seeder-base.dir/bitcoin.cpp.o
[417/545] Building CXX object src/wallet/CMakeFiles/wallet.dir/rpcwallet.cpp.o
[418/545] Building CXX object src/wallet/CMakeFiles/wallet.dir/walletdb.cpp.o
[419/545] Building CXX object src/wallet/CMakeFiles/wallet.dir/wallet.cpp.o
[420/545] Linking CXX static library src/wallet/libwallet.a
ninja: build stopped: cannot make progress due to previous errors.
Build build-debug failed with exit code 1

The MaybeCompleteSnapshotValidation function is covered by unit tests, but this kind of error behavior would require a functional test, which are only added in later PRs.

PiRK planned changes to this revision.Mar 4 2024, 16:15

Tail of the build log:

      operator<<(const void* __p)
      ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/ostream:250:7: note: candidate function not viable: no known conversion from 'const bilingual_str' to 'std::nullptr_t' (aka 'nullptr_t') for 1st argument
      operator<<(nullptr_t)
      ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/ostream:276:7: note: candidate function not viable: no known conversion from 'const bilingual_str' to 'std::basic_ostream<char>::__streambuf_type *' (aka 'basic_streambuf<char> *') for 1st argument
      operator<<(__streambuf_type* __sb);
      ^
2 errors generated.
[372/545] Building CXX object src/test/CMakeFiles/testutil.dir/util/wallet.cpp.o
[373/545] Building CXX object src/wallet/CMakeFiles/wallet.dir/bdb.cpp.o
[374/545] Building CXX object src/wallet/CMakeFiles/wallet.dir/coincontrol.cpp.o
[375/545] Building CXX object src/test/CMakeFiles/testutil.dir/util/blockfilter.cpp.o
[376/545] Building CXX object src/wallet/CMakeFiles/wallet.dir/context.cpp.o
[377/545] Building CXX object src/wallet/CMakeFiles/wallet.dir/crypter.cpp.o
[378/545] Building CXX object src/wallet/CMakeFiles/wallet.dir/db.cpp.o
[379/545] Building CXX object src/wallet/CMakeFiles/wallet-tool.dir/wallettool.cpp.o
[380/545] Building CXX object src/wallet/CMakeFiles/wallet.dir/fees.cpp.o
[381/545] Building CXX object src/wallet/CMakeFiles/wallet.dir/interfaces.cpp.o
[382/545] Building CXX object src/wallet/CMakeFiles/wallet.dir/load.cpp.o
[383/545] Building CXX object src/wallet/CMakeFiles/wallet.dir/receive.cpp.o
[384/545] Building CXX object src/wallet/CMakeFiles/wallet.dir/rpcwallet.cpp.o
[385/545] Building CXX object src/wallet/CMakeFiles/wallet.dir/rpc/backup.cpp.o
[386/545] Building CXX object src/wallet/CMakeFiles/wallet.dir/rpc/encrypt.cpp.o
[387/545] Linking CXX static library src/libscript.a
[388/545] Building CXX object src/wallet/CMakeFiles/wallet.dir/rpc/signmessage.cpp.o
[389/545] Building CXX object src/CMakeFiles/server.dir/rpc/avalanche.cpp.o
[390/545] Building CXX object src/wallet/CMakeFiles/wallet.dir/coinselection.cpp.o
[391/545] Building CXX object src/wallet/CMakeFiles/wallet.dir/rpc/util.cpp.o
[392/545] Building CXX object src/test/CMakeFiles/testutil.dir/util/str.cpp.o
[393/545] Building CXX object src/wallet/CMakeFiles/wallet.dir/salvage.cpp.o
[394/545] Building CXX object src/wallet/CMakeFiles/wallet.dir/scriptpubkeyman.cpp.o
[395/545] Building CXX object src/wallet/CMakeFiles/wallet.dir/sqlite.cpp.o
[396/545] Linking CXX static library src/libbitcoinconsensus.a
[397/545] Building CXX object src/wallet/CMakeFiles/wallet.dir/spend.cpp.o
[398/545] Building CXX object src/wallet/CMakeFiles/wallet.dir/transaction.cpp.o
[399/545] Building CXX object src/wallet/CMakeFiles/wallet.dir/walletdb.cpp.o
[400/545] Building CXX object src/wallet/CMakeFiles/wallet.dir/wallet.cpp.o
[401/545] Building CXX object src/wallet/CMakeFiles/wallet.dir/walletutil.cpp.o
[402/545] Linking CXX shared library src/libbitcoinconsensus.so.0.28.10
[403/545] Creating library symlink src/libbitcoinconsensus.so.0 src/libbitcoinconsensus.so
[404/545] Building CXX object src/seeder/CMakeFiles/seeder-base.dir/db.cpp.o
[405/545] Linking CXX executable src/bitcoin-tx
[406/545] Linking CXX executable src/bitcoin-cli
[407/545] Building CXX object src/seeder/CMakeFiles/seeder-base.dir/dns.cpp.o
[408/545] Building CXX object src/seeder/CMakeFiles/seeder-base.dir/options.cpp.o
[409/545] Building CXX object src/seeder/CMakeFiles/bitcoin-seeder.dir/main.cpp.o
[410/545] Linking CXX static library src/wallet/libwallet.a
[411/545] Building CXX object src/CMakeFiles/server.dir/wallet/init.cpp.o
[412/545] Building CXX object src/test/CMakeFiles/testutil.dir/util/mining.cpp.o
[413/545] Building CXX object src/test/CMakeFiles/testutil.dir/util/net.cpp.o
[414/545] Building CXX object src/CMakeFiles/server.dir/txmempool.cpp.o
[415/545] Building CXX object src/test/CMakeFiles/testutil.dir/util/validation.cpp.o
[416/545] Building CXX object src/CMakeFiles/server.dir/rpc/blockchain.cpp.o
[417/545] Building CXX object src/CMakeFiles/server.dir/rpc/rawtransaction.cpp.o
[418/545] Building CXX object src/seeder/CMakeFiles/seeder-base.dir/bitcoin.cpp.o
[419/545] Building CXX object src/test/CMakeFiles/testutil.dir/util/setup_common.cpp.o
[420/545] Building CXX object src/CMakeFiles/server.dir/net_processing.cpp.o
ninja: build stopped: cannot make progress due to previous errors.
Build build-clang failed with exit code 1

Tail of the build log:

[362/543] Creating library symlink src/libbitcoinconsensus.so.0 src/libbitcoinconsensus.so
[363/543] Linking C executable src/secp256k1/recover-bench
[364/543] Linking C executable src/secp256k1/verify-bench
[365/543] Linking C executable src/secp256k1/sign-bench
[366/543] Building CXX object src/test/CMakeFiles/testutil.dir/util/blockindex.cpp.o
[367/543] Building C object src/secp256k1/CMakeFiles/ecmult-bench.dir/src/bench_ecmult.c.o
[368/543] Linking C executable src/secp256k1/ecmult-bench
[369/543] Building C object src/secp256k1/CMakeFiles/internal-bench.dir/src/bench_internal.c.o
[370/543] Linking C executable src/secp256k1/internal-bench
[371/543] Building CXX object src/CMakeFiles/server.dir/torcontrol.cpp.o
[372/543] Building CXX object src/CMakeFiles/server.dir/net_processing.cpp.o
[373/543] Building CXX object src/test/CMakeFiles/testutil.dir/util/logging.cpp.o
[374/543] Building CXX object src/test/CMakeFiles/testutil.dir/util/str.cpp.o
[375/543] Building CXX object src/CMakeFiles/bitcoin-cli.dir/bitcoin-cli.cpp.o
[376/543] Linking CXX executable src/bitcoin-cli
[377/543] Building CXX object src/CMakeFiles/server.dir/rpc/rawtransaction.cpp.o
[378/543] Building CXX object src/CMakeFiles/server.dir/rpc/blockchain.cpp.o
[379/543] Building CXX object src/CMakeFiles/server.dir/txmempool.cpp.o
[380/543] Building CXX object src/wallet/CMakeFiles/wallet.dir/context.cpp.o
[381/543] Building CXX object src/test/CMakeFiles/testutil.dir/util/blockfilter.cpp.o
[382/543] Building CXX object src/test/CMakeFiles/testutil.dir/util/transaction_utils.cpp.o
[383/543] Building CXX object src/CMakeFiles/server.dir/wallet/init.cpp.o
[384/543] Building CXX object src/wallet/CMakeFiles/wallet.dir/coincontrol.cpp.o
[385/543] Building CXX object src/wallet/CMakeFiles/wallet.dir/db.cpp.o
[386/543] Building CXX object src/CMakeFiles/bitcoin-tx.dir/bitcoin-tx.cpp.o
[387/543] Linking CXX executable src/bitcoin-tx
[388/543] Building CXX object src/wallet/CMakeFiles/wallet.dir/crypter.cpp.o
[389/543] Building CXX object src/test/CMakeFiles/testutil.dir/util/validation.cpp.o
[390/543] Building CXX object src/test/CMakeFiles/testutil.dir/util/mining.cpp.o
[391/543] Building CXX object src/wallet/CMakeFiles/wallet.dir/bdb.cpp.o
[392/543] Building CXX object src/test/CMakeFiles/testutil.dir/util/net.cpp.o
[393/543] Building CXX object src/wallet/CMakeFiles/wallet.dir/coinselection.cpp.o
[394/543] Building CXX object src/test/CMakeFiles/testutil.dir/util/wallet.cpp.o
[395/543] Building CXX object src/test/CMakeFiles/testutil.dir/util/setup_common.cpp.o
[396/543] Building CXX object src/wallet/CMakeFiles/wallet.dir/fees.cpp.o
[397/543] Building CXX object src/wallet/CMakeFiles/wallet.dir/load.cpp.o
[398/543] Building CXX object src/wallet/CMakeFiles/wallet.dir/receive.cpp.o
[399/543] Building CXX object src/wallet/CMakeFiles/wallet-tool.dir/wallettool.cpp.o
[400/543] Building CXX object src/wallet/CMakeFiles/wallet.dir/rpc/util.cpp.o
[401/543] Building CXX object src/wallet/CMakeFiles/wallet.dir/sqlite.cpp.o
[402/543] Building CXX object src/wallet/CMakeFiles/wallet.dir/rpc/signmessage.cpp.o
[403/543] Building CXX object src/wallet/CMakeFiles/wallet.dir/transaction.cpp.o
[404/543] Building CXX object src/wallet/CMakeFiles/wallet.dir/rpc/encrypt.cpp.o
[405/543] Building CXX object src/seeder/CMakeFiles/seeder-base.dir/dns.cpp.o
[406/543] Building CXX object src/wallet/CMakeFiles/wallet.dir/salvage.cpp.o
[407/543] Building CXX object src/seeder/CMakeFiles/seeder-base.dir/db.cpp.o
[408/543] Building CXX object src/wallet/CMakeFiles/wallet.dir/walletutil.cpp.o
[409/543] Building CXX object src/wallet/CMakeFiles/wallet.dir/spend.cpp.o
[410/543] Building CXX object src/seeder/CMakeFiles/seeder-base.dir/options.cpp.o
[411/543] Building CXX object src/wallet/CMakeFiles/wallet.dir/interfaces.cpp.o
[412/543] Building CXX object src/wallet/CMakeFiles/wallet.dir/scriptpubkeyman.cpp.o
[413/543] Building CXX object src/seeder/CMakeFiles/bitcoin-seeder.dir/main.cpp.o
[414/543] Building CXX object src/seeder/CMakeFiles/seeder-base.dir/bitcoin.cpp.o
[415/543] Building CXX object src/wallet/CMakeFiles/wallet.dir/rpc/backup.cpp.o
[416/543] Building CXX object src/wallet/CMakeFiles/wallet.dir/walletdb.cpp.o
[417/543] Building CXX object src/wallet/CMakeFiles/wallet.dir/rpcwallet.cpp.o
[418/543] Building CXX object src/wallet/CMakeFiles/wallet.dir/wallet.cpp.o
[419/543] Linking CXX static library src/wallet/libwallet.a
ninja: build stopped: cannot make progress due to previous errors.
Build build-clang-tidy failed with exit code 1

Tail of the build log:

 1538 |     operator<<(std::basic_ostream<_CharT, _Traits>& __os,
      |     ^~~~~~~~
/usr/include/c++/9/bitset:1538:5: note:   template argument deduction/substitution failed:
In file included from ../../src/./fs.h:8,
                 from ../../src/./flatfile.h:9,
                 from ../../src/./blockindex.h:10,
                 from ../../src/./blockindexcomparators.h:8,
                 from ../../src/./validation.h:17,
                 from ../../src/validation.cpp:7:
../../src/./tinyformat.h:291:13: note:   ‘const bilingual_str’ is not derived from ‘const std::bitset<_Nb>’
  291 |         tmp << value;
      |         ~~~~^~~~~~~~
In file included from /usr/include/boost/detail/container_fwd.hpp:98,
                 from /usr/include/boost/container_hash/extensions.hpp:22,
                 from /usr/include/boost/container_hash/hash.hpp:761,
                 from /usr/include/boost/functional/hash.hpp:6,
                 from /usr/include/boost/multi_index/detail/hash_index_args.hpp:17,
                 from /usr/include/boost/multi_index/hashed_index_fwd.hpp:16,
                 from /usr/include/boost/multi_index/hashed_index.hpp:43,
                 from ../../src/./txmempool.h:22,
                 from ../../src/./validation.h:35,
                 from ../../src/validation.cpp:7:
/usr/include/c++/9/complex:552:5: note: candidate: ‘template<class _Tp, class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(std::basic_ostream<_CharT, _Traits>&, const std::complex<_Tp>&)’
  552 |     operator<<(basic_ostream<_CharT, _Traits>& __os, const complex<_Tp>& __x)
      |     ^~~~~~~~
/usr/include/c++/9/complex:552:5: note:   template argument deduction/substitution failed:
In file included from ../../src/./fs.h:8,
                 from ../../src/./flatfile.h:9,
                 from ../../src/./blockindex.h:10,
                 from ../../src/./blockindexcomparators.h:8,
                 from ../../src/./validation.h:17,
                 from ../../src/validation.cpp:7:
../../src/./tinyformat.h:291:13: note:   ‘const bilingual_str’ is not derived from ‘const std::complex<_Tp>’
  291 |         tmp << value;
      |         ~~~~^~~~~~~~
[492/608] Building CXX object src/CMakeFiles/bitcoinkernel.dir/avalanche/proof.cpp.o
[493/608] Building CXX object src/test/CMakeFiles/testutil.dir/util/str.cpp.o
[494/608] Building CXX object src/test/CMakeFiles/testutil.dir/util/transaction_utils.cpp.o
[495/608] Building CXX object src/CMakeFiles/bitcoinkernel.dir/policy/block/stakingrewards.cpp.o
[496/608] Building CXX object src/test/CMakeFiles/testutil.dir/util/wallet.cpp.o
[497/608] Building CXX object src/CMakeFiles/bitcoinkernel.dir/avalanche/proofpool.cpp.o
[498/608] Building CXX object src/seeder/CMakeFiles/seeder-base.dir/db.cpp.o
[499/608] Building CXX object src/seeder/CMakeFiles/seeder-base.dir/dns.cpp.o
[500/608] Building CXX object src/seeder/CMakeFiles/seeder-base.dir/options.cpp.o
[501/608] Building CXX object src/test/CMakeFiles/testutil.dir/util/blockfilter.cpp.o
[502/608] Building CXX object src/seeder/CMakeFiles/bitcoin-seeder.dir/main.cpp.o
[503/608] Building CXX object src/CMakeFiles/bitcoin-chainstate.dir/bitcoin-chainstate.cpp.o
[504/608] Building CXX object src/CMakeFiles/bitcoinkernel.dir/txmempool.cpp.o
[505/608] Building CXX object src/test/CMakeFiles/testutil.dir/util/net.cpp.o
[506/608] Building CXX object src/test/CMakeFiles/testutil.dir/util/mining.cpp.o
[507/608] Building CXX object src/CMakeFiles/server.dir/net_processing.cpp.o
[508/608] Building CXX object src/test/CMakeFiles/testutil.dir/util/validation.cpp.o
[509/608] Building CXX object src/CMakeFiles/bitcoinkernel.dir/avalanche/peermanager.cpp.o
[510/608] Building CXX object src/CMakeFiles/server.dir/rpc/blockchain.cpp.o
[511/608] Building CXX object src/CMakeFiles/bitcoinkernel.dir/avalanche/processor.cpp.o
[512/608] Building CXX object src/test/CMakeFiles/testutil.dir/util/setup_common.cpp.o
[513/608] Building CXX object src/seeder/CMakeFiles/seeder-base.dir/bitcoin.cpp.o
[514/608] Building CXX object src/CMakeFiles/bitcoinkernel.dir/net.cpp.o
ninja: build stopped: cannot make progress due to previous errors.
Build build-without-wallet failed with exit code 1

Why do you say there is no change in behavior ? Previously the node would shut down, now it only prints an error. Am I missing something ?

Why do you say there is no change in behavior ? Previously the node would shut down, now it only prints an error. Am I missing something ?

If LoadChainstate returns FAILURE_FATAL, it will result in an InitError in init.cpp. So the node still shuts down, just a few lines later than before.

The handle_invalid_snapshot lambda function still ends with shutdown_fnc(user_error);, so no change there except that a new log line is printed if there is another error is from InvalidateCoinsDBOnDisk. And there is no other callsite for InvalidateCoinsDBOnDisk in the codebase.

This revision is now accepted and ready to land.Apr 18 2024, 19:52