mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-04-03 20:35:17 +02:00
Merge bitcoin/bitcoin#32292: [29.x] Backports
a0d1f69b55doc: update release notes for 29.x (fanquake)6c0f26d3bdtest: check that creating a wallet does not log version info (Ava Chow)e685b4eca2test: Check that the correct versions are logged on wallet load (Ava Chow)25aa15ee7fwalletdb: Log the wallet version after it has been read from disk (Ava Chow)cf034172bftest: fix another intermittent failure in wallet_basic.py (Martin Zumsande)c966158426test: Fix intermittent failure in wallet_basic.py (Martin Zumsande)6c4e3de2actest: Use uninvolved pruned node in feature_pruning undo test (enoch)edd4073d70test: Fix nTimes typo in feature_pruning test (enoch)cc2fcdfc5ecmake: Allow `WITH_DBUS` on all Unix-like systems (Hennadii Stepanov)caec3cc41bcrypto: disable ASan for sha256_sse4 with Clang (fanquake)fabf4ff237tracing: fix invalid argument in mempool_monitor (William Casarin)f9d2c67a0ccmake: Respect user-provided configuration-specific flags (Hennadii Stepanov)6ed087dededoc: Fix test_bitcoin path (monlovesmango)2f6c802b54doc: Fix fuzz test_runner.py path (monlovesmango)f4d9546425qt: Replace stray tfm::format to cerr with qWarning (laanwj)5aa4956cd3gui: crash fix, disconnect numBlocksChanged() signal during shutdown (furszy)3665310808scripted-diff: Use bpf_cflags (MarcoFalke)4ed5c34abbtest: Add imports for util bpf_cflags (MarcoFalke)3dbd2b3d17refactor: Remove spurious virtual from final ~CZMQNotificationInterface (MarcoFalke)64552c83b2ci: Add workaround for vcpkg's libevent package (Hennadii Stepanov)85f3e1de68test: Handle empty string returned by CLI as None in RPC tests (Brandon Odiwuor)ca70d5cb25Remove 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: crACKa0d1f69b55Tree-SHA512: 72aafd17348aa4b602661efd07d48c6af6637c7349e7b032a65f46364e50094723d1c80dced71f0d5ddec59d6dafb72f0463944413a4d810a35cdca6b8272780
This commit is contained in:
8
.github/workflows/ci.yml
vendored
8
.github/workflows/ci.yml
vendored
@@ -194,10 +194,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
|
||||
|
||||
@@ -19,6 +19,10 @@ 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
|
||||
#=============================
|
||||
@@ -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)
|
||||
@@ -660,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}")
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -80,7 +80,7 @@ int trace_removed(struct pt_regs *ctx) {
|
||||
void *phash = NULL, *preason = NULL;
|
||||
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);
|
||||
@@ -95,7 +95,7 @@ int trace_rejected(struct pt_regs *ctx) {
|
||||
void *phash = NULL, *preason = NULL;
|
||||
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;
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
Bitcoin Core version 29.0 is now available from:
|
||||
Bitcoin Core version 29.x is now available from:
|
||||
|
||||
<https://bitcoincore.org/bin/bitcoin-core-29.0/>
|
||||
<https://bitcoincore.org/bin/bitcoin-core-29.x/>
|
||||
|
||||
This release includes new features, various bug fixes and performance
|
||||
improvements, as well as updated translations.
|
||||
@@ -37,226 +37,62 @@ unsupported systems.
|
||||
Notable changes
|
||||
===============
|
||||
|
||||
### P2P and Network Changes
|
||||
### Wallet
|
||||
|
||||
- Support for UPnP was dropped. If you want to open a port automatically, consider using the `-natpmp`
|
||||
option instead, which uses PCP or NAT-PMP depending on router support. (#31130)
|
||||
- #32553 wallet: Fix logging of wallet version
|
||||
|
||||
- libnatpmp was replaced with a built-in implementation of PCP and NAT-PMP (still enabled using the `-natpmp` option). This supports automatic IPv4 port forwarding as well as IPv6 pinholing. (#30043)
|
||||
### Test
|
||||
|
||||
- When the `-port` configuration option is used, the default onion listening port will now
|
||||
be derived to be that port + 1 instead of being set to a fixed value (8334 on mainnet).
|
||||
This re-allows setups with multiple local nodes using different `-port` and not using `-bind`,
|
||||
which would lead to a startup failure in v28.0 due to a port collision.
|
||||
Note that a `HiddenServicePort` manually configured in `torrc` may need adjustment if used in
|
||||
connection with the `-port` option.
|
||||
For example, if you are using `-port=5555` with a non-standard value and not using `-bind=...=onion`,
|
||||
previously Bitcoin Core would listen for incoming Tor connections on `127.0.0.1:8334`.
|
||||
Now it would listen on `127.0.0.1:5556` (`-port` plus one). If you configured the hidden service manually
|
||||
in torrc now you have to change it from `HiddenServicePort 8333 127.0.0.1:8334` to `HiddenServicePort 8333
|
||||
127.0.0.1:5556`, or configure bitcoind with `-bind=127.0.0.1:8334=onion` to get the previous behavior.
|
||||
(#31223)
|
||||
- #32286 test: Handle empty string returned by CLI as None in RPC tests
|
||||
- #32312 test: Fix feature_pruning test after nTime typo fix
|
||||
- #32336 test: Suppress upstream -Wduplicate-decl-specifier in bpfcc
|
||||
- #32483 test: fix two intermittent failures in wallet_basic.py
|
||||
|
||||
- Upon receiving an orphan transaction (an unconfirmed transaction that spends unknown inputs), the node will attempt to download missing parents from all peers who announced the orphan. This change may increase bandwidth usage but make orphan-handling more reliable. (#31397)
|
||||
### Util
|
||||
|
||||
### Mempool Policy and Mining Changes
|
||||
- #32248 Remove support for RNDR/RNDRRS for aarch64
|
||||
|
||||
- Ephemeral dust is a new concept that allows a single
|
||||
dust output in a transaction, provided the transaction
|
||||
is zero fee. In order to spend any unconfirmed outputs
|
||||
from this transaction, the spender must also spend
|
||||
this dust in addition to any other desired outputs.
|
||||
In other words, this type of transaction
|
||||
should be created in a transaction package where
|
||||
the dust is both created and spent simultaneously. (#30239)
|
||||
### Build
|
||||
|
||||
- Due to a bug, the default block reserved weight (`4,000 WU`) for fixed-size block header, transactions count, and coinbase transaction was reserved twice and could not be lowered. As a result the total reserved weight was always `8,000 WU`, meaning that even when specifying a `-blockmaxweight` higher than the default (even to the max of `4,000,000 WU`), the actual block size will never exceed `3,992,000 WU`.
|
||||
The fix consolidates the reservation into a single place and introduces a new startup option, `-blockreservedweight` which specifies the reserved weight directly. The default value of `-blockreservedweight` is set to `8,000 WU` to ensure backward compatibility for users who relied on the previous behavior of `-blockmaxweight`.
|
||||
The minimum value of `-blockreservedweight` is set to `2,000 WU`. Users setting `-blockreservedweight` below the default should ensure that the total weight of their block header, transaction count, and coinbase transaction does not exceed the reduced value or they may risk mining an invalid block. (#31384)
|
||||
- #32356 cmake: Respect user-provided configuration-specific flags
|
||||
- #32437 crypto: disable ASan for sha256_sse4 with Clang
|
||||
- #32469 cmake: Allow WITH_DBUS on all Unix-like systems
|
||||
|
||||
### Updated RPCs
|
||||
### Gui
|
||||
|
||||
- The RPC `testmempoolaccept` response now includes a `reject-details` field in some cases,
|
||||
similar to the complete error messages returned by `sendrawtransaction` (#28121)
|
||||
- #864 Crash fix, disconnect numBlocksChanged() signal during shutdown
|
||||
- #868 Replace stray tfm::format to cerr with qWarning
|
||||
|
||||
- Duplicate blocks submitted with `submitblock` will now persist their block data
|
||||
even if it was previously pruned. If pruning is activated, the data will be
|
||||
pruned again eventually once the block file it is persisted in is selected for
|
||||
pruning. This is consistent with the behaviour of `getblockfrompeer` where the
|
||||
block is persisted as well even when pruning. (#31175)
|
||||
### Doc
|
||||
|
||||
- `getmininginfo` now returns `nBits` and the current target in the `target` field. It also returns a `next` object which specifies the `height`, `nBits`, `difficulty`, and `target` for the next block. (#31583)
|
||||
- #32353 doc: Fix fuzz test_runner.py path
|
||||
- #32389 doc: Fix test_bitcoin path
|
||||
|
||||
- `getblock` and `getblockheader` now return the current target in the `target` field (#31583)
|
||||
### CI
|
||||
|
||||
- `getblockchaininfo` and `getchainstates` now return `nBits` and the current target in the `target` field (#31583)
|
||||
- #32184 ci: Add workaround for vcpkg's libevent package
|
||||
|
||||
- the `getblocktemplate` RPC `curtime` (BIP22) and `mintime` (BIP23) fields now
|
||||
account for the timewarp fix proposed in BIP94 on all networks. This ensures
|
||||
that, in the event a timewarp fix softfork activates on mainnet, un-upgraded
|
||||
miners will not accidentally violate the timewarp rule. (#31376, #31600)
|
||||
As a reminder, it's important that any software which uses the `getblocktemplate`
|
||||
RPC takes these values into account (either `curtime` or `mintime` is fine).
|
||||
Relying only on a clock can lead to invalid blocks under some circumstances,
|
||||
especially once a timewarp fix is deployed. (#31600)
|
||||
### Misc
|
||||
|
||||
### New RPCs
|
||||
|
||||
- `getdescriptoractivity` can be used to find all spend/receive activity relevant to
|
||||
a given set of descriptors within a set of specified blocks. This call can be used with
|
||||
`scanblocks` to lessen the need for additional indexing programs. (#30708)
|
||||
|
||||
|
||||
### Updated REST APIs
|
||||
|
||||
- `GET /rest/block/<BLOCK-HASH>.json` and `GET /rest/headers/<BLOCK-HASH>.json` now return the current target in the `target` field
|
||||
|
||||
### Updated Settings
|
||||
|
||||
- The maximum allowed value for the `-dbcache` configuration option has been
|
||||
dropped due to recent UTXO set growth. Note that before this change, large `-dbcache`
|
||||
values were automatically reduced to 16 GiB (1 GiB on 32 bit systems). (#28358)
|
||||
|
||||
- Handling of negated `-noseednode`, `-nobind`, `-nowhitebind`, `-norpcbind`, `-norpcallowip`, `-norpcwhitelist`, `-notest`, `-noasmap`, `-norpcwallet`, `-noonlynet`, and `-noexternalip` options has changed. Previously negating these options had various confusing and undocumented side effects. Now negating them just resets the settings and restores default behaviors, as if the options were not specified.
|
||||
|
||||
- Starting with v28.0, the `-mempoolfullrbf` startup option was set to
|
||||
default to `1`. With widespread adoption of this policy, users no longer
|
||||
benefit from disabling it, so the option has been removed, making full
|
||||
replace-by-fee the standard behavior. (#30592)
|
||||
|
||||
- Setting `-upnp` will now log a warning and be interpreted as `-natpmp`. Consider using `-natpmp` directly instead. (#31130, #31916)
|
||||
|
||||
- As a safety check, Bitcoin core will **fail to start** when `-blockreservedweight` init parameter value is lower than `2000` weight units. Bitcoin Core will also **fail to start** if the `-blockmaxweight` or `-blockreservedweight` init parameter exceeds consensus limit of `4,000,000 WU`.
|
||||
|
||||
- Passing `-debug=0` or `-debug=none` now behaves like `-nodebug`: previously set debug categories will be cleared, but subsequent `-debug` options will still be applied.
|
||||
|
||||
- The default for `-rpcthreads` has been changed from 4 to 16, and the default for `-rpcworkqueue` has been changed from 16 to 64. (#31215).
|
||||
|
||||
### Build System
|
||||
|
||||
The build system has been migrated from Autotools to CMake:
|
||||
|
||||
1. The minimum required CMake version is 3.22.
|
||||
2. In-source builds are not allowed. When using a subdirectory within the root source tree as a build directory, it is recommended that its name includes the substring "build".
|
||||
3. CMake variables may be used to configure the build system. See [Autotools to CMake Options Mapping](https://github.com/bitcoin-core/bitcoin-devwiki/wiki/Autotools-to-CMake-Options-Mapping) for details.
|
||||
4. For single-configuration generators, the default build configuration (`CMAKE_BUILD_TYPE`) is "RelWithDebInfo". However, for the "Release" configuration, CMake defaults to the compiler optimization flag `-O3`, which has not been extensively tested with Bitcoin Core. Therefore, the build system replaces it with `-O2`.
|
||||
5. By default, the built executables and libraries are located in the `bin/` and `lib/` subdirectories of the build directory.
|
||||
6. The build system supports component‐based installation. The names of the installable components coincide with the build target names. For example:
|
||||
```
|
||||
cmake -B build
|
||||
cmake --build build --target bitcoind
|
||||
cmake --install build --component bitcoind
|
||||
```
|
||||
|
||||
7. If any of the `CPPFLAGS`, `CFLAGS`, `CXXFLAGS` or `LDFLAGS` environment variables were used in your Autotools-based build process, you should instead use the corresponding CMake variables (`APPEND_CPPFLAGS`, `APPEND_CFLAGS`, `APPEND_CXXFLAGS` and `APPEND_LDFLAGS`). Alternatively, if you opt to use the dedicated `CMAKE_<...>_FLAGS` variables, you must ensure that the resulting compiler or linker invocations are as expected.
|
||||
|
||||
For more detailed guidance on configuring and using CMake, please refer to the official [CMake documentation](https://cmake.org/cmake/help/latest/) and [CMake’s User Interaction Guide](https://cmake.org/cmake/help/latest/guide/user-interaction/index.html). Additionally, consult platform-specific `doc/build-*.md` build guides for instructions tailored to your operating system.
|
||||
|
||||
## Low-Level Changes
|
||||
|
||||
### Tools and Utilities
|
||||
|
||||
- A new tool [`utxo_to_sqlite.py`](/contrib/utxo-tools/utxo_to_sqlite.py)
|
||||
converts a compact-serialized UTXO snapshot (as created with the
|
||||
`dumptxoutset` RPC) to a SQLite3 database. Refer to the script's `--help`
|
||||
output for more details. (#27432)
|
||||
|
||||
### Tests
|
||||
|
||||
- The BIP94 timewarp attack mitigation (designed for testnet4) is no longer active on the regtest network. (#31156)
|
||||
|
||||
### Dependencies
|
||||
|
||||
- MiniUPnPc and libnatpmp have been removed as dependencies (#31130, #30043).
|
||||
- #32187 refactor: Remove spurious virtual from final ~CZMQNotificationInterface
|
||||
- #32454 tracing: fix invalid argument in mempool_monitor
|
||||
|
||||
Credits
|
||||
=======
|
||||
|
||||
Thanks to everyone who directly contributed to this release:
|
||||
|
||||
- 0xb10c
|
||||
- Adlai Chandrasekhar
|
||||
- Afanti
|
||||
- Alfonso Roman Zubeldia
|
||||
- am-sq
|
||||
- Andre
|
||||
- Andre Alves
|
||||
- Anthony Towns
|
||||
- Antoine Poinsot
|
||||
- Ash Manning
|
||||
- Ava Chow
|
||||
- Boris Nagaev
|
||||
- achow101
|
||||
- Brandon Odiwuor
|
||||
- brunoerg
|
||||
- Chris Stewart
|
||||
- Cory Fields
|
||||
- costcould
|
||||
- Daniel Pfeifer
|
||||
- Daniela Brozzoni
|
||||
- David Gumberg
|
||||
- dergoegge
|
||||
- epysqyli
|
||||
- espi3
|
||||
- Eval EXEC
|
||||
- Fabian Jahr
|
||||
- enirox001
|
||||
- fanquake
|
||||
- furszy
|
||||
- Gabriele Bocchi
|
||||
- glozow
|
||||
- Greg Sanders
|
||||
- Gutflo
|
||||
- Hennadii Stepanov
|
||||
- Hodlinator
|
||||
- i-am-yuvi
|
||||
- ion-
|
||||
- ismaelsadeeq
|
||||
- Jadi
|
||||
- James O'Beirne
|
||||
- Jeremy Rand
|
||||
- Jon Atack
|
||||
- jurraca
|
||||
- Kay
|
||||
- kevkevinpal
|
||||
- l0rinc
|
||||
- jb55
|
||||
- laanwj
|
||||
- Larry Ruane
|
||||
- Lőrinc
|
||||
- Maciej S. Szmigiero
|
||||
- Mackain
|
||||
- MarcoFalke
|
||||
- marcofleon
|
||||
- Marnix
|
||||
- Martin Leitner-Ankerl
|
||||
- Martin Saposnic
|
||||
- Martin Zumsande
|
||||
- Matthew Zipkin
|
||||
- Max Edwards
|
||||
- Michael Dietz
|
||||
- naiyoma
|
||||
- Nicola Leonardo Susca
|
||||
- omahs
|
||||
- pablomartin4btc
|
||||
- Pieter Wuille
|
||||
- Randall Naar
|
||||
- RiceChuan
|
||||
- rkrux
|
||||
- Roman Zeyde
|
||||
- Ryan Ofsky
|
||||
- Sebastian Falbesoner
|
||||
- secp512k2
|
||||
- Sergi Delgado Segura
|
||||
- Simon
|
||||
- Sjors Provoost
|
||||
- stickies-v
|
||||
- Suhas Daftuar
|
||||
- tdb3
|
||||
- TheCharlatan
|
||||
- tianzedavid
|
||||
- Torkel Rogstad
|
||||
- Vasil Dimov
|
||||
- wgyt
|
||||
- willcl-ark
|
||||
- yancy
|
||||
- monlovesmango
|
||||
|
||||
As well as to everyone that helped with translations on
|
||||
[Transifex](https://www.transifex.com/bitcoin/bitcoin/).
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -33,6 +33,7 @@
|
||||
#include <fstream>
|
||||
#include <memory>
|
||||
|
||||
#include <QDebug>
|
||||
#include <QFontMetrics>
|
||||
#include <QScrollBar>
|
||||
#include <QSettings>
|
||||
@@ -464,7 +465,7 @@ bool SendCoinsDialog::signWithExternalSigner(PartiallySignedTransaction& psbtx,
|
||||
return false;
|
||||
}
|
||||
if (err) {
|
||||
tfm::format(std::cerr, "Failed to sign PSBT");
|
||||
qWarning() << "Failed to sign PSBT";
|
||||
processSendCoinsReturn(WalletModel::TransactionCreationFailed);
|
||||
return false;
|
||||
}
|
||||
@@ -851,6 +852,10 @@ void SendCoinsDialog::updateCoinControlState()
|
||||
}
|
||||
|
||||
void SendCoinsDialog::updateNumberOfBlocks(int count, const QDateTime& blockDate, double nVerificationProgress, SyncType synctype, SynchronizationState sync_state) {
|
||||
// During shutdown, clientModel will be nullptr. Attempting to update views at this point may cause a crash
|
||||
// due to accessing backend models that might no longer exist.
|
||||
if (!clientModel) return;
|
||||
// Process event
|
||||
if (sync_state == SynchronizationState::POST_INIT) {
|
||||
updateSmartFeeLabel();
|
||||
}
|
||||
|
||||
@@ -41,9 +41,6 @@
|
||||
#ifdef HAVE_SYSCTL_ARND
|
||||
#include <sys/sysctl.h>
|
||||
#endif
|
||||
#if defined(HAVE_STRONG_GETAUXVAL) && defined(__aarch64__)
|
||||
#include <sys/auxv.h>
|
||||
#endif
|
||||
|
||||
namespace {
|
||||
|
||||
@@ -189,62 +186,6 @@ uint64_t GetRdSeed() noexcept
|
||||
#endif
|
||||
}
|
||||
|
||||
#elif defined(__aarch64__) && defined(HWCAP2_RNG)
|
||||
|
||||
bool g_rndr_supported = false;
|
||||
|
||||
void InitHardwareRand()
|
||||
{
|
||||
if (getauxval(AT_HWCAP2) & HWCAP2_RNG) {
|
||||
g_rndr_supported = true;
|
||||
}
|
||||
}
|
||||
|
||||
void ReportHardwareRand()
|
||||
{
|
||||
// This must be done in a separate function, as InitHardwareRand() may be indirectly called
|
||||
// from global constructors, before logging is initialized.
|
||||
if (g_rndr_supported) {
|
||||
LogPrintf("Using RNDR and RNDRRS as additional entropy sources\n");
|
||||
}
|
||||
}
|
||||
|
||||
/** Read 64 bits of entropy using rndr.
|
||||
*
|
||||
* Must only be called when RNDR is supported.
|
||||
*/
|
||||
uint64_t GetRNDR() noexcept
|
||||
{
|
||||
uint8_t ok = 0;
|
||||
uint64_t r1;
|
||||
do {
|
||||
// https://developer.arm.com/documentation/ddi0601/2022-12/AArch64-Registers/RNDR--Random-Number
|
||||
__asm__ volatile("mrs %0, s3_3_c2_c4_0; cset %w1, ne;"
|
||||
: "=r"(r1), "=r"(ok)::"cc");
|
||||
if (ok) break;
|
||||
__asm__ volatile("yield");
|
||||
} while (true);
|
||||
return r1;
|
||||
}
|
||||
|
||||
/** Read 64 bits of entropy using rndrrs.
|
||||
*
|
||||
* Must only be called when RNDRRS is supported.
|
||||
*/
|
||||
uint64_t GetRNDRRS() noexcept
|
||||
{
|
||||
uint8_t ok = 0;
|
||||
uint64_t r1;
|
||||
do {
|
||||
// https://developer.arm.com/documentation/ddi0601/2022-12/AArch64-Registers/RNDRRS--Reseeded-Random-Number
|
||||
__asm__ volatile("mrs %0, s3_3_c2_c4_1; cset %w1, ne;"
|
||||
: "=r"(r1), "=r"(ok)::"cc");
|
||||
if (ok) break;
|
||||
__asm__ volatile("yield");
|
||||
} while (true);
|
||||
return r1;
|
||||
}
|
||||
|
||||
#else
|
||||
/* Access to other hardware random number generators could be added here later,
|
||||
* assuming it is sufficiently fast (in the order of a few hundred CPU cycles).
|
||||
@@ -263,12 +204,6 @@ void SeedHardwareFast(CSHA512& hasher) noexcept {
|
||||
hasher.Write((const unsigned char*)&out, sizeof(out));
|
||||
return;
|
||||
}
|
||||
#elif defined(__aarch64__) && defined(HWCAP2_RNG)
|
||||
if (g_rndr_supported) {
|
||||
uint64_t out = GetRNDR();
|
||||
hasher.Write((const unsigned char*)&out, sizeof(out));
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -294,14 +229,6 @@ void SeedHardwareSlow(CSHA512& hasher) noexcept {
|
||||
}
|
||||
return;
|
||||
}
|
||||
#elif defined(__aarch64__) && defined(HWCAP2_RNG)
|
||||
if (g_rndr_supported) {
|
||||
for (int i = 0; i < 4; ++i) {
|
||||
uint64_t out = GetRNDRRS();
|
||||
hasher.Write((const unsigned char*)&out, sizeof(out));
|
||||
}
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ and tests weren't explicitly disabled.
|
||||
The unit tests can be run with `ctest --test-dir build`, which includes unit
|
||||
tests from subtrees.
|
||||
|
||||
Run `test_bitcoin --list_content` for the full list of tests.
|
||||
Run `build/bin/test_bitcoin --list_content` for the full list of tests.
|
||||
|
||||
To run the unit tests manually, launch `build/bin/test_bitcoin`. To recompile
|
||||
after a test file was modified, run `cmake --build build` and then run the test again. If you
|
||||
@@ -44,7 +44,7 @@ The `test_bitcoin` runner accepts command line arguments from the Boost
|
||||
framework. To see the list of arguments that may be passed, run:
|
||||
|
||||
```
|
||||
test_bitcoin --help
|
||||
build/bin/test_bitcoin --help
|
||||
```
|
||||
|
||||
For example, to run only the tests in the `getarg_tests` file, with full logging:
|
||||
|
||||
@@ -471,6 +471,7 @@ static DBErrors LoadMinVersion(CWallet* pwallet, DatabaseBatch& batch) EXCLUSIVE
|
||||
AssertLockHeld(pwallet->cs_wallet);
|
||||
int nMinVersion = 0;
|
||||
if (batch.Read(DBKeys::MINVERSION, nMinVersion)) {
|
||||
pwallet->WalletLogPrintf("Wallet file version = %d\n", nMinVersion);
|
||||
if (nMinVersion > FEATURE_LATEST)
|
||||
return DBErrors::TOO_NEW;
|
||||
pwallet->LoadMinVersion(nMinVersion);
|
||||
@@ -1181,7 +1182,7 @@ DBErrors WalletBatch::LoadWallet(CWallet* pwallet)
|
||||
// Last client version to open this wallet
|
||||
int last_client = CLIENT_VERSION;
|
||||
bool has_last_client = m_batch->Read(DBKeys::VERSION, last_client);
|
||||
pwallet->WalletLogPrintf("Wallet file version = %d, last client version = %d\n", pwallet->GetVersion(), last_client);
|
||||
if (has_last_client) pwallet->WalletLogPrintf("Last client version = %d\n", last_client);
|
||||
|
||||
try {
|
||||
if ((result = LoadMinVersion(pwallet, *m_batch)) != DBErrors::LOAD_OK) return result;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright (c) 2015-2022 The Bitcoin Core developers
|
||||
// Copyright (c) 2015-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.
|
||||
|
||||
@@ -22,7 +22,7 @@ struct NewMempoolTransactionInfo;
|
||||
class CZMQNotificationInterface final : public CValidationInterface
|
||||
{
|
||||
public:
|
||||
virtual ~CZMQNotificationInterface();
|
||||
~CZMQNotificationInterface();
|
||||
|
||||
std::list<const CZMQAbstractNotifier*> GetActiveNotifiers() const;
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@ def mine_large_blocks(node, n):
|
||||
# Set the nTime if this is the first time this function has been called.
|
||||
# A static variable ensures that time is monotonicly increasing and is therefore
|
||||
# different for each block created => blockhash is unique.
|
||||
if "nTimes" not in mine_large_blocks.__dict__:
|
||||
if "nTime" not in mine_large_blocks.__dict__:
|
||||
mine_large_blocks.nTime = 0
|
||||
|
||||
# Get the block parameters for the first block
|
||||
@@ -500,11 +500,11 @@ class PruneTest(BitcoinTestFramework):
|
||||
"start", [{"desc": f"raw({false_positive_spk.hex()})"}], 0, 0, "basic", {"filter_false_positives": True})
|
||||
|
||||
def test_pruneheight_undo_presence(self):
|
||||
node = self.nodes[2]
|
||||
node = self.nodes[5]
|
||||
pruneheight = node.getblockchaininfo()["pruneheight"]
|
||||
fetch_block = node.getblockhash(pruneheight - 1)
|
||||
|
||||
self.connect_nodes(1, 2)
|
||||
self.connect_nodes(1, 5)
|
||||
peers = node.getpeerinfo()
|
||||
node.getblockfrompeer(fetch_block, peers[0]["id"])
|
||||
self.wait_until(lambda: not try_rpc(-1, "Block not available (pruned data)", node.getblock, fetch_block), timeout=5)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#!/usr/bin/env python3
|
||||
# Copyright (c) 2022 The Bitcoin Core developers
|
||||
# Copyright (c) 2022-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.
|
||||
|
||||
@@ -17,6 +17,7 @@ from test_framework.util import (
|
||||
assert_equal,
|
||||
assert_greater_than,
|
||||
assert_raises_rpc_error,
|
||||
bpf_cflags,
|
||||
)
|
||||
|
||||
coinselection_tracepoints_program = """
|
||||
@@ -175,7 +176,7 @@ class CoinSelectionTracepointTest(BitcoinTestFramework):
|
||||
ctx.enable_probe(probe="coin_selection:normal_create_tx_internal", fn_name="trace_normal_create_tx")
|
||||
ctx.enable_probe(probe="coin_selection:attempting_aps_create_tx", fn_name="trace_attempt_aps")
|
||||
ctx.enable_probe(probe="coin_selection:aps_create_tx_internal", fn_name="trace_aps_create_tx")
|
||||
self.bpf = BPF(text=coinselection_tracepoints_program, usdt_contexts=[ctx], debug=0, cflags=["-Wno-error=implicit-function-declaration"])
|
||||
self.bpf = BPF(text=coinselection_tracepoints_program, usdt_contexts=[ctx], debug=0, cflags=bpf_cflags())
|
||||
|
||||
self.log.info("Prepare wallets")
|
||||
self.generate(self.nodes[0], 101)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#!/usr/bin/env python3
|
||||
# Copyright (c) 2022 The Bitcoin Core developers
|
||||
# Copyright (c) 2022-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.
|
||||
|
||||
@@ -20,7 +20,10 @@ from test_framework.blocktools import COINBASE_MATURITY
|
||||
from test_framework.messages import COIN, DEFAULT_MEMPOOL_EXPIRY_HOURS
|
||||
from test_framework.p2p import P2PDataStore
|
||||
from test_framework.test_framework import BitcoinTestFramework
|
||||
from test_framework.util import assert_equal
|
||||
from test_framework.util import (
|
||||
assert_equal,
|
||||
bpf_cflags,
|
||||
)
|
||||
from test_framework.wallet import MiniWallet
|
||||
|
||||
MEMPOOL_TRACEPOINTS_PROGRAM = """
|
||||
@@ -166,7 +169,7 @@ class MempoolTracepointTest(BitcoinTestFramework):
|
||||
node = self.nodes[0]
|
||||
ctx = USDT(pid=node.process.pid)
|
||||
ctx.enable_probe(probe="mempool:added", fn_name="trace_added")
|
||||
bpf = BPF(text=MEMPOOL_TRACEPOINTS_PROGRAM, usdt_contexts=[ctx], debug=0, cflags=["-Wno-error=implicit-function-declaration"])
|
||||
bpf = BPF(text=MEMPOOL_TRACEPOINTS_PROGRAM, usdt_contexts=[ctx], debug=0, cflags=bpf_cflags())
|
||||
|
||||
def handle_added_event(_, data, __):
|
||||
events.append(bpf["added_events"].event(data))
|
||||
@@ -203,7 +206,7 @@ class MempoolTracepointTest(BitcoinTestFramework):
|
||||
node = self.nodes[0]
|
||||
ctx = USDT(pid=node.process.pid)
|
||||
ctx.enable_probe(probe="mempool:removed", fn_name="trace_removed")
|
||||
bpf = BPF(text=MEMPOOL_TRACEPOINTS_PROGRAM, usdt_contexts=[ctx], debug=0, cflags=["-Wno-error=implicit-function-declaration"])
|
||||
bpf = BPF(text=MEMPOOL_TRACEPOINTS_PROGRAM, usdt_contexts=[ctx], debug=0, cflags=bpf_cflags())
|
||||
|
||||
def handle_removed_event(_, data, __):
|
||||
events.append(bpf["removed_events"].event(data))
|
||||
@@ -249,7 +252,7 @@ class MempoolTracepointTest(BitcoinTestFramework):
|
||||
node = self.nodes[0]
|
||||
ctx = USDT(pid=node.process.pid)
|
||||
ctx.enable_probe(probe="mempool:replaced", fn_name="trace_replaced")
|
||||
bpf = BPF(text=MEMPOOL_TRACEPOINTS_PROGRAM, usdt_contexts=[ctx], debug=0, cflags=["-Wno-error=implicit-function-declaration"])
|
||||
bpf = BPF(text=MEMPOOL_TRACEPOINTS_PROGRAM, usdt_contexts=[ctx], debug=0, cflags=bpf_cflags())
|
||||
|
||||
def handle_replaced_event(_, data, __):
|
||||
event = ctypes.cast(data, ctypes.POINTER(MempoolReplaced)).contents
|
||||
@@ -302,7 +305,7 @@ class MempoolTracepointTest(BitcoinTestFramework):
|
||||
self.log.info("Hooking into mempool:rejected tracepoint...")
|
||||
ctx = USDT(pid=node.process.pid)
|
||||
ctx.enable_probe(probe="mempool:rejected", fn_name="trace_rejected")
|
||||
bpf = BPF(text=MEMPOOL_TRACEPOINTS_PROGRAM, usdt_contexts=[ctx], debug=0, cflags=["-Wno-error=implicit-function-declaration"])
|
||||
bpf = BPF(text=MEMPOOL_TRACEPOINTS_PROGRAM, usdt_contexts=[ctx], debug=0, cflags=bpf_cflags())
|
||||
|
||||
def handle_rejected_event(_, data, __):
|
||||
events.append(bpf["rejected_events"].event(data))
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#!/usr/bin/env python3
|
||||
# Copyright (c) 2022 The Bitcoin Core developers
|
||||
# Copyright (c) 2022-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.
|
||||
|
||||
@@ -17,7 +17,10 @@ except ImportError:
|
||||
from test_framework.messages import CBlockHeader, MAX_HEADERS_RESULTS, msg_headers, msg_version
|
||||
from test_framework.p2p import P2PInterface
|
||||
from test_framework.test_framework import BitcoinTestFramework
|
||||
from test_framework.util import assert_equal
|
||||
from test_framework.util import (
|
||||
assert_equal,
|
||||
bpf_cflags,
|
||||
)
|
||||
|
||||
# Tor v3 addresses are 62 chars + 6 chars for the port (':12345').
|
||||
MAX_PEER_ADDR_LENGTH = 68
|
||||
@@ -283,7 +286,7 @@ class NetTracepointTest(BitcoinTestFramework):
|
||||
fn_name="trace_inbound_message")
|
||||
ctx.enable_probe(probe="net:outbound_message",
|
||||
fn_name="trace_outbound_message")
|
||||
bpf = BPF(text=net_tracepoints_program, usdt_contexts=[ctx], debug=0, cflags=["-Wno-error=implicit-function-declaration"])
|
||||
bpf = BPF(text=net_tracepoints_program, usdt_contexts=[ctx], debug=0, cflags=bpf_cflags())
|
||||
|
||||
EXPECTED_INOUTBOUND_VERSION_MSG = 1
|
||||
checked_inbound_version_msg = 0
|
||||
@@ -341,7 +344,7 @@ class NetTracepointTest(BitcoinTestFramework):
|
||||
ctx = USDT(pid=self.nodes[0].process.pid)
|
||||
ctx.enable_probe(probe="net:inbound_connection",
|
||||
fn_name="trace_inbound_connection")
|
||||
bpf = BPF(text=net_tracepoints_program, usdt_contexts=[ctx], debug=0, cflags=["-Wno-error=implicit-function-declaration"])
|
||||
bpf = BPF(text=net_tracepoints_program, usdt_contexts=[ctx], debug=0, cflags=bpf_cflags())
|
||||
|
||||
inbound_connections = []
|
||||
EXPECTED_INBOUND_CONNECTIONS = 2
|
||||
@@ -378,7 +381,7 @@ class NetTracepointTest(BitcoinTestFramework):
|
||||
ctx = USDT(pid=self.nodes[0].process.pid)
|
||||
ctx.enable_probe(probe="net:outbound_connection",
|
||||
fn_name="trace_outbound_connection")
|
||||
bpf = BPF(text=net_tracepoints_program, usdt_contexts=[ctx], debug=0, cflags=["-Wno-error=implicit-function-declaration"])
|
||||
bpf = BPF(text=net_tracepoints_program, usdt_contexts=[ctx], debug=0, cflags=bpf_cflags())
|
||||
|
||||
# that the handle_* function succeeds.
|
||||
EXPECTED_OUTBOUND_CONNECTIONS = 2
|
||||
@@ -419,7 +422,7 @@ class NetTracepointTest(BitcoinTestFramework):
|
||||
ctx = USDT(pid=self.nodes[0].process.pid)
|
||||
ctx.enable_probe(probe="net:evicted_inbound_connection",
|
||||
fn_name="trace_evicted_inbound_connection")
|
||||
bpf = BPF(text=net_tracepoints_program, usdt_contexts=[ctx], debug=0, cflags=["-Wno-error=implicit-function-declaration"])
|
||||
bpf = BPF(text=net_tracepoints_program, usdt_contexts=[ctx], debug=0, cflags=bpf_cflags())
|
||||
|
||||
EXPECTED_EVICTED_CONNECTIONS = 2
|
||||
evicted_connections = []
|
||||
@@ -456,7 +459,7 @@ class NetTracepointTest(BitcoinTestFramework):
|
||||
ctx = USDT(pid=self.nodes[0].process.pid)
|
||||
ctx.enable_probe(probe="net:misbehaving_connection",
|
||||
fn_name="trace_misbehaving_connection")
|
||||
bpf = BPF(text=net_tracepoints_program, usdt_contexts=[ctx], debug=0, cflags=["-Wno-error=implicit-function-declaration"])
|
||||
bpf = BPF(text=net_tracepoints_program, usdt_contexts=[ctx], debug=0, cflags=bpf_cflags())
|
||||
|
||||
EXPECTED_MISBEHAVING_CONNECTIONS = 2
|
||||
misbehaving_connections = []
|
||||
@@ -490,7 +493,7 @@ class NetTracepointTest(BitcoinTestFramework):
|
||||
ctx = USDT(pid=self.nodes[0].process.pid)
|
||||
ctx.enable_probe(probe="net:closed_connection",
|
||||
fn_name="trace_closed_connection")
|
||||
bpf = BPF(text=net_tracepoints_program, usdt_contexts=[ctx], debug=0, cflags=["-Wno-error=implicit-function-declaration"])
|
||||
bpf = BPF(text=net_tracepoints_program, usdt_contexts=[ctx], debug=0, cflags=bpf_cflags())
|
||||
|
||||
EXPECTED_CLOSED_CONNECTIONS = 2
|
||||
closed_connections = []
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#!/usr/bin/env python3
|
||||
# Copyright (c) 2022 The Bitcoin Core developers
|
||||
# Copyright (c) 2022-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.
|
||||
|
||||
@@ -15,7 +15,10 @@ except ImportError:
|
||||
pass
|
||||
from test_framework.messages import COIN
|
||||
from test_framework.test_framework import BitcoinTestFramework
|
||||
from test_framework.util import assert_equal
|
||||
from test_framework.util import (
|
||||
assert_equal,
|
||||
bpf_cflags,
|
||||
)
|
||||
from test_framework.wallet import MiniWallet
|
||||
|
||||
utxocache_changes_program = """
|
||||
@@ -181,7 +184,7 @@ class UTXOCacheTracepointTest(BitcoinTestFramework):
|
||||
ctx = USDT(pid=self.nodes[0].process.pid)
|
||||
ctx.enable_probe(probe="utxocache:uncache",
|
||||
fn_name="trace_utxocache_uncache")
|
||||
bpf = BPF(text=utxocache_changes_program, usdt_contexts=[ctx], debug=0, cflags=["-Wno-error=implicit-function-declaration"])
|
||||
bpf = BPF(text=utxocache_changes_program, usdt_contexts=[ctx], debug=0, cflags=bpf_cflags())
|
||||
|
||||
# The handle_* function is a ctypes callback function called from C. When
|
||||
# we assert in the handle_* function, the AssertError doesn't propagate
|
||||
@@ -250,7 +253,7 @@ class UTXOCacheTracepointTest(BitcoinTestFramework):
|
||||
ctx.enable_probe(probe="utxocache:add", fn_name="trace_utxocache_add")
|
||||
ctx.enable_probe(probe="utxocache:spent",
|
||||
fn_name="trace_utxocache_spent")
|
||||
bpf = BPF(text=utxocache_changes_program, usdt_contexts=[ctx], debug=0, cflags=["-Wno-error=implicit-function-declaration"])
|
||||
bpf = BPF(text=utxocache_changes_program, usdt_contexts=[ctx], debug=0, cflags=bpf_cflags())
|
||||
|
||||
# The handle_* function is a ctypes callback function called from C. When
|
||||
# we assert in the handle_* function, the AssertError doesn't propagate
|
||||
@@ -339,7 +342,7 @@ class UTXOCacheTracepointTest(BitcoinTestFramework):
|
||||
ctx = USDT(pid=self.nodes[0].process.pid)
|
||||
ctx.enable_probe(probe="utxocache:flush",
|
||||
fn_name="trace_utxocache_flush")
|
||||
bpf = BPF(text=utxocache_flushes_program, usdt_contexts=[ctx], debug=0, cflags=["-Wno-error=implicit-function-declaration"])
|
||||
bpf = BPF(text=utxocache_flushes_program, usdt_contexts=[ctx], debug=0, cflags=bpf_cflags())
|
||||
|
||||
# The handle_* function is a ctypes callback function called from C. When
|
||||
# we assert in the handle_* function, the AssertError doesn't propagate
|
||||
@@ -396,7 +399,7 @@ class UTXOCacheTracepointTest(BitcoinTestFramework):
|
||||
ctx = USDT(pid=self.nodes[0].process.pid)
|
||||
ctx.enable_probe(probe="utxocache:flush",
|
||||
fn_name="trace_utxocache_flush")
|
||||
bpf = BPF(text=utxocache_flushes_program, usdt_contexts=[ctx], debug=0, cflags=["-Wno-error=implicit-function-declaration"])
|
||||
bpf = BPF(text=utxocache_flushes_program, usdt_contexts=[ctx], debug=0, cflags=bpf_cflags())
|
||||
bpf["utxocache_flush"].open_perf_buffer(handle_utxocache_flush)
|
||||
|
||||
self.log.info("prune blockchain to trigger a flush for pruning")
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#!/usr/bin/env python3
|
||||
# Copyright (c) 2022 The Bitcoin Core developers
|
||||
# Copyright (c) 2022-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.
|
||||
|
||||
@@ -18,8 +18,10 @@ except ImportError:
|
||||
|
||||
from test_framework.address import ADDRESS_BCRT1_UNSPENDABLE
|
||||
from test_framework.test_framework import BitcoinTestFramework
|
||||
from test_framework.util import assert_equal
|
||||
|
||||
from test_framework.util import (
|
||||
assert_equal,
|
||||
bpf_cflags,
|
||||
)
|
||||
|
||||
validation_blockconnected_program = """
|
||||
#include <uapi/linux/ptrace.h>
|
||||
@@ -97,7 +99,7 @@ class ValidationTracepointTest(BitcoinTestFramework):
|
||||
ctx.enable_probe(probe="validation:block_connected",
|
||||
fn_name="trace_block_connected")
|
||||
bpf = BPF(text=validation_blockconnected_program,
|
||||
usdt_contexts=[ctx], debug=0, cflags=["-Wno-error=implicit-function-declaration"])
|
||||
usdt_contexts=[ctx], debug=0, cflags=bpf_cflags())
|
||||
|
||||
def handle_blockconnected(_, data, __):
|
||||
event = ctypes.cast(data, ctypes.POINTER(Block)).contents
|
||||
|
||||
@@ -913,6 +913,8 @@ class TestNodeCLI():
|
||||
# Ignore cli_stdout, raise with cli_stderr
|
||||
raise subprocess.CalledProcessError(returncode, self.binary, output=cli_stderr)
|
||||
try:
|
||||
if not cli_stdout.strip():
|
||||
return None
|
||||
return json.loads(cli_stdout, parse_float=decimal.Decimal)
|
||||
except (json.JSONDecodeError, decimal.InvalidOperation):
|
||||
return cli_stdout.rstrip("\n")
|
||||
|
||||
@@ -317,6 +317,13 @@ def wait_until_helper_internal(predicate, *, timeout=60, lock=None, timeout_fact
|
||||
raise AssertionError("Predicate {} not true after {} seconds".format(predicate_source, timeout))
|
||||
|
||||
|
||||
def bpf_cflags():
|
||||
return [
|
||||
"-Wno-error=implicit-function-declaration",
|
||||
"-Wno-duplicate-decl-specifier", # https://github.com/bitcoin/bitcoin/issues/32322
|
||||
]
|
||||
|
||||
|
||||
def sha256sum_file(filename):
|
||||
h = hashlib.sha256()
|
||||
with open(filename, 'rb') as f:
|
||||
|
||||
@@ -726,6 +726,8 @@ class WalletTest(BitcoinTestFramework):
|
||||
txid_a = self.nodes[0].sendtoaddress(addr_a, 0.01)
|
||||
txid_b = self.nodes[0].sendtoaddress(addr_b, 0.01)
|
||||
self.generate(self.nodes[0], 1, sync_fun=self.no_op)
|
||||
# Prevent race of listunspent with outstanding TxAddedToMempool notifications
|
||||
self.nodes[0].syncwithvalidationinterfacequeue()
|
||||
# Now import the descriptors, make sure we can identify on which descriptor each coin was received.
|
||||
self.nodes[0].createwallet(wallet_name="wo", descriptors=True, disable_private_keys=True)
|
||||
wo_wallet = self.nodes[0].get_wallet_rpc("wo")
|
||||
@@ -777,6 +779,9 @@ class WalletTest(BitcoinTestFramework):
|
||||
|
||||
# check that it works again with -spendzeroconfchange set (=default)
|
||||
self.restart_node(0, ["-spendzeroconfchange=1"])
|
||||
# Make sure the wallet knows the tx in the mempool
|
||||
self.nodes[0].syncwithvalidationinterfacequeue()
|
||||
|
||||
zeroconf_wallet = self.nodes[0].get_wallet_rpc("zeroconf")
|
||||
utxos = zeroconf_wallet.listunspent(minconf=0)
|
||||
assert_equal(len(utxos), 1)
|
||||
|
||||
@@ -188,6 +188,19 @@ class CreateWalletTest(BitcoinTestFramework):
|
||||
"warnings": [EMPTY_PASSPHRASE_MSG, LEGACY_WALLET_MSG],
|
||||
})
|
||||
|
||||
self.log.info("Check that the version number is being logged correctly")
|
||||
with node.assert_debug_log(expected_msgs=[], unexpected_msgs=["Last client version = ", "Wallet file version = "]):
|
||||
node.createwallet("version_check")
|
||||
wallet = node.get_wallet_rpc("version_check")
|
||||
wallet_version = wallet.getwalletinfo()["walletversion"]
|
||||
client_version = node.getnetworkinfo()["version"]
|
||||
wallet.unloadwallet()
|
||||
with node.assert_debug_log(
|
||||
expected_msgs=[f"Last client version = {client_version}", f"Wallet file version = {wallet_version}"],
|
||||
unexpected_msgs=["Wallet file version = 10500"]
|
||||
):
|
||||
node.loadwallet("version_check")
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
CreateWalletTest(__file__).main()
|
||||
|
||||
Reference in New Issue
Block a user