brunoerg
commented at 7:43 pm on April 22, 2024:
contributor
This PR adds a fuzz target for the CreateTransaction function. It is a regression target for #27271 and can be testing by applying:
0@@ -1110,7 +1110,7 @@ static util::Result<CreatedTransactionResult> CreateTransactionInternal(
1 // This can only happen if feerate is 0, and requested destinations are value of 0 (e.g. OP_RETURN)
2 // and no pre-selected inputs. This will result in 0-input transaction, which is consensus-invalid anyways
3 if (selection_target == 0 && !coin_control.HasSelected()) {
4- return util::Error{_("Transaction requires one destination of non-0 value, a non-0 feerate, or a pre-selected input")};
5+ // return util::Error{_("Transaction requires one destination of non-0 value, a non-0 feerate, or a pre-selected input")};
6 }
Also, it moves ImportDescriptors function to src/wallet/test/util.h to avoid to duplicate same code.
DrahtBot
commented at 7:43 pm on April 22, 2024:
contributor
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.
Conflicts
Reviewers, this pull request conflicts with the following ones:
#31149 (tinyformat: enforce compile-time checks for format string literals by stickies-v)
#30928 (tinyformat: refactor: increase compile-time checks and don’t throw for tfm::format_error by stickies-v)
#30221 (wallet: Ensure best block matches wallet scan state by achow101)
#28710 (Remove the legacy wallet and BDB dependency by achow101)
#25979 ([WIP] wallet: standardize change output detection process by furszy)
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.
DrahtBot added the label
Tests
on Apr 22, 2024
brunoerg force-pushed
on Apr 22, 2024
DrahtBot added the label
CI failed
on Apr 22, 2024
brunoerg
commented at 9:21 pm on April 22, 2024:
contributor
Maybe move this to util.cpp as well? In theory it is the wrong place, because it depends on FuzzedDataProvider, but I think this isn’t too important in tests.
It seems the addition of a new util file makes this PR conflicts with other ones. Perhaps it’s better to put everything in wallet/test/util or leave as is? What do you think @maflcko?
You’re right. I just tested here without wallet and it compiles. We don’t have any verification for ENABLE_WALLET in Makefile.test_fuzz.include like in Makefile.test.include. I could include it.
maflcko
commented at 8:42 am on April 23, 2024:
member
lgtm, nice!
brunoerg force-pushed
on Apr 23, 2024
brunoerg force-pushed
on Apr 24, 2024
DrahtBot added the label
Needs rebase
on Apr 30, 2024
brunoerg force-pushed
on Apr 30, 2024
brunoerg
commented at 9:05 pm on April 30, 2024:
contributor
Rebased
brunoerg force-pushed
on Apr 30, 2024
DrahtBot removed the label
Needs rebase
on Apr 30, 2024
brunoerg requested review from maflcko
on May 1, 2024
DrahtBot added the label
CI failed
on Jun 20, 2024
DrahtBot
commented at 1:31 pm on June 20, 2024:
contributor
🚧 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.
brunoerg
commented at 9:36 pm on June 27, 2024:
contributor
Let me know if I’m missing something but at what point is the fuzzed wallet funded? I generated a coverage report and the test seems to blocked at SelectCoins in CreateTransactionInternal. It always results in an insufficient funds error, which means the fuzzer never gets past this line in CreateTransaction.
It is not being funded, I will add it. Thanks.
brunoerg force-pushed
on Jun 28, 2024
brunoerg
commented at 2:15 pm on June 28, 2024:
contributor
It is not being funded, I will add it. Thanks.
Force-pushed adding it.
DrahtBot added the label
CI failed
on Jun 28, 2024
DrahtBot
commented at 3:34 pm on June 28, 2024:
contributor
🚧 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.
Sometimes change_pos isn’t set so it does hit that line. Maybe there are other reasons for the low stability somewhere else?
maflcko
commented at 10:57 am on July 12, 2024:
member
The only obvious source of randomness I’m seeing is in CreateTransactionInternal:
Does it improve if you call SeedRandomForTest before every execution of every fuzz input?
marcofleon
commented at 2:34 pm on July 12, 2024:
contributor
Does it improve if you call SeedRandomForTest before every execution of every fuzz input?
Yes, calling SeedRandomForTest(SeedRand::ZEROS) at the beginning of every iteration improves stability from 28% to 70%.
brunoerg
commented at 2:54 pm on July 12, 2024:
contributor
Yes, calling SeedRandomForTest(SeedRand::ZEROS) at the beginning of every iteration improves stability from 28% to 70%.
Cool, I’ll address it.
brunoerg force-pushed
on Jul 12, 2024
brunoerg
commented at 4:41 pm on July 12, 2024:
contributor
Force-pushed adding SeedRandomForTest
brunoerg requested review from marcofleon
on Jul 18, 2024
hebasto added the label
Needs CMake port
on Aug 16, 2024
marcofleon
commented at 1:58 pm on August 19, 2024:
contributor
Sorry for taking a bit here. I still would like to figure out the stability issues for this harness (it’s at about 70%), but it’s turning into a whole rabbithole of its own. I don’t think it needs to be a blocker for this PR. It would be good to have the test in and I’ll continue to use this harness as my example for my “identifying instability” tool.
ACK22f4d12eb25d34d8f2f6a23b44074dc1fb73f71d.
DrahtBot added the label
Needs rebase
on Aug 28, 2024
brunoerg force-pushed
on Aug 28, 2024
brunoerg
commented at 10:01 pm on August 28, 2024:
contributor
Rebased
DrahtBot removed the label
Needs rebase
on Aug 28, 2024
hebasto
commented at 12:54 pm on August 29, 2024:
member
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: 2024-12-22 03:12 UTC
This site is hosted by @0xB10C More mirrored repositories can be found on mirror.b10c.me