Skip to content

fuzz: Faster wallet_notifications target - #28933

Merged
fanquake merged 2 commits into
bitcoin:masterfrom
maflcko:2311-fuzz-wallet-notif-
Nov 27, 2023
Merged

fanquake merged 2 commits into
bitcoin:masterfrom
maflcko:2311-fuzz-wallet-notif-

Conversation

@maflcko

@maflcko maflcko commented Nov 24, 2023

Copy link
Copy Markdown
Member

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

DrahtBot commented Nov 24, 2023 •

Copy link
Copy Markdown
Contributor

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.

@DrahtBot DrahtBot added the Tests label Nov 24, 2023
@maflcko
maflcko force-pushed the 2311-fuzz-wallet-notif- branch from fa092cc to fa4fc99 Compare November 24, 2023 13:01

@dergoegge dergoegge left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Code review ACK fa4fc99b6e2a13736521e6bca1f626ba1d2f59e3

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

@maflcko

maflcko commented Nov 24, 2023

Copy link
Copy Markdown
Member Author

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
Copy Markdown
Member

A datadir is still created, though

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

@brunoerg

brunoerg commented Nov 24, 2023 •

Copy link
Copy Markdown
Contributor

Concept ACK

will review soon!

@maflcko

maflcko commented Nov 24, 2023

Copy link
Copy Markdown
Member Author

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
Copy Markdown
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

maflcko commented Nov 24, 2023

Copy link
Copy Markdown
Member Author

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

@dergoegge

Copy link
Copy Markdown
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

brunoerg commented Nov 24, 2023 •

Copy link
Copy Markdown
Contributor

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

@maflcko

maflcko commented Nov 24, 2023

Copy link
Copy Markdown
Member Author

SetupScriptPubKeyMans

Which function do you mean?

$ git grep SetupScriptPubKeyMans | wc -l
0

@brunoerg

Copy link
Copy Markdown
Contributor

Which function do you mean?

Sorry, edited that. It's SetupDescriptorScriptPubKeyMans.

@brunoerg brunoerg left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

ACK fa4fc99b6e2a13736521e6bca1f626ba1d2f59e3

@dergoegge

dergoegge commented Nov 27, 2023 •

Copy link
Copy Markdown
Member

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
KSkpKSkpK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KSkpKSkpKSkpKSkpKSkpKSkpKSkpKSkpKSkpKKkpKSkpKSkpKSkpKSkp
KSkpKSkpKSkpKSkpKSkpKSkpKSkpKSkaAwPhqwAAAwMDAwP/5+fn5+fn

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

@maflcko

maflcko commented Nov 27, 2023

Copy link
Copy Markdown
Member Author

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
maflcko force-pushed the 2311-fuzz-wallet-notif- branch from fa4fc99 to fa15861 Compare November 27, 2023 11:06
@maflcko

maflcko commented Nov 27, 2023

Copy link
Copy Markdown
Member Author

I've run into timeouts.

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

@dergoegge dergoegge left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

reACK fa15861

@DrahtBot
DrahtBot requested a review from brunoerg November 27, 2023 11:46

@brunoerg brunoerg left a comment

Copy link
Copy Markdown
Contributor

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
@maflcko
maflcko deleted the 2311-fuzz-wallet-notif- branch November 28, 2023 07:39
@maflcko maflcko mentioned this pull request Apr 17, 2024
11 of 14 tasks
@bitcoin bitcoin locked and limited conversation to collaborators Nov 27, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants