Skip to content

fix: close over-allocated allocations with collect and stopService - #1258

Open
cargopete wants to merge 1 commit into
graphprotocol:mainfrom
cargopete:pete/overallocated-close
Open

cargopete wants to merge 1 commit into
graphprotocol:mainfrom
cargopete:pete/overallocated-close

Conversation

@cargopete

Copy link
Copy Markdown
Contributor

Closing an allocation while the indexer is over-allocated leaves it open. The agent sends collect alone in that case, expecting the SubgraphService to force-close the allocation, but since the current SubgraphService implementation collect resizes it to zero instead. The transaction succeeds, no AllocationClosed is emitted, and the agent reports IE015. Operators see it after delegators undelegate: a batch where some allocations close and others stay open with zero tokens.

This drops the over-allocated branch added in #1154, so both the action queue (populateUnallocateTransaction) and the direct close resolver always multicall collect and stopService. stopService has no over-allocation guard and closes the downsized allocation normally.

Verified with a new unit test in unallocate.test.ts that fails on main. Against the contracts, a forge test from the over-allocated setup in indexing.t.sol confirms that collect alone leaves the allocation open at zero tokens and that multicall(collect, stopService) closes it. The live implementations on Arbitrum One and Arbitrum Sepolia match bytecode, so both already have the resize behaviour.

@github-project-automation github-project-automation Bot moved this to 🗃️ Inbox in Indexer Sep 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: 🗃️ Inbox

Development

Successfully merging this pull request may close these issues.

1 participant