Skip to content
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

feat: posted order lru cache #56

Open
1 task
mfw78 opened this issue Sep 25, 2023 · 0 comments
Open
1 task

feat: posted order lru cache #56

mfw78 opened this issue Sep 25, 2023 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@mfw78
Copy link
Contributor

mfw78 commented Sep 25, 2023

Problem

As there is no method available for the conditional order to tell the watch-tower what action to take when the order is already in the order book, this may result in continually polling each block / spamming the API endpoint.

Suggested solution

Until cowprotocol/composable-cow#74 is complete, we can at least save on spamming the order book by maintaining an LRU cache of orderUids that have been submitted. If we poll and get a duplicate orderUid that's sitting in the LRU cache, we simply don't post it.

Alternatives considered

A full implementation of cowprotocol/composable-cow#74, however there is likely some other underlying work that would be done around the polling to unify/refactor the interfaces. This would be implemented at the ComposableCoW, and not the smart order as such (to maintain the single entry-point multiplexing), and therefore is for a later revision.

Acceptance criteria

  • Implemented an LRU cache to reduce pressure on the order book.
@mfw78 mfw78 added the enhancement New feature or request label Sep 25, 2023
@mfw78 mfw78 self-assigned this Sep 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant