Commit Graph

45067 Commits

Author SHA1 Message Date
Pieter Wuille
394dbe2142 txgraph: Introduce BlockBuilder interface (feature)
This interface lets one iterate efficiently over the chunks of the main
graph in a TxGraph, in the same order as CompareMainOrder. Each chunk
can be marked as "included" or "skipped" (and in the latter case,
dependent chunks will be skipped).
2025-05-12 17:07:30 -04:00
Pieter Wuille
883df3648e txgraph: Generalize GetClusterRefs to support subsections (preparation)
This is preparation for a next commit which will need a way to extract Refs
for just individual chunks from a cluster.
2025-05-12 17:07:30 -04:00
Pieter Wuille
c28a602e00 txgraph: Introduce TxGraphImpl observer tracking (preparation)
This is preparation for a next commit which will introduce a class whose
objects hold references to internals in TxGraphImpl, which disallows
modifications to the graph while such objects exist.
2025-05-12 17:07:30 -04:00
Pieter Wuille
9095d8ac1c txgraph: Maintain chunk index (preparation)
This is preparation for exposing mining and eviction functionality in
TxGraph.
2025-05-12 17:07:28 -04:00
Pieter Wuille
87e74e1242 txgraph: abstract out transaction ordering (refactor) 2025-05-12 17:00:33 -04:00
Pieter Wuille
2614fea17f txgraph: Add GetMainStagingDiagrams function (feature)
This allows determining whether the changes in a staging diagram unambiguously improve
the graph, through CompareChunks().
2025-05-12 16:00:24 -04:00
Ryan Ofsky
a5ac43d98d doc: Add release notes describing bitcoin wrapper executable 2025-05-12 14:49:17 -04:00
merge-script
663a9cabf8 Merge bitcoin/bitcoin#32458: guix: move *-check.py scripts under contrib/guix/
415650cea9 guix: move *-check.py scripts under contrib/guix (fanquake)

Pull request description:

  These scripts are not meant for general developer usage. They are for use on the release binaries, which have been compiled in an environment that makes various assumptions in regards to c library, compiler options, hardening options, dependency patching etc.

  Anyone is free to run these scripts against self-compiled binaries, but this isn't something we want to modify/generalize the scripts to support.

ACKs for top commit:
  laanwj:
    Code review ACK 415650cea9
  TheCharlatan:
    ACK 415650cea9

Tree-SHA512: 469cc5da9df014b4a9dc39080f31c3283641691209497cdb7cc5dc4767681a7f4b67425768e81838153ce39a26547ed94cd3be4dc27352d33960765bfac9d0e5
2025-05-12 19:49:17 +01:00
Ryan Ofsky
258bda80c0 doc: Mention bitcoin wrapper executable in documentation 2025-05-12 14:49:17 -04:00
Sjors Provoost
d2739d75c9 build: add bitcoin.exe to windows installer 2025-05-12 19:49:17 +01:00
Ryan Ofsky
ba649c0006 ci: Run multiprocess tests through wrapper executable 2025-05-12 13:49:17 -05:00
Ryan Ofsky
29bdd743bb test: Support BITCOIN_CMD environment variable
Support new BITCOIN_CMD environment variable in functional test to be able to
test the new bitcoin wrapper executable and run other commands through it
instead of calling them directly.

Co-authored-by: Sjors Provoost <sjors@sprovoost.nl>
2025-05-12 13:49:17 -05:00
Ryan Ofsky
9c8c68891b multiprocess: Add bitcoin wrapper executable
Intended to make bitcoin command line features more discoverable and allow
installing new multiprocess binaries in libexec/ instead of bin/ so they don't
cause confusion.

Idea and implementation of this were discussed in
https://github.com/bitcoin/bitcoin/issues/30983

Co-authored-by: Sjors Provoost <sjors@sprovoost.nl>
2025-05-12 14:49:17 -04:00
Ryan Ofsky
5076d20fdb util: Add cross-platform ExecVp and GetExePath functions
These functions are just meant to serve the needs of the bitcoin wrapper
executable, and are intentionally not very general purpose so they can be
simple.
2025-05-12 13:49:17 -05:00
merge-script
05765b8818 Merge bitcoin/bitcoin#32472: doc: Fix typo
d847e17c96 doc: Fix typo (Hennadii Stepanov)

Pull request description:

  A translator on Transifex noticed:
  > This is the only label which has two dots: ..
  > Usually we see the elipsis (…)

  This PR addresses this issue.

ACKs for top commit:
  janb84:
    good find, ACK d847e17c96

Tree-SHA512: cbdc5f283fe30655a923c34813c97406bba85657554984c26acbfed585ce3a652bcb21348d7e0f6fd9c82ca04111c412ff62c7d4b046869d13785b713e69ab6d
2025-05-12 19:48:46 +01:00
Hennadii Stepanov
d847e17c96 doc: Fix typo
An ellipsis (…) is typically used in such cases.
2025-05-12 17:11:27 +01:00
merge-script
3edf400b10 Merge bitcoin/bitcoin#32469: cmake: Allow WITH_DBUS on all Unix-like systems
5b7ed460c7 cmake: Allow `WITH_DBUS` on all Unix-like systems (Hennadii Stepanov)

Pull request description:

  This PR makes the `WITH_DBUS` option available on all Unix-like systems, not just Linux, thereby fixing a regression that was overlooked during the migration from Autotools.

  Note: Enabling D-Bus support on macOS still makes no sense, since the `Notificator` class uses the User Notification Center regardless:746ab19d5a/src/qt/notificator.cpp (L43-L56)

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

ACKs for top commit:
  laanwj:
    ACK 5b7ed460c7
  theStack:
    tACK 5b7ed460c7

Tree-SHA512: 01f5a365a8109c273489e2d46b08d8b64b82251c4814a486561221b55d8a47cb1effc9140dbd6b2ab5f12e2966d0ea0d07a4cbf67d310001ee681b0f5b63f300
2025-05-12 14:22:55 +01:00
Hennadii Stepanov
59e09e0fb7 Merge bitcoin-core/gui#871: qt, docs: Unify term "clipboard"
3bbdbc0a5e qt, docs: Unify term "clipboard" (Hennadii Stepanov)

Pull request description:

  A translator on Transifex noticed:
  > The term "system clipboard" appears twice. The term "clipboard" appears 10 times. Perhaps we could standardize on just saying "clipboard"?

  This PR addresses this issue.

ACKs for top commit:
  davidgumberg:
    ACK 3bbdbc0a5e
  pablomartin4btc:
    ACK 3bbdbc0a5e

Tree-SHA512: 61a100f60890d81122a4b8ce3e2cb7d355c7fb643de3196573f7f9107c6f52fa0b3e7a4f743ce2833e8c67b9cdad3568b761d730fef5c9781f5e1c45252888c4
2025-05-11 17:38:04 +01:00
Hennadii Stepanov
46f79dde67 Merge bitcoin-core/gui#841: Decouple WalletModel from RPCExecutor
002b792b9a gui: decouple WalletModel from RPCExecutor (furszy)

Pull request description:

  A more comprehensive fix for the issue described in #837.

  Since the `WalletModel` class is unavailable when compiling without wallet support
  `(-DENABLE_WALLET=0)`, the RPC executor class should not be coupled to it.
  This decoupling ensures GUI compatibility with builds that omit wallet support.

  This also drops an extra `#ifdef ENABLE_WALLET` block which is always good.

ACKs for top commit:
  w0xlt:
    Code Review ACK 002b792b9a
  pablomartin4btc:
    tACK 002b792b9a
  BrandonOdiwuor:
    tACK 002b792b9a
  hebasto:
    ACK 002b792b9a, I have reviewed the code and it looks OK.

Tree-SHA512: a8e6b7e9d88dd8e0ff5e2d0de91be2f85fd0559265267d3bf6cae5a37606cf1ab6bc7415d5817a11006008de362f2ca3557ba772b4e1bd9fbef5f564be3b53bb
2025-05-11 17:34:11 +01:00
Hennadii Stepanov
5b7ed460c7 cmake: Allow WITH_DBUS on all Unix-like systems
This change makes the `WITH_DBUS` option available on all Unix-like
systems, not just Linux, thereby fixing a regression that was
overlooked during the migration from Autotools.

Note: Enabling D-Bus support on macOS still makes no sense, since the
`Notificator` class uses the User Notification Center regardless.
2025-05-11 17:06:01 +01:00
merge-script
746ab19d5a Merge bitcoin/bitcoin#32446: build: simplify *ifaddr handling
ab878a7e74 build: simplify *ifaddr handling (fanquake)

Pull request description:

  We really just want to skip this when building for Windows. So do that,
  and remove the two header checks (we also already use both of these
  headers, unguarded, in the !windows part of the codebase).

  Squash the two *iffaddrs defines into one, as I haven't seen an
  `iffaddrs.h` that implements one, but not the other.

ACKs for top commit:
  hebasto:
    ACK ab878a7e74. Only addressed my [comment](https://github.com/bitcoin/bitcoin/pull/32446#discussion_r2079994126) and rebased since my recent [review](https://github.com/bitcoin/bitcoin/pull/32446#pullrequestreview-2825606189).
  TheCharlatan:
    ACK ab878a7e74

Tree-SHA512: 7667305df9fef4728526c7217f85b51e739ec63b38e808da51d6ae65cb6f2696afa5ba82e5a72ed4a7a9b79ffa2402640448af4392587253027122eab7618e30
2025-05-10 15:50:01 +01:00
Cory Fields
6f7052a7b9 threading: semaphore: move CountingSemaphoreGrant to its own header 2025-05-10 03:31:30 +00:00
Cory Fields
fd15469892 threading: semaphore: remove temporary convenience types 2025-05-10 00:53:16 +00:00
Cory Fields
1f89e2a49a scripted-diff: threading: semaphore: use direct types rather than the temporary convenience ones
-BEGIN VERIFY SCRIPT-
sed -i 's|BinarySemaphore|std::binary_semaphore|g' src/wallet/sqlite.h
sed -i 's|SemaphoreGrant|CountingGrant|g' src/net.h src/net.cpp
sed -i 's|Semaphore|std::counting_semaphore<>|g' src/net.h src/net.cpp
sed -i 's|CountingGrant|CountingSemaphoreGrant<>|g' src/net.h src/net.cpp

-END VERIFY SCRIPT-
2025-05-10 00:53:16 +00:00
Cory Fields
f21365c4fc threading: replace CountingSemaphore with std::counting_semaphore 2025-05-10 00:53:16 +00:00
Cory Fields
1acacfbad7 threading: make CountingSemaphore/CountingSemaphoreGrant template types 2025-05-10 00:53:16 +00:00
Cory Fields
e6ce5f9e78 scripted-diff: rename CSemaphore and CSemaphoreGrant
CountingSemaphore and CountingSemaphoreGrant model std::counting_semaphore.

-BEGIN VERIFY SCRIPT-
sed -i -e 's|CSemaphoreGrant|CountingSemaphoreGrant|g' -e 's|CSemaphore|CountingSemaphore|g' src/sync.h
-END VERIFY SCRIPT-
2025-05-10 00:53:16 +00:00
Cory Fields
793166d381 wallet: change the write semaphore to a BinarySemaphore
Follow-up commits will make a distinction between Semaphore and
BinarySemaphore.
2025-05-10 00:53:16 +00:00
Cory Fields
6790ad27f1 scripted-diff: rename CSemaphoreGrant and CSemaphore for net
-BEGIN VERIFY SCRIPT-
sed -i -e 's|CSemaphoreGrant|SemaphoreGrant|g' -e 's|CSemaphore|Semaphore|g' src/net.h src/net.cpp
-END VERIFY SCRIPT-
2025-05-10 00:53:16 +00:00
Cory Fields
d870bc9451 threading: add temporary semaphore aliases 2025-05-10 00:53:00 +00:00
Ava Chow
19b1e177d6 Merge bitcoin/bitcoin#32155: miner: timelock the coinbase to the mined block's height
a58cb3b1c1 qa: sanity check mined block have their coinbase timelocked to height (Antoine Poinsot)
8f2078af6a miner: timelock coinbase transactions (Antoine Poinsot)
788aeebf34 qa: use prev height as nLockTime for coinbase txs created in unit tests (Antoine Poinsot)
c76dbe9b8b qa: timelock coinbase transactions created in fuzz targets (Antoine Poinsot)
9c94069d8b contrib: timelock coinbase transactions in signet miner (Antoine Poinsot)
a5f52cfcc4 qa: timelock coinbase transactions created in functional tests (Antoine Poinsot)

Pull request description:

  The Consensus Cleanup soft fork proposal includes enforcing that coinbase transactions set their
  nLockTime field to the block height minus 1, as well as their nSequence such as to not disable the
  timelock. If such a fork were to be activated by Bitcoin users, miners need to be ready to produce
  compliant blocks at the risk of losing substantial amounts mining would-be invalid blocks. As miners
  are unfamously slow to upgrade, it's good to make this change as early as possible.

  Although Bitcoin Core's GBT implementation does not provide the `coinbasetxn` field, and mining
  pool software crafts the coinbase on its own, updating the Bitcoin Core mining code is a first step
  toward convincing pools to update their (often closed source) code. A possible followup is also to
  introduce new fields to GBT. In addition, this first step also makes it possible to test future
  Consensus Cleanup changes.

  The commit making the change also updates a bunch of seemingly-unrelated tests. This is because those tests were asserting error messages based on the txid of transactions involved, and changing the coinbase transaction structure necessarily changes the txid of all tests' transactions.

ACKs for top commit:
  Sjors:
    Code review ACK a58cb3b1c1
  achow101:
    ACK a58cb3b1c1
  TheCharlatan:
    Re-ACK a58cb3b1c1

Tree-SHA512: a2aae009a187eb760d34435f518a895ee76c6b02a667eb030ddf6bd584da6e8eae2737d974dbf81a928d60c07bcb4820f055adc067e18d8819640db0240bb513
2025-05-09 15:09:27 -07:00
Ava Chow
6c6ef58b0b Merge bitcoin/bitcoin#32436: test: refactor: negate signature-s using libsecp256k1
1ee698fde2 test: refactor: negate signature-s using libsecp256k1 (Sebastian Falbesoner)

Pull request description:

  This small PR gets rid of manual mod-n inversion of the ECDSA signature-s part in unit tests (introduced a long time ago in #5256, triggered by https://github.com/bitcoin-core/secp256k1/pull/69) by using secp256k1 instead. The function wasn't available at that time, but was introduced about three years later, see https://github.com/bitcoin-core/secp256k1/pull/408. Note that as the name suggests, `secp256k1_ec_seckey_negate` is meant to be used for secret keys, but it obviously works in general for scalars modulo the group order.

ACKs for top commit:
  achow101:
    ACK 1ee698fde2
  laanwj:
    Code review ACK 1ee698fde2
  w0xlt:
    ACK 1ee698fde2
  rkrux:
    tACK 1ee698fde2

Tree-SHA512: dc36ea1572b538d11ae34e1871f310a1cda8083ffb753e93e7ee9d56e91ebd8ec78d35758dfb700254720914b734ef7a071eeef71b6239f19e1e2fb289fb5435
2025-05-09 13:26:27 -07:00
Ava Chow
b104d44227 test: Remove RPCOverloadWrapper
With the legacy wallet now removed, these overloads are no longer
needed.
2025-05-09 12:31:53 -07:00
Ava Chow
4d32c19516 test: Replace importpubkey 2025-05-09 12:31:53 -07:00
Ava Chow
fe838dd391 test: Replace usage of addmultisigaddress 2025-05-09 12:31:53 -07:00
Ava Chow
d314207779 test: Replace usage of importaddress 2025-05-09 11:42:46 -07:00
Ava Chow
fcc457573f test: Replace importprivkey with wallet_importprivkey
importprivkey was a legacy wallet only RPC which had a helper for
descriptor wallets in tests. Add wallet_importprivkey helper and use it
wherever importprivkey is used (other than backward compatibility tests)
2025-05-09 11:42:33 -07:00
Ava Chow
94c87bbbd0 test: Remove unnecessary importprivkey from wallet_createwallet
This test was testing importprivkey behavior in a legacy wallet without
private keys. As legacy wallets no longer exist, this test case is no
longer relevant.
2025-05-09 11:40:54 -07:00
merge-script
9a05b45da6 Merge bitcoin/bitcoin#32438: refactor: Removals after bdb removal
fa061bfcdb Remove create options from wallet tool (MarcoFalke)
fa2125e7b8 Remove unused IsSingleKey (MarcoFalke)
fab5e2a094 doc: Remove note about bdb wallets (MarcoFalke)
eeeef88d46 doc: fix typo in abortrescan rpc (MarcoFalke)
fa7e5c15a7 Remove unused LegacyDataSPKM::DeleteRecords() (MarcoFalke)
ffff949472 remove NotifyWatchonlyChanged (MarcoFalke)
fa62a013a5 remove dead flush() (MarcoFalke)
fa5f3e62c8 vcpkg: Remove bdb (MarcoFalke)

Pull request description:

  This deletes some dead code

ACKs for top commit:
  Sjors:
    ACK fa061bfcdb if CI is also happy
  rkrux:
    utACK fa061bf

Tree-SHA512: 6c0b0705caa4ad024e6b921bd7f65aaa055d1f12f7884cd61823cbf0c32e46697ddbdaa209ab449d6a1df9761ce5d53763e25f26e4c36ce4c685b7524f5a3dd9
2025-05-09 16:47:55 +01:00
Vasil Dimov
e49a7274a2 rpc: Avoid join-split roundtrip for user:pass for auth credentials 2025-05-09 17:07:28 +02:00
laanwj
98ff38a6f1 rpc: Perform HTTP user:pass split once in RPCAuthorized 2025-05-09 16:58:08 +02:00
laanwj
879a17bcb1 rpc: Store all credentials hashed in memory
This gets rid of the special-casing of `strRPCUserColonPass` by hashing
cookies as well as manually provided `-rpcuser`/`-rpcpassword` with a
random salt before storing them.

Also take the opportunity to modernize the surrounding code a bit. There
should be no end-user visible differences in behavior.
2025-05-09 16:58:06 +02:00
laanwj
4ab9bedee9 rpc: Undeprecate rpcuser/rpcpassword, change message to security warning
Back in 2015, in #7044, we added configuration option `rpcauth` for
multiple RPC users. At the same time the old settings for single-user
configuration `rpcuser` and `rpcpassword` were "soon" to be deprecated.

The main reason for this deprecation is that while `-rpcpassword` stores
the password in plain text, `-rpcauth` stores a hash, so it doesn't
appear in the configuration in plain text.

As the options are still in active use, actually removing them is
expected to be a hassle to many, and it's not clear that is worth it. As
for the security risk, in many kinds of setups (no wallet,
containerized, single-user-single-application, local-only, etc) it is an
unlikely point of escalation.

In the end, it is good to encourage secure practices, but it is the
responsibility of the user. Log a clear warning but remove the
deprecation notice.

Closes #29240.
2025-05-09 16:57:27 +02:00
MarcoFalke
fa061bfcdb Remove create options from wallet tool
Just create descriptor wallets.
2025-05-09 15:07:04 +02:00
MarcoFalke
fa2125e7b8 Remove unused IsSingleKey 2025-05-09 15:06:51 +02:00
MarcoFalke
fab5e2a094 doc: Remove note about bdb wallets 2025-05-09 15:06:50 +02:00
MarcoFalke
eeeef88d46 doc: fix typo in abortrescan rpc 2025-05-09 15:06:37 +02:00
MarcoFalke
fa7e5c15a7 Remove unused LegacyDataSPKM::DeleteRecords() 2025-05-09 15:06:20 +02:00
merge-script
b070ce1696 Merge bitcoin/bitcoin#31360: depends: Avoid using helper variables in toolchain file
7343a1846c depends: Avoid using helper variables in toolchain file (Hennadii Stepanov)

Pull request description:

  Using helper variables has two issues:
  1. They contaminate the global namespace of the main build script.
  2. They can be used as `set(var)`, effectively [exposing](https://cmake.org/cmake/help/latest/command/set.html) a cache variable `var`, which makes the toolchain file susceptible to the build environment.

  The [`depends/Makefile`](https://github.com/bitcoin/bitcoin/blob/master/depends/Makefile) can generate values with "not-set" semantics as empty strings or strings containing only spaces. For example:2638fdb4f9/depends/Makefile (L157)
  Therefore, [`MATCHES`](https://cmake.org/cmake/help/latest/command/if.html#matches) must be used rather than [`STREQUAL`](https://cmake.org/cmake/help/latest/command/if.html#strequal).

ACKs for top commit:
  purpleKarrot:
    ACK 7343a1846c

Tree-SHA512: f2235321ac13daee8e82fa1ae9d02b95097a696265ad3a31fbda9cbc3c387c1dc7d01951154f99828468e50b73ed2889a6fa2720007f519dd11fe25ee5303d23
2025-05-09 14:04:39 +01:00
MarcoFalke
ffff949472 remove NotifyWatchonlyChanged
The signal is never called.
2025-05-09 15:03:08 +02:00