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

state, workers: allow for actively-managed historical state #877

Merged
merged 2 commits into from
Jan 6, 2025

Conversation

akirillo
Copy link
Contributor

@akirillo akirillo commented Jan 3, 2025

This PR tweaks the state & API code paths dependent on historical state being enabled. We allow for tracking "actively-managed historical state," i.e. historical state pertaining to objects (order metadata, tasks) which may still be updated by the relayer. Concretely, this means:

  • Tasks
    • We continue streaming task status updates over websocket via both the task status and task history topics. We continue to enable the task history topic since it is a reliable source of all task status updates for a given wallet.
    • We do not write tasks to the task history table if historical state is disabled.
  • Orders
    • We now allow writing to / reading from the order history table even if historical state is disabled. However, if historical state is disabled we remove orders from the table once they reach a terminal state.
    • This allows us to continue streaming order metadata updates over the associated websocket topic

Testing

Sorry, something went wrong.

@akirillo akirillo force-pushed the andrew/actively-managed-state branch from d557fef to 6a5d49f Compare January 3, 2025 19:27
@akirillo akirillo requested a review from joeykraut January 3, 2025 21:20
@akirillo akirillo self-assigned this Jan 3, 2025
@akirillo akirillo added the enhancement New feature or request label Jan 3, 2025
@akirillo akirillo marked this pull request as ready for review January 3, 2025 21:21
@akirillo akirillo force-pushed the andrew/actively-managed-state branch from 6a5d49f to ab293ef Compare January 5, 2025 00:40
@akirillo akirillo marked this pull request as draft January 5, 2025 01:31
@akirillo akirillo force-pushed the andrew/actively-managed-state branch from d3ff7a0 to a96ab24 Compare January 6, 2025 19:47
@akirillo akirillo marked this pull request as ready for review January 6, 2025 19:47
@akirillo akirillo force-pushed the andrew/actively-managed-state branch from a96ab24 to 24289ba Compare January 6, 2025 20:47
@akirillo akirillo merged commit 8dae6ec into main Jan 6, 2025
3 of 4 checks passed
@akirillo akirillo deleted the andrew/actively-managed-state branch January 6, 2025 21:42
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

Successfully merging this pull request may close these issues.

None yet

2 participants