Skip to content

fix: stop direct closes from cancelling live agreements#1246

Merged
MoonBoi9001 merged 4 commits into
main-dipsfrom
mb9/warn-when-closing-deployments-with-indexing-agreements
Jul 11, 2026
Merged

fix: stop direct closes from cancelling live agreements#1246
MoonBoi9001 merged 4 commits into
main-dipsfrom
mb9/warn-when-closing-deployments-with-indexing-agreements

Conversation

@MoonBoi9001

@MoonBoi9001 MoonBoi9001 commented Jul 10, 2026

Copy link
Copy Markdown
Member

This PR makes graph indexer allocations close refuse to close an allocation whose indexing agreement (DIPS) can still collect fees, unless --force is passed. The queued path already had this protection: queueing an unallocate rejects the action with an explanation when a collectable agreement exists. The direct close mutation had no such check and went straight to the on-chain transaction, and since the network cancels an allocation's active agreement as part of the close, the unguarded door could silently end a paid agreement.

The check now lives in 1 shared function, assertSafeToCloseAllocation, called by both the action validation (behavior unchanged, existing tests still pass) and the closeAllocation mutation (new behavior, covered by new tests). Forcing past the guard logs a warning, matching the queued path, and the close command's --force help text now says so. The CLI also translates the network's own close-guard revert (SubgraphServiceAllocationHasActiveAgreement) into the rules never command that resolves it, instead of printing a raw revert string. Companion to #1245, which keeps the post-close never rule off DIPS-managed deployments.

The network cancels an allocation's active indexing agreement as part of the close, but the
CLI never mentioned it. Closing or queueing an unallocate on a DIPS-managed deployment now
prints what happens and the command to opt out or back out; close-guard reverts translate too.
@github-project-automation github-project-automation Bot moved this to 🗃️ Inbox in Indexer Jul 10, 2026
CI verifies formatting with a diff check; the new module's import line was eslint-clean but
not prettier-formatted.
Queueing an unallocate already refuses when the allocation's DIPS agreement can still
collect fees unless force is set, but the closeAllocation mutation went straight to the
on-chain transaction. The check now lives in 1 shared function that both paths call.
The queue and close warnings duplicated the shared guard's rejection, which already reaches
the terminal as the mutation error. What remains is translating the network's close-guard
revert into the rules never command that resolves it.
@MoonBoi9001 MoonBoi9001 changed the title feat: tell operators when a close affects an indexing agreement fix: stop direct closes from cancelling live agreements Jul 10, 2026
@github-project-automation github-project-automation Bot moved this from 🗃️ Inbox to ✅ Approved in Indexer Jul 10, 2026
@MoonBoi9001
MoonBoi9001 merged commit aefddf6 into main-dips Jul 11, 2026
11 checks passed
@MoonBoi9001
MoonBoi9001 deleted the mb9/warn-when-closing-deployments-with-indexing-agreements branch July 11, 2026 04:19
@github-project-automation github-project-automation Bot moved this from ✅ Approved to 🚗 Merged in Indexer Jul 11, 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