Different slashing percentages for query and indexing disputes

Motivation

One of the security mechanisms in the Graph Network relies on filing disputes whenever an indexer presents a wrong proof of indexing or if it returns a query with inaccurate data.

After any participant files a dispute, the arbitrators will investigate if the dispute is valid according to the rules written in the Arbitration Charter. If they accept the dispute the offending indexer is slashed based on a governance parameter called slashingPercentage on their total stake.

The issue with having a single slashingPercentage parameter for both indexing and query disputes is that an indexer, in the regular day-to-day operation, will return a disproportionately higher amount of queries than indexing proofs. As a result, servicing queries is a higher-risk activity than indexing.

This proposal allows two different slashing percentages to balance the risk, one for indexing disputes and another for query disputes.

Implementation

The DisputeManager is the contract where actors in the protocol can create disputes about indexers misbehaving. There are two types of disputes: indexing and query ones. Indexing disputes are created based on one allocation that was closed with a wrong POI (proof of indexing) while query disputes are created presenting an attestation for a wrong query returned. After a dispute is created, the Arbitrator can resolve it and slash a percentage of the indexer’s stake.

The changes are implemented in the following PR: Disputes with separate slashing percentages for queries and indexing by abarmat · Pull Request #458 · graphprotocol/contracts · GitHub

Changes

  • Add a type to the dispute to categorize it when someone creates it.
  • Create new storage var for a separate indexer and query slashing percentages.
  • Add setters for each new slashing governance variable.
  • Pick the right slashing percentage when the dispute is resolved.
  • Additional minor refactors.

Audits

The code was audited by OpenZeppelin.

1 Like