Commit Graph

24107 Commits

Author SHA1 Message Date
MarcoFalke
c4234a5e78 Merge #18451: test: shift coverage from getunconfirmedbalance to getbalances
0306d78cb49d1684cc96ba3512b582a1fdaf78cc Use getbalances in wallet_address_types tests (Jon Atack)
7eacdc5167c8db94df84e206db85817bc64e4921 Shift coverage from getunconfirmedbalance to getbalances in wallet_abandonconflict tests (Jon Atack)
3e6f7377f600e47e5e3d439fc5d6ccf3db210038 Improve getbalances coverage in wallet_balance tests (Jon Atack)

Pull request description:

  <strike>This PR updates several tests and then removes the `getunconfirmedbalance` RPC which was deprecated in facfb4111d14a3b06c46690a2cca7ca91cea8a96 a year ago.

  Next steps: remove the deprecated `getwalletinfo` fields and the `getbalance` RPC in follow-ups, if there seems to be consensus on those removals.</strike>

  Update:

  `getunconfirmedbalance` RPC was deprecated in facfb4111d14a3b06c46690a2cca7ca91cea8a96 a year ago, but following the review comments below, this PR now only updates the test coverage to use `getbalances` while still leaving basic coverage for `getunconfirmedbalance` in wallet_balance.py.

  That said, I've seen 3 regular contributors confused in the past 10 days by "DEPRECATED" warnings in the code that are not following the deprecation policy in [JSON-RPC-interface.md#versioning](https://github.com/bitcoin/bitcoin/blob/master/doc/JSON-RPC-interface.md#versioning).

  ISTM these warnings should either be removed, or the calls deprecated (`-deprecatedrpc`), or the policy updated to describe these warnings as a pre-deprecation practice.

ACKs for top commit:
  jnewbery:
    utACK 0306d78cb

Tree-SHA512: 692e43e9bed5afa97d905740666e365f0b64e559e1c75a6a398236d9e943894e3477947fc11324f420a6feaffa0c0c1532aa983c50090ca39d06551399e6ddd1
2023-08-29 22:00:59 -05:00
MarcoFalke
05d4f0bb10 Merge #18646: gui: use PACKAGE_NAME in exception message
1b04302e43c91cf2353c545e646e50a672eab300 gui: use PACKAGE_NAME in exception message (fanquake)

Pull request description:

  Should address [this comment](https://github.com/bitcoin/bitcoin/issues/18643#issuecomment-613761345).

  ![qt_exception](https://user-images.githubusercontent.com/863730/79310875-348bf780-7f2f-11ea-9970-ba1ac28c7849.png)

  Can be triggered with a diff like:
  ```diff
  diff --git a/src/qt/modaloverlay.cpp b/src/qt/modaloverlay.cpp
  index 6243a71c7..e5d499012 100644
  --- a/src/qt/modaloverlay.cpp
  +++ b/src/qt/modaloverlay.cpp
  @@ -6,6 +6,7 @@
   #include <qt/forms/ui_modaloverlay.h>

   #include <qt/guiutil.h>
  +#include <util/check.h>

   #include <chainparams.h>

  @@ -179,6 +180,7 @@ void ModalOverlay::showHide(bool hide, bool userRequested)

   void ModalOverlay::closeClicked()
   {
  +    CHECK_NONFATAL(false);
       showHide(true);
       userClosed = true;
   }
  ```
  and clicking close in the modal.
  ```bash
  EXCEPTION: 18NonFatalCheckError
  qt/modaloverlay.cpp:183 (closeClicked)
  Internal bug detected: 'false'
  You may report this issue here: https://github.com/bitcoin/bitcoin/issues
  ```

ACKs for top commit:
  jonasschnelli:
    Thanks. utACK 1b04302e43c91cf2353c545e646e50a672eab300
  emilengler:
    utACK 1b04302
  hebasto:
    ACK 1b04302e43c91cf2353c545e646e50a672eab300.

Tree-SHA512: 20118269882fbbb5602dafe8101c6ca6c92d7b97efc1ef280a68a83c6a58340018d05f837ecabefee618dc11a62e82828d5ecde4350a71a4c2fd24257b90d45c
2023-08-29 22:00:59 -05:00
MarcoFalke
2d4db48606 Merge #18581: ci: Print ccache stats, add pip cache, and cleanups
73f83036298e4932772704b2d5359c78d81bd7cc ci: Add pip cache (Hennadii Stepanov)
6d480667b24dc630e7c3fe7ff032cbe1a958ab77 ci: Print ccache statistics summary (Hennadii Stepanov)
a6eea715ff549febe6d4bd52f17acb50abd99120 ci: Drop unused WINEDEBUG variable (Hennadii Stepanov)

Pull request description:

  The Travis [pip cache](https://docs.travis-ci.com/user/caching/#pip-cache) is free and saves a dozen of seconds :)

  Here are some excerpts from the Travis logs with `ccache` statistics (I found useful):

  2) [Arm64](https://travis-ci.org/github/bitcoin/bitcoin/jobs/673507749)
  ```
  ccache version 3.6
  cache directory                     /home/travis/build/bitcoin/bitcoin/ci/scratch/.ccache
  primary config                      /home/travis/build/bitcoin/bitcoin/ci/scratch/.ccache/ccache.conf
  secondary config      (readonly)    /etc/ccache.conf
  stats updated                       Fri Apr 10 18:21:06 2020
  stats zeroed                        Fri Apr 10 18:03:04 2020
  cache hit (direct)                   156
  cache hit (preprocessed)             198
  cache miss                           143
  cache hit rate                     71.23 %
  called for link                        8
  cleanups performed                     9
  files in cache                      1255
  cache size                          80.6 MB
  max cache size                     100.0 MB
  ```
  3) [s390x](https://travis-ci.org/github/bitcoin/bitcoin/jobs/673507750)
  ```
  ccache version 3.4.1
  cache directory                     /home/travis/build/bitcoin/bitcoin/ci/scratch/.ccache
  primary config                      /home/travis/build/bitcoin/bitcoin/ci/scratch/.ccache/ccache.conf
  secondary config      (readonly)    /etc/ccache.conf
  stats zero time                     Fri Apr 10 17:15:35 2020
  cache hit (direct)                   115
  cache hit (preprocessed)             163
  cache miss                            94
  cache hit rate                     74.73 %
  called for link                        6
  cleanups performed                     0
  files in cache                       804
  cache size                         304.8 MB
  max cache size                       5.0 GB
  ```
  4) [Win64](https://travis-ci.org/github/bitcoin/bitcoin/jobs/673507751)
  ```
  ccache version 3.4.1
  cache directory                     /home/travis/build/bitcoin/bitcoin/ci/scratch/.ccache
  primary config                      /home/travis/build/bitcoin/bitcoin/ci/scratch/.ccache/ccache.conf
  secondary config      (readonly)    /etc/ccache.conf
  stats zero time                     Fri Apr 10 17:38:07 2020
  cache hit (direct)                   147
  cache hit (preprocessed)             199
  cache miss                           138
  cache hit rate                     71.49 %
  called for link                        7
  cleanups performed                     7
  files in cache                      1242
  cache size                          87.0 MB
  max cache size                     100.0 MB
  ```
  5) [CentOS 7](https://travis-ci.org/github/bitcoin/bitcoin/jobs/673507752)
  ```
  ccache version 3.7.7
  cache directory                     /home/travis/build/bitcoin/bitcoin/ci/scratch/.ccache
  primary config                      /home/travis/build/bitcoin/bitcoin/ci/scratch/.ccache/ccache.conf
  secondary config      (readonly)    /etc/ccache.conf
  stats updated                       Fri Apr 10 17:45:59 2020
  stats zeroed                        Fri Apr 10 17:34:27 2020
  cache hit (direct)                   152
  cache hit (preprocessed)             200
  cache miss                           144
  cache hit rate                     70.97 %
  called for link                        8
  cleanups performed                     4
  files in cache                      1352
  cache size                          86.1 MB
  max cache size                     100.0 MB
  ```
  6) [bionic](https://travis-ci.org/github/bitcoin/bitcoin/jobs/673507753)
  ```
  ccache version 3.4.1
  cache directory                     /home/travis/build/bitcoin/bitcoin/ci/scratch/.ccache
  primary config                      /home/travis/build/bitcoin/bitcoin/ci/scratch/.ccache/ccache.conf
  secondary config      (readonly)    /etc/ccache.conf
  stats zero time                     Fri Apr 10 17:21:10 2020
  cache hit (direct)                   136
  cache hit (preprocessed)              35
  cache miss                           330
  cache hit rate                     34.13 %
  called for link                        8
  cleanups performed                    18
  files in cache                      1302
  cache size                          83.8 MB
  max cache size                     100.0 MB
  ```
  7) [xenial](https://travis-ci.org/github/bitcoin/bitcoin/jobs/673507754)
  ```
  ccache version 3.2.4
  cache directory                     /home/travis/build/bitcoin/bitcoin/ci/scratch/.ccache
  primary config                      /home/travis/build/bitcoin/bitcoin/ci/scratch/.ccache/ccache.conf
  secondary config      (readonly)    /etc/ccache.conf
  cache hit (direct)                   161
  cache hit (preprocessed)             174
  cache miss                            95
  called for link                        7
  files in cache                      3411
  cache size                           1.1 GB
  max cache size                       5.0 GB
  ```
  10) [focal](https://travis-ci.org/github/bitcoin/bitcoin/jobs/673507757)
  ```
  ccache version 3.7.7
  cache directory                     /home/travis/build/bitcoin/bitcoin/ci/scratch/.ccache
  primary config                      /home/travis/build/bitcoin/bitcoin/ci/scratch/.ccache/ccache.conf
  secondary config      (readonly)    /etc/ccache.conf
  stats updated                       Fri Apr 10 17:35:57 2020
  stats zeroed                        Fri Apr 10 17:21:32 2020
  cache hit (direct)                    78
  cache hit (preprocessed)             125
  cache miss                           107
  cache hit rate                     65.48 %
  called for link                      120
  cleanups performed                     0
  files in cache                      6218
  cache size                           1.8 GB
  max cache size                       5.0 GB
  ```
  14) [macOS 10.12](https://travis-ci.org/github/bitcoin/bitcoin/jobs/673507761)
  ```
  ccache version 3.4.1
  cache directory                     /home/travis/build/bitcoin/bitcoin/ci/scratch/.ccache
  primary config                      /home/travis/build/bitcoin/bitcoin/ci/scratch/.ccache/ccache.conf
  secondary config      (readonly)    /etc/ccache.conf
  stats zero time                     Fri Apr 10 17:47:19 2020
  cache hit (direct)                    28
  cache hit (preprocessed)               1
  cache miss                           469
  cache hit rate                      5.82 %
  called for link                        8
  cleanups performed                    17
  files in cache                      1946
  cache size                          82.6 MB
  max cache size                     100.0 MB
  ```
  15) [macOS 10.14 native](https://travis-ci.org/github/bitcoin/bitcoin/jobs/673507762)
  ```
  ccache version 3.7.8
  cache directory                     /Users/travis/build/bitcoin/bitcoin/ci/scratch/.ccache
  primary config                      /Users/travis/build/bitcoin/bitcoin/ci/scratch/.ccache/ccache.conf
  secondary config      (readonly)    /usr/local/Cellar/ccache/3.7.8/etc/ccache.conf
  stats updated                       Fri Apr 10 17:38:44 2020
  stats zeroed                        Fri Apr 10 17:22:36 2020
  cache hit (direct)                   213
  cache hit (preprocessed)             293
  cache miss                           144
  cache hit rate                     77.85 %
  called for link                       11
  called for preprocessing              56
  compile failed                        30
  preprocessor error                    56
  bad compiler arguments                14
  autoconf compile/link                 77
  no input file                         66
  cleanups performed                     0
  files in cache                      1564
  cache size                         284.6 MB
  max cache size                       5.0 GB
  ```

Top commit has no ACKs.

Tree-SHA512: f9f2c6d72680bafc7a982efc04dc37ab9bba77ffd2a4cbbc56bb0e86c5c3501d57aa2f0ebeac0113e9d8daac1ee4eac1eddf74c1172c267b37ee2d9324366c8a
2023-08-29 22:00:59 -05:00
Konstantin Akimov
4aa197dbdb Merge #18673: scripted-diff: Sort test includes
fa4632c41714dfaa699bacc6a947d72668a4deef test: Move boost/stdlib includes last (MarcoFalke)
fa488f131fd4f5bab0d01376c5a5013306f1abcd scripted-diff: Bump copyright headers (MarcoFalke)
fac5c373006a9e4bcbb56843bb85f1aca4d87599 scripted-diff: Sort test includes (MarcoFalke)

Pull request description:

  When writing tests, often includes need to be added or removed. Currently the list of includes is not sorted, so developers that write tests and have `clang-format` installed will either have an unrelated change (sorting) included in their commit or they will have to manually undo the sort.

  This pull preempts both issues by just sorting all includes in one commit.

  Please be aware that this is **NOT** a change to policy to enforce clang-format or any other developer guideline or process. Developers are free to use whatever tool they want, see also #18651.

  Edit: Also includes a commit to bump the copyright headers, so that the touched files don't need to be touched again for that.

ACKs for top commit:
  practicalswift:
    ACK fa4632c41714dfaa699bacc6a947d72668a4deef
  jonatack:
    ACK fa4632c41714dfaa, light review and sanity checks with gcc build and clang fuzz build

Tree-SHA512: 130a8d073a379ba556b1e64104d37c46b671425c0aef0ed725fd60156a95e8dc83fb6f0b5330b2f8152cf5daaf3983b4aca5e75812598f2626c39fd12b88b180
2023-08-29 22:00:59 -05:00
MarcoFalke
59c157faaa Merge #18504: build: Drop bitcoin-tx and bitcoin-wallet dependencies on libevent
01a3392b1b778fa4fcf568013326d6ea1de4fb3b Drop bitcoin-wallet dependency on libevent (Russell Yanofsky)
0660119ac372c2863d14060ac1bc9bc243771f94 Drop unintended bitcoin-tx dependency on libevent (Russell Yanofsky)

Pull request description:

  This fixes compile errors trying to build bitcoin-tx and bitcoin-wallet without libevent, which were reported by Luke Dashjr in https://github.com/bitcoin/bitcoin/issues/18465

  The fix avoiding `bitcoin-tx` dependency on libevent just adds a conditional build rule. This is implemented in the first commit (more details in commit description).

  The fix avoiding `bitcoin-wallet` dependency on libevent requires minor code changes, because `bitcoin-wallet` (unlike `bitcoin-tx`) links against code that calls `urlDecode` / `evhttp_uridecode`. This fix is implemented in the second commit (again details in the commit description).

ACKs for top commit:
  jonasschnelli:
    utACK 01a3392b1b778fa4fcf568013326d6ea1de4fb3b.

Tree-SHA512: d2245e912ab494cccceeb427a1eca8e55b01a0006ff93eebcfb5461ae7cecd1083ac2de443d9db036b18bdc6f0fb615546caaa20c585046f66d234937f74870a
2023-08-29 22:00:59 -05:00
PastaPastaPasta
2b32dd6394
Merge pull request #5548 from kwvg/fuzz6
backport: merge bitcoin#19143, #20377, #20946, #20936, #21226, #21264, #19259, #21380, #21489, #19288, #19055, #20882, #21185, #21115, partial bitcoin#11389 (fuzzing harness backports: part 6)
2023-08-29 21:56:14 -05:00
Kittywhiskers Van Gogh
6dac5dd2e0 merge bitcoin#21115: Fix Windows cross build 2023-08-29 21:55:45 -05:00
Kittywhiskers Van Gogh
bf15aad73f merge bitcoin#21185: Remove expensive and redundant muhash from crypto fuzz target 2023-08-29 21:55:45 -05:00
Kittywhiskers Van Gogh
32a3ed3b60 merge bitcoin#20882: Add missing muhash registration 2023-08-29 21:55:45 -05:00
Kittywhiskers Van Gogh
3b25c5e84e merge bitcoin#19055: Add MuHash3072 implementation
contains:
- b111410914041b72961536c3e4037eba103a8085
- 01297fb3ca57e4b8cbc5a89fc7c6367de33b0bc6

completes:
- c7eb44a911 (from dash#4704)
2023-08-29 21:55:45 -05:00
Kittywhiskers Van Gogh
04fabaa1bd merge bitcoin#19288: Add fuzzing harness for TorController 2023-08-29 21:55:45 -05:00
Kittywhiskers Van Gogh
5c1173ef9b merge bitcoin#21489: cleanups for versionbits fuzzer 2023-08-29 21:55:45 -05:00
Kittywhiskers Van Gogh
ac5330bf66 merge bitcoin#21380: Add fuzzing harness for versionbits 2023-08-29 21:55:45 -05:00
Kittywhiskers Van Gogh
e1d3be4adc partial bitcoin#11389: Support having SegWit always active in regtest
excludes:
- d618458184
2023-08-29 21:55:45 -05:00
Kittywhiskers Van Gogh
b60ab41f8c test: fix comments mangled by text search-and-replace 2023-08-29 21:55:45 -05:00
Kittywhiskers Van Gogh
11753e64e7 merge bitcoin#19259: Add fuzzing harness for LoadMempool(...) and DumpMempool(...) 2023-08-29 21:55:45 -05:00
Kittywhiskers Van Gogh
30b9d66789 merge bitcoin#21264: Two scripted diff renames 2023-08-29 21:55:45 -05:00
Kittywhiskers Van Gogh
3b589cb2e4 merge bitcoin#21226: Fix fuzz binary compilation under windows 2023-08-29 21:55:45 -05:00
Kittywhiskers Van Gogh
231a914a55 wallet: move hdwallet.cpp to libbitcoin_wallet.a
Required to resolve link failures:

```
/usr/bin/ld: /usr/bin/ld: DWARF error: invalid or unhandled FORM value: 0x25
libbitcoin_wallet.a(libbitcoin_wallet_a-rpcwallet.o): in function `getwalletinfo(JSONRPCRequest const&)':
rpcwallet.cpp:(.text+0x4db2d): undefined reference to `CHDChain::CountAccounts()'
/usr/bin/ld: rpcwallet.cpp:(.text+0x4dc15): undefined reference to `CHDChain::CountAccounts()'
/usr/bin/ld: rpcwallet.cpp:(.text+0x4dd42): undefined reference to `CHDChain::GetAccount(unsigned int, CHDAccount&)'
/usr/bin/ld: /usr/bin/ld: DWARF error: invalid or unhandled FORM value: 0x25
libbitcoin_wallet.a(libbitcoin_wallet_a-scriptpubkeyman.o): in function `LegacyScriptPubKeyMan::CheckDecryptionKey(std::vector<unsigned char, secure_allocator<unsigned char> > const&, bool)':
scriptpubkeyman.cpp:(.text+0x1041): undefined reference to `CHDChain::IsNull() const'
/usr/bin/ld: scriptpubkeyman.cpp:(.text+0x1058): undefined reference to `CHDChain::IsNull() const'
/usr/bin/ld: scriptpubkeyman.cpp:(.text+0x11a9): undefined reference to `CHDChain::GetSeedHash()'
/usr/bin/ld: libbitcoin_wallet.a(libbitcoin_wallet_a-scriptpubkeyman.o): in function `LegacyScriptPubKeyMan::DecryptHDChain(std::vector<unsigned char, secure_allocator<unsigned char> > const&, CHDChain&) const':
[...]
rpcdump.cpp:(.text+0x216d8): undefined reference to `CHDChain::GetMnemonic(std::__cxx11::basic_string<char, std::char_traits<char>, secure_allocator<char> >&, std::__cxx11::basic_string<char, std::char_traits<char>, secure_allocator<char> >&) const'
/usr/bin/ld: rpcdump.cpp:(.text+0x217a3): undefined reference to `CHDChain::GetSeed() const'
/usr/bin/ld: rpcdump.cpp:(.text+0x21a44): undefined reference to `CHDChain::CountAccounts()'
/usr/bin/ld: rpcdump.cpp:(.text+0x21a6e): undefined reference to `CHDChain::GetAccount(unsigned int, CHDAccount&)'
/usr/bin/ld: rpcdump.cpp:(.text+0x21b80): undefined reference to `CHDChain::CountAccounts()'
clang: error: linker command failed with exit code 1 (use -v to see invocation)
```
2023-08-29 21:55:45 -05:00
Kittywhiskers Van Gogh
dcd7babd80 merge bitcoin#20936: build fuzz tests by default 2023-08-29 21:55:45 -05:00
Kittywhiskers Van Gogh
4b00e08707 merge bitcoin#20946: Consolidate fuzzing TestingSetup initialization 2023-08-29 21:55:45 -05:00
Kittywhiskers Van Gogh
7c77a8c9c4 merge bitcoin#20377: Fill various small fuzzing gaps 2023-08-29 21:55:45 -05:00
Kittywhiskers Van Gogh
ed5c750fb6 merge bitcoin#19143: Add fuzzing harnesses for CAutoFile, CBufferedFile, LoadExternalBlockFile and other FILE* consumers
includes:
- ad6c34881dc125c973b6b9ba1daa999d3141b1ae
2023-08-29 21:55:45 -05:00
PastaPastaPasta
27eeceac4d
Merge pull request #5523 from vijaydasmp/bp22_12
backport: Merge bitcoin#20816,20844,20584,14501,18669
2023-08-29 21:41:59 -05:00
Wladimir J. van der Laan
2bacbcf1fd Merge #14501: Fix possible data race when committing block files
ef712298c3f8bc2afdad783f05080443b72b3f77 util: Check for file being NULL in DirectoryCommit (Luke Dashjr)
457490403853321d308c6ca6aaa90d6f8f29b4cf Fix possible data race when committing block files (Evan Klitzke)
220bb16cbee5b91d0bc0fcc6c71560d631295fa5 util: Introduce DirectoryCommit commit function to sync a directory (Evan Klitzke)
ce5cbaea63ad4ea78e533bdb14f47f414061ae7f util.h: Document FileCommit function (Evan Klitzke)
844d650eea3bd809884cc5dd996a388bdc58314e util: Prefer Mac-specific F_FULLSYNC over fdatasync in FileCommit (Evan Klitzke)
f6cec0bcaf560fa310853ad3fe17022602b63d5f util: Refactor FileCommit from an #if sequence nested in #else, to a sequence of #elif (Evan Klitzke)

Pull request description:

  Reviving #12696

ACKs for top commit:
  laanwj:
    Code review ACK ef712298c3f8bc2afdad783f05080443b72b3f77

Tree-SHA512: 07d650990ef4c18d645dee3f9a199a940683ad17557d79d93979a76c4e710d8d70e6eae01d1a5991494a24a7654eb7db868be0c34a31e70b2509945d95bc9cce
2023-08-29 21:40:46 -05:00
MarcoFalke
a298eb2b93 Merge #20584: Declare de facto const reference variables/member functions as const
31b136e5802e1b1e5f9a9589736afe0652f34da2 Don't declare de facto const reference variables as non-const (practicalswift)
1c65c075ee4c7f98d9c1fac5ed7576b96374d4e9 Don't declare de facto const member functions as non-const (practicalswift)

Pull request description:

  _Meta: This is the second and final part of the `const` refactoring series (part one: #20581). **I promise: no more refactoring PRs from me in a while! :)** I'll now go back to focusing on fuzzing/hardening!_

  Changes in this PR:
  * Don't declare de facto const member functions as non-const
  * Don't declare de facto const reference variables as non-const

  Awards for finding candidates for the above changes go to:
  * `clang-tidy`'s [`readability-make-member-function-const`](https://clang.llvm.org/extra/clang-tidy/checks/readability-make-member-function-const.html)  check ([list of `clang-tidy` checks](https://clang.llvm.org/extra/clang-tidy/checks/list.html))
  * `cppcheck`'s `constVariable` check ([list of `cppcheck` checks](https://sourceforge.net/p/cppcheck/wiki/ListOfChecks/))

  See #18920 for instructions on how to analyse Bitcoin Core using Clang Static Analysis, `clang-tidy` and `cppcheck`.

ACKs for top commit:
  ajtowns:
    ACK 31b136e5802e1b1e5f9a9589736afe0652f34da2
  jonatack:
    ACK 31b136e5802e1b1e5f9a9589736afe0652f34da2
  theStack:
    ACK 31b136e5802e1b1e5f9a9589736afe0652f34da2 ❄️

Tree-SHA512: f58f8f00744219426874379e9f3e9331132b9b48e954d24f3a85cbb858fdcc98009ed42ef7e7b4619ae8af9fc240a6d8bfc1c438db2e97b0ecd722a80dcfeffe
2023-08-29 21:40:46 -05:00
MarcoFalke
e554d3a02e Merge #18669: log: Use Join() helper when listing log categories
faec0638872798b58b9882ee079014555bc8393e log: Use Join() helper when listing log categories (MarcoFalke)

Pull request description:

  This removes the global `ListLogCategories` and replaces it with a one-line member function `LogCategoriesString`, which just calls `Join`.

  Should be a straightforward refactor to get rid of a few LOC.

ACKs for top commit:
  laanwj:
    ACK faec0638872798b58b9882ee079014555bc8393e
  promag:
    ACK faec0638872798b58b9882ee079014555bc8393e, I also think it's fine as it is (re https://github.com/bitcoin/bitcoin/pull/18669#discussion_r412944724).

Tree-SHA512: 2f51f9ce1246eda5630015f3a869e36953c7eb34f311baad576b92d7829e4e88051c6189436271cd0a13732a49698506345b446b98fd28e58edfb5b62169f1c9
2023-08-29 21:40:46 -05:00
Wladimir J. van der Laan
069624dd62 Merge #20844: test: Add sanitizer suppressions for AMD EPYC CPUs
fa6c114ae604571435e8c4d25906a8b6d5b9984c test: Add sanitizer suppressions for AMD EPYC CPUs (MarcoFalke)

Pull request description:

  Currently the ci system only runs on intel cpus (and some arm devices), but it won't run on CPUs `Using the 'shani(1way,2way)' SHA256 implementation` (excerpt from debug log).

  For reference, google cloud CPUs (which is what Cirrus CI uses) print `Using the 'sse4(1way),sse41(4way),avx2(8way)' SHA256 implementation`

  The traceback I got:

  ```
  crypto/sha256_shani.cpp:87:18: runtime error: unsigned integer overflow: 0 - 1 cannot be represented in type 'size_t' (aka 'unsigned long')
      #0 0x55c0000e95ec in sha256_shani::Transform(unsigned int*, unsigned char const*, unsigned long) /root/bitcoin/ci/scratch/build/bitcoin-x86_64-pc-linux-gnu/src/crypto/sha256_shani.cpp:87:18
      #1 0x55bfffb926f8 in (anonymous namespace)::SelfTest() /root/bitcoin/ci/scratch/build/bitcoin-x86_64-pc-linux-gnu/src/crypto/sha256.cpp:517:9
      #2 0x55bfffb906ed in SHA256AutoDetect[abi:cxx11]() /root/bitcoin/ci/scratch/build/bitcoin-x86_64-pc-linux-gnu/src/crypto/sha256.cpp:626:5
      #3 0x55bfff87ab97 in BasicTestingSetup::BasicTestingSetup(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::vector<char const*, std::allocator<char const*> > const&) /root/bitcoin/ci/scratch/build/bitcoin-x86_64-pc-linux-gnu/src/test/util/setup_common.cpp:104:5
      #4 0x55bffe885877 in main /root/bitcoin/ci/scratch/build/bitcoin-x86_64-pc-linux-gnu/src/qt/test/test_main.cpp:52:27
      #5 0x7f20c3bf60b2 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x270b2)
      #6 0x55bffe7a5f6d in _start (/root/bitcoin/ci/scratch/build/bitcoin-x86_64-pc-linux-gnu/src/qt/test/test_bitcoin-qt+0x1d00f6d)

  SUMMARY: UndefinedBehaviorSanitizer: unsigned-integer-overflow crypto/sha256_shani.cpp:87:18 in

ACKs for top commit:
  laanwj:
    Anyhow ACK fa6c114ae604571435e8c4d25906a8b6d5b9984c

Tree-SHA512: 968a1d28eedec58c337b1323862f583cb1bcd78c5f03396940b9ab53ded12f8c6652877909aba05ee5586532137418fd817ff979bd7bef6e07856094f9d7f9b1
2023-08-29 21:40:46 -05:00
MarcoFalke
4993f6e894 Merge #20816: net: Move RecordBytesSent() call out of cs_vSend lock
378aedc45248cea82d9a3e6dc1038d6828008a76 [net] Add cs_vSend lock annotations (John Newbery)
673254515a2f97e53dd8c7335c836b083ba7e31a [net] Move RecordBytesSent() call out of cs_vSend lock (John Newbery)

Pull request description:

  RecordBytesSent() does not require cs_vSend to be locked, so reduce the scope of cs_vSend.

  Also correctly annotate the CNode data members that are guarded by cs_vSend.

  This is a simpler alternative to #19673.

ACKs for top commit:
  jnewbery:
    ok, reverting to commit 378aedc which has two ACKs already. Any style issues can be fixed up in future PRs.
  troygiorshev:
    ACK 378aedc45248cea82d9a3e6dc1038d6828008a76
  theStack:
    re-ACK 378aedc45248cea82d9a3e6dc1038d6828008a76
  MarcoFalke:
    review ACK 378aedc45248cea82d9a3e6dc1038d6828008a76 🔌

Tree-SHA512: e9cd6c472b7e1479120c1bf2d1c640cf6d18c7d589a5f9b7dfc4875e5790adaab403a7a1b945a47e79e7249a614b8583270e4549f89b22e8a9edb2e4818b0d07
2023-08-29 21:40:46 -05:00
Odysseas Gabrielides
41ddf5a36c
fix: reorder CGovernanceManager field (#5550)
## Issue being fixed or feature implemented
When building with `-Wreorder-ctor` capture, the build fails with
`error: field 'lastMNListForVotingKeys' will be initialized after field
'votedFundingYesTriggerHash'`

## What was done?
Moved down `votedFundingYesTriggerHash` to last position in
`CGovernanceManager`.

## How Has This Been Tested?

## Breaking Changes
 no

## 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 _(for repository
code-owners and collaborators only)_
2023-08-29 11:22:55 -05:00
Odysseas Gabrielides
ceb84d5b51
feat: Superblock creation (Sentinel elimination) (#5525)
## Issue being fixed or feature implemented

Implementation of issue https://github.com/dashpay/dash-issues/issues/43

## What was done?

Masternode will try to create, sign and submit a Superblock (GovTrigger)
during the `nSuperblockMaturityWindow`.

## How Has This Been Tested?

## Breaking Changes


## Checklist:
- [x] I have performed a self-review of my own code
- [x] 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 _(for repository
code-owners and collaborators only)_

---------

Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>
Co-authored-by: PastaPastaPasta <6443210+PastaPastaPasta@users.noreply.github.com>
2023-08-29 10:31:59 -05:00
PastaPastaPasta
27be6e6291
Merge pull request #5530 from vijaydasmp/bp22_14
backport: bitcoin#15545,18418, 20681,20829,21042,21394,21398,21567,21736,21759
2023-08-28 11:33:02 -05:00
Wladimir J. van der Laan
22122ba543 Merge #20054: Remove confusing and useless "unexpected version" warning
0000a0c7e9e4e7c1afafe6ef75b7624f4c573190 Remove confusing and almost useless "unexpected version" warning (MarcoFalke)

Pull request description:

  It is useless because it isn't displayed for most users:

  * It isn't displayed in normal operation (because the validation debug category is disabled by default)
  * It isn't displayed for users that sync up their nodes intermittently, e.g. once a day or once a week (because it is disabled for IBD)
  * It is only displayed in the debug log (as opposed to the versionbits warning, which is displayed more prominently)

  It is confusing because it doesn't have a use case:

  Despite the above, if a user *did* see the warning, it would most likely be a false positive (like it has been in the past). Even if it wasn't, there is nothing they can do about it. The only thing they could do is to check for updates and hope that a fixed version is available. But why would the user be so scrupulously precise in enabling the warning and reading the log, but then fail to regularly check update channels for updated software?

ACKs for top commit:
  practicalswift:
    ACK 0000a0c7e9e4e7c1afafe6ef75b7624f4c573190
  decryp2kanon:
    ACK 0000a0c
  LarryRuane:
    ACK 0000a0c7e9e4e7c1afafe6ef75b7624f4c573190

Tree-SHA512: 16e069c84be6ab6034baeefdc515d0e5cdf560b2005d2faec5f989d45494bd16cfcb4ffca6a17211d9556ae44f9737a60a476c08b5c2bb5e1bd29724ecd6d5c1
2023-08-28 11:31:55 -05:00
MarcoFalke
37fdef8278 Merge bitcoin/bitcoin#21736: doc: Fix doxygen comment silent merge conflict in descriptor.cpp
e5faec65bd06a3b14175aca3040290f343bd6e9c doc: Fix doxygen comment silent merge conflict in descriptor.cpp (W. J. van der Laan)

Pull request description:

  It looks like #21238 introduced a silent merge conflict in the documentation, which fails with `-Wdocumentation` in the CI.

  (please merge only if CI passes)

ACKs for top commit:
  ajtowns:
    ACK e5faec65bd06a3b14175aca3040290f343bd6e9c -- fixed it for me
  meshcollider:
    ACK e5faec65bd06a3b14175aca3040290f343bd6e9c modulo CI

Tree-SHA512: b07d50fd12aa7c239a92aad8ef29f4e88583c3ce701ebedba7c426aac4981c79113adc4670b7d055ab9535a28bdc3f9a30e6ca1b1ed0d7b9a333a3d9c4b40d8a
2023-08-28 11:31:55 -05:00
W. J. van der Laan
6531372726 Merge #21567: docs: fix various misleading comments
4eca20d6f7d850492d331d89d1cdd77abb3c70c1 [doc] correct comment about ATMPW (glozow)
8fa74aeb5b96419c7d40b40f8e1e1269509278e2 [doc] correct comment in chainparams (glozow)
2f8272c2a4b6fa84c04dfeb4d751bb218f2d4c78 [doc] GetBestBlock() doesn't do nothing (gzhao408)

Pull request description:

  Came across a few misleading comments, wanted to fix them

ACKs for top commit:
  jnewbery:
    ACK 4eca20d6f7
  MarcoFalke:
    ACK 4eca20d6f7d850492d331d89d1cdd77abb3c70c1
  laanwj:
    Code review ACK 4eca20d6f7d850492d331d89d1cdd77abb3c70c1

Tree-SHA512: 5bef1f1e7703f304128cf0eb8945e139e031580c99062bbbe15bf4db8443c2ba5a8c65844833132e6646c8980c678fc1d2ab0c63e17105585d583570ee350fd0
2023-08-28 11:31:55 -05:00
MarcoFalke
aebc28725b Merge #21398: doc: Update fuzzing docs for afl-clang-lto
fab633d2dbfed1efcc3a02061685d56327ae51fd doc: Update fuzzing docs for afl-clang-lto (MarcoFalke)

Pull request description:

  Update the docs to default to `afl-clang-lto`. The afl-gcc (and other afl legacy fuzz engines) are still supported, though discouraged.

ACKs for top commit:
  fanquake:
    ACK fab633d2dbfed1efcc3a02061685d56327ae51fd - seems to work for me. Compiled and ran some fuzzers using Clang 11 on Bionic. Set `llvm-config` so that `clang-11` would be used over `clang` (10).
  jarolrod:
    ACK fab633d2dbfed1efcc3a02061685d56327ae51fd, tested on Ubuntu Focal

Tree-SHA512: 3d1969c167bea45a9d691f3b757f51213d550c9c1b895bed1fcf3c2f7345791787cfb13c376291b94eb3181caf4ae3126f4d01c7cebda7b2bb1c40a1294e9a68
2023-08-28 11:31:55 -05:00
fanquake
7a2d07c683 Merge #21394: [doc] Improve comment about protected peers
ebde946a527e50630df180c6565ea5bf8d2ab5aa [doc] Improve comment about protected peers (Amiti Uttarwar)

Pull request description:

  The comment currently suggests a long-standing node would infrequently protect peers under normal circumstances. Clarify that we also protect peers that are synced to the same work as our chain tip. [Relevant check here](ee0dc02c6f/src/net_processing.cpp (L1997)).

ACKs for top commit:
  Empact:
    ACK ebde946a52
  jnewbery:
    ACK ebde946a527e50630df180c6565ea5bf8d2ab5aa

Tree-SHA512: 3692f4098e95f935d801e0ee6bbd3a7c9480e66ca070a7c68ba79c4fc2e62377f5d37080c7b6a7d15ab617aaf4d3df9b26abc4f1b090d572ba46fdd092a6a64a
2023-08-28 11:31:55 -05:00
MarcoFalke
00d2d7fac3 Merge #21042: doc, test: Improve setup_clean_chain documentation
590bda79e876d9b959083105b8c7c41dd87706eb scripted-diff: Remove setup_clean_chain if default is not changed (Fabian Jahr)
98892f39e3d079c73bff7f2a5d5420fa95270497 doc: Improve setup_clean_chain documentation (Fabian Jahr)

Pull request description:

  The first commit improves documentation on setup_clean_chain which is misunderstood quite frequently. Most importantly it fixes the TestShell docs which are simply incorrect.

  The second commit removes the instances of `setup_clean_clain` in functional tests where it is not changing the default.

  This used to be part of #19168 which also sought to rename`setup_clean_chain`.

ACKs for top commit:
  jonatack:
    ACK 590bda79e876d9b959083105b8c7c41dd87706eb

Tree-SHA512: a7881186e65d31160b8f84107fb185973b37c6e50f190a85c6e2906a13a7472bb4efa9440bd37fe0a9ac5cd2d1e8559870a7e4380632d9a249eca8980b945f3e
2023-08-28 11:31:55 -05:00
Wladimir J. van der Laan
ebcfa7c0ec Merge #20829: doc: add -netinfo help
6f2c4fd0775a9c45eacc4bab8f138528852fdf44 netinfo: add user help documentation (Jon Atack)

Pull request description:

  This is the help doc commit of #20764 without the rest of the PR or anything new since the 0.21.0 branch-off in order to target giving users a -netinfo help doc for 0.21.

  - to test the new help
  ```
  $ ./src/bitcoin-cli -netinfo help
  ```
  - to see the updated short help
  ```
  $ ./src/bitcoin-cli -help | grep -A4 netinfo
  ```

  <details><summary><code>-netinfo</code> help doc</summary><p>

  ```
  $ ./src/bitcoin-cli -netinfo help
  -netinfo level "help"

  Returns a network peer connections dashboard with information from the remote server.
  Under the hood, -netinfo fetches the data by calling getpeerinfo and getnetworkinfo.
  An optional integer argument from 0 to 4 can be passed for different peers listings.
  Pass "help" to see this detailed help documentation.
  If more than one argument is passed, only the first one is read and parsed.
  Suggestion: use with the Linux watch(1) command for a live dashboard; see example below.

  Arguments:
  1. level (integer 0-4, optional)  Specify the info level of the peers dashboard (default 0):
                                    0 - Connection counts and local addresses
                                    1 - Like 0 but with a peers listing (without address or version columns)
                                    2 - Like 1 but with an address column
                                    3 - Like 1 but with a version column
                                    4 - Like 1 but with both address and version columns
  2. help (string "help", optional) Print this help documentation instead of the dashboard.

  Result:

  * The peers listing in levels 1-4 displays all of the peers sorted by direction and minimum ping time:

    Column   Description
    ------   -----------
    <->      Direction
             "in"  - inbound connections are those initiated by the peer
             "out" - outbound connections are those initiated by us
    type     Type of peer connection
             "full"   - full relay, the default
             "block"  - block relay; like full relay but does not relay transactions or addresses
    net      Network the peer connected through ("ipv4", "ipv6", "onion", "i2p", or "cjdns")
    mping    Minimum observed ping time, in milliseconds (ms)
    ping     Last observed ping time, in milliseconds (ms)
    send     Time since last message sent to the peer, in seconds
    recv     Time since last message received from the peer, in seconds
    txn      Time since last novel transaction received from the peer and accepted into our mempool, in minutes
    blk      Time since last novel block passing initial validity checks received from the peer, in minutes
    age      Duration of connection to the peer, in minutes
    asmap    Mapped AS (Autonomous System) number in the BGP route to the peer, used for diversifying
             peer selection (only displayed if the -asmap config option is set)
    id       Peer index, in increasing order of peer connections since node startup
    address  IP address and port of the peer
    version  Peer version and subversion concatenated, e.g. "70016/Satoshi:21.0.0/"

  * The connection counts table displays the number of peers by direction, network, and the totals
    for each, as well as a column for block relay peers.

  * The local addresses table lists each local address broadcast by the node, the port, and the score.

  Examples:

  Connection counts and local addresses only
  > bitcoin-cli -netinfo

  Compact peers listing
  > bitcoin-cli -netinfo 1

  Full dashboard
  > bitcoin-cli -netinfo 4

  Full live dashboard, adjust --interval or --no-title as needed (Linux)
  > watch --interval 1 --no-title ./src/bitcoin-cli -netinfo 4

  See this help
  > bitcoin-cli -netinfo help

  ```
  </p></details>

ACKs for top commit:
  laanwj:
    ACK 6f2c4fd0775a9c45eacc4bab8f138528852fdf44

Tree-SHA512: dd49b1ce65546dacfb8ba9f9d57de0eae55560fd05533cf26c0b5d6ec65bf1de789c3287e90a0e2f47707532fab2fe62919a4192a7ffd58ac8eec18293e9aaeb
2023-08-28 11:31:55 -05:00
Wladimir J. van der Laan
637cbc6a00 Merge #20681: doc: Convert depends options list from html to markdown
7b6887e75aec7e0d5c25682c26943073b7a728e5 doc: Convert depends options list from html to markdown (Wladimir J. van der Laan)

Pull request description:

  This makes it easier to read in `less`, which is important for install instructions.

  Rendered: [before](7ef6b1c51d/depends (dependency-options)) - [after](d97042406f/depends/README.md (dependency-options))

ACKs for top commit:
  jonatack:
    Code review re-ACK 7b6887e75aec7e0d5c25682c26943073b7a728e5 per `git diff d970424 7b6887e`
  hebasto:
    re-ACK 7b6887e75aec7e0d5c25682c26943073b7a728e5

Tree-SHA512: 02970b2bb97d2e8fb2d66470f6d70662653fda176bf6f4861742823b361fdc7ab6a2b44143480ac1a525b8d7808b6a068e8b3677dbba16cd783b4cab90470af5
2023-08-28 11:31:55 -05:00
fanquake
283c5592c8 Merge bitcoin/bitcoin#18418: wallet: Increase OUTPUT_GROUP_MAX_ENTRIES to 100
e6fe1c37d0a2f8037996dd80619d6c23ec028729 rpc: Improve avoidpartialspends and avoid_reuse documentation (Fabian Jahr)
8f073076b102b77897e5a025ae555baae3d1f671 wallet: Increase OUTPUT_GROUP_MAX_ENTRIES to 100 (Fabian Jahr)

Pull request description:

  Follow-up to #17824.

  This increases OUTPUT_GROUP_MAX_ENTRIES to 100 which means that OutputGroups will now be up to 100 outputs large, up from previously 10. The main motivation for this change is that during the PR review club on #17824 [several participants signaled](https://bitcoincore.reviews/17824.html#l-339) that 100 might be a better value here.

  I think fees should be manageable for users but more importantly, users should know what they can expect when using the wallet with this configuration, so I also tried to clarify the documentation on `-avoidpartialspends` and `avoid_reuse` a bit. If there are other additional ways how or docs where users can be made aware of the potential consequences of using these parameters, please let me know. Another small upside is that [there seem to be a high number of batching transactions with 100 and 200 inputs](https://miro.medium.com/max/3628/1*sZ5eaBSbsJsHx-J9iztq2g.png)([source](https://medium.com/@hasufly/an-analysis-of-batching-in-bitcoin-9bdf81a394e0)) giving these transactions a bit of a larger anonymity set, although that is probably a very weak argument.

ACKs for top commit:
  jnewbery:
    ACK e6fe1c37d0
  Xekyo:
    retACK e6fe1c37d0a2f8037996dd80619d6c23ec028729
  rajarshimaitra:
    tACK `e6fe1c3`
  achow101:
    ACK e6fe1c37d0a2f8037996dd80619d6c23ec028729
  glozow:
    code review ACK e6fe1c37d0

Tree-SHA512: 79685c58bafa64ed8303b0ecd616fce50fc9a2b758aa79833e4ad9f15760e09ab60c007bc16ab4cbc4222e644cfd154f1fa494b0f3a5d86faede7af33a6f2826
2023-08-28 11:31:55 -05:00
MarcoFalke
2c596914aa Merge bitcoin/bitcoin#15545: [doc] explain why CheckBlock() is called before AcceptBlock
3d552b0d788a7d3102396b32d0de08e57cbfd297 [doc] explain why CheckBlock() is called before AcceptBlock() (Sjors Provoost)

Pull request description:

  Based on https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2019-February/016697.html and its PDF attachment.

ACKs for top commit:
  MarcoFalke:
    cr ACK 3d552b0d788a7d3102396b32d0de08e57cbfd297

Tree-SHA512: d1ef39855317853e0e7e051ec6015054d0d227fcdf20281c2c1921056537f1f79044aa1bdd35f46475edd17596fbcae79aeb338c4865b1269a01b158f6cb2ac4
2023-08-28 11:31:55 -05:00
PastaPastaPasta
4ce7ed84a7
Merge pull request #5529 from vijaydasmp/bp22_13
backport: Merge bitcoin#21187, 21342,17350,19238,21210,21274,(partial)21053,20370,20437,21388
2023-08-28 11:25:10 -05:00
MarcoFalke
7bd149f034 Merge #21388: doc: Rename fuzz seed_dir to corpus_dir
fad0ae6bb8e10b5cb82a5ec014e59b5aafc85b5e doc: Rename fuzz seed_dir to corpus_dir (MarcoFalke)

Pull request description:

  The fuzz corpus directory might contain hand-crafted seeds, but generally it is a set of test inputs. See also https://github.com/google/fuzzing/blob/master/docs/glossary.md#corpus

ACKs for top commit:
  practicalswift:
    cr ACK fad0ae6bb8e10b5cb82a5ec014e59b5aafc85b5e: patch looks correct and "why not?" :)
  fanquake:
    ACK fad0ae6bb8e10b5cb82a5ec014e59b5aafc85b5e - did not test

Tree-SHA512: 38c952feb07aeeeb038b3261a12c824fab9ce5153d75f0ecf6d3f43db4f50998eeb2b14b11b7155f529189c93783fa2c11c81059021a04398c43f3505b31a2d4
2023-08-28 11:24:41 -05:00
MarcoFalke
31875f5d2d Merge #20437: fuzz: Avoid time-based "non-determinism" in fuzzing harnesses by using mocked GetTime()
8c09c0c1d18885ef94f79b3f2d073f43269bc95d fuzz: Avoid time-based "non-determinism" in fuzzing harnesses by using mocked GetTime() (practicalswift)

Pull request description:

  Avoid time-based "non-determinism" in fuzzing harnesses by using mocked `GetTime()`.

  Prior to this commit the fuzzing harnesses `banman`, `connman`, `net` and `rbf` had time-based "non-determinism". `addrman` is fixed in #20425. `process_message` and `process_messages` are left to fix: simply using mock time is not enough for them due to interaction with `IsInitialBlockDownload()`.

  See [`doc/fuzzing.md`](https://github.com/bitcoin/bitcoin/blob/master/doc/fuzzing.md) for information on how to fuzz Bitcoin Core. Don't forget to contribute any coverage increasing inputs you find to the [Bitcoin Core fuzzing corpus repo](https://github.com/bitcoin-core/qa-assets).

  Happy fuzzing :)

ACKs for top commit:
  MarcoFalke:
    review ACK 8c09c0c1d18885ef94f79b3f2d073f43269bc95d
  practicalswift:
    > review ACK [8c09c0c](8c09c0c1d1)

Tree-SHA512: 32dfbead3dfd18cf4ff56dc2ea341aa977441b4e19a54879cf54fa5820c7e2b14b92c7e238d32fd785654f3b28cc82826ae66c03e94c292633c63c41196ba9a8
2023-08-28 11:24:41 -05:00
MarcoFalke
4cf7374c04 Merge #20370: fuzz: version handshake
fabce459bb44e90dc7ae9c44eeedab707435af5b fuzz: version handshake (MarcoFalke)

Pull request description:

  Not fuzzing the version handshake will limit fuzz coverage

ACKs for top commit:
  practicalswift:
    cr ACK fabce459bb44e90dc7ae9c44eeedab707435af5b: patch looks very much correct

Tree-SHA512: 4091d27d39edee781d033e471b352084bb54df250d0890e4821a325926a44dff9b26a2614d67dd0529f73bd366b075d7a0a1a570c2837de286a1b93a59a8fb91
2023-08-28 11:24:41 -05:00
MarcoFalke
9daa8a2fd0 (Partial) Merge #21053: rpc, test: document {previous,next}blockhash as optional
ba7e17e073f833eccd4c7c111ae9058c3f123371 rpc, test: document {previous,next}blockhash as optional (Sebastian Falbesoner)

Pull request description:

  This PR updates the result help of the following RPCs w.r.t. the `previousblockhash` and `nextblockhash` fields:
  - getblockheader
  - getblock

  Also adds trivial tests on genesis block (should not contain "previousblockhash") and best block (should not contain "nextblockhash").

Top commit has no ACKs.

Tree-SHA512: ef42c5c773fc436e1b4a67be14e2532e800e1e30e45e54a57431c6abb714d2c069c70d40ea4012d549293b823a1973b3f569484b3273679683b28ed40abf46bb
2023-08-28 11:24:41 -05:00
MarcoFalke
52d7dbe329 Merge #21274: assumptions: Assume C++17
5e531e6beb5381c0be5efaa24b7e423e593568e4 assumptions: check C++17 assumption with MSVC (fanquake)
c7b46489f8c4d880382248fb47266d81948bbce0 assumptions: assume a C++17 compiler (fanquake)

Pull request description:

  This has been the case since #20413.

  This should also enable the check for MSVC. From my reading of https://docs.microsoft.com/en-us/cpp/build/reference/zc-cplusplus?view=msvc-160 and https://devblogs.microsoft.com/cppblog/msvc-now-correctly-reports-__cplusplus/ if we set the `/Zc:__cplusplus` switch in additional options, MSVC will report the correct value for `__cplusplus`. However I have not tested this.

ACKs for top commit:
  laanwj:
    Code review ACK 5e531e6beb5381c0be5efaa24b7e423e593568e4
  hebasto:
    ACK 5e531e6beb5381c0be5efaa24b7e423e593568e4, checked the MS docs, and AppVeyor build is green.
  practicalswift:
    ACK 5e531e6beb5381c0be5efaa24b7e423e593568e4

Tree-SHA512: a4fb525cf5c33abc944c614edb0313a39c8a39a1637a03c09342c15ba0925f4eb037062e65e51b42ade667506b7e554c7159acf86e6b8c35d0a87dd79a6f239b
2023-08-28 11:24:41 -05:00
Wladimir J. van der Laan
33d5b89d24 Merge #21210: doc: Rework internal and external links
77772a1b809e443a6861ee49009ff8bc55cff9c3 doc: Rework internal and external links (MarcoFalke)

Pull request description:

  Some minor changes:
  * Move Bitcoin Core download link to the very top. *Reason:* The download link has nothing to do with the section that explains Bitcoin. Also, anyone quickly looking for the download link will find it faster.
  * Add a new link to the doc folder. *Reason*: Apart from the documentation that is shipped with the binary software, the doc folder is the primary location for Bitcoin Core related documentation.
  * Remove dead link to pdf. *Reason*: The pdf can be trivially found by asking a search engine.
  * Remove reference to "build server". *Reason*: There is no "build server". The CI system is explained in the next sentence in detail.
  * Remove dead? link to translation mailing list. *Reason*: The translation process is explained in `doc/translation_process.md`, no need to explain it in detail in the main readme.

ACKs for top commit:
  laanwj:
    ACK 77772a1b809e443a6861ee49009ff8bc55cff9c3
  RiccardoMasutti:
    ACK 77772a1

Tree-SHA512: 365824c6da519892ff239842b0c9525f559513eb800afd77b14febdc9d1a79294d9448df6cd25b623f1734ff859d9e20951e78fb8091d19fdadde0dd24eeddd4
2023-08-28 11:24:41 -05:00
MarcoFalke
3ff5348d97 Merge bitcoin/bitcoin#19238: refactor: Make CAddrMan::cs non-recursive
ae98aec9c0521cdcec76459c8200bd45ff6a1485 refactor: Make CAddrMan::cs non-recursive (Hennadii Stepanov)
f5d1c7fac70f424114dae3be270fdc31589a8c34 Add AssertLockHeld to CAddrMan private functions (Hennadii Stepanov)
5ef1d0b6982f05f70ff2164ab9af1ac1d2f97f5d Add thread safety annotations to CAddrMan public functions (Hennadii Stepanov)
b138973a8b4bbe061ad97011f278a21e08ea79e6 refactor: Avoid recursive locking in CAddrMan::Clear (Hennadii Stepanov)
f79a664314b88941c1a2796623e846d0a5916c06 refactor: Apply consistent pattern for CAddrMan::Check usage (Hennadii Stepanov)
187b7d2bb36e6de9cd960378021ebe690619a2ef refactor: Avoid recursive locking in CAddrMan::Check (Hennadii Stepanov)
f77d9c79aa41dab4285e95c9432cc6d853be67a3 refactor: Fix CAddrMan::Check style (Hennadii Stepanov)
06703973c758c2c5d0ff916993aa7055f609d2d7 Make CAddrMan::Check private (Hennadii Stepanov)
efc6fac951e75ba913350bb470c3d4e6a4e284b9 refactor: Avoid recursive locking in CAddrMan::size (Hennadii Stepanov)
2da95545ea42f925dbc7703e42e9356908a8c83e test: Drop excessive locking in CAddrManTest::SimConnFail (Hennadii Stepanov)

Pull request description:

  This PR replaces `RecursiveMutex CAddrMan::cs` with `Mutex CAddrMan::cs`.

  All of the related code branches are covered by appropriate lock assertions to insure that the mutex locking policy has not been changed by accident.

  Related to #19303.

  Based on #22025, and first three commits belong to it.

ACKs for top commit:
  vasild:
    ACK ae98aec9c0521cdcec76459c8200bd45ff6a1485

Tree-SHA512: c3a2d3d955a75befd7e497a802b8c10730e393be9111ca263ad0464d32fae6c7edf9bd173ffb6bc9bb61c4b39073a74eba12979d47f26b0b7b4a861d100942df
2023-08-28 11:24:41 -05:00