Skip to content

Commit 32efe85

Browse files
committed
Merge bitcoin#31594: [28.x] 28.1 backports and final changes
36314b8 doc: Update 28.1 release notes (MarcoFalke) 5891027 doc: generate 28.1 manpages (Ava Chow) 6a68ef9 build: bump to 28.1 (Ava Chow) 5b368f8 depends: Fix CXXFLAGS on NetBSD (Hennadii Stepanov) 05cd448 test: generateblocks called by multiple threads (MarcoFalke) 621c634 rpc: Extend scope of validation mutex in generateblock (MarcoFalke) Pull request description: Backports: - bitcoin#31502 - bitcoin#31563 ACKs for top commit: glozow: reACK 36314b8 achow101: ACK 36314b8 Tree-SHA512: c7a624b4c166f4322011d98d1ca814ae98eaf5fd2481a507cd65a50216f1abbb91f8643508ce81f64f8b10fa2210db1722254c343253f2a950b9c64667735e9b
2 parents 6db7256 + 36314b8 commit 32efe85

File tree

11 files changed

+46
-35
lines changed

11 files changed

+46
-35
lines changed

configure.ac

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ AC_PREREQ([2.69])
22
define(_CLIENT_VERSION_MAJOR, 28)
33
define(_CLIENT_VERSION_MINOR, 1)
44
define(_CLIENT_VERSION_BUILD, 0)
5-
define(_CLIENT_VERSION_RC, 2)
5+
define(_CLIENT_VERSION_RC, 0)
66
define(_CLIENT_VERSION_IS_RELEASE, true)
77
define(_COPYRIGHT_YEAR, 2024)
88
define(_COPYRIGHT_HOLDERS,[The %s developers])

depends/hosts/netbsd.mk

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@ netbsd_NM = $(host_toolchain)gcc-nm
77
netbsd_RANLIB = $(host_toolchain)gcc-ranlib
88
endif
99

10-
netbsd_CXXFLAGS=$(netbsd_CFLAGS)
11-
1210
netbsd_release_CFLAGS=-O2
1311
netbsd_release_CXXFLAGS=$(netbsd_release_CFLAGS)
1412

doc/man/bitcoin-cli.1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3.
2-
.TH BITCOIN-CLI "1" "December 2024" "bitcoin-cli v28.1.0rc2" "User Commands"
2+
.TH BITCOIN-CLI "1" "December 2024" "bitcoin-cli v28.1.0" "User Commands"
33
.SH NAME
4-
bitcoin-cli \- manual page for bitcoin-cli v28.1.0rc2
4+
bitcoin-cli \- manual page for bitcoin-cli v28.1.0
55
.SH SYNOPSIS
66
.B bitcoin-cli
77
[\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
1515
.B bitcoin-cli
1616
[\fI\,options\/\fR] \fI\,help <command> Get help for a command\/\fR
1717
.SH DESCRIPTION
18-
Bitcoin Core RPC client version v28.1.0rc2
18+
Bitcoin Core RPC client version v28.1.0
1919
.SH OPTIONS
2020
.HP
2121
\-?

doc/man/bitcoin-qt.1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3.
2-
.TH BITCOIN-QT "1" "December 2024" "bitcoin-qt v28.1.0rc2" "User Commands"
2+
.TH BITCOIN-QT "1" "December 2024" "bitcoin-qt v28.1.0" "User Commands"
33
.SH NAME
4-
bitcoin-qt \- manual page for bitcoin-qt v28.1.0rc2
4+
bitcoin-qt \- manual page for bitcoin-qt v28.1.0
55
.SH SYNOPSIS
66
.B bitcoin-qt
77
[\fI\,command-line options\/\fR] [\fI\,URI\/\fR]
88
.SH DESCRIPTION
9-
Bitcoin Core version v28.1.0rc2
9+
Bitcoin Core version v28.1.0
1010
.PP
1111
Optional URI is a Bitcoin address in BIP21 URI format.
1212
.SH OPTIONS

doc/man/bitcoin-tx.1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3.
2-
.TH BITCOIN-TX "1" "December 2024" "bitcoin-tx v28.1.0rc2" "User Commands"
2+
.TH BITCOIN-TX "1" "December 2024" "bitcoin-tx v28.1.0" "User Commands"
33
.SH NAME
4-
bitcoin-tx \- manual page for bitcoin-tx v28.1.0rc2
4+
bitcoin-tx \- manual page for bitcoin-tx v28.1.0
55
.SH SYNOPSIS
66
.B bitcoin-tx
77
[\fI\,options\/\fR] \fI\,<hex-tx> \/\fR[\fI\,commands\/\fR] \fI\,Update hex-encoded bitcoin transaction\/\fR
88
.br
99
.B bitcoin-tx
1010
[\fI\,options\/\fR] \fI\,-create \/\fR[\fI\,commands\/\fR] \fI\,Create hex-encoded bitcoin transaction\/\fR
1111
.SH DESCRIPTION
12-
Bitcoin Core bitcoin\-tx utility version v28.1.0rc2
12+
Bitcoin Core bitcoin\-tx utility version v28.1.0
1313
.SH OPTIONS
1414
.HP
1515
\-?

doc/man/bitcoin-util.1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3.
2-
.TH BITCOIN-UTIL "1" "December 2024" "bitcoin-util v28.1.0rc2" "User Commands"
2+
.TH BITCOIN-UTIL "1" "December 2024" "bitcoin-util v28.1.0" "User Commands"
33
.SH NAME
4-
bitcoin-util \- manual page for bitcoin-util v28.1.0rc2
4+
bitcoin-util \- manual page for bitcoin-util v28.1.0
55
.SH SYNOPSIS
66
.B bitcoin-util
77
[\fI\,options\/\fR] [\fI\,commands\/\fR] \fI\,Do stuff\/\fR
88
.SH DESCRIPTION
9-
Bitcoin Core bitcoin\-util utility version v28.1.0rc2
9+
Bitcoin Core bitcoin\-util utility version v28.1.0
1010
.SH OPTIONS
1111
.HP
1212
\-?

doc/man/bitcoin-wallet.1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3.
2-
.TH BITCOIN-WALLET "1" "December 2024" "bitcoin-wallet v28.1.0rc2" "User Commands"
2+
.TH BITCOIN-WALLET "1" "December 2024" "bitcoin-wallet v28.1.0" "User Commands"
33
.SH NAME
4-
bitcoin-wallet \- manual page for bitcoin-wallet v28.1.0rc2
4+
bitcoin-wallet \- manual page for bitcoin-wallet v28.1.0
55
.SH DESCRIPTION
6-
Bitcoin Core bitcoin\-wallet version v28.1.0rc2
6+
Bitcoin Core bitcoin\-wallet version v28.1.0
77
.PP
88
bitcoin\-wallet is an offline tool for creating and interacting with Bitcoin Core wallet files.
99
By default bitcoin\-wallet will act on wallets in the default mainnet wallet directory in the datadir.

doc/man/bitcoind.1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3.
2-
.TH BITCOIND "1" "December 2024" "bitcoind v28.1.0rc2" "User Commands"
2+
.TH BITCOIND "1" "December 2024" "bitcoind v28.1.0" "User Commands"
33
.SH NAME
4-
bitcoind \- manual page for bitcoind v28.1.0rc2
4+
bitcoind \- manual page for bitcoind v28.1.0
55
.SH SYNOPSIS
66
.B bitcoind
77
[\fI\,options\/\fR] \fI\,Start Bitcoin Core\/\fR
88
.SH DESCRIPTION
9-
Bitcoin Core version v28.1.0rc2
9+
Bitcoin Core version v28.1.0
1010
.SH OPTIONS
1111
.HP
1212
\-?

doc/release-notes.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
Bitcoin Core version 28.1rc1 is now available from:
1+
Bitcoin Core version 28.1 is now available from:
22

3-
<https://bitcoincore.org/bin/bitcoin-core-28.1/test.rc1>
3+
<https://bitcoincore.org/bin/bitcoin-core-28.1>
44

55
This release includes new features, various bug fixes and performance
66
improvements, as well as updated translations.
@@ -68,12 +68,14 @@ Notable changes
6868
### Build
6969

7070
- #31013 depends: For mingw cross compile use `-gcc-posix` to prevent library conflict
71+
- #31502 depends: Fix CXXFLAGS on NetBSD
7172

7273
### Test
7374

7475
- #31016 test: add missing sync to feature_fee_estimation.py
7576
- #31448 fuzz: add cstdlib to FuzzedDataProvider
7677
- #31419 test: fix MIN macro redefinition
78+
- #31563 rpc: Extend scope of validation mutex in generateblock
7779

7880
### Doc
7981

@@ -92,6 +94,7 @@ Credits
9294
=======
9395

9496
- fanquake
97+
- Hennadii Stepanov
9598
- laanwj
9699
- MarcoFalke
97100
- Martin Zumsande

src/rpc/mining.cpp

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// Copyright (c) 2010 Satoshi Nakamoto
2-
// Copyright (c) 2009-2022 The Bitcoin Core developers
2+
// Copyright (c) 2009-present The Bitcoin Core developers
33
// Distributed under the MIT software license, see the accompanying
44
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
55

@@ -370,20 +370,21 @@ static RPCHelpMan generateblock()
370370

371371
ChainstateManager& chainman = EnsureChainman(node);
372372
{
373-
std::unique_ptr<CBlockTemplate> blocktemplate{miner.createNewBlock(coinbase_script, {.use_mempool = false})};
374-
if (!blocktemplate) {
375-
throw JSONRPCError(RPC_INTERNAL_ERROR, "Couldn't create new block");
373+
LOCK(chainman.GetMutex());
374+
{
375+
std::unique_ptr<CBlockTemplate> blocktemplate{miner.createNewBlock(coinbase_script, {.use_mempool = false})};
376+
if (!blocktemplate) {
377+
throw JSONRPCError(RPC_INTERNAL_ERROR, "Couldn't create new block");
378+
}
379+
block = blocktemplate->block;
376380
}
377-
block = blocktemplate->block;
378-
}
379381

380-
CHECK_NONFATAL(block.vtx.size() == 1);
382+
CHECK_NONFATAL(block.vtx.size() == 1);
381383

382-
// Add transactions
383-
block.vtx.insert(block.vtx.end(), txs.begin(), txs.end());
384-
RegenerateCommitments(block, chainman);
384+
// Add transactions
385+
block.vtx.insert(block.vtx.end(), txs.begin(), txs.end());
386+
RegenerateCommitments(block, chainman);
385387

386-
{
387388
BlockValidationState state;
388389
if (!miner.testBlockValidity(block, /*check_merkle_root=*/false, state)) {
389390
throw JSONRPCError(RPC_VERIFY_ERROR, strprintf("testBlockValidity failed: %s", state.ToString()));

test/functional/rpc_generate.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
#!/usr/bin/env python3
2-
# Copyright (c) 2020-2022 The Bitcoin Core developers
2+
# Copyright (c) 2020-present The Bitcoin Core developers
33
# Distributed under the MIT software license, see the accompanying
44
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
55
"""Test generate* RPCs."""
66

7+
from concurrent.futures import ThreadPoolExecutor
8+
79
from test_framework.test_framework import BitcoinTestFramework
810
from test_framework.wallet import MiniWallet
911
from test_framework.util import (
@@ -83,6 +85,13 @@ def test_generateblock(self):
8385
txid = block['tx'][1]
8486
assert_equal(node.getrawtransaction(txid=txid, verbose=False, blockhash=hash), rawtx)
8587

88+
# Ensure that generateblock can be called concurrently by many threads.
89+
self.log.info('Generate blocks in parallel')
90+
generate_50_blocks = lambda n: [n.generateblock(output=address, transactions=[]) for _ in range(50)]
91+
rpcs = [node.cli for _ in range(6)]
92+
with ThreadPoolExecutor(max_workers=len(rpcs)) as threads:
93+
list(threads.map(generate_50_blocks, rpcs))
94+
8695
self.log.info('Fail to generate block with out of order txs')
8796
txid1 = miniwallet.send_self_transfer(from_node=node)['txid']
8897
utxo1 = miniwallet.get_utxo(txid=txid1)

0 commit comments

Comments
 (0)