Skip to content

Conversation

@KvngMikey
Copy link

@KvngMikey KvngMikey commented Nov 25, 2025

fixes #596

Summary

  • This PR implements proper expiration handling for mint and melt quotes that remain in the PENDING state beyond their valid lifetime. It introduces a background sweep that marks these stale quotes as EXPIRED, ensuring they can no longer be redeemed or incorrectly matched by later processing.

Changes

  • Pending mint/melt quotes were never expired, which could accumulate indefinitely and cause incorrect accounting or reuse, so now we expire them
  • The system had no centralized regular task to sweep and update expired quotes, this was introduced to handle this.
  • All test passs.

Question

  • Should we add an expiry column to mint_quotes and melt_quotes? Right now, expiry is determined implicitly using:
    created_time + EXPIRY_SECONDS (5minutes, a fixed lifespan and global timeout)..
    Please advise which approach you prefer so I can update accordingly.

@KvngMikey
Copy link
Author

based on a conversation had with @callebtc, I’ve updated the PR so that _run_regular_tasks() strictly runs as a simple infinite loop, performing the periodic check and then sleeping. All other logic has been removed from this function as requested to be implemented after a future conversation, thank you

Copy link
Collaborator

@callebtc callebtc left a comment

Choose a reason for hiding this comment

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

thank you!

  • please remove the mint_regular_tasks_enabled toggle from settings.py, we should run the tasks by default
  • add a simple while True
  • remove changes to unrelated files

@KvngMikey KvngMikey requested a review from callebtc December 18, 2025 20:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature request] Mint should check pending proofs and expired quotes regularly

3 participants