GGP: 0012 Scope: Staking contract Created: GIPs-Repo-Latest-Commit: 9385b40faedd77c9af14eb6703b9c3f459e30949
GIP: 0027 Title: Create altruistic allocations and close stale allocations Authors: Ariel Barmat ariel@thegraph.com , Sam Green sam@semiotic.ai Created: 2022-03-24 Stage: Candidate Discussions-To: https://forum.thegraph.com/t/gip-0027-create-altruistic-allocations-and-close-stale-allocations/3217
Provide a mechanism so that indexers can opt-out of indexing rewards by allocating zero tokens to a subgraph. This would be useful for an indexer who wants to altruistically serve queries. In addition, this implementation allows the public to close stale allocations after the max allocation period, however, nobody can close an altruistic allocation.
Stale allocations affect the stability of the network when an indexer that has a big proportional allocated stake on a subgraph does not keep it active, as other indexers won’t want to allocate if it already has a big allocation. Stale allocations also reduce the speed of how value flows through the protocol, reducing the frequency at which curators and delegators get their share of rewards and fees. Currently, delegators of an indexer are the only ones who can close stale allocations, but this is an unnecessary validation considering that anyone could turn into a delegator, even with the smallest amount of tokens, and then close it. For a summary of the current stale allocation statistics, see the “Allocation Age” histogram here: Dune 3.
Today, indexers must allocate more than zero tokens. However, indexers might want to index and serve queries on a particular subgraph altruistically by opting out of rewards. Today indexers can serve queries altruistically by presenting an empty PoI on closeAllocation, however, this is not efficient because they must still pay Ethereum transaction fees to “refresh” (i.e., close and re-open) their allocations. By allowing altruistic indexers to allocate zero tokens, we can skip all the code paths for updating indexing rewards and provide a huge gas improvement.
Audit report: https://github.com/graphprotocol/contracts/blob/064d362af559b6ebb3df18634b0141f12ad0ed53/audits/ConsenSysDiligence/2022-03-graph-altruistic-alloc-and-query-versioning.pdf Implementations: https://github.com/graphprotocol/contracts/pull/549 Implementations latest commit-hash: e999cb6d210a85bfb074dfe814c5d4b2bf3e88c1
This proposal is to upgrade The Graph's protocol smart contracts running on Ethereum mainnet with the changes described in Graph Improvement Proposal (GIP) 0027, including the motivation and scope of the changes described in this proposal.
The code deployed that implements GIP-0027 must correspond to the commit hash included in the front matter of this governance proposal.
Following a successful "yes" vote, the protocol upgrade should be carried out at the earliest convenience using The Graph Council's Gnosis Multisig.