Page MenuHomePhabricator

[avalanche] Add stake contender cache to avalanche processor
ClosedPublic

Authored by roqqit on Oct 28 2024, 17:15.

Details

Reviewers
Fabien
Group Reviewers
Restricted Owners Package(Owns No Changed Paths)
Restricted Project
Commits
rABCb9a55d2cdd2d: [avalanche] Add stake contender cache to avalanche processor
Summary

This adds the cache to the processor and sanity checks adding contenders to the cache with a simple unit test. The cache is not yet used outside of the unit tests, but this is a necessary prerequisite for testing contender promotion at the processor level.

Test Plan
ninja check-avalanche-processor_tests

Event Timeline

Owners added a reviewer: Restricted Owners Package.Oct 28 2024, 17:15
roqqit requested review of this revision.Oct 28 2024, 17:15
roqqit planned changes to this revision.Oct 28 2024, 17:16

Tail of the build log:

[594/647] Building CXX object src/qt/CMakeFiles/bitcoin-qt-base.dir/bitcoingui.cpp.o
[595/647] Building CXX object src/qt/CMakeFiles/bitcoin-qt-base.dir/intro.cpp.o
[596/647] Linking CXX executable src/bitcoin-chainstate
FAILED: src/bitcoin-chainstate 
: && /usr/bin/c++ -Werror -g -O2 -fuse-ld=gold -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now -lstdc++fs -fPIE -pie src/CMakeFiles/bitcoin-chainstate.dir/bitcoin-chainstate.cpp.o -o src/bitcoin-chainstate  /usr/lib/x86_64-linux-gnu/libjemalloc_pic.a  -lstdc++fs  src/libbitcoinkernel.a  src/crypto/libcrypto.a  src/crypto/libcrypto_sse4.1.a  src/crypto/libcrypto_avx2.a  src/crypto/libcrypto_shani.a  src/univalue/libunivalue.a  src/secp256k1/libsecp256k1.a  src/leveldb/libleveldb.a  src/leveldb/libleveldb-sse4.2.a  src/leveldb/libmemenv.a  /usr/lib/x86_64-linux-gnu/libjemalloc_pic.a  -lm  -pthread  -ldl  -lstdc++fs && :
../../src/avalanche/processor.cpp:976: error: undefined reference to 'avalanche::StakeContenderCache::add(CBlockIndex const*, RCUPtr<avalanche::Proof const> const&, unsigned char)'
../../src/avalanche/processor.cpp:982: error: undefined reference to 'avalanche::StakeContenderCache::getVoteStatus(avalanche::StakeContenderId const&) const'
collect2: error: ld returned 1 exit status
[597/647] Building CXX object src/bench/CMakeFiles/bitcoin-bench.dir/data.cpp.o
[598/647] Building CXX object src/bench/CMakeFiles/bitcoin-bench.dir/chacha20.cpp.o
[599/647] Building CXX object src/qt/CMakeFiles/bitcoin-qt-base.dir/guiutil.cpp.o
[600/647] Building CXX object src/bench/CMakeFiles/bitcoin-bench.dir/ccoins_caching.cpp.o
[601/647] Building CXX object src/qt/CMakeFiles/bitcoin-qt-base.dir/bitcoin.cpp.o
[602/647] Building CXX object src/bench/CMakeFiles/bitcoin-bench.dir/block_assemble.cpp.o
[603/647] Building CXX object src/bench/CMakeFiles/bitcoin-bench.dir/crypto_hash.cpp.o
[604/647] Building CXX object src/bench/CMakeFiles/bitcoin-bench.dir/examples.cpp.o
[605/647] Building CXX object src/bench/CMakeFiles/bitcoin-bench.dir/hashpadding.cpp.o
[606/647] Building CXX object src/qt/CMakeFiles/bitcoin-qt-base.dir/optionsdialog.cpp.o
[607/647] Building CXX object src/bench/CMakeFiles/bitcoin-bench.dir/nanobench.cpp.o
[608/647] Building CXX object src/bench/CMakeFiles/bitcoin-bench.dir/lockedpool.cpp.o
[609/647] Building CXX object src/bench/CMakeFiles/bitcoin-bench.dir/checkqueue.cpp.o
[610/647] Building CXX object src/qt/CMakeFiles/bitcoin-qt-base.dir/optionsmodel.cpp.o
[611/647] Building CXX object src/bench/CMakeFiles/bitcoin-bench.dir/gcs_filter.cpp.o
[612/647] Building CXX object src/bench/CMakeFiles/bitcoin-bench.dir/checkblock.cpp.o
[613/647] Building CXX object src/bench/CMakeFiles/bitcoin-bench.dir/merkle_root.cpp.o
[614/647] Building CXX object src/bench/CMakeFiles/bitcoin-bench.dir/poly1305.cpp.o
[615/647] Building CXX object src/bench/CMakeFiles/bitcoin-bench.dir/pool.cpp.o
[616/647] Building CXX object src/bench/CMakeFiles/bitcoin-bench.dir/crypto_aes.cpp.o
[617/647] Building CXX object src/bench/CMakeFiles/bitcoin-bench.dir/rollingbloom.cpp.o
[618/647] Building CXX object src/bench/CMakeFiles/bitcoin-bench.dir/prevector.cpp.o
[619/647] Building CXX object src/qt/CMakeFiles/bitcoin-qt-base.dir/platformstyle.cpp.o
[620/647] Building CXX object src/qt/CMakeFiles/bitcoin-qt-base.dir/qvalidatedlineedit.cpp.o
[621/647] Building CXX object src/qt/CMakeFiles/bitcoin-qt-base.dir/qvaluecombobox.cpp.o
[622/647] Building CXX object src/bench/CMakeFiles/bitcoin-bench.dir/streams_findbyte.cpp.o
[623/647] Building CXX object src/bench/CMakeFiles/bitcoin-bench.dir/util_time.cpp.o
[624/647] Building CXX object src/bench/CMakeFiles/bitcoin-bench.dir/duplicate_inputs.cpp.o
[625/647] Building CXX object src/bench/CMakeFiles/bitcoin-bench.dir/bench.cpp.o
[626/647] Building CXX object src/bench/CMakeFiles/bitcoin-bench.dir/chained_tx.cpp.o
[627/647] Building CXX object src/qt/CMakeFiles/bitcoin-qt-base.dir/qrc_bitcoin_locale.cpp.o
[628/647] Building CXX object src/bench/CMakeFiles/bitcoin-bench.dir/verify_script.cpp.o
[629/647] Building CXX object src/bench/CMakeFiles/bitcoin-bench.dir/mempool_eviction.cpp.o
[630/647] Building CXX object src/bench/CMakeFiles/bitcoin-bench.dir/load_external.cpp.o
[631/647] Building CXX object src/qt/CMakeFiles/bitcoin-qt-base.dir/qrc_bitcoin.cpp.o
[632/647] Building CXX object src/bench/CMakeFiles/bitcoin-bench.dir/mempool_stress.cpp.o
[633/647] Building CXX object src/bench/CMakeFiles/bitcoin-bench.dir/peer_eviction.cpp.o
[634/647] Building CXX object src/bench/CMakeFiles/bitcoin-bench.dir/rpc_mempool.cpp.o
[635/647] Building CXX object src/bench/CMakeFiles/bitcoin-bench.dir/rpc_blockchain.cpp.o
[636/647] Building CXX object src/qt/CMakeFiles/bitcoin-qt-base.dir/utilitydialog.cpp.o
[637/647] Building CXX object src/qt/CMakeFiles/bitcoin-qt-base.dir/trafficgraphwidget.cpp.o
[638/647] Building CXX object src/qt/CMakeFiles/bitcoin-qt-base.dir/splashscreen.cpp.o
[639/647] Linking CXX executable src/bench/bitcoin-bench
[640/647] Building CXX object src/qt/CMakeFiles/bitcoin-qt-base.dir/peertablemodel.cpp.o
[641/647] Building CXX object src/qt/CMakeFiles/bitcoin-qt-base.dir/rpcconsole.cpp.o
[642/647] Linking CXX static library src/qt/libbitcoin-qt-base.a
[643/647] Automatic MOC for target bitcoin-qt
[644/647] Building CXX object src/qt/CMakeFiles/bitcoin-qt.dir/bitcoin-qt_autogen/mocs_compilation.cpp.o
[645/647] Building CXX object src/qt/CMakeFiles/bitcoin-qt.dir/main.cpp.o
[646/647] Linking CXX executable src/qt/bitcoin-qt
ninja: build stopped: cannot make progress due to previous errors.
Build build-without-wallet failed with exit code 1

Tail of the build log:

[594/647] Building CXX object src/bench/CMakeFiles/bitcoin-bench.dir/chacha20.cpp.o
[595/647] Building CXX object src/qt/CMakeFiles/bitcoin-qt-base.dir/intro.cpp.o
[596/647] Linking CXX executable src/bitcoin-chainstate
FAILED: src/bitcoin-chainstate 
: && /usr/bin/c++ -Werror -g -O2 -fuse-ld=gold -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now -lstdc++fs -fPIE -pie src/CMakeFiles/bitcoin-chainstate.dir/bitcoin-chainstate.cpp.o -o src/bitcoin-chainstate  /usr/lib/x86_64-linux-gnu/libjemalloc_pic.a  -lstdc++fs  src/libbitcoinkernel.a  src/crypto/libcrypto.a  src/crypto/libcrypto_sse4.1.a  src/crypto/libcrypto_avx2.a  src/crypto/libcrypto_shani.a  src/univalue/libunivalue.a  src/secp256k1/libsecp256k1.a  src/leveldb/libleveldb.a  src/leveldb/libleveldb-sse4.2.a  src/leveldb/libmemenv.a  /usr/lib/x86_64-linux-gnu/libjemalloc_pic.a  -lm  -pthread  -ldl  -lstdc++fs && :
../../src/avalanche/processor.cpp:976: error: undefined reference to 'avalanche::StakeContenderCache::add(CBlockIndex const*, RCUPtr<avalanche::Proof const> const&, unsigned char)'
../../src/avalanche/processor.cpp:982: error: undefined reference to 'avalanche::StakeContenderCache::getVoteStatus(avalanche::StakeContenderId const&) const'
collect2: error: ld returned 1 exit status
[597/647] Building CXX object src/bench/CMakeFiles/bitcoin-bench.dir/ccoins_caching.cpp.o
[598/647] Building CXX object src/qt/CMakeFiles/bitcoin-qt-base.dir/bitcoin.cpp.o
[599/647] Building CXX object src/bench/CMakeFiles/bitcoin-bench.dir/crypto_hash.cpp.o
[600/647] Building CXX object src/bench/CMakeFiles/bitcoin-bench.dir/examples.cpp.o
[601/647] Building CXX object src/qt/CMakeFiles/bitcoin-qt-base.dir/optionsdialog.cpp.o
[602/647] Building CXX object src/bench/CMakeFiles/bitcoin-bench.dir/checkqueue.cpp.o
[603/647] Building CXX object src/qt/CMakeFiles/bitcoin-qt-base.dir/guiutil.cpp.o
[604/647] Building CXX object src/bench/CMakeFiles/bitcoin-bench.dir/block_assemble.cpp.o
[605/647] Building CXX object src/bench/CMakeFiles/bitcoin-bench.dir/hashpadding.cpp.o
[606/647] Building CXX object src/bench/CMakeFiles/bitcoin-bench.dir/data.cpp.o
[607/647] Building CXX object src/bench/CMakeFiles/bitcoin-bench.dir/gcs_filter.cpp.o
[608/647] Building CXX object src/qt/CMakeFiles/bitcoin-qt-base.dir/optionsmodel.cpp.o
[609/647] Building CXX object src/bench/CMakeFiles/bitcoin-bench.dir/lockedpool.cpp.o
[610/647] Building CXX object src/bench/CMakeFiles/bitcoin-bench.dir/checkblock.cpp.o
[611/647] Building CXX object src/bench/CMakeFiles/bitcoin-bench.dir/merkle_root.cpp.o
[612/647] Building CXX object src/bench/CMakeFiles/bitcoin-bench.dir/poly1305.cpp.o
[613/647] Building CXX object src/bench/CMakeFiles/bitcoin-bench.dir/pool.cpp.o
[614/647] Building CXX object src/bench/CMakeFiles/bitcoin-bench.dir/crypto_aes.cpp.o
[615/647] Building CXX object src/bench/CMakeFiles/bitcoin-bench.dir/rollingbloom.cpp.o
[616/647] Building CXX object src/bench/CMakeFiles/bitcoin-bench.dir/duplicate_inputs.cpp.o
[617/647] Building CXX object src/bench/CMakeFiles/bitcoin-bench.dir/prevector.cpp.o
[618/647] Building CXX object src/bench/CMakeFiles/bitcoin-bench.dir/chained_tx.cpp.o
[619/647] Building CXX object src/bench/CMakeFiles/bitcoin-bench.dir/util_time.cpp.o
[620/647] Building CXX object src/bench/CMakeFiles/bitcoin-bench.dir/streams_findbyte.cpp.o
[621/647] Building CXX object src/bench/CMakeFiles/bitcoin-bench.dir/bench.cpp.o
[622/647] Building CXX object src/bench/CMakeFiles/bitcoin-bench.dir/load_external.cpp.o
[623/647] Building CXX object src/qt/CMakeFiles/bitcoin-qt-base.dir/platformstyle.cpp.o
[624/647] Building CXX object src/bench/CMakeFiles/bitcoin-bench.dir/verify_script.cpp.o
[625/647] Building CXX object src/bench/CMakeFiles/bitcoin-bench.dir/mempool_eviction.cpp.o
[626/647] Building CXX object src/bench/CMakeFiles/bitcoin-bench.dir/peer_eviction.cpp.o
[627/647] Building CXX object src/qt/CMakeFiles/bitcoin-qt-base.dir/qvalidatedlineedit.cpp.o
[628/647] Building CXX object src/qt/CMakeFiles/bitcoin-qt-base.dir/qvaluecombobox.cpp.o
[629/647] Linking CXX executable src/iguana/iguana
[630/647] Building CXX object src/qt/CMakeFiles/bitcoin-qt-base.dir/qrc_bitcoin.cpp.o
[631/647] Building CXX object src/bench/CMakeFiles/bitcoin-bench.dir/mempool_stress.cpp.o
[632/647] Building CXX object src/bench/CMakeFiles/bitcoin-bench.dir/nanobench.cpp.o
[633/647] Building CXX object src/bench/CMakeFiles/bitcoin-bench.dir/rpc_mempool.cpp.o
[634/647] Building CXX object src/bench/CMakeFiles/bitcoin-bench.dir/rpc_blockchain.cpp.o
[635/647] Building CXX object src/qt/CMakeFiles/bitcoin-qt-base.dir/trafficgraphwidget.cpp.o
[636/647] Building CXX object src/qt/CMakeFiles/bitcoin-qt-base.dir/utilitydialog.cpp.o
[637/647] Linking CXX executable src/bench/bitcoin-bench
[638/647] Building CXX object src/qt/CMakeFiles/bitcoin-qt-base.dir/splashscreen.cpp.o
[639/647] Building CXX object src/qt/CMakeFiles/bitcoin-qt-base.dir/qrc_bitcoin_locale.cpp.o
[640/647] Building CXX object src/qt/CMakeFiles/bitcoin-qt-base.dir/peertablemodel.cpp.o
[641/647] Building CXX object src/qt/CMakeFiles/bitcoin-qt-base.dir/rpcconsole.cpp.o
[642/647] Linking CXX static library src/qt/libbitcoin-qt-base.a
[643/647] Automatic MOC for target bitcoin-qt
[644/647] Building CXX object src/qt/CMakeFiles/bitcoin-qt.dir/bitcoin-qt_autogen/mocs_compilation.cpp.o
[645/647] Building CXX object src/qt/CMakeFiles/bitcoin-qt.dir/main.cpp.o
[646/647] Linking CXX executable src/qt/bitcoin-qt
ninja: build stopped: cannot make progress due to previous errors.
Build build-without-wallet failed with exit code 1
Fabien requested changes to this revision.Oct 28 2024, 19:44
Fabien added a subscriber: Fabien.

Back to your queue

This revision now requires changes to proceed.Oct 28 2024, 19:44

Fix build failure and rebase

This revision is now accepted and ready to land.Oct 29 2024, 08:56