mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-09 11:27:28 -03:00
Merge bitcoin/bitcoin#31594: [28.x] 28.1 backports and final changes
Some checks failed
Some checks failed
36314b8da2
doc: Update 28.1 release notes (MarcoFalke)58910279dc
doc: generate 28.1 manpages (Ava Chow)6a68ef9bfb
build: bump to 28.1 (Ava Chow)5b368f88a9
depends: Fix CXXFLAGS on NetBSD (Hennadii Stepanov)05cd448e33
test: generateblocks called by multiple threads (MarcoFalke)621c634b7f
rpc: Extend scope of validation mutex in generateblock (MarcoFalke) Pull request description: Backports: - #31502 - #31563 ACKs for top commit: glozow: reACK36314b8da2
achow101: ACK36314b8da2
Tree-SHA512: c7a624b4c166f4322011d98d1ca814ae98eaf5fd2481a507cd65a50216f1abbb91f8643508ce81f64f8b10fa2210db1722254c343253f2a950b9c64667735e9b
This commit is contained in:
commit
32efe85043
11 changed files with 46 additions and 35 deletions
|
@ -2,7 +2,7 @@ AC_PREREQ([2.69])
|
||||||
define(_CLIENT_VERSION_MAJOR, 28)
|
define(_CLIENT_VERSION_MAJOR, 28)
|
||||||
define(_CLIENT_VERSION_MINOR, 1)
|
define(_CLIENT_VERSION_MINOR, 1)
|
||||||
define(_CLIENT_VERSION_BUILD, 0)
|
define(_CLIENT_VERSION_BUILD, 0)
|
||||||
define(_CLIENT_VERSION_RC, 2)
|
define(_CLIENT_VERSION_RC, 0)
|
||||||
define(_CLIENT_VERSION_IS_RELEASE, true)
|
define(_CLIENT_VERSION_IS_RELEASE, true)
|
||||||
define(_COPYRIGHT_YEAR, 2024)
|
define(_COPYRIGHT_YEAR, 2024)
|
||||||
define(_COPYRIGHT_HOLDERS,[The %s developers])
|
define(_COPYRIGHT_HOLDERS,[The %s developers])
|
||||||
|
|
|
@ -7,8 +7,6 @@ netbsd_NM = $(host_toolchain)gcc-nm
|
||||||
netbsd_RANLIB = $(host_toolchain)gcc-ranlib
|
netbsd_RANLIB = $(host_toolchain)gcc-ranlib
|
||||||
endif
|
endif
|
||||||
|
|
||||||
netbsd_CXXFLAGS=$(netbsd_CFLAGS)
|
|
||||||
|
|
||||||
netbsd_release_CFLAGS=-O2
|
netbsd_release_CFLAGS=-O2
|
||||||
netbsd_release_CXXFLAGS=$(netbsd_release_CFLAGS)
|
netbsd_release_CXXFLAGS=$(netbsd_release_CFLAGS)
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3.
|
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3.
|
||||||
.TH BITCOIN-CLI "1" "December 2024" "bitcoin-cli v28.1.0rc2" "User Commands"
|
.TH BITCOIN-CLI "1" "December 2024" "bitcoin-cli v28.1.0" "User Commands"
|
||||||
.SH NAME
|
.SH NAME
|
||||||
bitcoin-cli \- manual page for bitcoin-cli v28.1.0rc2
|
bitcoin-cli \- manual page for bitcoin-cli v28.1.0
|
||||||
.SH SYNOPSIS
|
.SH SYNOPSIS
|
||||||
.B bitcoin-cli
|
.B bitcoin-cli
|
||||||
[\fI\,options\/\fR] \fI\,<command> \/\fR[\fI\,params\/\fR] \fI\,Send command to Bitcoin Core\/\fR
|
[\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.1.0rc2
|
||||||
.B bitcoin-cli
|
.B bitcoin-cli
|
||||||
[\fI\,options\/\fR] \fI\,help <command> Get help for a command\/\fR
|
[\fI\,options\/\fR] \fI\,help <command> Get help for a command\/\fR
|
||||||
.SH DESCRIPTION
|
.SH DESCRIPTION
|
||||||
Bitcoin Core RPC client version v28.1.0rc2
|
Bitcoin Core RPC client version v28.1.0
|
||||||
.SH OPTIONS
|
.SH OPTIONS
|
||||||
.HP
|
.HP
|
||||||
\-?
|
\-?
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3.
|
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3.
|
||||||
.TH BITCOIN-QT "1" "December 2024" "bitcoin-qt v28.1.0rc2" "User Commands"
|
.TH BITCOIN-QT "1" "December 2024" "bitcoin-qt v28.1.0" "User Commands"
|
||||||
.SH NAME
|
.SH NAME
|
||||||
bitcoin-qt \- manual page for bitcoin-qt v28.1.0rc2
|
bitcoin-qt \- manual page for bitcoin-qt v28.1.0
|
||||||
.SH SYNOPSIS
|
.SH SYNOPSIS
|
||||||
.B bitcoin-qt
|
.B bitcoin-qt
|
||||||
[\fI\,command-line options\/\fR] [\fI\,URI\/\fR]
|
[\fI\,command-line options\/\fR] [\fI\,URI\/\fR]
|
||||||
.SH DESCRIPTION
|
.SH DESCRIPTION
|
||||||
Bitcoin Core version v28.1.0rc2
|
Bitcoin Core version v28.1.0
|
||||||
.PP
|
.PP
|
||||||
Optional URI is a Bitcoin address in BIP21 URI format.
|
Optional URI is a Bitcoin address in BIP21 URI format.
|
||||||
.SH OPTIONS
|
.SH OPTIONS
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3.
|
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3.
|
||||||
.TH BITCOIN-TX "1" "December 2024" "bitcoin-tx v28.1.0rc2" "User Commands"
|
.TH BITCOIN-TX "1" "December 2024" "bitcoin-tx v28.1.0" "User Commands"
|
||||||
.SH NAME
|
.SH NAME
|
||||||
bitcoin-tx \- manual page for bitcoin-tx v28.1.0rc2
|
bitcoin-tx \- manual page for bitcoin-tx v28.1.0
|
||||||
.SH SYNOPSIS
|
.SH SYNOPSIS
|
||||||
.B bitcoin-tx
|
.B bitcoin-tx
|
||||||
[\fI\,options\/\fR] \fI\,<hex-tx> \/\fR[\fI\,commands\/\fR] \fI\,Update hex-encoded bitcoin transaction\/\fR
|
[\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.1.0rc2
|
||||||
.B bitcoin-tx
|
.B bitcoin-tx
|
||||||
[\fI\,options\/\fR] \fI\,-create \/\fR[\fI\,commands\/\fR] \fI\,Create hex-encoded bitcoin transaction\/\fR
|
[\fI\,options\/\fR] \fI\,-create \/\fR[\fI\,commands\/\fR] \fI\,Create hex-encoded bitcoin transaction\/\fR
|
||||||
.SH DESCRIPTION
|
.SH DESCRIPTION
|
||||||
Bitcoin Core bitcoin\-tx utility version v28.1.0rc2
|
Bitcoin Core bitcoin\-tx utility version v28.1.0
|
||||||
.SH OPTIONS
|
.SH OPTIONS
|
||||||
.HP
|
.HP
|
||||||
\-?
|
\-?
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3.
|
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3.
|
||||||
.TH BITCOIN-UTIL "1" "December 2024" "bitcoin-util v28.1.0rc2" "User Commands"
|
.TH BITCOIN-UTIL "1" "December 2024" "bitcoin-util v28.1.0" "User Commands"
|
||||||
.SH NAME
|
.SH NAME
|
||||||
bitcoin-util \- manual page for bitcoin-util v28.1.0rc2
|
bitcoin-util \- manual page for bitcoin-util v28.1.0
|
||||||
.SH SYNOPSIS
|
.SH SYNOPSIS
|
||||||
.B bitcoin-util
|
.B bitcoin-util
|
||||||
[\fI\,options\/\fR] [\fI\,commands\/\fR] \fI\,Do stuff\/\fR
|
[\fI\,options\/\fR] [\fI\,commands\/\fR] \fI\,Do stuff\/\fR
|
||||||
.SH DESCRIPTION
|
.SH DESCRIPTION
|
||||||
Bitcoin Core bitcoin\-util utility version v28.1.0rc2
|
Bitcoin Core bitcoin\-util utility version v28.1.0
|
||||||
.SH OPTIONS
|
.SH OPTIONS
|
||||||
.HP
|
.HP
|
||||||
\-?
|
\-?
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3.
|
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3.
|
||||||
.TH BITCOIN-WALLET "1" "December 2024" "bitcoin-wallet v28.1.0rc2" "User Commands"
|
.TH BITCOIN-WALLET "1" "December 2024" "bitcoin-wallet v28.1.0" "User Commands"
|
||||||
.SH NAME
|
.SH NAME
|
||||||
bitcoin-wallet \- manual page for bitcoin-wallet v28.1.0rc2
|
bitcoin-wallet \- manual page for bitcoin-wallet v28.1.0
|
||||||
.SH DESCRIPTION
|
.SH DESCRIPTION
|
||||||
Bitcoin Core bitcoin\-wallet version v28.1.0rc2
|
Bitcoin Core bitcoin\-wallet version v28.1.0
|
||||||
.PP
|
.PP
|
||||||
bitcoin\-wallet is an offline tool for creating and interacting with Bitcoin Core wallet files.
|
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.
|
By default bitcoin\-wallet will act on wallets in the default mainnet wallet directory in the datadir.
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3.
|
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3.
|
||||||
.TH BITCOIND "1" "December 2024" "bitcoind v28.1.0rc2" "User Commands"
|
.TH BITCOIND "1" "December 2024" "bitcoind v28.1.0" "User Commands"
|
||||||
.SH NAME
|
.SH NAME
|
||||||
bitcoind \- manual page for bitcoind v28.1.0rc2
|
bitcoind \- manual page for bitcoind v28.1.0
|
||||||
.SH SYNOPSIS
|
.SH SYNOPSIS
|
||||||
.B bitcoind
|
.B bitcoind
|
||||||
[\fI\,options\/\fR] \fI\,Start Bitcoin Core\/\fR
|
[\fI\,options\/\fR] \fI\,Start Bitcoin Core\/\fR
|
||||||
.SH DESCRIPTION
|
.SH DESCRIPTION
|
||||||
Bitcoin Core version v28.1.0rc2
|
Bitcoin Core version v28.1.0
|
||||||
.SH OPTIONS
|
.SH OPTIONS
|
||||||
.HP
|
.HP
|
||||||
\-?
|
\-?
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
Bitcoin Core version 28.1rc1 is now available from:
|
Bitcoin Core version 28.1 is now available from:
|
||||||
|
|
||||||
<https://bitcoincore.org/bin/bitcoin-core-28.1/test.rc1>
|
<https://bitcoincore.org/bin/bitcoin-core-28.1>
|
||||||
|
|
||||||
This release includes new features, various bug fixes and performance
|
This release includes new features, various bug fixes and performance
|
||||||
improvements, as well as updated translations.
|
improvements, as well as updated translations.
|
||||||
|
@ -68,12 +68,14 @@ Notable changes
|
||||||
### Build
|
### Build
|
||||||
|
|
||||||
- #31013 depends: For mingw cross compile use `-gcc-posix` to prevent library conflict
|
- #31013 depends: For mingw cross compile use `-gcc-posix` to prevent library conflict
|
||||||
|
- #31502 depends: Fix CXXFLAGS on NetBSD
|
||||||
|
|
||||||
### Test
|
### Test
|
||||||
|
|
||||||
- #31016 test: add missing sync to feature_fee_estimation.py
|
- #31016 test: add missing sync to feature_fee_estimation.py
|
||||||
- #31448 fuzz: add cstdlib to FuzzedDataProvider
|
- #31448 fuzz: add cstdlib to FuzzedDataProvider
|
||||||
- #31419 test: fix MIN macro redefinition
|
- #31419 test: fix MIN macro redefinition
|
||||||
|
- #31563 rpc: Extend scope of validation mutex in generateblock
|
||||||
|
|
||||||
### Doc
|
### Doc
|
||||||
|
|
||||||
|
@ -92,6 +94,7 @@ Credits
|
||||||
=======
|
=======
|
||||||
|
|
||||||
- fanquake
|
- fanquake
|
||||||
|
- Hennadii Stepanov
|
||||||
- laanwj
|
- laanwj
|
||||||
- MarcoFalke
|
- MarcoFalke
|
||||||
- Martin Zumsande
|
- Martin Zumsande
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
// Copyright (c) 2010 Satoshi Nakamoto
|
// 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
|
// Distributed under the MIT software license, see the accompanying
|
||||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||||
|
|
||||||
|
@ -370,20 +370,21 @@ static RPCHelpMan generateblock()
|
||||||
|
|
||||||
ChainstateManager& chainman = EnsureChainman(node);
|
ChainstateManager& chainman = EnsureChainman(node);
|
||||||
{
|
{
|
||||||
std::unique_ptr<CBlockTemplate> blocktemplate{miner.createNewBlock(coinbase_script, {.use_mempool = false})};
|
LOCK(chainman.GetMutex());
|
||||||
if (!blocktemplate) {
|
{
|
||||||
throw JSONRPCError(RPC_INTERNAL_ERROR, "Couldn't create new block");
|
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
|
// Add transactions
|
||||||
block.vtx.insert(block.vtx.end(), txs.begin(), txs.end());
|
block.vtx.insert(block.vtx.end(), txs.begin(), txs.end());
|
||||||
RegenerateCommitments(block, chainman);
|
RegenerateCommitments(block, chainman);
|
||||||
|
|
||||||
{
|
|
||||||
BlockValidationState state;
|
BlockValidationState state;
|
||||||
if (!miner.testBlockValidity(block, /*check_merkle_root=*/false, state)) {
|
if (!miner.testBlockValidity(block, /*check_merkle_root=*/false, state)) {
|
||||||
throw JSONRPCError(RPC_VERIFY_ERROR, strprintf("testBlockValidity failed: %s", state.ToString()));
|
throw JSONRPCError(RPC_VERIFY_ERROR, strprintf("testBlockValidity failed: %s", state.ToString()));
|
||||||
|
|
|
@ -1,9 +1,11 @@
|
||||||
#!/usr/bin/env python3
|
#!/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
|
# Distributed under the MIT software license, see the accompanying
|
||||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||||
"""Test generate* RPCs."""
|
"""Test generate* RPCs."""
|
||||||
|
|
||||||
|
from concurrent.futures import ThreadPoolExecutor
|
||||||
|
|
||||||
from test_framework.test_framework import BitcoinTestFramework
|
from test_framework.test_framework import BitcoinTestFramework
|
||||||
from test_framework.wallet import MiniWallet
|
from test_framework.wallet import MiniWallet
|
||||||
from test_framework.util import (
|
from test_framework.util import (
|
||||||
|
@ -83,6 +85,13 @@ class RPCGenerateTest(BitcoinTestFramework):
|
||||||
txid = block['tx'][1]
|
txid = block['tx'][1]
|
||||||
assert_equal(node.getrawtransaction(txid=txid, verbose=False, blockhash=hash), rawtx)
|
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')
|
self.log.info('Fail to generate block with out of order txs')
|
||||||
txid1 = miniwallet.send_self_transfer(from_node=node)['txid']
|
txid1 = miniwallet.send_self_transfer(from_node=node)['txid']
|
||||||
utxo1 = miniwallet.get_utxo(txid=txid1)
|
utxo1 = miniwallet.get_utxo(txid=txid1)
|
||||||
|
|
Loading…
Reference in a new issue