Commit Graph

39644 Commits

Author SHA1 Message Date
fanquake dd73c22976
Merge bitcoin/bitcoin#28486: test, bench: Initialize and terminate use of Winsock properly
fd4c6a10f2 test: Setup networking globally (Hennadii Stepanov)

Pull request description:

  On the master branch, when compiling without external signer support, the `bench_bitcoin.exe` does not initialize Winsock DLL that is required, for example, here: 459272d639/src/bench/addrman.cpp (L124)

  Moreover, Windows docs explicitly [state](https://learn.microsoft.com/en-us/windows/win32/api/winsock/nf-winsock-wsacleanup) that `WSAStartup` and `WSACleanup` must be balanced:
  > There must be a call to `WSACleanup` for each successful call to `WSAStartup`. Only the final `WSACleanup` function call performs the actual cleanup. The preceding calls simply decrement an internal reference count in the WS2_32.DLL.

  That is not the case for our unit tests because the `SetupNetworking()` call is a part of the `BasicTestingSetup` fixture and is invoked multiple times, while `~CNetCleanup()` is invoked once only, at the end of the test binary execution.

  This PR fixes Winsock DLL initialization and termination.

  More docs:
  - https://learn.microsoft.com/en-us/windows/win32/winsock/initializing-winsock
  - https://learn.microsoft.com/en-us/windows/win32/api/winsock/nf-winsock-wsastartup
  - https://learn.microsoft.com/en-us/windows/win32/api/winsock/nf-winsock-wsacleanup

  Fix https://github.com/bitcoin/bitcoin/issues/28940.

ACKs for top commit:
  maflcko:
    lgtm ACK fd4c6a10f2

Tree-SHA512: d360eaf776943f7f7a35ed5a5f9f3228d9e3d18eb824e5997cdc8eadddf466abe9f2da4910ee3bb86bf5411061e758259f7e1ec344f234ef7996f1bf8781dcda
2023-11-29 17:14:34 +00:00
fanquake d00d50e78a
Merge bitcoin/bitcoin#28968: fuzz: Fix nullptr deref in scriptpubkeyman
faecde9102 fuzz: Fix nullptr deref in scriptpubkeyman (MarcoFalke)

Pull request description:

  This should fix the UB that was found by review (https://github.com/bitcoin/bitcoin/pull/28578#discussion_r1404246109) and by fuzzing (https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=64487)

ACKs for top commit:
  dergoegge:
    utACK faecde9102
  brunoerg:
    crACK faecde9102

Tree-SHA512: ff726ed632d8d369c96d316bafebe87ff385e47b74b1d1da79409ddf296559eb991431883858057527e5df2414c01812ecbc99c21c69020228b0747f32b03121
2023-11-29 17:07:22 +00:00
MarcoFalke fab164f342
fuzz: Avoid signed-integer-overflow in wallet_notifications fuzz target 2023-11-29 17:12:50 +01:00
MarcoFalke faecde9102
fuzz: Fix nullptr deref in scriptpubkeyman
Also, add missing includes to scriptpubkeyman.

Also, export dependecies of the BasicTestingSetup from setup_common.h,
to avoid having to include them when setup_common.h is already included.
2023-11-29 16:04:08 +01:00
MarcoFalke fad82fea2b
ci: Reduce use of bash -c
It is confusing to treat commands as a single string. This change is
also required to support paths and strings with spaces in them in the
future.

This requires replacing TEST_RUNNER_ENV with a global export, because it
no longer works. See:

```bash
$ export ENV="A=1" && $ENV ls
bash: A=1: command not found...
```

Or in the CI task:

+ DIR_UNIT_TEST_DATA=/ci_container_base/ci/scratch/qa-assets/unit_test_data/
+ LD_LIBRARY_PATH=/ci_container_base/depends/i686-pc-linux-gnu/lib
+ BITCOIND=bitcoin-node make -j10 check VERBOSE=1
/ci_container_base/ci/test/03_test_script.sh: line 166: BITCOIND=bitcoin-node: command not found

https://github.com/bitcoin/bitcoin/pull/28954/checks?check_run_id=19096858944
https://cirrus-ci.com/task/6718317604372480
2023-11-29 15:13:16 +01:00
fanquake 8cf2137dbe
Merge bitcoin/bitcoin#28958: refactor: Use Txid in CMerkleBlock
fa02c08c93 refactor: Use Txid in CMerkleBlock (MarcoFalke)

Pull request description:

  This should also fix a gcc-13 compiler warning, see https://github.com/bitcoin/bitcoin/pull/28922#discussion_r1407856376

  ```
  rpc/txoutproof.cpp: In lambda function:
  rpc/txoutproof.cpp:72:33: error: possibly dangling reference to a temporary [-Werror=dangling-reference]
     72 |                     const Coin& coin = AccessByTxid(active_chainstate.CoinsTip(), Txid::FromUint256(tx));
        |                                 ^~~~
  rpc/txoutproof.cpp:72:52: note: the temporary was destroyed at the end of the full expression ‘AccessByTxid((*(const CCoinsViewCache*)(&(& active_chainstate)->Chainstate::CoinsTip())), transaction_identifier<false>::FromUint256((* & tx)))’
     72 |                     const Coin& coin = AccessByTxid(active_chainstate.CoinsTip(), Txid::FromUint256(tx));
        |                                        ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  cc1plus: all warnings being treated as errors

ACKs for top commit:
  TheCharlatan:
    Re-ACK fa02c08c93
  dergoegge:
    reACK fa02c08c93

Tree-SHA512: 2e6837b9d0c90bd6e9d766330e7086d68c6ec80bb27fe2cfc4702b251b00d91a79f8bfbc76d998cbcd90bee5317402cf617f61099eee96d94e7ac8f37ba7a642
2023-11-29 10:55:18 +00:00
fanquake 453c9ca590
Merge bitcoin/bitcoin#28966: test: Add missing CBlockPolicyEstimator::processBlockTx suppression
fa9dc92c53 test: Add missing CBlockPolicyEstimator::processBlockTx suppression (MarcoFalke)

Pull request description:

  Fixes https://github.com/bitcoin/bitcoin/pull/28865#discussion_r1408954537

  ```
  # FUZZ=policy_estimator UBSAN_OPTIONS="suppressions=/root/fuzz_dir/scratch/fuzz_gen/code/test/sanitizer_suppressions/ubsan:print_stacktrace=1:halt_on_error=1:report_error_type=1" ./src/test/fuzz/fuzz /tmp/crash-154b42214e70781a9c1ad72d3f2693913dcf8c06

  ...

  policy/fees.cpp:632:27: runtime error: implicit conversion from type 'unsigned int' of value 4294574080 (32-bit, unsigned) to type 'int' changed the value to -393216 (32-bit, signed)
      #0 0x55cbbe10daee in CBlockPolicyEstimator::processBlockTx(unsigned int, CTxMemPoolEntry const*) src/policy/fees.cpp:632:27
      #1 0x55cbbe10e361 in CBlockPolicyEstimator::processBlock(unsigned int, std::vector<CTxMemPoolEntry const*, std::allocator<CTxMemPoolEntry const*>>&) src/policy/fees.cpp:680:13
      #2 0x55cbbd84af48 in policy_estimator_fuzz_target(Span<unsigned char const>)::$_1::operator()() const src/test/fuzz/policy_estimator.cpp:69:40
      #3 0x55cbbd84af48 in unsigned long CallOneOf<policy_estimator_fuzz_target(Span<unsigned char const>)::$_0, policy_estimator_fuzz_target(Span<unsigned char const>)::$_1, policy_estimator_fuzz_target(Span<unsigned char const>)::$_2, policy_estimator_fuzz_target(Span<unsigned char const>)::$_3>(FuzzedDataProvider&, policy_estimator_fuzz_target(Span<unsigned char const>)::$_0, policy_estimator_fuzz_target(Span<unsigned char const>)::$_1, policy_estimator_fuzz_target(Span<unsigned char const>)::$_2, policy_estimator_fuzz_target(Span<unsigned char const>)::$_3) src/./test/fuzz/util.h:43:27
      #4 0x55cbbd84af48 in policy_estimator_fuzz_target(Span<unsigned char const>) src/test/fuzz/policy_estimator.cpp:38:9
      #5 0x55cbbda1cc18 in std::function<void (Span<unsigned char const>)>::operator()(Span<unsigned char const>) const /usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/std_function.h:591:9
      #6 0x55cbbda1cc18 in LLVMFuzzerTestOneInput src/test/fuzz/fuzz.cpp:178:5
      #7 0x55cbbd26a944 in fuzzer::Fuzzer::ExecuteCallback(unsigned char const*, unsigned long) (/root/fuzz_dir/scratch/fuzz_gen/code/src/test/fuzz/fuzz+0x190e944) (BuildId: ffb89e0b86c093ca3bdeae6f85537737a4e3b42d)
      #8 0x55cbbd253916 in fuzzer::RunOneTest(fuzzer::Fuzzer*, char const*, unsigned long) (/root/fuzz_dir/scratch/fuzz_gen/code/src/test/fuzz/fuzz+0x18f7916) (BuildId: ffb89e0b86c093ca3bdeae6f85537737a4e3b42d)
      #9 0x55cbbd25945a in fuzzer::FuzzerDriver(int*, char***, int (*)(unsigned char const*, unsigned long)) (/root/fuzz_dir/scratch/fuzz_gen/code/src/test/fuzz/fuzz+0x18fd45a) (BuildId: ffb89e0b86c093ca3bdeae6f85537737a4e3b42d)
      #10 0x55cbbd284026 in main (/root/fuzz_dir/scratch/fuzz_gen/code/src/test/fuzz/fuzz+0x1928026) (BuildId: ffb89e0b86c093ca3bdeae6f85537737a4e3b42d)
      #11 0x7fe4aa8280cf  (/lib/x86_64-linux-gnu/libc.so.6+0x280cf) (BuildId: 96ab1a8f3b2c9a2ed37c7388615e6a726d037e89)
      #12 0x7fe4aa828188 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x28188) (BuildId: 96ab1a8f3b2c9a2ed37c7388615e6a726d037e89)
      #13 0x55cbbd24e494 in _start (/root/fuzz_dir/scratch/fuzz_gen/code/src/test/fuzz/fuzz+0x18f2494) (BuildId: ffb89e0b86c093ca3bdeae6f85537737a4e3b42d)

  SUMMARY: UndefinedBehaviorSanitizer: implicit-integer-sign-change policy/fees.cpp:632:27 in
  ```

  ```
  # base64 /tmp/crash-154b42214e70781a9c1ad72d3f2693913dcf8c06
  AQEAAAAAADkFlVwAAQEAAAAAADkFlZVcACTDSSsP3746IAZrH48khwMAAQEB/QEALQAACwAAAAAA
  FgAAAAAAAQAABgAAAAAAAAAAAAAAAAAAACcQAAAAAAAAAAAAAAAAAAAAAAD6AAAAOQWVXAABAQAA
  AAAAOQWVlVwAIMNJKw/fvjogBmsfjySHAwABAQH9AQAtAAALAAAAAAAAAAABAAAGAAAAAAAAAAAA
  AAAAAAAAJxAAAAAAAAAAAAAAAAAAAAAAAPr/AAAAAAAAAAAAAAQAAAAA/wAAAAAAAAAAAAAEAAAA
  AAEBAeAIAVwBXAAA/jbSBvwBKABSKBwBYgEB2wAEkvXInHYAAAAAAAAAvgAAAAAA/9//6v8e/xIk
  MgAlAiUAOw==

ACKs for top commit:
  fanquake:
    ACK fa9dc92c53
  dergoegge:
    utACK fa9dc92c53

Tree-SHA512: 3898c17c928ecc2bcc8c7086359e9ae00da2197b4d8e10c7bf6d12415326c9bca3ef6e1d8d3b83172ccfa604ce7e7371415262ba705225f9ea4da8b1a7eb0306
2023-11-29 10:23:53 +00:00
MarcoFalke fa9dc92c53
test: Add missing CBlockPolicyEstimator::processBlockTx suppression 2023-11-29 10:51:04 +01:00
Andrew Chow 16b5b4b674
Merge bitcoin/bitcoin#28579: refactor: Remove redundant checks in compat/assumptions.h
fa1a384706 Move compat.h include from system.h to system.cpp (MarcoFalke)
88887531b7 Move compat/assumptions.h include to one place that actually needs it (MarcoFalke)
77774110f4 Remove __cplusplus from compat/assumptions.h (MarcoFalke)
faa3d4f1d8 Remove duplicate NDEBUG check from compat/assumptions.h (MarcoFalke)

Pull request description:

  Generally, compile-time checks should be close to the code that use them. Especially, since `compat/assumptions.h` is only included in one place, where iwyu suggests to remove it.

  Fix all issues:
  * The `NDEBUG` check is used in `util/check`, so it is redundant in `compat/assumptions.h`.
  * The `__cplusplus` check is redundant with `doc/dependencies.md` (see commit message).
  * Add missing `// IWYU pragma: keep` to avoid removing the include by accident.

ACKs for top commit:
  achow101:
    ACK fa1a384706
  TheCharlatan:
    re-ACK fa1a384706
  theuni:
    ACK fa1a384706

Tree-SHA512: f8b6db84be5d8844a2267345c0b1405fcbc39b8b5eeaa24db5b8412a74145fe44cf188b6b0c39cc2b062690ed37ca5b4662473484afe28dbec6469e79961389b
2023-11-28 16:51:28 -05:00
Andrew Chow 75462b39d2
Merge bitcoin/bitcoin#28554: bugfix: throw an error if an invalid parameter is passed to getnetworkhashps RPC
9ac114e5cd Throw error if invalid parameters passed to getnetworkhashps RPC endpoint (Jameson Lopp)

Pull request description:

  When writing some scripts that iterated over many blocks to generate hashrate estimates I realized that my script was going out of range of the current chain tip height but was not encountering any errors.

  I believe that passing an invalid block height to this function but receiving the hashrate estimate for the chain tip instead should be considered unexpected behavior.

ACKs for top commit:
  Sjors:
    re-utACK 9ac114e5cd
  kevkevinpal:
    reACK [9ac114e](9ac114e5cd)
  achow101:
    ACK 9ac114e5cd

Tree-SHA512: eefb465c2dd654fc48267f444e1809597ec5363cdd131ea9ec812458fed1e4bffbbbb0617d74687c9f7bb16274b598d8292f5eeb7953421e5d2a8dc2cc081f2b
2023-11-28 16:26:04 -05:00
Andrew Chow 535424a10b
Merge bitcoin/bitcoin#28903: refactor: Make CTxMemPoolEntry only explicitly copyable
705e3f1de0 refactor: Make CTxMemPoolEntry only explicitly copyable (TheCharlatan)

Pull request description:

  This has the goal of prohibiting users from accidentally creating runtime failures, e.g. by interacting with iterator_to with a copied entry. This was brought up here:  https://github.com/bitcoin/bitcoin/pull/28886#issuecomment-1814794954.

  CTxMemPoolEntry is already implicitly not move-constructable. So be explicit about this and use a std::list to collect the values in the policy_estimator fuzz test instead of a std::vector.

ACKs for top commit:
  maflcko:
    ACK 705e3f1de0 🌯
  achow101:
    ACK 705e3f1de0
  ajtowns:
    ACK 705e3f1de0
  ismaelsadeeq:
    ACK 705e3f1de0

Tree-SHA512: 62056905c679c919d00f9ae065ed66ac986e7e7062015aea542843d8deecda57104d7a68d002f7b20afa3164f8e9215d2d2d002c167224129540e3b1bd0712cc
2023-11-28 14:45:23 -05:00
Andrew Chow 30a0557829
Merge bitcoin/bitcoin#28805: test: Make existing functional tests compatible with --v2transport
35fb9930ad test: enable v2 transport for p2p_timeouts.py (Martin Zumsande)
2c1669c37a test: enable v2 transport for rpc_net.py (Sebastian Falbesoner)
cc961c2695 test: enable v2 transport for p2p_node_network_limited.py (Sebastian Falbesoner)
3598a1b5c9 test: enable --v2transport in combination with --usecli (Martin Zumsande)
68a9001751 test: persist -v2transport over restarts and respect -v2transport=0 (Martin Zumsande)

Pull request description:

  This makes the functional test suite compatible with BIP324, so that
  `python3 test_runner.py --v2transport`
  should succeed (currently, 12 tests fail for me on master).
  Includes two commits by TheStack I found in an old discussion https://github.com/bitcoin/bitcoin/pull/28331#discussion_r1326714164

  Note that even though all tests should pass, the python `p2p.py` module will do v2 connections only after the merge of #24748, so that for now only connections between two full nodes will actually run v2.
  Some of the fixed tests were added with `--v2transport` to the test runner. Though after #24748 we might also want to consider running the entire suite with `--v2transport` in some CI.

ACKs for top commit:
  sipa:
    utACK 35fb9930ad. Thanks for taking care of this.
  achow101:
    ACK 35fb9930ad
  theStack:
    ACK 35fb9930ad
  stratospher:
    ACK 35fb993.

Tree-SHA512: 80dc0bf211fa525ff1d092043aea9f222f14c02e5832a548fb8b83b9ede1fcee03c5e8ade0d05c331bdaa492af9c1cf3d0f0b15b846673c6eacea82dd4cefbc3
2023-11-28 14:16:35 -05:00
Hennadii Stepanov fd4c6a10f2
test: Setup networking globally 2023-11-28 19:11:52 +00:00
fanquake fe4e83f50d
Merge bitcoin/bitcoin#28912: refactor: VectorWriter and SpanReader without nVersion
fae76a1f2a scripted-diff: Use DataStream in most places (MarcoFalke)
fac39b56b7 refactor: SpanReader without nVersion (MarcoFalke)

Pull request description:

  The serialize version is unused, so remove it. This also allows to remove `GCS_SER_VERSION` and allows a scripted-diff to remove most of `CDataStream`.

ACKs for top commit:
  ajtowns:
    ACK fae76a1f2a
  ryanofsky:
    Code review ACK fae76a1f2a

Tree-SHA512: 3b487dba8ea380f1eacff9fdfb9197f025dbc30906813d3f4c3e6f1e9e4d9f2a169c6f163f51d135e18af538be78e2d2b13d694073ad25c5762980ae971a4c83
2023-11-28 17:35:50 +00:00
fanquake a4980da1ce
guix: remove input labels
Migrate package definitions to use the new format for propogated inputs.
See
https://guix.gnu.org/manual/en/html_node/package-Reference.html#index-inputs_002c-of-packages.

See also: https://guix.gnu.org/blog/2021/the-big-change/
2023-11-28 16:50:04 +00:00
MarcoFalke fa02c08c93
refactor: Use Txid in CMerkleBlock 2023-11-28 17:49:41 +01:00
fanquake 31ce305d46
Merge bitcoin/bitcoin#28952: fuzz: Avoid timeout in process_messages
fa825975b5 fuzz: Avoid timeout in process_messages (MarcoFalke)

Pull request description:

  Reduce the number of messages per fuzz input. There should be no reason to have more messages than that.

  This should also avoid timeouts, such as https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=64548. CC https://github.com/bitcoin/bitcoin/issues/28812

ACKs for top commit:
  dergoegge:
    utACK fa825975b5

Tree-SHA512: eeff732f7b0bd9a71f23aeecbf813d31fe34d355b906fd0384a43075cbc3cebc46a26df741b0f337208d8b33b3e28210c9b9437e2eed77844f03131bb8f5f2a1
2023-11-28 16:24:06 +00:00
Andrew Chow 26b7bcf10e
Merge bitcoin/bitcoin#28766: Improve peformance of CTransaction::HasWitness (28107 follow-up)
af1d2ff883 [primitives] Precompute result of CTransaction::HasWitness (dergoegge)

Pull request description:

  This addresses https://github.com/bitcoin/bitcoin/pull/28107#discussion_r1364961590 from #28107.

ACKs for top commit:
  theStack:
    ACK af1d2ff883
  achow101:
    ACK af1d2ff883
  stickies-v:
    ACK af1d2ff883
  TheCharlatan:
    ACK af1d2ff883

Tree-SHA512: a77654ae429d0d7ce12daa309770e75beec4f8984734f80ed203156199425af43b50ad3d8aab85a89371a71356464ebd4503a0248fd0103579adfc74a55aaf51
2023-11-28 08:44:41 -05:00
MarcoFalke fafcee4874
ci: Rename test script to 03_test_script.sh 2023-11-28 13:25:40 +01:00
MarcoFalke fae76a1f2a
scripted-diff: Use DataStream in most places
The remaining places are handled easier outside a scripted-diff.

-BEGIN VERIFY SCRIPT-
 sed --regexp-extended -i 's/CDataStream ([0-9a-zA-Z_]+)\(SER_[A-Z]+, [A-Z_]+_VERSION\);/DataStream \1{};/g' $( git grep -l CDataStream)
 sed -i 's/, CDataStream/, DataStream/g' src/wallet/walletdb.cpp
-END VERIFY SCRIPT-
2023-11-28 12:42:37 +01:00
MarcoFalke fac39b56b7
refactor: SpanReader without nVersion
The field is unused, so remove it.

This is also required for future commits.
2023-11-28 12:42:07 +01:00
fanquake c252a0fc0f
Merge bitcoin/bitcoin#28892: refactor: P2P transport without serialize version and type
fa79a881ce refactor: P2P transport without serialize version and type (MarcoFalke)
fa9b5f4fe3 refactor: NetMsg::Make() without nVersion (MarcoFalke)
66669da4a5 Remove unused Make() overload in netmessagemaker.h (MarcoFalke)
fa0ed07941 refactor: VectorWriter without nVersion (MarcoFalke)

Pull request description:

  Now that the serialize framework ignores the serialize version and serialize type, everything related to it can be removed from the code.

  This is the first step, removing dead code from the P2P stack. A different pull will remove it from the wallet and other parts.

ACKs for top commit:
  ajtowns:
    reACK fa79a881ce

Tree-SHA512: 785b413580d980f51f0d4f70ea5e0a99ce14cd12cb065393de2f5254891be94a14f4266110c8b87bd2dbc37467676655bce13bdb295ab139749fcd8b61bd5110
2023-11-28 11:24:09 +00:00
fanquake dc369af3f5
Merge bitcoin/bitcoin#28936: Change petertodd seeds to petertodd.net
ecb46837e7 Change petertodd seeds to petertodd.net (Peter Todd)

Pull request description:

  I changed my DNS seeds to .net from .org to avoid issues with DNS blacklisting, that falsely thinks my domain name is pointing to IP addresses with malware and similar things. Right now there are CNAME records, so the .org addresses still work. But eventually, if needed, I'll remove those CNAME's.

ACKs for top commit:
  pablomartin4btc:
    tACK ecb46837e7
  fanquake:
    ACK ecb46837e7 - tested that usable addresses are being returned.

Tree-SHA512: 285f7101198ea8e2e20900c17b38aa86db812308c6985d762e5fa8b6f1bc5b0d2d278da841fe2e10cf32e3fe18d4c984bc8cf195bd8d40c86b092b545c62acfa
2023-11-28 10:53:27 +00:00
fanquake c1b7332441
Merge bitcoin/bitcoin#28934: ci: Set MSVC toolset version explicitly
70100f8584 Revert "ci: Avoid toolset ambiguity that MSVC can't handle" (Hennadii Stepanov)
1a889f7ea0 ci: Set MSVC toolset version explicitly (Hennadii Stepanov)
4335e55359 ci: Run vcpkg with path prefix (Hennadii Stepanov)

Pull request description:

  This PR is an alternative to https://github.com/bitcoin/bitcoin/pull/28905 and reverts it.

  To avoid toolset version incompatibilities, which result in errors like this:
  ```
  LINK : fatal error C1900: Il mismatch between 'P1' version '20230904' and 'P2' version '20221215' [D:\a\bitcoin\bitcoin\build_msvc\test_bitcoin\test_bitcoin.vcxproj]
  LINK : fatal error LNK1257: code generation failed [D:\a\bitcoin\bitcoin\build_msvc\test_bitcoin\test_bitcoin.vcxproj]
  LINK : fatal error LNK1327: failure during running link.exe [D:\a\bitcoin\bitcoin\build_msvc\test_bitcoin\test_bitcoin.vcxproj]
  ```

  it is enough to set it explicitly in the vcpkg triplet file (see the second commit). The `VCToolsVersion` environment variable is set by the `ilammy/msvc-dev-cmd` action.

  Please note that the https://github.com/bitcoin/bitcoin/pull/28905 is not [optimal](https://github.com/bitcoin/bitcoin/pull/28905#issuecomment-1822571419):
  > I guess this is something we'll just have to maintain forever? That's a shame, because it also adds ~30% runtime to this CI job.

ACKs for top commit:
  sipsorcery:
    utACK 70100f8584.
  pablomartin4btc:
    ACK 70100f8584 since I've reviewed to be reverted #28905.

Tree-SHA512: 121a8e40c728060526f380b7946211b5d4eca8821bfe62e6451642ffdf95fe9ab7101e0cffa7f4a777bc9cf94278bb50c1b40b71768e1ac39801bb4831afeb90
2023-11-28 10:51:46 +00:00
MarcoFalke fa825975b5
fuzz: Avoid timeout in process_messages 2023-11-28 09:58:10 +01:00
Sebastian Falbesoner e67634ef19 fuzz: BIP324: damage ciphertext/aad in full byte range
Currently the damaging of input data for decryption (either ciphertext
or aad) only ever happens in the lower nibble within the byte at the
damage position, as the bit position for the `damage_val` byte was
calculated with `damage_bit & 3` (corresponding to `% 4`) rather than
`damage_bit & 7` (corresponding to the expected `% 8`).
2023-11-28 02:30:09 +01:00
fanquake 794f971607
Merge bitcoin/bitcoin#28933: fuzz: Faster wallet_notifications target
fa15861763 fuzz: Faster wallet_notifications target (MarcoFalke)
fa971c09f2 Export assert from util/check.h (MarcoFalke)

Pull request description:

  Avoid read/write from storage to speed the target up.

ACKs for top commit:
  dergoegge:
    reACK fa15861763
  brunoerg:
    reACK fa15861763

Tree-SHA512: 90aa856ae31db27a55ef0dfa2cb303d98e6c4d530d2937ad8d808c5f4048389b7ed3c78c27df92db8fe29531b5530aecbb06a0e8274dda424149f46cd6c19f98
2023-11-27 17:35:45 +00:00
MarcoFalke fa15861763
fuzz: Faster wallet_notifications target 2023-11-27 12:06:06 +01:00
fanquake 5f9fd11680
Merge bitcoin/bitcoin#28931: fuzz: Limit fuzz buffer size in script_flags target
faf1fb207f Fix IWYU for the script_flags fuzz target (MarcoFalke)
fa71285b73 fuzz: Limit fuzz buffer size in script_flags target (MarcoFalke)
fa6b87b9ee fuzz: CDataStream -> DataStream in script_flags (MarcoFalke)

Pull request description:

  Most fuzz targets have an upper limit on the buffer size to avoid excessive runtime. Do the same for `script_flags` to avoid timeouts such as https://github.com/bitcoin/bitcoin/issues/28812#issuecomment-1824696971

  Also, fix iwyu. Also, remove legacy `CDataStream`.

ACKs for top commit:
  dergoegge:
    ACK faf1fb207f
  brunoerg:
    utACK faf1fb207f

Tree-SHA512: 9301917b353f7409e448b6fd3635de19330856e0742431db5ef04e62873501b5b4cd6cb78ad81ada2747fa2bdae033115b5951d10489dd5d0d320426c8b96bee
2023-11-26 12:22:50 +00:00
Hennadii Stepanov 6d05c4fd13
msvc: Specify `boost-date-time` package explicitly
Compilation now succeeds only by coincidence, as the `boost-date-time`
package is installed as a dependency of the `boost-process` one.
2023-11-25 18:27:50 +00:00
Hennadii Stepanov 1f97e51d73
msvc: Update vcpkg manifest baseline up to "2023.08.09 Release"
Dependency changes (2023.01.09 --> 2023.08.09):
- berkeleydb: 4.8.30#8 --> 4.8.30#9
- boost: 1.81.0 --> 1.82.0#2
- sqlite3: 3.40.0#1 --> 3.42.0#1
- zeromq: 4.3.4#6 --> 2023-06-20#1
2023-11-25 18:27:40 +00:00
Hennadii Stepanov 2d2ef2f14f
msvc: No need to specify the default feature for `libevent` package 2023-11-25 18:27:33 +00:00
Peter Todd ecb46837e7
Change petertodd seeds to petertodd.net
I changed my DNS seeds to .net from .org to avoid issues with DNS blacklisting,
that falsely thinks my domain name is pointing to IP addresses with malware and
similar things. Right now there are CNAME records, so the .org addresses still
work. But eventually, if needed, I'll remove those CNAME's.
2023-11-25 13:59:41 +00:00
Hennadii Stepanov 70100f8584
Revert "ci: Avoid toolset ambiguity that MSVC can't handle"
This reverts commit 91d5bd8ac9.
2023-11-24 15:47:49 +00:00
Hennadii Stepanov 1a889f7ea0
ci: Set MSVC toolset version explicitly
This change avoids toolset incompatibilities that cause linker errors.
2023-11-24 15:47:28 +00:00
Hennadii Stepanov 4335e55359
ci: Run vcpkg with path prefix
The GHA VS installation includes its own vcpkg package manager, which is
available since VS 17.6. This change avoids any ambiguity about which
copy of vcpkg we run.
2023-11-24 15:40:46 +00:00
fanquake b5a271334c
Merge bitcoin/bitcoin#28922: Use Txid in COutpoint
9e58c5bcd9 Use Txid in COutpoint (dergoegge)

Pull request description:

  This PR changes the type of the hash of a transaction outpoint from `uint256` to `Txid`.

ACKs for top commit:
  Sjors:
    ACK 9e58c5bcd9
  stickies-v:
    ACK 9e58c5bcd9. A sizeable diff, but very straightforward changes. Didn't see anything controversial. Left a few nits, but nothing blocking, only if you have to retouch.
  TheCharlatan:
    ACK 9e58c5bcd9

Tree-SHA512: 58f61ce1c58668f689513e62072a7775419c4d5af8f607669cd8cdc2e7be9645ba14af7f9e2d65da2670da3ec1ce7fc2a744037520caf799aba212fd1ac44b34
2023-11-24 14:41:58 +00:00
fanquake c0196bec98
Merge bitcoin/bitcoin#28932: ci: remove `python3-setuptools` from macOS build deps
0ffcc5b680 ci: remove python3-setuptools from mac build deps (fanquake)

Pull request description:

  Remove no-longer used python-setuptools.
  Followup to #28432.
  Related to #28845.

ACKs for top commit:
  hebasto:
    ACK 0ffcc5b680, I have reviewed the code and it looks OK.
  TheCharlatan:
    ACK 0ffcc5b680

Tree-SHA512: c3ac441c85f6f203414e5e2ad0c453ee35fa4765c72c5ff79699aa622c0db767651890ac0c8507f5ed18e18e3b0e23f2952f677476424cfda4df93647a367c26
2023-11-24 13:38:52 +00:00
MarcoFalke fa971c09f2
Export assert from util/check.h
This avoids having to include both headers when assert and Assert are
used at the same time.
2023-11-24 13:11:36 +01:00
fanquake 0ffcc5b680
ci: remove python3-setuptools from mac build deps 2023-11-23 17:52:38 +00:00
fanquake 930bcfd4cd
Merge bitcoin/bitcoin#18919: test: Add gettransaction test for "coin-join" tx
fa20f8919c test: Add gettransaction test for "coin-join" tx (MarcoFalke)

Pull request description:

ACKs for top commit:
  furszy:
    utACK fa20f8919c

Tree-SHA512: 6e92455ef478d6bf2c544910402be9046698ded66f1f68d5fe5b989aafc20ba0537d362331e0e653595bca553166f6197fe548bdd0bcf295743775b8afb663a1
2023-11-23 17:49:06 +00:00
fanquake f4073c5395
Merge bitcoin/bitcoin#28578: fuzz: add target for `DescriptorScriptPubKeyMan`
47e5c9994c fuzz: add target for `DescriptorScriptPubKeyMan` (brunoerg)
641dddf018 fuzz: create ConsumeCoins (brunoerg)
2e1833ca13 fuzz: move `MockedDescriptorConverter` to `fuzz/util` (brunoerg)

Pull request description:

  This PR adds fuzz target for `DescriptorScriptPubKeyMan`. Also, moves `MockedDescriptorConverter` to `fuzz/util/descriptor` to be used here and in `descriptor` target.

ACKs for top commit:
  maflcko:
    lgtm ACK 47e5c9994c 🏓
  dergoegge:
    ACK 47e5c9994c

Tree-SHA512: 519acca6d7b7a3a0bfc031441b02d5980b12bfb97198bd1958a83cd815ceb9eb1499a48a3f0a7fe20e5d06d83b89335d987376fc0a014e2106b0bc0e9838dd02
2023-11-23 17:34:03 +00:00
MarcoFalke faf1fb207f
Fix IWYU for the script_flags fuzz target
Also, export script_error.h from interpreter.h, because there should
rarely be a case where script_error.h is included without interpreter.h
2023-11-23 17:57:53 +01:00
MarcoFalke fa71285b73
fuzz: Limit fuzz buffer size in script_flags target 2023-11-23 17:56:52 +01:00
MarcoFalke fa6b87b9ee
fuzz: CDataStream -> DataStream in script_flags 2023-11-23 17:50:33 +01:00
MarcoFalke fa20f8919c
test: Add gettransaction test for "coin-join" tx 2023-11-23 14:11:01 +01:00
MarcoFalke fa79a881ce
refactor: P2P transport without serialize version and type 2023-11-23 13:43:39 +01:00
fanquake ddc4b9850a
Merge bitcoin/bitcoin#28919: build: Fix regression in "ARMv8 CRC32 intrinsics" test
228d6a2969 build: Fix regression in "ARMv8 CRC32 intrinsics" test (Hennadii Stepanov)

Pull request description:

  In the master branch, the `aarch64` binaries lack support for CRC32 intrinsics.

  The `vmull_p64` is a part of the Crypto extensions from the ACLE. They are optional extensions, so they get enabled with a `+crypto` for architecture flags.

  The regression was introduced in https://github.com/bitcoin/bitcoin/pull/26183 (v25.0).

  The `./configure` script log excerpts:
  - the master branch @ d752349029ec7a76f1fd440db2ec2e458d0f3c99:
  ```
  checking whether C++ compiler accepts -march=armv8-a+crc... yes
  checking whether C++ compiler accepts -march=armv8-a+crypto... yes
  checking for ARMv8 CRC32 intrinsics... no
  checking for ARMv8 SHA-NI intrinsics... yes
  ```
  - this PR:
  ```
  checking whether C++ compiler accepts -march=armv8-a+crc+crypto... yes
  checking whether C++ compiler accepts -march=armv8-a+crypto... yes
  checking for ARMv8 CRC32 intrinsics... yes
  checking for ARMv8 SHA-NI intrinsics... yes
  ```

  Guix build:
  ```
  x86_64
  2afd81f540c6d3b36ff305e88bafe935e4272cd3efef3130aa69d49a0522541b  guix-build-228d6a2969e4/output/aarch64-linux-gnu/SHA256SUMS.part
  6c704d6d30d495adb3fb86befdb500eb389a02c1167163f14ab5c3c3e630e6b3  guix-build-228d6a2969e4/output/aarch64-linux-gnu/bitcoin-228d6a2969e4-aarch64-linux-gnu-debug.tar.gz
  e4419963c9c0d99adc4e38538900b648f2c14f793b60c8ee2e6f5acc9d3fadd3  guix-build-228d6a2969e4/output/aarch64-linux-gnu/bitcoin-228d6a2969e4-aarch64-linux-gnu.tar.gz
  7d11052b6bd28cdf26d5f2a4987f02d32c93a061907bcd048fb6d161a0466ca9  guix-build-228d6a2969e4/output/dist-archive/bitcoin-228d6a2969e4.tar.gz
  ```

ACKs for top commit:
  TheCharlatan:
    ACK 228d6a2969

Tree-SHA512: 4c27ca8acb953bf56e972d907a282ee19e3f30f7a4bf8a9822395fe0e28977cd6233e8b65b4a25cc1d3d5ff6a796d7af07653e18531c44ee3efaff1563d96d32
2023-11-22 17:20:13 +00:00
fanquake 5d13b9586e
Merge bitcoin/bitcoin#28461: build: Windows SSP roundup
f95af98128 guix: default ssp for Windows GCC (fanquake)
95d55b96c2 guix: remove ssp workaround from Windows GCC (fanquake)
8f43302a0a build: remove explicit libssp linking from Windows build (fanquake)

Pull request description:

  I was expecting this to fail to compile somewhere, maybe in the CI, but that doesn't seem to be the case?
  Seems workable given the SSP related changes in the newer mingw-w64 headers (which are in Guix):
  > Implement some of the stack protector functions/variables so -lssp is now optional when _FORTIFY_SOURCE or -fstack-protector-strong is used.

  However I think this would still be broken in some older environments, so we might have to wait for a compiler bump, or similar. The optional -lssp also seems to work when using older headers, which doesn't make sense.

  Would fix #28104.

ACKs for top commit:
  hebasto:
    ACK f95af98128, I've verified binaries from `bitcoin-f95af98128f1-win64.zip` on Windows 11 Pro 23H2.
  TheCharlatan:
    ACK f95af98128

Tree-SHA512: 71169ec513cfe692dfa7741d2bf37b45da05627c0af1cbd50cf8c3c04cc21c4bf88f3284532bddc1e3e648391ec78dbaca5170987a13c21ac204a7bcaf27f349
2023-11-22 17:17:12 +00:00
fanquake 172cd92620
Merge bitcoin/bitcoin#28862: lint: Report all lint errors instead of early exit
fa01f884d3 ci: Add missing COPY for ./test/lint/test_runner (MarcoFalke)
faff3e3b46 lint: Report all lint errors instead of early exit (MarcoFalke)

Pull request description:

  `all-lint.py` currently collects all failures. However, the `06_script.sh` does not, since July this year (https://github.com/bitcoin/bitcoin/pull/28103#discussion_r1268115806).

  Fix this by printing all failures before exiting.

  Can be tested by modifying (for example) two subtrees in the same commit and then running the linters.

ACKs for top commit:
  kevkevinpal:
    ACK [fa01f88](fa01f884d3)
  TheCharlatan:
    lgtm ACK fa01f884d3

Tree-SHA512: c0f3110f2907d87e29c755e3b77a67dfae1f8a25833fe6ef8f2f2c58cfecf1aa46f1a20881576b62252b04930140a9e416c78b4edba0780d3c4fa7aaebabba81
2023-11-22 17:00:45 +00:00