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

misc: 🍱 add a mock consensus test exercising penumbra_wallet::plan::sweep() #4605

Merged
merged 7 commits into from
Jun 14, 2024

Conversation

cratelyn
Copy link
Contributor

@cratelyn cratelyn commented Jun 12, 2024

💭 describe your changes

this introduces a mock consensus test, showing that the tx sweep command
works as expected for a simple case, when a wallet contains SWEEP_COUNT + 1
notes.

#4601 more directly tracks the issue of the note commitment missing error,
which i believe affects more than just sweeping. similarly, #4586 and #4578
fixed the issue of seeing not a valid SCT root errors, which could also occur
when sweeping notes, because it is effectively performing the same action of
performing many transactions in a hot loop, sending funds to oneself.

while this might not "fix" #4574 strictly speaking, this does introduce some
foundational test coverage so that we can write more robust regression tests
against the core logic responsible for sweep planning.

🔖 issue ticket number and link

✅ checklist before requesting a review

  • if this code contains consensus-breaking changes, i have added the
    "consensus-breaking" label. otherwise, i declare my belief that there are not
    consensus-breaking changes, for the following reason:

    this branch only introduces tests, and makes minor refactors in client-side
    code.

these are helper functions that assist the public `sweep()` function,
invoked by pcli's `tx sweep` subcommand.
the errors one gets if running in a standard `tokio::test` runtime are
a bit cryptic. add a comment remarking on this, as a helpful breadcrumb.
this will help us write a test case that is resilient to future changes
in the precise behavior of the sweeping functionality.
@cratelyn cratelyn self-assigned this Jun 12, 2024
@cratelyn cratelyn added A-client Area: Design and implementation for client functionality C-bug Category: a bug A-testing Area: Relates to testing of Penumbra A-mock-consensus Area: Relates to the mock consensus engine labels Jun 12, 2024
@cratelyn cratelyn added this to the Sprint 8 milestone Jun 12, 2024
@cratelyn cratelyn marked this pull request as ready for review June 12, 2024 21:04
@cratelyn
Copy link
Contributor Author

test flaked, see #4517. i'll re-run tests when i'm back at the computer.

@cratelyn cratelyn marked this pull request as draft June 13, 2024 04:07
@cratelyn cratelyn marked this pull request as ready for review June 13, 2024 19:53
@cratelyn cratelyn requested a review from a team June 13, 2024 20:04
@cratelyn cratelyn merged commit a0d38e6 into main Jun 14, 2024
13 checks passed
@cratelyn cratelyn deleted the kate/read-em-and-sweep branch June 14, 2024 02:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-client Area: Design and implementation for client functionality A-mock-consensus Area: Relates to the mock consensus engine A-testing Area: Relates to testing of Penumbra C-bug Category: a bug
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants