fix: stop direct closes from cancelling live agreements#1246
Merged
MoonBoi9001 merged 4 commits intoJul 11, 2026
Merged
Conversation
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.
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.
Maikol
approved these changes
Jul 10, 2026
MoonBoi9001
deleted the
mb9/warn-when-closing-deployments-with-indexing-agreements
branch
July 11, 2026 04:19
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.
This PR makes
graph indexer allocations closerefuse to close an allocation whose indexing agreement (DIPS) can still collect fees, unless--forceis 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--forcehelp text now says so. The CLI also translates the network's own close-guard revert (SubgraphServiceAllocationHasActiveAgreement) into therules nevercommand that resolves it, instead of printing a raw revert string. Companion to #1245, which keeps the post-close never rule off DIPS-managed deployments.