Skip to content
This repository has been archived by the owner on Oct 11, 2024. It is now read-only.

orderwatch: Check for stale removed orders more frequently #471

Merged
merged 8 commits into from
Oct 25, 2019

Conversation

fabioberger
Copy link
Contributor

@fabioberger fabioberger commented Oct 24, 2019

Fixes: #459

This PR:

  • Adds a process to OrderWatcher that checks for orders that have been flagged for removal and should now be permanently deleted every 5 minutes.
  • Stops updating an order DB entry's lastUpdatedTime when the entry is in-fact not updated (i.e., when we revalidate the order but no change to fillability was found). This could cause an order from a particularly active maker to stick around indefinitely despite being expired/cancelled/fullyFilled, because the changes in the maker's balance would cause this order to constantly be re-validated and it's lastUpdatedTime to constantly get bumped up.
  • Slightly increases permanentlyDeleteAfter to 25 block depth to account for us flagging an order for removal due to UTC expiry, but it still potentially getting filled/cancelled a few blocks after. This adjustment is out of extreme caution.

zeroex/orderwatch/order_watcher.go Show resolved Hide resolved
zeroex/orderwatch/order_watcher.go Outdated Show resolved Hide resolved
zeroex/orderwatch/order_watcher.go Outdated Show resolved Hide resolved
zeroex/orderwatch/order_watcher.go Show resolved Hide resolved
@albrow albrow self-requested a review October 24, 2019 22:52
Copy link
Contributor

@albrow albrow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just one small comment and other than that looks good to me!

…marked for removal and should be permanently deleted
…te-change found when re-validating. Otherwise, a `removed` order can stick around forever if it's maker keeps transferring their excess balance for example
…rs to account for cases where order is flagged for removal due to UTC expiration and might still get filled/cancelled slightly after
@fabioberger fabioberger force-pushed the feature/pruneRemovedMoreFrequently branch from cf5ab8f to ac2ed19 Compare October 25, 2019 21:58
@fabioberger fabioberger merged commit 760c1cb into development Oct 25, 2019
@fabioberger fabioberger deleted the feature/pruneRemovedMoreFrequently branch October 25, 2019 22:07
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants