Page MenuHomePhabricator

[backport#19988 5/9] Reduce MAX_PEER_TX_ANNOUNCEMENTS for non-PF_RELAY peers
AbandonedPublic

Authored by majcosta on May 17 2021, 17:59.

Details

Reviewers
None
Group Reviewers
Restricted Project
Summary

Maintaining up to 100000 INVs per peer is excessive, as that is far more
than fits in a typical mempool.

Also disable the "overload" penalty for PF_RELAY peers.


Partial backport of core#19988
https://github.com/bitcoin/bitcoin/pull/19988/commits/de11b0a4eff20da3e3ca52dc90948b5253d329c5

Depends on D9539

Test Plan
ninja all check check-functional

Event Timeline

Tail of the build log:

[340/505] Linking C executable src/secp256k1/verify-bench
[341/505] Linking C executable src/secp256k1/recover-bench
[342/505] Installing component secp256k1
-- Install configuration: "Debug"
-- Install component: "secp256k1"
-- 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
[343/505] Building CXX object src/test/CMakeFiles/testutil.dir/util/transaction_utils.cpp.o
[344/505] Linking CXX static library src/libscript.a
[345/505] Building CXX object src/wallet/CMakeFiles/wallet.dir/coincontrol.cpp.o
[346/505] Building CXX object src/test/CMakeFiles/testutil.dir/util/wallet.cpp.o
[347/505] Building CXX object src/wallet/CMakeFiles/wallet-tool.dir/wallettool.cpp.o
[348/505] Building CXX object src/wallet/CMakeFiles/wallet.dir/context.cpp.o
[349/505] Building CXX object src/wallet/CMakeFiles/wallet.dir/bdb.cpp.o
[350/505] Building CXX object src/wallet/CMakeFiles/wallet.dir/coinselection.cpp.o
[351/505] Building CXX object src/wallet/CMakeFiles/wallet.dir/__/interfaces/wallet.cpp.o
[352/505] Building CXX object src/wallet/CMakeFiles/wallet.dir/db.cpp.o
[353/505] Building CXX object src/wallet/CMakeFiles/wallet.dir/crypter.cpp.o
[354/505] Building CXX object src/wallet/CMakeFiles/wallet.dir/rpcdump.cpp.o
[355/505] Building CXX object src/wallet/CMakeFiles/wallet.dir/fees.cpp.o
[356/505] Building CXX object src/wallet/CMakeFiles/wallet.dir/load.cpp.o
[357/505] Building CXX object src/wallet/CMakeFiles/wallet.dir/rpcwallet.cpp.o
[358/505] Building CXX object src/wallet/CMakeFiles/wallet.dir/salvage.cpp.o
[359/505] Building CXX object src/wallet/CMakeFiles/wallet.dir/scriptpubkeyman.cpp.o
[360/505] Building CXX object src/wallet/CMakeFiles/wallet.dir/wallet.cpp.o
[361/505] Building CXX object src/wallet/CMakeFiles/wallet.dir/walletdb.cpp.o
[362/505] Building CXX object src/seeder/CMakeFiles/seeder-base.dir/db.cpp.o
[363/505] Building CXX object src/wallet/CMakeFiles/wallet.dir/walletutil.cpp.o
[364/505] Building CXX object src/seeder/CMakeFiles/seeder-base.dir/dns.cpp.o
[365/505] Building CXX object src/seeder/CMakeFiles/bitcoin-seeder.dir/main.cpp.o
[366/505] Building CXX object src/CMakeFiles/server.dir/net.cpp.o
[367/505] Building CXX object src/CMakeFiles/server.dir/torcontrol.cpp.o
[368/505] Building CXX object src/CMakeFiles/common.dir/net_permissions.cpp.o
[369/505] Linking CXX static library src/libcommon.a
[370/505] Linking CXX shared library src/libbitcoinconsensus.so.0.23.4
[371/505] Creating library symlink src/libbitcoinconsensus.so.0 src/libbitcoinconsensus.so
[372/505] Linking CXX executable src/bitcoin-cli
[373/505] Linking CXX executable src/bitcoin-tx
[374/505] Linking CXX static library src/wallet/libwallet.a
[375/505] Linking CXX static library src/wallet/libwallet-tool.a
[376/505] Building CXX object src/CMakeFiles/server.dir/init.cpp.o
[377/505] Building CXX object src/CMakeFiles/server.dir/txrequest.cpp.o
FAILED: src/CMakeFiles/server.dir/txrequest.cpp.o 
/usr/bin/ccache /usr/bin/c++  -DBOOST_AC_USE_STD_ATOMIC -DBOOST_SP_USE_STD_ATOMIC -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 -U_FORTIFY_SOURCE -Wall -Wextra -Wformat -Wvla -Wcast-align -Wunused-parameter -Wmissing-braces -Wredundant-decls -Wsign-compare -Wformat-security -Wno-unused-parameter -Wno-implicit-fallthrough -pthread -std=gnu++17 -MD -MT src/CMakeFiles/server.dir/txrequest.cpp.o -MF src/CMakeFiles/server.dir/txrequest.cpp.o.d -o src/CMakeFiles/server.dir/txrequest.cpp.o -c ../../src/txrequest.cpp
../../src/txrequest.cpp:79:21: error: ‘{anonymous}::Announcement::m_state’ is too small to hold all values of ‘enum class {anonymous}::State’ [-Werror]
     State m_state : 3;
                     ^
cc1plus: all warnings being treated as errors
[378/505] Building CXX object src/CMakeFiles/server.dir/net_processing.cpp.o
[379/505] Building CXX object src/test/CMakeFiles/testutil.dir/util/net.cpp.o
[380/505] Linking CXX executable src/bitcoin-wallet
[381/505] Building CXX object src/CMakeFiles/server.dir/wallet/init.cpp.o
[382/505] Building CXX object src/seeder/CMakeFiles/seeder-base.dir/bitcoin.cpp.o
[383/505] Building CXX object src/test/CMakeFiles/testutil.dir/util/setup_common.cpp.o
[384/505] Building CXX object src/CMakeFiles/server.dir/validation.cpp.o
ninja: build stopped: cannot make progress due to previous errors.
Build build-debug failed with exit code 1

Tail of the build log:

[311/452] Building CXX object src/CMakeFiles/server.dir/rpc/abc.cpp.o
[312/452] Building CXX object src/CMakeFiles/server.dir/rest.cpp.o
[313/452] Building CXX object src/CMakeFiles/server.dir/timedata.cpp.o
[314/452] Building CXX object src/CMakeFiles/server.dir/rpc/avalanche.cpp.o
[315/452] Building CXX object src/CMakeFiles/server.dir/script/sigcache.cpp.o
[316/452] Building CXX object src/CMakeFiles/server.dir/rpc/misc.cpp.o
[317/452] Building CXX object src/CMakeFiles/server.dir/versionbits.cpp.o
[318/452] Building CXX object src/CMakeFiles/server.dir/rpc/server.cpp.o
[319/452] Building CXX object src/CMakeFiles/server.dir/rpc/net.cpp.o
[320/452] Building CXX object src/CMakeFiles/server.dir/rpc/mining.cpp.o
[321/452] Building CXX object src/CMakeFiles/server.dir/txdb.cpp.o
[322/452] Building C object src/secp256k1/CMakeFiles/sign-bench.dir/src/bench_sign.c.o
[323/452] Building CXX object src/CMakeFiles/server.dir/init.cpp.o
[324/452] Building C object src/secp256k1/CMakeFiles/verify-bench.dir/src/bench_verify.c.o
[325/452] Building C object src/secp256k1/CMakeFiles/recover-bench.dir/src/bench_recover.c.o
[326/452] Building CXX object src/CMakeFiles/server.dir/validationinterface.cpp.o
[327/452] Building CXX object src/CMakeFiles/server.dir/net_processing.cpp.o
[328/452] Building C object src/secp256k1/CMakeFiles/ecmult-bench.dir/src/bench_ecmult.c.o
[329/452] Building C object src/secp256k1/CMakeFiles/internal-bench.dir/src/bench_internal.c.o
[330/452] Building CXX object src/CMakeFiles/server.dir/dummywallet.cpp.o
[331/452] Building CXX object src/test/CMakeFiles/testutil.dir/util/str.cpp.o
[332/452] Building C object src/secp256k1/CMakeFiles/secp256k1.dir/src/secp256k1.c.o
[333/452] Linking C static library src/secp256k1/libsecp256k1.a
[334/452] Building CXX object src/test/CMakeFiles/testutil.dir/util/logging.cpp.o
[335/452] Linking CXX static library src/libcommon.a
[336/452] Linking C executable src/secp256k1/ecmult-bench
[337/452] Linking C executable src/secp256k1/internal-bench
[338/452] Linking CXX static library src/libscript.a
[339/452] Linking C executable src/secp256k1/sign-bench
[340/452] Linking CXX static library src/libbitcoinconsensus.a
[341/452] Building CXX object src/CMakeFiles/server.dir/torcontrol.cpp.o
[342/452] Linking C executable src/secp256k1/verify-bench
[343/452] Linking CXX shared library src/libbitcoinconsensus.so.0.23.4
[344/452] Creating library symlink src/libbitcoinconsensus.so.0 src/libbitcoinconsensus.so
[345/452] Linking C executable src/secp256k1/recover-bench
[346/452] Linking CXX executable src/bitcoin-cli
[347/452] Building CXX object src/CMakeFiles/server.dir/txrequest.cpp.o
FAILED: src/CMakeFiles/server.dir/txrequest.cpp.o 
/usr/bin/ccache /usr/bin/c++  -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 -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-reuse=none -fstack-protector-all -Wstack-protector -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -Wall -Wextra -Wformat -Wvla -Wcast-align -Wunused-parameter -Wmissing-braces -Wredundant-decls -Wsign-compare -Wformat-security -Wno-unused-parameter -Wno-implicit-fallthrough -pthread -std=gnu++17 -MD -MT src/CMakeFiles/server.dir/txrequest.cpp.o -MF src/CMakeFiles/server.dir/txrequest.cpp.o.d -o src/CMakeFiles/server.dir/txrequest.cpp.o -c ../../src/txrequest.cpp
../../src/txrequest.cpp:79:21: error: ‘{anonymous}::Announcement::m_state’ is too small to hold all values of ‘enum class {anonymous}::State’ [-Werror]
     State m_state : 3;
                     ^
cc1plus: all warnings being treated as errors
[348/452] Linking CXX executable src/bitcoin-tx
[349/452] Building CXX object src/seeder/CMakeFiles/seeder-base.dir/dns.cpp.o
[350/452] Building CXX object src/test/CMakeFiles/testutil.dir/util/wallet.cpp.o
[351/452] Building CXX object src/test/CMakeFiles/testutil.dir/util/blockfilter.cpp.o
[352/452] Building CXX object src/CMakeFiles/server.dir/txmempool.cpp.o
[353/452] Building CXX object src/test/CMakeFiles/testutil.dir/util/transaction_utils.cpp.o
[354/452] Building CXX object src/seeder/CMakeFiles/seeder-base.dir/db.cpp.o
[355/452] Building CXX object src/test/CMakeFiles/testutil.dir/util/mining.cpp.o
[356/452] Building CXX object src/test/CMakeFiles/testutil.dir/util/net.cpp.o
[357/452] Building CXX object src/seeder/CMakeFiles/bitcoin-seeder.dir/main.cpp.o
[358/452] Building CXX object src/CMakeFiles/server.dir/rpc/rawtransaction.cpp.o
[359/452] Building CXX object src/test/CMakeFiles/testutil.dir/util/setup_common.cpp.o
[360/452] Building CXX object src/seeder/CMakeFiles/seeder-base.dir/bitcoin.cpp.o
[361/452] Building CXX object src/CMakeFiles/server.dir/rpc/blockchain.cpp.o
[362/452] 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:

[334/505] Building C object src/secp256k1/CMakeFiles/secp256k1.dir/src/secp256k1.c.o
[335/505] Linking C static library src/secp256k1/libsecp256k1.a
[336/505] Linking CXX static library src/libbitcoinconsensus.a
[337/505] Building C object src/secp256k1/CMakeFiles/internal-bench.dir/src/bench_internal.c.o
[338/505] Linking C executable src/secp256k1/ecmult-bench
[339/505] Linking C executable src/secp256k1/internal-bench
[340/505] Building CXX object src/test/CMakeFiles/testutil.dir/util/logging.cpp.o
[341/505] Linking C executable src/secp256k1/sign-bench
[342/505] Linking C executable src/secp256k1/verify-bench
[343/505] Linking C executable src/secp256k1/recover-bench
[344/505] Installing component secp256k1
-- Install configuration: "RelWithDebInfo"
-- Install component: "secp256k1"
-- 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
[345/505] Building CXX object src/CMakeFiles/script.dir/script/descriptor.cpp.o
[346/505] Building CXX object src/wallet/CMakeFiles/wallet.dir/db.cpp.o
[347/505] Building CXX object src/CMakeFiles/bitcoin-cli.dir/bitcoin-cli.cpp.o
[348/505] Linking CXX static library src/libscript.a
[349/505] Linking CXX static library src/libcommon.a
[350/505] Building CXX object src/CMakeFiles/server.dir/validation.cpp.o
[351/505] Linking CXX shared library src/libbitcoinconsensus.so.0.23.4
[352/505] Creating library symlink src/libbitcoinconsensus.so.0 src/libbitcoinconsensus.so
[353/505] Building CXX object src/test/CMakeFiles/testutil.dir/util/blockfilter.cpp.o
[354/505] Building CXX object src/wallet/CMakeFiles/wallet.dir/context.cpp.o
[355/505] Linking CXX executable src/bitcoin-cli
[356/505] Building CXX object src/test/CMakeFiles/testutil.dir/util/transaction_utils.cpp.o
[357/505] Building CXX object src/test/CMakeFiles/testutil.dir/util/net.cpp.o
[358/505] Building CXX object src/test/CMakeFiles/testutil.dir/util/mining.cpp.o
[359/505] Building CXX object src/CMakeFiles/bitcoin-tx.dir/bitcoin-tx.cpp.o
[360/505] Linking CXX executable src/bitcoin-tx
[361/505] Building CXX object src/wallet/CMakeFiles/wallet.dir/coincontrol.cpp.o
[362/505] Building CXX object src/test/CMakeFiles/testutil.dir/util/wallet.cpp.o
[363/505] Building CXX object src/wallet/CMakeFiles/wallet.dir/bdb.cpp.o
[364/505] Building CXX object src/wallet/CMakeFiles/wallet.dir/crypter.cpp.o
[365/505] Building CXX object src/wallet/CMakeFiles/wallet.dir/coinselection.cpp.o
[366/505] Building CXX object src/test/CMakeFiles/testutil.dir/util/setup_common.cpp.o
[367/505] Building CXX object src/seeder/CMakeFiles/seeder-base.dir/dns.cpp.o
[368/505] Building CXX object src/wallet/CMakeFiles/wallet.dir/fees.cpp.o
[369/505] Building CXX object src/seeder/CMakeFiles/seeder-base.dir/db.cpp.o
[370/505] Building CXX object src/wallet/CMakeFiles/wallet.dir/load.cpp.o
[371/505] Building CXX object src/wallet/CMakeFiles/wallet-tool.dir/wallettool.cpp.o
[372/505] Building CXX object src/wallet/CMakeFiles/wallet.dir/walletutil.cpp.o
[373/505] Building CXX object src/wallet/CMakeFiles/wallet.dir/salvage.cpp.o
[374/505] Building CXX object src/seeder/CMakeFiles/seeder-base.dir/bitcoin.cpp.o
[375/505] Building CXX object src/wallet/CMakeFiles/wallet.dir/__/interfaces/wallet.cpp.o
[376/505] Building CXX object src/seeder/CMakeFiles/bitcoin-seeder.dir/main.cpp.o
[377/505] Building CXX object src/wallet/CMakeFiles/wallet.dir/scriptpubkeyman.cpp.o
[378/505] Building CXX object src/wallet/CMakeFiles/wallet.dir/walletdb.cpp.o
[379/505] Building CXX object src/wallet/CMakeFiles/wallet.dir/rpcdump.cpp.o
[380/505] Building CXX object src/wallet/CMakeFiles/wallet.dir/wallet.cpp.o
[381/505] Building CXX object src/wallet/CMakeFiles/wallet.dir/rpcwallet.cpp.o
[382/505] Linking CXX static library src/wallet/libwallet.a
[383/505] Linking CXX static library src/wallet/libwallet-tool.a
[384/505] Linking CXX executable src/bitcoin-wallet
ninja: build stopped: cannot make progress due to previous errors.
Build build-diff failed with exit code 1