Page MenuHomePhabricator

[avalanche] Move the last poll time out of the node state
ClosedPublic

Authored by Fabien on Sep 27 2023, 14:55.

Details

Reviewers
PiRK
Group Reviewers
Restricted Project
Commits
rABC9b3e4e8c35b1: [avalanche] Move the last poll time out of the node state
Summary

Node state is intended to store validation related data that needs to be gated by cs_main. This not the case for the last poll time which is a network only data, so this is causing a cs_main locking for no benefit.

This diff move the last_poll attribute to the CNode itself. This doesn't require a lock as it's only accessed from the net thread.

There is no change in behavior.

Depends on D14548.

Test Plan
ninja all check-all

Diff Detail

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

Event Timeline

Fabien requested review of this revision.Sep 27 2023, 14:55

Tail of the build log:

-- Installing: /results/artifacts/include/secp256k1_recovery.h
-- Installing: /results/artifacts/include/secp256k1_schnorr.h
[361/541] Linking CXX static library src/libcommon.a
[362/541] Building CXX object src/test/CMakeFiles/testutil.dir/util/blockindex.cpp.o
[363/541] Building C object src/secp256k1/CMakeFiles/ecmult-bench.dir/src/bench_ecmult.c.o
[364/541] Linking C executable src/secp256k1/ecmult-bench
[365/541] Linking CXX static library src/libscript.a
[366/541] Linking CXX static library src/libbitcoinconsensus.a
[367/541] Building CXX object src/test/CMakeFiles/testutil.dir/util/str.cpp.o
[368/541] Building C object src/secp256k1/CMakeFiles/internal-bench.dir/src/bench_internal.c.o
[369/541] Linking CXX shared library src/libbitcoinconsensus.so.0.27.14
[370/541] Creating library symlink src/libbitcoinconsensus.so.0 src/libbitcoinconsensus.so
[371/541] Linking C executable src/secp256k1/internal-bench
[372/541] Linking CXX executable src/bitcoin-cli
[373/541] Building CXX object src/CMakeFiles/server.dir/txorphanage.cpp.o
[374/541] Building CXX object src/CMakeFiles/bitcoin-tx.dir/bitcoin-tx.cpp.o
[375/541] Building CXX object src/CMakeFiles/server.dir/txmempool.cpp.o
[376/541] Building CXX object src/CMakeFiles/server.dir/torcontrol.cpp.o
[377/541] Building CXX object src/test/CMakeFiles/testutil.dir/util/transaction_utils.cpp.o
[378/541] Building CXX object src/test/CMakeFiles/testutil.dir/util/blockfilter.cpp.o
[379/541] Building CXX object src/wallet/CMakeFiles/wallet.dir/context.cpp.o
[380/541] Linking CXX executable src/bitcoin-tx
[381/541] Building CXX object src/test/CMakeFiles/testutil.dir/util/mining.cpp.o
[382/541] Building CXX object src/wallet/CMakeFiles/wallet.dir/bdb.cpp.o
[383/541] Building CXX object src/wallet/CMakeFiles/wallet.dir/db.cpp.o
[384/541] Building CXX object src/CMakeFiles/server.dir/wallet/init.cpp.o
[385/541] Building CXX object src/test/CMakeFiles/testutil.dir/util/validation.cpp.o
[386/541] Building CXX object src/wallet/CMakeFiles/wallet.dir/coinselection.cpp.o
[387/541] Building CXX object src/test/CMakeFiles/testutil.dir/util/net.cpp.o
[388/541] Building CXX object src/wallet/CMakeFiles/wallet.dir/coincontrol.cpp.o
[389/541] Building CXX object src/wallet/CMakeFiles/wallet.dir/crypter.cpp.o
[390/541] Building CXX object src/test/CMakeFiles/testutil.dir/util/wallet.cpp.o
[391/541] Building CXX object src/CMakeFiles/server.dir/validation.cpp.o
[392/541] Building CXX object src/test/CMakeFiles/testutil.dir/util/setup_common.cpp.o
[393/541] Building CXX object src/wallet/CMakeFiles/wallet-tool.dir/wallettool.cpp.o
[394/541] Building CXX object src/wallet/CMakeFiles/wallet.dir/fees.cpp.o
[395/541] Building CXX object src/wallet/CMakeFiles/wallet.dir/sqlite.cpp.o
[396/541] Building CXX object src/wallet/CMakeFiles/wallet.dir/transaction.cpp.o
[397/541] Building CXX object src/wallet/CMakeFiles/wallet.dir/load.cpp.o
[398/541] Building CXX object src/wallet/CMakeFiles/wallet.dir/rpc/signmessage.cpp.o
[399/541] Building CXX object src/wallet/CMakeFiles/wallet.dir/rpc/util.cpp.o
[400/541] Building CXX object src/wallet/CMakeFiles/wallet.dir/receive.cpp.o
[401/541] Building CXX object src/wallet/CMakeFiles/wallet.dir/rpc/encrypt.cpp.o
[402/541] Building CXX object src/seeder/CMakeFiles/seeder-base.dir/dns.cpp.o
[403/541] Building CXX object src/wallet/CMakeFiles/wallet.dir/salvage.cpp.o
[404/541] Building CXX object src/seeder/CMakeFiles/seeder-base.dir/options.cpp.o
[405/541] Building CXX object src/wallet/CMakeFiles/wallet.dir/walletutil.cpp.o
[406/541] Building CXX object src/seeder/CMakeFiles/seeder-base.dir/db.cpp.o
[407/541] Building CXX object src/wallet/CMakeFiles/wallet.dir/interfaces.cpp.o
[408/541] Building CXX object src/seeder/CMakeFiles/bitcoin-seeder.dir/main.cpp.o
[409/541] Building CXX object src/wallet/CMakeFiles/wallet.dir/spend.cpp.o
[410/541] Building CXX object src/wallet/CMakeFiles/wallet.dir/rpc/backup.cpp.o
[411/541] Building CXX object src/wallet/CMakeFiles/wallet.dir/scriptpubkeyman.cpp.o
[412/541] Building CXX object src/seeder/CMakeFiles/seeder-base.dir/bitcoin.cpp.o
[413/541] Building CXX object src/wallet/CMakeFiles/wallet.dir/rpcwallet.cpp.o
[414/541] Building CXX object src/wallet/CMakeFiles/wallet.dir/walletdb.cpp.o
[415/541] Building CXX object src/wallet/CMakeFiles/wallet.dir/wallet.cpp.o
[416/541] 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

Tail of the build log:

[332/481] Building CXX object src/CMakeFiles/server.dir/node/ui_interface.cpp.o
[333/481] Building CXX object src/CMakeFiles/server.dir/rpc/server_util.cpp.o
[334/481] Building CXX object src/CMakeFiles/server.dir/script/scriptcache.cpp.o
[335/481] Building CXX object src/CMakeFiles/server.dir/shutdown.cpp.o
[336/481] Building CXX object src/CMakeFiles/server.dir/rest.cpp.o
[337/481] Building CXX object src/CMakeFiles/server.dir/timedata.cpp.o
[338/481] Building CXX object src/CMakeFiles/server.dir/rpc/txoutproof.cpp.o
[339/481] Building CXX object src/CMakeFiles/server.dir/rpc/server.cpp.o
[340/481] Building CXX object src/CMakeFiles/server.dir/versionbits.cpp.o
[341/481] Building CXX object src/CMakeFiles/server.dir/txorphanage.cpp.o
[342/481] Building CXX object src/CMakeFiles/server.dir/txdb.cpp.o
[343/481] Building CXX object src/CMakeFiles/server.dir/dummywallet.cpp.o
[344/481] Building CXX object src/CMakeFiles/server.dir/rpc/mining.cpp.o
[345/481] Building C object src/secp256k1/CMakeFiles/recover-bench.dir/src/bench_recover.c.o
[346/481] Building C object src/secp256k1/CMakeFiles/verify-bench.dir/src/bench_verify.c.o
[347/481] Building C object src/secp256k1/CMakeFiles/sign-bench.dir/src/bench_sign.c.o
[348/481] Building CXX object src/CMakeFiles/server.dir/validationinterface.cpp.o
[349/481] Building CXX object src/CMakeFiles/server.dir/rpc/avalanche.cpp.o
[350/481] Building C object src/secp256k1/CMakeFiles/secp256k1.dir/src/secp256k1.c.o
[351/481] Linking C static library src/secp256k1/libsecp256k1.a
[352/481] Linking CXX static library src/libscript.a
[353/481] Linking CXX static library src/libbitcoinconsensus.a
[354/481] Building CXX object src/CMakeFiles/server.dir/torcontrol.cpp.o
[355/481] Linking C executable src/secp256k1/recover-bench
[356/481] Linking CXX static library src/libcommon.a
[357/481] Linking C executable src/secp256k1/verify-bench
[358/481] Linking CXX shared library src/libbitcoinconsensus.so.0.27.14
[359/481] Creating library symlink src/libbitcoinconsensus.so.0 src/libbitcoinconsensus.so
[360/481] Building CXX object src/CMakeFiles/server.dir/txmempool.cpp.o
[361/481] Linking CXX executable src/bitcoin-cli
[362/481] Building CXX object src/CMakeFiles/server.dir/rpc/net.cpp.o
[363/481] Building C object src/secp256k1/CMakeFiles/ecmult-bench.dir/src/bench_ecmult.c.o
[364/481] Building CXX object src/test/CMakeFiles/testutil.dir/util/blockindex.cpp.o
[365/481] Linking C executable src/secp256k1/sign-bench
[366/481] Linking C executable src/secp256k1/ecmult-bench
[367/481] Building CXX object src/CMakeFiles/server.dir/init.cpp.o
[368/481] Building CXX object src/test/CMakeFiles/testutil.dir/util/str.cpp.o
[369/481] Linking CXX executable src/bitcoin-tx
[370/481] Building C object src/secp256k1/CMakeFiles/internal-bench.dir/src/bench_internal.c.o
[371/481] Linking C executable src/secp256k1/internal-bench
[372/481] Building CXX object src/CMakeFiles/bitcoind.dir/bitcoind.cpp.o
[373/481] Building CXX object src/test/CMakeFiles/testutil.dir/util/logging.cpp.o
[374/481] Building CXX object src/seeder/CMakeFiles/seeder-base.dir/dns.cpp.o
[375/481] Building CXX object src/test/CMakeFiles/testutil.dir/util/blockfilter.cpp.o
[376/481] Building CXX object src/test/CMakeFiles/testutil.dir/util/wallet.cpp.o
[377/481] Building CXX object src/test/CMakeFiles/testutil.dir/util/transaction_utils.cpp.o
[378/481] Building CXX object src/seeder/CMakeFiles/seeder-base.dir/db.cpp.o
[379/481] Building CXX object src/test/CMakeFiles/testutil.dir/util/validation.cpp.o
[380/481] Building CXX object src/test/CMakeFiles/testutil.dir/util/net.cpp.o
[381/481] Building CXX object src/seeder/CMakeFiles/seeder-base.dir/options.cpp.o
[382/481] Building CXX object src/test/CMakeFiles/testutil.dir/util/mining.cpp.o
[383/481] Building CXX object src/CMakeFiles/server.dir/rpc/rawtransaction.cpp.o
[384/481] Building CXX object src/CMakeFiles/server.dir/net_processing.cpp.o
[385/481] Building CXX object src/seeder/CMakeFiles/seeder-base.dir/bitcoin.cpp.o
[386/481] Building CXX object src/seeder/CMakeFiles/bitcoin-seeder.dir/main.cpp.o
[387/481] Building CXX object src/test/CMakeFiles/testutil.dir/util/setup_common.cpp.o
[388/481] Building CXX object src/CMakeFiles/server.dir/rpc/blockchain.cpp.o
[389/481] Building CXX object src/CMakeFiles/server.dir/validation.cpp.o
ninja: build stopped: cannot make progress due to previous errors.
Build build-without-wallet failed with exit code 1

Tail of the build log:

-- Installing: /results/artifacts/lib/libsecp256k1.a
-- Installing: /results/artifacts/include/secp256k1.h
-- Installing: /results/artifacts/include/secp256k1_preallocated.h
-- Installing: /results/artifacts/include/secp256k1_recovery.h
-- Installing: /results/artifacts/include/secp256k1_schnorr.h
[364/541] Linking C executable src/secp256k1/ecmult-bench
[365/541] Building CXX object src/test/CMakeFiles/testutil.dir/util/logging.cpp.o
[366/541] Linking CXX shared library src/libbitcoinconsensus.so.0.27.14
[367/541] Creating library symlink src/libbitcoinconsensus.so.0 src/libbitcoinconsensus.so
[368/541] Building C object src/secp256k1/CMakeFiles/internal-bench.dir/src/bench_internal.c.o
[369/541] Linking C executable src/secp256k1/internal-bench
[370/541] Building CXX object src/test/CMakeFiles/testutil.dir/util/str.cpp.o
[371/541] Building CXX object src/test/CMakeFiles/testutil.dir/util/blockfilter.cpp.o
[372/541] Building CXX object src/test/CMakeFiles/testutil.dir/util/transaction_utils.cpp.o
[373/541] Building CXX object src/CMakeFiles/server.dir/wallet/init.cpp.o
[374/541] Building CXX object src/CMakeFiles/bitcoin-cli.dir/bitcoin-cli.cpp.o
[375/541] Linking CXX executable src/bitcoin-cli
[376/541] Building CXX object src/CMakeFiles/bitcoin-tx.dir/bitcoin-tx.cpp.o
[377/541] Building CXX object src/test/CMakeFiles/testutil.dir/util/validation.cpp.o
[378/541] Linking CXX executable src/bitcoin-tx
[379/541] Building CXX object src/wallet/CMakeFiles/wallet.dir/context.cpp.o
[380/541] Building CXX object src/test/CMakeFiles/testutil.dir/util/net.cpp.o
[381/541] Building CXX object src/CMakeFiles/server.dir/rpc/rawtransaction.cpp.o
[382/541] Building CXX object src/test/CMakeFiles/testutil.dir/util/mining.cpp.o
[383/541] Building CXX object src/CMakeFiles/server.dir/net_processing.cpp.o
[384/541] Building CXX object src/test/CMakeFiles/testutil.dir/util/wallet.cpp.o
[385/541] Building CXX object src/wallet/CMakeFiles/wallet.dir/db.cpp.o
[386/541] Building CXX object src/wallet/CMakeFiles/wallet.dir/coincontrol.cpp.o
[387/541] Building CXX object src/wallet/CMakeFiles/wallet.dir/crypter.cpp.o
[388/541] Building CXX object src/wallet/CMakeFiles/wallet.dir/coinselection.cpp.o
[389/541] Building CXX object src/wallet/CMakeFiles/wallet.dir/bdb.cpp.o
[390/541] Building CXX object src/test/CMakeFiles/testutil.dir/util/setup_common.cpp.o
[391/541] Building CXX object src/wallet/CMakeFiles/wallet.dir/fees.cpp.o
[392/541] Building CXX object src/wallet/CMakeFiles/wallet-tool.dir/wallettool.cpp.o
[393/541] Building CXX object src/CMakeFiles/server.dir/rpc/blockchain.cpp.o
[394/541] Building CXX object src/wallet/CMakeFiles/wallet.dir/receive.cpp.o
[395/541] Building CXX object src/wallet/CMakeFiles/wallet.dir/transaction.cpp.o
[396/541] Building CXX object src/wallet/CMakeFiles/wallet.dir/load.cpp.o
[397/541] Building CXX object src/wallet/CMakeFiles/wallet.dir/rpc/util.cpp.o
[398/541] Building CXX object src/wallet/CMakeFiles/wallet.dir/rpc/signmessage.cpp.o
[399/541] Building CXX object src/wallet/CMakeFiles/wallet.dir/sqlite.cpp.o
[400/541] Building CXX object src/seeder/CMakeFiles/seeder-base.dir/dns.cpp.o
[401/541] Building CXX object src/wallet/CMakeFiles/wallet.dir/rpc/encrypt.cpp.o
[402/541] Building CXX object src/seeder/CMakeFiles/seeder-base.dir/db.cpp.o
[403/541] Building CXX object src/CMakeFiles/server.dir/validation.cpp.o
[404/541] Building CXX object src/wallet/CMakeFiles/wallet.dir/walletutil.cpp.o
[405/541] Building CXX object src/wallet/CMakeFiles/wallet.dir/salvage.cpp.o
[406/541] Building CXX object src/seeder/CMakeFiles/seeder-base.dir/options.cpp.o
[407/541] Building CXX object src/wallet/CMakeFiles/wallet.dir/interfaces.cpp.o
[408/541] Building CXX object src/wallet/CMakeFiles/wallet.dir/spend.cpp.o
[409/541] Building CXX object src/seeder/CMakeFiles/seeder-base.dir/bitcoin.cpp.o
[410/541] Building CXX object src/seeder/CMakeFiles/bitcoin-seeder.dir/main.cpp.o
[411/541] Building CXX object src/wallet/CMakeFiles/wallet.dir/scriptpubkeyman.cpp.o
[412/541] Building CXX object src/wallet/CMakeFiles/wallet.dir/walletdb.cpp.o
[413/541] Building CXX object src/wallet/CMakeFiles/wallet.dir/rpc/backup.cpp.o
[414/541] Building CXX object src/wallet/CMakeFiles/wallet.dir/wallet.cpp.o
[415/541] Building CXX object src/wallet/CMakeFiles/wallet.dir/rpcwallet.cpp.o
[416/541] Linking CXX static library src/wallet/libwallet.a
ninja: build stopped: cannot make progress due to previous errors.
Build build-diff failed with exit code 1
Fabien planned changes to this revision.Sep 27 2023, 15:08

Attempt to fix the warning that I can't reproduce locally

Tail of the build log:

  682 |     std::atomic<std::chrono::time_point<std::chrono::steady_clock>> last_poll{};
      |                                                                               ^
In file included from ../../src/./rcu.h:8,
                 from ../../src/./serialize.h:11,
                 from ../../src/./blockfileinfo.h:8,
                 from ../../src/./validation.h:16,
                 from ../../src/validation.cpp:7:
/usr/include/c++/9/atomic:198:7: note: ‘constexpr std::atomic<_Tp>::atomic() noexcept [with _Tp = std::chrono::time_point<std::chrono::_V2::steady_clock, std::chrono::duration<long int, std::ratio<1, 1000000000> > >]’ is implicitly deleted because its exception-specification does not match the implicit exception-specification ‘’
  198 |       atomic() noexcept = default;
      |       ^~~~~~
[414/541] Building CXX object src/test/CMakeFiles/testutil.dir/util/setup_common.cpp.o
FAILED: src/test/CMakeFiles/testutil.dir/util/setup_common.cpp.o 
/usr/bin/ccache /usr/bin/c++ -DABORT_ON_FAILED_ASSUME -DBOOST_ALL_NO_LIB -DBUILD_BITCOIN_INTERNAL -DDEBUG -DDEBUG_LOCKORDER -DENABLE_AVX2 -DENABLE_SHANI -DENABLE_SSE41 -DHAVE_BUILD_INFO -DHAVE_CONFIG_H -DHAVE_CONSENSUS_LIB -DLEVELDB_ATOMIC_PRESENT -DLEVELDB_PLATFORM_POSIX -DOS_LINUX -I../../src/. -Isrc -I../../src/univalue/include -Isrc/crypto/.. -I../../src/secp256k1/include -I../../src/leveldb/include -isystem /usr/include/jemalloc -isystem /usr/include/miniupnpc -Werror -O0 -fPIC -fvisibility=hidden -g3 -ftrapv -fstack-reuse=none -fstack-protector-all -Wstack-protector -fcf-protection=full -fstack-clash-protection -U_FORTIFY_SOURCE -Wall -Wextra -Wformat -Wvla -Wcast-align -Wunused-parameter -Wmissing-braces -Wredundant-decls -Wsign-compare -Wduplicated-branches -Wduplicated-cond -Wlogical-op -Wformat-security -Wredundant-move -Woverloaded-virtual -Wno-unused-parameter -Wno-implicit-fallthrough -Wno-psabi -pthread -std=gnu++17 -MD -MT src/test/CMakeFiles/testutil.dir/util/setup_common.cpp.o -MF src/test/CMakeFiles/testutil.dir/util/setup_common.cpp.o.d -o src/test/CMakeFiles/testutil.dir/util/setup_common.cpp.o -c ../../src/test/util/setup_common.cpp
In file included from ../../src/test/util/setup_common.cpp:18:
../../src/./net.h:682:79: error: use of deleted function ‘constexpr std::atomic<_Tp>::atomic() [with _Tp = std::chrono::time_point<std::chrono::_V2::steady_clock, std::chrono::duration<long int, std::ratio<1, 1000000000> > >]’
  682 |     std::atomic<std::chrono::time_point<std::chrono::steady_clock>> last_poll{};
      |                                                                               ^
In file included from ../../src/./rcu.h:8,
                 from ../../src/./serialize.h:11,
                 from ../../src/./blockstatus.h:9,
                 from ../../src/./blockindex.h:9,
                 from ../../src/./test/util/setup_common.h:8,
                 from ../../src/test/util/setup_common.cpp:5:
/usr/include/c++/9/atomic:198:7: note: ‘constexpr std::atomic<_Tp>::atomic() noexcept [with _Tp = std::chrono::time_point<std::chrono::_V2::steady_clock, std::chrono::duration<long int, std::ratio<1, 1000000000> > >]’ is implicitly deleted because its exception-specification does not match the implicit exception-specification ‘’
  198 |       atomic() noexcept = default;
      |       ^~~~~~
[415/541] Building CXX object src/CMakeFiles/server.dir/wallet/init.cpp.o
FAILED: src/CMakeFiles/server.dir/wallet/init.cpp.o 
/usr/bin/ccache /usr/bin/c++ -DABORT_ON_FAILED_ASSUME -DBOOST_ALL_NO_LIB -DBUILD_BITCOIN_INTERNAL -DDEBUG -DDEBUG_LOCKORDER -DENABLE_AVX2 -DENABLE_SHANI -DENABLE_SSE41 -DHAVE_BUILD_INFO -DHAVE_CONFIG_H -DHAVE_CONSENSUS_LIB -DLEVELDB_ATOMIC_PRESENT -DLEVELDB_PLATFORM_POSIX -DOS_LINUX -I../../src/leveldb/helpers/memenv -I../../src/. -Isrc -I../../src/univalue/include -Isrc/crypto/.. -I../../src/secp256k1/include -I../../src/leveldb/include -isystem /usr/include/jemalloc -isystem /usr/include/miniupnpc -Werror -O0 -fPIC -fvisibility=hidden -g3 -ftrapv -fstack-reuse=none -fstack-protector-all -Wstack-protector -fcf-protection=full -fstack-clash-protection -U_FORTIFY_SOURCE -Wall -Wextra -Wformat -Wvla -Wcast-align -Wunused-parameter -Wmissing-braces -Wredundant-decls -Wsign-compare -Wduplicated-branches -Wduplicated-cond -Wlogical-op -Wformat-security -Wredundant-move -Woverloaded-virtual -Wno-unused-parameter -Wno-implicit-fallthrough -Wno-psabi -pthread -std=gnu++17 -MD -MT src/CMakeFiles/server.dir/wallet/init.cpp.o -MF src/CMakeFiles/server.dir/wallet/init.cpp.o.d -o src/CMakeFiles/server.dir/wallet/init.cpp.o -c ../../src/wallet/init.cpp
In file included from ../../src/wallet/init.cpp:11:
../../src/./net.h:682:79: error: use of deleted function ‘constexpr std::atomic<_Tp>::atomic() [with _Tp = std::chrono::time_point<std::chrono::_V2::steady_clock, std::chrono::duration<long int, std::ratio<1, 1000000000> > >]’
  682 |     std::atomic<std::chrono::time_point<std::chrono::steady_clock>> last_poll{};
      |                                                                               ^
In file included from ../../src/./rcu.h:8,
                 from ../../src/./serialize.h:11,
                 from ../../src/./consensus/amount.h:10,
                 from ../../src/./config.h:8,
                 from ../../src/wallet/init.cpp:7:
/usr/include/c++/9/atomic:198:7: note: ‘constexpr std::atomic<_Tp>::atomic() noexcept [with _Tp = std::chrono::time_point<std::chrono::_V2::steady_clock, std::chrono::duration<long int, std::ratio<1, 1000000000> > >]’ is implicitly deleted because its exception-specification does not match the implicit exception-specification ‘’
  198 |       atomic() noexcept = default;
      |       ^~~~~~
[416/541] Building CXX object src/seeder/CMakeFiles/seeder-base.dir/bitcoin.cpp.o
FAILED: src/seeder/CMakeFiles/seeder-base.dir/bitcoin.cpp.o 
/usr/bin/ccache /usr/bin/c++ -DABORT_ON_FAILED_ASSUME -DBOOST_ALL_NO_LIB -DBUILD_BITCOIN_INTERNAL -DDEBUG -DDEBUG_LOCKORDER -DENABLE_AVX2 -DENABLE_SHANI -DENABLE_SSE41 -DHAVE_BUILD_INFO -DHAVE_CONFIG_H -DHAVE_CONSENSUS_LIB -DLEVELDB_ATOMIC_PRESENT -DLEVELDB_PLATFORM_POSIX -DOS_LINUX -I../../src/. -Isrc -I../../src/univalue/include -Isrc/crypto/.. -I../../src/secp256k1/include -I../../src/leveldb/include -isystem /usr/include/jemalloc -isystem /usr/include/miniupnpc -Werror -O0 -fPIC -fvisibility=hidden -g3 -ftrapv -fstack-reuse=none -fstack-protector-all -Wstack-protector -fcf-protection=full -fstack-clash-protection -U_FORTIFY_SOURCE -Wall -Wextra -Wformat -Wvla -Wcast-align -Wunused-parameter -Wmissing-braces -Wredundant-decls -Wsign-compare -Wduplicated-branches -Wduplicated-cond -Wlogical-op -Wformat-security -Wredundant-move -Woverloaded-virtual -Wno-unused-parameter -Wno-implicit-fallthrough -Wno-psabi -pthread -std=gnu++17 -MD -MT src/seeder/CMakeFiles/seeder-base.dir/bitcoin.cpp.o -MF src/seeder/CMakeFiles/seeder-base.dir/bitcoin.cpp.o.d -o src/seeder/CMakeFiles/seeder-base.dir/bitcoin.cpp.o -c ../../src/seeder/bitcoin.cpp
In file included from ../../src/./seeder/messagewriter.h:9,
                 from ../../src/seeder/bitcoin.cpp:13:
../../src/./net.h:682:79: error: use of deleted function ‘constexpr std::atomic<_Tp>::atomic() [with _Tp = std::chrono::time_point<std::chrono::_V2::steady_clock, std::chrono::duration<long int, std::ratio<1, 1000000000> > >]’
  682 |     std::atomic<std::chrono::time_point<std::chrono::steady_clock>> last_poll{};
      |                                                                               ^
In file included from ../../src/./rcu.h:8,
                 from ../../src/./serialize.h:11,
                 from ../../src/./netaddress.h:16,
                 from ../../src/./chainparams.h:11,
                 from ../../src/./seeder/bitcoin.h:8,
                 from ../../src/seeder/bitcoin.cpp:5:
/usr/include/c++/9/atomic:198:7: note: ‘constexpr std::atomic<_Tp>::atomic() noexcept [with _Tp = std::chrono::time_point<std::chrono::_V2::steady_clock, std::chrono::duration<long int, std::ratio<1, 1000000000> > >]’ is implicitly deleted because its exception-specification does not match the implicit exception-specification ‘’
  198 |       atomic() noexcept = default;
      |       ^~~~~~
ninja: build stopped: cannot make progress due to previous errors.
Build build-debug failed with exit code 1

Tail of the build log:

                 from ../../src/test/util/net.cpp:5:
/usr/include/c++/9/atomic:198:7: note: ‘constexpr std::atomic<_Tp>::atomic() noexcept [with _Tp = std::chrono::time_point<std::chrono::_V2::steady_clock, std::chrono::duration<long int, std::ratio<1, 1000000000> > >]’ is implicitly deleted because its exception-specification does not match the implicit exception-specification ‘’
  198 |       atomic() noexcept = default;
      |       ^~~~~~
[381/481] Building CXX object src/test/CMakeFiles/testutil.dir/util/mining.cpp.o
FAILED: src/test/CMakeFiles/testutil.dir/util/mining.cpp.o 
/usr/bin/ccache /usr/bin/c++ -DBOOST_ALL_NO_LIB -DBUILD_BITCOIN_INTERNAL -DENABLE_AVX2 -DENABLE_SHANI -DENABLE_SSE41 -DHAVE_BUILD_INFO -DHAVE_CONFIG_H -DHAVE_CONSENSUS_LIB -DLEVELDB_ATOMIC_PRESENT -DLEVELDB_PLATFORM_POSIX -DOS_LINUX -I../../src/. -Isrc -I../../src/univalue/include -Isrc/crypto/.. -I../../src/secp256k1/include -I../../src/leveldb/include -isystem /usr/include/jemalloc -isystem /usr/include/miniupnpc -Werror -g -O2 -fPIC -fvisibility=hidden -fstack-reuse=none -fstack-protector-all -Wstack-protector -fcf-protection=full -fstack-clash-protection -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -Wall -Wextra -Wformat -Wvla -Wcast-align -Wunused-parameter -Wmissing-braces -Wredundant-decls -Wsign-compare -Wduplicated-branches -Wduplicated-cond -Wlogical-op -Wformat-security -Wredundant-move -Woverloaded-virtual -Wno-unused-parameter -Wno-implicit-fallthrough -Wno-psabi -pthread -std=gnu++17 -MD -MT src/test/CMakeFiles/testutil.dir/util/mining.cpp.o -MF src/test/CMakeFiles/testutil.dir/util/mining.cpp.o.d -o src/test/CMakeFiles/testutil.dir/util/mining.cpp.o -c ../../src/test/util/mining.cpp
In file included from ../../src/test/util/mining.cpp:12:
../../src/./net.h:682:79: error: use of deleted function ‘constexpr std::atomic<_Tp>::atomic() [with _Tp = std::chrono::time_point<std::chrono::_V2::steady_clock, std::chrono::duration<long int, std::ratio<1, 1000000000> > >]’
  682 |     std::atomic<std::chrono::time_point<std::chrono::steady_clock>> last_poll{};
      |                                                                               ^
In file included from ../../src/./rcu.h:8,
                 from ../../src/./serialize.h:11,
                 from ../../src/./blockstatus.h:9,
                 from ../../src/./blockindex.h:9,
                 from ../../src/test/util/mining.cpp:7:
/usr/include/c++/9/atomic:198:7: note: ‘constexpr std::atomic<_Tp>::atomic() noexcept [with _Tp = std::chrono::time_point<std::chrono::_V2::steady_clock, std::chrono::duration<long int, std::ratio<1, 1000000000> > >]’ is implicitly deleted because its exception-specification does not match the implicit exception-specification ‘’
  198 |       atomic() noexcept = default;
      |       ^~~~~~
[382/481] Building CXX object src/seeder/CMakeFiles/seeder-base.dir/db.cpp.o
[383/481] Building CXX object src/seeder/CMakeFiles/seeder-base.dir/options.cpp.o
[384/481] Building CXX object src/test/CMakeFiles/testutil.dir/util/validation.cpp.o
[385/481] Building CXX object src/test/CMakeFiles/testutil.dir/util/setup_common.cpp.o
FAILED: src/test/CMakeFiles/testutil.dir/util/setup_common.cpp.o 
/usr/bin/ccache /usr/bin/c++ -DBOOST_ALL_NO_LIB -DBUILD_BITCOIN_INTERNAL -DENABLE_AVX2 -DENABLE_SHANI -DENABLE_SSE41 -DHAVE_BUILD_INFO -DHAVE_CONFIG_H -DHAVE_CONSENSUS_LIB -DLEVELDB_ATOMIC_PRESENT -DLEVELDB_PLATFORM_POSIX -DOS_LINUX -I../../src/. -Isrc -I../../src/univalue/include -Isrc/crypto/.. -I../../src/secp256k1/include -I../../src/leveldb/include -isystem /usr/include/jemalloc -isystem /usr/include/miniupnpc -Werror -g -O2 -fPIC -fvisibility=hidden -fstack-reuse=none -fstack-protector-all -Wstack-protector -fcf-protection=full -fstack-clash-protection -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -Wall -Wextra -Wformat -Wvla -Wcast-align -Wunused-parameter -Wmissing-braces -Wredundant-decls -Wsign-compare -Wduplicated-branches -Wduplicated-cond -Wlogical-op -Wformat-security -Wredundant-move -Woverloaded-virtual -Wno-unused-parameter -Wno-implicit-fallthrough -Wno-psabi -pthread -std=gnu++17 -MD -MT src/test/CMakeFiles/testutil.dir/util/setup_common.cpp.o -MF src/test/CMakeFiles/testutil.dir/util/setup_common.cpp.o.d -o src/test/CMakeFiles/testutil.dir/util/setup_common.cpp.o -c ../../src/test/util/setup_common.cpp
In file included from ../../src/test/util/setup_common.cpp:18:
../../src/./net.h:682:79: error: use of deleted function ‘constexpr std::atomic<_Tp>::atomic() [with _Tp = std::chrono::time_point<std::chrono::_V2::steady_clock, std::chrono::duration<long int, std::ratio<1, 1000000000> > >]’
  682 |     std::atomic<std::chrono::time_point<std::chrono::steady_clock>> last_poll{};
      |                                                                               ^
In file included from ../../src/./rcu.h:8,
                 from ../../src/./serialize.h:11,
                 from ../../src/./blockstatus.h:9,
                 from ../../src/./blockindex.h:9,
                 from ../../src/./test/util/setup_common.h:8,
                 from ../../src/test/util/setup_common.cpp:5:
/usr/include/c++/9/atomic:198:7: note: ‘constexpr std::atomic<_Tp>::atomic() noexcept [with _Tp = std::chrono::time_point<std::chrono::_V2::steady_clock, std::chrono::duration<long int, std::ratio<1, 1000000000> > >]’ is implicitly deleted because its exception-specification does not match the implicit exception-specification ‘’
  198 |       atomic() noexcept = default;
      |       ^~~~~~
[386/481] Building CXX object src/seeder/CMakeFiles/seeder-base.dir/bitcoin.cpp.o
FAILED: src/seeder/CMakeFiles/seeder-base.dir/bitcoin.cpp.o 
/usr/bin/ccache /usr/bin/c++ -DBOOST_ALL_NO_LIB -DBUILD_BITCOIN_INTERNAL -DENABLE_AVX2 -DENABLE_SHANI -DENABLE_SSE41 -DHAVE_BUILD_INFO -DHAVE_CONFIG_H -DHAVE_CONSENSUS_LIB -DLEVELDB_ATOMIC_PRESENT -DLEVELDB_PLATFORM_POSIX -DOS_LINUX -I../../src/. -Isrc -I../../src/univalue/include -Isrc/crypto/.. -I../../src/secp256k1/include -I../../src/leveldb/include -isystem /usr/include/jemalloc -isystem /usr/include/miniupnpc -Werror -g -O2 -fPIC -fvisibility=hidden -fstack-reuse=none -fstack-protector-all -Wstack-protector -fcf-protection=full -fstack-clash-protection -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -Wall -Wextra -Wformat -Wvla -Wcast-align -Wunused-parameter -Wmissing-braces -Wredundant-decls -Wsign-compare -Wduplicated-branches -Wduplicated-cond -Wlogical-op -Wformat-security -Wredundant-move -Woverloaded-virtual -Wno-unused-parameter -Wno-implicit-fallthrough -Wno-psabi -pthread -std=gnu++17 -MD -MT src/seeder/CMakeFiles/seeder-base.dir/bitcoin.cpp.o -MF src/seeder/CMakeFiles/seeder-base.dir/bitcoin.cpp.o.d -o src/seeder/CMakeFiles/seeder-base.dir/bitcoin.cpp.o -c ../../src/seeder/bitcoin.cpp
In file included from ../../src/./seeder/messagewriter.h:9,
                 from ../../src/seeder/bitcoin.cpp:13:
../../src/./net.h:682:79: error: use of deleted function ‘constexpr std::atomic<_Tp>::atomic() [with _Tp = std::chrono::time_point<std::chrono::_V2::steady_clock, std::chrono::duration<long int, std::ratio<1, 1000000000> > >]’
  682 |     std::atomic<std::chrono::time_point<std::chrono::steady_clock>> last_poll{};
      |                                                                               ^
In file included from ../../src/./rcu.h:8,
                 from ../../src/./serialize.h:11,
                 from ../../src/./netaddress.h:16,
                 from ../../src/./chainparams.h:11,
                 from ../../src/./seeder/bitcoin.h:8,
                 from ../../src/seeder/bitcoin.cpp:5:
/usr/include/c++/9/atomic:198:7: note: ‘constexpr std::atomic<_Tp>::atomic() noexcept [with _Tp = std::chrono::time_point<std::chrono::_V2::steady_clock, std::chrono::duration<long int, std::ratio<1, 1000000000> > >]’ is implicitly deleted because its exception-specification does not match the implicit exception-specification ‘’
  198 |       atomic() noexcept = default;
      |       ^~~~~~
[387/481] Building CXX object src/CMakeFiles/server.dir/txmempool.cpp.o
[388/481] Building CXX object src/seeder/CMakeFiles/bitcoin-seeder.dir/main.cpp.o
[389/481] Building CXX object src/CMakeFiles/server.dir/rpc/rawtransaction.cpp.o
ninja: build stopped: cannot make progress due to previous errors.
Build build-without-wallet failed with exit code 1
Fabien planned changes to this revision.Sep 27 2023, 15:21

Tail of the build log:

      |                                                                               ^
In file included from ../../src/./rcu.h:8,
                 from ../../src/./serialize.h:11,
                 from ../../src/./blockstatus.h:9,
                 from ../../src/./blockindex.h:9,
                 from ../../src/./test/util/setup_common.h:8,
                 from ../../src/test/util/setup_common.cpp:5:
/usr/include/c++/9/atomic:198:7: note: ‘constexpr std::atomic<_Tp>::atomic() noexcept [with _Tp = std::chrono::time_point<std::chrono::_V2::steady_clock, std::chrono::duration<long int, std::ratio<1, 1000000000> > >]’ is implicitly deleted because its exception-specification does not match the implicit exception-specification ‘’
  198 |       atomic() noexcept = default;
      |       ^~~~~~
[385/541] Building CXX object src/test/CMakeFiles/testutil.dir/util/validation.cpp.o
[386/541] Linking CXX executable src/bitcoin-tx
[387/541] Building CXX object src/wallet/CMakeFiles/wallet.dir/db.cpp.o
[388/541] Building CXX object src/wallet/CMakeFiles/wallet.dir/crypter.cpp.o
[389/541] Building CXX object src/test/CMakeFiles/testutil.dir/util/wallet.cpp.o
[390/541] Building CXX object src/wallet/CMakeFiles/wallet.dir/bdb.cpp.o
[391/541] Building CXX object src/wallet/CMakeFiles/wallet.dir/coinselection.cpp.o
[392/541] Building CXX object src/wallet/CMakeFiles/wallet.dir/fees.cpp.o
[393/541] Building CXX object src/wallet/CMakeFiles/wallet-tool.dir/wallettool.cpp.o
[394/541] Building CXX object src/wallet/CMakeFiles/wallet.dir/load.cpp.o
[395/541] Building CXX object src/CMakeFiles/server.dir/rpc/rawtransaction.cpp.o
[396/541] Building CXX object src/wallet/CMakeFiles/wallet.dir/receive.cpp.o
[397/541] Building CXX object src/wallet/CMakeFiles/wallet.dir/rpc/util.cpp.o
[398/541] Building CXX object src/wallet/CMakeFiles/wallet.dir/transaction.cpp.o
[399/541] Building CXX object src/wallet/CMakeFiles/wallet.dir/rpc/signmessage.cpp.o
[400/541] Building CXX object src/seeder/CMakeFiles/seeder-base.dir/dns.cpp.o
[401/541] Building CXX object src/wallet/CMakeFiles/wallet.dir/sqlite.cpp.o
[402/541] Building CXX object src/wallet/CMakeFiles/wallet.dir/rpc/encrypt.cpp.o
[403/541] Building CXX object src/seeder/CMakeFiles/seeder-base.dir/db.cpp.o
[404/541] Building CXX object src/wallet/CMakeFiles/wallet.dir/salvage.cpp.o
[405/541] Building CXX object src/wallet/CMakeFiles/wallet.dir/walletutil.cpp.o
[406/541] Building CXX object src/seeder/CMakeFiles/seeder-base.dir/options.cpp.o
[407/541] Building CXX object src/seeder/CMakeFiles/seeder-base.dir/bitcoin.cpp.o
FAILED: src/seeder/CMakeFiles/seeder-base.dir/bitcoin.cpp.o 
/usr/bin/ccache /usr/bin/c++ -DBOOST_ALL_NO_LIB -DBUILD_BITCOIN_INTERNAL -DENABLE_AVX2 -DENABLE_SHANI -DENABLE_SSE41 -DHAVE_BUILD_INFO -DHAVE_CONFIG_H -DHAVE_CONSENSUS_LIB -DLEVELDB_ATOMIC_PRESENT -DLEVELDB_PLATFORM_POSIX -DOS_LINUX -I../../src/. -Isrc -I../../src/univalue/include -Isrc/crypto/.. -I../../src/secp256k1/include -I../../src/leveldb/include -isystem /usr/include/jemalloc -isystem /usr/include/miniupnpc -Werror -g -O2 -fPIC -fvisibility=hidden -fstack-reuse=none -fstack-protector-all -Wstack-protector -fcf-protection=full -fstack-clash-protection -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -Wall -Wextra -Wformat -Wvla -Wcast-align -Wunused-parameter -Wmissing-braces -Wredundant-decls -Wsign-compare -Wduplicated-branches -Wduplicated-cond -Wlogical-op -Wformat-security -Wredundant-move -Woverloaded-virtual -Wno-unused-parameter -Wno-implicit-fallthrough -Wno-psabi -pthread -std=gnu++17 -MD -MT src/seeder/CMakeFiles/seeder-base.dir/bitcoin.cpp.o -MF src/seeder/CMakeFiles/seeder-base.dir/bitcoin.cpp.o.d -o src/seeder/CMakeFiles/seeder-base.dir/bitcoin.cpp.o -c ../../src/seeder/bitcoin.cpp
In file included from ../../src/./seeder/messagewriter.h:9,
                 from ../../src/seeder/bitcoin.cpp:13:
../../src/./net.h:682:79: error: use of deleted function ‘constexpr std::atomic<_Tp>::atomic() [with _Tp = std::chrono::time_point<std::chrono::_V2::steady_clock, std::chrono::duration<long int, std::ratio<1, 1000000000> > >]’
  682 |     std::atomic<std::chrono::time_point<std::chrono::steady_clock>> last_poll{};
      |                                                                               ^
In file included from ../../src/./rcu.h:8,
                 from ../../src/./serialize.h:11,
                 from ../../src/./netaddress.h:16,
                 from ../../src/./chainparams.h:11,
                 from ../../src/./seeder/bitcoin.h:8,
                 from ../../src/seeder/bitcoin.cpp:5:
/usr/include/c++/9/atomic:198:7: note: ‘constexpr std::atomic<_Tp>::atomic() noexcept [with _Tp = std::chrono::time_point<std::chrono::_V2::steady_clock, std::chrono::duration<long int, std::ratio<1, 1000000000> > >]’ is implicitly deleted because its exception-specification does not match the implicit exception-specification ‘’
  198 |       atomic() noexcept = default;
      |       ^~~~~~
[408/541] Building CXX object src/wallet/CMakeFiles/wallet.dir/spend.cpp.o
[409/541] Building CXX object src/wallet/CMakeFiles/wallet.dir/interfaces.cpp.o
[410/541] Building CXX object src/seeder/CMakeFiles/bitcoin-seeder.dir/main.cpp.o
[411/541] Building CXX object src/wallet/CMakeFiles/wallet.dir/scriptpubkeyman.cpp.o
[412/541] Building CXX object src/wallet/CMakeFiles/wallet.dir/walletdb.cpp.o
[413/541] Building CXX object src/wallet/CMakeFiles/wallet.dir/rpc/backup.cpp.o
[414/541] Building CXX object src/wallet/CMakeFiles/wallet.dir/wallet.cpp.o
[415/541] Building CXX object src/wallet/CMakeFiles/wallet.dir/rpcwallet.cpp.o
[416/541] Linking CXX static library src/wallet/libwallet.a
ninja: build stopped: cannot make progress due to previous errors.
Build build-diff failed with exit code 1

std::chrono::timepoint is not trivially copyable with all versions of the lib, so let'd drop the atomic. This variable is only accessed from the net thread anyway.

This revision is now accepted and ready to land.Sep 27 2023, 16:08