Skip to content

chore(solver/svm): robust svm markfilled #4221

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

corverroos
Copy link
Collaborator

Make SVM Markfilled logic more robust:

  • Idempotent, so can always retry
  • Ensure markfilled in DidFill as well as Fill

issue: none

@corverroos
Copy link
Collaborator Author

This pull request introduces enhancements to the SVM order processing logic in the solver package, focusing on improving order status handling and ensuring proper synchronization between outbox and inbox states. The key changes include adding a new method to check if an order has been filled and enhancing the markFilledSVMOrder function to validate the order's status before marking it as filled.

Enhancements to order processing:

  • Added DidFill method to procDeps: Introduced a new DidFill method in svmProcDeps to check if an order is already filled in the outbox and ensure it is marked as filled in the inbox for synchronization. This method leverages the trusted SVM state to prevent redundant processing. (solver/app/svmproc.go, solver/app/svmproc.goR72-R99)

  • Improved order status validation in markFilledSVMOrder: Enhanced the markFilledSVMOrder function to include a status check using anchorinbox.GetOrderState. This ensures the order is only marked as filled if it is in a pending state, avoiding unnecessary operations for already processed orders. (solver/app/svmtypes.go, solver/app/svmtypes.goR159-R170)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants