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: wallet: add target for spkm migration #29694

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

brunoerg
Copy link
Contributor

@brunoerg brunoerg commented Mar 21, 2024

This PR adds a fuzz target for ScriptPubKeyMan migration. It creates a LegacyDataSPKM which can have some keys/scripts/etc, and then migrate it to descriptor. I tried to keep it as compatible as possible with future legacy wallet removal.

@DrahtBot
Copy link
Contributor

DrahtBot commented Mar 21, 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/29694.

Reviews

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

Conflicts

Reviewers, this pull request conflicts with the following ones:

  • #25722 (refactor: Use util::Result class for wallet loading by ryanofsky)

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.

@brunoerg
Copy link
Contributor Author

cc: @achow101

@brunoerg brunoerg marked this pull request as draft June 25, 2024 20:37
@brunoerg brunoerg force-pushed the 2024-03-fuzz-spkm-migration branch from d0c3ca9 to 2e7ac47 Compare September 9, 2024 19:02
@brunoerg brunoerg marked this pull request as ready for review September 10, 2024 11:28
@achow101 achow101 self-requested a review October 15, 2024 15:53
@brunoerg
Copy link
Contributor Author

Inputs for this are available at: brunoerg/qa-assets#2

@brunoerg brunoerg force-pushed the 2024-03-fuzz-spkm-migration branch from 2e7ac47 to 77c31c8 Compare November 11, 2024 16:56
@brunoerg
Copy link
Contributor Author

@brunoerg brunoerg force-pushed the 2024-03-fuzz-spkm-migration branch from 77c31c8 to ed1a16b Compare November 26, 2024 19:33
Copy link
Member

@furszy furszy left a comment

Choose a reason for hiding this comment

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

Would be good to ensure that #31374 can be replicated here.

@brunoerg brunoerg force-pushed the 2024-03-fuzz-spkm-migration branch from ed1a16b to cdc9458 Compare November 26, 2024 19:48
@DrahtBot
Copy link
Contributor

🚧 At least one of the CI tasks failed.
Debug: https://github.com/bitcoin/bitcoin/runs/33561912794

Hints

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.

@brunoerg
Copy link
Contributor Author

Force-pushed addressing #29694 (comment)

@brunoerg
Copy link
Contributor Author

brunoerg commented Nov 26, 2024

Would be good to ensure that #31374 can be replicated here.

Since this target is only for spkm migration, I don't think it can be replicated here.

Edit: I can add ApplyMigrationData here and reproduce the crash from #31374. I'm going to move this to draft while working on it.

@brunoerg brunoerg marked this pull request as draft November 27, 2024 13:13
@brunoerg brunoerg force-pushed the 2024-03-fuzz-spkm-migration branch 2 times, most recently from 1421097 to 9750b3f Compare December 2, 2024 12:27
@brunoerg
Copy link
Contributor Author

Force-pushed adding SeedRandomStateForTest and SetMockTime for better stability.

@brunoerg brunoerg force-pushed the 2024-03-fuzz-spkm-migration branch from 5e2e916 to 457f1d4 Compare January 27, 2025 18:53
@brunoerg
Copy link
Contributor Author

Rebased

@brunoerg brunoerg force-pushed the 2024-03-fuzz-spkm-migration branch 2 times, most recently from a7749a9 to cbffd66 Compare January 27, 2025 21:47
@DrahtBot
Copy link
Contributor

DrahtBot commented Feb 3, 2025

https://cirrus-ci.com/task/5046981191532544?logs=ci#L1799

[22:03:02.859]  test  2025-01-27T22:03:01.984000Z TestFramework (ERROR): Assertion failed 
[22:03:02.859]                                    Traceback (most recent call last):
[22:03:02.859]                                      File "/ci_container_base/test/functional/test_framework/test_framework.py", line 135, in main
[22:03:02.859]                                        self.run_test()
[22:03:02.859]                                      File "/ci_container_base/ci/scratch/build-x86_64-pc-linux-gnu/test/functional/wallet_migration.py", line 1098, in run_test
[22:03:02.859]                                        self.test_failed_migration_cleanup()
[22:03:02.859]                                      File "/ci_container_base/ci/scratch/build-x86_64-pc-linux-gnu/test/functional/wallet_migration.py", line 899, in test_failed_migration_cleanup
[22:03:02.859]                                        assert all(wallet not in self.master_node.listwallets() for wallet in ["failed", "failed_watchonly", "failed_solvables"])
[22:03:02.859]                                    AssertionError

@brunoerg brunoerg marked this pull request as draft February 3, 2025 16:41
For in-memory SQLite databases, exclusive locking is generally not
necessary because in-memory dbs are private to the connection that
created them.
By using in-memory databases, we do not have dbs file to delete
and restore.
@brunoerg brunoerg force-pushed the 2024-03-fuzz-spkm-migration branch from cbffd66 to 0c0e79d Compare February 5, 2025 13:09
@DrahtBot DrahtBot removed the CI failed label Feb 5, 2025
@brunoerg brunoerg marked this pull request as ready for review February 5, 2025 16:58
@brunoerg
Copy link
Contributor Author

brunoerg commented Feb 5, 2025

Just fixed CI, ready for review!

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.

6 participants