Compare commits

...

59 Commits

Author SHA1 Message Date
merge-script
cf3a7e97ee Merge bitcoin/bitcoin#33416: [27.x] Backports
aee53d60d3 doc: update release notes for 27.x (fanquake)
be1a94a740 net: Do not apply whitelist permission to onion inbounds (Martin Zumsande)
640cc72577 depends: fix Qt macOS build with Clang 18 (fanquake)

Pull request description:

  Backports:
  * #30198 (partial)
  * #33395

ACKs for top commit:
  willcl-ark:
    ACK aee53d60d3

Tree-SHA512: 7e1913df148dd1b264a337d7c14de34011a8002fb0950ab00f4c73c60e2df1b3098d3b5aad311d9b33c01416c4e5fa06f23592232d63e9a942eeeb23bd371b3a
2025-10-13 12:21:08 +01:00
fanquake
aee53d60d3 doc: update release notes for 27.x 2025-10-08 16:53:44 +01:00
Martin Zumsande
be1a94a740 net: Do not apply whitelist permission to onion inbounds
Tor inbound connections do not reveal the peer's actual network address.
Therefore do not apply whitelist permissions to them.

Co-authored-by: Vasil Dimov <vd@FreeBSD.org>

Github-Pull: #33395
Rebased-From: f563ce9081
2025-10-08 10:41:31 +01:00
fanquake
640cc72577 depends: fix Qt macOS build with Clang 18
Patch Qts internal libpng to resolve the failure.

I would like to have this patched, so we can continue working on the
removal of `FORCE_USE_SYSTEM_CLANG`. Otherwise builds will be broken using
the default clang (18) on the current Ubuntu LTS (24.04).

Github-Pull: #30198
Rebased-From: 0a3631fc35
2025-10-08 10:41:31 +01:00
merge-script
ee048cd32b Merge bitcoin/bitcoin#33564: [27.x] Fix Qt download URLs
9652f4754d doc: update release notes for 27.x (fanquake)
0e8362760b [28.x] ci: Fix Qt 5.15 URL (Hennadii Stepanov)
e93b71d450 build: fix depends Qt download link (fanquake)

Pull request description:

  Backports:
  * #33561
  * #33563

ACKs for top commit:
  willcl-ark:
    utACK 9652f4754d
  hebasto:
    ACK 9652f4754d.

Tree-SHA512: 637a9feb7d14c2ec11381929f7fb9be2246d0985b847094eeeb65be79c97c0e379ddcbe99510a8f9d61cc43f50aad62f277e598d28005a8b25f007b5f52f7734
2025-10-08 09:37:52 +01:00
fanquake
9652f4754d doc: update release notes for 27.x 2025-10-07 14:57:40 +01:00
Hennadii Stepanov
0e8362760b [28.x] ci: Fix Qt 5.15 URL
Github-Pull: #33561
Rebased-From: 2cd432dc6d
2025-10-07 14:56:34 +01:00
fanquake
e93b71d450 build: fix depends Qt download link
Github-Pull: #33563
Rebased-From: abf4a6eeae
2025-10-07 14:56:07 +01:00
merge-script
39b935a8d4 Merge bitcoin/bitcoin#32479: [27.x] Backports
1d8856dddf doc: update release notes for 27.x (fanquake)
aef658601d depends: use "mkdir -p" when installing xproto (fanquake)
a328170e09 guix: accomodate migration to codeberg (fanquake)
e0af7bffff ci: remove --enable-external-signer (fanquake)
882166642c scripted-diff: Use bpf_cflags (MarcoFalke)
1fc7b9d260 test: Add imports for util bpf_cflags (MarcoFalke)
f52ab00f69 build: use make < 3.82 syntax for define directive (Sjors Provoost)
418bee8f9d refactor: Remove spurious virtual from final ~CZMQNotificationInterface (MarcoFalke)
992c7cad46 test: Handle empty string returned by CLI as None in RPC tests (Brandon Odiwuor)

Pull request description:

  Backports
  - #32070
  - #32187
  - #32286
  - #32439
  - #32568

ACKs for top commit:
  willcl-ark:
    ACK 1d8856dddf

Tree-SHA512: ca8534c24a806a35528f0d40a201fe0c66aa101a8cbeff9ef18d7599c300e6ca47d33563cd84198f1c15d77da7a141e8fcc0a2bd0a40165da6142dbbf1dcdc6c
2025-06-09 13:52:15 +01:00
fanquake
1d8856dddf doc: update release notes for 27.x 2025-06-04 11:16:54 +02:00
fanquake
aef658601d depends: use "mkdir -p" when installing xproto
It looks like the mkdir detection in xproto is broken on Alpine. Ensure
we always use `mkdir -p`.

Fixes #32494.

Github-Pull: #32568
Rebased-From: df9ebbf659
2025-06-04 11:16:35 +02:00
fanquake
a328170e09 guix: accomodate migration to codeberg
See https://guix.gnu.org/blog/2025/migrating-to-codeberg/.

When interacting with the old repo you may now also see:
```bash
warning: redirecting to https://codeberg.org/guix/guix/
```

Github-Pull: #32439
Rebased-From: d5ca4d4fd713a9f7e17e074a1e37dda99bbb09fc
2025-05-29 16:33:51 +01:00
fanquake
e0af7bffff ci: remove --enable-external-signer
Boost 1.88.0 (installed in the macOS CI) broke compat with Boost Process
V1. As `--enable-external-signer` is set in the CI, this causes the
macOS CI to fail. Remove `--enable-external-signer` from the CI.
2025-05-19 13:55:12 +01:00
MarcoFalke
882166642c scripted-diff: Use bpf_cflags
-BEGIN VERIFY SCRIPT-

 ren() { sed --regexp-extended -i "s/$1/$2/g" $( git grep --extended-regexp -l "$1" ) ; }

 ren 'cflags=\["-Wno-error=implicit-function-declaration"\]' 'cflags=bpf_cflags()'

-END VERIFY SCRIPT-

Github-Pull: #32336
Rebased-From: facb9b327b
2025-05-13 16:05:29 +01:00
MarcoFalke
1fc7b9d260 test: Add imports for util bpf_cflags
This is required for the next commit.

Github-Pull: #32336
Rebased-From: fa0c1baaf8
2025-05-13 16:05:26 +01:00
Sjors Provoost
f52ab00f69 build: use make < 3.82 syntax for define directive
From the GNU make 3.82 release announcement:

* The 'define' make directive now allows a variable assignment operator
  after the variable name, to allow for simple, conditional, or appending
  multi-line variable assignment.

macOS ships with 3.81. This caused the multiprocess config options
to be ignored.

Fixes #32068

Co-authored-by: Ryan Ofsky <ryan@ofsky.org>

Github-Pull: #32070
Rebased-From: 9157d9e449
2025-05-13 14:18:45 +01:00
MarcoFalke
418bee8f9d refactor: Remove spurious virtual from final ~CZMQNotificationInterface
Github-Pull: #32187
Rebased-From: fa69c42fdf
2025-05-13 14:16:25 +01:00
Brandon Odiwuor
992c7cad46 test: Handle empty string returned by CLI as None in RPC tests
Github-Pull: #32286
Rebased-From: a4041c77f0
2025-05-13 14:15:25 +01:00
merge-script
1e7041a9f3 Merge bitcoin/bitcoin#31422: [27.x] More backports
25f150304d doc: update release notes (fanquake)
8588d5bbe0 tracing: Rename the `MIN` macro to `_TRACEPOINT_TEST_MIN` in log_raw_p2p_msgs (0xb10c)
a1db79c31d depends: Fix spacing issue (Hennadii Stepanov)
c70bd786f8 depends: Fix CXXFLAGS on NetBSD (Hennadii Stepanov)
166fea73eb test: fix MIN macro-redefinition (0xb10c)

Pull request description:

  Backports:
  * #31419
  * #31502
  * #31623
  * #31627

ACKs for top commit:
  stickies-v:
    ACK 25f150304d

Tree-SHA512: 331027b176f5fd344a74d7b6d6668db5251ab2fec9f079977601499a37f71fe84cb6dee1cdee40a0570aa92d29839093c578e8eebde92188e4de534f4a6dee65
2025-02-11 13:21:38 +01:00
fanquake
25f150304d doc: update release notes 2025-02-10 11:43:17 +01:00
0xb10c
8588d5bbe0 tracing: Rename the MIN macro to _TRACEPOINT_TEST_MIN in log_raw_p2p_msgs
Inspired by: 00c1dbd26d (#31419)

Github-Pull: #31623
Rebased-From: f93f0c9396
2025-01-10 17:04:27 +00:00
Hennadii Stepanov
a1db79c31d depends: Fix spacing issue
This change resolves an issue where a missing space caused the value of
the `build_AR` variable to be concatenated with the "NM=" string. This
resulted in subsequent calls to `${AR}` and `${NM}` failing.

Github-Pull: #31627
Rebased-From: 8a46286da6
2025-01-10 17:04:22 +00:00
Hennadii Stepanov
c70bd786f8 depends: Fix CXXFLAGS on NetBSD
This change corrects an issue where CXXFLAGS were mistakenly overridden
by CFLAGS.

Github-Pull: #31502
Rebased-From: a10bb400e8
2025-01-06 11:00:47 +00:00
0xb10c
166fea73eb test: fix MIN macro-redefinition
Renames the `MIN` macro to `_TRACEPOINT_TEST_MIN`.

From #31418:

```
stderr:
/virtual/main.c:70:9: warning: 'MIN' macro redefined [-Wmacro-redefined]
   70 | #define MIN(a,b) ({ __typeof__ (a) _a = (a); __typeof__ (b) _b = (b); _a < _b ? _a : _b; })
      |         ^
include/linux/minmax.h:329:9: note: previous definition is here
  329 | #define MIN(a,b) __cmp(min,a,b)
      |         ^
1 warning generated.
```

fixes: https://github.com/bitcoin/bitcoin/issues/31418

Github-Pull: #31419
Rebased-From: 00c1dbd26d
2024-12-04 17:30:55 +00:00
merge-script
bf03c458e9 Merge bitcoin/bitcoin#31154: [27.x] rc2 or final
dd1bf8bc4e doc: update manual pages for 27.2 (fanquake)
f42fcf6ad7 build: bump version to v27.2 final (fanquake)
6c09325757 doc: finalise release notes for 27.2 (fanquake)
c838ce514f doc: use proper doxygen formatting for CTxMemPool::cs (Vasil Dimov)

Pull request description:

  This backports one other change (that doesn't warrant an rc), which fixes noisey output from newer versions of Clang (19+). Also makes the changes for 27.2 final.

  Bins for rc1 are available here: https://bitcoincore.org/bin/bitcoin-core-27.2/test.rc1/.

ACKs for top commit:
  stickies-v:
    ACK dd1bf8bc4e

Tree-SHA512: 10599443bb8862dc5f238246e21ff817d572fc23174efc0fe27960e490a4e82501555bc859a1a84f465ea211b00c54a3e9125612ca2d98be6e1e8684d5c61a4b
2024-10-31 13:51:02 +00:00
fanquake
dd1bf8bc4e doc: update manual pages for 27.2 2024-10-30 11:59:36 +00:00
fanquake
f42fcf6ad7 build: bump version to v27.2 final 2024-10-30 11:54:12 +00:00
fanquake
6c09325757 doc: finalise release notes for 27.2 2024-10-30 11:53:38 +00:00
Vasil Dimov
c838ce514f doc: use proper doxygen formatting for CTxMemPool::cs
Having `@par title` followed by an empty line renders improperly in
Doxygen - it results in a paragraph with a title but without a body.

https://www.doxygen.nl/manual/commands.html#cmdpar

This also results in a compiler warning (or error) with Clang 19:

```
./txmempool.h:368:34: error: empty paragraph passed to '@par' command [-Werror,-Wdocumentation]
  368 |      * @par Consistency guarantees
      |        ~~~~~~~~~~~~~~~~~~~~~~~~~~^
1 error generated.
```

Github-Pull: #30504
Rebased-From: 6a5e9e40e1
2024-10-25 16:01:02 +01:00
merge-script
882e0d730d Merge bitcoin/bitcoin#31101: [27.x] Prep for 27.2
0cdfb7e45c doc: update for 27.2rc1 (fanquake)
693403bed6 doc: update manual pages for 27.2rc1 (fanquake)
c338e43c6f build: bump version to 27.2rc1 (fanquake)

Pull request description:

  Prepare for 27.2.

ACKs for top commit:
  stickies-v:
    ACK 0cdfb7e45c

Tree-SHA512: 2ccf7d9eb02450e254649d50188c15c754ce74fb94e5101324a1cde5839de5451b0dc7567eed135c84bf83fefcd1a6d37cb757094f27563cbff43969b9852b1b
2024-10-22 15:50:50 +01:00
fanquake
0cdfb7e45c doc: update for 27.2rc1 2024-10-16 14:56:54 +01:00
fanquake
693403bed6 doc: update manual pages for 27.2rc1 2024-10-16 14:54:00 +01:00
fanquake
c338e43c6f build: bump version to 27.2rc1 2024-10-16 14:53:56 +01:00
merge-script
84df30927a Merge bitcoin/bitcoin#30558: [27.x] Even more backports
b06c4c6550 [WIP] doc: update release notes for 27.x (fanquake)
57de0f5e77 policy/feerate.h: avoid constraint self-dependency (Matt Whitlock)
ccff378a28 add missing #include <cstdint> for GCC 15 (Matt Whitlock)
500bba0561 test: fix constructor of msg_tx (Martin Zumsande)

Pull request description:

  Backports:
  * https://github.com/bitcoin/bitcoin/pull/30552
  * https://github.com/bitcoin/bitcoin/pull/30633

ACKs for top commit:
  stickies-v:
    ACK b06c4c6550

Tree-SHA512: 1b669d1c7e0c6c2c2a1b123970c2b5b59a417a423ee1133296ebad2ecb50e5c3889a6ae8dc640f8ae464a969b1b0287a8005a3317ee7d7252b61d96e59c131a4
2024-08-23 15:42:57 +01:00
fanquake
b06c4c6550 [WIP] doc: update release notes for 27.x 2024-08-23 12:16:39 +01:00
Matt Whitlock
57de0f5e77 policy/feerate.h: avoid constraint self-dependency
In file included from /usr/lib/gcc/x86_64-pc-linux-gnu/15/include/g++-v15/format:48,
                 from /usr/lib/gcc/x86_64-pc-linux-gnu/15/include/g++-v15/bits/chrono_io.h:39,
                 from /usr/lib/gcc/x86_64-pc-linux-gnu/15/include/g++-v15/chrono:3362,
                 from ./util/time.h:9,
                 from ./primitives/block.h:12,
                 from ./blockencodings.h:8,
                 from blockencodings.cpp:5:
/usr/lib/gcc/x86_64-pc-linux-gnu/15/include/g++-v15/type_traits: In substitution of 'template<class _Up>  requires !(is_same_v<std::optional<_Tp>, typename std::remove_cvref<_It2>::type>) && (is_constructible_v<_Tp, const _Up&>) && (__construct_from_contained_value<_Up, typename std::remove_cv< <template-parameter-1-1> >::type>) constexpr std::optional<CFeeRate>::optional(const std::optional<_Tp>&) [with _Up = CFeeRate]':
/usr/lib/gcc/x86_64-pc-linux-gnu/15/include/g++-v15/type_traits:1140:25:   required by substitution of 'template<class _Tp, class ... _Args> using std::__is_constructible_impl = std::__bool_constant<__is_constructible(_Tp, _Args ...)> [with _Tp = CFeeRate; _Args = {std::optional<CFeeRate>&}]'
 1140 |       = __bool_constant<__is_constructible(_Tp, _Args...)>;
      |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/lib/gcc/x86_64-pc-linux-gnu/15/include/g++-v15/type_traits:1145:12:   required from 'struct std::is_constructible<CFeeRate, std::optional<CFeeRate>&>'
 1145 |     struct is_constructible
      |            ^~~~~~~~~~~~~~~~
/usr/lib/gcc/x86_64-pc-linux-gnu/15/include/g++-v15/type_traits:178:35:   required by substitution of 'template<class ... _Bn> std::__detail::__first_t<std::integral_constant<bool, false>, typename std::enable_if<(!(bool)(_Bn::value)), void>::type ...> std::__detail::__or_fn(int) [with _Bn = {std::is_constructible<CFeeRate, std::optional<CFeeRate>&>, std::is_convertible<std::optional<CFeeRate>&, CFeeRate>, std::is_constructible<CFeeRate, std::optional<CFeeRate> >, std::is_convertible<std::optional<CFeeRate>, CFeeRate>, std::is_constructible<CFeeRate, const std::optional<CFeeRate>&>, std::is_convertible<const std::optional<CFeeRate>&, CFeeRate>, std::is_constructible<CFeeRate, const std::optional<CFeeRate> >, std::is_convertible<const std::optional<CFeeRate>, CFeeRate>}]'
  178 |                                      __enable_if_t<!bool(_Bn::value)>...>;
      |                                                               ^~~~~
/usr/lib/gcc/x86_64-pc-linux-gnu/15/include/g++-v15/type_traits:196:41:   required from 'struct std::__or_<std::is_constructible<CFeeRate, std::optional<CFeeRate>&>, std::is_convertible<std::optional<CFeeRate>&, CFeeRate>, std::is_constructible<CFeeRate, std::optional<CFeeRate> >, std::is_convertible<std::optional<CFeeRate>, CFeeRate>, std::is_constructible<CFeeRate, const std::optional<CFeeRate>&>, std::is_convertible<const std::optional<CFeeRate>&, CFeeRate>, std::is_constructible<CFeeRate, const std::optional<CFeeRate> >, std::is_convertible<const std::optional<CFeeRate>, CFeeRate> >'
  196 |     : decltype(__detail::__or_fn<_Bn...>(0))
      |                ~~~~~~~~~~~~~~~~~~~~~~~~~^~~
/usr/lib/gcc/x86_64-pc-linux-gnu/15/include/g++-v15/optional:824:45:   required from 'constexpr const bool std::optional<CFeeRate>::__construct_from_contained_value<CFeeRate, CFeeRate>'
  824 |           = !__converts_from_optional<_Tp, _From>::value;
      |                                                    ^~~~~
/usr/lib/gcc/x86_64-pc-linux-gnu/15/include/g++-v15/optional:884:7:   required by substitution of 'template<class _Up>  requires !(is_same_v<std::optional<_Tp>, typename std::remove_cvref<_It2>::type>) && (is_constructible_v<_Tp, const _Up&>) && (__construct_from_contained_value<_Up, typename std::remove_cv< <template-parameter-1-1> >::type>) constexpr std::optional<CFeeRate>::optional(const std::optional<_Tp>&) [with _Up = CFeeRate]'
  884 |           && __construct_from_contained_value<_Up>
      |              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./validation.h:164:41:   required from here
  164 |         return MempoolAcceptResult(state);
      |                                         ^
/usr/lib/gcc/x86_64-pc-linux-gnu/15/include/g++-v15/optional:886:2:   required by the constraints of 'template<class _Tp> template<class _Up>  requires !(is_same_v<std::optional<_Tp>, typename std::remove_cvref<_It2>::type>) && (is_constructible_v<_Tp, const _Up&>) && (__construct_from_contained_value<_Up, typename std::remove_cv< <template-parameter-1-1> >::type>) constexpr std::optional<_Tp>::optional(const std::optional<_From>&)'
/usr/lib/gcc/x86_64-pc-linux-gnu/15/include/g++-v15/optional:884:14: error: satisfaction of atomic constraint '__construct_from_contained_value<_Up, typename std::remove_cv< <template-parameter-1-1> >::type> [with _Tp = _Tp; _Up = _Up]' depends on itself
  884 |           && __construct_from_contained_value<_Up>
      |              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Github-Pull: #30633
Rebased-From: 055bc05792
2024-08-23 12:16:39 +01:00
Matt Whitlock
ccff378a28 add missing #include <cstdint> for GCC 15
Github-Pull: #30633
Rebased-From: 138f867156
2024-08-23 12:16:39 +01:00
Martin Zumsande
500bba0561 test: fix constructor of msg_tx
In python, if the default value is a mutable object (here: a class)
its shared over all instances, so that one instance being changed
would affect others to be changed as well.
This was likely the source of various intermittent bugs in the
functional tests.

Github-Pull: #30552
Rebased-From: ec5e294e4b
2024-07-31 12:04:45 +01:00
merge-script
0cbdc6b380 Merge bitcoin/bitcoin#30467: [27.x] More backports
4f23c86364 [WIP] doc: update release notes for 27.x (fanquake)
54bb9b0541 test: add test for modififed walletprocesspsbt calls (willcl-ark)
f22b9ca70c wallet: fix FillPSBT errantly showing as complete (willcl-ark)
05192ba84c init: change shutdown order of load block thread and scheduler (Martin Zumsande)
ab42206652 Reapply "test: p2p: check that connecting to ourself leads to disconnect" (Sebastian Falbesoner)
064f214673 net: prevent sending messages in `NetEventsInterface::InitializeNode` (Sebastian Falbesoner)
0933cf53b4 net: fix race condition in self-connect detection (Sebastian Falbesoner)
fa90989503 psbt: Check non witness utxo outpoint early (Ava Chow)

Pull request description:

  Backports:
  * https://github.com/bitcoin/bitcoin/pull/29855
  * https://github.com/bitcoin/bitcoin/pull/30357
  * https://github.com/bitcoin/bitcoin/pull/30394 (modified test commit)
  * https://github.com/bitcoin/bitcoin/pull/30435

ACKs for top commit:
  stickies-v:
    ACK 4f23c86364
  willcl-ark:
    ACK 4f23c86364

Tree-SHA512: 5c26445f0855f9d14890369ce19873b0686804eeb659e7d6da36a6f404f64d019436e1e6471579eaa60a96ebf8f64311883b4aef9d0ed528a95bd610c101c079
2024-07-24 10:31:55 +01:00
fanquake
4f23c86364 [WIP] doc: update release notes for 27.x 2024-07-23 15:47:06 +01:00
willcl-ark
54bb9b0541 test: add test for modififed walletprocesspsbt calls
This test checks that we can successfully process PSBTs and opt out of
finalization.

Previously trying to call `walletprocesspsbt` would attempt to
auto-finalize (as a convenience), and would not permit opt-out of
finalization, instead aborting via `CHECK_NONFATAL`.

Github-Pull: #30357
Rebased-From: 7e36dca657
2024-07-17 11:27:03 +01:00
willcl-ark
f22b9ca70c wallet: fix FillPSBT errantly showing as complete
Fix cases of calls to `FillPSBT` returning `complete=true` when it's not
the case.

This can happen when some inputs have been signed but the transaction is
subsequently modified, e.g. in the context of PayJoins.

Also fixes a related bug where a finalized hex string is attempted to be
added during `walletprocesspsbt` but a CHECK_NONFATAL causes an abort.

Reported in #30077.

Github-Pull: #30357
Rebased-From: 39cea21ec5
2024-07-17 11:27:03 +01:00
Martin Zumsande
05192ba84c init: change shutdown order of load block thread and scheduler
This avoids situations during a reindex in which shutdown
doesn't finish since SyncWithValidationInterfaceQueue is
called by the load block thread when the scheduler is already stopped.

Github-Pull: #30435
Rebased-From: 5fd4836019
2024-07-17 11:27:03 +01:00
Sebastian Falbesoner
ab42206652 Reapply "test: p2p: check that connecting to ourself leads to disconnect"
This reverts commit 9ec2c53701 with
a tiny change included (identation of the wait_until call).

Github-Pull: #30394
Rebased-From: 16bd283b3a
2024-07-17 11:27:03 +01:00
Sebastian Falbesoner
064f214673 net: prevent sending messages in NetEventsInterface::InitializeNode
Now that the queueing of the VERSION messages has been moved out of
`InitializeNode`, there is no need to pass a mutable `CNode` reference any
more. With a const reference, trying to send messages in this method would
lead to a compile-time error, e.g.:

----------------------------------------------------------------------------------------------------------------------------------
...
net_processing.cpp: In member function ‘virtual void {anonymous}::PeerManagerImpl::InitializeNode(const CNode&, ServiceFlags)’:
net_processing.cpp:1683:21: error: binding reference of type ‘CNode&’ to ‘const CNode’ discards qualifiers
 1683 |     PushNodeVersion(node, *peer);
...
----------------------------------------------------------------------------------------------------------------------------------

Github-Pull: #30394
Rebased-From: 0dbcd4c148
2024-07-17 11:27:03 +01:00
Sebastian Falbesoner
0933cf53b4 net: fix race condition in self-connect detection
Initiating an outbound network connection currently involves the
following steps after the socket connection is established (see
 `CConnman::OpenNetworkConnection` method):
    1. set up node state
    2. queue VERSION message
    3. add new node to vector `m_nodes`

If we connect to ourself, it can happen that the sent VERSION message
(step 2) is received and processed locally *before* the node object
is added to the connection manager's `m_nodes` vector (step 3). In this
case, the self-connect remains undiscovered, as the detection doesn't
find the outbound peer in `m_nodes` yet (see `CConnman::CheckIncomingNonce`).

Fix this by swapping the order of 2. and 3., by taking the `PushNodeVersion`
call out of `InitializeNode` and doing that in the `SendMessages` method
instead, which is only called for `CNode` instances in `m_nodes`.

Thanks go to vasild, mzumsande, dergoegge and sipa for suggestions on
how to fix this.

Github-Pull: #30394
Rebased-From: 66673f1c13
2024-07-17 11:27:03 +01:00
Ava Chow
fa90989503 psbt: Check non witness utxo outpoint early
A common issue that our fuzzers keep finding is that outpoints don't
exist in the non witness utxos. Instead of trying to track this down and
checking in various individual places, do the check early during
deserialization.

Github-Pull: #29855
Rebased-From: 9e13ccc50e
2024-07-17 11:27:03 +01:00
merge-script
b6440f20f2 Merge bitcoin/bitcoin#30305: [27.x] More backports
b3093eb755 doc: Update rel notes for 27.x (fanquake)
6338f92260 upnp: add compatibility for miniupnpc 2.2.8 (Cory Fields)
f34e44616d ci: remove unused bcc variable from workflow (Max Edwards)
0d524b1484 ci: move Asan / LSan / USDT job to Github Actions (Max Edwards)
43c40dd808 ci: add IPV6 network to ci container (Max Edwards)

Pull request description:

  Backports:
  * https://github.com/bitcoin/bitcoin/pull/30193
  * https://github.com/bitcoin/bitcoin/pull/30283
  * https://github.com/bitcoin/bitcoin/pull/30299

ACKs for top commit:
  willcl-ark:
    ACK b3093eb755
  stickies-v:
    ACK b3093eb755

Tree-SHA512: 325149f2b388072276e10fae2ebb7d8f3f5138d75f237c0182a09c631334fc2af9c2fe500db31bf41e94d4f154771e3cd386f8eb0d09d7a1ad656f637b71e735
2024-06-24 13:36:07 +01:00
fanquake
b3093eb755 doc: Update rel notes for 27.x 2024-06-24 11:38:32 +01:00
Cory Fields
6338f92260 upnp: add compatibility for miniupnpc 2.2.8
See: c0a50ce33e

The return value of 2 now indicates:
"A valid connected IGD has been found but its IP address is reserved (non routable)"

We continue to ignore any return value other than 1.

Github-Pull: #30283
Rebased-From: 8acdf66540
2024-06-19 12:49:04 +01:00
Max Edwards
f34e44616d ci: remove unused bcc variable from workflow
Github-Pull: #30299
Rebased-From: 518b06c4b8
2024-06-19 12:49:04 +01:00
Max Edwards
0d524b1484 ci: move Asan / LSan / USDT job to Github Actions
Moving it from Cirrus CI so it can be easier to maintain and used by forks

Github-Pull: #30193
Rebased-From: 9eea51d905
2024-06-19 12:48:57 +01:00
Max Edwards
43c40dd808 ci: add IPV6 network to ci container
Allows IPV6 functional tests to run inside the container

Github-Pull: #30193
Rebased-From: 4b527fa93b
2024-06-19 12:48:51 +01:00
merge-script
1088a98f5a Merge bitcoin/bitcoin#30222: [27.1] Finalize
d756a384d2 doc: update manual pages for 27.1 (fanquake)
93bb18f1c8 build: bump version to v27.1 final (fanquake)
fcf1241971 doc: update release notes for v27.1 final (fanquake)
f2e05cd2a9 depends: Update Boost download link (Hennadii Stepanov)
ba35920542 build: Fix building `fuzz` binary on on SunOS / illumos (Hennadii Stepanov)

Pull request description:

  Backports:
  * https://github.com/bitcoin/bitcoin/pull/30216
  * https://github.com/bitcoin/bitcoin/pull/30217

  I don't think either of these changes warrants an `rc2` cycle.

ACKs for top commit:
  stickies-v:
    ACK d756a384d2
  willcl-ark:
    ACK d756a384d2

Tree-SHA512: b5662143283a49156403d865dee25f3b6c22741345a4c8ff10f16845ea7a1a6d9d1319a70a44d07f31263bf1a6d85701146e9cc697b82a5a58922c48504a552c
2024-06-11 14:18:57 +01:00
fanquake
d756a384d2 doc: update manual pages for 27.1 2024-06-10 13:03:33 +01:00
fanquake
93bb18f1c8 build: bump version to v27.1 final 2024-06-10 13:03:33 +01:00
fanquake
fcf1241971 doc: update release notes for v27.1 final 2024-06-10 13:03:30 +01:00
Hennadii Stepanov
f2e05cd2a9 depends: Update Boost download link
See: https://github.com/boostorg/boost-tasks/pull/3

Github-Pull: #30217
Rebased-From: ffbc173ca1
2024-06-04 11:17:16 +01:00
Hennadii Stepanov
ba35920542 build: Fix building fuzz binary on on SunOS / illumos
Github-Pull: #30216
Rebased-From: 3299abce94
2024-06-04 11:17:16 +01:00
52 changed files with 316 additions and 170 deletions

View File

@@ -43,7 +43,6 @@ env: # Global defaults
# The following specific types should exist, with the following requirements:
# - small: For an x86_64 machine, recommended to have 2 CPUs and 8 GB of memory.
# - medium: For an x86_64 machine, recommended to have 4 CPUs and 16 GB of memory.
# - noble: For a machine running the Linux kernel shipped with exaclty Ubuntu Noble 24.04. The machine is recommended to have 4 CPUs and 16 GB of memory.
# - arm64: For an aarch64 machine, recommended to have 2 CPUs and 8 GB of memory.
# https://cirrus-ci.org/guide/tips-and-tricks/#sharing-configuration-between-tasks
@@ -159,19 +158,6 @@ task:
env:
FILE_ENV: "./ci/test/00_setup_env_native_msan.sh"
task:
name: 'ASan + LSan + UBSan + integer, no depends, USDT'
enable_bpfcc_script:
# In the image build step, no external environment variables are available,
# so any settings will need to be written to the settings env file:
- sed -i "s|\${CIRRUS_CI}|true|g" ./ci/test/00_setup_env_native_asan.sh
<< : *GLOBAL_TASK_TEMPLATE
persistent_worker:
labels:
type: noble # Must use this specific worker (needed for USDT functional tests)
env:
FILE_ENV: "./ci/test/00_setup_env_native_asan.sh"
task:
name: 'fuzzer,address,undefined,integer, no depends'
<< : *GLOBAL_TASK_TEMPLATE

View File

@@ -18,7 +18,6 @@ concurrency:
cancel-in-progress: true
env:
DANGER_RUN_CI_ON_HOST: 1
CI_FAILFAST_TEST_LEAVE_DANGLING: 1 # GHA does not care about dangling processes and setting this variable avoids killing the CI script itself on error
MAKEJOBS: '-j10'
@@ -81,6 +80,7 @@ jobs:
timeout-minutes: 120
env:
DANGER_RUN_CI_ON_HOST: 1
FILE_ENV: './ci/test/00_setup_env_mac_native.sh'
BASE_ROOT_DIR: ${{ github.workspace }}
@@ -137,7 +137,7 @@ jobs:
CI_CCACHE_VERSION: '4.7.5'
CI_QT_CONF: '-release -silent -opensource -confirm-license -opengl desktop -static -static-runtime -mp -qt-zlib -qt-pcre -qt-libpng -nomake examples -nomake tests -nomake tools -no-angle -no-dbus -no-gif -no-gtk -no-ico -no-icu -no-libjpeg -no-libudev -no-sql-sqlite -no-sql-odbc -no-sqlite -no-vulkan -skip qt3d -skip qtactiveqt -skip qtandroidextras -skip qtcharts -skip qtconnectivity -skip qtdatavis3d -skip qtdeclarative -skip doc -skip qtdoc -skip qtgamepad -skip qtgraphicaleffects -skip qtimageformats -skip qtlocation -skip qtlottie -skip qtmacextras -skip qtmultimedia -skip qtnetworkauth -skip qtpurchasing -skip qtquick3d -skip qtquickcontrols -skip qtquickcontrols2 -skip qtquicktimeline -skip qtremoteobjects -skip qtscript -skip qtscxml -skip qtsensors -skip qtserialbus -skip qtserialport -skip qtspeech -skip qtsvg -skip qtvirtualkeyboard -skip qtwayland -skip qtwebchannel -skip qtwebengine -skip qtwebglplugin -skip qtwebsockets -skip qtwebview -skip qtx11extras -skip qtxmlpatterns -no-openssl -no-feature-bearermanagement -no-feature-printdialog -no-feature-printer -no-feature-printpreviewdialog -no-feature-printpreviewwidget -no-feature-sql -no-feature-sqlmodel -no-feature-textbrowser -no-feature-textmarkdownwriter -no-feature-textodfwriter -no-feature-xml'
CI_QT_DIR: 'qt-everywhere-src-5.15.11'
CI_QT_URL: 'https://download.qt.io/official_releases/qt/5.15/5.15.11/single/qt-everywhere-opensource-src-5.15.11.zip'
CI_QT_URL: 'https://download.qt.io/archive/qt/5.15/5.15.11/single/qt-everywhere-opensource-src-5.15.11.zip'
PYTHONUTF8: 1
TEST_RUNNER_TIMEOUT_FACTOR: 40
@@ -294,3 +294,42 @@ jobs:
TEST_RUNNER_EXTRA: ${{ github.event_name != 'pull_request' && '--extended' || '' }}
shell: cmd
run: py -3 test\functional\test_runner.py --jobs %NUMBER_OF_PROCESSORS% --ci --quiet --tmpdirprefix=%RUNNER_TEMP% --combinedlogslen=99999999 --timeout-factor=%TEST_RUNNER_TIMEOUT_FACTOR% %TEST_RUNNER_EXTRA%
asan-lsan-ubsan-integer-no-depends-usdt:
name: 'ASan + LSan + UBSan + integer, no depends, USDT'
runs-on: ubuntu-24.04 # has to match container in ci/test/00_setup_env_native_asan.sh for tracing tools
# No need to run on the read-only mirror, unless it is a PR.
if: github.repository != 'bitcoin-core/gui' || github.event_name == 'pull_request'
timeout-minutes: 120
env:
FILE_ENV: "./ci/test/00_setup_env_native_asan.sh"
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set Ccache directory
run: echo "CCACHE_DIR=${RUNNER_TEMP}/ccache_dir" >> "$GITHUB_ENV"
- name: Restore Ccache cache
id: ccache-cache
uses: actions/cache/restore@v4
with:
path: ${{ env.CCACHE_DIR }}
key: ${{ github.job }}-ccache-${{ github.run_id }}
restore-keys: ${{ github.job }}-ccache-
- name: Enable bpfcc script
# In the image build step, no external environment variables are available,
# so any settings will need to be written to the settings env file:
run: sed -i "s|\${INSTALL_BCC_TRACING_TOOLS}|true|g" ./ci/test/00_setup_env_native_asan.sh
- name: CI script
run: ./ci/test_run_all.sh
- name: Save Ccache cache
uses: actions/cache/save@v4
if: github.event_name != 'pull_request' && steps.ccache-cache.outputs.cache-hit != 'true'
with:
path: ${{ env.CCACHE_DIR }}
# https://github.com/actions/cache/blob/main/tips-and-workarounds.md#update-a-cache
key: ${{ github.job }}-ccache-${{ github.run_id }}

View File

@@ -32,7 +32,7 @@ Qt
---------------------
To build Bitcoin Core with the GUI, a static build of Qt is required.
1. Download a single ZIP archive of Qt source code from https://download.qt.io/official_releases/qt/ (e.g., [`qt-everywhere-opensource-src-5.15.11.zip`](https://download.qt.io/official_releases/qt/5.15/5.15.11/single/qt-everywhere-opensource-src-5.15.11.zip)), and expand it into a dedicated folder. The following instructions assume that this folder is `C:\dev\qt-source`.
1. Download a single ZIP archive of Qt source code from https://download.qt.io/archive/qt/ (e.g., [`qt-everywhere-opensource-src-5.15.11.zip`](https://download.qt.io/archive/qt/5.15/5.15.11/single/qt-everywhere-opensource-src-5.15.11.zip)), and expand it into a dedicated folder. The following instructions assume that this folder is `C:\dev\qt-source`.
> 💡 **Tip:** If you use the default path with "Extract All" for the Qt source code zip file, and end up with something like `C:\dev\qt-everywhere-opensource-src-5.15.11\qt-everywhere-src-5.15.11`, you are likely to encounter a "path too long" error when building. To fix the problem move the source files to a shorter path such as the recommended `C:\dev\qt-source`.

View File

@@ -7,8 +7,10 @@
export LC_ALL=C.UTF-8
export CI_IMAGE_NAME_TAG="docker.io/ubuntu:24.04"
# Only install BCC tracing packages in Cirrus CI.
if [[ "${CIRRUS_CI}" == "true" ]]; then
# Only install BCC tracing packages in CI. Container has to match the host for BCC to work.
if [[ "${INSTALL_BCC_TRACING_TOOLS}" == "true" ]]; then
# Required for USDT functional tests to run
BPFCC_PACKAGE="bpfcc-tools linux-headers-$(uname --kernel-release)"
export CI_CONTAINER_CAP="--privileged -v /sys/kernel:/sys/kernel:rw"
else

View File

@@ -16,6 +16,7 @@ if [ -z "$DANGER_RUN_CI_ON_HOST" ]; then
# System-dependent env vars must be kept as is. So read them from the container.
docker run --rm "${CI_IMAGE_NAME_TAG}" bash -c "env | grep --extended-regexp '^(HOME|PATH|USER)='" | tee --append "/tmp/env-$USER-$CONTAINER_NAME"
echo "Creating $CI_IMAGE_NAME_TAG container to run in"
DOCKER_BUILDKIT=1 docker build \
--file "${BASE_READ_ONLY_DIR}/ci/test_imagefile" \
--build-arg "CI_IMAGE_NAME_TAG=${CI_IMAGE_NAME_TAG}" \
@@ -23,12 +24,15 @@ if [ -z "$DANGER_RUN_CI_ON_HOST" ]; then
--label="${CI_IMAGE_LABEL}" \
--tag="${CONTAINER_NAME}" \
"${BASE_READ_ONLY_DIR}"
docker volume create "${CONTAINER_NAME}_ccache" || true
docker volume create "${CONTAINER_NAME}_depends" || true
docker volume create "${CONTAINER_NAME}_depends_sources" || true
docker volume create "${CONTAINER_NAME}_depends_SDKs_android" || true
docker volume create "${CONTAINER_NAME}_previous_releases" || true
docker network create --ipv6 --subnet 1111:1111::/112 ci-ip6net || true
if [ -n "${RESTART_CI_DOCKER_BEFORE_RUN}" ] ; then
echo "Restart docker before run to stop and clear all containers started with --rm"
podman container rm --force --all # Similar to "systemctl restart docker"
@@ -56,6 +60,7 @@ if [ -z "$DANGER_RUN_CI_ON_HOST" ]; then
--mount "type=volume,src=${CONTAINER_NAME}_previous_releases,dst=$PREVIOUS_RELEASES_DIR" \
--env-file /tmp/env-$USER-$CONTAINER_NAME \
--name "$CONTAINER_NAME" \
--network ci-ip6net \
"$CONTAINER_NAME")
export CI_CONTAINER_ID
export CI_EXEC_CMD_PREFIX="docker exec ${CI_CONTAINER_ID}"

View File

@@ -119,7 +119,7 @@ if [ -n "$ANDROID_TOOLS_URL" ]; then
exit 0
fi
BITCOIN_CONFIG_ALL="${BITCOIN_CONFIG_ALL} --enable-external-signer --prefix=$BASE_OUTDIR"
BITCOIN_CONFIG_ALL="${BITCOIN_CONFIG_ALL} --prefix=$BASE_OUTDIR"
if [ -n "$CONFIG_SHELL" ]; then
"$CONFIG_SHELL" -c "./autogen.sh"

View File

@@ -1,8 +1,8 @@
AC_PREREQ([2.69])
define(_CLIENT_VERSION_MAJOR, 27)
define(_CLIENT_VERSION_MINOR, 1)
define(_CLIENT_VERSION_MINOR, 2)
define(_CLIENT_VERSION_BUILD, 0)
define(_CLIENT_VERSION_RC, 1)
define(_CLIENT_VERSION_RC, 0)
define(_CLIENT_VERSION_IS_RELEASE, true)
define(_COPYRIGHT_YEAR, 2024)
define(_COPYRIGHT_HOLDERS,[The %s developers])

View File

@@ -319,7 +319,7 @@ Source: https://logs.guix.gnu.org/guix/2020-11-12.log#232527
Start by cloning Guix:
```
git clone https://git.savannah.gnu.org/git/guix.git
git clone https://codeberg.org/guix/guix.git
cd guix
```
@@ -607,7 +607,7 @@ checklist.
```
Generation 38 Feb 22 2021 16:39:31 (current)
guix f350df4
repository URL: https://git.savannah.gnu.org/git/guix.git
repository URL: https://codeberg.org/guix/guix.git
branch: version-1.2.0
commit: f350df405fbcd5b9e27e6b6aa500da7f101f41e7
```
@@ -757,8 +757,8 @@ Please see the following links for more details:
- An upstream coreutils bug has been filed: [debbugs#47940](https://debbugs.gnu.org/cgi/bugreport.cgi?bug=47940)
- A Guix bug detailing the underlying problem has been filed: [guix-issues#47935](https://issues.guix.gnu.org/47935), [guix-issues#49985](https://issues.guix.gnu.org/49985#5)
- A commit to skip this test in Guix has been merged into the core-updates branch:
[savannah/guix@6ba1058](https://git.savannah.gnu.org/cgit/guix.git/commit/?id=6ba1058df0c4ce5611c2367531ae5c3cdc729ab4)
- A commit to skip this test is included since Guix 1.4.0:
[codeberg/guix@6ba1058](https://codeberg.org/guix/guix/commit/6ba1058df0c4ce5611c2367531ae5c3cdc729ab4)
[install-script]: #options-1-and-2-using-the-official-shell-installer-script-or-binary-tarball

View File

@@ -50,7 +50,7 @@ fi
# across time.
time-machine() {
# shellcheck disable=SC2086
guix time-machine --url=https://git.savannah.gnu.org/git/guix.git \
guix time-machine --url=https://codeberg.org/guix/guix.git \
--commit=d5ca4d4fd713a9f7e17e074a1e37dda99bbb09fc \
--cores="$JOBS" \
--keep-failed \

View File

@@ -41,7 +41,8 @@ from bcc import BPF, USDT
program = """
#include <uapi/linux/ptrace.h>
#define MIN(a,b) ({ __typeof__ (a) _a = (a); __typeof__ (b) _b = (b); _a < _b ? _a : _b; })
// A min() macro. Prefixed with _TRACEPOINT_TEST to avoid collision with other MIN macros.
#define _TRACEPOINT_TEST_MIN(a,b) ({ __typeof__ (a) _a = (a); __typeof__ (b) _b = (b); _a < _b ? _a : _b; })
// Maximum possible allocation size
// from include/linux/percpu.h in the Linux kernel
@@ -88,7 +89,7 @@ int trace_inbound_message(struct pt_regs *ctx) {
bpf_usdt_readarg_p(3, ctx, &msg->peer_conn_type, MAX_PEER_CONN_TYPE_LENGTH);
bpf_usdt_readarg_p(4, ctx, &msg->msg_type, MAX_MSG_TYPE_LENGTH);
bpf_usdt_readarg(5, ctx, &msg->msg_size);
bpf_usdt_readarg_p(6, ctx, &msg->msg, MIN(msg->msg_size, MAX_MSG_DATA_LENGTH));
bpf_usdt_readarg_p(6, ctx, &msg->msg, _TRACEPOINT_TEST_MIN(msg->msg_size, MAX_MSG_DATA_LENGTH));
inbound_messages.perf_submit(ctx, msg, sizeof(*msg));
return 0;
@@ -108,7 +109,7 @@ int trace_outbound_message(struct pt_regs *ctx) {
bpf_usdt_readarg_p(3, ctx, &msg->peer_conn_type, MAX_PEER_CONN_TYPE_LENGTH);
bpf_usdt_readarg_p(4, ctx, &msg->msg_type, MAX_MSG_TYPE_LENGTH);
bpf_usdt_readarg(5, ctx, &msg->msg_size);
bpf_usdt_readarg_p(6, ctx, &msg->msg, MIN(msg->msg_size, MAX_MSG_DATA_LENGTH));
bpf_usdt_readarg_p(6, ctx, &msg->msg, _TRACEPOINT_TEST_MIN(msg->msg_size, MAX_MSG_DATA_LENGTH));
outbound_messages.perf_submit(ctx, msg, sizeof(*msg));
return 0;

View File

@@ -147,7 +147,7 @@ include packages/packages.mk
# 2. Before including packages/*.mk (excluding packages/packages.mk), since
# they rely on the build_id variables
#
build_id:=$(shell env CC='$(build_CC)' C_STANDARD='$(C_STANDARD)' CXX='$(build_CXX)' CXX_STANDARD='$(CXX_STANDARD)' AR='$(build_AR) 'NM='$(build_NM)' RANLIB='$(build_RANLIB)' STRIP='$(build_STRIP)' SHA256SUM='$(build_SHA256SUM)' DEBUG='$(DEBUG)' LTO='$(LTO)' NO_HARDEN='$(NO_HARDEN)' ./gen_id '$(BUILD_ID_SALT)' 'GUIX_ENVIRONMENT=$(realpath $(GUIX_ENVIRONMENT))')
build_id:=$(shell env CC='$(build_CC)' C_STANDARD='$(C_STANDARD)' CXX='$(build_CXX)' CXX_STANDARD='$(CXX_STANDARD)' AR='$(build_AR)' NM='$(build_NM)' RANLIB='$(build_RANLIB)' STRIP='$(build_STRIP)' SHA256SUM='$(build_SHA256SUM)' DEBUG='$(DEBUG)' LTO='$(LTO)' NO_HARDEN='$(NO_HARDEN)' ./gen_id '$(BUILD_ID_SALT)' 'GUIX_ENVIRONMENT=$(realpath $(GUIX_ENVIRONMENT))')
$(host_arch)_$(host_os)_id:=$(shell env CC='$(host_CC)' C_STANDARD='$(C_STANDARD)' CXX='$(host_CXX)' CXX_STANDARD='$(CXX_STANDARD)' AR='$(host_AR)' NM='$(host_NM)' RANLIB='$(host_RANLIB)' STRIP='$(host_STRIP)' SHA256SUM='$(build_SHA256SUM)' DEBUG='$(DEBUG)' LTO='$(LTO)' NO_HARDEN='$(NO_HARDEN)' ./gen_id '$(HOST_ID_SALT)' 'GUIX_ENVIRONMENT=$(realpath $(GUIX_ENVIRONMENT))')
boost_packages_$(NO_BOOST) = $(boost_packages)

View File

@@ -7,8 +7,6 @@ netbsd_NM = $(host_toolchain)gcc-nm
netbsd_RANLIB = $(host_toolchain)gcc-ranlib
endif
netbsd_CXXFLAGS=$(netbsd_CFLAGS)
netbsd_release_CFLAGS=-O2
netbsd_release_CXXFLAGS=$(netbsd_release_CFLAGS)

View File

@@ -1,6 +1,6 @@
package=boost
$(package)_version=1.81.0
$(package)_download_path=https://boostorg.jfrog.io/artifactory/main/release/$($(package)_version)/source/
$(package)_download_path=https://archives.boost.io/release/$($(package)_version)/source/
$(package)_file_name=boost_$(subst .,_,$($(package)_version)).tar.bz2
$(package)_sha256_hash=71feeed900fbccca04a3b4f2f84a7c217186f28a940ed8b7ed4725986baf99fa
$(package)_patches=process_macos_sdk.patch

View File

@@ -9,7 +9,7 @@ $(package)_sha256_hash=$(native_$(package)_sha256_hash)
# setting in depends/config.site.in, which also hardcodes "lib".
# Without this setting, cmake by default would use the OS library
# directory, which might be "lib64" or something else, not "lib", on multiarch systems.
define $(package)_set_vars :=
define $(package)_set_vars
$(package)_config_opts := -DBUILD_TESTING=OFF
$(package)_config_opts += -DWITH_OPENSSL=OFF
$(package)_config_opts += -DWITH_ZLIB=OFF

View File

@@ -12,7 +12,7 @@ endif
# setting in depends/config.site.in, which also hardcodes "lib".
# Without this setting, cmake by default would use the OS library
# directory, which might be "lib64" or something else, not "lib", on multiarch systems.
define $(package)_set_vars :=
define $(package)_set_vars
$(package)_config_opts += -DCMAKE_INSTALL_LIBDIR=lib/
$(package)_config_opts += -DCMAKE_POSITION_INDEPENDENT_CODE=ON
ifneq ($(host),$(build))

View File

@@ -1,6 +1,6 @@
package=qt
$(package)_version=5.15.11
$(package)_download_path=https://download.qt.io/official_releases/qt/5.15/$($(package)_version)/submodules
$(package)_download_path=https://download.qt.io/archive/qt/5.15/$($(package)_version)/submodules
$(package)_suffix=everywhere-opensource-src-$($(package)_version).tar.xz
$(package)_file_name=qtbase-$($(package)_suffix)
$(package)_sha256_hash=425ad301acd91ca66c10c0dabee0704e2d0cd2801a6b670115800cbb95f84846
@@ -22,6 +22,7 @@ $(package)_patches += fast_fixed_dtoa_no_optimize.patch
$(package)_patches += guix_cross_lib_path.patch
$(package)_patches += fix-macos-linker.patch
$(package)_patches += memory_resource.patch
$(package)_patches += clang_18_libpng.patch
$(package)_patches += utc_from_string_no_optimize.patch
$(package)_patches += windows_lto.patch
$(package)_patches += zlib-timebits64.patch
@@ -250,6 +251,7 @@ define $(package)_preprocess_cmds
patch -p1 -i $($(package)_patch_dir)/qtbase-moc-ignore-gcc-macro.patch && \
patch -p1 -i $($(package)_patch_dir)/use_android_ndk23.patch && \
patch -p1 -i $($(package)_patch_dir)/memory_resource.patch && \
patch -p1 -i $($(package)_patch_dir)/clang_18_libpng.patch && \
patch -p1 -i $($(package)_patch_dir)/rcc_hardcode_timestamp.patch && \
patch -p1 -i $($(package)_patch_dir)/duplicate_lcqpafonts.patch && \
patch -p1 -i $($(package)_patch_dir)/utc_from_string_no_optimize.patch && \

View File

@@ -21,6 +21,8 @@ define $(package)_build_cmds
$(MAKE)
endef
# mkdir detection is broken on Alpine. Set MKDIRPROG to ensure we always
# use "mkdir -p", and avoid parallelism issues during install.
define $(package)_stage_cmds
$(MAKE) DESTDIR=$($(package)_staging_dir) install
$(MAKE) MKDIRPROG="mkdir -p" DESTDIR=$($(package)_staging_dir) install
endef

View File

@@ -0,0 +1,40 @@
fix Qt macOS build with Clang 18
See:
https://github.com/pnggroup/libpng/commit/893b8113f04d408cc6177c6de19c9889a48faa24.
In a similar manner as zlib (madler/zlib#895),
libpng contains a header configuration that's no longer valid and
hasn't been exercised for the macOS target.
- The target OS conditional macros are misused. Specifically
`TARGET_OS_MAC` covers all Apple targets, including iOS, and it
should not be checked with `#if defined` as they would always be
defined (to either 1 or 0) on Apple platforms.
- `#include <fp.h>` no longer works for the macOS target and results
in a compilation failure. macOS ships all required functions in
`math.h`, and clients should use `math.h` instead.
--- a/qtbase/src/3rdparty/libpng/pngpriv.h
+++ b/qtbase/src/3rdparty/libpng/pngpriv.h
@@ -514,18 +514,8 @@
*/
# include <float.h>
-# if (defined(__MWERKS__) && defined(macintosh)) || defined(applec) || \
- defined(THINK_C) || defined(__SC__) || defined(TARGET_OS_MAC)
- /* We need to check that <math.h> hasn't already been included earlier
- * as it seems it doesn't agree with <fp.h>, yet we should really use
- * <fp.h> if possible.
- */
-# if !defined(__MATH_H__) && !defined(__MATH_H) && !defined(__cmath__)
-# include <fp.h>
-# endif
-# else
-# include <math.h>
-# endif
+# include <math.h>
+
# if defined(_AMIGA) && defined(__SASC) && defined(_M68881)
/* Amiga SAS/C: We must include builtin FPU functions when compiling using
* MATH=68881

View File

@@ -30,7 +30,7 @@ You can find installation instructions in the `build-*.md` file for your platfor
| [Fontconfig](../depends/packages/fontconfig.mk) | [link](https://www.freedesktop.org/wiki/Software/fontconfig/) | [2.12.6](https://github.com/bitcoin/bitcoin/pull/23495) | 2.6 | Yes |
| [FreeType](../depends/packages/freetype.mk) | [link](https://freetype.org) | [2.11.0](https://github.com/bitcoin/bitcoin/commit/01544dd78ccc0b0474571da854e27adef97137fb) | 2.3.0 | Yes |
| [qrencode](../depends/packages/qrencode.mk) | [link](https://fukuchi.org/works/qrencode/) | [4.1.1](https://github.com/bitcoin/bitcoin/pull/27312) | | No |
| [Qt](../depends/packages/qt.mk) | [link](https://download.qt.io/official_releases/qt/) | [5.15.11](https://github.com/bitcoin/bitcoin/pull/28769) | [5.11.3](https://github.com/bitcoin/bitcoin/pull/24132) | No |
| [Qt](../depends/packages/qt.mk) | [link](https://download.qt.io/archive/qt/) | [5.15.11](https://github.com/bitcoin/bitcoin/pull/28769) | [5.11.3](https://github.com/bitcoin/bitcoin/pull/24132) | No |
### Networking
| Dependency | Releases | Version used | Minimum required | Runtime |

View File

@@ -1,7 +1,7 @@
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3.
.TH BITCOIN-CLI "1" "May 2024" "bitcoin-cli v27.1.0rc1" "User Commands"
.TH BITCOIN-CLI "1" "October 2024" "bitcoin-cli v27.2.0" "User Commands"
.SH NAME
bitcoin-cli \- manual page for bitcoin-cli v27.1.0rc1
bitcoin-cli \- manual page for bitcoin-cli v27.2.0
.SH SYNOPSIS
.B bitcoin-cli
[\fI\,options\/\fR] \fI\,<command> \/\fR[\fI\,params\/\fR] \fI\,Send command to Bitcoin Core\/\fR
@@ -15,7 +15,7 @@ bitcoin-cli \- manual page for bitcoin-cli v27.1.0rc1
.B bitcoin-cli
[\fI\,options\/\fR] \fI\,help <command> Get help for a command\/\fR
.SH DESCRIPTION
Bitcoin Core RPC client version v27.1.0rc1
Bitcoin Core RPC client version v27.2.0
.SH OPTIONS
.HP
\-?

View File

@@ -1,12 +1,12 @@
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3.
.TH BITCOIN-QT "1" "May 2024" "bitcoin-qt v27.1.0rc1" "User Commands"
.TH BITCOIN-QT "1" "October 2024" "bitcoin-qt v27.2.0" "User Commands"
.SH NAME
bitcoin-qt \- manual page for bitcoin-qt v27.1.0rc1
bitcoin-qt \- manual page for bitcoin-qt v27.2.0
.SH SYNOPSIS
.B bitcoin-qt
[\fI\,command-line options\/\fR] [\fI\,URI\/\fR]
.SH DESCRIPTION
Bitcoin Core version v27.1.0rc1
Bitcoin Core version v27.2.0
.PP
Optional URI is a Bitcoin address in BIP21 URI format.
.SH OPTIONS

View File

@@ -1,7 +1,7 @@
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3.
.TH BITCOIN-TX "1" "May 2024" "bitcoin-tx v27.1.0rc1" "User Commands"
.TH BITCOIN-TX "1" "October 2024" "bitcoin-tx v27.2.0" "User Commands"
.SH NAME
bitcoin-tx \- manual page for bitcoin-tx v27.1.0rc1
bitcoin-tx \- manual page for bitcoin-tx v27.2.0
.SH SYNOPSIS
.B bitcoin-tx
[\fI\,options\/\fR] \fI\,<hex-tx> \/\fR[\fI\,commands\/\fR] \fI\,Update hex-encoded bitcoin transaction\/\fR
@@ -9,7 +9,7 @@ bitcoin-tx \- manual page for bitcoin-tx v27.1.0rc1
.B bitcoin-tx
[\fI\,options\/\fR] \fI\,-create \/\fR[\fI\,commands\/\fR] \fI\,Create hex-encoded bitcoin transaction\/\fR
.SH DESCRIPTION
Bitcoin Core bitcoin\-tx utility version v27.1.0rc1
Bitcoin Core bitcoin\-tx utility version v27.2.0
.SH OPTIONS
.HP
\-?

View File

@@ -1,12 +1,12 @@
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3.
.TH BITCOIN-UTIL "1" "May 2024" "bitcoin-util v27.1.0rc1" "User Commands"
.TH BITCOIN-UTIL "1" "October 2024" "bitcoin-util v27.2.0" "User Commands"
.SH NAME
bitcoin-util \- manual page for bitcoin-util v27.1.0rc1
bitcoin-util \- manual page for bitcoin-util v27.2.0
.SH SYNOPSIS
.B bitcoin-util
[\fI\,options\/\fR] [\fI\,commands\/\fR] \fI\,Do stuff\/\fR
.SH DESCRIPTION
Bitcoin Core bitcoin\-util utility version v27.1.0rc1
Bitcoin Core bitcoin\-util utility version v27.2.0
.SH OPTIONS
.HP
\-?

View File

@@ -1,9 +1,9 @@
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3.
.TH BITCOIN-WALLET "1" "May 2024" "bitcoin-wallet v27.1.0rc1" "User Commands"
.TH BITCOIN-WALLET "1" "October 2024" "bitcoin-wallet v27.2.0" "User Commands"
.SH NAME
bitcoin-wallet \- manual page for bitcoin-wallet v27.1.0rc1
bitcoin-wallet \- manual page for bitcoin-wallet v27.2.0
.SH DESCRIPTION
Bitcoin Core bitcoin\-wallet version v27.1.0rc1
Bitcoin Core bitcoin\-wallet version v27.2.0
.PP
bitcoin\-wallet is an offline tool for creating and interacting with Bitcoin Core wallet files.
By default bitcoin\-wallet will act on wallets in the default mainnet wallet directory in the datadir.

View File

@@ -1,12 +1,12 @@
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3.
.TH BITCOIND "1" "May 2024" "bitcoind v27.1.0rc1" "User Commands"
.TH BITCOIND "1" "October 2024" "bitcoind v27.2.0" "User Commands"
.SH NAME
bitcoind \- manual page for bitcoind v27.1.0rc1
bitcoind \- manual page for bitcoind v27.2.0
.SH SYNOPSIS
.B bitcoind
[\fI\,options\/\fR] \fI\,Start Bitcoin Core\/\fR
.SH DESCRIPTION
Bitcoin Core version v27.1.0rc1
Bitcoin Core version v27.2.0
.SH OPTIONS
.HP
\-?

View File

@@ -1,9 +1,9 @@
27.1rc1 Release Notes
27.x Release Notes
=====================
Bitcoin Core version 27.1rc1 is now available from:
Bitcoin Core version 27.x is now available from:
<https://bitcoincore.org/bin/bitcoin-core-27.1/test.rc1/>
<https://bitcoincore.org/bin/bitcoin-core-27.x/>
This release includes various bug fixes and performance
improvements, as well as updated translations.
@@ -40,73 +40,48 @@ unsupported systems.
Notable changes
===============
### Miniscript
- #29853 sign: don't assume we are parsing a sane TapMiniscript
### RPC
- #29869 rpc, bugfix: Enforce maximum value for setmocktime
- #29870 rpc: Reword SighashFromStr error message
- #30094 rpc: move UniValue in blockToJSON
### Index
- #29776 Fix #29767, set m_synced = true after Commit()
### Gui
- #gui812 Fix create unsigned transaction fee bump
- #gui813 Don't permit port in proxy IP option
### Test
- #29892 test: Fix failing univalue float test
External signing is not currently supported when compiling with Boost version 1.88.0 or later.
### P2P
- #30085 p2p: detect addnode cjdns peers in GetAddedNodeInfo()
- #33395 net: Do not apply whitelist permission to onion inbounds
### Test
- #31419 test: fix MIN macro redefinition
- #32286 test: Handle empty string returned by CLI as None in RPC tests
- #32336 test: Suppress upstream -Wduplicate-decl-specifier in bpfcc
### Build
- #29747 depends: fix mingw-w64 Qt DEBUG=1 build
- #29859 build: Fix false positive CHECK_ATOMIC test
- #29985 depends: Fix build of Qt for 32-bit platforms with recent glibc
- #30097 crypto: disable asan for sha256_sse4 with clang and -O0
- #30151 depends: Fetch miniupnpc sources from an alternative website
### Doc
- #29934 doc: add LLVM instruction for macOS < 13
### CI
- #29856 ci: Bump s390x to ubuntu:24.04
- #30198 depends: fix Qt macOS build with Clang 18
- #31502 depends: Fix CXXFLAGS on NetBSD
- #31627 depends: Fix spacing issue
- #32070 build: use make < 3.82 syntax for define directive
- #32439 guix: accomodate migration to codeberg
- #32568 depends: use "mkdir -p" when installing xproto
- #33563 build: fix depends Qt download link
### Misc
- #29691 Change Luke Dashjr seed to dashjr-list-of-p2p-nodes.us
- #30149 contrib: Renew Windows code signing certificate
- #31623 tracing: Rename the MIN macro to TRACEPOINT_TEST_MIN in log_raw_p2p_msgs
- #32187 refactor: Remove spurious virtual from final ~CZMQNotificationInterface
- #33561 ci: Fix Qt 5.15 URL
Credits
=======
Thanks to everyone who directly contributed to this release:
- Antoine Poinsot
- Ava Chow
- Cory Fields
- dergoegge
- 0xb10c
- Brandon Odiwuor
- fanquake
- furszy
- Hennadii Stepanov
- Jon Atack
- laanwj
- Luke Dashjr
- MarcoFalke
- nanlour
- Martin Zumsande
- Sjors Provoost
- willcl-ark
- Vasil Dimov
As well as to everyone that helped with translations on
[Transifex](https://www.transifex.com/bitcoin/bitcoin/).

View File

@@ -274,7 +274,7 @@ FUZZ_SUITE_LD_COMMON += $(LIBBITCOIN_ZMQ) $(ZMQ_LIBS)
endif
if ENABLE_FUZZ_BINARY
test_fuzz_fuzz_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES) $(BOOST_CPPFLAGS)
test_fuzz_fuzz_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES) $(BOOST_CPPFLAGS) $(EVENT_CFLAGS)
test_fuzz_fuzz_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS)
test_fuzz_fuzz_LDADD = $(FUZZ_SUITE_LD_COMMON)
test_fuzz_fuzz_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS) $(PTHREAD_FLAGS)

View File

@@ -7,6 +7,7 @@
#include <util/chaintype.h>
#include <cstdint>
#include <memory>
#include <string>

View File

@@ -296,10 +296,11 @@ void Shutdown(NodeContext& node)
StopTorControl();
// After everything has been shut down, but before things get flushed, stop the
// scheduler and load block thread.
if (node.scheduler) node.scheduler->stop();
if (node.chainman && node.chainman->m_thread_load.joinable()) node.chainman->m_thread_load.join();
// After everything has been shut down, but before things get flushed, stop the
// the scheduler. After this point, SyncWithValidationInterfaceQueue() should not be called anymore
// as this would prevent the shutdown from completing.
if (node.scheduler) node.scheduler->stop();
// After the threads that potentially access these pointers have been stopped,
// destruct and reset all to nullptr.

View File

@@ -163,8 +163,11 @@ static bool ProcessUpnp()
struct UPNPUrls urls;
struct IGDdatas data;
int r;
#if MINIUPNPC_API_VERSION <= 17
r = UPNP_GetValidIGD(devlist, &urls, &data, lanaddr, sizeof(lanaddr));
#else
r = UPNP_GetValidIGD(devlist, &urls, &data, lanaddr, sizeof(lanaddr), nullptr, 0);
#endif
if (r == 1)
{
if (fDiscover) {

View File

@@ -558,9 +558,9 @@ void CNode::CloseSocketDisconnect()
m_i2p_sam_session.reset();
}
void CConnman::AddWhitelistPermissionFlags(NetPermissionFlags& flags, const CNetAddr &addr) const {
void CConnman::AddWhitelistPermissionFlags(NetPermissionFlags& flags, std::optional<CNetAddr> addr) const {
for (const auto& subnet : vWhitelistedRange) {
if (subnet.m_subnet.Match(addr)) NetPermissions::AddFlag(flags, subnet.m_flags);
if (addr.has_value() && subnet.m_subnet.Match(addr.value())) NetPermissions::AddFlag(flags, subnet.m_flags);
}
}
@@ -1726,7 +1726,11 @@ void CConnman::CreateNodeFromAcceptedSocket(std::unique_ptr<Sock>&& sock,
{
int nInbound = 0;
AddWhitelistPermissionFlags(permission_flags, addr);
const bool inbound_onion = std::find(m_onion_binds.begin(), m_onion_binds.end(), addr_bind) != m_onion_binds.end();
// Tor inbound connections do not reveal the peer's actual network address.
// Therefore do not apply address-based whitelist permissions to them.
AddWhitelistPermissionFlags(permission_flags, inbound_onion ? std::optional<CNetAddr>{} : addr);
if (NetPermissions::HasFlag(permission_flags, NetPermissionFlags::Implicit)) {
NetPermissions::ClearFlag(permission_flags, NetPermissionFlags::Implicit);
if (gArgs.GetBoolArg("-whitelistforcerelay", DEFAULT_WHITELISTFORCERELAY)) NetPermissions::AddFlag(permission_flags, NetPermissionFlags::ForceRelay);
@@ -1793,7 +1797,6 @@ void CConnman::CreateNodeFromAcceptedSocket(std::unique_ptr<Sock>&& sock,
nodeServices = static_cast<ServiceFlags>(nodeServices | NODE_BLOOM);
}
const bool inbound_onion = std::find(m_onion_binds.begin(), m_onion_binds.end(), addr_bind) != m_onion_binds.end();
// The V2Transport transparently falls back to V1 behavior when an incoming V1 connection is
// detected, so use it whenever we signal NODE_P2P_V2.
const bool use_v2transport(nodeServices & NODE_P2P_V2);

View File

@@ -999,8 +999,8 @@ public:
/** Mutex for anything that is only accessed via the msg processing thread */
static Mutex g_msgproc_mutex;
/** Initialize a peer (setup state, queue any initial messages) */
virtual void InitializeNode(CNode& node, ServiceFlags our_services) = 0;
/** Initialize a peer (setup state) */
virtual void InitializeNode(const CNode& node, ServiceFlags our_services) = 0;
/** Handle removal of a peer (clear state) */
virtual void FinalizeNode(const CNode& node) = 0;
@@ -1339,7 +1339,7 @@ private:
bool AttemptToEvictConnection();
CNode* ConnectNode(CAddress addrConnect, const char *pszDest, bool fCountFailure, ConnectionType conn_type, bool use_v2transport) EXCLUSIVE_LOCKS_REQUIRED(!m_unused_i2p_sessions_mutex);
void AddWhitelistPermissionFlags(NetPermissionFlags& flags, const CNetAddr &addr) const;
void AddWhitelistPermissionFlags(NetPermissionFlags& flags, std::optional<CNetAddr> addr) const;
void DeleteNode(CNode* pnode);

View File

@@ -245,6 +245,9 @@ struct Peer {
* Most peers use headers-first syncing, which doesn't use this mechanism */
uint256 m_continuation_block GUARDED_BY(m_block_inv_mutex) {};
/** Set to true once initial VERSION message was sent (only relevant for outbound peers). */
bool m_outbound_version_message_sent GUARDED_BY(NetEventsInterface::g_msgproc_mutex){false};
/** This peer's reported block height when we connected */
std::atomic<int> m_starting_height{-1};
@@ -499,7 +502,7 @@ public:
EXCLUSIVE_LOCKS_REQUIRED(!m_most_recent_block_mutex);
/** Implement NetEventsInterface */
void InitializeNode(CNode& node, ServiceFlags our_services) override EXCLUSIVE_LOCKS_REQUIRED(!m_peer_mutex);
void InitializeNode(const CNode& node, ServiceFlags our_services) override EXCLUSIVE_LOCKS_REQUIRED(!m_peer_mutex);
void FinalizeNode(const CNode& node) override EXCLUSIVE_LOCKS_REQUIRED(!m_peer_mutex, !m_headers_presync_mutex);
bool HasAllDesirableServiceFlags(ServiceFlags services) const override;
bool ProcessMessages(CNode* pfrom, std::atomic<bool>& interrupt) override
@@ -1563,7 +1566,7 @@ void PeerManagerImpl::UpdateLastBlockAnnounceTime(NodeId node, int64_t time_in_s
if (state) state->m_last_block_announcement = time_in_seconds;
}
void PeerManagerImpl::InitializeNode(CNode& node, ServiceFlags our_services)
void PeerManagerImpl::InitializeNode(const CNode& node, ServiceFlags our_services)
{
NodeId nodeid = node.GetId();
{
@@ -1576,9 +1579,6 @@ void PeerManagerImpl::InitializeNode(CNode& node, ServiceFlags our_services)
LOCK(m_peer_mutex);
m_peer_map.emplace_hint(m_peer_map.end(), nodeid, peer);
}
if (!node.IsInboundConn()) {
PushNodeVersion(node, *peer);
}
}
void PeerManagerImpl::ReattemptInitialBroadcast(CScheduler& scheduler)
@@ -5060,6 +5060,10 @@ bool PeerManagerImpl::ProcessMessages(CNode* pfrom, std::atomic<bool>& interrupt
PeerRef peer = GetPeerRef(pfrom->GetId());
if (peer == nullptr) return false;
// For outbound connections, ensure that the initial VERSION message
// has been sent first before processing any incoming messages
if (!pfrom->IsInboundConn() && !peer->m_outbound_version_message_sent) return false;
{
LOCK(peer->m_getdata_requests_mutex);
if (!peer->m_getdata_requests.empty()) {
@@ -5548,6 +5552,12 @@ bool PeerManagerImpl::SendMessages(CNode* pto)
// disconnect misbehaving peers even before the version handshake is complete.
if (MaybeDiscourageAndDisconnect(*pto, *peer)) return true;
// Initiate version handshake for outbound connections
if (!pto->IsInboundConn() && !peer->m_outbound_version_message_sent) {
PushNodeVersion(*pto, *peer);
peer->m_outbound_version_message_sent = true;
}
// Don't send anything until the version handshake is complete
if (!pto->fSuccessfullyConnected || pto->fDisconnect)
return true;

View File

@@ -6,9 +6,10 @@
#ifndef BITCOIN_NODE_INTERFACE_UI_H
#define BITCOIN_NODE_INTERFACE_UI_H
#include <cstdint>
#include <functional>
#include <memory>
#include <string>
#include <vector>
class CBlockIndex;
enum class SynchronizationState;

View File

@@ -38,10 +38,8 @@ private:
public:
/** Fee rate of 0 satoshis per kvB */
CFeeRate() : nSatoshisPerK(0) { }
template<typename I>
template<std::integral I> // Disallow silent float -> int conversion
explicit CFeeRate(const I _nSatoshisPerK): nSatoshisPerK(_nSatoshisPerK) {
// We've previously had bugs creep in from silent double->int conversion...
static_assert(std::is_integral<I>::value, "CFeeRate should be used without floats");
}
/**

View File

@@ -1173,8 +1173,13 @@ struct PartiallySignedTransaction
inputs.push_back(input);
// Make sure the non-witness utxo matches the outpoint
if (input.non_witness_utxo && input.non_witness_utxo->GetHash() != tx->vin[i].prevout.hash) {
throw std::ios_base::failure("Non-witness UTXO does not match outpoint hash");
if (input.non_witness_utxo) {
if (input.non_witness_utxo->GetHash() != tx->vin[i].prevout.hash) {
throw std::ios_base::failure("Non-witness UTXO does not match outpoint hash");
}
if (tx->vin[i].prevout.n >= input.non_witness_utxo->vout.size()) {
throw std::ios_base::failure("Input specifies output index that does not exist");
}
}
++i;
}

View File

@@ -28,7 +28,8 @@ void ConnmanTestMsg::Handshake(CNode& node,
auto& connman{*this};
peerman.InitializeNode(node, local_services);
FlushSendBuffer(node); // Drop the version message added by InitializeNode.
peerman.SendMessages(&node);
FlushSendBuffer(node); // Drop the version message added by SendMessages.
CSerializedNetMsg msg_version{
NetMsg::Make(NetMsgType::VERSION,

View File

@@ -363,9 +363,7 @@ public:
* that are guarded by it.
*
* @par Consistency guarantees
*
* By design, it is guaranteed that:
*
* 1. Locking both `cs_main` and `mempool.cs` will give a view of mempool
* that is consistent with current chain tip (`ActiveChain()` and
* `CoinsTip()`) and is fully populated. Fully populated means that if the
@@ -373,7 +371,6 @@ public:
* previously active chain, all the missing transactions will have been
* re-added to the mempool and should be present if they meet size and
* consistency constraints.
*
* 2. Locking `mempool.cs` without `cs_main` will give a view of a mempool
* consistent with some chain that was active since `cs_main` was last
* locked, and that is fully populated as described above. It is ok for

View File

@@ -2184,8 +2184,8 @@ TransactionError CWallet::FillPSBT(PartiallySignedTransaction& psbtx, bool& comp
// Complete if every input is now signed
complete = true;
for (const auto& input : psbtx.inputs) {
complete &= PSBTInputSigned(input);
for (size_t i = 0; i < psbtx.inputs.size(); ++i) {
complete &= PSBTInputSignedAndVerified(psbtx, i, &txdata);
}
return TransactionError::OK;

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2015-2022 The Bitcoin Core developers
// Copyright (c) 2015-present The Bitcoin Core developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
@@ -21,7 +21,7 @@ struct NewMempoolTransactionInfo;
class CZMQNotificationInterface final : public CValidationInterface
{
public:
virtual ~CZMQNotificationInterface();
~CZMQNotificationInterface();
std::list<const CZMQAbstractNotifier*> GetActiveNotifiers() const;

View File

@@ -38,7 +38,9 @@
"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"
],
"invalid_with_msg": [
[

View File

@@ -1,5 +1,5 @@
#!/usr/bin/env python3
# Copyright (c) 2022 The Bitcoin Core developers
# Copyright (c) 2022-present The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
@@ -17,6 +17,7 @@ from test_framework.util import (
assert_equal,
assert_greater_than,
assert_raises_rpc_error,
bpf_cflags,
)
coinselection_tracepoints_program = """
@@ -166,7 +167,7 @@ class CoinSelectionTracepointTest(BitcoinTestFramework):
ctx.enable_probe(probe="coin_selection:normal_create_tx_internal", fn_name="trace_normal_create_tx")
ctx.enable_probe(probe="coin_selection:attempting_aps_create_tx", fn_name="trace_attempt_aps")
ctx.enable_probe(probe="coin_selection:aps_create_tx_internal", fn_name="trace_aps_create_tx")
self.bpf = BPF(text=coinselection_tracepoints_program, usdt_contexts=[ctx], debug=0, cflags=["-Wno-error=implicit-function-declaration"])
self.bpf = BPF(text=coinselection_tracepoints_program, usdt_contexts=[ctx], debug=0, cflags=bpf_cflags())
self.log.info("Prepare wallets")
self.generate(self.nodes[0], 101)

View File

@@ -1,5 +1,5 @@
#!/usr/bin/env python3
# Copyright (c) 2022 The Bitcoin Core developers
# Copyright (c) 2022-present The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
@@ -19,7 +19,10 @@ from test_framework.blocktools import COINBASE_MATURITY
from test_framework.messages import COIN, DEFAULT_MEMPOOL_EXPIRY_HOURS
from test_framework.p2p import P2PDataStore
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import assert_equal
from test_framework.util import (
assert_equal,
bpf_cflags,
)
from test_framework.wallet import MiniWallet
MEMPOOL_TRACEPOINTS_PROGRAM = """
@@ -144,7 +147,7 @@ class MempoolTracepointTest(BitcoinTestFramework):
node = self.nodes[0]
ctx = USDT(pid=node.process.pid)
ctx.enable_probe(probe="mempool:added", fn_name="trace_added")
bpf = BPF(text=MEMPOOL_TRACEPOINTS_PROGRAM, usdt_contexts=[ctx], debug=0, cflags=["-Wno-error=implicit-function-declaration"])
bpf = BPF(text=MEMPOOL_TRACEPOINTS_PROGRAM, usdt_contexts=[ctx], debug=0, cflags=bpf_cflags())
def handle_added_event(_, data, __):
events.append(bpf["added_events"].event(data))
@@ -181,7 +184,7 @@ class MempoolTracepointTest(BitcoinTestFramework):
node = self.nodes[0]
ctx = USDT(pid=node.process.pid)
ctx.enable_probe(probe="mempool:removed", fn_name="trace_removed")
bpf = BPF(text=MEMPOOL_TRACEPOINTS_PROGRAM, usdt_contexts=[ctx], debug=0, cflags=["-Wno-error=implicit-function-declaration"])
bpf = BPF(text=MEMPOOL_TRACEPOINTS_PROGRAM, usdt_contexts=[ctx], debug=0, cflags=bpf_cflags())
def handle_removed_event(_, data, __):
events.append(bpf["removed_events"].event(data))
@@ -227,7 +230,7 @@ class MempoolTracepointTest(BitcoinTestFramework):
node = self.nodes[0]
ctx = USDT(pid=node.process.pid)
ctx.enable_probe(probe="mempool:replaced", fn_name="trace_replaced")
bpf = BPF(text=MEMPOOL_TRACEPOINTS_PROGRAM, usdt_contexts=[ctx], debug=0, cflags=["-Wno-error=implicit-function-declaration"])
bpf = BPF(text=MEMPOOL_TRACEPOINTS_PROGRAM, usdt_contexts=[ctx], debug=0, cflags=bpf_cflags())
def handle_replaced_event(_, data, __):
events.append(bpf["replaced_events"].event(data))
@@ -278,7 +281,7 @@ class MempoolTracepointTest(BitcoinTestFramework):
self.log.info("Hooking into mempool:rejected tracepoint...")
ctx = USDT(pid=node.process.pid)
ctx.enable_probe(probe="mempool:rejected", fn_name="trace_rejected")
bpf = BPF(text=MEMPOOL_TRACEPOINTS_PROGRAM, usdt_contexts=[ctx], debug=0, cflags=["-Wno-error=implicit-function-declaration"])
bpf = BPF(text=MEMPOOL_TRACEPOINTS_PROGRAM, usdt_contexts=[ctx], debug=0, cflags=bpf_cflags())
def handle_rejected_event(_, data, __):
events.append(bpf["rejected_events"].event(data))

View File

@@ -1,5 +1,5 @@
#!/usr/bin/env python3
# Copyright (c) 2022 The Bitcoin Core developers
# Copyright (c) 2022-present The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
@@ -17,7 +17,10 @@ except ImportError:
from test_framework.messages import msg_version
from test_framework.p2p import P2PInterface
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import assert_equal
from test_framework.util import (
assert_equal,
bpf_cflags,
)
# Tor v3 addresses are 62 chars + 6 chars for the port (':12345').
MAX_PEER_ADDR_LENGTH = 68
@@ -40,7 +43,8 @@ net_tracepoints_program = """
MAX_MSG_TYPE_LENGTH,
MAX_MSG_DATA_LENGTH
) + """
#define MIN(a,b) ({ __typeof__ (a) _a = (a); __typeof__ (b) _b = (b); _a < _b ? _a : _b; })
// A min() macro. Prefixed with _TRACEPOINT_TEST to avoid collision with other MIN macros.
#define _TRACEPOINT_TEST_MIN(a,b) ({ __typeof__ (a) _a = (a); __typeof__ (b) _b = (b); _a < _b ? _a : _b; })
struct p2p_message
{
@@ -60,7 +64,7 @@ int trace_inbound_message(struct pt_regs *ctx) {
bpf_usdt_readarg_p(3, ctx, &msg.peer_conn_type, MAX_PEER_CONN_TYPE_LENGTH);
bpf_usdt_readarg_p(4, ctx, &msg.msg_type, MAX_MSG_TYPE_LENGTH);
bpf_usdt_readarg(5, ctx, &msg.msg_size);
bpf_usdt_readarg_p(6, ctx, &msg.msg, MIN(msg.msg_size, MAX_MSG_DATA_LENGTH));
bpf_usdt_readarg_p(6, ctx, &msg.msg, _TRACEPOINT_TEST_MIN(msg.msg_size, MAX_MSG_DATA_LENGTH));
inbound_messages.perf_submit(ctx, &msg, sizeof(msg));
return 0;
}
@@ -73,7 +77,7 @@ int trace_outbound_message(struct pt_regs *ctx) {
bpf_usdt_readarg_p(3, ctx, &msg.peer_conn_type, MAX_PEER_CONN_TYPE_LENGTH);
bpf_usdt_readarg_p(4, ctx, &msg.msg_type, MAX_MSG_TYPE_LENGTH);
bpf_usdt_readarg(5, ctx, &msg.msg_size);
bpf_usdt_readarg_p(6, ctx, &msg.msg, MIN(msg.msg_size, MAX_MSG_DATA_LENGTH));
bpf_usdt_readarg_p(6, ctx, &msg.msg, _TRACEPOINT_TEST_MIN(msg.msg_size, MAX_MSG_DATA_LENGTH));
outbound_messages.perf_submit(ctx, &msg, sizeof(msg));
return 0;
};
@@ -114,7 +118,7 @@ class NetTracepointTest(BitcoinTestFramework):
fn_name="trace_inbound_message")
ctx.enable_probe(probe="net:outbound_message",
fn_name="trace_outbound_message")
bpf = BPF(text=net_tracepoints_program, usdt_contexts=[ctx], debug=0, cflags=["-Wno-error=implicit-function-declaration"])
bpf = BPF(text=net_tracepoints_program, usdt_contexts=[ctx], debug=0, cflags=bpf_cflags())
EXPECTED_INOUTBOUND_VERSION_MSG = 1
checked_inbound_version_msg = 0

View File

@@ -1,5 +1,5 @@
#!/usr/bin/env python3
# Copyright (c) 2022 The Bitcoin Core developers
# Copyright (c) 2022-present The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
@@ -15,7 +15,10 @@ except ImportError:
pass
from test_framework.messages import COIN
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import assert_equal
from test_framework.util import (
assert_equal,
bpf_cflags,
)
from test_framework.wallet import MiniWallet
utxocache_changes_program = """
@@ -175,7 +178,7 @@ class UTXOCacheTracepointTest(BitcoinTestFramework):
ctx = USDT(pid=self.nodes[0].process.pid)
ctx.enable_probe(probe="utxocache:uncache",
fn_name="trace_utxocache_uncache")
bpf = BPF(text=utxocache_changes_program, usdt_contexts=[ctx], debug=0, cflags=["-Wno-error=implicit-function-declaration"])
bpf = BPF(text=utxocache_changes_program, usdt_contexts=[ctx], debug=0, cflags=bpf_cflags())
# The handle_* function is a ctypes callback function called from C. When
# we assert in the handle_* function, the AssertError doesn't propagate
@@ -244,7 +247,7 @@ class UTXOCacheTracepointTest(BitcoinTestFramework):
ctx.enable_probe(probe="utxocache:add", fn_name="trace_utxocache_add")
ctx.enable_probe(probe="utxocache:spent",
fn_name="trace_utxocache_spent")
bpf = BPF(text=utxocache_changes_program, usdt_contexts=[ctx], debug=0, cflags=["-Wno-error=implicit-function-declaration"])
bpf = BPF(text=utxocache_changes_program, usdt_contexts=[ctx], debug=0, cflags=bpf_cflags())
# The handle_* function is a ctypes callback function called from C. When
# we assert in the handle_* function, the AssertError doesn't propagate
@@ -333,7 +336,7 @@ class UTXOCacheTracepointTest(BitcoinTestFramework):
ctx = USDT(pid=self.nodes[0].process.pid)
ctx.enable_probe(probe="utxocache:flush",
fn_name="trace_utxocache_flush")
bpf = BPF(text=utxocache_flushes_program, usdt_contexts=[ctx], debug=0, cflags=["-Wno-error=implicit-function-declaration"])
bpf = BPF(text=utxocache_flushes_program, usdt_contexts=[ctx], debug=0, cflags=bpf_cflags())
# The handle_* function is a ctypes callback function called from C. When
# we assert in the handle_* function, the AssertError doesn't propagate
@@ -390,7 +393,7 @@ class UTXOCacheTracepointTest(BitcoinTestFramework):
ctx = USDT(pid=self.nodes[0].process.pid)
ctx.enable_probe(probe="utxocache:flush",
fn_name="trace_utxocache_flush")
bpf = BPF(text=utxocache_flushes_program, usdt_contexts=[ctx], debug=0, cflags=["-Wno-error=implicit-function-declaration"])
bpf = BPF(text=utxocache_flushes_program, usdt_contexts=[ctx], debug=0, cflags=bpf_cflags())
bpf["utxocache_flush"].open_perf_buffer(handle_utxocache_flush)
self.log.info(f"prune blockchain to trigger a flush for pruning")

View File

@@ -1,5 +1,5 @@
#!/usr/bin/env python3
# Copyright (c) 2022 The Bitcoin Core developers
# Copyright (c) 2022-present The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
@@ -17,8 +17,10 @@ except ImportError:
from test_framework.address import ADDRESS_BCRT1_UNSPENDABLE
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import assert_equal
from test_framework.util import (
assert_equal,
bpf_cflags,
)
validation_blockconnected_program = """
#include <uapi/linux/ptrace.h>
@@ -94,7 +96,7 @@ class ValidationTracepointTest(BitcoinTestFramework):
ctx.enable_probe(probe="validation:block_connected",
fn_name="trace_block_connected")
bpf = BPF(text=validation_blockconnected_program,
usdt_contexts=[ctx], debug=0, cflags=["-Wno-error=implicit-function-declaration"])
usdt_contexts=[ctx], debug=0, cflags=bpf_cflags())
def handle_blockconnected(_, data, __):
event = ctypes.cast(data, ctypes.POINTER(Block)).contents

View File

@@ -0,0 +1,26 @@
#!/usr/bin/env python3
# Copyright (c) 2024 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""
Test P2P behaviour during the handshake phase.
"""
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import p2p_port
class P2PHandshakeTest(BitcoinTestFramework):
def set_test_params(self):
self.num_nodes = 1
def run_test(self):
node = self.nodes[0]
self.log.info("Check that connecting to ourself leads to immediate disconnect")
with node.assert_debug_log(["connected to self", "disconnecting"]):
node_listen_addr = f"127.0.0.1:{p2p_port(0)}"
node.addconnection(node_listen_addr, "outbound-full-relay", self.options.v2transport)
self.wait_until(lambda: len(node.getpeerinfo()) == 0)
if __name__ == '__main__':
P2PHandshakeTest().main()

View File

@@ -69,6 +69,28 @@ class PSBTTest(BitcoinTestFramework):
def skip_test_if_missing_module(self):
self.skip_if_no_wallet()
def test_psbt_incomplete_after_invalid_modification(self):
self.log.info("Check that PSBT is correctly marked as incomplete after invalid modification")
node = self.nodes[2]
wallet = node.get_wallet_rpc(self.default_wallet_name)
address = wallet.getnewaddress()
wallet.sendtoaddress(address=address, amount=1.0)
self.generate(node, nblocks=1, sync_fun=lambda: self.sync_all(self.nodes[:2]))
utxos = wallet.listunspent(addresses=[address])
psbt = wallet.createpsbt([{"txid": utxos[0]["txid"], "vout": utxos[0]["vout"]}], [{wallet.getnewaddress(): 0.9999}])
signed_psbt = wallet.walletprocesspsbt(psbt)["psbt"]
# Modify the raw transaction by changing the output address, so the signature is no longer valid
signed_psbt_obj = PSBT.from_base64(signed_psbt)
substitute_addr = wallet.getnewaddress()
raw = wallet.createrawtransaction([{"txid": utxos[0]["txid"], "vout": utxos[0]["vout"]}], [{substitute_addr: 0.9999}])
signed_psbt_obj.g.map[PSBT_GLOBAL_UNSIGNED_TX] = bytes.fromhex(raw)
# Check that the walletprocesspsbt call succeeds but also recognizes that the transaction is not complete
signed_psbt_incomplete = wallet.walletprocesspsbt(signed_psbt_obj.to_base64(), finalize=False)
assert signed_psbt_incomplete["complete"] is False
def test_utxo_conversion(self):
self.log.info("Check that non-witness UTXOs are removed for segwit v1+ inputs")
mining_node = self.nodes[2]
@@ -590,6 +612,7 @@ class PSBTTest(BitcoinTestFramework):
if self.options.descriptors:
self.test_utxo_conversion()
self.test_psbt_incomplete_after_invalid_modification()
self.test_input_confs_control()
@@ -701,11 +724,9 @@ class PSBTTest(BitcoinTestFramework):
assert_equal(analysis['next'], 'creator')
assert_equal(analysis['error'], 'PSBT is not valid. Output amount invalid')
analysis = self.nodes[0].analyzepsbt('cHNidP8BAJoCAAAAAkvEW8NnDtdNtDpsmze+Ht2LH35IJcKv00jKAlUs21RrAwAAAAD/////S8Rbw2cO1020OmybN74e3Ysffkglwq/TSMoCVSzbVGsBAAAAAP7///8CwLYClQAAAAAWABSNJKzjaUb3uOxixsvh1GGE3fW7zQD5ApUAAAAAFgAUKNw0x8HRctAgmvoevm4u1SbN7XIAAAAAAAEAnQIAAAACczMa321tVHuN4GKWKRncycI22aX3uXgwSFUKM2orjRsBAAAAAP7///9zMxrfbW1Ue43gYpYpGdzJwjbZpfe5eDBIVQozaiuNGwAAAAAA/v///wIA+QKVAAAAABl2qRT9zXUVA8Ls5iVqynLHe5/vSe1XyYisQM0ClQAAAAAWABRmWQUcjSjghQ8/uH4Bn/zkakwLtAAAAAAAAQEfQM0ClQAAAAAWABRmWQUcjSjghQ8/uH4Bn/zkakwLtAAAAA==')
assert_equal(analysis['next'], 'creator')
assert_equal(analysis['error'], 'PSBT is not valid. Input 0 specifies invalid prevout')
assert_raises_rpc_error(-22, "TX decode failed", self.nodes[0].analyzepsbt, "cHNidP8BAJoCAAAAAkvEW8NnDtdNtDpsmze+Ht2LH35IJcKv00jKAlUs21RrAwAAAAD/////S8Rbw2cO1020OmybN74e3Ysffkglwq/TSMoCVSzbVGsBAAAAAP7///8CwLYClQAAAAAWABSNJKzjaUb3uOxixsvh1GGE3fW7zQD5ApUAAAAAFgAUKNw0x8HRctAgmvoevm4u1SbN7XIAAAAAAAEAnQIAAAACczMa321tVHuN4GKWKRncycI22aX3uXgwSFUKM2orjRsBAAAAAP7///9zMxrfbW1Ue43gYpYpGdzJwjbZpfe5eDBIVQozaiuNGwAAAAAA/v///wIA+QKVAAAAABl2qRT9zXUVA8Ls5iVqynLHe5/vSe1XyYisQM0ClQAAAAAWABRmWQUcjSjghQ8/uH4Bn/zkakwLtAAAAAAAAQEfQM0ClQAAAAAWABRmWQUcjSjghQ8/uH4Bn/zkakwLtAAAAA==")
assert_raises_rpc_error(-25, 'Inputs missing or spent', self.nodes[0].walletprocesspsbt, 'cHNidP8BAJoCAAAAAkvEW8NnDtdNtDpsmze+Ht2LH35IJcKv00jKAlUs21RrAwAAAAD/////S8Rbw2cO1020OmybN74e3Ysffkglwq/TSMoCVSzbVGsBAAAAAP7///8CwLYClQAAAAAWABSNJKzjaUb3uOxixsvh1GGE3fW7zQD5ApUAAAAAFgAUKNw0x8HRctAgmvoevm4u1SbN7XIAAAAAAAEAnQIAAAACczMa321tVHuN4GKWKRncycI22aX3uXgwSFUKM2orjRsBAAAAAP7///9zMxrfbW1Ue43gYpYpGdzJwjbZpfe5eDBIVQozaiuNGwAAAAAA/v///wIA+QKVAAAAABl2qRT9zXUVA8Ls5iVqynLHe5/vSe1XyYisQM0ClQAAAAAWABRmWQUcjSjghQ8/uH4Bn/zkakwLtAAAAAAAAQEfQM0ClQAAAAAWABRmWQUcjSjghQ8/uH4Bn/zkakwLtAAAAA==')
assert_raises_rpc_error(-22, "TX decode failed", self.nodes[0].walletprocesspsbt, "cHNidP8BAJoCAAAAAkvEW8NnDtdNtDpsmze+Ht2LH35IJcKv00jKAlUs21RrAwAAAAD/////S8Rbw2cO1020OmybN74e3Ysffkglwq/TSMoCVSzbVGsBAAAAAP7///8CwLYClQAAAAAWABSNJKzjaUb3uOxixsvh1GGE3fW7zQD5ApUAAAAAFgAUKNw0x8HRctAgmvoevm4u1SbN7XIAAAAAAAEAnQIAAAACczMa321tVHuN4GKWKRncycI22aX3uXgwSFUKM2orjRsBAAAAAP7///9zMxrfbW1Ue43gYpYpGdzJwjbZpfe5eDBIVQozaiuNGwAAAAAA/v///wIA+QKVAAAAABl2qRT9zXUVA8Ls5iVqynLHe5/vSe1XyYisQM0ClQAAAAAWABRmWQUcjSjghQ8/uH4Bn/zkakwLtAAAAAAAAQEfQM0ClQAAAAAWABRmWQUcjSjghQ8/uH4Bn/zkakwLtAAAAA==")
self.log.info("Test that we can fund psbts with external inputs specified")

View File

@@ -1293,8 +1293,11 @@ class msg_tx:
__slots__ = ("tx",)
msgtype = b"tx"
def __init__(self, tx=CTransaction()):
self.tx = tx
def __init__(self, tx=None):
if tx is None:
self.tx = CTransaction()
else:
self.tx = tx
def deserialize(self, f):
self.tx.deserialize(f)

View File

@@ -887,6 +887,8 @@ class TestNodeCLI():
# Ignore cli_stdout, raise with cli_stderr
raise subprocess.CalledProcessError(returncode, self.binary, output=cli_stderr)
try:
if not cli_stdout.strip():
return None
return json.loads(cli_stdout, parse_float=decimal.Decimal)
except (json.JSONDecodeError, decimal.InvalidOperation):
return cli_stdout.rstrip("\n")

View File

@@ -277,6 +277,13 @@ def wait_until_helper_internal(predicate, *, attempts=float('inf'), timeout=floa
raise RuntimeError('Unreachable')
def bpf_cflags():
return [
"-Wno-error=implicit-function-declaration",
"-Wno-duplicate-decl-specifier", # https://github.com/bitcoin/bitcoin/issues/32322
]
def sha256sum_file(filename):
h = hashlib.sha256()
with open(filename, 'rb') as f:

View File

@@ -395,6 +395,8 @@ BASE_SCRIPTS = [
'rpc_getdescriptorinfo.py',
'rpc_mempool_info.py',
'rpc_help.py',
'p2p_handshake.py',
'p2p_handshake.py --v2transport',
'feature_dirsymlinks.py',
'feature_help.py',
'feature_shutdown.py',