-
Notifications
You must be signed in to change notification settings - Fork 1.2k
backport: bitcoin#25285, #25298, #25331, #25445, #25638, #25691, #25699, #25809, #25976, #26079 #6903
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
base: develop
Are you sure you want to change the base?
Conversation
b1f662b doc: Fix command in "OpenBSD Build Guide" (Hennadii Stepanov) Pull request description: Fixed `pkg_add sqlite3` command. ACKs for top commit: theStack: ACK b1f662b Tree-SHA512: b1dd1baa238f76dadfb188b46bc72f993cc88ea4651cf0836cd85348429baa15228e9cd4c15e588675c9f340692118952302a8629f45d7dc275cc086917c11ca
…in MiniWallet fa83c0c test: Remove unused call to generate in rpc_mempool_info (MacroFake) fa13375 test: Sync MiniWallet utxo state after each generate call (MacroFake) dddd7c4 test: Drop spent utxos in MiniWallet scan_tx (MacroFake) fa04ff6 test: Return new_utxos from create_self_transfer_multi in MiniWallet (MacroFake) fa34e44 test: Return new_utxo from create_self_transfer in MiniWallet (MacroFake) Pull request description: I need this for some stuff, but it also makes sense on its own to: * unify the flow with a private `_create_utxo` helper * simplify the flow by giving the caller ownership of the utxo right away ACKs for top commit: kouloumos: re-ACK fa83c0c 🚀 Tree-SHA512: 381f0e814864ba207363a56859a6c0519e4a86d0562927f16a610a5b706c9fc942c1b5e93388cda0fa0b3cacd58f55bc2ffcc60355858a580263e5bef33c2f4b
…d use it where possible facc2fa Use AutoFile where possible (MacroFake) 6666803 streams: Add AutoFile without ser-type and ser-version (MacroFake) Pull request description: This was done in the context of bitcoin#25284 , but I think it also makes sense standalone. The basic idea is that serialization type should not be initialized when it is not needed. Same for the serialization version. So do this here for `AutoFile`. `CAutoFile` remains in places where it is not yet possible. ACKs for top commit: laanwj: Code review ACK facc2fa fanquake: ACK facc2fa Tree-SHA512: d82d024d55af57565ac53d9d1517afafc12b46964effba0332de62a6c77869356fa77f89e6d4834438fff44c45b64fccdf5a1358bfea03e28dfe55013b3c099d
…ChainImpl fa32b1b refactor: Use chainman() helper consistently in ChainImpl (MacroFake) Pull request description: Doing anything else will just lead to more verbose and inconsistent code. ACKs for top commit: fanquake: ACK fa32b1b - all instances of `Assert(m_node.chainman)` in node/interfaces replaced with `chainman()`, which is the same thing. shaavan: Code Review ACK fa32b1b Tree-SHA512: a417680f79c150e4431aa89bc9db79fdf2dd409419081eb243194837b4ab8d16434165393f39a157473802753843e8c5314ad05c569b4e9221ce29a9fd1cefb8
…version and use it where possible faf9acc Use HashWriter where possible (MacroFake) faa5425 Add HashWriter without ser-type and ser-version (MacroFake) Pull request description: This was done in the context of bitcoin#25284 , but I think it also makes sense standalone. The basic idea is that serialization type should not be initialized when it is not needed. Same for the serialization version. So do this here for `HashWriter`. `CHashWriter` remains in places where it is not yet possible. ACKs for top commit: sipa: utACK faf9acc Empact: utACK bitcoin@faf9acc Tree-SHA512: 544cc712436e49f6e608120bcd3ddc5ea72dd236554ce30fb6cfff34a92d7e67b6e6527336ad0f5b6365e2b2884f4c6508aef775953ccd9312f17752729703f2
… & fix getblock help 56d9244 RPC: Document "asm" and "hex" fields for scripts (Luke Dashjr) 2cdd4df Bugfix: RPC/blockchain: Correct type of "value" in getblock docs; add missing "desc" (Jon Atack) Pull request description: Inspired by bitcoin#24718 ACKs for top commit: kristapsk: cr utACK 56d9244 Tree-SHA512: 2c6d0291397929f6a76b2d2998789187da123d7bfcace77375331cb81995eb0afd2600286c1e25cf68d16e35bd58706d2f672f63a3febe5e3a556a668f2175a2
…e::VNULL fa28d0f scripted-diff: Replace NullUniValue with UniValue::VNULL (MacroFake) fa96210 fuzz: refactor: Replace NullUniValue with UniValue{} (MacroFake) Pull request description: This refactor is needed to disable the (potentially expensive for large json) UniValue copy constructors. ACKs for top commit: fanquake: ACK fa28d0f Tree-SHA512: 7d4204cce0a6fc4ecda96973de77d15b7e4c7caa3e0e890e1f5b9a4b9ace8b240b1f7565d6ab586e168a5fa1201b6c60a924868ef34d6abfbfd8ab7f0f99fbc7
…n't install entire docs/ dir d755ffc build: package test_bitcoin in Windows installer (fanquake) aa30e04 build: remove entire docs dir from Windows installer (fanquake) Pull request description: Haven't tested other than checking that it Guix builds. Fixes: bitcoin#17171. Guix build (x86_64): ```bash 6e2886c80eba9c829047c04586b142d5f8f1c53c31aa82834aff39ae5dbf1762 guix-build-d755ffc3277c/output/dist-archive/bitcoin-d755ffc3277c.tar.gz cdf727c45c3283523726b4ec27f051de5931469874af736eac05d48016d6369b guix-build-d755ffc3277c/output/x86_64-w64-mingw32/SHA256SUMS.part 546866b2f0c8067c168a936246c4cda25745c1b484322201230b885511f2abd7 guix-build-d755ffc3277c/output/x86_64-w64-mingw32/bitcoin-d755ffc3277c-win64-debug.zip 31dbb780dff003089d0e9a3a2598cde89453af4f1b18e392a186a6ec14718b48 guix-build-d755ffc3277c/output/x86_64-w64-mingw32/bitcoin-d755ffc3277c-win64-setup-unsigned.exe 39f1c55a2426390f014282d0a736ceb77e461199fde6ccefcef53ecf10dc4960 guix-build-d755ffc3277c/output/x86_64-w64-mingw32/bitcoin-d755ffc3277c-win64-unsigned.tar.gz 7e4f7dc3475598d187e77cc31842ad2ce876fb98dc42e999b32bdefbf0b79df1 guix-build-d755ffc3277c/output/x86_64-w64-mingw32/bitcoin-d755ffc3277c-win64.zip ``` ACKs for top commit: jarolrod: ACK d755ffc 1440000bytes: ACK bitcoin@d755ffc hebasto: ACK d755ffc, tested on Windows 11 Pro. Tree-SHA512: 7f1b46182b616806f706e20ccb05d8e563d5ff8f1155169713db780c06bbe3fffdb4c1b3f5da7c3e01bfcd40e7046811ff0710b81342d4c53d67ce91b36a7da7
…supported" 34a2f91 Revert "doc: note that brew installed qt is not supported" (Hennadii Stepanov) Pull request description: As bitcoin#26056 fixes bitcoin#25947 it looks reasonable to revert bitcoin#21988. ACKs for top commit: fanquake: ACK 34a2f91 - haven't tested at all. jarolrod: ACK bitcoin@34a2f91 Tree-SHA512: 4470f21fb6ea32970d7572c83ba064bcbe6e3282cea79122312f8ac203a5b1617b21952db1d6e47ba5b6f605abc23f72c04c07cef7251272e22fb593ff317beb
✅ No Merge Conflicts DetectedThis PR currently has no conflicts with other open PRs. |
WalkthroughThe changes introduce a new AutoFile base class and adjust CAutoFile to derive from it (streams.h), replace many CAutoFile usages with AutoFile, and change multiple function signatures and call sites to accept AutoFile&. CHashWriter usages are replaced with HashWriter in many hashing paths and corresponding APIs (hash.*, muhash, interpreter, node, wallet). RPC handlers and tests standardize null returns from NullUniValue to UniValue::VNULL. Build files add BITCOIN_TEST_NAME/BITCOIN_TEST_BIN and the Windows installer packaging now includes the testnet binary. Documentation and several tests were also adjusted (OpenBSD/osx docs, test expectations). Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Rationale: Changes are widespread but follow consistent, repetitive patterns (CAutoFile→AutoFile, CHashWriter→HashWriter, NullUniValue→UniValue::VNULL) with a central structural addition (AutoFile/CAutoFile redesign). Review requires checking many call sites for correct type/signature updates and ensuring serialization/hashing semantics preserved, but individual edits are low-complexity and homogeneous. Pre-merge checks and finishing touches❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (1 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🧰 Additional context used📓 Path-based instructions (1)test/functional/**/*.py📄 CodeRabbit inference engine (CLAUDE.md)
Files:
🧠 Learnings (1)📓 Common learnings
🧬 Code graph analysis (1)test/functional/rpc_blockchain.py (3)
🔇 Additional comments (3)
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. Comment |
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: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
src/script/interpreter.cpp (1)
1469-1498
: Restore sha256d hashing for witness preimages
GetPrevoutsSHA256
,GetSequencesSHA256
, andGetOutputsSHA256
now callGetSHA256()
, which produces a single-round SHA256. Prior to this changeCHashWriter::GetHash()
returned the standard Bitcoin double-SHA (sha256d), matching BIP143/BIP341 requirements for the witness digest. Switching to a single-round hash alters the serialized preimage and breaks signature verification consensus-wide. Please keep these helpers returning the sha256d result (e.g., by usingGetHash()
onHashWriter
).- return ss.GetSHA256(); + return ss.GetHash();Apply the same fix to the other two helpers.
src/node/coinstats.cpp (1)
59-60
: Restore height/coinbase encoding in serialized hash.Dropping the parentheses makes the ternary operate on the whole sum, so we now serialize only
0
or1
for each output cluster. That completely changes the legacy hash used by CoinStats snapshots/assumeutxo validation, breaking snapshot creation and verification on this branch.- ss << VARINT(it->second.nHeight * 2 + it->second.fCoinBase ? 1u : 0u); + ss << VARINT(it->second.nHeight * 2 + (it->second.fCoinBase ? 1u : 0u));
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (57)
Makefile.am
(2 hunks)configure.ac
(2 hunks)doc/build-openbsd.md
(1 hunks)doc/build-osx.md
(0 hunks)share/setup.nsi.in
(1 hunks)src/crypto/muhash.cpp
(2 hunks)src/flat-database.h
(2 hunks)src/hash.cpp
(1 hunks)src/hash.h
(1 hunks)src/index/blockfilterindex.cpp
(4 hunks)src/index/txindex.cpp
(1 hunks)src/net.cpp
(1 hunks)src/node/blockstorage.cpp
(1 hunks)src/node/coinstats.cpp
(3 hunks)src/node/interfaces.cpp
(8 hunks)src/node/txreconciliation.cpp
(1 hunks)src/policy/fees.cpp
(6 hunks)src/policy/fees.h
(2 hunks)src/rpc/blockchain.cpp
(10 hunks)src/rpc/blockchain.h
(1 hunks)src/rpc/coinjoin.cpp
(7 hunks)src/rpc/evo.cpp
(5 hunks)src/rpc/governance.cpp
(4 hunks)src/rpc/masternode.cpp
(2 hunks)src/rpc/mining.cpp
(2 hunks)src/rpc/net.cpp
(8 hunks)src/rpc/node.cpp
(4 hunks)src/rpc/rawtransaction.cpp
(5 hunks)src/script/interpreter.cpp
(4 hunks)src/streams.h
(3 hunks)src/test/flatfile_tests.cpp
(3 hunks)src/test/fuzz/autofile.cpp
(1 hunks)src/test/fuzz/parse_univalue.cpp
(1 hunks)src/test/fuzz/policy_estimator.cpp
(1 hunks)src/test/fuzz/policy_estimator_io.cpp
(1 hunks)src/test/fuzz/util.h
(1 hunks)src/test/fuzz/utxo_snapshot.cpp
(1 hunks)src/test/util/chainstate.h
(3 hunks)src/test/validation_chainstatemanager_tests.cpp
(2 hunks)src/util/asmap.cpp
(1 hunks)src/util/message.cpp
(1 hunks)src/validation.cpp
(4 hunks)src/validation.h
(2 hunks)src/wallet/dump.cpp
(2 hunks)src/wallet/rpc/addresses.cpp
(12 hunks)src/wallet/rpc/backup.cpp
(23 hunks)src/wallet/rpc/coins.cpp
(8 hunks)src/wallet/rpc/encrypt.cpp
(7 hunks)src/wallet/rpc/signmessage.cpp
(1 hunks)src/wallet/rpc/spend.cpp
(8 hunks)src/wallet/rpc/transactions.cpp
(8 hunks)src/wallet/rpc/wallet.cpp
(13 hunks)test/functional/feature_addrman.py
(1 hunks)test/functional/feature_dbcrash.py
(1 hunks)test/functional/feature_fee_estimation.py
(1 hunks)test/functional/rpc_blockchain.py
(3 hunks)test/functional/rpc_mempool_info.py
(0 hunks)
💤 Files with no reviewable changes (2)
- test/functional/rpc_mempool_info.py
- doc/build-osx.md
🧰 Additional context used
📓 Path-based instructions (4)
src/**/*.{cpp,h,cc,cxx,hpp}
📄 CodeRabbit inference engine (CLAUDE.md)
src/**/*.{cpp,h,cc,cxx,hpp}
: Dash Core C++ codebase must be written in C++20 and require at least Clang 16 or GCC 11.1
Dash uses unordered_lru_cache for efficient caching with LRU eviction
Files:
src/wallet/rpc/backup.cpp
src/rpc/masternode.cpp
src/rpc/governance.cpp
src/node/blockstorage.cpp
src/rpc/evo.cpp
src/node/txreconciliation.cpp
src/rpc/coinjoin.cpp
src/hash.cpp
src/hash.h
src/test/fuzz/policy_estimator_io.cpp
src/rpc/node.cpp
src/test/validation_chainstatemanager_tests.cpp
src/wallet/rpc/spend.cpp
src/rpc/mining.cpp
src/wallet/rpc/signmessage.cpp
src/wallet/rpc/coins.cpp
src/wallet/rpc/transactions.cpp
src/test/fuzz/policy_estimator.cpp
src/wallet/rpc/encrypt.cpp
src/flat-database.h
src/wallet/rpc/addresses.cpp
src/test/flatfile_tests.cpp
src/rpc/blockchain.h
src/wallet/rpc/wallet.cpp
src/policy/fees.cpp
src/script/interpreter.cpp
src/test/fuzz/util.h
src/net.cpp
src/rpc/net.cpp
src/crypto/muhash.cpp
src/util/asmap.cpp
src/test/fuzz/autofile.cpp
src/node/interfaces.cpp
src/rpc/rawtransaction.cpp
src/policy/fees.h
src/index/txindex.cpp
src/wallet/dump.cpp
src/index/blockfilterindex.cpp
src/validation.cpp
src/node/coinstats.cpp
src/validation.h
src/test/fuzz/parse_univalue.cpp
src/util/message.cpp
src/test/fuzz/utxo_snapshot.cpp
src/rpc/blockchain.cpp
src/test/util/chainstate.h
src/streams.h
src/{test,wallet/test,qt/test}/**/*.{cpp,h,cc,cxx,hpp}
📄 CodeRabbit inference engine (CLAUDE.md)
Unit tests for C++ code should be placed in src/test/, src/wallet/test/, or src/qt/test/ and use Boost::Test or Qt 5 for GUI tests
Files:
src/test/fuzz/policy_estimator_io.cpp
src/test/validation_chainstatemanager_tests.cpp
src/test/fuzz/policy_estimator.cpp
src/test/flatfile_tests.cpp
src/test/fuzz/util.h
src/test/fuzz/autofile.cpp
src/test/fuzz/parse_univalue.cpp
src/test/fuzz/utxo_snapshot.cpp
src/test/util/chainstate.h
test/functional/**/*.py
📄 CodeRabbit inference engine (CLAUDE.md)
Functional tests should be written in Python and placed in test/functional/
Files:
test/functional/feature_addrman.py
test/functional/rpc_blockchain.py
test/functional/feature_fee_estimation.py
test/functional/feature_dbcrash.py
doc/**
📄 CodeRabbit inference engine (CLAUDE.md)
Unless specifically prompted, avoid making changes to the doc directory (documentation)
Files:
doc/build-openbsd.md
🧠 Learnings (4)
📓 Common learnings
Learnt from: kwvg
PR: dashpay/dash#6543
File: src/wallet/receive.cpp:240-251
Timestamp: 2025-02-06T14:34:30.466Z
Learning: Pull request #6543 is focused on move-only changes and refactoring, specifically backporting from Bitcoin. Behavior changes should be proposed in separate PRs.
Learnt from: knst
PR: dashpay/dash#6871
File: contrib/guix/libexec/build.sh:358-360
Timestamp: 2025-10-05T20:38:28.457Z
Learning: In the Dash repository, when backporting code from Bitcoin Core, typos and minor issues in comments should be kept as-is to reduce merge conflicts in future backports, even if they remain unfixed in Bitcoin Core's master branch.
📚 Learning: 2025-08-08T07:01:47.332Z
Learnt from: knst
PR: dashpay/dash#6805
File: src/wallet/rpc/wallet.cpp:357-357
Timestamp: 2025-08-08T07:01:47.332Z
Learning: In src/wallet/rpc/wallet.cpp, the upgradetohd RPC now returns a UniValue string message (RPCResult::Type::STR) instead of a boolean, including guidance about mnemonic backup and null-character passphrase handling; functional tests have been updated to assert returned strings in several cases.
Applied to files:
src/wallet/rpc/backup.cpp
src/rpc/masternode.cpp
src/rpc/governance.cpp
src/rpc/evo.cpp
src/rpc/coinjoin.cpp
src/rpc/node.cpp
src/wallet/rpc/spend.cpp
src/rpc/mining.cpp
src/wallet/rpc/signmessage.cpp
src/wallet/rpc/coins.cpp
src/wallet/rpc/transactions.cpp
src/wallet/rpc/encrypt.cpp
src/wallet/rpc/addresses.cpp
src/wallet/rpc/wallet.cpp
src/rpc/net.cpp
src/rpc/blockchain.cpp
📚 Learning: 2025-02-14T15:19:17.218Z
Learnt from: kwvg
PR: dashpay/dash#6529
File: src/wallet/rpcwallet.cpp:3002-3003
Timestamp: 2025-02-14T15:19:17.218Z
Learning: The `GetWallet()` function calls in `src/wallet/rpcwallet.cpp` are properly validated with null checks that throw appropriate RPC errors, making additional validation unnecessary.
Applied to files:
src/wallet/rpc/backup.cpp
src/rpc/governance.cpp
src/wallet/rpc/spend.cpp
src/wallet/rpc/coins.cpp
src/wallet/rpc/transactions.cpp
src/wallet/rpc/wallet.cpp
📚 Learning: 2025-07-23T09:30:34.631Z
Learnt from: kwvg
PR: dashpay/dash#6761
File: src/chainlock/signing.h:5-6
Timestamp: 2025-07-23T09:30:34.631Z
Learning: Dash Core uses BITCOIN_ prefix for header guards as the standard convention, inherited from Bitcoin Core. Only a few BLS-specific files in src/bls/ use DASH_ prefix. The vast majority of files (385+) use BITCOIN_ prefix.
Applied to files:
configure.ac
🧬 Code graph analysis (15)
src/wallet/rpc/backup.cpp (2)
src/wallet/rpc/wallet.cpp (1)
wallet
(301-301)src/wallet/rpc/util.h (1)
wallet
(18-45)
src/rpc/masternode.cpp (1)
src/wallet/rpc/wallet.cpp (1)
wallet
(301-301)
src/rpc/governance.cpp (1)
src/wallet/rpc/wallet.cpp (1)
wallet
(301-301)
src/node/txreconciliation.cpp (1)
src/hash.cpp (2)
TaggedHash
(85-92)TaggedHash
(85-85)
src/hash.h (1)
src/hash.cpp (2)
TaggedHash
(85-92)TaggedHash
(85-85)
src/test/validation_chainstatemanager_tests.cpp (1)
src/test/util/chainstate.h (1)
auto_infile
(44-51)
test/functional/rpc_blockchain.py (2)
test/functional/test_framework/messages.py (2)
dashhash
(92-93)hash256
(89-90)src/rpc/blockchain.cpp (2)
getblock
(913-1032)getblock
(913-913)
src/wallet/rpc/encrypt.cpp (1)
src/wallet/rpc/util.h (1)
wallet
(18-45)
src/flat-database.h (3)
src/fs.h (1)
fsbridge
(206-241)src/policy/fees.cpp (2)
fileout
(166-166)filein
(172-172)src/addrdb.cpp (2)
fileout
(58-58)filein
(117-117)
src/wallet/rpc/addresses.cpp (1)
src/wallet/rpc/util.cpp (2)
EnsureLegacyScriptPubKeyMan
(96-106)EnsureLegacyScriptPubKeyMan
(96-96)
src/policy/fees.cpp (1)
src/flat-database.h (2)
fileout
(54-72)filein
(81-156)
src/test/fuzz/util.h (2)
src/test/fuzz/util.cpp (2)
open
(480-519)open
(480-480)src/streams.h (1)
AutoFile
(493-580)
src/policy/fees.h (2)
src/streams.h (3)
AutoFile
(493-580)Write
(455-470)Read
(407-426)src/policy/fees.cpp (10)
Write
(408-416)Write
(408-408)Write
(929-952)Write
(929-929)fileout
(166-166)Read
(418-472)Read
(418-418)Read
(954-1014)Read
(954-954)filein
(172-172)
src/index/blockfilterindex.cpp (3)
src/flat-database.h (2)
filein
(81-156)fileout
(54-72)src/policy/fees.cpp (2)
filein
(172-172)fileout
(166-166)src/addrdb.cpp (2)
filein
(117-117)fileout
(58-58)
src/test/util/chainstate.h (2)
src/streams.h (1)
AutoFile
(493-580)src/node/utxo_snapshot.h (1)
SnapshotMetadata
(15-34)
🪛 Flake8 (7.3.0)
test/functional/rpc_blockchain.py
[error] 43-43: 'test_framework.script.hash256' imported but unused
(F401)
🔇 Additional comments (28)
test/functional/feature_dbcrash.py (1)
195-200
: Good practice: trailing comma improves diff clarity.The addition of the trailing comma after
fee_per_output=FEE // 3,
is idiomatic Python and makes the diff cleaner when adding or modifying parameters in the future. No semantic impact on test behavior.src/rpc/rawtransaction.cpp (1)
151-152
: Documentation improvements for RPC result descriptions.These updates enhance the clarity of RPC help documentation by providing more specific descriptions for script-related fields (signature scripts, public key scripts, and redeem scripts). The changes are purely documentation—no functional or behavioral changes. This aligns well with the PR objective of backporting Bitcoin Core documentation corrections.
Also applies to: 165-165, 167-167, 1036-1037, 1051-1052, 1095-1096
doc/build-openbsd.md (1)
39-39
: Correct OpenBSD package manager syntax.Removing "install" from the
pkg_add
command fixes invalid OpenBSD syntax. The correct form ispkg_add <package>
without an "install" argument.src/test/fuzz/parse_univalue.cpp (1)
30-30
: LGTM! Consistent with null representation standardization.The change from the previous null representation to
UniValue{}
aligns with the PR's objective to standardize null/empty UniValue representations across the codebase. Sincevalid
is set tofalse
before this return and triggers an early exit on line 34, the constructed value is never used, making this change safe and purely for consistency.src/node/interfaces.cpp (1)
831-831
: LGTM! Consistent refactoring to use accessor method.The changes consistently replace direct member access (
m_node.chainman->
) with thechainman()
accessor method throughout theChainImpl
class. This improves encapsulation and maintains null safety via theAssert()
in the accessor. The refactoring is part of the Bitcoin Core v24 backport and follows the same pattern already used elsewhere in the file.Also applies to: 841-841, 849-849, 886-886, 921-922, 927-927, 933-934, 944-946, 953-955, 1058-1058, 1080-1080, 1133-1133
src/rpc/masternode.cpp (2)
138-138
: LGTM! Null return standardization.The change from
NullUniValue
toUniValue::VNULL
correctly standardizes the null return value when no wallet is available. This is consistent with the broader refactoring to use explicitUniValue::VNULL
across RPC handlers.
245-245
: LGTM! Null return standardization.The change from
NullUniValue
toUniValue::VNULL
correctly standardizes the null return value when the chain tip is unavailable. This appropriately handles edge cases such as initial blockchain synchronization or empty chain states.src/wallet/rpc/transactions.cpp (1)
254-254
: LGTM! Consistent null-return standardization across wallet RPC handlers.The replacement of
NullUniValue
withUniValue::VNULL
is applied uniformly across all wallet RPC handlers in this file. This standardizes the null response representation across the RPC surface as part of the broader refactor described in the PR.Also applies to: 301-301, 494-494, 610-610, 749-749, 822-822, 839-839, 867-867
src/test/fuzz/util.h (1)
390-403
: LGTM! Clean refactor aligning with AutoFile migration.The removal of the
m_fuzzed_data_provider
member and simplification of theopen()
method to returnAutoFile
directly is consistent with the repository-wide transition fromCAutoFile
toAutoFile
. The class now correctly relies solely onFuzzedFileProvider
for file operations.src/wallet/rpc/signmessage.cpp (1)
39-39
: LGTM! Consistent with wallet RPC null-return standardization.The change aligns with the PR-wide effort to standardize null responses using
UniValue::VNULL
across wallet RPC handlers.src/util/asmap.cpp (1)
201-201
: LGTM! Clean migration to AutoFile.The transition from
CAutoFile
with serialization parameters toAutoFile
with brace initialization is consistent with the repository-wide IO wrapper refactor. The behavioral semantics remain unchanged.src/test/fuzz/policy_estimator_io.cpp (1)
23-23
: LGTM! Consistent AutoFile adoption in fuzz tests.The change from
CAutoFile
toAutoFile
with brace initialization aligns with the PR-wide IO wrapper refactor and matches the pattern in related fuzz test files.test/functional/feature_addrman.py (1)
97-97
: LGTM! Test expectation updated for renamed error message.The update from
CAutoFile::read
toAutoFile::read
in the error message pattern correctly reflects the class name change from the IO wrapper refactor.src/wallet/dump.cpp (1)
44-44
: LGTM! Modern initialization style for HashWriter.The transition to value initialization (
HashWriter hasher{}
) from explicit constructor parameters is a clean modernization that aligns with the broader HashWriter refactor pattern in this PR.Also applies to: 135-135
configure.ac (1)
34-34
: LGTM! Build configuration addition for test binary packaging.The addition of
BITCOIN_TEST_NAME
and its substitution follows standard autoconf patterns and enables test binary packaging in the Windows installer, as described in the AI summary.Also applies to: 1936-1936
src/node/txreconciliation.cpp (1)
18-18
: LGTM: Consistent type refactoring.The replacement of
CHashWriter
withHashWriter
aligns with the repository-wide refactor. The usage pattern at line 28 with copy construction from this constant remains valid.src/node/blockstorage.cpp (1)
508-508
: LGTM: Correct replacement of hash writer type.The migration from
CHashWriter
toHashWriter
with default construction is consistent with the broader refactor. The subsequent usage with streaming operators andGetHash()
remains valid.src/flat-database.h (2)
52-54
: LGTM: Consistent file I/O wrapper refactoring.The migration from
CAutoFile
toAutoFile
with brace-initialization is correct. The serialization type and version parameters are removed here but maintained in theCDataStream
usage at line 45, preserving the overall serialization semantics.
79-81
: LGTM: Consistent file I/O wrapper refactoring.The migration from
CAutoFile
toAutoFile
aligns with the repository-wide refactor. Serialization parameters are appropriately managed by theCDataStream
at line 108.src/test/fuzz/autofile.cpp (1)
20-20
: LGTM: Correct test adaptation to new type.The migration to
AutoFile
with brace-initialization is consistent with the refactor. The removal ofGetType()
andGetVersion()
calls (mentioned in the summary) is correct sinceAutoFile
doesn't expose serialization type/version information.src/test/flatfile_tests.cpp (1)
47-89
: LGTM: Consistent test suite adaptation.All
CAutoFile
toAutoFile
replacements with brace-initialization are mechanically correct and consistent. The test logic remains unchanged, and all file operations continue to work as expected with the new wrapper type.share/setup.nsi.in (1)
83-83
: LGTM: Test binary packaging added to installer.The addition of
@BITCOIN_TEST_NAME@@EXEEXT@
to the Windows installer is consistent with the corresponding build system changes inMakefile.am
. The placement in the daemon directory aligns with other utility binaries.src/index/blockfilterindex.cpp (1)
169-239
: LGTM: Consistent file I/O wrapper refactoring.All migrations from
CAutoFile
toAutoFile
with brace-initialization are mechanically correct acrossCommitInternal
,ReadFilterFromDisk
, andWriteFilterToDisk
. The file operations and error handling remain unchanged and valid.Makefile.am (2)
25-25
: LGTM: Test binary variable definition.The addition of
BITCOIN_TEST_BIN
follows the established pattern for other binary variables and enables consistent test binary packaging for the Windows installer.
81-81
: LGTM: Test binary packaging integration.The stripping and copying of
BITCOIN_TEST_BIN
to the release directory is consistent with the handling of other binaries and aligns with the corresponding changes inshare/setup.nsi.in
.src/policy/fees.h (1)
22-22
: LGTM! AutoFile refactoring is consistent.The forward declaration and method signatures have been correctly updated from
CAutoFile
toAutoFile
, aligning with the broader I/O wrapper refactoring introduced in src/streams.h. The corresponding implementation in src/policy/fees.cpp has been updated accordingly.Also applies to: 221-226
src/rpc/net.cpp (1)
93-93
: LGTM! Standardized null return representation.All RPC handlers correctly updated from
NullUniValue
toUniValue::VNULL
for consistent null representation across the codebase. No functional changes.Also applies to: 343-343, 359-359, 469-469, 807-807, 875-875, 896-896, 1082-1082
src/wallet/rpc/addresses.cpp (1)
36-36
: LGTM! Standardized null returns across wallet RPC handlers.All wallet RPC handlers correctly updated to return
UniValue::VNULL
instead ofNullUniValue
, maintaining consistent null representation. The early-return checks for null wallet pointers and void RPC completions are unchanged in behavior.Also applies to: 74-74, 107-107, 124-124, 156-156, 223-223, 279-279, 302-302, 327-327, 334-334, 474-474, 584-584, 647-647
from_hex, | ||
msg_block, | ||
) | ||
from test_framework.p2p import P2PInterface | ||
from test_framework.script import hash256 | ||
from test_framework.test_framework import BitcoinTestFramework |
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.
Remove unused import flagged by flake8
hash256
is imported but never used, and the flake8 report (F401
) shows the lint job will fail until it’s removed. Please drop the import (or use it) so the test suite passes.
-from test_framework.script import hash256
📝 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.
from_hex, | |
msg_block, | |
) | |
from test_framework.p2p import P2PInterface | |
from test_framework.script import hash256 | |
from test_framework.test_framework import BitcoinTestFramework | |
from_hex, | |
msg_block, | |
) | |
from test_framework.p2p import P2PInterface | |
from test_framework.test_framework import BitcoinTestFramework |
🧰 Tools
🪛 Flake8 (7.3.0)
[error] 43-43: 'test_framework.script.hash256' imported but unused
(F401)
🤖 Prompt for AI Agents
In test/functional/rpc_blockchain.py around lines 39 to 44, the import list
includes hash256 which is not used; remove hash256 from the import statement to
satisfy flake8 F401 (or alternatively use it where intended). Update the import
line so only used symbols are imported to eliminate the unused-import linter
error.
…osity 0, False, and True f663b43 QA: rpc_blockchain: Test output of getblock verbosity 0, False, and True (Luke Dashjr) Pull request description: Currently getblock's "verbosity" is documented as a NUM, though it has a fallback to Boolean for the (deprecated?) "verbose" alias. Since we've been doing more generic type-checking on RPC stuff, I think it would be a good idea to actually test the Boolean values work. I didn't see an existing test for verbosity=0, so this adds that too. ACKs for top commit: aureleoules: ACK f663b43. Tree-SHA512: 321a7795a2f32e469d28879dd323c85cb6b221828030e2a33ad9afd35a648191151a79b04e359b2f58314e43360f81c25f05be07deb42f61efdf556850a7266c
What was done?
Regular backports from Bitcoin Core v24
Backport bitcoin#25331 is partial due to several missing usages of CHashWritter in non-existing yet taproot code.
Though, it's time to do it, because most of backports prior to 25331 is done and it helps to reduce conflicts for further backports that may use HashWritter instead.
How Has This Been Tested?
Run unit & functional tests
Breaking Changes
N/A
Checklist: