GIP-0028: Subsidized Query Settlement

Thank you all for the feedback about the proposal.

From the comments, the main concern is that an honest indexer doing everything right to serve queries, under some circumstances, will not receive any query fee, whether because of the indexer selection algorithm not picking it or the subgraph is still in the early stage.

I’m sharing an update to the original proposal with some changes to allow an indexer to self-sign a zero query voucher if they didn’t receive any query from the gateway.

Allow indexers to self-sign an empty voucher.

Indexers need to be able to collect a voucher to unlock indexing rewards. To break any relationship with the gateway, they could self-sign an empty voucher when they cannot get one with query fees.

It requires:

  • Deploy an updated AllocationExchange (let’s call it VoucherCollector ) that only accepts zero-fee vouchers.
  • The VoucherCollect will use the interface for redeeming as the AllocationExchange.
  • The VoucherCollector needs to be different than the one holding the funds. The former is only for self-signed empty vouchers.
  • Allow the VoucherCollect as an asset holder in the Staking contract so it can call collect().
  • Configure the VoucherCollector with a shared private key that any indexer can use to sign their empty vouchers.

Allow the Staking contract to collect zero query fees.

  • Update the Staking contract to accept calls to collect with query = 0. This function currently reverts under that condition.
  • Whenever collect() is called on an allocation, flag it to be eligible to release indexing rewards.

Release rewards only if the indexer called collect at least once.

  • During a call to the rebates claim, test if the allocation had the collect function called, then release the indexing rewards if true. The number of query fees collected does not matter, as zero will be an accepted value.

Additional thoughts

The VoucherCollect matches the same interface of the AllocationExchange to make it easier to reason and use by clients.

Also, redeeming from VoucherCollect needs to consume roughly the same gas as calling the AllocationExchange to avoid defaulting to the former when query fees are too low.

Finally, another way to design the VoucherCollector is to just create a contract that supports both types of vouchers (self-signed and gateway signed) to avoid adding more moving parts.

Open for comments!

6 Likes