-
Notifications
You must be signed in to change notification settings - Fork 31
fix: prevent collision between in round and redeem vtxo #537
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's add a test that ensures the double spend attempt won't succeed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also please, in ark.trivy.yaml
, update runs-on
to ubuntu-24.04
This cant be tested with consistent outcome as it is matter of timing. |
Done |
Problem
Previously, there was a potential race condition where a vtxo could be both redeemed via SubmitRedeemTx and simultaneously registered for the next round via SpendVtxos. This could lead to double-spending attempts and inconsistent state.
Solution
This PR implements bidirectional checks to prevent collisions between vtxos being redeemed and those being registered for the next round:
redeemTxRequests
structure to track vtxos that are currently being redeemedredeemTxRequests
structure@altafan please review.