graphprotocol / graphprotocol/contracts
Grace period after maxAllocationEpochs on closeAllocation by delegator
Nobody has claimed this yet.
- Dominant language
- Solidity
- Stars
- 374
- Forks
- 176
- Avg merge
- 1d 15h
- Merged PRs (30d)
- 4
Description
closeAllocation() is the function that allows unallocating tokens assigned to a particular subgraph and eventually collecting all funds from state channels.
To avoid an indexer never closing an allocation and as a consequence never distributing the funds, we allow delegators to force close an allocation after maxAllocationEpochs.
An indexer would want to close the allocation before maxAllocationEpochs. It has two incentives to do so:
- Effective allocation stops counting after maxAllocationEpochs.
- If a delegators close the allocation a POI won't be able to be presented and no rewards are distributed.
I wonder if it is a good idea to also include a grace period after maxAllocationEpochs to detach these two times.
- indexers can close any time
- soft penalty: no effective allocation is counted after maxAllocationEpochs
- hard penalty: delegators can force close after maxAllocationEpochs + gracePeriod
For simplicity we can keep only maxAllocationEpochs and then add a grace period if necessary.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing closeAllocation() and the existing maxAllocationEpochs behavior described in the issue. Determine how a grace period would separate the soft and hard penalties, then document the decision and any required contract changes; the issue is complete when the behavior and scope are agreed.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- solidity
- Domain
- blockchain
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100