Proofs of Indexing and Subgraph Availability Oracle.
Proofs of Indexing and the Subgraph Availability Oracle were introduced to subsidize useful work in the network and to prevent economic attacks in which Indexers try to collect indexing rewards without having done the required work in the network. Such economic attack vendors could look the following way:
Proof of Indexing is therefore introduced to prevent attack vendor #1 and some instances #2. As of now, a signature over a message digest is used, which is generated when a subgraph is indexed from genesis. Likewise, the message digest is updated whenever the state of a subgraph is updated.
In order to claim their indexing rewards on a given subgraph, Indexers need to provide a recent Proof of Indexing (PoI). The PoI is computed from the signature of an Indexer, which is why it is necessary for Indexers to submit an individual PoI specific to them. Due to the competitive nature, Indexers are not incentivized to collude in helping each other generating correct PoIs without having done the work.
The Proofs of Indexing unlock rewards immediately, meaning they are accepted optimistically. However, it is possible to use these rewards to slash an Indexer later on, should the PoI be found to be formed incorrectly. The conditions for slashing an Indexer could include deterministically attributable faults such as:
Disputes will initially be decided by an Arbitrator who is appointed through governance. If a fault is not clearly attributable or the result of a software bug, the Arbitrator has the power to end disputes in a “draw.” Based on an arbitration charter and the protocol specifications, Arbitrators evaluate disputes and settle them.
Whether or not a subgraph manifest is available is completely subjective because of the speaker/listener fault equivalence. This is another type of fault but an Arbitrator cannot settle any of the other raised disputes for that subgraph if the subgraph manifest is not available. Likewise, it is not possible for other Indexers to compete for the indexing rewards of that particular subgraph.
To solve this issue, The Graph has introduced a Subgraph Availability Oracle, which is set through governance as well. To determine whether or not a subgraph manifest is available, the oracle looks at various prominent IPFS endpoints, like the Cloudflare IPFS Gateway. Should the subgraph manifest be not available, the subgraph is not eligible for the distribution of indexer rewards.