mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-23 08:34:58 +01:00
Compare commits
37 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bf4e3c01f7 | ||
|
|
aed613ab72 | ||
|
|
5e644a05ae | ||
|
|
85436bc7ac | ||
|
|
b7ded852bb | ||
|
|
d987707208 | ||
|
|
4d2f2fae97 | ||
|
|
7ae937326a | ||
|
|
6c5781e3cb | ||
|
|
5fbb86e155 | ||
|
|
2e9fc2e353 | ||
|
|
a26ff204f0 | ||
|
|
60edfd57f1 | ||
|
|
b93814b234 | ||
|
|
67bbe6d371 | ||
|
|
06731d19bc | ||
|
|
d0a2c87214 | ||
|
|
ce8f812b0a | ||
|
|
7b7636ead1 | ||
|
|
f0919339bf | ||
|
|
c14f3b3905 | ||
|
|
ec7a8839a2 | ||
|
|
0567787f5e | ||
|
|
52376d9217 | ||
|
|
af86266165 | ||
|
|
398768769f | ||
|
|
412cd1a34e | ||
|
|
fd94befbc6 | ||
|
|
dd04f2dda5 | ||
|
|
a3db8bd7ca | ||
|
|
53fd827883 | ||
|
|
6a5bb10da9 | ||
|
|
192759eb7b | ||
|
|
ffef91a5c1 | ||
|
|
8a16391c91 | ||
|
|
58478261de | ||
|
|
93713654ef |
28
.cirrus.yml
28
.cirrus.yml
@@ -34,22 +34,30 @@ base_template: &BASE_TEMPLATE
|
||||
|
||||
main_template: &MAIN_TEMPLATE
|
||||
timeout_in: 120m # https://cirrus-ci.org/faq/#instance-timed-out
|
||||
ccache_cache:
|
||||
folder: "/tmp/ccache_dir"
|
||||
ci_script:
|
||||
- ./ci/test_run_all.sh
|
||||
|
||||
global_task_template: &GLOBAL_TASK_TEMPLATE
|
||||
<< : *BASE_TEMPLATE
|
||||
container:
|
||||
# https://cirrus-ci.org/faq/#are-there-any-limits
|
||||
# Each project has 16 CPU in total, assign 2 to each container, so that 8 tasks run in parallel
|
||||
cpu: 2
|
||||
greedy: true
|
||||
memory: 8G # Set to 8GB to avoid OOM. https://cirrus-ci.org/guide/linux/#linux-containers
|
||||
ccache_cache:
|
||||
folder: "/tmp/ccache_dir"
|
||||
depends_built_cache:
|
||||
folder: "depends/built"
|
||||
fingerprint_script: echo $CIRRUS_TASK_NAME $(git rev-list -1 HEAD ./depends)
|
||||
ci_script:
|
||||
- ./ci/test_run_all.sh
|
||||
<< : *MAIN_TEMPLATE
|
||||
|
||||
global_task_template: &GLOBAL_TASK_TEMPLATE
|
||||
macos_native_task_template: &MACOS_NATIVE_TASK_TEMPLATE
|
||||
<< : *BASE_TEMPLATE
|
||||
check_clang_script:
|
||||
- clang --version
|
||||
brew_install_script:
|
||||
- brew install boost libevent qt@5 miniupnpc libnatpmp ccache zeromq qrencode libtool automake gnu-getopt
|
||||
<< : *MAIN_TEMPLATE
|
||||
|
||||
compute_credits_template: &CREDITS_TEMPLATE
|
||||
@@ -281,18 +289,16 @@ task:
|
||||
FILE_ENV: "./ci/test/00_setup_env_mac.sh"
|
||||
|
||||
task:
|
||||
name: 'macOS 12 native [gui, system sqlite only] [no depends]'
|
||||
brew_install_script:
|
||||
- brew install boost libevent qt@5 miniupnpc libnatpmp ccache zeromq qrencode libtool automake gnu-getopt
|
||||
<< : *GLOBAL_TASK_TEMPLATE
|
||||
name: 'macOS 13 native arm64 [gui, sqlite only] [no depends]'
|
||||
macos_instance:
|
||||
# Use latest image, but hardcode version to avoid silent upgrades (and breaks)
|
||||
image: monterey-xcode-13.2 # https://cirrus-ci.org/guide/macOS
|
||||
image: ghcr.io/cirruslabs/macos-ventura-xcode:14.1 # https://cirrus-ci.org/guide/macOS
|
||||
<< : *MACOS_NATIVE_TASK_TEMPLATE
|
||||
env:
|
||||
<< : *CIRRUS_EPHEMERAL_WORKER_TEMPLATE_ENV
|
||||
CI_USE_APT_INSTALL: "no"
|
||||
PACKAGE_MANAGER_INSTALL: "echo" # Nothing to do
|
||||
FILE_ENV: "./ci/test/00_setup_env_mac_host.sh"
|
||||
FILE_ENV: "./ci/test/00_setup_env_mac_native_arm64.sh"
|
||||
|
||||
task:
|
||||
name: 'ARM64 Android APK [focal]'
|
||||
|
||||
@@ -6,12 +6,11 @@
|
||||
|
||||
export LC_ALL=C.UTF-8
|
||||
|
||||
export HOST=x86_64-apple-darwin
|
||||
export PIP_PACKAGES="zmq lief"
|
||||
export HOST=arm64-apple-darwin
|
||||
export PIP_PACKAGES="zmq"
|
||||
export GOAL="install"
|
||||
export BITCOIN_CONFIG="--with-gui --enable-reduce-exports"
|
||||
export BITCOIN_CONFIG="--with-gui --with-miniupnpc --with-natpmp --enable-reduce-exports"
|
||||
export CI_OS_NAME="macos"
|
||||
export NO_DEPENDS=1
|
||||
export OSX_SDK=""
|
||||
export CCACHE_SIZE=300M
|
||||
export RUN_SECURITY_TESTS="true"
|
||||
@@ -13,7 +13,7 @@ fi
|
||||
if [ "$CI_OS_NAME" == "macos" ]; then
|
||||
sudo -H pip3 install --upgrade pip
|
||||
# shellcheck disable=SC2086
|
||||
IN_GETOPT_BIN="/usr/local/opt/gnu-getopt/bin/getopt" ${CI_RETRY_EXE} pip3 install --user $PIP_PACKAGES
|
||||
IN_GETOPT_BIN="$(brew --prefix gnu-getopt)/bin/getopt" ${CI_RETRY_EXE} pip3 install --user $PIP_PACKAGES
|
||||
fi
|
||||
|
||||
# Create folders that are mounted into the docker
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
AC_PREREQ([2.69])
|
||||
define(_CLIENT_VERSION_MAJOR, 23)
|
||||
define(_CLIENT_VERSION_MINOR, 1)
|
||||
define(_CLIENT_VERSION_MINOR, 2)
|
||||
define(_CLIENT_VERSION_BUILD, 0)
|
||||
define(_CLIENT_VERSION_RC, 2)
|
||||
define(_CLIENT_VERSION_RC, 0)
|
||||
define(_CLIENT_VERSION_IS_RELEASE, true)
|
||||
define(_COPYRIGHT_YEAR, 2022)
|
||||
define(_COPYRIGHT_HOLDERS,[The %s developers])
|
||||
|
||||
@@ -14,7 +14,7 @@ $(package)_config_opts_freebsd=--with-pic
|
||||
$(package)_config_opts_netbsd=--with-pic
|
||||
$(package)_config_opts_openbsd=--with-pic
|
||||
$(package)_config_opts_android=--with-pic
|
||||
$(package)_cflags+=-Wno-error=implicit-function-declaration
|
||||
$(package)_cflags+=-Wno-error=implicit-function-declaration -Wno-error=format-security -Wno-error=implicit-int
|
||||
$(package)_cxxflags+=-std=c++17
|
||||
$(package)_cppflags_mingw32=-DUNICODE -D_UNICODE
|
||||
endef
|
||||
|
||||
@@ -5,9 +5,14 @@ $(package)_file_name=$(package)-$($(package)_version).tar.xz
|
||||
$(package)_sha256_hash=60ddcff932b7fd352752d51a5c4f04f3d0403230a584df9a2e0d5ed87c486c8b
|
||||
$(package)_dependencies=libxcb
|
||||
|
||||
# This package explicitly enables -Werror=array-bounds, which causes build failures
|
||||
# with GCC 12.1+. Work around that by turning errors back into warnings.
|
||||
# This workaround would be dropped if the package was updated, as that would require
|
||||
# a different build system (Meson)
|
||||
define $(package)_set_vars
|
||||
$(package)_config_opts = --enable-option-checking --disable-dependency-tracking
|
||||
$(package)_config_opts += --disable-static --disable-docs
|
||||
$(package)_cflags += -Wno-error=array-bounds
|
||||
endef
|
||||
|
||||
define $(package)_preprocess_cmds
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package=systemtap
|
||||
$(package)_version=4.5
|
||||
$(package)_download_path=https://sourceware.org/systemtap/ftp/releases/
|
||||
$(package)_download_path=https://sourceware.org/ftp/systemtap/releases/
|
||||
$(package)_file_name=$(package)-$($(package)_version).tar.gz
|
||||
$(package)_sha256_hash=75078ed37e0dd2a769c9d1f9394170b2d9f4d7daa425f43ca80c13bad6cfc925
|
||||
$(package)_patches=remove_SDT_ASM_SECTION_AUTOGROUP_SUPPORT_check.patch
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
package=xcb_proto
|
||||
$(package)_version=1.14.1
|
||||
$(package)_version=1.15.2
|
||||
$(package)_download_path=https://xorg.freedesktop.org/archive/individual/proto
|
||||
$(package)_file_name=xcb-proto-$($(package)_version).tar.xz
|
||||
$(package)_sha256_hash=f04add9a972ac334ea11d9d7eb4fc7f8883835da3e4859c9afa971efdf57fcc3
|
||||
$(package)_sha256_hash=7072beb1f680a2fe3f9e535b797c146d22528990c72f63ddb49d2f350a3653ed
|
||||
|
||||
define $(package)_config_cmds
|
||||
$($(package)_autoconf)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
BIPs that are implemented by Bitcoin Core (up-to-date up to **v23.1**):
|
||||
BIPs that are implemented by Bitcoin Core (up-to-date up to **v23.2**):
|
||||
|
||||
* [`BIP 9`](https://github.com/bitcoin/bips/blob/master/bip-0009.mediawiki): The changes allowing multiple soft-forks to be deployed in parallel have been implemented since **v0.12.1** ([PR #7575](https://github.com/bitcoin/bitcoin/pull/7575))
|
||||
* [`BIP 11`](https://github.com/bitcoin/bips/blob/master/bip-0011.mediawiki): Multisig outputs are standard since **v0.6.0** ([PR #669](https://github.com/bitcoin/bitcoin/pull/669)).
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.2.
|
||||
.TH BITCOIN-CLI "1" "November 2022" "bitcoin-cli v23.1.0rc2" "User Commands"
|
||||
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3.
|
||||
.TH BITCOIN-CLI "1" "May 2023" "bitcoin-cli v23.2.0" "User Commands"
|
||||
.SH NAME
|
||||
bitcoin-cli \- manual page for bitcoin-cli v23.1.0rc2
|
||||
bitcoin-cli \- manual page for bitcoin-cli v23.2.0
|
||||
.SH SYNOPSIS
|
||||
.B bitcoin-cli
|
||||
[\fI\,options\/\fR] \fI\,<command> \/\fR[\fI\,params\/\fR] \fI\,Send command to Bitcoin Core\/\fR
|
||||
@@ -15,7 +15,7 @@ bitcoin-cli \- manual page for bitcoin-cli v23.1.0rc2
|
||||
.B bitcoin-cli
|
||||
[\fI\,options\/\fR] \fI\,help <command> Get help for a command\/\fR
|
||||
.SH DESCRIPTION
|
||||
Bitcoin Core RPC client version v23.1.0rc2
|
||||
Bitcoin Core RPC client version v23.2.0
|
||||
.SH OPTIONS
|
||||
.HP
|
||||
\-?
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.2.
|
||||
.TH BITCOIN-QT "1" "November 2022" "bitcoin-qt v23.1.0rc2" "User Commands"
|
||||
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3.
|
||||
.TH BITCOIN-QT "1" "May 2023" "bitcoin-qt v23.2.0" "User Commands"
|
||||
.SH NAME
|
||||
bitcoin-qt \- manual page for bitcoin-qt v23.1.0rc2
|
||||
bitcoin-qt \- manual page for bitcoin-qt v23.2.0
|
||||
.SH SYNOPSIS
|
||||
.B bitcoin-qt
|
||||
[\fI\,command-line options\/\fR]
|
||||
.SH DESCRIPTION
|
||||
Bitcoin Core version v23.1.0rc2
|
||||
Bitcoin Core version v23.2.0
|
||||
.SH OPTIONS
|
||||
.HP
|
||||
\-?
|
||||
@@ -115,7 +115,7 @@ Do not keep transactions in the mempool longer than <n> hours (default:
|
||||
.HP
|
||||
\fB\-par=\fR<n>
|
||||
.IP
|
||||
Set the number of script verification threads (\fB\-6\fR to 15, 0 = auto, <0 =
|
||||
Set the number of script verification threads (\fB\-10\fR to 15, 0 = auto, <0 =
|
||||
leave that many cores free, default: 0)
|
||||
.HP
|
||||
\fB\-persistmempool\fR
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.2.
|
||||
.TH BITCOIN-TX "1" "November 2022" "bitcoin-tx v23.1.0rc2" "User Commands"
|
||||
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3.
|
||||
.TH BITCOIN-TX "1" "May 2023" "bitcoin-tx v23.2.0" "User Commands"
|
||||
.SH NAME
|
||||
bitcoin-tx \- manual page for bitcoin-tx v23.1.0rc2
|
||||
bitcoin-tx \- manual page for bitcoin-tx v23.2.0
|
||||
.SH SYNOPSIS
|
||||
.B bitcoin-tx
|
||||
[\fI\,options\/\fR] \fI\,<hex-tx> \/\fR[\fI\,commands\/\fR] \fI\,Update hex-encoded bitcoin transaction\/\fR
|
||||
@@ -9,7 +9,7 @@ bitcoin-tx \- manual page for bitcoin-tx v23.1.0rc2
|
||||
.B bitcoin-tx
|
||||
[\fI\,options\/\fR] \fI\,-create \/\fR[\fI\,commands\/\fR] \fI\,Create hex-encoded bitcoin transaction\/\fR
|
||||
.SH DESCRIPTION
|
||||
Bitcoin Core bitcoin\-tx utility version v23.1.0rc2
|
||||
Bitcoin Core bitcoin\-tx utility version v23.2.0
|
||||
.SH OPTIONS
|
||||
.HP
|
||||
\-?
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.2.
|
||||
.TH BITCOIN-UTIL "1" "November 2022" "bitcoin-util v23.1.0rc2" "User Commands"
|
||||
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3.
|
||||
.TH BITCOIN-UTIL "1" "May 2023" "bitcoin-util v23.2.0" "User Commands"
|
||||
.SH NAME
|
||||
bitcoin-util \- manual page for bitcoin-util v23.1.0rc2
|
||||
bitcoin-util \- manual page for bitcoin-util v23.2.0
|
||||
.SH SYNOPSIS
|
||||
.B bitcoin-util
|
||||
[\fI\,options\/\fR] [\fI\,commands\/\fR] \fI\,Do stuff\/\fR
|
||||
.SH DESCRIPTION
|
||||
Bitcoin Core bitcoin\-util utility version v23.1.0rc2
|
||||
Bitcoin Core bitcoin\-util utility version v23.2.0
|
||||
.SH OPTIONS
|
||||
.HP
|
||||
\-?
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.2.
|
||||
.TH BITCOIN-WALLET "1" "November 2022" "bitcoin-wallet v23.1.0rc2" "User Commands"
|
||||
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3.
|
||||
.TH BITCOIN-WALLET "1" "May 2023" "bitcoin-wallet v23.2.0" "User Commands"
|
||||
.SH NAME
|
||||
bitcoin-wallet \- manual page for bitcoin-wallet v23.1.0rc2
|
||||
bitcoin-wallet \- manual page for bitcoin-wallet v23.2.0
|
||||
.SH DESCRIPTION
|
||||
Bitcoin Core bitcoin\-wallet version v23.1.0rc2
|
||||
Bitcoin Core bitcoin\-wallet version v23.2.0
|
||||
.PP
|
||||
bitcoin\-wallet is an offline tool for creating and interacting with Bitcoin Core wallet files.
|
||||
By default bitcoin\-wallet will act on wallets in the default mainnet wallet directory in the datadir.
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.2.
|
||||
.TH BITCOIND "1" "November 2022" "bitcoind v23.1.0rc2" "User Commands"
|
||||
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3.
|
||||
.TH BITCOIND "1" "May 2023" "bitcoind v23.2.0" "User Commands"
|
||||
.SH NAME
|
||||
bitcoind \- manual page for bitcoind v23.1.0rc2
|
||||
bitcoind \- manual page for bitcoind v23.2.0
|
||||
.SH SYNOPSIS
|
||||
.B bitcoind
|
||||
[\fI\,options\/\fR] \fI\,Start Bitcoin Core\/\fR
|
||||
.SH DESCRIPTION
|
||||
Bitcoin Core version v23.1.0rc2
|
||||
Bitcoin Core version v23.2.0
|
||||
.SH OPTIONS
|
||||
.HP
|
||||
\-?
|
||||
@@ -115,7 +115,7 @@ Do not keep transactions in the mempool longer than <n> hours (default:
|
||||
.HP
|
||||
\fB\-par=\fR<n>
|
||||
.IP
|
||||
Set the number of script verification threads (\fB\-6\fR to 15, 0 = auto, <0 =
|
||||
Set the number of script verification threads (\fB\-10\fR to 15, 0 = auto, <0 =
|
||||
leave that many cores free, default: 0)
|
||||
.HP
|
||||
\fB\-persistmempool\fR
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
23.1rc2 Release Notes Draft
|
||||
===============================
|
||||
23.3rc1 Release Notes
|
||||
==================
|
||||
|
||||
Bitcoin Core version 23.1rc2 is now available from:
|
||||
Bitcoin Core version 23.3rc1 is now available from:
|
||||
|
||||
<https://bitcoincore.org/bin/bitcoin-core-23.1/>
|
||||
<https://bitcoincore.org/bin/bitcoin-core-23.3/test.rc1>
|
||||
|
||||
This release includes new features, various bug fixes and performance
|
||||
This release includes various bug fixes and performance
|
||||
improvements, as well as updated translations.
|
||||
|
||||
Please report bugs using the issue tracker at GitHub:
|
||||
@@ -37,54 +37,21 @@ 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.
|
||||
|
||||
### P2P
|
||||
### RPC
|
||||
|
||||
- #25314 p2p: always set nTime for self-advertisements
|
||||
|
||||
### RPC and other APIs
|
||||
|
||||
- #25220 rpc: fix incorrect warning for address type p2sh-segwit in createmultisig
|
||||
- #25237 rpc: Capture UniValue by ref for rpcdoccheck
|
||||
- #25983 Prevent data race for pathHandlers
|
||||
- #26275 Fix crash on deriveaddresses when index is 2147483647 (2^31-1)
|
||||
- #27727 rpc: Fix invalid bech32 address handling
|
||||
|
||||
### Build system
|
||||
|
||||
- #25201 windeploy: Renewed windows code signing certificate
|
||||
- #25788 guix: patch NSIS to remove .reloc sections from installer stubs
|
||||
- #25861 guix: use --build={arch}-guix-linux-gnu in cross toolchain
|
||||
- #25985 Revert "build: Use Homebrew's sqlite package if it is available"
|
||||
|
||||
### GUI
|
||||
|
||||
- #24668 build, qt: bump Qt5 version to 5.15.3
|
||||
- gui#631 Disallow encryption of watchonly wallets
|
||||
- gui#680 Fixes MacOS 13 segfault by preventing certain notifications
|
||||
|
||||
### Tests
|
||||
|
||||
- #24454 tests: Fix calculation of external input weights
|
||||
|
||||
### Miscellaneous
|
||||
|
||||
- #26321 Adjust .tx/config for new Transifex CLI
|
||||
- #28097 depends: xcb-proto 1.15.2
|
||||
|
||||
Credits
|
||||
=======
|
||||
|
||||
Thanks to everyone who directly contributed to this release:
|
||||
|
||||
Andrew Chow
|
||||
brunoerg
|
||||
Hennadii Stepanov
|
||||
John Moffett
|
||||
MacroFake
|
||||
Martin Zumsande
|
||||
Michael Ford
|
||||
muxator
|
||||
Pavol Rusnak
|
||||
Sebastian Falbesoner
|
||||
W. J. van der Laan
|
||||
- MacroFake
|
||||
- Michael Ford
|
||||
|
||||
As well as to everyone that helped with translations on
|
||||
[Transifex](https://www.transifex.com/bitcoin/bitcoin/).
|
||||
|
||||
90
doc/release-notes/release-notes-23.1.md
Normal file
90
doc/release-notes/release-notes-23.1.md
Normal file
@@ -0,0 +1,90 @@
|
||||
23.1 Release Notes
|
||||
==================
|
||||
|
||||
Bitcoin Core version 23.1 is now available from:
|
||||
|
||||
<https://bitcoincore.org/bin/bitcoin-core-23.1/>
|
||||
|
||||
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 extensively tested on operating systems
|
||||
using the Linux kernel, macOS 10.15+, and Windows 7 and newer. 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.
|
||||
|
||||
### P2P
|
||||
|
||||
- #25314 p2p: always set nTime for self-advertisements
|
||||
|
||||
### RPC and other APIs
|
||||
|
||||
- #25220 rpc: fix incorrect warning for address type p2sh-segwit in createmultisig
|
||||
- #25237 rpc: Capture UniValue by ref for rpcdoccheck
|
||||
- #25983 Prevent data race for pathHandlers
|
||||
- #26275 Fix crash on deriveaddresses when index is 2147483647 (2^31-1)
|
||||
|
||||
### Build system
|
||||
|
||||
- #25201 windeploy: Renewed windows code signing certificate
|
||||
- #25788 guix: patch NSIS to remove .reloc sections from installer stubs
|
||||
- #25861 guix: use --build={arch}-guix-linux-gnu in cross toolchain
|
||||
- #25985 Revert "build: Use Homebrew's sqlite package if it is available"
|
||||
|
||||
### GUI
|
||||
|
||||
- #24668 build, qt: bump Qt5 version to 5.15.3
|
||||
- gui#631 Disallow encryption of watchonly wallets
|
||||
- gui#680 Fixes MacOS 13 segfault by preventing certain notifications
|
||||
|
||||
### Tests
|
||||
|
||||
- #24454 tests: Fix calculation of external input weights
|
||||
|
||||
### Miscellaneous
|
||||
|
||||
- #26321 Adjust .tx/config for new Transifex CLI
|
||||
|
||||
Credits
|
||||
=======
|
||||
|
||||
Thanks to everyone who directly contributed to this release:
|
||||
|
||||
- Andrew Chow
|
||||
- brunoerg
|
||||
- Hennadii Stepanov
|
||||
- John Moffett
|
||||
- MacroFake
|
||||
- Martin Zumsande
|
||||
- Michael Ford
|
||||
- muxator
|
||||
- Pavol Rusnak
|
||||
- Sebastian Falbesoner
|
||||
- W. J. van der Laan
|
||||
|
||||
As well as to everyone that helped with translations on
|
||||
[Transifex](https://www.transifex.com/bitcoin/bitcoin/).
|
||||
72
doc/release-notes/release-notes-23.2.md
Normal file
72
doc/release-notes/release-notes-23.2.md
Normal file
@@ -0,0 +1,72 @@
|
||||
23.2 Release Notes
|
||||
==================
|
||||
|
||||
Bitcoin Core version 23.2 is now available from:
|
||||
|
||||
<https://bitcoincore.org/bin/bitcoin-core-23.2/>
|
||||
|
||||
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 extensively tested on operating systems
|
||||
using the Linux kernel, macOS 10.15+, and Windows 7 and newer. 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.
|
||||
|
||||
### P2P
|
||||
|
||||
- #26909 net: prevent peers.dat corruptions by only serializing once
|
||||
- #27608 p2p: Avoid prematurely clearing download state for other peers
|
||||
- #27610 Improve performance of p2p inv to send queues
|
||||
|
||||
### Build system
|
||||
|
||||
- #25436 build: suppress array-bounds errors in libxkbcommon
|
||||
- #25763 bdb: disable Werror for format-security
|
||||
- #26944 depends: fix systemtap download URL
|
||||
- #27462 depends: fix compiling bdb with clang-16 on aarch64
|
||||
|
||||
### Miscellaneous
|
||||
|
||||
- #25444 ci: macOS task imrovements
|
||||
- #26388 ci: Use macos-ventura-xcode:14.1 image for "macOS native" task
|
||||
- #26924 refactor: Add missing includes to fix gcc-13 compile error
|
||||
|
||||
Credits
|
||||
=======
|
||||
|
||||
Thanks to everyone who directly contributed to this release:
|
||||
|
||||
- Anthony Towns
|
||||
- Hennadii Stepanov
|
||||
- MacroFake
|
||||
- Martin Zumsande
|
||||
- Michael Ford
|
||||
- Suhas Daftuar
|
||||
|
||||
As well as to everyone that helped with translations on
|
||||
[Transifex](https://www.transifex.com/bitcoin/bitcoin/).
|
||||
@@ -33,10 +33,9 @@ bool SerializeDB(Stream& stream, const Data& data)
|
||||
{
|
||||
// Write and commit header, data
|
||||
try {
|
||||
CHashWriter hasher(stream.GetType(), stream.GetVersion());
|
||||
stream << Params().MessageStart() << data;
|
||||
hasher << Params().MessageStart() << data;
|
||||
stream << hasher.GetHash();
|
||||
HashedSourceWriter hashwriter{stream};
|
||||
hashwriter << Params().MessageStart() << data;
|
||||
stream << hashwriter.GetHash();
|
||||
} catch (const std::exception& e) {
|
||||
return error("%s: Serialize or I/O error - %s", __func__, e.what());
|
||||
}
|
||||
|
||||
@@ -1171,8 +1171,7 @@ void AddrMan::Unserialize(Stream& s_)
|
||||
}
|
||||
|
||||
// explicit instantiation
|
||||
template void AddrMan::Serialize(CHashWriter& s) const;
|
||||
template void AddrMan::Serialize(CAutoFile& s) const;
|
||||
template void AddrMan::Serialize(HashedSourceWriter<CAutoFile>& s) const;
|
||||
template void AddrMan::Serialize(CDataStream& s) const;
|
||||
template void AddrMan::Unserialize(CAutoFile& s);
|
||||
template void AddrMan::Unserialize(CHashVerifier<CAutoFile>& s);
|
||||
|
||||
24
src/hash.h
24
src/hash.h
@@ -188,6 +188,30 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
/** Writes data to an underlying source stream, while hashing the written data. */
|
||||
template <typename Source>
|
||||
class HashedSourceWriter : public CHashWriter
|
||||
{
|
||||
private:
|
||||
Source& m_source;
|
||||
|
||||
public:
|
||||
explicit HashedSourceWriter(Source& source LIFETIMEBOUND) : CHashWriter{source.GetType(), source.GetVersion()}, m_source{source} {}
|
||||
|
||||
void write(Span<const std::byte> src)
|
||||
{
|
||||
m_source.write(src);
|
||||
CHashWriter::write(src);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
HashedSourceWriter& operator<<(const T& obj)
|
||||
{
|
||||
::Serialize(*this, obj);
|
||||
return *this;
|
||||
}
|
||||
};
|
||||
|
||||
/** Compute the 256-bit hash of an object's serialization. */
|
||||
template<typename T>
|
||||
uint256 SerializeHash(const T& obj, int nType=SER_GETHASH, int nVersion=PROTOCOL_VERSION)
|
||||
|
||||
@@ -109,13 +109,13 @@ CTxDestination DecodeDestination(const std::string& str, const CChainParams& par
|
||||
std::equal(pubkey_prefix.begin(), pubkey_prefix.end(), data.begin()))) {
|
||||
error_str = "Invalid length for Base58 address";
|
||||
} else {
|
||||
error_str = "Invalid prefix for Base58-encoded address";
|
||||
error_str = "Invalid or unsupported Base58-encoded address.";
|
||||
}
|
||||
return CNoDestination();
|
||||
} else if (!is_bech32) {
|
||||
// Try Base58 decoding without the checksum, using a much larger max length
|
||||
if (!DecodeBase58(str, data, 100)) {
|
||||
error_str = "Not a valid Bech32 or Base58 encoding";
|
||||
error_str = "Invalid or unsupported Segwit (Bech32) or Base58 encoding.";
|
||||
} else {
|
||||
error_str = "Invalid checksum or length of Base58 address";
|
||||
}
|
||||
@@ -124,7 +124,11 @@ CTxDestination DecodeDestination(const std::string& str, const CChainParams& par
|
||||
|
||||
data.clear();
|
||||
const auto dec = bech32::Decode(str);
|
||||
if ((dec.encoding == bech32::Encoding::BECH32 || dec.encoding == bech32::Encoding::BECH32M) && dec.data.size() > 0) {
|
||||
if (dec.encoding == bech32::Encoding::BECH32 || dec.encoding == bech32::Encoding::BECH32M) {
|
||||
if (dec.data.empty()) {
|
||||
error_str = "Empty Bech32 data section";
|
||||
return CNoDestination();
|
||||
}
|
||||
// Bech32 decoding
|
||||
if (dec.hrp != params.Bech32HRP()) {
|
||||
error_str = "Invalid prefix for Bech32 address";
|
||||
@@ -158,7 +162,7 @@ CTxDestination DecodeDestination(const std::string& str, const CChainParams& par
|
||||
}
|
||||
}
|
||||
|
||||
error_str = "Invalid Bech32 v0 address data size";
|
||||
error_str = strprintf("Invalid Bech32 v0 address program size (%s byte), per BIP141", data.size());
|
||||
return CNoDestination();
|
||||
}
|
||||
|
||||
@@ -175,7 +179,7 @@ CTxDestination DecodeDestination(const std::string& str, const CChainParams& par
|
||||
}
|
||||
|
||||
if (data.size() < 2 || data.size() > BECH32_WITNESS_PROG_MAX_LEN) {
|
||||
error_str = "Invalid Bech32 address data size";
|
||||
error_str = strprintf("Invalid Bech32 address program size (%s byte)", data.size());
|
||||
return CNoDestination();
|
||||
}
|
||||
|
||||
@@ -184,6 +188,9 @@ CTxDestination DecodeDestination(const std::string& str, const CChainParams& par
|
||||
std::copy(data.begin(), data.end(), unk.program);
|
||||
unk.length = data.size();
|
||||
return unk;
|
||||
} else {
|
||||
error_str = strprintf("Invalid padding in Bech32 data section");
|
||||
return CNoDestination();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -541,8 +541,11 @@ private:
|
||||
/** Remove this block from our tracked requested blocks. Called if:
|
||||
* - the block has been received from a peer
|
||||
* - the request for the block has timed out
|
||||
* If "from_peer" is specified, then only remove the block if it is in
|
||||
* flight from that peer (to avoid one peer's network traffic from
|
||||
* affecting another's state).
|
||||
*/
|
||||
void RemoveBlockRequest(const uint256& hash) EXCLUSIVE_LOCKS_REQUIRED(cs_main);
|
||||
void RemoveBlockRequest(const uint256& hash, std::optional<NodeId> from_peer) EXCLUSIVE_LOCKS_REQUIRED(cs_main);
|
||||
|
||||
/* Mark a block as in flight
|
||||
* Returns false, still setting pit, if the block was already in flight from the same peer
|
||||
@@ -853,7 +856,7 @@ bool PeerManagerImpl::IsBlockRequested(const uint256& hash)
|
||||
return mapBlocksInFlight.find(hash) != mapBlocksInFlight.end();
|
||||
}
|
||||
|
||||
void PeerManagerImpl::RemoveBlockRequest(const uint256& hash)
|
||||
void PeerManagerImpl::RemoveBlockRequest(const uint256& hash, std::optional<NodeId> from_peer)
|
||||
{
|
||||
auto it = mapBlocksInFlight.find(hash);
|
||||
if (it == mapBlocksInFlight.end()) {
|
||||
@@ -862,6 +865,12 @@ void PeerManagerImpl::RemoveBlockRequest(const uint256& hash)
|
||||
}
|
||||
|
||||
auto [node_id, list_it] = it->second;
|
||||
|
||||
if (from_peer && node_id != *from_peer) {
|
||||
// Block was requested by another peer
|
||||
return;
|
||||
}
|
||||
|
||||
CNodeState *state = State(node_id);
|
||||
assert(state != nullptr);
|
||||
|
||||
@@ -897,7 +906,7 @@ bool PeerManagerImpl::BlockRequested(NodeId nodeid, const CBlockIndex& block, st
|
||||
}
|
||||
|
||||
// Make sure it's not listed somewhere already.
|
||||
RemoveBlockRequest(hash);
|
||||
RemoveBlockRequest(hash, std::nullopt);
|
||||
|
||||
std::list<QueuedBlock>::iterator it = state->vBlocksInFlight.insert(state->vBlocksInFlight.end(),
|
||||
{&block, std::unique_ptr<PartiallyDownloadedBlock>(pit ? new PartiallyDownloadedBlock(&m_mempool) : nullptr)});
|
||||
@@ -2545,6 +2554,11 @@ void PeerManagerImpl::ProcessBlock(CNode& node, const std::shared_ptr<const CBlo
|
||||
m_chainman.ProcessNewBlock(m_chainparams, block, force_processing, &new_block);
|
||||
if (new_block) {
|
||||
node.m_last_block_time = GetTime<std::chrono::seconds>();
|
||||
// In case this block came from a different peer than we requested
|
||||
// from, we can erase the block request now anyway (as we just stored
|
||||
// this block to disk).
|
||||
LOCK(cs_main);
|
||||
RemoveBlockRequest(block->GetHash(), std::nullopt);
|
||||
} else {
|
||||
LOCK(cs_main);
|
||||
mapBlockSource.erase(block->GetHash());
|
||||
@@ -3604,7 +3618,7 @@ void PeerManagerImpl::ProcessMessage(CNode& pfrom, const std::string& msg_type,
|
||||
PartiallyDownloadedBlock& partialBlock = *(*queuedBlockIt)->partialBlock;
|
||||
ReadStatus status = partialBlock.InitData(cmpctblock, vExtraTxnForCompact);
|
||||
if (status == READ_STATUS_INVALID) {
|
||||
RemoveBlockRequest(pindex->GetBlockHash()); // Reset in-flight state in case Misbehaving does not result in a disconnect
|
||||
RemoveBlockRequest(pindex->GetBlockHash(), pfrom.GetId()); // Reset in-flight state in case Misbehaving does not result in a disconnect
|
||||
Misbehaving(pfrom.GetId(), 100, "invalid compact block");
|
||||
return;
|
||||
} else if (status == READ_STATUS_FAILED) {
|
||||
@@ -3699,7 +3713,7 @@ void PeerManagerImpl::ProcessMessage(CNode& pfrom, const std::string& msg_type,
|
||||
// process from some other peer. We do this after calling
|
||||
// ProcessNewBlock so that a malleated cmpctblock announcement
|
||||
// can't be used to interfere with block relay.
|
||||
RemoveBlockRequest(pblock->GetHash());
|
||||
RemoveBlockRequest(pblock->GetHash(), std::nullopt);
|
||||
}
|
||||
}
|
||||
return;
|
||||
@@ -3731,7 +3745,7 @@ void PeerManagerImpl::ProcessMessage(CNode& pfrom, const std::string& msg_type,
|
||||
PartiallyDownloadedBlock& partialBlock = *it->second.second->partialBlock;
|
||||
ReadStatus status = partialBlock.FillBlock(*pblock, resp.txn);
|
||||
if (status == READ_STATUS_INVALID) {
|
||||
RemoveBlockRequest(resp.blockhash); // Reset in-flight state in case Misbehaving does not result in a disconnect
|
||||
RemoveBlockRequest(resp.blockhash, pfrom.GetId()); // Reset in-flight state in case Misbehaving does not result in a disconnect
|
||||
Misbehaving(pfrom.GetId(), 100, "invalid compact block/non-matching block transactions");
|
||||
return;
|
||||
} else if (status == READ_STATUS_FAILED) {
|
||||
@@ -3757,7 +3771,7 @@ void PeerManagerImpl::ProcessMessage(CNode& pfrom, const std::string& msg_type,
|
||||
// though the block was successfully read, and rely on the
|
||||
// handling in ProcessNewBlock to ensure the block index is
|
||||
// updated, etc.
|
||||
RemoveBlockRequest(resp.blockhash); // it is now an empty pointer
|
||||
RemoveBlockRequest(resp.blockhash, pfrom.GetId()); // it is now an empty pointer
|
||||
fBlockRead = true;
|
||||
// mapBlockSource is used for potentially punishing peers and
|
||||
// updating which peers send us compact blocks, so the race
|
||||
@@ -3825,7 +3839,7 @@ void PeerManagerImpl::ProcessMessage(CNode& pfrom, const std::string& msg_type,
|
||||
// Always process the block if we requested it, since we may
|
||||
// need it even when it's not a candidate for a new best tip.
|
||||
forceProcessing = IsBlockRequested(hash);
|
||||
RemoveBlockRequest(hash);
|
||||
RemoveBlockRequest(hash, pfrom.GetId());
|
||||
// mapBlockSource is only used for punishing peers and setting
|
||||
// which peers send us compact blocks, so the race between here and
|
||||
// cs_main in ProcessNewBlock is fine.
|
||||
@@ -4876,7 +4890,9 @@ bool PeerManagerImpl::SendMessages(CNode* pto)
|
||||
// especially since we have many peers and some will draw much shorter delays.
|
||||
unsigned int nRelayedTransactions = 0;
|
||||
LOCK(pto->m_tx_relay->cs_filter);
|
||||
while (!vInvTx.empty() && nRelayedTransactions < INVENTORY_BROADCAST_MAX) {
|
||||
size_t broadcast_max{INVENTORY_BROADCAST_MAX + (pto->m_tx_relay->setInventoryTxToSend.size()/1000)*5};
|
||||
broadcast_max = std::min<size_t>(1000, broadcast_max);
|
||||
while (!vInvTx.empty() && nRelayedTransactions < broadcast_max) {
|
||||
// Fetch the top element from the heap
|
||||
std::pop_heap(vInvTx.begin(), vInvTx.end(), compareInvMempoolOrder);
|
||||
std::set<uint256>::iterator it = vInvTx.back();
|
||||
|
||||
@@ -22,6 +22,9 @@
|
||||
#endif
|
||||
|
||||
#include <algorithm>
|
||||
#include <limits>
|
||||
#include <stdexcept>
|
||||
#include <utility>
|
||||
#ifdef ARENA_DEBUG
|
||||
#include <iomanip>
|
||||
#include <iostream>
|
||||
|
||||
@@ -5,11 +5,11 @@
|
||||
#ifndef BITCOIN_SUPPORT_LOCKEDPOOL_H
|
||||
#define BITCOIN_SUPPORT_LOCKEDPOOL_H
|
||||
|
||||
#include <stdint.h>
|
||||
#include <cstddef>
|
||||
#include <list>
|
||||
#include <map>
|
||||
#include <mutex>
|
||||
#include <memory>
|
||||
#include <mutex>
|
||||
#include <unordered_map>
|
||||
|
||||
/**
|
||||
|
||||
@@ -441,4 +441,18 @@ BOOST_AUTO_TEST_CASE(streams_buffered_file_rand)
|
||||
fs::remove(streams_test_filename);
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(streams_hashed)
|
||||
{
|
||||
CDataStream stream(SER_NETWORK, INIT_PROTO_VERSION);
|
||||
HashedSourceWriter hash_writer{stream};
|
||||
const std::string data{"bitcoin"};
|
||||
hash_writer << data;
|
||||
|
||||
CHashVerifier hash_verifier{&stream};
|
||||
std::string result;
|
||||
hash_verifier >> result;
|
||||
BOOST_CHECK_EQUAL(data, result);
|
||||
BOOST_CHECK_EQUAL(hash_writer.GetHash(), hash_verifier.GetHash());
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_SUITE_END()
|
||||
|
||||
@@ -831,11 +831,16 @@ void CTxMemPool::check(const CCoinsViewCache& active_coins_tip, int64_t spendhei
|
||||
|
||||
bool CTxMemPool::CompareDepthAndScore(const uint256& hasha, const uint256& hashb, bool wtxid)
|
||||
{
|
||||
/* Return `true` if hasha should be considered sooner than hashb. Namely when:
|
||||
* a is not in the mempool, but b is
|
||||
* both are in the mempool and a has fewer ancestors than b
|
||||
* both are in the mempool and a has a higher score than b
|
||||
*/
|
||||
LOCK(cs);
|
||||
indexed_transaction_set::const_iterator i = wtxid ? get_iter_from_wtxid(hasha) : mapTx.find(hasha);
|
||||
if (i == mapTx.end()) return false;
|
||||
indexed_transaction_set::const_iterator j = wtxid ? get_iter_from_wtxid(hashb) : mapTx.find(hashb);
|
||||
if (j == mapTx.end()) return true;
|
||||
if (j == mapTx.end()) return false;
|
||||
indexed_transaction_set::const_iterator i = wtxid ? get_iter_from_wtxid(hasha) : mapTx.find(hasha);
|
||||
if (i == mapTx.end()) return true;
|
||||
uint64_t counta = i->GetCountWithAncestors();
|
||||
uint64_t countb = j->GetCountWithAncestors();
|
||||
if (counta == countb) {
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
#define BITCOIN_UTIL_BIP32_H
|
||||
|
||||
#include <attributes.h>
|
||||
#include <cstdint>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
|
||||
#include <algorithm>
|
||||
#include <array>
|
||||
#include <cstdint>
|
||||
#include <cstring>
|
||||
#include <locale>
|
||||
#include <sstream>
|
||||
|
||||
@@ -60,12 +60,12 @@ class InvalidAddressErrorMessageTest(BitcoinTestFramework):
|
||||
|
||||
def test_validateaddress(self):
|
||||
# Invalid Bech32
|
||||
self.check_invalid(BECH32_INVALID_SIZE, 'Invalid Bech32 address data size')
|
||||
self.check_invalid(BECH32_INVALID_PREFIX, 'Not a valid Bech32 or Base58 encoding')
|
||||
self.check_invalid(BECH32_INVALID_SIZE, 'Invalid Bech32 address program size (41 byte)')
|
||||
self.check_invalid(BECH32_INVALID_PREFIX, 'Invalid or unsupported Segwit (Bech32) or Base58 encoding.')
|
||||
self.check_invalid(BECH32_INVALID_BECH32, 'Version 1+ witness address must use Bech32m checksum')
|
||||
self.check_invalid(BECH32_INVALID_BECH32M, 'Version 0 witness address must use Bech32 checksum')
|
||||
self.check_invalid(BECH32_INVALID_VERSION, 'Invalid Bech32 address witness version')
|
||||
self.check_invalid(BECH32_INVALID_V0_SIZE, 'Invalid Bech32 v0 address data size')
|
||||
self.check_invalid(BECH32_INVALID_V0_SIZE, 'Invalid Bech32 v0 address program size (21 byte), per BIP141')
|
||||
self.check_invalid(BECH32_TOO_LONG, 'Bech32 string too long', list(range(90, 108)))
|
||||
self.check_invalid(BECH32_ONE_ERROR, 'Invalid Bech32 checksum', [9])
|
||||
self.check_invalid(BECH32_TWO_ERRORS, 'Invalid Bech32 checksum', [22, 43])
|
||||
@@ -81,7 +81,7 @@ class InvalidAddressErrorMessageTest(BitcoinTestFramework):
|
||||
self.check_valid(BECH32_VALID_MULTISIG)
|
||||
|
||||
# Invalid Base58
|
||||
self.check_invalid(BASE58_INVALID_PREFIX, 'Invalid prefix for Base58-encoded address')
|
||||
self.check_invalid(BASE58_INVALID_PREFIX, 'Invalid or unsupported Base58-encoded address.')
|
||||
self.check_invalid(BASE58_INVALID_CHECKSUM, 'Invalid checksum or length of Base58 address')
|
||||
self.check_invalid(BASE58_INVALID_LENGTH, 'Invalid checksum or length of Base58 address')
|
||||
|
||||
@@ -89,19 +89,19 @@ class InvalidAddressErrorMessageTest(BitcoinTestFramework):
|
||||
self.check_valid(BASE58_VALID)
|
||||
|
||||
# Invalid address format
|
||||
self.check_invalid(INVALID_ADDRESS, 'Not a valid Bech32 or Base58 encoding')
|
||||
self.check_invalid(INVALID_ADDRESS_2, 'Not a valid Bech32 or Base58 encoding')
|
||||
self.check_invalid(INVALID_ADDRESS, 'Invalid or unsupported Segwit (Bech32) or Base58 encoding.')
|
||||
self.check_invalid(INVALID_ADDRESS_2, 'Invalid or unsupported Segwit (Bech32) or Base58 encoding.')
|
||||
|
||||
def test_getaddressinfo(self):
|
||||
node = self.nodes[0]
|
||||
|
||||
assert_raises_rpc_error(-5, "Invalid Bech32 address data size", node.getaddressinfo, BECH32_INVALID_SIZE)
|
||||
assert_raises_rpc_error(-5, "Invalid Bech32 address program size (41 byte)", node.getaddressinfo, BECH32_INVALID_SIZE)
|
||||
|
||||
assert_raises_rpc_error(-5, "Not a valid Bech32 or Base58 encoding", node.getaddressinfo, BECH32_INVALID_PREFIX)
|
||||
assert_raises_rpc_error(-5, "Invalid or unsupported Segwit (Bech32) or Base58 encoding.", node.getaddressinfo, BECH32_INVALID_PREFIX)
|
||||
|
||||
assert_raises_rpc_error(-5, "Invalid prefix for Base58-encoded address", node.getaddressinfo, BASE58_INVALID_PREFIX)
|
||||
assert_raises_rpc_error(-5, "Invalid or unsupported Base58-encoded address.", node.getaddressinfo, BASE58_INVALID_PREFIX)
|
||||
|
||||
assert_raises_rpc_error(-5, "Not a valid Bech32 or Base58 encoding", node.getaddressinfo, INVALID_ADDRESS)
|
||||
assert_raises_rpc_error(-5, "Invalid or unsupported Segwit (Bech32) or Base58 encoding.", node.getaddressinfo, INVALID_ADDRESS)
|
||||
|
||||
def run_test(self):
|
||||
self.test_validateaddress()
|
||||
|
||||
203
test/functional/rpc_validateaddress.py
Executable file
203
test/functional/rpc_validateaddress.py
Executable file
@@ -0,0 +1,203 @@
|
||||
#!/usr/bin/env python3
|
||||
# Copyright (c) 2023 The Bitcoin Core developers
|
||||
# Distributed under the MIT software license, see the accompanying
|
||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
"""Test validateaddress for main chain"""
|
||||
|
||||
from test_framework.test_framework import BitcoinTestFramework
|
||||
|
||||
from test_framework.util import assert_equal
|
||||
|
||||
INVALID_DATA = [
|
||||
# BIP 173
|
||||
(
|
||||
"tc1qw508d6qejxtdg4y5r3zarvary0c5xw7kg3g4ty",
|
||||
"Invalid or unsupported Segwit (Bech32) or Base58 encoding.", # Invalid hrp
|
||||
[],
|
||||
),
|
||||
("bc1qw508d6qejxtdg4y5r3zarvary0c5xw7kv8f3t5", "Invalid Bech32 checksum", [41]),
|
||||
(
|
||||
"BC13W508D6QEJXTDG4Y5R3ZARVARY0C5XW7KN40WF2",
|
||||
"Version 1+ witness address must use Bech32m checksum",
|
||||
[],
|
||||
),
|
||||
(
|
||||
"bc1rw5uspcuh",
|
||||
"Version 1+ witness address must use Bech32m checksum", # Invalid program length
|
||||
[],
|
||||
),
|
||||
(
|
||||
"bc10w508d6qejxtdg4y5r3zarvary0c5xw7kw508d6qejxtdg4y5r3zarvary0c5xw7kw5rljs90",
|
||||
"Version 1+ witness address must use Bech32m checksum", # Invalid program length
|
||||
[],
|
||||
),
|
||||
(
|
||||
"BC1QR508D6QEJXTDG4Y5R3ZARVARYV98GJ9P",
|
||||
"Invalid Bech32 v0 address program size (16 byte), per BIP141",
|
||||
[],
|
||||
),
|
||||
(
|
||||
"tb1qrp33g0q5c5txsp9arysrx4k6zdkfs4nce4xj0gdcccefvpysxf3q0sL5k7",
|
||||
"Invalid or unsupported Segwit (Bech32) or Base58 encoding.", # tb1, Mixed case
|
||||
[],
|
||||
),
|
||||
(
|
||||
"BC1QW508D6QEJXTDG4Y5R3ZARVARY0C5XW7KV8F3t4",
|
||||
"Invalid character or mixed case", # bc1, Mixed case, not in BIP 173 test vectors
|
||||
[40],
|
||||
),
|
||||
(
|
||||
"bc1zw508d6qejxtdg4y5r3zarvaryvqyzf3du",
|
||||
"Version 1+ witness address must use Bech32m checksum", # Wrong padding
|
||||
[],
|
||||
),
|
||||
(
|
||||
"tb1qrp33g0q5c5txsp9arysrx4k6zdkfs4nce4xj0gdcccefvpysxf3pjxtptv",
|
||||
"Invalid or unsupported Segwit (Bech32) or Base58 encoding.", # tb1, Non-zero padding in 8-to-5 conversion
|
||||
[],
|
||||
),
|
||||
("bc1gmk9yu", "Empty Bech32 data section", []),
|
||||
# BIP 350
|
||||
(
|
||||
"tc1p0xlxvlhemja6c4dqv22uapctqupfhlxm9h8z3k2e72q4k9hcz7vq5zuyut",
|
||||
"Invalid or unsupported Segwit (Bech32) or Base58 encoding.", # Invalid human-readable part
|
||||
[],
|
||||
),
|
||||
(
|
||||
"bc1p0xlxvlhemja6c4dqv22uapctqupfhlxm9h8z3k2e72q4k9hcz7vqh2y7hd",
|
||||
"Version 1+ witness address must use Bech32m checksum", # Invalid checksum (Bech32 instead of Bech32m)
|
||||
[],
|
||||
),
|
||||
(
|
||||
"tb1z0xlxvlhemja6c4dqv22uapctqupfhlxm9h8z3k2e72q4k9hcz7vqglt7rf",
|
||||
"Invalid or unsupported Segwit (Bech32) or Base58 encoding.", # tb1, Invalid checksum (Bech32 instead of Bech32m)
|
||||
[],
|
||||
),
|
||||
(
|
||||
"BC1S0XLXVLHEMJA6C4DQV22UAPCTQUPFHLXM9H8Z3K2E72Q4K9HCZ7VQ54WELL",
|
||||
"Version 1+ witness address must use Bech32m checksum", # Invalid checksum (Bech32 instead of Bech32m)
|
||||
[],
|
||||
),
|
||||
(
|
||||
"bc1qw508d6qejxtdg4y5r3zarvary0c5xw7kemeawh",
|
||||
"Version 0 witness address must use Bech32 checksum", # Invalid checksum (Bech32m instead of Bech32)
|
||||
[],
|
||||
),
|
||||
(
|
||||
"tb1q0xlxvlhemja6c4dqv22uapctqupfhlxm9h8z3k2e72q4k9hcz7vq24jc47",
|
||||
"Invalid or unsupported Segwit (Bech32) or Base58 encoding.", # tb1, Invalid checksum (Bech32m instead of Bech32)
|
||||
[],
|
||||
),
|
||||
(
|
||||
"bc1p38j9r5y49hruaue7wxjce0updqjuyyx0kh56v8s25huc6995vvpql3jow4",
|
||||
"Invalid Base 32 character", # Invalid character in checksum
|
||||
[59],
|
||||
),
|
||||
(
|
||||
"BC130XLXVLHEMJA6C4DQV22UAPCTQUPFHLXM9H8Z3K2E72Q4K9HCZ7VQ7ZWS8R",
|
||||
"Invalid Bech32 address witness version",
|
||||
[],
|
||||
),
|
||||
("bc1pw5dgrnzv", "Invalid Bech32 address program size (1 byte)", []),
|
||||
(
|
||||
"bc1p0xlxvlhemja6c4dqv22uapctqupfhlxm9h8z3k2e72q4k9hcz7v8n0nx0muaewav253zgeav",
|
||||
"Invalid Bech32 address program size (41 byte)",
|
||||
[],
|
||||
),
|
||||
(
|
||||
"BC1QR508D6QEJXTDG4Y5R3ZARVARYV98GJ9P",
|
||||
"Invalid Bech32 v0 address program size (16 byte), per BIP141",
|
||||
[],
|
||||
),
|
||||
(
|
||||
"tb1p0xlxvlhemja6c4dqv22uapctqupfhlxm9h8z3k2e72q4k9hcz7vq47Zagq",
|
||||
"Invalid or unsupported Segwit (Bech32) or Base58 encoding.", # tb1, Mixed case
|
||||
[],
|
||||
),
|
||||
(
|
||||
"bc1p0xlxvlhemja6c4dqv22uapctqupfhlxm9h8z3k2e72q4k9hcz7v07qwwzcrf",
|
||||
"Invalid padding in Bech32 data section", # zero padding of more than 4 bits
|
||||
[],
|
||||
),
|
||||
(
|
||||
"tb1p0xlxvlhemja6c4dqv22uapctqupfhlxm9h8z3k2e72q4k9hcz7vpggkg4j",
|
||||
"Invalid or unsupported Segwit (Bech32) or Base58 encoding.", # tb1, Non-zero padding in 8-to-5 conversion
|
||||
[],
|
||||
),
|
||||
("bc1gmk9yu", "Empty Bech32 data section", []),
|
||||
]
|
||||
VALID_DATA = [
|
||||
# BIP 350
|
||||
(
|
||||
"BC1QW508D6QEJXTDG4Y5R3ZARVARY0C5XW7KV8F3T4",
|
||||
"0014751e76e8199196d454941c45d1b3a323f1433bd6",
|
||||
),
|
||||
# (
|
||||
# "tb1qrp33g0q5c5txsp9arysrx4k6zdkfs4nce4xj0gdcccefvpysxf3q0sl5k7",
|
||||
# "00201863143c14c5166804bd19203356da136c985678cd4d27a1b8c6329604903262",
|
||||
# ),
|
||||
(
|
||||
"bc1qrp33g0q5c5txsp9arysrx4k6zdkfs4nce4xj0gdcccefvpysxf3qccfmv3",
|
||||
"00201863143c14c5166804bd19203356da136c985678cd4d27a1b8c6329604903262",
|
||||
),
|
||||
(
|
||||
"bc1pw508d6qejxtdg4y5r3zarvary0c5xw7kw508d6qejxtdg4y5r3zarvary0c5xw7kt5nd6y",
|
||||
"5128751e76e8199196d454941c45d1b3a323f1433bd6751e76e8199196d454941c45d1b3a323f1433bd6",
|
||||
),
|
||||
("BC1SW50QGDZ25J", "6002751e"),
|
||||
("bc1zw508d6qejxtdg4y5r3zarvaryvaxxpcs", "5210751e76e8199196d454941c45d1b3a323"),
|
||||
# (
|
||||
# "tb1qqqqqp399et2xygdj5xreqhjjvcmzhxw4aywxecjdzew6hylgvsesrxh6hy",
|
||||
# "0020000000c4a5cad46221b2a187905e5266362b99d5e91c6ce24d165dab93e86433",
|
||||
# ),
|
||||
(
|
||||
"bc1qqqqqp399et2xygdj5xreqhjjvcmzhxw4aywxecjdzew6hylgvses5wp4dt",
|
||||
"0020000000c4a5cad46221b2a187905e5266362b99d5e91c6ce24d165dab93e86433",
|
||||
),
|
||||
# (
|
||||
# "tb1pqqqqp399et2xygdj5xreqhjjvcmzhxw4aywxecjdzew6hylgvsesf3hn0c",
|
||||
# "5120000000c4a5cad46221b2a187905e5266362b99d5e91c6ce24d165dab93e86433",
|
||||
# ),
|
||||
(
|
||||
"bc1pqqqqp399et2xygdj5xreqhjjvcmzhxw4aywxecjdzew6hylgvses7epu4h",
|
||||
"5120000000c4a5cad46221b2a187905e5266362b99d5e91c6ce24d165dab93e86433",
|
||||
),
|
||||
(
|
||||
"bc1p0xlxvlhemja6c4dqv22uapctqupfhlxm9h8z3k2e72q4k9hcz7vqzk5jj0",
|
||||
"512079be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798",
|
||||
),
|
||||
]
|
||||
|
||||
|
||||
class ValidateAddressMainTest(BitcoinTestFramework):
|
||||
def set_test_params(self):
|
||||
self.setup_clean_chain = True
|
||||
self.chain = "" # main
|
||||
self.num_nodes = 1
|
||||
self.extra_args = [["-prune=899"]] * self.num_nodes
|
||||
|
||||
def check_valid(self, addr, spk):
|
||||
info = self.nodes[0].validateaddress(addr)
|
||||
assert_equal(info["isvalid"], True)
|
||||
assert_equal(info["scriptPubKey"], spk)
|
||||
assert "error" not in info
|
||||
assert "error_locations" not in info
|
||||
|
||||
def check_invalid(self, addr, error_str, error_locations):
|
||||
res = self.nodes[0].validateaddress(addr)
|
||||
assert_equal(res["isvalid"], False)
|
||||
assert_equal(res["error"], error_str)
|
||||
assert_equal(res["error_locations"], error_locations)
|
||||
|
||||
def test_validateaddress(self):
|
||||
for (addr, error, locs) in INVALID_DATA:
|
||||
self.check_invalid(addr, error, locs)
|
||||
for (addr, spk) in VALID_DATA:
|
||||
self.check_valid(addr, spk)
|
||||
|
||||
def run_test(self):
|
||||
self.test_validateaddress()
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
ValidateAddressMainTest().main()
|
||||
@@ -138,6 +138,7 @@ BASE_SCRIPTS = [
|
||||
'feature_fee_estimation.py',
|
||||
'interface_zmq.py',
|
||||
'rpc_invalid_address_message.py',
|
||||
'rpc_validateaddress.py',
|
||||
'interface_bitcoin_cli.py --legacy-wallet',
|
||||
'interface_bitcoin_cli.py --descriptors',
|
||||
'feature_bind_extra.py',
|
||||
|
||||
@@ -634,7 +634,7 @@ class WalletTest(BitcoinTestFramework):
|
||||
assert_equal(total_txs, len(self.nodes[0].listtransactions("*", 99999)))
|
||||
|
||||
# Test getaddressinfo on external address. Note that these addresses are taken from disablewallet.py
|
||||
assert_raises_rpc_error(-5, "Invalid prefix for Base58-encoded address", self.nodes[0].getaddressinfo, "3J98t1WpEZ73CNmQviecrnyiWrnqRhWNLy")
|
||||
assert_raises_rpc_error(-5, "Invalid or unsupported Base58-encoded address.", self.nodes[0].getaddressinfo, "3J98t1WpEZ73CNmQviecrnyiWrnqRhWNLy")
|
||||
address_info = self.nodes[0].getaddressinfo("mneYUmWYsuk7kySiURxCi3AGxrAqZxLgPZ")
|
||||
assert_equal(address_info['address'], "mneYUmWYsuk7kySiURxCi3AGxrAqZxLgPZ")
|
||||
assert_equal(address_info["scriptPubKey"], "76a9144e3854046c7bd1594ac904e4793b6a45b36dea0988ac")
|
||||
|
||||
Reference in New Issue
Block a user