mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-23 16:44:52 +01:00
Compare commits
78 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e44d72b648 | ||
|
|
7135d7536c | ||
|
|
90f78c74a0 | ||
|
|
3cd4fdb008 | ||
|
|
e5a9e2435f | ||
|
|
2437d93989 | ||
|
|
a6aca67214 | ||
|
|
9082498589 | ||
|
|
cb13264169 | ||
|
|
fb62393277 | ||
|
|
c2b2942415 | ||
|
|
b64faa54c2 | ||
|
|
a6cbd33d1a | ||
|
|
7f1da76269 | ||
|
|
b1f694fce2 | ||
|
|
52f09633d0 | ||
|
|
744b1c8581 | ||
|
|
812cadefa2 | ||
|
|
c60055c637 | ||
|
|
0bd5cb7ac4 | ||
|
|
2b279a2138 | ||
|
|
ac2b6083ba | ||
|
|
2c21db657f | ||
|
|
9f0ee1cc9b | ||
|
|
00b401c648 | ||
|
|
59c19a5416 | ||
|
|
5c2ba9f583 | ||
|
|
ac637458ef | ||
|
|
186e3f1fb6 | ||
|
|
bbfb994fc1 | ||
|
|
fdc629fa73 | ||
|
|
a124b91339 | ||
|
|
812e637521 | ||
|
|
2ccdfa424c | ||
|
|
3df2624ee9 | ||
|
|
e65676216c | ||
|
|
2d6c14efba | ||
|
|
9b15b20cb1 | ||
|
|
dbc450c1b5 | ||
|
|
e57359c7dd | ||
|
|
51fbcba682 | ||
|
|
2829588882 | ||
|
|
f676da82fa | ||
|
|
4e7dd0ac20 | ||
|
|
32efe85043 | ||
|
|
36314b8da2 | ||
|
|
58910279dc | ||
|
|
6a68ef9bfb | ||
|
|
5b368f88a9 | ||
|
|
05cd448e33 | ||
|
|
621c634b7f | ||
|
|
6db725662d | ||
|
|
5576618152 | ||
|
|
01fe07a2ce | ||
|
|
7ddfcf32da | ||
|
|
e0b27b234c | ||
|
|
bdc6b3e531 | ||
|
|
a0585b6087 | ||
|
|
bbde830b97 | ||
|
|
227642d5af | ||
|
|
b8112cf422 | ||
|
|
2835158be0 | ||
|
|
d6b225f165 | ||
|
|
8fef83a0a0 | ||
|
|
df7764621e | ||
|
|
9add853b65 | ||
|
|
1025090fbe | ||
|
|
446f5d20d6 | ||
|
|
9976162a0e | ||
|
|
1d0411dc8f | ||
|
|
7fec638222 | ||
|
|
f998ac6286 | ||
|
|
0773560abf | ||
|
|
b917334208 | ||
|
|
f072721181 | ||
|
|
6643fd2145 | ||
|
|
89522379d1 | ||
|
|
89d34cffed |
4
COPYING
4
COPYING
@@ -1,7 +1,7 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2009-2024 The Bitcoin Core developers
|
||||
Copyright (c) 2009-2024 Bitcoin Developers
|
||||
Copyright (c) 2009-2025 The Bitcoin Core developers
|
||||
Copyright (c) 2009-2025 Bitcoin Developers
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
<OutDir>$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\..\src\test\fuzz\*.cpp" />
|
||||
<ClCompile Include="..\..\src\test\fuzz\*.cpp" Exclude="..\..\src\test\fuzz\utxo_snapshot.cpp" />
|
||||
<ClCompile Include="..\..\src\test\fuzz\util\descriptor.cpp">
|
||||
<ObjectFileName>$(IntDir)test_fuzz_util_descriptor.obj</ObjectFileName>
|
||||
</ClCompile>
|
||||
|
||||
@@ -17,3 +17,4 @@ export FUZZ_TESTS_CONFIG="--valgrind"
|
||||
export GOAL="install"
|
||||
export BITCOIN_CONFIG="--enable-fuzz --with-sanitizers=fuzzer CC=clang-16 CXX=clang++-16"
|
||||
export CCACHE_MAXSIZE=200M
|
||||
export LLVM_SYMBOLIZER_PATH="/usr/bin/llvm-symbolizer-16"
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
AC_PREREQ([2.69])
|
||||
define(_CLIENT_VERSION_MAJOR, 28)
|
||||
define(_CLIENT_VERSION_MINOR, 0)
|
||||
define(_CLIENT_VERSION_MINOR, 2)
|
||||
define(_CLIENT_VERSION_BUILD, 0)
|
||||
define(_CLIENT_VERSION_RC, 0)
|
||||
define(_CLIENT_VERSION_IS_RELEASE, true)
|
||||
define(_COPYRIGHT_YEAR, 2024)
|
||||
define(_COPYRIGHT_YEAR, 2025)
|
||||
define(_COPYRIGHT_HOLDERS,[The %s developers])
|
||||
define(_COPYRIGHT_HOLDERS_SUBSTITUTION,[[Bitcoin Core]])
|
||||
AC_INIT([Bitcoin Core],m4_join([.], _CLIENT_VERSION_MAJOR, _CLIENT_VERSION_MINOR, _CLIENT_VERSION_BUILD)m4_if(_CLIENT_VERSION_RC, [0], [], [rc]_CLIENT_VERSION_RC),[https://github.com/bitcoin/bitcoin/issues],[bitcoin],[https://bitcoincore.org/])
|
||||
|
||||
@@ -5,7 +5,7 @@ Upstream-Contact: Satoshi Nakamoto <satoshin@gmx.com>
|
||||
Source: https://github.com/bitcoin/bitcoin
|
||||
|
||||
Files: *
|
||||
Copyright: 2009-2024, Bitcoin Core Developers
|
||||
Copyright: 2009-2025, Bitcoin Core Developers
|
||||
License: Expat
|
||||
Comment: The Bitcoin Core Developers encompasses all contributors to the
|
||||
project, listed in the release notes or the git log.
|
||||
|
||||
@@ -72,9 +72,12 @@ cat >> "${EXAMPLE_CONF_FILE}" << 'EOF'
|
||||
# Options for mainnet
|
||||
[main]
|
||||
|
||||
# Options for testnet
|
||||
# Options for testnet3
|
||||
[test]
|
||||
|
||||
# Options for testnet4
|
||||
[testnet4]
|
||||
|
||||
# Options for signet
|
||||
[signet]
|
||||
|
||||
|
||||
@@ -319,7 +319,7 @@ Source: https://logs.guix.gnu.org/guix/2020-11-12.log#232527
|
||||
Start by cloning Guix:
|
||||
|
||||
```
|
||||
git clone https://git.savannah.gnu.org/git/guix.git
|
||||
git clone https://codeberg.org/guix/guix.git
|
||||
cd guix
|
||||
```
|
||||
|
||||
@@ -607,7 +607,7 @@ checklist.
|
||||
```
|
||||
Generation 38 Feb 22 2021 16:39:31 (current)
|
||||
guix f350df4
|
||||
repository URL: https://git.savannah.gnu.org/git/guix.git
|
||||
repository URL: https://codeberg.org/guix/guix.git
|
||||
branch: version-1.2.0
|
||||
commit: f350df405fbcd5b9e27e6b6aa500da7f101f41e7
|
||||
```
|
||||
@@ -760,8 +760,8 @@ Please see the following links for more details:
|
||||
|
||||
- An upstream coreutils bug has been filed: [debbugs#47940](https://debbugs.gnu.org/cgi/bugreport.cgi?bug=47940)
|
||||
- A Guix bug detailing the underlying problem has been filed: [guix-issues#47935](https://issues.guix.gnu.org/47935), [guix-issues#49985](https://issues.guix.gnu.org/49985#5)
|
||||
- A commit to skip this test in Guix has been merged into the core-updates branch:
|
||||
[savannah/guix@6ba1058](https://git.savannah.gnu.org/cgit/guix.git/commit/?id=6ba1058df0c4ce5611c2367531ae5c3cdc729ab4)
|
||||
- A commit to skip this test is included since Guix 1.4.0:
|
||||
[codeberg/guix@6ba1058](https://codeberg.org/guix/guix/commit/6ba1058df0c4ce5611c2367531ae5c3cdc729ab4)
|
||||
|
||||
|
||||
[install-script]: #options-1-and-2-using-the-official-shell-installer-script-or-binary-tarball
|
||||
|
||||
@@ -137,7 +137,7 @@ fi
|
||||
|
||||
|
||||
################
|
||||
# Unsigned tarballs SHOULD exist
|
||||
# Codesigning tarballs SHOULD exist
|
||||
################
|
||||
|
||||
# Usage: outdir_for_host HOST SUFFIX
|
||||
@@ -149,13 +149,13 @@ outdir_for_host() {
|
||||
}
|
||||
|
||||
|
||||
unsigned_tarball_for_host() {
|
||||
codesigning_tarball_for_host() {
|
||||
case "$1" in
|
||||
*mingw*)
|
||||
echo "$(outdir_for_host "$1")/${DISTNAME}-win64-unsigned.tar.gz"
|
||||
echo "$(outdir_for_host "$1")/${DISTNAME}-win64-codesigning.tar.gz"
|
||||
;;
|
||||
*darwin*)
|
||||
echo "$(outdir_for_host "$1")/${DISTNAME}-${1}-unsigned.tar.gz"
|
||||
echo "$(outdir_for_host "$1")/${DISTNAME}-${1}-codesigning.tar.gz"
|
||||
;;
|
||||
*)
|
||||
exit 1
|
||||
@@ -164,22 +164,22 @@ unsigned_tarball_for_host() {
|
||||
}
|
||||
|
||||
# Accumulate a list of build directories that already exist...
|
||||
hosts_unsigned_tarball_missing=""
|
||||
hosts_codesigning_tarball_missing=""
|
||||
for host in $HOSTS; do
|
||||
if [ ! -e "$(unsigned_tarball_for_host "$host")" ]; then
|
||||
hosts_unsigned_tarball_missing+=" ${host}"
|
||||
if [ ! -e "$(codesigning_tarball_for_host "$host")" ]; then
|
||||
hosts_codesigning_tarball_missing+=" ${host}"
|
||||
fi
|
||||
done
|
||||
|
||||
if [ -n "$hosts_unsigned_tarball_missing" ]; then
|
||||
if [ -n "$hosts_codesigning_tarball_missing" ]; then
|
||||
# ...so that we can print them out nicely in an error message
|
||||
cat << EOF
|
||||
ERR: Unsigned tarballs do not exist
|
||||
ERR: Codesigning tarballs do not exist
|
||||
...
|
||||
|
||||
EOF
|
||||
for host in $hosts_unsigned_tarball_missing; do
|
||||
echo " ${host} '$(unsigned_tarball_for_host "$host")'"
|
||||
for host in $hosts_codesigning_tarball_missing; do
|
||||
echo " ${host} '$(codesigning_tarball_for_host "$host")'"
|
||||
done
|
||||
exit 1
|
||||
fi
|
||||
@@ -371,7 +371,7 @@ EOF
|
||||
OUTDIR="$(OUTDIR_BASE=/outdir-base && outdir_for_host "$HOST" codesigned)" \
|
||||
DIST_ARCHIVE_BASE=/outdir-base/dist-archive \
|
||||
DETACHED_SIGS_REPO=/detached-sigs \
|
||||
UNSIGNED_TARBALL="$(OUTDIR_BASE=/outdir-base && unsigned_tarball_for_host "$HOST")" \
|
||||
CODESIGNING_TARBALL="$(OUTDIR_BASE=/outdir-base && codesigning_tarball_for_host "$HOST")" \
|
||||
bash -c "cd /bitcoin && bash contrib/guix/libexec/codesign.sh"
|
||||
)
|
||||
|
||||
|
||||
@@ -289,24 +289,6 @@ mkdir -p "$DISTSRC"
|
||||
;;
|
||||
esac
|
||||
|
||||
case "$HOST" in
|
||||
*darwin*)
|
||||
make deploydir ${V:+V=1}
|
||||
mkdir -p "unsigned-app-${HOST}"
|
||||
cp --target-directory="unsigned-app-${HOST}" \
|
||||
contrib/macdeploy/detached-sig-create.sh
|
||||
mv --target-directory="unsigned-app-${HOST}" dist
|
||||
(
|
||||
cd "unsigned-app-${HOST}"
|
||||
find . -print0 \
|
||||
| sort --zero-terminated \
|
||||
| tar --create --no-recursion --mode='u+rw,go+r-w,a+X' --null --files-from=- \
|
||||
| gzip -9n > "${OUTDIR}/${DISTNAME}-${HOST}-unsigned.tar.gz" \
|
||||
|| ( rm -f "${OUTDIR}/${DISTNAME}-${HOST}-unsigned.tar.gz" && exit 1 )
|
||||
)
|
||||
make deploy ${V:+V=1} OSX_ZIP="${OUTDIR}/${DISTNAME}-${HOST}-unsigned.zip"
|
||||
;;
|
||||
esac
|
||||
(
|
||||
cd installed
|
||||
|
||||
@@ -339,7 +321,7 @@ mkdir -p "$DISTSRC"
|
||||
|
||||
cp -r "${DISTSRC}/share/rpcauth" "${DISTNAME}/share/"
|
||||
|
||||
# Finally, deterministically produce {non-,}debug binary tarballs ready
|
||||
# Deterministically produce {non-,}debug binary tarballs ready
|
||||
# for release
|
||||
case "$HOST" in
|
||||
*mingw*)
|
||||
@@ -347,8 +329,8 @@ mkdir -p "$DISTSRC"
|
||||
| xargs -0r touch --no-dereference --date="@${SOURCE_DATE_EPOCH}"
|
||||
find "${DISTNAME}" -not -name "*.dbg" \
|
||||
| sort \
|
||||
| zip -X@ "${OUTDIR}/${DISTNAME}-${HOST//x86_64-w64-mingw32/win64}.zip" \
|
||||
|| ( rm -f "${OUTDIR}/${DISTNAME}-${HOST//x86_64-w64-mingw32/win64}.zip" && exit 1 )
|
||||
| zip -X@ "${OUTDIR}/${DISTNAME}-${HOST//x86_64-w64-mingw32/win64}-unsigned.zip" \
|
||||
|| ( rm -f "${OUTDIR}/${DISTNAME}-${HOST//x86_64-w64-mingw32/win64}-unsigned.zip" && exit 1 )
|
||||
find "${DISTNAME}" -name "*.dbg" -print0 \
|
||||
| xargs -0r touch --no-dereference --date="@${SOURCE_DATE_EPOCH}"
|
||||
find "${DISTNAME}" -name "*.dbg" \
|
||||
@@ -372,12 +354,13 @@ mkdir -p "$DISTSRC"
|
||||
find "${DISTNAME}" -print0 \
|
||||
| sort --zero-terminated \
|
||||
| tar --create --no-recursion --mode='u+rw,go+r-w,a+X' --null --files-from=- \
|
||||
| gzip -9n > "${OUTDIR}/${DISTNAME}-${HOST}.tar.gz" \
|
||||
|| ( rm -f "${OUTDIR}/${DISTNAME}-${HOST}.tar.gz" && exit 1 )
|
||||
| gzip -9n > "${OUTDIR}/${DISTNAME}-${HOST}-unsigned.tar.gz" \
|
||||
|| ( rm -f "${OUTDIR}/${DISTNAME}-${HOST}-unsigned.tar.gz" && exit 1 )
|
||||
;;
|
||||
esac
|
||||
) # $DISTSRC/installed
|
||||
|
||||
# Finally make tarballs for codesigning
|
||||
case "$HOST" in
|
||||
*mingw*)
|
||||
cp -rf --target-directory=. contrib/windeploy
|
||||
@@ -385,13 +368,33 @@ mkdir -p "$DISTSRC"
|
||||
cd ./windeploy
|
||||
mkdir -p unsigned
|
||||
cp --target-directory=unsigned/ "${OUTDIR}/${DISTNAME}-win64-setup-unsigned.exe"
|
||||
cp -r --target-directory=unsigned/ "${INSTALLPATH}"
|
||||
find unsigned/ -name "*.dbg" -print0 \
|
||||
| xargs -0r rm
|
||||
find . -print0 \
|
||||
| sort --zero-terminated \
|
||||
| tar --create --no-recursion --mode='u+rw,go+r-w,a+X' --null --files-from=- \
|
||||
| gzip -9n > "${OUTDIR}/${DISTNAME}-win64-unsigned.tar.gz" \
|
||||
|| ( rm -f "${OUTDIR}/${DISTNAME}-win64-unsigned.tar.gz" && exit 1 )
|
||||
| gzip -9n > "${OUTDIR}/${DISTNAME}-win64-codesigning.tar.gz" \
|
||||
|| ( rm -f "${OUTDIR}/${DISTNAME}-win64-codesigning.tar.gz" && exit 1 )
|
||||
)
|
||||
;;
|
||||
*darwin*)
|
||||
make deploydir ${V:+V=1}
|
||||
mkdir -p "unsigned-app-${HOST}"
|
||||
cp --target-directory="unsigned-app-${HOST}" \
|
||||
contrib/macdeploy/detached-sig-create.sh
|
||||
mv --target-directory="unsigned-app-${HOST}" dist
|
||||
cp -r --target-directory="unsigned-app-${HOST}" "${INSTALLPATH}"
|
||||
(
|
||||
cd "unsigned-app-${HOST}"
|
||||
find . -print0 \
|
||||
| sort --zero-terminated \
|
||||
| tar --create --no-recursion --mode='u+rw,go+r-w,a+X' --null --files-from=- \
|
||||
| gzip -9n > "${OUTDIR}/${DISTNAME}-${HOST}-codesigning.tar.gz" \
|
||||
|| ( rm -f "${OUTDIR}/${DISTNAME}-${HOST}-codesigning.tar.gz" && exit 1 )
|
||||
)
|
||||
make deploy ${V:+V=1} OSX_ZIP="${OUTDIR}/${DISTNAME}-${HOST}-unsigned.zip"
|
||||
;;
|
||||
esac
|
||||
) # $DISTSRC
|
||||
|
||||
|
||||
@@ -4,6 +4,9 @@
|
||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
export LC_ALL=C
|
||||
set -e -o pipefail
|
||||
|
||||
# Environment variables for determinism
|
||||
export TAR_OPTIONS="--owner=0 --group=0 --numeric-owner --mtime='@${SOURCE_DATE_EPOCH}' --sort=name"
|
||||
export TZ=UTC
|
||||
|
||||
# Although Guix _does_ set umask when building its own packages (in our case,
|
||||
@@ -27,7 +30,7 @@ fi
|
||||
# Check that required environment variables are set
|
||||
cat << EOF
|
||||
Required environment variables as seen inside the container:
|
||||
UNSIGNED_TARBALL: ${UNSIGNED_TARBALL:?not set}
|
||||
CODESIGNING_TARBALL: ${CODESIGNING_TARBALL:?not set}
|
||||
DETACHED_SIGS_REPO: ${DETACHED_SIGS_REPO:?not set}
|
||||
DIST_ARCHIVE_BASE: ${DIST_ARCHIVE_BASE:?not set}
|
||||
DISTNAME: ${DISTNAME:?not set}
|
||||
@@ -63,27 +66,54 @@ mkdir -p "$DISTSRC"
|
||||
(
|
||||
cd "$DISTSRC"
|
||||
|
||||
tar -xf "$UNSIGNED_TARBALL"
|
||||
tar -xf "$CODESIGNING_TARBALL"
|
||||
|
||||
mkdir -p codesignatures
|
||||
tar -C codesignatures -xf "$CODESIGNATURE_GIT_ARCHIVE"
|
||||
|
||||
case "$HOST" in
|
||||
*mingw*)
|
||||
find "$PWD" -name "*-unsigned.exe" | while read -r infile; do
|
||||
infile_base="$(basename "$infile")"
|
||||
|
||||
# Codesigned *-unsigned.exe and output to OUTDIR
|
||||
# Apply detached codesignatures
|
||||
WORKDIR=".tmp"
|
||||
mkdir -p ${WORKDIR}
|
||||
cp -r --target-directory="${WORKDIR}" "unsigned/${DISTNAME}"
|
||||
find "${WORKDIR}/${DISTNAME}" -name "*.exe" -type f -exec rm {} \;
|
||||
find unsigned/ -name "*.exe" -type f | while read -r bin
|
||||
do
|
||||
bin_base="$(realpath --relative-to=unsigned/ "${bin}")"
|
||||
mkdir -p "${WORKDIR}/$(dirname "${bin_base}")"
|
||||
osslsigncode attach-signature \
|
||||
-in "$infile" \
|
||||
-out "${OUTDIR}/${infile_base/-unsigned}" \
|
||||
-in "${bin}" \
|
||||
-out "${WORKDIR}/${bin_base/-unsigned}" \
|
||||
-CAfile "$GUIX_ENVIRONMENT/etc/ssl/certs/ca-certificates.crt" \
|
||||
-sigin codesignatures/win/"$infile_base".pem
|
||||
-sigin codesignatures/win/"${bin_base}".pem
|
||||
done
|
||||
|
||||
# Move installer to outdir
|
||||
cd "${WORKDIR}"
|
||||
find . -name "*setup.exe" -print0 \
|
||||
| xargs -0r mv --target-directory="${OUTDIR}"
|
||||
|
||||
# Make .zip from binaries
|
||||
find "${DISTNAME}" -print0 \
|
||||
| xargs -0r touch --no-dereference --date="@${SOURCE_DATE_EPOCH}"
|
||||
find "${DISTNAME}" \
|
||||
| sort \
|
||||
| zip -X@ "${OUTDIR}/${DISTNAME}-${HOST//x86_64-w64-mingw32/win64}.zip" \
|
||||
|| ( rm -f "${OUTDIR}/${DISTNAME}-${HOST//x86_64-w64-mingw32/win64}.zip" && exit 1 )
|
||||
;;
|
||||
*darwin*)
|
||||
# Apply detached codesignatures to dist/ (in-place)
|
||||
signapple apply dist/Bitcoin-Qt.app codesignatures/osx/dist
|
||||
case "$HOST" in
|
||||
arm64*) ARCH="arm64" ;;
|
||||
x86_64*) ARCH="x86_64" ;;
|
||||
esac
|
||||
|
||||
# Apply detached codesignatures (in-place)
|
||||
signapple apply dist/Bitcoin-Qt.app codesignatures/osx/"${HOST}"/dist/Bitcoin-Qt.app
|
||||
find "${DISTNAME}" -wholename "*/bin/*" -type f | while read -r bin
|
||||
do
|
||||
signapple apply "${bin}" "codesignatures/osx/${HOST}/${bin}.${ARCH}sign"
|
||||
done
|
||||
|
||||
# Make a .zip from dist/
|
||||
cd dist/
|
||||
@@ -91,6 +121,14 @@ mkdir -p "$DISTSRC"
|
||||
| xargs -0r touch --no-dereference --date="@${SOURCE_DATE_EPOCH}"
|
||||
find . | sort \
|
||||
| zip -X@ "${OUTDIR}/${DISTNAME}-${HOST}.zip"
|
||||
cd ..
|
||||
|
||||
# Make a .tar.gz from bins
|
||||
find "${DISTNAME}" -print0 \
|
||||
| sort --zero-terminated \
|
||||
| tar --create --no-recursion --mode='u+rw,go+r-w,a+X' --null --files-from=- \
|
||||
| gzip -9n > "${OUTDIR}/${DISTNAME}-${HOST}.tar.gz" \
|
||||
|| ( rm -f "${OUTDIR}/${DISTNAME}-${HOST}.tar.gz" && exit 1 )
|
||||
;;
|
||||
*)
|
||||
exit 1
|
||||
@@ -105,7 +143,7 @@ mv --no-target-directory "$OUTDIR" "$ACTUAL_OUTDIR" \
|
||||
(
|
||||
cd /outdir-base
|
||||
{
|
||||
echo "$UNSIGNED_TARBALL"
|
||||
echo "$CODESIGNING_TARBALL"
|
||||
echo "$CODESIGNATURE_GIT_ARCHIVE"
|
||||
find "$ACTUAL_OUTDIR" -type f
|
||||
} | xargs realpath --relative-base="$PWD" \
|
||||
|
||||
@@ -50,7 +50,7 @@ fi
|
||||
# across time.
|
||||
time-machine() {
|
||||
# shellcheck disable=SC2086
|
||||
guix time-machine --url=https://git.savannah.gnu.org/git/guix.git \
|
||||
guix time-machine --url=https://codeberg.org/guix/guix.git \
|
||||
--commit=7bf1d7aeaffba15c4f680f93ae88fbef25427252 \
|
||||
--cores="$JOBS" \
|
||||
--keep-failed \
|
||||
|
||||
@@ -17,13 +17,14 @@
|
||||
(gnu packages moreutils)
|
||||
(gnu packages pkg-config)
|
||||
((gnu packages python) #:select (python-minimal))
|
||||
((gnu packages python-build) #:select (python-tomli))
|
||||
((gnu packages python-build) #:select (python-tomli python-poetry-core))
|
||||
((gnu packages python-crypto) #:select (python-asn1crypto))
|
||||
((gnu packages tls) #:select (openssl))
|
||||
((gnu packages version-control) #:select (git-minimal))
|
||||
(guix build-system cmake)
|
||||
(guix build-system gnu)
|
||||
(guix build-system python)
|
||||
(guix build-system pyproject)
|
||||
(guix build-system trivial)
|
||||
(guix download)
|
||||
(guix gexp)
|
||||
@@ -393,10 +394,10 @@ specific moment in time, whitelisting and revocation checks.")
|
||||
(license license:expat))))
|
||||
|
||||
(define-public python-signapple
|
||||
(let ((commit "62155712e7417aba07565c9780a80e452823ae6a"))
|
||||
(let ((commit "85bfcecc33d2773bc09bc318cec0614af2c8e287"))
|
||||
(package
|
||||
(name "python-signapple")
|
||||
(version (git-version "0.1" "1" commit))
|
||||
(version (git-version "0.2.0" "1" commit))
|
||||
(source
|
||||
(origin
|
||||
(method git-fetch)
|
||||
@@ -406,13 +407,14 @@ specific moment in time, whitelisting and revocation checks.")
|
||||
(file-name (git-file-name name commit))
|
||||
(sha256
|
||||
(base32
|
||||
"1nm6rm4h4m7kbq729si4cm8rzild62mk4ni8xr5zja7l33fhv3gb"))))
|
||||
(build-system python-build-system)
|
||||
"17yqjll8nw83q6dhgqhkl7w502z5vy9sln8m6mlx0f1c10isg8yg"))))
|
||||
(build-system pyproject-build-system)
|
||||
(propagated-inputs
|
||||
(list python-asn1crypto
|
||||
python-oscrypto
|
||||
python-certvalidator
|
||||
python-elfesteem))
|
||||
(native-inputs (list python-poetry-core))
|
||||
;; There are no tests, but attempting to run python setup.py test leads to
|
||||
;; problems, just disable the test
|
||||
(arguments '(#:tests? #f))
|
||||
|
||||
@@ -6,26 +6,57 @@
|
||||
export LC_ALL=C
|
||||
set -e
|
||||
|
||||
ROOTDIR=dist
|
||||
BUNDLE="${ROOTDIR}/Bitcoin-Qt.app"
|
||||
BINARY="${BUNDLE}/Contents/MacOS/Bitcoin-Qt"
|
||||
SIGNAPPLE=signapple
|
||||
TEMPDIR=sign.temp
|
||||
ARCH=$(${SIGNAPPLE} info ${BINARY} | head -n 1 | cut -d " " -f 1)
|
||||
OUT="signature-osx-${ARCH}.tar.gz"
|
||||
OUTROOT=osx/dist
|
||||
|
||||
if [ -z "$1" ]; then
|
||||
echo "usage: $0 <signapple args>"
|
||||
echo "example: $0 <path to key>"
|
||||
BUNDLE_ROOT=dist
|
||||
BUNDLE_NAME="Bitcoin-Qt.app"
|
||||
UNSIGNED_BUNDLE="${BUNDLE_ROOT}/${BUNDLE_NAME}"
|
||||
UNSIGNED_BINARY="${UNSIGNED_BUNDLE}/Contents/MacOS/Bitcoin-Qt"
|
||||
|
||||
ARCH=$(${SIGNAPPLE} info ${UNSIGNED_BINARY} | head -n 1 | cut -d " " -f 1)
|
||||
|
||||
OUTDIR="osx/${ARCH}-apple-darwin"
|
||||
OUTROOT="${TEMPDIR}/${OUTDIR}"
|
||||
|
||||
OUT="signature-osx-${ARCH}.tar.gz"
|
||||
|
||||
if [ "$#" -ne 3 ]; then
|
||||
echo "usage: $0 <path to key> <path to app store connect key> <apple developer team uuid>"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
rm -rf ${TEMPDIR}
|
||||
mkdir -p ${TEMPDIR}
|
||||
|
||||
${SIGNAPPLE} sign -f --detach "${TEMPDIR}/${OUTROOT}" "$@" "${BUNDLE}" --hardened-runtime
|
||||
stty -echo
|
||||
printf "Enter the passphrase for %s: " "$1"
|
||||
read cs_key_pass
|
||||
printf "\n"
|
||||
printf "Enter the passphrase for %s: " "$2"
|
||||
read api_key_pass
|
||||
printf "\n"
|
||||
stty echo
|
||||
|
||||
tar -C "${TEMPDIR}" -czf "${OUT}" .
|
||||
# Sign and notarize app bundle
|
||||
${SIGNAPPLE} sign -f --hardened-runtime --detach "${OUTROOT}/${BUNDLE_ROOT}" --passphrase "${cs_key_pass}" "$1" "${UNSIGNED_BUNDLE}"
|
||||
${SIGNAPPLE} apply "${UNSIGNED_BUNDLE}" "${OUTROOT}/${BUNDLE_ROOT}/${BUNDLE_NAME}"
|
||||
${SIGNAPPLE} notarize --detach "${OUTROOT}/${BUNDLE_ROOT}" --passphrase "${api_key_pass}" "$2" "$3" "${UNSIGNED_BUNDLE}"
|
||||
|
||||
# Sign each binary
|
||||
find . -maxdepth 3 -wholename "*/bin/*" -type f -exec realpath --relative-to=. {} \; | while read -r bin
|
||||
do
|
||||
bin_dir=$(dirname "${bin}")
|
||||
bin_name=$(basename "${bin}")
|
||||
${SIGNAPPLE} sign -f --hardened-runtime --detach "${OUTROOT}/${bin_dir}" --passphrase "${cs_key_pass}" "$1" "${bin}"
|
||||
${SIGNAPPLE} apply "${bin}" "${OUTROOT}/${bin_dir}/${bin_name}.${ARCH}sign"
|
||||
done
|
||||
|
||||
# Notarize the binaries
|
||||
# Binaries cannot have stapled notarizations so this does not actually generate any output
|
||||
binaries_dir=$(dirname "$(find . -maxdepth 2 -wholename '*/bin' -type d -exec realpath --relative-to=. {} \;)")
|
||||
${SIGNAPPLE} notarize --passphrase "${api_key_pass}" "$2" "$3" "${binaries_dir}"
|
||||
|
||||
tar -C "${TEMPDIR}" -czf "${OUT}" "${OUTDIR}"
|
||||
rm -rf "${TEMPDIR}"
|
||||
echo "Created ${OUT}"
|
||||
|
||||
@@ -41,7 +41,8 @@ from bcc import BPF, USDT
|
||||
program = """
|
||||
#include <uapi/linux/ptrace.h>
|
||||
|
||||
#define MIN(a,b) ({ __typeof__ (a) _a = (a); __typeof__ (b) _b = (b); _a < _b ? _a : _b; })
|
||||
// A min() macro. Prefixed with _TRACEPOINT_TEST to avoid collision with other MIN macros.
|
||||
#define _TRACEPOINT_TEST_MIN(a,b) ({ __typeof__ (a) _a = (a); __typeof__ (b) _b = (b); _a < _b ? _a : _b; })
|
||||
|
||||
// Maximum possible allocation size
|
||||
// from include/linux/percpu.h in the Linux kernel
|
||||
@@ -88,7 +89,7 @@ int trace_inbound_message(struct pt_regs *ctx) {
|
||||
bpf_usdt_readarg_p(3, ctx, &msg->peer_conn_type, MAX_PEER_CONN_TYPE_LENGTH);
|
||||
bpf_usdt_readarg_p(4, ctx, &msg->msg_type, MAX_MSG_TYPE_LENGTH);
|
||||
bpf_usdt_readarg(5, ctx, &msg->msg_size);
|
||||
bpf_usdt_readarg_p(6, ctx, &msg->msg, MIN(msg->msg_size, MAX_MSG_DATA_LENGTH));
|
||||
bpf_usdt_readarg_p(6, ctx, &msg->msg, _TRACEPOINT_TEST_MIN(msg->msg_size, MAX_MSG_DATA_LENGTH));
|
||||
|
||||
inbound_messages.perf_submit(ctx, msg, sizeof(*msg));
|
||||
return 0;
|
||||
@@ -108,7 +109,7 @@ int trace_outbound_message(struct pt_regs *ctx) {
|
||||
bpf_usdt_readarg_p(3, ctx, &msg->peer_conn_type, MAX_PEER_CONN_TYPE_LENGTH);
|
||||
bpf_usdt_readarg_p(4, ctx, &msg->msg_type, MAX_MSG_TYPE_LENGTH);
|
||||
bpf_usdt_readarg(5, ctx, &msg->msg_size);
|
||||
bpf_usdt_readarg_p(6, ctx, &msg->msg, MIN(msg->msg_size, MAX_MSG_DATA_LENGTH));
|
||||
bpf_usdt_readarg_p(6, ctx, &msg->msg, _TRACEPOINT_TEST_MIN(msg->msg_size, MAX_MSG_DATA_LENGTH));
|
||||
|
||||
outbound_messages.perf_submit(ctx, msg, sizeof(*msg));
|
||||
return 0;
|
||||
|
||||
@@ -8,9 +8,9 @@ if [ -z "$OSSLSIGNCODE" ]; then
|
||||
OSSLSIGNCODE=osslsigncode
|
||||
fi
|
||||
|
||||
if [ -z "$1" ]; then
|
||||
echo "usage: $0 <osslcodesign args>"
|
||||
echo "example: $0 -key codesign.key"
|
||||
if [ "$#" -ne 1 ]; then
|
||||
echo "usage: $0 <path to key>"
|
||||
echo "example: $0 codesign.key"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
@@ -22,12 +22,22 @@ OUTSUBDIR="${OUTDIR}/win"
|
||||
TIMESERVER=http://timestamp.comodoca.com
|
||||
CERTFILE="win-codesign.cert"
|
||||
|
||||
stty -echo
|
||||
printf "Enter the passphrase for %s: " "$1"
|
||||
read cs_key_pass
|
||||
printf "\n"
|
||||
stty echo
|
||||
|
||||
|
||||
mkdir -p "${OUTSUBDIR}"
|
||||
# shellcheck disable=SC2046
|
||||
basename -a $(ls -1 "${SRCDIR}"/*-unsigned.exe) | while read UNSIGNED; do
|
||||
echo Signing "${UNSIGNED}"
|
||||
"${OSSLSIGNCODE}" sign -certs "${CERTFILE}" -t "${TIMESERVER}" -h sha256 -in "${SRCDIR}/${UNSIGNED}" -out "${WORKDIR}/${UNSIGNED}" "$@"
|
||||
"${OSSLSIGNCODE}" extract-signature -pem -in "${WORKDIR}/${UNSIGNED}" -out "${OUTSUBDIR}/${UNSIGNED}.pem" && rm "${WORKDIR}/${UNSIGNED}"
|
||||
find ${SRCDIR} -wholename "*.exe" -type f -exec realpath --relative-to=. {} \; | while read -r bin
|
||||
do
|
||||
echo Signing "${bin}"
|
||||
bin_base="$(realpath --relative-to=${SRCDIR} "${bin}")"
|
||||
mkdir -p "$(dirname ${WORKDIR}/"${bin_base}")"
|
||||
"${OSSLSIGNCODE}" sign -certs "${CERTFILE}" -t "${TIMESERVER}" -h sha256 -in "${bin}" -out "${WORKDIR}/${bin_base}" -key "$1" -pass "${cs_key_pass}"
|
||||
mkdir -p "$(dirname ${OUTSUBDIR}/"${bin_base}")"
|
||||
"${OSSLSIGNCODE}" extract-signature -pem -in "${WORKDIR}/${bin_base}" -out "${OUTSUBDIR}/${bin_base}.pem" && rm "${WORKDIR}/${bin_base}"
|
||||
done
|
||||
|
||||
rm -f "${OUT}"
|
||||
|
||||
@@ -143,7 +143,7 @@ include packages/packages.mk
|
||||
# 2. Before including packages/*.mk (excluding packages/packages.mk), since
|
||||
# they rely on the build_id variables
|
||||
#
|
||||
build_id:=$(shell env CC='$(build_CC)' C_STANDARD='$(C_STANDARD)' CXX='$(build_CXX)' CXX_STANDARD='$(CXX_STANDARD)' AR='$(build_AR) 'NM='$(build_NM)' RANLIB='$(build_RANLIB)' STRIP='$(build_STRIP)' SHA256SUM='$(build_SHA256SUM)' DEBUG='$(DEBUG)' LTO='$(LTO)' NO_HARDEN='$(NO_HARDEN)' ./gen_id '$(BUILD_ID_SALT)' 'GUIX_ENVIRONMENT=$(realpath $(GUIX_ENVIRONMENT))')
|
||||
build_id:=$(shell env CC='$(build_CC)' C_STANDARD='$(C_STANDARD)' CXX='$(build_CXX)' CXX_STANDARD='$(CXX_STANDARD)' AR='$(build_AR)' NM='$(build_NM)' RANLIB='$(build_RANLIB)' STRIP='$(build_STRIP)' SHA256SUM='$(build_SHA256SUM)' DEBUG='$(DEBUG)' LTO='$(LTO)' NO_HARDEN='$(NO_HARDEN)' ./gen_id '$(BUILD_ID_SALT)' 'GUIX_ENVIRONMENT=$(realpath $(GUIX_ENVIRONMENT))')
|
||||
$(host_arch)_$(host_os)_id:=$(shell env CC='$(host_CC)' C_STANDARD='$(C_STANDARD)' CXX='$(host_CXX)' CXX_STANDARD='$(CXX_STANDARD)' AR='$(host_AR)' NM='$(host_NM)' RANLIB='$(host_RANLIB)' STRIP='$(host_STRIP)' SHA256SUM='$(build_SHA256SUM)' DEBUG='$(DEBUG)' LTO='$(LTO)' NO_HARDEN='$(NO_HARDEN)' ./gen_id '$(HOST_ID_SALT)' 'GUIX_ENVIRONMENT=$(realpath $(GUIX_ENVIRONMENT))')
|
||||
|
||||
boost_packages_$(NO_BOOST) = $(boost_packages)
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
ifneq ($(shell $(SHELL) $(.SHELLFLAGS) "command -v $(host)-gcc-posix"),)
|
||||
mingw32_CC := $(host)-gcc-posix
|
||||
endif
|
||||
ifneq ($(shell $(SHELL) $(.SHELLFLAGS) "command -v $(host)-g++-posix"),)
|
||||
mingw32_CXX := $(host)-g++-posix
|
||||
endif
|
||||
|
||||
@@ -7,8 +7,6 @@ netbsd_NM = $(host_toolchain)gcc-nm
|
||||
netbsd_RANLIB = $(host_toolchain)gcc-ranlib
|
||||
endif
|
||||
|
||||
netbsd_CXXFLAGS=$(netbsd_CFLAGS)
|
||||
|
||||
netbsd_release_CFLAGS=-O2
|
||||
netbsd_release_CXXFLAGS=$(netbsd_release_CFLAGS)
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ $(package)_download_file=$(native_$(package)_download_file)
|
||||
$(package)_file_name=$(native_$(package)_file_name)
|
||||
$(package)_sha256_hash=$(native_$(package)_sha256_hash)
|
||||
|
||||
define $(package)_set_vars :=
|
||||
define $(package)_set_vars
|
||||
$(package)_config_opts := -DBUILD_TESTING=OFF
|
||||
$(package)_config_opts += -DWITH_OPENSSL=OFF
|
||||
$(package)_config_opts += -DWITH_ZLIB=OFF
|
||||
|
||||
@@ -4,6 +4,7 @@ $(package)_download_path=https://download.savannah.gnu.org/releases/$(package)
|
||||
$(package)_file_name=$(package)-$($(package)_version).tar.xz
|
||||
$(package)_sha256_hash=8bee39bd3968c4804b70614a0a3ad597299ad0e824bc8aad5ce8aaf48067bde7
|
||||
$(package)_build_subdir=build
|
||||
$(package)_patches += cmake_minimum.patch
|
||||
|
||||
define $(package)_set_vars
|
||||
$(package)_config_opts := -DCMAKE_BUILD_TYPE=None -DBUILD_SHARED_LIBS=TRUE
|
||||
@@ -12,6 +13,10 @@ define $(package)_set_vars
|
||||
$(package)_config_opts += -DCMAKE_DISABLE_FIND_PACKAGE_BrotliDec=TRUE
|
||||
endef
|
||||
|
||||
define $(package)_preprocess_cmds
|
||||
patch -p1 < $($(package)_patch_dir)/cmake_minimum.patch
|
||||
endef
|
||||
|
||||
define $(package)_config_cmds
|
||||
$($(package)_cmake) -S .. -B .
|
||||
endef
|
||||
|
||||
@@ -5,6 +5,7 @@ $(package)_file_name=$(package)-$($(package)_version).tar.gz
|
||||
$(package)_sha256_hash=92e6de1be9ec176428fd2367677e61ceffc2ee1cb119035037a27d346b0403bb
|
||||
$(package)_patches=cmake_fixups.patch
|
||||
$(package)_patches+=fix_mingw_link.patch
|
||||
$(package)_patches += netbsd_fixup.patch
|
||||
$(package)_build_subdir=build
|
||||
|
||||
# When building for Windows, we set _WIN32_WINNT to target the same Windows
|
||||
@@ -24,7 +25,8 @@ endef
|
||||
|
||||
define $(package)_preprocess_cmds
|
||||
patch -p1 < $($(package)_patch_dir)/cmake_fixups.patch && \
|
||||
patch -p1 < $($(package)_patch_dir)/fix_mingw_link.patch
|
||||
patch -p1 < $($(package)_patch_dir)/fix_mingw_link.patch && \
|
||||
patch -p1 < $($(package)_patch_dir)/netbsd_fixup.patch
|
||||
endef
|
||||
|
||||
define $(package)_config_cmds
|
||||
|
||||
@@ -8,7 +8,7 @@ ifneq ($(host),$(build))
|
||||
$(package)_dependencies += native_capnp
|
||||
endif
|
||||
|
||||
define $(package)_set_vars :=
|
||||
define $(package)_set_vars
|
||||
ifneq ($(host),$(build))
|
||||
$(package)_config_opts := -DCAPNP_EXECUTABLE="$$(native_capnp_prefixbin)/capnp"
|
||||
$(package)_config_opts += -DCAPNPC_CXX_EXECUTABLE="$$(native_capnp_prefixbin)/capnpc-c++"
|
||||
|
||||
@@ -21,6 +21,8 @@ define $(package)_build_cmds
|
||||
$(MAKE)
|
||||
endef
|
||||
|
||||
# mkdir detection is broken on Alpine. Set MKDIRPROG to ensure we always
|
||||
# use "mkdir -p", and avoid parallelism issues during install.
|
||||
define $(package)_stage_cmds
|
||||
$(MAKE) DESTDIR=$($(package)_staging_dir) install
|
||||
$(MAKE) MKDIRPROG="mkdir -p" DESTDIR=$($(package)_staging_dir) install
|
||||
endef
|
||||
|
||||
13
depends/patches/freetype/cmake_minimum.patch
Normal file
13
depends/patches/freetype/cmake_minimum.patch
Normal file
@@ -0,0 +1,13 @@
|
||||
build: set minimum required CMake to 3.12
|
||||
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -97,7 +97,7 @@
|
||||
# FreeType explicitly marks the API to be exported and relies on the compiler
|
||||
# to hide all other symbols. CMake supports a C_VISBILITY_PRESET property
|
||||
# starting with 2.8.12.
|
||||
-cmake_minimum_required(VERSION 2.8.12)
|
||||
+cmake_minimum_required(VERSION 3.12)
|
||||
|
||||
if (NOT CMAKE_VERSION VERSION_LESS 3.3)
|
||||
# Allow symbol visibility settings also on static libraries. CMake < 3.3
|
||||
23
depends/patches/libevent/netbsd_fixup.patch
Normal file
23
depends/patches/libevent/netbsd_fixup.patch
Normal file
@@ -0,0 +1,23 @@
|
||||
Improve portability on NetBSD
|
||||
|
||||
According to GCC documentation, "the various `-std` options disable
|
||||
certain keywords".
|
||||
This change adheres to GCC's recommendation by replacing the `typeof`
|
||||
keyword with its alternative, `__typeof__`.
|
||||
|
||||
See https://github.com/libevent/libevent/commit/1759485e9a59147a47a674f5132fcfe764e7748c.
|
||||
|
||||
|
||||
--- a/kqueue.c
|
||||
+++ b/kqueue.c
|
||||
@@ -52,8 +52,8 @@
|
||||
* intptr_t, whereas others define it as void*. There doesn't seem to be an
|
||||
* easy way to tell them apart via autoconf, so we need to use OS macros. */
|
||||
#if defined(__NetBSD__)
|
||||
-#define PTR_TO_UDATA(x) ((typeof(((struct kevent *)0)->udata))(x))
|
||||
-#define INT_TO_UDATA(x) ((typeof(((struct kevent *)0)->udata))(intptr_t)(x))
|
||||
+#define PTR_TO_UDATA(x) ((__typeof__(((struct kevent *)0)->udata))(x))
|
||||
+#define INT_TO_UDATA(x) ((__typeof__(((struct kevent *)0)->udata))(intptr_t)(x))
|
||||
#elif defined(EVENT__HAVE_INTTYPES_H) && !defined(__OpenBSD__) && !defined(__FreeBSD__) && !defined(__darwin__) && !defined(__APPLE__) && !defined(__CloudABI__)
|
||||
#define PTR_TO_UDATA(x) ((intptr_t)(x))
|
||||
#define INT_TO_UDATA(x) ((intptr_t)(x))
|
||||
@@ -31,7 +31,7 @@ Comments may appear in two ways:
|
||||
### Network specific options
|
||||
|
||||
Network specific options can be:
|
||||
- placed into sections with headers `[main]` (not `[mainnet]`), `[test]` (not `[testnet]`), `[signet]` or `[regtest]`;
|
||||
- placed into sections with headers `[main]` (not `[mainnet]`), `[test]` (not `[testnet]`, for testnet3), `[testnet4]`, `[signet]` or `[regtest]`;
|
||||
- prefixed with a chain name; e.g., `regtest.maxmempool=100`.
|
||||
|
||||
Network specific options take precedence over non-network specific options.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3.
|
||||
.TH BITCOIN-CLI "1" "September 2024" "bitcoin-cli v28.0.0" "User Commands"
|
||||
.TH BITCOIN-CLI "1" "June 2025" "bitcoin-cli v28.2.0" "User Commands"
|
||||
.SH NAME
|
||||
bitcoin-cli \- manual page for bitcoin-cli v28.0.0
|
||||
bitcoin-cli \- manual page for bitcoin-cli v28.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 v28.0.0
|
||||
.B bitcoin-cli
|
||||
[\fI\,options\/\fR] \fI\,help <command> Get help for a command\/\fR
|
||||
.SH DESCRIPTION
|
||||
Bitcoin Core RPC client version v28.0.0
|
||||
Bitcoin Core RPC client version v28.2.0
|
||||
.SH OPTIONS
|
||||
.HP
|
||||
\-?
|
||||
@@ -176,7 +176,7 @@ Consider moving to testnet4 now by using \fB\-testnet4\fR.
|
||||
.IP
|
||||
Use the testnet4 chain. Equivalent to \fB\-chain\fR=\fI\,testnet4\/\fR.
|
||||
.SH COPYRIGHT
|
||||
Copyright (C) 2009-2024 The Bitcoin Core developers
|
||||
Copyright (C) 2009-2025 The Bitcoin Core developers
|
||||
|
||||
Please contribute if you find Bitcoin Core useful. Visit
|
||||
<https://bitcoincore.org/> for further information about the software.
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3.
|
||||
.TH BITCOIN-QT "1" "September 2024" "bitcoin-qt v28.0.0" "User Commands"
|
||||
.TH BITCOIN-QT "1" "June 2025" "bitcoin-qt v28.2.0" "User Commands"
|
||||
.SH NAME
|
||||
bitcoin-qt \- manual page for bitcoin-qt v28.0.0
|
||||
bitcoin-qt \- manual page for bitcoin-qt v28.2.0
|
||||
.SH SYNOPSIS
|
||||
.B bitcoin-qt
|
||||
[\fI\,command-line options\/\fR] [\fI\,URI\/\fR]
|
||||
.SH DESCRIPTION
|
||||
Bitcoin Core version v28.0.0
|
||||
Bitcoin Core version v28.2.0
|
||||
.PP
|
||||
Optional URI is a Bitcoin address in BIP21 URI format.
|
||||
.SH OPTIONS
|
||||
@@ -352,7 +352,8 @@ Support filtering of blocks and transaction with bloom filters (default:
|
||||
.IP
|
||||
Listen for connections on <port> (default: 8333, testnet3: 18333,
|
||||
testnet4: 48333, signet: 38333, regtest: 18444). Not relevant for
|
||||
I2P (see doc/i2p.md).
|
||||
I2P (see doc/i2p.md). If set to a value x, the default onion
|
||||
listening port will be set to x+1.
|
||||
.HP
|
||||
\fB\-proxy=\fR<ip:port|path>
|
||||
.IP
|
||||
@@ -835,7 +836,7 @@ Reset all settings changed in the GUI
|
||||
.IP
|
||||
Show splash screen on startup (default: 1)
|
||||
.SH COPYRIGHT
|
||||
Copyright (C) 2009-2024 The Bitcoin Core developers
|
||||
Copyright (C) 2009-2025 The Bitcoin Core developers
|
||||
|
||||
Please contribute if you find Bitcoin Core useful. Visit
|
||||
<https://bitcoincore.org/> for further information about the software.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3.
|
||||
.TH BITCOIN-TX "1" "September 2024" "bitcoin-tx v28.0.0" "User Commands"
|
||||
.TH BITCOIN-TX "1" "June 2025" "bitcoin-tx v28.2.0" "User Commands"
|
||||
.SH NAME
|
||||
bitcoin-tx \- manual page for bitcoin-tx v28.0.0
|
||||
bitcoin-tx \- manual page for bitcoin-tx v28.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 v28.0.0
|
||||
.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 v28.0.0
|
||||
Bitcoin Core bitcoin\-tx utility version v28.2.0
|
||||
.SH OPTIONS
|
||||
.HP
|
||||
\-?
|
||||
@@ -142,7 +142,7 @@ set=NAME:JSON\-STRING
|
||||
.IP
|
||||
Set register NAME to given JSON\-STRING
|
||||
.SH COPYRIGHT
|
||||
Copyright (C) 2009-2024 The Bitcoin Core developers
|
||||
Copyright (C) 2009-2025 The Bitcoin Core developers
|
||||
|
||||
Please contribute if you find Bitcoin Core useful. Visit
|
||||
<https://bitcoincore.org/> for further information about the software.
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3.
|
||||
.TH BITCOIN-UTIL "1" "September 2024" "bitcoin-util v28.0.0" "User Commands"
|
||||
.TH BITCOIN-UTIL "1" "June 2025" "bitcoin-util v28.2.0" "User Commands"
|
||||
.SH NAME
|
||||
bitcoin-util \- manual page for bitcoin-util v28.0.0
|
||||
bitcoin-util \- manual page for bitcoin-util v28.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 v28.0.0
|
||||
Bitcoin Core bitcoin\-util utility version v28.2.0
|
||||
.SH OPTIONS
|
||||
.HP
|
||||
\-?
|
||||
@@ -60,7 +60,7 @@ grind
|
||||
.IP
|
||||
Perform proof of work on hex header string
|
||||
.SH COPYRIGHT
|
||||
Copyright (C) 2009-2024 The Bitcoin Core developers
|
||||
Copyright (C) 2009-2025 The Bitcoin Core developers
|
||||
|
||||
Please contribute if you find Bitcoin Core useful. Visit
|
||||
<https://bitcoincore.org/> for further information about the software.
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3.
|
||||
.TH BITCOIN-WALLET "1" "September 2024" "bitcoin-wallet v28.0.0" "User Commands"
|
||||
.TH BITCOIN-WALLET "1" "June 2025" "bitcoin-wallet v28.2.0" "User Commands"
|
||||
.SH NAME
|
||||
bitcoin-wallet \- manual page for bitcoin-wallet v28.0.0
|
||||
bitcoin-wallet \- manual page for bitcoin-wallet v28.2.0
|
||||
.SH DESCRIPTION
|
||||
Bitcoin Core bitcoin\-wallet version v28.0.0
|
||||
Bitcoin Core bitcoin\-wallet version v28.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.
|
||||
@@ -121,7 +121,7 @@ salvage
|
||||
Attempt to recover private keys from a corrupt wallet. Warning:
|
||||
\&'salvage' is experimental.
|
||||
.SH COPYRIGHT
|
||||
Copyright (C) 2009-2024 The Bitcoin Core developers
|
||||
Copyright (C) 2009-2025 The Bitcoin Core developers
|
||||
|
||||
Please contribute if you find Bitcoin Core useful. Visit
|
||||
<https://bitcoincore.org/> for further information about the software.
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3.
|
||||
.TH BITCOIND "1" "September 2024" "bitcoind v28.0.0" "User Commands"
|
||||
.TH BITCOIND "1" "June 2025" "bitcoind v28.2.0" "User Commands"
|
||||
.SH NAME
|
||||
bitcoind \- manual page for bitcoind v28.0.0
|
||||
bitcoind \- manual page for bitcoind v28.2.0
|
||||
.SH SYNOPSIS
|
||||
.B bitcoind
|
||||
[\fI\,options\/\fR] \fI\,Start Bitcoin Core\/\fR
|
||||
.SH DESCRIPTION
|
||||
Bitcoin Core version v28.0.0
|
||||
Bitcoin Core version v28.2.0
|
||||
.SH OPTIONS
|
||||
.HP
|
||||
\-?
|
||||
@@ -350,7 +350,8 @@ Support filtering of blocks and transaction with bloom filters (default:
|
||||
.IP
|
||||
Listen for connections on <port> (default: 8333, testnet3: 18333,
|
||||
testnet4: 48333, signet: 38333, regtest: 18444). Not relevant for
|
||||
I2P (see doc/i2p.md).
|
||||
I2P (see doc/i2p.md). If set to a value x, the default onion
|
||||
listening port will be set to x+1.
|
||||
.HP
|
||||
\fB\-proxy=\fR<ip:port|path>
|
||||
.IP
|
||||
@@ -811,7 +812,7 @@ subject to empty whitelists.
|
||||
.IP
|
||||
Accept command line and JSON\-RPC commands
|
||||
.SH COPYRIGHT
|
||||
Copyright (C) 2009-2024 The Bitcoin Core developers
|
||||
Copyright (C) 2009-2025 The Bitcoin Core developers
|
||||
|
||||
Please contribute if you find Bitcoin Core useful. Visit
|
||||
<https://bitcoincore.org/> for further information about the software.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
Bitcoin Core version 28.0 is now available from:
|
||||
Bitcoin Core version 28.2 is now available from:
|
||||
|
||||
<https://bitcoincore.org/bin/bitcoin-core-28.0/>
|
||||
<https://bitcoincore.org/bin/bitcoin-core-28.2/>
|
||||
|
||||
This release includes new features, various bug fixes and performance
|
||||
improvements, as well as updated translations.
|
||||
@@ -25,335 +25,59 @@ 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.
|
||||
|
||||
Running bitcoin core binaries on macOS requires self signing.
|
||||
```
|
||||
cd /path/to/bitcoin-core/bin
|
||||
xattr -d com.apple.quarantine bitcoin-cli bitcoin-qt bitcoin-tx bitcoin-util bitcoin-wallet bitcoind test_bitcoin
|
||||
codesign -s - bitcoin-cli bitcoin-qt bitcoin-tx bitcoin-util bitcoin-wallet bitcoind test_bitcoin
|
||||
```
|
||||
|
||||
Compatibility
|
||||
==============
|
||||
|
||||
Bitcoin Core is supported and extensively tested on operating systems
|
||||
using the Linux Kernel 3.17+, macOS 11.0+, and Windows 7 and newer. Bitcoin
|
||||
Core should also work on most other Unix-like systems but is not as
|
||||
Core should also work on most other UNIX-like systems but is not as
|
||||
frequently tested on them. It is not recommended to use Bitcoin Core on
|
||||
unsupported systems.
|
||||
|
||||
Notable changes
|
||||
===============
|
||||
|
||||
Testnet4/BIP94 support
|
||||
-----
|
||||
### Build
|
||||
|
||||
Support for Testnet4 as specified in [BIP94](https://github.com/bitcoin/bips/blob/master/bip-0094.mediawiki)
|
||||
has been added. The network can be selected with the `-testnet4` option and
|
||||
the section header is also named `[testnet4]`.
|
||||
- #31407 guix: Notarize MacOS app bundle and codesign all MacOS and Windows binaries
|
||||
- #31500 depends: Fix compiling libevent package on NetBSD
|
||||
- #31627 depends: Fix spacing issue
|
||||
- #32070 build: use make < 3.82 syntax for define directive
|
||||
- #32439 guix: accomodate migration to codeberg
|
||||
- #32568 depends: use "mkdir -p" when installing xproto
|
||||
- #32693 depends: fix cmake compatibility error for freetype
|
||||
|
||||
While the intention is to phase out support for Testnet3 in an upcoming
|
||||
version, support for it is still available via the known options in this
|
||||
release.
|
||||
### Test
|
||||
|
||||
Windows Data Directory
|
||||
----------------------
|
||||
- #32286 test: Handle empty string returned by CLI as None in RPC tests
|
||||
- #32336 test: Suppress upstream -Wduplicate-decl-specifier in bpfcc
|
||||
|
||||
The default data directory on Windows has been moved from `C:\Users\Username\AppData\Roaming\Bitcoin`
|
||||
to `C:\Users\Username\AppData\Local\Bitcoin`. Bitcoin Core will check the existence
|
||||
of the old directory first and continue to use that directory for backwards
|
||||
compatibility if it is present. (#27064)
|
||||
### Tracing
|
||||
|
||||
P2P and network changes
|
||||
-----------------------
|
||||
- #31623 tracing: Rename the MIN macro to TRACEPOINT_TEST_MIN in log_raw_p2p_msgs
|
||||
|
||||
- Previously if Bitcoin Core was listening for P2P connections, either using
|
||||
default settings or via `bind=addr:port` it would always also bind to
|
||||
`127.0.0.1:8334` to listen for Tor connections. It was not possible to switch
|
||||
this off, even if the node didn't use Tor. This has been changed and now
|
||||
`bind=addr:port` results in binding on `addr:port` only. The default behavior
|
||||
of binding to `0.0.0.0:8333` and `127.0.0.1:8334` has not been changed.
|
||||
### Doc
|
||||
|
||||
If you are using a `bind=...` configuration without `bind=...=onion` and rely
|
||||
on the previous implied behavior to accept incoming Tor connections at
|
||||
`127.0.0.1:8334`, you need to now make this explicit by using
|
||||
`bind=... bind=127.0.0.1:8334=onion`. (#22729)
|
||||
- #32003 doc: remove note about macOS self-signing
|
||||
|
||||
- Bitcoin Core will now fail to start up if any of its P2P binds fail, rather
|
||||
than the previous behaviour where it would only abort startup if all P2P
|
||||
binds had failed. (#22729)
|
||||
### Misc
|
||||
|
||||
- UNIX domain sockets can now be used for proxy connections. Set `-onion` or `-proxy`
|
||||
to the local socket path with the prefix `unix:` (e.g. `-onion=unix:/home/me/torsocket`).
|
||||
(#27375)
|
||||
|
||||
- unix socket paths are now accepted for `-zmqpubrawblock` and `-zmqpubrawtx` with
|
||||
the format `-zmqpubrawtx=unix:/path/to/file`
|
||||
|
||||
- Additional flags "in" and "out" have been added to `-whitelist` to control whether
|
||||
permissions apply to incoming connections and/or manual (default: incoming only).
|
||||
|
||||
- Transactions that are too low feerate will be opportunistically paired with their child
|
||||
transactions and submitted as a package, thus enabling the node to download
|
||||
1-parent-1-child packages using the existing transaction relay protocol. Combined with
|
||||
other mempool policies, this allows limited "package relay" when a parent transaction
|
||||
is below mempool minimum feerate; TRUC parents are additionally allowed to be below
|
||||
minimum relay feerate (i.e. pay 0 fees). Use the `submitpackage` RPC to submit packages
|
||||
directly to the node. Warning: this p2p feature is limited (unlike the `submitpackage`
|
||||
interface, a child with multiple unconfirmed parents is not supported) and not yet
|
||||
reliable under adversarial conditions. (#28970)
|
||||
|
||||
Mempool Policy Changes
|
||||
----------------------
|
||||
|
||||
- Transactions with version number set to 3 are now treated as standard on all networks (#29496),
|
||||
subject to Opt-in Topologically Restricted Until Confirmation (TRUC) Transactions policy as
|
||||
described in [BIP 431](https://github.com/bitcoin/bips/blob/master/bip-0431.mediawiki). The
|
||||
policy includes limits on spending unconfirmed outputs (#28948), eviction of a previous descendant
|
||||
if a more incentive-compatible one is submitted (#29306), and a maximum transaction size of 10,000vB
|
||||
(#29873). These restrictions simplify the assessment of incentive compatibility of accepting or
|
||||
replacing TRUC transactions, thus ensuring any replacements are more profitable for the node and
|
||||
making fee-bumping more reliable.
|
||||
|
||||
- Pay To Anchor (P2A) is a new standard witness output type for spending,
|
||||
a newly recognised output template. This allows for key-less anchor
|
||||
outputs, with compact spending conditions for additional efficiencies on
|
||||
top of an equivalent `sh(OP_TRUE)` output, in addition to the txid stability
|
||||
of the spending transaction.
|
||||
N.B. propagation of this output spending on the network will be limited
|
||||
until a sufficient number of nodes on the network adopt this upgrade.
|
||||
|
||||
- Limited package RBF is now enabled, where the proposed conflicting package would result in
|
||||
a connected component, aka cluster, of size 2 in the mempool. All clusters being conflicted
|
||||
against must be of size 2 or lower.
|
||||
|
||||
- `mempoolfullrbf=1` is now set by default.
|
||||
|
||||
Updated RPCs
|
||||
------------
|
||||
|
||||
- The JSON-RPC server now recognizes JSON-RPC 2.0 requests and responds with
|
||||
strict adherence to the [specification](https://www.jsonrpc.org/specification).
|
||||
See [JSON-RPC-interface.md](https://github.com/bitcoin/bitcoin/blob/master/doc/JSON-RPC-interface.md#json-rpc-11-vs-20) for details.
|
||||
|
||||
- The `dumptxoutset` RPC now returns the UTXO set dump in a new and
|
||||
improved format. At the same time the `loadtxoutset` RPC now
|
||||
expects this new format in dumps it tries to load. Dumps with the
|
||||
old format are no longer supported and need to be recreated using
|
||||
the new format in order to be usable.
|
||||
|
||||
- AssumeUTXO mainnet parameters have been added for height 840,000.
|
||||
This means the `loadtxoutset` RPC can now be used on mainnet with
|
||||
the matching UTXO set from that height.
|
||||
|
||||
- The `warnings` field in `getblockchaininfo`, `getmininginfo` and
|
||||
`getnetworkinfo` now returns all the active node warnings as an array
|
||||
of strings, instead of just a single warning. The current behaviour
|
||||
can temporarily be restored by running bitcoind with configuration
|
||||
option `-deprecatedrpc=warnings`.
|
||||
|
||||
- Previously when using the `sendrawtransaction` rpc and specifying outputs
|
||||
that are already in the UXTO set an RPC error code `-27` with RPC error
|
||||
text "Transaction already in block chain" was returned in response.
|
||||
The help text has been updated to "Transaction outputs already in utxo set"
|
||||
to more accurately describe the source of the issue.
|
||||
|
||||
- The default mode for the `estimatesmartfee` RPC has been updated from `conservative` to `economical`.
|
||||
which is expected to reduce overestimation for many users, particularly if Replace-by-Fee is an option.
|
||||
For users that require high confidence in their fee estimates at the cost of potentially overestimating,
|
||||
the `conservative` mode remains available.
|
||||
|
||||
- An item of `unspents`, of `scantxoutset`, has two new fields: `blockhash`
|
||||
and `confirmations`. `blockhash` is the hash of the block where the UTXO was
|
||||
created. `confirmations` is the number of confirmations of the UTXO. (#30515)
|
||||
|
||||
- `maxfeerate` and `maxburnamount` arguments are added to submitpackage.
|
||||
|
||||
Changes to wallet related RPCs can be found in the Wallet section below.
|
||||
|
||||
New RPCs
|
||||
--------
|
||||
|
||||
Updated REST APIs
|
||||
-----------------
|
||||
- Parameter validation for `/rest/getutxos` has been improved by rejecting
|
||||
truncated or overly large txids and malformed outpoint indices by raising an
|
||||
HTTP_BAD_REQUEST "Parse error". Previously, these malformed requests would be
|
||||
silently handled. (#30482, #30444)
|
||||
|
||||
Build System
|
||||
------------
|
||||
|
||||
- GCC 11.1 or later, or Clang 16.0 or later,
|
||||
are now required to compile Bitcoin Core.
|
||||
|
||||
- The minimum required glibc to run Bitcoin Core is now
|
||||
2.31. This means that RHEL 8 and Ubuntu 18.04 (Bionic)
|
||||
are no-longer supported. (#29987)
|
||||
|
||||
- `--enable-lcov-branch-coverage` has been removed, given
|
||||
incompatibilities between lcov version 1 & 2. `LCOV_OPTS`
|
||||
should be used to set any options instead.
|
||||
|
||||
Updated settings
|
||||
----------------
|
||||
|
||||
- When running with `-alertnotify`, an alert can now be raised multiple
|
||||
times instead of just once. Previously, it was only raised when unknown
|
||||
new consensus rules were activated, whereas the scope has now been
|
||||
increased to include all kernel warnings. Specifically, alerts will now
|
||||
also be raised when an invalid chain with a large amount of work has
|
||||
been detected. Additional warnings may be added in the future.
|
||||
(#30058)
|
||||
|
||||
Changes to GUI or wallet related settings can be found in the GUI or Wallet section below.
|
||||
|
||||
New settings
|
||||
------------
|
||||
|
||||
Tools and Utilities
|
||||
-------------------
|
||||
|
||||
Wallet
|
||||
------
|
||||
|
||||
- The wallet now detects when wallet transactions conflict with the mempool. Mempool
|
||||
conflicting transactions can be seen in the `"mempoolconflicts"` field of
|
||||
`gettransaction`. The inputs of mempool conflicted transactions can now be respent
|
||||
without manually abandoning the transactions when the parent transaction is dropped
|
||||
from the mempool, which can cause wallet balances to appear higher.
|
||||
|
||||
- A new `max_tx_weight` option has been added to the RPCs `fundrawtransaction`, `walletcreatefundedpsbt`, and `send`.
|
||||
It specifies the maximum transaction weight. If the limit is exceeded during funding, the transaction will not be built.
|
||||
The default value is 4,000,000 WU.
|
||||
|
||||
- A new RPC `createwalletdescriptor` is added which allows users to add new automatically
|
||||
generated descriptors to their wallet. This can be used to upgrade wallets created prior to
|
||||
the introduction of a new standard descriptor, such as taproot.
|
||||
|
||||
- A new RPC `gethdkeys` is added which will list all of the BIP 32 HD keys in use by all
|
||||
of the descriptors in the wallet. These keys can be used in conjunction with `createwalletdescriptor`
|
||||
to create and add single key descriptors to the wallet for a particular key that the wallet
|
||||
already knows.
|
||||
|
||||
- The `sendall` RPC can spend unconfirmed change and will include additional fees as necessary
|
||||
for the resulting transaction to bump the unconfirmed transactions' feerates to the specified feerate.
|
||||
|
||||
- If a `fee_rate` is specified when using the `bumpfee` RPC, the feerate is no longer restricted to
|
||||
following the wallet's incremental feerate of 5 sat/vb. The feerate must still be at least the sum
|
||||
of the original fee and the mempool's incremental feerate.
|
||||
|
||||
GUI changes
|
||||
-----------
|
||||
|
||||
- The "Migrate Wallet" menu allows users to migrate any legacy wallet in their wallet
|
||||
directory, regardless of the wallets loaded. (gui#824)
|
||||
|
||||
- The "Information" window now displays the maximum mempool size along with the
|
||||
mempool usage. (gui#825)
|
||||
|
||||
Low-level changes
|
||||
=================
|
||||
|
||||
RPC
|
||||
---
|
||||
|
||||
Tests
|
||||
-----
|
||||
|
||||
- The BIP94 timewarp attack mitigation is now active on the `regtest` network
|
||||
|
||||
- `-testdatadir` is added to `test_bitcoin` to allow specifying the location for unit test data directories.
|
||||
|
||||
Blockstorage
|
||||
------------
|
||||
|
||||
- Block files are now XOR'd by default with a key stored in the blocksdir.
|
||||
Previous releases of Bitcoin Core or previous external software will not be able to read the blocksdir with a non-zero XOR-key.
|
||||
Refer to the `-blocksxor` help for more details.
|
||||
- #31611 doc: upgrade license to 2025
|
||||
- #32187 refactor: Remove spurious virtual from final ~CZMQNotificationInterface
|
||||
|
||||
Credits
|
||||
=======
|
||||
|
||||
Thanks to everyone who directly contributed to this release:
|
||||
- 0xb10c
|
||||
- Alfonso Roman Zubeldia
|
||||
- Andrew Toth
|
||||
- AngusP
|
||||
- Anthony Towns
|
||||
- Antoine Poinsot
|
||||
- Anton A
|
||||
- Ava Chow
|
||||
- Ayush Singh
|
||||
- Ben Westgate
|
||||
- 0xB10C
|
||||
- achow101
|
||||
- Brandon Odiwuor
|
||||
- brunoerg
|
||||
- bstin
|
||||
- Charlie
|
||||
- Christopher Bergqvist
|
||||
- Cory Fields
|
||||
- crazeteam
|
||||
- Daniela Brozzoni
|
||||
- David Gumberg
|
||||
- dergoegge
|
||||
- Edil Medeiros
|
||||
- Epic Curious
|
||||
- Fabian Jahr
|
||||
- fanquake
|
||||
- furszy
|
||||
- glozow
|
||||
- Greg Sanders
|
||||
- hanmz
|
||||
- Hennadii Stepanov
|
||||
- Hernan Marino
|
||||
- Hodlinator
|
||||
- ishaanam
|
||||
- ismaelsadeeq
|
||||
- Jadi
|
||||
- Jon Atack
|
||||
- josibake
|
||||
- jrakibi
|
||||
- kevkevin
|
||||
- kevkevinpal
|
||||
- Konstantin Akimov
|
||||
- laanwj
|
||||
- Larry Ruane
|
||||
- Lőrinc
|
||||
- Luis Schwab
|
||||
- Luke Dashjr
|
||||
- kehiy
|
||||
- MarcoFalke
|
||||
- marcofleon
|
||||
- Marnix
|
||||
- Martin Saposnic
|
||||
- Martin Zumsande
|
||||
- Matt Corallo
|
||||
- Matthew Zipkin
|
||||
- Matt Whitlock
|
||||
- Max Edwards
|
||||
- Michael Dietz
|
||||
- Murch
|
||||
- nanlour
|
||||
- pablomartin4btc
|
||||
- Peter Todd
|
||||
- Pieter Wuille
|
||||
- @RandyMcMillan
|
||||
- RoboSchmied
|
||||
- Roman Zeyde
|
||||
- Ryan Ofsky
|
||||
- Sebastian Falbesoner
|
||||
- Sergi Delgado Segura
|
||||
- Sjors Provoost
|
||||
- spicyzboss
|
||||
- StevenMia
|
||||
- stickies-v
|
||||
- stratospher
|
||||
- Suhas Daftuar
|
||||
- sunerok
|
||||
- tdb3
|
||||
- TheCharlatan
|
||||
- umiumi
|
||||
- Vasil Dimov
|
||||
- virtu
|
||||
- willcl-ark
|
||||
|
||||
As well as to everyone that helped with translations on
|
||||
[Transifex](https://www.transifex.com/bitcoin/bitcoin/).
|
||||
|
||||
371
doc/release-notes/release-notes-28.0.md
Normal file
371
doc/release-notes/release-notes-28.0.md
Normal file
@@ -0,0 +1,371 @@
|
||||
Bitcoin Core version 28.0 is now available from:
|
||||
|
||||
<https://bitcoincore.org/bin/bitcoin-core-28.0/>
|
||||
|
||||
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.
|
||||
|
||||
Running Bitcoin Core binaries on macOS requires self signing.
|
||||
```
|
||||
cd /path/to/bitcoin-28.0/bin
|
||||
xattr -d com.apple.quarantine bitcoin-cli bitcoin-qt bitcoin-tx bitcoin-util bitcoin-wallet bitcoind test_bitcoin
|
||||
codesign -s - bitcoin-cli bitcoin-qt bitcoin-tx bitcoin-util bitcoin-wallet bitcoind test_bitcoin
|
||||
```
|
||||
|
||||
Compatibility
|
||||
==============
|
||||
|
||||
Bitcoin Core is supported and extensively tested on operating systems
|
||||
using the Linux Kernel 3.17+, macOS 11.0+, 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.
|
||||
|
||||
Notable changes
|
||||
===============
|
||||
|
||||
Testnet4/BIP94 support
|
||||
-----
|
||||
|
||||
Support for Testnet4 as specified in [BIP94](https://github.com/bitcoin/bips/blob/master/bip-0094.mediawiki)
|
||||
has been added. The network can be selected with the `-testnet4` option and
|
||||
the section header is also named `[testnet4]`.
|
||||
|
||||
While the intention is to phase out support for Testnet3 in an upcoming
|
||||
version, support for it is still available via the known options in this
|
||||
release. (#29775)
|
||||
|
||||
Windows Data Directory
|
||||
----------------------
|
||||
|
||||
The default data directory on Windows has been moved from `C:\Users\Username\AppData\Roaming\Bitcoin`
|
||||
to `C:\Users\Username\AppData\Local\Bitcoin`. Bitcoin Core will check the existence
|
||||
of the old directory first and continue to use that directory for backwards
|
||||
compatibility if it is present. (#27064)
|
||||
|
||||
JSON-RPC 2.0 Support
|
||||
--------------------
|
||||
|
||||
The JSON-RPC server now recognizes JSON-RPC 2.0 requests and responds with
|
||||
strict adherence to the [specification](https://www.jsonrpc.org/specification).
|
||||
See [JSON-RPC-interface.md](https://github.com/bitcoin/bitcoin/blob/master/doc/JSON-RPC-interface.md#json-rpc-11-vs-20) for details. (#27101)
|
||||
|
||||
JSON-RPC clients may need to be updated to be compatible with the JSON-RPC server.
|
||||
Please open an issue on GitHub if any compatibility issues are found.
|
||||
|
||||
libbitcoinconsensus Removal
|
||||
---------------------------
|
||||
|
||||
The libbitcoin-consensus library was deprecated in 27.0 and is now completely removed. (#29648)
|
||||
|
||||
P2P and Network Changes
|
||||
-----------------------
|
||||
|
||||
- Previously if Bitcoin Core was listening for P2P connections, either using
|
||||
default settings or via `bind=addr:port` it would always also bind to
|
||||
`127.0.0.1:8334` to listen for Tor connections. It was not possible to switch
|
||||
this off, even if the node didn't use Tor. This has been changed and now
|
||||
`bind=addr:port` results in binding on `addr:port` only. The default behavior
|
||||
of binding to `0.0.0.0:8333` and `127.0.0.1:8334` has not been changed.
|
||||
|
||||
If you are using a `bind=...` configuration without `bind=...=onion` and rely
|
||||
on the previous implied behavior to accept incoming Tor connections at
|
||||
`127.0.0.1:8334`, you need to now make this explicit by using
|
||||
`bind=... bind=127.0.0.1:8334=onion`. (#22729)
|
||||
|
||||
- Bitcoin Core will now fail to start up if any of its P2P binds fail, rather
|
||||
than the previous behaviour where it would only abort startup if all P2P
|
||||
binds had failed. (#22729)
|
||||
|
||||
- UNIX domain sockets can now be used for proxy connections. Set `-onion` or `-proxy`
|
||||
to the local socket path with the prefix `unix:` (e.g. `-onion=unix:/home/me/torsocket`).
|
||||
(#27375)
|
||||
|
||||
- UNIX socket paths are now accepted for `-zmqpubrawblock` and `-zmqpubrawtx` with
|
||||
the format `-zmqpubrawtx=unix:/path/to/file` (#27679)
|
||||
|
||||
- Additional "in" and "out" flags have been added to `-whitelist` to control whether
|
||||
permissions apply to inbound connections and/or manual ones (default: inbound only). (#27114)
|
||||
|
||||
- Transactions having a feerate that is too low will be opportunistically paired with
|
||||
their child transactions and submitted as a package, thus enabling the node to download
|
||||
1-parent-1-child packages using the existing transaction relay protocol. Combined with
|
||||
other mempool policies, this change allows limited "package relay" when a parent transaction
|
||||
is below the mempool minimum feerate. Topologically Restricted Until Confirmation (TRUC)
|
||||
parents are additionally allowed to be below the minimum relay feerate (i.e., pay 0 fees).
|
||||
Use the `submitpackage` RPC to submit packages directly to the node. Warning: this P2P
|
||||
feature is limited (unlike the `submitpackage` interface, a child with multiple unconfirmed
|
||||
parents is not supported) and not yet reliable under adversarial conditions. (#28970)
|
||||
|
||||
Mempool Policy Changes
|
||||
----------------------
|
||||
|
||||
- Transactions with version number set to 3 are now treated as standard on all networks (#29496),
|
||||
subject to opt-in Topologically Restricted Until Confirmation (TRUC) transaction policy as
|
||||
described in [BIP 431](https://github.com/bitcoin/bips/blob/master/bip-0431.mediawiki). The
|
||||
policy includes limits on spending unconfirmed outputs (#28948), eviction of a previous descendant
|
||||
if a more incentive-compatible one is submitted (#29306), and a maximum transaction size of 10,000vB
|
||||
(#29873). These restrictions simplify the assessment of incentive compatibility of accepting or
|
||||
replacing TRUC transactions, thus ensuring any replacements are more profitable for the node and
|
||||
making fee-bumping more reliable.
|
||||
|
||||
- Pay To Anchor (P2A) is a new standard witness output type for spending,
|
||||
a newly recognised output template. This allows for key-less anchor
|
||||
outputs, with compact spending conditions for additional efficiencies on
|
||||
top of an equivalent `sh(OP_TRUE)` output, in addition to the txid stability
|
||||
of the spending transaction.
|
||||
N.B. propagation of this output spending on the network will be limited
|
||||
until a sufficient number of nodes on the network adopt this upgrade. (#30352)
|
||||
|
||||
- Limited package RBF is now enabled, where the proposed conflicting package would result in
|
||||
a connected component, aka cluster, of size 2 in the mempool. All clusters being conflicted
|
||||
against must be of size 2 or lower. (#28984)
|
||||
|
||||
- The default value of the `-mempoolfullrbf` configuration option has been changed from 0 to 1,
|
||||
i.e. `mempoolfullrbf=1`. (#30493)
|
||||
|
||||
Updated RPCs
|
||||
------------
|
||||
|
||||
- The `dumptxoutset` RPC now returns the UTXO set dump in a new and
|
||||
improved format. Correspondingly, the `loadtxoutset` RPC now expects
|
||||
this new format in the dumps it tries to load. Dumps with the old
|
||||
format are no longer supported and need to be recreated using the
|
||||
new format to be usable. (#29612)
|
||||
|
||||
- AssumeUTXO mainnet parameters have been added for height 840,000.
|
||||
This means the `loadtxoutset` RPC can now be used on mainnet with
|
||||
the matching UTXO set from that height. (#28553)
|
||||
|
||||
- The `warnings` field in `getblockchaininfo`, `getmininginfo` and
|
||||
`getnetworkinfo` now returns all the active node warnings as an array
|
||||
of strings, instead of a single warning. The current behaviour
|
||||
can be temporarily restored by running Bitcoin Core with the configuration
|
||||
option `-deprecatedrpc=warnings`. (#29845)
|
||||
|
||||
- Previously when using the `sendrawtransaction` RPC and specifying outputs
|
||||
that are already in the UTXO set, an RPC error code of `-27` with the
|
||||
message "Transaction already in block chain" was returned in response.
|
||||
The error message has been changed to "Transaction outputs already in utxo set"
|
||||
to more accurately describe the source of the issue. (#30212)
|
||||
|
||||
- The default mode for the `estimatesmartfee` RPC has been updated from `conservative` to `economical`,
|
||||
which is expected to reduce over-estimation for many users, particularly if Replace-by-Fee is an option.
|
||||
For users that require high confidence in their fee estimates at the cost of potentially over-estimating,
|
||||
the `conservative` mode remains available. (#30275)
|
||||
|
||||
- RPC `scantxoutset` now returns 2 new fields in the "unspents" JSON array: `blockhash` and `confirmations`.
|
||||
See the scantxoutset help for details. (#30515)
|
||||
|
||||
- RPC `submitpackage` now allows 2 new arguments to be passed: `maxfeerate` and `maxburnamount`. See the
|
||||
subtmitpackage help for details. (#28950)
|
||||
|
||||
Changes to wallet-related RPCs can be found in the Wallet section below.
|
||||
|
||||
Updated REST APIs
|
||||
-----------------
|
||||
- Parameter validation for `/rest/getutxos` has been improved by rejecting
|
||||
truncated or overly large txids and malformed outpoint indices via raising
|
||||
an HTTP_BAD_REQUEST "Parse error". These requests were previously handled
|
||||
silently. (#30482, #30444)
|
||||
|
||||
Build System
|
||||
------------
|
||||
|
||||
- GCC 11.1 or later, or Clang 16.0 or later,
|
||||
are now required to compile Bitcoin Core. (#29091, #30263)
|
||||
|
||||
- The minimum required glibc to run Bitcoin Core is now
|
||||
2.31. This means that RHEL 8 and Ubuntu 18.04 (Bionic)
|
||||
are no-longer supported. (#29987)
|
||||
|
||||
- `--enable-lcov-branch-coverage` has been removed, given
|
||||
incompatibilities between lcov version 1 & 2. `LCOV_OPTS`
|
||||
should be used to set any options instead. (#30192)
|
||||
|
||||
Updated Settings
|
||||
----------------
|
||||
|
||||
- When running with `-alertnotify`, an alert can now be raised multiple
|
||||
times instead of just once. Previously, it was only raised when unknown
|
||||
new consensus rules were activated. Its scope has now been increased to
|
||||
include all kernel warnings. Specifically, alerts will now also be raised
|
||||
when an invalid chain with a large amount of work has been detected.
|
||||
Additional warnings may be added in the future. (#30058)
|
||||
|
||||
Changes to GUI or wallet related settings can be found in the GUI or Wallet section below.
|
||||
|
||||
Wallet
|
||||
------
|
||||
|
||||
- The wallet now detects when wallet transactions conflict with the mempool. Mempool-conflicting
|
||||
transactions can be seen in the `"mempoolconflicts"` field of `gettransaction`. The inputs
|
||||
of mempool-conflicted transactions can now be respent without manually abandoning the
|
||||
transactions when the parent transaction is dropped from the mempool, which can cause wallet
|
||||
balances to appear higher. (#27307)
|
||||
|
||||
- A new `max_tx_weight` option has been added to the RPCs `fundrawtransaction`, `walletcreatefundedpsbt`, and `send`.
|
||||
It specifies the maximum transaction weight. If the limit is exceeded during funding, the transaction will not be built.
|
||||
The default value is 4,000,000 WU. (#29523)
|
||||
|
||||
- A new `createwalletdescriptor` RPC allows users to add new automatically generated
|
||||
descriptors to their wallet. This can be used to upgrade wallets created prior to the
|
||||
introduction of a new standard descriptor, such as taproot. (#29130)
|
||||
|
||||
- A new RPC `gethdkeys` lists all of the BIP32 HD keys in use by all of the descriptors in the wallet.
|
||||
These keys can be used in conjunction with `createwalletdescriptor` to create and add single key
|
||||
descriptors to the wallet for a particular key that the wallet already knows. (#29130)
|
||||
|
||||
- The `sendall` RPC can now spend unconfirmed change and will include additional fees as necessary
|
||||
for the resulting transaction to bump the unconfirmed transactions' feerates to the specified feerate. (#28979)
|
||||
|
||||
- In RPC `bumpfee`, if a `fee_rate` is specified, the feerate is no longer restricted
|
||||
to following the wallet's incremental feerate of 5 sat/vb. The feerate must still be
|
||||
at least the sum of the original fee and the mempool's incremental feerate. (#27969)
|
||||
|
||||
GUI Changes
|
||||
-----------
|
||||
|
||||
- The "Migrate Wallet" menu allows users to migrate any legacy wallet in their wallet
|
||||
directory, regardless of the wallets loaded. (gui#824)
|
||||
|
||||
- The "Information" window now displays the maximum mempool size along with the
|
||||
mempool usage. (gui#825)
|
||||
|
||||
Low-level Changes
|
||||
=================
|
||||
|
||||
Tests
|
||||
-----
|
||||
|
||||
- The BIP94 timewarp attack mitigation is now active on the `regtest` network. (#30681)
|
||||
|
||||
- A new `-testdatadir` option has been added to `test_bitcoin` to allow specifying the
|
||||
location of unit test data directories. (#26564)
|
||||
|
||||
Blockstorage
|
||||
------------
|
||||
|
||||
- Block files are now XOR'd by default with a key stored in the blocksdir.
|
||||
Previous releases of Bitcoin Core or previous external software will not be able to read the blocksdir with a non-zero XOR-key.
|
||||
Refer to the `-blocksxor` help for more details. (#28052)
|
||||
|
||||
Chainstate
|
||||
----------
|
||||
|
||||
- The chainstate database flushes that occur when blocks are pruned will no longer
|
||||
empty the database cache. The cache will remain populated longer, which significantly
|
||||
reduces the time for initial block download to complete. (#28280)
|
||||
|
||||
Dependencies
|
||||
------------
|
||||
|
||||
- The dependency on Boost.Process has been replaced with cpp-subprocess, which is contained in source.
|
||||
Builders will no longer need Boost.Process to build with external signer support. (#28981)
|
||||
|
||||
Credits
|
||||
=======
|
||||
|
||||
Thanks to everyone who directly contributed to this release:
|
||||
- 0xb10c
|
||||
- Alfonso Roman Zubeldia
|
||||
- Andrew Toth
|
||||
- AngusP
|
||||
- Anthony Towns
|
||||
- Antoine Poinsot
|
||||
- Anton A
|
||||
- Ava Chow
|
||||
- Ayush Singh
|
||||
- Ben Westgate
|
||||
- Brandon Odiwuor
|
||||
- brunoerg
|
||||
- bstin
|
||||
- Charlie
|
||||
- Christopher Bergqvist
|
||||
- Cory Fields
|
||||
- crazeteam
|
||||
- Daniela Brozzoni
|
||||
- David Gumberg
|
||||
- dergoegge
|
||||
- Edil Medeiros
|
||||
- Epic Curious
|
||||
- Fabian Jahr
|
||||
- fanquake
|
||||
- furszy
|
||||
- glozow
|
||||
- Greg Sanders
|
||||
- hanmz
|
||||
- Hennadii Stepanov
|
||||
- Hernan Marino
|
||||
- Hodlinator
|
||||
- ishaanam
|
||||
- ismaelsadeeq
|
||||
- Jadi
|
||||
- Jon Atack
|
||||
- josibake
|
||||
- jrakibi
|
||||
- kevkevin
|
||||
- kevkevinpal
|
||||
- Konstantin Akimov
|
||||
- laanwj
|
||||
- Larry Ruane
|
||||
- Lőrinc
|
||||
- Luis Schwab
|
||||
- Luke Dashjr
|
||||
- MarcoFalke
|
||||
- marcofleon
|
||||
- Marnix
|
||||
- Martin Saposnic
|
||||
- Martin Zumsande
|
||||
- Matt Corallo
|
||||
- Matthew Zipkin
|
||||
- Matt Whitlock
|
||||
- Max Edwards
|
||||
- Michael Dietz
|
||||
- Murch
|
||||
- nanlour
|
||||
- pablomartin4btc
|
||||
- Peter Todd
|
||||
- Pieter Wuille
|
||||
- @RandyMcMillan
|
||||
- RoboSchmied
|
||||
- Roman Zeyde
|
||||
- Ryan Ofsky
|
||||
- Sebastian Falbesoner
|
||||
- Sergi Delgado Segura
|
||||
- Sjors Provoost
|
||||
- spicyzboss
|
||||
- StevenMia
|
||||
- stickies-v
|
||||
- stratospher
|
||||
- Suhas Daftuar
|
||||
- sunerok
|
||||
- tdb3
|
||||
- TheCharlatan
|
||||
- umiumi
|
||||
- Vasil Dimov
|
||||
- virtu
|
||||
- willcl-ark
|
||||
|
||||
As well as to everyone that helped with translations on
|
||||
[Transifex](https://www.transifex.com/bitcoin/bitcoin/).
|
||||
@@ -164,8 +164,8 @@ Then open a Pull Request to the [guix.sigs repository](https://github.com/bitcoi
|
||||
|
||||
In the `guix-build-${VERSION}/output/x86_64-apple-darwin` and `guix-build-${VERSION}/output/arm64-apple-darwin` directories:
|
||||
|
||||
tar xf bitcoin-osx-unsigned.tar.gz
|
||||
./detached-sig-create.sh /path/to/codesign.p12
|
||||
tar xf bitcoin-${VERSION}-${ARCH}-apple-darwin-codesigning.tar.gz
|
||||
./detached-sig-create.sh /path/to/codesign.p12 /path/to/AuthKey_foo.p8 uuid
|
||||
Enter the keychain password and authorize the signature
|
||||
signature-osx.tar.gz will be created
|
||||
|
||||
@@ -173,8 +173,8 @@ In the `guix-build-${VERSION}/output/x86_64-apple-darwin` and `guix-build-${VERS
|
||||
|
||||
In the `guix-build-${VERSION}/output/x86_64-w64-mingw32` directory:
|
||||
|
||||
tar xf bitcoin-win-unsigned.tar.gz
|
||||
./detached-sig-create.sh -key /path/to/codesign.key
|
||||
tar xf bitcoin-${VERSION}-win64-codesigning.tar.gz
|
||||
./detached-sig-create.sh /path/to/codesign.key
|
||||
Enter the passphrase for the key when prompted
|
||||
signature-win.tar.gz will be created
|
||||
|
||||
|
||||
@@ -290,7 +290,8 @@
|
||||
|
||||
# Listen for connections on <port> (default: 8333, testnet3: 18333,
|
||||
# testnet4: 48333, signet: 38333, regtest: 18444). Not relevant for
|
||||
# I2P (see doc/i2p.md).
|
||||
# I2P (see doc/i2p.md). If set to a value x, the default onion
|
||||
# listening port will be set to x+1.
|
||||
#port=<port>
|
||||
|
||||
# Connect through SOCKS5 proxy, set -noproxy to disable (default:
|
||||
@@ -697,9 +698,12 @@
|
||||
# Options for mainnet
|
||||
[main]
|
||||
|
||||
# Options for testnet
|
||||
# Options for testnet3
|
||||
[test]
|
||||
|
||||
# Options for testnet4
|
||||
[testnet4]
|
||||
|
||||
# Options for signet
|
||||
[signet]
|
||||
|
||||
|
||||
@@ -188,7 +188,7 @@ void AddrManImpl::Serialize(Stream& s_) const
|
||||
|
||||
int nUBuckets = ADDRMAN_NEW_BUCKET_COUNT ^ (1 << 30);
|
||||
s << nUBuckets;
|
||||
std::unordered_map<int, int> mapUnkIds;
|
||||
std::unordered_map<nid_type, int> mapUnkIds;
|
||||
int nIds = 0;
|
||||
for (const auto& entry : mapInfo) {
|
||||
mapUnkIds[entry.first] = nIds;
|
||||
@@ -398,7 +398,7 @@ void AddrManImpl::Unserialize(Stream& s_)
|
||||
}
|
||||
}
|
||||
|
||||
AddrInfo* AddrManImpl::Find(const CService& addr, int* pnId)
|
||||
AddrInfo* AddrManImpl::Find(const CService& addr, nid_type* pnId)
|
||||
{
|
||||
AssertLockHeld(cs);
|
||||
|
||||
@@ -413,11 +413,11 @@ AddrInfo* AddrManImpl::Find(const CService& addr, int* pnId)
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
AddrInfo* AddrManImpl::Create(const CAddress& addr, const CNetAddr& addrSource, int* pnId)
|
||||
AddrInfo* AddrManImpl::Create(const CAddress& addr, const CNetAddr& addrSource, nid_type* pnId)
|
||||
{
|
||||
AssertLockHeld(cs);
|
||||
|
||||
int nId = nIdCount++;
|
||||
nid_type nId = nIdCount++;
|
||||
mapInfo[nId] = AddrInfo(addr, addrSource);
|
||||
mapAddr[addr] = nId;
|
||||
mapInfo[nId].nRandomPos = vRandom.size();
|
||||
@@ -438,8 +438,8 @@ void AddrManImpl::SwapRandom(unsigned int nRndPos1, unsigned int nRndPos2) const
|
||||
|
||||
assert(nRndPos1 < vRandom.size() && nRndPos2 < vRandom.size());
|
||||
|
||||
int nId1 = vRandom[nRndPos1];
|
||||
int nId2 = vRandom[nRndPos2];
|
||||
nid_type nId1 = vRandom[nRndPos1];
|
||||
nid_type nId2 = vRandom[nRndPos2];
|
||||
|
||||
const auto it_1{mapInfo.find(nId1)};
|
||||
const auto it_2{mapInfo.find(nId2)};
|
||||
@@ -453,7 +453,7 @@ void AddrManImpl::SwapRandom(unsigned int nRndPos1, unsigned int nRndPos2) const
|
||||
vRandom[nRndPos2] = nId1;
|
||||
}
|
||||
|
||||
void AddrManImpl::Delete(int nId)
|
||||
void AddrManImpl::Delete(nid_type nId)
|
||||
{
|
||||
AssertLockHeld(cs);
|
||||
|
||||
@@ -476,7 +476,7 @@ void AddrManImpl::ClearNew(int nUBucket, int nUBucketPos)
|
||||
|
||||
// if there is an entry in the specified bucket, delete it.
|
||||
if (vvNew[nUBucket][nUBucketPos] != -1) {
|
||||
int nIdDelete = vvNew[nUBucket][nUBucketPos];
|
||||
nid_type nIdDelete = vvNew[nUBucket][nUBucketPos];
|
||||
AddrInfo& infoDelete = mapInfo[nIdDelete];
|
||||
assert(infoDelete.nRefCount > 0);
|
||||
infoDelete.nRefCount--;
|
||||
@@ -488,7 +488,7 @@ void AddrManImpl::ClearNew(int nUBucket, int nUBucketPos)
|
||||
}
|
||||
}
|
||||
|
||||
void AddrManImpl::MakeTried(AddrInfo& info, int nId)
|
||||
void AddrManImpl::MakeTried(AddrInfo& info, nid_type nId)
|
||||
{
|
||||
AssertLockHeld(cs);
|
||||
|
||||
@@ -515,7 +515,7 @@ void AddrManImpl::MakeTried(AddrInfo& info, int nId)
|
||||
// first make space to add it (the existing tried entry there is moved to new, deleting whatever is there).
|
||||
if (vvTried[nKBucket][nKBucketPos] != -1) {
|
||||
// find an item to evict
|
||||
int nIdEvict = vvTried[nKBucket][nKBucketPos];
|
||||
nid_type nIdEvict = vvTried[nKBucket][nKBucketPos];
|
||||
assert(mapInfo.count(nIdEvict) == 1);
|
||||
AddrInfo& infoOld = mapInfo[nIdEvict];
|
||||
|
||||
@@ -554,7 +554,7 @@ bool AddrManImpl::AddSingle(const CAddress& addr, const CNetAddr& source, std::c
|
||||
if (!addr.IsRoutable())
|
||||
return false;
|
||||
|
||||
int nId;
|
||||
nid_type nId;
|
||||
AddrInfo* pinfo = Find(addr, &nId);
|
||||
|
||||
// Do not set a penalty for a source's self-announcement
|
||||
@@ -627,7 +627,7 @@ bool AddrManImpl::Good_(const CService& addr, bool test_before_evict, NodeSecond
|
||||
{
|
||||
AssertLockHeld(cs);
|
||||
|
||||
int nId;
|
||||
nid_type nId;
|
||||
|
||||
m_last_good = time;
|
||||
|
||||
@@ -753,7 +753,8 @@ std::pair<CAddress, NodeSeconds> AddrManImpl::Select_(bool new_only, std::option
|
||||
|
||||
// Iterate over the positions of that bucket, starting at the initial one,
|
||||
// and looping around.
|
||||
int i, position, node_id;
|
||||
int i, position;
|
||||
nid_type node_id;
|
||||
for (i = 0; i < ADDRMAN_BUCKET_SIZE; ++i) {
|
||||
position = (initial_position + i) % ADDRMAN_BUCKET_SIZE;
|
||||
node_id = GetEntry(search_tried, bucket, position);
|
||||
@@ -786,7 +787,7 @@ std::pair<CAddress, NodeSeconds> AddrManImpl::Select_(bool new_only, std::option
|
||||
}
|
||||
}
|
||||
|
||||
int AddrManImpl::GetEntry(bool use_tried, size_t bucket, size_t position) const
|
||||
nid_type AddrManImpl::GetEntry(bool use_tried, size_t bucket, size_t position) const
|
||||
{
|
||||
AssertLockHeld(cs);
|
||||
|
||||
@@ -849,7 +850,7 @@ std::vector<std::pair<AddrInfo, AddressPosition>> AddrManImpl::GetEntries_(bool
|
||||
std::vector<std::pair<AddrInfo, AddressPosition>> infos;
|
||||
for (int bucket = 0; bucket < bucket_count; ++bucket) {
|
||||
for (int position = 0; position < ADDRMAN_BUCKET_SIZE; ++position) {
|
||||
int id = GetEntry(from_tried, bucket, position);
|
||||
nid_type id = GetEntry(from_tried, bucket, position);
|
||||
if (id >= 0) {
|
||||
AddrInfo info = mapInfo.at(id);
|
||||
AddressPosition location = AddressPosition(
|
||||
@@ -904,8 +905,8 @@ void AddrManImpl::ResolveCollisions_()
|
||||
{
|
||||
AssertLockHeld(cs);
|
||||
|
||||
for (std::set<int>::iterator it = m_tried_collisions.begin(); it != m_tried_collisions.end();) {
|
||||
int id_new = *it;
|
||||
for (std::set<nid_type>::iterator it = m_tried_collisions.begin(); it != m_tried_collisions.end();) {
|
||||
nid_type id_new = *it;
|
||||
|
||||
bool erase_collision = false;
|
||||
|
||||
@@ -923,7 +924,7 @@ void AddrManImpl::ResolveCollisions_()
|
||||
} else if (vvTried[tried_bucket][tried_bucket_pos] != -1) { // The position in the tried bucket is not empty
|
||||
|
||||
// Get the to-be-evicted address that is being tested
|
||||
int id_old = vvTried[tried_bucket][tried_bucket_pos];
|
||||
nid_type id_old = vvTried[tried_bucket][tried_bucket_pos];
|
||||
AddrInfo& info_old = mapInfo[id_old];
|
||||
|
||||
const auto current_time{Now<NodeSeconds>()};
|
||||
@@ -969,11 +970,11 @@ std::pair<CAddress, NodeSeconds> AddrManImpl::SelectTriedCollision_()
|
||||
|
||||
if (m_tried_collisions.size() == 0) return {};
|
||||
|
||||
std::set<int>::iterator it = m_tried_collisions.begin();
|
||||
std::set<nid_type>::iterator it = m_tried_collisions.begin();
|
||||
|
||||
// Selects a random element from m_tried_collisions
|
||||
std::advance(it, insecure_rand.randrange(m_tried_collisions.size()));
|
||||
int id_new = *it;
|
||||
nid_type id_new = *it;
|
||||
|
||||
// If id_new not found in mapInfo remove it from m_tried_collisions
|
||||
if (mapInfo.count(id_new) != 1) {
|
||||
@@ -1058,15 +1059,15 @@ int AddrManImpl::CheckAddrman() const
|
||||
LOG_TIME_MILLIS_WITH_CATEGORY_MSG_ONCE(
|
||||
strprintf("new %i, tried %i, total %u", nNew, nTried, vRandom.size()), BCLog::ADDRMAN);
|
||||
|
||||
std::unordered_set<int> setTried;
|
||||
std::unordered_map<int, int> mapNew;
|
||||
std::unordered_set<nid_type> setTried;
|
||||
std::unordered_map<nid_type, int> mapNew;
|
||||
std::unordered_map<Network, NewTriedCount> local_counts;
|
||||
|
||||
if (vRandom.size() != (size_t)(nTried + nNew))
|
||||
return -7;
|
||||
|
||||
for (const auto& entry : mapInfo) {
|
||||
int n = entry.first;
|
||||
nid_type n = entry.first;
|
||||
const AddrInfo& info = entry.second;
|
||||
if (info.fInTried) {
|
||||
if (!TicksSinceEpoch<std::chrono::seconds>(info.m_last_success)) {
|
||||
|
||||
@@ -32,6 +32,13 @@ static constexpr int ADDRMAN_NEW_BUCKET_COUNT{1 << ADDRMAN_NEW_BUCKET_COUNT_LOG2
|
||||
static constexpr int32_t ADDRMAN_BUCKET_SIZE_LOG2{6};
|
||||
static constexpr int ADDRMAN_BUCKET_SIZE{1 << ADDRMAN_BUCKET_SIZE_LOG2};
|
||||
|
||||
/**
|
||||
* User-defined type for the internally used nIds
|
||||
* This used to be int, making it feasible for attackers to cause an overflow,
|
||||
* see https://bitcoincore.org/en/2024/07/31/disclose-addrman-int-overflow/
|
||||
*/
|
||||
using nid_type = int64_t;
|
||||
|
||||
/**
|
||||
* Extended statistics about a CAddress
|
||||
*/
|
||||
@@ -179,36 +186,36 @@ private:
|
||||
static constexpr uint8_t INCOMPATIBILITY_BASE = 32;
|
||||
|
||||
//! last used nId
|
||||
int nIdCount GUARDED_BY(cs){0};
|
||||
nid_type nIdCount GUARDED_BY(cs){0};
|
||||
|
||||
//! table with information about all nIds
|
||||
std::unordered_map<int, AddrInfo> mapInfo GUARDED_BY(cs);
|
||||
std::unordered_map<nid_type, AddrInfo> mapInfo GUARDED_BY(cs);
|
||||
|
||||
//! find an nId based on its network address and port.
|
||||
std::unordered_map<CService, int, CServiceHash> mapAddr GUARDED_BY(cs);
|
||||
std::unordered_map<CService, nid_type, CServiceHash> mapAddr GUARDED_BY(cs);
|
||||
|
||||
//! randomly-ordered vector of all nIds
|
||||
//! This is mutable because it is unobservable outside the class, so any
|
||||
//! changes to it (even in const methods) are also unobservable.
|
||||
mutable std::vector<int> vRandom GUARDED_BY(cs);
|
||||
mutable std::vector<nid_type> vRandom GUARDED_BY(cs);
|
||||
|
||||
// number of "tried" entries
|
||||
int nTried GUARDED_BY(cs){0};
|
||||
|
||||
//! list of "tried" buckets
|
||||
int vvTried[ADDRMAN_TRIED_BUCKET_COUNT][ADDRMAN_BUCKET_SIZE] GUARDED_BY(cs);
|
||||
nid_type vvTried[ADDRMAN_TRIED_BUCKET_COUNT][ADDRMAN_BUCKET_SIZE] GUARDED_BY(cs);
|
||||
|
||||
//! number of (unique) "new" entries
|
||||
int nNew GUARDED_BY(cs){0};
|
||||
|
||||
//! list of "new" buckets
|
||||
int vvNew[ADDRMAN_NEW_BUCKET_COUNT][ADDRMAN_BUCKET_SIZE] GUARDED_BY(cs);
|
||||
nid_type vvNew[ADDRMAN_NEW_BUCKET_COUNT][ADDRMAN_BUCKET_SIZE] GUARDED_BY(cs);
|
||||
|
||||
//! last time Good was called (memory only). Initially set to 1 so that "never" is strictly worse.
|
||||
NodeSeconds m_last_good GUARDED_BY(cs){1s};
|
||||
|
||||
//! Holds addrs inserted into tried table that collide with existing entries. Test-before-evict discipline used to resolve these collisions.
|
||||
std::set<int> m_tried_collisions;
|
||||
std::set<nid_type> m_tried_collisions;
|
||||
|
||||
/** Perform consistency checks every m_consistency_check_ratio operations (if non-zero). */
|
||||
const int32_t m_consistency_check_ratio;
|
||||
@@ -225,22 +232,22 @@ private:
|
||||
std::unordered_map<Network, NewTriedCount> m_network_counts GUARDED_BY(cs);
|
||||
|
||||
//! Find an entry.
|
||||
AddrInfo* Find(const CService& addr, int* pnId = nullptr) EXCLUSIVE_LOCKS_REQUIRED(cs);
|
||||
AddrInfo* Find(const CService& addr, nid_type* pnId = nullptr) EXCLUSIVE_LOCKS_REQUIRED(cs);
|
||||
|
||||
//! Create a new entry and add it to the internal data structures mapInfo, mapAddr and vRandom.
|
||||
AddrInfo* Create(const CAddress& addr, const CNetAddr& addrSource, int* pnId = nullptr) EXCLUSIVE_LOCKS_REQUIRED(cs);
|
||||
AddrInfo* Create(const CAddress& addr, const CNetAddr& addrSource, nid_type* pnId = nullptr) EXCLUSIVE_LOCKS_REQUIRED(cs);
|
||||
|
||||
//! Swap two elements in vRandom.
|
||||
void SwapRandom(unsigned int nRandomPos1, unsigned int nRandomPos2) const EXCLUSIVE_LOCKS_REQUIRED(cs);
|
||||
|
||||
//! Delete an entry. It must not be in tried, and have refcount 0.
|
||||
void Delete(int nId) EXCLUSIVE_LOCKS_REQUIRED(cs);
|
||||
void Delete(nid_type nId) EXCLUSIVE_LOCKS_REQUIRED(cs);
|
||||
|
||||
//! Clear a position in a "new" table. This is the only place where entries are actually deleted.
|
||||
void ClearNew(int nUBucket, int nUBucketPos) EXCLUSIVE_LOCKS_REQUIRED(cs);
|
||||
|
||||
//! Move an entry from the "new" table(s) to the "tried" table
|
||||
void MakeTried(AddrInfo& info, int nId) EXCLUSIVE_LOCKS_REQUIRED(cs);
|
||||
void MakeTried(AddrInfo& info, nid_type nId) EXCLUSIVE_LOCKS_REQUIRED(cs);
|
||||
|
||||
/** Attempt to add a single address to addrman's new table.
|
||||
* @see AddrMan::Add() for parameters. */
|
||||
@@ -256,9 +263,9 @@ private:
|
||||
|
||||
/** Helper to generalize looking up an addrman entry from either table.
|
||||
*
|
||||
* @return int The nid of the entry. If the addrman position is empty or not found, returns -1.
|
||||
* @return nid_type The nid of the entry. If the addrman position is empty or not found, returns -1.
|
||||
* */
|
||||
int GetEntry(bool use_tried, size_t bucket, size_t position) const EXCLUSIVE_LOCKS_REQUIRED(cs);
|
||||
nid_type GetEntry(bool use_tried, size_t bucket, size_t position) const EXCLUSIVE_LOCKS_REQUIRED(cs);
|
||||
|
||||
std::vector<CAddress> GetAddr_(size_t max_addresses, size_t max_pct, std::optional<Network> network, const bool filtered = true) const EXCLUSIVE_LOCKS_REQUIRED(cs);
|
||||
|
||||
|
||||
@@ -41,15 +41,15 @@ std::unique_ptr<CBaseChainParams> CreateBaseChainParams(const ChainType chain)
|
||||
{
|
||||
switch (chain) {
|
||||
case ChainType::MAIN:
|
||||
return std::make_unique<CBaseChainParams>("", 8332, 8334);
|
||||
return std::make_unique<CBaseChainParams>("", 8332);
|
||||
case ChainType::TESTNET:
|
||||
return std::make_unique<CBaseChainParams>("testnet3", 18332, 18334);
|
||||
return std::make_unique<CBaseChainParams>("testnet3", 18332);
|
||||
case ChainType::TESTNET4:
|
||||
return std::make_unique<CBaseChainParams>("testnet4", 48332, 48334);
|
||||
return std::make_unique<CBaseChainParams>("testnet4", 48332);
|
||||
case ChainType::SIGNET:
|
||||
return std::make_unique<CBaseChainParams>("signet", 38332, 38334);
|
||||
return std::make_unique<CBaseChainParams>("signet", 38332);
|
||||
case ChainType::REGTEST:
|
||||
return std::make_unique<CBaseChainParams>("regtest", 18443, 18445);
|
||||
return std::make_unique<CBaseChainParams>("regtest", 18443);
|
||||
}
|
||||
assert(false);
|
||||
}
|
||||
|
||||
@@ -22,15 +22,13 @@ class CBaseChainParams
|
||||
public:
|
||||
const std::string& DataDir() const { return strDataDir; }
|
||||
uint16_t RPCPort() const { return m_rpc_port; }
|
||||
uint16_t OnionServiceTargetPort() const { return m_onion_service_target_port; }
|
||||
|
||||
CBaseChainParams() = delete;
|
||||
CBaseChainParams(const std::string& data_dir, uint16_t rpc_port, uint16_t onion_service_target_port)
|
||||
: m_rpc_port(rpc_port), m_onion_service_target_port(onion_service_target_port), strDataDir(data_dir) {}
|
||||
CBaseChainParams(const std::string& data_dir, uint16_t rpc_port)
|
||||
: m_rpc_port(rpc_port), strDataDir(data_dir) {}
|
||||
|
||||
private:
|
||||
const uint16_t m_rpc_port;
|
||||
const uint16_t m_onion_service_target_port;
|
||||
std::string strDataDir;
|
||||
};
|
||||
|
||||
|
||||
10
src/init.cpp
10
src/init.cpp
@@ -524,7 +524,7 @@ void SetupServerArgs(ArgsManager& argsman)
|
||||
argsman.AddArg("-addnode=<ip>", strprintf("Add a node to connect to and attempt to keep the connection open (see the addnode RPC help for more info). This option can be specified multiple times to add multiple nodes; connections are limited to %u at a time and are counted separately from the -maxconnections limit.", MAX_ADDNODE_CONNECTIONS), ArgsManager::ALLOW_ANY | ArgsManager::NETWORK_ONLY, OptionsCategory::CONNECTION);
|
||||
argsman.AddArg("-asmap=<file>", strprintf("Specify asn mapping used for bucketing of the peers (default: %s). Relative paths will be prefixed by the net-specific datadir location.", DEFAULT_ASMAP_FILENAME), ArgsManager::ALLOW_ANY, OptionsCategory::CONNECTION);
|
||||
argsman.AddArg("-bantime=<n>", strprintf("Default duration (in seconds) of manually configured bans (default: %u)", DEFAULT_MISBEHAVING_BANTIME), ArgsManager::ALLOW_ANY, OptionsCategory::CONNECTION);
|
||||
argsman.AddArg("-bind=<addr>[:<port>][=onion]", strprintf("Bind to given address and always listen on it (default: 0.0.0.0). Use [host]:port notation for IPv6. Append =onion to tag any incoming connections to that address and port as incoming Tor connections (default: 127.0.0.1:%u=onion, testnet3: 127.0.0.1:%u=onion, testnet4: 127.0.0.1:%u=onion, signet: 127.0.0.1:%u=onion, regtest: 127.0.0.1:%u=onion)", defaultBaseParams->OnionServiceTargetPort(), testnetBaseParams->OnionServiceTargetPort(), testnet4BaseParams->OnionServiceTargetPort(), signetBaseParams->OnionServiceTargetPort(), regtestBaseParams->OnionServiceTargetPort()), ArgsManager::ALLOW_ANY | ArgsManager::NETWORK_ONLY, OptionsCategory::CONNECTION);
|
||||
argsman.AddArg("-bind=<addr>[:<port>][=onion]", strprintf("Bind to given address and always listen on it (default: 0.0.0.0). Use [host]:port notation for IPv6. Append =onion to tag any incoming connections to that address and port as incoming Tor connections (default: 127.0.0.1:%u=onion, testnet3: 127.0.0.1:%u=onion, testnet4: 127.0.0.1:%u=onion, signet: 127.0.0.1:%u=onion, regtest: 127.0.0.1:%u=onion)", defaultChainParams->GetDefaultPort() + 1, testnetChainParams->GetDefaultPort() + 1, testnet4ChainParams->GetDefaultPort() + 1, signetChainParams->GetDefaultPort() + 1, regtestChainParams->GetDefaultPort() + 1), ArgsManager::ALLOW_ANY | ArgsManager::NETWORK_ONLY, OptionsCategory::CONNECTION);
|
||||
argsman.AddArg("-cjdnsreachable", "If set, then this host is configured for CJDNS (connecting to fc00::/8 addresses would lead us to the CJDNS network, see doc/cjdns.md) (default: 0)", ArgsManager::ALLOW_ANY, OptionsCategory::CONNECTION);
|
||||
argsman.AddArg("-connect=<ip>", "Connect only to the specified node; -noconnect disables automatic connections (the rules for this peer are the same as for -addnode). This option can be specified multiple times to connect to multiple nodes.", ArgsManager::ALLOW_ANY | ArgsManager::NETWORK_ONLY, OptionsCategory::CONNECTION);
|
||||
argsman.AddArg("-discover", "Discover own IP addresses (default: 1 when listening and no -externalip or -proxy)", ArgsManager::ALLOW_ANY, OptionsCategory::CONNECTION);
|
||||
@@ -551,7 +551,7 @@ void SetupServerArgs(ArgsManager& argsman)
|
||||
argsman.AddArg("-peerbloomfilters", strprintf("Support filtering of blocks and transaction with bloom filters (default: %u)", DEFAULT_PEERBLOOMFILTERS), ArgsManager::ALLOW_ANY, OptionsCategory::CONNECTION);
|
||||
argsman.AddArg("-peerblockfilters", strprintf("Serve compact block filters to peers per BIP 157 (default: %u)", DEFAULT_PEERBLOCKFILTERS), ArgsManager::ALLOW_ANY, OptionsCategory::CONNECTION);
|
||||
argsman.AddArg("-txreconciliation", strprintf("Enable transaction reconciliations per BIP 330 (default: %d)", DEFAULT_TXRECONCILIATION_ENABLE), ArgsManager::ALLOW_ANY | ArgsManager::DEBUG_ONLY, OptionsCategory::CONNECTION);
|
||||
argsman.AddArg("-port=<port>", strprintf("Listen for connections on <port> (default: %u, testnet3: %u, testnet4: %u, signet: %u, regtest: %u). Not relevant for I2P (see doc/i2p.md).", defaultChainParams->GetDefaultPort(), testnetChainParams->GetDefaultPort(), testnet4ChainParams->GetDefaultPort(), signetChainParams->GetDefaultPort(), regtestChainParams->GetDefaultPort()), ArgsManager::ALLOW_ANY | ArgsManager::NETWORK_ONLY, OptionsCategory::CONNECTION);
|
||||
argsman.AddArg("-port=<port>", strprintf("Listen for connections on <port> (default: %u, testnet3: %u, testnet4: %u, signet: %u, regtest: %u). Not relevant for I2P (see doc/i2p.md). If set to a value x, the default onion listening port will be set to x+1.", defaultChainParams->GetDefaultPort(), testnetChainParams->GetDefaultPort(), testnet4ChainParams->GetDefaultPort(), signetChainParams->GetDefaultPort(), regtestChainParams->GetDefaultPort()), ArgsManager::ALLOW_ANY | ArgsManager::NETWORK_ONLY, OptionsCategory::CONNECTION);
|
||||
#ifdef HAVE_SOCKADDR_UN
|
||||
argsman.AddArg("-proxy=<ip:port|path>", "Connect through SOCKS5 proxy, set -noproxy to disable (default: disabled). May be a local file path prefixed with 'unix:' if the proxy supports it.", ArgsManager::ALLOW_ANY | ArgsManager::DISALLOW_ELISION, OptionsCategory::CONNECTION);
|
||||
#else
|
||||
@@ -1852,6 +1852,8 @@ bool AppInitMain(NodeContext& node, interfaces::BlockAndHeaderTipInfo* tip_info)
|
||||
const uint16_t default_bind_port =
|
||||
static_cast<uint16_t>(args.GetIntArg("-port", Params().GetDefaultPort()));
|
||||
|
||||
const uint16_t default_bind_port_onion = default_bind_port + 1;
|
||||
|
||||
const auto BadPortWarning = [](const char* prefix, uint16_t port) {
|
||||
return strprintf(_("%s request to listen on port %u. This port is considered \"bad\" and "
|
||||
"thus it is unlikely that any peer will connect to it. See "
|
||||
@@ -1876,7 +1878,7 @@ bool AppInitMain(NodeContext& node, interfaces::BlockAndHeaderTipInfo* tip_info)
|
||||
const std::string network_type = bind_arg.substr(index + 1);
|
||||
if (network_type == "onion") {
|
||||
const std::string truncated_bind_arg = bind_arg.substr(0, index);
|
||||
bind_addr = Lookup(truncated_bind_arg, BaseParams().OnionServiceTargetPort(), false);
|
||||
bind_addr = Lookup(truncated_bind_arg, default_bind_port_onion, false);
|
||||
if (bind_addr.has_value()) {
|
||||
connOptions.onion_binds.push_back(bind_addr.value());
|
||||
continue;
|
||||
@@ -1912,7 +1914,7 @@ bool AppInitMain(NodeContext& node, interfaces::BlockAndHeaderTipInfo* tip_info)
|
||||
} else if (!connOptions.vBinds.empty()) {
|
||||
onion_service_target = connOptions.vBinds.front();
|
||||
} else {
|
||||
onion_service_target = DefaultOnionServiceTarget();
|
||||
onion_service_target = DefaultOnionServiceTarget(default_bind_port_onion);
|
||||
connOptions.onion_binds.push_back(onion_service_target);
|
||||
}
|
||||
|
||||
|
||||
@@ -274,6 +274,9 @@ CExtKey DecodeExtKey(const std::string& str)
|
||||
key.Decode(data.data() + prefix.size());
|
||||
}
|
||||
}
|
||||
if (!data.empty()) {
|
||||
memory_cleanse(data.data(), data.size());
|
||||
}
|
||||
return key;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// Copyright (c) 2010 Satoshi Nakamoto
|
||||
// Copyright (c) 2009-2022 The Bitcoin Core developers
|
||||
// Copyright (c) 2009-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.
|
||||
|
||||
@@ -370,20 +370,21 @@ static RPCHelpMan generateblock()
|
||||
|
||||
ChainstateManager& chainman = EnsureChainman(node);
|
||||
{
|
||||
std::unique_ptr<CBlockTemplate> blocktemplate{miner.createNewBlock(coinbase_script, {.use_mempool = false})};
|
||||
if (!blocktemplate) {
|
||||
throw JSONRPCError(RPC_INTERNAL_ERROR, "Couldn't create new block");
|
||||
LOCK(chainman.GetMutex());
|
||||
{
|
||||
std::unique_ptr<CBlockTemplate> blocktemplate{miner.createNewBlock(coinbase_script, {.use_mempool = false})};
|
||||
if (!blocktemplate) {
|
||||
throw JSONRPCError(RPC_INTERNAL_ERROR, "Couldn't create new block");
|
||||
}
|
||||
block = blocktemplate->block;
|
||||
}
|
||||
block = blocktemplate->block;
|
||||
}
|
||||
|
||||
CHECK_NONFATAL(block.vtx.size() == 1);
|
||||
CHECK_NONFATAL(block.vtx.size() == 1);
|
||||
|
||||
// Add transactions
|
||||
block.vtx.insert(block.vtx.end(), txs.begin(), txs.end());
|
||||
RegenerateCommitments(block, chainman);
|
||||
// Add transactions
|
||||
block.vtx.insert(block.vtx.end(), txs.begin(), txs.end());
|
||||
RegenerateCommitments(block, chainman);
|
||||
|
||||
{
|
||||
BlockValidationState state;
|
||||
if (!miner.testBlockValidity(block, /*check_merkle_root=*/false, state)) {
|
||||
throw JSONRPCError(RPC_VERIFY_ERROR, strprintf("testBlockValidity failed: %s", state.ToString()));
|
||||
|
||||
@@ -1,14 +1,17 @@
|
||||
// Copyright (c) 2019-2022 The Bitcoin Core developers
|
||||
// Copyright (c) 2019-present The Bitcoin Core developers
|
||||
// Distributed under the MIT software license, see the accompanying
|
||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
|
||||
#include <string>
|
||||
#include <limits>
|
||||
#include <vector>
|
||||
#include <script/script.h>
|
||||
#include <script/miniscript.h>
|
||||
#include <serialize.h>
|
||||
|
||||
#include <assert.h>
|
||||
#include <primitives/transaction.h>
|
||||
#include <script/miniscript.h>
|
||||
#include <script/script.h>
|
||||
#include <script/solver.h>
|
||||
#include <span.h>
|
||||
#include <util/check.h>
|
||||
#include <util/vector.h>
|
||||
|
||||
namespace miniscript {
|
||||
namespace internal {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright (c) 2019-2022 The Bitcoin Core developers
|
||||
// Copyright (c) 2019-present The Bitcoin Core developers
|
||||
// Distributed under the MIT software license, see the accompanying
|
||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
|
||||
@@ -6,20 +6,24 @@
|
||||
#define BITCOIN_SCRIPT_MINISCRIPT_H
|
||||
|
||||
#include <algorithm>
|
||||
#include <functional>
|
||||
#include <numeric>
|
||||
#include <compare>
|
||||
#include <cstdint>
|
||||
#include <cstdlib>
|
||||
#include <iterator>
|
||||
#include <memory>
|
||||
#include <optional>
|
||||
#include <string>
|
||||
#include <set>
|
||||
#include <stdexcept>
|
||||
#include <tuple>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
#include <assert.h>
|
||||
#include <cstdlib>
|
||||
|
||||
#include <consensus/consensus.h>
|
||||
#include <policy/policy.h>
|
||||
#include <primitives/transaction.h>
|
||||
#include <script/interpreter.h>
|
||||
#include <script/parsing.h>
|
||||
#include <script/script.h>
|
||||
#include <serialize.h>
|
||||
#include <span.h>
|
||||
#include <util/check.h>
|
||||
#include <util/strencodings.h>
|
||||
@@ -150,7 +154,8 @@ public:
|
||||
};
|
||||
|
||||
//! Literal operator to construct Type objects.
|
||||
inline consteval Type operator"" _mst(const char* c, size_t l) {
|
||||
inline consteval Type operator""_mst(const char* c, size_t l)
|
||||
{
|
||||
Type typ{Type::Make(0)};
|
||||
|
||||
for (const char *p = c; p < c + l; p++) {
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
#include <climits>
|
||||
#include <cstddef>
|
||||
#include <cstdint>
|
||||
#include <cstdlib>
|
||||
#include <cstring>
|
||||
#include <initializer_list>
|
||||
#include <limits>
|
||||
|
||||
@@ -186,7 +186,7 @@ public:
|
||||
return false;
|
||||
}
|
||||
|
||||
auto IdsReferToSameAddress = [&](int id, int other_id) EXCLUSIVE_LOCKS_REQUIRED(m_impl->cs, other.m_impl->cs) {
|
||||
auto IdsReferToSameAddress = [&](nid_type id, nid_type other_id) EXCLUSIVE_LOCKS_REQUIRED(m_impl->cs, other.m_impl->cs) {
|
||||
if (id == -1 && other_id == -1) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@ using NodeRef = miniscript::NodeRef<CPubKey>;
|
||||
using Node = miniscript::Node<CPubKey>;
|
||||
using Type = miniscript::Type;
|
||||
using MsCtx = miniscript::MiniscriptContext;
|
||||
using miniscript::operator"" _mst;
|
||||
using miniscript::operator""_mst;
|
||||
|
||||
//! Some pre-computed data for more efficient string roundtrips and to simulate challenges.
|
||||
struct TestData {
|
||||
|
||||
@@ -290,7 +290,7 @@ public:
|
||||
|
||||
using Fragment = miniscript::Fragment;
|
||||
using NodeRef = miniscript::NodeRef<CPubKey>;
|
||||
using miniscript::operator"" _mst;
|
||||
using miniscript::operator""_mst;
|
||||
using Node = miniscript::Node<CPubKey>;
|
||||
|
||||
/** Compute all challenges (pubkeys, hashes, timelocks) that occur in a given Miniscript. */
|
||||
|
||||
@@ -711,9 +711,9 @@ void StopTorControl()
|
||||
}
|
||||
}
|
||||
|
||||
CService DefaultOnionServiceTarget()
|
||||
CService DefaultOnionServiceTarget(uint16_t port)
|
||||
{
|
||||
struct in_addr onion_service_target;
|
||||
onion_service_target.s_addr = htonl(INADDR_LOOPBACK);
|
||||
return {onion_service_target, BaseParams().OnionServiceTargetPort()};
|
||||
return {onion_service_target, port};
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ void StartTorControl(CService onion_service_target);
|
||||
void InterruptTorControl();
|
||||
void StopTorControl();
|
||||
|
||||
CService DefaultOnionServiceTarget();
|
||||
CService DefaultOnionServiceTarget(uint16_t port);
|
||||
|
||||
/** Reply from Tor, can be single or multi-line */
|
||||
class TorControlReply
|
||||
|
||||
@@ -366,7 +366,7 @@ public:
|
||||
if (count) {
|
||||
unsigned i = 0;
|
||||
while (count > LIMB_BITS) {
|
||||
ret.m_val[i++] = ~I{0};
|
||||
ret.m_val[i++] = I(~I{0});
|
||||
count -= LIMB_BITS;
|
||||
}
|
||||
ret.m_val[i] = I(~I{0}) >> (LIMB_BITS - count);
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -398,6 +398,7 @@ class EstimateFeeTest(BitcoinTestFramework):
|
||||
self.start_node(0)
|
||||
self.connect_nodes(0, 1)
|
||||
self.connect_nodes(0, 2)
|
||||
self.sync_blocks()
|
||||
assert_equal(self.nodes[0].estimatesmartfee(1)["errors"], ["Insufficient data or no feerate found"])
|
||||
|
||||
def broadcast_and_mine(self, broadcaster, miner, feerate, count):
|
||||
|
||||
60
test/functional/feature_port.py
Executable file
60
test/functional/feature_port.py
Executable file
@@ -0,0 +1,60 @@
|
||||
#!/usr/bin/env python3
|
||||
# Copyright (c) 2024-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.
|
||||
"""
|
||||
Test the -port option and its interactions with
|
||||
-bind.
|
||||
"""
|
||||
|
||||
from test_framework.test_framework import (
|
||||
BitcoinTestFramework,
|
||||
)
|
||||
from test_framework.util import (
|
||||
p2p_port,
|
||||
)
|
||||
|
||||
|
||||
class PortTest(BitcoinTestFramework):
|
||||
def set_test_params(self):
|
||||
self.setup_clean_chain = True
|
||||
# Avoid any -bind= on the command line.
|
||||
self.bind_to_localhost_only = False
|
||||
self.num_nodes = 1
|
||||
|
||||
def run_test(self):
|
||||
node = self.nodes[0]
|
||||
node.has_explicit_bind = True
|
||||
port1 = p2p_port(self.num_nodes)
|
||||
port2 = p2p_port(self.num_nodes + 5)
|
||||
|
||||
self.log.info("When starting with -port, bitcoind binds to it and uses port + 1 for an onion bind")
|
||||
with node.assert_debug_log(expected_msgs=[f'Bound to 0.0.0.0:{port1}', f'Bound to 127.0.0.1:{port1 + 1}']):
|
||||
self.restart_node(0, extra_args=["-listen", f"-port={port1}"])
|
||||
|
||||
self.log.info("When specifying -port multiple times, only the last one is taken")
|
||||
with node.assert_debug_log(expected_msgs=[f'Bound to 0.0.0.0:{port2}', f'Bound to 127.0.0.1:{port2 + 1}'], unexpected_msgs=[f'Bound to 0.0.0.0:{port1}']):
|
||||
self.restart_node(0, extra_args=["-listen", f"-port={port1}", f"-port={port2}"])
|
||||
|
||||
self.log.info("When specifying ports with both -port and -bind, the one from -port is ignored")
|
||||
with node.assert_debug_log(expected_msgs=[f'Bound to 0.0.0.0:{port2}'], unexpected_msgs=[f'Bound to 0.0.0.0:{port1}']):
|
||||
self.restart_node(0, extra_args=["-listen", f"-port={port1}", f"-bind=0.0.0.0:{port2}"])
|
||||
|
||||
self.log.info("When -bind specifies no port, the values from -port and -bind are combined")
|
||||
with self.nodes[0].assert_debug_log(expected_msgs=[f'Bound to 0.0.0.0:{port1}']):
|
||||
self.restart_node(0, extra_args=["-listen", f"-port={port1}", "-bind=0.0.0.0"])
|
||||
|
||||
self.log.info("When an onion bind specifies no port, the value from -port, incremented by 1, is taken")
|
||||
with self.nodes[0].assert_debug_log(expected_msgs=[f'Bound to 127.0.0.1:{port1 + 1}']):
|
||||
self.restart_node(0, extra_args=["-listen", f"-port={port1}", "-bind=127.0.0.1=onion"])
|
||||
|
||||
self.log.info("Invalid values for -port raise errors")
|
||||
self.stop_node(0)
|
||||
node.extra_args = ["-listen", "-port=65536"]
|
||||
node.assert_start_raises_init_error(expected_msg="Error: Invalid port specified in -port: '65536'")
|
||||
node.extra_args = ["-listen", "-port=0"]
|
||||
node.assert_start_raises_init_error(expected_msg="Error: Invalid port specified in -port: '0'")
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
PortTest(__file__).main()
|
||||
@@ -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 = """
|
||||
@@ -166,7 +167,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.
|
||||
|
||||
@@ -19,7 +19,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 = """
|
||||
@@ -144,7 +147,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))
|
||||
@@ -181,7 +184,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))
|
||||
@@ -227,7 +230,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, __):
|
||||
events.append(bpf["replaced_events"].event(data))
|
||||
@@ -278,7 +281,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 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
|
||||
@@ -40,7 +43,8 @@ net_tracepoints_program = """
|
||||
MAX_MSG_TYPE_LENGTH,
|
||||
MAX_MSG_DATA_LENGTH
|
||||
) + """
|
||||
#define MIN(a,b) ({ __typeof__ (a) _a = (a); __typeof__ (b) _b = (b); _a < _b ? _a : _b; })
|
||||
// A min() macro. Prefixed with _TRACEPOINT_TEST to avoid collision with other MIN macros.
|
||||
#define _TRACEPOINT_TEST_MIN(a,b) ({ __typeof__ (a) _a = (a); __typeof__ (b) _b = (b); _a < _b ? _a : _b; })
|
||||
|
||||
struct p2p_message
|
||||
{
|
||||
@@ -60,7 +64,7 @@ int trace_inbound_message(struct pt_regs *ctx) {
|
||||
bpf_usdt_readarg_p(3, ctx, &msg.peer_conn_type, MAX_PEER_CONN_TYPE_LENGTH);
|
||||
bpf_usdt_readarg_p(4, ctx, &msg.msg_type, MAX_MSG_TYPE_LENGTH);
|
||||
bpf_usdt_readarg(5, ctx, &msg.msg_size);
|
||||
bpf_usdt_readarg_p(6, ctx, &msg.msg, MIN(msg.msg_size, MAX_MSG_DATA_LENGTH));
|
||||
bpf_usdt_readarg_p(6, ctx, &msg.msg, _TRACEPOINT_TEST_MIN(msg.msg_size, MAX_MSG_DATA_LENGTH));
|
||||
inbound_messages.perf_submit(ctx, &msg, sizeof(msg));
|
||||
return 0;
|
||||
}
|
||||
@@ -73,7 +77,7 @@ int trace_outbound_message(struct pt_regs *ctx) {
|
||||
bpf_usdt_readarg_p(3, ctx, &msg.peer_conn_type, MAX_PEER_CONN_TYPE_LENGTH);
|
||||
bpf_usdt_readarg_p(4, ctx, &msg.msg_type, MAX_MSG_TYPE_LENGTH);
|
||||
bpf_usdt_readarg(5, ctx, &msg.msg_size);
|
||||
bpf_usdt_readarg_p(6, ctx, &msg.msg, MIN(msg.msg_size, MAX_MSG_DATA_LENGTH));
|
||||
bpf_usdt_readarg_p(6, ctx, &msg.msg, _TRACEPOINT_TEST_MIN(msg.msg_size, MAX_MSG_DATA_LENGTH));
|
||||
outbound_messages.perf_submit(ctx, &msg, sizeof(msg));
|
||||
return 0;
|
||||
};
|
||||
@@ -114,7 +118,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
|
||||
|
||||
@@ -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 = """
|
||||
@@ -175,7 +178,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
|
||||
@@ -244,7 +247,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
|
||||
@@ -333,7 +336,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
|
||||
@@ -390,7 +393,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(f"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.
|
||||
|
||||
@@ -17,8 +17,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>
|
||||
@@ -94,7 +96,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
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
#!/usr/bin/env python3
|
||||
# Copyright (c) 2020-2022 The Bitcoin Core developers
|
||||
# Copyright (c) 2020-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.
|
||||
"""Test generate* RPCs."""
|
||||
|
||||
from concurrent.futures import ThreadPoolExecutor
|
||||
|
||||
from test_framework.test_framework import BitcoinTestFramework
|
||||
from test_framework.wallet import MiniWallet
|
||||
from test_framework.util import (
|
||||
@@ -83,6 +85,13 @@ class RPCGenerateTest(BitcoinTestFramework):
|
||||
txid = block['tx'][1]
|
||||
assert_equal(node.getrawtransaction(txid=txid, verbose=False, blockhash=hash), rawtx)
|
||||
|
||||
# Ensure that generateblock can be called concurrently by many threads.
|
||||
self.log.info('Generate blocks in parallel')
|
||||
generate_50_blocks = lambda n: [n.generateblock(output=address, transactions=[]) for _ in range(50)]
|
||||
rpcs = [node.cli for _ in range(6)]
|
||||
with ThreadPoolExecutor(max_workers=len(rpcs)) as threads:
|
||||
list(threads.map(generate_50_blocks, rpcs))
|
||||
|
||||
self.log.info('Fail to generate block with out of order txs')
|
||||
txid1 = miniwallet.send_self_transfer(from_node=node)['txid']
|
||||
utxo1 = miniwallet.get_utxo(txid=txid1)
|
||||
|
||||
@@ -220,10 +220,9 @@ class TestNode():
|
||||
extra_args = self.extra_args
|
||||
|
||||
# If listening and no -bind is given, then bitcoind would bind P2P ports on
|
||||
# 0.0.0.0:P and 127.0.0.1:18445 (for incoming Tor connections), where P is
|
||||
# 0.0.0.0:P and 127.0.0.1:P+1 (for incoming Tor connections), where P is
|
||||
# a unique port chosen by the test framework and configured as port=P in
|
||||
# bitcoin.conf. To avoid collisions on 127.0.0.1:18445, change it to
|
||||
# 127.0.0.1:tor_port().
|
||||
# bitcoin.conf. To avoid collisions, change it to 127.0.0.1:tor_port().
|
||||
will_listen = all(e != "-nolisten" and e != "-listen=0" for e in extra_args)
|
||||
has_explicit_bind = self.has_explicit_bind or any(e.startswith("-bind=") for e in extra_args)
|
||||
if will_listen and not has_explicit_bind:
|
||||
@@ -915,6 +914,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")
|
||||
|
||||
@@ -301,6 +301,13 @@ def wait_until_helper_internal(predicate, *, attempts=float('inf'), timeout=floa
|
||||
raise RuntimeError('Unreachable')
|
||||
|
||||
|
||||
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:
|
||||
|
||||
@@ -335,6 +335,7 @@ BASE_SCRIPTS = [
|
||||
'feature_minchainwork.py',
|
||||
'rpc_estimatefee.py',
|
||||
'rpc_getblockstats.py',
|
||||
'feature_port.py',
|
||||
'feature_bind_port_externalip.py',
|
||||
'wallet_create_tx.py --legacy-wallet',
|
||||
'wallet_send.py --legacy-wallet',
|
||||
|
||||
Reference in New Issue
Block a user