Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
a7b5814
Fix 11-year-old mis-categorized error code in OP_IF evaluation
cculianu Mar 26, 2025
e842eb9
descriptors: add HavePrivateKeys()
Eunovo Jul 22, 2025
2dc74e3
wallet/migration: use HavePrivateKeys in place of ToPrivateString
Eunovo May 13, 2025
5c4db25
descriptor: refactor ToPrivateString for providers
Eunovo Aug 1, 2025
9e5e982
descriptor: ToPrivateString() pass if at least 1 priv key exists
Eunovo Aug 1, 2025
ed945a6
walletrpc: reject listdes with priv key on w-only wallets
Eunovo May 12, 2025
9c7e477
test: Test listdescs with priv works even with missing priv keys
Eunovo May 12, 2025
faf0c2d
refactor: Avoid copies by using const references or by move-construction
Jan 13, 2025
fa64d84
refactor: Enforce readability-avoid-const-params-in-decls
Jul 10, 2025
fac7fed
refactor: Use std::reference_wrapper<AddrMan> in Connman
Jan 15, 2026
fabf8d1
fuzz: Restore SendMessages coverage in process_message(s) fuzz targets
Jan 15, 2026
de509c6
iwyu: Add missed line to IWYU patch
hebasto Jan 15, 2026
a5a8c41
ci, iwyu: Fix warnings in `src/kernel` and treat them as errors
hebasto Jan 16, 2026
d45ec3f
test: Add getreceivedbyaddress coverage to wallet_listreceivedby
b-l-u-e Jan 4, 2026
c57fbbe
Merge bitcoin/bitcoin#31650: refactor: Avoid copies by using const re…
sedited Jan 19, 2026
5e49f5d
Merge bitcoin/bitcoin#33779: ci, iwyu: Fix warnings in `src/kernel` a…
sedited Jan 19, 2026
fa6947f
kernel: Remove unused core_read.cpp from kernel
Jan 14, 2026
faf6667
refactor: [move-only] Merge core_io module
Jan 14, 2026
faf07bd
doc: Fix typo found by LLM
Jan 15, 2026
898e8d3
Merge bitcoin/bitcoin#34296: refactor: [move-only] Merge core_io modu…
sedited Jan 19, 2026
9482f00
chore: Update outdated GitHub Actions versions
pgoslatara Jan 19, 2026
19a2edd
iwyu: Do not export C++ headers in most cases
hebasto Jan 19, 2026
e1a90bc
iwyu: Do not export `crypto/hex_base.h` header
hebasto Jan 19, 2026
d938947
doc: Add "Using IWYU" to Developer Notes
hebasto Jan 19, 2026
03f363d
doc: Document IWYU workaround
hebasto Jan 19, 2026
0dafc0d
clang-format: use AngleBracket for main includes
stickies-v Jan 19, 2026
3478401
Merge bitcoin/bitcoin#32143: Fix 11-year-old mis-categorized error co…
achow101 Jan 20, 2026
977be17
Merge bitcoin/bitcoin#34188: test: Add multiple transactions and erro…
achow101 Jan 20, 2026
ab80588
Merge bitcoin/bitcoin#34345: clang-format: use AngleBracket for main …
fanquake Jan 20, 2026
38f951f
Merge bitcoin/bitcoin#34308: doc: Document IWYU workaround
fanquake Jan 20, 2026
c84c752
Merge bitcoin/bitcoin#34319: Drop some `IWYU pragma: export` and docu…
fanquake Jan 20, 2026
f441370
Merge bitcoin/bitcoin#34344: ci: update GitHub Actions versions
fanquake Jan 20, 2026
a6e8cd3
Merge bitcoin/bitcoin#34310: iwyu: Add missed line to IWYU patch
fanquake Jan 20, 2026
7f5ebef
Merge bitcoin/bitcoin#34302: fuzz: Restore SendMessages coverage in p…
sedited Jan 20, 2026
f7e88e2
Merge bitcoin/bitcoin#32471: wallet/rpc: fix listdescriptors RPC fail…
achow101 Jan 20, 2026
1c4aa70
test: cover `FlushChainstateBlockFile` undo flush ordering
l0rinc Jan 20, 2026
01719be
blockstorage: flush dirty undo files during state flush
l0rinc Jan 20, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ jobs:
sed -i '1s/^/set(ENV{CMAKE_POLICY_VERSION_MINIMUM} 3.5)\n/' "${VCPKG_INSTALLATION_ROOT}/scripts/ports.cmake"

- name: vcpkg tools cache
uses: actions/cache@v4
uses: actions/cache@v5
with:
path: C:/vcpkg/downloads/tools
key: ${{ github.job }}-vcpkg-tools
Expand Down Expand Up @@ -409,7 +409,7 @@ jobs:
uses: ./.github/actions/save-caches

- name: Upload built executables
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v6
with:
name: ${{ matrix.artifact-name }}-${{ github.run_id }}
path: |
Expand Down Expand Up @@ -447,7 +447,7 @@ jobs:
ref: ${{ needs.record-frozen-commit.outputs.commit }}

- name: Download built executables
uses: actions/download-artifact@v5
uses: actions/download-artifact@v7
with:
name: ${{ matrix.artifact-name }}-${{ github.run_id }}

Expand Down
6 changes: 4 additions & 2 deletions ci/test/01_iwyu.patch
Original file line number Diff line number Diff line change
Expand Up @@ -539,10 +539,11 @@ See: https://github.com/include-what-you-use/include-what-you-use/blob/clang_21/
};

const IncludeMapEntry stdlib_c_include_map[] = {
@@ -601,31 +601,31 @@ const IncludeMapEntry stdlib_c_include_map[] = {
@@ -600,32 +600,32 @@ const IncludeMapEntry stdlib_c_include_map[] = {
// https://github.com/cplusplus/draft/blob/c+%2B20/source/lib-intro.tex
//
// $ curl -s -N https://raw.githubusercontent.com/cplusplus/draft/c%2B%2B20/source/lib-intro.tex | sed -n '/begin{multicolfloattable}.*{headers.cpp.c}/,/end{multicolfloattable}/p' | grep tcode | perl -nle 'm/tcode{<c(.*)>}/ && print qq@ { "<$1.h>", kPublic, "<c$1>", kPublic },@' | sort
{ "<assert.h>", kPublic, "<cassert>", kPublic },
- { "<assert.h>", kPublic, "<cassert>", kPublic },
- { "<complex.h>", kPublic, "<ccomplex>", kPublic },
- { "<ctype.h>", kPublic, "<cctype>", kPublic },
- { "<errno.h>", kPublic, "<cerrno>", kPublic },
Expand All @@ -568,6 +569,7 @@ See: https://github.com/include-what-you-use/include-what-you-use/blob/clang_21/
- { "<uchar.h>", kPublic, "<cuchar>", kPublic },
- { "<wchar.h>", kPublic, "<cwchar>", kPublic },
- { "<wctype.h>", kPublic, "<cwctype>", kPublic },
+ { "<assert.h>", kPrivate, "<cassert>", kPublic },
+ { "<complex.h>", kPrivate, "<ccomplex>", kPublic },
+ { "<ctype.h>", kPrivate, "<cctype>", kPublic },
+ { "<errno.h>", kPrivate, "<cerrno>", kPublic },
Expand Down
2 changes: 1 addition & 1 deletion ci/test/03_test_script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ fi

if [[ "${RUN_IWYU}" == true ]]; then
# TODO: Consider enforcing IWYU across the entire codebase.
FILES_WITH_ENFORCED_IWYU="/src/((crypto|index)/.*\\.cpp|node/blockstorage.cpp|node/utxo_snapshot.cpp|core_read.cpp|signet.cpp|kernel/chain.cpp)"
FILES_WITH_ENFORCED_IWYU="/src/((crypto|index|kernel)/.*\\.cpp|node/blockstorage.cpp|node/utxo_snapshot.cpp|core_io.cpp|signet.cpp)"
jq --arg patterns "$FILES_WITH_ENFORCED_IWYU" 'map(select(.file | test($patterns)))' "${BASE_BUILD_DIR}/compile_commands.json" > "${BASE_BUILD_DIR}/compile_commands_iwyu_errors.json"
jq --arg patterns "$FILES_WITH_ENFORCED_IWYU" 'map(select(.file | test($patterns) | not))' "${BASE_BUILD_DIR}/compile_commands.json" > "${BASE_BUILD_DIR}/compile_commands_iwyu_warnings.json"

Expand Down
7 changes: 0 additions & 7 deletions contrib/devtools/circular-dependencies.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,6 @@
import sys
import re

MAPPING = {
'core_read.cpp': 'core_io.cpp',
'core_write.cpp': 'core_io.cpp',
}

# Directories with header-based modules, where the assumption that .cpp files
# define functions and variables declared in corresponding .h files is
# incorrect.
Expand All @@ -19,8 +14,6 @@
]

def module_name(path):
if path in MAPPING:
path = MAPPING[path]
if any(path.startswith(dirpath) for dirpath in HEADER_MODULE_PATHS):
return path
if path.endswith(".h"):
Expand Down
17 changes: 16 additions & 1 deletion doc/developer-notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -558,6 +558,21 @@ llvm-cov show \

The generated coverage report can be accessed at `build/coverage_report/index.html`.

### Using IWYU

The [`include-what-you-use`](https://github.com/include-what-you-use/include-what-you-use) tool (IWYU)
helps to enforce the source code organization [policy](#source-code-organization) in this repository.

To ensure consistency, it is recommended to run the IWYU CI job locally rather than running the tool directly.

In some cases, IWYU might suggest headers that seem unnecessary at first glance, but are actually required.
For example, a macro may use a symbol that requires its own include. Another example is passing a string literal
to a function that accepts a `std::string` parameter. An implicit conversion occurs at the callsite using the
`std::string` constructor, which makes the corresponding header required. We accept these suggestions as is.

Use `IWYU pragma: export` very sparingly, as this enforces transitive inclusion of headers
and undermines the specific purpose of IWYU.

### Performance profiling with perf

Profiling is a good way to get a precise idea of where time is being spent in
Expand Down Expand Up @@ -1057,7 +1072,7 @@ Write scripts in Python or Rust rather than bash, when possible.

- *Rationale*: Excluding headers because they are already indirectly included results in compilation
failures when those indirect dependencies change. Furthermore, it obscures what the real code
dependencies are.
dependencies are. The [Using IWYU](#using-iwyu) section describes a tool to help enforce this.

- Don't import anything into the global namespace (`using namespace ...`). Use
fully specified types such as `std::string`.
Expand Down
1 change: 1 addition & 0 deletions src/.clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ LambdaBodyIndentation: Signature
LineEnding: DeriveLF
MacroBlockBegin: ''
MacroBlockEnd: ''
MainIncludeChar: AngleBracket
MaxEmptyLinesToKeep: 2
NamespaceIndentation: None
ObjCBinPackProtocolList: Auto
Expand Down
1 change: 1 addition & 0 deletions src/.clang-tidy
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ performance-*,
-performance-no-int-to-ptr,
-performance-noexcept-move-constructor,
-performance-unnecessary-value-param,
readability-avoid-const-params-in-decls,
readability-const-return-type,
readability-container-contains,
readability-redundant-declaration,
Expand Down
3 changes: 1 addition & 2 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,7 @@ add_library(bitcoin_common STATIC EXCLUDE_FROM_ALL
common/system.cpp
common/url.cpp
compressor.cpp
core_read.cpp
core_write.cpp
core_io.cpp
deploymentinfo.cpp
external_signer.cpp
init/common.cpp
Expand Down
2 changes: 1 addition & 1 deletion src/addrman.h
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ class AddrMan
*
* @return A vector of randomly selected addresses from vRandom.
*/
std::vector<CAddress> GetAddr(size_t max_addresses, size_t max_pct, std::optional<Network> network, const bool filtered = true) const;
std::vector<CAddress> GetAddr(size_t max_addresses, size_t max_pct, std::optional<Network> network, bool filtered = true) const;

/**
* Returns an information-location pair for all addresses in the selected addrman table.
Expand Down
4 changes: 2 additions & 2 deletions src/addrman_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ class AddrManImpl
std::pair<CAddress, NodeSeconds> Select(bool new_only, const std::unordered_set<Network>& networks) 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
std::vector<CAddress> GetAddr(size_t max_addresses, size_t max_pct, std::optional<Network> network, bool filtered = true) const
EXCLUSIVE_LOCKS_REQUIRED(!cs);

std::vector<std::pair<AddrInfo, AddressPosition>> GetEntries(bool from_tried) const
Expand Down Expand Up @@ -267,7 +267,7 @@ class AddrManImpl
* */
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);
std::vector<CAddress> GetAddr_(size_t max_addresses, size_t max_pct, std::optional<Network> network, bool filtered = true) const EXCLUSIVE_LOCKS_REQUIRED(cs);

std::vector<std::pair<AddrInfo, AddressPosition>> GetEntries_(bool from_tried) const EXCLUSIVE_LOCKS_REQUIRED(cs);

Expand Down
4 changes: 2 additions & 2 deletions src/chainparams.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class ArgsManager;
/**
* Creates and returns a std::unique_ptr<CChainParams> of the chosen chain.
*/
std::unique_ptr<const CChainParams> CreateChainParams(const ArgsManager& args, const ChainType chain);
std::unique_ptr<const CChainParams> CreateChainParams(const ArgsManager& args, ChainType chain);

/**
* Return the currently selected parameters. This won't change after app
Expand All @@ -26,6 +26,6 @@ const CChainParams &Params();
/**
* Sets the params returned by Params() to those for the given chain type.
*/
void SelectParams(const ChainType chain);
void SelectParams(ChainType chain);

#endif // BITCOIN_CHAINPARAMS_H
4 changes: 2 additions & 2 deletions src/chainparamsbase.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class CBaseChainParams
/**
* Creates and returns a std::unique_ptr<CBaseChainParams> of the chosen chain.
*/
std::unique_ptr<CBaseChainParams> CreateBaseChainParams(const ChainType chain);
std::unique_ptr<CBaseChainParams> CreateBaseChainParams(ChainType chain);

/**
*Set the arguments for chainparams
Expand All @@ -49,7 +49,7 @@ void SetupChainParamsBaseOptions(ArgsManager& argsman);
const CBaseChainParams& BaseParams();

/** Sets the params returned by Params() to those for the given chain. */
void SelectBaseParams(const ChainType chain);
void SelectBaseParams(ChainType chain);

/** List of possible chain / network names */
#define LIST_CHAIN_NAMES "main, test, testnet4, signet, regtest"
Expand Down
4 changes: 2 additions & 2 deletions src/common/bloom.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class CBloomFilter
* It should generally always be a random value (and is largely only exposed for unit testing)
* nFlags should be one of the BLOOM_UPDATE_* enums (not _MASK)
*/
CBloomFilter(const unsigned int nElements, const double nFPRate, const unsigned int nTweak, unsigned char nFlagsIn);
CBloomFilter(unsigned int nElements, double nFPRate, unsigned int nTweak, unsigned char nFlagsIn);
CBloomFilter() : nHashFuncs(0), nTweak(0), nFlags(0) {}

SERIALIZE_METHODS(CBloomFilter, obj) { READWRITE(obj.vData, obj.nHashFuncs, obj.nTweak, obj.nFlags); }
Expand Down Expand Up @@ -108,7 +108,7 @@ class CBloomFilter
class CRollingBloomFilter
{
public:
CRollingBloomFilter(const unsigned int nElements, const double nFPRate);
CRollingBloomFilter(unsigned int nElements, double nFPRate);

void insert(std::span<const unsigned char> vKey);
bool contains(std::span<const unsigned char> vKey) const;
Expand Down
2 changes: 1 addition & 1 deletion src/common/messages.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ std::string FeeModeInfo(std::pair<std::string, FeeEstimateMode>& mode);
std::string FeeModesDetail(std::string default_info);
std::string InvalidEstimateModeErrorMessage();
bilingual_str PSBTErrorString(PSBTError error);
bilingual_str TransactionErrorString(const node::TransactionError error);
bilingual_str TransactionErrorString(node::TransactionError error);
bilingual_str ResolveErrMsg(const std::string& optname, const std::string& strBind);
bilingual_str InvalidPortErrMsg(const std::string& optname, const std::string& strPort);
bilingual_str AmountHighWarn(const std::string& optname);
Expand Down
2 changes: 1 addition & 1 deletion src/common/signmessage.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,6 @@ bool MessageSign(
*/
uint256 MessageHash(const std::string& message);

std::string SigningResultString(const SigningResult res);
std::string SigningResultString(SigningResult res);

#endif // BITCOIN_COMMON_SIGNMESSAGE_H
Loading
Loading