Fix sandbox IOC cancel after local accept#4113
Closed
Jonah-Chan wants to merge 1 commit into
Closed
Conversation
090b9c5 to
b66414b
Compare
Constraint: Sandbox matching can accept an IOC limit order and immediately evaluate the no-match cancel path in the same call stack. Rejected: Canceling from the pre-accept local order state | initialized orders are local-only and cancel_order intentionally refuses them. Confidence: high Scope-risk: narrow Directive: Matching-engine paths that emit an order state event and then continue processing must use state that has observed the emitted event. Tested: cargo test -p nautilus-execution --test matching_engine test_process_ioc_limit_order_without_immediate_match_emits_cancel Tested: cargo test -p nautilus-execution --test matching_engine test_process_limit_order_matched_immediate_fill Tested: cargo test -p nautilus-execution --test matching_engine test_ioc_order_canceled_when_liquidity_consumption_exhausts_fills Tested: cargo fmt --check --package nautilus-execution Tested: git diff --check Not-tested: full workspace test suite Co-authored-by: OmX <omx@oh-my-codex.dev>
b66414b to
1f0909b
Compare
Member
|
Thanks @Jonah-Chan, closed per b69bade. |
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
OrderAcceptedto the local sandbox order before continuing same-call-stack matching-engine handling.OrderAcceptedfollowed byOrderCanceled.Fixes #4112.
Why
accept_orderpreviously dispatched the accepted event without updating the mutable localOrderAny. In the IOC/FOK no-immediate-match branch,process_limit_ordercould then callcancel_orderwith an order still inINITIALIZED, which logsCannot cancel an order with INITIALIZED from the matching engineand drops the cancel event.Tests