Skip to content

fix: stop closing allocations the operator just recreated#1243

Merged
MoonBoi9001 merged 2 commits into
main-dipsfrom
mb9/skip-allocation-close-when-rule-flipped-to-allocate
Jul 10, 2026
Merged

fix: stop closing allocations the operator just recreated#1243
MoonBoi9001 merged 2 commits into
main-dipsfrom
mb9/skip-allocation-close-when-rule-flipped-to-allocate

Conversation

@MoonBoi9001

@MoonBoi9001 MoonBoi9001 commented Jul 8, 2026

Copy link
Copy Markdown
Member

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.


image

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.
@github-project-automation github-project-automation Bot moved this to 🗃️ Inbox in Indexer Jul 8, 2026
@MoonBoi9001
MoonBoi9001 marked this pull request as draft July 8, 2026 13:25
@MoonBoi9001
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.
@github-project-automation github-project-automation Bot moved this from 🗃️ Inbox to ✅ Approved in Indexer Jul 10, 2026
@MoonBoi9001
MoonBoi9001 merged commit f2a1948 into main-dips Jul 10, 2026
11 checks passed
@MoonBoi9001
MoonBoi9001 deleted the mb9/skip-allocation-close-when-rule-flipped-to-allocate branch July 10, 2026 15:00
@github-project-automation github-project-automation Bot moved this from ✅ Approved to 🚗 Merged in Indexer Jul 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: 🚗 Merged

Development

Successfully merging this pull request may close these issues.

2 participants