fix: replace speculative resolve() with mark_voted() to prevent dupli…#344
Open
enjoyandlove wants to merge 1 commit into
Open
fix: replace speculative resolve() with mark_voted() to prevent dupli…#344enjoyandlove wants to merge 1 commit into
enjoyandlove wants to merge 1 commit into
Conversation
Author
|
Hi, @anderdc |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #343
tracker.resolve()was being called speculatively in the forward loop after a confirm or timeout vote succeeded.resolve()removes the swap fromvoted_ids, destroying the duplicate-vote guard untilevent_watcherfires.confirm_miner_fulfillments, line 520enforce_swap_timeouts) are replaced withtracker.mark_voted(), which records the vote without dropping the guard.event_watchercontinues to calltracker.resolve()authoritatively onSwapCompleted/SwapTimedOutchain events — that ownership boundary is now respected.Why
Between "our vote lands" and "event_watcher observes the finality event" (~12 s per forward step, typically several steps of lag),
is_voted()was returningFalseand a redundant extrinsic was submitted on every step. This burned TAO fees on every affected swap and flooded logs with "already voted" rejections, masking legitimate failures.Test plan
tests/test_swap_tracker.pymark_voted/is_voted/prune_stale_voted_idsround-trip tests passuv run pytest tests/confirm_swaportimeout_swapthe swap is not re-submitted on the next forward step beforeevent_watcherfires