# GIP-0007: Different slashing percentages for query and indexing disputes

**URL:** <https://forum.thegraph.com/t/gip-0007-different-slashing-percentages-for-query-and-indexing-disputes/2020>\
**Category:** Graph Improvement Proposals (GIP)\
**Tags:** protocol-gov\
**Created:** [May 21, 2021, 6:06pm UTC](https://forum.thegraph.com/t/gip-0007-different-slashing-percentages-for-query-and-indexing-disputes/2020 "2021-05-21T18:06:47Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ari](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.thegraph.com/ari/32/2747_2.png) [@ari](https://forum.thegraph.com/u/ari)\
**Post date:** [May 21, 2021, 6:06pm UTC](https://forum.thegraph.com/t/gip-0007-different-slashing-percentages-for-query-and-indexing-disputes/2020/1 "2021-05-21T18:06:47Z")

</div>

## 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](https://github.com/graphprotocol/contracts/pull/458)

## 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.

> **[The Graph - Slashing Upgrade Audit - OpenZeppelin blog](https://www.openzeppelin.com/news/thegraph-slashing-upgrade-audit)**
>
> The Graph team asked us to audit an upgrade of the DisputeManager contract that adds separated slashing percentages to indexing and query disputes.
