fix: stop closing allocations the operator just recreated#1243
Merged
MoonBoi9001 merged 2 commits intoJul 10, 2026
Merged
Conversation
The reconcile loop executes allocation decisions computed from a rules snapshot up to several polling intervals old, so it closed allocations operators had just recreated. Closes decided by an opt-out rule now re-check the live rule and skip when it requests allocation.
MoonBoi9001
marked this pull request as draft
July 8, 2026 13:25
MoonBoi9001
marked this pull request as ready for review
July 9, 2026 04:08
The guard treats never and offchain opt-out decisions identically, but only the never path had a direct test; the incident itself came through offchain. 1 test replays that flavour.
Maikol
approved these changes
Jul 10, 2026
MoonBoi9001
deleted the
mb9/skip-allocation-close-when-rule-flipped-to-allocate
branch
July 10, 2026 15:00
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.
The indexer-agent opens and closes allocations by following operator rules. Close decisions were computed from an outdated copy of those rules, so when an operator closed and recreated an allocation, the agent could execute the stale decision and close the fresh one. Closes caused by an opt-out rule now re-check the live rule first.
Observed in local-network DIPs testing: the agent closed a freshly recreated allocation about 15 seconds after its creation, which cascaded into rejected payment proposals. Preventing the wrong close is the only complete fix here, because the network settles an allocation's active indexing agreement inside the close transaction itself (SubgraphService cancels the agreement, or reverts the close when its guard is enabled); once a stale close executes, the agreement is already gone. PR #1245 limits the aftermath separately by keeping the post-close never rule off DIPS-managed deployments, so a close no longer blocks the deployment's future proposals.
The re-check applies only to closes that a never or offchain rule decided; closes for denied deployments, invalid amounts, or the deliberate never-allocate override on the network subgraph proceed unchanged, and 7 new unit tests pin each case. A smaller window remains between queueing and executing a close.