Commit Graph

43132 Commits

Author SHA1 Message Date
furszy
36a22e5683
ci: make ctest stop on failure
Wastes less resources and notifies the developer faster when
a failure occurs.
2024-11-08 13:06:51 -05:00
Ava Chow
83fab3212c test: Add combinerawtransaction test to rpc_createmultisig
The only coverage of combinerawtransaction is in a legacy wallet only
test. So also use it in rpc_createmultisig so that this RPC remains
tested after the legacy wallet is removed.
2024-11-08 11:49:27 -05:00
merge-script
018e5fcc46
Merge bitcoin/bitcoin#31190: TxDownloadManager followups
5dc94d13d4 fuzz fix: assert MAX_PEER_TX_ANNOUNCEMENTS is not exceeded (glozow)
8351562bec [fuzz] allow negative time jumps in txdownloadman_impl (glozow)
917ab810d9 [doc] comment fixups from n30110 (glozow)

Pull request description:

  Addresses some remaining followups from #30110:
  - https://github.com/bitcoin/bitcoin/pull/30110#discussion_r1818893833
  - https://github.com/bitcoin/bitcoin/pull/30110#discussion_r1819638959
  - https://github.com/bitcoin/bitcoin/pull/30110#discussion_r1819634235

ACKs for top commit:
  naumenkogs:
    ACK 5dc94d13d4
  instagibbs:
    ACK 5dc94d13d4
  theStack:
    ACK 5dc94d13d4

Tree-SHA512: 568de8822b2ba73407d2231d9c8c83e6c53fb929b598102b6135c16805752954b3b9b53f4e698856d4422fd8ac2f58ce7d033e9d8e101ed09986578b7605df66
2024-11-07 17:30:00 +00:00
merge-script
3a5f6027e1
Merge bitcoin/bitcoin#31171: depends: Specify CMake generator explicitly
e2ba823671 depends: Specify CMake generator explicitly (Hennadii Stepanov)

Pull request description:

  Building packages in depends implies using GNU Make. However, this assumption can be wrong in environments where the [`CMAKE_GENERATOR`](https://cmake.org/cmake/help/latest/envvar/CMAKE_GENERATOR.html) variable is set.

  This change explicitly makes CMake use the "Unix Makefiles" generator.

  Can be tested as follows:
  ```
  $ env CMAKE_GENERATOR=Ninja make -C depends
  ```

ACKs for top commit:
  fanquake:
    ACK e2ba823671 - Going forward I think we should look at making this work without having to hard code anything.

Tree-SHA512: e14ed1cec192434fe089d36a83e1e150727a3b299fada80a61fa5b44b0c50e014a774ef1e6cd6df189e25f7a13042a20d4f9605f6ccd32e7782f10adaf5e788f
2024-11-07 17:12:21 +00:00
Vasil Dimov
99d9a093cf
test: clarify log messages when handling SOCKS5 proxy connections
Co-authored-by: Martin Zumsande <mzumsande@gmail.com>
2024-11-07 14:20:59 +01:00
merge-script
c9e67e214f
Merge bitcoin/bitcoin#31238: fuzz: Limit wallet_notifications iterations
fa461d7a43 fuzz: Limit wallet_notifications iterations (MarcoFalke)

Pull request description:

  I don't think the fuzz target has ever found a real issue. The closest being https://github.com/bitcoin/bitcoin/pull/25869

  It is also, by far, the slowest fuzz target. For example, looking at https://cirrus-ci.com/task/5533338067271680?logs=ci#L3974, it takes more than one hour:

  ```
  Run wallet_notifications with args ['/ci_container_base/ci/scratch/build-x86_64-pc-linux-gnu/src/test/fuzz/fuzz', '-runs=1', PosixPath('/ci_container_base/ci/scratch/qa-assets/fuzz_corpora/wallet_notifications')]INFO: Running with entropic power schedule (0xFF, 100).
  INFO: Seed: 1096115652
  INFO: Loaded 1 modules   (625824 inline 8-bit counters): 625824 [0x5628396d9138, 0x562839771dd8),
  INFO: Loaded 1 PC tables (625824 PCs): 625824 [0x562839771dd8,0x56283a0fe7d8),
  INFO:     1287 files found in /ci_container_base/ci/scratch/qa-assets/fuzz_corpora/wallet_notifications
  INFO: -max_len is not provided; libFuzzer will not generate inputs larger than 1047827 bytes
  INFO: seed corpus: files: 1287 min: 1b max: 1047827b total: 11616898b rss: 172Mb
  #16pulse  cov: 14328 ft: 25341 corp: 14/239b exec/s: 5 rss: 204Mb
  #64pulse  cov: 19179 ft: 58412 corp: 61/3587b exec/s: 5 rss: 320Mb
  #128pulse  cov: 19692 ft: 85738 corp: 125/16Kb exec/s: 3 rss: 544Mb
  #256pulse  cov: 19923 ft: 107490 corp: 253/72Kb exec/s: 2 rss: 556Mb
  #512pulse  cov: 20107 ft: 124704 corp: 509/330Kb exec/s: 2 rss: 590Mb
  Slowest unit: 10 s:
  artifact_prefix='./'; Test unit written to ./slow-unit-9fa5f7d7e4afa1626622ef1b3c70a7563eecf11d
  #1024pulse  cov: 20360 ft: 136324 corp: 1009/2488Kb exec/s: 0 rss: 726Mb
  Slowest unit: 23 s:
  artifact_prefix='./'; Test unit written to ./slow-unit-5d99a20de2c2b6bedb0cbaf0ba3743ae3ba13c7c
  Slowest unit: 26 s:
  artifact_prefix='./'; Test unit written to ./slow-unit-8889ecb61bdc0650355e0d0d27c012f3239d07a4
  Slowest unit: 42 s:
  artifact_prefix='./'; Test unit written to ./slow-unit-d16c084282ac1a85fcdc43c48e49836b08446686
  #1289INITED cov: 20409 ft: 138281 corp: 1245/10323Kb exec/s: 0 rss: 880Mb
  #1289DONE   cov: 20409 ft: 138281 corp: 1245/10323Kb lim: 1047827 exec/s: 0 rss: 880Mb
  Done 1289 runs in 3813 second(s)
  ```

  Looking at the flame graphs, it looks like the slow runs spend most of their time in the Knapsack solver. This seems reasonable, because it may run 1000 inner Knapsack iterations 200 times. So reduce the fuzz iterations from 200 to 20 to avoid fuzz timeouts and wasted resources.

ACKs for top commit:
  brunoerg:
    code review ACK fa461d7a43
  dergoegge:
    lgtm ACK fa461d7a43

Tree-SHA512: bee707a3398ab0c729f335f00d8cad63135939831454dd863830fc957b4b51b27064224be0ed15eb76cfcc39de972e4e79b0802940934fbac516840ddc475ab9
2024-11-07 10:27:38 +00:00
Ava Chow
564238aabf
Merge bitcoin/bitcoin#31164: net: Use actual memory size in receive buffer accounting
d22a234ed2 net: Use actual memory size in receive buffer accounting (laanwj)
047b5e2af1 streams: add DataStream::GetMemoryUsage (laanwj)
c3a6722f34 net: Use DynamicUsage(m_type) in CSerializedNetMsg::GetMemoryUsage (laanwj)
c6594c0b14 memusage: Add DynamicUsage for std::string (laanwj)
7596282a55 memusage: Allow counting usage of vectors with different allocators (laanwj)

Pull request description:

  Add a method `CNetMessage::GetMemoryUsage` and use this for accounting of the size of the process receive queue instead of the raw message size (like we already do for the send buffer and `CSerializedNetMsg`).

  This ensures that allocation and deserialization overhead is better taken into account.

  On average, this counts about ~100 extra bytes per packet on x86_64:
  ```
  2024-10-27T09:50:12Z [net] 24 bytes -> 112 bytes
  2024-10-27T10:36:37Z [net] 61 bytes -> 176 bytes
  2024-10-27T10:36:38Z [net] 1285 bytes -> 1392 bytes
  2024-10-27T09:50:21Z [net] 43057 bytes -> 43168 bytes
  ```

ACKs for top commit:
  l0rinc:
    ACK d22a234ed2
  achow101:
    ACK d22a234ed2
  i-am-yuvi:
    ACK d22a234ed2
  danielabrozzoni:
    Light ACK d22a234ed2 - code looks good to me, but I'm not very familiar with C++ memory management specifics

Tree-SHA512: ef09707e77b67bdbc48e9464133e4fccfa5c05051c1022e81ad84f20ed41db83ac5a9b109ebdb8d38f70785c03c5d6bfe51d32dc133d49e52d1e6225f6f8e292
2024-11-06 16:01:07 -05:00
MarcoFalke
fa461d7a43
fuzz: Limit wallet_notifications iterations 2024-11-06 21:30:32 +01:00
secp512k2
ec375de39f
doc: Add missing 'blank=true' option in offline-signing-tutorial.md
Issue:

The text mentions that the `createwallet` command should use the options `disable_private_keys=true, blank=true`, but the provided command only includes `disable_private_keys=true`, missing the `blank=true` option.

Correction:

Added `blank=true` to the command to match the options described in the text.

Explanation:

The `blank=true` option is necessary to create a blank wallet. Including this option ensures the command matches the options specified in the text.
2024-11-06 10:36:30 -08:00
Hennadii Stepanov
5a96767e3f
depends, libevent: Do not install *.pc files and remove patches for them 2024-11-06 15:40:42 +00:00
Hennadii Stepanov
ffda355b5a
cmake, refactor: Move HAVE_EVHTTP_... to libevent interface 2024-11-06 15:40:42 +00:00
Hennadii Stepanov
b619bdc330
cmake: Revamp FindLibevent module
This change generalizes the use of `find_package` / `pkg_check_modules`,
prioritizing the former.
2024-11-06 15:40:34 +00:00
merge-script
2c90f8e08c
Merge bitcoin/bitcoin#31232: ci: add second_deadlock_stack=1 to TSAN options
5161c2618c ci: add second_deadlock_stack=1 to TSAN options (fanquake)

Pull request description:

  This is mentioned in the developer notes, but isn't present in `TSAN_OPTIONS`, resulting in:
  ```bash
  WARNING: ThreadSanitizer: lock-order-inversion (potential deadlock) (pid=60508)
    Cycle in lock order graph: M0 (0xffff98e02208) => M1 (0xffff98e0cbe8) => M2 (0xffff98e0cd98) => M0
  <snip>

    Hint: use TSAN_OPTIONS=second_deadlock_stack=1 to get more informative warning message
  ```

  Add it, for (potentially) more informative output, when failures occur. Checked that adding does output more information.

ACKs for top commit:
  maflcko:
    lgtm ACK 5161c2618c
  hebasto:
    ACK 5161c2618c.

Tree-SHA512: 57bfa24d248ed76ba0db537edff425453a0765c4768fc1b6f59a87876d4acf63ed38bb3c20f369a008ae256472d9d24e58d76729d423f662dfdb2952afc46cb0
2024-11-06 15:04:06 +00:00
glozow
5dc94d13d4 fuzz fix: assert MAX_PEER_TX_ANNOUNCEMENTS is not exceeded
Previously this assertion checked MAX_PEER_TX_REQUEST_IN_FLIGHT was not
exceeded. However, this property is not actually enforced; it is just
used to determine when a peer is overloaded.
2024-11-06 09:29:11 -03:00
merge-script
45e2f8f87d
Merge bitcoin/bitcoin#31173: cmake: Add FindQRencode module and enable libqrencode package for MSVC
9e5089dbb0 build, msvc: Enable `libqrencode` vcpkg package (Hennadii Stepanov)
30089b0cb6 cmake: Add `FindQRencode` module (Hennadii Stepanov)

Pull request description:

  This PR introduces the `FindQRencode` CMake module, following the official CMake [guidelines](https://cmake.org/cmake/help/latest/manual/cmake-developer.7.html#find-modules) for managing [upstream libraries](https://github.com/fukuchi/libqrencode) that lack a config file package. This module enhances flexibility in locating the `libqrencode` library by making the use of `pkg-config` optional.

  With this update, `libqrencode` can be detected on systems where either `pkg-config` or the `libqrencode.pc` file is unavailable, such as Windows environments using the vcpkg package manager. However, if `libqrencode.pc` is available, it remains beneficial as the only direct source of the library's version information.

  Additionally, the `libqrencode` vcpkg package is enabled for MSVC builds.

  Here is a diff for configuration output on Ubuntu 24.10:
  ```diff
   -- Detecting CXX compile features - done
   -- Found SQLite3: /usr/include (found suitable version "3.46.1", minimum required is "3.7.17")
   -- Found PkgConfig: /usr/bin/pkg-config (found version "1.8.1")
  --- Checking for module 'libqrencode'
  ---   Found libqrencode, version 4.1.1
  +-- Found QRencode: /usr/lib/x86_64-linux-gnu/libqrencode.so (found version "4.1.1")
   -- Found Qt: /usr/lib/x86_64-linux-gnu/cmake/Qt5 (found suitable version "5.15.15", minimum required is "5.11.3")
   -- Performing Test CXX_SUPPORTS__WERROR
   -- Performing Test CXX_SUPPORTS__WERROR - Success
  ```

ACKs for top commit:
  fanquake:
    ACK 9e5089dbb0

Tree-SHA512: bb9baca64386772f2f4752b1cbff1230792562ca6b2e37c56ad28580b55b1ae6ff65c2cf0d8ab026111d7b5a056d7ac672496a3cfd1a81e4fdd2b84c8cf75fff
2024-11-06 12:11:39 +00:00
merge-script
80cb630bd9
Merge bitcoin/bitcoin#31216: Update secp256k1 subtree to v0.6.0
97235c446e build: Disable secp256k1 musig module (Ava Chow)
2d46a89386 Squashed 'src/secp256k1/' changes from 2f2ccc46954..0cdc758a563 (Ava Chow)

Pull request description:

  v0.6.0 was just released, main change is that it has the musig module which #29675 needs.

ACKs for top commit:
  hebasto:
    ACK 97235c446e, verified by updating the secp256k1 subtree locally.
  laanwj:
    ACK 97235c446e

Tree-SHA512: af92da26fc9afb55399b73d80198c0d2aa1adfae7b91f0ad20ffeb519135baf7e78243049b9bd45a2027943931b2d657c944f93151e5200d95a6f3c90b831f31
2024-11-06 11:15:23 +00:00
fanquake
5161c2618c
ci: add second_deadlock_stack=1 to TSAN options
This is mentioned in the developer notes, but isn't present in
`TSAN_OPTIONS`, resulting in:
```bash
WARNING: ThreadSanitizer: lock-order-inversion (potential deadlock) (pid=60508)
  Cycle in lock order graph: M0 (0xffff98e02208) => M1 (0xffff98e0cbe8) => M2 (0xffff98e0cd98) => M0
<snip>

  Hint: use TSAN_OPTIONS=second_deadlock_stack=1 to get more informative warning message
```

Add it, for (potentially) more informative output, when failures
occur. Checked that adding does output more information.
2024-11-06 11:03:41 +00:00
merge-script
85224f92d5
Merge bitcoin/bitcoin#30811: build: Unify -logsourcelocations format
788c1324f3 build: Unify `-logsourcelocations` format (Hennadii Stepanov)

Pull request description:

  Closes https://github.com/bitcoin/bitcoin/issues/30799:

  ```
  $ ./build/src/bitcoind -logsourcelocations -asmap=/tmp/no_file 2>&1 | head -1
  2024-11-04T11:40:36Z [init/common.cpp:149] [LogPackageVersion] Bitcoin Core version v28.99.0-788c1324f3d8 (release build)
  ```

ACKs for top commit:
  maflcko:
    re-ACK 788c1324f3
  fanquake:
    ACK 788c1324f3

Tree-SHA512: 5e2ac9c3fda148717271c0fa765382cfdfc8e714e5173095ca528ab7026bf0c422222d7da56f55c082c56fc64fd25b5ba71a05e54f6226be327be4598ad9a9f3
2024-11-06 09:57:56 +00:00
merge-script
9719d373dc
Merge bitcoin/bitcoin#30634: ci: Use clang-19 from apt.llvm.org
fabe90c824 ci: Use clang-19 from apt.llvm.org (MarcoFalke)

Pull request description:

  A new clang version generally comes with bugfixes, new sanitizer features, deprecations, as well as new features.

  Upgrade the sanitizer tasks to use the new version.

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

Tree-SHA512: 637452e3cbc8ad97a3650976e2dbf4bcd032f2c454e12b48514eb5d252b3e106448674fe2d3bf45d11c0782874250d7a79e34fbb0aaa990499a156fcafd50329
2024-11-06 09:43:24 +00:00
secp512k2
ac286e0d1b
doc: Fix grammatical errors in multisig-tutorial.md
This pull request fixes grammatical errors in the 'multisig-tutorial.md' document.

Corrections:

1. Incorrect Phrase "As can been seen":

   - Before:

     There are discussions about eliminating this redundancy, as can been seen in the issue #17190 (https://github.com/bitcoin/bitcoin/issues/17190).

   - After:

     There are discussions about eliminating this redundancy, as can be seen in the issue #17190 (https://github.com/bitcoin/bitcoin/issues/17190).

2. Clarity Improvement in a Sentence:

   - Before:

     Note that at least two descriptors are usually used, one for internal derivation paths and external ones.

   - After:

     Note that at least two descriptors are usually used, one for internal derivation paths and one for external ones.

Explanation:

- Corrected "been" to "be" to fix the grammatical error.
- Added "one for" before "external ones" to improve clarity and parallel structure in the sentence.

These minor corrections enhance the readability and professionalism of the documentation. Thank you for considering this pull request.
2024-11-05 12:13:02 -08:00
Ava Chow
97235c446e build: Disable secp256k1 musig module
The musig module is currently unused so disable it.
2024-11-05 15:08:49 -05:00
Hennadii Stepanov
9e5089dbb0
build, msvc: Enable libqrencode vcpkg package 2024-11-05 16:38:56 +00:00
Hennadii Stepanov
30089b0cb6
cmake: Add FindQRencode module 2024-11-05 16:38:19 +00:00
merge-script
65b1941936
Merge bitcoin/bitcoin#31186: msvc: Update vcpkg manifest
f6577b7174 build, msvc: Update vcpkg manifest baseline (Hennadii Stepanov)
16e16013bf build, msvc: Document `libevent` version pinning (Hennadii Stepanov)
ec47cd2b50 build, msvc: Drop no longer needed `liblzma` version pinning (Hennadii Stepanov)
9a0734df5f build, msvc: Reorder keys in `vcpkg.json` (Hennadii Stepanov)

Pull request description:

  This PR updates the vcpkg manifest baseline from the [2023.08.09 Release ](https://github.com/microsoft/vcpkg/releases/tag/2023.08.09) to the [2024.09.30 Release](https://github.com/microsoft/vcpkg/releases/tag/2024.09.30), with the following package changes:
  - `boost`: 1.82.0#2 --> 1.85.0#1,2
  - `qt5`: 5.15.10#5 -> 5.15.15
  - `sqlite3`: 3.42.0#1 --> 3.46.1
  - `zeromq`: 2023-06-20#1 --> 4.3.5#2

  The previous update was made in https://github.com/bitcoin/bitcoin/pull/28938.

  For additional minor improvements, please refer to the commit messages.

ACKs for top commit:
  fanquake:
    ACK f6577b7174

Tree-SHA512: bfd6f995d97cd3222573ac1c3626c13ee68cf3e2de344869a2d91775090d60f63ef2b17d9a59eba46620eedd51d6787aebe3aeed1189ec55379211a186c21b4e
2024-11-05 16:26:18 +00:00
merge-script
d338872083
Merge bitcoin/bitcoin#31206: doc: Use relative hyperlinks in release-process.md
9f71cff6ab doc: Use relative hyperlinks in release-process.md (Jeremy Rand)

Pull request description:

  Improves usability with offline clones of the documentation.

  Refs
  https://github.com/bitcoin/bitcoin/pull/30025#issuecomment-2093081127

ACKs for top commit:
  maflcko:
    review ACK 9f71cff6ab

Tree-SHA512: 475603556e111ec21e656e9d105f742e6881fbfce220347951c96406ffe8a71da0b10a0631dd2da89f59e9b76d5d9980b3e5c8f97a9c2562ff58422ae41d1343
2024-11-05 16:16:16 +00:00
merge-script
ffc05fca6f
Merge bitcoin/bitcoin#31220: doc: Fix word order in developer-notes.md
44939e5de1 doc: Fix word order in developer-notes.md (secp512k2)

Pull request description:

  This pull request fixes a word order error in developer-notes.md.

ACKs for top commit:
  fanquake:
    ACK 44939e5de1

Tree-SHA512: f8c8f2a976940c6fb3483c13c048accd073a8486e0d614ca9da15bf166c41f1f1c1cd57678359af04a32c5ffa15afa647a3f015f89c83997c69803a62fad8de6
2024-11-05 16:14:12 +00:00
merge-script
9f2c8287a2
Merge bitcoin/bitcoin#31192: depends, doc: List packages required to build qt package separately
4747f03095 depends, doc: List packages required to build `qt` package separately (Hennadii Stepanov)

Pull request description:

  Suggested in https://github.com/bitcoin/bitcoin/pull/30997#discussion_r1791789613:
  > There's probably enough GUI-only stuff here, i.e `bison`, `ninja-build`, `python3`, `xz-utils`, that this could be moved to it's own `#### Gui` section.

ACKs for top commit:
  fanquake:
    ACK 4747f03095

Tree-SHA512: 090af77606e9c1f87b3466d6a6c97745af456943495bc7df46cdb5e955f641c39da8a6f7590fd1cc0ea816e320d7c336a860faffc2b35b0d5014dabbc490d9f9
2024-11-05 16:13:09 +00:00
Ryan Ofsky
03cff2c142
Merge bitcoin/bitcoin#31191: build: Make G_FUZZING constexpr, require -DBUILD_FOR_FUZZING=ON to fuzz
fafbf8acf4 Make G_FUZZING constexpr, require -DBUILD_FOR_FUZZING=ON to execute a fuzz target (MarcoFalke)
fae3cf0ffa ci: Temporarily disable macOS/Windows fuzz step (MarcoFalke)

Pull request description:

  `g_fuzzing` is used inside `Assume` at runtime, causing significant overhead in hot paths. See https://github.com/bitcoin/bitcoin/issues/31178

  One could simply remove the `g_fuzzing` check from the `Assume`, but this would make fuzzing a bit less useful. Also, it would be unclear if `g_fuzzing` adds a runtime overhead in other code paths today or in the future.

  Fix all issues by making `G_FUZZING` equal to the build option `BUILD_FOR_FUZZING`, and for consistency in fuzzing, require it to be set when executing any fuzz target.

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

  Temporarily this drops fuzzing from two CI tasks, but they can be re-added in a follow-up with something like https://github.com/bitcoin/bitcoin/pull/31073

ACKs for top commit:
  marcofleon:
    Tested ACK fafbf8acf4
  davidgumberg:
    I still ACK fafbf8acf4 for fixing the regression measured in #31178.
  ryanofsky:
    Code review ACK fafbf8acf4 but approach -0, because this approach means libraries built for fuzz testing do not function correctly if used in a release, and libraries built for releases are mostly useless for fuzz testing. So I would like to at least consider other solutions to this problem even if we go with this one.
  dergoegge:
    utACK fafbf8acf4

Tree-SHA512: 124fc2e8b35e0c4df414436556a7a0a36cd1bec4b3000b40dcf2ab8c85f32e0610bf7f70d2fd79223d62f3c3665b6c09da21241654c7b9859461b8ca340d5421
2024-11-05 06:05:27 -05:00
secp512k2
44939e5de1
doc: Fix word order in developer-notes.md
This pull request fixes a word order error in developer-notes.md.

Before:

"In cases where do you call .c_str(), you might want to additionally check that the string does not contain embedded '\0' characters..."

After:

"In cases where you do call .c_str(), you might want to additionally check that the string does not contain embedded '\0' characters..."

Explanation:

The sentence had incorrect word order, making it grammatically incorrect. Rearranging "do you" to "you do" corrects the sentence, improving the readability and clarity of the documentation.
2024-11-04 20:05:14 -08:00
Ava Chow
b934954ad1
Merge bitcoin/bitcoin#30670: doc: Extend developer-notes with file-name-only debugging fix
1b0b9b4c78 Extend possible debugging fixes with file-name-only (Lőrinc)
cb7c5ca824 Add gdb and lldb links to debugging troubleshooting (Lőrinc)

Pull request description:

  Split out of https://github.com/bitcoin/bitcoin/pull/30454#discussion_r1714285678

  While testing the new `cmake` build with [CLion](https://youtrack.jetbrains.com/issue/CPP-15850/Debugger-doesnt-stop-on-breakpoints-in-case-of-fdebug-prefix-map#focus=Comments-27-4926356.0-0), I noticed that the tests don't always stop at the set breakpoints, so I've updated the `developer-notes.md`, hoping it will be useful for others experiencing the same.

  Added links to  gdb and lldb documentations.

  Assumed a default directory (similarly to https://github.com/hebasto/bitcoin/pull/328/files#diff-4d2a64ce14cb8b971dbba9455421b04ae7ed0c489c66d983664be5632b0de4a3R19) to make the commands more realistic.

  Extended the possible debugging fixes with `file-name-only` option.

ACKs for top commit:
  achow101:
    ACK 1b0b9b4c78
  laanwj:
    ACK 1b0b9b4c78

Tree-SHA512: 11d2fa69074d6301ee0ca94bc7adb4f251e270624b733c03abc0b91ddb4c9e810d31bd8cbebaebf893974cd85aa14fff94504b93d9c1c46ace64349a84041b41
2024-11-04 15:54:32 -05:00
Ava Chow
05aebe3790
Merge bitcoin/bitcoin#30930: netinfo: add peer services column and outbound-only option
87532fe558 netinfo: allow setting an outbound-only peer list (Jon Atack)
681ebcceca netinfo: rename and hoist max level constant to use in top-level help (Jon Atack)
e7d307ce8c netinfo: clarify relaytxes and addr_relay_enabled help docs (Jon Atack)
eef2a9d406 netinfo: add peer services column (Jon Atack)

Pull request description:

  Been using this since May 2023.

  - add a peer services column (considered displaying the p2p_v2 flag as "p" or "2"; proposing "2" here for continuity with the "v" column, but "p" is fine for me as well)
  - clarify in the help that "relaytxes" and "addr_relay_enabled" are from getpeerinfo
  - hoist (and rename) the max level constant to use in top-level help, to avoid overlooking to update the top-level help if the value of the constant changes (as caught by Larry Ruane in review below)
  - add an optional "outonly" (or "o") argument for an outbound-only peer list, as suggested by Vasil Dimov in his review below. Several people have requested this, to keep the output within screen limits when running netinfo as a live dashboard (i.e. with `watch`) on a node with many peers. While doing this, also permit passing "h" for the help in addition to "help".

ACKs for top commit:
  achow101:
    ACK 87532fe558
  rkrux:
    tACK 87532fe558
  tdb3:
    cr re ACK 87532fe558
  brunoerg:
    crACK 87532fe558

Tree-SHA512: 35b1b0de28dfecaad58bf5af194757a5e0f563553cf69ea4d76f2e1963f8d662717254df2549114c7bba4a041bf5282d5cb3fba8d436b2807f2a00560787d64c
2024-11-04 15:50:59 -05:00
Ava Chow
0ba680d41b Update secp256k1 subtree to v0.6.0 2024-11-04 14:59:46 -05:00
Ava Chow
2d46a89386 Squashed 'src/secp256k1/' changes from 2f2ccc46954..0cdc758a563
0cdc758a563 Merge bitcoin-core/secp256k1#1631: release: prepare for 0.6.0
39d5dfd542a release: prepare for 0.6.0
df2eceb2790 build: add ellswift.md and musig.md to release tarball
a306bb7e903 tools: fix check-abi.sh after cmake out locations were changed
145868a84d2 Do not export `secp256k1_musig_nonce_gen_internal`
b161bffb8bf Merge bitcoin-core/secp256k1#1579: Clear sensitive memory without getting optimized out (revival of #636)
a38d879a1a6 Merge bitcoin-core/secp256k1#1628: Name public API structs
7d48f5ed02e Merge bitcoin-core/secp256k1#1581: test, ci: Lower default iteration count to 16
694342fdb71 Name public API structs
0f73caf7c62 test, ci: Lower default iteration count to 16
9a8db52f4e9 Merge bitcoin-core/secp256k1#1582: cmake, test: Add `secp256k1_` prefix to test names
765ef53335a Clear _gej instances after point multiplication to avoid potential leaks
349e6ab916b Introduce separate _clear functions for hash module
99cc9fd6d01 Don't rely on memset to set signed integers to 0
97c57f42ba8 Implement various _clear() functions with secp256k1_memclear()
9bb368d1466 Use secp256k1_memclear() to clear stack memory instead of memset()
e3497bbf001 Separate between clearing memory and setting to zero in tests
d79a6ccd43a Separate secp256k1_fe_set_int( . , 0 ) from secp256k1_fe_clear()
1c081262227 Add secp256k1_memclear() for clearing secret data
1464f15c812 Merge bitcoin-core/secp256k1#1625: util: Remove unused (u)int64_t formatting macros
980c08df80a util: Remove unused (u)int64_t formatting macros
9b7c59cbb90 Merge bitcoin-core/secp256k1#1624: ci: Update macOS image
096e3e23f63 ci: Update macOS image
e7d384488e8 Don't clear secrets in pippenger implementation
68b55209f1b Merge bitcoin-core/secp256k1#1619: musig: ctimetests: fix _declassify range for generated nonce points
f0868a9b3d8 Merge bitcoin-core/secp256k1#1595: build: 45839th attempt to fix symbol visibility on Windows
1fae76f50c0 Merge bitcoin-core/secp256k1#1620: Remove unused scratch space from API
8be3839fb2e Remove unused scratch space from API
57eda3ba300 musig: ctimetests: fix _declassify range for generated nonce points
87384f5c0f2 cmake, test: Add `secp256k1_` prefix to test names
e59158b6eb7 Merge bitcoin-core/secp256k1#1553: cmake: Set top-level target output locations
18f9b967c25 Merge bitcoin-core/secp256k1#1616: examples: do not retry generating seckey randomness in musig
5bab8f6d3c4 examples: make key generation doc consistent
e8908221a45 examples: do not retry generating seckey randomness in musig
70b6be1834e extrakeys: improve doc of keypair_create (don't suggest retry)
01b5893389e Merge bitcoin-core/secp256k1#1599: #1570 improve examples: remove key generation loop
cd4f84f3ba8 Improve examples/documentation: remove key generation loops
a88aa935063 Merge bitcoin-core/secp256k1#1603: f can never equal -m
3660fe5e2a9 Merge bitcoin-core/secp256k1#1479: Add module "musig" that implements MuSig2 multi-signatures (BIP 327)
168c92011f5 build: allow enabling the musig module in cmake
f411841a46b Add module "musig" that implements MuSig2 multi-signatures (BIP 327)
0be79660f38 util: add constant-time is_zero_array function
c8fbdb1b972 group: add ge_to_bytes_ext and ge_from_bytes_ext
ef7ff03407f f can never equal -m
c232486d84e Revert "cmake: Set `ENVIRONMENT` property for examples on Windows"
26e4a7c2146 cmake: Set top-level target output locations
4c57c7a5a95 Merge bitcoin-core/secp256k1#1554: cmake: Clean up testing code
447334cb06d include: Avoid visibility("default") on Windows
472faaa8ee6 Merge bitcoin-core/secp256k1#1604: doc: fix typos in `secp256k1_ecdsa_{recoverable_,}signature` API description
292310fbb24 doc: fix typos in `secp256k1_ecdsa_{recoverable_,}signature` API description
85e224dd97f group: add ge_to_bytes and ge_from_bytes
7c987ec89e6 cmake: Call `enable_testing()` unconditionally
6aa576515ef cmake: Delete `CTest` module

git-subtree-dir: src/secp256k1
git-subtree-split: 0cdc758a56360bf58a851fe91085a327ec97685a
2024-11-04 14:59:46 -05:00
laanwj
d22a234ed2 net: Use actual memory size in receive buffer accounting
Add a method CNetMessage::GetMemoryUsage and use this for accounting of
the size of the process receive queue instead of the raw message size.

This ensures that allocation and deserialization overhead is taken into
account.
2024-11-04 18:46:40 +01:00
laanwj
047b5e2af1 streams: add DataStream::GetMemoryUsage 2024-11-04 18:46:40 +01:00
laanwj
c3a6722f34 net: Use DynamicUsage(m_type) in CSerializedNetMsg::GetMemoryUsage
Now that memusage correctly computes the dynamic size of a string, there
is no need for special handling here.
2024-11-04 18:46:40 +01:00
laanwj
c6594c0b14 memusage: Add DynamicUsage for std::string
Add DynamicUsage(std::string) which Returns the dynamic allocation of a std::string,
or 0 if none (in case of small string optimization).
2024-11-04 18:46:40 +01:00
laanwj
7596282a55 memusage: Allow counting usage of vectors with different allocators 2024-11-04 17:04:08 +01:00
merge-script
6463117a29
Merge bitcoin/bitcoin#31208: doc: archive release notes for v27.2
1a05c86ae4 doc: archive release notes for v27.2 (fanquake)

Pull request description:

  Archive `v27.2`.

ACKs for top commit:
  laanwj:
    ACK 1a05c86ae4 , matches release notes on branch

Tree-SHA512: 8c29f2c0acd32092d00e64e4d9d9758d3191263ec190e30f0b65f5ac0e2bf78c571268bbe317d0bf50537d9f2f9c804080d560c8b81d015362c02da8d9cbee15
2024-11-04 12:20:04 +00:00
Hennadii Stepanov
788c1324f3
build: Unify -logsourcelocations format 2024-11-04 11:30:43 +00:00
Hennadii Stepanov
4747f03095
depends, doc: List packages required to build qt package separately 2024-11-04 11:22:33 +00:00
fanquake
1a05c86ae4
doc: archive release notes for v27.2 2024-11-04 11:19:54 +00:00
Lőrinc
42066f45ff Refactor SipHash_32b benchmark to improve accuracy and avoid optimization issues
- Modify `SipHash_32b` benchmark to use `FastRandomContext` for generating initial values.
- Cycle through and modify each byte of the `uint256` value to ensure no part of it can be optimized away.

The lack of "recursion" (where the method call overwrites the used inputs partially) and the systematic modification of each input byte makes the benchmark usage more reliable and thorough.
2024-11-03 12:36:49 +01:00
Jeremy Rand
9f71cff6ab
doc: Use relative hyperlinks in release-process.md
Improves usability with offline clones of the documentation.

Refs
https://github.com/bitcoin/bitcoin/pull/30025#issuecomment-2093081127
2024-11-03 10:45:31 +00:00
Ava Chow
f1bcf3edc5
Merge bitcoin/bitcoin#31139: test: added test to assert TX decode rpc error on submitpackage rpc
d7fd766feb test: added test to assert TX decode rpc error on submitpackage rpc (kevkevinpal)

Pull request description:

  This PR adds coverage for this line https://github.com/bitcoin/bitcoin/blob/master/src/rpc/mempool.cpp#L996

  If you run the following you will get no results for `submitpackage`
  `grep -nri "TX decode failed" ./test/functional`

ACKs for top commit:
  achow101:
    ACK d7fd766feb
  instagibbs:
    reACK d7fd766feb
  tdb3:
    ACK d7fd766feb
  rkrux:
    reACK d7fd766feb

Tree-SHA512: e92e0e2621a4efab35625d8da3ac61ccb7fa65c378aa977112bc132fd3b42431f8c3ceb081f7c9903ed2833c229042b65bdb11444e1d6367354ae65dc7504231
2024-11-01 17:21:04 -04:00
Ava Chow
975b115e1a
Merge bitcoin/bitcoin#31198: init: warn, don't error, when '-upnp' is set
a1b3ccae4b init: warn, don't error, when '-upnp' is set (Antoine Poinsot)

Pull request description:

  It prevented the GUI from starting when its settings.json had the -upnp option set. This also doesn't prevent the node from running, so this error didn't need to be fatal.

  Thanks to Sjors for bringing attention to what i broke and to Maflcko for suggesting a simple short term fix.

  Fixes https://github.com/bitcoin-core/gui/issues/843.

ACKs for top commit:
  maflcko:
    lgtm ACK a1b3ccae4b
  kevkevinpal:
    Concept ACK [a1b3cca](a1b3ccae4b)
  achow101:
    ACK a1b3ccae4b
  tdb3:
    ACK a1b3ccae4b

Tree-SHA512: ceb1513bf532698e5143d64430a065f39626ef0d2708103ffc8ab7f81e8393f488af2350c5a299bc80f966add82a3951b4d81ae8b0e3070c0d15c94e8db4badd
2024-11-01 17:15:26 -04:00
merge-script
4a0251c05d
Merge bitcoin/bitcoin#31187: ci: Do not error on unused-member-function in test each commit
54d07dd37d ci: Do not error on unused-member-function in test each commit (Sergi Delgado Segura)

Pull request description:

  After https://github.com/bitcoin/bitcoin/pull/31045, an unused method in a commit will trigger a compilation error, even if that method is later used in a following commit within the same PR.

  Do not enforce unused-member-function in test each commit.

  Close #31180

ACKs for top commit:
  kevkevinpal:
    lgtm ACK [54d07dd](54d07dd37d)
  maflcko:
    lgtm ACK 54d07dd37d
  TheCharlatan:
    lgtm ACK 54d07dd37d

Tree-SHA512: 79723ca604d44b065b08793b442de9049a689cc5a4df508299a91966456bf77e24a0f3febaf3114fd23b061716554b70ee866bf594283960d952366ea2096dbc
2024-11-01 16:40:32 +00:00
merge-script
e001dc3dc6
Merge bitcoin/bitcoin#31203: fuzz: fix implicit-integer-sign-change in wallet_create_transaction
5a26cf7773 fuzz: fix `implicit-integer-sign-change` in wallet_create_transaction (brunoerg)

Pull request description:

  This PR limites the value of `m_confirm_target` to avoid `implicit-integer-sign-change`:
  ```
  /ci_container_base/src/wallet/fees.cpp:58:58: runtime error: implicit conversion from type 'unsigned int' of value 4294967292 (32-bit, unsigned) to type 'int' changed the value to -4 (32-bit, signed)
      #0 0x55b6fd26c021 in wallet::GetMinimumFeeRate(wallet::CWallet const&, wallet::CCoinControl const&, FeeCalculation*) ci/scratch/build-x86_64-pc-linux-gnu/src/wallet/./src/wallet/fees.cpp:58:58
      #1 0x55b6fd3ef5ca in wallet::CreateTransactionInternal(wallet::CWallet&, std::vector<wallet::CRecipient, std::allocator<wallet::CRecipient>> const&, std::optional<unsigned int>, wallet::CCoinControl const&, bool) ci/scratch/build-x86_64-pc-linux-gnu/src/wallet/./src/wallet/spend.cpp:1101:49
      #2 0x55b6fd3ebea5 in wallet::CreateTransaction(wallet::CWallet&, std::vector<wallet::CRecipient, std::allocator<wallet::CRecipient>> const&, std::optional<unsigned int>, wallet::CCoinControl const&, bool) ci/scratch/build-x86_64-pc-linux-gnu/src/wallet/./src/wallet/spend.cpp:1382:16
      #3 0x55b6fccbc154 in wallet::(anonymous namespace)::wallet_create_transaction_fuzz_target(std::span<unsigned char const, 18446744073709551615ul>) ci/scratch/build-x86_64-pc-linux-gnu/src/test/fuzz/./src/wallet/test/fuzz/spend.cpp:99:11
      #4 0x55b6fccda45d in std::function<void (std::span<unsigned char const, 18446744073709551615ul>)>::operator()(std::span<unsigned char const, 18446744073709551615ul>) const /usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/std_function.h:591:9
      #5 0x55b6fccda45d in LLVMFuzzerTestOneInput ci/scratch/build-x86_64-pc-linux-gnu/src/test/fuzz/util/./src/test/fuzz/fuzz.cpp:211:5
      #6 0x55b6fc368484 in fuzzer::Fuzzer::ExecuteCallback(unsigned char const*, unsigned long) (/ci_container_base/ci/scratch/build-x86_64-pc-linux-gnu/src/test/fuzz/fuzz+0x1c8a484) (BuildId: d11f8692b05f02b5a14b6e7579598b426e3144c5)
      #7 0x55b6fc367b79 in fuzzer::Fuzzer::RunOne(unsigned char const*, unsigned long, bool, fuzzer::InputInfo*, bool, bool*) (/ci_container_base/ci/scratch/build-x86_64-pc-linux-gnu/src/test/fuzz/fuzz+0x1c89b79) (BuildId: d11f8692b05f02b5a14b6e7579598b426e3144c5)
      #8 0x55b6fc369796 in fuzzer::Fuzzer::ReadAndExecuteSeedCorpora(std::vector<fuzzer::SizedFile, std::allocator<fuzzer::SizedFile>>&) (/ci_container_base/ci/scratch/build-x86_64-pc-linux-gnu/src/test/fuzz/fuzz+0x1c8b796) (BuildId: d11f8692b05f02b5a14b6e7579598b426e3144c5)
      #9 0x55b6fc369ca7 in fuzzer::Fuzzer::Loop(std::vector<fuzzer::SizedFile, std::allocator<fuzzer::SizedFile>>&) (/ci_container_base/ci/scratch/build-x86_64-pc-linux-gnu/src/test/fuzz/fuzz+0x1c8bca7) (BuildId: d11f8692b05f02b5a14b6e7579598b426e3144c5)
      #10 0x55b6fc35719f in fuzzer::FuzzerDriver(int*, char***, int (*)(unsigned char const*, unsigned long)) (/ci_container_base/ci/scratch/build-x86_64-pc-linux-gnu/src/test/fuzz/fuzz+0x1c7919f) (BuildId: d11f8692b05f02b5a14b6e7579598b426e3144c5)
      #11 0x55b6fc381826 in main (/ci_container_base/ci/scratch/build-x86_64-pc-linux-gnu/src/test/fuzz/fuzz+0x1ca3826) (BuildId: d11f8692b05f02b5a14b6e7579598b426e3144c5)
      #12 0x7f934c6661c9  (/lib/x86_64-linux-gnu/libc.so.6+0x2a1c9) (BuildId: 6d64b17fbac799e68da7ebd9985ddf9b5cb375e6)
      #13 0x7f934c66628a in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2a28a) (BuildId: 6d64b17fbac799e68da7ebd9985ddf9b5cb375e6)
      #14 0x55b6fc34c184 in _start (/ci_container_base/ci/scratch/build-x86_64-pc-linux-gnu/src/test/fuzz/fuzz+0x1c6e184) (BuildId: d11f8692b05f02b5a14b6e7579598b426e3144c5)

  SUMMARY: UndefinedBehaviorSanitizer: implicit-integer-sign-change /ci_container_base/src/wallet/fees.cpp:58:58
  MS: 0 ; base unit: 0000000000000000000000000000000000000000
  0x2e,0x1,0xb0,0xb8,0x0,0xff,0xff,0xff,0xff,0x60,0x14,0x22,0xff,0xff,0xff,0xff,0xff,0xfd,0xff,0xff,0xff,0xff,0xff,0x7e,0xf9,0x41,0x8,0x2b,0x17,0x58,0xb,0x17,0xfc,0xff,0xff,0xff,0xff,0xff,0xff,0x7e,0xf9,0x41,0x8,0x2b,0x17,0x58,0xb,
  .\001\260\270\000\377\377\377\377`\024\"\377\377\377\377\377\375\377\377\377\377\377~\371A\010+\027X\013\027\374\377\377\377\377\377\377~\371A\010+\027X\013
  artifact_prefix='./'; Test unit written to ./crash-5627f57ffba7568a500f8379f62c3338978b43f2
  Base64: LgGwuAD/////YBQi///////9//////9++UEIKxdYCxf8////////fvlBCCsXWAs=
  ```

ACKs for top commit:
  maflcko:
    lgtm ACK 5a26cf7773
  dergoegge:
    utACK 5a26cf7773

Tree-SHA512: a1b129d81d42350cf85ff6fb95cd6982b6aac88467a526ee4b3c9b3313af2f7952c5dfa9886f455756faba399d8356b6c318d7ab2d6318e08fea838bee90b2fe
2024-11-01 15:40:41 +00:00
brunoerg
5a26cf7773 fuzz: fix implicit-integer-sign-change in wallet_create_transaction 2024-11-01 10:58:44 -03:00
Antoine Poinsot
a1b3ccae4b init: warn, don't error, when '-upnp' is set
It prevented the GUI from starting when its settings.json had the -upnp option set. This also doesn't
prevent the node from running, so this error didn't need to be fatal.

Thanks to Sjors for bringing attention to what i broke and to Maflcko for suggestion a simple short
term fix.
2024-10-31 14:05:50 -04:00