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

Bug: Mint tries to invalidate proofs twice in race condition #683

Open
callebtc opened this issue Dec 20, 2024 · 0 comments
Open

Bug: Mint tries to invalidate proofs twice in race condition #683

callebtc opened this issue Dec 20, 2024 · 0 comments
Labels
bug Something isn't working mint About the Nutshell mint

Comments

@callebtc
Copy link
Collaborator

callebtc commented Dec 20, 2024

Race condition when melting tokens.

  • First call: User makes a melt request that takes a long time
  • Before the first call returns, user GETs the melt quote
  • Melt quote is PAID although the first call hasn't returned yet
  • Mint invalidates all proofs of this melt operation
  • Now the first call returns, and we try to invalidate the same melt proofs again

Can be reproduced by setting fakewallet_delay_outgoing_payment = 15 to a long time, and fakewallet_payment_state="PAID" (seems to work also for PENDING, probably doesn't matter?).

I think this race condition is very unlikely in a real scenario, because the first call would likely return before any other GET request can race it. Should still be fixed of course.

@callebtc callebtc added bug Something isn't working mint About the Nutshell mint labels Dec 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working mint About the Nutshell mint
Projects
None yet
Development

No branches or pull requests

1 participant