48146 Commits

Author SHA1 Message Date
Pieter Wuille
20e2f3e96d scripted-diff: rename _rep -> _idx in SFL
This is a preparation for the next commit, where chunks will no longer
be identified using a representative transaction, but using a set index.
Reduce the load of line changes by doing this rename ahead of time.

-BEGIN VERIFY SCRIPT-
sed --in-place 's/_rep/_idx/g' src/cluster_linearize.h
-END VERIFY SCRIPT-
2026-02-17 09:04:36 -05:00
Pieter Wuille
268fcb6a53 clusterlin: add more Assumes and sanity checks (tests) 2026-02-17 09:04:36 -05:00
Pieter Wuille
d69c9f56ea clusterlin: count chunk deps without loop (optimization)
This small optimization avoids the need to loop over the parents of each
transaction when initializing the dependency-counting structures inside
GetLinearization().
2026-02-17 09:04:36 -05:00
Pieter Wuille
f66fa69ce0 clusterlin: split tx/chunk dep counting (preparation)
This splits the chunk_deps variable in LoadLinearization in two, one for
tracking tx dependencies and one for chunk dependencies. This is a
preparation for a later commit, where chunks won't be identified anymore
by a representative transaction in them, but by a separate index. With
that, it seems weird to keep them both in the same structure if they
will be indexed in an unrelated way.

Note that the changes in src/test/util/cluster_linearize.h to the table
of worst observed iteration counts are due to switching to a different
data set, and are unrelated to the changes in this commit.
2026-02-17 09:04:36 -05:00
Pieter Wuille
900e459778 clusterlin: avoid depgraph argument in SanityCheck (cleanup)
Since the deterministic ordering change, SpanningForestState holds a
reference to the DepGraph it is linearizing. So this means we do not
need to pass it to SanityCheck() as an argument anymore.
2026-02-17 09:04:36 -05:00
Pieter Wuille
666b37970f clusterlin: fix type to count dependencies 2026-02-17 09:04:36 -05:00
merge-script
a7c29df0e5
Merge bitcoin/bitcoin#34552: fees: refactor: separate feerate format from fee estimate mode
c1355493e2c26b613109bfac3dcd898b3acca75a refactor: fees: split fee rate format from fee estimate mode (ismaelsadeeq)
922ebf96ed6674ae7acc6f0cde4d7b064f759834 refactor: move-only: move `FeeEstimateMode` enum to `util/fees.h` (ismaelsadeeq)

Pull request description:

  ### Motivation

  Part of #34075

  - The `FeeEstimateMode` enum was responsible for both selecting the fee estimation algorithm and specifying the fee rate' format.

  ####  Changes in this PR:
     * The `FeeEstimateMode` enum (`UNSET`, `ECONOMICAL`, `CONSERVATIVE`) is moved to a new util/fees.h header.
     * A new `FeeRateFormat `enum (`BTC_KVB`, `SAT_VB`) is introduced in `policy/feerate.h` for feerate formatting.
     * The `CFeeRate::ToString()` method is updated to use `FeeRateFormat`.
     * All relevant function calls have been updated to use the new `FeeRateFormat` enum for formatting and `FeeEstimateMode` for fee estimation mode.

   This refactoring separates these unrelated responsibilities to improve code clarity.

ACKs for top commit:
  l0rinc:
    ACK c1355493e2c26b613109bfac3dcd898b3acca75a
  furszy:
    utACK c1355493e2c26b613109bfac3dcd898b3acca75a
  musaHaruna:
    ACK [c135549](c1355493e2) — reviewed in the context of PR [34075](https://github.com/bitcoin/bitcoin/pull/34075)
  willcl-ark:
    ACK c1355493e2c26b613109bfac3dcd898b3acca75a

Tree-SHA512: 7cbe36350744313d3d688d3fd282a58c441af1818b1e8ad9cddbc911c499a5205f8d4a39c36b21fed60542db1ef763eb69752d141bcef3393bf33c0922018645
2026-02-17 14:15:38 +01:00
will
231dd04b8d
build: define CMAKE_COMPILE_WARNING_AS_ERROR as a cache option
CMAKE_COMPILE_WARNING_AS_ERROR is not a cache variable by default in
CMake, so it has no value in the configure summary when not set, and
even when set cannot be toggled in ccmake. Define it as an option() to
make it a cache BOOL with a default of OFF.
2026-02-17 12:31:53 +00:00
MarcoFalke
fa48d42163
test: Stricter unit test
Now that the previous commit fixed a unit test bug, make the test
stricter, to prevent this issue from happening again in the future.
2026-02-17 12:55:28 +01:00
MarcoFalke
fa626bd143
util: Remove brittle and confusing sp::Popen(std::string) 2026-02-17 12:55:26 +01:00
Fabian Jahr
fd06157d14
test: Add coverage for restarted node without any block sync 2026-02-17 12:44:23 +01:00
Fabian Jahr
3d7ab7ecb7
rpc, test: Address feedback from #29668 2026-02-17 12:44:23 +01:00
Fabian Jahr
312919c9dd
test: Indices can not start based on block data without undo data 2026-02-17 12:44:23 +01:00
Fabian Jahr
a9a3b29dd6
index: Check availability of undo data for indices 2026-02-17 12:44:21 +01:00
merge-script
c8c9c1e617
Merge bitcoin/bitcoin#34383: ci: remove commit count limit from test-each-commit and fail fast
eb510f8678ba2e5f2c2fad2a8b086ce93293de1a ci: fail fast in test-each-commit script (Lőrinc)
04c4d710087b6dfdfd8f941fb9c6109238f4216f ci: remove commit count limit from `test-each-commit` (Lőrinc)

Pull request description:

  ### Problem

  `test-each-commit` currently tests only a limited number of ancestor commits in a PR, so failures introduced deeper in the commit stack might be missed.

  ### Fix

  Remove the max-count limit so `test-each-commit` runs the full build + unit + functional test flow on every non-head PR commit, while keeping the PR tip excluded because it is already covered by the normal CI jobs.
  It will also stop after the first failure to surface the root cause sooner and keep logs readable when testing ancestor commits.

  ### Examples
  * Example failure 10 commits deep: https://github.com/l0rinc/bitcoin/actions/runs/21390976651/job/61577575033?pr=105 in https://github.com/l0rinc/bitcoin/pull/105
  * Example pass with >7 dummy commits: https://github.com/l0rinc/bitcoin/actions/runs/21392557521/job/61595159841?pr=106 in https://github.com/l0rinc/bitcoin/pull/106

  ---------

  Note: this PR has gone through a few iterations, the latest one just extends the existing job.

ACKs for top commit:
  maflcko:
    lgtm ACK eb510f8678ba2e5f2c2fad2a8b086ce93293de1a 🕓
  hebasto:
    re-ACK eb510f8678ba2e5f2c2fad2a8b086ce93293de1a.
  willcl-ark:
    ACK eb510f8678ba2e5f2c2fad2a8b086ce93293de1a

Tree-SHA512: 5aadafd32daad610ce882277802c390642dc34f7d5bfa71d4b503ee007942d1ebafce2a3430ea5fd2af6673c83f9aee42450043be4722d7c02407d90920f8bce
2026-02-17 10:03:37 +00:00
fanquake
62e378584e
guix: don't export TZ twice 2026-02-17 09:54:50 +00:00
fanquake
badcf1c68d
guix: fix typo in guix-codesign 2026-02-17 09:54:49 +00:00
merge-script
8a050b9cb6
Merge bitcoin/bitcoin#34575: test: Avoid empty errmsg in JSONRPCException
211111b8048dad959a510150d80277bd9b3d0e25 test: Avoid empty errmsg in JSONRPCException (MarcoFalke)

Pull request description:

  It is unclear why the fallback should be an empty message, when it is better to include all rpc_error details that are available.

  Also, include the http status.

  This allows to revert commit 6354b4fd7fe819eb13274b212e426a7d10ca75d3, because it is no longer needed.

  Can be tested by running this diff:

  ```diff
  diff --git a/test/functional/wallet_disable.py b/test/functional/wallet_disable.py
  index dbcccd4778..9717a2d248 100755
  --- a/test/functional/wallet_disable.py
  +++ b/test/functional/wallet_disable.py
  @@ -18,9 +18,8 @@ class DisableWalletTest (BitcoinTestFramework):
           self.extra_args = [["-disablewallet"]]
           self.wallet_names = []

  -    def run_test (self):
  -        # Make sure wallet is really disabled
  -        assert_raises_rpc_error(-32601, 'Method not found', self.nodes[0].getwalletinfo)
  +    def run_test(self):
  +        self.nodes[0].getwalletinfo()
           x = self.nodes[0].validateaddress('3J98t1WpEZ73CNmQviecrnyiWrnqRhWNLy')
           assert x['isvalid'] == False
           x = self.nodes[0].validateaddress('mneYUmWYsuk7kySiURxCi3AGxrAqZxLgPZ')

ACKs for top commit:
  ismaelsadeeq:
    utACK 211111b8048dad959a510150d80277bd9b3d0e25
  furszy:
    utACK 211111b8048dad959a510150d80277bd9b3d0e25
  hodlinator:
    ACK 211111b8048dad959a510150d80277bd9b3d0e25
  rkrux:
    tACK 211111b8048dad959a510150d80277bd9b3d0e25

Tree-SHA512: 92067aaaa61a887398e38f587004ba31070acc6a9dbd003e9e35393e8c049e786177afa43da05d2d653af340b6c69803c4323061d73d417219bcdf37729e4b66
2026-02-17 09:40:06 +00:00
Hennadii Stepanov
746d8cddc1
qt: Use plurals where necessary 2026-02-17 08:32:57 +00:00
MarcoFalke
fa5672dcaf
refactor: [gui] Use SettingTo<int64_t> over deprecated SettingToInt
This refactor does not change any behavior.

Also, remove the now-unused deprecated aliases.
2026-02-16 16:20:11 +01:00
Hennadii Stepanov
35e6444fdc
Merge bitcoin/bitcoin#34570: doc: update Windows MSVC build guide to utilize winget to install build requirements
d159b103987f672ec4fbb6ba79ba9db45c24c977 doc: update Windows MSVC build guide to utilize WinGet to install apps (janb84)

Pull request description:

  This PR updates the Windows MSVC build guide to bring it more in line with the macOS and Unix build guides.

  Currently the guide listed requirements but left users to manually do the download/installation. The macOS and the Unix guide utilize package managers to provide concrete installation commands that users can follow. By introducing  `winget`, the Windows MSVC build guide now also provides concrete installation commands.

  The changes/commands can be tested on any windows machine, provided it run a  Windows 10 (version 1809 (build 17763)) or later (e.g. Windows 11 / Server 2025).

ACKs for top commit:
  hodlinator:
    re-ACK d159b103987f672ec4fbb6ba79ba9db45c24c977
  hebasto:
    re-ACK d159b103987f672ec4fbb6ba79ba9db45c24c977.

Tree-SHA512: 9eeee60ba3e50e42362f1a6d8003120868c1f49cf146cc6fe16a6deb53ce29c67e841b8ec80d516fe2e6d6ea4c48d34fb12691151e0fea5568c14377bd3da6fb
2026-02-16 13:42:33 +00:00
janb84
d159b10398 doc: update Windows MSVC build guide to utilize WinGet to install apps 2026-02-16 14:26:52 +01:00
ANAVHEOBA
afea2af139
net: reduce log level for PCP/NAT-PMP NOT_AUTHORIZED failures
Users running on home networks with routers that don't support PCP (Port
Control Protocol) or NAT-PMP port mapping receive frequent warning-level
log messages every few minutes:

  "pcp: Mapping failed with result NOT_AUTHORIZED (code 2)"

This is expected behavior for many consumer routers that have PCP
disabled by default, not an actionable error.

Add explicit constants for the NOT_AUTHORIZED result code (value 2)
for both NAT-PMP and PCP protocols. Log the first NOT_AUTHORIZED
failure at warning level for visibility, then downgrade subsequent
occurrences to LogDebug to avoid log noise. Other failure types
continue to warn unconditionally.

Fixes #34114

Co-authored-by: willcl-ark <will@256k1.dev>
2026-02-16 10:20:56 +00:00
MarcoFalke
fac3ecaf69
rpc: Properly parse -rpcworkqueue/-rpcthreads
Also, remove the trailing unnecessary \n from the two logs.
2026-02-16 09:54:47 +01:00
MarcoFalke
faee36f63b
util: Add SettingTo<Int>() and GetArg<Int>()
Redirect:
* SettingToInt to SettingTo<int64_t>, and
* GetIntArg to GetArg<int64_t>
2026-02-16 09:52:28 +01:00
Hennadii Stepanov
6df4a045f7
qt: Replace three dots with ellipsis 2026-02-14 15:53:32 +00:00
Hennadii Stepanov
80dc4359b8
cmake: Apply workaround for install_name_tool conditionally 2026-02-14 10:55:45 +00:00
MarcoFalke
211111b804
test: Avoid empty errmsg in JSONRPCException
It is unclear why the fallback should be an empty message, when it is
better to include all rpc_error details that are available.

Also, include the http status.

This allows to revert commit 6354b4fd7fe819eb13274b212e426a7d10ca75d3,
because it is no longer needed.
2026-02-13 18:55:53 +01:00
Hennadii Stepanov
b65ff0e5a1
Merge bitcoin/bitcoin#34548: ci: Add and use ci-windows-cross.py helper
fa13b13239e53b7198eabab2a3771277a2b433e1 ci: [refactor] Use pathlib over os.path (MarcoFalke)
fa2719ab1ba2252b53609e254413a38ac2097dc9 ci: [refactor] Move run_unit_tests to ci-windows-cross.py (MarcoFalke)
fa99ba5f14d4c7fbc48188504a1668d8e5106c77 ci: Set PREVIOUS_RELEASES_DIR env var in ci-windows-cross.py (MarcoFalke)
fa4a1cab6c179de4e48b574e0a325c74ab7a25f7 ci: Move run_functional_tests into ci-windows-cross.py (MarcoFalke)
1111108685ec0fd09b1e288b07c2b7982fc017e0 ci: [refactor] Move pyzmq install and get_previous_releases into ci-windows-cross.py (MarcoFalke)
fac9c7bd6635d59617949564b1c8075b8537a16b ci: [refactor] Move config.ini rewrite to ci-windows-cross.py (MarcoFalke)
faf738946668b6ec16de37298e5a1da23ed77222 ci: Move check_manifests step to ci-windows-cross.py (MarcoFalke)
fa674d55df57ac0b60f3aa9c9dfec0ae53e8af14 ci: [refactor] Move print_version step into ci-windows-cross.py helper (MarcoFalke)

Pull request description:

  Currently the ci yaml has a mix of Bash and Pwsh snippets, which is problematic:

  * The `shellcheck` tool does not review the Bash
  * The ci yaml is not merged with master on re-runs, but the code is, leading to possibly confusing CI errors on re-runs
  * The Pwsh isn't reviewed at all by any tool
  * It is tedious to run the CI commands locally on Windows

  Fix all issues by extracting them into a step-based Python script.

ACKs for top commit:
  janb84:
    re ACK fa13b13239e53b7198eabab2a3771277a2b433e1
  hebasto:
    ACK fa13b13239e53b7198eabab2a3771277a2b433e1, I have reviewed the code and it looks OK.

Tree-SHA512: 23d21d3bfb07e102fe1cc15ba5749d553d9766ae6c4a7648bd77df0705469bd138c76a9a2fdeb4d91d3f889a425b7caf25878ecb2e68b604faf9665f8df4eb6d
2026-02-13 14:31:35 +00:00
merge-script
03e5f063b5
Merge bitcoin/bitcoin#34559: ci: split vcpkg tools cache into restore/save
c413cf12c5c6e688e71be84397a6e4fc75b5eaa4 ci: Split vcpkg tools cache into restore/save (willcl-ark)

Pull request description:

  The vcpkg tools cache was using the combined actions/cache action, which by default saves on every run regardless of branch. Split it into the restore/save pattern used by the other caches, so that saves only happen on default branch pushes.

  This will have little impact in bitcoin/bitcoin (which uses few branches), but on forks, if you don't update master branch frequently (which saves all caches), then all cache space will eventually be taken up by multiple vckpg tools caches, resulting in bad cache hit rates in all other jobs.

ACKs for top commit:
  maflcko:
    lgtm ACK c413cf12c5c6e688e71be84397a6e4fc75b5eaa4

Tree-SHA512: e28a43b1aa17ce7f0a19d16b98efed0372004d83e4d7e92a126f642599d7e1a94684032a48a3b380b3a7c970c313c92bfe30146b977e33f81b45fe70b49755e3
2026-02-13 11:34:49 +00:00
merge-script
84e826ddc1
Merge bitcoin/bitcoin#34511: test: fully reset the state of CConnman in tests
2cb7e99deee1017a6edd94d82de556895138361d test: also reset CConnman::m_private_broadcast in tests (Vasil Dimov)
91b7c874e2b1479ed29f067cd1bef7724aabd951 test: add ConnmanTestMsg convenience method Reset() (Vasil Dimov)

Pull request description:

  Member variables of `CConnman::m_private_broadcast` (introduced in
  https://github.com/bitcoin/bitcoin/pull/29415) could influence the tests
  which creates non-determinism if the same instance of `CConnman` is used
  for repeated test iterations.

  So, reset the state of `CConnman::m_private_broadcast` from
  `ConnmanTestMsg::Reset()`. Currently this affects the fuzz tests
  `process_message` and `process_messages`.

  Reported in https://github.com/bitcoin/bitcoin/issues/34476#issuecomment-3849088794

ACKs for top commit:
  maflcko:
    review ACK 2cb7e99deee1017a6edd94d82de556895138361d 🚙
  Crypt-iQ:
    tACK 2cb7e99deee1017a6edd94d82de556895138361d
  frankomosh:
    Code Review ACK 2cb7e99deee1017a6edd94d82de556895138361d
  brunoerg:
    code review ACK 2cb7e99deee1017a6edd94d82de556895138361d

Tree-SHA512: 0f4b114542da8dc611689457ce67034c15cbfe409b006b2db72bc74078ee9513f5ce3d0e6e67d37c127cfa0a5170fe72fe3ea45ce2a61d45a358dd11bd1881f8
2026-02-13 11:17:26 +00:00
merge-script
309c51d89d
Merge bitcoin/bitcoin#34546: kernel: Avoid duplicating symbols in the kernel library
eafd530d20326a101be672243de68a67161ef83e kernel: avoid potential duplicate object in shared library/binary (Cory Fields)
24c3b47010036d67e6d777d9aa37ae3ef8146254 build: add kernel-specific warnings (Cory Fields)

Pull request description:

  This is a revival of https://github.com/bitcoin/bitcoin/pull/31807

  Introduces the [-Wunique-object-duplication](https://clang.llvm.org/docs/DiagnosticsReference.html#wunique-object-duplication) warning flag available in clang-21 for usage when building the kernel library. It warns of potential duplicate objects in shared libraries. REDUCE_EXPORTS needs to be ON to trigger it.

  Though we have a C API now that manages exporting symbols, I think it is prudent to also avoid any duplicate symbols on the internal c++ side in case we ever to decide to expose some of its headers. It also not clear that all linkers would handle these cases correctly even in the current internal usage.

ACKs for top commit:
  fanquake:
    ACK eafd530d20326a101be672243de68a67161ef83e
  hebasto:
    ACK eafd530d20326a101be672243de68a67161ef83e.

Tree-SHA512: 81961b50f0268dbe076497e130857f5b4b9151c748d107ec15158d1511dd25bce745e0beeb127b9cea51cb2edd78032735600606a75f7ff8a3fd572acced42e0
2026-02-13 11:11:14 +00:00
Pol Espinasa
24f93c9af7
release note 2026-02-13 10:52:28 +01:00
Pol Espinasa
331a5279d2
wallet, rpc:remove settxfee and paytxfee 2026-02-13 10:52:25 +01:00
Cory Fields
eafd530d20
kernel: avoid potential duplicate object in shared library/binary
Fixes warning and potential bug whereby init_flag may exist in both
libbitcoinkernel as well as a downstream user, as opposed to being shared as
intended.

src/support/lockedpool.h:224:31:
warning: 'init_flag' may be duplicated when built into a shared library: it is mutable, has hidden visibility, and external linkage [-Wunique-object-duplication]
2026-02-13 08:50:50 +01:00
Cory Fields
24c3b47010
build: add kernel-specific warnings
In some cases, we'll want to be more aggressive or care about different things
when building the kernel. In this case, a warning is added for symbols which
may be duplicated between the kernel and downstream users.

This warning was introduced in clang 21, which is not yet the minimum
supported compiler version. REDUCE_EXPORTS needs to be ON to trigger it.
2026-02-13 08:50:17 +01:00
Andrew Toth
cae6d895f8
fuzz: add target for CoinsViewOverlay
Co-authored-by: l0rinc <pap.lorinc@gmail.com>
2026-02-12 21:31:23 -05:00
Andrew Toth
86eda88c8e
fuzz: move backend mutating block to end of coins_view
Refactor TestCoinsView() to move code that directly modifies
backend_coins_view to the end of the function.
This prepares for a CoinsViewOverlay fuzz target that asserts
the backend_coins_view is not mutated by any methods before
BatchWrite is called.

Co-authored-by: l0rinc <pap.lorinc@gmail.com>
2026-02-12 21:31:23 -05:00
Andrew Toth
89824fb27b
fuzz: pass coins_view_cache to TestCoinsView in coins_view
Refactor TestCoinsView() to accept the cache as a parameter instead of
creating it internally. This prepares for adding a CoinsViewOverlay
fuzz target that needs to pass in a different cache type.

This is a non-functional change.

Co-authored-by: l0rinc <pap.lorinc@gmail.com>
2026-02-12 21:31:23 -05:00
Andrew Toth
73e99a5966
coins: don't mutate main cache when connecting block
Use `CoinsViewOverlay` when connecting blocks in `ConnectTip`.

Add a new integration test to verify that using
CoinsViewOverlay does not mutate the main cache
during validation for an invalid block.

Co-authored-by: l0rinc <pap.lorinc@gmail.com>
2026-02-12 21:31:23 -05:00
Andrew Toth
67c0d1798e
coins: introduce CoinsViewOverlay
Introduce `CoinsViewOverlay`, a `CCoinsViewCache` subclass that reads
coins without mutating the underlying cache via `FetchCoin()`.

Use `PeekCoin()` to look up a Coin through a stack of `CCoinsViewCache` layers without populating parent caches. This prevents the main cache from caching inputs pulled from disk for a block that has not yet been fully validated. Once `Flush()` is called on the view, these inputs will be added as spent to `coinsCache` in the main cache via `BatchWrite()`.

This is the foundation for async input fetching, where worker threads must not
mutate shared state.

Co-authored-by: l0rinc <pap.lorinc@gmail.com>
2026-02-12 21:31:23 -05:00
Andrew Toth
69b01af0eb
coins: add PeekCoin()
Introduce a helper to look up a Coin through a stack of CCoinsViewCache layers without populating parent caches.

This is useful for ephemeral views (e.g. during ConnectBlock) that want to avoid polluting CoinsTip() when validating invalid blocks.

Co-authored-by: l0rinc <pap.lorinc@gmail.com>
Co-authored-by: Pieter Wuille <pieter@wuille.net>
Co-authored-by: Ryan Ofsky <ryan@ofsky.org>
2026-02-12 21:31:23 -05:00
Ryan Ofsky
f700609e8a doc: Release notes for mining IPC interface bump 2026-02-12 08:39:11 -05:00
Hennadii Stepanov
79c934b51c
cmake: Fix NetBSD-specific workaround for Boost 2026-02-12 10:49:45 +00:00
MarcoFalke
fa90d44a22
test: Fix intermittent issues in feature_assumevalid.py 2026-02-12 11:23:24 +01:00
merge-script
07b924775e
Merge bitcoin/bitcoin#34427: lint: Flatten lint image entry points
faba426b3b666c0e93e4349ba88deb79517534c6 lint: Flatten lint image entry points (MarcoFalke)
1111fff91c768d6893868032a0dfba02a9709ffc lint: Add missing --platform=linux to docker build command (MarcoFalke)

Pull request description:

  Two fixups to the lint container:

  * Add a missing `--platform=linux` to avoid running a non-native arch, like s390x, which happens with podman if such a container was most recently used.
  * Flatten the entry points to remove the bash-based one:

  Previously, an additional entry point into the container that spawned a bash was supported. The bash had an alias `lint` to run all lint scripts. However, such a use-case seems limited (because it only runs inside the container), inflexible (because it only allows running all lint scripts), and possibly brittle (because it can miss re-building the image when the cache is stale). So remove it and just offer the single entry point via the `./ci/lint.py` script.

  If there is a use-case to skip the image building, it should be trivial to add an env var setting the the lint Python script like `DANGER_SKIP_IMAGE_RE_BUILD=1` (or so) in the future.

ACKs for top commit:
  willcl-ark:
    ACK faba426b3b666c0e93e4349ba88deb79517534c6

Tree-SHA512: 9afda16723c215602c6c42fa3a286d1828c887c8f6ff9512c8ec162ec8997789695f0c464d389cae94e67acf8b5e0f1a55e2ee0d60131a2eee091cf281f91514
2026-02-12 09:43:29 +00:00
Sjors Provoost
9453c15361 ipc mining: break compatibility with existing clients (version bump)
This increments the field number of the `Init.makeMining` method and makes the
old `makeMining` method return an error, so existing IPC mining clients not
using the latest schema file will get an error and not be able to access the
Mining interface.

Normally, there shouldn't be a need to break compatibility this way, but the
mining interface has evolved a lot since it was first introduced, with old
clients using the original methods less stable and performant than newer
clients. So now is a good time to introduce a cutoff, drop deprecated methods,
and stop supporting old clients which can't function as well.

Bumping the field number is also an opportunity to make other improvements that
would be awkward to implement compatibly, so a few of these were implemented in
commits immediately preceding this one.

Co-authored-by: Ryan Ofsky <ryan@ofsky.org>
2026-02-12 03:34:08 +01:00
Sjors Provoost
70de5cc2d2 ipc mining: pass missing context to BlockTemplate methods (incompatible schema change)
Adding a context parameter ensures that these methods are run in
their own thread and don't block other calls. They were missing
for:

- createNewBlock()
- checkBlock()

The missing parameters were first pointed out by plebhash in
https://github.com/bitcoin/bitcoin/issues/33575#issuecomment-3383290115 and
adding them should prevent possible performance problems and lockups,
especially with #34184 which can make the createNewBlock method block for a
long time before returning. It would be straightforward to make this change in
a backward compatible way
(https://github.com/bitcoin/bitcoin/pull/34184#discussion_r2770232149) but nice
to not need to go through the trouble.

Warning: This is an intermediate, review-only commit. Binaries built from it
should not be distributed or used to connect to other clients or servers. It
makes incompatible changes to the `mining.capnp` schema without updating the
`Init.makeMining` version, causing binaries to advertise support for a schema
they do not actually implement. Mixed versions may therefore exchange garbage
requests/responses instead of producing clear errors. The final commit in this
series bumps the mining interface number to ensure mismatches are detected.

git-bisect-skip: yes

Co-authored-by: Ryan Ofsky <ryan@ofsky.org>
2026-02-12 03:34:08 +01:00
Ryan Ofsky
2278f017af ipc mining: remove deprecated methods (incompatible schema change)
This change removes deprecated methods from the ipc mining interface.

Warning: This is an intermediate, review-only commit. Binaries built from it
should not be distributed or used to connect to other clients or servers. It
makes incompatible changes to the `mining.capnp` schema without updating the
`Init.makeMining` version, causing binaries to advertise support for a schema
they do not actually implement. Mixed versions may therefore exchange garbage
requests/responses instead of producing clear errors. The final commit in this
series bumps the mining interface number to ensure mismatches are detected.

git-bisect-skip: yes
2026-02-11 21:34:08 -05:00
Ryan Ofsky
c6638fa7c5 ipc mining: provide default option values (incompatible schema change)
This change copies default option values from the C++ mining interface to the
Cap'n Proto interface. Currently, no capnp default values are set, so they are
implicitly all false or 0, which is inconvenient for the rust and python
clients and inconsistent with the C++ client.

Warning: This is an intermediate, review-only commit. Binaries built from it
should not be distributed or used to connect to other clients or servers. It
makes incompatible changes to the `mining.capnp` schema without updating the
`Init.makeMining` version, causing binaries to advertise support for a schema
they do not actually implement. Mixed versions may therefore exchange garbage
requests/responses instead of producing clear errors. The final commit in this
series bumps the mining interface number to ensure mismatches are detected.

git-bisect-skip: yes
2026-02-11 21:34:08 -05:00