fix(dex - Certik): schedule both GoodTil delays when height and time are set#137
Open
metalarm10 wants to merge 3 commits into
Open
fix(dex - Certik): schedule both GoodTil delays when height and time are set#137metalarm10 wants to merge 3 commits into
metalarm10 wants to merge 3 commits into
Conversation
ysv
approved these changes
Jun 1, 2026
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.
Closes: https://app.clickup.com/t/868jnp17x
Summary
delayGoodTilCancellationused anif/returnchain that registered only the height-based delay when bothGoodTilBlockHeightandGoodTilBlockTimewere set on the same order. Orders then remained matchable past their declaredGoodTilBlockTimeuntilGoodTilBlockHeightwas reached.Replaced with parallel
ifblocks matchingremoveGoodTilDelay's existing structure. Both delays are now scheduled when both fields are set; whichever fires first cancels the order, and the second cleanup becomes a no-op against the missing KV key.Refs: CertiK Submission no:2 - accepted as Low severity.
Test & Verification
no_match_with_good_til_block_time_before_height_cancel_by_timeexercises the time-before-height case (time expires at block 103, height set to 200, endHeight=105 — order can only be canceled via the time-based path).TestKeeper_GoodTilsuite passes.git stashofgood_til.go) — confirms it specifically guards against this regression and isn't a false positive.Description
Reviewers checklist:
Authors checklist
This change is