Commit graph

37373 commits

Author SHA1 Message Date
fanquake
1ce5accc32
Merge bitcoin/bitcoin#29464: [25.2] Final backports and changes for 25.2rc1
9f13dc1ed3 doc: Update release notes for 25.2rc1 (Ava Chow)
a27662b16a doc: update manpages for 25.2rc1 (Ava Chow)
65c6171784 build: Bump to 25.2rc1 (Ava Chow)
cf0f43ee42 wallet: Fix use-after-free in WalletBatch::EraseRecords (MarcoFalke)
6acfc4324c Use only Span{} constructor for byte-like types where possible (MarcoFalke)
b40d10787b util: Allow std::byte and char Span serialization (MarcoFalke)

Pull request description:

  Backport:

  * #29176
  * #27927

  #29176 does not cleanly backport, and it also requires 27927 to work. Both are still fairly simple backports.

  Also does the rest of the version bump tasks for 25.2rc1.

ACKs for top commit:
  fanquake:
    ACK 9f13dc1ed3

Tree-SHA512: 9d9dbf415f8559410eba9a431b61a8fc94216898d2d1fd8398e1f7a22a04790faade810e65324c7a797456b33396c3a58f991e81319aaaa63d3ab441e5e20dbc
2024-02-26 11:54:29 +00:00
Ava Chow
9f13dc1ed3 doc: Update release notes for 25.2rc1 2024-02-21 18:52:41 -05:00
Ava Chow
a27662b16a doc: update manpages for 25.2rc1 2024-02-21 18:48:50 -05:00
Ava Chow
65c6171784 build: Bump to 25.2rc1 2024-02-21 18:39:11 -05:00
MarcoFalke
cf0f43ee42
wallet: Fix use-after-free in WalletBatch::EraseRecords
Github-Pull: bitcoin/bitcoin#29176
Rebased-From: faebf1df2a
2024-02-21 18:34:20 -05:00
MarcoFalke
6acfc4324c
Use only Span{} constructor for byte-like types where possible
This removes bloat that is not needed.

Github-Pull: bitcoin/bitcoin#27927
Rebased-From: fa38d86235
2024-02-21 18:34:05 -05:00
MarcoFalke
b40d10787b
util: Allow std::byte and char Span serialization
Github-Pull: bitcoin/bitcoin#27927
Rebased-From: fa257bc831
2024-02-21 18:33:43 -05:00
fanquake
8087626cbd
Merge bitcoin/bitcoin#28768: [25.x] Backports
53bbda5114 doc: update release notes for 25.x (fanquake)
31e1e035be test: add regression test for the getrawtransaction segfault (Martin Zumsande)
041228d293 rpc: fix getrawtransaction segfault (Martin Zumsande)
b86285df1f gui: fix crash on selecting "Mask values" in transaction view (Sebastian Falbesoner)
c21024fd86 doc: add historical release notes for 25.1 (fanquake)

Pull request description:

  Collecting backports for the 25.x branch. Currently:
  * https://github.com/bitcoin-core/gui/pull/774
  * https://github.com/bitcoin/bitcoin/pull/29003

ACKs for top commit:
  stickies-v:
    ACK 53bbda5114

Tree-SHA512: 9b1ba17cce9de70d20329372ba71225dd930718a1f7db84a7be764dcfbba01c5e466255e7b95433ab6d7559ee8aaa04cc99ee5d1512d91fcc0a8015f1aa4150a
2024-01-16 11:23:36 +00:00
fanquake
53bbda5114
doc: update release notes for 25.x 2024-01-16 09:28:18 +00:00
Martin Zumsande
31e1e035be
test: add regression test for the getrawtransaction segfault
This fails on master without the previous commit.

Github-Pull: #29003
Rebased-From: 9075a44646
2024-01-15 15:23:49 +00:00
Martin Zumsande
041228d293
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-15 15:23:49 +00:00
Sebastian Falbesoner
b86285df1f
gui: fix crash on selecting "Mask values" in transaction view
This commits fixes a crash bug that can be caused with the following steps:
- change to the "Transactions" view
- right-click on an arbitrary transaction -> "Show transaction details"
- close the transaction detail window again
- select "Settings" -> "Mask values"

The problem is that the list of opened dialogs, tracked in the member
variable `m_opened_dialogs`, is only ever appended with newly opened
transaction detail dialog pointers, but never removed. This leads to
dangling pointers in the list, and if the "Mask values" menu item is
selected, a crash is caused in the course of trying to close the opened
transaction detail dialogs (see `closeOpenedDialogs()` method). Fix this
by removing the pointer from the list if the corresponding widget is
destroyed.

Github-Pull: https://github.com/bitcoin-core/gui/pull/774
Rebased-From: e26e665f9f
2023-12-11 15:51:59 +00:00
fanquake
c21024fd86
doc: add historical release notes for 25.1 2023-12-11 15:51:59 +00:00
fanquake
7da4ae1f78
Merge bitcoin/bitcoin#28655: [25.1] Final Changes
a13670090d doc: update release notes for 25.1 (fanquake)
e8d5c35e80 doc: update manual pages for 25.1 (fanquake)
9e00b73ee7 build: bump version to 25.1 final (fanquake)

Pull request description:

  Final changes for `v25.1`.
  PR for bitcoincore.org is here: https://github.com/bitcoin-core/bitcoincore.org/pull/991.
  No additional changes have been backported since rc1 (tagged 14 days ago),
  and no bugs or issues have been reported (test bins have been available for 9 days).

ACKs for top commit:
  hebasto:
    ACK a13670090d.
  TheCharlatan:
    lgtm ACK a13670090d

Tree-SHA512: 037f937dd4d2a9de15ff15a80f35b6047b61ffc3d9a33e7d4a4fcbce6302569bbc516c6da5849211b34ebbe914c4edcdd182e2d1d43897d0dcd32834ce6f2574
2023-10-16 16:44:20 +01:00
fanquake
a13670090d
doc: update release notes for 25.1 2023-10-16 11:35:40 +02:00
fanquake
e8d5c35e80
doc: update manual pages for 25.1 2023-10-16 11:34:25 +02:00
fanquake
9e00b73ee7
build: bump version to 25.1 final 2023-10-16 11:30:08 +02:00
fanquake
167d3e2f16
Merge bitcoin/bitcoin#28559: [25.1] Final changes for 25.1rc1
10f3f813b2 doc: add release notes for 25.1rc1 (fanquake)
71aed7aa31 doc: update manual pages for 25.1rc1 (fanquake)
02f059c819 build: Bump version to 25.1rc1 (fanquake)
dc1fcec026 doc: add 25.0 release notes (fanquake)

Pull request description:

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

ACKs for top commit:
  dergoegge:
    ACK 10f3f813b2
  hebasto:
    ACK 10f3f813b2, I have reviewed the code and it looks OK.
  willcl-ark:
    ACK 10f3f813b2
  stickies-v:
    ACK 10f3f813b2

Tree-SHA512: 3e1c527dac06afb4c8e1e481055211f69aa0ed769ac242ed610d23d470bbc0c062227034d01876ba4a5fa836e953fb001e8b0d6bc026069d372d34b8a031fb25
2023-10-04 13:10:16 +01:00
fanquake
10f3f813b2
doc: add release notes for 25.1rc1 2023-10-04 11:24:05 +01:00
fanquake
71aed7aa31
doc: update manual pages for 25.1rc1 2023-10-04 11:24:05 +01:00
fanquake
02f059c819
build: Bump version to 25.1rc1 2023-10-04 11:24:05 +01:00
fanquake
dc1fcec026
doc: add 25.0 release notes 2023-10-04 11:24:05 +01:00
fanquake
9f8d501cb8
Merge bitcoin/bitcoin#28487: [25.1] Final backports
45a5fcb165 http: bugfix: track closed connection (stickies-v)
752a456fa8 http: log connection instead of request count (stickies-v)
ae86adabe4 http: refactor: use encapsulated HTTPRequestTracker (stickies-v)
f31899d19a gui: macOS, make appMenuBar part of the main app window (furszy)
64ffa94231 gui: macOS, do not process dock icon actions during shutdown (furszy)
e270f3f857 depends: fix unusable memory_resource in macos qt build (fanquake)
a6683945ca build, macos: Fix `qt` package build with new Xcode 15 linker (Hennadii Stepanov)
b3517cb1b5 test: Test loading wallets with conflicts without a chain (Andrew Chow)
d63478cb50 wallet: Check last block and conflict height are valid in MarkConflicted (Andrew Chow)
5e51a9cc72 ci: Nuke Android APK task, Use credits for tsan (MarcoFalke)
910c36253e test: ensure old fee_estimate.dat not read on restart and flushed (ismaelsadeeq)
37764d3300 tx fees, policy: read stale fee estimates with a regtest-only option (ismaelsadeeq)
16bb9161fa tx fees, policy: do not read estimates of old fee_estimates.dat (ismaelsadeeq)
c4dd5989b3 tx fees, policy: periodically flush fee estimates to fee_estimates.dat (ismaelsadeeq)
c36770cefd test: wallet, verify migration doesn't crash for an invalid script (furszy)
0d2a33e05c wallet: disallow migration of invalid or not-watched scripts (furszy)
2c51a07c08 Do not use std::vector = {} to release memory (Pieter Wuille)

Pull request description:

  Further backports for the `25.x` branch. Currently:
  * https://github.com/bitcoin/bitcoin/pull/27622
  * https://github.com/bitcoin/bitcoin/pull/27834
  * https://github.com/bitcoin/bitcoin/pull/28125
  * https://github.com/bitcoin/bitcoin/pull/28452
  * https://github.com/bitcoin/bitcoin/pull/28542
  * https://github.com/bitcoin/bitcoin/pull/28543
  * https://github.com/bitcoin/bitcoin/pull/28551
  * https://github.com/bitcoin/bitcoin/pull/28571
  * https://github.com/bitcoin-core/gui/pull/751

ACKs for top commit:
  hebasto:
    re-ACK 45a5fcb165, only #28551 has been backported with since my recent [review](https://github.com/bitcoin/bitcoin/pull/28487#pullrequestreview-1655584132).
  dergoegge:
    reACK 45a5fcb165
  willcl-ark:
    reACK 45a5fcb165

Tree-SHA512: 0f5807aa364b7c2a2039fef11d5cd5e168372c3bf5b0e941350fcd92e7db4a1662801b97bb4f68e29788c77d24bbf97385a483c4501ca72d93fa25327d5694fa
2023-10-04 11:23:14 +01:00
stickies-v
45a5fcb165
http: bugfix: track closed connection
It is possible that the client disconnects before the request is
handled. In those cases, evhttp_request_set_on_complete_cb is never
called, which means that on shutdown the server we'll keep waiting
endlessly.

By adding evhttp_connection_set_closecb, libevent automatically
cleans up those dead connections at latest when we shutdown, and
depending on the libevent version already at the moment of remote
client disconnect. In both cases, the bug is fixed.

Github-Pull: #28551
Rebased-From: 68f23f57d7
2023-10-04 10:12:59 +01:00
stickies-v
752a456fa8
http: log connection instead of request count
There is no significant benefit in logging the request count instead
of the connection count. Reduces amount of code and computational
complexity.

Github-Pull: #28551
Rebased-From: 084d037231
2023-10-04 10:11:01 +01:00
stickies-v
ae86adabe4
http: refactor: use encapsulated HTTPRequestTracker
Introduces and uses a HTTPRequestTracker class to keep track of
how many HTTP requests are currently active, so we don't stop the
server before they're all handled.

This has two purposes:
1. In a next commit, allows us to untrack all requests associated
with a connection without running into lifetime issues of the
connection living longer than the request
(see https://github.com/bitcoin/bitcoin/pull/27909#discussion_r1265614783)

2. Improve encapsulation by making the mutex and cv internal members,
and exposing just the WaitUntilEmpty() method that can be safely
used.

Github-Pull: #28551
Rebased-From: 41f9027813
2023-10-04 10:10:35 +01:00
furszy
f31899d19a
gui: macOS, make appMenuBar part of the main app window
By moving the appMenuBar destruction responsibility to the QT
framework, we ensure the disconnection of the submenus signals
prior to the destruction of the main app window.

The standalone menu bar may have served a purpose in earlier
versions when it didn't contain actions that directly open
specific screens within the main application window. However,
at present, all the actions within the appMenuBar lead to the
opening of screens within the main app window. So, the absence
of a main app window makes these actions essentially pointless.

Github-Pull: gui#751
Rebased-From: bae209e387
2023-10-03 15:59:17 +01:00
furszy
64ffa94231
gui: macOS, do not process dock icon actions during shutdown
As the 'QMenuBar' is created without a parent window in MacOS, the
app crashes when the user presses the shutdown button and, right
after it, triggers any action in the menu bar.

This happens because the QMenuBar is manually deleted in the
BitcoinGUI destructor but the events attached to it children
actions are not disconnected, so QActions events such us the
'QMenu::aboutToShow' could try to access null pointers.

Instead of guarding every single QAction pointer inside the
QMenu::aboutToShow slot, or manually disconnecting all
registered events in the destructor, we can check if a
shutdown was requested and discard the event.

The 'node' field is a ref whose memory is held by the
main application class, so it is safe to use here. Events
are disconnected prior destructing the main application object.

Furthermore, the 'MacDockIconHandler::dockIconClicked' signal
can make the app crash during shutdown for the very same
reason. The 'show()' call triggers the 'QApplication::focusWindowChanged'
event, which is connected to the 'minimize_action' QAction,
which is also part of the app menu bar, which could no longer exist.

Github-Pull: gui#751
Rebased-From: e14cc8fc69
2023-10-03 15:58:41 +01:00
fanquake
e270f3f857
depends: fix unusable memory_resource in macos qt build
See https://codereview.qt-project.org/c/qt/qtbase/+/482392.

Github-Pull: #28571
Rebased-From: 848eec0936
2023-10-03 15:55:04 +01:00
Hennadii Stepanov
a6683945ca
build, macos: Fix qt package build with new Xcode 15 linker
Github-Pull: #28543
Rebased-From: 79ef528511
2023-10-03 10:32:55 +01:00
Andrew Chow
b3517cb1b5
test: Test loading wallets with conflicts without a chain
Loading a wallet with conflicts without a chain (e.g. wallet tool and
migration) would previously result in an assertion due to -1 being both
a valid number of conflict confirmations, and the indicator that that
member has not been set yet.

Github-Pull: #28542
Rebased-From: 782701ce7d
2023-10-02 13:39:34 +01:00
Andrew Chow
d63478cb50
wallet: Check last block and conflict height are valid in MarkConflicted
MarkConflicted calculates conflict confirmations incorrectly when both
the last block processed height and the conflicting height are negative
(i.e. uninitialized). If either are negative, we should not be marking
conflicts and should exit early.

Github-Pull: #28542
Rebased-From: 4660fc82a1
2023-10-02 13:29:04 +01:00
MarcoFalke
5e51a9cc72
ci: Nuke Android APK task, Use credits for tsan
Github-Pull: #27834
Rebased-From: fa22538e48
2023-10-02 13:09:01 +01:00
ismaelsadeeq
910c36253e
test: ensure old fee_estimate.dat not read on restart and flushed
This commit adds tests to ensure that old fee_estimates.dat files
are not read and that fee_estimates are periodically flushed to the
fee_estimates.dat file.

Additionaly it tests the -regtestonly option -acceptstalefeeestimates.

Github-Pull: #27622
Rebased-From: d2b39e09bc
2023-10-02 13:09:01 +01:00
ismaelsadeeq
37764d3300
tx fees, policy: read stale fee estimates with a regtest-only option
If -acceptstalefeeestimates option is passed stale fee estimates can now
be read when operating in regtest environments.

Additionally, this commit updates all declarations of the CBlockPolicyEstimator
class to include a the second constructor variable.

Github-Pull: #27622
Rebased-From: cf219f29f3
2023-10-02 13:09:01 +01:00
ismaelsadeeq
16bb9161fa
tx fees, policy: do not read estimates of old fee_estimates.dat
Old fee estimates could cause transactions to become stuck in the
mempool. This commit prevents the node from using stale estimates
from an old file.

Github-Pull: #27622
Rebased-From: 3eb241a141
2023-10-02 13:09:01 +01:00
ismaelsadeeq
c4dd5989b3
tx fees, policy: periodically flush fee estimates to fee_estimates.dat
This reduces chances of having old estimates in fee_estimates.dat.

Github-Pull: #27622
Rebased-From: 5b886f2b43
2023-10-02 13:09:01 +01:00
furszy
c36770cefd
test: wallet, verify migration doesn't crash for an invalid script
The migration process must skip any invalid script inside the legacy
spkm and all the addressbook records linked to them.

These scripts are not being watched by the current wallet, nor should
be watched by the migrated one.

IsMine() returns ISMINE_NO for them.

Github-Pull: #28125
Rebased-From: 8e7e3e6149
2023-10-02 13:09:01 +01:00
furszy
0d2a33e05c
wallet: disallow migration of invalid or not-watched scripts
The legacy wallet allowed to import any raw script, without checking if
it was valid or not. Appending it to the watch-only set.

This causes a crash in the migration process because we are only
expecting to find valid scripts inside the legacy spkm.

These stored scripts internally map to `ISMINE_NO` (same as if they
weren't stored at all..).

So we need to check for these special case, and take into account that
the legacy spkm could be storing invalid not watched scripts.

Which, in code words, means IsMineInner() returning IsMineResult::INVALID
for them.

Github-Pull: #28125
Rebased-From: 1de8a2372a
2023-10-02 13:09:01 +01:00
Pieter Wuille
2c51a07c08
Do not use std::vector = {} to release memory
Github-Pull: #28452
Rebased-From: 3fcd7fc7ff
2023-10-02 13:09:00 +01:00
fanquake
887cbfcc93
Merge bitcoin/bitcoin#28534: [25.x] qt: 25.1rc1 translations update
88b525f93a qt: 25.1rc1 translations update (Hennadii Stepanov)

Pull request description:

  This PR pulls the recent translations from the [Transifex.com](https://www.transifex.com/bitcoin/bitcoin) using the [`bitcoin-maintainer-tools/update-translations.py`](https://github.com/bitcoin-core/bitcoin-maintainer-tools/blob/main/update-translations.py) tool.

  According to our [Release Process docs](https://github.com/bitcoin/bitcoin/blob/master/doc/release-process.md#before-every-release-candidate), it is supposed to be merged before `v25.1rc1` tagging.

  Changes in "Chinese (China) (zh_CN)" translation were manually discarded as they have too many removals (it looks like a vandalism).

ACKs for top commit:
  stickies-v:
    re-ACK 88b525f93a
  jarolrod:
    ACK 88b525f93a

Tree-SHA512: 007d3e00f92d2450f99d1a84b53dc929fd80b7ebb7939271b67969bf99bb3b0ae7426428f6c63f1dbdfa88b90cb237e7614f7b2239f9773b84424b544bf106af
2023-10-02 10:47:32 +02:00
Hennadii Stepanov
88b525f93a
qt: 25.1rc1 translations update 2023-09-28 15:50:04 +01:00
fanquake
ecc74cd4f3
Merge bitcoin/bitcoin#28047: [25.x] Further backports for 25.1
494f1afa5a depends: xcb-proto 1.15.2 (fanquake)
513ca0a711 test: wallet, add coverage for watch-only raw sh script migration (furszy)
6d5a510dcd descriptor: InferScript, do not return top-level only func as sub descriptor (furszy)
37d9cc657c test: wallet, add coverage for addressbook migration (furszy)
4b16650c10 wallet: migration bugfix, persist empty labels (furszy)
59b06b696a wallet: migration bugfix, clone 'send' record label to all wallets (furszy)

Pull request description:

  Currently backports:
  * #28038
  * #28067 2nd & 3rd commits.
  * #28097

ACKs for top commit:
  stickies-v:
    ACK 494f1afa5a

Tree-SHA512: cea134cfa72950d8428191adce79c0881302ca54488f64d3d4a5f9070bb2445d8074e58fa31a482481c4eabb74c852a025f53597540fc646dc20f33b21cf0a06
2023-09-06 15:55:51 +01:00
fanquake
494f1afa5a
depends: xcb-proto 1.15.2
Resolves build failures under Python 3.12, i.e building on rawhide:
```bash
make[3]: Nothing to be done for 'install-exec-am'.
 /usr/bin/mkdir -p '/bitcoin/depends/work/staging/aarch64-unknown-linux-gnu/xcb_proto/1.14.1-4a91ac9dc41/bitcoin/depends/aarch64-unknown-linux-gnu/lib/python3.12/site-packages/xcbgen'
 /usr/bin/install -c -m 644 __init__.py error.py expr.py align.py matcher.py state.py xtypes.py '/bitcoin/depends/work/staging/aarch64-unknown-linux-gnu/xcb_proto/1.14.1-4a91ac9dc41/bitcoin/depends/aarch64-unknown-linux-gnu/lib/python3.12/site-packages/xcbgen'
Traceback (most recent call last):
  File "<string>", line 2, in <module>
ModuleNotFoundError: No module named 'imp'
make[3]: *** [Makefile:271: install-pkgpythonPYTHON] Error 1
```

`imp` was removed in 3.12: https://docs.python.org/3/library/imp.html.

Github-Pull: #28097
Rebased-From: 7cb88c8b46
2023-07-21 09:57:59 +01:00
furszy
513ca0a711
test: wallet, add coverage for watch-only raw sh script migration
Github-Pull: #28067
Rebased-From: dd9633b516
2023-07-21 09:39:15 +01:00
furszy
6d5a510dcd
descriptor: InferScript, do not return top-level only func as sub descriptor
e.g. sh(addr(ADDR)) or sh(raw(HEX)) are invalid descriptors.

Making sh and wsh top level functions to return addr/raw descriptors when
the subscript inference fails.

Github-Pull: #28067
Rebased-From: cc781a2180
2023-07-21 09:38:35 +01:00
furszy
37d9cc657c
test: wallet, add coverage for addressbook migration
Github-Pull: #28038
Rebased-From: 7ecc29a0b7
2023-07-07 17:32:28 +01:00
furszy
4b16650c10
wallet: migration bugfix, persist empty labels
addressbook records with no associated label could be
treated as change. And we don't want that for external
addresses.

Github-Pull: #28038
Rebased-From: a277f8357a
2023-07-07 17:31:14 +01:00
furszy
59b06b696a
wallet: migration bugfix, clone 'send' record label to all wallets
Github-Pull: #28038
Rebased-From: 1b64f6498c
2023-07-07 17:30:53 +01:00
fanquake
8825983716
Merge bitcoin/bitcoin#27752: [25.x] Parallel compact block downloads
b8ad3220a9 Unconditionally return when compact block status == READ_STATUS_FAILED (Greg Sanders)
cdd3de08e3 Add tests for parallel compact block downloads (Greg Sanders)
e66a5cbb56 Support up to 3 parallel compact block txn fetchings (Greg Sanders)
d1a93f5d41 Only request full blocks from the peer we thought had the block in-flight (Greg Sanders)
38e3af9fad Convert mapBlocksInFlight to a multimap (Greg Sanders)
a45159b8e2 Remove nBlocksInFlight (Greg Sanders)
722361e129 alias BlockDownloadMap for mapBlocksInFlight (Greg Sanders)

Pull request description:

  Backports:
  * https://github.com/bitcoin/bitcoin/pull/27626
  * https://github.com/bitcoin/bitcoin/pull/27743

ACKs for top commit:
  instagibbs:
    utACK b8ad3220a9
  ajtowns:
    ACK b8ad3220a9 ; confirmed patches are clean cherry-picks from master, and already tested patches prior to 25.0 release

Tree-SHA512: 438901496a5ed927662e62f936e3d1e7ffb727cb235869854983e8e29a68e144eb3bff307d9fc3ae785fb276b67a216b1cce397689252ca49c5d761efc1380ac
2023-07-04 12:00:54 +01:00