Commit graph

33592 commits

Author SHA1 Message Date
fanquake
260ede1d99
Merge bitcoin/bitcoin#24644: wallet: add tracepoints and algorithm information to coin selection
ab5af9ca72 test: Add test for coinselection tracepoints (Andrew Chow)
ca02b68e8a doc: document coin selection tracepoints (Andrew Chow)
8e3f39e4fa wallet: Add some tracepoints for coin selection (Andrew Chow)
15b58383d0 wallet: compute waste for SelectionResults of preset inputs (Andrew Chow)
912f1ed181 wallet: track which coin selection algorithm produced a SelectionResult (Andrew Chow)

Pull request description:

  Tracepoints can be useful for coin selection as they would allow us to observe what is being selected, selection parameters, and calculation results. So this PR adds 4 new tracepoints:

  1. After `SelectCoins` returns in order to observe the `SelectionResult`
  2. After the first `CreateTransactionInternal` to observe the created transaction
  3. Prior to the second `CreateTransactionInternal` to notify that the optimistic avoid partial spends selection is occurring
  4. After the second `CreateTransactionInternal` to observe the created transaction and inform which solution is being used.

  This PR also adds an algorithm enum to `SelectionResult` so that the first tracepoint will be able to report which algorithm was used to produce that result.

  The primary use case for these tracepoints is in running coin selection simulations. The script I use to run these simulations use these tracepoints in order to gather data on the algorithm used and the calculated waste.

ACKs for top commit:
  jb55:
    crACK ab5af9ca72
  josibake:
    crACK ab5af9ca72
  0xB10C:
    ACK ab5af9ca72. Code reviewed, ran the `interface_usdt_coinselection.py` test, and tested with the above bpftrace script (updated `%d` -> `%ld` where necessary, ty achow101).

Tree-SHA512: a4bf7a910cdf464622f2f3b5d44c15b891f24852df6e7f8c5b177fe3d8aaa4a1164593a24c3960eb22b16544fa7140e5c745345367b9e291b78395084c0ac8ff
2022-04-26 19:16:27 +01:00
fanquake
833add0f48
Merge bitcoin/bitcoin#24989: scripted-diff: rename BytePtr to AsBytePtr
bae4561938 scripted-diff: rename BytePtr to AsBytePtr (João Barbosa)

Pull request description:

  Building with iPhoneOS SDK fails because it also has `BytePtr` defined
  in [/usr/include/MacTypes.h](https://opensource.apple.com/source/CarbonHeaders/CarbonHeaders-18.1/MacTypes.h.auto.html):
  ```cpp
  typedef UInt8 *                         BytePtr;
  ```

ACKs for top commit:
  MarcoFalke:
    cr ACK bae4561938
  laanwj:
    Code review ACK bae4561938
  sipa:
    utACK bae4561938
  prusnak:
    Approach ACK bae4561938

Tree-SHA512: fb4d4a94c9c2238107952c071bae9bf6bbde6ed6651f6d300f222adf8a6a423f0567cbbcc3102d4167ef2e4e6f9988a2f91d75a5418bf6bcd64eebb4bcd1077f
2022-04-26 16:50:35 +01:00
fanquake
f654cdb89c
Merge bitcoin/bitcoin#24392: build: Fix configuring depends with cmake
ff4a38a327 build: Fix configuring depends with cmake (Hennadii Stepanov)

Pull request description:

  This PR fixes bitcoin/bitcoin#24389.

  On master (28aa0e3ca0) configuring of the `libmultiprocess` package for the `x86_64-w64-mingw32` target fails:
  ```
  $ cd depends
  $ make libmultiprocess_configured MULTIPROCESS=1 HOST=x86_64-w64-mingw32
  Configuring libmultiprocess...
  CMake Warning:
    No source or binary directory provided.  Both will be assumed to be the
    same as the current working directory, but note that this warning will
    become a fatal error in future CMake releases.

  -- The CXX compiler identification is GNU 9.3.0
  -- Check for working CXX compiler: /usr/bin/x86_64-w64-mingw32-g++-posix
  -- Check for working CXX compiler: /usr/bin/x86_64-w64-mingw32-g++-posix -- broken
  CMake Error at /usr/share/cmake-3.16/Modules/CMakeTestCXXCompiler.cmake:53 (message):
    The C++ compiler

      "/usr/bin/x86_64-w64-mingw32-g++-posix"

    is not able to compile a simple test program.

    It fails with the following output:

      Change Dir: /home/hebasto/GitHub/bitcoin/depends/work/build/x86_64-w64-mingw32/libmultiprocess/d576d975debdc9090bd2582f83f49c76c0061698-f496b1e64cb/CMakeFiles/CMakeTmp

      Run Build Command(s):/usr/bin/make cmTC_93273/fast && make[1]: Entering directory '/home/hebasto/GitHub/bitcoin/depends/work/build/x86_64-w64-mingw32/libmultiprocess/d576d975debdc9090bd2582f83f49c76c0061698-f496b1e64cb/CMakeFiles/CMakeTmp'
      /usr/bin/make -f CMakeFiles/cmTC_93273.dir/build.make CMakeFiles/cmTC_93273.dir/build
      make[2]: Entering directory '/home/hebasto/GitHub/bitcoin/depends/work/build/x86_64-w64-mingw32/libmultiprocess/d576d975debdc9090bd2582f83f49c76c0061698-f496b1e64cb/CMakeFiles/CMakeTmp'
      Building CXX object CMakeFiles/cmTC_93273.dir/testCXXCompiler.cxx.o
      /usr/bin/x86_64-w64-mingw32-g++-posix    -I/home/hebasto/GitHub/bitcoin/depends/x86_64-w64-mingw32/include     -pipe -O2    -o CMakeFiles/cmTC_93273.dir/testCXXCompiler.cxx.o -c /home/hebasto/GitHub/bitcoin/depends/work/build/x86_64-w64-mingw32/libmultiprocess/d576d975debdc9090bd2582f83f49c76c0061698-f496b1e64cb/CMakeFiles/CMakeTmp/testCXXCompiler.cxx
      Linking CXX executable cmTC_93273
      /usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_93273.dir/link.txt --verbose=1
      /usr/bin/x86_64-w64-mingw32-g++-posix  -I/home/hebasto/GitHub/bitcoin/depends/x86_64-w64-mingw32/include     -pipe -O2   -L/home/hebasto/GitHub/bitcoin/depends/x86_64-w64-mingw32/lib  -rdynamic CMakeFiles/cmTC_93273.dir/testCXXCompiler.cxx.o  -o cmTC_93273
      x86_64-w64-mingw32-g++-posix: error: unrecognized command line option ‘-rdynamic’
      make[2]: *** [CMakeFiles/cmTC_93273.dir/build.make:87: cmTC_93273] Error 1
      make[2]: Leaving directory '/home/hebasto/GitHub/bitcoin/depends/work/build/x86_64-w64-mingw32/libmultiprocess/d576d975debdc9090bd2582f83f49c76c0061698-f496b1e64cb/CMakeFiles/CMakeTmp'
      make[1]: *** [Makefile:121: cmTC_93273/fast] Error 2
      make[1]: Leaving directory '/home/hebasto/GitHub/bitcoin/depends/work/build/x86_64-w64-mingw32/libmultiprocess/d576d975debdc9090bd2582f83f49c76c0061698-f496b1e64cb/CMakeFiles/CMakeTmp'

    CMake will not be able to correctly generate this project.
  Call Stack (most recent call first):
    CMakeLists.txt:6 (project)

  -- Configuring incomplete, errors occurred!
  See also "/home/hebasto/GitHub/bitcoin/depends/work/build/x86_64-w64-mingw32/libmultiprocess/d576d975debdc9090bd2582f83f49c76c0061698-f496b1e64cb/CMakeFiles/CMakeOutput.log".
  See also "/home/hebasto/GitHub/bitcoin/depends/work/build/x86_64-w64-mingw32/libmultiprocess/d576d975debdc9090bd2582f83f49c76c0061698-f496b1e64cb/CMakeFiles/CMakeError.log".
  make: *** [funcs.mk:283: /home/hebasto/GitHub/bitcoin/depends/work/build/x86_64-w64-mingw32/libmultiprocess/d576d975debdc9090bd2582f83f49c76c0061698-f496b1e64cb/./.stamp_configured] Error 1

  ```

  The reason of that failure is the unset `-DCMAKE_SYSTEM_NAME` flag:
  ```
  $ make print-libmultiprocess_cmake MULTIPROCESS=1 HOST=x86_64-w64-mingw32
  libmultiprocess_cmake=env CC="x86_64-w64-mingw32-gcc" CFLAGS="  -I/home/hebasto/GitHub/bitcoin/depends/x86_64-w64-mingw32/include     -pipe -O2    " CXX="x86_64-w64-mingw32-g++-posix" CXXFLAGS="  -I/home/hebasto/GitHub/bitcoin/depends/x86_64-w64-mingw32/include     -pipe -O2    " LDFLAGS="  -L/home/hebasto/GitHub/bitcoin/depends/x86_64-w64-mingw32/lib    " cmake -DCMAKE_INSTALL_PREFIX:PATH="/home/hebasto/GitHub/bitcoin/depends/x86_64-w64-mingw32" -DCMAKE_SYSTEM_NAME= -DCMAKE_C_COMPILER_TARGET=x86_64-w64-mingw32 -DCMAKE_CXX_COMPILER_TARGET=x86_64-w64-mingw32
  ```

  This PR fixes this error:
  ```
  $ make libmultiprocess_configured MULTIPROCESS=1 HOST=x86_64-w64-mingw32
  $ # no errors
  ```

ACKs for top commit:
  fanquake:
    ACK ff4a38a327 - going to merge this now, and we can follow up with more cmake improvements.

Tree-SHA512: bd8d8b2f4eedcc8c46cf995b9c39493ea4d0b13c224f77ef62985304ebd392f05119043a06f1401c64f962007a8faa4bb53715d99a408ee6c33bb49a2dd650ba
2022-04-26 15:44:12 +01:00
fanquake
f4005af3ec
Merge bitcoin/bitcoin#24977: rpc: Explain active and internal in listdescriptors
4637bbe448 rpc: Explain active and internal in listdescriptors (Andrew Chow)

Pull request description:

  The current help text for active and internal in listdescriptors is not particularly helpful. They require the reader to already know what those terms mean. This help text is updated to actually explain the definitions of those words in context of a descriptor wallet.

ACKs for top commit:
  S3RK:
    ACK 4637bbe448
  jarolrod:
    ACK 4637bbe448
  w0xlt:
    ACK 4637bbe448

Tree-SHA512: 0af2c04f3b9920799cf616ad618bde9248eb9f74cc28f443b5b0f6646deba76e9b1415aca0865ad3bcc24aa6af0e9d07ad7b7cd80f0fe80838cf847f1b944426
2022-04-26 15:09:39 +01:00
fanquake
cc3877f831
Merge bitcoin/bitcoin#24971: tidy: modernize-use-nullptr
9c96f1008b tidy: enable modernize-use-nullptr (fanquake)
e53274868e Don't use zero as null pointer constant (-Wzero-as-null-pointer-constant) (practicalswift)

Pull request description:

  Alternative to #15112 which uses `clang-tidy` to do perform the checking, rather than `-Wzero-as-null-pointer-constant`, and avoids having to uses pragmas, i.e:
  ```cpp
  #if defined(HAVE_CONFIG_H)
  #include <config/bitcoin-config.h>
  #endif

  #if defined(HAVE_W_ZERO_AS_NULL_POINTER_CONSTANT)
  #pragma GCC diagnostic push
  #pragma GCC diagnostic ignored "-Wzero-as-null-pointer-constant"
  #pragma GCC diagnostic ignored "-Wunknown-pragmas"
  #pragma clang diagnostic push
  #pragma clang diagnostic ignored "-Wzero-as-null-pointer-constant"
  #endif
  ```
  to suppress warnings coming from upstream code.

  Can be tested by dropping the preceding commit. Should produce errors like:
  ```bash
  clang-tidy-14 --use-color -p=/home/ubuntu/ci_scratch/ci/scratch/build/bitcoin-x86_64-pc-linux-gnu /home/ubuntu/ci_scratch/ci/scratch/build/bitcoin-x86_64-pc-linux-gnu/src/netbase.cpp
  /home/ubuntu/ci_scratch/ci/scratch/build/bitcoin-x86_64-pc-linux-gnu/src/netbase.cpp:678:36: error: use nullptr [modernize-use-nullptr,-warnings-as-errors]
          if (!Socks5(strDest, port, 0, sock)) {
                                     ^
                                     nullptr

  ```

ACKs for top commit:
  laanwj:
    Concept and code review ACK 9c96f1008b

Tree-SHA512: d822a354e44ba8f7fc53da9a4be7de5c25cc4ffc7c57651b76fdd1a030764b0390cfd79fca94685b8a3ff4f4d13054764f12d1f0d8c2a1b9ba519a7524f7f5bf
2022-04-26 14:55:46 +01:00
laanwj
23ebd7a802
Merge bitcoin/bitcoin#24959: Remove not needed clang-format off comments
fa870e3d4c Remove not needed clang-format off comments (MarcoFalke)

Pull request description:

  It seems odd to disable clang-format and force manual formatting when there is no need for it. So remove the clang-format comments and other unneeded comments.

  Can be reviewed with `--word-diff-regex=. --ignore-all-space`

  Looks like this was initially added in commit d9d79576f4 to accommodate a linter that has since been removed and replaced by a functional test.

ACKs for top commit:
  laanwj:
    Code review ACK fa870e3d4c
  fanquake:
    ACK fa870e3d4c

Tree-SHA512: 0f8f97c12f5dbe517dd96c10b10ce1b8772d8daed33e6b41f73ea1040e89888cf3b8c0ad7b20319e366fe30c71e8b181c89098ae7f6a3deb8647e1b4731db815
2022-04-26 15:11:37 +02:00
fanquake
269dcad16e
Merge bitcoin/bitcoin#24789: init, index: disallow indexes when running reindex-chainstate
dac44fc06f init: disallow reindex-chainstate with optional indexes (Martin Zumsande)
62e14285f9 doc: Add note that -reindex will rebuild optional indexes (Martin Zumsande)

Pull request description:

  When started together with `-reindex-chainstate`, currently coinstatsindex gets corrupted and the blockfilterindex flatfiles duplicated. See the OP of #24630 for more a more detailed explanation on why this happens.

  This is an alternative to #24630 which does not wipe and rebuild the indexes but returns an `InitError` when they are activated, thus requiring the user to deactivate them temporarily until the `-reindex-chainstate` run is finished.

  This also disallows `-reindex-chainstate` in combination with `-txindex`, which is not leading to corruption, but currently still rebuilds the index unnecessarily and unexpectedly.

  As a long-term goal, it would be desirable to have the indexes tolerate `reindex-chainstate` by ignoring their `BlockConnected` notifications (there is discussion in #24630 about this) or possibly move `reindex-chainstate` option  into a `bitcoin-chainstate` executable, which could also solve the problem. But these would be larger projects - until then, it might be better to disallow the interaction than having corrupted indexes.

  The first commit adjusts the `-reindex` doc to mention that this option does rebuild all active indexes.

ACKs for top commit:
  ryanofsky:
    Code review ACK dac44fc06f. Just fixed IsArgSet call and edited error messages since last review

Tree-SHA512: c1abf7d350648ae227c3fd6c95d9a54c3bac9de70915275dea1c87cca6d9a76a056c0e306d95ef8cfe4df1f8525b418e0e7a4f52ded3be464041c0dc297f8930
2022-04-26 12:11:39 +01:00
fanquake
30c1c6ed80
Merge bitcoin/bitcoin#24979: Precomputed hashes are note #16 in BIP341
df08c23f01 Precomputed hashes are note #16 in BIP341 (Gregory Sanders)

Pull request description:

  Seems to have drifted one space

ACKs for top commit:
  fanquake:
    ACK df08c23f01

Tree-SHA512: f0e959743f67ad4b46584f44305d27a89b52874d70091e004ec05dfd2f8c6481e9edceecb0af98f519ad3debb0c0bb26fa27f370545b6e15f366bd0af1158bab
2022-04-26 12:01:20 +01:00
fanquake
9c96f1008b
tidy: enable modernize-use-nullptr 2022-04-26 10:43:33 +01:00
practicalswift
e53274868e
Don't use zero as null pointer constant (-Wzero-as-null-pointer-constant) 2022-04-26 10:41:45 +01:00
fanquake
f436bfd126
Merge bitcoin/bitcoin#22953: refactor: introduce single-separator split helper (boost::split replacement)
a62e84438d fuzz: add `SplitString` fuzz target (MarcoFalke)
4fad7e46d9 test: add unit tests for `SplitString` helper (Kiminuo)
9cc8e876e4 refactor: introduce single-separator split helper `SplitString` (Sebastian Falbesoner)

Pull request description:

  This PR adds a simple string split helper `SplitString` that takes use of the spanparsing `Split` function that was first introduced in #13697 (commit fe8a7dcd78). This enables to replace most calls to `boost::split`, in the cases where only a single separator character is used. Note that while previous attempts to replace `boost::split` were controversial (e.g. #13751), this one has a trivial implementation: it merely uses an internal helper (that is unit tested and in regular use with output descriptiors) and converts its result from spans to strings. As a drawback though, not all `boost::split` instances can be tackled.

  As a possible optimization, one could return a vector of `std::string_view`s (available since C++17) instead of strings, to avoid copies. This would need more carefulness on the caller sites though, to avoid potential lifetime issues, and it's probably not worth it, considering that none of the places where strings are split are really performance-critical.

ACKs for top commit:
  martinus:
    Code review ACK a62e84438d. Ran all tests. I also like that with `boost::split` it was not obvious that the resulting container was cleared, and with `SplitString` API that's obvious.

Tree-SHA512: 10cb22619ebe46831b1f8e83584a89381a036b54c88701484ac00743e2a62cfe52c9f3ecdbb2d0815e536c99034558277cc263600ec3f3588b291c07eef8ed24
2022-04-26 09:54:49 +01:00
João Barbosa
bae4561938 scripted-diff: rename BytePtr to AsBytePtr
Building with iPhoneOS SDK fails because it also has `BytePtr` defined 
in /usr/include/MacTypes.h.

-BEGIN VERIFY SCRIPT-
sed -i 's/BytePtr/AsBytePtr/' $(git grep -l "BytePtr" src)
-END VERIFY SCRIPT-
2022-04-26 09:41:45 +01:00
laanwj
a19f641a80
Merge bitcoin/bitcoin#24157: p2p: Replace RecursiveMutex cs_totalBytesSent with Mutex and rename it
709af67add p2p: replace RecursiveMutex `m_total_bytes_sent_mutex` with Mutex (w0xlt)
8be75fd0f0 p2p: add assertions and negative TS annotations for `m_total_bytes_sent_mutex` (w0xlt)
a237a065cc scripted-diff: rename cs_totalBytesSent -> m_total_bytes_sent_mutex (w0xlt)

Pull request description:

  Related to #19303, this PR gets rid of the RecursiveMutex `cs_totalBytesSent` and also adds `AssertLockNotHeld` macros combined with `LOCKS_EXCLUDED` thread safety annotations to avoid recursive locking.

ACKs for top commit:
  jonatack:
    ACK 709af67add per `git range-diff 7a4ac71 eff7918 709af67`, rebase to master, clang 15 debug build, and build with -Wthread-safety-negative
  vasild:
    ACK 709af67add
  hebasto:
    ACK 709af67add, tested on Ubuntu 22.04.

Tree-SHA512: 560b4e6c92b1511911d69185207df6ee809db09b96d97f96430d8d2595dc05c98cc691aaec8a58ef87cf2ab0a98675c210b8ce0be3dedb81e31114bbbfdfd8be
2022-04-26 10:21:52 +02:00
MacroFake
1ae65b4c5f
Merge bitcoin/bitcoin#24968: Move only: Move TxOrphange tests to orphange_tests.cpp
b8f17fbcb4 [tests] Move TxOrphange tests to orphange_tests.cpp (John Newbery)

Pull request description:

  PR #21148 moved the orphan transaction handling functionality from net_processing into its own translation unit txorphanage.cpp. The unit tests for that code should be in its own file rather than mixed with the net_processing unit tests in denialofservive_tests.cpp.

ACKs for top commit:
  vincenzopalazzo:
    ACK b8f17fbcb4

Tree-SHA512: 32da89b3792abcbdcf897d66276225731c8976e1e0cd902c4b5ad8aff02104719c3aee2990cc2fcbe3eddede8a59472266e0ad1ce2ac11d66fe52c8cbe705161
2022-04-26 09:43:09 +02:00
laanwj
1e7db37e76
Merge bitcoin/bitcoin#24856: lint: Converting lint-assertions.sh to lint-assertions.py
172c2333f0 Porting lint-assertions.sh to lint-assertions.py (hiago)

Pull request description:

  This PR is converting `test/lint/lint-assertions.sh` to `test/lint/lint-assertions.py`. It's an item of #24783.

ACKs for top commit:
  laanwj:
    Tested ACK 172c2333f0

Tree-SHA512: 94d5b03acfeaf2303fad95d489d6c3aa7bd655889ddaa807cc97e0613b8eb8f5ef094feee2a98d974606890deb554e76490a5c523d64eb5bc55afa6a43221aae
2022-04-25 19:47:17 +02:00
laanwj
16fa967d3c
Merge bitcoin/bitcoin#24915: lint: Convert lint-circular-dependencies.sh to Python
79635c79e0 lint: Convert lint-circular-dependencies.sh to Python (Smlep)

Pull request description:

  Here is a port of `/test/lint/lint-circular-dependencies.sh` to a Python-script as part of the request of https://github.com/bitcoin/bitcoin/issues/24783.

  It aims to provide the same output as the bash version.

ACKs for top commit:
  laanwj:
    Tested ACK 79635c79e0

Tree-SHA512: f18077018f1229dd933cfe2bf0cfe7dc7d6538961c96a83c7a1f05e0cec4b068ca05502d68410d2aa4b6864523424db386e38233735190525904c2a8e9d2ba13
2022-04-25 19:37:19 +02:00
laanwj
9eedbe98c8
Merge bitcoin/bitcoin#24815: lint: convert lint-tests.sh to python
ae0e06a439 Converted lint-tests.sh to python (TakeshiMusgrave)

Pull request description:

  Reference issue: https://github.com/bitcoin/bitcoin/issues/24783

ACKs for top commit:
  laanwj:
    Tested ACK ae0e06a439

Tree-SHA512: a118295b5b6b5199b52d46b54de871d88dd544112e7dd5001a9575d65b093af0aea390f9ad223462a4fc6a201bd8c4debe5e26bfa4860a90c97cfe300477c04a
2022-04-25 19:27:37 +02:00
laanwj
0342ae1d39
Merge bitcoin/bitcoin#24802: lint: convert format strings linter test to python
267684ee34 lint: convert format strings linter test to python (Eunoia)

Pull request description:

  Refs #24783

  Attempted to keep the style and flow of implementation as it is.

  ### Additional Notes(Optional):
  1. There is scope of improvement on how the related files are fetched. In this `git grep` with `subprocess` is still used as I found it to be the simplest. Any pointers on this are appreciated.
  2. Removed sort operation on the matching files as I couldn't think of any strong arguments to have it. Any pointers on this are appreciated.
  3. Not important, but one small detail is that the previous implementation was storing matched files for all the `function_names` iterated so far. Fixed that in this PR.

ACKs for top commit:
  laanwj:
    Code review ACK 267684ee34

Tree-SHA512: 54ceae0c3501e561fdd9c5167b2dd8dd06da1b3697a077a042210970ce7004bda8c4e19abb1905ee64cbdce635f0a078508da645846ae7e81c016091f3f02458
2022-04-25 18:32:40 +02:00
laanwj
777b89b300
Merge bitcoin/bitcoin#24929: lint: convert shell locale linter test to Python
2c838cc309 lint: convert shell locale linter test to Python (Eunoia)

Pull request description:

  Refs #24783

ACKs for top commit:
  laanwj:
    Code review ACK 2c838cc309

Tree-SHA512: 3cb5e7c7cd2acbdf0dc45096055b33cbfa0ec9e47ea567452d23a49a7441b3b62a8416879f234459c86fa892c42205c91d8a575115346c023ab0152cf713e20c
2022-04-25 18:23:02 +02:00
laanwj
8b686776ef
Merge bitcoin/bitcoin#24902: lint: Convert lint-include-guards.sh to Python
d5fdec5cf8 Convert lint-include-guards.sh to python (brydinh)

Pull request description:

  This PR addresses [issue 24783](https://github.com/bitcoin/bitcoin/issues/24783).  Converted lint-include-guards.sh to python.

ACKs for top commit:
  KevinMusgrave:
    Tested ACK d5fdec5cf8
  laanwj:
    Code review ACK d5fdec5cf8

Tree-SHA512: cae566fc1b222b447c0d60ea20fd012f1cfde4dd07c1762ede2b2c9f84ed59ee8e629db1264dab8ac20bcac410e4c389827addf0a59757f94b40a65ea9bab466
2022-04-25 18:14:54 +02:00
Gregory Sanders
df08c23f01 Precomputed hashes are note #16 in BIP341 2022-04-25 11:58:42 -04:00
laanwj
c90b42bcdb
Merge bitcoin/bitcoin#24916: lint: Convert lint-python-utf8-encoding.sh to Python
035eef4be6 lint: Convert lint-python-utf8-encoding.sh to Python (Dimitri)

Pull request description:

  A port of `test/lint/lint-python-utf8-encoding.sh` to a Python-script as part of the request of #24783. Checked for output-consistency.

ACKs for top commit:
  laanwj:
    Code review ACK 035eef4be6

Tree-SHA512: a8a2f505bf7953d318837182101346c44e73cfd1bf3b5342ff1400fb1c67c5292519fa99db1035da87cf27fb5f5ac5d28871bf55a1c085b5f8a3bb33ff0fa3fb
2022-04-25 17:58:25 +02:00
laanwj
7134327be5
Merge bitcoin/bitcoin#24932: lint: Convert lint-locale-dependence.sh to Python
3043a1bc9d lint: Make known violations more specific in lint-locale-dependence (Dimitri)
229917d3d4 lint: Convert lint-locale-dependence.sh to Python (Dimitri)

Pull request description:

  A port of `test/lint/lint-locale-dependence.sh` to a Python-script as part of the request of #24783. Checked for output-consistency.

ACKs for top commit:
  laanwj:
    Tested and code review ACK 3043a1bc9d

Tree-SHA512: 80555cf7aac156bab5488f85098731d1c12a42667fe7d0df0c35487ab8fc951654a70a15351a759282eabab8319f5aabd8bdb153412b9edc3a9033bef64fd609
2022-04-25 17:53:53 +02:00
laanwj
e88a52e9a2
Merge bitcoin/bitcoin#24973: doc: Add 23.0 release notes
2abfb6cb09 doc: Add 23.0 release notes (laanwj)

Pull request description:

  Add 23.0 release notes from the wiki. We forgot to move these back to the branch, so they go direct-to-master.

  Only change from the wiki is to add the credits.

ACKs for top commit:
  Kvaciral:
    re-ACK 2abfb6cb09
  dunxen:
    Re-ACK  2abfb6c

Tree-SHA512: 8541cb1d258ff9a3c6a42875434ae30638343c3192b268b53b92c8abc7a09685d778c3e44d08aa10da71f87a24933c0485dbc5d32c509c699d30886d57a45aff
2022-04-25 16:14:05 +02:00
laanwj
2abfb6cb09 doc: Add 23.0 release notes 2022-04-25 15:49:59 +02:00
Andrew Chow
4637bbe448 rpc: Explain active and internal in listdescriptors
The current help text for active and internal in listdescriptors is not
particularly helpful. They require the reader to already know what those
terms mean. This help text is updated to actually explain the
definitions of those words in context of a descriptor wallet.
2022-04-25 09:48:03 -04:00
fanquake
10a626a1d6
Merge bitcoin/bitcoin#24955: guix: Improve error message about missed macOS SDK
914076ed5f guix: Improve error message about missed macOS SDK (Hennadii Stepanov)

Pull request description:

  The error message now mentions another option for users to specify the path to the macOS SDK.

ACKs for top commit:
  fanquake:
    ACK 914076ed5f

Tree-SHA512: e8b9a6c8aa984f02cdb4ad1eeb6c22510c0c74c47c831104ac410ef68b3bc40024a52400b5065a3e25603f8a040e72c8c464436cb9a0a018ca73b0d28e0d609d
2022-04-25 10:03:45 +01:00
MarcoFalke
fa870e3d4c
Remove not needed clang-format off comments
Can be reviewed with --word-diff-regex=. --ignore-all-space
2022-04-25 10:55:07 +02:00
fanquake
aa54132bac
Merge bitcoin/bitcoin#24454: tests: Fix calculation of external input weights
9f5ab670e7 tests: Use descriptor that requires both legacy and segwit (Andrew Chow)
8a04a386f7 tests: Calculate input weight more accurately (Andrew Chow)

Pull request description:

  The external input tests with specifying input weight would sometimes result in a test failure because it would add 2 to the calculated byte size in order to account for some of the variation in signature and script sizes. However 1 in 128 signatures are actually 1 byte smaller than we expect, so the difference between the actual signature size and our calculated size becomes 3 bytes which is outside of the tolerance of `assert_fee_amount` and would thus cause the test failure.

  To resolve this, the 2 byte buffer is reduced to 1 byte, so in the above scenario, the difference is 2 bytes which is within the tolerance of `assert_fee_amount`. Additionally, instead of putting a fixed size that we assume is the correct size for the length of the compact size length prefix of data, we actually get the length of the compact size uint.

  Lastly, the size calculation for a scriptWitness was simply incorrect and used fields that did not exist. This is fixed, and the test slightly modified so that it also produces a scriptWitness.

  Fixes #24151

ACKs for top commit:
  jonatack:
    re-ACK 9f5ab670e7
  glozow:
    code review ACK 9f5ab670e7

Tree-SHA512: b7c7ffe8fb0c07bc9e72fbff1f9ef57ee01a57c56bf54b8873345c8b9572c3ce9402b24dc211910b478114a9e6420faef5a4bf8866f38c299971354e54ec4745
2022-04-25 09:54:40 +01:00
fanquake
b31ba3abf8
Merge bitcoin/bitcoin#24948: contrib: macdeploy: fix typo in permissions
51d06df874 contrib: macdeploy: fix permissions typo in gen-sdk script (Pavol Rusnak)

Pull request description:

  Fixes https://github.com/bitcoin/bitcoin/issues/24947

ACKs for top commit:
  laanwj:
    Edit: tested ACK 51d06df874
  hebasto:
    ACK 51d06df874
  fanquake:
    ACK 51d06df874 - recreated the tarball, but didn't run a Guix build.

Tree-SHA512: c8af0690e6059b4f4f15b5b541be27cb7d92d4cedc744320a46b4df8af1fc017d124f0e8067f75cf89aa3d0662777d66e5ce7e0e9c371df6fda377d60ee5f679
2022-04-25 09:45:16 +01:00
John Newbery
b8f17fbcb4 [tests] Move TxOrphange tests to orphange_tests.cpp 2022-04-25 08:37:01 +01:00
Martin Zumsande
dac44fc06f init: disallow reindex-chainstate with optional indexes
It currently leads to corruption (coinstatsindex) or
data duplication (blockfilterindex), so disable it.
2022-04-24 22:28:25 +02:00
MarcoFalke
b1c5991eeb
Merge bitcoin/bitcoin#24812: util/check: Add CHECK_NONFATAL identity function and NONFATAL_UNREACHABLE macro
ee02c8bd9a util/check: Add CHECK_NONFATAL identity function, NONFATAL_UNREACHABLE AND UNREACHABLE macros (Aurèle Oulès)

Pull request description:

  This PR replaces the macro `CHECK_NONFATAL` with an identity function.
  I simplified the usage of `CHECK_NONFATAL` where applicable in `src/rpc`.
  This function is useful in sanity checks for RPC and command-line interfaces.

  Context: https://github.com/bitcoin/bitcoin/pull/24804#discussion_r846182474.

  Also adds `UNREACHABLE_NONFATAL` macro.

ACKs for top commit:
  jonatack:
    ACK ee02c8bd9a
  MarcoFalke:
    ACK ee02c8bd9a 🍨

Tree-SHA512: 3cba09223cd7b22e62fe5d0b46c4a024c1d9957d4268ba6d3fb07fcc0a5854fc0886bb3266184e6a7df5df91373b3e84edd6adf6999c4e934aeef8c043b01aa2
2022-04-24 12:00:05 +02:00
Hennadii Stepanov
914076ed5f
guix: Improve error message about missed macOS SDK 2022-04-24 11:51:38 +02:00
Pavol Rusnak
51d06df874
contrib: macdeploy: fix permissions typo in gen-sdk script 2022-04-22 22:09:44 +02:00
Hennadii Stepanov
be7a5f2fc4
Merge bitcoin-core/gui#587: refactor: Replace GUIUtil::ObjectInvoke() with QMetaObject::invokeMethod()
6958a26aa1 Revert "qt: Add ObjectInvoke template function" (Hennadii Stepanov)
249984f4f9 qt: Replace `GUIUtil::ObjectInvoke()` with `QMetaObject::invokeMethod()` (Hennadii Stepanov)

Pull request description:

  A comment in 5659e73493 states that `GUIUtil::ObjectInvoke`
  > can be replaced by a call to the QMetaObject::invokeMethod functor overload after Qt 5.10

ACKs for top commit:
  w0xlt:
    tACK 6958a26aa1 on Ubuntu 21.10, Qt 5.15.2.
  promag:
    Code review ACK 6958a26aa1.

Tree-SHA512: 6a840289568113cf38df6c1092821d626c2d206768a21d4dc6846b9dcccb4130477adb45ba718bb6bc15a3041871a7df3238983ac03db80406732be597693266
2022-04-22 18:51:37 +02:00
fanquake
505ba39665
Merge bitcoin/bitcoin#22910: net: Encapsulate asmap in NetGroupManager
36f814c0e8 [netgroupman] Remove NetGroupManager::GetAsmap() (John Newbery)
4709fc2019 [netgroupman] Move asmap checksum calculation to NetGroupManager (John Newbery)
1b978a7e8c [netgroupman] Move GetMappedAS() and GetGroup() logic to NetGroupManager (John Newbery)
ddb4101e63 [net] Only use public CNetAddr functions and data in GetMappedAS() and GetGroup() (John Newbery)
6b2268162e [netgroupman] Add GetMappedAS() and GetGroup() (John Newbery)
19431560e3 [net] Move asmap into NetGroupManager (John Newbery)
17c24d4580 [init] Add netgroupman to node.context (John Newbery)
9b3836710b [build] Add netgroup.cpp|h (John Newbery)

Pull request description:

  The asmap data is currently owned by addrman, but is used by both addrman and connman. #22791 made the data const and private (so that it can't be updated by other components), but it is still passed out of addrman as a reference to const, and used by `CNetAddress` to calculate the group and AS of the net address.

  This RFC PR proposes to move all asmap data and logic into a new `NetGroupManager` component. This is initialized at startup, and the client components addrman and connman simply call `NetGroupManager::GetGroup(const CAddress&)` and `NetGroupManager::GetMappedAS(const CAddress&)` to get the net group and AS of an address.

ACKs for top commit:
  mzumsande:
    Code Review ACK 36f814c0e8
  jnewbery:
    CI failure seems spurious. I rebased onto latest master to trigger a new CI run, but whilst I was doing that, mzumsande ACKed 36f814c0e8, so I've reverted to that.
  dergoegge:
    Code review ACK 36f814c0e8

Tree-SHA512: 244a89cdfd720d8cce679eae5b7951e1b46b37835fccb6bdfa362856761bb110e79e263a6eeee8246140890f3bee2850e9baa7bc14a388a588e0e29b9d275175
2022-04-22 14:43:14 +01:00
hiago
172c2333f0 Porting lint-assertions.sh to lint-assertions.py 2022-04-22 09:45:12 -03:00
w0xlt
709af67add p2p: replace RecursiveMutex m_total_bytes_sent_mutex with Mutex 2022-04-22 05:40:24 -03:00
w0xlt
8be75fd0f0 p2p: add assertions and negative TS annotations for m_total_bytes_sent_mutex
Co-authored-by: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com>
2022-04-22 05:40:24 -03:00
Andrew Chow
9f5ab670e7 tests: Use descriptor that requires both legacy and segwit 2022-04-21 21:00:36 -04:00
Dimitri
035eef4be6 lint: Convert lint-python-utf8-encoding.sh to Python 2022-04-21 23:26:45 +02:00
Dimitri
3043a1bc9d lint: Make known violations more specific in lint-locale-dependence 2022-04-21 20:03:32 +02:00
Dimitri
229917d3d4 lint: Convert lint-locale-dependence.sh to Python 2022-04-21 19:31:41 +02:00
MarcoFalke
7a4ac713aa
Merge bitcoin/bitcoin#24936: test: compare /mempool/contents response with getrawmempool RPC
bef61496ab test: compare `/mempool/contents` response with `getrawmempool` RPC (brunoerg)
5bc5cbaf31 doc: add reference to `getrawmempool` RPC in `/mempool/contents` REST doc (brunoerg)

Pull request description:

  This PR is similar to #24797, it compares `/mempool/contents` REST response with `getrawmempool` RPC (verbose=True) since they use the same `MempoolToJSON` function.

  Also, adds a reference to `getrawmempool` RPC help to get details about the fields from `/mempool/contents`.

ACKs for top commit:
  0xB10C:
    ACK bef6149

Tree-SHA512: b7e9e9c765ee837986ba167b9234a9b95c9ef0a9ebcc2a03d50f6be6d3aba1480bd77c78111d95df1e4023cde6dfc64bf1e7908d9e5b6f96ca46b76611a4a9b4
2022-04-21 19:01:00 +02:00
laanwj
173c796268
Merge bitcoin/bitcoin#24854: Remove not needed ArithToUint256 roundtrips in tests
fad6d4f952 Remove not needed ArithToUint256 roundtrips in tests (MarcoFalke)
fa456ccb22 Remove duplicate static_asserts (MarcoFalke)

Pull request description:

  No need to go from `arith_uint256`->`uint256` when a `uint256` can be constructed right away.

ACKs for top commit:
  laanwj:
    Code review ACK fad6d4f952

Tree-SHA512: bea901ea5904bf61a0dadf7168c6b126f7e62ff1180d4aa72063c28930a01a8baa57ab0d324226bd4de72fb59559455c29c049d90061f888044198aae1426dcb
2022-04-21 18:05:47 +02:00
Andrew Chow
ab5af9ca72 test: Add test for coinselection tracepoints 2022-04-21 11:17:00 -04:00
Andrew Chow
ca02b68e8a doc: document coin selection tracepoints 2022-04-21 11:11:02 -04:00
laanwj
2513499348
Merge bitcoin/bitcoin#24803: lint: convert submodule linter test to Python
4a9e36dbaf lint: convert submodule linter test to Python (Eunoia)

Pull request description:

  Refs #24783

ACKs for top commit:
  laanwj:
    Tested ACK 4a9e36dbaf

Tree-SHA512: ca25b59acf75cebc79588a6c51dc5c313c8d0bd1d492127815d7b81b36aaffd02815a515d97b355582002f71efc33d46435d0b28fce24497bb99799d9ba57228
2022-04-21 17:10:43 +02:00
laanwj
43bb106613
Merge bitcoin/bitcoin#24213: refactor: use Span in random.*
3ae7791bca refactor: use Span in random.* (pasta)

Pull request description:

  ~This PR does two things~
  1. use a Span<unsigned char> for GetRandBytes and GetStrongRandBytes

  ~2. make GetRand a template for which any integral type can be used, where the default behavior is to return a random integral up to the max of the integral unless a max is provided.
  This simplifies a lot of code from `GetRand(std::numeric_limits<uint64_t>::max()` -> `GetRand<uint64_t>()`~

  MarcoFalke this was inspired by your comment here: https://github.com/bitcoin/bitcoin/pull/24185#issuecomment-1025514263 about using Span, so hopefully I'll be able to get this PR done and merged 😂

  ~Also, if requested I could revert the `GetRand(std::numeric_limits<uint64_t>::max()` -> `GetRand<uint64_t>()` related changes if it ends up causing too many conflicts~

ACKs for top commit:
  laanwj:
    Thank you! Code review re-ACK 3ae7791bca

Tree-SHA512: 12375a83b68b288916ba0de81cfcab4aac14389a66a36811ae850427435eb67dd55e47df9ac3ec47db4e214f4330139e548bec815fff8a3f571484ea558dca79
2022-04-21 16:38:04 +02:00