graphprotocol / graphprotocol/contracts

Grace period after maxAllocationEpochs on closeAllocation by delegator

Open
#417 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

discussion
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:

  1. Effective allocation stops counting after maxAllocationEpochs.
  2. 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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.