Page MenuHomePhabricator

remove ::fAcceptDatacarrier global
ClosedPublic

Authored by PiRK on Mar 25 2024, 09:25.

Details

Reviewers
Fabien
Group Reviewers
Restricted Project
Commits
rABCfcf58d6bd71c: remove ::fAcceptDatacarrier global
Summary

This is a partial backport of core#25648

Combine datacarrier globals into one

https://github.com/bitcoin/bitcoin/pull/25648/commits/fa2a6b8516b24d7e9ca11926a49cf2b07f661e81

Pass datacarrier setting into IsStandard

https://github.com/bitcoin/bitcoin/pull/25648/commits/fad0b4fab849eb5f1f0aa54ebc290f85a473ec91

Remove global

https://github.com/bitcoin/bitcoin/pull/25648/commits/66664384a6fec39ecb4d8d06db66a4f193a06e33

Notable differences from the source material:

  • we already removed ::nMaxDatacarrierBytes in D1419
  • the avalanche code also relies on IsStandard for verifying proofs. Wrap the function call to use MAX_OP_RETURN_RELAY in this context, to avoid having relay policies from the local node impact other nodes' proof validity

Depends on D15780

Test Plan

ninja all check-all bitcoin-fuzzers

Event Timeline

PiRK requested review of this revision.Mar 25 2024, 09:25

remove unused max_datacarrier_bytes in processor.cpp

Tail of the build log:

-- Installing: /results/artifacts/include/secp256k1_recovery.h
-- Installing: /results/artifacts/include/secp256k1_schnorr.h
[369/549] Linking C executable src/secp256k1/internal-bench
[370/549] Linking C executable src/secp256k1/recover-bench
[371/549] Linking C executable src/secp256k1/verify-bench
[372/549] Building CXX object src/test/CMakeFiles/testutil.dir/util/blockindex.cpp.o
[373/549] Linking C executable src/secp256k1/sign-bench
[374/549] Building CXX object src/CMakeFiles/bitcoin-cli.dir/bitcoin-cli.cpp.o
[375/549] Building CXX object src/test/CMakeFiles/testutil.dir/util/logging.cpp.o
[376/549] Linking CXX executable src/bitcoin-cli
[377/549] Building CXX object src/test/CMakeFiles/testutil.dir/util/str.cpp.o
[378/549] Building C object src/secp256k1/CMakeFiles/ecmult-bench.dir/src/bench_ecmult.c.o
[379/549] Linking C executable src/secp256k1/ecmult-bench
[380/549] Building CXX object src/CMakeFiles/server.dir/wallet/init.cpp.o
[381/549] Building CXX object src/test/CMakeFiles/testutil.dir/util/blockfilter.cpp.o
[382/549] Building CXX object src/CMakeFiles/server.dir/rpc/blockchain.cpp.o
[383/549] Building CXX object src/test/CMakeFiles/testutil.dir/util/transaction_utils.cpp.o
[384/549] Building CXX object src/CMakeFiles/server.dir/txmempool.cpp.o
[385/549] Building CXX object src/CMakeFiles/server.dir/rpc/rawtransaction.cpp.o
[386/549] Building CXX object src/wallet/CMakeFiles/wallet.dir/context.cpp.o
[387/549] Building CXX object src/CMakeFiles/bitcoin-tx.dir/bitcoin-tx.cpp.o
[388/549] Linking CXX executable src/bitcoin-tx
[389/549] Building CXX object src/test/CMakeFiles/testutil.dir/util/net.cpp.o
[390/549] Building CXX object src/test/CMakeFiles/testutil.dir/util/mining.cpp.o
[391/549] Building CXX object src/test/CMakeFiles/testutil.dir/util/validation.cpp.o
[392/549] Building CXX object src/wallet/CMakeFiles/wallet.dir/db.cpp.o
[393/549] Building CXX object src/wallet/CMakeFiles/wallet.dir/coincontrol.cpp.o
[394/549] Building CXX object src/wallet/CMakeFiles/wallet.dir/crypter.cpp.o
[395/549] Building CXX object src/wallet/CMakeFiles/wallet.dir/coinselection.cpp.o
[396/549] Building CXX object src/test/CMakeFiles/testutil.dir/util/wallet.cpp.o
[397/549] Building CXX object src/CMakeFiles/server.dir/net_processing.cpp.o
[398/549] Building CXX object src/wallet/CMakeFiles/wallet.dir/bdb.cpp.o
[399/549] Building CXX object src/wallet/CMakeFiles/wallet-tool.dir/wallettool.cpp.o
[400/549] Building CXX object src/test/CMakeFiles/testutil.dir/util/setup_common.cpp.o
[401/549] Building CXX object src/wallet/CMakeFiles/wallet.dir/fees.cpp.o
[402/549] Building CXX object src/wallet/CMakeFiles/wallet.dir/load.cpp.o
[403/549] Building CXX object src/wallet/CMakeFiles/wallet.dir/transaction.cpp.o
[404/549] Building CXX object src/wallet/CMakeFiles/wallet.dir/receive.cpp.o
[405/549] Building CXX object src/wallet/CMakeFiles/wallet.dir/rpc/encrypt.cpp.o
[406/549] Building CXX object src/wallet/CMakeFiles/wallet.dir/rpc/util.cpp.o
[407/549] Building CXX object src/wallet/CMakeFiles/wallet.dir/rpc/signmessage.cpp.o
[408/549] Building CXX object src/wallet/CMakeFiles/wallet.dir/sqlite.cpp.o
[409/549] Building CXX object src/seeder/CMakeFiles/seeder-base.dir/dns.cpp.o
[410/549] Building CXX object src/wallet/CMakeFiles/wallet.dir/salvage.cpp.o
[411/549] Building CXX object src/seeder/CMakeFiles/seeder-base.dir/options.cpp.o
[412/549] Building CXX object src/seeder/CMakeFiles/seeder-base.dir/db.cpp.o
[413/549] Building CXX object src/CMakeFiles/server.dir/validation.cpp.o
[414/549] Building CXX object src/wallet/CMakeFiles/wallet.dir/walletutil.cpp.o
[415/549] Building CXX object src/wallet/CMakeFiles/wallet.dir/interfaces.cpp.o
[416/549] Building CXX object src/seeder/CMakeFiles/bitcoin-seeder.dir/main.cpp.o
[417/549] Building CXX object src/seeder/CMakeFiles/seeder-base.dir/bitcoin.cpp.o
[418/549] Building CXX object src/wallet/CMakeFiles/wallet.dir/spend.cpp.o
[419/549] Building CXX object src/wallet/CMakeFiles/wallet.dir/scriptpubkeyman.cpp.o
[420/549] Building CXX object src/wallet/CMakeFiles/wallet.dir/rpc/backup.cpp.o
[421/549] Building CXX object src/wallet/CMakeFiles/wallet.dir/walletdb.cpp.o
[422/549] Building CXX object src/wallet/CMakeFiles/wallet.dir/wallet.cpp.o
[423/549] Building CXX object src/wallet/CMakeFiles/wallet.dir/rpcwallet.cpp.o
[424/549] Linking CXX static library src/wallet/libwallet.a
ninja: build stopped: cannot make progress due to previous errors.
Build build-clang failed with exit code 1
PiRK planned changes to this revision.Mar 25 2024, 09:31

fuzzer needs fixing, one of the transaction test needs adjusting

Tail of the build log:

[347/397] Building CXX object src/test/fuzz/CMakeFiles/fuzz.dir/psbt.cpp.o
[348/397] Building CXX object src/test/fuzz/CMakeFiles/fuzz.dir/random.cpp.o
[349/397] Building CXX object src/test/fuzz/CMakeFiles/fuzz.dir/script.cpp.o
FAILED: src/test/fuzz/CMakeFiles/fuzz.dir/script.cpp.o 
/usr/bin/ccache /usr/bin/clang++ -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/miniupnpc -Werror -g -O2 -fPIE -fvisibility=hidden -fsanitize=fuzzer -fstack-protector-all -Wstack-protector -fcf-protection=full -fstack-clash-protection -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 -Wno-psabi -pthread -std=gnu++17 -MD -MT src/test/fuzz/CMakeFiles/fuzz.dir/script.cpp.o -MF src/test/fuzz/CMakeFiles/fuzz.dir/script.cpp.o.d -o src/test/fuzz/CMakeFiles/fuzz.dir/script.cpp.o -c ../../src/test/fuzz/script.cpp
../../src/test/fuzz/script.cpp:75:11: error: no matching function for call to 'IsStandard'
    (void)IsStandard(script, which_type);
          ^~~~~~~~~~
../../src/./policy/policy.h:115:6: note: candidate function not viable: requires 3 arguments, but 2 were provided
bool IsStandard(const CScript &scriptPubKey,
     ^
1 error generated.
[350/397] Building CXX object src/test/fuzz/CMakeFiles/fuzz.dir/signature_checker.cpp.o
[351/397] Building CXX object src/test/fuzz/CMakeFiles/fuzz.dir/protocol.cpp.o
[352/397] Building CXX object src/test/fuzz/CMakeFiles/fuzz.dir/process_message.cpp.o
[353/397] Building CXX object src/test/fuzz/CMakeFiles/fuzz.dir/spanparsing.cpp.o
[354/397] Building CXX object src/test/fuzz/CMakeFiles/fuzz.dir/rolling_bloom_filter.cpp.o
[355/397] Building CXX object src/test/fuzz/CMakeFiles/fuzz.dir/process_messages.cpp.o
[356/397] Building CXX object src/test/fuzz/CMakeFiles/fuzz.dir/script_bitcoin_consensus.cpp.o
[357/397] Building CXX object src/test/fuzz/CMakeFiles/fuzz.dir/script_descriptor_cache.cpp.o
[358/397] Building CXX object src/test/fuzz/CMakeFiles/fuzz.dir/script_ops.cpp.o
[359/397] Building CXX object src/test/fuzz/CMakeFiles/fuzz.dir/script_interpreter.cpp.o
[360/397] Building CXX object src/test/fuzz/CMakeFiles/fuzz.dir/script_sigcache.cpp.o
[361/397] Building CXX object src/test/fuzz/CMakeFiles/fuzz.dir/scriptnum_ops.cpp.o
[362/397] Building CXX object src/wallet/CMakeFiles/wallet.dir/context.cpp.o
[363/397] Building CXX object src/test/fuzz/CMakeFiles/fuzz.dir/tx_in.cpp.o
[364/397] Building CXX object src/wallet/CMakeFiles/wallet.dir/db.cpp.o
[365/397] Building CXX object src/test/fuzz/CMakeFiles/fuzz.dir/tx_out.cpp.o
[366/397] Building CXX object src/test/fuzz/CMakeFiles/fuzz.dir/secp256k1_ec_seckey_import_export_der.cpp.o
[367/397] Building CXX object src/test/fuzz/CMakeFiles/fuzz.dir/span.cpp.o
[368/397] Building CXX object src/test/fuzz/CMakeFiles/fuzz.dir/secp256k1_ecdsa_signature_parse_der_lax.cpp.o
[369/397] Building CXX object src/test/fuzz/CMakeFiles/fuzz.dir/string.cpp.o
[370/397] Building CXX object src/test/fuzz/CMakeFiles/fuzz.dir/timedata.cpp.o
[371/397] Building CXX object src/test/fuzz/CMakeFiles/fuzz.dir/system.cpp.o
[372/397] Building CXX object src/wallet/CMakeFiles/wallet.dir/crypter.cpp.o
[373/397] Building CXX object src/test/fuzz/CMakeFiles/fuzz.dir/script_sign.cpp.o
[374/397] Building CXX object src/test/fuzz/CMakeFiles/fuzz.dir/transaction.cpp.o
[375/397] Building CXX object src/test/fuzz/CMakeFiles/fuzz.dir/strprintf.cpp.o
[376/397] Building CXX object src/test/fuzz/CMakeFiles/fuzz.dir/validation_load_mempool.cpp.o
[377/397] Building CXX object src/test/fuzz/CMakeFiles/fuzz.dir/txrequest.cpp.o
[378/397] Building CXX object src/wallet/CMakeFiles/wallet.dir/fees.cpp.o
[379/397] Building CXX object src/wallet/CMakeFiles/wallet.dir/load.cpp.o
[380/397] Building CXX object src/wallet/CMakeFiles/wallet.dir/transaction.cpp.o
[381/397] Building CXX object src/wallet/CMakeFiles/wallet.dir/sqlite.cpp.o
[382/397] Building CXX object src/wallet/CMakeFiles/wallet.dir/receive.cpp.o
[383/397] Building CXX object src/wallet/CMakeFiles/wallet.dir/rpc/util.cpp.o
[384/397] Building CXX object src/wallet/CMakeFiles/wallet.dir/rpc/signmessage.cpp.o
[385/397] Building CXX object src/wallet/CMakeFiles/wallet.dir/rpc/encrypt.cpp.o
[386/397] Building CXX object src/wallet/CMakeFiles/wallet.dir/salvage.cpp.o
[387/397] Building CXX object src/wallet/CMakeFiles/wallet.dir/walletutil.cpp.o
[388/397] Building CXX object src/wallet/CMakeFiles/wallet.dir/spend.cpp.o
[389/397] Building CXX object src/wallet/CMakeFiles/wallet.dir/interfaces.cpp.o
[390/397] Building CXX object src/wallet/CMakeFiles/wallet.dir/scriptpubkeyman.cpp.o
[391/397] Building CXX object src/wallet/CMakeFiles/wallet.dir/walletdb.cpp.o
[392/397] Building CXX object src/wallet/CMakeFiles/wallet.dir/rpc/backup.cpp.o
[393/397] Building CXX object src/wallet/CMakeFiles/wallet.dir/wallet.cpp.o
[394/397] Building CXX object src/wallet/CMakeFiles/wallet.dir/rpcwallet.cpp.o
[395/397] Linking CXX static library src/wallet/libwallet.a
ninja: build stopped: cannot make progress due to previous errors.
Build build-fuzzer failed with exit code 1

Tail of the build log:

/work /work/abc-ci-builds/lint-circular-dependencies
A new circular dependency in the form of "consensus/amount -> util/system -> script/standard -> consensus/amount" appears to have been introduced.

/work/abc-ci-builds/lint-circular-dependencies
Build lint-circular-dependencies failed with exit code 1
PiRK edited the test plan for this revision. (Show Details)

fix more fuzzers, adjust the transaction_tests test to use the proper custom max size param and remove now unneeded gArgs.ForceSetArg

Tail of the build log:

/work /work/abc-ci-builds/lint-circular-dependencies
A new circular dependency in the form of "consensus/amount -> util/system -> script/standard -> consensus/amount" appears to have been introduced.

/work/abc-ci-builds/lint-circular-dependencies
Build lint-circular-dependencies failed with exit code 1

Tail of the build log:

[348/397] Building CXX object src/test/fuzz/CMakeFiles/fuzz.dir/random.cpp.o
[349/397] Building CXX object src/test/fuzz/CMakeFiles/fuzz.dir/primitives_transaction.cpp.o
[350/397] Building CXX object src/test/fuzz/CMakeFiles/fuzz.dir/process_message.cpp.o
[351/397] Building CXX object src/test/fuzz/CMakeFiles/fuzz.dir/rolling_bloom_filter.cpp.o
[352/397] Building CXX object src/test/fuzz/CMakeFiles/fuzz.dir/script.cpp.o
FAILED: src/test/fuzz/CMakeFiles/fuzz.dir/script.cpp.o 
/usr/bin/ccache /usr/bin/clang++ -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/miniupnpc -Werror -g -O2 -fPIE -fvisibility=hidden -fsanitize=fuzzer -fstack-protector-all -Wstack-protector -fcf-protection=full -fstack-clash-protection -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 -Wno-psabi -pthread -std=gnu++17 -MD -MT src/test/fuzz/CMakeFiles/fuzz.dir/script.cpp.o -MF src/test/fuzz/CMakeFiles/fuzz.dir/script.cpp.o.d -o src/test/fuzz/CMakeFiles/fuzz.dir/script.cpp.o -c ../../src/test/fuzz/script.cpp
../../src/test/fuzz/script.cpp:75:11: error: no matching function for call to 'IsStandard'
    (void)IsStandard(script, which_type);
          ^~~~~~~~~~
../../src/./policy/policy.h:115:6: note: candidate function not viable: requires 3 arguments, but 2 were provided
bool IsStandard(const CScript &scriptPubKey,
     ^
1 error generated.
[353/397] Building CXX object src/test/fuzz/CMakeFiles/fuzz.dir/process_messages.cpp.o
[354/397] Building CXX object src/test/fuzz/CMakeFiles/fuzz.dir/script_bitcoin_consensus.cpp.o
[355/397] Building CXX object src/test/fuzz/CMakeFiles/fuzz.dir/script_descriptor_cache.cpp.o
[356/397] Building CXX object src/test/fuzz/CMakeFiles/fuzz.dir/spanparsing.cpp.o
[357/397] Building CXX object src/test/fuzz/CMakeFiles/fuzz.dir/script_ops.cpp.o
[358/397] Building CXX object src/test/fuzz/CMakeFiles/fuzz.dir/script_interpreter.cpp.o
[359/397] Building CXX object src/test/fuzz/CMakeFiles/fuzz.dir/signature_checker.cpp.o
[360/397] Building CXX object src/test/fuzz/CMakeFiles/fuzz.dir/scriptnum_ops.cpp.o
[361/397] Building CXX object src/test/fuzz/CMakeFiles/fuzz.dir/secp256k1_ecdsa_signature_parse_der_lax.cpp.o
[362/397] Building CXX object src/wallet/CMakeFiles/wallet.dir/context.cpp.o
[363/397] Building CXX object src/test/fuzz/CMakeFiles/fuzz.dir/tx_out.cpp.o
[364/397] Building CXX object src/test/fuzz/CMakeFiles/fuzz.dir/script_sigcache.cpp.o
[365/397] Building CXX object src/test/fuzz/CMakeFiles/fuzz.dir/tx_in.cpp.o
[366/397] Building CXX object src/test/fuzz/CMakeFiles/fuzz.dir/secp256k1_ec_seckey_import_export_der.cpp.o
[367/397] Building CXX object src/test/fuzz/CMakeFiles/fuzz.dir/span.cpp.o
[368/397] Building CXX object src/test/fuzz/CMakeFiles/fuzz.dir/system.cpp.o
[369/397] Building CXX object src/test/fuzz/CMakeFiles/fuzz.dir/timedata.cpp.o
[370/397] Building CXX object src/test/fuzz/CMakeFiles/fuzz.dir/transaction.cpp.o
[371/397] Building CXX object src/wallet/CMakeFiles/wallet.dir/db.cpp.o
[372/397] Building CXX object src/test/fuzz/CMakeFiles/fuzz.dir/strprintf.cpp.o
[373/397] Building CXX object src/wallet/CMakeFiles/wallet.dir/crypter.cpp.o
[374/397] Building CXX object src/test/fuzz/CMakeFiles/fuzz.dir/string.cpp.o
[375/397] Building CXX object src/test/fuzz/CMakeFiles/fuzz.dir/script_sign.cpp.o
[376/397] Building CXX object src/test/fuzz/CMakeFiles/fuzz.dir/txrequest.cpp.o
[377/397] Building CXX object src/test/fuzz/CMakeFiles/fuzz.dir/validation_load_mempool.cpp.o
[378/397] Building CXX object src/wallet/CMakeFiles/wallet.dir/fees.cpp.o
[379/397] Building CXX object src/wallet/CMakeFiles/wallet.dir/transaction.cpp.o
[380/397] Building CXX object src/wallet/CMakeFiles/wallet.dir/load.cpp.o
[381/397] Building CXX object src/wallet/CMakeFiles/wallet.dir/sqlite.cpp.o
[382/397] Building CXX object src/wallet/CMakeFiles/wallet.dir/rpc/signmessage.cpp.o
[383/397] Building CXX object src/wallet/CMakeFiles/wallet.dir/receive.cpp.o
[384/397] Building CXX object src/wallet/CMakeFiles/wallet.dir/rpc/util.cpp.o
[385/397] Building CXX object src/wallet/CMakeFiles/wallet.dir/rpc/encrypt.cpp.o
[386/397] Building CXX object src/wallet/CMakeFiles/wallet.dir/salvage.cpp.o
[387/397] Building CXX object src/wallet/CMakeFiles/wallet.dir/walletutil.cpp.o
[388/397] Building CXX object src/wallet/CMakeFiles/wallet.dir/spend.cpp.o
[389/397] Building CXX object src/wallet/CMakeFiles/wallet.dir/interfaces.cpp.o
[390/397] Building CXX object src/wallet/CMakeFiles/wallet.dir/scriptpubkeyman.cpp.o
[391/397] Building CXX object src/wallet/CMakeFiles/wallet.dir/rpc/backup.cpp.o
[392/397] Building CXX object src/wallet/CMakeFiles/wallet.dir/walletdb.cpp.o
[393/397] Building CXX object src/wallet/CMakeFiles/wallet.dir/wallet.cpp.o
[394/397] Building CXX object src/wallet/CMakeFiles/wallet.dir/rpcwallet.cpp.o
[395/397] Linking CXX static library src/wallet/libwallet.a
[396/397] Linking CXX static library src/libserver.a
ninja: build stopped: cannot make progress due to previous errors.
Build build-fuzzer failed with exit code 1
PiRK planned changes to this revision.Mar 25 2024, 09:48

circular dependency issue

Tail of the build log:

/work /work/abc-ci-builds/lint-circular-dependencies
A new circular dependency in the form of "consensus/amount -> util/system -> script/standard -> consensus/amount" appears to have been introduced.

/work/abc-ci-builds/lint-circular-dependencies
Build lint-circular-dependencies failed with exit code 1
PiRK edited the summary of this revision. (Show Details)

rebase onto D15780

MakeProcessor takes argsman as a parameter, no need to access it via the global gArgs

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

revert most avalanche changes, wrap IsStandard for the purpose of checking a proof's validity

PiRK planned changes to this revision.Mar 25 2024, 16:24

the system.h changes are no longer required, the args inspection code can be moved to mempool_options.h

remove the ArgsManager shortcut, the parsing of arguments is now only needed in one place

This revision is now accepted and ready to land.Mar 26 2024, 09:13
This revision was automatically updated to reflect the committed changes.