Skip to content

Commit

Permalink
Merge bitcoin#29509: [26.x] backports and final changes for v26.1rc2
Browse files Browse the repository at this point in the history
c68d4d0 [doc] update manual pages for v26.1rc2 (glozow)
bd715bf [build] bump version to v26.1rc2 (glozow)
b6d006d update release notes 26.1 (glozow)
fce992b fuzz: restrict fopencookie usage to Linux & FreeBSD (fanquake)
40c56a4 test: make sure keypool sizes do not change on `getrawchangeaddress`/`getnewaddress` failures (UdjinM6)
7c82b27 wallet: Avoid updating `ReserveDestination::nIndex` when `GetReservedDestination` fails (UdjinM6)
b5419ce p2p: Don't consider blocks mutated if they don't connect to known prev block (Greg Sanders)
0535c25 [test] IsBlockMutated unit tests (dergoegge)
8141498 [validation] Cache merkle root and witness commitment checks (dergoegge)
0c5c596 [test] Add regression test for bitcoin#27608 (dergoegge)
2473635 [net processing] Don't process mutated blocks (dergoegge)
50c0b61 [validation] Merkle root malleation should be caught by IsBlockMutated (dergoegge)
aff368f [validation] Introduce IsBlockMutated (dergoegge)
076c67c [refactor] Cleanup merkle root checks (dergoegge)
97a1d0a [validation] Isolate merkle root checks (dergoegge)
4ac0eb5 test: Drop `x` modifier in `fsbridge::fopen` call for mingw builds (Hennadii Stepanov)

Pull request description:

  Includes:
  - bitcoin#29357
  - bitcoin#29412
  - bitcoin#29524
  - bitcoin#29510
  - bitcoin#29529

  Also does:
  - update to release notes
  - bump to rc2
  - manpages
  - (no changes to bitcoin.conf)

ACKs for top commit:
  achow101:
    ACK c68d4d0

Tree-SHA512: 2f8c3dd705e3f9f33403b3cc17e8006510ff827d7dbd609b09732a1669964e9b001cfecdc63d8d8daeb8f39c652e1e4ad0aac873d44d259c21803de85688ed2b
  • Loading branch information
glozow committed Mar 11, 2024
2 parents a718bfa + c68d4d0 commit c33e83a
Show file tree
Hide file tree
Showing 19 changed files with 525 additions and 64 deletions.
2 changes: 1 addition & 1 deletion configure.ac
Expand Up @@ -2,7 +2,7 @@ AC_PREREQ([2.69])
define(_CLIENT_VERSION_MAJOR, 26)
define(_CLIENT_VERSION_MINOR, 1)
define(_CLIENT_VERSION_BUILD, 0)
define(_CLIENT_VERSION_RC, 1)
define(_CLIENT_VERSION_RC, 2)
define(_CLIENT_VERSION_IS_RELEASE, true)
define(_COPYRIGHT_YEAR, 2023)
define(_COPYRIGHT_HOLDERS,[The %s developers])
Expand Down
6 changes: 3 additions & 3 deletions doc/man/bitcoin-cli.1
@@ -1,7 +1,7 @@
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.1.
.TH BITCOIN-CLI "1" "February 2024" "bitcoin-cli v26.1.0rc1" "User Commands"
.TH BITCOIN-CLI "1" "March 2024" "bitcoin-cli v26.1.0rc2" "User Commands"
.SH NAME
bitcoin-cli \- manual page for bitcoin-cli v26.1.0rc1
bitcoin-cli \- manual page for bitcoin-cli v26.1.0rc2
.SH SYNOPSIS
.B bitcoin-cli
[\fI\,options\/\fR] \fI\,<command> \/\fR[\fI\,params\/\fR] \fI\,Send command to Bitcoin Core\/\fR
Expand All @@ -15,7 +15,7 @@ bitcoin-cli \- manual page for bitcoin-cli v26.1.0rc1
.B bitcoin-cli
[\fI\,options\/\fR] \fI\,help <command> Get help for a command\/\fR
.SH DESCRIPTION
Bitcoin Core RPC client version v26.1.0rc1
Bitcoin Core RPC client version v26.1.0rc2
.SH OPTIONS
.HP
\-?
Expand Down
6 changes: 3 additions & 3 deletions doc/man/bitcoin-qt.1
@@ -1,12 +1,12 @@
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.1.
.TH BITCOIN-QT "1" "February 2024" "bitcoin-qt v26.1.0rc1" "User Commands"
.TH BITCOIN-QT "1" "March 2024" "bitcoin-qt v26.1.0rc2" "User Commands"
.SH NAME
bitcoin-qt \- manual page for bitcoin-qt v26.1.0rc1
bitcoin-qt \- manual page for bitcoin-qt v26.1.0rc2
.SH SYNOPSIS
.B bitcoin-qt
[\fI\,command-line options\/\fR]
.SH DESCRIPTION
Bitcoin Core version v26.1.0rc1
Bitcoin Core version v26.1.0rc2
.SH OPTIONS
.HP
\-?
Expand Down
6 changes: 3 additions & 3 deletions doc/man/bitcoin-tx.1
@@ -1,15 +1,15 @@
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.1.
.TH BITCOIN-TX "1" "February 2024" "bitcoin-tx v26.1.0rc1" "User Commands"
.TH BITCOIN-TX "1" "March 2024" "bitcoin-tx v26.1.0rc2" "User Commands"
.SH NAME
bitcoin-tx \- manual page for bitcoin-tx v26.1.0rc1
bitcoin-tx \- manual page for bitcoin-tx v26.1.0rc2
.SH SYNOPSIS
.B bitcoin-tx
[\fI\,options\/\fR] \fI\,<hex-tx> \/\fR[\fI\,commands\/\fR] \fI\,Update hex-encoded bitcoin transaction\/\fR
.br
.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 v26.1.0rc1
Bitcoin Core bitcoin\-tx utility version v26.1.0rc2
.SH OPTIONS
.HP
\-?
Expand Down
6 changes: 3 additions & 3 deletions doc/man/bitcoin-util.1
@@ -1,12 +1,12 @@
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.1.
.TH BITCOIN-UTIL "1" "February 2024" "bitcoin-util v26.1.0rc1" "User Commands"
.TH BITCOIN-UTIL "1" "March 2024" "bitcoin-util v26.1.0rc2" "User Commands"
.SH NAME
bitcoin-util \- manual page for bitcoin-util v26.1.0rc1
bitcoin-util \- manual page for bitcoin-util v26.1.0rc2
.SH SYNOPSIS
.B bitcoin-util
[\fI\,options\/\fR] [\fI\,commands\/\fR] \fI\,Do stuff\/\fR
.SH DESCRIPTION
Bitcoin Core bitcoin\-util utility version v26.1.0rc1
Bitcoin Core bitcoin\-util utility version v26.1.0rc2
.SH OPTIONS
.HP
\-?
Expand Down
6 changes: 3 additions & 3 deletions doc/man/bitcoin-wallet.1
@@ -1,9 +1,9 @@
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.1.
.TH BITCOIN-WALLET "1" "February 2024" "bitcoin-wallet v26.1.0rc1" "User Commands"
.TH BITCOIN-WALLET "1" "March 2024" "bitcoin-wallet v26.1.0rc2" "User Commands"
.SH NAME
bitcoin-wallet \- manual page for bitcoin-wallet v26.1.0rc1
bitcoin-wallet \- manual page for bitcoin-wallet v26.1.0rc2
.SH DESCRIPTION
Bitcoin Core bitcoin\-wallet version v26.1.0rc1
Bitcoin Core bitcoin\-wallet version v26.1.0rc2
.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.
Expand Down
6 changes: 3 additions & 3 deletions doc/man/bitcoind.1
@@ -1,12 +1,12 @@
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.1.
.TH BITCOIND "1" "February 2024" "bitcoind v26.1.0rc1" "User Commands"
.TH BITCOIND "1" "March 2024" "bitcoind v26.1.0rc2" "User Commands"
.SH NAME
bitcoind \- manual page for bitcoind v26.1.0rc1
bitcoind \- manual page for bitcoind v26.1.0rc2
.SH SYNOPSIS
.B bitcoind
[\fI\,options\/\fR] \fI\,Start Bitcoin Core\/\fR
.SH DESCRIPTION
Bitcoin Core version v26.1.0rc1
Bitcoin Core version v26.1.0rc2
.SH OPTIONS
.HP
\-?
Expand Down
10 changes: 10 additions & 0 deletions doc/release-notes.md
Expand Up @@ -45,10 +45,12 @@ Notable changes
- #28994 wallet: skip BnB when SFFO is enabled
- #28920 wallet: birth time update during tx scanning
- #29176 wallet: Fix use-after-free in WalletBatch::EraseRecords
- #29510 wallet: getrawchangeaddress and getnewaddress failures should not affect keypools for descriptor wallets

### RPC

- #29003 rpc: fix getrawtransaction segfault
- #28784 rpc: keep .cookie file if it was not generated

### Logs

Expand All @@ -57,6 +59,8 @@ Notable changes
### P2P and network changes

- #29200 net: create I2P sessions using both ECIES-X25519 and ElGamal encryption
- #29412 p2p: Don't process mutated blocks
- #29524 p2p: Don't consider blocks mutated if they don't connect to known prev block

### Build

Expand All @@ -73,22 +77,28 @@ Notable changes
- #28391 refactor: Simplify CTxMempool/BlockAssembler fields, remove some external mapTx access
- #29179 test: wallet rescan with reorged parent + IsFromMe child in mempool
- #28791 snapshots: don't core dump when running -checkblockindex after loadtxoutset
- #29357 test: Drop x modifier in fsbridge::fopen call for MinGW builds
- #29529 fuzz: restrict fopencookie usage to Linux & FreeBSD

Credits
=======

Thanks to everyone who directly contributed to this release:

- dergoegge
- fanquake
- furszy
- glozow
- Greg Sanders
- Hennadii Stepanov
- Jon Atack
- MarcoFalke
- Mark Friedenbach
- Martin Zumsande
- Murch
- Roman Zeyde
- stickies-v
- UdjinM6

As well as to everyone that helped with translations on
[Transifex](https://www.transifex.com/bitcoin/bitcoin/).
12 changes: 11 additions & 1 deletion src/net_processing.cpp
Expand Up @@ -4689,6 +4689,17 @@ void PeerManagerImpl::ProcessMessage(CNode& pfrom, const std::string& msg_type,

LogPrint(BCLog::NET, "received block %s peer=%d\n", pblock->GetHash().ToString(), pfrom.GetId());

const CBlockIndex* prev_block{WITH_LOCK(m_chainman.GetMutex(), return m_chainman.m_blockman.LookupBlockIndex(pblock->hashPrevBlock))};

// Check for possible mutation if it connects to something we know so we can check for DEPLOYMENT_SEGWIT being active
if (prev_block && IsBlockMutated(/*block=*/*pblock,
/*check_witness_root=*/DeploymentActiveAfter(prev_block, m_chainman, Consensus::DEPLOYMENT_SEGWIT))) {
LogPrint(BCLog::NET, "Received mutated block from peer=%d\n", peer->m_id);
Misbehaving(*peer, 100, "mutated block");
WITH_LOCK(cs_main, RemoveBlockRequest(pblock->GetHash(), peer->m_id));
return;
}

bool forceProcessing = false;
const uint256 hash(pblock->GetHash());
bool min_pow_checked = false;
Expand All @@ -4704,7 +4715,6 @@ void PeerManagerImpl::ProcessMessage(CNode& pfrom, const std::string& msg_type,
mapBlockSource.emplace(hash, std::make_pair(pfrom.GetId(), true));

// Check work on this block against our anti-dos thresholds.
const CBlockIndex* prev_block = m_chainman.m_blockman.LookupBlockIndex(pblock->hashPrevBlock);
if (prev_block && prev_block->nChainWork + CalculateHeadersWork({pblock->GetBlockHeader()}) >= GetAntiDoSWorkThreshold()) {
min_pow_checked = true;
}
Expand Down
8 changes: 6 additions & 2 deletions src/primitives/block.h
Expand Up @@ -71,8 +71,10 @@ class CBlock : public CBlockHeader
// network and disk
std::vector<CTransactionRef> vtx;

// memory only
mutable bool fChecked;
// Memory-only flags for caching expensive checks
mutable bool fChecked; // CheckBlock()
mutable bool m_checked_witness_commitment{false}; // CheckWitnessCommitment()
mutable bool m_checked_merkle_root{false}; // CheckMerkleRoot()

CBlock()
{
Expand All @@ -95,6 +97,8 @@ class CBlock : public CBlockHeader
CBlockHeader::SetNull();
vtx.clear();
fChecked = false;
m_checked_witness_commitment = false;
m_checked_merkle_root = false;
}

CBlockHeader GetBlockHeader() const
Expand Down
2 changes: 1 addition & 1 deletion src/test/fuzz/util.cpp
Expand Up @@ -255,7 +255,7 @@ FILE* FuzzedFileProvider::open()
[&] {
mode = "a+";
});
#if defined _GNU_SOURCE && !defined __ANDROID__
#if defined _GNU_SOURCE && (defined(__linux__) || defined(__FreeBSD__))
const cookie_io_functions_t io_hooks = {
FuzzedFileProvider::read,
FuzzedFileProvider::write,
Expand Down
9 changes: 8 additions & 1 deletion src/test/streams_tests.cpp
Expand Up @@ -29,7 +29,14 @@ BOOST_AUTO_TEST_CASE(xor_file)
BOOST_CHECK_EXCEPTION(xor_file.ignore(1), std::ios_base::failure, HasReason{"AutoFile::ignore: file handle is nullpt"});
}
{
AutoFile xor_file{raw_file("wbx"), xor_pat};
#ifdef __MINGW64__
// Our usage of mingw-w64 and the msvcrt runtime does not support
// the x modifier for the _wfopen().
const char* mode = "wb";
#else
const char* mode = "wbx";
#endif
AutoFile xor_file{raw_file(mode), xor_pat};
xor_file << test1 << test2;
}
{
Expand Down

0 comments on commit c33e83a

Please sign in to comment.