-
Notifications
You must be signed in to change notification settings - Fork 0
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: ebo processor event loop #27
Merged
Merged
Conversation
This file contains 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
GRT-58 Implement `start()` ( bootstrap & eventLoop)
Use an interval to handle events, and save the reference on a class attribute. https://www.figma.com/board/BbciqJb5spg35ZglTsRRBb/Offchain?node-id=239-2645&t=rxiyrWw25Xi7qLak-4 AC:
|
# 🤖 Linear Part of GRT-58 ## Description * Removes `onTerminate` callback from `EboActor` as this functionality will be handled by the `EboProcessor`. * Allows the `EboActorsManager` to build new actors while registering them inside its registry.
# 🤖 Linear Part of GRT-58 ## Description Periodic interval inside `EboProcessor` to process new events and forward them to actors.
# 🤖 Linear Part of GRT-58 ## Description * Check for finalizable request and _settleable_ disputes * Adds `createdAt` to all Prophet entities * Refactor `EboRegistry` getters to return arrays of entities instead of maps (we were always doing `.values()` or `.keys()`) **NOTE**: we might end up extracting some of the functionality added here into another service (some `TODO` comments were left there marking those places), but for the moment I prefer to have this working to reach the E2E stage with the core logic already developed. 👼
GRT-109 Implement checkRequestState
Flows and more details can be found on the Notion's Tech Design doc. |
# 🤖 Linear Closes GRT-58 ## Description * Changes `EboActor` public methods to only `enqueue` and `processEvents` * Enqueues corresponding events into a heap inside the `EboActor` instances to process them later * Creates a new interface `EboRegistryCommand` implementing the _Command_ design pattern to be able to rollback internal `EboActor` state if an RPC call fails after updating the state, simulating a "transaction". * Refactor actor creation to remove dependency with `protocolProvider` during this method ### EboActor processEvents flow ```mermaid flowchart LR start(((start))) peekNextEvent[Peek next event] noMoreEvents?{No more events?} updateActorState[Update actor state] rpcCall[Execute RPC] rpcFailed?{RPC failed?} rollbackStateUpdate[Rollback state update] popProcessedEvent[Pop processed event] _end(((end))) start-->peekNextEvent peekNextEvent-->noMoreEvents? noMoreEvents?-->|true|_end noMoreEvents?-->|false|updateActorState updateActorState-->rpcCall rpcCall-->rpcFailed? rpcFailed?-->|yes|rollbackStateUpdate rollbackStateUpdate-- Will retry during next periodic check -->_end rpcFailed?-->|no|popProcessedEvent popProcessedEvent-->peekNextEvent ```
0xkenj1
approved these changes
Sep 3, 2024
0xnigir1
approved these changes
Sep 3, 2024
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.
🤖 Linear
Closes GRT-58, GRT-109
Description
Feature PR, branched out of #26.
I'll open one PR per main task and merge them into this branch, so it's easier to review and work on changes.
EboActorManager
to also create actors andEboActor
constructor to stop asking foronTerminate
callback as it will be handled byEboProcessor
EboProcessor
main event loopEboActor
functions based onEboProcessor
main event loop needs