Page MenuHomePhabricator

refactor: remove config argument from removeForReorg and updateMempoolForReorg
AbandonedPublic

Authored by PiRK on Oct 11 2022, 09:52.

Details

Reviewers
Fabien
Group Reviewers
Restricted Project
Summary

These methods only use the config to access the chain params, which is now accessible as member of the chain state.

Depends on D12214

Test Plan

ninja all check-all

Event Timeline

Fabien requested changes to this revision.Oct 11 2022, 14:30
Fabien added a subscriber: Fabien.
Fabien added inline comments.
src/txmempool.h
659 ↗(On Diff #35576)

You already have the chain params in CChainState since your last backport, this should be public or have an accessor rather than duplicating

1115 ↗(On Diff #35576)

dito

This revision now requires changes to proceed.Oct 11 2022, 14:30

remove config argument altogether

PiRK retitled this revision from refactor: pass chain params instead of config to removeForReorg and updateMempoolForReorg to refactor: remove config argument from removeForReorg and updateMempoolForReorg.Oct 12 2022, 10:38
PiRK edited the summary of this revision. (Show Details)

Tail of the build log:

-- Installing: /results/artifacts/include/secp256k1_preallocated.h
-- Installing: /results/artifacts/include/secp256k1_recovery.h
-- Installing: /results/artifacts/include/secp256k1_schnorr.h
[353/523] Building C object src/secp256k1/CMakeFiles/internal-bench.dir/src/bench_internal.c.o
[354/523] Linking C executable src/secp256k1/internal-bench
[355/523] Building CXX object src/test/CMakeFiles/testutil.dir/util/logging.cpp.o
[356/523] Building CXX object src/CMakeFiles/server.dir/rpc/avalanche.cpp.o
[357/523] Building CXX object src/CMakeFiles/server.dir/rpc/server.cpp.o
[358/523] Building CXX object src/CMakeFiles/server.dir/rpc/mining.cpp.o
[359/523] Building CXX object src/test/CMakeFiles/testutil.dir/util/str.cpp.o
[360/523] Building CXX object src/test/CMakeFiles/testutil.dir/util/transaction_utils.cpp.o
[361/523] Building CXX object src/CMakeFiles/server.dir/torcontrol.cpp.o
[362/523] Building CXX object src/CMakeFiles/server.dir/rpc/net.cpp.o
[363/523] Building CXX object src/CMakeFiles/server.dir/validation.cpp.o
FAILED: src/CMakeFiles/server.dir/validation.cpp.o 
/usr/bin/ccache /usr/bin/clang++ -DBOOST_AC_USE_STD_ATOMIC -DBOOST_ALL_NO_LIB -DBOOST_ATOMIC_DYN_LINK -DBOOST_FILESYSTEM_DYN_LINK -DBOOST_SP_USE_STD_ATOMIC -DBOOST_THREAD_DYN_LINK -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/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 -g -O2 -fPIC -fvisibility=hidden -fstack-protector-all -Wstack-protector -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -Wall -Wextra -Wformat -Wgnu -Wvla -Wcast-align -Wunused-parameter -Wmissing-braces -Wthread-safety -Wrange-loop-analysis -Wredundant-decls -Wunreachable-code-loop-increment -Wsign-compare -Wconditional-uninitialized -Wdocumentation -Wformat-security -Wredundant-move -Woverloaded-virtual -Wshadow -Wshadow-field -Wno-unused-parameter -Wno-implicit-fallthrough -pthread -std=gnu++17 -MD -MT src/CMakeFiles/server.dir/validation.cpp.o -MF src/CMakeFiles/server.dir/validation.cpp.o.d -o src/CMakeFiles/server.dir/validation.cpp.o -c ../../src/validation.cpp
../../src/validation.cpp:747:22: error: lambda capture 'args' is not used [-Werror,-Wunused-lambda-capture]
                   [&args, this](const auto &tx) {
                    ~^~~~~
1 error generated.
[364/523] Building CXX object src/wallet/CMakeFiles/wallet.dir/bdb.cpp.o
[365/523] Building CXX object src/wallet/CMakeFiles/wallet.dir/coincontrol.cpp.o
[366/523] Building CXX object src/wallet/CMakeFiles/wallet.dir/coinselection.cpp.o
[367/523] Building CXX object src/wallet/CMakeFiles/wallet.dir/context.cpp.o
[368/523] Building CXX object src/wallet/CMakeFiles/wallet.dir/crypter.cpp.o
[369/523] Building CXX object src/wallet/CMakeFiles/wallet.dir/db.cpp.o
[370/523] Building CXX object src/CMakeFiles/server.dir/txmempool.cpp.o
[371/523] Building CXX object src/test/CMakeFiles/testutil.dir/util/blockfilter.cpp.o
[372/523] Building CXX object src/test/CMakeFiles/testutil.dir/util/mining.cpp.o
[373/523] Building CXX object src/test/CMakeFiles/testutil.dir/util/net.cpp.o
[374/523] Building CXX object src/CMakeFiles/server.dir/wallet/init.cpp.o
[375/523] Building CXX object src/test/CMakeFiles/testutil.dir/util/wallet.cpp.o
[376/523] Building CXX object src/wallet/CMakeFiles/wallet.dir/sqlite.cpp.o
[377/523] Building CXX object src/CMakeFiles/bitcoin-tx.dir/bitcoin-tx.cpp.o
[378/523] Linking CXX executable src/bitcoin-tx
[379/523] Building CXX object src/CMakeFiles/server.dir/rpc/rawtransaction.cpp.o
[380/523] Building CXX object src/wallet/CMakeFiles/wallet.dir/fees.cpp.o
[381/523] Building CXX object src/wallet/CMakeFiles/wallet.dir/walletutil.cpp.o
[382/523] Building CXX object src/seeder/CMakeFiles/seeder-base.dir/db.cpp.o
[383/523] Building CXX object src/seeder/CMakeFiles/seeder-base.dir/dns.cpp.o
[384/523] Building CXX object src/wallet/CMakeFiles/wallet-tool.dir/wallettool.cpp.o
[385/523] Building CXX object src/seeder/CMakeFiles/seeder-base.dir/options.cpp.o
[386/523] Building CXX object src/seeder/CMakeFiles/bitcoin-seeder.dir/main.cpp.o
[387/523] Building CXX object src/CMakeFiles/server.dir/rpc/blockchain.cpp.o
[388/523] Building CXX object src/test/CMakeFiles/testutil.dir/util/setup_common.cpp.o
[389/523] Building CXX object src/wallet/CMakeFiles/wallet.dir/load.cpp.o
[390/523] Building CXX object src/CMakeFiles/server.dir/net_processing.cpp.o
[391/523] Building CXX object src/wallet/CMakeFiles/wallet.dir/__/interfaces/wallet.cpp.o
[392/523] Building CXX object src/seeder/CMakeFiles/seeder-base.dir/bitcoin.cpp.o
[393/523] Building CXX object src/wallet/CMakeFiles/wallet.dir/salvage.cpp.o
[394/523] Building CXX object src/wallet/CMakeFiles/wallet.dir/scriptpubkeyman.cpp.o
[395/523] Building CXX object src/wallet/CMakeFiles/wallet.dir/walletdb.cpp.o
[396/523] Building CXX object src/wallet/CMakeFiles/wallet.dir/rpcdump.cpp.o
[397/523] Building CXX object src/wallet/CMakeFiles/wallet.dir/wallet.cpp.o
[398/523] Building CXX object src/wallet/CMakeFiles/wallet.dir/rpcwallet.cpp.o
[399/523] Linking CXX static library src/wallet/libwallet.a
[400/523] Linking CXX static library src/wallet/libwallet-tool.a
[401/523] Linking CXX executable src/bitcoin-wallet
ninja: build stopped: cannot make progress due to previous errors.
Build build-clang failed with exit code 1
PiRK planned changes to this revision.Oct 12 2022, 11:21

wait for D12213 then rebase

PiRK edited the summary of this revision. (Show Details)

rebase

Tail of the build log:

1 error generated.
[377/524] Building CXX object src/wallet/CMakeFiles/wallet.dir/sqlite.cpp.o
[378/524] 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/clang++ -DBOOST_AC_USE_STD_ATOMIC -DBOOST_ALL_NO_LIB -DBOOST_ATOMIC_DYN_LINK -DBOOST_FILESYSTEM_DYN_LINK -DBOOST_SP_USE_STD_ATOMIC -DBOOST_THREAD_DYN_LINK -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/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 -g -O2 -fPIC -fvisibility=hidden -fstack-protector-all -Wstack-protector -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -Wall -Wextra -Wformat -Wgnu -Wvla -Wcast-align -Wunused-parameter -Wmissing-braces -Wthread-safety -Wrange-loop-analysis -Wredundant-decls -Wunreachable-code-loop-increment -Wsign-compare -Wconditional-uninitialized -Wdocumentation -Wformat-security -Wredundant-move -Woverloaded-virtual -Wshadow -Wshadow-field -Wno-unused-parameter -Wno-implicit-fallthrough -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:
In file included from ../../src/./net.h:13:
In file included from ../../src/./avalanche/proofradixtreeadapter.h:8:
In file included from ../../src/./avalanche/proof.h:16:
../../src/./validation.h:336:16: error: parameter 'config' not found in the function declaration [-Werror,-Wdocumentation]
 * @param[in]  config             The global configuration.
               ^~~~~~
1 error generated.
[379/524] Building CXX object src/CMakeFiles/server.dir/rpc/server.cpp.o
[380/524] Building CXX object src/wallet/CMakeFiles/wallet.dir/walletutil.cpp.o
[381/524] 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/clang++ -DBOOST_AC_USE_STD_ATOMIC -DBOOST_ALL_NO_LIB -DBOOST_ATOMIC_DYN_LINK -DBOOST_FILESYSTEM_DYN_LINK -DBOOST_SP_USE_STD_ATOMIC -DBOOST_THREAD_DYN_LINK -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-protector-all -Wstack-protector -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -Wall -Wextra -Wformat -Wgnu -Wvla -Wcast-align -Wunused-parameter -Wmissing-braces -Wthread-safety -Wrange-loop-analysis -Wredundant-decls -Wunreachable-code-loop-increment -Wsign-compare -Wconditional-uninitialized -Wdocumentation -Wformat-security -Wredundant-move -Woverloaded-virtual -Wshadow -Wshadow-field -Wno-unused-parameter -Wno-implicit-fallthrough -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:17:
In file included from ../../src/./net.h:13:
In file included from ../../src/./avalanche/proofradixtreeadapter.h:8:
In file included from ../../src/./avalanche/proof.h:16:
../../src/./validation.h:336:16: error: parameter 'config' not found in the function declaration [-Werror,-Wdocumentation]
 * @param[in]  config             The global configuration.
               ^~~~~~
1 error generated.
[382/524] Building CXX object src/seeder/CMakeFiles/seeder-base.dir/db.cpp.o
[383/524] Building CXX object src/seeder/CMakeFiles/seeder-base.dir/dns.cpp.o
[384/524] Building CXX object src/seeder/CMakeFiles/seeder-base.dir/options.cpp.o
[385/524] Building CXX object src/seeder/CMakeFiles/bitcoin-seeder.dir/main.cpp.o
[386/524] Building CXX object src/test/CMakeFiles/testutil.dir/util/wallet.cpp.o
[387/524] Building CXX object src/wallet/CMakeFiles/wallet.dir/fees.cpp.o
[388/524] Building CXX object src/wallet/CMakeFiles/wallet-tool.dir/wallettool.cpp.o
[389/524] Building CXX object src/CMakeFiles/bitcoin-tx.dir/bitcoin-tx.cpp.o
[390/524] Linking CXX executable src/bitcoin-tx
[391/524] Building CXX object src/wallet/CMakeFiles/wallet.dir/load.cpp.o
[392/524] 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/clang++ -DBOOST_AC_USE_STD_ATOMIC -DBOOST_ALL_NO_LIB -DBOOST_ATOMIC_DYN_LINK -DBOOST_FILESYSTEM_DYN_LINK -DBOOST_SP_USE_STD_ATOMIC -DBOOST_THREAD_DYN_LINK -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-protector-all -Wstack-protector -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -Wall -Wextra -Wformat -Wgnu -Wvla -Wcast-align -Wunused-parameter -Wmissing-braces -Wthread-safety -Wrange-loop-analysis -Wredundant-decls -Wunreachable-code-loop-increment -Wsign-compare -Wconditional-uninitialized -Wdocumentation -Wformat-security -Wredundant-move -Woverloaded-virtual -Wshadow -Wshadow-field -Wno-unused-parameter -Wno-implicit-fallthrough -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/bitcoin.cpp:13:
In file included from ../../src/./seeder/messagewriter.h:9:
In file included from ../../src/./net.h:13:
In file included from ../../src/./avalanche/proofradixtreeadapter.h:8:
In file included from ../../src/./avalanche/proof.h:16:
../../src/./validation.h:336:16: error: parameter 'config' not found in the function declaration [-Werror,-Wdocumentation]
 * @param[in]  config             The global configuration.
               ^~~~~~
1 error generated.
[393/524] Building CXX object src/wallet/CMakeFiles/wallet.dir/salvage.cpp.o
[394/524] Building CXX object src/wallet/CMakeFiles/wallet.dir/__/interfaces/wallet.cpp.o
[395/524] Building CXX object src/wallet/CMakeFiles/wallet.dir/scriptpubkeyman.cpp.o
[396/524] Building CXX object src/wallet/CMakeFiles/wallet.dir/walletdb.cpp.o
[397/524] Building CXX object src/wallet/CMakeFiles/wallet.dir/rpcdump.cpp.o
[398/524] Building CXX object src/wallet/CMakeFiles/wallet.dir/wallet.cpp.o
[399/524] Building CXX object src/wallet/CMakeFiles/wallet.dir/rpcwallet.cpp.o
[400/524] Linking CXX static library src/wallet/libwallet.a
[401/524] Linking CXX static library src/wallet/libwallet-tool.a
[402/524] Linking CXX executable src/bitcoin-wallet
ninja: build stopped: cannot make progress due to previous errors.
Build build-clang failed with exit code 1

rebase after removing unused parameters from doxygen doc in parent diff

This revision is now accepted and ready to land.Oct 14 2022, 14:17
PiRK planned changes to this revision.Oct 21 2022, 06:49