Skip to content

fuzz: Limit wallet_notifications iterations (take 2)#31467

Closed
maflcko wants to merge 1 commit intobitcoin:masterfrom
maflcko:2412-fuzz-wallet-less
Closed

fuzz: Limit wallet_notifications iterations (take 2)#31467
maflcko wants to merge 1 commit intobitcoin:masterfrom
maflcko:2412-fuzz-wallet-less

Conversation

@maflcko
Copy link
Member

@maflcko maflcko commented Dec 11, 2024

This is a follow-up to #31238 (comment), limiting the scope of the fuzz target even further, because it is still by far the most expensive one, see bitcoin-core/qa-assets#214 (comment).

Also, remove the FundTx check, as it is one of the heavier calls.

In the future, the fuzz target can fully be reworked, because it also has poor stability, see #31238 (comment)

@DrahtBot
Copy link
Contributor

DrahtBot commented Dec 11, 2024

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

Code Coverage & Benchmarks

For details see: https://corecheck.dev/bitcoin/bitcoin/pulls/31467.

Reviews

See the guideline for information on the review process.
A summary of reviews will appear here.

@DrahtBot DrahtBot added the Tests label Dec 11, 2024
// Add tx to block
block.vtx.emplace_back(MakeTransactionRef(tx));
// Check that funding the tx doesn't crash the wallet
a.FundTx(fuzzed_data_provider, tx);
Copy link
Contributor

Choose a reason for hiding this comment

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

FundTx is part of FuzzedWallet and is only used in this target. Since we're removing this call here, maybe we could delete the entire function in FuzzedWallet.

Copy link
Member Author

Choose a reason for hiding this comment

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

Good point. This should either be kept (as I added it as a regression fuzz test), or the whole target can be removed.

IIUC the overhead comes from the knapsack solver running 1000 times over all inputs, which seems heavy. I wonder if there is an easy way to disable knapsack here?

I guess a middle ground could be to execute this call only ever once per fuzz input.

Copy link
Contributor

Choose a reason for hiding this comment

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

IIUC the overhead comes from the knapsack solver running 1000 times over all inputs, which seems heavy. I wonder if there is an easy way to disable knapsack here?

This is the 1000 iterations from ApproximateBestSubset?

Copy link
Contributor

Choose a reason for hiding this comment

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

Just fyi - When I was working on this paper (https://repositorio.usp.br/directbitstream/ceb3347f-d97b-4995-8c0d-17ec195dd128/3218430.pdf), I did some experiments by reducing the number of iterations in ApproximateBestSubset, I think I mention it in the paper, but I remember that reducing the number of iterations by the half had no impact on its behavior.

Copy link
Contributor

Choose a reason for hiding this comment

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

Keeping the two FundTx calls doesn't make the target significantly slower for me (-runs=1 takes 8 sec vs 6 sec without them). But I agree that if they are removed then the function should be removed from FuzzedWallet.

Copy link
Member

Choose a reason for hiding this comment

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

I don't see too much time difference in a corpus made using both with/without this FundTx call, so it seems better to keep the coverage it could provide.

If knapsack is causing slowness, that seems mostly an argument to improve it, reduce its iteration counts, or get rid of it. Paging @murchandamus .

Copy link
Member

Choose a reason for hiding this comment

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

Removing Knapsack is still on my to-do list!

@fanquake fanquake requested a review from marcofleon December 17, 2024 11:54
@fanquake
Copy link
Member

@dergoegge you likely also have some thoughts here?

@maflcko
Copy link
Member Author

maflcko commented Feb 20, 2025

Follow-ups could be:

  • Remove knapsack, or disable it for this target
  • Temporarily remove the target until knapsack is removed
  • Other possible avenues for speed-up of this target, or a cleanup, or a fix for stability issues

Though, I don't have time to work on this right now, so closing for now.

@maflcko maflcko closed this Feb 20, 2025
@maflcko maflcko deleted the 2412-fuzz-wallet-less branch February 20, 2025 20:50
fanquake added a commit that referenced this pull request May 16, 2025
fad2faf fuzz: Delete wallet_notifications (MarcoFalke)

Pull request description:

  The fuzz target has many issues:

  * It has never found a meaningful issue.
  * It is still slow, despite #28933 and #31238.
  * It is unmaintained, see #28882 (comment) (missing meaningful coverage) or #31238 (comment) (unstable) or #31467 (comment) (fix slowness), etc ...

  So remove it for now. It can be added back once one or all of the issues have been addressed.

ACKs for top commit:
  fanquake:
    ACK fad2faf
  brunoerg:
    ACK fad2faf

Tree-SHA512: e48c08352688c0eead5793ee1c7513ddd37459bc665e914a770a3f69772674ed0e14c05e5d07b333ca0ab03bb35d7d9d32561311af569958e19dc4607c11fade
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.

7 participants