Commit graph

38360 commits

Author SHA1 Message Date
MarcoFalke
fac229ab1f
ci: Remove P_CI_DIR and --workdir
The --workdir setting to the docker run command is not needed. And
P_CI_DIR/PWD is equal to BASE_ROOT_DIR, so just use that directly.
2023-07-24 16:10:47 +02:00
furszy
c648bdbda2
test: create wallet specific for test_locked_wallet case
Other tests are also relying on the node1 default wallet,
which thanks to 'test_locked_wallet' is encrypted.
And can only be accessed within a specific timeframe (100ms)
set internally by the same test.

This make other tests susceptible to races. They can only
perform their operations successfully within the specified
time.

This can be seen running the test in valgrind, where other
test cases fail due the wallet re-locking itself after the
100ms.
2023-07-24 11:03:05 -03:00
MarcoFalke
fa9108f85a
refactor: Use reinterpret_cast where appropriate
Also, wrap reinterpret_cast into a CharCast to ensure it is only called
on byte pointers.
2023-07-24 15:32:35 +02:00
MarcoFalke
3333f950d4
refactor: Avoid casting away constness
Seems confusing and brittle to remove const and then add it back in the
return type.
2023-07-24 15:32:27 +02:00
MarcoFalke
fa6394dd10
refactor: Remove unused C-style casts 2023-07-24 15:32:00 +02:00
Hennadii Stepanov
a7477744c5
Add UBSan -fsanitize=integer suppressions for src/secp256k1 subtree 2023-07-23 14:56:51 +01:00
brunoerg
ecfe507e07 fuzz: use ConnmanTestMsg in connman
Using `ConnmanTestMsg` we can add nodes and be
more effective fuzzing functions like `DisconnectNode`,
`FindNode`, `GetNodeStats` and other ones.
2023-07-22 13:42:17 -03:00
Hennadii Stepanov
92de74ef18
refactor: Make more transaction size variables signed
This change gets rid of `static_cast`s and compiler warnings.
2023-07-22 07:46:49 +01:00
MarcoFalke
faa8c1be26
fuzz: Re-enable symbolize=1 in ASAN_OPTIONS 2023-07-22 08:26:34 +02:00
Antoine Poinsot
131314b62e
fuzz: increase coverage of the descriptor targets
Once a descriptor is successfully parsed, execute more of its methods.
There is probably still room for improvements by checking for some
invariants, but this is a low hanging fruit that significantly increases
the code coverage of these targets.
2023-07-21 19:14:36 +02:00
Antoine Poinsot
90a24741e7
fuzz: add a new, more efficient, descriptor parsing target
This new target focuses on fuzzing the actual descriptor parsing logic
by not requiring the fuzzer to produce valid keys (nor a valid checksum
for that matter).
This should make it much more efficient to find bugs we could introduce
moving forward.

Using a character as a marker (here '%') to be able to search and
replace in the string without having to mock the actual descriptor
parsing logic was an insight from Pieter Wuille.
2023-07-21 19:14:30 +02:00
Suhas Daftuar
d0d40ea9a6 Move block-storage-related logic to ChainstateManager
Separate the notion of which blocks are stored on disk, and what data is in our
block index, from what tip a chainstate might be able to get to. We can use
chainstate-agnostic data to determine when to store a block on disk (primarily,
an anti-DoS set of criteria) and let the chainstates figure out for themselves
when a block is of interest for being a candidate tip.

Note: some of the invariants in CheckBlockIndex are modified, but more work is
needed (ie to move CheckBlockIndex to ChainstateManager, as most of what
CheckBlockIndex is doing is checking the consistency of the block index, which
is outside of Chainstate).
2023-07-21 10:09:44 -04:00
MarcoFalke
fabef121b0
refactor: Use EnsureAnyNodeContext
node_context is never null, but if it was, it would lead to a nullptr
dereference in node_context->scheduler. Just use EnsureAnyNodeContext
everywhere for more robust, consistent, and correct code.
2023-07-21 15:05:07 +02:00
MarcoFalke
fa1640617e
test: Add SyncWithValidationInterfaceQueue to mockscheduler RPC
This makes existing tests less brittle, see
https://github.com/bitcoin/bitcoin/pull/28108/files#r1268966663
2023-07-21 14:44:30 +02:00
Antoine Poinsot
d60229ede5
fuzz: make the parsed descriptor testing into a function
We'll be reusing it in the new target.
2023-07-21 10:40:13 +02:00
fanquake
d23fda0584
Merge bitcoin/bitcoin#28103: test: Add missing set -ex to ci/lint/06_script.sh
ffff4b5dc5 lint: Add missing `set -ex` to ci/lint/06_script.sh (MarcoFalke)
fadc5232f4 doc: Add doc comment to ci/test_imagefile (MarcoFalke)

Pull request description:

  Requested in https://github.com/bitcoin/bitcoin/pull/28083#pullrequestreview-1535304219.

  Also, one doc commit.

ACKs for top commit:
  fanquake:
    ACK ffff4b5dc5
  jamesob:
    ACK ffff4b5dc5 ([`jamesob/ackr/28103.1.MarcoFalke.test_add_missing_set_ex`](https://github.com/jamesob/bitcoin/tree/ackr/28103.1.MarcoFalke.test_add_missing_set_ex))

Tree-SHA512: 99e67aeaae460319c2c428eab5297dbe1f1dc7f162f6592380bc5d2005308300c391cc187959cb2ace486dfe3411a8b0477f703ff11b5fe33944942c210a2d32
2023-07-20 17:03:27 +01:00
fanquake
e0c8294f29
Merge bitcoin/bitcoin#28110: doc: correct Fedora systemtap dep
12edf7b155 doc: correct Fedora systemtap dep (fanquake)

Pull request description:

ACKs for top commit:
  hebasto:
    ACK 12edf7b155, tested on Fedora 38:

Tree-SHA512: c7995fed4bb7091691181ca92efa0f1892ae141f8f950798cfc2f446c082261ded1c4aab9ef397e15a6f1e896f1adee91e81b95c84542051ba3474f702850dc0
2023-07-20 16:54:41 +01:00
Andrew Chow
b3022af0e2
Merge bitcoin/bitcoin#28108: test: fix intermittent failure in wallet_resendwallettransactions.py
e667bd68a1 test: fix intermittent failure in wallet_resendwallettransactions.py (Martin Zumsande)

Pull request description:

  Fixes #28094

  The test bumps the mocktime for ~2 weeks and then triggers eviction from the mempool. But this bump will also cause a new resubmit, and if the timing is such that this resubmit happens right after the eviction and before the check that the tx was evicted, the test can fail as in #28094:

  ```
  node0 2023-07-17T21:31:23.809483Z (mocktime: 2023-08-02T09:46:27Z) [httpworker.1] [validation.cpp:267] [LimitMempoolSize] [mempool] Expired 2 transactions from the memory pool
  node0 2023-07-17T21:31:23.810079Z (mocktime: 2023-08-02T09:46:27Z) [scheduler] [wallet/wallet.h:895] [WalletLogPrintf] [default wallet] ResubmitWalletTransactions: resubmit 2 unconfirmed transactions
  node0 2023-07-17T21:31:23.810474Z (mocktime: 2023-08-02T09:46:27Z) [httpworker.2] [rpc/request.cpp:181] [parse] [rpc] ThreadRPCServer method=getmempoolentry user=__cookie__
  2023-07-17T21:31:23.811000Z TestFramework (ERROR): Assertion failed (...) AssertionError: No exception raised
  ```
  Fix this by flushing out the current resubmit call before triggering mempool eviction.

ACKs for top commit:
  MarcoFalke:
    Nice. lgtm ACK e667bd68a1
  achow101:
    ACK e667bd68a1
  jonatack:
    Light "this looks like the other tests in this file" ACK e667bd68a1

Tree-SHA512: 027c2177ecd8bea80ec388ec2564f8fcbc717efd2722304b16fc0e9fa7ad216af61977c4e360b8135de68586cf13b0aa729ffa4fa27bad655092c3a55f73933c
2023-07-20 11:39:24 -04:00
Andrew Chow
7edce77ff3
Merge bitcoin/bitcoin#28067: descriptors: do not return top-level only funcs as sub descriptors
dd9633b516 test: wallet, add coverage for watch-only raw sh script migration (furszy)
cc781a2180 descriptor: InferScript, do not return top-level only func as sub descriptor (furszy)
286e0c7d5e wallet: loading, log descriptor parsing error details (furszy)

Pull request description:

  Linked to #28057.

  Currently, the `InferScript` function returns an invalid descriptor when it tries to infer a p2sh-p2pkh script whose pubkey is not known by the wallet.

  This behavior occurs because the inference process bypasses the `pkh` subscript when the pubkey is not contained by the wallet (no pubkey provider), interpreting it as a `sh(addr(ADDR))` descriptor. Then, the failure arises because the `addr()` function is restricted to being used only at the top level.

  For reviewers, would recommend to start by examining the functional test to understand the context and the circumstances on which this can result in a fatal error (e.g. during the migration process).

ACKs for top commit:
  achow101:
    ACK dd9633b516
  darosior:
    utACK dd9633b516

Tree-SHA512: 61e763206c604c372019d2c36e31684f3dddf81f8b154eb9aba5cd66d8d61bda457ed4e591613eb6ce6c76cf7c3f11764abc6cd727a7c2b6414f1065783be032
2023-07-20 11:16:45 -04:00
fanquake
79954903b2
Merge bitcoin/bitcoin#27620: test: miner: add coverage for -blockmintxfee setting
bbbb89d238 test: miner: add coverage for `-blockmintxfee` setting (Sebastian Falbesoner)

Pull request description:

  This PR adds missing test coverage for the `-blockmintxfee` option, which can be used by miners to specify the lowest fee-rate for transactions to be included in blocks. The setting was introduced in PR #9380 (commit daec955fd6), with the rationale to decouple different minimum fees from `-minrelaytxfee`. According to the PR description it _"should be set by miners to reflect their marginal cost of transmitting extra bytes."_.

  On each iteration, the test creates and submits two txs using MiniWallet: one with the the minimum fee-rate as specified for `-blockmintxfee` and a second one with a fee-rate a little below that (-0.01 sats/vbyte). Then it checks that  only the first one is picked for the block template and accordingly also only exists in the block that is mined after. This is repeatedly done for a fixed (but obviously somewhat arbitrary) list of different `-blockmintxfee` settings on a single node, including the default and zero (i.e. no minimum fee a.k.a. "include even zero-fee txs") settings.

ACKs for top commit:
  ryanofsky:
    Code review ACK bbbb89d238, nice test
  brunoerg:
    reACK bbbb89d238
  glozow:
    ACK bbbb89d238, sorry for the late re-review!

Tree-SHA512: 7b72612971e6a1667b4b3913ec27109953fd17a1020a4bde6941a93666b2e10a23fb6fe7df23471a5671ffe31e42cd992d2efb8b31903915b3dfc1d6478df757
2023-07-20 15:33:54 +01:00
furszy
dd9633b516
test: wallet, add coverage for watch-only raw sh script migration 2023-07-20 11:04:52 -03:00
furszy
cc781a2180
descriptor: InferScript, do not return top-level only func as sub descriptor
e.g. sh(addr(ADDR)) or sh(raw(HEX)) are invalid descriptors.

Making sh and wsh top level functions to return addr/raw descriptors when
the subscript inference fails.
2023-07-20 11:04:52 -03:00
fanquake
ac7c1772f9
Merge bitcoin/bitcoin#26654: util: Show descriptive error messages when FileCommit fails
5408a55fc8 Consolidate Win32-specific error formatting (John Moffett)
c95a4432d7 Show descriptive error messages when FileCommit fails (John Moffett)

Pull request description:

  Only raw [`errno`](https://en.cppreference.com/w/cpp/error/errno) int values are logged if `FileCommit` fails. These values are implementation-specific, so it makes it harder to debug based on user reports. For instance, https://github.com/bitcoin/bitcoin/issues/26455#issue-1436654238 and [another](https://bitcointalk.org/index.php?topic=5182526.0#:~:text=FileCommit%3A%20FlushFileBuffers%20failed%3A%205).

  Instead, use `SysErrorString` (or the refactored Windows equivalent `Win32ErrorString`) to display both the raw int value and the descriptive message. All other instances in the code I could find where `errno` or (Windows-only) `GetLastError()`/`WSAGetLastError()` are logged use the full descriptive string. For example:

  1b680948d4/src/util/sock.cpp (L390)

  1b680948d4/src/util/sock.cpp (L272)

  7e1007a3c6/src/netbase.cpp (L515-L516)

  8ccab65f28/src/init.cpp (L164)

  I refactored the Windows formatting code to put it in `syserror.cpp`, as it's applicable to all Win32 API system errors, not just networking errors. To be clear, the Windows API functions `WSAGetLastError()` and `GetLastError()` are currently [equivalent](https://stackoverflow.com/questions/15586224/is-wsagetlasterror-just-an-alias-for-getlasterror).

ACKs for top commit:
  MarcoFalke:
    lgtm ACK 5408a55fc8 💡

Tree-SHA512: 3921cbac98bd9edaf84d3dd7a43896c7921f144c8ca2cde9bc96d5fb05281f7c55e7cc99db8debf6203b5f916f053025e4fa741f51458fe2c53bb57b0a781027
2023-07-20 13:37:21 +01:00
fanquake
1fde20faf8
Merge bitcoin/bitcoin#28099: contrib: move user32.dll from bitcoind.exe libs
8c38509233 contrib: move user32.dll from bitcoind.exe libs (fanquake)

Pull request description:

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

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

Tree-SHA512: f752a5b807341c87320523f4e7c564c8acdbfc1313054a684844035102a7c4695d34cfefb0c6904f3151b2dfdcb54d6ea243c570deceeda30345944251e4c513
2023-07-20 13:16:54 +01:00
fanquake
12edf7b155
doc: correct Fedora systemtap dep 2023-07-20 11:36:02 +01:00
fanquake
355bbcba01
Merge bitcoin/bitcoin#28066: fuzz: Generate process_message targets individually
fa6245da60 fuzz: Generate process_message targets individually (MarcoFalke)
fa1471e575 refactor: Remove duplicate allNetMessageTypesVec (MarcoFalke)

Pull request description:

  Now that `LIMIT_TO_MESSAGE_TYPE` is a runtime setting after commit 927b001502, it shouldn't hurt to also generate each message type individually. Something similar was done for the `rpc` target in commit cf4da5ec29.

ACKs for top commit:
  stickies-v:
    re-crACK fa6245da60
  brunoerg:
    reACK fa6245da60

Tree-SHA512: 8f3ec71bab89781f10820a0e027fcde8949f3333eb19a30315aaad6f90f5167028113cea255b2d60b700da817c7eaac20b7b4c92f931052d7f5c2f148d33aa5a
2023-07-20 10:17:08 +01:00
fanquake
04afe55e29
Merge bitcoin/bitcoin#26467: bumpfee: Allow the user to choose which output is change
e8c31f135c tests: Test for bumping single output transaction (Andrew Chow)
4f4d4407e3 test: Test bumpfee reduce_output (Andrew Chow)
7d83502d3d bumpfee: Allow original change position to be specified (Andrew Chow)

Pull request description:

  When bumping the transaction fee, we will try to find the change output of the transaction in order to have an output whose value we can modify so that we can meet the target feerate. However we do not always find the change output which can cause us to unnecessarily add an additional output to the transaction. We can avoid this issue by outsourcing the determination of change to the user if they so desire.

  This PR adds a `orig_change_pos` option to bumpfee which the user can use to specify the index of the change output.

  Fixes #11233
  Fixes #20795

ACKs for top commit:
  ismaelsadeeq:
    re ACK e8c31f135c
  pinheadmz:
    re-ACK e8c31f135c
  furszy:
    Code review ACK e8c31f13

Tree-SHA512: 3a230655934af17f7c1a5953fafb5ef0d687c21355cf284d5e98fece411f589cd69ea505f06d6bdcf82836b08d268c366ad2dd30ae3d71541c9cdf94d1f698ee
2023-07-20 09:55:04 +01:00
MarcoFalke
fa3d72960b
lint: Ignore check_fileopens failure on **kwargs
This fixes a bug in the linter:

"""
Python's open(...) seems to be used to open text files without explicitly specifying encoding='utf8':
test/functional/test_framework/test_node.py:        with open(self.debug_log_path, **kwargs) as dl:
"""
2023-07-20 09:15:43 +02:00
MarcoFalke
fa6bb85cd2
test: Ignore UTF-8 errors in assert_debug_log
read() fails in text mode when the unicode hasn't been fully written
yet. Fixes: "wallet_importdescriptors.py: can't decode bytes in position
228861-228863: unexpected end of data"
(https://github.com/bitcoin/bitcoin/issues/28030)
2023-07-20 09:15:29 +02:00
MarcoFalke
fa63326fbc
test: Fix debug_log_size helper
debug_log_bytes returned "an opaque number when in text mode"
(https://docs.python.org/3/tutorial/inputoutput.html#methods-of-file-objects),
not the number of bytes.

Fix this by using binary mode or text mode (with the same encoding)
consistently when opening the file for ftell() and read().
2023-07-20 09:15:04 +02:00
Ryan Ofsky
5608e1d3b4
Merge bitcoin/bitcoin#27928: test: Add more tests for the BIP21 implementation
f1d807e383 Add more tests for the BIP21 implementation (Kiminuo)

Pull request description:

  This PR is an attempt to make it clear how the current BIP21 implementation behaves in Bitcoin Core. Especially, I'm interested whether one can specify multiple `amount` (`message`, etc.) parameters.

  My primary end goal is to answer [this question of mine](https://bitcoin.stackexchange.com/questions/118654/how-to-interpret-bip21-uri-with-amount-specified-twice/) but I figured that maybe it's worth a PR. If not, I'll close the PR.

ACKs for top commit:
  MarcoFalke:
    lgtm ACK f1d807e383
  kevkevinpal:
    ACK [f1d807e](f1d807e383)

Tree-SHA512: d287809d47c5cfc667f850927bfd969bd345a996d3d53a4c26ef0ffd29eb75ef53358692a15f9a0493ec9e1c101123b6584572e25f87bcb98ff67f6b6c166de4
2023-07-19 16:43:12 -04:00
Andrew Chow
4d828ef427
Merge bitcoin/bitcoin#28085: refactor: use Span for SipHash::Write
7d92b1430a refactor: use Span for SipHash::Write (Sebastian Falbesoner)

Pull request description:

  This simple refactoring PR changes the interface for the `SipHash` arbitrary-data `Write` method to take a `Span<unsigned char>` instead of having to pass data and length. (`Span<std::byte>` seems to be more modern, but vectors of `unsigned char` are still used prety much everywhere where SipHash is called, and I didn't find it very appealing having to clutter the code with `Make(Writable)ByteSpan` helpers).

ACKs for top commit:
  sipa:
    utACK 7d92b1430a
  MarcoFalke:
    lgtm ACK 7d92b1430a
  achow101:
    ACK 7d92b1430a

Tree-SHA512: f17a27013c942aead4b09f5a64e0c3ff8dbc7e83fe63eb9a2e3ace8be9921c9cbba3ec67e3e83fbe3332ca941c42370efd059e702c060f9b508307e9657c66f2
2023-07-19 16:27:08 -04:00
Martin Zumsande
e667bd68a1 test: fix intermittent failure in wallet_resendwallettransactions.py
Before, it was possible that a resend was triggered right between
eviction the txns from the mempool and the check that they were evicted.
2023-07-19 14:14:59 -04:00
Matthew Zipkin
ba8ab4fc54
test: cover addrv2 support in anchors.dat with a TorV3 address 2023-07-19 13:24:44 -04:00
MarcoFalke
fa633aa690
streams: Teach AutoFile how to XOR 2023-07-19 18:12:42 +02:00
fanquake
78a983f597
Merge bitcoin/bitcoin#28097: depends: xcb-proto 1.15.2
7cb88c8b46 depends: xcb-proto 1.15.2 (fanquake)

Pull request description:

  Resolves build failures with Python 3.12, i.e building on rawhide:
  ```bash
  make -C depends -j9
  ...
  make[3]: Nothing to be done for 'install-exec-am'.
   /usr/bin/mkdir -p '/bitcoin/depends/work/staging/aarch64-unknown-linux-gnu/xcb_proto/1.14.1-4a91ac9dc41/bitcoin/depends/aarch64-unknown-linux-gnu/lib/python3.12/site-packages/xcbgen'
   /usr/bin/install -c -m 644 __init__.py error.py expr.py align.py matcher.py state.py xtypes.py '/bitcoin/depends/work/staging/aarch64-unknown-linux-gnu/xcb_proto/1.14.1-4a91ac9dc41/bitcoin/depends/aarch64-unknown-linux-gnu/lib/python3.12/site-packages/xcbgen'
  Traceback (most recent call last):
    File "<string>", line 2, in <module>
  ModuleNotFoundError: No module named 'imp'
  make[3]: *** [Makefile:271: install-pkgpythonPYTHON] Error 1
  ```

  `imp` was removed in 3.12: https://docs.python.org/3/library/imp.html.

  Guix Build:
  ```bash
  6d1725c9346bdf04e1eeec2deffda90957bd081700ba896834a143756410fb0e  guix-build-7cb88c8b4672/output/aarch64-linux-gnu/SHA256SUMS.part
  34486c39daea8a3ce8d92e9c1501f26e5f5e300d9612a25bd56c48ab56353329  guix-build-7cb88c8b4672/output/aarch64-linux-gnu/bitcoin-7cb88c8b4672-aarch64-linux-gnu-debug.tar.gz
  cb0080d75d0fc4fc5c7fc022b5771470c60609c35836e7b66c4f479a2edcd098  guix-build-7cb88c8b4672/output/aarch64-linux-gnu/bitcoin-7cb88c8b4672-aarch64-linux-gnu.tar.gz
  395c332f83206125819aabf9a5dad5c906bdcd78ec13269fdfb4215bb5cc3247  guix-build-7cb88c8b4672/output/arm-linux-gnueabihf/SHA256SUMS.part
  f9e72693dd59f1b4dce6b6efa7bf325b2b589075a904c57b430dbe5c39add4ff  guix-build-7cb88c8b4672/output/arm-linux-gnueabihf/bitcoin-7cb88c8b4672-arm-linux-gnueabihf-debug.tar.gz
  14cfcebcd557d30d5a07837ab38ca217346f9b97e238a96376d6467d0db39e1a  guix-build-7cb88c8b4672/output/arm-linux-gnueabihf/bitcoin-7cb88c8b4672-arm-linux-gnueabihf.tar.gz
  1aaa7c04156a78628060a2ec47077589fb5dfb7a2e558fe604aaaa916b8a7f51  guix-build-7cb88c8b4672/output/arm64-apple-darwin/SHA256SUMS.part
  94585898babc8fdce7660c3160fe7b26c6f6749ac53a177f91a8b4226856ab7b  guix-build-7cb88c8b4672/output/arm64-apple-darwin/bitcoin-7cb88c8b4672-arm64-apple-darwin-unsigned.dmg
  9bcc693e5fad668e6c7beb8280c9c3e6988318569e0efa7d24f8cd990a3c1dd4  guix-build-7cb88c8b4672/output/arm64-apple-darwin/bitcoin-7cb88c8b4672-arm64-apple-darwin-unsigned.tar.gz
  3e427a7c2530cc3bb2f87125997bafa94234c21ebb7004cc36dc8408c0b0c9ff  guix-build-7cb88c8b4672/output/arm64-apple-darwin/bitcoin-7cb88c8b4672-arm64-apple-darwin.tar.gz
  988909c91077cb83b8d5ee77933192525d1fa1fd0bba0874138433314cb64927  guix-build-7cb88c8b4672/output/dist-archive/bitcoin-7cb88c8b4672.tar.gz
  b13c8b1f4f75505d2356f9e702db384dbb58ee3f7f0af3b110df4b7bc4c80f52  guix-build-7cb88c8b4672/output/powerpc64-linux-gnu/SHA256SUMS.part
  6f2f204401c36ee59564c8d56f9adf4f2587471ea0705e0f6a89ade4a8decf55  guix-build-7cb88c8b4672/output/powerpc64-linux-gnu/bitcoin-7cb88c8b4672-powerpc64-linux-gnu-debug.tar.gz
  c1af63ec54fcbfd267a047d2dca41bdfcace1ae6a5746df11bd710217b17b205  guix-build-7cb88c8b4672/output/powerpc64-linux-gnu/bitcoin-7cb88c8b4672-powerpc64-linux-gnu.tar.gz
  2407bc6d0beaa12dd7601ff14ef2c077346752a7b57fdf27df0a512f2af825bd  guix-build-7cb88c8b4672/output/powerpc64le-linux-gnu/SHA256SUMS.part
  ff033b4b2a3c2816555ee3a443e4087cba47d4eb05b00e092603892ff91acc30  guix-build-7cb88c8b4672/output/powerpc64le-linux-gnu/bitcoin-7cb88c8b4672-powerpc64le-linux-gnu-debug.tar.gz
  ebd9c3ab462290e2c3264dd4184a1d132b90cc93d8359ae28bc23a120b918716  guix-build-7cb88c8b4672/output/powerpc64le-linux-gnu/bitcoin-7cb88c8b4672-powerpc64le-linux-gnu.tar.gz
  57afcfe859903b960ef792447d34a17d556e44c98c021f5a35bfbd963f9e7be5  guix-build-7cb88c8b4672/output/riscv64-linux-gnu/SHA256SUMS.part
  105e6ef4fbac91e1bbbea3e98c80915654894d247cbfe0e4d2ff89b633ace10e  guix-build-7cb88c8b4672/output/riscv64-linux-gnu/bitcoin-7cb88c8b4672-riscv64-linux-gnu-debug.tar.gz
  e893e321ddd966c29fa949c3d7866fd0dca6ea87f9185e702a17c62896acf90b  guix-build-7cb88c8b4672/output/riscv64-linux-gnu/bitcoin-7cb88c8b4672-riscv64-linux-gnu.tar.gz
  80e7610cdb2ea9f1a503fa7c9ac7e29600e98fdac020951a76525494822416d9  guix-build-7cb88c8b4672/output/x86_64-apple-darwin/SHA256SUMS.part
  8fe050ca40af1d2830f7efe928f8ea8e30800dfa286f5d22549255d7ed893a30  guix-build-7cb88c8b4672/output/x86_64-apple-darwin/bitcoin-7cb88c8b4672-x86_64-apple-darwin-unsigned.dmg
  51a06c78edb9b29008deab11f5e98acac04de64080804d22b5a4f30c4b195ee5  guix-build-7cb88c8b4672/output/x86_64-apple-darwin/bitcoin-7cb88c8b4672-x86_64-apple-darwin-unsigned.tar.gz
  5cb44b69b2315fd2bb4122fa252158a9460269f24121226d88f6146e52aafc5b  guix-build-7cb88c8b4672/output/x86_64-apple-darwin/bitcoin-7cb88c8b4672-x86_64-apple-darwin.tar.gz
  d57f8ad1041a8112b012472ff00593a214f55215a29c5e5c3bc724d5eb645b1e  guix-build-7cb88c8b4672/output/x86_64-linux-gnu/SHA256SUMS.part
  76f1865d49cedf4b03f9ac5c4cb968968e54f8b19e96391340d82669a9395e93  guix-build-7cb88c8b4672/output/x86_64-linux-gnu/bitcoin-7cb88c8b4672-x86_64-linux-gnu-debug.tar.gz
  63cca6f0cbfd74148b20093bc2494b9abf50594cfb7055c5b5d702583d6c37a4  guix-build-7cb88c8b4672/output/x86_64-linux-gnu/bitcoin-7cb88c8b4672-x86_64-linux-gnu.tar.gz
  8d2afd4156525bc4684271092b5017e12f01fcc3dad29608886d10c0ef01b09d  guix-build-7cb88c8b4672/output/x86_64-w64-mingw32/SHA256SUMS.part
  6ebb038dc1f589bf92bcf3766dfcb0310f7df9ff4f75c943c2eb6fcced1a2580  guix-build-7cb88c8b4672/output/x86_64-w64-mingw32/bitcoin-7cb88c8b4672-win64-debug.zip
  d73aad8495174a49dad172278fbe590b86104bca9fcec8301a548a9fc8b1118f  guix-build-7cb88c8b4672/output/x86_64-w64-mingw32/bitcoin-7cb88c8b4672-win64-setup-unsigned.exe
  7697fffdb9b2c2f0c6042f56daf9940c561ed4c950692a2adbb039ecd885e047  guix-build-7cb88c8b4672/output/x86_64-w64-mingw32/bitcoin-7cb88c8b4672-win64-unsigned.tar.gz
  4483876d0e5709b25bd2e238958a820f7996eaebe21c1c3f3a8c3f490a0c8562  guix-build-7cb88c8b4672/output/x86_64-w64-mingw32/bitcoin-7cb88c8b4672-win64.zip
  ```

ACKs for top commit:
  hebasto:
    ACK 7cb88c8b46, tested on Ubuntu Mantic with:

Tree-SHA512: 7e01c20f15864c29ada6719051e683fbf7a533aaed810aa74763f50f6810fa49e8d3773d13d18ba88a20404305fc92d3c95190e799ebaf25a82301e97422e7a8
2023-07-19 12:34:09 +01:00
fanquake
0be2f5481c
Merge bitcoin/bitcoin#27986: test: remove race in the user-agent reception check
20b49460b3 test: remove race in the user-agent reception check (Vasil Dimov)

Pull request description:

  In `add_p2p_connection()` we connect to `bitcoind` from the Python client and check that it has received our version string.

  This check looked up the last/newest entry from `getpeerinfo` RPC, assuming that it must be the connection we have just opened. But this will not be the case if a new inbound or outbound connection is made to/from `bitcoind` in the meantime.

  Instead of the last entry in `getpeerinfo`, check all and find the one which corresponds to our connection using our outgoing address:port tuple which is unique.

ACKs for top commit:
  jonatack:
    re-ACK 20b49460b3
  MarcoFalke:
    Concept ACK 20b49460b3

Tree-SHA512: 61fd3359ef11ea830021ede0e745497a7b60690c32d21c47cd12ff79f78907bb45e922c9d01e5d7ff614a8cd5e4560d39a3fc86b01b200429773a23ace3917e4
2023-07-19 12:32:30 +01:00
fanquake
3648a9b4f7
Merge bitcoin/bitcoin#28056: rpc: doc: Added longpollid and data params to template_request
f6a26196cf Added `longpollid` and `data` params to `template_request` #27998 (Rhythm Garg)

Pull request description:

  This PR will add the optional parameters `longpollid` and `data` to `template_request` as they were missing when calling `help getblocktemplate` in RPCHelpMan.

  I request the maintainers to review this and let me know about any mistakes in the descriptions of the parameters.

  This PR refers to the issue #27998

ACKs for top commit:
  ItIsOHM:
    > tACK [f6a2619](f6a26196cf)
  russeree:
    tACK f6a26196cf
  stickies-v:
    tACK f6a26196cf

Tree-SHA512: 6c592db59cb11b2d031ce5265c547fa296266278f6c25f96afe18a420e0d547f4d483e0f66de75d52c0c319ac1585f3558b9f70c12ef208c96ec96a51f786c6a
2023-07-19 12:26:09 +01:00
fanquake
84c5416b03
Merge bitcoin/bitcoin#28093: subtree: update libsecp256k1 to latest master
5080c9c25f build: adapt Windows builds for libsecp256k1 build changes (fanquake)
ff061fde18 Squashed 'src/secp256k1/' changes from 705ce7ed8c..c545fdc374 (fanquake)

Pull request description:

  Includes https://github.com/bitcoin-core/secp256k1/pull/1378. Which fixes #28079.
  Adapts Windows build for https://github.com/bitcoin-core/secp256k1/pull/1367.

ACKs for top commit:
  hebasto:
    ACK 5080c9c25f, I've made the `src/secp256k1` subtree update locally and got zero diff with this PR branch.
  jonasnick:
    ACK 5080c9c25f

Tree-SHA512: 37915d420ebacefc6bc82c2511bff3d6884e01d5c92795f19cd61862f96b30aa1fe768aeabec128c9d25c1d8bc62b46b46969626067266074b39566ad9e2f5ba
2023-07-19 11:36:30 +01:00
MarcoFalke
ffff4b5dc5
lint: Add missing set -ex to ci/lint/06_script.sh
This is needed for the container-entrypoint.sh

Also, remove unused `source` from ci/lint_run_all.sh, since it is the
last step.
2023-07-19 11:39:50 +02:00
MarcoFalke
fadc5232f4
doc: Add doc comment to ci/test_imagefile
(Similar to the doc comment in ci/lint_imagefile)

Also, rename docker-entrypoint.sh to container-entrypoint.sh

Also, add copyright header to touched files.
2023-07-19 11:27:28 +02:00
fanquake
24d5cf9314
Merge bitcoin/bitcoin#27425: test: move remaining rand code from util/setup_common to util/random
1cd45d4e08 test: move random.h include header from setup_common.h to cpp (Jon Atack)
1b246fdd14 test: move remaining random test util code from setup_common to random (jonatack)

Pull request description:

  and drop the `util/random` dependency on `util/setup_common`.  This improves code separation and allows `util/setup_common` to call `util/random` functions without creating a circular dependency, thereby addressing https://github.com/bitcoin/bitcoin/pull/26940#issuecomment-1497266140 by glozow (thanks!)

ACKs for top commit:
  MarcoFalke:
    lgtm ACK 1cd45d4e08 🌂

Tree-SHA512: 6ce63d9103ba9b04eebbd8ad02fe9aa79e356296533404034a1ae88e9b7ca0bc9a5c51fd754b71cf4e7b55b18bcd4d5474b2d588edee3851e3b3ce0e4d309a93
2023-07-19 10:26:11 +01:00
fanquake
c6a338b67e
Merge bitcoin/bitcoin#28083: ci: Use DOCKER_BUILDKIT for lint image
fa2f18ad8e ci: Use DOCKER_BUILDKIT for lint image (MarcoFalke)

Pull request description:

  Currently the lint docker/podman image has many issues:

  * It relies on an EOL debian version.
  * It relies on a debian version different from the one used in the CI lint task.
  * It relies on the legacy docker build command, which requires the user to make `cd ./ci/lint/` before the build step.
  * It doesn't use the `.python-version` file, but a hardcoded version.

  Fix all issues by using the recommended `DOCKER_BUILDKIT=1` to generate the image.

  Also:
  * Rename `/tmp/python` to `/python_build`.
  * Compress all `pip install` commands into one.
  * Bump `.python-version`.

ACKs for top commit:
  jamesob:
    ACK fa2f18ad8e

Tree-SHA512: 804b384904ad753845667998841cc7825f4229933ca2c42af021384713486ec3cca80ba58612d37557fba7ee1921439dacca5e1236aac0557dd75bd9a2f1875d
2023-07-18 16:40:39 +01:00
fanquake
8c38509233
contrib: move user32.dll from bitcoind.exe libs
The user interface library is no-longer needed by `bitcoind.exe`,
or utils, only `bitcoin-qt.exe`.
Add missing lib doc.
2023-07-18 16:39:22 +01:00
fanquake
5080c9c25f
build: adapt Windows builds for libsecp256k1 build changes
See https://github.com/bitcoin-core/secp256k1/pull/1367.
2023-07-18 15:26:51 +01:00
fanquake
8ee662984f
Update secp256k1 subtree to latest upstream master 2023-07-18 15:25:05 +01:00
fanquake
ff061fde18 Squashed 'src/secp256k1/' changes from 705ce7ed8c..c545fdc374
c545fdc374 Merge bitcoin-core/secp256k1#1298: Remove randomness tests
b40e2d30b7 Merge bitcoin-core/secp256k1#1378: ellswift: fix probabilistic test failure when swapping sides
c424e2fb43 ellswift: fix probabilistic test failure when swapping sides
907a67212e Merge bitcoin-core/secp256k1#1313: ci: Test on development snapshots of GCC and Clang
0f7657d59c Merge bitcoin-core/secp256k1#1366: field: Use `restrict` consistently in fe_sqrt
cc55757552 Merge bitcoin-core/secp256k1#1340: clean up in-comment Sage code (refer to secp256k1_params.sage, update to Python3)
600c5adcd5 clean up in-comment Sage code (refer to secp256k1_params.sage, update to Python3)
981e5be38c ci: Fix typo in comment
e9e9648219 ci: Reduce number of macOS tasks from 28 to 8
609093b387 ci: Add x86_64 Linux tasks for gcc and clang snapshots
1deecaaf3b ci: Install development snapshots of gcc and clang
b79ba8aa4c field: Use `restrict` consistently in fe_sqrt
c9ebca95f9 Merge bitcoin-core/secp256k1#1363: doc: minor ellswift.md updates
afd7eb4a55 Merge bitcoin-core/secp256k1#1371: Add exhaustive tests for ellswift (with create+decode roundtrip)
2792119278 Add exhaustive test for ellswift (create+decode roundtrip)
c7d900ffd1 doc: minor ellswift.md updates
332af315fc Merge bitcoin-core/secp256k1#1344: group: save normalize_weak calls in `secp256k1_ge_is_valid_var`/`secp256k1_gej_eq_x_var`
9e6d1b0e9b Merge bitcoin-core/secp256k1#1367: build: Improvements to symbol visibility logic on Windows (attempt 3)
0aacf64352 Merge bitcoin-core/secp256k1#1370: Corrected some typos
b6b9834e8d small fixes
07c0e8b82e group: remove unneeded normalize_weak in `secp256k1_gej_eq_x_var`
3fc1de5c55 Merge bitcoin-core/secp256k1#1364: Avoid `-Wmaybe-uninitialized` when compiling with `gcc -O1`
fb758fe8d6 Merge bitcoin-core/secp256k1#1323: tweak_add: fix API doc for tweak=0
c6cd2b15a0 ci: Add task for static library on Windows + CMake
020bf69a44 build: Add extensive docs on visibility issues
0196e8ade1 build: Introduce `SECP256k1_DLL_EXPORT` macro
9f1b1904a3 refactor: Replace `SECP256K1_API_VAR` with `SECP256K1_API`
ae9db95cea build: Introduce `SECP256K1_STATIC` macro for Windows users
7966aee31d Merge bitcoin-core/secp256k1#1369: ci: Print commit in Windows container
a7bec34231 ci: Print commit in Windows container
249c81eaa3 Merge bitcoin-core/secp256k1#1368: ci: Drop manual checkout of merge commit
98579e297b ci: Drop manual checkout of merge commit
5b9f37f136 ci: Add `CFLAGS: -O1` to task matrix
a6ca76cdf2 Avoid `-Wmaybe-uninitialized` when compiling with `gcc -O1`
0fa84f869d Merge bitcoin-core/secp256k1#1358: tests: introduce helper for non-zero `random_fe_test()` results
5a95a268b9 tests: introduce helper for non-zero `random_fe_test` results
304421d57b tests: refactor: remove duplicate function `random_field_element_test`
3aef6ab8e1 Merge bitcoin-core/secp256k1#1345: field: Static-assert that int args affecting magnitude are constant
4494a369b6 Merge bitcoin-core/secp256k1#1357: tests: refactor: take use of `secp256k1_ge_x_on_curve_var`
799f4eec27 Merge bitcoin-core/secp256k1#1356: ci: Adjust Docker image to Debian 12 "bookworm"
c862a9fb49 ci: Adjust Docker image to Debian 12 "bookworm"
a1782098a9 ci: Force DWARF v4 for Clang when Valgrind tests are expected
7d8d5c86df tests: refactor: take use of `secp256k1_ge_x_on_curve_var`
8a7273465b Help the compiler prove that a loop is entered
fd491ea1bb Merge bitcoin-core/secp256k1#1355: Fix a typo in the error message
ac43613d25 Merge bitcoin-core/secp256k1#1354: Add ellswift to CHANGELOG
67887ae65c Fix a typo in the error message
926dd3e962 Merge bitcoin-core/secp256k1#1295: abi: Use dllexport for mingw builds
10836832e7 Merge bitcoin-core/secp256k1#1336: Use `__shiftright128` intrinsic in `secp256k1_u128_rshift` on MSVC
7c7467ab7f Refer to ellswift.md in API docs
c32ffd8d8c Add ellswift to CHANGELOG
3c1a0fd37f Merge bitcoin-core/secp256k1#1347: field: Document return value of fe_sqrt()
5779137457 field: Document return value of fe_sqrt()
be8ff3a02a field: Static-assert that int args affecting magnitude are constant
efa76c4bf7 group: remove unneeded normalize_weak in `secp256k1_ge_is_valid_var`
5b7bf2e9d4 Use `__shiftright128` intrinsic in `secp256k1_u128_rshift` on MSVC
05873bb6b1 tweak_add: fix API doc for tweak=0
6ec3731e8c Simplify test PRNG implementation
fb5bfa4eed Add static test vector for Xoshiro256++
723e8ca8f7 Remove randomness tests
bc7c8db179 abi: Use dllexport for mingw builds

git-subtree-dir: src/secp256k1
git-subtree-split: c545fdc374964424683d9dac31a828adedabe860
2023-07-18 15:25:05 +01:00
fanquake
08eb5f1b67
ci: document that -Wreturn-type has been fixed upstream (Windows)
`noreturn` attributes have been added to the mingw-w64 headers, meaning
that from 11.0.0 onwards, you'll no-longer see `-Wreturn-type` warnings
when using assert(false):
1690994f51.

Add -Wno-return-type to the Windows CI, where is should have been all
along, and document why it's required. This can be dropped when we are
using the fixed version of the mingw-w64 headers there.

Drop the -Werror -Wno-return-type special case from our build system.
-Wreturn-type is on by default in Clang and GCC.
2023-07-18 14:27:30 +01:00
fanquake
7cb88c8b46
depends: xcb-proto 1.15.2
Resolves build failures under Python 3.12, i.e building on rawhide:
```bash
make[3]: Nothing to be done for 'install-exec-am'.
 /usr/bin/mkdir -p '/bitcoin/depends/work/staging/aarch64-unknown-linux-gnu/xcb_proto/1.14.1-4a91ac9dc41/bitcoin/depends/aarch64-unknown-linux-gnu/lib/python3.12/site-packages/xcbgen'
 /usr/bin/install -c -m 644 __init__.py error.py expr.py align.py matcher.py state.py xtypes.py '/bitcoin/depends/work/staging/aarch64-unknown-linux-gnu/xcb_proto/1.14.1-4a91ac9dc41/bitcoin/depends/aarch64-unknown-linux-gnu/lib/python3.12/site-packages/xcbgen'
Traceback (most recent call last):
  File "<string>", line 2, in <module>
ModuleNotFoundError: No module named 'imp'
make[3]: *** [Makefile:271: install-pkgpythonPYTHON] Error 1
```

`imp` was removed in 3.12: https://docs.python.org/3/library/imp.html.
2023-07-18 11:27:24 +01:00
fanquake
673acab223
Merge bitcoin/bitcoin#28090: validation: use noexcept instead of deprecated throw()
047daad4f5 clang-tidy: turn on modernize-use-noexcept (fanquake)
85e9e1f802 validation: use noexcept instead of deprecated throw() (fanquake)

Pull request description:

  We fixed this once before in https://github.com/bitcoin/bitcoin/pull/10965.
  Turn on https://clang.llvm.org/extra/clang-tidy/checks/modernize/use-noexcept.html#modernize-use-noexcept.

ACKs for top commit:
  MarcoFalke:
    lgtm ACK 047daad4f5
  sipa:
    utACK 047daad4f5
  Empact:
    utACK 047daad4f5
  stickies-v:
    ACK 047daad4f5

Tree-SHA512: 949b0fe598d66583747853094db13f196b402000e601f8634e5a708b55454d29c5aa18eaf1f2420d3ccf10e3e524b7414ff3a6fe4cb431420bf749c22b2b8bab
2023-07-18 10:24:13 +01:00