backport: Merge bitcoin/bitcoin#27357, 25977, (partial) 27594, 28583, 27608 #7200
backport: Merge bitcoin/bitcoin#27357, 25977, (partial) 27594, 28583, 27608 #7200vijaydasmp wants to merge 5 commits intodashpay:developfrom
Conversation
✅ No Merge Conflicts DetectedThis PR currently has no conflicts with other open PRs. |
…or other peers 52e5207 p2p: Avoid prematurely clearing download state for other peers (Suhas Daftuar) Pull request description: Avoid letting one peer send us data that clears out the download request (and related timers etc) from another peer. The exception is if a block is definitely stored to disk, in which case we'll clear the download state (just as we do for compact blocks). ACKs for top commit: jamesob: ACK 52e5207 ([`jamesob/ackr/27608.1.sdaftuar.p2p_avoid_prematurely_cl`](https://github.com/jamesob/bitcoin/tree/ackr/27608.1.sdaftuar.p2p_avoid_prematurely_cl)) instagibbs: ACK 52e5207 fjahr: Code review ACK 52e5207 mzumsande: Code Review ACK 52e5207 Tree-SHA512: 3ee92507edc3303c16c70ca44ba6c28c104afe95196e4b9167032590ed23d4f569f654f8eb8758940bd6536bc9ca810d2a77d2739db386b927e8b3f3cf55cb16
fa05a72 tidy: modernize-use-emplace (MarcoFalke) Pull request description: Constructing a temporary unnamed object only to copy or move it into a container seems both verbose in code and a strict performance penalty. Fix both issues via the `modernize-use-emplace` tidy check. ACKs for top commit: Sjors: re-utACK fa05a72 hebasto: ACK fa05a72. TheCharlatan: ACK fa05a72 Tree-SHA512: 4408a094f406e7bf6c1468c2b0798f68f4d952a1253cf5b20bdc648ad7eea4a2c070051fed46d66fd37bce2ce6f85962484a1d32826b7ab8c9baba431eaa2765 Merge bitcoin#28583: refactor: [tidy] modernize-use-emplace fa05a72 tidy: modernize-use-emplace (MarcoFalke) Pull request description: Constructing a temporary unnamed object only to copy or move it into a container seems both verbose in code and a strict performance penalty. Fix both issues via the `modernize-use-emplace` tidy check. ACKs for top commit: Sjors: re-utACK fa05a72 hebasto: ACK fa05a72. TheCharlatan: ACK fa05a72 Tree-SHA512: 4408a094f406e7bf6c1468c2b0798f68f4d952a1253cf5b20bdc648ad7eea4a2c070051fed46d66fd37bce2ce6f85962484a1d32826b7ab8c9baba431eaa2765 Merge bitcoin#28583: refactor: [tidy] modernize-use-emplace fa05a72 tidy: modernize-use-emplace (MarcoFalke) Pull request description: Constructing a temporary unnamed object only to copy or move it into a container seems both verbose in code and a strict performance penalty. Fix both issues via the `modernize-use-emplace` tidy check. ACKs for top commit: Sjors: re-utACK fa05a72 hebasto: ACK fa05a72. TheCharlatan: ACK fa05a72 Tree-SHA512: 4408a094f406e7bf6c1468c2b0798f68f4d952a1253cf5b20bdc648ad7eea4a2c070051fed46d66fd37bce2ce6f85962484a1d32826b7ab8c9baba431eaa2765 Merge bitcoin#28583: refactor: [tidy] modernize-use-emplace fa05a72 tidy: modernize-use-emplace (MarcoFalke) Pull request description: Constructing a temporary unnamed object only to copy or move it into a container seems both verbose in code and a strict performance penalty. Fix both issues via the `modernize-use-emplace` tidy check. ACKs for top commit: Sjors: re-utACK fa05a72 hebasto: ACK fa05a72. TheCharlatan: ACK fa05a72 Tree-SHA512: 4408a094f406e7bf6c1468c2b0798f68f4d952a1253cf5b20bdc648ad7eea4a2c070051fed46d66fd37bce2ce6f85962484a1d32826b7ab8c9baba431eaa2765
bb07fb9 to
cf657ae
Compare
fae1d9c refactor: Remove unused GetTimeMillis (MarcoFalke) Pull request description: The function is unused, not type-safe, and does not denote the underlying clock type. So remove it. ACKs for top commit: willcl-ark: tACK fae1d9c Tree-SHA512: 41ea7125d1964192b85a94265be974d02bf1e79b1feb61bff11486dc0ac811745156940ec5cad2ad1f94b653936f8ae563c959c1c4142203a55645fcb83203e8 GetTimeMicros is used in other palces as well GetSystemTime is used in other places
… with `util::Result` 8aa8f73 refactor: Replace std::optional<bilingual_str> with util::Result (Ryan Ofsky) 5f49cb1 util: Add void support to util::Result (MarcoFalke) Pull request description: Replace uses of `std::optional<bilingual_str>` with `util::Result` as suggested bitcoin#25648 (comment), bitcoin#27632 (comment), bitcoin#27632 (comment), bitcoin#24313 (comment) ACKs for top commit: MarcoFalke: very nice ACK 8aa8f73 🏏 TheCharlatan: ACK 8aa8f73 hebasto: ACK 8aa8f73, I have reviewed the code and it looks OK. Tree-SHA512: 6c2f218bc445184ce93ec2b907e61666a05f26f2c9447f69fcb504aa8291b0c693d913f659dfd19813a9e24615546c72cbe2ca419218fd867ff0694c4a1b6a30 Redundant std::move
…er and rename to m_warningcache 5526849 validation: Move warningcache to ChainstateManager (dimitaracev) Pull request description: Removes `warningcache` and moves it to `ChainstateManager`. Also removes the respective `TODO` completely. ACKs for top commit: ajtowns: ACK 5526849 dimitaracev: > ACK [5526849](bitcoin@5526849) TheCharlatan: ACK 5526849 ryanofsky: Code review ACK 5526849 Tree-SHA512: 6869bd7aa4f0b59324e12eb8e3df47f2c9a3f3b0d9b7d45857426ec9e8b71c5573bdcf71db822f8c10aff7d8679a00a4bedc7a256c28f325e744e5d7267b41e9
WalkthroughThis pull request enables the Estimated code review effort🎯 3 (Moderate) | ⏱️ ~40 minutes 🚥 Pre-merge checks | ✅ 1 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (1 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Tip Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs). 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.
🧹 Nitpick comments (1)
src/util/result.h (1)
46-46: Constrain the default constructor toResult<void>using a requires clause.Line 46 is intended only for
void, but it is currently available for all specializations. This default constructor initializes the variant withstd::monostate, which is semantically incorrect forResult<non-void>types. Constraining it improves API clarity and prevents accidental misuse.♻️ Proposed fix
- Result() : m_variant{std::in_place_index_t<1>{}, std::monostate{}} {} // constructor for void + Result() requires std::is_same_v<M, void> + : m_variant{std::in_place_index_t<1>{}, std::monostate{}} {} // constructor for void🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/util/result.h` at line 46, The default constructor currently available for all Result<T> specializations should be constrained to only Result<void>; update the constructor declaration for Result() to add a requires clause (e.g., requires std::is_void_v<T>) so it only participates when T is void, leaving other specializations without this monostate constructor; modify the Result() definition that initializes m_variant{std::in_place_index_t<1>{}, std::monostate{}} to use that requires constraint (or equivalent SFINAE) so non-void Result<T> cannot be default-constructed into monostate.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@src/util/result.h`:
- Line 46: The default constructor currently available for all Result<T>
specializations should be constrained to only Result<void>; update the
constructor declaration for Result() to add a requires clause (e.g., requires
std::is_void_v<T>) so it only participates when T is void, leaving other
specializations without this monostate constructor; modify the Result()
definition that initializes m_variant{std::in_place_index_t<1>{},
std::monostate{}} to use that requires constraint (or equivalent SFINAE) so
non-void Result<T> cannot be default-constructed into monostate.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 6bf73ca4-aba1-482f-9bb9-90fadee4257f
📒 Files selected for processing (38)
src/.bear-tidy-configsrc/.clang-tidysrc/addrdb.cppsrc/addrdb.hsrc/bench/block_assemble.cppsrc/bench/wallet_loading.cppsrc/external_signer.cppsrc/httpserver.cppsrc/init.cppsrc/net_permissions.cppsrc/net_processing.cppsrc/node/blockstorage.cppsrc/qt/rpcconsole.cppsrc/rest.cppsrc/rpc/blockchain.cppsrc/rpc/net.cppsrc/rpc/rawtransaction.cppsrc/rpc/server.cppsrc/script/sign.cppsrc/test/addrman_tests.cppsrc/test/bip32_tests.cppsrc/test/net_tests.cppsrc/test/rpc_tests.cppsrc/test/settings_tests.cppsrc/test/sighash_tests.cppsrc/test/txpackage_tests.cppsrc/test/util/setup_common.cppsrc/test/util/txmempool.cppsrc/test/util_tests.cppsrc/test/util_threadnames_tests.cppsrc/test/validation_block_tests.cppsrc/util/result.hsrc/validation.cppsrc/validation.hsrc/wallet/rpc/backup.cppsrc/wallet/salvage.cppsrc/wallet/spend.cppsrc/wallet/test/wallet_tests.cpp
What was done?
Backports from Bitcoin Core v26,
How Has This Been Tested?
Run unit & functional tests