Wallet loading functions up and down the stack have lots of error and warning parameters, and return error information in different ways. This PR makes them uniformly return util::Result, without changing behavior.
DrahtBot added the label Refactoring on Jul 27, 2022
DrahtBot
commented at 8:53 PM on July 27, 2022:
contributor
<!--e57a25ab6845829454e8d69fc972939a-->
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.
<!--5faf32d7da4f0f540f40219e4f7537a3-->
LLM Linter (β¨ experimental)
Possible typos and grammar issues:
deal with with error and warning messages -> deal with error and warning messages [Typo: βwithβ is duplicated in the util/messages.h file comment, making the sentence grammatically incorrect.]
Possible places where named args for integral literals may be used (e.g. func(x, /*named_arg=*/0) in C++, and func(x, named_arg=0) in Python):
ExpectSuccess(IntFn(5, true), {}, 5) in src/test/result_tests.cpp
ExpectSuccess(NoCopyFn(5, true), {}, 5) in src/test/result_tests.cpp
ExpectError(NoCopyFn(5, false), Untranslated("nocopy 5 error."), 5) in src/test/result_tests.cpp
ExpectSuccess(NoCopyNoMoveFn(5, true), {}, 5) in src/test/result_tests.cpp
ExpectError(NoCopyNoMoveFn(5, false), Untranslated("nocopynomove 5 error."), 5) in src/test/result_tests.cpp
ExpectError(ChainedErrorFn(ERR1, 5), Untranslated("chained error. enum error. warn."), 5) in src/test/result_tests.cpp
ExpectSuccess(MultiWarnFn(3), Untranslated("warn 0. warn 1. warn 2."), 3) in src/test/result_tests.cpp
ExpectSuccess(AccumulateFn(true), Untranslated("warn 0. warn 0. warn 1. int 3 warn."), 3) in src/test/result_tests.cpp
ExpectSuccess(TruthyFalsyFn(0, true), {}, 0) in src/test/result_tests.cpp
ExpectError(TruthyFalsyFn(0, false), Untranslated("error value 0."), 0) in src/test/result_tests.cpp
ExpectSuccess(TruthyFalsyFn(1, true), {}, 1) in src/test/result_tests.cpp
ExpectError(TruthyFalsyFn(1, false), Untranslated("error value 1."), 1) in src/test/result_tests.cpp
ExpectSuccess(result, {}, 0) in src/test/result_tests.cpp
ExpectSuccess(result, Untranslated("error"), 2) in src/test/result_tests.cpp
ExpectSuccess(result2, {}, 0) in src/test/result_tests.cpp
ExpectError(result2, Untranslated("error"), 3) in src/test/result_tests.cpp
ExpectSuccess(result2, Untranslated("error"), 4) in src/test/result_tests.cpp
<sup>2026-04-01 12:18:28</sup>
DrahtBot added the label Needs rebase on Aug 5, 2022
ryanofsky force-pushed on Aug 5, 2022
DrahtBot removed the label Needs rebase on Aug 5, 2022
DrahtBot added the label Needs rebase on Aug 10, 2022
ryanofsky force-pushed on Aug 15, 2022
ryanofsky marked this as ready for review on Aug 15, 2022
ryanofsky
commented at 6:19 PM on August 15, 2022:
contributor
DrahtBot removed the label Needs rebase on Aug 15, 2022
DrahtBot added the label Needs rebase on Aug 16, 2022
ryanofsky referenced this in commit 834857e56b on Aug 30, 2022
ryanofsky referenced this in commit 82c549aa53 on Sep 1, 2022
ryanofsky force-pushed on Sep 1, 2022
DrahtBot removed the label Needs rebase on Sep 1, 2022
ryanofsky referenced this in commit c14e904f66 on Sep 1, 2022
ryanofsky force-pushed on Sep 1, 2022
ryanofsky force-pushed on Sep 2, 2022
ryanofsky referenced this in commit a8973ae714 on Sep 6, 2022
ryanofsky referenced this in commit 05a97d3208 on Sep 13, 2022
ryanofsky referenced this in commit e04d8a754f on Sep 13, 2022
ryanofsky referenced this in commit 8e12547694 on Sep 13, 2022
DrahtBot added the label Needs rebase on Sep 13, 2022
ryanofsky referenced this in commit 52a4e50fb4 on Sep 13, 2022
ryanofsky force-pushed on Sep 14, 2022
ryanofsky referenced this in commit f9accbc6e2 on Sep 15, 2022
ryanofsky referenced this in commit 776d9b3fbb on Sep 15, 2022
ryanofsky force-pushed on Sep 15, 2022
DrahtBot removed the label Needs rebase on Sep 15, 2022
DrahtBot added the label Needs rebase on Sep 16, 2022
ryanofsky referenced this in commit f05441a572 on Sep 20, 2022
ryanofsky referenced this in commit 456e3d4ecc on Sep 20, 2022
ryanofsky force-pushed on Sep 20, 2022
DrahtBot removed the label Needs rebase on Sep 20, 2022
ryanofsky referenced this in commit 8ba9cb26a1 on Sep 20, 2022
ryanofsky referenced this in commit 8ebf0cd171 on Sep 20, 2022
DrahtBot added the label Needs rebase on Oct 3, 2022
ryanofsky referenced this in commit fee8670c7c on Oct 14, 2022
ryanofsky referenced this in commit 28a6934da9 on Oct 14, 2022
ryanofsky force-pushed on Oct 14, 2022
DrahtBot removed the label Needs rebase on Oct 14, 2022
DrahtBot added the label Needs rebase on Dec 1, 2022
ryanofsky referenced this in commit f4d55d858d on Jan 6, 2023
ryanofsky referenced this in commit 979dbd5c73 on Jan 6, 2023
ryanofsky force-pushed on Jan 20, 2023
DrahtBot removed the label Needs rebase on Jan 20, 2023
DrahtBot added the label Needs rebase on Jan 23, 2023
ryanofsky referenced this in commit b57a898a98 on Feb 10, 2023
ryanofsky referenced this in commit 513adde96f on Feb 10, 2023
ryanofsky referenced this in commit eb50fcd685 on Feb 10, 2023
ryanofsky force-pushed on Feb 11, 2023
DrahtBot removed the label Needs rebase on Feb 11, 2023
ryanofsky referenced this in commit 501ef88b94 on Feb 16, 2023
DrahtBot added the label Needs rebase on Feb 17, 2023
ryanofsky referenced this in commit d785176df3 on Mar 1, 2023
ryanofsky referenced this in commit 6056f7b0da on Mar 1, 2023
ryanofsky force-pushed on Mar 1, 2023
DrahtBot removed the label Needs rebase on Mar 1, 2023
DrahtBot added the label Needs rebase on Mar 8, 2023
ryanofsky referenced this in commit e766928ed1 on Mar 16, 2023
ryanofsky referenced this in commit 6afc0431f0 on Mar 16, 2023
ryanofsky referenced this in commit 6d7d7bbb7b on Apr 4, 2023
ryanofsky referenced this in commit 460ef0a18b on Apr 4, 2023
ryanofsky force-pushed on Apr 7, 2023
DrahtBot removed the label Needs rebase on Apr 7, 2023
DrahtBot added the label Needs rebase on Apr 12, 2023
ryanofsky force-pushed on Apr 13, 2023
DrahtBot removed the label Needs rebase on Apr 13, 2023
in
src/util/result.h:62
in
2a9db070ecoutdated
58 | + } 59 | + 60 | + //! Value setter methods that do nothing because this class has value type T=void. 61 | + void ConstructValue() {} 62 | + template <typename O> 63 | + void MoveValue(O& other) {}
It took me a while to figure out what's going on here with the recursive Construct calls and the lambda that's passed along. How about instead of passing a lambda along use a bool template argument like so:
It took me a while to figure out what's going on here with the recursive Construct calls and the lambda that's passed along. How about instead of passing a lambda along use a bool template argument like so:
Thanks, that's much better! Took suggestion jsut renaming argument to "Failure"
Mayby explicitly mark the move-assignment as delete
Thanks, that changes error message from error: object of type 'util::Result<int>' cannot be assigned because its copy assignment operator is implicitly deleted to error: overload resolution selected deleted operator=, which should be more helpful now because a comment at the deleted operator= declaration explains why the operator is deleted and recommends using Set() instead
nit: I don't think the if (!src.m_info->errors.empty()) check is necessary.
It's not strictly necessary, but it avoids allocating an ErrorInfo object in the common case where there are no errors or warnings. Since this is called whenever result objects are moved, it's good to avoid unnecessary allocations here.
in
src/util/result.h:150
in
2a9db070ecoutdated
147 | +//! types of errors, and can suffice just using the type `T` success value on 148 | +//! success, and descriptive error strings when there's a failure. But 149 | +//! applications that do need more complicated error-handling behavior can 150 | +//! override the default `F = void` failure type and get failure values by 151 | +//! calling result.GetFailure(). 152 | +template <typename T, typename F = void>
maybe consider forbidding type bool for T. I recently had similar code in another project, and its utterly confusing; because Result can convert to bool but that only tells if it has a bool or not. It's very error prone.
I guess the same goes for something like Result<std::optional<int>, int>, or really any type implementing operator bool()? How did you handle these cases in your code? Sometimes the non-presence of a result is not really an error.
I agree with all of this and want to do more work to address it.
I think by default types convertible to bool should be disallowed with Result. I think Result<bool> or Result<optional<T>> types are inherently ambiguous and code accessing those return values would be fragile and prone to errors from dereferencing incorrectly.
But disallowing all types convertible to bool would go to far because being able to return types like unique_ptr and shared_ptr is important. Returning types like Result<int> should probably fine in practice too, even though ints are convertible to bool, and there could be a little ambiguity.
So there is some fine-tuning to be done here, and I want to code to be organized so Result and ResultPtr (#26022) classes handle this safety stuff, and ResultBase class handles all the real result functionality.
in
src/test/result_tests.cpp:149
in
3a919e576foutdated
move constructors should usually be noexcept, but then all methods it uses also have to be noexcept.
It would be possible to add a constructor that move constructs Result<T, F> from Result<OT, OF> and is noexcept. For this to work, move constructing T from OT would have to be noexcept, and F and OF types would need to be identical so unique_ptr<ErrorInfo<F>> could be moved without any allocations.
Right now I'm just trying to do the simplest thing that's correct, and I think probably in most cases where the result class is used, having the move constructor be marked noexcept isn't going impact performance. But it is something that could be optimized later.
in
src/wallet/spend.cpp:746
in
3a919e576foutdated
743 | - if (!res_detailed_errors.empty()) return res_detailed_errors.front(); 744 | + if (!res_detailed_errors.empty()) return std::move(res_detailed_errors.front());
745 |
746 |
747 | // General "Insufficient Funds"
748 | return util::Result<SelectionResult>(util::Error());
martinus
commented at 1:37 PM on April 22, 2023:
contributor
After rebasing I get a compile error in spend.cppChooseSelectionResult, adding a bunch of std::move helps
in
src/wallet/spend.cpp:720
in
3a919e576foutdated
714 | @@ -715,7 +715,7 @@ util::Result<SelectionResult> AutomaticCoinSelection(const CWallet& wallet, Coin
715 | if (CAmount total_amount = available_coins.GetTotalAmount() - total_discarded < value_to_select) {
716 | // Special case, too-long-mempool cluster.
717 | if (total_amount + total_unconf_long_chain > value_to_select) {
718 | - return util::Result<SelectionResult>({_("Unconfirmed UTXOs are available, but spending them creates a chain of transactions that will be rejected by the mempool")}); 719 | + return util::Error{_("Unconfirmed UTXOs are available, but spending them creates a chain of transactions that will be rejected by the mempool")};
720 | }
721 | return util::Result<SelectionResult>(util::Error()); // General "Insufficient Funds"
martinus
commented at 2:25 PM on April 22, 2023:
contributor
Code review 2a9db07, apart from the compile error when rebasing I found mostly nits. This makes util::Result quite a bit more powerful, and it's still simple to use. The code itself of util::Result is a bit hard to understand though, but I don't have a better way either.
DrahtBot added the label CI failed on Apr 23, 2023
DrahtBot added the label Needs rebase on May 2, 2023
ryanofsky referenced this in commit aa73bee496 on May 2, 2023
ryanofsky referenced this in commit 28a954c703 on May 2, 2023
ryanofsky force-pushed on May 3, 2023
DrahtBot removed the label Needs rebase on May 3, 2023
DrahtBot removed the label CI failed on May 3, 2023
DrahtBot added the label Needs rebase on May 15, 2023
ryanofsky referenced this in commit cdf11c66c0 on Jul 21, 2023
ryanofsky referenced this in commit 40f09de73e on Jul 21, 2023
ryanofsky force-pushed on Jul 21, 2023
ryanofsky
commented at 5:03 PM on July 21, 2023:
contributor
Rebased f7d4451b98014176c083adc02bdf59e6dd2b9355 -> 17891a95ab5873aa978a5bf5ed8985ee1513e728 (pr/bresult-load.16 -> pr/bresult-load.17, compare making most of the suggested changes. I'm working on some more changes that should use ResultPtr from #26022 to simplify some of the code that has changed and made it safer. It will take more work to make ResultPtr compatible, and relatedly change the Result class to discourage using it with confusing types that are convertible to bool.
DrahtBot removed the label Needs rebase on Jul 21, 2023
ryanofsky referenced this in commit 4d995d3fa6 on Jul 21, 2023
ryanofsky referenced this in commit 775b54e881 on Jul 21, 2023
DrahtBot added the label CI failed on Jul 21, 2023
maflcko
commented at 2:55 PM on August 1, 2023:
member
Maybe mark as draft for as long as CI is red and this is based on something else?
ryanofsky marked this as a draft on Aug 1, 2023
ryanofsky referenced this in commit cf01e29b9d on Aug 1, 2023
ryanofsky referenced this in commit 1de05ef919 on Aug 1, 2023
ryanofsky referenced this in commit 6ddcc9bec8 on Aug 1, 2023
ryanofsky referenced this in commit 08f5febfc5 on Aug 1, 2023
ryanofsky force-pushed on Aug 2, 2023
DrahtBot removed the label CI failed on Aug 2, 2023
ryanofsky referenced this in commit 9cea9e8e38 on Aug 3, 2023
ryanofsky referenced this in commit b0beb4c504 on Aug 3, 2023
ryanofsky referenced this in commit 835f09452b on Aug 4, 2023
ryanofsky referenced this in commit 9e80d0b754 on Aug 4, 2023
ryanofsky referenced this in commit b21e2b067e on Aug 7, 2023
ryanofsky referenced this in commit 7f883b33bb on Aug 7, 2023
DrahtBot added the label Needs rebase on Aug 24, 2023
ryanofsky referenced this in commit 5529ea16ad on Sep 6, 2023
ryanofsky referenced this in commit a21ac50c2b on Sep 6, 2023
ryanofsky referenced this in commit ed61b012b1 on Sep 6, 2023
ryanofsky referenced this in commit 956bec1eca on Sep 6, 2023
ryanofsky force-pushed on Sep 25, 2023
DrahtBot removed the label Needs rebase on Sep 25, 2023
DrahtBot added the label CI failed on Oct 5, 2023
DrahtBot added the label Needs rebase on Oct 16, 2023
ryanofsky referenced this in commit 256a16e999 on Oct 18, 2023
ryanofsky referenced this in commit 29f6cfdabe on Oct 18, 2023
ryanofsky referenced this in commit 1f6190ac9b on Oct 18, 2023
ryanofsky referenced this in commit 24999606f8 on Oct 18, 2023
ryanofsky referenced this in commit e2b184ec86 on Oct 26, 2023
ryanofsky referenced this in commit f158686962 on Oct 26, 2023
ryanofsky referenced this in commit 2e1cc4f55f on Oct 26, 2023
ryanofsky referenced this in commit 3fe48360c3 on Oct 26, 2023
ryanofsky referenced this in commit 1c7d8bea4f on Jan 24, 2024
ryanofsky referenced this in commit f822ac9a24 on Jan 24, 2024
ryanofsky referenced this in commit 774240a82b on Feb 21, 2024
ryanofsky referenced this in commit 4ec6b060a8 on Feb 21, 2024
ryanofsky referenced this in commit 2c78cce3c5 on Feb 21, 2024
ryanofsky referenced this in commit f27418f37e on Feb 21, 2024
ryanofsky referenced this in commit b0687b7e1e on Feb 21, 2024
ryanofsky referenced this in commit 2055659814 on Feb 21, 2024
ryanofsky referenced this in commit b91edfa4f1 on Feb 21, 2024
ryanofsky force-pushed on Feb 21, 2024
ryanofsky
commented at 11:39 PM on February 21, 2024:
contributor
DrahtBot removed the label CI failed on Feb 22, 2024
DrahtBot removed the label Needs rebase on Feb 22, 2024
ryanofsky referenced this in commit 16b1f910be on Feb 22, 2024
ryanofsky referenced this in commit cdf7bb1756 on Feb 22, 2024
ryanofsky force-pushed on Feb 22, 2024
ryanofsky
commented at 8:14 PM on February 22, 2024:
contributor
Updated 6700299bcb6f560e9e4caf34254d7d86d4e78833 -> 2385cb37dbbe00004f8bffe1d1d784778d89a21e (pr/bresult-load.20 -> pr/bresult-load.21, compare) splitting this up from one big to commit to multiple commits so it is reasonable to review.
However, looking over the commits, this still belongs in draft state, because since the time this PR was opened, a lot of improvements were made to the util::Result class in base PR #25665 based on review feedback, so there are a lot of updates that can be made in this PR to make it nicer.
sedited referenced this in commit 50220e34f6 on Mar 10, 2024
sedited referenced this in commit 539f101dfe on Mar 10, 2024
sedited referenced this in commit fe260d92a3 on Mar 11, 2024
sedited referenced this in commit 5029e59b9d on Mar 11, 2024
sedited referenced this in commit f3dbbbc3d5 on Mar 12, 2024
sedited referenced this in commit 63b92a8c80 on Mar 12, 2024
sedited referenced this in commit a72ae6a43f on Mar 12, 2024
sedited referenced this in commit 76fe2f8d41 on Mar 12, 2024
sedited referenced this in commit 2331edb22e on Mar 12, 2024
sedited referenced this in commit 5797f3cb7c on Mar 12, 2024
sedited referenced this in commit 31ae72fdfa on Mar 15, 2024
sedited referenced this in commit 6b7813c256 on Mar 15, 2024
sedited referenced this in commit f6118b724c on Mar 19, 2024
sedited referenced this in commit ee80f88bcb on Mar 19, 2024
ryanofsky referenced this in commit 40b009dfee on Mar 22, 2024
ryanofsky referenced this in commit e0cbb8862c on Mar 22, 2024
ryanofsky referenced this in commit d52c2e949c on Mar 26, 2024
ryanofsky referenced this in commit efb463788f on Mar 26, 2024
sedited referenced this in commit c7d4f43198 on Mar 26, 2024
sedited referenced this in commit 5e38b42b1e on Mar 26, 2024
ryanofsky referenced this in commit 88821fe2a0 on Mar 26, 2024
ryanofsky referenced this in commit 110bccc371 on Mar 26, 2024
ryanofsky referenced this in commit d859ea511f on Mar 26, 2024
ryanofsky referenced this in commit 6adeafab68 on Mar 26, 2024
ryanofsky referenced this in commit 3eb47b4641 on Mar 27, 2024
ryanofsky referenced this in commit d4579e303b on Mar 27, 2024
ryanofsky referenced this in commit 9fe6a68170 on Mar 28, 2024
ryanofsky referenced this in commit 7a4741eaf8 on Mar 28, 2024
ryanofsky referenced this in commit 5467ecbe58 on Apr 18, 2024
ryanofsky referenced this in commit 28e2081210 on Apr 18, 2024
ryanofsky referenced this in commit d293d0ba52 on Apr 24, 2024
ryanofsky referenced this in commit c45cb13b9e on Apr 24, 2024
ryanofsky referenced this in commit 6602231564 on Apr 24, 2024
ryanofsky referenced this in commit f74da4c69b on Apr 24, 2024
ryanofsky referenced this in commit cbcdc67c64 on Apr 24, 2024
ryanofsky referenced this in commit da1f3d1c72 on Apr 24, 2024
ryanofsky referenced this in commit 23abc129d2 on Apr 24, 2024
ryanofsky referenced this in commit 8310de510b on Apr 24, 2024
ryanofsky referenced this in commit 990f9d65c5 on Apr 24, 2024
ryanofsky referenced this in commit 10ff4de2b6 on Apr 24, 2024
ryanofsky referenced this in commit 98cb2e1bf9 on Apr 24, 2024
ryanofsky referenced this in commit 8e0323bc8e on Apr 25, 2024
ryanofsky referenced this in commit 4fb08c28ba on Apr 25, 2024
ryanofsky referenced this in commit 0290a2e819 on Apr 25, 2024
ryanofsky referenced this in commit 88aa093356 on Apr 25, 2024
ryanofsky referenced this in commit 7cd5b8d3b6 on Apr 26, 2024
ryanofsky referenced this in commit f45705988e on Apr 26, 2024
ryanofsky referenced this in commit 3103e87086 on Apr 26, 2024
ryanofsky referenced this in commit 0cbcb66257 on Apr 26, 2024
ryanofsky referenced this in commit e9a5ad3f4b on Apr 26, 2024
ryanofsky referenced this in commit 55d7de92bb on Apr 26, 2024
ryanofsky referenced this in commit 9bc6779338 on Apr 26, 2024
ryanofsky referenced this in commit 2d22f23766 on Apr 26, 2024
ryanofsky referenced this in commit 616572cbb4 on Apr 26, 2024
ryanofsky referenced this in commit e1be443315 on Apr 26, 2024
ryanofsky referenced this in commit cd62acaf6a on Apr 26, 2024
ryanofsky referenced this in commit 0c8a1bb144 on Apr 26, 2024
ryanofsky referenced this in commit 7a1982fe1d on Apr 26, 2024
ryanofsky referenced this in commit 9552619961 on Apr 26, 2024
ryanofsky referenced this in commit 834f65e824 on Apr 30, 2024
ryanofsky referenced this in commit 6a8b2befea on Apr 30, 2024
DrahtBot added the label Needs rebase on Apr 30, 2024
ryanofsky referenced this in commit 84b347df68 on May 1, 2024
ryanofsky referenced this in commit db91dbb5a9 on May 1, 2024
ryanofsky referenced this in commit c1db95485c on May 1, 2024
ryanofsky referenced this in commit 5d8923d53e on May 1, 2024
ryanofsky force-pushed on May 1, 2024
DrahtBot removed the label Needs rebase on May 1, 2024
DrahtBot added the label CI failed on May 1, 2024
DrahtBot
commented at 10:42 PM on May 1, 2024:
contributor
<!--85328a0da195eb286784d51f73fa0af9-->
π§ At least one of the CI tasks failed. Make sure to run all tests locally, according to the
documentation.
Possibly this is due to a silent merge conflict (the changes in this pull request being
incompatible with the current code in the target branch). If so, make sure to rebase on the latest
commit of the target branch.
Leave a comment here, if you need help tracking down a confusing failure.
DrahtBot added the label Needs rebase on May 20, 2024
janus referenced this in commit 785f5c7679 on Jun 6, 2024
janus referenced this in commit 0ac7fbf62d on Jun 6, 2024
ryanofsky referenced this in commit ba959dbed3 on Jun 17, 2024
ryanofsky referenced this in commit b08548336e on Jun 17, 2024
ryanofsky referenced this in commit 90f7d39983 on Jun 17, 2024
ryanofsky referenced this in commit 387cf87d52 on Jun 17, 2024
ryanofsky force-pushed on Jun 17, 2024
DrahtBot removed the label Needs rebase on Jun 17, 2024
DrahtBot added the label CI failed on Jun 18, 2024
DrahtBot
commented at 2:33 AM on June 18, 2024:
contributor
<!--85328a0da195eb286784d51f73fa0af9-->
π§ At least one of the CI tasks failed. Make sure to run all tests locally, according to the
documentation.
Possibly this is due to a silent merge conflict (the changes in this pull request being
incompatible with the current code in the target branch). If so, make sure to rebase on the latest
commit of the target branch.
Leave a comment here, if you need help tracking down a confusing failure.
Make sure to run all tests locally, according to the documentation.
The failure may happen due to a number of reasons, for example:
Possibly due to a silent merge conflict (the changes in this pull request being
incompatible with the current code in the target branch). If so, make sure to rebase on the latest
commit of the target branch.
A sanitizer issue, which can only be found by compiling with the sanitizer and running the
affected test.
An intermittent issue.
Leave a comment here, if you need help tracking down a confusing failure.
</details>
DrahtBot removed the label Needs rebase on Jul 18, 2024
ryanofsky force-pushed on Jul 19, 2024
DrahtBot removed the label CI failed on Jul 19, 2024
ryanofsky referenced this in commit ebb45ad32d on Jul 19, 2024
ryanofsky referenced this in commit 15b673d122 on Jul 19, 2024
DrahtBot added the label Needs rebase on Aug 15, 2024
ryanofsky referenced this in commit 3f858220b6 on Nov 4, 2024
ryanofsky referenced this in commit a78c1c9ca6 on Nov 4, 2024
ryanofsky referenced this in commit b6ff54babf on Nov 4, 2024
ryanofsky referenced this in commit 609bb02d97 on Nov 4, 2024
ryanofsky referenced this in commit b23df5e070 on Nov 4, 2024
ryanofsky referenced this in commit 7e2b35711e on Nov 4, 2024
ryanofsky force-pushed on Nov 4, 2024
ryanofsky
commented at 1:38 PM on November 4, 2024:
contributor
Rebased 46d01725ed1434fba8d974f57f6893e2cd1facee -> 2dc6d076e76f9c778dbced9adfd0ef64aea732b1 (pr/bresult-load.38 -> pr/bresult-load.39, compare)<!-- end --> on top of updated base PR to fix CI errors
DrahtBot removed the label Needs rebase on Nov 4, 2024
DrahtBot added the label CI failed on Nov 4, 2024
ryanofsky force-pushed on Nov 4, 2024
DrahtBot removed the label CI failed on Nov 4, 2024
DrahtBot added the label Needs rebase on Dec 4, 2024
ryanofsky referenced this in commit 3864a57835 on Dec 6, 2024
ryanofsky referenced this in commit 58c33f0f3a on Dec 6, 2024
ryanofsky referenced this in commit dcedb20a8a on Dec 6, 2024
ryanofsky referenced this in commit 108368d7e2 on Dec 6, 2024
ryanofsky referenced this in commit 1def53ca4d on Dec 6, 2024
ryanofsky referenced this in commit e10e4eb5b0 on Dec 6, 2024
ryanofsky referenced this in commit 643b881011 on Dec 6, 2024
ryanofsky referenced this in commit 5e14665e04 on Dec 6, 2024
ryanofsky force-pushed on Dec 6, 2024
DrahtBot removed the label Needs rebase on Dec 6, 2024
DrahtBot added the label Needs rebase on Jan 17, 2025
ryanofsky referenced this in commit 6a2152a073 on Mar 11, 2025
ryanofsky referenced this in commit 5f469c9103 on Mar 11, 2025
ryanofsky referenced this in commit 244d430b51 on Mar 11, 2025
ryanofsky referenced this in commit 15adb64db8 on Mar 11, 2025
ryanofsky referenced this in commit 4599760cc6 on Mar 11, 2025
ryanofsky referenced this in commit 69b14c8122 on Mar 11, 2025
ryanofsky force-pushed on Mar 12, 2025
DrahtBot removed the label Needs rebase on Mar 12, 2025
DrahtBot added the label Needs rebase on Mar 14, 2025
ryanofsky force-pushed on Mar 20, 2025
DrahtBot removed the label Needs rebase on Mar 20, 2025
DrahtBot added the label Needs rebase on Mar 27, 2025
ryanofsky referenced this in commit 1069ffddc0 on Jul 31, 2025
ryanofsky referenced this in commit 9334d83c79 on Jul 31, 2025
ryanofsky referenced this in commit 5f1f23bc17 on Jul 31, 2025
ryanofsky referenced this in commit 8b892d41fd on Jul 31, 2025
ryanofsky force-pushed on Aug 1, 2025
DrahtBot removed the label Needs rebase on Aug 2, 2025
DrahtBot added the label Needs rebase on Aug 8, 2025
ryanofsky force-pushed on Oct 15, 2025
DrahtBot removed the label Needs rebase on Oct 15, 2025
ryanofsky referenced this in commit 8423d62a98 on Oct 28, 2025
ryanofsky referenced this in commit 90b6a005d2 on Oct 28, 2025
DrahtBot added the label Needs rebase on Nov 4, 2025
ryanofsky referenced this in commit f3ec0bd5e8 on Nov 11, 2025
ryanofsky referenced this in commit 2c77a46ccc on Nov 11, 2025
ryanofsky referenced this in commit aa64b5bba0 on Nov 11, 2025
ryanofsky referenced this in commit bddf91ae9b on Nov 11, 2025
ryanofsky force-pushed on Nov 11, 2025
DrahtBot added the label CI failed on Nov 11, 2025
DrahtBot
commented at 11:15 PM on November 11, 2025:
contributor
<!--85328a0da195eb286784d51f73fa0af9-->
π§ At least one of the CI tasks failed.
<sub>Task test each commit: https://github.com/bitcoin/bitcoin/actions/runs/19279987246/job/55128809872</sub>
<sub>LLM reason (β¨ experimental): Compilation failed due to a missing/renamed API: ChainstateLoadStatus and its SUCCESS member no longer exist in node, causing multiple compile errors.</sub>
<details><summary>Hints</summary>
Try to run the tests locally, according to the documentation. However, a CI failure may still
happen due to a number of reasons, for example:
Possibly due to a silent merge conflict (the changes in this pull request being
incompatible with the current code in the target branch). If so, make sure to rebase on the latest
commit of the target branch.
A sanitizer issue, which can only be found by compiling with the sanitizer and running the
affected test.
An intermittent issue.
Leave a comment here, if you need help tracking down a confusing failure.
</details>
DrahtBot removed the label Needs rebase on Nov 11, 2025
ryanofsky force-pushed on Nov 12, 2025
DrahtBot added the label Needs rebase on Dec 9, 2025
ryanofsky referenced this in commit 4fccfc42ae on Dec 12, 2025
ryanofsky referenced this in commit c382c3d104 on Dec 12, 2025
ryanofsky referenced this in commit 9f5e68e872 on Dec 12, 2025
ryanofsky referenced this in commit 1cdab246de on Dec 12, 2025
ryanofsky force-pushed on Dec 12, 2025
DrahtBot removed the label Needs rebase on Dec 12, 2025
DrahtBot added the label Needs rebase on Dec 15, 2025
ryanofsky referenced this in commit 7a25b428ab on Dec 16, 2025
ryanofsky referenced this in commit a06c7b8bb3 on Dec 16, 2025
ryanofsky referenced this in commit 7214d8f06e on Dec 16, 2025
ryanofsky referenced this in commit 2ddc060120 on Dec 16, 2025
ryanofsky force-pushed on Dec 16, 2025
DrahtBot removed the label Needs rebase on Dec 16, 2025
DrahtBot removed the label CI failed on Dec 16, 2025
DrahtBot added the label Needs rebase on Dec 16, 2025
ryanofsky referenced this in commit d0c8b9575f on Jan 7, 2026
ryanofsky referenced this in commit b687ce7628 on Jan 7, 2026
ryanofsky referenced this in commit 37a3d36427 on Jan 7, 2026
ryanofsky referenced this in commit 176196dce3 on Jan 7, 2026
ryanofsky referenced this in commit 873582ff04 on Jan 7, 2026
ryanofsky referenced this in commit 339f0d9f76 on Jan 7, 2026
ryanofsky force-pushed on Jan 17, 2026
DrahtBot removed the label Needs rebase on Jan 17, 2026
DrahtBot added the label CI failed on Jan 17, 2026
ryanofsky force-pushed on Jan 18, 2026
DrahtBot removed the label CI failed on Jan 18, 2026
DrahtBot added the label Needs rebase on Jan 19, 2026
ryanofsky force-pushed on Jan 22, 2026
DrahtBot removed the label Needs rebase on Jan 22, 2026
ryanofsky force-pushed on Jan 22, 2026
DrahtBot added the label CI failed on Jan 22, 2026
DrahtBot
commented at 11:47 PM on January 22, 2026:
contributor
Try to run the tests locally, according to the documentation. However, a CI failure may still
happen due to a number of reasons, for example:
Possibly due to a silent merge conflict (the changes in this pull request being
incompatible with the current code in the target branch). If so, make sure to rebase on the latest
commit of the target branch.
A sanitizer issue, which can only be found by compiling with the sanitizer and running the
affected test.
An intermittent issue.
Leave a comment here, if you need help tracking down a confusing failure.
</details>
DrahtBot removed the label CI failed on Jan 23, 2026
DrahtBot added the label Needs rebase on Feb 4, 2026
ryanofsky force-pushed on Feb 9, 2026
DrahtBot removed the label Needs rebase on Feb 9, 2026
ryanofsky force-pushed on Feb 9, 2026
DrahtBot added the label CI failed on Feb 9, 2026
DrahtBot
commented at 6:06 PM on February 9, 2026:
contributor
<!--85328a0da195eb286784d51f73fa0af9-->
π§ At least one of the CI tasks failed.
<sub>Task tidy: https://github.com/bitcoin/bitcoin/actions/runs/21833918575/job/62999419836</sub>
<sub>LLM reason (β¨ experimental): Clang-tidy failed the build due to an unused using declaration (using util::Unexpected) in wallet.cpp, causing the CI to fail.</sub>
<details><summary>Hints</summary>
Try to run the tests locally, according to the documentation. However, a CI failure may still
happen due to a number of reasons, for example:
Possibly due to a silent merge conflict (the changes in this pull request being
incompatible with the current code in the target branch). If so, make sure to rebase on the latest
commit of the target branch.
A sanitizer issue, which can only be found by compiling with the sanitizer and running the
affected test.
An intermittent issue.
Leave a comment here, if you need help tracking down a confusing failure.
</details>
DrahtBot removed the label CI failed on Feb 9, 2026
DrahtBot added the label Needs rebase on Feb 10, 2026
ryanofsky referenced this in commit bc914f08e2 on Mar 2, 2026
ryanofsky referenced this in commit e237f352a4 on Mar 2, 2026
ryanofsky referenced this in commit 9540e2701f on Mar 2, 2026
ryanofsky referenced this in commit 677f66a42f on Mar 2, 2026
ryanofsky referenced this in commit 78f39378e0 on Mar 2, 2026
ryanofsky referenced this in commit d91775c8ea on Mar 2, 2026
refactor: Add util::Result failure values
Add util::Result support for returning more error information. For better error
handling, adds the ability to return a value on failure, not just a value on
success. This is a key missing feature that made the result class not useful
for functions like LoadChainstate() which produce different errors that need to
be handled differently.
This change also makes some more minor improvements:
- Smaller type size. On 64-bit platforms, util::Result<int> is 16 bytes, and
util::Result<void> is 8 bytes. Previously util::Result<int> and
util::Result<void> were 72 bytes.
- More documentation and tests.
Previous commit causes the warning to be triggered, but the suboptimal return
from const statement was added earlier in 517e204bacd9d.
Warning was causing CI failure https://cirrus-ci.com/task/6159914970644480
022c6f5c68
refactor: Add util::Result::Update() method
Add util::Result Update method to make it possible to change the value of an
existing Result object. This will be useful for functions that can return
multiple error and warning messages, and want to be able to change the result
value while keeping existing messages.
443adefa3b
refactor: Use util::Result class in LoadChainstate and VerifyLoadedChainstate2a4e031f8e
refactor: Add util::Result multiple error and warning messages
Add util::Result support for returning warning messages and multiple errors,
not just a single error string. This provides a way for functions to report
errors and warnings in a standard way, and simplifies interfaces.
The functionality is unit tested here, and put to use in followup PR
https://github.com/bitcoin/bitcoin/pull/25722
bc748d0c6f
test: add static test for util::Result memory usage
Suggested by Martin Leitner-Ankerl <martin.ankerl@gmail.com>
https://github.com/bitcoin/bitcoin/pull/25722#discussion_r1174298529
Co-authored-by: Martin Leitner-Ankerl <martin.ankerl@gmail.com>
5ef13873a9
Merge branch 'pr/bresult2' into pr/bresult-ptr2c51c00e22
Add util::ResultPtr class
The util::ResultPtr class is a wrapper for util::Result providing syntax sugar
to make it less awkward to use with returned pointers. Instead of needing to be
deferenced twice with **result or (*result)->member, it only needs to be
dereferenced once with *result or result->member. Also when it is used in a
boolean context, instead of evaluating to true when there is no error and the
pointer is null, it evaluates to false so it is straightforward to determine
whether the result points to something.
This PR is only partial a solution to #26004 because while it makes it easier
to check for null pointer values, it does not make it impossible to return a
null pointer value inside a successful result. It would be possible to enforce
that successful results always contain non-null pointers by using a not_null
type (https://github.com/bitcoin/bitcoin/issues/24423) in combination with
ResultPtr, though.
56171227ae
Use ResultPtr<unique_ptr> instead of Result<unique_ptr>e0982ed684
Merge branch 'pr/bresult-ptr' into pr/bresult-loadae8a0fcc47
Add temporary ResultExtract helper for porting to util::Result62c2d8faa1
refactor: Use util::Result class in wallet/sqlitee18af43fe6
refactor: Use util::Result class in wallet/migrate26a1639cad
refactor: Use util::Result class in wallet::MakeDatabase1f57aa9203
refactor: Use util::Result class in wallet/dump682b8d283b
refactor: Use util::Result class in wallet/wallettool7392dc11b7
refactor: Use util::Result class in wallet/wallet707e53e715
refactor: Use util::Result class in wallet/load6aac228547
refactor: Use util::Result class in wallet/rpc4d2a684657
refactor: Use util::Result class in wallet/interfacesd71873e041
refactor: Use util::Result class in wallet/test4cd6dc7252
Drop temporary ResultExtract helper for porting to util::Result97a3e65ba7
scripted-diff: replace wallet DatabaseStatus with DatabaseError
This is a metadata mirror of the GitHub repository
bitcoin/bitcoin.
This site is not affiliated with GitHub.
Content is generated from a GitHub metadata backup.
generated: 2026-05-02 06:13 UTC
This site is hosted by @0xB10C More mirrored repositories can be found on mirror.b10c.me