Consider rewards denial when closing allocations
Background
Currently the indexer-agent does not consider whether a subgraph deployment has been denied rewards when closing an allocation. The agent does consider the deniedAt field when evaluating when a deployment is worth allocating towards, but does not consider it when closing. In most cases this behavior works well, but the subgraph availability oracle is not perfect and sometimes it denies rewards incorrectly. In those cases the indexer-agent should hold off on closing the allocation until the rewards are no longer denied.
Solution
Let's discuss what we think is the desired behavior. I'll present a few proposals to kick off discussion.
-
Use
requireSupportedto decide whether to auto close or not; require manual intervention to close denied subgraphs withrequireSupported= true. In the case ofrequireSupported= true and deniedAt is not null, the agent will log a warning and not add anything to the queue. In order to close the allocation the indexer will need to either: updaterequireSupportedto false on the matching indexing rule, or manually queue an execute the action. -
Always add the action to the queue (instead of just logging in some cases like above), and use the
requireSupportedvalue and the allocation management mode value to decide how it gets added to the actions queue. These unallocate actions in the queue should be clearly marked in some way so indexer can see that they will not collect rewards if executed.requireSupported allocationManagement agent action true auto Add unallocate action to the queue with status = queued, clearly label action as not receiving indexing rewards true oversight Add unallocate action to the queue with status = queued, clearly label action as not receiving indexing rewards true manual Do not add action to the queue false auto Add unallocate action to the queue with status = approved false oversight Add unallocate action to the queue with status = queued false manual Do not add action to the queue