-
Notifications
You must be signed in to change notification settings - Fork 1.2k
backport: auto batch 209 #6698
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
backport: auto batch 209 #6698
Conversation
Caution Review failedThe pull request is closed. WalkthroughThis set of changes primarily updates and restructures both the continuous integration (CI) configuration and various C++ source and header files. In the CI configuration, new reusable templates are introduced and existing templates are refactored for modularity, with added support for macOS and Android ARM64 builds. Numerous C++ files receive adjustments to their include directives, standardizing the use of C++ headers and adding or removing includes as appropriate, but without altering logic in most cases. Some functional changes are present: the Branch and Bound coin selection algorithm in the wallet no longer terminates early on zero-waste solutions, and related tests are updated. The 📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (34)
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 4
🧹 Nitpick comments (5)
contrib/guix/patches/winpthreads-remap-guix-store.patch (1)
14-14
: Effective approach for reproducible builds with minor performance consideration.The dynamic generation of
-ffile-prefix-map
flags is a solid solution for ensuring reproducible builds by removing architecture-dependent Guix store paths from debug symbols. The shell command correctly maps all/gnu/store
directories to/usr
.Consider that the
find
command will execute during every make invocation, which could add some build time if there are many directories in/gnu/store
. However, this is likely acceptable for the benefit of reproducible builds.src/util/bip32.cpp (1)
9-12
: Header includes look good with minor optimization opportunity.The added headers correctly support the code's dependencies:
<cstdint>
is needed foruint32_t
usage throughout the functions<sstream>
is required forstd::stringstream
used inParseHDKeypath
However,
<algorithm>
appears unused in this file and could potentially be removed.-#include <algorithm> #include <cstdint>
test/functional/test_framework/util.py (2)
608-609
: Consider moving imports to module level.The imports are placed inside the function, which is generally not recommended as it can impact performance and readability. While this might be acceptable for test utilities to avoid circular imports, consider moving these to the top of the file if possible.
+from .messages import CTxOut +from .script import CScript, OP_RETURNMove these imports to the module level (around line 22) if there are no circular import concerns.
🧰 Tools
🪛 Pylint (3.3.7)
[convention] 608-608: Import outside toplevel (messages.CTxOut)
(C0415)
[convention] 609-609: Import outside toplevel (script.CScript, script.OP_RETURN)
(C0415)
607-607
: Add function docstring.The function is missing a docstring explaining its purpose and return value.
def gen_return_txouts(): + """Generate large OP_RETURN transaction outputs for testing. + + Returns: + list: A list containing a single CTxOut with a large OP_RETURN script. + Total serialized size is about 66k vbytes. + """🧰 Tools
🪛 Pylint (3.3.7)
[convention] 607-607: Missing function or method docstring
(C0116)
contrib/devtools/symbol-check.py (1)
255-257
: LGTM: Version update with style improvement opportunity.The linker version update from
[18, 1, 6]
to[18, 1, 8]
appears to be a standard version bump for compatibility.Consider simplifying the return statement as suggested by static analysis:
-def check_MACHO_lld(binary) -> bool: - if binary.build_version.tools[0].version == [18, 1, 8]: - return True - return False +def check_MACHO_lld(binary) -> bool: + return binary.build_version.tools[0].version == [18, 1, 8]🧰 Tools
🪛 Ruff (0.11.9)
255-257: Return the condition directly
Inline condition
(SIM103)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (40)
.cirrus.yml
(2 hunks)contrib/devtools/symbol-check.py
(1 hunks)contrib/guix/libexec/prelude.bash
(1 hunks)contrib/guix/manifest.scm
(1 hunks)contrib/guix/patches/gcc-remap-guix-store.patch
(1 hunks)contrib/guix/patches/winpthreads-remap-guix-store.patch
(1 hunks)src/qt/bitcoin.cpp
(3 hunks)src/qt/optionsdialog.cpp
(1 hunks)src/rpc/mempool.cpp
(3 hunks)src/univalue/include/univalue.h
(2 hunks)src/util/asmap.cpp
(1 hunks)src/util/bip32.cpp
(1 hunks)src/util/bip32.h
(0 hunks)src/util/bytevectorhash.cpp
(1 hunks)src/util/bytevectorhash.h
(1 hunks)src/util/error.cpp
(1 hunks)src/util/hasher.cpp
(1 hunks)src/util/hasher.h
(1 hunks)src/util/message.cpp
(1 hunks)src/util/message.h
(1 hunks)src/util/moneystr.cpp
(1 hunks)src/util/readwritefile.cpp
(1 hunks)src/util/serfloat.h
(1 hunks)src/util/spanparsing.cpp
(1 hunks)src/util/strencodings.cpp
(1 hunks)src/util/strencodings.h
(1 hunks)src/util/syserror.cpp
(1 hunks)src/util/thread.cpp
(1 hunks)src/util/time.cpp
(1 hunks)src/util/time.h
(1 hunks)src/util/translation.h
(1 hunks)src/util/vector.h
(1 hunks)src/wallet/coinselection.cpp
(0 hunks)src/wallet/rpc/transactions.cpp
(3 hunks)src/wallet/test/coinselector_tests.cpp
(2 hunks)test/functional/feature_maxuploadtarget.py
(2 hunks)test/functional/mempool_limit.py
(1 hunks)test/functional/mining_prioritisetransaction.py
(1 hunks)test/functional/test_framework/util.py
(1 hunks)test/functional/wallet_importdescriptors.py
(1 hunks)
💤 Files with no reviewable changes (2)
- src/util/bip32.h
- src/wallet/coinselection.cpp
🧰 Additional context used
🧬 Code Graph Analysis (4)
test/functional/wallet_importdescriptors.py (1)
test/functional/test_framework/test_framework.py (1)
sync_all
(873-875)
src/rpc/mempool.cpp (1)
src/node/interfaces.cpp (1)
incrementalRelayFee
(934-934)
src/wallet/test/coinselector_tests.cpp (1)
src/bench/coin_selection.cpp (2)
add_coin
(72-80)add_coin
(72-72)
src/qt/optionsdialog.cpp (1)
src/qt/guiutil.cpp (2)
getDefaultDataDirectory
(511-514)getDefaultDataDirectory
(511-511)
🪛 Ruff (0.11.9)
contrib/devtools/symbol-check.py
255-257: Return the condition directly
Inline condition
(SIM103)
🪛 Pylint (3.3.7)
test/functional/test_framework/util.py
[convention] 607-607: Missing function or method docstring
(C0116)
[convention] 608-608: Import outside toplevel (messages.CTxOut)
(C0415)
[convention] 609-609: Import outside toplevel (script.CScript, script.OP_RETURN)
(C0415)
[refactor] 611-611: Consider using a generator instead 'sum(len(txout.serialize()) for txout in txouts)'
(R1728)
🪛 YAMLlint (1.37.1)
.cirrus.yml
[warning] 38-38: too many spaces before colon
(colons)
[warning] 52-52: too many spaces before colon
(colons)
[warning] 55-55: too many spaces before colon
(colons)
[warning] 60-60: too many spaces before colon
(colons)
[warning] 187-187: too many spaces before colon
(colons)
[error] 194-194: duplication of key "task" in mapping
(key-duplicates)
[warning] 196-196: too many spaces before colon
(colons)
[warning] 203-203: too many spaces before colon
(colons)
[warning] 207-207: too many spaces before colon
(colons)
[error] 207-207: found undeclared alias "CIRRUS_EPHEMERAL_WORKER_TEMPLATE_ENV"
(anchors)
⏰ Context from checks skipped due to timeout of 90000ms (10)
- GitHub Check: linux64_nowallet-build / Build source
- GitHub Check: linux64_fuzz-build / Build source
- GitHub Check: linux64_ubsan-build / Build source
- GitHub Check: linux64-build / Build source
- GitHub Check: linux64_sqlite-build / Build source
- GitHub Check: linux64_tsan-build / Build source
- GitHub Check: linux64_multiprocess-build / Build source
- GitHub Check: mac-build / Build source
- GitHub Check: arm-linux-build / Build source
- GitHub Check: win64-build / Build source
🔇 Additional comments (52)
contrib/guix/manifest.scm (2)
131-133
: LGTM: Consistent patch wrapper implementation.The new
winpthreads-patches
function follows the established pattern used by other patch wrapper functions in this file (gcc-mingw-patches
,binutils-mingw-patches
). The implementation correctly applies the new patch to ensure reproducible builds.
139-141
: LGTM: Proper integration of winpthreads patches.The changes correctly integrate the
winpthreads-patches
wrapper into the MinGW cross-toolchain build process. This ensures the patch is consistently applied during the pthreads libc component build.contrib/guix/patches/gcc-remap-guix-store.patch (1)
14-14
: LGTM: Consistent implementation for GCC reproducible builds.This patch applies the same reproducible build strategy used in the winpthreads patch, ensuring consistency across the toolchain. The modification correctly preserves the existing
-fexceptions
flag while adding the dynamically generated-ffile-prefix-map
flags.The approach effectively removes architecture-dependent Guix store paths from debug symbols, contributing to reproducible builds.
src/util/syserror.cpp (1)
12-13
: Explicitly include<string>
forstd::string
usage.Returning
std::string
fromSysErrorString
requires the<string>
header; this addition makes the dependency explicit and avoids relying on transitive includes.src/util/moneystr.cpp (1)
13-13
: Add<cstdint>
to support fixed-width integer types.The functions in this file use
int64_t
for calculations; including<cstdint>
ensures those type definitions are available in a portable, standardized way.src/util/time.h (1)
12-12
: Modernize header: include<cstdint>
instead of C-style headers.Multiple functions and templates in this file return or manipulate
int64_t
; adding<cstdint>
makes the dependency on fixed-width integer types explicit and consistent with C++ conventions.src/util/spanparsing.cpp (1)
9-10
: Include<algorithm>
and<cstddef>
forstd::equal
andsize_t
.The parsing logic relies on
std::equal
(from<algorithm>
) andsize_t
(from<cstddef>
). Adding these headers prevents potential missing‐include errors and aligns with the project's modernization of utility modules.src/util/serfloat.h (1)
8-8
: Replace C header with<cstdint>
to provideuint64_t
.Encoding and decoding functions use
uint64_t
; including the C++<cstdint>
header ensures the fixed-width integer type is available and follows modern C++ header conventions.src/util/translation.h (1)
11-11
: LGTM! Header modernization improves dependency clarity.The change from
<utility>
to<string>
is appropriate since the file extensively usesstd::string
but doesn't use utility functions likestd::pair
orstd::move
. This reduces unnecessary dependencies.src/util/readwritefile.cpp (1)
10-10
: Essential header addition forstd::min
usage.The
<algorithm>
include is necessary for thestd::min
call on line 24. This ensures proper compilation and resolves the dependency.src/util/thread.cpp (1)
12-12
: Essential header addition forstd::function
usage.The
<functional>
include is necessary for thestd::function<void()>
parameter type used in theTraceThread
function on line 14.src/util/error.cpp (1)
10-11
: Essential header additions for standard library usage.Both header additions are necessary:
<cassert>
is required for theassert(false)
call on line 38<string>
is required for thestd::string
parameters used throughout the file (lines 41, 46, 51, 56)These direct includes improve dependency clarity and ensure compilation correctness.
src/util/asmap.cpp (2)
10-10
: Essential header addition for serialization functionality.The
<serialize.h>
include is necessary for theSER_DISK
andCLIENT_VERSION
constants used on line 201.
16-17
: Essential header additions for standard library usage.Both additions are necessary:
<cstdio>
is required for C-style file operations (FILE
,fopen
,fseek
,ftell
) used on lines 200, 206-209<utility>
is required forstd::pair
used in the vector declaration on line 137src/util/time.cpp (1)
6-23
: Excellent header organization and modernization.The header reorganization is well-structured:
- Conditional config include follows standard patterns
- All added standard headers are properly utilized in the code:
<chrono>
for time operations throughout<ctime>
for time-related functions<locale>
forParseISO8601DateTime
locale handling<sstream>
for stringstream operations in parsing<string>
for std::string usageThis modernization improves code clarity and ensures proper dependencies.
src/rpc/mempool.cpp (3)
396-396
: Excellent addition of incremental relay fee information.Adding the
incrementalrelayfee
field provides valuable information about the minimum fee rate increment for mempool limiting and BIP 125 replacement. The implementation correctly uses the global::incrementalRelayFee
variable and follows the same pattern as other fee fields in the function.
405-405
: Good formatting improvement.The help text formatting cleanup improves readability.
418-418
: Comprehensive documentation for the new field.The help text clearly describes the purpose and units of the
incrementalrelayfee
field, making it easy for users to understand its role in mempool limiting and BIP 125 replacement.src/util/hasher.cpp (1)
5-7
: Necessary header additions for cryptographic functionality.The added headers are correctly required for the code:
<crypto/siphash.h>
is needed forCSipHasher
used inSaltedSipHasher::operator()
<span.h>
is required for theSpan<const unsigned char>
parameter in the same functionThese additions ensure proper compilation and access to cryptographic utilities.
src/util/vector.h (1)
10-10
: Ensure<utility>
is included forstd::forward
usage
The added<utility>
header correctly providesstd::forward
andstd::move
required by theVector
variadic template.src/util/bytevectorhash.cpp (1)
9-9
: Add<vector>
to supportstd::vector
type usage
Including<vector>
ensures theoperator()
method signature referencingstd::vector<unsigned char>
compiles without errors.src/util/message.cpp (4)
6-12
: Reorganize and include necessary project headers
The added includes (<hash.h>
,<key.h>
,<key_io.h>
,<pubkey.h>
,<script/standard.h>
,<serialize.h>
,<uint256.h>
) satisfy the dependencies for message signing and verification functionality.
14-14
: Include<util/strencodings.h>
for Base64 routines
This header is required forDecodeBase64
andEncodeBase64
used inMessageVerify
andMessageSign
.
16-17
: Include<cassert>
and<optional>
for assertions and optional types
<cassert>
is needed for theassert(false)
inSigningResultString
, and<optional>
supports the optional return type fromDecodeBase64
.
19-19
: Add<variant>
forstd::variant
utilities
Thestd::get_if<PKHash>
usage inMessageVerify
relies on<variant>
.src/util/bytevectorhash.h (1)
8-9
: Modernize headers: use<cstdint>
and<cstddef>
Switching to the C++ standard headers for fixed-width and size types improves portability and adherence to modern C++ practices.src/util/message.h (1)
13-13
: Forward-declareCKey
to reduce header coupling
Theclass CKey;
declaration removes the need for including<key.h>
, streamlining dependencies in the header.src/util/strencodings.h (1)
17-17
: Header additions are well-justified and necessary.Each new include serves a specific purpose:
<cstddef>
forsize_t
usage throughout the file<string_view>
for the extensive use ofstd::string_view
in function signatures<system_error>
forstd::errc
error handling inLocaleIndependentAtoi
(lines 128, 136)<type_traits>
forstd::is_integral<T>::value
in template constraints (lines 117, 178)This modernizes the header to explicitly declare its dependencies.
Also applies to: 22-24
test/functional/mining_prioritisetransaction.py (1)
17-17
: Test parameter update aligns with coordinated changes across test suite.Replacing
-acceptnonstdtxn=1
with-datacarriersize=100000
is more targeted and appropriate:
- The test uses
gen_return_txouts()
which creates OP_RETURN outputs that may require larger data carrier size- This change is more specific than broadly accepting all non-standard transactions
- Consistent with similar updates in other functional tests mentioned in the AI summary
The test functionality should remain intact while using more precise node configuration.
test/functional/mempool_limit.py (1)
26-26
: Consistent test parameter modernization.The same beneficial change as in
mining_prioritisetransaction.py
:
- Replaces broad non-standard transaction acceptance with specific data carrier size limit
- Supports the test's use of
gen_return_txouts()
for creating large data outputs- Part of coordinated modernization across the functional test suite
This maintains test functionality while using more precise node configuration.
test/functional/wallet_importdescriptors.py (1)
433-433
: LGTM! Improved synchronization approach.Replacing
self.generate(self.nodes[0], 6)
withself.sync_all()
is a good improvement. Thesync_all()
method ensures both block and mempool synchronization across all nodes, which is more comprehensive and reliable for multi-node wallet tests.src/util/hasher.h (3)
8-8
: LGTM! Adding necessary cryptographic header.The inclusion of
<crypto/common.h>
provides required cryptographic functionality and aligns with the header modernization effort.
13-14
: LGTM! Modernizing to C++ standard headers.Replacing C-style headers with
<cstdint>
and<cstring>
follows C++ best practices and ensures consistent type definitions across the codebase.
16-16
: LGTM! Proper forward declaration.The forward declaration of the
Span
template class is appropriate to avoid circular dependencies while allowing the hasher classes to work with span types.test/functional/feature_maxuploadtarget.py (2)
49-50
: LGTM! Coordinated test parameter updates.The changes properly update the upload target to 800MB and add the data carrier size parameter. These modifications align with similar updates in other functional tests and maintain test consistency.
103-103
: LGTM! Test logic correctly updated.The
max_bytes_per_day
calculation has been properly updated to reflect the new 800MB upload target, ensuring the test logic remains consistent with the node configuration.src/univalue/include/univalue.h (2)
114-115
: LGTM! Well-designed template method declaration.The templated
push_backV
method provides flexible iterator-based insertion of ranges into UniValue arrays, enhancing the API's usability and supporting move semantics.
185-191
: LGTM! Correct and efficient implementation.The template implementation is well-designed:
- Properly validates the UniValue type before proceeding
- Uses efficient
values.insert(values.end(), first, last)
for range insertion- Returns appropriate boolean status
- Supports move semantics when used with move iterators
test/functional/test_framework/util.py (1)
610-612
: LGTM! Large OP_RETURN output implementation looks correct.The change from multiple small outputs to a single large OP_RETURN output is well-implemented. The math checks out: 67,437 bytes of data plus overhead equals 67,456 bytes total serialized size, achieving the ~66k vbytes target mentioned in the comment.
🧰 Tools
🪛 Pylint (3.3.7)
[refactor] 611-611: Consider using a generator instead 'sum(len(txout.serialize()) for txout in txouts)'
(R1728)
src/wallet/rpc/transactions.cpp (4)
331-331
: Good documentation update.The parameter documentation correctly reflects the change from a specific UniValue reference to a generic vector container.
335-336
: Excellent template generalization.Converting
ListTransactions
to a template function allows it to work with different container types while maintaining type safety. This makes the function more flexible and reusable.
523-523
: Good performance optimization with vector collection.Using
std::vector<UniValue>
to collect transactions before moving them to the final result is more efficient than repeatedly callingpush_back
on aUniValue
array, especially for large transaction lists.
545-547
: Efficient bulk transfer preserving chronological order.The implementation correctly reverses the collected transactions (newest to oldest → oldest to newest) using move iterators and the new
push_backV
method for efficient bulk transfer. The range calculation(txs_rev_it - nFrom - nCount, txs_rev_it - nFrom)
properly handles the skip and count parameters.src/qt/bitcoin.cpp (4)
101-105
: LGTM: Proper Qt 5/6 compatibility for meta type registration.The conditional compilation correctly handles the API change where
qRegisterMetaTypeStreamOperators
was removed in Qt 6 in favor of the simplerqRegisterMetaType
.
144-148
: LGTM: Correct handling of deprecated QLibraryInfo API.The change properly addresses the deprecation of
QLibraryInfo::location()
in Qt 6, replacing it withQLibraryInfo::path()
.
150-152
: LGTM: Improved code style with consistent bracing.Adding braces around single-line if statements improves code readability and consistency.
Also applies to: 155-157, 160-162, 165-167
529-533
: LGTM: Appropriate high-DPI handling for Qt versions.The high-DPI attributes are correctly limited to Qt versions below 6.0.0, as these settings became default behavior in Qt 6.
src/qt/optionsdialog.cpp (1)
399-411
: LGTM: Enhanced user communication in reset dialog.The restructured dialog message provides better user guidance by clearly explaining:
- The restart requirement
- Where settings will be backed up
- What action is being requested
This is a significant improvement over the previous simple concatenation approach.
.cirrus.yml (2)
30-36
: LGTM: Good centralization of common CI settings.The new
main_template
effectively consolidates timeout, ccache, and CI script settings that are shared across multiple tasks.
54-60
: LGTM: Platform-specific template improves organization.The
macos_native_task_template
appropriately encapsulates macOS-specific setup steps like clang version checking and Homebrew package installation.🧰 Tools
🪛 YAMLlint (1.37.1)
[warning] 55-55: too many spaces before colon
(colons)
[warning] 60-60: too many spaces before colon
(colons)
src/wallet/test/coinselector_tests.cpp (2)
209-210
:✅ Verification successful
Verify the Branch and Bound algorithm change is intentional.
The test expectation for selecting 5 cents has changed from
{4 cents, 1 cent}
to{3 cents, 2 cents}
. Both combinations equal 5 cents, but this change suggests the algorithm now prefers different coin combinations when multiple zero-waste solutions exist.Please verify that this change aligns with the intended algorithmic behavior:
🏁 Script executed:
#!/bin/bash # Description: Search for the Branch and Bound implementation to understand the algorithmic change # Expected: Find the implementation and any changes to early exit behavior echo "Searching for Branch and Bound coin selection implementation..." rg -A 10 -B 5 "SelectCoinsBnB|zero.?waste|early.?exit" --type cpp echo -e "\nSearching for BnB algorithm changes..." ast-grep --pattern 'bool SelectCoinsBnB($$$) { $$$ }' echo -e "\nSearching for related test documentation or comments..." rg -A 5 -B 5 "early.*exit|zero.*waste.*solution" --type cppLength of output: 23041
🏁 Script executed:
#!/bin/bash # Display the BnB recursion and early-exit logic in SelectCoinsBnB echo "=== BnbSearch definition ===" rg -n -C5 "BnbSearch" src/wallet/coinselection.cpp echo -e "\n=== Perfect-match bailout (zero-waste) ===" rg -n -C5 "if (curr_value ==.*selection_target)" src/wallet/coinselection.cpp echo -e "\n=== Any 'found_solution' or early-exit flag ===" rg -n -C5 "found" src/wallet/coinselection.cppLength of output: 2073
Exhaustive BnB search: test expectations updated accordingly.
The Branch-and-Bound implementation no longer bails out on the first zero-waste match—instead it explores all perfect-match combinations and picks the one with minimal waste according to its tie-breaker. That change explains why:
- For a 5 ¢ target,
{3 ¢, 2 ¢}
is now chosen over{4 ¢, 1 ¢}
- For a 10 ¢ target,
{4 ¢, 3 ¢, 2 ¢, 1 ¢}
is now chosen instead of combinations with fewer coinsThe updated tests accurately reflect the intended, exhaustive minimization of the waste metric.
236-237
:✅ Verification successful
Confirm the coin selection optimality for the 10-cent test case.
The expected result now selects
{4, 3, 2, 1}
cents (4 coins) instead of using the available 5-cent coin, which could produce fewer coins like{5, 4, 1}
or{5, 3, 2}
(3 coins each). Using more coins generally increases transaction size and fees.This selection pattern suggests the algorithm may be optimizing for criteria other than minimizing coin count. Please verify this is the intended behavior and aligns with the coin selection strategy:
🏁 Script executed:
#!/bin/bash # Description: Examine the coin selection criteria and optimization goals # Expected: Find documentation or code comments explaining the selection strategy echo "Searching for coin selection optimization criteria..." rg -A 10 -B 5 "optimization|minimize|criteria|strategy|waste.*calculation" src/wallet/coinselection.cpp echo -e "\nSearching for comments about coin selection preferences..." rg -A 5 -B 5 "prefer|optimal|better.*solution" src/wallet/coinselection.cppLength of output: 3643
🏁 Script executed:
#!/bin/bash echo "Context around the 10-cent test case:" rg -C 10 "10 \* CENT" src/wallet/test/coinselector_tests.cpp echo -e "\nDefinition of add_coin helper:" rg -C 5 "static void add_coin" src/wallet/test/coinselector_tests.cppLength of output: 8574
BnB selects by minimized waste, not coin count
The Branch & Bound implementation in src/wallet/coinselection.cpp (and documented in Murch’s thesis) optimizes the waste metric—
waste = (selectionTotal – target) + inputs × (currentFeeRate – longTermFeeRate)—
not the raw number of coins. It explores all combinations and, on ties, keeps the last zero-waste solution found. In the 10 cent test,{4, 3, 2, 1}
yields the same zero waste as{5, 4, 1}
or{5, 3, 2}
but is encountered last, so its selection is intentional and correct. No change required.
contrib/guix/libexec/prelude.bash
Outdated
@@ -51,7 +51,7 @@ fi | |||
time-machine() { | |||
# shellcheck disable=SC2086 | |||
guix time-machine --url=https://git.savannah.gnu.org/git/guix.git \ | |||
--commit=f0bb724211872cd6158fce6162e0b8c73efed126 \ | |||
--commit=7bf1d7aeaffba15c4f680f93ae88fbef25427252 \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Verification agent
🧩 Analysis chain
Verify the updated Guix commit hash.
The commit hash has been updated to use a newer version of Guix. Please ensure this commit exists and is stable.
🏁 Script executed:
#!/bin/bash
# Description: Verify the new Guix commit hash exists and get basic info about it
# Expected: The commit should exist and provide information about the changes
# Check if the commit exists in the Guix repository
curl -s "https://git.savannah.gnu.org/cgit/guix.git/commit/?id=7bf1d7aeaffba15c4f680f93ae88fbef25427252" | grep -q "commit" && echo "Commit exists" || echo "Commit not found"
# Get commit information
curl -s "https://git.savannah.gnu.org/cgit/guix.git/commit/?id=7bf1d7aeaffba15c4f680f93ae88fbef25427252" | grep -E "(commit|author|date)" | head -5
Length of output: 316
Invalid Guix commit hash in prelude.bash
The updated hash 7bf1d7aeaffba15c4f680f93ae88fbef25427252
could not be found in the Guix repository. Please verify and replace it with a valid, existing commit ID (or revert to the previous known-good hash f0bb724211872cd6158fce6162e0b8c73efed126
).
• File: contrib/guix/libexec/prelude.bash
Line 54
- --commit=7bf1d7aeaffba15c4f680f93ae88fbef25427252 \
+ --commit=<valid-guix-commit-hash> \
Committable suggestion skipped: line range outside the PR's diff.
🤖 Prompt for AI Agents
In contrib/guix/libexec/prelude.bash at line 54, the Guix commit hash
7bf1d7aeaffba15c4f680f93ae88fbef25427252 is invalid or does not exist in the
repository. Replace this commit hash with a valid, existing commit ID from the
Guix repository, or revert it back to the previous known-good hash
f0bb724211872cd6158fce6162e0b8c73efed126 to ensure stability.
#include <streams.h> | ||
|
||
#include <algorithm> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Verification agent
🧩 Analysis chain
Verify the necessity of the algorithm header.
While the <algorithm>
include follows the modernization pattern, I don't see direct usage of standard algorithm functions in the visible code. Please verify this inclusion is necessary for internal implementations or future compatibility.
🏁 Script executed:
#!/bin/bash
# Description: Check if std::algorithm functions are used in this file
# Expected: Find usage of std::sort, std::find, std::min_element, etc.
rg -A 2 -B 2 "std::(sort|find|search|min_element|max_element|copy|transform|for_each|count|binary_search)" src/util/asmap.cpp
Length of output: 127
🏁 Script executed:
#!/bin/bash
# Display the first 200 lines of src/util/asmap.cpp to inspect for any <algorithm> dependencies
echo "====== src/util/asmap.cpp (lines 1–200) ======"
sed -n '1,200p' src/util/asmap.cpp
Length of output: 8483
Remove unused <algorithm>
include
The <algorithm>
header isn’t referenced anywhere in src/util/asmap.cpp (no calls to sort, find, transform, etc.). You can safely drop it to clean up the include list.
Locations:
- File: src/util/asmap.cpp, line with
#include <algorithm>
Suggested diff:
--- a/src/util/asmap.cpp
+++ b/src/util/asmap.cpp
@@
-#include <algorithm>
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
#include <algorithm> |
🤖 Prompt for AI Agents
In src/util/asmap.cpp at line 13, the #include <algorithm> directive is not used
anywhere in the file. Remove this include statement to clean up unnecessary
headers and reduce compilation overhead.
@@ -3,17 +3,18 @@ | |||
// Distributed under the MIT software license, see the accompanying | |||
// file COPYING or http://www.opensource.org/licenses/mit-license.php. | |||
|
|||
#include <span.h> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Verification agent
🧩 Analysis chain
Header inclusions modernization looks good.
The header changes properly align with the code usage:
<span.h>
is needed forSpan<const unsigned char>
(line 128) andSpan<const uint8_t>
(line 485)<cassert>
replaces<cstdlib>
and correctly supportsassert()
calls (lines 285, 497)<string>
and<vector>
are used throughout for standard containers<ostream>
may be needed for output stream operations
However, I notice std::stringstream
is used on line 286 but <sstream>
isn't included. Please verify this compiles correctly.
Also applies to: 11-11, 15-17
🏁 Script executed:
#!/bin/bash
# Check if sstream header is needed for stringstream usage
rg -A 3 -B 3 "stringstream" src/util/strencodings.cpp
Length of output: 262
Add missing <sstream>
include for std::stringstream
The file uses std::stringstream
in FormatParagraph
(around line 286) but doesn’t include <sstream>
. Please add it to the header list.
• File: src/util/strencodings.cpp
• Location: among the other standard headers at the top of the file
Suggested diff:
#include <vector>
+#include <sstream>
#include <span.h>
#include <ostream>
#include <string>
#include <cassert>
🤖 Prompt for AI Agents
In src/util/strencodings.cpp at line 6, the file uses std::stringstream around
line 286 but does not include the <sstream> header. Add #include <sstream> among
the other standard headers at the top of the file to ensure proper compilation
and usage of stringstream.
task: | ||
name: 'ARM64 Android APK [focal]' | ||
<< : *BASE_TEMPLATE | ||
android_sdk_cache: | ||
folder: "depends/SDKs/android" | ||
fingerprint_key: "ANDROID_API_LEVEL=28 ANDROID_BUILD_TOOLS_VERSION=28.0.3 ANDROID_NDK_VERSION=23.2.8568313" | ||
depends_sources_cache: | ||
folder: "depends/sources" | ||
fingerprint_script: git rev-list -1 HEAD ./depends | ||
<< : *MAIN_TEMPLATE | ||
container: | ||
image: ubuntu:focal | ||
env: | ||
<< : *CIRRUS_EPHEMERAL_WORKER_TEMPLATE_ENV | ||
FILE_ENV: "./ci/test/00_setup_env_android.sh" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Verification agent
🧩 Analysis chain
Fix YAML formatting and undeclared alias issues.
The static analysis identifies several problems that need to be addressed:
- Duplicate task key: Line 194 creates a duplicate "task" key in the YAML mapping
- Undeclared alias: Line 207 references
CIRRUS_EPHEMERAL_WORKER_TEMPLATE_ENV
which is not declared - Spacing issues: Multiple lines have incorrect indentation before colons
🏁 Script executed:
#!/bin/bash
# Verify the YAML syntax and check for the undeclared alias
echo "Checking for CIRRUS_EPHEMERAL_WORKER_TEMPLATE_ENV declaration..."
rg -n "CIRRUS_EPHEMERAL_WORKER_TEMPLATE_ENV.*:" .cirrus.yml || echo "Alias not found"
echo "Validating YAML syntax..."
python3 -c "
import yaml
import sys
try:
with open('.cirrus.yml', 'r') as f:
yaml.safe_load(f)
print('YAML syntax is valid')
except yaml.YAMLError as e:
print(f'YAML syntax error: {e}')
sys.exit(1)
except Exception as e:
print(f'Error: {e}')
sys.exit(1)
"
Length of output: 742
🏁 Script executed:
#!/bin/bash
# Check how many times 'task:' appears at the start of a line
echo "Occurrences of 'task:' in .cirrus.yml:"
rg -n '^task:' .cirrus.yml
Length of output: 257
🏁 Script executed:
#!/bin/bash
# Check if a 'tasks:' mapping exists
echo "Searching for 'tasks:' at the beginning of lines in .cirrus.yml"
rg -n '^tasks:' .cirrus.yml || echo "No 'tasks:' mapping found"
Length of output: 239
Group tasks under a top‐level tasks:
key and fix undefined alias
- Introduce a top‐level
tasks:
sequence so you don’t repeattask:
at the root (avoid duplicate mapping keys). - Declare the missing anchor
&CIRRUS_EPHEMERAL_WORKER_TEMPLATE_ENV
alongside your other templates (or remove its usage). - Normalize the YAML merge syntax—use
<<: *TEMPLATE
(no space before the colon).
Example diff:
+.cirrus.yml
+tasks:
+ - task:
name: 'ARM64 Android APK [focal]'
- << : *BASE_TEMPLATE
+ <<: *BASE_TEMPLATE
android_sdk_cache:
folder: "depends/SDKs/android"
fingerprint_key: "ANDROID_API_LEVEL=28 ANDROID_BUILD_TOOLS_VERSION=28.0.3 ANDROID_NDK_VERSION=23.2.8568313"
depends_sources_cache:
folder: "depends/sources"
fingerprint_script: git rev-list -1 HEAD ./depends
- << : *MAIN_TEMPLATE
+ <<: *MAIN_TEMPLATE
container:
image: ubuntu:focal
env:
- << : *CIRRUS_EPHEMERAL_WORKER_TEMPLATE_ENV
+ <<: *CIRRUS_EPHEMERAL_WORKER_TEMPLATE_ENV
FILE_ENV: "./ci/test/00_setup_env_android.sh"
And in your templates section (near &BASE_TEMPLATE
, &MAIN_TEMPLATE
), add:
env_templates:
CIRRUS_EPHEMERAL_WORKER_TEMPLATE_ENV: &CIRRUS_EPHEMERAL_WORKER_TEMPLATE_ENV
# define required environment variables here
🧰 Tools
🪛 YAMLlint (1.37.1)
[error] 194-194: duplication of key "task" in mapping
(key-duplicates)
[warning] 196-196: too many spaces before colon
(colons)
[warning] 203-203: too many spaces before colon
(colons)
[warning] 207-207: too many spaces before colon
(colons)
[error] 207-207: found undeclared alias "CIRRUS_EPHEMERAL_WORKER_TEMPLATE_ENV"
(anchors)
🤖 Prompt for AI Agents
In .cirrus.yml around lines 194 to 208, fix the YAML by grouping all individual
'task:' entries under a single top-level 'tasks:' key to avoid duplicate mapping
keys. Declare the missing alias 'CIRRUS_EPHEMERAL_WORKER_TEMPLATE_ENV' in the
templates section with an appropriate anchor or remove its usage if not needed.
Also, correct the YAML merge syntax by removing spaces before colons in '<<:
*TEMPLATE' lines and ensure proper indentation throughout the block.
98e358d
to
ff68e99
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
utACK ff68e99
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (2)
contrib/devtools/symbol-check.py (1)
254-257
: Simplify the return statement.The current if/else pattern can be simplified by returning the condition directly, as suggested by the static analysis tool.
Apply this diff to simplify the function:
def check_MACHO_lld(binary) -> bool: - if binary.build_version.tools[0].version == [18, 1, 8]: - return True - return False + return binary.build_version.tools[0].version == [18, 1, 8]🧰 Tools
🪛 Ruff (0.11.9)
255-257: Return the condition directly
Inline condition
(SIM103)
🪛 Pylint (3.3.7)
[convention] 254-254: Missing function or method docstring
(C0116)
[convention] 254-254: Function name "check_MACHO_lld" doesn't conform to snake_case naming style
(C0103)
[warning] 254-254: Redefining name 'binary' from outer scope (line 310)
(W0621)
test/functional/test_framework/util.py (1)
609-609
: Consider moving imports to module level.The static analysis correctly flags that imports are being done inside the function. While this might be intentional to avoid circular imports, consider moving these to the top-level imports if there are no dependency issues.
+from .script import CScript, OP_RETURN # ... later in the function ... - from .script import CScript, OP_RETURN🧰 Tools
🪛 Pylint (3.3.7)
[convention] 609-609: Import outside toplevel (script.CScript, script.OP_RETURN)
(C0415)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (37)
contrib/devtools/symbol-check.py
(1 hunks)contrib/guix/libexec/prelude.bash
(1 hunks)contrib/guix/manifest.scm
(1 hunks)contrib/guix/patches/gcc-remap-guix-store.patch
(1 hunks)contrib/guix/patches/winpthreads-remap-guix-store.patch
(1 hunks)src/qt/bitcoin.cpp
(3 hunks)src/univalue/include/univalue.h
(2 hunks)src/util/asmap.cpp
(1 hunks)src/util/bip32.cpp
(1 hunks)src/util/bip32.h
(0 hunks)src/util/bytevectorhash.cpp
(1 hunks)src/util/bytevectorhash.h
(1 hunks)src/util/error.cpp
(1 hunks)src/util/hasher.cpp
(1 hunks)src/util/hasher.h
(1 hunks)src/util/message.cpp
(1 hunks)src/util/message.h
(1 hunks)src/util/moneystr.cpp
(1 hunks)src/util/readwritefile.cpp
(1 hunks)src/util/serfloat.h
(1 hunks)src/util/spanparsing.cpp
(1 hunks)src/util/strencodings.cpp
(1 hunks)src/util/strencodings.h
(1 hunks)src/util/syserror.cpp
(1 hunks)src/util/thread.cpp
(1 hunks)src/util/time.cpp
(1 hunks)src/util/time.h
(1 hunks)src/util/translation.h
(1 hunks)src/util/vector.h
(1 hunks)src/wallet/coinselection.cpp
(0 hunks)src/wallet/rpc/transactions.cpp
(3 hunks)src/wallet/test/coinselector_tests.cpp
(2 hunks)test/functional/feature_maxuploadtarget.py
(2 hunks)test/functional/mempool_limit.py
(1 hunks)test/functional/mining_prioritisetransaction.py
(1 hunks)test/functional/test_framework/util.py
(1 hunks)test/functional/wallet_importdescriptors.py
(1 hunks)
💤 Files with no reviewable changes (2)
- src/util/bip32.h
- src/wallet/coinselection.cpp
✅ Files skipped from review due to trivial changes (12)
- src/util/time.h
- src/util/spanparsing.cpp
- src/util/translation.h
- src/util/vector.h
- src/util/strencodings.h
- src/util/bytevectorhash.cpp
- src/util/serfloat.h
- src/util/thread.cpp
- src/util/error.cpp
- src/util/moneystr.cpp
- src/util/message.cpp
- src/util/readwritefile.cpp
🚧 Files skipped from review as they are similar to previous changes (21)
- src/util/syserror.cpp
- test/functional/mempool_limit.py
- src/util/bytevectorhash.h
- src/util/message.h
- src/util/bip32.cpp
- src/util/strencodings.cpp
- src/util/hasher.cpp
- src/util/asmap.cpp
- src/util/hasher.h
- contrib/guix/libexec/prelude.bash
- test/functional/wallet_importdescriptors.py
- test/functional/mining_prioritisetransaction.py
- test/functional/feature_maxuploadtarget.py
- contrib/guix/patches/winpthreads-remap-guix-store.patch
- src/util/time.cpp
- contrib/guix/patches/gcc-remap-guix-store.patch
- src/univalue/include/univalue.h
- contrib/guix/manifest.scm
- src/qt/bitcoin.cpp
- src/wallet/rpc/transactions.cpp
- src/wallet/test/coinselector_tests.cpp
🧰 Additional context used
🪛 Ruff (0.11.9)
contrib/devtools/symbol-check.py
255-257: Return the condition directly
Inline condition
(SIM103)
🪛 Pylint (3.3.7)
test/functional/test_framework/util.py
[convention] 607-607: Missing function or method docstring
(C0116)
[convention] 608-608: Import outside toplevel (messages.CTxOut)
(C0415)
[convention] 609-609: Import outside toplevel (script.CScript, script.OP_RETURN)
(C0415)
[refactor] 611-611: Consider using a generator instead 'sum(len(txout.serialize()) for txout in txouts)'
(R1728)
⏰ Context from checks skipped due to timeout of 90000ms (10)
- GitHub Check: linux64_tsan-build / Build source
- GitHub Check: linux64_multiprocess-build / Build source
- GitHub Check: mac-build / Build source
- GitHub Check: win64-build / Build source
- GitHub Check: linux64_nowallet-build / Build source
- GitHub Check: linux64_sqlite-build / Build source
- GitHub Check: linux64_ubsan-build / Build source
- GitHub Check: linux64-build / Build source
- GitHub Check: linux64_fuzz-build / Build source
- GitHub Check: arm-linux-build / Build source
🔇 Additional comments (3)
contrib/devtools/symbol-check.py (1)
255-255
:❓ Verification inconclusive
Verify the updated LLVM linker version.
The version update from
[18, 1, 6]
to[18, 1, 8]
appears to align with build environment updates mentioned in the PR context.Please verify that this version matches the actual LLVM linker version used in your macOS build environment:
🏁 Script executed:
#!/bin/bash # Description: Verify the LLVM linker version used in macOS builds # Expected: Version should match [18, 1, 8] # Check if ld64.lld is available and get its version if command -v ld64.lld >/dev/null 2>&1; then echo "ld64.lld version:" ld64.lld --version elif command -v lld >/dev/null 2>&1; then echo "lld version:" lld --version else echo "LLVM linker not found in PATH" fi # Check Xcode's linker version if on macOS if [[ "$OSTYPE" == "darwin"* ]]; then echo "Xcode linker version:" xcrun --show-sdk-path xcrun --sdk macosx --show-sdk-version fiLength of output: 142
Verify macOS LLVM linker version and simplify return statement
Please confirm that the updated LLVM linker version (
[18, 1, 8]
) matches the one shipped with your macOS build tools, and streamline the conditional incheck_MACHO_lld
.• In
contrib/devtools/symbol-check.py
at line 255, simplify:- if binary.build_version.tools[0].version == [18, 1, 8]: - return True - return False + return binary.build_version.tools[0].version == [18, 1, 8]• Run the version check on a macOS machine (where
ld64.lld
orlld
is inPATH
or viaxcrun
) to ensure it reports18.1.8
.🧰 Tools
🪛 Ruff (0.11.9)
255-257: Return the condition directly
Inline condition
(SIM103)
test/functional/test_framework/util.py (2)
605-606
: Comment updates look good.The updated comments accurately reflect the new implementation that generates a single large OP_RETURN output instead of multiple smaller ones.
610-611
:✅ Verification successful
Verify the data carrier size coordination with test configuration.
The refactoring from 128 small outputs to 1 large output (67,437 bytes) is well-implemented and maintains the expected total serialized size. However, this large OP_RETURN requires coordination with test configurations that set
-datacarriersize=100000
.Please verify that all tests using this function have the appropriate data carrier size configuration:
🏁 Script executed:
#!/bin/bash # Description: Check if tests using gen_return_txouts have proper datacarriersize configuration # Expected: Tests should include -datacarriersize=100000 or similar large value # Find all files that import or use gen_return_txouts rg -l "gen_return_txouts" # Check for datacarriersize configuration in those files rg -A 5 -B 5 "datacarriersize" --type pyLength of output: 2535
All tests using gen_return_txouts include the correct
-datacarriersize
We’ve verified that every test importing or calling
gen_return_txouts
sets-datacarriersize=100000
, which safely accommodates the 67 437-byte OP_RETURN:• test/functional/feature_maxuploadtarget.py
• test/functional/mining_prioritisetransaction.py
• test/functional/mempool_limit.pyNo further changes are needed.
🧰 Tools
🪛 Pylint (3.3.7)
[refactor] 611-611: Consider using a generator instead 'sum(len(txout.serialize()) for txout in txouts)'
(R1728)
@@ -46,8 +46,8 @@ def set_test_params(self): | |||
self.setup_clean_chain = True | |||
self.num_nodes = 1 | |||
self.extra_args = [[ | |||
"-maxuploadtarget=400", | |||
"-acceptnonstdtxn=1", | |||
"-maxuploadtarget=800M", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
25503: is it conflict resolving bug? Should not change maxuploadtarget
here; it's at least out of scope of PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this was a mistake by claude; fixed
@@ -7,11 +7,14 @@ | |||
#include <clientversion.h> | |||
#include <fs.h> | |||
#include <logging.h> | |||
#include <serialize.h> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
25234: missing changes in ci/dash/lint-tidy.sh (which is ci/test/06_script_b.sh)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
ff68e99
to
8b9d343
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (2)
test/functional/test_framework/util.py (2)
605-606
: Documentation improvement needed.The comment describes the output size as "about 66k vbytes" but the actual assertion shows exactly 67,456 bytes. Consider being more precise in the documentation.
-# Create large OP_RETURN txouts that can be appended to a transaction -# to make it large (helper for constructing large transactions). The -# total serialized size of the txouts is about 66k vbytes. +# Create large OP_RETURN txouts that can be appended to a transaction +# to make it large (helper for constructing large transactions). The +# total serialized size of the txouts is exactly 67,456 bytes (~66k vbytes).
607-612
: Address static analysis findings and add documentation.The function implementation looks correct but has several style issues flagged by static analysis:
- Missing function docstring
- Imports inside function (acceptable for test utilities but worth documenting why)
- Magic numbers without explanation
def gen_return_txouts(): + """Generate a single large OP_RETURN transaction output for testing. + + Creates one CTxOut with a large OP_RETURN script containing 67,437 bytes + of data, with total serialized size of 67,456 bytes (~66k vbytes). + + Returns: + List[CTxOut]: List containing one large OP_RETURN output + """ + # Imports are placed here to avoid potential circular import issues from .messages import CTxOut from .script import CScript, OP_RETURN - txouts = [CTxOut(nValue=0, scriptPubKey=CScript([OP_RETURN, b'\x01'*67437]))] - assert_equal(sum([len(txout.serialize()) for txout in txouts]), 67456) + + # Create single large OP_RETURN output: 67,437 bytes of data + overhead = 67,456 bytes total + large_data = b'\x01' * 67437 + txouts = [CTxOut(nValue=0, scriptPubKey=CScript([OP_RETURN, large_data]))] + + # Verify the exact serialized size for test consistency + assert_equal(sum(len(txout.serialize()) for txout in txouts), 67456) return txouts🧰 Tools
🪛 Pylint (3.3.7)
[convention] 607-607: Missing function or method docstring
(C0116)
[convention] 608-608: Import outside toplevel (messages.CTxOut)
(C0415)
[convention] 609-609: Import outside toplevel (script.CScript, script.OP_RETURN)
(C0415)
[refactor] 611-611: Consider using a generator instead 'sum(len(txout.serialize()) for txout in txouts)'
(R1728)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (35)
ci/dash/lint-tidy.sh
(1 hunks)contrib/devtools/symbol-check.py
(1 hunks)contrib/guix/libexec/prelude.bash
(1 hunks)contrib/guix/manifest.scm
(1 hunks)contrib/guix/patches/gcc-remap-guix-store.patch
(1 hunks)contrib/guix/patches/winpthreads-remap-guix-store.patch
(1 hunks)src/univalue/include/univalue.h
(2 hunks)src/util/asmap.cpp
(1 hunks)src/util/bip32.cpp
(1 hunks)src/util/bip32.h
(0 hunks)src/util/bytevectorhash.cpp
(1 hunks)src/util/bytevectorhash.h
(1 hunks)src/util/error.cpp
(1 hunks)src/util/hasher.cpp
(1 hunks)src/util/hasher.h
(1 hunks)src/util/message.cpp
(1 hunks)src/util/message.h
(1 hunks)src/util/moneystr.cpp
(1 hunks)src/util/readwritefile.cpp
(1 hunks)src/util/serfloat.h
(1 hunks)src/util/spanparsing.cpp
(1 hunks)src/util/strencodings.cpp
(1 hunks)src/util/strencodings.h
(1 hunks)src/util/syserror.cpp
(1 hunks)src/util/thread.cpp
(1 hunks)src/util/time.cpp
(1 hunks)src/util/time.h
(1 hunks)src/util/translation.h
(1 hunks)src/util/vector.h
(1 hunks)src/wallet/rpc/transactions.cpp
(3 hunks)src/wallet/test/coinselector_tests.cpp
(2 hunks)test/functional/feature_maxuploadtarget.py
(1 hunks)test/functional/mempool_limit.py
(1 hunks)test/functional/mining_prioritisetransaction.py
(1 hunks)test/functional/test_framework/util.py
(1 hunks)
💤 Files with no reviewable changes (1)
- src/util/bip32.h
✅ Files skipped from review due to trivial changes (7)
- src/util/translation.h
- src/util/spanparsing.cpp
- src/util/error.cpp
- src/util/strencodings.h
- src/util/message.cpp
- ci/dash/lint-tidy.sh
- src/util/time.cpp
🚧 Files skipped from review as they are similar to previous changes (25)
- src/util/time.h
- src/util/hasher.cpp
- src/util/moneystr.cpp
- src/util/syserror.cpp
- src/util/serfloat.h
- src/util/readwritefile.cpp
- src/util/thread.cpp
- src/util/bytevectorhash.h
- src/util/bytevectorhash.cpp
- contrib/guix/libexec/prelude.bash
- src/util/asmap.cpp
- src/util/message.h
- src/util/bip32.cpp
- src/util/vector.h
- test/functional/mining_prioritisetransaction.py
- test/functional/mempool_limit.py
- src/util/strencodings.cpp
- contrib/guix/patches/winpthreads-remap-guix-store.patch
- src/util/hasher.h
- test/functional/feature_maxuploadtarget.py
- contrib/guix/manifest.scm
- contrib/guix/patches/gcc-remap-guix-store.patch
- src/wallet/test/coinselector_tests.cpp
- src/univalue/include/univalue.h
- src/wallet/rpc/transactions.cpp
🧰 Additional context used
🪛 Ruff (0.11.9)
contrib/devtools/symbol-check.py
255-257: Return the condition directly
Inline condition
(SIM103)
🪛 Pylint (3.3.7)
test/functional/test_framework/util.py
[convention] 607-607: Missing function or method docstring
(C0116)
[convention] 608-608: Import outside toplevel (messages.CTxOut)
(C0415)
[convention] 609-609: Import outside toplevel (script.CScript, script.OP_RETURN)
(C0415)
[refactor] 611-611: Consider using a generator instead 'sum(len(txout.serialize()) for txout in txouts)'
(R1728)
⏰ Context from checks skipped due to timeout of 90000ms (5)
- GitHub Check: linux64-build / Build source
- GitHub Check: linux64_nowallet-build / Build source
- GitHub Check: linux64_multiprocess-build / Build source
- GitHub Check: linux64_tsan-build / Build source
- GitHub Check: arm-linux-build / Build source
🔇 Additional comments (2)
contrib/devtools/symbol-check.py (1)
255-257
:✅ Verification successful
Apply the static analysis suggestion for cleaner code.
The version update from
[18, 1, 6]
to[18, 1, 8]
looks appropriate for a toolchain update. However, the function can be simplified by returning the condition directly.Apply this diff to simplify the function:
def check_MACHO_lld(binary) -> bool: - if binary.build_version.tools[0].version == [18, 1, 8]: - return True - return False + return binary.build_version.tools[0].version == [18, 1, 8]Please verify that LLD version 18.1.8 is the correct version for your toolchain:
🌐 Web query:
What is the latest stable version of LLVM LLD linker 18.x series?
💡 Result:
Latest Stable Version of LLVM LLD Linker in the 18.x Series
The most recent stable version of the LLVM LLD linker in the 18.x series is 18.1.8. This version, along with its sources, pre-built binaries, and documentation, is available for download on the official LLVM release page as of June 2025[10].
Citations:
- 1: https://llvm.org
- 2: https://releases.llvm.org
- 3: https://maskray.me/blog/2024-02-18-lld-18-elf-changes
- 4: https://github.com/llvm/llvm-project
- 5: https://rocm.docs.amd.com/projects/llvm-project/en/docs-6.3.1/LLVM/lld/html/
- 6: https://releases.llvm.org/18.1.0/tools/lld/docs/ReleaseNotes.html
- 7: llvm/llvm-project#67779
- 8: https://rocm.docs.amd.com/projects/llvm-project/en/latest/LLVM/lld/html/ReleaseNotes.html
- 9: https://apt.llvm.org
- 10: https://releases.llvm.org/download.html
Simplify
check_MACHO_lld
to return the version check directlyVerified that LLVM LLD 18.1.8 is the latest stable 18.x release, so the function can be reduced to a single return statement.
• File: contrib/devtools/symbol-check.py
Function:check_MACHO_lld
(around lines 255–257)Apply this diff:
def check_MACHO_lld(binary) -> bool: - if binary.build_version.tools[0].version == [18, 1, 8]: - return True - return False + return binary.build_version.tools[0].version == [18, 1, 8]🧰 Tools
🪛 Ruff (0.11.9)
255-257: Return the condition directly
Inline condition
(SIM103)
test/functional/test_framework/util.py (1)
610-610
:✅ Verification successful
Verify OP_RETURN size limits.
The function creates an OP_RETURN script with 67,437 bytes of data, which is significantly larger than typical Bitcoin/Dash OP_RETURN limits. Ensure this large size is supported by the test environment and doesn't violate protocol constraints.
🏁 Script executed:
#!/bin/bash # Description: Check for OP_RETURN size limits in the codebase # Search for OP_RETURN size constraints or limits rg -A 5 -B 5 "OP_RETURN.*[Ll]imit|[Ll]imit.*OP_RETURN|MAX.*OP_RETURN|OP_RETURN.*MAX" --type cpp --type py # Search for datacarriersize parameter usage rg -A 3 -B 3 "datacarriersize" --type cpp --type pyLength of output: 9766
OP_RETURN size is covered by functional test overrides
The 67 437-byte OP_RETURN payload is accepted because functional tests override the default 83 byte limit via the
-datacarriersize=100000
node argument. No changes are needed.Key locations setting a higher limit:
- test/functional/mempool_limit.py
- test/functional/feature_maxuploadtarget.py
- test/functional/mining_prioritisetransaction.py
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
utACK 8b9d343
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
utACK 8b9d343
0bb7a1f ci: Improve naming related to "macOS 12 native x86_64" task (Hennadii Stepanov) 8e017f3 ci, refactor: Add `MACOS_NATIVE_TASK_TEMPLATE` (Hennadii Stepanov) Pull request description: Split from bitcoin#25160 as [suggested](bitcoin#25160 (comment)). ACKs for top commit: MarcoFalke: ACK 0bb7a1f 🚘 Tree-SHA512: d50fe8a51a3364e76d1a5394f718e30bd2994ccdaa4bf73c017c5d81bff00539dcff1cd3879c8b4b6b442b7248b0aa6491489a27c6dd7ec1f3e976aa2a03c730
#30) * Merge bitcoin#25476: test: Remove unnecessary mining from importdescriptors test e3d8d72 test: Remove unnecessary block mining from importdescriptors test (Fabian Jahr) Pull request description: This removes generation of 6 blocks and replaces is with a `sync_all` in the `importdescriptors` test. The generated blocks themself don't seem to serve any purpose in the test. Instead they could make the test flaky (although I did not find open issues pointing to this happening in practice in the CI). Right before the blocks being generated a transaction is created (L454) and later in the test this tx is assumed to be still in the mempool. If the nodes were to sync their mempools before the blocks are generated, the test fails. It currently only seems to work because one node sends the tx while the other generates the blocks and the mempools are not synced fast enough. The `sync_all` is still needed to let nodes catch up at that point. Otherwise races happen further below which the generate call seems to have prevented so far. ACKs for top commit: laanwj: Code review ACK e3d8d72 Tree-SHA512: 14f3dc2938d779d1ad43e09a7e046523fc3c92f41df012833f279a2e88e74c2fcab301fe4f3fcc038bd8460ea1360725a8d1eb5b59acd1039495bacb484fd790 * Update test/functional/wallet_importdescriptors.py --------- Co-authored-by: MacroFake <falke.marco@gmail.com> Co-authored-by: PastaBot <156604295+DashCoreAutoGuix@users.noreply.github.com>
…pecific changes d8d99d0 qt6: Do not use deprecated high DPI attributes in Qt 6 (Hennadii Stepanov) 8927bb8 refactor: Fix style in `initTranslations()` function (Hennadii Stepanov) ad73447 qt6: Do not use deprecated `QLibraryInfo::path` in Qt 6 (Hennadii Stepanov) 3f51d0b qt6: Fix type registration (Hennadii Stepanov) Pull request description: One more step in migration to Qt 6. Could be tested with hebasto#3 or bitcoin#24798. No behavior change when compiling with Qt 5. ACKs for top commit: laanwj: Code review ACK d8d99d0 jarolrod: ACK d8d99d0 Tree-SHA512: e5f92a80f8622e5f95dd98a90783956a26d3c8382b9ca8e479fb6c152cfdc85a2f6084e78d463ceea1e0f0b3ac72d2b086c8ca24967b2b6070553317e9e3252e
af56d63 Revert "bnb: exit selection when best_waste is 0" (Murch) Pull request description: This reverts commit 9b5950d. Waste can be negative. At feerates lower than long_term_feerate this means that a waste of 0 may be a suboptimal solution and this causes the search to exit prematurely. Only when the feerate is equal to the long_term_feerate would achieving a waste of 0 indicate that we have achieved an optimal solution, because it would mean that the excess is 0. It seems unlikely that this would ever occur outside of test cases, and even then we should prefer solutions with more inputs over solutions with fewer according to previous decisions—but solutions with more inputs are found later in the branch exploration. The "optimization" described in bitcoin#18257 and implemented in bitcoin#18262 is therefore a premature exit on a suboptimal solution and should be reverted. ACKs for top commit: sipa: utACK af56d63 S3RK: utACK af56d63 achow101: ACK af56d63 glozow: utACK af56d63, agree it is incorrect to stop here unless we could rule out the possibility of a better solution with negative waste. `SelectCoinsBnB` doesn't know what long term feerate and effective feerate are (and probably shouldn't) so it's better to have no exit early condition at all. Tree-SHA512: 470f1a49041a0042cb69d239fccac7512ace79871d43508b6e7f7a2f3aca3523930b16e00c5513b816d5fe078d9ab53e42b0a80fd3c3d48e6434f24c2b009077
…ing large outputs (instead of `acceptnonstdtxn`) 475aae8 test: pass `datacarriersize` option for tests using large outputs (instead of `acceptnonstdtxn`) (Sebastian Falbesoner) b1ba3ed test: let `gen_return_txouts` create a single large OP_RETURN output (Sebastian Falbesoner) f319287 test: assert serialized txouts size of `gen_return_txouts` helper (Sebastian Falbesoner) Pull request description: By specifying the `datacarriersize` option instead of the more generic `acceptnonstdtxn` for functional tests, we can be more specific about what part of the transaction is non-standard and can be sure that all other aspects follow the standard policy. Transactions with more than one OP_RETURN output are [never considered standard](https://github.com/bitcoin/bitcoin/blob/749b80b29e875cc6afa1c2674cccdfd7115cc16a/src/policy/policy.cpp#L149-L153), i.e. we have to change the `gen_return_txouts` helper to create only a single output in order to get rid of the `acceptnonstdxtn` option. Note that on master there is currently no test using the `datacarriersize` parameter, so this PR indirectly also increases the test coverage. The change affects the tests `mempool_limit.py`, `mining_prioritisetransaction.py` (call `gen_return_txouts` directly) and `feature_maxuploadtarget.py` (calls `gen_return_txouts` indirectly via the `mine_large_block(...)` helper). Top commit has no ACKs. Tree-SHA512: c17f032e00d28f5e5880a4d378773fbc8b1995ea9c377f237598d412628fe117f497a44ebdfa8af8cd8a3b1e3127e0cf7692efbf5c833c713764a71a85301f23
…e in listtransactions fa8a1c0 rpc: Fix Univalue push_backV OOM in listtransactions (MacroFake) Pull request description: Related to, but not intended as a fix for bitcoin#25229. Currently the RPC will have the same data stored thrice: * `UniValue ret` (memory filled by `ListTransactions`) * `std::vector<UniValue> vec` (constructed by calling `push_backV`) * `UniValue result` (the actual result, memory filled by `push_backV`) Fix this by filling the memory only once: * `std::vector<UniValue> ret` (memory filled by `ListTransactions`) * Pass iterators to `push_backV` instead of creating a full copy * Move memory into `UniValue result` instead of copying it ACKs for top commit: shaavan: Code Review ACK fa8a1c0 Tree-SHA512: 1c3ca40fc8497134a4141195160e4aa9fe72b3c00c5998c972b58ad0eb498ebea05013f9105bb80e7264c9db1d0e7a2032396a8a4af1f326d831fbee20f32ea3
07f2c25 refactor: add most of src/util to iwyu (fanquake) Pull request description: These files change infrequently, and not much header shuffling is required. We don't add everything in src/util/ yet, because IWYU makes some dubious suggestions, which I'm going to follow up with upstream. Soon we'll swap `src/util/xyz.cpp` for just `src/util/`. ACKs for top commit: hebasto: ACK 07f2c25, I have reviewed the code and it looks OK, I agree it can be merged. Tree-SHA512: 07d76435c2bff1a62c4967eb0efaafe619cc3bbaf4166741d8520927b24336c01aee59822f8082ee2a01e15046a0f5d506b4b23a6e40ceb750f3226ed8167847
8b9d343
to
2725e91
Compare
, bitcoin#25369, bitcoin#25617, bitcoin#25611, bitcoin#25736, bitcoin#25714, bitcoin#26612, bitcoin#27605, bitcoin#30464, partial bitcoin#25551 (univalue backports) 05e2091 merge bitcoin#30464: Fix MSVC warning C4101 "unreferenced local variable" (Kittywhiskers Van Gogh) f00dc78 build: drop `-Wdangling-reference` GCC suppression (Kittywhiskers Van Gogh) 6d81d06 merge bitcoin#27605: Replace global find_value function with UniValue::find_value method (Kittywhiskers Van Gogh) 203a1c1 merge bitcoin#26612: pass named argument value as string_view (Kittywhiskers Van Gogh) 41eb3b0 merge bitcoin#25714: Avoid std::string copies (Kittywhiskers Van Gogh) 6f03a13 merge bitcoin#25736: Remove unused and confusing set*() return value (Kittywhiskers Van Gogh) 27cffb1 refactor: shed avoidable casts in Dash-specific UniValue-ret functions (Kittywhiskers Van Gogh) 32958da merge bitcoin#25611: Avoid brittle, narrowing and verbose integral type confusions (Kittywhiskers Van Gogh) 7802752 merge bitcoin#25617: univalue test cleanups (Kittywhiskers Van Gogh) 94bbbf1 partial bitcoin#25551: Throw exception on invalid Univalue pushes over silent ignore (Kittywhiskers Van Gogh) d980870 revert: revert bitcoin#25464 (Reduce Univalue push_backV peak memory usage in listtransactions) (Kittywhiskers Van Gogh) 1e023e5 merge bitcoin#25369: Unsubtree Univalue (Kittywhiskers Van Gogh) 6b9e682 merge bitcoin#25249: Bump univalue subtree (Kittywhiskers Van Gogh) b3443ee Squashed 'src/univalue/' changes from 6c19d050a9..de4f73ddca (Kittywhiskers Van Gogh) 9db7b12 merge bitcoin#25113: Bump univalue subtree (Kittywhiskers Van Gogh) 88f794f Squashed 'src/univalue/' changes from a44caf65fe..6c19d050a9 (Kittywhiskers Van Gogh) b07e550 merge bitcoin#25153: Use getInt<T> over get_int/get_int64 (Kittywhiskers Van Gogh) b1ae6f5 Squashed 'src/univalue/' changes from 2740c4f..a44caf65fe (Kittywhiskers Van Gogh) 1780961 revert: bitcoin#25464 (Reduce Univalue push_backV peak memory usage in listtransactions) (Kittywhiskers Van Gogh) Pull request description: ## Motivation To get rid of the `-Wdangling-reference` suppression ([source](https://github.com/dashpay/dash/blob/f648039258d2192ec5e505721e34edaa0bda568c/configure.ac#L461-L467)) for GCC introduced in [dash#6639](#6639) by backporting the set of changes needed to backport [bitcoin#27605](bitcoin#27605). ## Additional Information * At some point, the contents on `univalue/` diverged from official repository ([bitcoin-core/univalue-subtree](https://github.com/bitcoin-core/univalue-subtree)), which makes updating the subtree a more difficult prospect. We realign the subtree by updating it to [`a44caf65`](bitcoin-core/univalue-subtree@a44caf65) (last sane commit, taken from [bitcoin#22646](bitcoin#22646), which was backported as [dash#4823](#4823)) and marking all merge conflicts in favour of the incoming update. This lets us do the final few subtree updates before it's no longer treated as a subtree. * To allow for subtree updates, [bitcoin#25464](bitcoin#25464) (backported as 001d7ba in [dash#6698](#6698)) was temporarily reverted and then reapplied _after_ the directory was unsubtree'd. * [bitcoin#30464](bitcoin#30464) needed to be backported to keep the whitespace linter happy (failed [build](https://github.com/dashpay/dash/actions/runs/16463979981/job/46536933377#step:5:119)). ## Breaking Changes None expected. ## Checklist - [x] I have performed a self-review of my own code - [x] I have commented my code, particularly in hard-to-understand areas **(note: N/A)** - [x] I have added or updated relevant unit/integration/functional/e2e tests - [x] I have made corresponding changes to the documentation **(note: N/A)** - [x] I have assigned this pull request to a milestone _(for repository code-owners and collaborators only)_ ACKs for top commit: UdjinM6: utACK 05e2091 Tree-SHA512: fdd35699defcc24a396fc9746a8eca26a5866666e9ae049f7d9e38fe84021aa49169e48b9408d3c47c6cd41aa9523f0f94a8b91ecc874a962bf5e6005d7eff21
Issue being fixed or feature implemented
Batch of backports done automatically via claude code.
What was done?
See commits
How Has This Been Tested?
CI ran on each commit
Breaking Changes
None noticed
Checklist: