-
Notifications
You must be signed in to change notification settings - Fork 138
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
Actions queue #419
Actions queue #419
Conversation
2239dcd
to
490c381
Compare
6c908a7
to
259d0c2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey Ford! This PR is amazing! 😻 A ton of refactoring and design. Thank you so much! I have a few comments for you, other than that, the manual mode of action queue works amazingly with the optimizer
packages/indexer-common/src/indexer-management/models/action.ts
Outdated
Show resolved
Hide resolved
packages/indexer-common/src/indexer-management/models/action.ts
Outdated
Show resolved
Hide resolved
- Add action queue models and resolvers to indexer-common - Add actions module to indexer-cli - Add actions worker that polls and executes approved action queue items - Include validation of action queue inputs - Provide control of allocation management via AlloctionManagementMode enum (AUTO | MANUAL | OVERSIGHT)
- Auto created indexing rules were setting a nonexistent property amount where it should be allocationAmount - Several typos were fixed in the logs - Additional information is now included in the multicall tx logs so indexers don't have to search the logs for type and deployment target for the various actions being executed
- Create and use findEvent function to find the expected events in the event logs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM:)
Just a small question about ActionType.collect
that was previously considered, I guess we don't need it since the worker will handle it along with unallocate and reallocate?
packages/indexer-common/src/indexer-management/resolvers/allocations.ts
Outdated
Show resolved
Hide resolved
Yeah, collect is just always performed after a successful unnallocate or reallocate action. |
- Simply truncate the models after each test instead of recreating the server - Provide control of log level via LOG_LEVEL env var
Background
The action queue aims to decouple action execution from decision making, provide oversight of decisions to indexers, and provide a more clear delineation of concerns in the software. The indexer management server will handle external interactions (data fetching and executing actions) while the indexer agent will be focused on managing the reconciliation loop decision making process and ongoing management of allocations. By moving transaction execution and data fetching to the indexer management server, providing the option to turn off the agents allocation management, and providing an allocation management interface hosted by the the indexer management server we open up the design space for 3rd party decision making software to replace or supplement the indexer-agent.
Changes Summary
items
oversight
allocation management mode to the indexer-agent (description below)Usage
The action execution worker will only grab items from the action queue to execute if they have
ActionStatus
=approved
. In the recommended path actions are added to the queue withActionStatus
=queued
, so they must then be approved in order to be executed on-chain. The indexer-agent now has 3 management modes (set using--allocation-management
orINDEXER_AGENT_ALLOCATION_MANAGEMENT
):auto
,manual
, andoversight
.Allocation management modes:
auto
: The indexer-agent will act similarly to the current paradigm. When it identifies allocation actions it will add them to the queue with ActionStatus =approved
and the execution worker process will pick it up within 30 seconds and execute it.manual
: The indexer-agent will not add any items to the action queue in this mode. It will host the indexer-management server which can be interacted with manually or integrated with 3rd party tools to add actions to the action queue and execute them.oversight
: The indexer-agent will add run its reconciliation loop to make allocation decisions and will add proposed actions to the action queue withActionStatus = queued
. These actions will then require approval before they will be executed.Actions CLI
An actions module has been added to the indexer-cli for interacting with the actions queue.