Fix supervisor: report vault execution so stuck-scan order isn't fixed#187
Draft
Fix supervisor: report vault execution so stuck-scan order isn't fixed#187
Conversation
added autobalancer callback to find potentially stuck vaults
a6cce3f to
b2af175
Compare
This file contains hidden or 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
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.
Closes: #177
waiting for this to merge: onflow/FlowActions#139
for now testable with:
(cd lib/FlowALP/FlowActions && git checkout holyfuchs/autobalancer-callback)
Description
The supervisor “check the first N vaults” logic was fixed: vault executions are now reported to the registry, which keeps an ordered list of “least recently executed” vaults. The supervisor then scans only those first N (e.g. 5) and recovers the ones that are actually stuck, instead of always the same fixed set.
What was implemented
Execution callback
Each AutoBalancer now has an execution callback that runs after a scheduled rebalance. The callback calls the registry with that vault’s id so the registry can update its internal order (remove id from the list, append to the end).
Shared callback resource
In
FlowYieldVaultsAutoBalancers, a singleRegistryReportCallbackresource per account implementsDeFiActions.AutoBalancerExecutionCallback. ItsonExecuted(balancerUUID)calls the registry so the vault that just ran is reported by id. Every new AutoBalancer gets a capability to this shared callback and passes it tosetExecutionCallback(cap).Context (from discussion)
The supervisor was limited to processing a small batch (e.g. first 5 vaults) per run. The agreed short-term approach was to order the vault list by “last executed” so the supervisor always checks the oldest / least recently executed vaults first (most likely stuck).