contracts icon indicating copy to clipboard operation
contracts copied to clipboard

Grace period after maxAllocationEpochs on closeAllocation by delegator

Open abarmat opened this issue 5 years ago • 1 comments
trafficstars

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.

abarmat avatar Nov 18 '20 15:11 abarmat

maybe. i am always against more params though, unless absolutely necessary.

my gut feeling is we could do without it. a rational indexer should just close on time. and the indexer agent should do it automatially (i think)

davekay100 avatar Nov 19 '20 21:11 davekay100