owned this note
owned this note
Published
Linked with GitHub
# Indexing additional chains on the network
## Introduction
This document outlines in detail some of the considerations & discussions behind the Epoch Block Oracle GIP.
## Considerations
There are a few technical approaches which can enable support for new indexed chains on The Graph Network. In choosing between them, it is important to state the decision-making criteria.
- **Upfront work**: what initial work is required?
- **Adding new chains**: what must be done to add an incremental chain?
- **Decentralisation**: what trust assumptions does it introduce, and what is the path to decentralisation?
- **Operational cost**: what is the ongoing cost to operate this solution (for an altruistic trusted actor)
- **Indexer cost**: is there any change in costs for indexers?
- **Legibility**: is the resulting system easy to understand, interrogate and reason about?
- **Data freshness**: does it make any changes to the freshness of indexed data?
The highest priority criterion is the ability to quickly & simply add new indexed chains. A centralised Oracle approach has been agreed as the necessary starting point in order to do that. A key priority will be a path or a plan to increased decentralisation over time.
There are still a range of potential approaches:
### Protocol Chain Epoch Oracle
Create an Oracle contract on the Protocol chain, updated by an Owner, which provides the EpochBlock for all supported networks. Per an update to the Arbitration Charter, Indexers close allocations using the latest available EpochBlock for the indexed network.
This replicates the existing setup for subgraphs indexing Ethereum mainnet for new indexed chains, while introducing a new Trusted actor (the Owner of the Oracle, which would be decentralised over time).
It introduces an ongoing cost to keep the Oracle up to date, and does nothing to improve data freshness.
### Arbitrator verification
Indexers can close allocations with a recent block for an indexed chain: the recency requirement is specified by the Arbitration Charter. The Arbitrator is responsible for identifying bad actors (identifying when allocations have been closed with POIs from insufficiently recent blocks on the indexed chain).
This is very simple for all participants apart from the Arbitrator, whose monitoring role is significantly complicated.
This approach could be enhanced by introducing **anchoring of POIs by Indexers on the Indexed chain**: calling a contract or account with the POI for a recent block in the calldata.
This increases the legitimacy of arbitration on the basis data freshness, changing the Arbitrator's responsibility from identifying whether an allocation was closed with a sufficiently recent POI, to identifying whether an allocation was closed sufficiently soon after a recent block was anchored on the Indexed chain (where the recency of that block can be verified definitively on the indexed chain).
However it introduces ongoing operational requirements:
- The Arbitrator will need to index all subgraphs, in order to cross-check the arbitrary blocks chosen for closure based on recency
- Deploying a contract or establishing an equivalent setup on each new indexed chain (which the Indexers would "send" their POIs to)
- Monitoring that setup on every chain
- Indexers most hold funds and manage wallets on all the chains they wish to index, to make transactions
It also requires updating the PoI format to be be self-contained with all the necessary metadata signed off-chain (currently the signature is implicit as the Indexer submits the PoI as part of an Ethereum transaction).
### Comparison
| | Epoch Oracle | Arbitrator verification | Arbitrator verification with anchors |
|------------------------|-----------------------------------------------------------------|--------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------|
| **Upfront work** | Deploying the oracle, setting up the Owner, updating network and indexer components | Scaling up the Arbitrator, updating network and indexer components | Scaling up the Arbitrator, establishing a setup for anchors on each protocol, updating network and indexer components |
| **Adding a new chain** | Add to Oracle | Abitrator set up to monitor new chain | Abitrator setup, Deployment on indexed chain |
| **Decentralisation** | New trusted actor, decentralised over time | Increased responsibility of the Arbitrator. Could evolve to a bridging solution over time. | Increased responsibility of the Arbitrator. Could evolve to a bridging solution over time. |
| **Operational cost** | Oracle gas costs, RPC costs | Arbitrator workload increases | Arbitrator workload increases |
| **Indexer cost** | No change | No change | Transactions on the indexed chain |
| **Legibility** | Matches current setup | Less legible without additional tooling | Less legible without additional tooling |
| **Data freshness** | No change | Can be introduced, but hard work to monitor and enforce | Can be introduced, easier to monitor (given setup work) |
## Decision
The Epoch Oracle is the simplest approach. Since we can expect the network as a whole to change over the coming months given the planned move to L2, this is a key decision-making factor, so we will proceed with an Epoch Oracle.
# Copyright Waiver
Copyright and related rights waived via [CC0](https://creativecommons.org/publicdomain/zero/1.0/).
# References
[Cross-chain POI (Nov 2021)](https://www.notion.so/Cross-chain-PoI-c9da4a8ea4104b2d93b2e79ca954155b)
[Multiblockchain POI (Feb 2022)](https://whimsical.com/multiblockchain-poi-RTse7vNqCfXmzcLpJ5dX9c)
[Forum discussion](https://forum.thegraph.com/t/require-that-more-recent-pois-are-submitted-in-order-to-collect-indexing-rewards-multi-blockhain-pois/2500)