Compare commits

...

285 Commits
v30.1 ... 29.x

Author SHA1 Message Date
merge-script
fa91ad3420 Merge bitcoin/bitcoin#34268: [29.x] backports + final changes for 29.3
b834447fb2 [doc] generate manpages 29.3rc1 (glozow)
e9c978391f [build] bump version to 29.3rc1 (glozow)
e973b61dbb [doc] update release notes for 29.3rc1 (glozow)
f4b78c42e5 test: Add a test for anchor outputs in the wallet (Ava Chow)
c6e7765c0a wallet: Throw an error in sendall if the tx size cannot be calculated (Ava Chow)
bab1ac827b wallet: Determine IsFromMe by checking for TXOs of inputs (Ava Chow)
71633a9b5c test: Test wallet 'from me' status change (Ava Chow)
daef5852f0 guix: Fix `osslsigncode` tests (Hennadii Stepanov)
7a71850a6d Remove unreliable seed from chainparams.cpp, and the associated README (SatsAndSports)
2e4688618b miner: fix `addPackageTxs` unsigned integer overflow (ismaelsadeeq)

Pull request description:

  Backports:

  - #34227
  - #33723
  - #33475
  - #33268

  And final changes for 29.3rc1

ACKs for top commit:
  achow101:
    ACK b834447fb2
  janb84:
    ACK b834447fb2
  sedited:
    ACK b834447fb2

Tree-SHA512: 68e02fbde7162f728229f4bfc803bedda6d269e54593ebe40da607f6bd25b2b10bc4297bfa0bc977ce2dc6b558efe6571a7f875090e0f916fc09e5b67432ba30
2026-01-15 10:23:09 +00:00
glozow
b834447fb2 [doc] generate manpages 29.3rc1 2026-01-14 10:07:46 -08:00
glozow
e9c978391f [build] bump version to 29.3rc1 2026-01-14 10:07:46 -08:00
glozow
e973b61dbb [doc] update release notes for 29.3rc1 2026-01-14 10:07:46 -08:00
Ava Chow
f4b78c42e5 test: Add a test for anchor outputs in the wallet
Github-Pull: #33268
Rebased-From: 609d265ebc
2026-01-14 10:07:46 -08:00
Ava Chow
c6e7765c0a wallet: Throw an error in sendall if the tx size cannot be calculated
Github-Pull: #33268
Rebased-From: c40dc822d7
2026-01-13 16:40:32 -08:00
Ava Chow
bab1ac827b wallet: Determine IsFromMe by checking for TXOs of inputs
Instead of checking whether the total amount of inputs known by the
wallet is greater than 0, we should be checking for whether the input is
known by the wallet. This enables us to determine whether a transaction
spends an of output with an amount of 0, which is necessary for marking
0-value dust outputs as spent.

Github-Pull: #33268
Rebased-From: 39a7dbdd27
2026-01-13 16:40:32 -08:00
Ava Chow
71633a9b5c test: Test wallet 'from me' status change
If something is imported into the wallet, it can change the 'from me'
status of a transaction. This status is only visible through
gettransaction's "fee" field which is only shown for transactions that
are 'from me'.

Github-Pull: #33268
Rebased-From: e76c2f7a41
2026-01-13 16:40:30 -08:00
Hennadii Stepanov
daef5852f0 guix: Fix osslsigncode tests
Github-Pull: #34227
Rebased-From: 194114daf3
2026-01-12 13:13:49 -08:00
SatsAndSports
7a71850a6d Remove unreliable seed from chainparams.cpp, and the associated README
Github-Pull: #33723
Rebased-From: b0c706795c
2026-01-12 13:13:49 -08:00
ismaelsadeeq
2e4688618b miner: fix addPackageTxs unsigned integer overflow
Github-Pull: #33475
Rebased-From: b807dfcdc5
2026-01-12 13:13:45 -08:00
merge-script
6e7ea3cf2a Merge bitcoin/bitcoin#33788: [29.x] Backport fixes for CVE-2025-46598
6f136cd391 tests: drop expect_disconnect behaviour for tx relay (Anthony Towns)
be0857745a validation: only check input scripts once (Anthony Towns)
65bcbbc538 net_processing: drop MaybePunishNodeForTx (Anthony Towns)
f24291bd96 qa: unit test sighash caching (Antoine Poinsot)
73d3ab8fc9 qa: simple differential fuzzing for sighash with/without caching (Antoine Poinsot)
ddfb9150b8 script: (optimization) introduce sighash midstate caching (Pieter Wuille)
354d46bc10 script: (refactor) prepare for introducing sighash midstate cache (Pieter Wuille)
5a0506eea0 tests: add sighash caching tests to feature_taproot (Pieter Wuille)
020ed613be validation: detect witness stripping without re-running Script checks (Antoine Poinsot)
56626300b8 policy: introduce a helper to detect whether a transaction spends Segwit outputs (Antoine Poinsot)
97088fa75a qa: test witness stripping in p2p_segwit (Antoine Poinsot)

Pull request description:

ACKs for top commit:
  sipa:
    Code review ACK 6f136cd391
  glozow:
    ACK 6f136cd391, looks correct
  darosior:
    ACK 6f136cd391

Tree-SHA512: 445d770ae10bf1c4766810f945a8e5d83bfa0869d346b0f93c237b91101c9af45d6c935414e79ebf5e0c7089599a9a5a96cff82d9703b1d9573ce9deb21971fd
2026-01-12 11:40:55 -08:00
merge-script
3af199531b Merge bitcoin/bitcoin#34222: [29.x] Backport wallets directory deletion fixes
76cdeb7b06 wallet: test: Failed migration cleanup (David Gumberg)
9405e915e7 test: coverage for migration failure when last sync is beyond prune height (furszy)
5e8ad98163 wallet: migration, fix watch-only and solvables wallets names (furszy)
a7e2d106db wallet: improve post-migration logging (furszy)
9ea84c08d7 test: restorewallet, coverage for existing dirs, unnamed wallet and prune failure (furszy)
833848e9b8 test: add coverage for unnamed wallet migration failure (furszy)
a074d36254 wallet: fix unnamed wallet migration failure (furszy)
d91f56e1e3 wallet: RestoreWallet failure, erase only what was created (furszy)
cc324aa2be wallettool: do not use fs::remove_all in createfromdump cleanup (Ava Chow)
01c04d32aa wallet: introduce method to return all db created files (furszy)
abaf1e37a7 refactor: remove sqlite dir path back-and-forth conversion (furszy)

Pull request description:

  Backports:
  * #34215
  * #34156
  * #34226
  * 2 required commits from #31423

  Note that this backport is unclean and several changes have to be made to most commits to accommodate BDB and the differences in migration cleanup behavior.

ACKs for top commit:
  furszy:
    Code review ACK 76cdeb7b06
  brunoerg:
    light code review ACK 76cdeb7b06 + backported the functional tests without the fixes and all of them failed accordingly.
  glozow:
    light review ACK 76cdeb7b06.

Tree-SHA512: 432268117783fc9a221d895a6f6601b6a2a5031c76d1443cf804cc1d486b40fcded982409d548acd1c01a13c7b378b840fcc3fbe823d6ba5ffc4ebe017d4e13c
2026-01-12 11:02:04 -08:00
David Gumberg
76cdeb7b06 wallet: test: Failed migration cleanup
Refactor a common way to perform the failed migration test that exists
for default wallets, and add relative-path wallets and absolute-path
wallets.

Github-Pull: 34226
Rebased-From: eeaf28dbe0
2026-01-09 12:56:19 -08:00
furszy
9405e915e7 test: coverage for migration failure when last sync is beyond prune height
Github-Pull: bitcoin/bitcoin#34156
Rebased-From: b7c34d08dd
2026-01-09 12:52:57 -08:00
furszy
5e8ad98163 wallet: migration, fix watch-only and solvables wallets names
Because the default wallet has no name, the watch-only and solvables
wallets created during migration end up having no name either.

This fixes it by applying the same prefix name we use for the backup
file for an unnamed default wallet.

Before: watch-only wallet named "_watchonly"
After:  watch-only wallet named "default_wallet_watchonly"

Github-Pull: bitcoin/bitcoin#34156
Rebased-From: 82caa8193a
2026-01-09 12:52:57 -08:00
furszy
a7e2d106db wallet: improve post-migration logging
Right now, after migration the last message users see is "migration completed",
but the migration isn't actually finished yet. We still need to load the new wallets
to ensure consistency, and if that fails, the migration will be rolled back. This
can be confusing for users.

This change logs the post-migration loading step and if a wallet fails to load and
the migration will be rolled back.

Github-Pull: bitcoin/bitcoin#34156
Rebased-From: d70b159c42
2026-01-09 12:52:57 -08:00
furszy
9ea84c08d7 test: restorewallet, coverage for existing dirs, unnamed wallet and prune failure
The first test verifies that restoring into an existing empty directory
or a directory with no .dat db files succeeds, while restoring into a
dir with a .dat file fails.

The second test covers restoring into the default unnamed wallet
(wallet.dat), which also implicitly exercises the recovery path used
after a failed migration.

The third test covers failure during restore on a prune node. When
the wallet last sync was beyond the pruning height.

Github-Pull: bitcoin/bitcoin#34156
Rebased-From: f011e0f068
2026-01-09 12:52:57 -08:00
furszy
833848e9b8 test: add coverage for unnamed wallet migration failure
Verifies that a failed migration of the unnamed (default) wallet
does not erase the main /wallets/ directory, and also that the
backup file exists.

Github-Pull: bitcoin/bitcoin#34156
Rebased-From: 36093bde63
2026-01-09 12:52:10 -08:00
furszy
a074d36254 wallet: fix unnamed wallet migration failure
When migrating any legacy unnamed wallet, a failed migration would
cause the cleanup logic to remove its parent directory. Since this
type of legacy wallet lives directly in the main '/wallets/' folder,
this resulted in unintentionally erasing all wallets, including the
backup file.

To be fully safe, we will no longer call `fs::remove_all`. Instead,
we only erase the individual db files we have created, leaving
everything else intact. The created wallets parent directories are
erased only if they are empty.
As part of this last change, `RestoreWallet` was modified to allow
an existing directory as the destination, since we no longer remove
the original wallet directory (we only remove the files we created
inside it). This also fixes the restore of top-level default wallets
during failures, which were failing due to the directory existence
check that always returns true for the /wallets/ directory.

This bug started after:
f6ee59b6e2
Previously, the `fs::copy_file` call was failing for top-level wallets,
which prevented the `fs::remove_all` call from being reached.

Github-Pull: bitcoin/bitcoin#34156
Rebased-From: f4c7e28e80
2026-01-09 10:39:43 -08:00
furszy
d91f56e1e3 wallet: RestoreWallet failure, erase only what was created
Track what RestoreWallet creates so only those files and directories
are removed during a failure and nothing else. Preexisting paths
must be left untouched.

Note:
Using fs::remove_all() instead of fs::remove() in RestoreWallet does
not cause any problems currently, but the change is necessary for the
next commit which extends RestoreWallet to work with existing directories,
which may contain files that must not be deleted.

Github-Pull: bitcoin/bitcoin#34156
Rebased-From: 4ed0693a3f
2026-01-08 18:10:04 -08:00
Ava Chow
cc324aa2be wallettool: do not use fs::remove_all in createfromdump cleanup
Github-Pull: bitcoin/bitcoin#34215
Rebased-From: f78f6f1dc8
2026-01-08 18:10:04 -08:00
furszy
01c04d32aa wallet: introduce method to return all db created files
Github-Pull: bitcoin/bitcoin#31423
Rebased-From: 1de423e0a0
2026-01-08 18:10:04 -08:00
furszy
abaf1e37a7 refactor: remove sqlite dir path back-and-forth conversion
Github-Pull: bitcoin/bitcoin#31423
Rebased-From: d04f6a97ba
2026-01-07 18:57:16 -08:00
merge-script
7a33cb9062 Merge bitcoin/bitcoin#33623: doc: document capnproto and libmultiprocess deps in 29.x
2cf352fd8e doc: document capnproto and libmultiprocess deps (will)

Pull request description:

  Closes: #33576

  These dependencies are both undocumented, and libmultiprocess has a relatively special requirement in that v6.0 and later are known to not work with v29.x of Bitcoin Core due to https://github.com/bitcoin-core/libmultiprocess/pull/160

ACKs for top commit:
  ryanofsky:
    Code review ACK 2cf352fd8e. Thanks for making all these changes and for opening the fix originally.

Tree-SHA512: 3839bb7b0bbb23c3fe358960e93f7919953cac315eaed2b214491dd4f6c80ed500c09a618d11408836bddf6d11fc98b1ca3989f552104c49713ebd8859706ac5
2025-12-09 10:36:14 +00:00
will
2cf352fd8e doc: document capnproto and libmultiprocess deps
These dependencies are both undocumented, and libmultiprocess has a
relatively special requirement in that v6.0 and later are known to not
work with v29.x of Bitcoin Core due to https://github.com/bitcoin-core/libmultiprocess/pull/160
2025-12-05 17:32:06 +00:00
merge-script
8a16165ab7 Merge bitcoin/bitcoin#33611: [29.x] Backports
4917d0c0de doc: update release notes for 29.x (fanquake)
554ff3f7f3 test: change log rate limit version gate from 299900 to 290100 (Eugene Siegel)
16e10f928c ci: expose all ACTIONS_* vars (willcl-ark)
c7979f429a ci: Properly include $FILE_ENV in DEPENDS_HASH (Ava Chow)

Pull request description:

  Backports:
  * #33508
  * #33581
  * #33612

ACKs for top commit:
  willcl-ark:
    ACK 4917d0c0de

Tree-SHA512: fc0660a8087a2791ff969d1a006ec9690c2a2eb3db923fa21c9081e506868a6473638be3d19120d4a812dcf82ae47c8b16359bb695582b78b0dc7ee14e377adf
2025-11-18 11:35:42 +00:00
Anthony Towns
6f136cd391 tests: drop expect_disconnect behaviour for tx relay
Github-Pull: #33050
Rebased-From: 876dbdfb47
2025-11-03 21:50:28 +00:00
Anthony Towns
be0857745a validation: only check input scripts once
Previously, we would check failing input scripts twice when considering
a transaction for the mempool, in order to distinguish policy failures
from consensus failures. This allowed us both to provide a different
error message and to discourage peers for consensus failures. Because we
are no longer discouraging peers for consensus failures during tx relay,
and because checking a script can be expensive, only do this once.

Also renames non-mandatory-script-verify-flag error to
mempool-script-verify-flag-failed.

NOTE: Backport required additional adjustment in test/functional/feature_block

Github-Pull: #33050
Rebased-From: b29ae9efdf
2025-11-03 21:50:28 +00:00
Anthony Towns
65bcbbc538 net_processing: drop MaybePunishNodeForTx
Do not discourage nodes even when they send us consensus invalid
transactions.

Because we do not discourage nodes for transactions we consider
non-standard, we don't get any DoS protection from this check in
adversarial scenarios, so remove the check entirely both to simplify the
code and reduce the risk of splitting the network due to changes in tx
relay policy.

NOTE: Backport required additional adjustment in test/functional/p2p_invalid_tx

Github-Pull: #33050
Rebased-From: 266dd0e10d
2025-11-03 21:50:28 +00:00
Antoine Poinsot
f24291bd96 qa: unit test sighash caching
Github-Pull: #32473
Rebased-From: 83950275ed
2025-11-03 21:50:28 +00:00
Antoine Poinsot
73d3ab8fc9 qa: simple differential fuzzing for sighash with/without caching
Github-Pull: #32473
Rebased-From: b221aa80a0
2025-11-03 21:50:28 +00:00
Pieter Wuille
ddfb9150b8 script: (optimization) introduce sighash midstate caching
Github-Pull: #32473
Rebased-From: 92af9f74d7
2025-11-03 21:50:28 +00:00
Pieter Wuille
354d46bc10 script: (refactor) prepare for introducing sighash midstate cache
Github-Pull: #32473
Rebased-From: 8f3ddb0bcc
2025-11-03 21:50:28 +00:00
Pieter Wuille
5a0506eea0 tests: add sighash caching tests to feature_taproot
Github-Pull: #32473
Rebased-From: 9014d4016a
2025-11-03 21:50:28 +00:00
Antoine Poinsot
020ed613be validation: detect witness stripping without re-running Script checks
Since it was introduced in 4eb515574e (#18044), the detection of a
stripped witness relies on running the Script checks 3 times. In the worst case, this consists in
running Script validation 3 times for every single input.

Detection of a stripped witness is necessary because in this case wtxid==txid, and the transaction's
wtxid must not be added to the reject filter or it could allow a malicious peer to interfere with
txid-based orphan resolution as used in 1p1c package relay.

However it is not necessary to run Script validation to detect a stripped witness (much less so
doing it 3 times in a row). There are 3 types of witness program: defined program types (Taproot,
P2WPKH, P2WSH), undefined types, and the Pay-to-anchor carve-out.

For defined program types, Script validation with an empty witness will always fail (by consensus).
For undefined program types, Script validation is always going to fail regardless of the witness (by
standardness). For P2A, an empty witness is never going to lead to a failure.

Therefore it holds that we can always detect a stripped witness without re-running Script validation.
However this might lead to more "false positives" (cases where we return witness stripping for an
otherwise invalid transaction) than the existing implementation. For instance a transaction with one
P2PKH input with an invalid signature and one P2WPKH input with its witness stripped. The existing
implementation would treat it as consensus invalid while the implementation in this commit would
always consider it witness stripped.

Github-Pull: #33105
Rebased-From: 27aefac425
2025-11-03 21:50:28 +00:00
Antoine Poinsot
56626300b8 policy: introduce a helper to detect whether a transaction spends Segwit outputs
We will use this helper in later commits to detect witness stripping without having
to execute every input Script three times in a row.

Github-Pull: #33105
Rebased-From: 2907b58834
2025-11-03 21:50:28 +00:00
Antoine Poinsot
97088fa75a qa: test witness stripping in p2p_segwit
A stripped witness is detected as a special case in mempool acceptance to make sure we do not add
the wtxid (which is =txid since witness is stripped) to the reject filter. This is because it may
interfere with 1p1c parent relay which currently uses orphan reconciliation (and originally it was
until wtxid-relay was widely adopted on the network.

This commit adds a test for this special case in the p2p_segwit function test, both when spending
a native segwit output and when spending a p2sh-wrapped segwit output.

Thanks to Eugene Siegel for pointing out the p2sh-wrapped detection did not have test coverage by
finding a bug in a related patch of mine.

Github-Pull: #33105
Rebased-From: eb073209db
2025-11-03 21:50:28 +00:00
fanquake
4917d0c0de doc: update release notes for 29.x 2025-10-14 17:31:09 +01:00
Eugene Siegel
554ff3f7f3 test: change log rate limit version gate from 299900 to 290100
Github-Pull: #33612
Rebased-From: 7b544341c0
2025-10-14 17:30:06 +01:00
willcl-ark
16e10f928c ci: expose all ACTIONS_* vars
When using `docker buildx build` in conjunction with the `gha` backend
cache type, it's important to specify the URL and TOKEN needed to
authenticate.

On Cirrus runners this is working with only `ACTIONS_CACHE_URL` and
`ACTIONS_RUNTIME_TOKEN`, but this is not enough for the GitHub backend.

Fix this by exporting all `ACTIONS_*` variables.

This fixes cache restore/save on forks or where GH-hosted runners are
being used.

Github-Pull: #33508
Rebased-From: bc706955d7
2025-10-14 10:01:37 +01:00
Ava Chow
c7979f429a ci: Properly include $FILE_ENV in DEPENDS_HASH
$FILE_ENV has a full relative path already, prepending with ci/test/
results in a non-existent path which means that DEPENDS_HASH was not
actually committing to the test's environment file.

Github-Pull: #33581
Rebased-From: ceeb53adcd
2025-10-13 16:22:33 +01:00
merge-script
2d6426c296 Merge bitcoin/bitcoin#33551: [29.x] Finalise 29.2
46d9b9091b doc: update manual pages for v29.2 (fanquake)
b2026fa290 build: bump version to v29.2 (fanquake)
3226616493 doc: update release notes for 29.2 (fanquake)

Pull request description:

  I'm optimistic that 29.2 wont need an `rc3`.

ACKs for top commit:
  instagibbs:
    ACK 46d9b9091b
  stickies-v:
    ACK 46d9b9091b
  glozow:
    ACK 46d9b9091b

Tree-SHA512: f515d2dfbbe60dc145f79425cb2e8ef7a443e69dab208b9acdf357dae7cca3f566f7d013a85c6d4330d8931da060320159a3a9d8dae0ea3ff18bba5aeb282722
2025-10-10 11:51:54 -04:00
fanquake
46d9b9091b doc: update manual pages for v29.2 2025-10-08 10:40:37 +01:00
fanquake
b2026fa290 build: bump version to v29.2 2025-10-08 10:40:37 +01:00
fanquake
3226616493 doc: update release notes for 29.2 2025-10-08 10:40:37 +01:00
merge-script
8bcb90d7e3 Merge bitcoin/bitcoin#33563: [29.x] build: fix depends Qt download link
abf4a6eeae build: fix depends Qt download link (fanquake)

Pull request description:

  Fix Qt download path, so we wont always hit the fallback.

ACKs for top commit:
  hebasto:
    ACK abf4a6eeae.

Tree-SHA512: 1157528983ede46c60810eae5c73f4bd81640afcae9afd9aad14c30104e90c52f8e97755f22314a5514bc1de3a92d864398087fe826f1980acc772fd32535a9f
2025-10-07 14:04:27 +01:00
fanquake
abf4a6eeae build: fix depends Qt download link 2025-10-07 13:31:04 +01:00
merge-script
398c176ea8 Merge bitcoin/bitcoin#33534: [29.x] Finalise 29.2rc2
d82fc69829 doc: update release notes for 29.2rc2 (fanquake)
513cef75ee doc: update manual pages for v29.2rc2 (fanquake)
eea16f7de7 build: bump version to v29.2rc2 (fanquake)
6b3c1dbc5c contrib: fix using macdploy script without translations. (amisha)

Pull request description:

  It's been 2 weeks since rc1: https://github.com/bitcoin/bitcoin/releases/tag/v29.2rc1.
  We've backported more changes:
  * #33403
  * #33474
  * #33482

  Lets do `rc2`.

ACKs for top commit:
  davidgumberg:
    reACK d82fc69
  glozow:
    ACK d82fc69829
  darosior:
    utACK d82fc69829. Changes look good to me, but i have not been through the process of regenerating the doc myself.

Tree-SHA512: c829efe89f86c9c76767ffe60a3779ece902ee9e3c8f6b4203562aaf257019484bfa49916ddfabdcabbd1478368d9b80a3f0a15057778aa1984852ea245283a6
2025-10-03 14:01:58 -04:00
fanquake
d82fc69829 doc: update release notes for 29.2rc2 2025-10-03 18:07:20 +01:00
fanquake
513cef75ee doc: update manual pages for v29.2rc2 2025-10-03 16:26:09 +01:00
fanquake
eea16f7de7 build: bump version to v29.2rc2 2025-10-03 16:26:09 +01:00
amisha
6b3c1dbc5c contrib: fix using macdploy script without translations.
QT translations are optional, but the script would error when
'translations_dir' falls back to its default value NULL.

This PR fixes it by moving the set-up of QT translations under
the check for 'translations_dir' presence.

Github-Pull: #33482
Rebased-From: 7b5261f7ef
2025-10-03 16:26:09 +01:00
merge-script
d1b5d4e9ca Merge bitcoin/bitcoin#33474: [29.x] Backports
2d7ebd2d91 doc: update release notes for 29.x (fanquake)
a8bb76b61f test: add more TRUC reorg coverge (Greg Sanders)
666aec7d49 Mempool: Do not enforce TRUC checks on reorg (Greg Sanders)
6f23ead4a2 fuzz: don't bypass_limits for most mempool harnesses (Greg Sanders)
9d9baafc6f doc: rpc: fix case typo in `finalizepsbt` help (final_scriptwitness) (Sebastian Falbesoner)
22ab141243 rpc: fix getblock(header) returns target for tip (Sjors Provoost)
118abf4c30 test: add block 2016 to mock mainnet (Sjors Provoost)

Pull request description:

  Backports:
  * #33446
  * #33484
  * #33504

ACKs for top commit:
  luke-jr:
    ACK 2d7ebd2d91
  dergoegge:
    ACK 2d7ebd2d91
  marcofleon:
    ACK 2d7ebd2d91

Tree-SHA512: 27b852177d8502d6c703cb0eeb1e4df9d651c9c8add5fbf6ae4eeb4b8aefc145471f38f9794c0ed276bf7ebba1844ecbaf5a84cb5913ca7d0a546f5216ea3b2d
2025-10-03 14:21:52 +01:00
fanquake
2d7ebd2d91 doc: update release notes for 29.x 2025-10-02 15:18:36 +01:00
Greg Sanders
a8bb76b61f test: add more TRUC reorg coverge
Github-Pull: #33504
Rebased-From: 06df14ba75
2025-10-02 15:17:34 +01:00
Greg Sanders
666aec7d49 Mempool: Do not enforce TRUC checks on reorg
Not enforcing TRUC topology on reorg was the intended
behavior, but the appropriate bypass argument was not
checked.

This mistake means we could potentially invalidate a long
chain of perfectly incentive-compatible transactions that
were made historically, including subsequent non-TRUC
transactions, all of which may have been very high feerate.

Lastly, it wastes CPU cycles doing topology checks since
this behavior cannot actually enforce the topology in
general for the reorg setting.

Github-Pull: #33504
Rebased-From: 26e71c237d
2025-10-02 15:17:31 +01:00
Greg Sanders
6f23ead4a2 fuzz: don't bypass_limits for most mempool harnesses
Using bypass_limits=true is essentially fuzzing part of a
reorg only, and results in TRUC invariants unable to be
checked. Remove most instances of bypassing limits, leaving
one harness able to do so.

Github-Pull: #33504
Rebased-From: bbe8e9063c
2025-10-02 15:17:10 +01:00
Sebastian Falbesoner
9d9baafc6f doc: rpc: fix case typo in finalizepsbt help (final_scriptwitness)
Github-Pull: #33484
Rebased-From: ff05bebcc4
2025-09-29 15:56:02 -04:00
Sjors Provoost
22ab141243 rpc: fix getblock(header) returns target for tip
A target field was added to the getblock and getblockheader RPC calls in bitcoin#31583, but it mistakingly always used the tip value.

Because regtest does not have difficulty adjustment, a test is added for mainnet instead.

Github-Pull: #33446
Rebased-From: bf7996cbc3
2025-09-24 10:34:21 -04:00
Sjors Provoost
118abf4c30 test: add block 2016 to mock mainnet
The next commit requires an additional mainnet block which changes the difficulty.

Also fix a few minor mistakes in the test (suite):
- rename the create_coinbase retarger_period argument to halving_period. Before bitcoin#31583 this was hardcoded for regtest where these values are the same.
- drop unused fees argument from mine helper

Finally the CPU miner instructions for generating the alternative mainnet chain are expanded.

Github-Pull: #33446
Rebased-From: 4c3c1f42cf
2025-09-24 10:25:02 -04:00
merge-script
f6d49d0a09 Merge bitcoin/bitcoin#33403: Backport Cirrus runners to 29.x
5750355139 ci: link against -lstdc++ in native fuzz with msan job (fanquake)
78d93effd0 ci: Checkout latest merged pulls (MarcoFalke)
4a034cbeb4 ci: reduce runner sizes on various jobs (will)
6ded1fe117 ci: remove un-needed lint_run*.sh files (willcl-ark)
4e8b64b181 ci: fix annoying docker warning (will)
773e4cda94 ci: add ccache hit-rate warning when < 75% (will)
4339787379 doc: Detail configuration of hosted CI runners (will)
c7f290b826 ci: dynamically match makejobs with cores (will)
a08c3cc51c ci: remove .cirrus.yml (will)
06424fb004 ci: port lint (will)
0f0378fe3c ci: port msan-depends (will)
643385b22d ci: port tsan-depends (will)
3b2dcc8b9a ci: port tidy (will)
b4286cf354 ci: port centos-depends-gui (will)
5057b9a6ff ci: port previous-releases-depends-debug (will)
85ec6c6882 ci: port fuzzer-address-undefined-integer-nodepends (will)
544f902b2a ci: port i686-multiprocess-DEBUG (will)
e826c3daa5 ci: port nowallet-libbitcoinkernel (will)
835b5b8bb1 ci: port mac-cross-gui-notests (will)
a91567a980 ci: force reinstall of kernel headers in asan (will)
819ee09af3 ci: update asan-lsan-ubsan (will)
894a3cbe42 ci: update windows-cross job (will)
82c60a3151 ci: port arm 32-bit job (will)
849993377d ci: add job to determine runner type (will)
f9f3e8b686 ci: add Cirrus cache host (will)
af086431e8 ci: have base install run in right dir (will)
0a649d07c9 ci: use docker build cache arg directly (will)
f3089fb2cf ci: use buildx in ci (will)
1faf918a16 ci: add configure-docker action (will)
954c1a55e4 ci: add REPO_USE_CIRRUS_RUNNERS (will)
301aa5d814 ci: add caching actions (will)
f63b8e960d ci: add configure environment action (will)

Pull request description:

  Backports #32989 to the 29.x branch

ACKs for top commit:
  m3dwards:
    ACK 5750355139

Tree-SHA512: c0509903043acd1c1e62f6382d9373a5c7a51377a76cbe6ea0cacf83cb03b10e658b8fd0dc2080acb9d6361f0a7883feb0134acd9bc53d164561364d42e111e7
2025-09-24 10:18:19 -04:00
fanquake
5750355139 ci: link against -lstdc++ in native fuzz with msan job
Github-Pull: #33425
Rebased-From: b77137a564
2025-09-23 15:26:11 +01:00
MarcoFalke
78d93effd0 ci: Checkout latest merged pulls
Github-Pull: #33303
Rebased-From: fa8f081af3
2025-09-23 15:26:10 +01:00
will
4a034cbeb4 ci: reduce runner sizes on various jobs
Github-Pull: #33319
Rebased-From: 5eeb2facbb

These jobs can use reduced runner size to avoid wasting CPU, as much of
the long-running part of the job is single-threaded.

Suggested in: https://github.com/bitcoin/bitcoin/pull/32989#discussion_r2321775620

Co-authored-by: MarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz>
2025-09-23 15:26:09 +01:00
willcl-ark
6ded1fe117 ci: remove un-needed lint_run*.sh files
Github-Pull: #32989
Rebased-From: 3c5da69a23

ci/lint_run_all.sh: Only used in .cirrus.yml. Refer to test/lint/README.md on how to run locally.
2025-09-23 15:26:08 +01:00
will
4e8b64b181 ci: fix annoying docker warning
Github-Pull: #32989
Rebased-From: 2aa288efdd

Docker currently warns that we are missing a default value.

Set this to scratch which will error if an appropriate image tag is not
passed in to silence the warning.
2025-09-23 15:26:07 +01:00
will
773e4cda94 ci: add ccache hit-rate warning when < 75%
Github-Pull: #32989
Rebased-From: dd1c5903e8

Print the ccache hit-rate for the job using a GitHub annotation if it
was below 75%.
2025-09-23 15:26:06 +01:00
will
4339787379 doc: Detail configuration of hosted CI runners
Github-Pull: #32989
Rebased-From: f427284483
2025-09-23 15:26:06 +01:00
will
c7f290b826 ci: dynamically match makejobs with cores
Github-Pull: #32989
Rebased-From: 3f339e99e0

Previously jobs were running on a large multi-core server where 10 jobs
as default made sense (or may even have been on the low side).

Using hosted runners with fixed (and lower) numbers of vCPUs we should
adapt compilation to match the number of cpus we have dynamically.

This is cross-platform compatible with macos and linux only.
2025-09-23 15:26:05 +01:00
will
a08c3cc51c ci: remove .cirrus.yml
Github-Pull: #32989
Rebased-From: 4393ffdd83

Removed as unused.
2025-09-23 15:26:04 +01:00
will
06424fb004 ci: port lint
Github-Pull: #32989
Rebased-From: bc41848d00

Co-authored-by: Max Edwards <youwontforgetthis@gmail.com>
2025-09-23 15:26:03 +01:00
will
0f0378fe3c ci: port msan-depends
Github-Pull: #32989
Rebased-From: d290a8e6ea

Co-authored-by: Max Edwards <youwontforgetthis@gmail.com>
2025-09-23 15:26:02 +01:00
will
643385b22d ci: port tsan-depends
Github-Pull: #32989
Rebased-From: 9bbae61e3b

Co-authored-by: Max Edwards <youwontforgetthis@gmail.com>
2025-09-23 15:26:01 +01:00
will
3b2dcc8b9a ci: port tidy
Github-Pull: #32989
Rebased-From: bf7d536452

Co-authored-by: Max Edwards <youwontforgetthis@gmail.com>
2025-09-23 15:26:00 +01:00
will
b4286cf354 ci: port centos-depends-gui
Github-Pull: #32989
Rebased-From: 549074bc64

Co-authored-by: Max Edwards <youwontforgetthis@gmail.com>
2025-09-23 15:25:59 +01:00
will
5057b9a6ff ci: port previous-releases-depends-debug
Github-Pull: #32989
Rebased-From: 58e38c3a04

Co-authored-by: Max Edwards <youwontforgetthis@gmail.com>
2025-09-23 15:25:58 +01:00
will
85ec6c6882 ci: port fuzzer-address-undefined-integer-nodepends
Github-Pull: #32989
Rebased-From: 341196d75c

Co-authored-by: Max Edwards <youwontforgetthis@gmail.com>
2025-09-23 15:25:57 +01:00
will
544f902b2a ci: port i686-multiprocess-DEBUG
Github-Pull: #32989
Rebased-From: f2068f26c1

Co-authored-by: Max Edwards <youwontforgetthis@gmail.com>
2025-09-23 15:25:56 +01:00
will
e826c3daa5 ci: port nowallet-libbitcoinkernel
Github-Pull: #32989
Rebased-From: 2a00b12d73

Co-authored-by: Max Edwards <youwontforgetthis@gmail.com>
2025-09-23 15:25:55 +01:00
will
835b5b8bb1 ci: port mac-cross-gui-notests
Github-Pull: #32989
Rebased-From: 9c2514de53

Co-authored-by: Max Edwards <youwontforgetthis@gmail.com>
2025-09-23 15:25:54 +01:00
will
a91567a980 ci: force reinstall of kernel headers in asan
Github-Pull: #32989
Rebased-From: 2c990d84a3

When using hosted runners in combination with cached docker images,
there is the possibility that the host runner image is updated,
rendering the linux-headers package (stored in the cached docker image)
incompatible.

Fix this by doing a re-install of the headers package in
03_test_script.sh.

If the underlying runner kernel has not changed thie has no effect, but
prevents the job from failing if it has.
2025-09-23 15:25:53 +01:00
will
819ee09af3 ci: update asan-lsan-ubsan
Github-Pull: #32989
Rebased-From: 884251441b

Co-authored-by: Max Edwards <youwontforgetthis@gmail.com>
2025-09-23 15:25:52 +01:00
will
894a3cbe42 ci: update windows-cross job
Github-Pull: #32989
Rebased-From: 04e7bfbceb

Co-authored-by: Max Edwards <youwontforgetthis@gmail.com>
2025-09-23 15:25:51 +01:00
will
82c60a3151 ci: port arm 32-bit job
Github-Pull: #32989
Rebased-From: f253031cb8

Co-authored-by: Max Edwards <youwontforgetthis@gmail.com>
2025-09-23 15:25:50 +01:00
will
849993377d ci: add job to determine runner type
Github-Pull: #32989
Rebased-From: cc1735d777

To remove multiple occurances of the respository name, against which we
compare `${{ github.repository }}` to check if we should use Cirrus
Runners, introduce a helper job which can check a single environment
variable and output this as an input to subsequent jobs.

Forks can maintain a trivial patch of their repo name against the
`REPO_USE_CIRRUS_RUNNERS` variable in ci.yml if they have Cirrus Runners
of their own, which will then enable cache actions and docker build
cache to use Cirrus Cache.

It's not possible to use `${{ env.USE_CIRRUS_RUNNERS }}` in the
`runs-on:` directive as the context is not supported by GitHub.

If it was, this job would no longer be necessary.
2025-09-23 15:25:49 +01:00
will
f9f3e8b686 ci: add Cirrus cache host
Github-Pull: #32989
Rebased-From: 020069e6b7

Whilst the action cirruslabs/actions/cache will automatically set this
host, the docker `gha` build cache backend will not be aware of it.

Set the value here, which will later be used in the docker build args to
enable docker build cache on the cirrus cache.
2025-09-23 15:25:48 +01:00
will
af086431e8 ci: have base install run in right dir
Github-Pull: #32989
Rebased-From: 9c2b96e0d0

This sets the build dir at build time so that Apple SDK gets installed
in the correct/expected location for the runtime to find it.

Co-authored-by: Max Edwards <youwontforgetthis@gmail.com>
2025-09-23 15:25:47 +01:00
will
0a649d07c9 ci: use docker build cache arg directly
Github-Pull: #32989
Rebased-From: 18f6be09d0

Reverts: e87429a2d0

This was added in PR #31545 with the intention that self-hosted runners
might use it to save build cache.

As we are not using hosted runners with a registry build cache, the bulk
of this commit can be reverted, simply using the value of
$DOCKER_BUILD_CACHE_ARG in the script.

link: https://github.com/bitcoin/bitcoin/pull/31545
2025-09-23 15:25:46 +01:00
will
f3089fb2cf ci: use buildx in ci
Github-Pull: #32989
Rebased-From: 94a0932547

Using buildx is required to properly load the correct driver, for use
with registry caching. Neither build, nor BUILDKIT=1 currently do this
properly.

Use of `docker buildx build` is compatible with podman.
2025-09-23 15:25:45 +01:00
will
1faf918a16 ci: add configure-docker action
Github-Pull: #32989
Rebased-From: fdf64e5532

Another action to reduce boilerplate in the main ci.yml file.

This action will set up a docker builder compatible with caching build
layers to a container registry using the `gha` build driver.

It will then configure the docker build cache args.
2025-09-23 15:25:44 +01:00
will
954c1a55e4 ci: add REPO_USE_CIRRUS_RUNNERS
Github-Pull: #32989
Rebased-From: 33ba073df7

If set, Cirrus runners will be used on pushes to, and pull requests
against, this repository.

Forks can set this if they have their own cirrus runners.
2025-09-23 15:25:43 +01:00
will
301aa5d814 ci: add caching actions
Github-Pull: #32989
Rebased-From: b232b0fa5e

Add "Restore" and "Save" caching actions.

These actions reduce boilerplate in the main ci.yml configuration file.

These actions are implemented so that caches will be saved on `push`
only.

When a pull request is opened it will cache hit on the caches from the
lastest push, or in the case of depends will hit on any matching depends
hash, falling back to partial matches.

Depends caches are hashed using
`$(git ls-tree HEAD depends "ci/test/$FILE_ENV" | sha256sum | cut -d' ' -f1)`
and this hash is passed in as an input to the actions. This means we
direct cache hit in cases where depends would not be re-built, otherwise
falling back to a partial match.

Previous releases cache is hashed similarly to depends, but using the
test/get_previous_releases.py file.

The cirruslabs cache action will fallback transparently to GitHub's
cache in the case that the job is not being run on a Cirrus Runner,
making these compatible with running on forks (on free GH hardware).
2025-09-23 15:25:42 +01:00
will
f63b8e960d ci: add configure environment action
Github-Pull: #32989
Rebased-From: b8fcc9fcbc
2025-09-23 15:25:41 +01:00
merge-script
7e1eca4882 Merge bitcoin/bitcoin#33344: [29.x] Backports
f2bd79f80c doc: update manual pages for v29.2rc1 (fanquake)
461dd13faf build: bump version to v29.2rc1 (fanquake)
9bc4afb62c doc: update release notes for 29.x (fanquake)
61cdc04a83 net: Do not apply whitelist permission to onion inbounds (Martin Zumsande)
1288d44804 test: send duplicate blocktxn message in p2p_compactblocks.py (Eugene Siegel)
569ceb0df4 net: check for empty header before calling FillBlock (Eugene Siegel)
4c940d4789 p2p: remove vestigial READ_STATUS_CHECKBLOCK_FAILED (Greg Sanders)
9b95ab5e9d p2p: Add witness mutation check inside FillBlock (Greg Sanders)
e97588fc3d trace: Workaround GCC bug compiling with old systemtap (Luke Dashjr)
324caa8497 ci: always use tag for LLVM checkout (fanquake)
2717331981 Fix benchmark CSV output (Hennadii Stepanov)

Pull request description:

  Backports:
  * #32646
  * #33296
  * #33310
  * #33340
  * #33364
  * #33395

  Plus changes for 29.2rc1.

ACKs for top commit:
  darosior:
    utACK f2bd79f80c
  mzumsande:
    utACK f2bd79f80c

Tree-SHA512: 346a92032b7a069e2941056c6273ff65e360c5834832b106350a9cd42b634518cc75b807da6e51a6292e3a33342bb7b145777d3538a2792e03c63962d747a025
2025-09-17 14:00:10 -04:00
fanquake
f2bd79f80c doc: update manual pages for v29.2rc1 2025-09-17 15:54:29 +01:00
fanquake
461dd13faf build: bump version to v29.2rc1 2025-09-17 15:47:34 +01:00
fanquake
9bc4afb62c doc: update release notes for 29.x 2025-09-17 15:45:45 +01:00
Martin Zumsande
61cdc04a83 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-09-17 10:12:08 +01:00
Eugene Siegel
1288d44804 test: send duplicate blocktxn message in p2p_compactblocks.py
Add test_multiple_blocktxn_response that checks that the peer is
disconnected.

Github-Pull: #33296
Rebased-From: 8b62647680
2025-09-12 15:44:07 +01:00
Eugene Siegel
569ceb0df4 net: check for empty header before calling FillBlock
Previously in debug builds, this would cause an Assume crash if
FillBlock had been called previously. This could happen when multiple
blocktxn messages were received.

Co-Authored-By: Greg Sanders <gsanders87@gmail.com>

Github-Pull: #33296
Rebased-From: 5e585a0fc4
2025-09-12 15:44:03 +01:00
Greg Sanders
4c940d4789 p2p: remove vestigial READ_STATUS_CHECKBLOCK_FAILED
Github-Pull: #32646
Rebased-From: 28299ce776
2025-09-12 15:44:00 +01:00
Greg Sanders
9b95ab5e9d p2p: Add witness mutation check inside FillBlock
Since #29412, we have not allowed mutated blocks to continue
being processed immediately the block is received, but this
is only done for the legacy BLOCK message.

Extend these checks as belt-and-suspenders to not allow
similar mutation strategies to affect relay by honest peers
by applying the check inside
PartiallyDownloadedBlock::FillBlock, immediately before
returning READ_STATUS_OK.

This also removes the extraneous CheckBlock call.

Github-Pull: #32646
Rebased-From: bac9ee4830
2025-09-12 15:43:53 +01:00
Luke Dashjr
e97588fc3d trace: Workaround GCC bug compiling with old systemtap
Github-Pull: #33310
Rebased-From: 93a29ff283
2025-09-12 11:52:26 +01:00
fanquake
324caa8497 ci: always use tag for LLVM checkout
Rather than trying to match the apt installed clang version, which is
prone to intermittent issues. i.e #33345.

Github-Pull: #33364
Rebased-From: b736052e39
2025-09-12 09:48:59 +01:00
Hennadii Stepanov
2717331981 Fix benchmark CSV output
The `SHA256AutoDetect` return output is used, among other use cases, to
name benchmarks. Using a comma breaks the CSV output.

This change replaces the comma with a semicolon, which fixes the issue.

Github-Pull: #33340
Rebased-From: 790b440197
2025-09-09 10:13:49 +01:00
merge-script
a0e438bd49 Merge bitcoin/bitcoin#33294: [29.x] *san CI backports
7c6be9acae doc: update release notes for 29.x (fanquake)
ea40fa95d9 ci: use LLVM 21 (fanquake)
5513516241 ci: remove DEBUG_LOCKORDER from TSAN job (fanquake)
f9939cdbe0 ci: instrument libc++ in TSAN job (fanquake)
0fba5ae021 ci: allow libc++ instrumentation other than msan (fanquake)
10cbf2255d ci: Use APT_LLVM_V in msan task (MarcoFalke)

Pull request description:

  Backports:
  * #32999
  * #33099 (added `ninja-build`)
  * #33258

ACKs for top commit:
  marcofleon:
    ACK 7c6be9acae, looks okay to me

Tree-SHA512: 928882d505ed8101a6d4123947252a84d40bd350383408926b5c37aed56dc3359067d1d14c443c51351a6958a8dd9e141bb7713665295ff1f1ad86c5f8a36df0
2025-09-08 17:16:58 +01:00
fanquake
7c6be9acae doc: update release notes for 29.x 2025-09-05 12:04:09 +01:00
fanquake
ea40fa95d9 ci: use LLVM 21
Github-Pull: #33258
Rebased-From: 4cf0ae474b
2025-09-03 16:51:18 +01:00
fanquake
5513516241 ci: remove DEBUG_LOCKORDER from TSAN job
Github-Pull: #33099
Rebased-From: 7aa5b67132
2025-09-03 16:51:18 +01:00
fanquake
f9939cdbe0 ci: instrument libc++ in TSAN job
Qt is disabled, as the build is now taking a very long time.

Github-Pull: #33099
Rebased-From: b09af2ce50
2025-09-03 16:51:14 +01:00
fanquake
0fba5ae021 ci: allow libc++ instrumentation other than msan
Github-Pull: #33099
Rebased-From: 6653cafd0b
2025-09-03 16:16:08 +01:00
MarcoFalke
10cbf2255d ci: Use APT_LLVM_V in msan task
Also, use update-alternatives to avoid having to manually specify
clang-${APT_LLVM_V} or llvm-symbolizer-${APT_LLVM_V} everywhere.

Github-Pull: #32999
Rebased-From: fad040a578
2025-09-03 16:14:25 +01:00
merge-script
fd784f2774 Merge bitcoin/bitcoin#33271: [29.x] finalise v29.1
084c95a18c doc: update manual pages for v29.1 (fanquake)
37d115c67e build: bump version to v29.1 final (fanquake)
b0d88bcc50 doc: finalise release notes for 29.1 (fanquake)
99ab2e70e7 ci: return to using dash in CentOS job (fanquake)
6448ebb5a7 doc: Remove wrong and redundant doxygen tag (MarcoFalke)

Pull request description:

  Backports:
  * #33236
  * #33261

  Since `rc2`, #33212 was also backported in #33251.

ACKs for top commit:
  glozow:
    ACK 084c95a18c
  willcl-ark:
    ACK 084c95a18c

Tree-SHA512: 0698e5b2d12f7328bf5af8dbbd92b0049de401c0a4af27fda2209f9aab35d827c5ac65eb9268aa1fae241e3adf0d3dd89324bb288655ead8af2b5584aae1f6d2
2025-09-03 10:49:29 -04:00
fanquake
084c95a18c doc: update manual pages for v29.1 2025-09-03 13:41:57 +01:00
fanquake
37d115c67e build: bump version to v29.1 final 2025-09-03 13:23:31 +01:00
fanquake
b0d88bcc50 doc: finalise release notes for 29.1 2025-09-03 13:22:28 +01:00
fanquake
99ab2e70e7 ci: return to using dash in CentOS job
Github-Pull: #33261
Rebased-From: 509ffea40a
2025-09-03 11:51:12 +01:00
MarcoFalke
6448ebb5a7 doc: Remove wrong and redundant doxygen tag
Remove it in feerate.

Fix it in the other places.

Github-Pull: #33236
Rebased-From: 966666de9a
2025-08-29 14:53:02 +01:00
merge-script
162c009c1d Merge bitcoin/bitcoin#33251: [29.x] backport #33212
fcac8022d8 test: index with an unclean restart after a reorg (Martin Zumsande)
16b1710d97 index: don't commit state in BaseIndex::Rewind (Martin Zumsande)

Pull request description:

  Backports #33212 to 29.x

ACKs for top commit:
  achow101:
    ACK fcac8022d8
  stickies-v:
    ACK fcac8022d8
  mzumsande:
    Code Review ACK fcac8022d8

Tree-SHA512: eeb9213f03bbb1d48c3ccb12121a6e475f436895d314b5171007e7e4ee457c74b312fa7f0d1808d6221dc22b192700a93ea21c4e9e04689da7dde7e1f79e9569
2025-08-27 09:46:59 +01:00
Martin Zumsande
fcac8022d8 test: index with an unclean restart after a reorg
This test fails without the previous commit.

Github-Pull: #33212
Rebased-From: a602f6fb7b
2025-08-24 22:51:07 +01:00
Martin Zumsande
16b1710d97 index: don't commit state in BaseIndex::Rewind
The committed state of an index should never
be ahead of the flushed chainstate. Otherwise, in the case
of an unclean shutdown, the blocks necessary to revert
from the prematurely committed state would not be
available, which would corrupt the coinstatsindex in particular.
Instead, the index state will be committed with the next
ChainStateFlushed notification.

Github-Pull: #33212
Rebased-From: 01b95ac6f4
2025-08-24 22:48:09 +01:00
merge-script
027a60d218 Merge bitcoin/bitcoin#33234: doc: update example bitcoin conf for 29.1rc2
65dc198d2c doc: update example bitcoin conf for 29.1rc2 (fanquake)

Pull request description:

  Followup to #33226.

ACKs for top commit:
  dergoegge:
    ACK 65dc198d2c
  willcl-ark:
    ACK 65dc198d2c

Tree-SHA512: b2924783dd98890bd031dbca8c9c126cd3ab45c3cc8d2f14dd5b5f940fcc7061f3d1f73e2d36482afceaae786f3087b59baab98db0f10bc0d19e3f016f52851a
2025-08-21 15:03:20 +01:00
fanquake
65dc198d2c doc: update example bitcoin conf for 29.1rc2 2025-08-21 13:39:05 +01:00
merge-script
89fe999cda Merge bitcoin/bitcoin#33226: [29.x] 33106 backport and final changes for rc2
0034dcfba9 [doc] man pages for 29.1rc2 (glozow)
eb1574af0c [build] bump version to 29.1rc2 (glozow)
f9f1ca5445 [doc] update release notes (glozow)
9dd7efc8c3 [policy] lower default minrelaytxfee and incrementalrelayfee to 100sat/kvB (glozow)
bbdab3ef7b [prep/test] make wallet_fundrawtransaction's minrelaytxfee assumption explicit (glozow)
da30ca0efa [prep/util] help MockMempoolMinFee handle more precise feerates (glozow)
a0ae3fc8a7 [prep/test] replace magic number 1000 with respective feerate vars (glozow)
1c1970fb45 [miner] lower default -blockmintxfee to 1sat/kvB (glozow)
3a7e093f94 [doc] assert that default min relay feerate and incremental are the same (glozow)
567c3ee3cb [test] explicitly check default -minrelaytxfee and -incrementalrelayfee (glozow)
6b5396c4b1 [test] RBF rule 4 for various incrementalrelayfee settings (glozow)
03da7aff99 [test] check bypass of minrelay for various minrelaytxfee settings (glozow)
4e3cfa660d [test] check miner doesn't select 0fee transactions (glozow)

Pull request description:

  Backports #33106 and includes final changes for 29.1rc2. Based on current network conditions (in which nodes rejecting 0.1-1sat/vB are missing many transactions), it is recommended to change these policy settings.

  I did not include #32750 because it causes #33177 and I don't foresee any problems; it was just a nice to have.
  For reviewers: the backport is unclean but fairly straightforward. I just had to adapt a test that is no longer in master (#32973) and include `-datacarriersize` in order to pad transaction size (#32406).

ACKs for top commit:
  dergoegge:
    utACK 0034dcfba9
  marcofleon:
    ACK  0034dcfba9
  murchandamus:
    crACK 0034dcfba9
  brunoerg:
    crACK 0034dcfba9

Tree-SHA512: 1b7540ac3fec5b15cf36926dbf633054f14549d76aa445a2bf042b5667e8637db4f9c21c869af25a0c3f8c7cca6c585d17896d2f7e95a6264c1ff59817446694
2025-08-21 12:18:36 +01:00
glozow
0034dcfba9 [doc] man pages for 29.1rc2 2025-08-20 10:19:48 -04:00
glozow
eb1574af0c [build] bump version to 29.1rc2 2025-08-20 10:19:48 -04:00
glozow
f9f1ca5445 [doc] update release notes
Release notes are from 18720bc5d5
2025-08-20 10:19:32 -04:00
glozow
9dd7efc8c3 [policy] lower default minrelaytxfee and incrementalrelayfee to 100sat/kvB
Let's say an attacker wants to use/exhaust the network's bandwidth, and
has the choice between renting resources from a commercial provider and
getting the network to "spam" itself it by sending unconfirmed
transactions. We'd like the latter to be more expensive than the former.

The bandwidth for relaying a transaction across the network is roughly
its serialized size (plus relay overhead) x number of nodes. A 1000vB
transaction is 1000-4000B serialized. With 100k nodes, that's 0.1-0.4GB
If the going rate for commercial services is 10c/GB, that's like 1-4c per kvB
of transaction data, so a 1000vB transaction should pay at least $0.04.

At a price of 120k USD/BTC, 100sat is about $0.12. This price allows us
to tolerate a large decrease in the conversion rate or increase in the
number of nodes.

Github-Pull: #33106
Rebased-From: 6da5de58ca
2025-08-20 10:19:23 -04:00
glozow
bbdab3ef7b [prep/test] make wallet_fundrawtransaction's minrelaytxfee assumption explicit
Github-Pull: #33106
Rebased-From: 2e515d2897
2025-08-20 10:19:23 -04:00
glozow
da30ca0efa [prep/util] help MockMempoolMinFee handle more precise feerates
Use a virtual size of 1000 to keep precision when using a feerate
(which is rounded to the nearest satoshi per kvb) that isn't just an
integer.

Github-Pull: #33106
Rebased-From: 457cfb61b5
2025-08-20 10:19:23 -04:00
glozow
a0ae3fc8a7 [prep/test] replace magic number 1000 with respective feerate vars
Github-Pull: #33106
Rebased-From: 3eab8b7240
2025-08-20 10:19:23 -04:00
glozow
1c1970fb45 [miner] lower default -blockmintxfee to 1sat/kvB
Back when we implemented coin age priority as a miner policy, miners
mempools might admit transactions paying very low fees, but then want to
set a higher fee for block inclusion. However, since coin age priority
was removed in v0.15, the block assembly policy is solely based on fees,
so we do not need to apply minimum feerate rules in multiple places. In
fact, the block assembly policy ignoring transactions that are added to
the mempool is likely undesirable as we waste resources accepting and
storing this transaction.

Instead, rely on mempool policy to enforce a minimum entry feerate to
the mempool (minrelaytxfee). Set the minimum block feerate to the
minimum non-zero amount (1sat/kvB) so it collects everything it finds in
mempool into the block.

Github-Pull: #33106
Rebased-From:  5f2df0ef78
2025-08-20 10:19:23 -04:00
glozow
3a7e093f94 [doc] assert that default min relay feerate and incremental are the same
Github-Pull: #33106
Rebased-From: d6213d6aa1
2025-08-20 10:19:23 -04:00
glozow
567c3ee3cb [test] explicitly check default -minrelaytxfee and -incrementalrelayfee
Github-Pull: #33106
Rebased-From:  1fbee5d7b6
2025-08-20 10:19:23 -04:00
glozow
6b5396c4b1 [test] RBF rule 4 for various incrementalrelayfee settings
Github-Pull: #33106
Rebased-From: 72dc18467d
2025-08-20 10:19:23 -04:00
glozow
03da7aff99 [test] check bypass of minrelay for various minrelaytxfee settings
Github-Pull: #33106
Rebased-From: 85f498893f
2025-08-20 10:19:23 -04:00
glozow
4e3cfa660d [test] check miner doesn't select 0fee transactions
Github-Pull: #33106
Rebased-From: e5f896bb1f
2025-08-20 10:19:15 -04:00
merge-script
c5196bc9c4 Merge bitcoin/bitcoin#33225: [29.x] Backport logging ratelimiting
0022e25333 test: modify logging_filesize_rate_limit params (Eugene Siegel)
206f5902db config: add DEBUG_ONLY -logratelimit (Eugene Siegel)
dfdd407c42 test: logging_filesize_rate_limit improvements (stickies-v)
11538160b3 test: don't leak log category mask across tests (stickies-v)
4ed7a51642 test: add ReadDebugLogLines helper function (stickies-v)
acfa83d9d0 log: make m_limiter a shared_ptr (stickies-v)
81751341e9 log: clean up LogPrintStr_ and Reset, prefix all logs with "[*]" when there are suppressions (Eugene Siegel)
7c3820ff63 log: change LogLimitStats to struct LogRateLimiter::Stats (Eugene Siegel)
dfe4e19f66 log: clarify RATELIMIT_MAX_BYTES comment, use RATELIMIT_WINDOW (Eugene Siegel)
273ffda2c8 log: remove const qualifier from arguments in LogPrintFormatInternal (Eugene Siegel)
9cde68fa98 log: avoid double hashing in SourceLocationHasher (Eugene Siegel)
25f975b8df test: remove noexcept(false) comment in ~DebugLogHelper (Eugene Siegel)
24c793d06c doc: add release notes for new rate limiting logging behavior (Eugene Siegel)
0b6b096421 log: Add rate limiting to LogPrintf, LogInfo, LogWarning, LogError, LogPrintLevel (Eugene Siegel)
a0992a842e log: use std::source_location in place of __func__, __FILE__, __LINE__ (Eugene Siegel)
41262cc4d5 log: introduce LogRateLimiter, LogLimitStats, Status (Eugene Siegel)
4987c03531 test: Mark ~DebugLogHelper as noexcept(false) (Eugene Siegel)

Pull request description:

  Backports:
  * #32604
    * Note that 24c793d06c isn't clean, as it's added directly to `release-notes.md`.
  * #33011
  * #33211

ACKs for top commit:
  instagibbs:
    utACK 0022e25333
  dergoegge:
    utACK 0022e25333
  stickies-v:
    ACK 0022e25333 - all backports clean except the release notes one, as indicated.

Tree-SHA512: 466aa6884a2c936131cf222b94943148bc385fc9574840cc63933f510c40c2cc74d8c9a9b2560205926a0a70a93de0e191a623fa2352628d8cead45bbee59b1c
2025-08-20 09:54:28 -04:00
Eugene Siegel
0022e25333 test: modify logging_filesize_rate_limit params
Change time_window from 20s to 1h so Reset is not accidentally called
if the test takes a while.

Change num_lines from 1024 to 10 since LogRateLimiter is parameterized
and does not require logging 1MiB of data.

Co-Authored-By: stickies-v <stickies-v@protonmail.com>

Github-Pull: #33211
Rebased-From: 5dda364c4b
2025-08-20 12:01:59 +01:00
Eugene Siegel
206f5902db config: add DEBUG_ONLY -logratelimit
Use -nologratelimit by default in functional tests if the bitcoind
version supports it.

Co-Authored-By: stickies-v <stickies-v@protonmail.com>

Github-Pull: #33011
Rebased-From: 5c74a0b397
2025-08-20 12:01:35 +01:00
stickies-v
dfdd407c42 test: logging_filesize_rate_limit improvements
- Add helper functions and structs to improve readability and
  reusability of test code
- Make tests more specific by comparing all produced log lines with
  expected log lines instead of relying on approximations or proxies.

Github-Pull: #33011
Rebased-From: 9f3b017bcc
2025-08-20 12:01:12 +01:00
stickies-v
11538160b3 test: don't leak log category mask across tests
This ensures log tests behave consistently when other tests modify
the log category mask.

Github-Pull: #33011
Rebased-From: 350193e5e2
2025-08-20 12:00:48 +01:00
stickies-v
4ed7a51642 test: add ReadDebugLogLines helper function
Deduplicates repeated usage of the same functionality.

Github-Pull: #33011
Rebased-From: 05d7c22479
2025-08-20 12:00:22 +01:00
stickies-v
acfa83d9d0 log: make m_limiter a shared_ptr
This allows us to safely and explicitly manage the dual dependency
on the limiter: one for the Logger, and one for the CScheduler.

Github-Pull: #33011
Rebased-From: 3d630c2544
2025-08-20 11:59:45 +01:00
Eugene Siegel
81751341e9 log: clean up LogPrintStr_ and Reset, prefix all logs with "[*]" when there are suppressions
In LogPrintStr_:
- remove an unnecessary BCLog since we are in the BCLog namespace.
- remove an unnecessary \n when rate limiting is triggered since
  FormatLogStrInPlace will add it.
- move the ratelimit bool into an else if block.
- prefix all log lines with [*] when suppressions exist. Previously this
  was only done if should_ratelimit was true.

In Reset:
- remove an unnecessary \n since FormatLogStrInPlace will add it.
- Change Level::Info to Level::Warning.

Github-Pull: #33011
Rebased-From: e8f9c37a3b
2025-08-20 11:55:28 +01:00
Eugene Siegel
7c3820ff63 log: change LogLimitStats to struct LogRateLimiter::Stats
Clean up the noisy LogLimitStats and remove references to the time
window.

Co-Authored-By: stickies-v <stickies-v@protonmail.com>

Github-Pull: #33011
Rebased-From: 3c7cae49b6
2025-08-20 11:54:59 +01:00
Eugene Siegel
dfe4e19f66 log: clarify RATELIMIT_MAX_BYTES comment, use RATELIMIT_WINDOW
Co-Authored-By: stickies-v <stickies-v@protonmail.com>

Github-Pull: #33011
Rebased-From: 8319a13468
2025-08-20 11:53:48 +01:00
Eugene Siegel
273ffda2c8 log: remove const qualifier from arguments in LogPrintFormatInternal
Co-Authored-By: l0rinc <pap.lorinc@gmail.com>

Github-Pull: #33011
Rebased-From: 5f70bc80df
2025-08-20 11:52:01 +01:00
Eugene Siegel
9cde68fa98 log: avoid double hashing in SourceLocationHasher
Co-Authored-By: l0rinc <pap.lorinc@gmail.com>

Github-Pull: #33011
Rebased-From: b8e92fb3d4
2025-08-20 11:51:31 +01:00
Eugene Siegel
25f975b8df test: remove noexcept(false) comment in ~DebugLogHelper
Github-Pull: #33011
Rebased-From: 616bc22f13
2025-08-20 11:51:06 +01:00
Eugene Siegel
24c793d06c doc: add release notes for new rate limiting logging behavior
Github-Pull: #32604
Rebased-From: 4c772cbd83
2025-08-20 11:47:20 +01:00
Eugene Siegel
0b6b096421 log: Add rate limiting to LogPrintf, LogInfo, LogWarning, LogError, LogPrintLevel
To mitigate disk-filling attacks caused by unsafe usages of LogPrintf and
friends, we rate-limit them by passing a should_ratelimit bool that
eventually makes its way to LogPrintStr which may call
LogRateLimiter::Consume. The rate limiting is accomplished by
adding a LogRateLimiter member to BCLog::Logger which tracks source
code locations for the given logging window.

Every hour, a source location can log up to 1MiB of data. Source
locations that exceed the limit will have their logs suppressed for the
rest of the window determined by m_limiter.

This change affects the public LogPrintLevel function if called with
a level >= BCLog::Level::Info.

The UpdateTipLog function has been changed to use the private LogPrintLevel_
macro with should_ratelimit set to false. This allows UpdateTipLog to log
during IBD without hitting the rate limit.

Note that on restart, a source location that was rate limited before the
restart will be able to log until it hits the rate limit again.

Co-Authored-By: Niklas Gogge <n.goeggi@gmail.com>
Co-Authored-By: stickies-v <stickies-v@protonmail.com>

Github-Pull: #32604
Rebased-From: d541409a64
2025-08-20 11:45:06 +01:00
Eugene Siegel
a0992a842e log: use std::source_location in place of __func__, __FILE__, __LINE__
The std::source_location conveniently stores the file name, line number,
and function name of a source code location. We switch to using it instead
of the __func__ identifier and the __FILE__ and __LINE__ macros.

BufferedLog is changed to have a std::source_location member, replacing the
source_file, source_line, and logging_function members. As a result,
MemUsage no longer explicitly counts source_file or logging_function as the
std::source_location memory usage is included in the MallocUsage call.

This also changes the behavior of -logsourcelocations as std::source_location
includes the entire function signature. Because of this, the functional test
feature_config_args.py must be changed to no longer include the function
signature as the function signature can differ across platforms.

Co-Authored-By: Niklas Gogge <n.goeggi@gmail.com>
Co-Authored-By: stickies-v <stickies-v@protonmail.com>

Github-Pull: #32604
Rebased-From: a6a35cc0c2
2025-08-20 11:42:01 +01:00
Eugene Siegel
41262cc4d5 log: introduce LogRateLimiter, LogLimitStats, Status
LogRateLimiter will be used to keep track of source locations and our
current time-based logging window. It contains an unordered_map and a
m_suppressions_active bool to track source locations. The map is keyed
by std::source_location, so a custom Hash function (SourceLocationHasher)
and custom KeyEqual function (SourceLocationEqual) is provided.
SourceLocationHasher uses CSipHasher(0,0) under the hood to get a
uniform distribution.

A public Reset method is provided so that a scheduler (e.g. the
"b-scheduler" thread) can periodically reset LogRateLimiter's state when
the time window has elapsed.

The LogRateLimiter::Consume method checks if we have enough available
bytes in our rate limiting budget to log an additional string. It
returns a Status enum that denotes the rate limiting status and can
be used by the caller to emit a warning, skip logging, etc.

The Status enum has three states:
- UNSUPPRESSED     (logging was successful)
- NEWLY_SUPPRESSED (logging was succcesful, next log will be suppressed)
- STILL_SUPPRESSED (logging was unsuccessful)

LogLimitStats counts the available bytes left for logging per source
location for the current logging window. It does not track actual source
locations; it is used as a value in m_source_locations.

Also exposes a SuppressionsActive() method so the logger can use
that in a later commit to prefix [*] to logs whenenever suppressions
are active.

Co-Authored-By: Niklas Gogge <n.goeggi@gmail.com>
Co-Authored-By: stickies-v <stickies-v@protonmail.com>

Github-Pull: #32604
Rebased-From: afb9e39ec5
2025-08-20 11:37:48 +01:00
Eugene Siegel
4987c03531 test: Mark ~DebugLogHelper as noexcept(false)
We mark ~DebugLogHelper as noexcept(false) to be able to catch the
exception it throws. This lets us use it in test in combination with
BOOST_CHECK_THROW and BOOST_CHECK_NO_THROW to check that certain log
messages are (not) logged.

Co-Authored-By: Niklas Gogge <n.goeggi@gmail.com>

Github-Pull: #32604
Rebased-From: df7972a6cf
2025-08-20 11:37:17 +01:00
merge-script
837c5c7fd8 Merge bitcoin/bitcoin#33074: [29.x] Backports
b9e637bd0e doc: update release notes for 29.x (fanquake)
2b9738a083 test: Fix 'getdescriptoractivity' RPCHelpMan, add test to verify 'spend_vin' is the correct field (Chris Stewart)
4e8abca445 rpc: fix getpeerinfo ping duration unit docs (0xb10c)
a08886d564 doc: move `cmake -B build -LH` up in Unix build docs (Bufo)
264418f80c doc: Add rel note for breaking change in dumptxoutset RPC (Chris Stewart)
a18b53f99e guix: warn SOURCE_DATE_EPOCH set in guix-codesign (will)
9437415024 tracing: fix pointer argument handling in mempool_monitor.py (deadmanoz)
3cd8612cd7 doc/zmq: fix unix socket path example (Roman Zeyde)

Pull request description:

  Backports:
  * #33070
  * #33073
  * #33086
  * #33088
  * #33103
  * #33119
  * #33133

ACKs for top commit:
  glozow:
    ACK b9e637bd0e

Tree-SHA512: bf2a700ec4d730548cf5abf10930b41e26742ea23582149b0eddcaaa48c1db05ab657ef9ffc7dcba2d1af2e265d0ea866d7b484a321a9c9ac662a6dc2263d102
2025-08-15 13:59:08 +01:00
fanquake
b9e637bd0e doc: update release notes for 29.x 2025-08-06 11:18:21 +01:00
Chris Stewart
2b9738a083 test: Fix 'getdescriptoractivity' RPCHelpMan, add test to verify 'spend_vin' is the correct field
Github-Pull: #33119
Rebased-From: 3543bfdfec
2025-08-06 11:17:38 +01:00
0xb10c
4e8abca445 rpc: fix getpeerinfo ping duration unit docs
The getpeerinfo docs incorrectly specified the ping durations as
milliseconds. This was incorrectly changed in a3789c700b
(released in v25; master since Sept. 2022). The correct duration unit
is seconds.

Also, remove the documentation of the getpeerinfo RPC response from the
ping RPC since it's incomplete. Better to just reference the getpeerinfo
RPC and it's documenation for this.

Github-Pull: #33133
Rebased-From: 1252eeb997
2025-08-05 09:44:47 +01:00
Bufo
a08886d564 doc: move cmake -B build -LH up in Unix build docs
Github-Pull: #33088
Rebased-From: 6757052fc4
2025-08-03 12:25:29 +01:00
Chris Stewart
264418f80c doc: Add rel note for breaking change in dumptxoutset RPC
This was missed in the v29.0 release notes.
2025-07-30 16:49:37 +01:00
will
a18b53f99e guix: warn SOURCE_DATE_EPOCH set in guix-codesign
Currently there is a warning for this in guix-build, but we also need
one in guix-codesign, otherwise the codesigned hashes are not
reproducible.

Move common functionality into prelude and call the function in both
guix actions.

Github-Pull: #33073
Rebased-From: 1bed0f734b
2025-07-29 16:35:30 +01:00
deadmanoz
9437415024 tracing: fix pointer argument handling in mempool_monitor.py
The BPF code was incorrectly passing pointer variables by value to
bpf_usdt_readarg(), causing the function to fail silently and resulting
in transaction hashes and reason strings displaying as zeros or garbage.

This fix adds the missing reference operator (&) when passing pointer
variables to bpf_usdt_readarg(), allowing the function to properly
write the pointer values and enabling correct display of transaction
hashes and removal/rejection reasons.

Fixes the regression introduced in ec47ba349d where bpf_usdt_readarg_p
was replaced with bpf_usdt_readarg but the calling convention wasn't
properly updated for pointer arguments.

Github-Pull: #33086
Rebased-From: 0ce041ea88
2025-07-29 10:54:48 +01:00
Roman Zeyde
3cd8612cd7 doc/zmq: fix unix socket path example
Following 75a5c8258e/doc/release-notes/release-notes-28.0.md (L105)

Github-Pull: #33070
Rebased-From: e83699a626
2025-07-28 10:28:44 +01:00
merge-script
565af03c37 Merge bitcoin/bitcoin#33056: [29.x] final changes for v29.1rc1
4c2d285b70 [doc] update release notes for v29.1rc1 (glozow)
06eb42d83c [doc] manpages for 29.1rc1 (glozow)
735ffad864 [build] bump version to 29.1rc1 (glozow)

Pull request description:

ACKs for top commit:
  marcofleon:
    nice, ACK 4c2d285b70
  fanquake:
    ACK 4c2d285b70
  darosior:
    ACK 4c2d285b70

Tree-SHA512: ffcc45566e33b8c4b80da1c751a5045863e06a31de81ec6f3f5ba26717eb8e7087139f7d2696ed5c61170efb62b5b9416f350bcb108a03afcdfa38e77067d612
2025-07-25 16:28:46 +01:00
glozow
4c2d285b70 [doc] update release notes for v29.1rc1 2025-07-24 15:54:20 -04:00
glozow
06eb42d83c [doc] manpages for 29.1rc1 2025-07-24 13:20:21 -04:00
glozow
735ffad864 [build] bump version to 29.1rc1 2025-07-24 12:40:27 -04:00
merge-script
4bf77955ed Merge bitcoin/bitcoin#33013: [29.x] Backport #32521
f25dc84b28 doc: update release notes for 29.x (Antoine Poinsot)
313023369b qa: functional test a transaction running into the legacy sigop limit (Antoine Poinsot)
0a4671d5eb qa: unit test standardness of inputs packed with legacy sigops (Antoine Poinsot)
204b965915 policy: make pathological transactions packed with legacy sigops non-standard. (Antoine Poinsot)

Pull request description:

  This backports PR #32521 to make the change available to miners who can't (or don't want to) upgrade past version 29.

ACKs for top commit:
  marcofleon:
    reACK f25dc84b28
  glozow:
    ACK f25dc84b28

Tree-SHA512: d5e06618720ed1a96d8a5fccdd8d1dbcbb5748505aa0df69198326828fe13f220e55bbce813f6f2daae82d23348e1f83a3a20a28639ec3fc2455c5b6e79a56e6
2025-07-24 12:32:38 -04:00
merge-script
951b349af1 Merge bitcoin/bitcoin#33052: [29.x] backport #32069
c6fe6971bf doc: update release notes for 29.x (fanquake)
380b5aded2 test: fix intermittent failure in wallet_reorgsrestore.py (furszy)

Pull request description:

  Backport https://github.com/bitcoin/bitcoin/pull/32069 to 29. This is a test flakiness fix for https://github.com/bitcoin/bitcoin/pull/31757, which was backported to 29 in https://github.com/bitcoin/bitcoin/pull/32589.

ACKs for top commit:
  marcofleon:
    ACK c6fe6971bf

Tree-SHA512: 82517eef67c8d0fe57e70cb769d1b040ea8dea41c2d2e5b442477e1c7add7d7bac1c4aabbebc5b7d440db5b7bf00f1d70dc6ffb375b7a2e77d9599c543579122
2025-07-24 16:59:04 +01:00
fanquake
c6fe6971bf doc: update release notes for 29.x 2025-07-24 10:00:40 -04:00
furszy
380b5aded2 test: fix intermittent failure in wallet_reorgsrestore.py
Wait until the node's process has fully stopped before starting a new instance.

Since the same code is used in tool_wallet.py, this consolidates the behavior
into a 'kill_process()' function.

Github-Pull: bitcoin/bitcoin#32069
Rebased-From: 36b0713edc
2025-07-24 09:29:11 -04:00
merge-script
8063d55446 Merge bitcoin/bitcoin#33046: [29.x] test: Do not pass tests on unhandled exceptions
411e15194b doc: update release notes for 29.x (fanquake)
5e327e6703 test: Log KeyboardInterrupt as exception (MarcoFalke)
79e1a3c9c6 test: Do not pass tests on unhandled exceptions (MarcoFalke)

Pull request description:

  Backports #33001 to `29.x`.

ACKs for top commit:
  pablomartin4btc:
    ACK 411e15194b
  marcofleon:
    lgtm ACK 411e15194b

Tree-SHA512: ea930f8c24a0a5e18f2107e96540db5c39941442059190d6104dfcf88b4a33d06ecaa7dbdf8baa91e564ee7ca3d12df5118c7fa404a38108de4ad0e5f122f72d
2025-07-24 12:15:56 +01:00
Antoine Poinsot
f25dc84b28 doc: update release notes for 29.x 2025-07-23 12:47:50 -04:00
fanquake
411e15194b doc: update release notes for 29.x 2025-07-23 16:47:49 +01:00
MarcoFalke
5e327e6703 test: Log KeyboardInterrupt as exception
log.exception is more verbose and useful to debug timeouts.

Also, log stderr for CalledProcessError to make debugging easier.

Github-Pull: #33001
Rebased-From: faa3e68411
2025-07-23 16:47:12 +01:00
MarcoFalke
79e1a3c9c6 test: Do not pass tests on unhandled exceptions
This adds a missing catch for BaseException (e.g. SystemExit), which
would otherwise be silently ignored.

Also, remove the redundant other catches, which are just calling
log.exception with a redundant log message.

Github-Pull: #33001
Rebased-From: fa30b34026
2025-07-23 16:46:48 +01:00
Antoine Poinsot
313023369b qa: functional test a transaction running into the legacy sigop limit
It's useful to have an end-to-end test in addition to the unit test to sanity check the RPC error as
well as making sure the transaction is otherwise fully standard.

Github-Pull: bitcoin/bitcoin#32521
Rebased-From: 96da68a38f
2025-07-18 16:51:54 -04:00
Antoine Poinsot
0a4671d5eb qa: unit test standardness of inputs packed with legacy sigops
Check bounds and different output types.

Github-Pull: bitcoin/bitcoin#32521
Rebased-From: 367147954d
2025-07-18 16:51:54 -04:00
Antoine Poinsot
204b965915 policy: make pathological transactions packed with legacy sigops non-standard.
The Consensus Cleanup soft fork proposal includes a limit on the number of legacy signature
operations potentially executed when validating a transaction. If this change is to be implemented
here and activated by Bitcoin users in the future, we should prevent the ability for someone to
broadcast a transaction through the p2p network that is not valid according to the new rules. This
is because if it was possible it would be a trivial DoS to potentially unupgraded miners after the
soft fork activates.

We do not know for sure whether users will activate the Consensus Cleanup. However if they do such
transactions must have been made non-standard long in advance, due to the time it takes for most
nodes on the network to upgrade. In addition this limit may only be run into by pathological
transactions which pad the Script with sigops but do not use actual signatures when spending, as
otherwise they would run into the standard transaction size limit.

Github-Pull: bitcoin/bitcoin#32521
Rebased-From: 5863315e33
2025-07-18 16:51:53 -04:00
merge-script
ef380a454c Merge bitcoin/bitcoin#32863: [29.x] Backports
5300295083 doc: update release notes for 29.x (fanquake)
730886b92b depends: fix libevent _WIN32_WINNT usage (fanquake)
f798c317a0 cmake: Drop no longer necessary "cmakeMinimumRequired" object (Hennadii Stepanov)
bc2147c884 depends: Force `CMAKE_EXPORT_NO_PACKAGE_REGISTRY=TRUE` (Hennadii Stepanov)
58b1a65ab0 add more bad p2p ports (Jameson Lopp)
f85d41c224 test: retain the intended behavior of `feature_fee_estimation.py` nodes (ismaelsadeeq)
84c0c0e64b test: fix incorrect subtest in `feature_fee_estimation.py` (ismaelsadeeq)
83ee49b1dc doc: clarify that the "-j N" goes after the "--build build" part (Salvatore Ingala)
e5a7575a6d doc: Add workaround for vcpkg issue with paths with embedded spaces (Hennadii Stepanov)
59a83fb8d1 functional test: correctly detect nonstd TRUC tx vsize in feature_taproot (Greg Sanders)
9f3690b978 feature_taproot: sample tx version border values more (Greg Sanders)
8a4a938db5 depends: Override host compilers for FreeBSD and OpenBSD (Hennadii Stepanov)
3a57bfaaf9 test: Use rehash() in outbound eviction block-relay (pablomartin4btc)
f82015ccfc test: Clarify roles in outbound eviction comments (pablomartin4btc)
222fbfcc6a test: check P2SH sigop count for coinbase tx (brunoerg)

Pull request description:

  Backports
  - #32463
  - #32716
  - #32823
  - #32826
  - #32837
  - #32841
  - #32846
  - #32850
  - #32858
  - #32859
  - #32943
  - #32954

ACKs for top commit:
  hebasto:
    ACK 5300295083, I've backported all listed PRs locally (had 3 conflicts to resolve), and got zero diff with this PR.
  glozow:
    ACK 5300295083

Tree-SHA512: c2f764ce3dcd1b6c16bfbe73a548a815f8d7db83653436d17686541a5cb530255a96132865442aa2f569340c95abee31aadda8bf0736582c7a19720029096b1e
2025-07-18 13:47:15 -04:00
fanquake
5300295083 doc: update release notes for 29.x 2025-07-16 13:51:57 +01:00
fanquake
730886b92b depends: fix libevent _WIN32_WINNT usage
Starting with version 13.x, the mingw headers will define the value of
NTDDI_VERSION, based on the value of _WIN32_WINNT, if that version is <
Windows 10. Given that libevent was undefining our _WIN32_WINNT, and
redefining it to a value < Windows 10 (0x0501), NTDDI_VERSION was also
being defined to that value, leading to functions not being exposed in
the mingw-w64 headers; see here:
9c2668ef77/mingw-w64-headers/include/iphlpapi.h (L36-L41).

Imports a commit from usptream (a14ff91254f40cf36e0fee199e26fb11260fab49).

Fixes #32707.

Github-Pull: #32837
Rebased-From: f5647c6c5a
2025-07-16 13:50:53 +01:00
Hennadii Stepanov
f798c317a0 cmake: Drop no longer necessary "cmakeMinimumRequired" object
Github-Pull: #32954
Rebased-From: 12a6959892
2025-07-16 13:31:40 +01:00
Hennadii Stepanov
bc2147c884 depends: Force CMAKE_EXPORT_NO_PACKAGE_REGISTRY=TRUE
When using CMake policies 3.14 and below, the `export(PACKAGE)` command
by default populates the user package registry, which is stored outside
the build tree. Setting the `CMAKE_EXPORT_NO_PACKAGE_REGISTRY` variable
disables this side effect.

In CMake 3.15 and later, this behavior is disabled by default, and the
variable has no effect.

Github-Pull: #32943
Rebased-From: 44f3bae300
2025-07-14 13:34:27 +01:00
Jameson Lopp
58b1a65ab0 add more bad p2p ports
Github-Pull: #32826
Rebased-From: 6967e8e8ab
2025-07-04 16:35:35 +01:00
ismaelsadeeq
f85d41c224 test: retain the intended behavior of feature_fee_estimation.py nodes
- Increase block weight by 4000 for all nodes with custom -blockmaxweight.
  Prior to this commit, we generated blocks with 4000 weight units less worth of transactions.
  See https://github.com/bitcoin/bitcoin/issues/32461#issuecomment-2925282272 for details.
  This commit fixes it by increasing the block weight by 4000.

Github-Pull: #32463
Rebased-From: 9b75cfda4d
2025-07-04 09:34:31 +01:00
ismaelsadeeq
84c0c0e64b test: fix incorrect subtest in feature_fee_estimation.py
- Update `check_smart_estimates` to calculate the fee rate ceiling
   by taking the maximum of fees seen, minrelaytxfee, and mempoolminfee.
- Improve the subtest name and comments.

Github-Pull: #32463
Rebased-From: 5c1236f04a
2025-07-04 09:34:28 +01:00
Salvatore Ingala
83ee49b1dc doc: clarify that the "-j N" goes after the "--build build" part
Also, capitalized the comments in build-unix.md for uniformity
with the docs on other targets.

Github-Pull: #32846
Rebased-From: 0e9f409db3
2025-07-03 17:42:44 +01:00
Hennadii Stepanov
e5a7575a6d doc: Add workaround for vcpkg issue with paths with embedded spaces
Github-Pull: #32858
Rebased-From: 0a1af4418e
2025-07-03 16:25:19 +01:00
Greg Sanders
59a83fb8d1 functional test: correctly detect nonstd TRUC tx vsize in feature_taproot
Github-Pull: #32859
Rebased-From: f0524cda39
2025-07-03 12:03:30 +01:00
Greg Sanders
9f3690b978 feature_taproot: sample tx version border values more
Currently if the version 3 is selected for an otherwise
standard spender, the test will fail. It's unlikely but
possible, so change the test to update expectations and
sample more aggressively on border values to instigate
failures much quicker in the future if another version is
made standard.

Github-Pull: #32841
Rebased-From: 4be81e9746
2025-07-03 12:03:06 +01:00
Hennadii Stepanov
8a4a938db5 depends: Override host compilers for FreeBSD and OpenBSD
When building depends on FreeBSD/OpenBSD `aarch64`, the host compilers
default to `default_host_{CC,CXX}`, which resolves to `gcc`/`g++`. This
is incorrect on these systems, where Clang is the default system
compiler.

Github-Pull: #32716
Rebased-From: 4f10a57671
2025-07-03 11:58:03 +01:00
pablomartin4btc
3a57bfaaf9 test: Use rehash() in outbound eviction block-relay
Ensure that tip_header.rehash() is used instead of tip_header.hash, which is None when the header is deserialized from hex.

This avoids depending on wait_for_getheaders() falling back to any received message, making the test more explicit and robust.

Github-Pull: #32823
Rebased-From: ec004cdb86
2025-07-03 11:58:03 +01:00
pablomartin4btc
f82015ccfc test: Clarify roles in outbound eviction comments
Some ambiguous uses of "we" referring to either the node or the peer are replaced with clearer phrasing.

Also rephrase some comments for consistency and readability.

Applies to all relevant outbound eviction tests in p2p_eviction_logic.py.

Github-Pull: #32823
Rebased-From: 26598ed21e
2025-07-03 11:58:03 +01:00
brunoerg
222fbfcc6a test: check P2SH sigop count for coinbase tx
Github-Pull: #32850
Rebased-From: d6aaffcb11
2025-07-03 11:58:03 +01:00
merge-script
d360a6ef56 Merge bitcoin/bitcoin#32810: [29.x] More backports
ef2a013e31 doc: update release notes for 29.x (fanquake)
4b656e2023 test: Add msgtype to msg_generic slots (dergoegge)
1c0e19b93a node: cap -dbcache to 1GiB on 32-bit architectures (Antoine Poinsot)
eafea2393d init: cap -maxmempool to 500 MB on 32-bit systems (Antoine Poinsot)
a3c1939d6e cmake: Explicitly specify `Boost_ROOT` for Homebrew's package (Hennadii Stepanov)
a990c1002b cmake: Use `HINTS` instead of `PATHS` in `find_*` commands (Hennadii Stepanov)
5987c1b6ab test: fix catchup loop in outbound eviction functional test (Sebastian Falbesoner)
e37a70bf71 build: add root dir to CMAKE_PREFIX_PATH (will)

Pull request description:

  Backports:
  * #32530
  * #32742
  * #32798
  * #32805
  * #32814
  * #32833

  Fixes #31009.

ACKs for top commit:
  pinheadmz:
    ACK ef2a013e31
  hebasto:
    re-ACK ef2a013e31.
  willcl-ark:
    ACK ef2a013e31

Tree-SHA512: 936ccf732f9fa49acc90de8af0ebf7134aa54dbaf9533c8dfbe08cd178b87a3a091c837d5bb84d61869a69c3c7d499a565b33237b14330a6c66d9c8456d5a261
2025-07-03 11:57:31 +01:00
fanquake
ef2a013e31 doc: update release notes for 29.x 2025-06-30 13:29:28 +01:00
dergoegge
4b656e2023 test: Add msgtype to msg_generic slots
Github-Pull: #32833
Rebased-From: 7dc43ea503
2025-06-30 13:28:55 +01:00
Antoine Poinsot
1c0e19b93a node: cap -dbcache to 1GiB on 32-bit architectures
32-bit architecture is limited to 4GiB, so it doesn't make sense to set a too
high value. Since this setting is performance critical, pick an arbitrary value
higher than for -maxmempool but still reasonable.

Github-Pull: #32530
Rebased-From: 9f8e7b0b3b
2025-06-26 17:36:06 +01:00
Antoine Poinsot
eafea2393d init: cap -maxmempool to 500 MB on 32-bit systems
32-bit architecture is limited to 4GiB, so it doesn't make sense to set a too high value. 500 MB is
chosen as an arbitrary maximum value that seems reasonable.

Github-Pull: #32530
Rebased-From: 2c43b6adeb
2025-06-26 17:36:02 +01:00
Hennadii Stepanov
a3c1939d6e cmake: Explicitly specify Boost_ROOT for Homebrew's package
On macOS, this change ensures that the Boost package is located at its
real path rather than via the symlink in the default prefix.

Github-Pull: #32814
Rebased-From: 8800b5acc1
2025-06-26 15:02:08 +01:00
Hennadii Stepanov
a990c1002b cmake: Use HINTS instead of PATHS in find_* commands
According to the CMake documentation, `HINTS` "should be paths computed
by system introspection, such as a hint provided by the location of
another item already found", which is precisely the case in the
`FindQRencode` module.

Entries in `HINTS` are searched before those in `PATHS`. On macOS,
Homebrew’s `libqrencode` will therefore be located at its real path
rather than via the symlink in the default prefix.

Github-Pull: #32805
Rebased-From: ead4468748
2025-06-26 12:10:51 +01:00
Sebastian Falbesoner
5987c1b6ab test: fix catchup loop in outbound eviction functional test
The catchup loop in the outbound eviction functional test currently has
a small flaw, as the contained waiting for a `getheaders` message just
waits for any such message instead of one with the intended block hash.
The reason is that the `prev_prev_hash` variable is set incorrectly,
since the `tip_header` instance is not updated and its field `.hash` is
None. Fix that by updating `tip_header` and use the correct field -- we
want the tip header's previous hash (`.hashPrevBlock`).

Github-Pull: #32742
Rebased-From: dd8447f70f
2025-06-26 11:24:02 +01:00
will
e37a70bf71 build: add root dir to CMAKE_PREFIX_PATH
Nix patches cmake to remove the root directory `/` from
`CMAKE_SYSTEM_PREFIX_PATH`:
428b49b28e/pkgs/by-name/cm/cmake/001-search-path.diff (L10)

Without this, and when using the toolchain for depends builds, cmake's
`find_path()` and `find_package()` do not know where to find
dependencies, causing issues like:
https://github.com/bitcoin/bitcoin/issues/32428

Adding this path back via CMAKE_PREFIX_PATH is harmless on other
systems, and fixes the toolchain for Nix users.

We append the `/` dir a maximum of once, as the toolchain may be called
repeatedly during builds.

Co-authored-by: Russell Yanofsky <russ@yanofsky.org>
Co-authored-by: josibake <josibake@protonmail.com>

Github-Pull: #32798
Rebased-From: e27a94596f
2025-06-25 11:38:37 +01:00
merge-script
983b268768 Merge bitcoin/bitcoin#32589: [29.x] More backports
0922f6bbc3 doc: update release notes for 29.x (fanquake)
5697605414 contrib: tracing: Correctly read msg type in p2p_monitor.py (David Gumberg)
4c7ed36c96 test: Fix list index out of range error in feature_bip68_sequence.py (zaidmstrr)
3e23b47a6f doc: fix transifex 404s (fanquake)
616baf3c27 doc: taproot became always active in v24.0 (Sjors Provoost)
ef6111bd18 depends: capnp 1.2.0 (fanquake)
8246c6a65f test: wallet, coverage for crash on dup block disconnection during unclean shutdown (Martin Zumsande)
a18085a18b wallet: fix crash on double block disconnection (furszy)
7264459c0d build: patch cmake min version on freetype (josibake)
27c533052c doc, windows: CompanyName "Bitcoin" => "Bitcoin Core project" (Hodlinator)
1b51d750ad depends: fix SHA256SUM command on OpenBSD (use GNU mode output) (Sebastian Falbesoner)
aea8a394b1 doc: make `-DWITH_ZMQ=ON` explicit on `build-unix.md` (Luis Schwab)
23e76ef520 guix: warn and abort when SOURCE_DATE_EPOCH is set (will)
876a7b2db5 doc: add missing packages for BSDs (cmake, gmake, curl) to depends/README.md (Sebastian Falbesoner)
78688c8413 rpc, doc: update `listdescriptors` RCP help (rkrux)
c899334e36 rpc: Note in fundrawtransaction doc, fee rate is for package (benthecarman)
247ee59f55 doc: update tor docs to use bitcoind binary from path (ismaelsadeeq)
4a1143b083 depends: use "mkdir -p" when installing xproto (fanquake)
646fa1d028 test: fix sync function in rpc_psbt.py (Martin Zumsande)
17b31fc802 doc: Add missing top-level description to pruneblockchain RPC (nervana21)
e34b6fbcad guix: accomodate migration to codeberg (fanquake)
142153ee42 cmake: Add missed `SSE41_CXXFLAGS` (Hennadii Stepanov)

Pull request description:

  Backports
  - #31757
  - #32333
  - #32439
  - #32551 (just 800b7cc42c)
  - #32568
  - #32607
  - #32630
  - #32678
  - #32679
  - #32690 (just 8713e8060d)
  - #32693
  - #32696
  - #32708
  - #32711
  - #32719
  - #32760
  - #32765
  - #32771
  - #32776
  - #32777

  Closes #32625.

ACKs for top commit:
  instagibbs:
     ACK 0922f6bbc3
  willcl-ark:
    ACK 0922f6bbc3

Tree-SHA512: 0389e5d85fa897fdbefd37635f6ec822ca5ab48a57c4d40fdd4d1be2465c676f514b0db4d72c962ee15e0090b27ff17701e167d660eaa25f855d06bbb1fe0e6e
2025-06-25 11:03:05 +01:00
fanquake
0922f6bbc3 doc: update release notes for 29.x 2025-06-23 12:48:15 +01:00
David Gumberg
5697605414 contrib: tracing: Correctly read msg type in p2p_monitor.py
Github-Pull: #32771
Rebased-From: 3473986fe1
2025-06-23 10:01:45 +01:00
zaidmstrr
4c7ed36c96 test: Fix list index out of range error in feature_bip68_sequence.py
Github-Pull: #32765
Rebased-From: e285e691b7
2025-06-19 15:06:14 +01:00
fanquake
3e23b47a6f doc: fix transifex 404s
Github-Pull: #32777
Rebased-From: 53a996f122
2025-06-19 11:48:46 +01:00
Sjors Provoost
616baf3c27 doc: taproot became always active in v24.0
Github-Pull: #32776
Rebased-From: 8ee8a951c2
2025-06-19 11:42:10 +01:00
fanquake
ef6111bd18 depends: capnp 1.2.0
Github-Pull: #32760
Rebased-From: c7eaac326a
2025-06-19 10:40:41 +01:00
Martin Zumsande
8246c6a65f test: wallet, coverage for crash on dup block disconnection during unclean shutdown
Co-authored-by: furszy <matiasfurszyfer@protonmail.com>

Github-Pull: #31757
Rebased-From: 11f8ab140f
2025-06-19 10:39:27 +01:00
furszy
a18085a18b wallet: fix crash on double block disconnection
The wallet crashes if it processes the same block disconnection event twice in a row due
to an incompatible coinbase transaction state.
This happens because 'disconnectBlock' provides 'TxStateInactive' without the "abandoned"
flag for coinbase transactions to 'SyncTransaction', while 'AddToWallet()' internally
modifies it to retain the abandoned state.

The flow is as follows:
1) On the first disconnection, the transaction state transitions from "confirmed" to
"inactive," bypassing the state equality check since the provided state differs. Then,
'AddToWallet' internally updates the state to "inactive + abandoned"

2) On the second disconnection, as we provide only the "inactive" state
to 'SyncTransaction()', the state equality assertion fails and crashes the wallet.

Github-Pull: #31757
Rebased-From: 9ef429b6ae
2025-06-19 10:39:27 +01:00
josibake
7264459c0d build: patch cmake min version on freetype
Patch cmake_minimum_required version for freetype, using the version from
https://gitlab.freedesktop.org/freetype/freetype/-/merge_requests/352/diffs

This fixes a failure when building with CMake 4, where compatibility
with CMake versions < 3.5 has been removed (see https://cmake.org/cmake/help/latest/release/4.0.html#deprecated-and-removed-features)

Github-Pull: #32693
Rebased-From: d7c37906e7
2025-06-19 10:39:27 +01:00
Hodlinator
27c533052c doc, windows: CompanyName "Bitcoin" => "Bitcoin Core project"
Matches /share/setup.nsi.in:14

Github-Pull: #32719
Rebased-From: 239fc4d62e
2025-06-19 10:39:27 +01:00
Sebastian Falbesoner
1b51d750ad depends: fix SHA256SUM command on OpenBSD (use GNU mode output)
On OpenBSD, the `sha256` command by default outputs hashsums on files in
"BSD" mode, looking like this:

$ sha256 ~/.vimrc
SHA256 (/home/thestack/.vimrc) = 6ba69d100e8c5ca0488ded6293d4e5f740a6a5d5ace96cbcf0599c18d27389e4

This is not compatible with our depends commands, which expect the
hashes to be on the first column (to be extracted via `cut -d" " -f1`).
Fix this by switching to GNU mode output, looking like this:

$ sha256 -r ~/.vimrc
6ba69d100e8c5ca0488ded6293d4e5f740a6a5d5ace96cbcf0599c18d27389e4 /home/thestack/.vimrc

Without this change, the multiprocess depends build fails with the following output:

$ gmake -C depends MULTIPROCESS=1 NO_BOOST=1 NO_LIBEVENT=1 NO_QT=1 NO_QR=1 NO_WALLET=1 NO_ZMQ=1 NO_USDT=1
[ ..... ]
Extracting native_libmultiprocess...
sha256: /home/thestack/bitcoin/depends/work/build/x86_64-unknown-openbsd7.7/native_libmultiprocess/-2bc902f4693/.src-ipc-libmultiprocess.tar.hash: no properly formatted checksum lines found
gmake: *** [funcs.mk:342: /home/thestack/bitcoin/depends/work/build/x86_64-unknown-openbsd7.7/native_libmultiprocess/-2bc902f4693/.stamp_extracted] Error 1

Github-Pull: #32690
Rebased-From: 8713e8060d
2025-06-19 10:39:27 +01:00
Luis Schwab
aea8a394b1 doc: make -DWITH_ZMQ=ON explicit on build-unix.md
Github-Pull: #32696
Rebased-From: 32d4e92b9a
2025-06-10 17:27:40 +01:00
will
23e76ef520 guix: warn and abort when SOURCE_DATE_EPOCH is set
Current behaviour will by-default use SOURCE_DATE_EPOCH from the
environment without warning. This breaks the default reproducibility
from a guix build.

Warn when and exit when this variable is set, and
FORCE_SOURCE_DATE_EPOCH is unset.

Github-Pull: #32678
Rebased-From: 5c4a0f8009
2025-06-10 15:22:51 +01:00
Sebastian Falbesoner
876a7b2db5 doc: add missing packages for BSDs (cmake, gmake, curl) to depends/README.md
Github-Pull: #32711
Rebased-From: 89526deddf
2025-06-10 13:32:02 +01:00
rkrux
78688c8413 rpc, doc: update listdescriptors RCP help
This RPC lists all the descriptors present in the wallet, not only
the ones that were imported, but also the ones generated when a
new wallet is created.

It can be verified by creating a new wallet and calling the
`listdescriptors` RPC, which will contain 8 ranged descriptors that
are created for every new wallet.

Github-Pull: #32708
Rebased-From: b44514b876
2025-06-10 11:31:10 +01:00
benthecarman
c899334e36 rpc: Note in fundrawtransaction doc, fee rate is for package
Github-Pull: #32607
Rebased-From: f98e1aaf34
2025-06-09 16:13:01 +01:00
ismaelsadeeq
247ee59f55 doc: update tor docs to use bitcoind binary from path
Github-Pull: #32679
Rebased-From: 4ce53495e5
2025-06-09 16:12:25 +01:00
fanquake
4a1143b083 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-03 20:26:27 +01:00
Martin Zumsande
646fa1d028 test: fix sync function in rpc_psbt.py
It currently only syncs between the first two nodes,
which may do nothing when the block is created on the
third node.

Github-Pull: #32630
Rebased-From: 4df4df45d7
2025-05-29 12:31:10 +01:00
nervana21
17b31fc802 doc: Add missing top-level description to pruneblockchain RPC
Previously, the `pruneblockchain` RPC help output included only the method signature and arguments, with no top-level description explaining its purpose or constraints.

This PR adds a concise top-level description, improving documentation consistency and alerting users to the potential impacts of using the command.

Github-Pull: #32333
Rebased-From: 135a0f0aa7
2025-05-29 12:15:57 +01:00
fanquake
e34b6fbcad 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: c8d9baae94
2025-05-28 09:53:33 +01:00
Hennadii Stepanov
142153ee42 cmake: Add missed SSE41_CXXFLAGS
Github-Pull: #32551
Rebased-From: 800b7cc42c
2025-05-22 14:55:42 +01:00
merge-script
589b56192f Merge bitcoin/bitcoin#32292: [29.x] Backports
a0d1f69b55 doc: update release notes for 29.x (fanquake)
6c0f26d3bd test: check that creating a wallet does not log version info (Ava Chow)
e685b4eca2 test: Check that the correct versions are logged on wallet load (Ava Chow)
25aa15ee7f walletdb: Log the wallet version after it has been read from disk (Ava Chow)
cf034172bf test: fix another intermittent failure in wallet_basic.py (Martin Zumsande)
c966158426 test: Fix intermittent failure in wallet_basic.py (Martin Zumsande)
6c4e3de2ac test: Use uninvolved pruned node in feature_pruning undo test (enoch)
edd4073d70 test: Fix nTimes typo in feature_pruning test (enoch)
cc2fcdfc5e cmake: Allow `WITH_DBUS` on all Unix-like systems (Hennadii Stepanov)
caec3cc41b crypto: disable ASan for sha256_sse4 with Clang (fanquake)
fabf4ff237 tracing: fix invalid argument in mempool_monitor (William Casarin)
f9d2c67a0c cmake: Respect user-provided configuration-specific flags (Hennadii Stepanov)
6ed087dede doc: Fix test_bitcoin path (monlovesmango)
2f6c802b54 doc: Fix fuzz test_runner.py path (monlovesmango)
f4d9546425 qt: Replace stray tfm::format to cerr with qWarning (laanwj)
5aa4956cd3 gui: crash fix, disconnect numBlocksChanged() signal during shutdown (furszy)
3665310808 scripted-diff: Use bpf_cflags (MarcoFalke)
4ed5c34abb test: Add imports for util bpf_cflags (MarcoFalke)
3dbd2b3d17 refactor: Remove spurious virtual from final ~CZMQNotificationInterface (MarcoFalke)
64552c83b2 ci: Add workaround for vcpkg's libevent package (Hennadii Stepanov)
85f3e1de68 test: Handle empty string returned by CLI as None in RPC tests (Brandon Odiwuor)
ca70d5cb25 Remove support for RNDR/RNDRRS for aarch64 on Linux (laanwj)

Pull request description:

  Backports for `29.x`:

  - #32184
  - #32187
  - #32248
  - #32286
  - #32312
  - #32336
  - #32353
  - #32356
  - #32389
  - #32437
  - #32454
  - #32469
  - #32483
  - #32553
  - https://github.com/bitcoin-core/gui/pull/864
  - https://github.com/bitcoin-core/gui/pull/868

ACKs for top commit:
  willcl-ark:
    crACK a0d1f69b55

Tree-SHA512: 72aafd17348aa4b602661efd07d48c6af6637c7349e7b032a65f46364e50094723d1c80dced71f0d5ddec59d6dafb72f0463944413a4d810a35cdca6b8272780
2025-05-22 12:05:19 +01:00
fanquake
a0d1f69b55 doc: update release notes for 29.x 2025-05-20 12:30:25 +01:00
Ava Chow
6c0f26d3bd test: check that creating a wallet does not log version info
Github-Pull: #32553
Rebased-From: 4b2cd0b41f
2025-05-20 12:29:25 +01:00
Ava Chow
e685b4eca2 test: Check that the correct versions are logged on wallet load
Github-Pull: #32553
Rebased-From: 39a483c8e9
2025-05-20 12:29:21 +01:00
Ava Chow
25aa15ee7f walletdb: Log the wallet version after it has been read from disk
Logging the wallet version before anything has been read from disk results
in the wrong version being logged.

Also split the last client version logging as it may not always be
present to be logged.

Github-Pull: #32553
Rebased-From: 359ecd3704
2025-05-20 12:29:18 +01:00
Martin Zumsande
cf034172bf test: fix another intermittent failure in wallet_basic.py
During init, the test framework will start using rpc after the
mempool was loaded. It will not wait for postInitProcess or
outstanding transactionAddedToMempool notifications, leading to
a possible race, in which listunspent is being called while the
tx is still in Inactive status. Prevent this by processing
outstanding notifications.

Github-Pull: #32483
Rebased-From: e7ad86e1ca
2025-05-14 13:26:53 +01:00
Martin Zumsande
c966158426 test: Fix intermittent failure in wallet_basic.py
There could be a race with outstanding TxAddedToMempool notifications
being applied to the soon-to-be created wallet.

Fixes an intermittent timeout reproducable by adding a sleep to
AddToWallet.

Github-Pull: #32483
Rebased-From: 07350e204d
2025-05-14 13:26:48 +01:00
enoch
6c4e3de2ac test: Use uninvolved pruned node in feature_pruning undo test
After fixing the nTime variable name, the test_pruneheight_undo_presence
test began failing because node 2, which is involved in reorg testing,
could be on a different chain than other nodes. This caused failures
when trying to fetch blocks from other nodes that didn't recognize
node 2's chain.

Switch to using node 5 instead, which is also a pruned node but isn't
involved in reorg testing, ensuring it stays on the same chain as the
other nodes. This allows the block fetching to work as intended in the
test.

Github-Pull: #32312
Rebased-From: 2aa63d511a
2025-05-14 10:01:32 +01:00
enoch
edd4073d70 test: Fix nTimes typo in feature_pruning test
Fix incorrect variable name in comment (nTimes -> nTime) in
feature_pruning.py. This typo caused the test to always reset
mine_large_blocks.nTime to 0, rather than only on the first run
as intended.

Github-Pull: #32312
Rebased-From: 772ba7f9ce
2025-05-14 10:01:26 +01:00
Hennadii Stepanov
cc2fcdfc5e 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.

Github-Pull: #32469
Rebased-From: 5b7ed460c7
2025-05-12 14:25:19 +01:00
fanquake
caec3cc41b crypto: disable ASan for sha256_sse4 with Clang
This can alsofail to compile when optimisations are being used, see:
https://github.com/bitcoin/bitcoin/issues/31913.
So disable just ASan for this function under any optimisation level.

Github-Pull: #32437
Rebased-From: 4e8ab5e00f
2025-05-12 14:25:16 +01:00
William Casarin
fabf4ff237 tracing: fix invalid argument in mempool_monitor
The mempool_monitor tracing tool is incorrectly reading the reason
as the first argument. Fix this!

Github-Pull: #32454
Rebased-From: 31c5ebc400
2025-05-09 09:31:38 +01:00
Hennadii Stepanov
f9d2c67a0c cmake: Respect user-provided configuration-specific flags
Github-Pull: #32356
Rebased-From: edde96376a
2025-05-08 16:35:14 +01:00
monlovesmango
6ed087dede doc: Fix test_bitcoin path
This commit fixes a couple command paths for interacting with the
test_bitcoin binary within the Unit Test documentation.

Github-Pull: #32389
Rebased-From: 6cbc28b8dd
2025-05-06 18:04:28 +01:00
monlovesmango
2f6c802b54 doc: Fix fuzz test_runner.py path
This commit fixes the path listed in the documentation for the fuzz
testing test_runner.py. Previously the --help option worked but running
fuzz tests from the documented path did not.

Github-Pull: #32353
Rebased-From: 61f238e84a
2025-05-06 18:04:28 +01:00
laanwj
f4d9546425 qt: Replace stray tfm::format to cerr with qWarning
GUI warnings should go to the log, not to the console (which may not be
connected at all).

Github-Pull: gui#868
Rebased-From: edd46566bd
2025-05-06 18:04:28 +01:00
furszy
5aa4956cd3 gui: crash fix, disconnect numBlocksChanged() signal during shutdown
The crash stems from the order of the shutdown procedure:
We first unset the client model, then destroy the wallet controller—but we leave
the internal wallet models ('m_wallets') untouched for a brief period. As a result,
there’s a point in time where views still have connected signals and access to
wallet models that are not connected to any wallet controller.
Now.. since the clientModel is only replaced with nullptr locally and not destroyed
yet, signals like numBlocksChanged can still emit. Thus, when wallet views receive
them, they see a non-null wallet model ptr, and proceed to call backend functions
from a model that is being torn down.

As the shutdown procedure begins by unsetting clientModel from all views. It’s safe
to ignore events when clientModel is nullptr.

Github-Pull: gui#864
Rebased-From: 71656bdfaa
2025-05-06 18:04:28 +01:00
MarcoFalke
3665310808 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-06 18:04:28 +01:00
MarcoFalke
4ed5c34abb test: Add imports for util bpf_cflags
This is required for the next commit.

Github-Pull: #32336
Rebased-From: fa0c1baaf8
2025-05-06 18:04:27 +01:00
MarcoFalke
3dbd2b3d17 refactor: Remove spurious virtual from final ~CZMQNotificationInterface
Github-Pull: #32187
Rebased-From: fa69c42fdf
2025-05-06 18:04:27 +01:00
Hennadii Stepanov
64552c83b2 ci: Add workaround for vcpkg's libevent package
This change is necessary for Windows GHA images, which provide
CMake >= 4.0.

Github-Pull: #32184
Rebased-From: ef00a28414
2025-05-06 18:04:27 +01:00
Brandon Odiwuor
85f3e1de68 test: Handle empty string returned by CLI as None in RPC tests
Github-Pull: #32286
Rebased-From: a4041c77f0
2025-05-06 18:04:27 +01:00
laanwj
ca70d5cb25 Remove support for RNDR/RNDRRS for aarch64 on Linux
This hardware feature is

- rarely supported on SoCs (and broken on like half of the chips that support it in the first place) (#31817)
- apparently not compiled into the release binary (https://github.com/bitcoin/bitcoin/issues/31817#issuecomment-2795885962)
- hard to test in CI, due to unavailable of hardware

Better to remove it.

This reverts commit aee5404e02.

Closes #31817.

Github-Pull: #32248
Rebased-From: 7749d929a0
2025-05-06 18:04:27 +01:00
merge-script
3fad438b83 Merge bitcoin/bitcoin#32352: [29.x] qt: 29.1 translations update
fc60337733 qt: 29.1 translations update (Hennadii Stepanov)

Pull request description:

  This PR fetches the recent translation updates from Transifex.

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

  **Notes for reviewers:**

  1. "fr_CM" and "fr_LU" have been dropped as part of [phasing out of territory-specific translations](https://app.transifex.com/bitcoin/communication/d:402657d1-6254-4ce9-8d26-e7827652c627/?q=project%3Abitcoin).

  2. The translations for the following languages, which appear to be the result of a mistake or an act of vandalism, have been discarded (also see https://github.com/bitcoin/bitcoin/pull/32004):
      - Czech (cs)
      - Danish (da)
      - Dutch (nl)
      - Vietnamese (vi)

  3. Update for Silesian (szl) has been discarded as malicious.

ACKs for top commit:
  laanwj:
    ACK fc60337733

Tree-SHA512: 0003a3ec67553f046ac8f98f61fd799cdcdac731f417e936af6782f8559270cc4f4fa40ffd8de5b40d7988d674dbac7eab73879aec974433bdf61a7790efd2a4
2025-05-06 18:03:01 +01:00
Hennadii Stepanov
fc60337733 qt: 29.1 translations update 2025-05-02 11:43:10 +01:00
merge-script
f490f5562d Merge bitcoin/bitcoin#32252: [29.x] doc: minor rel notes changes
87e53781f7 doc: minor rel notes changes (fanquake)

Pull request description:

  Remove two unused headers.
  Remove the empty-template, as point releases will modify `release-notes.md`.

ACKs for top commit:
  jonatack:
    LGTM ACK 87e53781f7
  janb84:
    ACK [87e5378](87e53781f7)

Tree-SHA512: 69ff0d7863c1598ab2b4daf2a7f9ca3edae513a7d5ebb85aa1b468150cfd17da2f503ac0a41dc77fe04c3670cb7d58df46b00837d08aad624f024756f575fca1
2025-04-11 16:20:13 +01:00
fanquake
87e53781f7 doc: minor rel notes changes
Remove two unused headers.
Remove the empty-template, as point releases will modify release-notes.md.
2025-04-11 16:00:42 +01:00
merge-script
56ed476a29 Merge bitcoin/bitcoin#32241: [29.x] 29.0 final changes
977db54233 [doc] update man pages for 29.0 (glozow)
190e718e83 [build] bump to 29.0 final (glozow)
50108104d7 [doc] copy over Release Notes draft from wiki (glozow)

Pull request description:

  There weren't any reports from rc2 and rc3 binaries have been up since April 2 (1 week ago).

ACKs for top commit:
  hebasto:
    ACK 977db54233.
  janb84:
    ACK [977db54](977db54233)
  laanwj:
    ACK 977db54233

Tree-SHA512: f0dee957c56a7b24cc361b0450efeaaad5ead6401ba649f8af6cf5cb464fea4357e1eaedaaa80accdeb18d47321a604979c43be57e14aa3ae5603d083e7df250
2025-04-11 15:55:48 +01:00
glozow
977db54233 [doc] update man pages for 29.0 2025-04-09 11:34:37 -04:00
glozow
190e718e83 [build] bump to 29.0 final 2025-04-09 11:34:37 -04:00
glozow
50108104d7 [doc] copy over Release Notes draft from wiki 2025-04-09 11:34:37 -04:00
merge-script
1344d3bd0f Merge bitcoin/bitcoin#32136: [29.x] backports and 29.0rc3
f80ab9a5d8 [doc] update man pages for 29.0rc3 (glozow)
7c05ef5673 [build] bump to 29.0rc3 (glozow)
c0756b758f depends: set CMAKE_*_COMPILER_TARGET in toolchain (fanquake)
477345207b cmake: Add `NO_CACHE_IF_FAILED` option for checking linker flags (Hennadii Stepanov)
7bc7af9951 fuzz: extract unsequenced operations with side-effects (Lőrinc)
288163ea0f fuzz: Fix off-by-one in package_rbf target (MarcoFalke)
a3060483fa test: avoid disk space warning for non-regtest (Sjors Provoost)

Pull request description:

  Backports + final changes for 29.0rc3.

  Backports:
  - #32057
  - #32122
  - #32141
  - #32027
  - #31849

ACKs for top commit:
  hebasto:
    ACK f80ab9a5d8, I've verified back-ports locally and reviewed release related changes.
  fanquake:
    ACK f80ab9a5d8

Tree-SHA512: 15c882eac98825c41859859af1621e63a5b9d98f3b492c451c14f2d2232220dfa8d1ef933adae773918e188c6ade085f254f2853ff078bf1f99b8cd77facb182
2025-04-01 19:59:46 +08:00
glozow
f80ab9a5d8 [doc] update man pages for 29.0rc3 2025-03-28 14:56:29 -04:00
glozow
7c05ef5673 [build] bump to 29.0rc3 2025-03-28 14:37:09 -04:00
fanquake
c0756b758f depends: set CMAKE_*_COMPILER_TARGET in toolchain
According to the CMake docs, this is the correct way to setup a
toolchain file for cross-compilation using Clang. See
https://cmake.org/cmake/help/latest/manual/cmake-toolchains.7.html#cross-compiling-using-clang

Internally it looks like CMake will only take this variable into account
if it detects the compiler to be Clang, so this shouldn't effect other
builds, but in the case of our Apple cross builds, we'd end up with a
duplicated `--target=arm64-apple-darwin` on the compiler line, given we
are already setting `--target` for Darwin builds.

Would fix #31748.

Github-Pull: #31849
Rebased-From: 963355037f
2025-03-28 14:24:37 -04:00
Hennadii Stepanov
477345207b cmake: Add NO_CACHE_IF_FAILED option for checking linker flags
Use it for checking `-fsanitize`.

This change improves the user experience when the configuration step
fails due to a missing library. Now, there is no need to manually clean
the CMake cache after installing the required library.

Github-Pull: #32027
Rebased-From: 52ac17757e
2025-03-28 14:24:09 -04:00
Lőrinc
7bc7af9951 fuzz: extract unsequenced operations with side-effects
https://github.com/bitcoin/bitcoin/pull/30746#discussion_r1817851827 introduced an unsequenced operations with side-effects - which is undefined behavior, i.e. the right hand side can be evaluated before the left hand side, which happens to mutate it.

Tried:
```
clang++ --analyze -std=c++20 -I./src -I./src/test -I./src/test/fuzz src/test/fuzz/base_encode_decode.cpp src/psbt.cpp
```
but it didn't warn about UB.

Grepped for similar ones, but could find any other one in the codebase:
> grep -rnE --include='*.cpp' --include='*.h' '\b(\w+)\(([^)]*\b(\w+)\b[^)]*)\)\s*==\s*\3\.' .
```
./src/test/arith_uint256_tests.cpp:373:    BOOST_CHECK(R1L.GetHex() == R1L.ToString());
./src/test/arith_uint256_tests.cpp:374:    BOOST_CHECK(R2L.GetHex() == R2L.ToString());
./src/test/arith_uint256_tests.cpp:375:    BOOST_CHECK(OneL.GetHex() == OneL.ToString());
./src/test/arith_uint256_tests.cpp:376:    BOOST_CHECK(MaxL.GetHex() == MaxL.ToString());
./src/test/fuzz/cluster_linearize.cpp:565:        assert(depgraph.FeeRate(best_anc.transactions) == best_anc.feerate);
./src/test/fuzz/cluster_linearize.cpp:646:        assert(depgraph.FeeRate(found.transactions) == found.feerate);
./src/test/fuzz/cluster_linearize.cpp:765:            assert(depgraph.FeeRate(chunk_info.transactions) == chunk_info.feerate);
./src/test/fuzz/base_encode_decode.cpp:95:    assert(DecodeBase64PSBT(psbt, random_string, error) == error.empty());
./src/test/fuzz/key.cpp:102:        assert(pubkey.data() == pubkey.begin());
./src/test/skiplist_tests.cpp:42:        BOOST_CHECK(vIndex[from].GetAncestor(0) == vIndex.data());
./src/script/signingprovider.cpp:535:                   ComputeTapbranchHash(node.sub[1]->hash, node.sub[1]->hash) == node.hash) {
./src/pubkey.h:78:      return vch.size() > 0 && GetLen(vch[0]) == vch.size();
./src/cluster_linearize.h:881:            Assume(elem.inc.feerate.IsEmpty() == elem.pot_feerate.IsEmpty());
```

Hodlinator deduced the UB on Windows in https://github.com/bitcoin/bitcoin/issues/32135#issuecomment-2751723855

Github-Pull: #32141
Rebased-From: b1de59e896

Co-authored-by: Hodlinator <172445034+hodlinator@users.noreply.github.com>
2025-03-28 14:23:42 -04:00
MarcoFalke
288163ea0f fuzz: Fix off-by-one in package_rbf target
Github-Pull: #32122
Rebased-From: fa5674c264
2025-03-25 16:58:12 -04:00
Sjors Provoost
a3060483fa test: avoid disk space warning for non-regtest
feature_config_args.py incorrectly assumed that its testnet4 node
would not log a disk space warning.

0683b8ebf3 increased m_assumed_blockchain_size
on testnet4 from 1 to 11 GiB which triggers this bug on more
systems, e.g. a RAM disk.

Prevent the warning by setting -prune for these nodes.

Fix the same issue in feature_signet.py

Github-Pull: #32057
Rebased-From: 20fe41e9e8
2025-03-25 10:31:08 -04:00
merge-script
d6db87165c Merge bitcoin/bitcoin#32062: [29.x] backports and rc2
74df31cb0b [doc] update example bitcoin.conf with missing options (glozow)
8082f88d1a [doc] update man pages for 29.0rc2 (glozow)
472d582bfe [build] bump to 29.0rc2 (glozow)
a4c30bd00a qt: doc: adapt outdated binary paths to CMake changes (Sebastian Falbesoner)
4e438d326e build: use make < 3.82 syntax for define directive (Sjors Provoost)
7ff0b02161 build: Remove manpages when making MacOS app (Ava Chow)
5ebcb59fdb test: fix intermittent failure in p2p_orphan_handling.py (Martin Zumsande)
458655bca8 fuzz: make sure DecodeBase58(Check) is called with valid values more often (Lőrinc)
15ecae31a8 fuzz: Always restrict base conversion input lengths (Lőrinc)
80c5d57bd1 contrib: Fix `gen-bitcoin-conf.sh`. (David Gumberg)

Pull request description:

  backports:
  - #32049
  - #32063
  - #32064
  - #32070
  - #31917

ACKs for top commit:
  Sjors:
    ACK 74df31cb0b
  hebasto:
    ACK 74df31cb0b, I have reviewed the code and it looks OK.
  ismaelsadeeq:
    Code review ACK 74df31cb0b

Tree-SHA512: df4ef832a03c9c3f89d30d3f65d81b7c7e4793d2cad8a269f1ff221454a4b0b05e06109f4556926c1c4f7fcbd2537052b4d58b4b3911dfcfc35726c600b587d9
2025-03-18 08:38:18 +08:00
glozow
74df31cb0b [doc] update example bitcoin.conf with missing options 2025-03-17 06:16:22 -04:00
glozow
8082f88d1a [doc] update man pages for 29.0rc2 2025-03-17 06:16:22 -04:00
glozow
472d582bfe [build] bump to 29.0rc2 2025-03-17 06:16:22 -04:00
Sebastian Falbesoner
a4c30bd00a qt: doc: adapt outdated binary paths to CMake changes
Github-Pull: bitcoin-core/gui#858
Rebased-From: 7ebc458a8c
2025-03-17 06:16:03 -04:00
Sjors Provoost
4e438d326e 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

Github-Pull: #32070
Rebased-From: 9157d9e449

Co-authored-by: Ryan Ofsky <ryan@ofsky.org>
2025-03-16 22:07:20 -04:00
Ava Chow
7ff0b02161 build: Remove manpages when making MacOS app
Github-Pull: #32064
Rebased-From: 80b5e7f2cb
2025-03-16 22:07:20 -04:00
Martin Zumsande
5ebcb59fdb test: fix intermittent failure in p2p_orphan_handling.py
If we bump the mocktime before the node has successfully disconnected
the peer, the requests for both parents could be spread over
two GETDATAS, which would make the test fail.

Github-Pull: #32063
Rebased-From: 02942056fd
2025-03-16 22:07:20 -04:00
Lőrinc
458655bca8 fuzz: make sure DecodeBase58(Check) is called with valid values more often
In Base58 fuzz the two roundtrips are merged now, the new `decode_input` switches between a completely random input and a valid encoded one, to make sure the decoding passes more often.
The `max_ret_len` can also exceed the original length now and is being validated more thoroughly.

Github-Pull: #31917
Rebased-From: d5537c18a9

Co-authored-by: maflcko <6399679+maflcko@users.noreply.github.com>
Co-authored-by: marcofleon <marleo23@proton.me>
2025-03-16 22:07:20 -04:00
Lőrinc
15ecae31a8 fuzz: Always restrict base conversion input lengths
They seem to cause timeouts:
> Issue 397734700: bitcoin-core:base58check_encode_decode: Timeout in base58check_encode_decode

The `encoded_string.empty()` check was corrected here to `decoded.empty()` to make sure the `(0, decoded.size() - 1)` range is always valid.

Github-Pull: #31917
Rebased-From: bad1433ef2

Co-authored-by: maflcko <6399679+maflcko@users.noreply.github.com>
Co-authored-by: marcofleon <marleo23@proton.me>
Co-authored-by: Martin Zumsande <mzumsande@gmail.com>
2025-03-16 22:07:20 -04:00
David Gumberg
80c5d57bd1 contrib: Fix gen-bitcoin-conf.sh.
In #31118, the format of bitcoind's `--help` output changed slightly in
a way that breaks `gen-bitcoin-conf.sh`, modify the script to accomodate
the new format, by starting after the line that says "Options:" and
strip the `-help` option and its description from the output.

Github-Pull: #32049
Rebased-From: a24419f8be
2025-03-13 17:06:10 -04:00
merge-script
e9e6825b8c Merge bitcoin/bitcoin#32046: [29.x] bump to v29.0rc1
47e2fa86dc [doc] release notes link for 29.0 (glozow)
21f423939e [examples] generate example bitcoin.conf (glozow)
86a3ce6209 [doc] update man pages for 29.0rc1 (glozow)
95c21b1fdd [build] bump version to 29.0rc1 (glozow)
153bd443ec [build] bump CLIENT_VERSION_MAJOR to 29 (glozow)

Pull request description:

  - "backport" #32041
  - bump version to v29.0rc1
  - generate manpages
  - add example bitcoin.conf
  - add release-notes.md pointing to wiki

ACKs for top commit:
  achow101:
    ACK 47e2fa86dc
  davidgumberg:
    ACK 47e2fa86dc
  hebasto:
    ACK 47e2fa86dc.

Tree-SHA512: 4e4eec31ab12990d933b6313950e779b7b58fc349f294f59d2504a8db3c28d5dea64b79e588e2c0fe62836db306fb4c3fb3fcd7bd1f51350e880370cec3437d6
2025-03-13 11:49:25 +08:00
glozow
47e2fa86dc [doc] release notes link for 29.0 2025-03-12 15:09:22 -04:00
glozow
21f423939e [examples] generate example bitcoin.conf 2025-03-12 15:09:22 -04:00
glozow
86a3ce6209 [doc] update man pages for 29.0rc1 2025-03-12 15:02:24 -04:00
glozow
95c21b1fdd [build] bump version to 29.0rc1 2025-03-12 13:48:01 -04:00
glozow
153bd443ec [build] bump CLIENT_VERSION_MAJOR to 29
Github-Pull: #32041
Rebased-From: a3f0e9a
2025-03-12 13:47:38 -04:00
246 changed files with 9767 additions and 11926 deletions

View File

@@ -1,214 +0,0 @@
env: # Global defaults
CIRRUS_CLONE_DEPTH: 1
CIRRUS_LOG_TIMESTAMP: true
MAKEJOBS: "-j10"
TEST_RUNNER_PORT_MIN: "14000" # Must be larger than 12321, which is used for the http cache. See https://cirrus-ci.org/guide/writing-tasks/#http-cache
CI_FAILFAST_TEST_LEAVE_DANGLING: "1" # Cirrus CI does not care about dangling processes and setting this variable avoids killing the CI script itself on error
# A self-hosted machine(s) can be used via Cirrus CI. It can be configured with
# multiple users to run tasks in parallel. No sudo permission is required.
#
# https://cirrus-ci.org/guide/persistent-workers/
#
# Generally, a persistent worker must run Ubuntu 23.04+ or Debian 12+.
#
# The following specific types should exist, with the following requirements:
# - small: For an x86_64 machine, with at least 2 vCPUs and 8 GB of memory.
# - medium: For an x86_64 machine, with at least 4 vCPUs and 16 GB of memory.
# - arm64: For an aarch64 machine, with at least 2 vCPUs and 8 GB of memory.
#
# CI jobs for the latter configuration can be run on x86_64 hardware
# by installing qemu-user-static, which works out of the box with
# podman or docker. Background: https://stackoverflow.com/a/72890225/313633
#
# The above machine types are matched to each task by their label. Refer to the
# Cirrus CI docs for more details.
#
# When a contributor maintains a fork of the repo, any pull request they make
# to their own fork, or to the main repository, will trigger two CI runs:
# one for the branch push and one for the pull request.
# This can be avoided by setting SKIP_BRANCH_PUSH=true as a custom env variable
# in Cirrus repository settings, accessible from
# https://cirrus-ci.com/github/my-organization/my-repository
#
# On machines that are persisted between CI jobs, RESTART_CI_DOCKER_BEFORE_RUN=1
# ensures that previous containers and artifacts are cleared before each run.
# This requires installing Podman instead of Docker.
#
# Futhermore:
# - podman-docker-4.1+ is required due to the bugfix in 4.1
# (https://github.com/bitcoin/bitcoin/pull/21652#issuecomment-1657098200)
# - The ./ci/ dependencies (with cirrus-cli) should be installed. One-liner example
# for a single user setup with sudo permission:
#
# ```
# apt update && apt install git screen python3 bash podman-docker uidmap slirp4netns curl -y && curl -L -o cirrus "https://github.com/cirruslabs/cirrus-cli/releases/latest/download/cirrus-linux-$(dpkg --print-architecture)" && mv cirrus /usr/local/bin/cirrus && chmod +x /usr/local/bin/cirrus
# ```
#
# - There are no strict requirements on the hardware. Having fewer CPU threads
# than recommended merely causes the CI script to run slower.
# To avoid rare and intermittent OOM due to short memory usage spikes,
# it is recommended to add (and persist) swap:
#
# ```
# fallocate -l 16G /swapfile_ci && chmod 600 /swapfile_ci && mkswap /swapfile_ci && swapon /swapfile_ci && ( echo '/swapfile_ci none swap sw 0 0' | tee -a /etc/fstab )
# ```
#
# - To register the persistent worker, open a `screen` session and run:
#
# ```
# RESTART_CI_DOCKER_BEFORE_RUN=1 screen cirrus worker run --labels type=todo_fill_in_type --token todo_fill_in_token
# ```
# https://cirrus-ci.org/guide/tips-and-tricks/#sharing-configuration-between-tasks
filter_template: &FILTER_TEMPLATE
# Allow forks to specify SKIP_BRANCH_PUSH=true and skip CI runs when a branch is pushed,
# but still run CI when a PR is created.
# https://cirrus-ci.org/guide/writing-tasks/#conditional-task-execution
skip: $SKIP_BRANCH_PUSH == "true" && $CIRRUS_PR == ""
stateful: false # https://cirrus-ci.org/guide/writing-tasks/#stateful-tasks
base_template: &BASE_TEMPLATE
<< : *FILTER_TEMPLATE
merge_base_script:
# Require git (used in fingerprint_script).
- git --version || ( apt-get update && apt-get install -y git )
- if [ "$CIRRUS_PR" = "" ]; then exit 0; fi
- git fetch --depth=1 $CIRRUS_REPO_CLONE_URL "pull/${CIRRUS_PR}/merge"
- git checkout FETCH_HEAD # Use merged changes to detect silent merge conflicts
# Also, the merge commit is used to lint COMMIT_RANGE="HEAD~..HEAD"
main_template: &MAIN_TEMPLATE
timeout_in: 120m # https://cirrus-ci.org/faq/#instance-timed-out
ci_script:
- ./ci/test_run_all.sh
global_task_template: &GLOBAL_TASK_TEMPLATE
<< : *BASE_TEMPLATE
<< : *MAIN_TEMPLATE
compute_credits_template: &CREDITS_TEMPLATE
# https://cirrus-ci.org/pricing/#compute-credits
# Only use credits for pull requests to the main repo
use_compute_credits: $CIRRUS_REPO_FULL_NAME == 'bitcoin/bitcoin' && $CIRRUS_PR != ""
task:
name: 'lint'
<< : *BASE_TEMPLATE
container:
image: debian:bookworm
cpu: 1
memory: 1G
# For faster CI feedback, immediately schedule the linters
<< : *CREDITS_TEMPLATE
test_runner_cache:
folder: "/lint_test_runner"
fingerprint_script: echo $CIRRUS_TASK_NAME $(git rev-parse HEAD:test/lint/test_runner)
python_cache:
folder: "/python_build"
fingerprint_script: cat .python-version /etc/os-release
unshallow_script:
- git fetch --unshallow --no-tags
lint_script:
- ./ci/lint_run_all.sh
task:
name: 'tidy'
<< : *GLOBAL_TASK_TEMPLATE
persistent_worker:
labels:
type: medium
env:
FILE_ENV: "./ci/test/00_setup_env_native_tidy.sh"
task:
name: 'ARM, unit tests, no functional tests'
<< : *GLOBAL_TASK_TEMPLATE
persistent_worker:
labels:
type: arm64 # Use arm64 worker to sidestep qemu and avoid a slow CI: https://github.com/bitcoin/bitcoin/pull/28087#issuecomment-1649399453
env:
FILE_ENV: "./ci/test/00_setup_env_arm.sh"
task:
name: 'Win64-cross'
<< : *GLOBAL_TASK_TEMPLATE
persistent_worker:
labels:
type: small
env:
FILE_ENV: "./ci/test/00_setup_env_win64.sh"
task:
name: 'CentOS, depends, gui'
<< : *GLOBAL_TASK_TEMPLATE
persistent_worker:
labels:
type: small
env:
FILE_ENV: "./ci/test/00_setup_env_native_centos.sh"
task:
name: 'previous releases, depends DEBUG'
<< : *GLOBAL_TASK_TEMPLATE
persistent_worker:
labels:
type: small
env:
FILE_ENV: "./ci/test/00_setup_env_native_previous_releases.sh"
task:
name: 'TSan, depends, gui'
<< : *GLOBAL_TASK_TEMPLATE
persistent_worker:
labels:
type: medium
env:
FILE_ENV: "./ci/test/00_setup_env_native_tsan.sh"
task:
name: 'MSan, depends'
<< : *GLOBAL_TASK_TEMPLATE
persistent_worker:
labels:
type: small
timeout_in: 300m # Use longer timeout for the *rare* case where a full build (llvm + msan + depends + ...) needs to be done.
env:
FILE_ENV: "./ci/test/00_setup_env_native_msan.sh"
task:
name: 'fuzzer,address,undefined,integer, no depends'
<< : *GLOBAL_TASK_TEMPLATE
persistent_worker:
labels:
type: medium
timeout_in: 240m # larger timeout, due to the high CPU demand
env:
FILE_ENV: "./ci/test/00_setup_env_native_fuzz.sh"
task:
name: 'multiprocess, i686, DEBUG'
<< : *GLOBAL_TASK_TEMPLATE
persistent_worker:
labels:
type: medium
env:
FILE_ENV: "./ci/test/00_setup_env_i686_multiprocess.sh"
task:
name: 'no wallet, libbitcoinkernel'
<< : *GLOBAL_TASK_TEMPLATE
persistent_worker:
labels:
type: small
env:
FILE_ENV: "./ci/test/00_setup_env_native_nowallet_libbitcoinkernel.sh"
task:
name: 'macOS-cross, gui, no tests'
<< : *GLOBAL_TASK_TEMPLATE
persistent_worker:
labels:
type: small
env:
FILE_ENV: "./ci/test/00_setup_env_mac_cross.sh"

View File

@@ -0,0 +1,56 @@
name: 'Configure Docker'
description: 'Set up Docker build driver and configure build cache args'
inputs:
use-cirrus:
description: 'Use cirrus cache'
required: true
runs:
using: 'composite'
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
# Use host network to allow access to cirrus gha cache running on the host
driver-opts: |
network=host
# This is required to allow buildkit to access the actions cache
- name: Expose actions cache variables
uses: actions/github-script@v6
with:
script: |
Object.keys(process.env).forEach(function (key) {
if (key.startsWith('ACTIONS_')) {
core.info(`Exporting ${key}`);
core.exportVariable(key, process.env[key]);
}
});
- name: Construct docker build cache args
shell: bash
run: |
# Configure docker build cache backend
#
# On forks the gha cache will work but will use Github's cache backend.
# Docker will check for variables $ACTIONS_CACHE_URL, $ACTIONS_RESULTS_URL and $ACTIONS_RUNTIME_TOKEN
# which are set automatically when running on GitHub infra: https://docs.docker.com/build/cache/backends/gha/#synopsis
# Use cirrus cache host
if [[ ${{ inputs.use-cirrus }} == 'true' ]]; then
url_args="url=${CIRRUS_CACHE_HOST},url_v2=${CIRRUS_CACHE_HOST}"
else
url_args=""
fi
# Always optimistically --cachefrom in case a cache blob exists
args=(--cache-from "type=gha${url_args:+,${url_args}},scope=${CONTAINER_NAME}")
# If this is a push to the default branch, also add --cacheto to save the cache
if [[ ${{ github.event_name }} == "push" && ${{ github.ref_name }} == ${{ github.event.repository.default_branch }} ]]; then
args+=(--cache-to "type=gha${url_args:+,${url_args}},mode=max,ignore-error=true,scope=${CONTAINER_NAME}")
fi
# Always `--load` into docker images (needed when using the `docker-container` build driver).
args+=(--load)
echo "DOCKER_BUILD_CACHE_ARG=${args[*]}" >> $GITHUB_ENV

View File

@@ -0,0 +1,27 @@
name: 'Configure environment'
description: 'Configure CI, cache and container name environment variables'
runs:
using: 'composite'
steps:
- name: Set CI and cache directories
shell: bash
run: |
echo "BASE_ROOT_DIR=${{ runner.temp }}" >> "$GITHUB_ENV"
echo "BASE_BUILD_DIR=${{ runner.temp }}/build" >> "$GITHUB_ENV"
echo "CCACHE_DIR=${{ runner.temp }}/ccache_dir" >> $GITHUB_ENV
echo "DEPENDS_DIR=${{ runner.temp }}/depends" >> "$GITHUB_ENV"
echo "BASE_CACHE=${{ runner.temp }}/depends/built" >> $GITHUB_ENV
echo "SOURCES_PATH=${{ runner.temp }}/depends/sources" >> $GITHUB_ENV
echo "PREVIOUS_RELEASES_DIR=${{ runner.temp }}/previous_releases" >> $GITHUB_ENV
- name: Set cache hashes
shell: bash
run: |
echo "DEPENDS_HASH=$(git ls-tree HEAD depends "$FILE_ENV" | sha256sum | cut -d' ' -f1)" >> $GITHUB_ENV
echo "PREVIOUS_RELEASES_HASH=$(git ls-tree HEAD test/get_previous_releases.py | sha256sum | cut -d' ' -f1)" >> $GITHUB_ENV
- name: Get container name
shell: bash
run: |
source $FILE_ENV
echo "CONTAINER_NAME=$CONTAINER_NAME" >> "$GITHUB_ENV"

View File

@@ -0,0 +1,47 @@
name: 'Restore Caches'
description: 'Restore ccache, depends sources, and built depends caches'
runs:
using: 'composite'
steps:
- name: Restore Ccache cache
id: ccache-cache
uses: cirruslabs/cache/restore@v4
with:
path: ${{ env.CCACHE_DIR }}
key: ccache-${{ env.CONTAINER_NAME }}-${{ github.run_id }}
restore-keys: |
ccache-${{ env.CONTAINER_NAME }}-
- name: Restore depends sources cache
id: depends-sources
uses: cirruslabs/cache/restore@v4
with:
path: ${{ env.SOURCES_PATH }}
key: depends-sources-${{ env.CONTAINER_NAME }}-${{ env.DEPENDS_HASH }}
restore-keys: |
depends-sources-${{ env.CONTAINER_NAME }}-
- name: Restore built depends cache
id: depends-built
uses: cirruslabs/cache/restore@v4
with:
path: ${{ env.BASE_CACHE }}
key: depends-built-${{ env.CONTAINER_NAME }}-${{ env.DEPENDS_HASH }}
restore-keys: |
depends-built-${{ env.CONTAINER_NAME }}-
- name: Restore previous releases cache
id: previous-releases
uses: cirruslabs/cache/restore@v4
with:
path: ${{ env.PREVIOUS_RELEASES_DIR }}
key: previous-releases-${{ env.CONTAINER_NAME }}-${{ env.PREVIOUS_RELEASES_HASH }}
restore-keys: |
previous-releases-${{ env.CONTAINER_NAME }}-
- name: export cache hits
shell: bash
run: |
echo "depends-sources-cache-hit=${{ steps.depends-sources.outputs.cache-hit }}" >> $GITHUB_ENV
echo "depends-built-cache-hit=${{ steps.depends-built.outputs.cache-hit }}" >> $GITHUB_ENV
echo "previous-releases-cache-hit=${{ steps.previous-releases.outputs.cache-hit }}" >> $GITHUB_ENV

39
.github/actions/save-caches/action.yml vendored Normal file
View File

@@ -0,0 +1,39 @@
name: 'Save Caches'
description: 'Save ccache, depends sources, and built depends caches'
runs:
using: 'composite'
steps:
- name: debug cache hit inputs
shell: bash
run: |
echo "depends sources direct cache hit to primary key: ${{ env.depends-sources-cache-hit }}"
echo "depends built direct cache hit to primary key: ${{ env.depends-built-cache-hit }}"
echo "previous releases direct cache hit to primary key: ${{ env.previous-releases-cache-hit }}"
- name: Save Ccache cache
uses: cirruslabs/cache/save@v4
if: ${{ (github.event_name == 'push') && (github.ref_name == github.event.repository.default_branch) }}
with:
path: ${{ env.CCACHE_DIR }}
key: ccache-${{ env.CONTAINER_NAME }}-${{ github.run_id }}
- name: Save depends sources cache
uses: cirruslabs/cache/save@v4
if: ${{ (github.event_name == 'push') && (github.ref_name == github.event.repository.default_branch) && (env.depends-sources-cache-hit != 'true') }}
with:
path: ${{ env.SOURCES_PATH }}
key: depends-sources-${{ env.CONTAINER_NAME }}-${{ env.DEPENDS_HASH }}
- name: Save built depends cache
uses: cirruslabs/cache/save@v4
if: ${{ (github.event_name == 'push') && (github.ref_name == github.event.repository.default_branch) && (env.depends-built-cache-hit != 'true' )}}
with:
path: ${{ env.BASE_CACHE }}
key: depends-built-${{ env.CONTAINER_NAME }}-${{ env.DEPENDS_HASH }}
- name: Save previous releases cache
uses: cirruslabs/cache/save@v4
if: ${{ (github.event_name == 'push') && (github.ref_name == github.event.repository.default_branch) && (env.previous-releases-cache-hit != 'true' )}}
with:
path: ${{ env.PREVIOUS_RELEASES_DIR }}
key: previous-releases-${{ env.CONTAINER_NAME }}-${{ env.PREVIOUS_RELEASES_HASH }}

View File

@@ -19,9 +19,26 @@ concurrency:
env:
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'
CIRRUS_CACHE_HOST: http://127.0.0.1:12321/ # When using Cirrus Runners this host can be used by the docker `gha` build cache type.
REPO_USE_CIRRUS_RUNNERS: 'bitcoin/bitcoin' # Use cirrus runners and cache for this repo, instead of falling back to the slow GHA runners
jobs:
runners:
name: 'determine runners'
runs-on: ubuntu-latest
outputs:
use-cirrus-runners: ${{ steps.runners.outputs.use-cirrus-runners }}
steps:
- id: runners
run: |
if [[ "${REPO_USE_CIRRUS_RUNNERS}" == "${{ github.repository }}" ]]; then
echo "use-cirrus-runners=true" >> "$GITHUB_OUTPUT"
echo "::notice title=Runner Selection::Using Cirrus Runners"
else
echo "use-cirrus-runners=false" >> "$GITHUB_OUTPUT"
echo "::notice title=Runner Selection::Using GitHub-hosted runners"
fi
test-each-commit:
name: 'test each commit'
runs-on: ubuntu-24.04
@@ -106,8 +123,12 @@ jobs:
BASE_ROOT_DIR: ${{ github.workspace }}
steps:
- name: Checkout
uses: actions/checkout@v4
- &CHECKOUT
name: Checkout
uses: actions/checkout@v5
with:
# Ensure the latest merged pull request state is used, even on re-runs.
ref: &CHECKOUT_REF_TMPL ${{ github.event_name == 'pull_request' && github.ref || '' }}
- name: Clang version
run: |
@@ -175,8 +196,7 @@ jobs:
job-name: 'Win64 native fuzz, VS 2022'
steps:
- name: Checkout
uses: actions/checkout@v4
- *CHECKOUT
- name: Configure Developer Command Prompt for Microsoft Visual C++
# Using microsoft/setup-msbuild is not enough.
@@ -194,10 +214,12 @@ jobs:
Write-Host "PowerShell version $($PSVersionTable.PSVersion.ToString())"
- name: Using vcpkg with MSBuild
shell: bash
run: |
Set-Location "$env:VCPKG_INSTALLATION_ROOT"
Add-Content -Path "triplets\x64-windows.cmake" -Value "set(VCPKG_BUILD_TYPE release)"
Add-Content -Path "triplets\x64-windows-static.cmake" -Value "set(VCPKG_BUILD_TYPE release)"
echo "set(VCPKG_BUILD_TYPE release)" >> "${VCPKG_INSTALLATION_ROOT}/triplets/x64-windows.cmake"
echo "set(VCPKG_BUILD_TYPE release)" >> "${VCPKG_INSTALLATION_ROOT}/triplets/x64-windows-static.cmake"
# Workaround for libevent, which requires CMake 3.1 but is incompatible with CMake >= 4.0.
sed -i '1s/^/set(ENV{CMAKE_POLICY_VERSION_MINIMUM} 3.5)\n/' "${VCPKG_INSTALLATION_ROOT}/scripts/ports.cmake"
- name: vcpkg tools cache
uses: actions/cache@v4
@@ -263,44 +285,151 @@ jobs:
run: |
py -3 test\fuzz\test_runner.py --par %NUMBER_OF_PROCESSORS% --loglevel DEBUG %RUNNER_TEMP%\qa-assets\fuzz_corpora
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
ci-matrix:
name: ${{ matrix.name }}
needs: runners
runs-on: ${{ needs.runners.outputs.use-cirrus-runners == 'true' && matrix.cirrus-runner || matrix.fallback-runner }}
if: ${{ vars.SKIP_BRANCH_PUSH != 'true' || github.event_name == 'pull_request' }}
timeout-minutes: 120
timeout-minutes: ${{ matrix.timeout-minutes }}
env:
FILE_ENV: "./ci/test/00_setup_env_native_asan.sh"
DANGER_CI_ON_HOST_FOLDERS: 1
FILE_ENV: ${{ matrix.file-env }}
strategy:
fail-fast: false
matrix:
include:
- name: '32 bit ARM, unit tests, no functional tests'
cirrus-runner: 'ubuntu-24.04-arm' # Cirrus' Arm runners are Apple (with virtual Linux aarch64), which doesn't support 32-bit mode
fallback-runner: 'ubuntu-24.04-arm'
timeout-minutes: 120
file-env: './ci/test/00_setup_env_arm.sh'
- name: 'win64 Cross'
cirrus-runner: 'ghcr.io/cirruslabs/ubuntu-runner-amd64:24.04-sm'
fallback-runner: 'ubuntu-24.04'
timeout-minutes: 120
file-env: './ci/test/00_setup_env_win64.sh'
- name: 'ASan + LSan + UBSan + integer, no depends, USDT'
cirrus-runner: 'ghcr.io/cirruslabs/ubuntu-runner-amd64:24.04-md' # has to match container in ci/test/00_setup_env_native_asan.sh for tracing tools
fallback-runner: 'ubuntu-24.04'
timeout-minutes: 120
file-env: './ci/test/00_setup_env_native_asan.sh'
- name: 'macOS-cross, gui, no tests'
cirrus-runner: 'ghcr.io/cirruslabs/ubuntu-runner-amd64:24.04-sm'
fallback-runner: 'ubuntu-24.04'
timeout-minutes: 120
file-env: './ci/test/00_setup_env_mac_cross.sh'
- name: 'No wallet, libbitcoinkernel'
cirrus-runner: 'ghcr.io/cirruslabs/ubuntu-runner-amd64:24.04-sm'
fallback-runner: 'ubuntu-24.04'
timeout-minutes: 120
file-env: './ci/test/00_setup_env_native_nowallet_libbitcoinkernel.sh'
- name: 'i686, multiprocess, DEBUG'
cirrus-runner: 'ghcr.io/cirruslabs/ubuntu-runner-amd64:24.04-md'
fallback-runner: 'ubuntu-24.04'
timeout-minutes: 120
file-env: './ci/test/00_setup_env_i686_multiprocess.sh'
- name: 'fuzzer,address,undefined,integer, no depends'
cirrus-runner: 'ghcr.io/cirruslabs/ubuntu-runner-amd64:24.04-lg'
fallback-runner: 'ubuntu-24.04'
timeout-minutes: 240
file-env: './ci/test/00_setup_env_native_fuzz.sh'
- name: 'previous releases, depends DEBUG'
cirrus-runner: 'ghcr.io/cirruslabs/ubuntu-runner-amd64:24.04-md'
fallback-runner: 'ubuntu-24.04'
timeout-minutes: 120
file-env: './ci/test/00_setup_env_native_previous_releases.sh'
- name: 'CentOS, depends, gui'
cirrus-runner: 'ghcr.io/cirruslabs/ubuntu-runner-amd64:24.04-lg'
fallback-runner: 'ubuntu-24.04'
timeout-minutes: 120
file-env: './ci/test/00_setup_env_native_centos.sh'
- name: 'tidy'
cirrus-runner: 'ghcr.io/cirruslabs/ubuntu-runner-amd64:24.04-md'
fallback-runner: 'ubuntu-24.04'
timeout-minutes: 120
file-env: './ci/test/00_setup_env_native_tidy.sh'
- name: 'TSan, depends, no gui'
cirrus-runner: 'ghcr.io/cirruslabs/ubuntu-runner-amd64:24.04-md'
fallback-runner: 'ubuntu-24.04'
timeout-minutes: 120
file-env: './ci/test/00_setup_env_native_tsan.sh'
- name: 'MSan, depends'
cirrus-runner: 'ghcr.io/cirruslabs/ubuntu-runner-amd64:24.04-lg'
fallback-runner: 'ubuntu-24.04'
timeout-minutes: 120
file-env: './ci/test/00_setup_env_native_msan.sh'
steps:
- name: Checkout
uses: actions/checkout@v4
- *CHECKOUT
- name: Set CI directories
run: |
echo "CCACHE_DIR=${{ runner.temp }}/ccache_dir" >> "$GITHUB_ENV"
echo "BASE_ROOT_DIR=${{ runner.temp }}" >> "$GITHUB_ENV"
echo "BASE_BUILD_DIR=${{ runner.temp }}/build-asan" >> "$GITHUB_ENV"
- name: Configure environment
uses: ./.github/actions/configure-environment
- name: Restore Ccache cache
id: ccache-cache
uses: actions/cache/restore@v4
- name: Restore caches
id: restore-cache
uses: ./.github/actions/restore-caches
- name: Configure Docker
uses: ./.github/actions/configure-docker
with:
path: ${{ env.CCACHE_DIR }}
key: ${{ github.job }}-ccache-${{ github.run_id }}
restore-keys: ${{ github.job }}-ccache-
use-cirrus: ${{ needs.runners.outputs.use-cirrus-runners }}
- name: Enable bpfcc script
if: ${{ env.CONTAINER_NAME == 'ci_native_asan' }}
# 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: Set mmap_rnd_bits
if: ${{ env.CONTAINER_NAME == 'ci_native_tsan' || env.CONTAINER_NAME == 'ci_native_msan' }}
# Prevents crashes due to high ASLR entropy
run: sudo sysctl -w vm.mmap_rnd_bits=28
- 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'
- name: Save caches
uses: ./.github/actions/save-caches
lint:
name: 'lint'
needs: runners
runs-on: ${{ needs.runners.outputs.use-cirrus-runners == 'true' && 'ghcr.io/cirruslabs/ubuntu-runner-amd64:24.04-xs' || 'ubuntu-24.04' }}
if: ${{ vars.SKIP_BRANCH_PUSH != 'true' || github.event_name == 'pull_request' }}
timeout-minutes: 20
env:
CONTAINER_NAME: "bitcoin-linter"
steps:
- name: Checkout
uses: actions/checkout@v5
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 }}
ref: *CHECKOUT_REF_TMPL
fetch-depth: 0
- name: Configure Docker
uses: ./.github/actions/configure-docker
with:
use-cirrus: ${{ needs.runners.outputs.use-cirrus-runners }}
- name: CI script
run: |
set -o xtrace
docker buildx build -t "$CONTAINER_NAME" $DOCKER_BUILD_CACHE_ARG --file "./ci/lint_imagefile" .
CIRRUS_PR_FLAG=""
if [ "${{ github.event_name }}" = "pull_request" ]; then
CIRRUS_PR_FLAG="-e CIRRUS_PR=1"
fi
docker run --rm $CIRRUS_PR_FLAG -v "$(pwd)":/bitcoin "$CONTAINER_NAME"

View File

@@ -19,15 +19,19 @@ if(POLICY CMP0171)
cmake_policy(SET CMP0171 NEW)
endif()
# When adjusting CMake flag variables, we must not override those explicitly
# set by the user. These are a subset of the CACHE_VARIABLES property.
get_directory_property(precious_variables CACHE_VARIABLES)
#=============================
# Project / Package metadata
#=============================
set(CLIENT_NAME "Bitcoin Core")
set(CLIENT_VERSION_MAJOR 28)
set(CLIENT_VERSION_MINOR 99)
set(CLIENT_VERSION_MAJOR 29)
set(CLIENT_VERSION_MINOR 3)
set(CLIENT_VERSION_BUILD 0)
set(CLIENT_VERSION_RC 0)
set(CLIENT_VERSION_IS_RELEASE "false")
set(CLIENT_VERSION_RC 1)
set(CLIENT_VERSION_IS_RELEASE "true")
set(COPYRIGHT_YEAR "2025")
# During the enabling of the CXX and CXXOBJ languages, we modify
@@ -153,7 +157,7 @@ if(WITH_QRENCODE)
set(USE_QRCODE TRUE)
endif()
cmake_dependent_option(WITH_DBUS "Enable DBus support." ON "CMAKE_SYSTEM_NAME STREQUAL \"Linux\" AND BUILD_GUI" OFF)
cmake_dependent_option(WITH_DBUS "Enable DBus support." ON "NOT CMAKE_SYSTEM_NAME MATCHES \"(Windows|Darwin)\" AND BUILD_GUI" OFF)
option(WITH_MULTIPROCESS "Build multiprocess bitcoin-node and bitcoin-gui executables in addition to monolithic bitcoind and bitcoin-qt executables. Requires libmultiprocess library. Experimental." OFF)
if(WITH_MULTIPROCESS)
@@ -376,6 +380,7 @@ if(SANITIZERS)
int main() { return 0; }
"
RESULT_VAR linker_supports_sanitizers
NO_CACHE_IF_FAILED
)
if(NOT linker_supports_sanitizers)
message(FATAL_ERROR "Linker did not accept requested flags, you are missing required libraries.")
@@ -659,7 +664,7 @@ message(" external signer ..................... ${ENABLE_EXTERNAL_SIGNER}")
message(" ZeroMQ .............................. ${WITH_ZMQ}")
message(" USDT tracing ........................ ${WITH_USDT}")
message(" QR code (GUI) ....................... ${WITH_QRENCODE}")
message(" DBus (GUI, Linux only) .............. ${WITH_DBUS}")
message(" DBus (GUI) .......................... ${WITH_DBUS}")
message("Tests:")
message(" test_bitcoin ........................ ${BUILD_TESTS}")
message(" test_bitcoin-qt ..................... ${BUILD_GUI_TESTS}")

View File

@@ -1,6 +1,5 @@
{
"version": 3,
"cmakeMinimumRequired": {"major": 3, "minor": 21, "patch": 0},
"configurePresets": [
{
"name": "vs2022",

View File

@@ -70,7 +70,7 @@ Translations
------------
Changes to translations as well as new translations can be submitted to
[Bitcoin Core's Transifex page](https://www.transifex.com/bitcoin/bitcoin/).
[Bitcoin Core's Transifex page](https://explore.transifex.com/bitcoin/bitcoin/).
Translations are periodically pulled from Transifex and merged into the git repository. See the
[translation process](doc/translation_process.md) for details on how this works.

View File

@@ -1,8 +1,8 @@
## CI Scripts
# CI Scripts
This directory contains scripts for each build step in each build stage.
### Running a Stage Locally
## Running a Stage Locally
Be aware that the tests will be built and run in-place, so please run at your own risk.
If the repository is not a fresh git clone, you might have to clean files from previous builds or test runs first.
@@ -27,7 +27,7 @@ with a specific configuration,
env -i HOME="$HOME" PATH="$PATH" USER="$USER" bash -c 'FILE_ENV="./ci/test/00_setup_env_arm.sh" ./ci/test_run_all.sh'
```
### Configurations
## Configurations
The test files (`FILE_ENV`) are constructed to test a wide range of
configurations, rather than a single pass/fail. This helps to catch build
@@ -49,8 +49,32 @@ env -i HOME="$HOME" PATH="$PATH" USER="$USER" bash -c 'MAKEJOBS="-j1" FILE_ENV="
The files starting with `0n` (`n` greater than 0) are the scripts that are run
in order.
### Cache
## Cache
In order to avoid rebuilding all dependencies for each build, the binaries are
cached and reused when possible. Changes in the dependency-generator will
trigger cache-invalidation and rebuilds as necessary.
## Configuring a repository for CI
### Primary repository
To configure the primary repository, follow these steps:
1. Register with [Cirrus Runners](https://cirrus-runners.app/) and purchase runners.
2. Install the Cirrus Runners GitHub app against the GitHub organization.
3. Enable organisation-level runners to be used in public repositories:
1. `Org settings -> Actions -> Runner Groups -> Default -> Allow public repos`
4. Permit the following actions to run:
1. cirruslabs/cache/restore@\*
1. cirruslabs/cache/save@\*
1. docker/setup-buildx-action@\*
1. actions/github-script@\*
### Forked repositories
When used in a fork the CI will run on GitHub's free hosted runners by default.
In this case, due to GitHub's 10GB-per-repo cache size limitations caches will be frequently evicted and missed, but the workflows will run (slowly).
It is also possible to use your own Cirrus Runners in your own fork with an appropriate patch to the `REPO_USE_CIRRUS_RUNNERS` variable in ../.github/workflows/ci.yml
NB that Cirrus Runners only work at an organisation level, therefore in order to use your own Cirrus Runners, *the fork must be within your own organisation*.

View File

@@ -1,17 +0,0 @@
#!/usr/bin/env bash
#
# Copyright (c) 2019-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.
export LC_ALL=C.UTF-8
# Only used in .cirrus.yml. Refer to test/lint/README.md on how to run locally.
cp "./ci/retry/retry" "/ci_retry"
cp "./.python-version" "/.python-version"
mkdir --parents "/test/lint"
cp --recursive "./test/lint/test_runner" "/test/lint/"
set -o errexit; source ./ci/lint/04_install.sh
set -o errexit
./ci/lint/06_script.sh

View File

@@ -35,7 +35,7 @@ fi
echo "Fallback to default values in env (if not yet set)"
# The number of parallel jobs to pass down to make and test_runner.py
export MAKEJOBS=${MAKEJOBS:--j4}
export MAKEJOBS=${MAKEJOBS:--j$(if command -v nproc > /dev/null 2>&1; then nproc; else sysctl -n hw.logicalcpu; fi)}
# Whether to prefer BusyBox over GNU utilities
export USE_BUSY_BOX=${USE_BUSY_BOX:-false}

View File

@@ -8,6 +8,7 @@ export LC_ALL=C.UTF-8
# Homebrew's python@3.12 is marked as externally managed (PEP 668).
# Therefore, `--break-system-packages` is needed.
export CONTAINER_NAME="ci_mac_native" # macos does not use a container, but the env var is needed for logging
export PIP_PACKAGES="--break-system-packages zmq"
export GOAL="install"
export CMAKE_GENERATOR="Ninja"

View File

@@ -6,6 +6,7 @@
export LC_ALL=C.UTF-8
export CONTAINER_NAME="ci_mac_native_fuzz" # macos does not use a container, but the env var is needed for logging
export CMAKE_GENERATOR="Ninja"
export BITCOIN_CONFIG="-DBUILD_FOR_FUZZING=ON"
export CI_OS_NAME="macos"

View File

@@ -19,15 +19,15 @@ else
fi
export CONTAINER_NAME=ci_native_asan
export APT_LLVM_V="20"
export APT_LLVM_V="21"
export PACKAGES="systemtap-sdt-dev clang-${APT_LLVM_V} llvm-${APT_LLVM_V} libclang-rt-${APT_LLVM_V}-dev python3-zmq qtbase5-dev qttools5-dev qttools5-dev-tools libevent-dev libboost-dev libdb5.3++-dev libzmq3-dev libqrencode-dev libsqlite3-dev ${BPFCC_PACKAGE}"
export NO_DEPENDS=1
export GOAL="install"
export BITCOIN_CONFIG="\
-DWITH_USDT=ON -DWITH_ZMQ=ON -DWITH_BDB=ON -DWARN_INCOMPATIBLE_BDB=OFF -DBUILD_GUI=ON \
-DSANITIZERS=address,float-divide-by-zero,integer,undefined \
-DCMAKE_C_COMPILER=clang-${APT_LLVM_V} \
-DCMAKE_CXX_COMPILER=clang++-${APT_LLVM_V} \
-DCMAKE_C_COMPILER=clang \
-DCMAKE_CXX_COMPILER=clang++ \
-DCMAKE_C_FLAGS='-ftrivial-auto-var-init=pattern' \
-DCMAKE_CXX_FLAGS='-ftrivial-auto-var-init=pattern -Wno-error=deprecated-declarations' \
-DAPPEND_CXXFLAGS='-std=c++23' \

View File

@@ -8,7 +8,7 @@ export LC_ALL=C.UTF-8
export CONTAINER_NAME=ci_native_centos
export CI_IMAGE_NAME_TAG="quay.io/centos/centos:stream10"
export CI_BASE_PACKAGES="gcc-c++ glibc-devel libstdc++-devel ccache make git python3 python3-pip which patch xz procps-ng ksh rsync coreutils bison e2fsprogs cmake"
export CI_BASE_PACKAGES="gcc-c++ glibc-devel libstdc++-devel ccache make git python3 python3-pip which patch xz procps-ng rsync coreutils bison e2fsprogs cmake dash"
export PIP_PACKAGES="pyzmq"
export DEP_OPTS="DEBUG=1" # Temporarily enable a DEBUG=1 build to check for GCC-bug-117966 regressions. This can be removed once the minimum GCC version is bumped to 12 in the previous releases task, see https://github.com/bitcoin/bitcoin/issues/31436#issuecomment-2530717875
export GOAL="install"

View File

@@ -8,7 +8,7 @@ export LC_ALL=C.UTF-8
export CI_IMAGE_NAME_TAG="mirror.gcr.io/ubuntu:24.04"
export CONTAINER_NAME=ci_native_fuzz
export APT_LLVM_V="20"
export APT_LLVM_V="21"
export PACKAGES="clang-${APT_LLVM_V} llvm-${APT_LLVM_V} libclang-rt-${APT_LLVM_V}-dev libevent-dev libboost-dev libsqlite3-dev"
export NO_DEPENDS=1
export RUN_UNIT_TESTS=false
@@ -19,9 +19,8 @@ export CI_CONTAINER_CAP="--cap-add SYS_PTRACE" # If run with (ASan + LSan), the
export BITCOIN_CONFIG="\
-DBUILD_FOR_FUZZING=ON \
-DSANITIZERS=fuzzer,address,undefined,float-divide-by-zero,integer \
-DCMAKE_C_COMPILER=clang-${APT_LLVM_V} \
-DCMAKE_CXX_COMPILER=clang++-${APT_LLVM_V} \
-DCMAKE_C_COMPILER=clang \
-DCMAKE_CXX_COMPILER=clang++ \
-DCMAKE_C_FLAGS='-ftrivial-auto-var-init=pattern' \
-DCMAKE_CXX_FLAGS='-ftrivial-auto-var-init=pattern' \
"
export LLVM_SYMBOLIZER_PATH="/usr/bin/llvm-symbolizer-${APT_LLVM_V}"

View File

@@ -7,14 +7,16 @@
export LC_ALL=C.UTF-8
export CI_IMAGE_NAME_TAG="mirror.gcr.io/ubuntu:24.04"
LIBCXX_DIR="/msan/cxx_build/"
export APT_LLVM_V="21"
LIBCXX_DIR="/cxx_build/"
export MSAN_FLAGS="-fsanitize=memory -fsanitize-memory-track-origins=2 -fno-omit-frame-pointer -g -O1 -fno-optimize-sibling-calls"
LIBCXX_FLAGS="-nostdinc++ -nostdlib++ -isystem ${LIBCXX_DIR}include/c++/v1 -L${LIBCXX_DIR}lib -Wl,-rpath,${LIBCXX_DIR}lib -lc++ -lc++abi -lpthread -Wno-unused-command-line-argument"
# -lstdc++ to resolve link issues due to upstream packaging
LIBCXX_FLAGS="-nostdinc++ -nostdlib++ -isystem ${LIBCXX_DIR}include/c++/v1 -L${LIBCXX_DIR}lib -Wl,-rpath,${LIBCXX_DIR}lib -lc++ -lc++abi -lpthread -Wno-unused-command-line-argument -lstdc++"
export MSAN_AND_LIBCXX_FLAGS="${MSAN_FLAGS} ${LIBCXX_FLAGS}"
export CONTAINER_NAME="ci_native_fuzz_msan"
export PACKAGES="ninja-build"
# BDB generates false-positives and will be removed in future
export PACKAGES="ninja-build clang-${APT_LLVM_V} llvm-${APT_LLVM_V} llvm-${APT_LLVM_V}-dev libclang-${APT_LLVM_V}-dev libclang-rt-${APT_LLVM_V}-dev"
export DEP_OPTS="DEBUG=1 NO_BDB=1 NO_QT=1 CC=clang CXX=clang++ CFLAGS='${MSAN_FLAGS}' CXXFLAGS='${MSAN_AND_LIBCXX_FLAGS}'"
export GOAL="all"
# Setting CMAKE_{C,CXX}_FLAGS_DEBUG flags to an empty string ensures that the flags set in MSAN_FLAGS remain unaltered.
@@ -27,7 +29,7 @@ export BITCOIN_CONFIG="\
-DSANITIZERS=fuzzer,memory \
-DAPPEND_CPPFLAGS='-DBOOST_MULTI_INDEX_ENABLE_SAFE_MODE -U_FORTIFY_SOURCE' \
"
export USE_MEMORY_SANITIZER="true"
export USE_INSTRUMENTED_LIBCPP="MemoryWithOrigins"
export RUN_UNIT_TESTS="false"
export RUN_FUNCTIONAL_TESTS="false"
export RUN_FUZZ_TESTS=true

View File

@@ -7,13 +7,14 @@
export LC_ALL=C.UTF-8
export CI_IMAGE_NAME_TAG="mirror.gcr.io/ubuntu:24.04"
LIBCXX_DIR="/msan/cxx_build/"
export APT_LLVM_V="21"
LIBCXX_DIR="/cxx_build/"
export MSAN_FLAGS="-fsanitize=memory -fsanitize-memory-track-origins=2 -fno-omit-frame-pointer -g -O1 -fno-optimize-sibling-calls"
LIBCXX_FLAGS="-nostdinc++ -nostdlib++ -isystem ${LIBCXX_DIR}include/c++/v1 -L${LIBCXX_DIR}lib -Wl,-rpath,${LIBCXX_DIR}lib -lc++ -lc++abi -lpthread -Wno-unused-command-line-argument"
export MSAN_AND_LIBCXX_FLAGS="${MSAN_FLAGS} ${LIBCXX_FLAGS}"
export CONTAINER_NAME="ci_native_msan"
export PACKAGES="ninja-build"
export PACKAGES="clang-${APT_LLVM_V} llvm-${APT_LLVM_V} llvm-${APT_LLVM_V}-dev libclang-${APT_LLVM_V}-dev libclang-rt-${APT_LLVM_V}-dev ninja-build"
# BDB generates false-positives and will be removed in future
export DEP_OPTS="DEBUG=1 NO_BDB=1 NO_QT=1 CC=clang CXX=clang++ CFLAGS='${MSAN_FLAGS}' CXXFLAGS='${MSAN_AND_LIBCXX_FLAGS}'"
export GOAL="install"
@@ -26,4 +27,4 @@ export BITCOIN_CONFIG="\
-DSANITIZERS=memory \
-DAPPEND_CPPFLAGS='-U_FORTIFY_SOURCE' \
"
export USE_MEMORY_SANITIZER="true"
export USE_INSTRUMENTED_LIBCPP="MemoryWithOrigins"

View File

@@ -8,9 +8,12 @@ export LC_ALL=C.UTF-8
export CONTAINER_NAME=ci_native_tsan
export CI_IMAGE_NAME_TAG="mirror.gcr.io/ubuntu:24.04"
export APT_LLVM_V="20"
export PACKAGES="clang-${APT_LLVM_V} llvm-${APT_LLVM_V} libclang-rt-${APT_LLVM_V}-dev libc++abi-${APT_LLVM_V}-dev libc++-${APT_LLVM_V}-dev python3-zmq"
export DEP_OPTS="CC=clang-${APT_LLVM_V} CXX='clang++-${APT_LLVM_V} -stdlib=libc++'"
export APT_LLVM_V="21"
LIBCXX_DIR="/cxx_build/"
LIBCXX_FLAGS="-fsanitize=thread -nostdinc++ -nostdlib++ -isystem ${LIBCXX_DIR}include/c++/v1 -L${LIBCXX_DIR}lib -Wl,-rpath,${LIBCXX_DIR}lib -lc++ -lc++abi -lpthread -Wno-unused-command-line-argument"
export PACKAGES="clang-${APT_LLVM_V} llvm-${APT_LLVM_V} llvm-${APT_LLVM_V}-dev libclang-${APT_LLVM_V}-dev libclang-rt-${APT_LLVM_V}-dev python3-zmq ninja-build"
export DEP_OPTS="CC=clang CXX=clang++ CXXFLAGS='${LIBCXX_FLAGS}' NO_QT=1"
export GOAL="install"
export BITCOIN_CONFIG="-DWITH_ZMQ=ON -DSANITIZERS=thread \
-DAPPEND_CPPFLAGS='-DARENA_DEBUG -DDEBUG_LOCKORDER -DDEBUG_LOCKCONTENTION -D_LIBCPP_REMOVE_TRANSITIVE_INCLUDES'"
-DAPPEND_CPPFLAGS='-DARENA_DEBUG -DDEBUG_LOCKCONTENTION -D_LIBCPP_REMOVE_TRANSITIVE_INCLUDES'"
export USE_INSTRUMENTED_LIBCPP="Thread"

View File

@@ -43,32 +43,24 @@ elif [ "$CI_OS_NAME" != "macos" ]; then
${CI_RETRY_EXE} bash -c "apt-get install --no-install-recommends --no-upgrade -y $PACKAGES $CI_BASE_PACKAGES"
fi
if [ -n "${APT_LLVM_V}" ]; then
update-alternatives --install /usr/bin/clang++ clang++ "/usr/bin/clang++-${APT_LLVM_V}" 100
update-alternatives --install /usr/bin/clang clang "/usr/bin/clang-${APT_LLVM_V}" 100
update-alternatives --install /usr/bin/llvm-symbolizer llvm-symbolizer "/usr/bin/llvm-symbolizer-${APT_LLVM_V}" 100
fi
if [ -n "$PIP_PACKAGES" ]; then
# shellcheck disable=SC2086
${CI_RETRY_EXE} pip3 install --user $PIP_PACKAGES
fi
if [[ ${USE_MEMORY_SANITIZER} == "true" ]]; then
${CI_RETRY_EXE} git clone --depth=1 https://github.com/llvm/llvm-project -b "llvmorg-20.1.0" /msan/llvm-project
if [[ -n "${USE_INSTRUMENTED_LIBCPP}" ]]; then
${CI_RETRY_EXE} git clone --depth=1 https://github.com/llvm/llvm-project -b "llvmorg-21.1.1" /llvm-project
cmake -G Ninja -B /msan/clang_build/ \
-DLLVM_ENABLE_PROJECTS="clang" \
-DCMAKE_BUILD_TYPE=Release \
-DLLVM_TARGETS_TO_BUILD=Native \
-DLLVM_ENABLE_RUNTIMES="compiler-rt;libcxx;libcxxabi;libunwind" \
-S /msan/llvm-project/llvm
ninja -C /msan/clang_build/ "$MAKEJOBS"
ninja -C /msan/clang_build/ install-runtimes
update-alternatives --install /usr/bin/clang++ clang++ /msan/clang_build/bin/clang++ 100
update-alternatives --install /usr/bin/clang clang /msan/clang_build/bin/clang 100
update-alternatives --install /usr/bin/llvm-symbolizer llvm-symbolizer /msan/clang_build/bin/llvm-symbolizer 100
cmake -G Ninja -B /msan/cxx_build/ \
cmake -G Ninja -B /cxx_build/ \
-DLLVM_ENABLE_RUNTIMES="libcxx;libcxxabi;libunwind" \
-DCMAKE_BUILD_TYPE=Release \
-DLLVM_USE_SANITIZER=MemoryWithOrigins \
-DLLVM_USE_SANITIZER="${USE_INSTRUMENTED_LIBCPP}" \
-DCMAKE_C_COMPILER=clang \
-DCMAKE_CXX_COMPILER=clang++ \
-DLLVM_TARGETS_TO_BUILD=Native \
@@ -76,13 +68,13 @@ if [[ ${USE_MEMORY_SANITIZER} == "true" ]]; then
-DLIBCXXABI_USE_LLVM_UNWINDER=OFF \
-DLIBCXX_ABI_DEFINES="_LIBCPP_ABI_BOUNDED_ITERATORS;_LIBCPP_ABI_BOUNDED_ITERATORS_IN_STD_ARRAY;_LIBCPP_ABI_BOUNDED_ITERATORS_IN_STRING;_LIBCPP_ABI_BOUNDED_ITERATORS_IN_VECTOR;_LIBCPP_ABI_BOUNDED_UNIQUE_PTR" \
-DLIBCXX_HARDENING_MODE=debug \
-S /msan/llvm-project/runtimes
-S /llvm-project/runtimes
ninja -C /msan/cxx_build/ "$MAKEJOBS"
ninja -C /cxx_build/ "$MAKEJOBS"
# Clear no longer needed source folder
du -sh /msan/llvm-project
rm -rf /msan/llvm-project
du -sh /llvm-project
rm -rf /llvm-project
fi
if [[ "${RUN_TIDY}" == "true" ]]; then

View File

@@ -23,34 +23,14 @@ if [ -z "$DANGER_RUN_CI_ON_HOST" ]; then
fi
echo "Creating $CI_IMAGE_NAME_TAG container to run in"
DOCKER_BUILD_CACHE_ARG=""
DOCKER_BUILD_CACHE_TEMPDIR=""
DOCKER_BUILD_CACHE_OLD_DIR=""
DOCKER_BUILD_CACHE_NEW_DIR=""
# If set, use an `docker build` cache directory on the CI host
# to cache docker image layers for the CI container image.
# This cache can be multiple GB in size. Prefixed with DANGER
# as setting it removes (old cache) files from the host.
if [ "$DANGER_DOCKER_BUILD_CACHE_HOST_DIR" ]; then
# Directory where the current cache for this run could be. If not existing
# or empty, "docker build" will warn, but treat it as cache-miss and continue.
DOCKER_BUILD_CACHE_OLD_DIR="${DANGER_DOCKER_BUILD_CACHE_HOST_DIR}/${CONTAINER_NAME}"
# Temporary directory for a newly created cache. We can't write the new
# cache into OLD_DIR directly, as old cache layers would not be removed.
# The NEW_DIR contents are moved to OLD_DIR after OLD_DIR has been cleared.
# This happens after `docker build`. If a task fails or is aborted, the
# DOCKER_BUILD_CACHE_TEMPDIR might be retained on the host. If the host isn't
# ephemeral, it has to take care of cleaning old TEMPDIR's up.
DOCKER_BUILD_CACHE_TEMPDIR="$(mktemp --directory ci-docker-build-cache-XXXXXXXXXX)"
DOCKER_BUILD_CACHE_NEW_DIR="${DOCKER_BUILD_CACHE_TEMPDIR}/${CONTAINER_NAME}"
DOCKER_BUILD_CACHE_ARG="--cache-from type=local,src=${DOCKER_BUILD_CACHE_OLD_DIR} --cache-to type=local,dest=${DOCKER_BUILD_CACHE_NEW_DIR},mode=max"
fi
# Use buildx unconditionally
# Using buildx is required to properly load the correct driver, for use with registry caching. Neither build, nor BUILDKIT=1 currently do this properly
# shellcheck disable=SC2086
DOCKER_BUILDKIT=1 docker build \
docker buildx build \
--file "${BASE_READ_ONLY_DIR}/ci/test_imagefile" \
--build-arg "CI_IMAGE_NAME_TAG=${CI_IMAGE_NAME_TAG}" \
--build-arg "FILE_ENV=${FILE_ENV}" \
--build-arg "BASE_ROOT_DIR=${BASE_ROOT_DIR}" \
$MAYBE_CPUSET \
--platform="${CI_IMAGE_PLATFORM}" \
--label="${CI_IMAGE_LABEL}" \
@@ -58,15 +38,6 @@ if [ -z "$DANGER_RUN_CI_ON_HOST" ]; then
$DOCKER_BUILD_CACHE_ARG \
"${BASE_READ_ONLY_DIR}"
if [ "$DANGER_DOCKER_BUILD_CACHE_HOST_DIR" ]; then
if [ -e "${DOCKER_BUILD_CACHE_NEW_DIR}/index.json" ]; then
echo "Removing the existing docker build cache in ${DOCKER_BUILD_CACHE_OLD_DIR}"
rm -rf "${DOCKER_BUILD_CACHE_OLD_DIR}"
echo "Moving the contents of ${DOCKER_BUILD_CACHE_NEW_DIR} to ${DOCKER_BUILD_CACHE_OLD_DIR}"
mv "${DOCKER_BUILD_CACHE_NEW_DIR}" "${DOCKER_BUILD_CACHE_OLD_DIR}"
fi
fi
docker volume create "${CONTAINER_NAME}_ccache" || true
docker volume create "${CONTAINER_NAME}_depends" || true
docker volume create "${CONTAINER_NAME}_depends_sources" || true

View File

@@ -24,6 +24,14 @@ fi
echo "Free disk space:"
df -h
# We force an install of linux-headers again here via $PACKAGES to fix any
# kernel mismatch between a cached docker image and the underlying host.
# This can happen occasionally on hosted runners if the runner image is updated.
if [[ "$CONTAINER_NAME" == "ci_native_asan" ]]; then
$CI_RETRY_EXE apt-get update
${CI_RETRY_EXE} bash -c "apt-get install --no-install-recommends --no-upgrade -y $PACKAGES"
fi
# What host to compile for. See also ./depends/README.md
# Tests that need cross-compilation export the appropriate HOST.
# Tests that run natively guess the host
@@ -92,7 +100,7 @@ fi
if [ -z "$NO_DEPENDS" ]; then
if [[ $CI_IMAGE_NAME_TAG == *centos* ]]; then
SHELL_OPTS="CONFIG_SHELL=/bin/ksh" # Temporarily use ksh instead of dash, until https://bugzilla.redhat.com/show_bug.cgi?id=2335416 is fixed.
SHELL_OPTS="CONFIG_SHELL=/bin/dash"
else
SHELL_OPTS="CONFIG_SHELL="
fi
@@ -129,6 +137,12 @@ bash -c "cmake -S $BASE_ROOT_DIR $BITCOIN_CONFIG_ALL $BITCOIN_CONFIG || ( (cat $
bash -c "cmake --build . $MAKEJOBS --target all $GOAL" || ( echo "Build failure. Verbose build follows." && cmake --build . --target all "$GOAL" --verbose ; false )
bash -c "${PRINT_CCACHE_STATISTICS}"
if [ "$CI" = "true" ]; then
hit_rate=$(ccache -s | grep "Hits:" | head -1 | sed 's/.*(\(.*\)%).*/\1/')
if [ "${hit_rate%.*}" -lt 75 ]; then
echo "::notice title=low ccache hitrate::Ccache hit-rate in $CONTAINER_NAME was $hit_rate%"
fi
fi
du -sh "${DEPENDS_DIR}"/*/
du -sh "${PREVIOUS_RELEASES_DIR}"

View File

@@ -4,12 +4,16 @@
# See ci/README.md for usage.
ARG CI_IMAGE_NAME_TAG
# We never want scratch, but default arg silences a Warning
ARG CI_IMAGE_NAME_TAG=scratch
FROM ${CI_IMAGE_NAME_TAG}
ARG FILE_ENV
ENV FILE_ENV=${FILE_ENV}
ARG BASE_ROOT_DIR
ENV BASE_ROOT_DIR=${BASE_ROOT_DIR}
COPY ./ci/retry/retry /usr/bin/retry
COPY ./ci/test/00_setup_env.sh ./${FILE_ENV} ./ci/test/01_base_install.sh /ci_container_base/ci/test/

View File

@@ -17,6 +17,18 @@ function(add_boost_if_needed)
directory and other added INTERFACE properties.
]=]
if(CMAKE_HOST_APPLE)
find_program(HOMEBREW_EXECUTABLE brew)
if(HOMEBREW_EXECUTABLE)
execute_process(
COMMAND ${HOMEBREW_EXECUTABLE} --prefix boost
OUTPUT_VARIABLE Boost_ROOT
ERROR_QUIET
OUTPUT_STRIP_TRAILING_WHITESPACE
)
endif()
endif()
# We cannot rely on find_package(Boost ...) to work properly without
# Boost_NO_BOOST_CMAKE set until we require a more recent Boost because
# upstream did not ship proper CMake files until 1.82.0.

View File

@@ -21,16 +21,16 @@ endif()
find_path(QRencode_INCLUDE_DIR
NAMES qrencode.h
PATHS ${PC_QRencode_INCLUDE_DIRS}
HINTS ${PC_QRencode_INCLUDE_DIRS}
)
find_library(QRencode_LIBRARY_RELEASE
NAMES qrencode
PATHS ${PC_QRencode_LIBRARY_DIRS}
HINTS ${PC_QRencode_LIBRARY_DIRS}
)
find_library(QRencode_LIBRARY_DEBUG
NAMES qrencoded qrencode
PATHS ${PC_QRencode_LIBRARY_DIRS}
HINTS ${PC_QRencode_LIBRARY_DIRS}
)
include(SelectLibraryConfigurations)
select_library_configurations(QRencode)

View File

@@ -36,6 +36,10 @@ if(USDT_INCLUDE_DIR)
include(CheckCXXSourceCompiles)
set(CMAKE_REQUIRED_INCLUDES ${USDT_INCLUDE_DIR})
check_cxx_source_compiles("
#if defined(__arm__)
# define STAP_SDT_ARG_CONSTRAINT g
#endif
// Setting SDT_USE_VARIADIC lets systemtap (sys/sdt.h) know that we want to use
// the optional variadic macros to define tracepoints.
#define SDT_USE_VARIADIC 1

View File

@@ -83,6 +83,7 @@ function(add_macos_deploy_target)
COMMAND ${CMAKE_COMMAND} --install ${PROJECT_BINARY_DIR} --config $<CONFIG> --component bitcoin-qt --prefix ${macos_app}/Contents/MacOS --strip
COMMAND ${CMAKE_COMMAND} -E rename ${macos_app}/Contents/MacOS/bin/$<TARGET_FILE_NAME:bitcoin-qt> ${macos_app}/Contents/MacOS/Bitcoin-Qt
COMMAND ${CMAKE_COMMAND} -E rm -rf ${macos_app}/Contents/MacOS/bin
COMMAND ${CMAKE_COMMAND} -E rm -rf ${macos_app}/Contents/MacOS/share
VERBATIM
)

View File

@@ -105,14 +105,13 @@ function(remove_cxx_flag_from_all_configs flag)
endfunction()
function(replace_cxx_flag_in_config config old_flag new_flag)
string(TOUPPER "${config}" config_uppercase)
string(REGEX REPLACE "(^| )${old_flag}( |$)" "\\1${new_flag}\\2" new_flags "${CMAKE_CXX_FLAGS_${config_uppercase}}")
set(CMAKE_CXX_FLAGS_${config_uppercase} "${new_flags}" PARENT_SCOPE)
set(CMAKE_CXX_FLAGS_${config_uppercase} "${new_flags}"
CACHE STRING
"Flags used by the CXX compiler during ${config_uppercase} builds."
FORCE
)
string(TOUPPER "CMAKE_CXX_FLAGS_${config}" var_name)
if("${var_name}" IN_LIST precious_variables)
return()
endif()
string(REGEX REPLACE "(^| )${old_flag}( |$)" "\\1${new_flag}\\2" ${var_name} "${${var_name}}")
set(${var_name} "${${var_name}}" PARENT_SCOPE)
set_property(CACHE ${var_name} PROPERTY VALUE "${${var_name}}")
endfunction()
set_default_config(RelWithDebInfo)

View File

@@ -20,7 +20,7 @@ In configuration output, this function prints a string by the following pattern:
function(try_append_linker_flag flag)
cmake_parse_arguments(PARSE_ARGV 1
TALF # prefix
"" # options
"NO_CACHE_IF_FAILED" # options
"TARGET;VAR;SOURCE;RESULT_VAR" # one_value_keywords
"IF_CHECK_PASSED" # multi_value_keywords
)
@@ -68,6 +68,10 @@ function(try_append_linker_flag flag)
if(DEFINED TALF_RESULT_VAR)
set(${TALF_RESULT_VAR} "${${result}}" PARENT_SCOPE)
endif()
if(NOT ${result} AND TALF_NO_CACHE_IF_FAILED)
unset(${result} CACHE)
endif()
endfunction()
if(MSVC)

View File

@@ -50,7 +50,8 @@ EOF
# adding newlines is a bit funky to ensure portability for BSD
# see here for more details: https://stackoverflow.com/a/24575385
${BITCOIND} --help \
| sed '1,/Print this help message and exit/d' \
| sed '1,/Options:/d' \
| sed -E '/^[[:space:]]{2}-help/,/^[[:space:]]*$/d' \
| sed -E 's/^[[:space:]]{2}\-/#/' \
| sed -E 's/^[[:space:]]{7}/# /' \
| sed -E '/[=[:space:]]/!s/#.*$/&=1/' \

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
```
@@ -760,8 +760,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

@@ -69,6 +69,12 @@ fi
mkdir -p "$VERSION_BASE"
################
# SOURCE_DATE_EPOCH should not unintentionally be set
################
check_source_date_epoch
################
# Build directories should not exist
################

View File

@@ -67,6 +67,12 @@ EOF
exit 1
fi
################
# SOURCE_DATE_EPOCH should not unintentionally be set
################
check_source_date_epoch
################
# The codesignature git worktree should not be dirty
################

View File

@@ -21,6 +21,26 @@ check_tools() {
done
}
################
# SOURCE_DATE_EPOCH should not unintentionally be set
################
check_source_date_epoch() {
if [ -n "$SOURCE_DATE_EPOCH" ] && [ -z "$FORCE_SOURCE_DATE_EPOCH" ]; then
cat << EOF
ERR: Environment variable SOURCE_DATE_EPOCH is set which may break reproducibility.
Aborting...
Hint: You may want to:
1. Unset this variable: \`unset SOURCE_DATE_EPOCH\` before rebuilding
2. Set the 'FORCE_SOURCE_DATE_EPOCH' environment variable if you insist on
using your own epoch
EOF
exit 1
fi
}
check_tools cat env readlink dirname basename git
################
@@ -50,7 +70,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=53396a22afc04536ddf75d8f82ad2eafa5082725 \
--cores="$JOBS" \
--keep-failed \

View File

@@ -2,6 +2,7 @@
((gnu packages bash) #:select (bash-minimal))
(gnu packages bison)
((gnu packages certs) #:select (nss-certs))
((gnu packages check) #:select (libfaketime))
((gnu packages cmake) #:select (cmake-minimal))
(gnu packages commencement)
(gnu packages compression)
@@ -209,7 +210,17 @@ and abstract ELF, PE and MachO formats.")
(base32
"1j47vwq4caxfv0xw68kw5yh00qcpbd56d7rq6c483ma3y7s96yyz"))))
(build-system cmake-build-system)
(inputs (list openssl))
(arguments
(list
#:phases
#~(modify-phases %standard-phases
(replace 'check
(lambda* (#:key tests? #:allow-other-keys)
(if tests?
(invoke "faketime" "-f" "@2025-01-01 00:00:00" ;; Tests fail after 2025.
"ctest" "--output-on-failure" "--no-tests=error")
(format #t "test suite not run~%")))))))
(inputs (list libfaketime openssl))
(home-page "https://github.com/mtrojnar/osslsigncode")
(synopsis "Authenticode signing and timestamping tool")
(description "osslsigncode is a small tool that implements part of the

View File

@@ -465,18 +465,18 @@ if config.translations_dir:
sys.stderr.write(f"Error: Could not find translation dir \"{config.translations_dir[0]}\"\n")
sys.exit(1)
print("+ Adding Qt translations +")
print("+ Adding Qt translations +")
translations = Path(config.translations_dir[0])
translations = Path(config.translations_dir[0])
regex = re.compile('qt_[a-z]*(.qm|_[A-Z]*.qm)')
regex = re.compile('qt_[a-z]*(.qm|_[A-Z]*.qm)')
lang_files = [x for x in translations.iterdir() if regex.match(x.name)]
lang_files = [x for x in translations.iterdir() if regex.match(x.name)]
for file in lang_files:
if verbose:
print(file.as_posix(), "->", os.path.join(applicationBundle.resourcesPath, file.name))
shutil.copy2(file.as_posix(), os.path.join(applicationBundle.resourcesPath, file.name))
for file in lang_files:
if verbose:
print(file.as_posix(), "->", os.path.join(applicationBundle.resourcesPath, file.name))
shutil.copy2(file.as_posix(), os.path.join(applicationBundle.resourcesPath, file.name))
# ------------------------------------------------

View File

@@ -10,14 +10,13 @@ to addrman with).
Update `MIN_BLOCKS` in `makeseeds.py` and the `-m`/`--minblocks` arguments below, as needed.
The seeds compiled into the release are created from sipa's, achow101's and luke-jr's
The seeds compiled into the release are created from sipa's and achow101's
DNS seed, virtu's crawler, and asmap community AS map data. Run the following commands
from the `/contrib/seeds` directory:
```
curl https://bitcoin.sipa.be/seeds.txt.gz | gzip -dc > seeds_main.txt
curl https://21.ninja/seeds.txt.gz | gzip -dc >> seeds_main.txt
curl https://luke.dashjr.org/programs/bitcoin/files/charts/seeds.txt >> seeds_main.txt
curl https://mainnet.achownodes.xyz/seeds.txt.gz | gzip -dc >> seeds_main.txt
curl https://signet.achownodes.xyz/seeds.txt.gz | gzip -dc > seeds_signet.txt
curl https://testnet.achownodes.xyz/seeds.txt.gz | gzip -dc > seeds_test.txt

View File

@@ -66,7 +66,7 @@ BPF_PERF_OUTPUT(replaced_events);
int trace_added(struct pt_regs *ctx) {
struct added_event added = {};
void *phash = NULL;
bpf_usdt_readarg(1, ctx, phash);
bpf_usdt_readarg(1, ctx, &phash);
bpf_probe_read_user(&added.hash, sizeof(added.hash), phash);
bpf_usdt_readarg(2, ctx, &added.vsize);
bpf_usdt_readarg(3, ctx, &added.fee);
@@ -78,9 +78,9 @@ int trace_added(struct pt_regs *ctx) {
int trace_removed(struct pt_regs *ctx) {
struct removed_event removed = {};
void *phash = NULL, *preason = NULL;
bpf_usdt_readarg(1, ctx, phash);
bpf_usdt_readarg(1, ctx, &phash);
bpf_probe_read_user(&removed.hash, sizeof(removed.hash), phash);
bpf_usdt_readarg(1, ctx, preason);
bpf_usdt_readarg(2, ctx, &preason);
bpf_probe_read_user_str(&removed.reason, sizeof(removed.reason), preason);
bpf_usdt_readarg(3, ctx, &removed.vsize);
bpf_usdt_readarg(4, ctx, &removed.fee);
@@ -93,9 +93,9 @@ int trace_removed(struct pt_regs *ctx) {
int trace_rejected(struct pt_regs *ctx) {
struct rejected_event rejected = {};
void *phash = NULL, *preason = NULL;
bpf_usdt_readarg(1, ctx, phash);
bpf_usdt_readarg(1, ctx, &phash);
bpf_probe_read_user(&rejected.hash, sizeof(rejected.hash), phash);
bpf_usdt_readarg(1, ctx, preason);
bpf_usdt_readarg(2, ctx, &preason);
bpf_probe_read_user_str(&rejected.reason, sizeof(rejected.reason), preason);
rejected_events.perf_submit(ctx, &rejected, sizeof(rejected));
return 0;
@@ -104,12 +104,12 @@ int trace_rejected(struct pt_regs *ctx) {
int trace_replaced(struct pt_regs *ctx) {
struct replaced_event replaced = {};
void *phash_replaced = NULL, *phash_replacement = NULL;
bpf_usdt_readarg(1, ctx, phash_replaced);
bpf_usdt_readarg(1, ctx, &phash_replaced);
bpf_probe_read_user(&replaced.replaced_hash, sizeof(replaced.replaced_hash), phash_replaced);
bpf_usdt_readarg(2, ctx, &replaced.replaced_vsize);
bpf_usdt_readarg(3, ctx, &replaced.replaced_fee);
bpf_usdt_readarg(4, ctx, &replaced.replaced_entry_time);
bpf_usdt_readarg(5, ctx, phash_replacement);
bpf_usdt_readarg(5, ctx, &phash_replacement);
bpf_probe_read_user(&replaced.replacement_hash, sizeof(replaced.replacement_hash), phash_replacement);
bpf_usdt_readarg(6, ctx, &replaced.replacement_vsize);
bpf_usdt_readarg(7, ctx, &replaced.replacement_fee);

View File

@@ -54,7 +54,7 @@ int trace_inbound_message(struct pt_regs *ctx) {
bpf_probe_read_user_str(&msg.peer_addr, sizeof(msg.peer_addr), paddr);
bpf_usdt_readarg(3, ctx, &pconn_type);
bpf_probe_read_user_str(&msg.peer_conn_type, sizeof(msg.peer_conn_type), pconn_type);
bpf_usdt_readarg(4, ctx, &pconn_type);
bpf_usdt_readarg(4, ctx, &pmsg_type);
bpf_probe_read_user_str(&msg.msg_type, sizeof(msg.msg_type), pmsg_type);
bpf_usdt_readarg(5, ctx, &msg.msg_size);
@@ -71,7 +71,7 @@ int trace_outbound_message(struct pt_regs *ctx) {
bpf_probe_read_user_str(&msg.peer_addr, sizeof(msg.peer_addr), paddr);
bpf_usdt_readarg(3, ctx, &pconn_type);
bpf_probe_read_user_str(&msg.peer_conn_type, sizeof(msg.peer_conn_type), pconn_type);
bpf_usdt_readarg(4, ctx, &pconn_type);
bpf_usdt_readarg(4, ctx, &pmsg_type);
bpf_probe_read_user_str(&msg.msg_type, sizeof(msg.msg_type), pmsg_type);
bpf_usdt_readarg(5, ctx, &msg.msg_size);

View File

@@ -206,6 +206,7 @@ endif
$(host_prefix)/toolchain.cmake : toolchain.cmake.in $(host_prefix)/.stamp_$(final_build_id)
@mkdir -p $(@D)
sed -e 's|@depends_crosscompiling@|$(crosscompiling)|' \
-e 's|@host@|$(host)|' \
-e 's|@host_system_name@|$($(host_os)_cmake_system_name)|' \
-e 's|@host_system_version@|$($(host_os)_cmake_system_version)|' \
-e 's|@host_arch@|$(host_arch)|' \

View File

@@ -90,15 +90,15 @@ For linux S390X cross compilation:
### Install the required dependencies: FreeBSD
pkg install bash
pkg install bash cmake curl gmake
### Install the required dependencies: NetBSD
pkgin install bash gmake
pkgin install bash cmake curl gmake perl
### Install the required dependencies: OpenBSD
pkg_add bash gmake gtar
pkg_add bash cmake curl gmake gtar
### Dependency Options

View File

@@ -3,3 +3,7 @@ build_freebsd_CXX=clang++
build_freebsd_SHA256SUM = sha256sum
build_freebsd_DOWNLOAD = curl --location --fail --connect-timeout $(DOWNLOAD_CONNECT_TIMEOUT) --retry $(DOWNLOAD_RETRIES) -o
# freebsd host on freebsd builder: override freebsd host preferences.
freebsd_CC = clang
freebsd_CXX = clang++

View File

@@ -1,9 +1,13 @@
build_openbsd_CC = clang
build_openbsd_CXX = clang++
build_openbsd_SHA256SUM = sha256
build_openbsd_SHA256SUM = sha256 -r
build_openbsd_DOWNLOAD = curl --location --fail --connect-timeout $(DOWNLOAD_CONNECT_TIMEOUT) --retry $(DOWNLOAD_RETRIES) -o
build_openbsd_TAR = gtar
# openBSD touch doesn't understand -h
build_openbsd_TOUCH = touch -m -t 200001011200
# openbsd host on openbsd builder: override openbsd host preferences.
openbsd_CC = clang
openbsd_CXX = clang++

View File

@@ -187,6 +187,7 @@ $(1)_cmake=env CC="$$($(1)_cc)" \
-DCMAKE_INSTALL_LIBDIR=lib/ \
-DCMAKE_POSITION_INDEPENDENT_CODE=ON \
-DCMAKE_VERBOSE_MAKEFILE:BOOL=$(V) \
-DCMAKE_EXPORT_NO_PACKAGE_REGISTRY:BOOL=TRUE \
$$($(1)_config_opts)
ifeq ($($(1)_type),build)
$(1)_cmake += -DCMAKE_INSTALL_RPATH:PATH="$$($($(1)_type)_prefix)/lib"

View File

@@ -5,7 +5,7 @@ $(package)_download_file=$(native_$(package)_download_file)
$(package)_file_name=$(native_$(package)_file_name)
$(package)_sha256_hash=$(native_$(package)_sha256_hash)
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

@@ -4,6 +4,7 @@ $(package)_download_path=https://download.savannah.gnu.org/releases/$(package)
$(package)_file_name=$(package)-$($(package)_version).tar.xz
$(package)_sha256_hash=8bee39bd3968c4804b70614a0a3ad597299ad0e824bc8aad5ce8aaf48067bde7
$(package)_build_subdir=build
$(package)_patches += cmake_minimum.patch
define $(package)_set_vars
$(package)_config_opts := -DCMAKE_BUILD_TYPE=None -DBUILD_SHARED_LIBS=TRUE
@@ -12,6 +13,10 @@ define $(package)_set_vars
$(package)_config_opts += -DCMAKE_DISABLE_FIND_PACKAGE_BrotliDec=TRUE
endef
define $(package)_preprocess_cmds
patch -p1 < $($(package)_patch_dir)/cmake_minimum.patch
endef
define $(package)_config_cmds
$($(package)_cmake) -S .. -B .
endef

View File

@@ -5,6 +5,7 @@ $(package)_file_name=$(package)-$($(package)_version).tar.gz
$(package)_sha256_hash=92e6de1be9ec176428fd2367677e61ceffc2ee1cb119035037a27d346b0403bb
$(package)_patches=cmake_fixups.patch
$(package)_patches += netbsd_fixup.patch
$(package)_patches += winver_fixup.patch
$(package)_build_subdir=build
# When building for Windows, we set _WIN32_WINNT to target the same Windows
@@ -25,7 +26,8 @@ endef
define $(package)_preprocess_cmds
patch -p1 < $($(package)_patch_dir)/cmake_fixups.patch && \
patch -p1 < $($(package)_patch_dir)/netbsd_fixup.patch
patch -p1 < $($(package)_patch_dir)/netbsd_fixup.patch && \
patch -p1 < $($(package)_patch_dir)/winver_fixup.patch
endef
define $(package)_config_cmds

View File

@@ -8,7 +8,7 @@ ifneq ($(host),$(build))
$(package)_dependencies += native_capnp
endif
define $(package)_set_vars :=
define $(package)_set_vars
ifneq ($(host),$(build))
$(package)_config_opts := -DCAPNP_EXECUTABLE="$$(native_capnp_prefixbin)/capnp"
$(package)_config_opts += -DCAPNPC_CXX_EXECUTABLE="$$(native_capnp_prefixbin)/capnpc-c++"

View File

@@ -1,9 +1,9 @@
package=native_capnp
$(package)_version=1.1.0
$(package)_version=1.2.0
$(package)_download_path=https://capnproto.org/
$(package)_download_file=capnproto-c++-$($(package)_version).tar.gz
$(package)_file_name=capnproto-cxx-$($(package)_version).tar.gz
$(package)_sha256_hash=07167580e563f5e821e3b2af1c238c16ec7181612650c5901330fa9a0da50939
$(package)_sha256_hash=ed00e44ecbbda5186bc78a41ba64a8dc4a861b5f8d4e822959b0144ae6fd42ef
define $(package)_set_vars
$(package)_config_opts := -DBUILD_TESTING=OFF

View File

@@ -1,8 +1,8 @@
package=native_libmultiprocess
$(package)_version=1954f7f65661d49e700c344eae0fc8092decf975
$(package)_version=v5.0
$(package)_download_path=https://github.com/bitcoin-core/libmultiprocess/archive
$(package)_file_name=$($(package)_version).tar.gz
$(package)_sha256_hash=fc014bd74727c1d5d30b396813685012c965d079244dd07b53bc1c75c610a2cb
$(package)_sha256_hash=401984715b271a3446e1910f21adf048ba390d31cc93cc3073742e70d56fa3ea
$(package)_dependencies=native_capnp
define $(package)_config_cmds

View File

@@ -1,6 +1,6 @@
package=qt
$(package)_version=5.15.16
$(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=b04815058c18058b6ba837206756a2c87d1391f07a0dcb0dd314f970fd041592

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,13 @@
build: set minimum required CMake to 3.12
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -97,7 +97,7 @@
# FreeType explicitly marks the API to be exported and relies on the compiler
# to hide all other symbols. CMake supports a C_VISBILITY_PRESET property
# starting with 2.8.12.
-cmake_minimum_required(VERSION 2.8.12)
+cmake_minimum_required(VERSION 3.12)
if (NOT CMAKE_VERSION VERSION_LESS 3.3)
# Allow symbol visibility settings also on static libraries. CMake < 3.3

View File

@@ -0,0 +1,122 @@
Cherry-picked from a14ff91254f40cf36e0fee199e26fb11260fab49.
move _WIN32_WINNT defintions before first #include
_WIN32_WINNT and WIN32_LEAN_AND_MEAN need to be defined
before the windows.h is included for the first time.
Avoid the confusion of indirect #include by defining
before any.
diff --git a/event_iocp.c b/event_iocp.c
index 6b2a2e15..4955e426 100644
--- a/event_iocp.c
+++ b/event_iocp.c
@@ -23,12 +23,14 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include "evconfig-private.h"
#ifndef _WIN32_WINNT
/* Minimum required for InitializeCriticalSectionAndSpinCount */
#define _WIN32_WINNT 0x0403
#endif
+
+#include "evconfig-private.h"
+
#include <winsock2.h>
#include <windows.h>
#include <process.h>
diff --git a/evthread_win32.c b/evthread_win32.c
index 2ec80560..8647f72b 100644
--- a/evthread_win32.c
+++ b/evthread_win32.c
@@ -23,18 +23,21 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include "event2/event-config.h"
-#include "evconfig-private.h"
#ifdef _WIN32
#ifndef _WIN32_WINNT
/* Minimum required for InitializeCriticalSectionAndSpinCount */
#define _WIN32_WINNT 0x0403
#endif
-#include <winsock2.h>
#define WIN32_LEAN_AND_MEAN
+#endif
+
+#include "event2/event-config.h"
+#include "evconfig-private.h"
+
+#ifdef _WIN32
+#include <winsock2.h>
#include <windows.h>
-#undef WIN32_LEAN_AND_MEAN
#include <sys/locking.h>
#endif
diff --git a/evutil.c b/evutil.c
index 9817f086..8537ffe8 100644
--- a/evutil.c
+++ b/evutil.c
@@ -24,6 +24,14 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+#ifdef _WIN32
+#ifndef _WIN32_WINNT
+/* For structs needed by GetAdaptersAddresses */
+#define _WIN32_WINNT 0x0501
+#endif
+#define WIN32_LEAN_AND_MEAN
+#endif
+
#include "event2/event-config.h"
#include "evconfig-private.h"
@@ -31,15 +39,10 @@
#include <winsock2.h>
#include <winerror.h>
#include <ws2tcpip.h>
-#define WIN32_LEAN_AND_MEAN
#include <windows.h>
-#undef WIN32_LEAN_AND_MEAN
#include <io.h>
#include <tchar.h>
#include <process.h>
-#undef _WIN32_WINNT
-/* For structs needed by GetAdaptersAddresses */
-#define _WIN32_WINNT 0x0501
#include <iphlpapi.h>
#include <netioapi.h>
#endif
diff --git a/listener.c b/listener.c
index f5c00c9c..d1080e76 100644
--- a/listener.c
+++ b/listener.c
@@ -24,16 +24,19 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+#ifdef _WIN32
+#ifndef _WIN32_WINNT
+/* Minimum required for InitializeCriticalSectionAndSpinCount */
+#define _WIN32_WINNT 0x0403
+#endif
+#endif
+
#include "event2/event-config.h"
#include "evconfig-private.h"
#include <sys/types.h>
#ifdef _WIN32
-#ifndef _WIN32_WINNT
-/* Minimum required for InitializeCriticalSectionAndSpinCount */
-#define _WIN32_WINNT 0x0403
-#endif
#include <winsock2.h>
#include <winerror.h>
#include <ws2tcpip.h>

View File

@@ -13,6 +13,10 @@ if(@depends_crosscompiling@)
set(CMAKE_SYSTEM_NAME @host_system_name@)
set(CMAKE_SYSTEM_VERSION @host_system_version@)
set(CMAKE_SYSTEM_PROCESSOR @host_arch@)
set(CMAKE_C_COMPILER_TARGET @host@)
set(CMAKE_CXX_COMPILER_TARGET @host@)
set(CMAKE_OBJCXX_COMPILER_TARGET @host@)
endif()
if(NOT DEFINED CMAKE_C_FLAGS_INIT)
@@ -88,6 +92,22 @@ set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)
set(QT_TRANSLATIONS_DIR "${CMAKE_CURRENT_LIST_DIR}/translations")
# The following is only necessary when using cmake from Nix or NixOS, because
# Nix patches cmake to remove the root directory `/` from
# CMAKE_SYSTEM_PREFIX_PATH. Adding it back is harmless on other platforms and
# necessary on Nix because without it cmake find_path, find_package, etc
# functions do not know where to look in CMAKE_FIND_ROOT_PATH for dependencies
# (https://github.com/bitcoin/bitcoin/issues/32428).
#
# TODO: longer term, it may be possible to use a dependency provider, which
# would bring the find_package calls completely under our control, making this
# patch unnecessary.
#
# Make sure we only append once, as this file may be called repeatedly.
if(NOT "/" IN_LIST CMAKE_PREFIX_PATH)
list(APPEND CMAKE_PREFIX_PATH "/")
endif()
if(CMAKE_SYSTEM_NAME STREQUAL "Darwin" AND NOT CMAKE_HOST_APPLE)
# The find_package(Qt ...) function internally uses find_library()
# calls for all dependencies to ensure their availability.

View File

@@ -58,7 +58,8 @@ BIPs that are implemented by Bitcoin Core:
Validation rules for Taproot (including Schnorr signatures and Tapscript
leaves) are implemented as of **v0.21.0** ([PR 19953](https://github.com/bitcoin/bitcoin/pull/19953)),
with mainnet activation as of **v0.21.1** ([PR 21377](https://github.com/bitcoin/bitcoin/pull/21377),
[PR 21686](https://github.com/bitcoin/bitcoin/pull/21686)).
[PR 21686](https://github.com/bitcoin/bitcoin/pull/21686)),
always active as of **v24.0** ([PR 23536](https://github.com/bitcoin/bitcoin/pull/23536)).
* [`BIP 350`](https://github.com/bitcoin/bips/blob/master/bip-0350.mediawiki): Addresses for native v1+ segregated Witness outputs use Bech32m instead of Bech32 as of **v22.0** ([PR 20861](https://github.com/bitcoin/bitcoin/pull/20861)).
* [`BIP 371`](https://github.com/bitcoin/bips/blob/master/bip-0371.mediawiki): Taproot fields for PSBT as of **v24.0** ([PR 22558](https://github.com/bitcoin/bitcoin/pull/22558)).
* [`BIP 379`](https://github.com/bitcoin/bips/blob/master/bip-0379.md): Miniscript was partially implemented in **v24.0** ([PR 24148](https://github.com/bitcoin/bitcoin/pull/24148)), and fully implemented as of **v26.0** ([PR 27255](https://github.com/bitcoin/bitcoin/pull/27255)).

View File

@@ -129,6 +129,6 @@ cmake -B build -DENABLE_WALLET=OFF
### 2. Compile
```bash
cmake --build build # Use "-j N" for N parallel jobs.
ctest --test-dir build # Use "-j N" for N parallel tests. Some tests are disabled if Python 3 is not available.
cmake --build build # Append "-j N" for N parallel jobs.
ctest --test-dir build # Append "-j N" for N parallel tests. Some tests are disabled if Python 3 is not available.
```

View File

@@ -118,6 +118,6 @@ Run `cmake -B build -LH` to see the full list of available options.
Build and run the tests:
```bash
cmake --build build # Use "-j N" for N parallel jobs.
ctest --test-dir build # Use "-j N" for N parallel tests. Some tests are disabled if Python 3 is not available.
cmake --build build # Append "-j N" for N parallel jobs.
ctest --test-dir build # Append "-j N" for N parallel tests. Some tests are disabled if Python 3 is not available.
```

View File

@@ -118,8 +118,8 @@ cmake -B build -DBerkeleyDB_INCLUDE_DIR:PATH="${BDB_PREFIX}/include" -DWITH_BDB=
### 2. Compile
```bash
cmake --build build # Use "-j N" for N parallel jobs.
ctest --test-dir build # Use "-j N" for N parallel tests. Some tests are disabled if Python 3 is not available.
cmake --build build # Append "-j N" for N parallel jobs.
ctest --test-dir build # Append "-j N" for N parallel tests. Some tests are disabled if Python 3 is not available.
```
## Resource limits

View File

@@ -187,8 +187,8 @@ After configuration, you are ready to compile.
Run the following in your terminal to compile Bitcoin Core:
``` bash
cmake --build build # Use "-j N" here for N parallel jobs.
ctest --test-dir build # Use "-j N" for N parallel tests. Some tests are disabled if Python 3 is not available.
cmake --build build # Append "-j N" here for N parallel jobs.
ctest --test-dir build # Append "-j N" for N parallel tests. Some tests are disabled if Python 3 is not available.
```
### 3. Deploy (optional)

View File

@@ -9,8 +9,12 @@ To Build
```bash
cmake -B build
cmake --build build # use "-j N" for N parallel jobs
cmake --install build # optional
```
Run `cmake -B build -LH` to see the full list of available options.
```bash
cmake --build build # Append "-j N" for N parallel jobs
cmake --install build # Optional
```
See below for instructions on how to [install the dependencies on popular Linux
@@ -60,7 +64,7 @@ executables, which are based on BerkeleyDB 4.8. Otherwise, you can build Berkele
To build Bitcoin Core without wallet, see [*Disable-wallet mode*](#disable-wallet-mode)
ZMQ dependencies (provides ZMQ API):
ZMQ-enabled binaries are compiled with `-DWITH_ZMQ=ON` and require the following dependency:
sudo apt-get install libzmq3-dev
@@ -108,7 +112,7 @@ are based on Berkeley DB 4.8. Otherwise, you can build Berkeley DB [yourself](#b
To build Bitcoin Core without wallet, see [*Disable-wallet mode*](#disable-wallet-mode)
ZMQ dependencies (provides ZMQ API):
ZMQ-enabled binaries are compiled with `-DWITH_ZMQ=ON` and require the following dependency:
sudo dnf install zeromq-devel
@@ -171,13 +175,6 @@ In this case there is no dependency on SQLite or Berkeley DB.
Mining is also possible in disable-wallet mode using the `getblocktemplate` RPC call.
Additional Configure Flags
--------------------------
A list of additional configure flags can be displayed with:
cmake -B build -LH
Setup and Build Example: Arch Linux
-----------------------------------
This example lists the steps necessary to setup and build a command line only distribution of the latest changes on Arch Linux:

View File

@@ -54,33 +54,43 @@ In the following instructions, the "Debug" configuration can be specified instea
```
cmake -B build --preset vs2022-static # It might take a while if the vcpkg binary cache is unpopulated or invalidated.
cmake --build build --config Release # Use "-j N" for N parallel jobs.
ctest --test-dir build --build-config Release # Use "-j N" for N parallel tests. Some tests are disabled if Python 3 is not available.
cmake --build build --config Release # Append "-j N" for N parallel jobs.
ctest --test-dir build --build-config Release # Append "-j N" for N parallel tests. Some tests are disabled if Python 3 is not available.
cmake --install build --config Release # Optional.
```
If building with `BUILD_GUI=ON`, vcpkg installation during the build
configuration step might fail because of extremely long paths required during
vcpkg installation if your vcpkg instance is installed in the default Visual
Studio directory. This can be avoided without modifying your vcpkg root
directory by changing vcpkg's intermediate build directory with the
`--x-buildtrees-root` argument to something shorter, for example:
```powershell
cmake -B build --preset vs2022-static -DVCPKG_INSTALL_OPTIONS="--x-buildtrees-root=C:\vcpkg"
```
### 5. Building with Dynamic Linking without GUI
```
cmake -B build --preset vs2022 -DBUILD_GUI=OFF # It might take a while if the vcpkg binary cache is unpopulated or invalidated.
cmake --build build --config Release # Use "-j N" for N parallel jobs.
ctest --test-dir build --build-config Release # Use "-j N" for N parallel tests. Some tests are disabled if Python 3 is not available.
cmake --build build --config Release # Append "-j N" for N parallel jobs.
ctest --test-dir build --build-config Release # Append "-j N" for N parallel tests. Some tests are disabled if Python 3 is not available.
```
### 6. vcpkg-specific Issues and Workarounds
vcpkg installation during the configuration step might fail for various reasons unrelated to Bitcoin Core.
If the failure is due to a "Buildtrees path … is too long" error, which is often encountered when building
with `BUILD_GUI=ON` and using the default vcpkg installation provided by Visual Studio, you can
specify a shorter path to store intermediate build files by using
the [`--x-buildtrees-root`](https://learn.microsoft.com/en-us/vcpkg/commands/common-options#buildtrees-root) option:
```powershell
cmake -B build --preset vs2022-static -DVCPKG_INSTALL_OPTIONS="--x-buildtrees-root=C:\vcpkg"
```
If vcpkg installation fails with the message "Paths with embedded space may be handled incorrectly", which
can occur if your local Bitcoin Core repository path contains spaces, you can override the vcpkg install directory
by setting the [`VCPKG_INSTALLED_DIR`](https://github.com/microsoft/vcpkg-docs/blob/main/vcpkg/users/buildsystems/cmake-integration.md#vcpkg_installed_dir) variable:
```powershell
cmake -B build --preset vs2022-static -DVCPKG_INSTALLED_DIR="C:\path_without_spaces"
```
## Performance Notes
### 6. vcpkg Manifest Default Features
### 7. vcpkg Manifest Default Features
One can skip vcpkg manifest default features to speedup the configuration step.
For example, the following invocation will skip all features except for "wallet" and "tests" and their dependencies:
@@ -90,6 +100,6 @@ cmake -B build --preset vs2022 -DVCPKG_MANIFEST_NO_DEFAULT_FEATURES=ON -DVCPKG_M
Available features are listed in the [`vcpkg.json`](/vcpkg.json) file.
### 7. Antivirus Software
### 8. Antivirus Software
To improve the build process performance, one might add the Bitcoin repository directory to the Microsoft Defender Antivirus exclusions.

View File

@@ -47,9 +47,9 @@ This means you cannot use a directory that is located directly on the host Windo
Build using:
gmake -C depends HOST=x86_64-w64-mingw32 # Use "-j N" for N parallel jobs.
gmake -C depends HOST=x86_64-w64-mingw32 # Append "-j N" for N parallel jobs.
cmake -B build --toolchain depends/x86_64-w64-mingw32/toolchain.cmake
cmake --build build # Use "-j N" for N parallel jobs.
cmake --build build # Append "-j N" for N parallel jobs.
## Depends system

View File

@@ -30,9 +30,13 @@ Bitcoin Core requires one of the following compilers.
| [Fontconfig](../depends/packages/fontconfig.mk) (gui) | [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) (gui) | [link](https://freetype.org) | [2.11.0](https://github.com/bitcoin/bitcoin/commit/01544dd78ccc0b0474571da854e27adef97137fb) | 2.3.0 | Yes |
| [qrencode](../depends/packages/qrencode.mk) (gui) | [link](https://fukuchi.org/works/qrencode/) | [4.1.1](https://github.com/bitcoin/bitcoin/pull/27312) | N/A | No |
| [Qt](../depends/packages/qt.mk) (gui) | [link](https://download.qt.io/official_releases/qt/) | [5.15.16](https://github.com/bitcoin/bitcoin/pull/30774) | [5.11.3](https://github.com/bitcoin/bitcoin/pull/24132) | No |
| [Qt](../depends/packages/qt.mk) (gui) | [link](https://download.qt.io/archive/qt/) | [5.15.16](https://github.com/bitcoin/bitcoin/pull/30774) | [5.11.3](https://github.com/bitcoin/bitcoin/pull/24132) | No |
| [ZeroMQ](../depends/packages/zeromq.mk) (notifications) | [link](https://github.com/zeromq/libzmq/releases) | [4.3.4](https://github.com/bitcoin/bitcoin/pull/23956) | 4.0.0 | No |
| [Berkeley DB](../depends/packages/bdb.mk) (legacy wallet) | [link](https://www.oracle.com/technetwork/database/database-technologies/berkeleydb/downloads/index.html) | 4.8.30 | 4.8.x | No |
| [SQLite](../depends/packages/sqlite.mk) (wallet) | [link](https://sqlite.org) | [3.38.5](https://github.com/bitcoin/bitcoin/pull/25378) | [3.7.17](https://github.com/bitcoin/bitcoin/pull/19077) | No |
| Python (scripts, tests) | [link](https://www.python.org) | N/A | [3.10](https://github.com/bitcoin/bitcoin/pull/30527) | No |
| [systemtap](../depends/packages/systemtap.mk) ([tracing](tracing.md)) | [link](https://sourceware.org/systemtap/) | [4.8](https://github.com/bitcoin/bitcoin/pull/26945)| N/A | No |
| [capnproto](../depends/packages/capnp.mk) ([multiprocess](multiprocess.md)) | [link](https://capnproto.org/) | [1.2.0](https://github.com/bitcoin/bitcoin/pull/32760)| [0.7.0](https://github.com/bitcoin-core/libmultiprocess/pull/88) | No |
| [libmultiprocess](../depends/packages/libmultiprocess.mk) ([multiprocess](multiprocess.md)) | [link](https://github.com/bitcoin-core/libmultiprocess) | [5.0](https://github.com/bitcoin/bitcoin/pull/31945)| [v5.0-pre1](https://github.com/bitcoin/bitcoin/pull/31740)* | No |
\* Libmultiprocess 5.x versions should be compatible, but 6.0 and later are not due to bitcoin-core/libmultiprocess#160.

View File

@@ -19,7 +19,7 @@ One can use `--preset=libfuzzer-nosan` to do the same without common sanitizers
See [further](#run-without-sanitizers-for-increased-throughput) for more information.
There is also a runner script to execute all fuzz targets. Refer to
`./test/fuzz/test_runner.py --help` for more details.
`./build_fuzz/test/fuzz/test_runner.py --help` for more details.
## Overview of Bitcoin Core fuzzing

View File

@@ -1,5 +1,201 @@
.TH BITCOIN-CLI "1"
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3.
.TH BITCOIN-CLI "1" "January 2026" "bitcoin-cli v29.3.0rc1" "User Commands"
.SH NAME
bitcoin-cli \- manual page for bitcoin-cli
bitcoin-cli \- manual page for bitcoin-cli v29.3.0rc1
.SH SYNOPSIS
.B bitcoin-cli
[\fI\,options\/\fR] \fI\,<command> \/\fR[\fI\,params\/\fR]
.br
.B bitcoin-cli
[\fI\,options\/\fR] \fI\,-named <command> \/\fR[\fI\,name=value\/\fR]...
.br
.B bitcoin-cli
[\fI\,options\/\fR] \fI\,help\/\fR
.br
.B bitcoin-cli
[\fI\,options\/\fR] \fI\,help <command>\/\fR
.SH DESCRIPTION
Bitcoin Core RPC client version v29.3.0rc1
.PP
The bitcoin\-cli utility provides a command line interface to interact with a Bitcoin Core RPC server.
.PP
It can be used to query network information, manage wallets, create or broadcast transactions, and control the Bitcoin Core server.
.PP
Use the "help" command to list all commands. Use "help <command>" to show help for that command.
The \fB\-named\fR option allows you to specify parameters using the key=value format, eliminating the need to pass unused positional parameters.
.SH OPTIONS
.HP
\fB\-color=\fR<when>
.IP
Color setting for CLI output (default: auto). Valid values: always, auto
(add color codes when standard output is connected to a terminal
and OS is not WIN32), never. Only applies to the output of
\fB\-getinfo\fR.
.HP
\fB\-conf=\fR<file>
.IP
Specify configuration file. Relative paths will be prefixed by datadir
location. (default: bitcoin.conf)
.HP
\fB\-datadir=\fR<dir>
.IP
Specify data directory
.HP
\fB\-help\fR
.IP
Print this help message and exit (also \fB\-h\fR or \-?)
.HP
\fB\-named\fR
.IP
Pass named instead of positional arguments (default: false)
.HP
\fB\-rpcclienttimeout=\fR<n>
.IP
Timeout in seconds during HTTP requests, or 0 for no timeout. (default:
900)
.HP
\fB\-rpcconnect=\fR<ip>
.IP
Send commands to node running on <ip> (default: 127.0.0.1)
.HP
\fB\-rpccookiefile=\fR<loc>
.IP
Location of the auth cookie. Relative paths will be prefixed by a
net\-specific datadir location. (default: data dir)
.HP
\fB\-rpcpassword=\fR<pw>
.IP
Password for JSON\-RPC connections
.HP
\fB\-rpcport=\fR<port>
.IP
Connect to JSON\-RPC on <port> (default: 8332, testnet: 18332, testnet4:
48332, signet: 38332, regtest: 18443)
.HP
\fB\-rpcuser=\fR<user>
.IP
Username for JSON\-RPC connections
.HP
\fB\-rpcwait\fR
.IP
Wait for RPC server to start
.HP
\fB\-rpcwaittimeout=\fR<n>
.IP
Timeout in seconds to wait for the RPC server to start, or 0 for no
timeout. (default: 0)
.HP
\fB\-rpcwallet=\fR<walletname>
.IP
Send RPC for non\-default wallet on RPC server (needs to exactly match
corresponding \fB\-wallet\fR option passed to bitcoind). This changes
the RPC endpoint used, e.g.
http://127.0.0.1:8332/wallet/<walletname>
.HP
\fB\-stdin\fR
.IP
Read extra arguments from standard input, one per line until EOF/Ctrl\-D
(recommended for sensitive information such as passphrases). When
combined with \fB\-stdinrpcpass\fR, the first line from standard input
is used for the RPC password.
.HP
\fB\-stdinrpcpass\fR
.IP
Read RPC password from standard input as a single line. When combined
with \fB\-stdin\fR, the first line from standard input is used for the
RPC password. When combined with \fB\-stdinwalletpassphrase\fR,
\fB\-stdinrpcpass\fR consumes the first line, and \fB\-stdinwalletpassphrase\fR
consumes the second.
.HP
\fB\-stdinwalletpassphrase\fR
.IP
Read wallet passphrase from standard input as a single line. When
combined with \fB\-stdin\fR, the first line from standard input is used
for the wallet passphrase.
.HP
\fB\-version\fR
.IP
Print version and exit
.PP
Debugging/Testing options:
.PP
Chain selection options:
.HP
\fB\-chain=\fR<chain>
.IP
Use the chain <chain> (default: main). Allowed values: main, test,
testnet4, signet, regtest
.HP
\fB\-signet\fR
.IP
Use the signet chain. Equivalent to \fB\-chain\fR=\fI\,signet\/\fR. Note that the network
is defined by the \fB\-signetchallenge\fR parameter
.HP
\fB\-signetchallenge\fR
.IP
Blocks must satisfy the given script to be considered valid (only for
signet networks; defaults to the global default signet test
network challenge)
.HP
\fB\-signetseednode\fR
.IP
Specify a seed node for the signet network, in the hostname[:port]
format, e.g. sig.net:1234 (may be used multiple times to specify
multiple seed nodes; defaults to the global default signet test
network seed node(s))
.HP
\fB\-testnet\fR
.IP
Use the testnet3 chain. Equivalent to \fB\-chain\fR=\fI\,test\/\fR. Support for testnet3
is deprecated and will be removed in an upcoming release.
Consider moving to testnet4 now by using \fB\-testnet4\fR.
.HP
\fB\-testnet4\fR
.IP
Use the testnet4 chain. Equivalent to \fB\-chain\fR=\fI\,testnet4\/\fR.
.PP
CLI Commands:
.HP
\fB\-addrinfo\fR
.IP
Get the number of addresses known to the node, per network and total,
after filtering for quality and recency. The total number of
addresses known to the node may be higher.
.HP
\fB\-generate\fR
.IP
Generate blocks, equivalent to RPC getnewaddress followed by RPC
generatetoaddress. Optional positional integer arguments are
number of blocks to generate (default: 1) and maximum iterations
to try (default: 1000000), equivalent to RPC generatetoaddress
nblocks and maxtries arguments. Example: bitcoin\-cli \fB\-generate\fR 4
1000
.HP
\fB\-getinfo\fR
.IP
Get general information from the remote server. Note that unlike
server\-side RPC calls, the output of \fB\-getinfo\fR is the result of
multiple non\-atomic requests. Some entries in the output may
represent results from different states (e.g. wallet balance may
be as of a different block from the chain state reported)
.HP
\fB\-netinfo\fR
.IP
Get network peer connection information from the remote server. An
optional argument from 0 to 4 can be passed for different peers
listings (default: 0). If a non\-zero value is passed, an
additional "outonly" (or "o") argument can be passed to see
outbound peers only. Pass "help" (or "h") for detailed help
documentation.
.SH COPYRIGHT
Copyright (C) 2009-2025 The Bitcoin Core developers
This is a placeholder file. Please follow the instructions in \fIcontrib/devtools/README.md\fR to generate the manual pages after a release.
Please contribute if you find Bitcoin Core useful. Visit
<https://bitcoincore.org/> for further information about the software.
The source code is available from <https://github.com/bitcoin/bitcoin>.
This is experimental software.
Distributed under the MIT software license, see the accompanying file COPYING
or <https://opensource.org/licenses/MIT>
.SH "SEE ALSO"
bitcoind(1), bitcoin-cli(1), bitcoin-tx(1), bitcoin-wallet(1), bitcoin-util(1), bitcoin-qt(1)

View File

@@ -1,5 +1,852 @@
.TH BITCOIN-QT "1"
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3.
.TH BITCOIN-QT "1" "January 2026" "bitcoin-qt v29.3.0rc1" "User Commands"
.SH NAME
bitcoin-qt \- manual page for bitcoin-qt
bitcoin-qt \- manual page for bitcoin-qt v29.3.0rc1
.SH SYNOPSIS
.B bitcoin-qt
[\fI\,options\/\fR] [\fI\,URI\/\fR]
.SH DESCRIPTION
Bitcoin Core version v29.3.0rc1
.PP
The bitcoin\-qt application provides a graphical interface for interacting with Bitcoin Core.
.PP
It combines the core functionalities of bitcoind with a user\-friendly interface for wallet management, transaction history, and network statistics.
.PP
It is suitable for users who prefer a graphical over a command\-line interface.
.PP
You can optionally specify a payment [URI], in e.g. the BIP21 URI format.
.SH OPTIONS
.HP
\fB\-alertnotify=\fR<cmd>
.IP
Execute command when an alert is raised (%s in cmd is replaced by
message)
.HP
\fB\-allowignoredconf\fR
.IP
For backwards compatibility, treat an unused bitcoin.conf file in the
datadir as a warning, not an error.
.HP
\fB\-assumevalid=\fR<hex>
.IP
If this block is in the chain assume that it and its ancestors are valid
and potentially skip their script verification (0 to verify all,
default:
00000000000000000001b658dd1120e82e66d2790811f89ede9742ada3ed6d77,
testnet3:
00000000000003fc7967410ba2d0a8a8d50daedc318d43e8baf1a9782c236a57,
testnet4:
0000000000003ed4f08dbdf6f7d6b271a6bcffce25675cb40aa9fa43179a89f3,
signet:
000000895a110f46e59eb82bbc5bfb67fa314656009c295509c21b4999f5180a)
.HP
\fB\-blockfilterindex=\fR<type>
.IP
Maintain an index of compact filters by block (default: 0, values:
basic). If <type> is not supplied or if <type> = 1, indexes for
all known types are enabled.
.HP
\fB\-blocknotify=\fR<cmd>
.IP
Execute command when the best block changes (%s in cmd is replaced by
block hash)
.HP
\fB\-blockreconstructionextratxn=\fR<n>
.IP
Extra transactions to keep in memory for compact block reconstructions
(default: 100)
.HP
\fB\-blocksdir=\fR<dir>
.IP
Specify directory to hold blocks subdirectory for *.dat files (default:
<datadir>)
.HP
\fB\-blocksonly\fR
.IP
Whether to reject transactions from network peers. Disables automatic
broadcast and rebroadcast of transactions, unless the source peer
has the 'forcerelay' permission. RPC transactions are not
affected. (default: 0)
.HP
\fB\-blocksxor\fR
.IP
Whether an XOR\-key applies to blocksdir *.dat files. The created XOR\-key
will be zeros for an existing blocksdir or when `\-blocksxor=0` is
set, and random for a freshly initialized blocksdir. (default: 1)
.HP
\fB\-coinstatsindex\fR
.IP
Maintain coinstats index used by the gettxoutsetinfo RPC (default: 0)
.HP
\fB\-conf=\fR<file>
.IP
Specify path to read\-only configuration file. Relative paths will be
prefixed by datadir location (only useable from command line, not
configuration file) (default: bitcoin.conf)
.HP
\fB\-daemon\fR
.IP
Run in the background as a daemon and accept commands (default: 0)
.HP
\fB\-daemonwait\fR
.IP
Wait for initialization to be finished before exiting. This implies
\fB\-daemon\fR (default: 0)
.HP
\fB\-datadir=\fR<dir>
.IP
Specify data directory
.HP
\fB\-dbcache=\fR<n>
.IP
Maximum database cache size <n> MiB (minimum 4, default: 450). Make sure
you have enough RAM. In addition, unused memory allocated to the
mempool is shared with this cache (see \fB\-maxmempool\fR).
.HP
\fB\-debuglogfile=\fR<file>
.IP
Specify location of debug log file (default: debug.log). Relative paths
will be prefixed by a net\-specific datadir location. Pass
\fB\-nodebuglogfile\fR to disable writing the log to a file.
.HP
\fB\-help\fR
.IP
Print this help message and exit (also \fB\-h\fR or \-?)
.HP
\fB\-includeconf=\fR<file>
.IP
Specify additional configuration file, relative to the \fB\-datadir\fR path
(only useable from configuration file, not command line)
.HP
\fB\-loadblock=\fR<file>
.IP
Imports blocks from external file on startup
.HP
\fB\-maxmempool=\fR<n>
.IP
Keep the transaction memory pool below <n> megabytes (default: 300)
.HP
\fB\-maxorphantx=\fR<n>
.IP
Keep at most <n> unconnectable transactions in memory (default: 100)
.HP
\fB\-mempoolexpiry=\fR<n>
.IP
Do not keep transactions in the mempool longer than <n> hours (default:
336)
.HP
\fB\-par=\fR<n>
.IP
Set the number of script verification threads (0 = auto, up to 15, <0 =
leave that many cores free, default: 0)
.HP
\fB\-persistmempool\fR
.IP
Whether to save the mempool on shutdown and load on restart (default: 1)
.HP
\fB\-persistmempoolv1\fR
.IP
Whether a mempool.dat file created by \fB\-persistmempool\fR or the savemempool
RPC will be written in the legacy format (version 1) or the
current format (version 2). This temporary option will be removed
in the future. (default: 0)
.HP
\fB\-pid=\fR<file>
.IP
Specify pid file. Relative paths will be prefixed by a net\-specific
datadir location. (default: bitcoind.pid)
.HP
\fB\-prune=\fR<n>
.IP
Reduce storage requirements by enabling pruning (deleting) of old
blocks. This allows the pruneblockchain RPC to be called to
delete specific blocks and enables automatic pruning of old
blocks if a target size in MiB is provided. This mode is
incompatible with \fB\-txindex\fR. Warning: Reverting this setting
requires re\-downloading the entire blockchain. (default: 0 =
disable pruning blocks, 1 = allow manual pruning via RPC, >=550 =
automatically prune block files to stay under the specified
target size in MiB)
.HP
\fB\-reindex\fR
.IP
If enabled, wipe chain state and block index, and rebuild them from
blk*.dat files on disk. Also wipe and rebuild other optional
indexes that are active. If an assumeutxo snapshot was loaded,
its chainstate will be wiped as well. The snapshot can then be
reloaded via RPC.
.HP
\fB\-reindex\-chainstate\fR
.IP
If enabled, wipe chain state, and rebuild it from blk*.dat files on
disk. If an assumeutxo snapshot was loaded, its chainstate will
be wiped as well. The snapshot can then be reloaded via RPC.
.HP
\fB\-settings=\fR<file>
.IP
Specify path to dynamic settings data file. Can be disabled with
\fB\-nosettings\fR. File is written at runtime and not meant to be
edited by users (use bitcoin.conf instead for custom settings).
Relative paths will be prefixed by datadir location. (default:
settings.json)
.HP
\fB\-shutdownnotify=\fR<cmd>
.IP
Execute command immediately before beginning shutdown. The need for
shutdown may be urgent, so be careful not to delay it long (if
the command doesn't require interaction with the server, consider
having it fork into the background).
.HP
\fB\-startupnotify=\fR<cmd>
.IP
Execute command on startup.
.HP
\fB\-txindex\fR
.IP
Maintain a full transaction index, used by the getrawtransaction rpc
call (default: 0)
.HP
\fB\-version\fR
.IP
Print version and exit
.PP
Connection options:
.HP
\fB\-addnode=\fR<ip>
.IP
Add a node to connect to and attempt to keep the connection open (see
the addnode RPC help for more info). This option can be specified
multiple times to add multiple nodes; connections are limited to
8 at a time and are counted separately from the \fB\-maxconnections\fR
limit.
.HP
\fB\-asmap=\fR<file>
.IP
Specify asn mapping used for bucketing of the peers (default:
ip_asn.map). Relative paths will be prefixed by the net\-specific
datadir location.
.HP
\fB\-bantime=\fR<n>
.IP
Default duration (in seconds) of manually configured bans (default:
86400)
.HP
\fB\-bind=\fR<addr>[:<port>][=onion]
.IP
Bind to given address and always listen on it (default: 0.0.0.0). Use
[host]:port notation for IPv6. Append =onion to tag any incoming
connections to that address and port as incoming Tor connections
(default: 127.0.0.1:8334=onion, testnet3: 127.0.0.1:18334=onion,
testnet4: 127.0.0.1:48334=onion, signet: 127.0.0.1:38334=onion,
regtest: 127.0.0.1:18445=onion)
.HP
\fB\-cjdnsreachable\fR
.IP
If set, then this host is configured for CJDNS (connecting to fc00::/8
addresses would lead us to the CJDNS network, see doc/cjdns.md)
(default: 0)
.HP
\fB\-connect=\fR<ip>
.IP
Connect only to the specified node; \fB\-noconnect\fR disables automatic
connections (the rules for this peer are the same as for
\fB\-addnode\fR). This option can be specified multiple times to connect
to multiple nodes.
.HP
\fB\-discover\fR
.IP
Discover own IP addresses (default: 1 when listening and no \fB\-externalip\fR
or \fB\-proxy\fR)
.HP
\fB\-dns\fR
.IP
Allow DNS lookups for \fB\-addnode\fR, \fB\-seednode\fR and \fB\-connect\fR (default: 1)
.HP
\fB\-dnsseed\fR
.IP
Query for peer addresses via DNS lookup, if low on addresses (default: 1
unless \fB\-connect\fR used or \fB\-maxconnections\fR=\fI\,0\/\fR)
.HP
\fB\-externalip=\fR<ip>
.IP
Specify your own public address
.HP
\fB\-fixedseeds\fR
.IP
Allow fixed seeds if DNS seeds don't provide peers (default: 1)
.HP
\fB\-forcednsseed\fR
.IP
Always query for peer addresses via DNS lookup (default: 0)
.HP
\fB\-i2pacceptincoming\fR
.IP
Whether to accept inbound I2P connections (default: 1). Ignored if
\fB\-i2psam\fR is not set. Listening for inbound I2P connections is done
through the SAM proxy, not by binding to a local address and
port.
.HP
\fB\-i2psam=\fR<ip:port>
.IP
I2P SAM proxy to reach I2P peers and accept I2P connections (default:
none)
.HP
\fB\-listen\fR
.IP
Accept connections from outside (default: 1 if no \fB\-proxy\fR, \fB\-connect\fR or
\fB\-maxconnections\fR=\fI\,0\/\fR)
.HP
\fB\-listenonion\fR
.IP
Automatically create Tor onion service (default: 1)
.HP
\fB\-maxconnections=\fR<n>
.IP
Maintain at most <n> automatic connections to peers (default: 125). This
limit does not apply to connections manually added via \fB\-addnode\fR
or the addnode RPC, which have a separate limit of 8.
.HP
\fB\-maxreceivebuffer=\fR<n>
.IP
Maximum per\-connection receive buffer, <n>*1000 bytes (default: 5000)
.HP
\fB\-maxsendbuffer=\fR<n>
.IP
Maximum per\-connection memory usage for the send buffer, <n>*1000 bytes
(default: 1000)
.HP
\fB\-maxuploadtarget=\fR<n>
.IP
Tries to keep outbound traffic under the given target per 24h. Limit
does not apply to peers with 'download' permission or blocks
created within past week. 0 = no limit (default: 0M). Optional
suffix units [k|K|m|M|g|G|t|T] (default: M). Lowercase is 1000
base while uppercase is 1024 base
.HP
\fB\-natpmp\fR
.IP
Use PCP or NAT\-PMP to map the listening port (default: 0)
.HP
\fB\-networkactive\fR
.IP
Enable all P2P network activity (default: 1). Can be changed by the
setnetworkactive RPC command
.HP
\fB\-onion=\fR<ip:port|path>
.IP
Use separate SOCKS5 proxy to reach peers via Tor onion services, set
\fB\-noonion\fR to disable (default: \fB\-proxy\fR). May be a local file path
prefixed with 'unix:'.
.HP
\fB\-onlynet=\fR<net>
.IP
Make automatic outbound connections only to network <net> (ipv4, ipv6,
onion, i2p, cjdns). Inbound and manual connections are not
affected by this option. It can be specified multiple times to
allow multiple networks.
.HP
\fB\-peerblockfilters\fR
.IP
Serve compact block filters to peers per BIP 157 (default: 0)
.HP
\fB\-peerbloomfilters\fR
.IP
Support filtering of blocks and transaction with bloom filters (default:
0)
.HP
\fB\-port=\fR<port>
.IP
Listen for connections on <port> (default: 8333, testnet3: 18333,
testnet4: 48333, signet: 38333, regtest: 18444). Not relevant for
I2P (see doc/i2p.md). If set to a value x, the default onion
listening port will be set to x+1.
.HP
\fB\-proxy=\fR<ip:port|path>
.IP
Connect through SOCKS5 proxy, set \fB\-noproxy\fR to disable (default:
disabled). May be a local file path prefixed with 'unix:' if the
proxy supports it.
.HP
\fB\-proxyrandomize\fR
.IP
Randomize credentials for every proxy connection. This enables Tor
stream isolation (default: 1)
.HP
\fB\-seednode=\fR<ip>
.IP
Connect to a node to retrieve peer addresses, and disconnect. This
option can be specified multiple times to connect to multiple
nodes. During startup, seednodes will be tried before dnsseeds.
.HP
\fB\-timeout=\fR<n>
.IP
Specify socket connection timeout in milliseconds. If an initial attempt
to connect is unsuccessful after this amount of time, drop it
(minimum: 1, default: 5000)
.HP
\fB\-torcontrol=\fR<ip>:<port>
.IP
Tor control host and port to use if onion listening enabled (default:
127.0.0.1:9051). If no port is specified, the default port of
9051 will be used.
.HP
\fB\-torpassword=\fR<pass>
.IP
Tor control port password (default: empty)
.HP
\fB\-v2transport\fR
.IP
Support v2 transport (default: 1)
.HP
\fB\-whitebind=\fR<[permissions@]addr>
.IP
Bind to the given address and add permission flags to the peers
connecting to it. Use [host]:port notation for IPv6. Allowed
permissions: bloomfilter (allow requesting BIP37 filtered blocks
and transactions), noban (do not ban for misbehavior; implies
download), forcerelay (relay transactions that are already in the
mempool; implies relay), relay (relay even in \fB\-blocksonly\fR mode,
and unlimited transaction announcements), mempool (allow
requesting BIP35 mempool contents), download (allow getheaders
during IBD, no disconnect after maxuploadtarget limit), addr
(responses to GETADDR avoid hitting the cache and contain random
records with the most up\-to\-date info). Specify multiple
permissions separated by commas (default:
download,noban,mempool,relay). Can be specified multiple times.
.HP
\fB\-whitelist=\fR<[permissions@]IP address or network>
.IP
Add permission flags to the peers using the given IP address (e.g.
1.2.3.4) or CIDR\-notated network (e.g. 1.2.3.0/24). Uses the same
permissions as \fB\-whitebind\fR. Additional flags "in" and "out"
control whether permissions apply to incoming connections and/or
manual (default: incoming only). Can be specified multiple times.
.PP
Wallet options:
.HP
\fB\-addresstype\fR
.IP
What type of addresses to use ("legacy", "p2sh\-segwit", "bech32", or
"bech32m", default: "bech32")
.HP
\fB\-avoidpartialspends\fR
.IP
Group outputs by address, selecting many (possibly all) or none, instead
of selecting on a per\-output basis. Privacy is improved as
addresses are mostly swept with fewer transactions and outputs
are aggregated in clean change addresses. It may result in higher
fees due to less optimal coin selection caused by this added
limitation and possibly a larger\-than\-necessary number of inputs
being used. Always enabled for wallets with "avoid_reuse"
enabled, otherwise default: 0.
.HP
\fB\-changetype\fR
.IP
What type of change to use ("legacy", "p2sh\-segwit", "bech32", or
"bech32m"). Default is "legacy" when \fB\-addresstype\fR=\fI\,legacy\/\fR, else it
is an implementation detail.
.HP
\fB\-consolidatefeerate=\fR<amt>
.IP
The maximum feerate (in BTC/kvB) at which transaction building may use
more inputs than strictly necessary so that the wallet's UTXO
pool can be reduced (default: 0.0001).
.HP
\fB\-disablewallet\fR
.IP
Do not load the wallet and disable wallet RPC calls
.HP
\fB\-discardfee=\fR<amt>
.IP
The fee rate (in BTC/kvB) that indicates your tolerance for discarding
change by adding it to the fee (default: 0.0001). Note: An output
is discarded if it is dust at this rate, but we will always
discard up to the dust relay fee and a discard fee above that is
limited by the fee estimate for the longest target
.HP
\fB\-fallbackfee=\fR<amt>
.IP
A fee rate (in BTC/kvB) that will be used when fee estimation has
insufficient data. 0 to entirely disable the fallbackfee feature.
(default: 0.00)
.HP
\fB\-keypool=\fR<n>
.IP
Set key pool size to <n> (default: 1000). Warning: Smaller sizes may
increase the risk of losing funds when restoring from an old
backup, if none of the addresses in the original keypool have
been used.
.HP
\fB\-maxapsfee=\fR<n>
.IP
Spend up to this amount in additional (absolute) fees (in BTC) if it
allows the use of partial spend avoidance (default: 0.00)
.HP
\fB\-mintxfee=\fR<amt>
.IP
Fee rates (in BTC/kvB) smaller than this are considered zero fee for
transaction creation (default: 0.00001)
.HP
\fB\-paytxfee=\fR<amt>
.IP
Fee rate (in BTC/kvB) to add to transactions you send (default: 0.00)
.HP
\fB\-signer=\fR<cmd>
.IP
External signing tool, see doc/external\-signer.md
.HP
\fB\-spendzeroconfchange\fR
.IP
Spend unconfirmed change when sending transactions (default: 1)
.HP
\fB\-txconfirmtarget=\fR<n>
.IP
If paytxfee is not set, include enough fee so transactions begin
confirmation on average within n blocks (default: 6)
.HP
\fB\-wallet=\fR<path>
.IP
Specify wallet path to load at startup. Can be used multiple times to
load multiple wallets. Path is to a directory containing wallet
data and log files. If the path is not absolute, it is
interpreted relative to <walletdir>. This only loads existing
wallets and does not create new ones. For backwards compatibility
this also accepts names of existing top\-level data files in
<walletdir>.
.HP
\fB\-walletbroadcast\fR
.IP
Make the wallet broadcast transactions (default: 1)
.HP
\fB\-walletdir=\fR<dir>
.IP
Specify directory to hold wallets (default: <datadir>/wallets if it
exists, otherwise <datadir>)
.HP
\fB\-walletnotify=\fR<cmd>
.IP
Execute command when a wallet transaction changes. %s in cmd is replaced
by TxID, %w is replaced by wallet name, %b is replaced by the
hash of the block including the transaction (set to 'unconfirmed'
if the transaction is not included) and %h is replaced by the
block height (\fB\-1\fR if not included). %w is not currently
implemented on windows. On systems where %w is supported, it
should NOT be quoted because this would break shell escaping used
to invoke the command.
.HP
\fB\-walletrbf\fR
.IP
Send transactions with full\-RBF opt\-in enabled (RPC only, default: 1)
.PP
ZeroMQ notification options:
.HP
\fB\-zmqpubhashblock=\fR<address>
.IP
Enable publish hash block in <address>
.HP
\fB\-zmqpubhashblockhwm=\fR<n>
.IP
Set publish hash block outbound message high water mark (default: 1000)
.HP
\fB\-zmqpubhashtx=\fR<address>
.IP
Enable publish hash transaction in <address>
.HP
\fB\-zmqpubhashtxhwm=\fR<n>
.IP
Set publish hash transaction outbound message high water mark (default:
1000)
.HP
\fB\-zmqpubrawblock=\fR<address>
.IP
Enable publish raw block in <address>
.HP
\fB\-zmqpubrawblockhwm=\fR<n>
.IP
Set publish raw block outbound message high water mark (default: 1000)
.HP
\fB\-zmqpubrawtx=\fR<address>
.IP
Enable publish raw transaction in <address>
.HP
\fB\-zmqpubrawtxhwm=\fR<n>
.IP
Set publish raw transaction outbound message high water mark (default:
1000)
.HP
\fB\-zmqpubsequence=\fR<address>
.IP
Enable publish hash block and tx sequence in <address>
.HP
\fB\-zmqpubsequencehwm=\fR<n>
.IP
Set publish hash sequence message high water mark (default: 1000)
.PP
Debugging/Testing options:
.HP
\fB\-debug=\fR<category>
.IP
Output debug and trace logging (default: \fB\-nodebug\fR, supplying <category>
is optional). If <category> is not supplied or if <category> is 1
or "all", output all debug logging. If <category> is 0 or "none",
any other categories are ignored. Other valid values for
<category> are: addrman, bench, blockstorage, cmpctblock, coindb,
estimatefee, http, i2p, ipc, leveldb, libevent, mempool,
mempoolrej, net, proxy, prune, qt, rand, reindex, rpc, scan,
selectcoins, tor, txpackages, txreconciliation, validation,
walletdb, zmq. This option can be specified multiple times to
output multiple categories.
.HP
\fB\-debugexclude=\fR<category>
.IP
Exclude debug and trace logging for a category. Can be used in
conjunction with \fB\-debug\fR=\fI\,1\/\fR to output debug and trace logging for
all categories except the specified category. This option can be
specified multiple times to exclude multiple categories. This
takes priority over "\-debug"
.HP
\fB\-help\-debug\fR
.IP
Print help message with debugging options and exit
.HP
\fB\-logips\fR
.IP
Include IP addresses in debug output (default: 0)
.HP
\fB\-loglevelalways\fR
.IP
Always prepend a category and level (default: 0)
.HP
\fB\-logsourcelocations\fR
.IP
Prepend debug output with name of the originating source location
(source file, line number and function name) (default: 0)
.HP
\fB\-logthreadnames\fR
.IP
Prepend debug output with name of the originating thread (default: 0)
.HP
\fB\-logtimestamps\fR
.IP
Prepend debug output with timestamp (default: 1)
.HP
\fB\-maxtxfee=\fR<amt>
.IP
Maximum total fees (in BTC) to use in a single wallet transaction;
setting this too low may abort large transactions (default: 0.10)
.HP
\fB\-printtoconsole\fR
.IP
Send trace/debug info to console (default: 1 when no \fB\-daemon\fR. To disable
logging to file, set \fB\-nodebuglogfile\fR)
.HP
\fB\-shrinkdebugfile\fR
.IP
Shrink debug.log file on client startup (default: 1 when no \fB\-debug\fR)
.HP
\fB\-uacomment=\fR<cmt>
.IP
Append comment to the user agent string
.PP
Chain selection options:
.HP
\fB\-chain=\fR<chain>
.IP
Use the chain <chain> (default: main). Allowed values: main, test,
testnet4, signet, regtest
.HP
\fB\-signet\fR
.IP
Use the signet chain. Equivalent to \fB\-chain\fR=\fI\,signet\/\fR. Note that the network
is defined by the \fB\-signetchallenge\fR parameter
.HP
\fB\-signetchallenge\fR
.IP
Blocks must satisfy the given script to be considered valid (only for
signet networks; defaults to the global default signet test
network challenge)
.HP
\fB\-signetseednode\fR
.IP
Specify a seed node for the signet network, in the hostname[:port]
format, e.g. sig.net:1234 (may be used multiple times to specify
multiple seed nodes; defaults to the global default signet test
network seed node(s))
.HP
\fB\-testnet\fR
.IP
Use the testnet3 chain. Equivalent to \fB\-chain\fR=\fI\,test\/\fR. Support for testnet3
is deprecated and will be removed in an upcoming release.
Consider moving to testnet4 now by using \fB\-testnet4\fR.
.HP
\fB\-testnet4\fR
.IP
Use the testnet4 chain. Equivalent to \fB\-chain\fR=\fI\,testnet4\/\fR.
.PP
Node relay options:
.HP
\fB\-bytespersigop\fR
.IP
Equivalent bytes per sigop in transactions for relay and mining
(default: 20)
.HP
\fB\-datacarrier\fR
.IP
Relay and mine data carrier transactions (default: 1)
.HP
\fB\-datacarriersize\fR
.IP
Relay and mine transactions whose data\-carrying raw scriptPubKey is of
this size or less (default: 83)
.HP
\fB\-minrelaytxfee=\fR<amt>
.IP
Fees (in BTC/kvB) smaller than this are considered zero fee for
relaying, mining and transaction creation (default: 0.000001)
.HP
\fB\-permitbaremultisig\fR
.IP
Relay transactions creating non\-P2SH multisig outputs (default: 1)
.HP
\fB\-whitelistforcerelay\fR
.IP
Add 'forcerelay' permission to whitelisted peers with default
permissions. This will relay transactions even if the
transactions were already in the mempool. (default: 0)
.HP
\fB\-whitelistrelay\fR
.IP
Add 'relay' permission to whitelisted peers with default permissions.
This will accept relayed transactions even when not relaying
transactions (default: 1)
.PP
Block creation options:
.HP
\fB\-blockmaxweight=\fR<n>
.IP
Set maximum BIP141 block weight (default: 4000000)
.HP
\fB\-blockmintxfee=\fR<amt>
.IP
Set lowest fee rate (in BTC/kvB) for transactions to be included in
block creation. (default: 0.00000001)
.HP
\fB\-blockreservedweight=\fR<n>
.IP
Reserve space for the fixed\-size block header plus the largest coinbase
transaction the mining software may add to the block. (default:
8000).
.PP
RPC server options:
.HP
\fB\-rest\fR
.IP
Accept public REST requests (default: 0)
.HP
\fB\-rpcallowip=\fR<ip>
.IP
Allow JSON\-RPC connections from specified source. Valid values for <ip>
are a single IP (e.g. 1.2.3.4), a network/netmask (e.g.
1.2.3.4/255.255.255.0), a network/CIDR (e.g. 1.2.3.4/24), all
ipv4 (0.0.0.0/0), or all ipv6 (::/0). This option can be
specified multiple times
.HP
\fB\-rpcauth=\fR<userpw>
.IP
Username and HMAC\-SHA\-256 hashed password for JSON\-RPC connections. The
field <userpw> comes in the format: <USERNAME>:<SALT>$<HASH>. A
canonical python script is included in share/rpcauth. The client
then connects normally using the
rpcuser=<USERNAME>/rpcpassword=<PASSWORD> pair of arguments. This
option can be specified multiple times
.HP
\fB\-rpcbind=\fR<addr>[:port]
.IP
Bind to given address to listen for JSON\-RPC connections. Do not expose
the RPC server to untrusted networks such as the public internet!
This option is ignored unless \fB\-rpcallowip\fR is also passed. Port is
optional and overrides \fB\-rpcport\fR. Use [host]:port notation for
IPv6. This option can be specified multiple times (default:
127.0.0.1 and ::1 i.e., localhost)
.HP
\fB\-rpccookiefile=\fR<loc>
.IP
Location of the auth cookie. Relative paths will be prefixed by a
net\-specific datadir location. (default: data dir)
.HP
\fB\-rpccookieperms=\fR<readable\-by>
.IP
Set permissions on the RPC auth cookie file so that it is readable by
[owner|group|all] (default: owner [via umask 0077])
.HP
\fB\-rpcpassword=\fR<pw>
.IP
Password for JSON\-RPC connections
.HP
\fB\-rpcport=\fR<port>
.IP
Listen for JSON\-RPC connections on <port> (default: 8332, testnet3:
18332, testnet4: 48332, signet: 38332, regtest: 18443)
.HP
\fB\-rpcthreads=\fR<n>
.IP
Set the number of threads to service RPC calls (default: 16)
.HP
\fB\-rpcuser=\fR<user>
.IP
Username for JSON\-RPC connections
.HP
\fB\-rpcwhitelist=\fR<whitelist>
.IP
Set a whitelist to filter incoming RPC calls for a specific user. The
field <whitelist> comes in the format: <USERNAME>:<rpc 1>,<rpc
2>,...,<rpc n>. If multiple whitelists are set for a given user,
they are set\-intersected. See \fB\-rpcwhitelistdefault\fR documentation
for information on default whitelist behavior.
.HP
\fB\-rpcwhitelistdefault\fR
.IP
Sets default behavior for rpc whitelisting. Unless rpcwhitelistdefault
is set to 0, if any \fB\-rpcwhitelist\fR is set, the rpc server acts as
if all rpc users are subject to empty\-unless\-otherwise\-specified
whitelists. If rpcwhitelistdefault is set to 1 and no
\fB\-rpcwhitelist\fR is set, rpc server acts as if all rpc users are
subject to empty whitelists.
.HP
\fB\-server\fR
.IP
Accept command line and JSON\-RPC commands
.PP
UI Options:
.HP
\fB\-choosedatadir\fR
.IP
Choose data directory on startup (default: 0)
.HP
\fB\-lang=\fR<lang>
.IP
Set language, for example "de_DE" (default: system locale)
.HP
\fB\-min\fR
.IP
Start minimized
.HP
\fB\-resetguisettings\fR
.IP
Reset all settings changed in the GUI
.HP
\fB\-splash\fR
.IP
Show splash screen on startup (default: 1)
.SH COPYRIGHT
Copyright (C) 2009-2025 The Bitcoin Core developers
This is a placeholder file. Please follow the instructions in \fIcontrib/devtools/README.md\fR to generate the manual pages after a release.
Please contribute if you find Bitcoin Core useful. Visit
<https://bitcoincore.org/> for further information about the software.
The source code is available from <https://github.com/bitcoin/bitcoin>.
This is experimental software.
Distributed under the MIT software license, see the accompanying file COPYING
or <https://opensource.org/licenses/MIT>
.SH "SEE ALSO"
bitcoind(1), bitcoin-cli(1), bitcoin-tx(1), bitcoin-wallet(1), bitcoin-util(1), bitcoin-qt(1)

View File

@@ -1,5 +1,159 @@
.TH BITCOIN-TX "1"
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3.
.TH BITCOIN-TX "1" "January 2026" "bitcoin-tx v29.3.0rc1" "User Commands"
.SH NAME
bitcoin-tx \- manual page for bitcoin-tx
bitcoin-tx \- manual page for bitcoin-tx v29.3.0rc1
.SH SYNOPSIS
.B bitcoin-tx
[\fI\,options\/\fR] \fI\,<hex-tx> \/\fR[\fI\,commands\/\fR]
.br
.B bitcoin-tx
[\fI\,options\/\fR] \fI\,-create \/\fR[\fI\,commands\/\fR]
.SH DESCRIPTION
Bitcoin Core bitcoin\-tx utility version v29.3.0rc1
.PP
The bitcoin\-tx tool is used for creating and modifying bitcoin transactions.
.PP
bitcoin\-tx can be used with "<hex\-tx> [commands]" to update a hex\-encoded bitcoin transaction, or with "\-create [commands]" to create a hex\-encoded bitcoin transaction.
.SH OPTIONS
.HP
\fB\-create\fR
.IP
Create new, empty TX.
.HP
\fB\-help\fR
.IP
Print this help message and exit (also \fB\-h\fR or \-?)
.HP
\fB\-json\fR
.IP
Select JSON output
.HP
\fB\-txid\fR
.IP
Output only the hex\-encoded transaction id of the resultant transaction.
.HP
\fB\-version\fR
.IP
Print version and exit
.PP
Debugging/Testing options:
.PP
Chain selection options:
.HP
\fB\-chain=\fR<chain>
.IP
Use the chain <chain> (default: main). Allowed values: main, test,
testnet4, signet, regtest
.HP
\fB\-signet\fR
.IP
Use the signet chain. Equivalent to \fB\-chain\fR=\fI\,signet\/\fR. Note that the network
is defined by the \fB\-signetchallenge\fR parameter
.HP
\fB\-signetchallenge\fR
.IP
Blocks must satisfy the given script to be considered valid (only for
signet networks; defaults to the global default signet test
network challenge)
.HP
\fB\-signetseednode\fR
.IP
Specify a seed node for the signet network, in the hostname[:port]
format, e.g. sig.net:1234 (may be used multiple times to specify
multiple seed nodes; defaults to the global default signet test
network seed node(s))
.HP
\fB\-testnet\fR
.IP
Use the testnet3 chain. Equivalent to \fB\-chain\fR=\fI\,test\/\fR. Support for testnet3
is deprecated and will be removed in an upcoming release.
Consider moving to testnet4 now by using \fB\-testnet4\fR.
.HP
\fB\-testnet4\fR
.IP
Use the testnet4 chain. Equivalent to \fB\-chain\fR=\fI\,testnet4\/\fR.
.PP
Commands:
.IP
delin=N
.IP
Delete input N from TX
.IP
delout=N
.IP
Delete output N from TX
.IP
in=TXID:VOUT(:SEQUENCE_NUMBER)
.IP
Add input to TX
.IP
locktime=N
.IP
Set TX lock time to N
.IP
nversion=N
.IP
Set TX version to N
.IP
outaddr=VALUE:ADDRESS
.IP
Add address\-based output to TX
.IP
outdata=[VALUE:]DATA
.IP
Add data\-based output to TX
.IP
outmultisig=VALUE:REQUIRED:PUBKEYS:PUBKEY1:PUBKEY2:....[:FLAGS]
.IP
Add Pay To n\-of\-m Multi\-sig output to TX. n = REQUIRED, m = PUBKEYS.
Optionally add the "W" flag to produce a
pay\-to\-witness\-script\-hash output. Optionally add the "S" flag to
wrap the output in a pay\-to\-script\-hash.
.IP
outpubkey=VALUE:PUBKEY[:FLAGS]
.IP
Add pay\-to\-pubkey output to TX. Optionally add the "W" flag to produce a
pay\-to\-witness\-pubkey\-hash output. Optionally add the "S" flag to
wrap the output in a pay\-to\-script\-hash.
.IP
outscript=VALUE:SCRIPT[:FLAGS]
.IP
Add raw script output to TX. Optionally add the "W" flag to produce a
pay\-to\-witness\-script\-hash output. Optionally add the "S" flag to
wrap the output in a pay\-to\-script\-hash.
.IP
replaceable(=N)
.IP
Sets Replace\-By\-Fee (RBF) opt\-in sequence number for input N. If N is
not provided, the command attempts to opt\-in all available inputs
for RBF. If the transaction has no inputs, this option is
ignored.
.IP
sign=SIGHASH\-FLAGS
.IP
Add zero or more signatures to transaction. This command requires JSON
registers:prevtxs=JSON object, privatekeys=JSON object. See
signrawtransactionwithkey docs for format of sighash flags, JSON
objects.
.PP
Register Commands:
.IP
load=NAME:FILENAME
.IP
Load JSON file FILENAME into register NAME
.IP
set=NAME:JSON\-STRING
.IP
Set register NAME to given JSON\-STRING
.SH COPYRIGHT
Copyright (C) 2009-2025 The Bitcoin Core developers
This is a placeholder file. Please follow the instructions in \fIcontrib/devtools/README.md\fR to generate the manual pages after a release.
Please contribute if you find Bitcoin Core useful. Visit
<https://bitcoincore.org/> for further information about the software.
The source code is available from <https://github.com/bitcoin/bitcoin>.
This is experimental software.
Distributed under the MIT software license, see the accompanying file COPYING
or <https://opensource.org/licenses/MIT>
.SH "SEE ALSO"
bitcoind(1), bitcoin-cli(1), bitcoin-tx(1), bitcoin-wallet(1), bitcoin-util(1), bitcoin-qt(1)

View File

@@ -1,5 +1,78 @@
.TH BITCOIN-UTIL "1"
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3.
.TH BITCOIN-UTIL "1" "January 2026" "bitcoin-util v29.3.0rc1" "User Commands"
.SH NAME
bitcoin-util \- manual page for bitcoin-util
bitcoin-util \- manual page for bitcoin-util v29.3.0rc1
.SH SYNOPSIS
.B bitcoin-util
[\fI\,options\/\fR] [\fI\,command\/\fR]
.br
.B bitcoin-util
[\fI\,options\/\fR] \fI\,grind <hex-block-header>\/\fR
.SH DESCRIPTION
Bitcoin Core bitcoin\-util utility version v29.3.0rc1
.PP
The bitcoin\-util tool provides bitcoin related functionality that does not rely on the ability to access a running node. Available [commands] are listed below.
.SH OPTIONS
.HP
\fB\-help\fR
.IP
Print this help message and exit (also \fB\-h\fR or \-?)
.HP
\fB\-version\fR
.IP
Print version and exit
.PP
Debugging/Testing options:
.PP
Chain selection options:
.HP
\fB\-chain=\fR<chain>
.IP
Use the chain <chain> (default: main). Allowed values: main, test,
testnet4, signet, regtest
.HP
\fB\-signet\fR
.IP
Use the signet chain. Equivalent to \fB\-chain\fR=\fI\,signet\/\fR. Note that the network
is defined by the \fB\-signetchallenge\fR parameter
.HP
\fB\-signetchallenge\fR
.IP
Blocks must satisfy the given script to be considered valid (only for
signet networks; defaults to the global default signet test
network challenge)
.HP
\fB\-signetseednode\fR
.IP
Specify a seed node for the signet network, in the hostname[:port]
format, e.g. sig.net:1234 (may be used multiple times to specify
multiple seed nodes; defaults to the global default signet test
network seed node(s))
.HP
\fB\-testnet\fR
.IP
Use the testnet3 chain. Equivalent to \fB\-chain\fR=\fI\,test\/\fR. Support for testnet3
is deprecated and will be removed in an upcoming release.
Consider moving to testnet4 now by using \fB\-testnet4\fR.
.HP
\fB\-testnet4\fR
.IP
Use the testnet4 chain. Equivalent to \fB\-chain\fR=\fI\,testnet4\/\fR.
.PP
Commands:
.IP
grind
.IP
Perform proof of work on hex header string
.SH COPYRIGHT
Copyright (C) 2009-2025 The Bitcoin Core developers
This is a placeholder file. Please follow the instructions in \fIcontrib/devtools/README.md\fR to generate the manual pages after a release.
Please contribute if you find Bitcoin Core useful. Visit
<https://bitcoincore.org/> for further information about the software.
The source code is available from <https://github.com/bitcoin/bitcoin>.
This is experimental software.
Distributed under the MIT software license, see the accompanying file COPYING
or <https://opensource.org/licenses/MIT>
.SH "SEE ALSO"
bitcoind(1), bitcoin-cli(1), bitcoin-tx(1), bitcoin-wallet(1), bitcoin-util(1), bitcoin-qt(1)

View File

@@ -1,5 +1,136 @@
.TH BITCOIN-WALLET "1"
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3.
.TH BITCOIN-WALLET "1" "January 2026" "bitcoin-wallet v29.3.0rc1" "User Commands"
.SH NAME
bitcoin-wallet \- manual page for bitcoin-wallet
bitcoin-wallet \- manual page for bitcoin-wallet v29.3.0rc1
.SH SYNOPSIS
.B bitcoin-wallet
[\fI\,options\/\fR] \fI\,<command>\/\fR
.SH DESCRIPTION
Bitcoin Core bitcoin\-wallet utility version v29.3.0rc1
.PP
bitcoin\-wallet is an offline tool for creating and interacting with Bitcoin Core wallet files.
.PP
By default bitcoin\-wallet will act on wallets in the default mainnet wallet directory in the datadir.
.PP
To change the target wallet, use the \fB\-datadir\fR, \fB\-wallet\fR and (test)chain selection arguments.
.SH OPTIONS
.HP
\fB\-datadir=\fR<dir>
.IP
Specify data directory
.HP
\fB\-descriptors\fR
.IP
Create descriptors wallet. Only for 'create'
.HP
\fB\-dumpfile=\fR<file name>
.IP
When used with 'dump', writes out the records to this file. When used
with 'createfromdump', loads the records into a new wallet.
.HP
\fB\-format=\fR<format>
.IP
The format of the wallet file to create. Either "bdb" or "sqlite". Only
used with 'createfromdump'
.HP
\fB\-help\fR
.IP
Print this help message and exit (also \fB\-h\fR or \-?)
.HP
\fB\-legacy\fR
.IP
Create legacy wallet. Only for 'create'
.HP
\fB\-version\fR
.IP
Print version and exit
.HP
\fB\-wallet=\fR<wallet\-name>
.IP
Specify wallet name
.PP
Debugging/Testing options:
.HP
\fB\-debug=\fR<category>
.IP
Output debugging information (default: 0).
.HP
\fB\-printtoconsole\fR
.IP
Send trace/debug info to console (default: 1 when no \fB\-debug\fR is true, 0
otherwise).
.HP
\fB\-withinternalbdb\fR
.IP
Use the internal Berkeley DB parser when dumping a Berkeley DB wallet
file (default: false)
.PP
Chain selection options:
.HP
\fB\-chain=\fR<chain>
.IP
Use the chain <chain> (default: main). Allowed values: main, test,
testnet4, signet, regtest
.HP
\fB\-signet\fR
.IP
Use the signet chain. Equivalent to \fB\-chain\fR=\fI\,signet\/\fR. Note that the network
is defined by the \fB\-signetchallenge\fR parameter
.HP
\fB\-signetchallenge\fR
.IP
Blocks must satisfy the given script to be considered valid (only for
signet networks; defaults to the global default signet test
network challenge)
.HP
\fB\-signetseednode\fR
.IP
Specify a seed node for the signet network, in the hostname[:port]
format, e.g. sig.net:1234 (may be used multiple times to specify
multiple seed nodes; defaults to the global default signet test
network seed node(s))
.HP
\fB\-testnet\fR
.IP
Use the testnet3 chain. Equivalent to \fB\-chain\fR=\fI\,test\/\fR. Support for testnet3
is deprecated and will be removed in an upcoming release.
Consider moving to testnet4 now by using \fB\-testnet4\fR.
.HP
\fB\-testnet4\fR
.IP
Use the testnet4 chain. Equivalent to \fB\-chain\fR=\fI\,testnet4\/\fR.
.PP
Commands:
.IP
create
.IP
Create new wallet file
.IP
createfromdump
.IP
Create new wallet file from dumped records
.IP
dump
.IP
Print out all of the wallet key\-value records
.IP
info
.IP
Get wallet info
.IP
salvage
.IP
Attempt to recover private keys from a corrupt wallet. Warning:
\&'salvage' is experimental.
.SH COPYRIGHT
Copyright (C) 2009-2025 The Bitcoin Core developers
This is a placeholder file. Please follow the instructions in \fIcontrib/devtools/README.md\fR to generate the manual pages after a release.
Please contribute if you find Bitcoin Core useful. Visit
<https://bitcoincore.org/> for further information about the software.
The source code is available from <https://github.com/bitcoin/bitcoin>.
This is experimental software.
Distributed under the MIT software license, see the accompanying file COPYING
or <https://opensource.org/licenses/MIT>
.SH "SEE ALSO"
bitcoind(1), bitcoin-cli(1), bitcoin-tx(1), bitcoin-wallet(1), bitcoin-util(1), bitcoin-qt(1)

View File

@@ -1,5 +1,830 @@
.TH BITCOIND "1"
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3.
.TH BITCOIND "1" "January 2026" "bitcoind v29.3.0rc1" "User Commands"
.SH NAME
bitcoind \- manual page for bitcoind
bitcoind \- manual page for bitcoind v29.3.0rc1
.SH SYNOPSIS
.B bitcoind
[\fI\,options\/\fR]
.SH DESCRIPTION
Bitcoin Core daemon version v29.3.0rc1
.PP
The Bitcoin Core daemon (bitcoind) is a headless program that connects to the Bitcoin network to validate and relay transactions and blocks, as well as relaying addresses.
.PP
It provides the backbone of the Bitcoin network and its RPC, REST and ZMQ services can provide various transaction, block and address\-related services.
.PP
There is an optional wallet component which provides transaction services.
.PP
It can be used in a headless environment or as part of a server setup.
.SH OPTIONS
.HP
\fB\-alertnotify=\fR<cmd>
.IP
Execute command when an alert is raised (%s in cmd is replaced by
message)
.HP
\fB\-allowignoredconf\fR
.IP
For backwards compatibility, treat an unused bitcoin.conf file in the
datadir as a warning, not an error.
.HP
\fB\-assumevalid=\fR<hex>
.IP
If this block is in the chain assume that it and its ancestors are valid
and potentially skip their script verification (0 to verify all,
default:
00000000000000000001b658dd1120e82e66d2790811f89ede9742ada3ed6d77,
testnet3:
00000000000003fc7967410ba2d0a8a8d50daedc318d43e8baf1a9782c236a57,
testnet4:
0000000000003ed4f08dbdf6f7d6b271a6bcffce25675cb40aa9fa43179a89f3,
signet:
000000895a110f46e59eb82bbc5bfb67fa314656009c295509c21b4999f5180a)
.HP
\fB\-blockfilterindex=\fR<type>
.IP
Maintain an index of compact filters by block (default: 0, values:
basic). If <type> is not supplied or if <type> = 1, indexes for
all known types are enabled.
.HP
\fB\-blocknotify=\fR<cmd>
.IP
Execute command when the best block changes (%s in cmd is replaced by
block hash)
.HP
\fB\-blockreconstructionextratxn=\fR<n>
.IP
Extra transactions to keep in memory for compact block reconstructions
(default: 100)
.HP
\fB\-blocksdir=\fR<dir>
.IP
Specify directory to hold blocks subdirectory for *.dat files (default:
<datadir>)
.HP
\fB\-blocksonly\fR
.IP
Whether to reject transactions from network peers. Disables automatic
broadcast and rebroadcast of transactions, unless the source peer
has the 'forcerelay' permission. RPC transactions are not
affected. (default: 0)
.HP
\fB\-blocksxor\fR
.IP
Whether an XOR\-key applies to blocksdir *.dat files. The created XOR\-key
will be zeros for an existing blocksdir or when `\-blocksxor=0` is
set, and random for a freshly initialized blocksdir. (default: 1)
.HP
\fB\-coinstatsindex\fR
.IP
Maintain coinstats index used by the gettxoutsetinfo RPC (default: 0)
.HP
\fB\-conf=\fR<file>
.IP
Specify path to read\-only configuration file. Relative paths will be
prefixed by datadir location (only useable from command line, not
configuration file) (default: bitcoin.conf)
.HP
\fB\-daemon\fR
.IP
Run in the background as a daemon and accept commands (default: 0)
.HP
\fB\-daemonwait\fR
.IP
Wait for initialization to be finished before exiting. This implies
\fB\-daemon\fR (default: 0)
.HP
\fB\-datadir=\fR<dir>
.IP
Specify data directory
.HP
\fB\-dbcache=\fR<n>
.IP
Maximum database cache size <n> MiB (minimum 4, default: 450). Make sure
you have enough RAM. In addition, unused memory allocated to the
mempool is shared with this cache (see \fB\-maxmempool\fR).
.HP
\fB\-debuglogfile=\fR<file>
.IP
Specify location of debug log file (default: debug.log). Relative paths
will be prefixed by a net\-specific datadir location. Pass
\fB\-nodebuglogfile\fR to disable writing the log to a file.
.HP
\fB\-help\fR
.IP
Print this help message and exit (also \fB\-h\fR or \-?)
.HP
\fB\-includeconf=\fR<file>
.IP
Specify additional configuration file, relative to the \fB\-datadir\fR path
(only useable from configuration file, not command line)
.HP
\fB\-loadblock=\fR<file>
.IP
Imports blocks from external file on startup
.HP
\fB\-maxmempool=\fR<n>
.IP
Keep the transaction memory pool below <n> megabytes (default: 300)
.HP
\fB\-maxorphantx=\fR<n>
.IP
Keep at most <n> unconnectable transactions in memory (default: 100)
.HP
\fB\-mempoolexpiry=\fR<n>
.IP
Do not keep transactions in the mempool longer than <n> hours (default:
336)
.HP
\fB\-par=\fR<n>
.IP
Set the number of script verification threads (0 = auto, up to 15, <0 =
leave that many cores free, default: 0)
.HP
\fB\-persistmempool\fR
.IP
Whether to save the mempool on shutdown and load on restart (default: 1)
.HP
\fB\-persistmempoolv1\fR
.IP
Whether a mempool.dat file created by \fB\-persistmempool\fR or the savemempool
RPC will be written in the legacy format (version 1) or the
current format (version 2). This temporary option will be removed
in the future. (default: 0)
.HP
\fB\-pid=\fR<file>
.IP
Specify pid file. Relative paths will be prefixed by a net\-specific
datadir location. (default: bitcoind.pid)
.HP
\fB\-prune=\fR<n>
.IP
Reduce storage requirements by enabling pruning (deleting) of old
blocks. This allows the pruneblockchain RPC to be called to
delete specific blocks and enables automatic pruning of old
blocks if a target size in MiB is provided. This mode is
incompatible with \fB\-txindex\fR. Warning: Reverting this setting
requires re\-downloading the entire blockchain. (default: 0 =
disable pruning blocks, 1 = allow manual pruning via RPC, >=550 =
automatically prune block files to stay under the specified
target size in MiB)
.HP
\fB\-reindex\fR
.IP
If enabled, wipe chain state and block index, and rebuild them from
blk*.dat files on disk. Also wipe and rebuild other optional
indexes that are active. If an assumeutxo snapshot was loaded,
its chainstate will be wiped as well. The snapshot can then be
reloaded via RPC.
.HP
\fB\-reindex\-chainstate\fR
.IP
If enabled, wipe chain state, and rebuild it from blk*.dat files on
disk. If an assumeutxo snapshot was loaded, its chainstate will
be wiped as well. The snapshot can then be reloaded via RPC.
.HP
\fB\-settings=\fR<file>
.IP
Specify path to dynamic settings data file. Can be disabled with
\fB\-nosettings\fR. File is written at runtime and not meant to be
edited by users (use bitcoin.conf instead for custom settings).
Relative paths will be prefixed by datadir location. (default:
settings.json)
.HP
\fB\-shutdownnotify=\fR<cmd>
.IP
Execute command immediately before beginning shutdown. The need for
shutdown may be urgent, so be careful not to delay it long (if
the command doesn't require interaction with the server, consider
having it fork into the background).
.HP
\fB\-startupnotify=\fR<cmd>
.IP
Execute command on startup.
.HP
\fB\-txindex\fR
.IP
Maintain a full transaction index, used by the getrawtransaction rpc
call (default: 0)
.HP
\fB\-version\fR
.IP
Print version and exit
.PP
Connection options:
.HP
\fB\-addnode=\fR<ip>
.IP
Add a node to connect to and attempt to keep the connection open (see
the addnode RPC help for more info). This option can be specified
multiple times to add multiple nodes; connections are limited to
8 at a time and are counted separately from the \fB\-maxconnections\fR
limit.
.HP
\fB\-asmap=\fR<file>
.IP
Specify asn mapping used for bucketing of the peers (default:
ip_asn.map). Relative paths will be prefixed by the net\-specific
datadir location.
.HP
\fB\-bantime=\fR<n>
.IP
Default duration (in seconds) of manually configured bans (default:
86400)
.HP
\fB\-bind=\fR<addr>[:<port>][=onion]
.IP
Bind to given address and always listen on it (default: 0.0.0.0). Use
[host]:port notation for IPv6. Append =onion to tag any incoming
connections to that address and port as incoming Tor connections
(default: 127.0.0.1:8334=onion, testnet3: 127.0.0.1:18334=onion,
testnet4: 127.0.0.1:48334=onion, signet: 127.0.0.1:38334=onion,
regtest: 127.0.0.1:18445=onion)
.HP
\fB\-cjdnsreachable\fR
.IP
If set, then this host is configured for CJDNS (connecting to fc00::/8
addresses would lead us to the CJDNS network, see doc/cjdns.md)
(default: 0)
.HP
\fB\-connect=\fR<ip>
.IP
Connect only to the specified node; \fB\-noconnect\fR disables automatic
connections (the rules for this peer are the same as for
\fB\-addnode\fR). This option can be specified multiple times to connect
to multiple nodes.
.HP
\fB\-discover\fR
.IP
Discover own IP addresses (default: 1 when listening and no \fB\-externalip\fR
or \fB\-proxy\fR)
.HP
\fB\-dns\fR
.IP
Allow DNS lookups for \fB\-addnode\fR, \fB\-seednode\fR and \fB\-connect\fR (default: 1)
.HP
\fB\-dnsseed\fR
.IP
Query for peer addresses via DNS lookup, if low on addresses (default: 1
unless \fB\-connect\fR used or \fB\-maxconnections\fR=\fI\,0\/\fR)
.HP
\fB\-externalip=\fR<ip>
.IP
Specify your own public address
.HP
\fB\-fixedseeds\fR
.IP
Allow fixed seeds if DNS seeds don't provide peers (default: 1)
.HP
\fB\-forcednsseed\fR
.IP
Always query for peer addresses via DNS lookup (default: 0)
.HP
\fB\-i2pacceptincoming\fR
.IP
Whether to accept inbound I2P connections (default: 1). Ignored if
\fB\-i2psam\fR is not set. Listening for inbound I2P connections is done
through the SAM proxy, not by binding to a local address and
port.
.HP
\fB\-i2psam=\fR<ip:port>
.IP
I2P SAM proxy to reach I2P peers and accept I2P connections (default:
none)
.HP
\fB\-listen\fR
.IP
Accept connections from outside (default: 1 if no \fB\-proxy\fR, \fB\-connect\fR or
\fB\-maxconnections\fR=\fI\,0\/\fR)
.HP
\fB\-listenonion\fR
.IP
Automatically create Tor onion service (default: 1)
.HP
\fB\-maxconnections=\fR<n>
.IP
Maintain at most <n> automatic connections to peers (default: 125). This
limit does not apply to connections manually added via \fB\-addnode\fR
or the addnode RPC, which have a separate limit of 8.
.HP
\fB\-maxreceivebuffer=\fR<n>
.IP
Maximum per\-connection receive buffer, <n>*1000 bytes (default: 5000)
.HP
\fB\-maxsendbuffer=\fR<n>
.IP
Maximum per\-connection memory usage for the send buffer, <n>*1000 bytes
(default: 1000)
.HP
\fB\-maxuploadtarget=\fR<n>
.IP
Tries to keep outbound traffic under the given target per 24h. Limit
does not apply to peers with 'download' permission or blocks
created within past week. 0 = no limit (default: 0M). Optional
suffix units [k|K|m|M|g|G|t|T] (default: M). Lowercase is 1000
base while uppercase is 1024 base
.HP
\fB\-natpmp\fR
.IP
Use PCP or NAT\-PMP to map the listening port (default: 0)
.HP
\fB\-networkactive\fR
.IP
Enable all P2P network activity (default: 1). Can be changed by the
setnetworkactive RPC command
.HP
\fB\-onion=\fR<ip:port|path>
.IP
Use separate SOCKS5 proxy to reach peers via Tor onion services, set
\fB\-noonion\fR to disable (default: \fB\-proxy\fR). May be a local file path
prefixed with 'unix:'.
.HP
\fB\-onlynet=\fR<net>
.IP
Make automatic outbound connections only to network <net> (ipv4, ipv6,
onion, i2p, cjdns). Inbound and manual connections are not
affected by this option. It can be specified multiple times to
allow multiple networks.
.HP
\fB\-peerblockfilters\fR
.IP
Serve compact block filters to peers per BIP 157 (default: 0)
.HP
\fB\-peerbloomfilters\fR
.IP
Support filtering of blocks and transaction with bloom filters (default:
0)
.HP
\fB\-port=\fR<port>
.IP
Listen for connections on <port> (default: 8333, testnet3: 18333,
testnet4: 48333, signet: 38333, regtest: 18444). Not relevant for
I2P (see doc/i2p.md). If set to a value x, the default onion
listening port will be set to x+1.
.HP
\fB\-proxy=\fR<ip:port|path>
.IP
Connect through SOCKS5 proxy, set \fB\-noproxy\fR to disable (default:
disabled). May be a local file path prefixed with 'unix:' if the
proxy supports it.
.HP
\fB\-proxyrandomize\fR
.IP
Randomize credentials for every proxy connection. This enables Tor
stream isolation (default: 1)
.HP
\fB\-seednode=\fR<ip>
.IP
Connect to a node to retrieve peer addresses, and disconnect. This
option can be specified multiple times to connect to multiple
nodes. During startup, seednodes will be tried before dnsseeds.
.HP
\fB\-timeout=\fR<n>
.IP
Specify socket connection timeout in milliseconds. If an initial attempt
to connect is unsuccessful after this amount of time, drop it
(minimum: 1, default: 5000)
.HP
\fB\-torcontrol=\fR<ip>:<port>
.IP
Tor control host and port to use if onion listening enabled (default:
127.0.0.1:9051). If no port is specified, the default port of
9051 will be used.
.HP
\fB\-torpassword=\fR<pass>
.IP
Tor control port password (default: empty)
.HP
\fB\-v2transport\fR
.IP
Support v2 transport (default: 1)
.HP
\fB\-whitebind=\fR<[permissions@]addr>
.IP
Bind to the given address and add permission flags to the peers
connecting to it. Use [host]:port notation for IPv6. Allowed
permissions: bloomfilter (allow requesting BIP37 filtered blocks
and transactions), noban (do not ban for misbehavior; implies
download), forcerelay (relay transactions that are already in the
mempool; implies relay), relay (relay even in \fB\-blocksonly\fR mode,
and unlimited transaction announcements), mempool (allow
requesting BIP35 mempool contents), download (allow getheaders
during IBD, no disconnect after maxuploadtarget limit), addr
(responses to GETADDR avoid hitting the cache and contain random
records with the most up\-to\-date info). Specify multiple
permissions separated by commas (default:
download,noban,mempool,relay). Can be specified multiple times.
.HP
\fB\-whitelist=\fR<[permissions@]IP address or network>
.IP
Add permission flags to the peers using the given IP address (e.g.
1.2.3.4) or CIDR\-notated network (e.g. 1.2.3.0/24). Uses the same
permissions as \fB\-whitebind\fR. Additional flags "in" and "out"
control whether permissions apply to incoming connections and/or
manual (default: incoming only). Can be specified multiple times.
.PP
Wallet options:
.HP
\fB\-addresstype\fR
.IP
What type of addresses to use ("legacy", "p2sh\-segwit", "bech32", or
"bech32m", default: "bech32")
.HP
\fB\-avoidpartialspends\fR
.IP
Group outputs by address, selecting many (possibly all) or none, instead
of selecting on a per\-output basis. Privacy is improved as
addresses are mostly swept with fewer transactions and outputs
are aggregated in clean change addresses. It may result in higher
fees due to less optimal coin selection caused by this added
limitation and possibly a larger\-than\-necessary number of inputs
being used. Always enabled for wallets with "avoid_reuse"
enabled, otherwise default: 0.
.HP
\fB\-changetype\fR
.IP
What type of change to use ("legacy", "p2sh\-segwit", "bech32", or
"bech32m"). Default is "legacy" when \fB\-addresstype\fR=\fI\,legacy\/\fR, else it
is an implementation detail.
.HP
\fB\-consolidatefeerate=\fR<amt>
.IP
The maximum feerate (in BTC/kvB) at which transaction building may use
more inputs than strictly necessary so that the wallet's UTXO
pool can be reduced (default: 0.0001).
.HP
\fB\-disablewallet\fR
.IP
Do not load the wallet and disable wallet RPC calls
.HP
\fB\-discardfee=\fR<amt>
.IP
The fee rate (in BTC/kvB) that indicates your tolerance for discarding
change by adding it to the fee (default: 0.0001). Note: An output
is discarded if it is dust at this rate, but we will always
discard up to the dust relay fee and a discard fee above that is
limited by the fee estimate for the longest target
.HP
\fB\-fallbackfee=\fR<amt>
.IP
A fee rate (in BTC/kvB) that will be used when fee estimation has
insufficient data. 0 to entirely disable the fallbackfee feature.
(default: 0.00)
.HP
\fB\-keypool=\fR<n>
.IP
Set key pool size to <n> (default: 1000). Warning: Smaller sizes may
increase the risk of losing funds when restoring from an old
backup, if none of the addresses in the original keypool have
been used.
.HP
\fB\-maxapsfee=\fR<n>
.IP
Spend up to this amount in additional (absolute) fees (in BTC) if it
allows the use of partial spend avoidance (default: 0.00)
.HP
\fB\-mintxfee=\fR<amt>
.IP
Fee rates (in BTC/kvB) smaller than this are considered zero fee for
transaction creation (default: 0.00001)
.HP
\fB\-paytxfee=\fR<amt>
.IP
Fee rate (in BTC/kvB) to add to transactions you send (default: 0.00)
.HP
\fB\-signer=\fR<cmd>
.IP
External signing tool, see doc/external\-signer.md
.HP
\fB\-spendzeroconfchange\fR
.IP
Spend unconfirmed change when sending transactions (default: 1)
.HP
\fB\-txconfirmtarget=\fR<n>
.IP
If paytxfee is not set, include enough fee so transactions begin
confirmation on average within n blocks (default: 6)
.HP
\fB\-wallet=\fR<path>
.IP
Specify wallet path to load at startup. Can be used multiple times to
load multiple wallets. Path is to a directory containing wallet
data and log files. If the path is not absolute, it is
interpreted relative to <walletdir>. This only loads existing
wallets and does not create new ones. For backwards compatibility
this also accepts names of existing top\-level data files in
<walletdir>.
.HP
\fB\-walletbroadcast\fR
.IP
Make the wallet broadcast transactions (default: 1)
.HP
\fB\-walletdir=\fR<dir>
.IP
Specify directory to hold wallets (default: <datadir>/wallets if it
exists, otherwise <datadir>)
.HP
\fB\-walletnotify=\fR<cmd>
.IP
Execute command when a wallet transaction changes. %s in cmd is replaced
by TxID, %w is replaced by wallet name, %b is replaced by the
hash of the block including the transaction (set to 'unconfirmed'
if the transaction is not included) and %h is replaced by the
block height (\fB\-1\fR if not included). %w is not currently
implemented on windows. On systems where %w is supported, it
should NOT be quoted because this would break shell escaping used
to invoke the command.
.HP
\fB\-walletrbf\fR
.IP
Send transactions with full\-RBF opt\-in enabled (RPC only, default: 1)
.PP
ZeroMQ notification options:
.HP
\fB\-zmqpubhashblock=\fR<address>
.IP
Enable publish hash block in <address>
.HP
\fB\-zmqpubhashblockhwm=\fR<n>
.IP
Set publish hash block outbound message high water mark (default: 1000)
.HP
\fB\-zmqpubhashtx=\fR<address>
.IP
Enable publish hash transaction in <address>
.HP
\fB\-zmqpubhashtxhwm=\fR<n>
.IP
Set publish hash transaction outbound message high water mark (default:
1000)
.HP
\fB\-zmqpubrawblock=\fR<address>
.IP
Enable publish raw block in <address>
.HP
\fB\-zmqpubrawblockhwm=\fR<n>
.IP
Set publish raw block outbound message high water mark (default: 1000)
.HP
\fB\-zmqpubrawtx=\fR<address>
.IP
Enable publish raw transaction in <address>
.HP
\fB\-zmqpubrawtxhwm=\fR<n>
.IP
Set publish raw transaction outbound message high water mark (default:
1000)
.HP
\fB\-zmqpubsequence=\fR<address>
.IP
Enable publish hash block and tx sequence in <address>
.HP
\fB\-zmqpubsequencehwm=\fR<n>
.IP
Set publish hash sequence message high water mark (default: 1000)
.PP
Debugging/Testing options:
.HP
\fB\-debug=\fR<category>
.IP
Output debug and trace logging (default: \fB\-nodebug\fR, supplying <category>
is optional). If <category> is not supplied or if <category> is 1
or "all", output all debug logging. If <category> is 0 or "none",
any other categories are ignored. Other valid values for
<category> are: addrman, bench, blockstorage, cmpctblock, coindb,
estimatefee, http, i2p, ipc, leveldb, libevent, mempool,
mempoolrej, net, proxy, prune, qt, rand, reindex, rpc, scan,
selectcoins, tor, txpackages, txreconciliation, validation,
walletdb, zmq. This option can be specified multiple times to
output multiple categories.
.HP
\fB\-debugexclude=\fR<category>
.IP
Exclude debug and trace logging for a category. Can be used in
conjunction with \fB\-debug\fR=\fI\,1\/\fR to output debug and trace logging for
all categories except the specified category. This option can be
specified multiple times to exclude multiple categories. This
takes priority over "\-debug"
.HP
\fB\-help\-debug\fR
.IP
Print help message with debugging options and exit
.HP
\fB\-logips\fR
.IP
Include IP addresses in debug output (default: 0)
.HP
\fB\-loglevelalways\fR
.IP
Always prepend a category and level (default: 0)
.HP
\fB\-logsourcelocations\fR
.IP
Prepend debug output with name of the originating source location
(source file, line number and function name) (default: 0)
.HP
\fB\-logthreadnames\fR
.IP
Prepend debug output with name of the originating thread (default: 0)
.HP
\fB\-logtimestamps\fR
.IP
Prepend debug output with timestamp (default: 1)
.HP
\fB\-maxtxfee=\fR<amt>
.IP
Maximum total fees (in BTC) to use in a single wallet transaction;
setting this too low may abort large transactions (default: 0.10)
.HP
\fB\-printtoconsole\fR
.IP
Send trace/debug info to console (default: 1 when no \fB\-daemon\fR. To disable
logging to file, set \fB\-nodebuglogfile\fR)
.HP
\fB\-shrinkdebugfile\fR
.IP
Shrink debug.log file on client startup (default: 1 when no \fB\-debug\fR)
.HP
\fB\-uacomment=\fR<cmt>
.IP
Append comment to the user agent string
.PP
Chain selection options:
.HP
\fB\-chain=\fR<chain>
.IP
Use the chain <chain> (default: main). Allowed values: main, test,
testnet4, signet, regtest
.HP
\fB\-signet\fR
.IP
Use the signet chain. Equivalent to \fB\-chain\fR=\fI\,signet\/\fR. Note that the network
is defined by the \fB\-signetchallenge\fR parameter
.HP
\fB\-signetchallenge\fR
.IP
Blocks must satisfy the given script to be considered valid (only for
signet networks; defaults to the global default signet test
network challenge)
.HP
\fB\-signetseednode\fR
.IP
Specify a seed node for the signet network, in the hostname[:port]
format, e.g. sig.net:1234 (may be used multiple times to specify
multiple seed nodes; defaults to the global default signet test
network seed node(s))
.HP
\fB\-testnet\fR
.IP
Use the testnet3 chain. Equivalent to \fB\-chain\fR=\fI\,test\/\fR. Support for testnet3
is deprecated and will be removed in an upcoming release.
Consider moving to testnet4 now by using \fB\-testnet4\fR.
.HP
\fB\-testnet4\fR
.IP
Use the testnet4 chain. Equivalent to \fB\-chain\fR=\fI\,testnet4\/\fR.
.PP
Node relay options:
.HP
\fB\-bytespersigop\fR
.IP
Equivalent bytes per sigop in transactions for relay and mining
(default: 20)
.HP
\fB\-datacarrier\fR
.IP
Relay and mine data carrier transactions (default: 1)
.HP
\fB\-datacarriersize\fR
.IP
Relay and mine transactions whose data\-carrying raw scriptPubKey is of
this size or less (default: 83)
.HP
\fB\-minrelaytxfee=\fR<amt>
.IP
Fees (in BTC/kvB) smaller than this are considered zero fee for
relaying, mining and transaction creation (default: 0.000001)
.HP
\fB\-permitbaremultisig\fR
.IP
Relay transactions creating non\-P2SH multisig outputs (default: 1)
.HP
\fB\-whitelistforcerelay\fR
.IP
Add 'forcerelay' permission to whitelisted peers with default
permissions. This will relay transactions even if the
transactions were already in the mempool. (default: 0)
.HP
\fB\-whitelistrelay\fR
.IP
Add 'relay' permission to whitelisted peers with default permissions.
This will accept relayed transactions even when not relaying
transactions (default: 1)
.PP
Block creation options:
.HP
\fB\-blockmaxweight=\fR<n>
.IP
Set maximum BIP141 block weight (default: 4000000)
.HP
\fB\-blockmintxfee=\fR<amt>
.IP
Set lowest fee rate (in BTC/kvB) for transactions to be included in
block creation. (default: 0.00000001)
.HP
\fB\-blockreservedweight=\fR<n>
.IP
Reserve space for the fixed\-size block header plus the largest coinbase
transaction the mining software may add to the block. (default:
8000).
.PP
RPC server options:
.HP
\fB\-rest\fR
.IP
Accept public REST requests (default: 0)
.HP
\fB\-rpcallowip=\fR<ip>
.IP
Allow JSON\-RPC connections from specified source. Valid values for <ip>
are a single IP (e.g. 1.2.3.4), a network/netmask (e.g.
1.2.3.4/255.255.255.0), a network/CIDR (e.g. 1.2.3.4/24), all
ipv4 (0.0.0.0/0), or all ipv6 (::/0). This option can be
specified multiple times
.HP
\fB\-rpcauth=\fR<userpw>
.IP
Username and HMAC\-SHA\-256 hashed password for JSON\-RPC connections. The
field <userpw> comes in the format: <USERNAME>:<SALT>$<HASH>. A
canonical python script is included in share/rpcauth. The client
then connects normally using the
rpcuser=<USERNAME>/rpcpassword=<PASSWORD> pair of arguments. This
option can be specified multiple times
.HP
\fB\-rpcbind=\fR<addr>[:port]
.IP
Bind to given address to listen for JSON\-RPC connections. Do not expose
the RPC server to untrusted networks such as the public internet!
This option is ignored unless \fB\-rpcallowip\fR is also passed. Port is
optional and overrides \fB\-rpcport\fR. Use [host]:port notation for
IPv6. This option can be specified multiple times (default:
127.0.0.1 and ::1 i.e., localhost)
.HP
\fB\-rpccookiefile=\fR<loc>
.IP
Location of the auth cookie. Relative paths will be prefixed by a
net\-specific datadir location. (default: data dir)
.HP
\fB\-rpccookieperms=\fR<readable\-by>
.IP
Set permissions on the RPC auth cookie file so that it is readable by
[owner|group|all] (default: owner [via umask 0077])
.HP
\fB\-rpcpassword=\fR<pw>
.IP
Password for JSON\-RPC connections
.HP
\fB\-rpcport=\fR<port>
.IP
Listen for JSON\-RPC connections on <port> (default: 8332, testnet3:
18332, testnet4: 48332, signet: 38332, regtest: 18443)
.HP
\fB\-rpcthreads=\fR<n>
.IP
Set the number of threads to service RPC calls (default: 16)
.HP
\fB\-rpcuser=\fR<user>
.IP
Username for JSON\-RPC connections
.HP
\fB\-rpcwhitelist=\fR<whitelist>
.IP
Set a whitelist to filter incoming RPC calls for a specific user. The
field <whitelist> comes in the format: <USERNAME>:<rpc 1>,<rpc
2>,...,<rpc n>. If multiple whitelists are set for a given user,
they are set\-intersected. See \fB\-rpcwhitelistdefault\fR documentation
for information on default whitelist behavior.
.HP
\fB\-rpcwhitelistdefault\fR
.IP
Sets default behavior for rpc whitelisting. Unless rpcwhitelistdefault
is set to 0, if any \fB\-rpcwhitelist\fR is set, the rpc server acts as
if all rpc users are subject to empty\-unless\-otherwise\-specified
whitelists. If rpcwhitelistdefault is set to 1 and no
\fB\-rpcwhitelist\fR is set, rpc server acts as if all rpc users are
subject to empty whitelists.
.HP
\fB\-server\fR
.IP
Accept command line and JSON\-RPC commands
.SH COPYRIGHT
Copyright (C) 2009-2025 The Bitcoin Core developers
This is a placeholder file. Please follow the instructions in \fIcontrib/devtools/README.md\fR to generate the manual pages after a release.
Please contribute if you find Bitcoin Core useful. Visit
<https://bitcoincore.org/> for further information about the software.
The source code is available from <https://github.com/bitcoin/bitcoin>.
This is experimental software.
Distributed under the MIT software license, see the accompanying file COPYING
or <https://opensource.org/licenses/MIT>
.SH "SEE ALSO"
bitcoind(1), bitcoin-cli(1), bitcoin-tx(1), bitcoin-wallet(1), bitcoin-util(1), bitcoin-qt(1)

View File

@@ -87,10 +87,14 @@ incoming connections.
1720: h323hostcall
1723: pptp
2049: nfs
3306: MySQL
3389: RDP / Windows Remote Desktop
3659: apple-sasl / PasswordServer
4045: lockd
5060: sip
5061: sips
5432: PostgreSQL
5900: VNC
6000: X11
6566: sane-port
6665: Alternate IRC
@@ -100,6 +104,7 @@ incoming connections.
6669: Alternate IRC
6697: IRC + TLS
10080: Amanda
27017: MongoDB
For further information see:

View File

@@ -1,99 +0,0 @@
*The release notes draft is a temporary file that can be added to by anyone. See
[/doc/developer-notes.md#release-notes](/doc/developer-notes.md#release-notes)
for the process.*
*version* Release Notes Draft
===============================
Bitcoin Core version *version* is now available from:
<https://bitcoincore.org/bin/bitcoin-core-*version*/>
This release includes new features, various bug fixes and performance
improvements, as well as updated translations.
Please report bugs using the issue tracker at GitHub:
<https://github.com/bitcoin/bitcoin/issues>
To receive security and update notifications, please subscribe to:
<https://bitcoincore.org/en/list/announcements/join/>
How to Upgrade
==============
If you are running an older version, shut it down. Wait until it has completely
shut down (which might take a few minutes in some cases), then run the
installer (on Windows) or just copy over `/Applications/Bitcoin-Qt` (on macOS)
or `bitcoind`/`bitcoin-qt` (on Linux).
Upgrading directly from a version of Bitcoin Core that has reached its EOL is
possible, but it might take some time if the data directory needs to be migrated. Old
wallet versions of Bitcoin Core are generally supported.
Compatibility
==============
Bitcoin Core is supported and tested on operating systems using the
Linux Kernel 3.17+, macOS 13+, and Windows 10+. Bitcoin
Core should also work on most other Unix-like systems but is not as
frequently tested on them. It is not recommended to use Bitcoin Core on
unsupported systems.
Notable changes
===============
P2P and network changes
-----------------------
Updated RPCs
------------
Changes to wallet related RPCs can be found in the Wallet section below.
New RPCs
--------
Build System
------------
Updated settings
----------------
Changes to GUI or wallet related settings can be found in the GUI or Wallet section below.
New settings
------------
Tools and Utilities
-------------------
Wallet
------
GUI changes
-----------
Low-level changes
=================
RPC
---
Tests
-----
*version* change log
====================
Credits
=======
Thanks to everyone who directly contributed to this release:
As well as to everyone that helped with translations on
[Transifex](https://www.transifex.com/bitcoin/bitcoin/).

98
doc/release-notes.md Normal file
View File

@@ -0,0 +1,98 @@
Bitcoin Core version 29.3rc1 is now available from:
<https://bitcoincore.org/bin/bitcoin-core-29.3/test.rc1/>
This release includes various bug fixes and performance
improvements, as well as updated translations.
Please report bugs using the issue tracker at GitHub:
<https://github.com/bitcoin/bitcoin/issues>
To receive security and update notifications, please subscribe to:
<https://bitcoincore.org/en/list/announcements/join/>
How to Upgrade
==============
If you are running an older version, shut it down. Wait until it has completely
shut down (which might take a few minutes in some cases), then run the
installer (on Windows) or just copy over `/Applications/Bitcoin-Qt` (on macOS)
or `bitcoind`/`bitcoin-qt` (on Linux).
Upgrading directly from a version of Bitcoin Core that has reached its EOL is
possible, but it might take some time if the data directory needs to be migrated. Old
wallet versions of Bitcoin Core are generally supported.
Compatibility
==============
Bitcoin Core is supported and tested on operating systems using the
Linux Kernel 3.17+, macOS 13+, and Windows 10+. Bitcoin
Core should also work on most other Unix-like systems but is not as
frequently tested on them. It is not recommended to use Bitcoin Core on
unsupported systems.
Notable changes
===============
### P2P
- #33050 net, validation: don't punish peers for consensus-invalid txs
- #33723 chainparams: remove dnsseed.bitcoin.dashjr-list-of-p2p-nodes.us
### Validation
- #32473 Introduce per-txin sighash midstate cache for legacy/p2sh/segwitv0 scripts
- #33105 validation: detect witness stripping without re-running Script checks
### Wallet
- #33268 wallet: Identify transactions spending 0-value outputs, and add tests for anchor outputs in a wallet
- #34156 wallet: fix unnamed legacy wallet migration failure
- #34226 wallet: test: Relative wallet failed migration cleanup
- #34123 wallet: migration, avoid creating spendable wallet from a watch-only legacy wallet
- #34215 wallettool: fix unnamed createfromdump failure walletsdir deletion
### Mining
- #33475 bugfix: miner: fix `addPackageTxs` unsigned integer overflow
### Build
- #34227 guix: Fix `osslsigncode` tests
### Documentation
- #33623 doc: document capnproto and libmultiprocess deps in 29.x
### Test
- #33612 test: change log rate limit version gate
### Misc
- #33508 ci: fix buildx gha cache authentication on forks
- #33581 ci: Properly include $FILE_ENV in DEPENDS_HASH
Credits
=======
Thanks to everyone who directly contributed to this release:
- Anthony Towns
- Antoine Poinsot
- Ava Chow
- David Gumberg
- Eugene Siegel
- fanquake
- furszy
- Hennadii Stepanov
- ismaelsadeeq
- Pieter Wuille
- SatsAndSports
- willcl-ark
As well as to everyone that helped with translations on
[Transifex](https://explore.transifex.com/bitcoin/bitcoin/).

View File

@@ -57,10 +57,10 @@ Release Process
- Clear the release notes and move them to the wiki (see "Write the release notes" below).
- Translations on Transifex:
- Pull translations from Transifex into the master branch.
- Create [a new resource](https://www.transifex.com/bitcoin/bitcoin/content/) named after the major version with the slug `qt-translation-<RRR>x`, where `RRR` is the major branch number padded with zeros. Use `src/qt/locale/bitcoin_en.xlf` to create it.
- Create [a new resource](https://app.transifex.com/bitcoin/bitcoin/content/) named after the major version with the slug `qt-translation-<RRR>x`, where `RRR` is the major branch number padded with zeros. Use `src/qt/locale/bitcoin_en.xlf` to create it.
- In the project workflow settings, ensure that [Translation Memory Fill-up](https://help.transifex.com/en/articles/6224817-setting-up-translation-memory-fill-up) is enabled and that [Translation Memory Context Matching](https://help.transifex.com/en/articles/6224753-translation-memory-with-context) is disabled.
- Update the Transifex slug in [`.tx/config`](/.tx/config) to the slug of the resource created in the first step. This identifies which resource the translations will be synchronized from.
- Make an announcement that translators can start translating for the new version. You can use one of the [previous announcements](https://www.transifex.com/bitcoin/communication/) as a template.
- Make an announcement that translators can start translating for the new version. You can use one of the [previous announcements](https://app.transifex.com/bitcoin/communication/) as a template.
- Change the auto-update URL for the resource to `master`, e.g. `https://raw.githubusercontent.com/bitcoin/bitcoin/master/src/qt/locale/bitcoin_en.xlf`. (Do this only after the previous steps, to prevent an auto-update from interfering.)
#### After branch-off (on the major release branch)

View File

@@ -62,7 +62,7 @@ outgoing connections, but more is possible.
In a typical situation, this suffices to run behind a Tor proxy:
./bitcoind -proxy=127.0.0.1:9050
bitcoind -proxy=127.0.0.1:9050
## 2. Automatically create a Bitcoin Core onion service
@@ -187,25 +187,25 @@ should be equal to binding address and port for inbound Tor connections (127.0.0
In a typical situation, where you're only reachable via Tor, this should suffice:
./bitcoind -proxy=127.0.0.1:9050 -externalip=7zvj7a2imdgkdbg4f2dryd5rgtrn7upivr5eeij4cicjh65pooxeshid.onion -listen
bitcoind -proxy=127.0.0.1:9050 -externalip=7zvj7a2imdgkdbg4f2dryd5rgtrn7upivr5eeij4cicjh65pooxeshid.onion -listen
(obviously, replace the .onion address with your own). It should be noted that you still
listen on all devices and another node could establish a clearnet connection, when knowing
your address. To mitigate this, additionally bind the address of your Tor proxy:
./bitcoind ... -bind=127.0.0.1:8334=onion
bitcoind ... -bind=127.0.0.1:8334=onion
If you don't care too much about hiding your node, and want to be reachable on IPv4
as well, use `discover` instead:
./bitcoind ... -discover
bitcoind ... -discover
and open port 8333 on your firewall (or use port mapping, i.e., `-natpmp`).
If you only want to use Tor to reach .onion addresses, but not use it as a proxy
for normal IPv4/IPv6 communication, use:
./bitcoind -onion=127.0.0.1:9050 -externalip=7zvj7a2imdgkdbg4f2dryd5rgtrn7upivr5eeij4cicjh65pooxeshid.onion -discover
bitcoind -onion=127.0.0.1:9050 -externalip=7zvj7a2imdgkdbg4f2dryd5rgtrn7upivr5eeij4cicjh65pooxeshid.onion -discover
## 4. Privacy recommendations

View File

@@ -41,7 +41,7 @@ git commit
### Creating a Transifex account
Visit the [Transifex Signup](https://www.transifex.com/signup/) page to create an account. Take note of your username and password, as they will be required to configure the command-line tool.
You can find the Bitcoin translation project at [https://www.transifex.com/bitcoin/bitcoin/](https://www.transifex.com/bitcoin/bitcoin/).
You can find the Bitcoin translation project at [https://explore.transifex.com/bitcoin/bitcoin/](https://explore.transifex.com/bitcoin/bitcoin/).
### Installing the Transifex client command-line tool
The client is used to fetch updated translations. Please check installation instructions and any other details at https://developers.transifex.com/docs/cli.

View File

@@ -84,7 +84,7 @@ For instance:
$ bitcoind -zmqpubhashtx=tcp://127.0.0.1:28332 \
-zmqpubhashtx=tcp://192.168.1.2:28332 \
-zmqpubhashblock="tcp://[::1]:28333" \
-zmqpubrawtx=ipc:///tmp/bitcoind.tx.raw \
-zmqpubrawtx=unix:/tmp/bitcoind.tx.raw \
-zmqpubhashtxhwm=10000
Each PUB notification has a topic and body, where the header

View File

@@ -1 +1,706 @@
# This is a placeholder file. Please follow the instructions in `contrib/devtools/README.md` to generate a bitcoin.conf file.
##
## bitcoin.conf configuration file.
## Generated by contrib/devtools/gen-bitcoin-conf.sh.
##
## Lines beginning with # are comments.
## All possible configuration options are provided. To use, copy this file
## to your data directory (default or specified by -datadir), uncomment
## options you would like to change, and save the file.
##
### Options
# Execute command when an alert is raised (%s in cmd is replaced by
# message)
#alertnotify=<cmd>
# For backwards compatibility, treat an unused bitcoin.conf file in the
# datadir as a warning, not an error.
#allowignoredconf=1
# If this block is in the chain assume that it and its ancestors are valid
# and potentially skip their script verification (0 to verify all,
# default:
# 00000000000000000001b658dd1120e82e66d2790811f89ede9742ada3ed6d77,
# testnet3:
# 00000000000003fc7967410ba2d0a8a8d50daedc318d43e8baf1a9782c236a57,
# testnet4:
# 0000000000003ed4f08dbdf6f7d6b271a6bcffce25675cb40aa9fa43179a89f3,
# signet:
# 000000895a110f46e59eb82bbc5bfb67fa314656009c295509c21b4999f5180a)
#assumevalid=<hex>
# Maintain an index of compact filters by block (default: 0, values:
# basic). If <type> is not supplied or if <type> = 1, indexes for
# all known types are enabled.
#blockfilterindex=<type>
# Execute command when the best block changes (%s in cmd is replaced by
# block hash)
#blocknotify=<cmd>
# Extra transactions to keep in memory for compact block reconstructions
# (default: 100)
#blockreconstructionextratxn=<n>
# Specify directory to hold blocks subdirectory for *.dat files (default:
# <datadir>)
#blocksdir=<dir>
# Whether to reject transactions from network peers. Disables automatic
# broadcast and rebroadcast of transactions, unless the source peer
# has the 'forcerelay' permission. RPC transactions are not
# affected. (default: 0)
#blocksonly=1
# Whether an XOR-key applies to blocksdir *.dat files. The created XOR-key
# will be zeros for an existing blocksdir or when `-blocksxor=0` is
# set, and random for a freshly initialized blocksdir. (default: 1)
#blocksxor=1
# Maintain coinstats index used by the gettxoutsetinfo RPC (default: 0)
#coinstatsindex=1
# Specify path to read-only configuration file. Relative paths will be
# prefixed by datadir location (only useable from command line, not
# configuration file) (default: bitcoin.conf)
#conf=<file>
# Run in the background as a daemon and accept commands (default: 0)
#daemon=1
# Wait for initialization to be finished before exiting. This implies
# -daemon (default: 0)
#daemonwait=1
# Specify data directory
#datadir=<dir>
# Maximum database cache size <n> MiB (minimum 4, default: 450). Make sure
# you have enough RAM. In addition, unused memory allocated to the
# mempool is shared with this cache (see -maxmempool).
#dbcache=<n>
# Specify location of debug log file (default: debug.log). Relative paths
# will be prefixed by a net-specific datadir location. Pass
# -nodebuglogfile to disable writing the log to a file.
#debuglogfile=<file>
# Specify additional configuration file, relative to the -datadir path
# (only useable from configuration file, not command line)
#includeconf=<file>
# Imports blocks from external file on startup
#loadblock=<file>
# Keep the transaction memory pool below <n> megabytes (default: 300)
#maxmempool=<n>
# Keep at most <n> unconnectable transactions in memory (default: 100)
#maxorphantx=<n>
# Do not keep transactions in the mempool longer than <n> hours (default:
# 336)
#mempoolexpiry=<n>
# Set the number of script verification threads (0 = auto, up to 15, <0 =
# leave that many cores free, default: 0)
#par=<n>
# Whether to save the mempool on shutdown and load on restart (default: 1)
#persistmempool=1
# Whether a mempool.dat file created by -persistmempool or the savemempool
# RPC will be written in the legacy format (version 1) or the
# current format (version 2). This temporary option will be removed
# in the future. (default: 0)
#persistmempoolv1=1
# Specify pid file. Relative paths will be prefixed by a net-specific
# datadir location. (default: bitcoind.pid)
#pid=<file>
# Reduce storage requirements by enabling pruning (deleting) of old
# blocks. This allows the pruneblockchain RPC to be called to
# delete specific blocks and enables automatic pruning of old
# blocks if a target size in MiB is provided. This mode is
# incompatible with -txindex. Warning: Reverting this setting
# requires re-downloading the entire blockchain. (default: 0 =
# disable pruning blocks, 1 = allow manual pruning via RPC, >=550 =
# automatically prune block files to stay under the specified
# target size in MiB)
#prune=<n>
# If enabled, wipe chain state and block index, and rebuild them from
# blk*.dat files on disk. Also wipe and rebuild other optional
# indexes that are active. If an assumeutxo snapshot was loaded,
# its chainstate will be wiped as well. The snapshot can then be
# reloaded via RPC.
#reindex=1
# If enabled, wipe chain state, and rebuild it from blk*.dat files on
# disk. If an assumeutxo snapshot was loaded, its chainstate will
# be wiped as well. The snapshot can then be reloaded via RPC.
#reindex-chainstate=1
# Specify path to dynamic settings data file. Can be disabled with
# -nosettings. File is written at runtime and not meant to be
# edited by users (use bitcoin.conf instead for custom settings).
# Relative paths will be prefixed by datadir location. (default:
# settings.json)
#settings=<file>
# Execute command immediately before beginning shutdown. The need for
# shutdown may be urgent, so be careful not to delay it long (if
# the command doesn't require interaction with the server, consider
# having it fork into the background).
#shutdownnotify=<cmd>
# Execute command on startup.
#startupnotify=<cmd>
# Maintain a full transaction index, used by the getrawtransaction rpc
# call (default: 0)
#txindex=1
# Print version and exit
#version=1
### Connection options
# Add a node to connect to and attempt to keep the connection open (see
# the addnode RPC help for more info). This option can be specified
# multiple times to add multiple nodes; connections are limited to
# 8 at a time and are counted separately from the -maxconnections
# limit.
#addnode=<ip>
# Specify asn mapping used for bucketing of the peers (default:
# ip_asn.map). Relative paths will be prefixed by the net-specific
# datadir location.
#asmap=<file>
# Default duration (in seconds) of manually configured bans (default:
# 86400)
#bantime=<n>
# Bind to given address and always listen on it (default: 0.0.0.0). Use
# [host]:port notation for IPv6. Append =onion to tag any incoming
# connections to that address and port as incoming Tor connections
# (default: 127.0.0.1:8334=onion, testnet3: 127.0.0.1:18334=onion,
# testnet4: 127.0.0.1:48334=onion, signet: 127.0.0.1:38334=onion,
# regtest: 127.0.0.1:18445=onion)
#bind=<addr>[:<port>][=onion]
# If set, then this host is configured for CJDNS (connecting to fc00::/8
# addresses would lead us to the CJDNS network, see doc/cjdns.md)
# (default: 0)
#cjdnsreachable=1
# Connect only to the specified node; -noconnect disables automatic
# connections (the rules for this peer are the same as for
# -addnode). This option can be specified multiple times to connect
# to multiple nodes.
#connect=<ip>
# Discover own IP addresses (default: 1 when listening and no -externalip
# or -proxy)
#discover=1
# Allow DNS lookups for -addnode, -seednode and -connect (default: 1)
#dns=1
# Query for peer addresses via DNS lookup, if low on addresses (default: 1
# unless -connect used or -maxconnections=0)
#dnsseed=1
# Specify your own public address
#externalip=<ip>
# Allow fixed seeds if DNS seeds don't provide peers (default: 1)
#fixedseeds=1
# Always query for peer addresses via DNS lookup (default: 0)
#forcednsseed=1
# Whether to accept inbound I2P connections (default: 1). Ignored if
# -i2psam is not set. Listening for inbound I2P connections is done
# through the SAM proxy, not by binding to a local address and
# port.
#i2pacceptincoming=1
# I2P SAM proxy to reach I2P peers and accept I2P connections (default:
# none)
#i2psam=<ip:port>
# Accept connections from outside (default: 1 if no -proxy, -connect or
# -maxconnections=0)
#listen=1
# Automatically create Tor onion service (default: 1)
#listenonion=1
# Maintain at most <n> automatic connections to peers (default: 125). This
# limit does not apply to connections manually added via -addnode
# or the addnode RPC, which have a separate limit of 8.
#maxconnections=<n>
# Maximum per-connection receive buffer, <n>*1000 bytes (default: 5000)
#maxreceivebuffer=<n>
# Maximum per-connection memory usage for the send buffer, <n>*1000 bytes
# (default: 1000)
#maxsendbuffer=<n>
# Tries to keep outbound traffic under the given target per 24h. Limit
# does not apply to peers with 'download' permission or blocks
# created within past week. 0 = no limit (default: 0M). Optional
# suffix units [k|K|m|M|g|G|t|T] (default: M). Lowercase is 1000
# base while uppercase is 1024 base
#maxuploadtarget=<n>
# Use PCP or NAT-PMP to map the listening port (default: 0)
#natpmp=1
# Enable all P2P network activity (default: 1). Can be changed by the
# setnetworkactive RPC command
#networkactive=1
# Use separate SOCKS5 proxy to reach peers via Tor onion services, set
# -noonion to disable (default: -proxy). May be a local file path
# prefixed with 'unix:'.
#onion=<ip:port|path>
# Make automatic outbound connections only to network <net> (ipv4, ipv6,
# onion, i2p, cjdns). Inbound and manual connections are not
# affected by this option. It can be specified multiple times to
# allow multiple networks.
#onlynet=<net>
# Serve compact block filters to peers per BIP 157 (default: 0)
#peerblockfilters=1
# Support filtering of blocks and transaction with bloom filters (default:
# 0)
#peerbloomfilters=1
# Listen for connections on <port> (default: 8333, testnet3: 18333,
# testnet4: 48333, signet: 38333, regtest: 18444). Not relevant for
# I2P (see doc/i2p.md). If set to a value x, the default onion
# listening port will be set to x+1.
#port=<port>
# Connect through SOCKS5 proxy, set -noproxy to disable (default:
# disabled). May be a local file path prefixed with 'unix:' if the
# proxy supports it.
#proxy=<ip:port|path>
# Randomize credentials for every proxy connection. This enables Tor
# stream isolation (default: 1)
#proxyrandomize=1
# Connect to a node to retrieve peer addresses, and disconnect. This
# option can be specified multiple times to connect to multiple
# nodes. During startup, seednodes will be tried before dnsseeds.
#seednode=<ip>
# Specify socket connection timeout in milliseconds. If an initial attempt
# to connect is unsuccessful after this amount of time, drop it
# (minimum: 1, default: 5000)
#timeout=<n>
# Tor control host and port to use if onion listening enabled (default:
# 127.0.0.1:9051). If no port is specified, the default port of
# 9051 will be used.
#torcontrol=<ip>:<port>
# Tor control port password (default: empty)
#torpassword=<pass>
# Support v2 transport (default: 1)
#v2transport=1
# Bind to the given address and add permission flags to the peers
# connecting to it. Use [host]:port notation for IPv6. Allowed
# permissions: bloomfilter (allow requesting BIP37 filtered blocks
# and transactions), noban (do not ban for misbehavior; implies
# download), forcerelay (relay transactions that are already in the
# mempool; implies relay), relay (relay even in -blocksonly mode,
# and unlimited transaction announcements), mempool (allow
# requesting BIP35 mempool contents), download (allow getheaders
# during IBD, no disconnect after maxuploadtarget limit), addr
# (responses to GETADDR avoid hitting the cache and contain random
# records with the most up-to-date info). Specify multiple
# permissions separated by commas (default:
# download,noban,mempool,relay). Can be specified multiple times.
#whitebind=<[permissions@]addr>
# Add permission flags to the peers using the given IP address (e.g.
# 1.2.3.4) or CIDR-notated network (e.g. 1.2.3.0/24). Uses the same
# permissions as -whitebind. Additional flags "in" and "out"
# control whether permissions apply to incoming connections and/or
# manual (default: incoming only). Can be specified multiple times.
#whitelist=<[permissions@]IP address or network>
### Wallet options
# What type of addresses to use ("legacy", "p2sh-segwit", "bech32", or
# "bech32m", default: "bech32")
#addresstype=1
# Group outputs by address, selecting many (possibly all) or none, instead
# of selecting on a per-output basis. Privacy is improved as
# addresses are mostly swept with fewer transactions and outputs
# are aggregated in clean change addresses. It may result in higher
# fees due to less optimal coin selection caused by this added
# limitation and possibly a larger-than-necessary number of inputs
# being used. Always enabled for wallets with "avoid_reuse"
# enabled, otherwise default: 0.
#avoidpartialspends=1
# What type of change to use ("legacy", "p2sh-segwit", "bech32", or
# "bech32m"). Default is "legacy" when -addresstype=legacy, else it
# is an implementation detail.
#changetype=1
# The maximum feerate (in BTC/kvB) at which transaction building may use
# more inputs than strictly necessary so that the wallet's UTXO
# pool can be reduced (default: 0.0001).
#consolidatefeerate=<amt>
# Do not load the wallet and disable wallet RPC calls
#disablewallet=1
# The fee rate (in BTC/kvB) that indicates your tolerance for discarding
# change by adding it to the fee (default: 0.0001). Note: An output
# is discarded if it is dust at this rate, but we will always
# discard up to the dust relay fee and a discard fee above that is
# limited by the fee estimate for the longest target
#discardfee=<amt>
# A fee rate (in BTC/kvB) that will be used when fee estimation has
# insufficient data. 0 to entirely disable the fallbackfee feature.
# (default: 0.00)
#fallbackfee=<amt>
# Set key pool size to <n> (default: 1000). Warning: Smaller sizes may
# increase the risk of losing funds when restoring from an old
# backup, if none of the addresses in the original keypool have
# been used.
#keypool=<n>
# Spend up to this amount in additional (absolute) fees (in BTC) if it
# allows the use of partial spend avoidance (default: 0.00)
#maxapsfee=<n>
# Fee rates (in BTC/kvB) smaller than this are considered zero fee for
# transaction creation (default: 0.00001)
#mintxfee=<amt>
# Fee rate (in BTC/kvB) to add to transactions you send (default: 0.00)
#paytxfee=<amt>
# External signing tool, see doc/external-signer.md
#signer=<cmd>
# Spend unconfirmed change when sending transactions (default: 1)
#spendzeroconfchange=1
# If paytxfee is not set, include enough fee so transactions begin
# confirmation on average within n blocks (default: 6)
#txconfirmtarget=<n>
# Specify wallet path to load at startup. Can be used multiple times to
# load multiple wallets. Path is to a directory containing wallet
# data and log files. If the path is not absolute, it is
# interpreted relative to <walletdir>. This only loads existing
# wallets and does not create new ones. For backwards compatibility
# this also accepts names of existing top-level data files in
# <walletdir>.
#wallet=<path>
# Make the wallet broadcast transactions (default: 1)
#walletbroadcast=1
# Specify directory to hold wallets (default: <datadir>/wallets if it
# exists, otherwise <datadir>)
#walletdir=<dir>
# Execute command when a wallet transaction changes. %s in cmd is replaced
# by TxID, %w is replaced by wallet name, %b is replaced by the
# hash of the block including the transaction (set to 'unconfirmed'
# if the transaction is not included) and %h is replaced by the
# block height (-1 if not included). %w is not currently
# implemented on windows. On systems where %w is supported, it
# should NOT be quoted because this would break shell escaping used
# to invoke the command.
#walletnotify=<cmd>
# Send transactions with full-RBF opt-in enabled (RPC only, default: 1)
#walletrbf=1
### ZeroMQ notification options
# Enable publish hash block in <address>
#zmqpubhashblock=<address>
# Set publish hash block outbound message high water mark (default: 1000)
#zmqpubhashblockhwm=<n>
# Enable publish hash transaction in <address>
#zmqpubhashtx=<address>
# Set publish hash transaction outbound message high water mark (default:
# 1000)
#zmqpubhashtxhwm=<n>
# Enable publish raw block in <address>
#zmqpubrawblock=<address>
# Set publish raw block outbound message high water mark (default: 1000)
#zmqpubrawblockhwm=<n>
# Enable publish raw transaction in <address>
#zmqpubrawtx=<address>
# Set publish raw transaction outbound message high water mark (default:
# 1000)
#zmqpubrawtxhwm=<n>
# Enable publish hash block and tx sequence in <address>
#zmqpubsequence=<address>
# Set publish hash sequence message high water mark (default: 1000)
#zmqpubsequencehwm=<n>
### Debugging/Testing options
# Output debug and trace logging (default: -nodebug, supplying <category>
# is optional). If <category> is not supplied or if <category> is 1
# or "all", output all debug logging. If <category> is 0 or "none",
# any other categories are ignored. Other valid values for
# <category> are: addrman, bench, blockstorage, cmpctblock, coindb,
# estimatefee, http, i2p, ipc, leveldb, libevent, mempool,
# mempoolrej, net, proxy, prune, qt, rand, reindex, rpc, scan,
# selectcoins, tor, txpackages, txreconciliation, validation,
# walletdb, zmq. This option can be specified multiple times to
# output multiple categories.
#debug=<category>
# Exclude debug and trace logging for a category. Can be used in
# conjunction with -debug=1 to output debug and trace logging for
# all categories except the specified category. This option can be
# specified multiple times to exclude multiple categories. This
# takes priority over "-debug"
#debugexclude=<category>
# Include IP addresses in debug output (default: 0)
#logips=1
# Always prepend a category and level (default: 0)
#loglevelalways=1
# Prepend debug output with name of the originating source location
# (source file, line number and function name) (default: 0)
#logsourcelocations=1
# Prepend debug output with name of the originating thread (default: 0)
#logthreadnames=1
# Prepend debug output with timestamp (default: 1)
#logtimestamps=1
# Maximum total fees (in BTC) to use in a single wallet transaction;
# setting this too low may abort large transactions (default: 0.10)
#maxtxfee=<amt>
# Send trace/debug info to console (default: 1 when no -daemon. To disable
# logging to file, set -nodebuglogfile)
#printtoconsole=1
# Shrink debug.log file on client startup (default: 1 when no -debug)
#shrinkdebugfile=1
# Append comment to the user agent string
#uacomment=<cmt>
### Chain selection options
# Use the chain <chain> (default: main). Allowed values: main, test,
# testnet4, signet, regtest
#chain=<chain>
# Use the signet chain. Equivalent to -chain=signet. Note that the network
# is defined by the -signetchallenge parameter
#signet=1
# Blocks must satisfy the given script to be considered valid (only for
# signet networks; defaults to the global default signet test
# network challenge)
#signetchallenge=1
# Specify a seed node for the signet network, in the hostname[:port]
# format, e.g. sig.net:1234 (may be used multiple times to specify
# multiple seed nodes; defaults to the global default signet test
# network seed node(s))
#signetseednode=1
# Use the testnet3 chain. Equivalent to -chain=test. Support for testnet3
# is deprecated and will be removed in an upcoming release.
# Consider moving to testnet4 now by using -testnet4.
#testnet=1
# Use the testnet4 chain. Equivalent to -chain=testnet4.
#testnet4=1
### Node relay options
# Equivalent bytes per sigop in transactions for relay and mining
# (default: 20)
#bytespersigop=1
# Relay and mine data carrier transactions (default: 1)
#datacarrier=1
# Relay and mine transactions whose data-carrying raw scriptPubKey is of
# this size or less (default: 83)
#datacarriersize=1
# Fees (in BTC/kvB) smaller than this are considered zero fee for
# relaying, mining and transaction creation (default: 0.000001)
#minrelaytxfee=<amt>
# Relay transactions creating non-P2SH multisig outputs (default: 1)
#permitbaremultisig=1
# Add 'forcerelay' permission to whitelisted peers with default
# permissions. This will relay transactions even if the
# transactions were already in the mempool. (default: 0)
#whitelistforcerelay=1
# Add 'relay' permission to whitelisted peers with default permissions.
# This will accept relayed transactions even when not relaying
# transactions (default: 1)
#whitelistrelay=1
### Block creation options
# Set maximum BIP141 block weight (default: 4000000)
#blockmaxweight=<n>
# Set lowest fee rate (in BTC/kvB) for transactions to be included in
# block creation. (default: 0.00000001)
#blockmintxfee=<amt>
# Reserve space for the fixed-size block header plus the largest coinbase
# transaction the mining software may add to the block. (default:
# 8000).
#blockreservedweight=<n>
### RPC server options
# Accept public REST requests (default: 0)
#rest=1
# Allow JSON-RPC connections from specified source. Valid values for <ip>
# are a single IP (e.g. 1.2.3.4), a network/netmask (e.g.
# 1.2.3.4/255.255.255.0), a network/CIDR (e.g. 1.2.3.4/24), all
# ipv4 (0.0.0.0/0), or all ipv6 (::/0). This option can be
# specified multiple times
#rpcallowip=<ip>
# Username and HMAC-SHA-256 hashed password for JSON-RPC connections. The
# field <userpw> comes in the format: <USERNAME>:<SALT>$<HASH>. A
# canonical python script is included in share/rpcauth. The client
# then connects normally using the
# rpcuser=<USERNAME>/rpcpassword=<PASSWORD> pair of arguments. This
# option can be specified multiple times
#rpcauth=<userpw>
# Bind to given address to listen for JSON-RPC connections. Do not expose
# the RPC server to untrusted networks such as the public internet!
# This option is ignored unless -rpcallowip is also passed. Port is
# optional and overrides -rpcport. Use [host]:port notation for
# IPv6. This option can be specified multiple times (default:
# 127.0.0.1 and ::1 i.e., localhost)
#rpcbind=<addr>[:port]
# Location of the auth cookie. Relative paths will be prefixed by a
# net-specific datadir location. (default: data dir)
#rpccookiefile=<loc>
# Set permissions on the RPC auth cookie file so that it is readable by
# [owner|group|all] (default: owner [via umask 0077])
#rpccookieperms=<readable-by>
# Password for JSON-RPC connections
#rpcpassword=<pw>
# Listen for JSON-RPC connections on <port> (default: 8332, testnet3:
# 18332, testnet4: 48332, signet: 38332, regtest: 18443)
#rpcport=<port>
# Set the number of threads to service RPC calls (default: 16)
#rpcthreads=<n>
# Username for JSON-RPC connections
#rpcuser=<user>
# Set a whitelist to filter incoming RPC calls for a specific user. The
# field <whitelist> comes in the format: <USERNAME>:<rpc 1>,<rpc
# 2>,...,<rpc n>. If multiple whitelists are set for a given user,
# they are set-intersected. See -rpcwhitelistdefault documentation
# for information on default whitelist behavior.
#rpcwhitelist=<whitelist>
# Sets default behavior for rpc whitelisting. Unless rpcwhitelistdefault
# is set to 0, if any -rpcwhitelist is set, the rpc server acts as
# if all rpc users are subject to empty-unless-otherwise-specified
# whitelists. If rpcwhitelistdefault is set to 1 and no
# -rpcwhitelist is set, rpc server acts as if all rpc users are
# subject to empty whitelists.
#rpcwhitelistdefault=1
# Accept command line and JSON-RPC commands
#server=1
# [Sections]
# Most options will apply to all networks. To confine an option to a specific
# network, add it under the relevant section below.
#
# Note: If not specified under a network section, the options addnode, connect,
# port, bind, rpcport, rpcbind, and wallet will only apply to mainnet.
# Options for mainnet
[main]
# Options for testnet3
[test]
# Options for testnet4
[testnet4]
# Options for signet
[signet]
# Options for regtest
[regtest]

View File

@@ -14,7 +14,7 @@ BEGIN
BEGIN
BLOCK "040904E4" // U.S. English - multilingual (hex)
BEGIN
VALUE "CompanyName", "Bitcoin"
VALUE "CompanyName", CLIENT_NAME " project"
VALUE "FileDescription", "bitcoin-cli (JSON-RPC client for " CLIENT_NAME ")"
VALUE "FileVersion", CLIENT_VERSION_STRING
VALUE "InternalName", "bitcoin-cli"

View File

@@ -14,7 +14,7 @@ BEGIN
BEGIN
BLOCK "040904E4" // U.S. English - multilingual (hex)
BEGIN
VALUE "CompanyName", "Bitcoin"
VALUE "CompanyName", CLIENT_NAME " project"
VALUE "FileDescription", "bitcoin-tx (CLI Bitcoin transaction editor utility)"
VALUE "FileVersion", CLIENT_VERSION_STRING
VALUE "InternalName", "bitcoin-tx"

View File

@@ -14,7 +14,7 @@ BEGIN
BEGIN
BLOCK "040904E4" // U.S. English - multilingual (hex)
BEGIN
VALUE "CompanyName", "Bitcoin"
VALUE "CompanyName", CLIENT_NAME " project"
VALUE "FileDescription", "bitcoin-util (CLI Bitcoin utility)"
VALUE "FileVersion", CLIENT_VERSION_STRING
VALUE "InternalName", "bitcoin-util"

View File

@@ -14,7 +14,7 @@ BEGIN
BEGIN
BLOCK "040904E4" // U.S. English - multilingual (hex)
BEGIN
VALUE "CompanyName", "Bitcoin"
VALUE "CompanyName", CLIENT_NAME " project"
VALUE "FileDescription", "bitcoin-wallet (CLI tool for " CLIENT_NAME " wallets)"
VALUE "FileVersion", CLIENT_VERSION_STRING
VALUE "InternalName", "bitcoin-wallet"

View File

@@ -14,7 +14,7 @@ BEGIN
BEGIN
BLOCK "040904E4" // U.S. English - multilingual (hex)
BEGIN
VALUE "CompanyName", "Bitcoin"
VALUE "CompanyName", CLIENT_NAME " project"
VALUE "FileDescription", "bitcoind (Bitcoin node with a JSON-RPC server)"
VALUE "FileVersion", CLIENT_VERSION_STRING
VALUE "InternalName", "bitcoind"

View File

@@ -180,7 +180,7 @@ bool PartiallyDownloadedBlock::IsTxAvailable(size_t index) const
return txn_available[index] != nullptr;
}
ReadStatus PartiallyDownloadedBlock::FillBlock(CBlock& block, const std::vector<CTransactionRef>& vtx_missing)
ReadStatus PartiallyDownloadedBlock::FillBlock(CBlock& block, const std::vector<CTransactionRef>& vtx_missing, bool segwit_active)
{
if (header.IsNull()) return READ_STATUS_INVALID;
@@ -205,16 +205,11 @@ ReadStatus PartiallyDownloadedBlock::FillBlock(CBlock& block, const std::vector<
if (vtx_missing.size() != tx_missing_offset)
return READ_STATUS_INVALID;
BlockValidationState state;
CheckBlockFn check_block = m_check_block_mock ? m_check_block_mock : CheckBlock;
if (!check_block(block, state, Params().GetConsensus(), /*fCheckPoW=*/true, /*fCheckMerkleRoot=*/true)) {
// TODO: We really want to just check merkle tree manually here,
// but that is expensive, and CheckBlock caches a block's
// "checked-status" (in the CBlock?). CBlock should be able to
// check its own merkle root and cache that check.
if (state.GetResult() == BlockValidationResult::BLOCK_MUTATED)
return READ_STATUS_FAILED; // Possible Short ID collision
return READ_STATUS_CHECKBLOCK_FAILED;
// Check for possible mutations early now that we have a seemingly good block
IsBlockMutatedFn check_mutated{m_check_block_mutated_mock ? m_check_block_mutated_mock : IsBlockMutated};
if (check_mutated(/*block=*/block,
/*check_witness_root=*/segwit_active)) {
return READ_STATUS_FAILED; // Possible Short ID collision
}
LogDebug(BCLog::CMPCTBLOCK, "Successfully reconstructed block %s with %lu txn prefilled, %lu txn from mempool (incl at least %lu from extra pool) and %lu txn requested\n", hash.ToString(), prefilled_count, mempool_count, extra_count, vtx_missing.size());

View File

@@ -84,8 +84,6 @@ typedef enum ReadStatus_t
READ_STATUS_OK,
READ_STATUS_INVALID, // Invalid object, peer is sending bogus crap
READ_STATUS_FAILED, // Failed to process object
READ_STATUS_CHECKBLOCK_FAILED, // Used only by FillBlock to indicate a
// failure in CheckBlock.
} ReadStatus;
class CBlockHeaderAndShortTxIDs {
@@ -141,15 +139,16 @@ public:
CBlockHeader header;
// Can be overridden for testing
using CheckBlockFn = std::function<bool(const CBlock&, BlockValidationState&, const Consensus::Params&, bool, bool)>;
CheckBlockFn m_check_block_mock{nullptr};
using IsBlockMutatedFn = std::function<bool(const CBlock&, bool)>;
IsBlockMutatedFn m_check_block_mutated_mock{nullptr};
explicit PartiallyDownloadedBlock(CTxMemPool* poolIn) : pool(poolIn) {}
// extra_txn is a list of extra orphan/conflicted/etc transactions to look at
ReadStatus InitData(const CBlockHeaderAndShortTxIDs& cmpctblock, const std::vector<CTransactionRef>& extra_txn);
bool IsTxAvailable(size_t index) const;
ReadStatus FillBlock(CBlock& block, const std::vector<CTransactionRef>& vtx_missing);
// segwit_active enforces witness mutation checks just before reporting a healthy status
ReadStatus FillBlock(CBlock& block, const std::vector<CTransactionRef>& vtx_missing, bool segwit_active);
};
#endif // BITCOIN_BLOCKENCODINGS_H

View File

@@ -47,7 +47,7 @@ if(HAVE_SSE41 AND HAVE_X86_SHANI)
target_compile_definitions(bitcoin_crypto PRIVATE ENABLE_SSE41 ENABLE_X86_SHANI)
target_sources(bitcoin_crypto PRIVATE sha256_x86_shani.cpp)
set_property(SOURCE sha256_x86_shani.cpp PROPERTY
COMPILE_OPTIONS ${X86_SHANI_CXXFLAGS}
COMPILE_OPTIONS ${SSE41_CXXFLAGS} ${X86_SHANI_CXXFLAGS}
)
endif()

View File

@@ -627,7 +627,7 @@ std::string SHA256AutoDetect(sha256_implementation::UseImplementation use_implem
Transform = sha256_x86_shani::Transform;
TransformD64 = TransformD64Wrapper<sha256_x86_shani::Transform>;
TransformD64_2way = sha256d64_x86_shani::Transform_2way;
ret = "x86_shani(1way,2way)";
ret = "x86_shani(1way;2way)";
have_sse4 = false; // Disable SSE4/AVX2;
have_avx2 = false;
}
@@ -641,14 +641,14 @@ std::string SHA256AutoDetect(sha256_implementation::UseImplementation use_implem
#endif
#if defined(ENABLE_SSE41)
TransformD64_4way = sha256d64_sse41::Transform_4way;
ret += ",sse41(4way)";
ret += ";sse41(4way)";
#endif
}
#if defined(ENABLE_AVX2)
if (have_avx2 && have_avx && enabled_avx) {
TransformD64_8way = sha256d64_avx2::Transform_8way;
ret += ",avx2(8way)";
ret += ";avx2(8way)";
}
#endif
#endif // defined(HAVE_GETCPUID)
@@ -682,7 +682,7 @@ std::string SHA256AutoDetect(sha256_implementation::UseImplementation use_implem
Transform = sha256_arm_shani::Transform;
TransformD64 = TransformD64Wrapper<sha256_arm_shani::Transform>;
TransformD64_2way = sha256d64_arm_shani::Transform_2way;
ret = "arm_shani(1way,2way)";
ret = "arm_shani(1way;2way)";
}
#endif
#endif // DISABLE_OPTIMIZED_SHA256

View File

@@ -13,13 +13,17 @@
namespace sha256_sse4
{
void Transform(uint32_t* s, const unsigned char* chunk, size_t blocks)
#if defined(__clang__) && !defined(__OPTIMIZE__)
#if defined(__clang__)
/*
clang is unable to compile this with -O0 and -fsanitize=address.
See upstream bug: https://github.com/llvm/llvm-project/issues/92182
See upstream bug: https://github.com/llvm/llvm-project/issues/92182.
This also fails to compile with -O2, -fcf-protection & -fsanitize=address.
See https://github.com/bitcoin/bitcoin/issues/31913.
*/
#if __has_feature(address_sanitizer)
__attribute__((no_sanitize("address")))
#endif
#endif
{
static const uint32_t K256 alignas(16) [] = {
0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5,

View File

@@ -253,18 +253,13 @@ bool BaseIndex::Rewind(const CBlockIndex* current_tip, const CBlockIndex* new_ti
return false;
}
// In the case of a reorg, ensure persisted block locator is not stale.
// Don't commit here - the committed index state must never be ahead of the
// flushed chainstate, otherwise unclean restarts would lead to index corruption.
// Pruning has a minimum of 288 blocks-to-keep and getting the index
// out of sync may be possible but a users fault.
// In case we reorg beyond the pruned depth, ReadBlock would
// throw and lead to a graceful shutdown
SetBestBlockIndex(new_tip);
if (!Commit()) {
// If commit fails, revert the best block index to avoid corruption.
SetBestBlockIndex(current_tip);
return false;
}
return true;
}

View File

@@ -1384,6 +1384,15 @@ bool AppInitMain(NodeContext& node, interfaces::BlockAndHeaderTipInfo* tip_info)
}
}, std::chrono::minutes{5});
if (args.GetBoolArg("-logratelimit", BCLog::DEFAULT_LOGRATELIMIT)) {
LogInstance().SetRateLimiting(BCLog::LogRateLimiter::Create(
[&scheduler](auto func, auto window) { scheduler.scheduleEvery(std::move(func), window); },
BCLog::RATELIMIT_MAX_BYTES,
BCLog::RATELIMIT_WINDOW));
} else {
LogInfo("Log rate limiting disabled");
}
assert(!node.validation_signals);
node.validation_signals = std::make_unique<ValidationSignals>(std::make_unique<SerialTaskRunner>(scheduler));
auto& validation_signals = *node.validation_signals;

View File

@@ -38,6 +38,7 @@ void AddLoggingArgs(ArgsManager& argsman)
argsman.AddArg("-logsourcelocations", strprintf("Prepend debug output with name of the originating source location (source file, line number and function name) (default: %u)", DEFAULT_LOGSOURCELOCATIONS), ArgsManager::ALLOW_ANY, OptionsCategory::DEBUG_TEST);
argsman.AddArg("-logtimemicros", strprintf("Add microsecond precision to debug timestamps (default: %u)", DEFAULT_LOGTIMEMICROS), ArgsManager::ALLOW_ANY | ArgsManager::DEBUG_ONLY, OptionsCategory::DEBUG_TEST);
argsman.AddArg("-loglevelalways", strprintf("Always prepend a category and level (default: %u)", DEFAULT_LOGLEVELALWAYS), ArgsManager::ALLOW_ANY, OptionsCategory::DEBUG_TEST);
argsman.AddArg("-logratelimit", strprintf("Apply rate limiting to unconditional logging to mitigate disk-filling attacks (default: %u)", BCLog::DEFAULT_LOGRATELIMIT), ArgsManager::ALLOW_ANY | ArgsManager::DEBUG_ONLY, OptionsCategory::DEBUG_TEST);
argsman.AddArg("-printtoconsole", "Send trace/debug info to console (default: 1 when no -daemon. To disable logging to file, set -nodebuglogfile)", ArgsManager::ALLOW_ANY, OptionsCategory::DEBUG_TEST);
argsman.AddArg("-shrinkdebugfile", "Shrink debug.log file on client startup (default: 1 when no -debug)", ArgsManager::ALLOW_ANY, OptionsCategory::DEBUG_TEST);
}

View File

@@ -146,7 +146,6 @@ public:
// release ASAP to avoid it where possible.
vSeeds.emplace_back("seed.bitcoin.sipa.be."); // Pieter Wuille, only supports x1, x5, x9, and xd
vSeeds.emplace_back("dnsseed.bluematt.me."); // Matt Corallo, only supports x9
vSeeds.emplace_back("dnsseed.bitcoin.dashjr-list-of-p2p-nodes.us."); // Luke Dashjr
vSeeds.emplace_back("seed.bitcoin.jonasschnelli.ch."); // Jonas Schnelli, only supports x1, x5, x9, and xd
vSeeds.emplace_back("seed.btc.petertodd.net."); // Peter Todd, only supports x1, x5, x9, and xd
vSeeds.emplace_back("seed.bitcoin.sprovoost.nl."); // Sjors Provoost

View File

@@ -12,8 +12,10 @@
#include <util/time.h>
#include <array>
#include <cstring>
#include <map>
#include <optional>
#include <utility>
using util::Join;
using util::RemovePrefixView;
@@ -73,12 +75,12 @@ bool BCLog::Logger::StartLogging()
// dump buffered messages from before we opened the log
m_buffering = false;
if (m_buffer_lines_discarded > 0) {
LogPrintStr_(strprintf("Early logging buffer overflowed, %d log lines discarded.\n", m_buffer_lines_discarded), __func__, __FILE__, __LINE__, BCLog::ALL, Level::Info);
LogPrintStr_(strprintf("Early logging buffer overflowed, %d log lines discarded.\n", m_buffer_lines_discarded), std::source_location::current(), BCLog::ALL, Level::Info, /*should_ratelimit=*/false);
}
while (!m_msgs_before_open.empty()) {
const auto& buflog = m_msgs_before_open.front();
std::string s{buflog.str};
FormatLogStrInPlace(s, buflog.category, buflog.level, buflog.source_file, buflog.source_line, buflog.logging_function, buflog.threadname, buflog.now, buflog.mocktime);
FormatLogStrInPlace(s, buflog.category, buflog.level, buflog.source_loc, buflog.threadname, buflog.now, buflog.mocktime);
m_msgs_before_open.pop_front();
if (m_print_to_file) FileWriteStr(s, m_fileout);
@@ -364,17 +366,50 @@ std::string BCLog::Logger::GetLogPrefix(BCLog::LogFlags category, BCLog::Level l
static size_t MemUsage(const BCLog::Logger::BufferedLog& buflog)
{
return buflog.str.size() + buflog.logging_function.size() + buflog.source_file.size() + buflog.threadname.size() + memusage::MallocUsage(sizeof(memusage::list_node<BCLog::Logger::BufferedLog>));
return memusage::DynamicUsage(buflog.str) +
memusage::DynamicUsage(buflog.threadname) +
memusage::MallocUsage(sizeof(memusage::list_node<BCLog::Logger::BufferedLog>));
}
void BCLog::Logger::FormatLogStrInPlace(std::string& str, BCLog::LogFlags category, BCLog::Level level, std::string_view source_file, int source_line, std::string_view logging_function, std::string_view threadname, SystemClock::time_point now, std::chrono::seconds mocktime) const
BCLog::LogRateLimiter::LogRateLimiter(uint64_t max_bytes, std::chrono::seconds reset_window)
: m_max_bytes{max_bytes}, m_reset_window{reset_window} {}
std::shared_ptr<BCLog::LogRateLimiter> BCLog::LogRateLimiter::Create(
SchedulerFunction&& scheduler_func, uint64_t max_bytes, std::chrono::seconds reset_window)
{
auto limiter{std::shared_ptr<LogRateLimiter>(new LogRateLimiter(max_bytes, reset_window))};
std::weak_ptr<LogRateLimiter> weak_limiter{limiter};
auto reset = [weak_limiter] {
if (auto shared_limiter{weak_limiter.lock()}) shared_limiter->Reset();
};
scheduler_func(reset, limiter->m_reset_window);
return limiter;
}
BCLog::LogRateLimiter::Status BCLog::LogRateLimiter::Consume(
const std::source_location& source_loc,
const std::string& str)
{
StdLockGuard scoped_lock(m_mutex);
auto& stats{m_source_locations.try_emplace(source_loc, m_max_bytes).first->second};
Status status{stats.m_dropped_bytes > 0 ? Status::STILL_SUPPRESSED : Status::UNSUPPRESSED};
if (!stats.Consume(str.size()) && status == Status::UNSUPPRESSED) {
status = Status::NEWLY_SUPPRESSED;
m_suppression_active = true;
}
return status;
}
void BCLog::Logger::FormatLogStrInPlace(std::string& str, BCLog::LogFlags category, BCLog::Level level, const std::source_location& source_loc, std::string_view threadname, SystemClock::time_point now, std::chrono::seconds mocktime) const
{
if (!str.ends_with('\n')) str.push_back('\n');
str.insert(0, GetLogPrefix(category, level));
if (m_log_sourcelocations) {
str.insert(0, strprintf("[%s:%d] [%s] ", RemovePrefixView(source_file, "./"), source_line, logging_function));
str.insert(0, strprintf("[%s:%d] [%s] ", RemovePrefixView(source_loc.file_name(), "./"), source_loc.line(), source_loc.function_name()));
}
if (m_log_threadnames) {
@@ -384,28 +419,27 @@ void BCLog::Logger::FormatLogStrInPlace(std::string& str, BCLog::LogFlags catego
str.insert(0, LogTimestampStr(now, mocktime));
}
void BCLog::Logger::LogPrintStr(std::string_view str, std::string_view logging_function, std::string_view source_file, int source_line, BCLog::LogFlags category, BCLog::Level level)
void BCLog::Logger::LogPrintStr(std::string_view str, std::source_location&& source_loc, BCLog::LogFlags category, BCLog::Level level, bool should_ratelimit)
{
StdLockGuard scoped_lock(m_cs);
return LogPrintStr_(str, logging_function, source_file, source_line, category, level);
return LogPrintStr_(str, std::move(source_loc), category, level, should_ratelimit);
}
void BCLog::Logger::LogPrintStr_(std::string_view str, std::string_view logging_function, std::string_view source_file, int source_line, BCLog::LogFlags category, BCLog::Level level)
// NOLINTNEXTLINE(misc-no-recursion)
void BCLog::Logger::LogPrintStr_(std::string_view str, std::source_location&& source_loc, BCLog::LogFlags category, BCLog::Level level, bool should_ratelimit)
{
std::string str_prefixed = LogEscapeMessage(str);
if (m_buffering) {
{
BufferedLog buf{
.now=SystemClock::now(),
.mocktime=GetMockTime(),
.str=str_prefixed,
.logging_function=std::string(logging_function),
.source_file=std::string(source_file),
.threadname=util::ThreadGetInternalName(),
.source_line=source_line,
.category=category,
.level=level,
.now = SystemClock::now(),
.mocktime = GetMockTime(),
.str = str_prefixed,
.threadname = util::ThreadGetInternalName(),
.source_loc = std::move(source_loc),
.category = category,
.level = level,
};
m_cur_buffer_memusage += MemUsage(buf);
m_msgs_before_open.push_back(std::move(buf));
@@ -424,7 +458,31 @@ void BCLog::Logger::LogPrintStr_(std::string_view str, std::string_view logging_
return;
}
FormatLogStrInPlace(str_prefixed, category, level, source_file, source_line, logging_function, util::ThreadGetInternalName(), SystemClock::now(), GetMockTime());
FormatLogStrInPlace(str_prefixed, category, level, source_loc, util::ThreadGetInternalName(), SystemClock::now(), GetMockTime());
bool ratelimit{false};
if (should_ratelimit && m_limiter) {
auto status{m_limiter->Consume(source_loc, str_prefixed)};
if (status == LogRateLimiter::Status::NEWLY_SUPPRESSED) {
// NOLINTNEXTLINE(misc-no-recursion)
LogPrintStr_(strprintf(
"Excessive logging detected from %s:%d (%s): >%d bytes logged during "
"the last time window of %is. Suppressing logging to disk from this "
"source location until time window resets. Console logging "
"unaffected. Last log entry.",
source_loc.file_name(), source_loc.line(), source_loc.function_name(),
m_limiter->m_max_bytes,
Ticks<std::chrono::seconds>(m_limiter->m_reset_window)),
std::source_location::current(), LogFlags::ALL, Level::Warning, /*should_ratelimit=*/false); // with should_ratelimit=false, this cannot lead to infinite recursion
} else if (status == LogRateLimiter::Status::STILL_SUPPRESSED) {
ratelimit = true;
}
}
// To avoid confusion caused by dropped log messages when debugging an issue,
// we prefix log lines with "[*]" when there are any suppressed source locations.
if (m_limiter && m_limiter->SuppressionsActive()) {
str_prefixed.insert(0, "[*] ");
}
if (m_print_to_console) {
// print to console
@@ -434,7 +492,7 @@ void BCLog::Logger::LogPrintStr_(std::string_view str, std::string_view logging_
for (const auto& cb : m_print_callbacks) {
cb(str_prefixed);
}
if (m_print_to_file) {
if (m_print_to_file && !ratelimit) {
assert(m_fileout != nullptr);
// reopen the log file, if requested
@@ -492,6 +550,36 @@ void BCLog::Logger::ShrinkDebugFile()
fclose(file);
}
void BCLog::LogRateLimiter::Reset()
{
decltype(m_source_locations) source_locations;
{
StdLockGuard scoped_lock(m_mutex);
source_locations.swap(m_source_locations);
m_suppression_active = false;
}
for (const auto& [source_loc, stats] : source_locations) {
if (stats.m_dropped_bytes == 0) continue;
LogPrintLevel_(
LogFlags::ALL, Level::Warning, /*should_ratelimit=*/false,
"Restarting logging from %s:%d (%s): %d bytes were dropped during the last %ss.",
source_loc.file_name(), source_loc.line(), source_loc.function_name(),
stats.m_dropped_bytes, Ticks<std::chrono::seconds>(m_reset_window));
}
}
bool BCLog::LogRateLimiter::Stats::Consume(uint64_t bytes)
{
if (bytes > m_available_bytes) {
m_dropped_bytes += bytes;
m_available_bytes = 0;
return false;
}
m_available_bytes -= bytes;
return true;
}
bool BCLog::Logger::SetLogLevel(std::string_view level_str)
{
const auto level = GetLogLevel(level_str);

View File

@@ -6,6 +6,7 @@
#ifndef BITCOIN_LOGGING_H
#define BITCOIN_LOGGING_H
#include <crypto/siphash.h>
#include <threadsafety.h>
#include <tinyformat.h>
#include <util/fs.h>
@@ -14,11 +15,15 @@
#include <atomic>
#include <cstdint>
#include <cstring>
#include <functional>
#include <list>
#include <memory>
#include <mutex>
#include <source_location>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>
static const bool DEFAULT_LOGTIMEMICROS = false;
@@ -31,6 +36,24 @@ extern const char * const DEFAULT_DEBUGLOGFILE;
extern bool fLogIPs;
struct SourceLocationEqual {
bool operator()(const std::source_location& lhs, const std::source_location& rhs) const noexcept
{
return lhs.line() == rhs.line() && std::string_view(lhs.file_name()) == std::string_view(rhs.file_name());
}
};
struct SourceLocationHasher {
size_t operator()(const std::source_location& s) const noexcept
{
// Use CSipHasher(0, 0) as a simple way to get uniform distribution.
return size_t(CSipHasher(0, 0)
.Write(s.line())
.Write(MakeUCharSpan(std::string_view{s.file_name()}))
.Finalize());
}
};
struct LogCategory {
std::string category;
bool active;
@@ -82,6 +105,69 @@ namespace BCLog {
};
constexpr auto DEFAULT_LOG_LEVEL{Level::Debug};
constexpr size_t DEFAULT_MAX_LOG_BUFFER{1'000'000}; // buffer up to 1MB of log data prior to StartLogging
constexpr uint64_t RATELIMIT_MAX_BYTES{1024 * 1024}; // maximum number of bytes per source location that can be logged within the RATELIMIT_WINDOW
constexpr auto RATELIMIT_WINDOW{1h}; // time window after which log ratelimit stats are reset
constexpr bool DEFAULT_LOGRATELIMIT{true};
//! Fixed window rate limiter for logging.
class LogRateLimiter
{
public:
//! Keeps track of an individual source location and how many available bytes are left for logging from it.
struct Stats {
//! Remaining bytes
uint64_t m_available_bytes;
//! Number of bytes that were consumed but didn't fit in the available bytes.
uint64_t m_dropped_bytes{0};
Stats(uint64_t max_bytes) : m_available_bytes{max_bytes} {}
//! Updates internal accounting and returns true if enough available_bytes were remaining
bool Consume(uint64_t bytes);
};
private:
mutable StdMutex m_mutex;
//! Stats for each source location that has attempted to log something.
std::unordered_map<std::source_location, Stats, SourceLocationHasher, SourceLocationEqual> m_source_locations GUARDED_BY(m_mutex);
//! Whether any log locations are suppressed. Cached view on m_source_locations for performance reasons.
std::atomic<bool> m_suppression_active{false};
LogRateLimiter(uint64_t max_bytes, std::chrono::seconds reset_window);
public:
using SchedulerFunction = std::function<void(std::function<void()>, std::chrono::milliseconds)>;
/**
* @param scheduler_func Callable object used to schedule resetting the window. The first
* parameter is the function to be executed, and the second is the
* reset_window interval.
* @param max_bytes Maximum number of bytes that can be logged for each source
* location.
* @param reset_window Time window after which the stats are reset.
*/
static std::shared_ptr<LogRateLimiter> Create(
SchedulerFunction&& scheduler_func,
uint64_t max_bytes,
std::chrono::seconds reset_window);
//! Maximum number of bytes logged per location per window.
const uint64_t m_max_bytes;
//! Interval after which the window is reset.
const std::chrono::seconds m_reset_window;
//! Suppression status of a source log location.
enum class Status {
UNSUPPRESSED, // string fits within the limit
NEWLY_SUPPRESSED, // suppression has started since this string
STILL_SUPPRESSED, // suppression is still ongoing
};
//! Consumes `source_loc`'s available bytes corresponding to the size of the (formatted)
//! `str` and returns its status.
[[nodiscard]] Status Consume(
const std::source_location& source_loc,
const std::string& str) EXCLUSIVE_LOCKS_REQUIRED(!m_mutex);
//! Resets all usage to zero. Called periodically by the scheduler.
void Reset() EXCLUSIVE_LOCKS_REQUIRED(!m_mutex);
//! Returns true if any log locations are currently being suppressed.
bool SuppressionsActive() const { return m_suppression_active; }
};
class Logger
{
@@ -89,8 +175,8 @@ namespace BCLog {
struct BufferedLog {
SystemClock::time_point now;
std::chrono::seconds mocktime;
std::string str, logging_function, source_file, threadname;
int source_line;
std::string str, threadname;
std::source_location source_loc;
LogFlags category;
Level level;
};
@@ -105,6 +191,9 @@ namespace BCLog {
size_t m_cur_buffer_memusage GUARDED_BY(m_cs){0};
size_t m_buffer_lines_discarded GUARDED_BY(m_cs){0};
//! Manages the rate limiting of each log location.
std::shared_ptr<LogRateLimiter> m_limiter GUARDED_BY(m_cs);
//! Category-specific log level. Overrides `m_log_level`.
std::unordered_map<LogFlags, Level> m_category_log_levels GUARDED_BY(m_cs);
@@ -115,7 +204,7 @@ namespace BCLog {
/** Log categories bitfield. */
std::atomic<CategoryMask> m_categories{BCLog::NONE};
void FormatLogStrInPlace(std::string& str, LogFlags category, Level level, std::string_view source_file, int source_line, std::string_view logging_function, std::string_view threadname, SystemClock::time_point now, std::chrono::seconds mocktime) const;
void FormatLogStrInPlace(std::string& str, LogFlags category, Level level, const std::source_location& source_loc, std::string_view threadname, SystemClock::time_point now, std::chrono::seconds mocktime) const;
std::string LogTimestampStr(SystemClock::time_point now, std::chrono::seconds mocktime) const;
@@ -123,7 +212,7 @@ namespace BCLog {
std::list<std::function<void(const std::string&)>> m_print_callbacks GUARDED_BY(m_cs) {};
/** Send a string to the log output (internal) */
void LogPrintStr_(std::string_view str, std::string_view logging_function, std::string_view source_file, int source_line, BCLog::LogFlags category, BCLog::Level level)
void LogPrintStr_(std::string_view str, std::source_location&& source_loc, BCLog::LogFlags category, BCLog::Level level, bool should_ratelimit)
EXCLUSIVE_LOCKS_REQUIRED(m_cs);
std::string GetLogPrefix(LogFlags category, Level level) const;
@@ -142,7 +231,7 @@ namespace BCLog {
std::atomic<bool> m_reopen_file{false};
/** Send a string to the log output */
void LogPrintStr(std::string_view str, std::string_view logging_function, std::string_view source_file, int source_line, BCLog::LogFlags category, BCLog::Level level)
void LogPrintStr(std::string_view str, std::source_location&& source_loc, BCLog::LogFlags category, BCLog::Level level, bool should_ratelimit)
EXCLUSIVE_LOCKS_REQUIRED(!m_cs);
/** Returns whether logs will be written to any output */
@@ -172,6 +261,12 @@ namespace BCLog {
/** Only for testing */
void DisconnectTestLogger() EXCLUSIVE_LOCKS_REQUIRED(!m_cs);
void SetRateLimiting(std::shared_ptr<LogRateLimiter> limiter) EXCLUSIVE_LOCKS_REQUIRED(!m_cs)
{
StdLockGuard scoped_lock(m_cs);
m_limiter = std::move(limiter);
}
/** Disable logging
* This offers a slight speedup and slightly smaller memory usage
* compared to leaving the logging system in its default state.
@@ -239,7 +334,7 @@ static inline bool LogAcceptCategory(BCLog::LogFlags category, BCLog::Level leve
bool GetLogCategory(BCLog::LogFlags& flag, std::string_view str);
template <typename... Args>
inline void LogPrintFormatInternal(std::string_view logging_function, std::string_view source_file, const int source_line, const BCLog::LogFlags flag, const BCLog::Level level, util::ConstevalFormatString<sizeof...(Args)> fmt, const Args&... args)
inline void LogPrintFormatInternal(std::source_location&& source_loc, BCLog::LogFlags flag, BCLog::Level level, bool should_ratelimit, util::ConstevalFormatString<sizeof...(Args)> fmt, const Args&... args)
{
if (LogInstance().Enabled()) {
std::string log_msg;
@@ -248,19 +343,19 @@ inline void LogPrintFormatInternal(std::string_view logging_function, std::strin
} catch (tinyformat::format_error& fmterr) {
log_msg = "Error \"" + std::string{fmterr.what()} + "\" while formatting log message: " + fmt.fmt;
}
LogInstance().LogPrintStr(log_msg, logging_function, source_file, source_line, flag, level);
LogInstance().LogPrintStr(log_msg, std::move(source_loc), flag, level, should_ratelimit);
}
}
#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
#define LogPrintLevel_(category, level, should_ratelimit, ...) LogPrintFormatInternal(std::source_location::current(), category, level, should_ratelimit, __VA_ARGS__)
// Log unconditionally.
// Log unconditionally. Uses basic rate limiting to mitigate disk filling attacks.
// Be conservative when using functions that unconditionally log to debug.log!
// It should not be the case that an inbound peer can fill up a user's storage
// with debug.log entries.
#define LogInfo(...) LogPrintLevel_(BCLog::LogFlags::ALL, BCLog::Level::Info, __VA_ARGS__)
#define LogWarning(...) LogPrintLevel_(BCLog::LogFlags::ALL, BCLog::Level::Warning, __VA_ARGS__)
#define LogError(...) LogPrintLevel_(BCLog::LogFlags::ALL, BCLog::Level::Error, __VA_ARGS__)
#define LogInfo(...) LogPrintLevel_(BCLog::LogFlags::ALL, BCLog::Level::Info, /*should_ratelimit=*/true, __VA_ARGS__)
#define LogWarning(...) LogPrintLevel_(BCLog::LogFlags::ALL, BCLog::Level::Warning, /*should_ratelimit=*/true, __VA_ARGS__)
#define LogError(...) LogPrintLevel_(BCLog::LogFlags::ALL, BCLog::Level::Error, /*should_ratelimit=*/true, __VA_ARGS__)
// Deprecated unconditional logging.
#define LogPrintf(...) LogInfo(__VA_ARGS__)
@@ -268,12 +363,18 @@ inline void LogPrintFormatInternal(std::string_view logging_function, std::strin
// Use a macro instead of a function for conditional logging to prevent
// evaluating arguments when logging for the category is not enabled.
// Log conditionally, prefixing the output with the passed category name and severity level.
#define LogPrintLevel(category, level, ...) \
do { \
if (LogAcceptCategory((category), (level))) { \
LogPrintLevel_(category, level, __VA_ARGS__); \
} \
// Log by prefixing the output with the passed category name and severity level. This can either
// log conditionally if the category is allowed or unconditionally if level >= BCLog::Level::Info
// is passed. If this function logs unconditionally, logging to disk is rate-limited. This is
// important so that callers don't need to worry about accidentally introducing a disk-fill
// vulnerability if level >= Info is used. Additionally, users specifying -debug are assumed to be
// developers or power users who are aware that -debug may cause excessive disk usage due to logging.
#define LogPrintLevel(category, level, ...) \
do { \
if (LogAcceptCategory((category), (level))) { \
bool rate_limit{level >= BCLog::Level::Info}; \
LogPrintLevel_(category, level, rate_limit, __VA_ARGS__); \
} \
} while (0)
// Log conditionally, prefixing the output with the passed category name.

View File

@@ -575,9 +575,9 @@ void CNode::CloseSocketDisconnect()
m_i2p_sam_session.reset();
}
void CConnman::AddWhitelistPermissionFlags(NetPermissionFlags& flags, const CNetAddr &addr, const std::vector<NetWhitelistPermissions>& ranges) const {
void CConnman::AddWhitelistPermissionFlags(NetPermissionFlags& flags, std::optional<CNetAddr> addr, const std::vector<NetWhitelistPermissions>& ranges) const {
for (const auto& subnet : ranges) {
if (subnet.m_subnet.Match(addr)) {
if (addr.has_value() && subnet.m_subnet.Match(addr.value())) {
NetPermissions::AddFlag(flags, subnet.m_flags);
}
}
@@ -1767,7 +1767,11 @@ void CConnman::CreateNodeFromAcceptedSocket(std::unique_ptr<Sock>&& sock,
{
int nInbound = 0;
AddWhitelistPermissionFlags(permission_flags, addr, vWhitelistedRangeIncoming);
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, vWhitelistedRangeIncoming);
{
LOCK(m_nodes_mutex);
@@ -1822,7 +1826,6 @@ void CConnman::CreateNodeFromAcceptedSocket(std::unique_ptr<Sock>&& sock,
NodeId id = GetNewNodeId();
uint64_t nonce = GetDeterministicRandomizer(RANDOMIZER_ID_LOCALHOSTNONCE).Write(id).Finalize();
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.
ServiceFlags local_services = GetLocalServices();

View File

@@ -1364,7 +1364,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 std::vector<NetWhitelistPermissions>& ranges) const;
void AddWhitelistPermissionFlags(NetPermissionFlags& flags, std::optional<CNetAddr> addr, const std::vector<NetWhitelistPermissions>& ranges) const;
void DeleteNode(CNode* pnode);

View File

@@ -553,12 +553,6 @@ private:
bool via_compact_block, const std::string& message = "")
EXCLUSIVE_LOCKS_REQUIRED(!m_peer_mutex);
/**
* Potentially disconnect and discourage a node based on the contents of a TxValidationState object
*/
void MaybePunishNodeForTx(NodeId nodeid, const TxValidationState& state)
EXCLUSIVE_LOCKS_REQUIRED(!m_peer_mutex);
/** Maybe disconnect a peer and discourage future connections from its address.
*
* @param[in] pnode The node to check.
@@ -1805,32 +1799,6 @@ void PeerManagerImpl::MaybePunishNodeForBlock(NodeId nodeid, const BlockValidati
}
}
void PeerManagerImpl::MaybePunishNodeForTx(NodeId nodeid, const TxValidationState& state)
{
PeerRef peer{GetPeerRef(nodeid)};
switch (state.GetResult()) {
case TxValidationResult::TX_RESULT_UNSET:
break;
// The node is providing invalid data:
case TxValidationResult::TX_CONSENSUS:
if (peer) Misbehaving(*peer, "");
return;
// Conflicting (but not necessarily invalid) data or different policy:
case TxValidationResult::TX_INPUTS_NOT_STANDARD:
case TxValidationResult::TX_NOT_STANDARD:
case TxValidationResult::TX_MISSING_INPUTS:
case TxValidationResult::TX_PREMATURE_SPEND:
case TxValidationResult::TX_WITNESS_MUTATED:
case TxValidationResult::TX_WITNESS_STRIPPED:
case TxValidationResult::TX_CONFLICT:
case TxValidationResult::TX_MEMPOOL_POLICY:
case TxValidationResult::TX_NO_MEMPOOL:
case TxValidationResult::TX_RECONSIDERABLE:
case TxValidationResult::TX_UNKNOWN:
break;
}
}
bool PeerManagerImpl::BlockRequestAllowed(const CBlockIndex* pindex)
{
AssertLockHeld(cs_main);
@@ -2987,8 +2955,6 @@ std::optional<node::PackageToValidate> PeerManagerImpl::ProcessInvalidTx(NodeId
if (peer) AddKnownTx(*peer, parent_txid);
}
MaybePunishNodeForTx(nodeid, state);
return package_to_validate;
}
@@ -3314,7 +3280,21 @@ void PeerManagerImpl::ProcessCompactBlockTxns(CNode& pfrom, Peer& peer, const Bl
}
PartiallyDownloadedBlock& partialBlock = *range_flight.first->second.second->partialBlock;
ReadStatus status = partialBlock.FillBlock(*pblock, block_transactions.txn);
if (partialBlock.header.IsNull()) {
// It is possible for the header to be empty if a previous call to FillBlock wiped the header, but left
// the PartiallyDownloadedBlock pointer around (i.e. did not call RemoveBlockRequest). In this case, we
// should not call LookupBlockIndex below.
RemoveBlockRequest(block_transactions.blockhash, pfrom.GetId());
Misbehaving(peer, "previous compact block reconstruction attempt failed");
LogDebug(BCLog::NET, "Peer %d sent compact block transactions multiple times", pfrom.GetId());
return;
}
// We should not have gotten this far in compact block processing unless it's attached to a known header
const CBlockIndex* prev_block{Assume(m_chainman.m_blockman.LookupBlockIndex(partialBlock.header.hashPrevBlock))};
ReadStatus status = partialBlock.FillBlock(*pblock, block_transactions.txn,
/*segwit_active=*/DeploymentActiveAfter(prev_block, m_chainman, Consensus::DEPLOYMENT_SEGWIT));
if (status == READ_STATUS_INVALID) {
RemoveBlockRequest(block_transactions.blockhash, pfrom.GetId()); // Reset in-flight state in case Misbehaving does not result in a disconnect
Misbehaving(peer, "invalid compact block/non-matching block transactions");
@@ -3322,6 +3302,9 @@ void PeerManagerImpl::ProcessCompactBlockTxns(CNode& pfrom, Peer& peer, const Bl
} else if (status == READ_STATUS_FAILED) {
if (first_in_flight) {
// Might have collided, fall back to getdata now :(
// We keep the failed partialBlock to disallow processing another compact block announcement from the same
// peer for the same block. We let the full block download below continue under the same m_downloading_since
// timer.
std::vector<CInv> invs;
invs.emplace_back(MSG_BLOCK | GetFetchFlags(peer), block_transactions.blockhash);
MakeAndPushMessage(pfrom, NetMsgType::GETDATA, invs);
@@ -3331,23 +3314,7 @@ void PeerManagerImpl::ProcessCompactBlockTxns(CNode& pfrom, Peer& peer, const Bl
return;
}
} else {
// Block is either okay, or possibly we received
// READ_STATUS_CHECKBLOCK_FAILED.
// Note that CheckBlock can only fail for one of a few reasons:
// 1. bad-proof-of-work (impossible here, because we've already
// accepted the header)
// 2. merkleroot doesn't match the transactions given (already
// caught in FillBlock with READ_STATUS_FAILED, so
// impossible here)
// 3. the block is otherwise invalid (eg invalid coinbase,
// block is too big, too many legacy sigops, etc).
// So if CheckBlock failed, #3 is the only possibility.
// Under BIP 152, we don't discourage the peer unless proof of work is
// invalid (we don't require all the stateless checks to have
// been run). This is handled below, so just treat this as
// though the block was successfully read, and rely on the
// handling in ProcessNewBlock to ensure the block index is
// updated, etc.
// Block is okay for further processing
RemoveBlockRequest(block_transactions.blockhash, pfrom.GetId()); // it is now an empty pointer
fBlockRead = true;
// mapBlockSource is used for potentially punishing peers and
@@ -4462,7 +4429,9 @@ void PeerManagerImpl::ProcessMessage(CNode& pfrom, const std::string& msg_type,
return;
}
std::vector<CTransactionRef> dummy;
status = tempBlock.FillBlock(*pblock, dummy);
const CBlockIndex* prev_block{Assume(m_chainman.m_blockman.LookupBlockIndex(cmpctblock.header.hashPrevBlock))};
status = tempBlock.FillBlock(*pblock, dummy,
/*segwit_active=*/DeploymentActiveAfter(prev_block, m_chainman, Consensus::DEPLOYMENT_SEGWIT));
if (status == READ_STATUS_OK) {
fBlockReconstructed = true;
}

View File

@@ -861,10 +861,14 @@ bool IsBadPort(uint16_t port)
case 1720: // h323hostcall
case 1723: // pptp
case 2049: // nfs
case 3306: // MySQL
case 3389: // RDP / Windows Remote Desktop
case 3659: // apple-sasl / PasswordServer
case 4045: // lockd
case 5060: // sip
case 5061: // sips
case 5432: // PostgreSQL
case 5900: // VNC
case 6000: // X11
case 6566: // sane-port
case 6665: // Alternate IRC
@@ -874,6 +878,7 @@ bool IsBadPort(uint16_t port)
case 6669: // Alternate IRC
case 6697: // IRC + TLS
case 10080: // Amanda
case 27017: // MongoDB
return true;
}
return false;

Some files were not shown because too many files have changed in this diff Show More