Skip to content
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

fuzz: Faster wallet_notifications target #28933

Merged
merged 2 commits into from
Nov 27, 2023

Conversation

maflcko
Copy link
Member

@maflcko maflcko commented Nov 24, 2023

Avoid read/write from storage to speed the target up.

This avoids having to include both headers when assert and Assert are
used at the same time.
@DrahtBot
Copy link
Contributor

DrahtBot commented Nov 24, 2023

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

Code Coverage

For detailed information about the code coverage, see the test coverage report.

Reviews

See the guideline for information on the review process.

Type Reviewers
ACK dergoegge, brunoerg

If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.

Copy link
Member

@dergoegge dergoegge left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code review ACK fa4fc99

With the mocked database this shouldn't be going to disk at all now, right?

@maflcko
Copy link
Member Author

maflcko commented Nov 24, 2023

With the mocked database this shouldn't be going to disk at all now, right?

Yeah, I guess so. (A datadir is still created, though)

@dergoegge
Copy link
Member

A datadir is still created, though

Is that necessary or just a side effect from using TestingSetup?

@brunoerg
Copy link
Contributor

brunoerg commented Nov 24, 2023

Concept ACK

will review soon!

@maflcko
Copy link
Member Author

maflcko commented Nov 24, 2023

Is that necessary or just a side effect from using TestingSetup?

Both. For one, validation can not exist without datadir. Also, it is created in TestingSetup. But it shouldn't cause any issues, because it will be empty.

@dergoegge
Copy link
Member

But it shouldn't cause any issues, because it will be empty.

Empty dirs aren't of size zero and #28811 would still apply (given more timeouts/crashes).

It's a bit of a shame if it's always empty to still create it, but not an issue for this PR in any case.

@maflcko
Copy link
Member Author

maflcko commented Nov 24, 2023

Are there any timeouts left at this point? If yes, it may be good to report them.

@dergoegge
Copy link
Member

Are there any timeouts left at this point? If yes, it may be good to report them.

We'll see I guess, initial exec/s looked good but they have now deteriorated to 3 exec/s (per core). No timeouts so far though and CPU utilization is at 100% on all cores, so this is a definite improvement.

@brunoerg
Copy link
Contributor

brunoerg commented Nov 24, 2023

Is there any benefit about using this ImportDescriptor approach compared to simply use SetupDescriptorScriptPubKeyMans?

@maflcko
Copy link
Member Author

maflcko commented Nov 24, 2023

SetupScriptPubKeyMans

Which function do you mean?

$ git grep SetupScriptPubKeyMans | wc -l
0

@brunoerg
Copy link
Contributor

Which function do you mean?

Sorry, edited that. It's SetupDescriptorScriptPubKeyMans.

Copy link
Contributor

@brunoerg brunoerg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK fa4fc99

@dergoegge
Copy link
Member

dergoegge commented Nov 27, 2023

I've run into timeouts.

e.g. this input takes >5s to execute on my machine.
QV9BKr6un2BgAAD/S6+fn2CAYJ9gn5+f3wCABP+fn2Bg/489AGCf8AAAJn8AAAB/AJ9kYJ+fk0FB
QQAZAADBvkFEIiT5////IiIjIiIgvF1G/90AAOR/D/+7QUFBPb1hvkFBV0G+Qfi+4IJBQQcjByIg
jf4iIiISDwAAAAB///+7VBC1RCIk+f///yIiIyIiILxdRv/dAADkfw//u5gjRLW73dsG//8gIiIj
IgAAQeDh4eHh4eEtLUEtLQMaGgMeKSopKSkpKSkpKSkpKSkpKSkpKSkpKSkpKSkpKSEpKSkpKSkp
KSkpKRgpKSkpKSkpKSkpKSkpKSkpKSkpKSkpKSkpKSkpKSkpKSkpKSkpKSkpKSkpKSkpKSkpKSkp
KSkpKSkpKSkpKSkpKSkpKSkpKSkpKSkpKSkpKTkpKSkpKSkpKSkpKSkpKSkpKSkpKSkpKSkpKSkp
KSkpKSkpKSkpKSkpKSkpKSkpKSkpKSkpKSlFKSkpKSkpKSkpKSkpKSkpKSkpKSkpKSkpKSkpKSkp
KSkpKSkpKSkpKSkpKSkpKSkpKSkpKSkpKSkpKSkpKSkpKdbWKSkpKSkpKSkpKSkpKSkpKSkpKSkp
KSkpKSkpKSkpKSkpKSkpKSkpKSkp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SkpKSkpKSkpKSkpKSkpKSkpKSkpKSkpKSkpKSkpKSkpKSkpKSkpKSkpKSkpKSkp
KSkpKSkpKSkpKSkpKSkpKSkpKSkpKSkpKSkpKSkpKSkpKSkpKSkpKcgS/AAAAtEDA0EDQQEAQU5k
QgoDGwMDBAAUAwAQA2QDAwNBAAADAwMDCnsdQ0NDZn9+JkNBZAMDA0EAAAMDAwNBA/9/AABBAwLh
EwMUwcHBwcHBwcHBwcHBwcHBwcHBAwAQA0IKA5QD//8DQQ0DAykpKSkpKSkQKSkpKSkpKSkpKSkp
KSkpKSkpKSkpKSkpKSkpKSkpKSkpKSkpKSkpKSkpKSkpKSkpKSkpKSkpKSkpKSkpKSkpKSkpKSkp
KSkpKSkpKSkpKSkpKSkpKSkpSSkpKSkpKSkpKSkpKSkpKSkpKSkpKSkpKSkpKSkpKSkpKSkpKSkp
KSkpKSkpDEkpKSkpKSkpKSkpKSkpKSkpKSkpKSkpKSkpKSkpKSkpKSkpKSkpKSkpKSkpKSkpKSkp
KSkpKSkpfwAAACkpKSkpKSkpKSkpKSkpKSkqKSkpKSkpKSkpKSkpKSkpKSkpKSkpKSkpKSkpKSkp
KSkpKSkpKSkpKSkpKSkpKSkpKSkpKSkpKSkpKSkpKSkpKSkpKSkpKSkpKSkpKSkpKSkpKSkpKSkp
KSkpKSkpKSkpKSkpKSkpKSkpKSkpKZUpKSkpKSkpKSnW1ikpKSkpKSkpKRgpKSkpKSkpKSkpKSkp
KSkpKSkpKSkpKSkpKSkpKSkpKSkpKSkpKSkpKSkpKSkpKSkpKSkpKSkpKKkpKSkpKSkpKSkpKSkp
KSkpKSkpKSkpKSkpKSkpKSkpKSkpKSkaAwPhqwAAAwMDAwP/5+fn5+fn

Afl++ stability also dropped to ~70% which suggests that there is some non-determinism in the target.

@maflcko
Copy link
Member Author

maflcko commented Nov 27, 2023

Afl++ stability also dropped to ~70% which suggests that there is some non-determinism in the target.

This is expected, because the wallet internally uses system random, similar to the p2p fuzz targets. This should be fixed in a follow-up for all fuzz targets.

@maflcko
Copy link
Member Author

maflcko commented Nov 27, 2023

I've run into timeouts.

Thanks, fixed by reducing the number of new addresses that are generated each run

Copy link
Member

@dergoegge dergoegge left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reACK fa15861

Copy link
Contributor

@brunoerg brunoerg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reACK fa15861

@fanquake fanquake merged commit 794f971 into bitcoin:master Nov 27, 2023
16 checks passed
@maflcko maflcko deleted the 2311-fuzz-wallet-notif- branch November 28, 2023 07:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants