Commit Graph

27669 Commits

Author SHA1 Message Date
fanquake
34f0f56582
Merge bitcoin/bitcoin#28506: fuzz: Add missing PROVIDE_FUZZ_MAIN_FUNCTION guard to __AFL_FUZZ_INIT
fa33b2c889b90bd44f188ba5f0fafe31d7d7fad7 fuzz: Add missing PROVIDE_FUZZ_MAIN_FUNCTION guard to __AFL_FUZZ_INIT (MarcoFalke)

Pull request description:

  Should fix https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=62455

ACKs for top commit:
  dergoegge:
    utACK fa33b2c889b90bd44f188ba5f0fafe31d7d7fad7

Tree-SHA512: 735926f7f94ad1c3c5dc0fc62a2ef3a85abae25f4fe1e7654c2857ce3e867667ed28da58ab36281d730d3e206a0728cb429671ea5d3ccd11519e637eb191f70d
2024-10-24 11:18:39 -05:00
fanquake
ca0225c0fd
Merge bitcoin/bitcoin#28480: fuzz: Don't use afl++ deferred forkserver mode
508d05f8a7b511dd53f543df8899813487eb03e5 [fuzz] Don't use afl++ deferred forkserver mode (dergoegge)

Pull request description:

  Fixes #28469

  This makes our afl++ harness essentially behave like libFuzzer, with the exception that the whole program does fully reset every 100000 iterations. 100000 is somewhat arbitrary and we could also go with `std::numeric_limits<unsigned in>::max()` but a smaller limit does allow for the occasional reset to counter act some amount of instability in the fuzzing loop (e.g. non-determinism, statefulness).

  It's a bit of a shame to do this just for the targets whose initial state can't be forked (e.g. threads) because other targets do benefit from not having to redo the state setup. An alternative would be https://github.com/bitcoin/bitcoin/issues/28469#issuecomment-1717526774:
  ```
  If the goal is to be maximally performant, the fork would need to happen for each fuzz target specifically.
  I guess it can be achieved by wrapping __AFL_INIT(); into a helper function and then require all fuzz
  target initialize() to call it?
  ```

ACKs for top commit:
  MarcoFalke:
    lgtm ACK 508d05f8a7b511dd53f543df8899813487eb03e5

Tree-SHA512: d9fe94e2e3198795f8fb58f67eb383531a534bcd4ec75a1f0ae6ccb5531863dbc09800bb7d77536417745c4c8bc49a4f84dcc959918b27d4997a270eeacb0e7e
2024-10-24 11:18:39 -05:00
fanquake
2b236ad07b
Merge bitcoin/bitcoin#28460: fuzz: Use afl++ shared-memory fuzzing
97e2e1d641016cd7b74848b9560e3771f092c1ea [fuzz] Use afl++ shared-memory fuzzing (dergoegge)

Pull request description:

  Using shared-memory is faster than reading from stdin, see 7d2122e059/instrumentation/README.persistent_mode.md

ACKs for top commit:
  MarcoFalke:
    review ACK 97e2e1d641016cd7b74848b9560e3771f092c1ea

Tree-SHA512: 7e71b5f84835e41531c19ee959be2426da245869757de8e5dd1c730ae83ead650e2ef75f4d594d7965f661821a4ffbd27be84d3ce623702991501b34a8d02fc3
2024-10-24 11:18:39 -05:00
fanquake
52f036b316
Merge bitcoin/bitcoin#28427: index: coinstats reorg, fail when block cannot be reversed
c0bf667912064960df194ea94150976b34f7c267 index: add [nodiscard] attribute to functions writing to the db (furszy)
eef595560e9ecf3a0d1db4d8ea7ecc33a49d839f index: coinstats reorg, fail when block cannot be reversed (furszy)

Pull request description:

  Found it while reviewing https://github.com/bitcoin/bitcoin/pull/24230#discussion_r1310863359.

  During a reorg, continuing execution when a block cannot be reversed leaves the
  coinstats index in an inconsistent state.
  This was surely overlooked when 'CustomRewind' was implemented.

ACKs for top commit:
  ryanofsky:
    Code review ACK c0bf667912064960df194ea94150976b34f7c267. Only change since last review is new commit adding [[nodiscard]]

Tree-SHA512: f4fc8522508d23e4fff09a29c935971819b1bd3b2a260e08e2e2b72f9340980d74fbec742a58fe216baf61d27de057c7c8300e8fa075f8507cd1227f128af909
2024-10-24 11:18:39 -05:00
fanquake
6ad6f2f28d
Merge bitcoin/bitcoin#28412: test: remove unused variables in p2p_invalid_block
3eb03803c4111d09c63550a6a6c09afbe3430bf6 test: remove unused variables in `p2p_invalid_block` (brunoerg)

Pull request description:

ACKs for top commit:
  stickies-v:
    ACK 3eb03803c4111d09c63550a6a6c09afbe3430bf6

Tree-SHA512: eadae1eb323e5562d1ea0aed43ebf0145f0fdbb6cd6d4646bbf1ca89f384820e7b9cb69f0bb04a949e9f8983a879aee8387d6f7ac3d4e4ea027f8892e656fb98
2024-10-24 11:18:39 -05:00
fanquake
43b88315e1
Merge bitcoin/bitcoin#28426: doc: s/--no-substitute/--no-substitutes in guix/INSTALL
8f541023b9582f8291d00ed4fc14a0db096b0113 doc: s/--no-substitute/--no-substitutes in guix/INSTALL (fanquake)

Pull request description:

  https://guix.gnu.org/manual/en/html_node/Common-Build-Options.html

ACKs for top commit:
  hebasto:
    ACK 8f541023b9582f8291d00ed4fc14a0db096b0113.
  TheCharlatan:
    ACK 8f541023b9582f8291d00ed4fc14a0db096b0113

Tree-SHA512: 4d79791a8fa772d35723d35e85aaf9ab86304f2a1238e883bbb85051d0cc5f9841dab99ef0fe1e9d67f6259798e98942be00ae7c4320328987234293d9bf3012
2024-10-24 11:18:38 -05:00
fanquake
1730a267ba
Merge bitcoin/bitcoin#28386: test: remove fixed timeouts from feature_config_args
fbcacd4cf0dbe54e51f89cda05ff3db9e378ea12 test: remove fixed timeouts from feature_config_args (Martin Zumsande)

Pull request description:

  Fixes #28290

  These fixed timeouts aren't affected by the `timeout_factor` option and can therefore cause timeouts in slow environments.
  They are also unnecessary for the test because they measure the wrong thing:
  While there is an internal waiting time of 60s within `ThreadOpenConnections` (beginning only when that thread is started) for fixed seeds querying, the timeouts here don't measure that but the time from startup until a debug log message is encountered, during which many other things happen in init, so they don't make much sense to me in the first place.

ACKs for top commit:
  MarcoFalke:
    lgtm ACK fbcacd4cf0dbe54e51f89cda05ff3db9e378ea12

Tree-SHA512: 7bb3b7db2f9666b1929ffb7773c838ee98b0845569428e5d00ecf5234973d534c4f474e213896c71baabd6096a79347bd21b41a17b130053049714eb8a447c79
2024-10-24 11:18:38 -05:00
fanquake
7f83db0d0c
Merge bitcoin/bitcoin#28332: test: previous releases: speed up fetching sources with shallow clone
360ac64b90ee16cc24bd4c574ec7e11760515a79 test: previous releases: speed up fetching sources with shallow clone (Sebastian Falbesoner)

Pull request description:

  For the sake of building previous releases, fetching the whole history of the repository for each version seems to be overkill as it takes much more time, bandwidth and disk space than necessary. Create a shallow clone instead with history truncated to the one commit of the version tag, which is directly checked out in the same command. This has the nice side-effect that we can remove the extra `git checkout` step after as it's not needed anymore.

  Note that it might look confusing to pass a _tag_ to a parameter named `--branch`, but the git-clone manpage explicitly states that this is supported.

ACKs for top commit:
  MarcoFalke:
    lgtm ACK 360ac64b90ee16cc24bd4c574ec7e11760515a79

Tree-SHA512: c885a695c1ea90895cf7a785540c24e8ef8d1d9ea78db28143837240586beb6dfb985b8b0b542d2f64e2f0ffdca7c65fc3d55f44b5e1b22cc5535bc044566f86
2024-10-24 11:18:38 -05:00
fanquake
8490bf4b03
Merge bitcoin/bitcoin#28288: test: fix 'unknown named parameter' test in wallet_basic
452c094449de00f3640e6e0763366e7603375825 test: fix 'unknown named parameter' test in `wallet_basic` (brunoerg)

Pull request description:

  This PR removes loop when testing an unknown named parameter. They don't have any effect.

ACKs for top commit:
  jonatack:
    ACK 452c094449de00f3640e6e0763366e7603375825
  theStack:
    re-ACK 452c094449de00f3640e6e0763366e7603375825

Tree-SHA512: cf1a37d738bb6fdf9817e7b1d33bc69643dae61e3dbfae5c1e9f26220c55db6f134018dd9a1c65c13869ee58bcb6f3337c5999aabf2614d3126fbc01270705e8
2024-10-24 11:18:38 -05:00
fanquake
8b8ff1c7d5
Merge bitcoin/bitcoin#28215: fuzz: fix a couple incorrect assertions in the coins_view target
e417c988f61bf9d3948d5c8e169626922fe6e24c fuzz: coins_view: remove an incorrect assertion (Antoine Poinsot)
c5f6b1db56f67f529377bfb61f58c0a8c17b0127 fuzz: coins_view: correct an incorrect assertion (Antoine Poinsot)

Pull request description:

  The `coins_view` fuzz target would assert in two places that the cache is consistent with the backend. But it's never the case (that's the whole point of using a cache).

  The only reason this didn't result in a crash was that we would never actually hit these assertions. I ran into this while introducing a new target with an in-memory `CCoinsViewDB` as the backend view (see https://github.com/bitcoin/bitcoin/pull/28216) which made the code paths with those assertions actually reachable.

ACKs for top commit:
  dergoegge:
    Code review ACK e417c988f61bf9d3948d5c8e169626922fe6e24c

Tree-SHA512: 5847bb2744a2f2831dace62d32b79cc491bf54e2af4ce425411d245d566622d9aff816d9be5ec8e830d10851c13f2500bf4f0c004d88b4d7cca1d483ef8960a6
2024-10-24 11:18:38 -05:00
fanquake
c36f7d93fa
Merge bitcoin/bitcoin#27401: tracepoints: Disables -Wgnu-zero-variadic-macro-arguments to compile without warnings
5197660e947435e510ef3ef72be8be8dee3ffa41 tracepoints: Disables `-Wgnu-zero-variadic-macro-arguments` to compile without warnings (Martin Leitner-Ankerl)

Pull request description:

  Fixes #26916 by disabling the warning `-Wgnu-zero-variadic-macro-arguments` when clang is used as the compiler.

  Also see the comments
  * Proposed changes in the bug  https://github.com/bitcoin/bitcoin/issues/26916#issuecomment-1480997053
  * Proposed changes when moving to a variadic maro: https://github.com/bitcoin/bitcoin/pull/26593#discussion_r1155488768

ACKs for top commit:
  hebasto:
    ACK 5197660e947435e510ef3ef72be8be8dee3ffa41, I've reconsidered my [comment](https://github.com/bitcoin/bitcoin/pull/27401#issuecomment-1507142439) and I think the current localized approach is optimal.
  fanquake:
    ACK 5197660e947435e510ef3ef72be8be8dee3ffa41 - checked that this fixes the warnings under Clang.

Tree-SHA512: c3dda3bcbb2540af6283ffff65885a9937bfdaaef3b00dc7d60b9f9740031d5c36ac9cb3d3d8756dbadce4812201a9754f5b8770df0d5e0d5ee690ba8a7135d2
2024-10-24 11:18:38 -05:00
fanquake
163020ef92
Merge bitcoin/bitcoin#28203: refactor: serialization simplifications
f054bd072afb72d8dae7adc521ce15c13b236700 refactor: use "if constexpr" in std::vector's Unserialize() (Martin Leitner-Ankerl)
088caa68fb8efd8624709d643913b8a7e1218f8a refactor: use "if constexpr" in std::vector's Serialize() (Martin Leitner-Ankerl)
0fafaca4d3bbf0c0b5bfe1ec617ab15252ea51e6 refactor: use "if constexpr" in prevector's Unserialize() (Martin Leitner-Ankerl)
c8839ec5cd81ba9ae88081747c49ecc758973dd1 refactor: use "if constexpr" in prevector's Serialize() (Martin Leitner-Ankerl)
1403d181c106bc271ad2522adebde07c7850069b refactor: use fold expressions instead of recursive calls in UnserializeMany() (Martin Leitner-Ankerl)
bd08a008b42dac921bd9c031637e378899c1cd1d refactor: use fold expressions instead of recursive calls in SerializeMany() (Martin Leitner-Ankerl)

Pull request description:

  This simplifies the serialization code a bit and should also make it a bit faster.

  * use fold expressions instead of recursive calls. This simplifies the code, makes it most likely faster because it reduces the number of function calls, and compiles faster because there are fewer template instantiations.

  * use `if constexpr` instead of unnecessarily creating a temporary object only to call the right overload. This is used for `std::vector` and `prevector` serialization.

ACKs for top commit:
  MarcoFalke:
    only change is to add a missing `&`. lgtm, re-ACK f054bd072afb72d8dae7adc521ce15c13b236700 📦
  jonatack:
    ACK f054bd072afb72d8dae7adc521ce15c13b236700
  sipa:
    utACK f054bd072afb72d8dae7adc521ce15c13b236700
  john-moffett:
    ACK f054bd072afb72d8dae7adc521ce15c13b236700

Tree-SHA512: 0417bf2d6be486c581732297945449211fc3481bac82964e27628b38ef55a47dfa58d730148aeaf1b19fa8eb1076489cc646ceebb178162a9afa59034601501d
2024-10-24 11:18:38 -05:00
fanquake
24e57da770
Merge bitcoin/bitcoin#28181: qa, doc: Fix comment
ab498d913c6f9f6096c75cc43a91e7a12cfc3fb7 qa, doc: Fix comment (Hennadii Stepanov)

Pull request description:

  This PR is a follow-up for:
  - https://github.com/bitcoin/bitcoin/pull/9956
  - https://github.com/bitcoin/bitcoin/pull/10096

ACKs for top commit:
  RandyMcMillan:
    ACK ab498d913c6f9f6096c75cc43a91e7a12cfc3fb7

Tree-SHA512: 267ae52c961ee79e172f27cb1587282ac5cf7ec929a136db6feed3de4f319a74b462befd9b99711081db8a5c30a513f72366364068700418b273a31958b31b1d
2024-10-24 11:18:38 -05:00
fanquake
933a63e8fc
Merge bitcoin/bitcoin#28145: valgrind: add suppression for bug 472219
50f7214e0915a88dd81c1ac1d292e049a398cda2 valgrind: add suppression for bug 472219 (fanquake)

Pull request description:

  Now that https://bugs.kde.org/show_bug.cgi?id=472219 has been fixed upstream in:

  https://sourceware.org/git/?p=valgrind.git;a=commit;h=6ce0979884a8f246c80a098333ceef1a7b7f694d

  Add a supression to ignore the bug until we are using a fixed version of Valgrind.

  Related to #28072.

ACKs for top commit:
  MarcoFalke:
    lgtm ACK 50f7214e0915a88dd81c1ac1d292e049a398cda2

Tree-SHA512: 1030f3709195250350fd9c558420a9b1773fb54fdb323e0452a46eeb69ec6d60b5df50bde617c12d917e16dde07db64dee1b0101ddd4eda6161261fc7f6d4474
2024-10-24 11:18:37 -05:00
fanquake
33766805eb
Merge bitcoin/bitcoin#28124: fuzz: Re-enable symbolize=1 in ASAN_OPTIONS
faa8c1be265d2344a3bc0932455b0182ec7d64c7 fuzz: Re-enable symbolize=1 in ASAN_OPTIONS (MarcoFalke)

Pull request description:

  Looks like this fixed itself somehow and is no longer reproducible?

ACKs for top commit:
  fanquake:
    ACK faa8c1be265d2344a3bc0932455b0182ec7d64c7

Tree-SHA512: 67d2d6349cc7485f32bebabc18869ab101ae66a778a40ff9ddb037980997e600d7c6d1e0a17a011fa2a4ba07c73594b087dd781248cb8351f2688bc4cf6e587d
2024-10-24 11:18:37 -05:00
fanquake
621061459a
Merge bitcoin/bitcoin#28099: contrib: move user32.dll from bitcoind.exe libs
8c3850923300352f14dc3dde6a6ce6689ddef185 contrib: move user32.dll from bitcoind.exe libs (fanquake)

Pull request description:

  The user interface library is no-longer needed by `bitcoind.exe`, or utils, only `bitcoin-qt.exe`.
  Add missing doc.

ACKs for top commit:
  hebasto:
    ACK 8c3850923300352f14dc3dde6a6ce6689ddef185, I've verified imported libraries on a Windows machine with the `dumpbin /imports` command.

Tree-SHA512: f752a5b807341c87320523f4e7c564c8acdbfc1313054a684844035102a7c4695d34cfefb0c6904f3151b2dfdcb54d6ea243c570deceeda30345944251e4c513
2024-10-24 11:18:37 -05:00
fanquake
90a1fb0e8d
Merge bitcoin/bitcoin#28650: fuzz: Merge with -set_cover_merge=1
fa858d63a0a5d794aab38c26f60c593513fe08de fuzz: Merge with -set_cover_merge=1 (MarcoFalke)

Pull request description:

  This should be less controversial than commit 151a2b189c3561dda2bb7de809306c1cfeb40e23. The overall size of the qa-assets repo is reduced further from 1.9GB to 1.6GB. Also, the runtime to iterate on the resulting folder is reduced further from ~1699s to ~1149s (N=1).

ACKs for top commit:
  murchandamus:
    crACK fa858d63a0a5d794aab38c26f60c593513fe08de
  dergoegge:
    ACK fa858d63a0a5d794aab38c26f60c593513fe08de

Tree-SHA512: e23fa93bd48f01d11c551b035004c678bd6d76bc24ac7d0d0a7883060804e6711763cbd0cd0ded3aad3e4c40da764decae81c2703388cc11961def3c89a4f9ba
2024-10-24 11:17:28 -05:00
fanquake
f007abd19d
Merge bitcoin/bitcoin#28459: build: add -mbranch-protection=bti (aarch64) to hardening flags
61a6c3b0e9a8dab5c5f845af4becde817539133c build: add `-mbranch-protection=bti` to aarch64 hardening flags (fanquake)

Pull request description:

  This is a simpler (less hardening) version of https://github.com/bitcoin/bitcoin/pull/24123.

  You can inspect binaries using `readelf -n`, and look for BTI in a `.note.gnu.property`. i.e
  ```bash
  readelf -n src/bitcoin-cli

  Displaying notes found in: .note.gnu.property
    Owner                Data size Description
    GNU                  0x00000010NT_GNU_PROPERTY_TYPE_0
        Properties: AArch64 feature: BTI
  ```

  Related to https://github.com/bitcoin/bitcoin/issues/19075.

ACKs for top commit:
  TheCharlatan:
    utACK 61a6c3b0e9a8dab5c5f845af4becde817539133c

Tree-SHA512: 64504de44e91d853165daf4111dca905d8eb9ef3f4bfb0d447c677b02c9100dbd56f13e6fe6539fb06c2343a094229591ac5d1bd9e184b32b512c0ac3f9bac36
2024-10-24 11:17:28 -05:00
fanquake
af8d12445a
Merge bitcoin/bitcoin#28624: docs: fix typo
57131bfa3cfd9e5826b5c557aba8aa03bf41f833 docs: fix typo (vuittont60)

Pull request description:

ACKs for top commit:
  maflcko:
    lgtm ACK 57131bfa3cfd9e5826b5c557aba8aa03bf41f833
  hebasto:
    ACK 57131bfa3cfd9e5826b5c557aba8aa03bf41f833, the `codespell` is powerless to catch this typo.
  jarolrod:
    ACK 57131bfa3cfd9e5826b5c557aba8aa03bf41f833

Tree-SHA512: 816dfc5ff64531ea92acf35feca2286a71c75344df2524ff003a3d375e60100b8531e1678be0ed11863d03ab522d5733d8a0bf4b6f5f79c495a65246fe0b697f
2024-10-24 11:17:28 -05:00
fanquake
c740264da8
Merge bitcoin/bitcoin#28532: qt: enable -ltcg for windows under LTO
f0cebbdb2a1a3c2f0facd88963484ad6fd5851db qt: enable -ltcg for windows HOST (fanquake)

Pull request description:

  Patch around multiple definition issues in Qt, and enable `-ltcg` when using `LTO=1`.

  Split from #25391.

ACKs for top commit:
  hebasto:
    ACK f0cebbdb2a1a3c2f0facd88963484ad6fd5851db

Tree-SHA512: 2d6e34779f360bf6dfea4f70fc9004a16e95da79716fcb3046afbf2b01317b7e16965cb51b967b7b5fb64549306c5f48cf59082884289c52016bc1e86949e062
2024-10-24 11:17:28 -05:00
fanquake
ccd3920d40
Merge bitcoin/bitcoin#28556: doc: fix link to developer-notes.md file in multiprocess.md
d9b172cd00fc3a8de1308e4469b82f5da474ea33 doc: fix link to developer-notes.md file in multiprocess.md (David Álvarez Rosa)

Pull request description:

  Fix link to `developer-notes.md` file in `multiprocess.md`.

ACKs for top commit:
  fanquake:
    ACK d9b172cd00fc3a8de1308e4469b82f5da474ea33

Tree-SHA512: 55fffefb37c4d67acb1fa8b0660216ec1c7f2c2314d11e4d319cae40480ed59ef448909fa2ca334167c86d60d41932220dce4186e28fa300f4d03eb0b3c769d0
2024-10-24 11:17:20 -05:00
fanquake
b70e091374
Merge bitcoin/bitcoin#29667: fuzz: actually test garbage >64b in p2p transport test
626f8e398e219b84907ccaad036f69177d39284c fuzz: actually test garbage >64b in p2p transport test (Pieter Wuille)

Pull request description:

  This fixes an oversight from #28196: in the `p2p_transport_bidirectional_v2` fuzz test, when the desired garbage length is over 64 bytes, the code would actually use garbage length 0. Fix this.

ACKs for top commit:
  instagibbs:
    ACK 626f8e398e
  brunoerg:
    crACK 626f8e398e219b84907ccaad036f69177d39284c

Tree-SHA512: f6346367adb10464b6c9d20aef43625531d2a4d8110887ad03214b8c1907b83560f2dd5b5415e2180a40b4cd276d51881b32b60c740471b5c6bb218aa19848d8
2024-10-24 11:16:21 -05:00
fanquake
6d7aa3d978
Merge bitcoin/bitcoin#29497: test: simplify test_runner.py
0831b54dfca1b9e728295fff500215da14589fc0 test: simplify test_runner.py (tdb3)

Pull request description:

  Implements the simplifications to test_runner.py proposed by sipa in PR #23995.

  Remove the num_running variable as it can be implied by the length of the jobs list.

  Remove the i variable as it can be implied by the length of the test_results list.

  Instead of counting results to determine if finished, make the queue object itself
  responsible (by looking at running jobs and jobs left).

ACKs for top commit:
  mzumsande:
    re-ACK 0831b54
  davidgumberg:
    reACK 0831b54dfc
  marcofleon:
    re-ACK 0831b54dfca1b9e728295fff500215da14589fc0

Tree-SHA512: e5473e68d49cd779b29d97635329283ae7195412cb1e92461675715ca7eedb6519a1a93ba28d40ca6f015d270f7bcd3e77cef279d9cd655155ab7805b49638f1
2024-10-24 11:16:21 -05:00
Ava Chow
d0e15d59f8
Merge bitcoin/bitcoin#29606: refactor: Reserve memory for ToLower/ToUpper conversions
6f2f4a4d096a3b261258c8cdd96cca532988d1d3 Reserve memory for ToLower/ToUpper conversions (Lőrinc)

Pull request description:

  Similarly to https://github.com/bitcoin/bitcoin/pull/29458, we're preallocating the result string based on the input string's length.
  The methods were already [covered by tests](https://github.com/bitcoin/bitcoin/blob/master/src/test/util_tests.cpp#L1250-L1276).

ACKs for top commit:
  tdb3:
    ACK for 6f2f4a4d096a3b261258c8cdd96cca532988d1d3
  maflcko:
    lgtm ACK 6f2f4a4d096a3b261258c8cdd96cca532988d1d3
  achow101:
    ACK 6f2f4a4d096a3b261258c8cdd96cca532988d1d3
  Empact:
    Code Review ACK 6f2f4a4d09
  stickies-v:
    ACK 6f2f4a4d096a3b261258c8cdd96cca532988d1d3

Tree-SHA512: e3ba7af77decdc73272d804c94fef0b11028a85f3c0ea1ed6386672611b1c35fce151f02e64f5bb5acb5ba506aaa54577719b07925b9cc745143cf5c7e5eb262
2024-10-24 11:16:21 -05:00
Ava Chow
045fa5f57e
Merge bitcoin/bitcoin#29514: tests: Provide more helpful assert_equal errors
a3badf75f6fd88d465e59f46f0336a0c1eacb7de tests: Provide more helpful assert_equal errors (Anthony Towns)

Pull request description:

  In the functional tests, we often compare dicts with assert_equal, but the output makes it very hard to tell exactly which entry in the dicts don't match when there are a lot of entries and only minor differences. Change the output to make it clearer.

ACKs for top commit:
  achow101:
    ACK a3badf75f6fd88d465e59f46f0336a0c1eacb7de
  vasild:
    ACK a3badf75f6fd88d465e59f46f0336a0c1eacb7de
  brunoerg:
    utACK a3badf75f6fd88d465e59f46f0336a0c1eacb7de
  josibake:
    ACK a3badf75f6
  BrandonOdiwuor:
    Code Review ACK a3badf75f6fd88d465e59f46f0336a0c1eacb7de

Tree-SHA512: 1d4b4a3b2e2e28ab09f10b41b04b52b37f64e0d8a54e2306f37de0c3eb3299a7ad4ba225b9efa67057a75e90d008a17385c810a32c9b212d240be280c2dcf2e5
2024-10-24 11:16:21 -05:00
Ava Chow
bd607f049d
Merge bitcoin/bitcoin#29393: i2p: log connection was refused due to arbitrary port
5b358cdd1a5f5d2fe87a9e41c638996eab2e2796 i2p: log connection was refused due to arbitrary port (brunoerg)

Pull request description:

  For I2P, we do not try to connect if port is != 0. However, we do not have anything that indicates it or any error when trying to connect with port != 0. This PR adds a log for it. Also, it improves the functional test. With this log we can ensure the reason we won't connect is the port, in the current test, we cannot ensure it.

ACKs for top commit:
  jonatack:
    ACK 5b358cdd1a5f5d2fe87a9e41c638996eab2e2796
  epiccurious:
    re-ACK 5b358cdd1a5f5d2fe87a9e41c638996eab2e2796.
  achow101:
    ACK 5b358cdd1a5f5d2fe87a9e41c638996eab2e2796
  kristapsk:
    re-ACK 5b358cdd1a5f5d2fe87a9e41c638996eab2e2796
  vasild:
    ACK 5b358cdd1a5f5d2fe87a9e41c638996eab2e2796

Tree-SHA512: 027245afa771c9295fff0bfd17c251dca4a9f4c739e5773922de3c030a65ef05d96291edcbdeeaa50ba3add61f75f28d8c00be503e03fc33d3491d1956fc549f
2024-10-24 11:16:21 -05:00
fanquake
c9617558e3
Merge bitcoin/bitcoin#29595: doc: Wrap flags with code in developer-notes.md
4f1753deaa2481839a0cc4c690d703b3dfebcb5f doc: Wrap flags with code in developer-notes.md (spicyzboss)

Pull request description:

  Before wrap code block
  <img width="1077" alt="image" src="https://github.com/bitcoin/bitcoin/assets/73651621/93f39960-311d-411d-acaf-dce69ad36ca0">

  After wrap code block
  <img width="1073" alt="image" src="https://github.com/bitcoin/bitcoin/assets/73651621/fe6a5cd2-e981-45b1-a150-5a55fab81ae6">

ACKs for top commit:
  fanquake:
    ACK 4f1753deaa2481839a0cc4c690d703b3dfebcb5f

Tree-SHA512: 15a123f3a13c62d9cfdf62d5df351b8c2b3f9f666fba5a2722325600d802a29da61773ad32fb9f8483a915f59dd42731ba724b81b7874d39cb9627f0266b5713
2024-10-24 11:16:21 -05:00
fanquake
8d6e5e7d67
Merge bitcoin/bitcoin#29583: fuzz: Apply fuzz env (suppressions, etc.) when fetching harness list
738a53720e7df70a23709f7a26e4467bbe36db9c [fuzz] Apply fuzz env (suppressions, etc.) when fetching harness list (dergoegge)

Pull request description:

  The fuzz test runner does not add the UBSan suppressions when fetching the harness list. We can observe this in CI as lots of UBSan errors prior to the harnesses actually executing: https://api.cirrus-ci.com/v1/task/5678606140047360/logs/ci.log

  ```
  + test/fuzz/test_runner.py -j10 -l DEBUG /ci_container_base/ci/scratch/qa-assets/fuzz_seed_corpus/ --empty_min_time=60
  /usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/string_view:578:38: runtime error: unsigned integer overflow: 12 - 23 cannot be represented in type 'size_type' (aka 'unsigned long')
  SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/string_view:578:38 in
  /usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/string_view:578:33: runtime error: implicit conversion from type 'size_type' (aka 'unsigned long') of value 18446744073709551605 (64-bit, unsigned) to type 'const difference_type' (aka 'const long') changed the value to -11 (64-bit, signed)
  SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/string_view:578:33 in
  crypto/sha256.cpp:75:57: runtime error: left shift of 1359893119 by 26 places cannot be represented in type 'uint32_t' (aka 'unsigned int')
  SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior crypto/sha256.cpp:75:57 in
  crypto/sha256.cpp:75:79: runtime error: left shift of 1359893119 by 21 places cannot be represented in type 'uint32_t' (aka 'unsigned int')
  SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior crypto/sha256.cpp:75:79 in
  crypto/sha256.cpp:75:101: runtime error: left shift of 1359893119 by 7 places cannot be represented in type 'uint32_t' (aka 'unsigned int')
  SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior crypto/sha256.cpp:75:101 in
  crypto/sha256.cpp:82:47: runtime error: unsigned integer overflow: 2968370640 + 2483695512 cannot be represented in type 'uint32_t' (aka 'unsigned int')
  SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior crypto/sha256.cpp:82:47 in
  crypto/sha256.cpp:74:57: runtime error: left shift of 1779033703 by 30 places cannot be represented in type 'uint32_t' (aka 'unsigned int')
  SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior crypto/sha256.cpp:74:57 in
  crypto/sha256.cpp:74:79: runtime error: left shift of 1779033703 by 19 places cannot be represented in type 'uint32_t' (aka 'unsigned int')
  SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior crypto/sha256.cpp:74:79 in
  crypto/sha256.cpp:74:101: runtime error: left shift of 1779033703 by 10 places cannot be represented in type 'uint32_t' (aka 'unsigned int')
  SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior crypto/sha256.cpp:74:101 in
  crypto/sha256.cpp:83:29: runtime error: unsigned integer overflow: 3458249854 + 980412007 cannot be represented in type 'uint32_t' (aka 'unsigned int')
  SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior crypto/sha256.cpp:83:29 in
  crypto/sha256.cpp:82:21: runtime error: unsigned integer overflow: 528734635 + 4228187651 cannot be represented in type 'uint32_t' (aka 'unsigned int')
  SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior crypto/sha256.cpp:82:21 in
  crypto/sha256.cpp:84:7: runtime error: unsigned integer overflow: 1013904242 + 3720769133 cannot be represented in type 'uint32_t' (aka 'unsigned int')
  SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior crypto/sha256.cpp:84:7 in
  crypto/sha256.cpp:85:12: runtime error: unsigned integer overflow: 3720769133 + 2654153126 cannot be represented in type 'uint32_t' (aka 'unsigned int')
  SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior crypto/sha256.cpp:85:12 in
  crypto/sha256.cpp:82:33: runtime error: unsigned integer overflow: 4165002546 + 1259303586 cannot be represented in type 'uint32_t' (aka 'unsigned int')
  SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior crypto/sha256.cpp:82:33 in
  crypto/sha256.cpp:125:50: runtime error: unsigned integer overflow: 3835390401 + 1367343104 cannot be represented in type 'unsigned int'
  SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior crypto/sha256.cpp:125:50 in
  crypto/sha256.cpp:77:58: runtime error: left shift of 1367343104 by 15 places cannot be represented in type 'uint32_t' (aka 'unsigned int')
  ...
  ```

  To fix this we simply apply the usual fuzz env variables (that apply the suppressions) when fetching the harness list as well.

ACKs for top commit:
  ismaelsadeeq:
    Tested ACK 738a53720e7df70a23709f7a26e4467bbe36db9c
  fanquake:
    ACK 738a53720e7df70a23709f7a26e4467bbe36db9c

Tree-SHA512: befebaeb4ee5f2eddca67fc6dc69e997c6a250ea54844e5e6e93d1f6a13be49364a3ace31eaa942b02dcf73612af29ec4ace86c9eb7567b92f6f5dc3ea14dc11
2024-10-24 11:16:20 -05:00
fanquake
4dce690a5e
Merge bitcoin/bitcoin#29576: Update functional test runner to return error code when no tests are found to run
33268a855883142a039a7a7b14eb1345e52809fd test: exit with code 1 when no fn tests are found (Max Edwards)

Pull request description:

  As discussed in the following PR comment: https://github.com/bitcoin/bitcoin/pull/29535#issuecomment-1979259786

  Prevents the test_runner from exiting silently with code 0 when no tests were found which has recently happened after a GHA runner update such as in this run: https://github.com/bitcoin/bitcoin/actions/runs/8131828989/job/22239779585#step:27:63

ACKs for top commit:
  TheCharlatan:
    ACK 33268a855883142a039a7a7b14eb1345e52809fd
  theStack:
    lgtm ACK 33268a855883142a039a7a7b14eb1345e52809fd

Tree-SHA512: d389e9f5e4da7ce1627fb2fad9b33baf0b04e75dbdbfc0dbf5f1e3e2b0ae1e79721476c5668476055b0f7de29723ed02c8d7e420081a555030cb784886e240fc
2024-10-24 11:16:20 -05:00
fanquake
910a7d6cbf
Merge bitcoin/bitcoin#29529: fuzz: restrict fopencookie usage to Linux & FreeBSD
312f3381a2d3a7afb7c81b4662214d4d67b4e84a fuzz: restrict fopencookie usage to Linux & FreeBSD (fanquake)

Pull request description:

  Should fix the GCC compilation portion of https://github.com/bitcoin/bitcoin/issues/29517#issuecomment-1973573314.

  See also: https://www.gnu.org/software/gnulib/manual/html_node/fopencookie.html.

ACKs for top commit:
  m3dwards:
    ACK 312f3381a2
  TheCharlatan:
    utACK 312f3381a2d3a7afb7c81b4662214d4d67b4e84a

Tree-SHA512: aa8ff20c3fa735415d05a93b8855877035c300f4d2dfd82f65fd9ed5b5c96ab619b4d84eef114ed0013dc5ff0800cb628ed3801e1efde0cfb0d426930d1673d5
2024-10-24 11:16:20 -05:00
fanquake
fdac2b3286
Merge bitcoin/bitcoin#29493: subtree: update crc32c subtree
5d45552fd4303f8d668ffbc50cce1053485aeead Squashed 'src/crc32c/' changes from 0bac72c455..b60d2b7334 (fanquake)

Pull request description:

  Update the crc32c subtree. Includes:
  * https://github.com/bitcoin-core/crc32c-subtree/pull/6

  Which fixes #29178.

ACKs for top commit:
  hebasto:
    ACK 359a8d98468aa4f00be349ccbfc869d797ee807d.
  theuni:
    ACK 359a8d98468aa4f00be349ccbfc869d797ee807d
  dergoegge:
    ACK 359a8d98468aa4f00be349ccbfc869d797ee807d

Tree-SHA512: 2cec81a34ad26bbbc298aea5daffa41e56114d31cc2eb5fe486f46a77c3467bba22bdeca1c52ae97220e119d98818304272fc6337442af55282accabcd4c5833
2024-10-24 11:16:20 -05:00
fanquake
a23b342d7d
Merge bitcoin/bitcoin#29475: doc: Fix Broken Links
6fa61e35320ac2bc623a9c9ca11b270b34e2d05a doc: Fix Broken Links (Justin Dhillon)

Pull request description:

  ### Summery

  Here is what I have fixed:

  http://voorloopnul.com/blog/a-python-netstat-in-less-than-100-lines-of-code/
   --> https://web.archive.org/web/20190424172231/http://voorloopnul.com/blog/a-python-netstat-in-less-than-100-lines-of-code/

  ### Support my work

  These links were found with [link-inspector](https://github.com/justindhillon/link-inspector). If you find this PR useful, give the repo a 

ACKs for top commit:
  fjahr:
    ACK 6fa61e35320ac2bc623a9c9ca11b270b34e2d05a

Tree-SHA512: ba83badfc8a89f33813801f749bcd7ad41d4c9c817ece76f3bb1b60f24c28e99cfccc485a0ba059ec2c1134e8ffb5fa37fdc9835e553229ee5b1167c9b2e8d1f
2024-10-24 11:16:20 -05:00
fanquake
92bad90e6c
Merge bitcoin/bitcoin#28178: fuzz: Generate with random libFuzzer settings
fa3a4102ef0ae06d8930d7a7b567759e2a5b5fde fuzz: Set -rss_limit_mb=8000 for generate as well (MarcoFalke)
fa4e396e1da8e5b04a5f906b95017b969ea37bae fuzz: Generate with random libFuzzer settings (MarcoFalke)

Pull request description:

  Sometimes a libFuzzer setting like `-use_value_profile=1` helps [0], sometimes it hurts [1].

  [0] https://github.com/bitcoin/bitcoin/pull/20789#issuecomment-752961937
  [1] https://github.com/bitcoin/bitcoin/pull/27888#issuecomment-1645976254

  By picking a random value, it is ensured that at least some of the runs will have the beneficial configuration set.

  Also, set `-max_total_time` to prevent slow fuzz targets from getting a larger time share, or possibly peg to a single core for a long time and block the python script from exiting for a long time. This can be improved in the future. For example, the python script can exit after some time (https://github.com/bitcoin/bitcoin/pull/20752#discussion_r549248791). Alternatively, it can measure if coverage progress was made and run for less time if no progress has been made recently anyway, so that more time can be spent on targets that are new or still make progress.

ACKs for top commit:
  murchandamus:
    utACK fa3a4102ef0ae06d8930d7a7b567759e2a5b5fde
  dergoegge:
    utACK fa3a4102ef0ae06d8930d7a7b567759e2a5b5fde
  brunoerg:
    light ACK fa3a4102ef0ae06d8930d7a7b567759e2a5b5fde

Tree-SHA512: bfd04a76ca09aec612397bae5f3f263a608faa7087697169bd4c506c8195c4d2dd84ddc7fcd3ebbc75771eab618fad840af819114968ca3668fc730092376768
2024-10-24 11:16:20 -05:00
fanquake
9b6a05df66
Merge bitcoin/bitcoin#29443: depends: fix BDB compilation on OpenBSD
0fbf051fec723f86f49ab14ea15c91bb1435c656 depends: fix BDB compilation on OpenBSD (Sebastian Falbesoner)

Pull request description:

  Compiling C++ code with `-D_XOPEN_SOURCE=600` causes problems on OpenBSD. If that define is set, the C++ standard header detection routine in BDB's configure script fails due to a missing type name for `locale_t` (see https://gist.github.com/theStack/b41884e31ebc5cdca3220bcaa674cb70 for the relevant config.log part).

  This results in `HAVE_CXX_STDHEADERS` not being defined, which then it turn leads to the inclusion of `<iostream.h>` (rather than `<iostream>`), which doesn't exist, as described in #28963.

  According to a mailing list post discussing a similar problem [1], "OpenBSD provides the POSIX APIs by default", so we don't need this define anyway and can remove it. This fixes the BDB build problem as described in issue #28963. See also f87e75ae71 for a similar fix for google's flatbuffer project.

  Tested on OpenBSD 7.4 with clang 13.0.0. Fixes #28963.

  [1] https://www.mail-archive.com/tech@openbsd.org/msg63386.html

ACKs for top commit:
  fanquake:
    ACK 0fbf051fec723f86f49ab14ea15c91bb1435c656

Tree-SHA512: 02139e9081ed855e067bfba8c81b54c657417576e553cc1035a916ada9be049358f5e14d756d5f234c5226bd7e943f61c6ae8990c1b152f9125681b7b777c9b3
2024-10-24 11:16:20 -05:00
fanquake
9963e6bc28
Merge bitcoin/bitcoin#29413: fuzz: increase length of string used for NetWhitelist{bind}Permissions::TryParse
864e2e9097de8f1fda63137f803687dd5cc96c03 fuzz: increase length of string used for `NetWhitelist{bind}Permissions::TryParse` (brunoerg)

Pull request description:

  The string `s` represents the value from `-whitelist`/`-whitebind` (e.g. "bloom,forcerelay,noban@1.2.3.4:32") and it is used in `NetWhitelistPermissions::TryParse` and `NetWhitebindPermissions::TryParse`. However, a max length of 32 is not enough to cover a lot of cases. Even disconsidering the permissions, 32 would not be enough to cover a lot of addresses. This PR fixes it.

ACKs for top commit:
  maflcko:
    lgtm ACK 864e2e9097de8f1fda63137f803687dd5cc96c03
  epiccurious:
    utACK 864e2e9097de8f1fda63137f803687dd5cc96c03.
  vasild:
    ACK 864e2e9097de8f1fda63137f803687dd5cc96c03

Tree-SHA512: 2b89031b9f2ea92d636f05fd167b1e5ac726742a7e7c1af8ddaeaf90236e659731aaa6b7c23f65ec16ce52ac1b9e68e7b16e23c59e355312d057e001976d172a
2024-10-24 11:16:20 -05:00
fanquake
3914745a10
Merge bitcoin/bitcoin#29425: test: fix intermittent failure in wallet_reorgrestore.py
44d11532f80705b790bc6e28df9a96ac54b25f9b test: fix intermittent failure in wallet_reorgrestore.py (Martin Zumsande)

Pull request description:

  By adding a missing `sync_blocks` call.
  There was a race at `node2` between connecting the block produced by `node0`, and using `-generate` to create new blocks itself. In the failed run, block generation started before connecting the block, resulting in a final block height that was smaller by 1 than expected.
  See https://github.com/bitcoin/bitcoin/issues/29392#issuecomment-1939541603 for a more detailed analysis of the failed run.

  Can be reproduced by adding a sleep to [this spot](6ff0aa089c/src/validation.cpp (L4217))  in `ChainstateManager::ProcessNewBlock()`:
  ```
  if (util::ThreadGetInternalName() == "msghand") {
      std::this_thread::sleep_for(0.2s);
  }
  ```
  which fails for me on master and succeeds with the fix.

  Fixes #29392

ACKs for top commit:
  maflcko:
    lgtm ACK 44d11532f80705b790bc6e28df9a96ac54b25f9b

Tree-SHA512: c08699e5ae348d4c0626022b519449d052f511d3f44601bcd8dac836a130a3f67fca149532e1e3690367ebfdcbcdd32e527170d039209c1f599ce861136ae29f
2024-10-24 11:16:19 -05:00
fanquake
b719883081
Merge bitcoin/bitcoin#29399: test: Fix utxo set hash serialisation signedness
fa0ceae970242d8d6bdef150c98f04c67b06e20c test: Fix utxo set hash serialisation signedness (MarcoFalke)

Pull request description:

  It is unsigned in Bitcoin Core, so the tests should match it:

  5b8990a1f3/src/kernel/coinstats.cpp (L54)

  Large positive values for the block height are too difficult to hit in tests, but it still seems fine to fix this.

  The bug was introduced when the code was written in 6ccc8fc067bf516cda7bc5d7d721945be5ac2003.

  (Lowercase `i` means signed, see https://docs.python.org/3/library/struct.html#format-characters)

ACKs for top commit:
  epiccurious:
    Tested ACK fa0ceae970242d8d6bdef150c98f04c67b06e20c.
  fjahr:
    utACK fa0ceae970242d8d6bdef150c98f04c67b06e20c

Tree-SHA512: ab4405c74fb191fff8520b456d3a800cd084d616bb9ddca27d56b8e5c8969bd537490f6e204c1870dbb09a3e130b03b22a27b6644252a024059c200bbd9004e7
2024-10-24 11:16:19 -05:00
Ava Chow
f0968807bc
Merge bitcoin/bitcoin#29377: test: Add makefile target for running unit tests
5ca9b24da18e842e7a093dc44f6b222af73e92cf test: Add makefile target for running unit tests (TheCharlatan)

Pull request description:

  `make check` runs a bunch of other subtree tests that exercise code that is hardly ever changed and have a comparatively long runtime. There seems to be no target for running just the unit tests, so add one.

  Alternatively the secp256k1 tests could be removed from the `check-local` target, reducing its runtime. This was rejected before though in https://github.com/bitcoin/bitcoin/pull/20264.

ACKs for top commit:
  delta1:
    utACK 5ca9b24da18e842e7a093dc44f6b222af73e92cf
  edilmedeiros:
    Tested ACK 5ca9b24da18e842e7a093dc44f6b222af73e92cf
  achow101:
    ACK 5ca9b24da18e842e7a093dc44f6b222af73e92cf
  ryanofsky:
    Tested ACK 5ca9b24da18e842e7a093dc44f6b222af73e92cf.

Tree-SHA512: 470969d44585d7cc33ad038a16e791db9e2be8469f52ddf122c46f20776fad34e6a48f988861a132c42540158fed05f3cf66fcc3bea05708253daaa35af54339
2024-10-24 11:16:19 -05:00
Ava Chow
03e0bd3347
Merge bitcoin/bitcoin#27319: addrman, refactor: improve stochastic test in AddSingle
e064487ca28c12ba774c2f43a3c7acbdb1a278c9 addrman, refactor: improve stochastic test in `AddSingle` (brunoerg)

Pull request description:

  This PR changes this algorithm to be O(1) instead of O(n). Also, in the current implementation, if `pinfo->nRefCount` is 0, we created an unnecessary variable (`nFactor`), this changes it. the change is relatively simple and does not cause conflicts.

ACKs for top commit:
  achow101:
    ACK e064487ca28c12ba774c2f43a3c7acbdb1a278c9
  amitiuttarwar:
    ACK e064487ca28c12ba774c2f43a3c7acbdb1a278c9
  stratospher:
    ACK e064487ca28c12ba774c2f43a3c7acbdb1a278c9. simple use of << instead of a loop, didn't observe any behaviour difference before and after.

Tree-SHA512: ff0a65155e47f65d2ce3cb5a3fd7a86efef1861181143df13a9d8e59cb16aee9be2f8801457bba8478b17fac47b015bff5cc656f6fac2ccc071ee7178a38d291
2024-10-24 11:16:19 -05:00
pasta
2e162da06f
Merge #6330: backport: merge bitcoin#27653, #24748, #29352, #29372, #29460, #29358, #29511, #29390, #29431, bitcoin-core/gui#788 (BIP324 backports: part 4)
4735b82979 merge bitcoin#29431: disconnection scenarios during v2 handshake (Kittywhiskers Van Gogh)
cc6b88ee37 merge bitcoin-core/gui#788: update session ID tooltip (Kittywhiskers Van Gogh)
2455862c9f merge bitcoin#29390: speedup bip324_cipher.py unit test (Kittywhiskers Van Gogh)
062aaf11e4 merge bitcoin#29511: Fix intermittent failure in rpc_net.py --v2transport (Kittywhiskers Van Gogh)
54972e8fa0 merge bitcoin#29358: use v2 everywhere for P2PConnection if --v2transport is enabled (Kittywhiskers Van Gogh)
4cce72fc3e test: add missing debug log assertion in `p2p_invalid_messages.py` (Kittywhiskers Van Gogh)
bd2fe6103d merge bitcoin#29460: assert rpc error for addnode v2transport not enabled (Kittywhiskers Van Gogh)
5ee15faba0 merge bitcoin#29372: fix intermittent failure in `rpc_setban.py --v2transport` (Kittywhiskers Van Gogh)
e2788189fd merge bitcoin#29352: fix intermittent failure in p2p_v2_earlykeyresponse (Kittywhiskers Van Gogh)
6b2a8b5988 merge bitcoin#24748: functional tests for v2 P2P encryption (Kittywhiskers Van Gogh)
32500f2acd merge bitcoin#27653: add unit test coverage for Python ECDSA implementation (Kittywhiskers Van Gogh)
9f476c6775 net: add Dash network message short IDs, allocate range 128 onwards (Kittywhiskers Van Gogh)

Pull request description:

  ## Additional Information

  * Depends on https://github.com/dashpay/dash/pull/6329

  * Dash-specific P2P messages have been allocated short IDs after 128 based on a prior suggestion ([source](https://github.com/dashpay/dash/pull/6280#issuecomment-2361453862)) as there are 255 potential short IDs (ID `0` is reserved for V1 fallback, [source](a7bbcc823d/src/net.cpp (L1019))) and upstream uses 28 short IDs (though Dash has left ID `5` blank as we do not implement the `FEEFILTER` message, [source](a7bbcc823d/src/net.cpp (L1024))).

    As it is unlikely that upstream will utilize more than 127 short IDs (and the spec refers to IDs after 32 as "undefined", [source](52894e1aa7/bip-0324.mediawiki (v2-bitcoin-p2p-message-structure))), there shouldn't be an adverse effect to utilizing IDs >=128. The unified array of short IDs are accessible through `V2ShortIDs()`.

    * As there are checks to see if an ID *can* be valid by checking against the array size (which wouldn't work here as we create an array of 256 entries combining both upstream and Dash's allocated short IDs, filling the rest with blank values and we cannot ignore blank values to know if a value is unallocated as the blanking could also signal a reservation, [source](a7bbcc823d/src/net.cpp (L1048-L1052))), such a check needs to be done by using `IsValidV2ShortID()`.
    * `V2ShortIDs()` isn't as elegant as desired as `std::fill` and `std::copy` are not `constexpr` until C++20 ([source](https://en.cppreference.com/w/cpp/algorithm/fill), [source](https://en.cppreference.com/w/cpp/algorithm/copy)) and until we drop C++17 support, we have to be mindful of that.

  * `masternode connect` will now _attempt_ to establish a P2Pv2 connection if the node *initiating* the connection has opted-in using the new argument (`v2transport`) and the node was started with P2Pv2 enabled (using the launch argument, `-v2transport`).

    This mirrors changes to behavior to `addconnection` introduced in [bitcoin#24748](https://github.com/bitcoin/bitcoin/pull/24748)

  * The oversized payload test in `p2p_invalid_messages.py` will expect an excessively large message of size of `3145729` bytes (and in P2Pv2, `3145742` bytes), as opposed to upstream's `4000001` and `4000014` bytes respectively as Dash has a lower protocol limit of 3MiB ([source](a7bbcc823d/src/net.h (L80-L81))) vs Bitcoin's 4MB ([source](225718eda8/src/net.h (L62-L63)))

  ## Breaking Changes

  None expected.

  ## Checklist:

  - [x] I have performed a self-review of my own code
  - [x] I have commented my code, particularly in hard-to-understand areas
  - [x] I have added or updated relevant unit/integration/functional/e2e tests
  - [x] I have made corresponding changes to the documentation **(note: N/A)**
  - [x] I have assigned this pull request to a milestone _(for repository code-owners and collaborators only)_

ACKs for top commit:
  PastaPastaPasta:
    utACK 4735b82979
  UdjinM6:
    light ACK 4735b82979

Tree-SHA512: 4a9d586133633c109e6a8f20a6c6c5e4b24185fb616bcd8568e546b6e9f886e7a8707e811fd070bbe32c40df269f89a56343a24b67242c6147f9df27275af599
2024-10-24 11:14:57 -05:00
pasta
dda9b73ac8
Merge #6355: fix: fetch PR head before merging it in Check Merge Fast-Forward Only action
c3aae9e165 fix: fetch PR head before merging it in "check ff" (UdjinM6)

Pull request description:

  ## Issue being fixed or feature implemented
  ```
  v Run git fetch origin master:master
    git fetch origin master:master
    git checkout master
    if [[ "pull_request_target" == "pull_request"* ]]; then
      git merge --ff-only b216a402cc58cb153bebe137064fd0c804752d21
    else
      git merge --ff-only 3a18f087bf
    fi
    shell: /usr/bin/bash -e {0}
  From https://github.com/dashpay/dash
   * [new branch]          master     -> master
  Switched to branch 'master'
  merge: b216a402cc58cb153bebe137064fd0c804752d21 - not something we can merge
  Error: Process completed with exit code 1.
  ```
  https://github.com/dashpay/dash/actions/runs/11492009432/job/31999602262?pr=6346

  So it's picking the right commit sha now but it has no commit itself.

  #6344 follow-up

  ## What was done?

  ## How Has This Been Tested?

  ## Breaking Changes

  ## Checklist:
  - [ ] I have performed a self-review of my own code
  - [ ] I have commented my code, particularly in hard-to-understand areas
  - [ ] I have added or updated relevant unit/integration/functional/e2e tests
  - [ ] I have made corresponding changes to the documentation
  - [ ] I have assigned this pull request to a milestone _(for repository code-owners and collaborators only)_

ACKs for top commit:
  PastaPastaPasta:
    utACK c3aae9e165

Tree-SHA512: 6a50d3ad40ac54aa919e970b9509e78aa61dbdfc9211e8837b5bf470ee8f0b1b68f53d082d04e8e6f375bd0bb62d92951f69cde5985b6fd1482a0cd531abf8ba
2024-10-24 10:36:04 -05:00
pasta
011f8c421c
Merge #6326: backport: bitcoin#20191, #20791, #21345, #21563, #22153, #22376, #22461, bitcoin-core/gui#365, bitcoin-core/gui#375, partial bitcoin#20755
24c01934a2 fix: small fixup for bitcoin#14918 and bitcoin#21679 (Konstantin Akimov)
f358f2bcdd Merge bitcoin-core/gui#375: Emit dataChanged signal to dynamically re-sort Peers table (Hennadii Stepanov)
7aeb0adeb9 Merge bitcoin-core/gui#365: Draw "eye" sign at the beginning of watch-only addresses (Hennadii Stepanov)
c52a582a3f refactor: re-order conditions over flags for m_edge_trig_events - follow-up for bitcoin#21563 (Konstantin Akimov)
6ed62b323c Merge bitcoin/bitcoin#21563: net: Restrict period when cs_vNodes mutex is locked (MarcoFalke)
16052f10ae Merge #20791: p2p: remove unused legacyWhitelisted in AcceptConnection() (MarcoFalke)
42d4f9a9b9 partial Merge #20755: [rpc] Remove deprecated fields from getpeerinfo (MarcoFalke)
cba01aa8f9 Merge bitcoin/bitcoin#20191: wallet, refactor: make DescriptorScriptPubKeyMan agnostic of internal flag (fanquake)
397fe9c0a5 Merge bitcoin/bitcoin#22461: wallet: Change ScriptPubKeyMan::Upgrade default to True (Samuel Dobson)
97f0d91d3e Merge bitcoin/bitcoin#22376: ci: Do not clone `bitcoin-core/qa-assets` git repository if not necessary (MarcoFalke)
0698be3680 Merge bitcoin/bitcoin#22153: test: Fix p2p_leak.py intermittent failure (MarcoFalke)
58b95338eb Merge #21345: test: bring p2p_leak.py up to date (MarcoFalke)

Pull request description:

  ## Issue being fixed or feature implemented
  Regular backports from bitcoin v22

  ## What was done?

  See commits for list of backports.
  bitcoin#20755 is partial because we need `banscore` for functional test `p2p_quorum_data.py`.

  Also several minor fixes for:
   - default args (bitcoin#14918, bitcoin#21679)
   - fixes for CNode::CloseSocketDisconnect (related to bitcoin/bitcoin#21563)
   - minor refactoring of m_edge_trig_events (related to bitcoin/bitcoin#21563)
   - missing executable flags for functional tests

  ## How Has This Been Tested?
  Run unit and functional tests.
  See also a screenshot:
  ![image](https://github.com/user-attachments/assets/a994bb6a-f31e-4083-9d15-56a20c470da8)

  ## Breaking Changes
  ```
  Updated RPCs
  - `getpeerinfo` no longer returns the following fields: `addnode`,
    and `whitelisted`, which were previously deprecated in v21. Instead of
    `addnode`, the `connection_type` field returns manual. Instead of
    `whitelisted`, the `permissions` field indicates if the peer has special
    privileges.
  ```

  ## Checklist:
  - [x] I have performed a self-review of my own code
  - [ ] I have commented my code, particularly in hard-to-understand areas
  - [ ] I have added or updated relevant unit/integration/functional/e2e tests
  - [ ] I have made corresponding changes to the documentation
  - [x] I have assigned this pull request to a milestone

ACKs for top commit:
  PastaPastaPasta:
    utACK 24c01934a2
  UdjinM6:
    utACK 24c01934a2

Tree-SHA512: d457e7a63bef3edb7bbb82e54deb72e57b021ea74d40f05c5a2fca2253e97919531a3e35936851ac9ca88e9ee94f2f299dae979c53904596b8a489ebf9cd9aa6
2024-10-24 10:35:17 -05:00
pasta
4de1235e81
Merge #6332: backport: merge bitcoin#23114, #24262, #25502, #26373 (add sipa/minisketch as vendored dependency)
e56482bd91 merge bitcoin#26373: Update minisketch subtree to latest upstream (Kittywhiskers Van Gogh)
1c94f1a3c3 Squashed 'src/minisketch/' changes from 47f0a2d26f..a571ba20f9 (Kittywhiskers Van Gogh)
94f81fae35 merge bitcoin#25502: update minisketch subtree (Kittywhiskers Van Gogh)
4655944656 Squashed 'src/minisketch/' changes from 7eeb778fef..47f0a2d26f (Kittywhiskers Van Gogh)
807f09ac7c merge bitcoin#24262: Update minisketch subtree (Kittywhiskers Van Gogh)
2a7b57f57e Squashed 'src/minisketch/' changes from 89629eb2c7..7eeb778fef (Kittywhiskers Van Gogh)
a6b26b5dc1 merge bitcoin#23114: Add minisketch subtree and integrate into build/test (Kittywhiskers Van Gogh)
d71dfabc41 Squashed 'src/minisketch/' content from commit 89629eb2c7 (Kittywhiskers Van Gogh)

Pull request description:

  ## Additional Information

  * Dependency for https://github.com/dashpay/dash/pull/6333

  ## Breaking Changes

  None expected

  ## Checklist

  - [x] I have performed a self-review of my own code
  - [x] I have commented my code, particularly in hard-to-understand areas **(note: N/A)**
  - [x] I have added or updated relevant unit/integration/functional/e2e tests
  - [x] I have made corresponding changes to the documentation
  - [x] I have assigned this pull request to a milestone _(for repository code-owners and collaborators only)_

ACKs for top commit:
  PastaPastaPasta:
    utACK e56482bd91
  UdjinM6:
    utACK e56482bd91

Tree-SHA512: a13dbfb4eefbf43917df9ae1a154758120dc8e3d511e846311fce46b1c81b878dadcea07476600b406f94201c677706366ce5984a3466e75744f823a529fc622
2024-10-24 10:19:22 -05:00
Kittywhiskers Van Gogh
4735b82979
merge bitcoin#29431: disconnection scenarios during v2 handshake 2024-10-24 14:32:05 +00:00
Kittywhiskers Van Gogh
cc6b88ee37
merge bitcoin-core/gui#788: update session ID tooltip 2024-10-24 14:32:04 +00:00
Kittywhiskers Van Gogh
2455862c9f
merge bitcoin#29390: speedup bip324_cipher.py unit test 2024-10-24 14:32:04 +00:00
Kittywhiskers Van Gogh
062aaf11e4
merge bitcoin#29511: Fix intermittent failure in rpc_net.py --v2transport 2024-10-24 14:32:04 +00:00
Kittywhiskers Van Gogh
54972e8fa0
merge bitcoin#29358: use v2 everywhere for P2PConnection if --v2transport is enabled 2024-10-24 14:32:04 +00:00
Kittywhiskers Van Gogh
4cce72fc3e
test: add missing debug log assertion in p2p_invalid_messages.py 2024-10-24 14:32:04 +00:00
Kittywhiskers Van Gogh
bd2fe6103d
merge bitcoin#29460: assert rpc error for addnode v2transport not enabled 2024-10-24 14:32:04 +00:00