Commit graph

39218 commits

Author SHA1 Message Date
glozow
c33e83a53a
Merge bitcoin/bitcoin#29509: [26.x] backports and final changes for v26.1rc2
c68d4d0ac5 [doc] update manual pages for v26.1rc2 (glozow)
bd715bfb30 [build] bump version to v26.1rc2 (glozow)
b6d006d2a2 update release notes 26.1 (glozow)
fce992b38e fuzz: restrict fopencookie usage to Linux & FreeBSD (fanquake)
40c56a4d13 test: make sure keypool sizes do not change on `getrawchangeaddress`/`getnewaddress` failures (UdjinM6)
7c82b2758c wallet: Avoid updating `ReserveDestination::nIndex` when `GetReservedDestination` fails (UdjinM6)
b5419ce6b6 p2p: Don't consider blocks mutated if they don't connect to known prev block (Greg Sanders)
0535c253fe [test] IsBlockMutated unit tests (dergoegge)
8141498f3a [validation] Cache merkle root and witness commitment checks (dergoegge)
0c5c5962cb [test] Add regression test for #27608 (dergoegge)
24736350e9 [net processing] Don't process mutated blocks (dergoegge)
50c0b61a9d [validation] Merkle root malleation should be caught by IsBlockMutated (dergoegge)
aff368fa81 [validation] Introduce IsBlockMutated (dergoegge)
076c67c3aa [refactor] Cleanup merkle root checks (dergoegge)
97a1d0a459 [validation] Isolate merkle root checks (dergoegge)
4ac0eb543d test: Drop `x` modifier in `fsbridge::fopen` call for mingw builds (Hennadii Stepanov)

Pull request description:

  Includes:
  - #29357
  - #29412
  - #29524
  - #29510
  - #29529

  Also does:
  - update to release notes
  - bump to rc2
  - manpages
  - (no changes to bitcoin.conf)

ACKs for top commit:
  achow101:
    ACK c68d4d0ac5

Tree-SHA512: 2f8c3dd705e3f9f33403b3cc17e8006510ff827d7dbd609b09732a1669964e9b001cfecdc63d8d8daeb8f39c652e1e4ad0aac873d44d259c21803de85688ed2b
2024-03-11 09:54:18 +00:00
glozow
c68d4d0ac5 [doc] update manual pages for v26.1rc2 2024-03-07 10:51:31 +00:00
glozow
bd715bfb30 [build] bump version to v26.1rc2 2024-03-07 10:47:19 +00:00
glozow
b6d006d2a2 update release notes 26.1 2024-03-07 10:45:40 +00:00
fanquake
fce992b38e fuzz: restrict fopencookie usage to Linux & FreeBSD
Should fix the GCC compilation portion of #29517:
https://github.com/bitcoin/bitcoin/issues/29517#issuecomment-1973573314.

See also:
https://www.gnu.org/software/gnulib/manual/html_node/fopencookie.html
but note that FreeBSD has supported this function since 11.x.

Github-Pull: #29529
Rebased-From: 312f3381a2
2024-03-07 10:45:14 +00:00
UdjinM6
40c56a4d13 test: make sure keypool sizes do not change on getrawchangeaddress/getnewaddress failures
Github-Pull: #29510
Rebased-From: e073f1dfda
2024-03-05 10:50:03 +00:00
UdjinM6
7c82b2758c wallet: Avoid updating ReserveDestination::nIndex when GetReservedDestination fails
Github-Pull: #29510
Rebased-From: 367bb7a80c
2024-03-05 10:49:41 +00:00
Greg Sanders
b5419ce6b6 p2p: Don't consider blocks mutated if they don't connect to known prev block
Github-Pull: #29524
Rebased-From: a1fbde0ef7
2024-03-05 10:47:50 +00:00
dergoegge
0535c253fe [test] IsBlockMutated unit tests
Github-Pull: #29412
Rebased-From: d8087adc7e
2024-03-05 10:46:15 +00:00
dergoegge
8141498f3a [validation] Cache merkle root and witness commitment checks
Slight performance improvement by avoiding duplicate work.

Github-Pull: #29412
Rebased-From: 1ec6bbeb8d
2024-03-05 10:24:35 +00:00
dergoegge
0c5c5962cb [test] Add regression test for #27608
Github-Pull: #29412
Rebased-From: 5bf4f5ba32
2024-03-05 10:24:27 +00:00
dergoegge
24736350e9 [net processing] Don't process mutated blocks
We preemptively perform a block mutation check before further processing
a block message (similar to early sanity checks on other messsage
types). The main reasons for this change are as follows:

- `CBlock::GetHash()` is a foot-gun without a prior mutation check, as
  the hash returned only commits to the header but not to the actual
  transactions (`CBlock::vtx`) contained in the block.
- We have observed attacks that abused mutated blocks in the past, which
  could have been prevented by simply not processing mutated blocks
  (e.g. https://github.com/bitcoin/bitcoin/pull/27608).

Github-Pull: #29412
Rebased-From: 49257c0304
2024-03-05 10:24:17 +00:00
dergoegge
50c0b61a9d [validation] Merkle root malleation should be caught by IsBlockMutated
Github-Pull: #29412
Rebased-From: 2d8495e080
2024-03-05 10:24:16 +00:00
dergoegge
aff368fa81 [validation] Introduce IsBlockMutated
Github-Pull: #29412
Rebased-From: 66abce1d98
2024-03-05 10:21:16 +00:00
dergoegge
076c67c3aa [refactor] Cleanup merkle root checks
Github-Pull: #29412
Rebased-From: e7669e1343
2024-03-01 16:28:19 +00:00
dergoegge
97a1d0a459 [validation] Isolate merkle root checks
Github-Pull: #29412
Rebased-From: 95bddb930a
2024-03-01 16:27:43 +00:00
Hennadii Stepanov
4ac0eb543d test: Drop x modifier in fsbridge::fopen call for mingw builds
The MinGW-w64 toolchain links executables to the old msvcrt C Runtime
Library that does not support the `x` modifier for the _wfopen()
function.

Github-Pull: #29357
Rebased-From: d2fe90571e
2024-02-28 22:21:25 +00:00
glozow
a718bfafe7
Merge bitcoin/bitcoin#29503: 26.x: backport #28784 ("rpc: keep .cookie if it was not generated")
1e956439eb rpc: keep .cookie if it was not generated (Roman Zeyde)

Pull request description:

  v26 introduced a regression in that starting a `bitcoind` twice may have the second instance delete the cookie file of the first, making it impossible to communicate with it.

  Not a big deal but it's annoying, only an issue for 26.0, and the patch is trivial.

ACKs for top commit:
  glozow:
    lgtm ACK 1e956439eb

Tree-SHA512: 0e4b18aebaaf284944f1709b238c8c0acce5e8997409e0c278a5a30ac221ac1ff1d3ad31fbf2ac15b03bf7582891e07a7a2cf00f13cb596aa9512566b9320c23
2024-02-28 11:00:19 -05:00
Roman Zeyde
1e956439eb
rpc: keep .cookie if it was not generated
Otherwise, starting bitcoind twice may cause the `.cookie`
file generated by the first instance to be deleted by the
second instance shutdown (after failing to obtain a lock).

Github-Pull: bitcoin/bitcoin#28784
Rebased-From: 7cb9367157
2024-02-28 11:19:27 +01:00
fanquake
a4690485d1
Merge bitcoin/bitcoin#29440: [26.1] final changes for 26.1rc1
1e7fb270d3 [doc] add release notes for 26.1rc1 (glozow)
0ffeaf237a [doc] update manual pages for 26.1rc1 (glozow)
d4aeb4a5a0 [build] bump version to 26.1rc1 (glozow)
c27793891a qt: 26.1rc1 translations update (Hennadii Stepanov)
40e7693fa1 ci: Switch native macOS CI job to Xcode 15.0 (Hennadii Stepanov)
72eab1ca64 build: Fix `-Xclang -internal-isystem` option (Hennadii Stepanov)

Pull request description:

  Final changes to tag a 26.1rc1.
  Bumps version numbers, man pages, adds release notes etc.

ACKs for top commit:
  hebasto:
    re-ACK 1e7fb270d3
  fanquake:
    ACK 1e7fb270d3

Tree-SHA512: 0f4146590d61f4f9322f3147f672ff2af48fc1d85c708b959adcbdb50b8f280570cb732d9f4a424c014046d07e9aa6e408fc3a0337dbaf8cbaea5283697da35a
2024-02-19 15:31:06 +00:00
glozow
1e7fb270d3 [doc] add release notes for 26.1rc1 2024-02-16 17:30:26 +00:00
glozow
0ffeaf237a [doc] update manual pages for 26.1rc1 2024-02-16 17:29:46 +00:00
glozow
d4aeb4a5a0 [build] bump version to 26.1rc1 2024-02-16 17:29:46 +00:00
Hennadii Stepanov
c27793891a qt: 26.1rc1 translations update
This change is a result if pulling the recent translations
from the Transifex website using the
bitcoin-maintainer-tools/update-translations.py tool.

A few manual adjustments were made:
- skipped removing of `bitcoin_af.ts`
- skipped removing of `bitcoin_ar.ts`
- skipped adding of `bitcoin_ru_RU.ts` (`bitcoin_ru.ts` is already
present)
2024-02-16 17:29:46 +00:00
Hennadii Stepanov
40e7693fa1 ci: Switch native macOS CI job to Xcode 15.0
Github-Pull: #29195
Rebased-From: d742be3d3f
2024-02-16 17:29:31 +00:00
Hennadii Stepanov
72eab1ca64 build: Fix -Xclang -internal-isystem option
LLVM Clang >=16.0 and Apple Clang >=15.0 do not recognize
`-Xclang -internal-isystem/usr/local/include` anymore.

For example, see: cbbe1d4454

Github-Pull: #29195
Rebased-From: 8decc5c726
2024-02-16 17:28:33 +00:00
fanquake
74df372750
Merge bitcoin/bitcoin#29209: [26.x] more backports
11f3a7e6ba Use hardened runtime on macOS release builds. (Mark Friedenbach)
ac1b9a51db [test] import descriptor wallet with reorged parent + IsFromMe child in mempool (glozow)
ecb8ebc660 [test] rescan legacy wallet with reorged parent + IsFromMe child in mempool (Gloria Zhao)
438ac2947d snapshots: don't core dump when running -checkblockindex after `loadtxoutset` (Mark Friedenbach)
7ec34554af [log] mempool loading (glozow)
fe0f8fe8aa net: create I2P sessions with both ECIES-X25519 and ElGamal encryption (Jon Atack)
fc62271015 [refactor] Add helper for iterating through mempool entries (stickies-v)

Pull request description:

  Backports for 26.x. Includes:
  - 453b481 from #28391
    - #29179
  - #29200
  - #29227
  - #28791
  - #29127

ACKs for top commit:
  stickies-v:
    ACK 11f3a7e6ba

Tree-SHA512: 20ef871ec768f2328056d83f958e595b36ae9b8baa8a6e8b0e1f02c3df4b16965a8e05dcb4323afbcc9ecc4bdde10931232512022c39ee7e12baf9795bf25bf1
2024-02-16 13:37:21 +00:00
Mark Friedenbach
11f3a7e6ba
Use hardened runtime on macOS release builds.
The Apple notary service requires submitted app bundles to be configured to use the hardened runtime libraries.  This is configured at signing time, and supported by the signapple tool Bitcoin Core uses for reproduceable signed binaries.  We simply need to pass "--hardened-runtime" when the signature is created.  Once attached to the bundle, the resulting codesigned binary can be successfully submitted to the Apple binary notarization service by any Apple Developer.

Github-Pull: #29127
Rebased-From: 4fdd836db9
2024-01-19 16:14:36 +00:00
glozow
ac1b9a51db
[test] import descriptor wallet with reorged parent + IsFromMe child in mempool
Test that wallet rescans process transactions topologically, even if a
parent's entry into the mempool is later than that of its child.
This behavior is important because IsFromMe requires the ability to look
up a transaction's inputs.

Co-authored-by: furszy <matiasfurszyfer@protonmail.com>

Github-Pull: #29179
Rebased-From: df30247705
2024-01-19 16:13:22 +00:00
Gloria Zhao
ecb8ebc660
[test] rescan legacy wallet with reorged parent + IsFromMe child in mempool
Test that wallet rescans process transactions topologically, even if a
parent's entry into the mempool is later than that of its child.
This behavior is important because IsFromMe requires the ability to look
up a transaction's inputs.

Github-Pull: #29179
Rebased-From: c3d02be536
2024-01-19 16:13:14 +00:00
Mark Friedenbach
438ac2947d
snapshots: don't core dump when running -checkblockindex after loadtxoutset
Github-Pull: #28791
Rebased-From: cdc6ac4126
2024-01-19 16:13:05 +00:00
glozow
7ec34554af
[log] mempool loading
Log at the top before incrementing so that this log isn't printed when
there's only 1 tx.

Github-Pull: #29227
Rebased-From: eb78ea4eeb
2024-01-19 16:12:57 +00:00
Jon Atack
fe0f8fe8aa
net: create I2P sessions with both ECIES-X25519 and ElGamal encryption
A Bitcoin Core node may only connect to a peer destination via I2P if both sides
have sessions with the same encryption type.  The encryption type is a property
of the session, not the destination.  Sessions may support multiple encryption
types.

As Bitcoin Core is not currently setting the I2P encryption type when creating
sessions, it is using the older default, ElGamal (type 0).

This pull updates Bitcoin Core to use both ECIES-X25519 and ElGamal (types 4 and
0, respectively).  This allows to connect to I2P peers with either type, and the
newer, faster ECIES-X25519 will be preferred.

See also the recently updated section "Signature and Encryption Types" in
https://geti2p.net/en/docs/api/samv3

Thanks and credit to zzzi2p (https://github.com/zzzi2p) for reporting.

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

Github-Pull: #29200
Rebased-From: 9d728916b2
2024-01-19 16:12:47 +00:00
stickies-v
fc62271015
[refactor] Add helper for iterating through mempool entries
Instead of reaching into the mapTx data structure, use a helper method
that provides the required vector of CTxMemPoolEntry pointers.

Github-Pull: #28391
Rebased-From: 453b4813eb
2024-01-19 16:12:23 +00:00
glozow
04edf9f586
Merge bitcoin/bitcoin#29011: [26.x] Backports
7b79e54474 doc: update release notes for 26.x (fanquake)
ccf00b1e6e wallet: Fix use-after-free in WalletBatch::EraseRecords (MarcoFalke)
40252e184e ci: Set `HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK` to avoid failures (Hennadii Stepanov)
b06b14e68d rpc: getwalletinfo, return wallet 'birthtime' (furszy)
12834012c2 test: coverage for wallet birth time interaction with -reindex (furszy)
0fa47e2569 wallet: fix legacy spkm default birth time (furszy)
84f4a6c145 wallet: birth time update during tx scanning (furszy)
074296dd60 refactor: rename FirstKeyTimeChanged to MaybeUpdateBirthTime (furszy)
35039ac3cc fuzz: disable BnB when SFFO is enabled (furszy)
903b4623d3 test: add coverage for BnB-SFFO restriction (furszy)
05d0576d3c wallet: create tx, log resulting coin selection info (furszy)
5493ebbe74 wallet: skip BnB when SFFO is active (Murch)
b15e2e2cec test: add regression test for the getrawtransaction segfault (Martin Zumsande)
5097bb3389 rpc: fix getrawtransaction segfault (Martin Zumsande)
81e744a9a6 ci: Use Ubuntu 24.04 Noble for asan (MarcoFalke)
69e53d1e47 ci: Use Ubuntu 24.04 Noble for tsan,tidy,fuzz (MarcoFalke)
d2c80b6f52 doc: Missing additions to 26.0 release notes (fanquake)
8dc2c753ff doc: add historical release notes for 26.0 (fanquake)

Pull request description:

  Backports for `26.x`. Currently:
  * https://github.com/bitcoin/bitcoin/pull/28920
  * https://github.com/bitcoin/bitcoin/pull/28992
  * https://github.com/bitcoin/bitcoin/pull/28994
  * https://github.com/bitcoin/bitcoin/pull/29003
  * https://github.com/bitcoin/bitcoin/pull/29023
  * https://github.com/bitcoin/bitcoin/pull/29080
  * https://github.com/bitcoin/bitcoin/pull/29176

ACKs for top commit:
  TheCharlatan:
    ACK 7b79e54474
  glozow:
    ACK 7b79e54474, matches mine

Tree-SHA512: 898aec76ed3ad35e0edd0980af5bcc21bd60003bbf69e0b4f473ed2aa38c4e3b360b930bc3747cf798195906a8f9fe66417524f5e5ef40fa68f1c1aaceebdeb0
2024-01-09 15:39:19 +00:00
fanquake
7b79e54474
doc: update release notes for 26.x 2024-01-04 16:21:37 +00:00
MarcoFalke
ccf00b1e6e
wallet: Fix use-after-free in WalletBatch::EraseRecords
Github-Pull: #29176
Rebased-From: faebf1df2a
2024-01-04 16:21:37 +00:00
Hennadii Stepanov
40252e184e
ci: Set HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK to avoid failures
Homebrew attempts to check for outdated dependents or those with broken
linkage. Such behavior might lead to failures when Homebrew updates them
on old macOS images.

This change prevents such behavior.

Github-Pull: #29080
Rebased-From: 43c3246af7
2024-01-04 16:21:37 +00:00
furszy
b06b14e68d
rpc: getwalletinfo, return wallet 'birthtime'
And add coverage for it

Github-Pull: #28920
Rebased-From: 1ce45baed7
2024-01-04 16:21:37 +00:00
furszy
12834012c2
test: coverage for wallet birth time interaction with -reindex
Verifying the wallet updates the birth time accordingly when it
detects a transaction with a time older than the oldest descriptor
timestamp.
This could happen when the user blindly imports a descriptor with
'timestamp=now'.

Github-Pull: #28920
Rebased-From: 83c66444d0
2024-01-04 16:21:37 +00:00
furszy
0fa47e2569
wallet: fix legacy spkm default birth time
To avoid scanning blocks, as assumed by a wallet with no
generated keys or imported scripts, the default value for
the birth time needs to be set to the maximum int64_t value.

Once the first key is generated or the first script is imported,
the legacy SPKM will update the birth time automatically.

Github-Pull: #28920
Rebased-From: 6f497377aa
2024-01-04 16:21:37 +00:00
furszy
84f4a6c145
wallet: birth time update during tx scanning
As the user could have imported a descriptor with
a newer timestamp (by blindly setting 'timestamp=now'),
the wallet needs to update the birth time when it detects
a transaction older than the oldest descriptor timestamp.

Github-Pull: #28920
Rebased-From: 75fbf444c1
2024-01-04 16:21:37 +00:00
furszy
074296dd60
refactor: rename FirstKeyTimeChanged to MaybeUpdateBirthTime
In the following-up commit, the wallet birth time will also
be modified by the transactions scanning process. When a tx
older than all descriptor's timestamp is detected.

Github-Pull: #28920
Rebased-From: b4306e3c8d
2024-01-04 16:21:37 +00:00
furszy
35039ac3cc
fuzz: disable BnB when SFFO is enabled
Github-Pull: #28994
Rebased-From: 576bee88fd
2024-01-04 16:21:36 +00:00
furszy
903b4623d3
test: add coverage for BnB-SFFO restriction
Verify the transaction creation process does not produce
a BnB solution when SFFO is enabled.
This is currently problematic because it could require a
change output. And BnB is specialized on changeless solutions.

Co-authored-by: Andrew Chow <achow101@gmail.com>
Co-authored-by: Murch <murch@murch.one>

Github-Pull: #28994
Rebased-From: 05e5ff194c
2024-01-04 16:21:36 +00:00
furszy
05d0576d3c
wallet: create tx, log resulting coin selection info
Useful for understanding what is going on internally
when the software is running. Debug issues, and provide
more accurate feedback to users.

Github-Pull: #28994
Rebased-From: 0c5755761c
2024-01-04 16:21:36 +00:00
Murch
5493ebbe74
wallet: skip BnB when SFFO is active
Co-authored-by: furszy <matiasfurszyfer@protonmail.com>

Github-Pull: #28994
Rebased-From: 5cea25ba79
2024-01-04 16:21:36 +00:00
Martin Zumsande
b15e2e2cec
test: add regression test for the getrawtransaction segfault
This fails on master without the previous commit.

Github-Pull: #29003
Rebased-From: 9075a44646
2024-01-04 16:21:36 +00:00
Martin Zumsande
5097bb3389
rpc: fix getrawtransaction segfault
The crash would happen when querying a mempool transaction with verbosity=2, while pruning.

Github-Pull: #29003
Rebased-From: 494a926d05
2024-01-04 16:21:36 +00:00
MarcoFalke
81e744a9a6
ci: Use Ubuntu 24.04 Noble for asan
Github-Pull: #28992
Rebased-From: fad2392c58
2024-01-04 16:21:36 +00:00