The Graph Core Dev Call #31

CALL SUMMARY

Topic Details Covered
Substreams Codegen
2:15
Introduction
Overview of new tools for Substreams-powered subgraphs presented by StreamingFast.

Integration Modes
Describes the original and new trigger-based methods for integrating Substreams with Graph Node.

Development Environment
Introduction to a contained development environment for easy setup and coding with Substreams.

Demo and Features
Demonstrates how to build a Substreams project and highlights GUI improvements.

Local Development Setup
Explains how the development environment can be used locally.

Further Reading
Links to additional resources and documentation for Substreams Codegen.

Graph Horizon Overview
29:21
Progress & Updates
Introduction to the new data services protocol extending The Graph’s functionality.

Key Roles in Graph Horizon
Description of key roles such as Service Providers, Data Consumers, Payers, Receivers, and Delegators.

Staking and Provisions
Explanation of how Service Providers stake GRT and manage provisions within the protocol.

Service Registration and Payment Flow
Details on registering services and handling payments within Graph Horizon.

Delegation Mechanics
Overview of how Delegators contribute to network security and earn rewards.

Governance and Security Standards
Governance’s role in setting standards for collateralization and security within Graph Horizon.

The Subgraph Service (GIP-0068)
49:30
Introduction and Transition
Introduction to the new Subgraph Service and how Indexers transition to it.

Key Functionalities and Stake Management
Explanation of indexer registration, stake management, and payment processes.

Allocation Management
Details on long-lived allocations and the process of posting Proofs of Indexing (POIs).

Query Fees and Collateralization
Overview of how query fees are processed and collateralized within Graph Horizon.

Dispute Resolution
Introduction of the new Dispute Manager contract and how disputes are handled.

Transition and Backward Compatibility
Transition details from the current protocol to Graph Horizon, ensuring backward compatibility.

Conclusion
Summary of the comprehensive framework proposed by GIP-0066 and GIP-0068.


SUBSTREAMS CODEGEN
DEMO (2:15)

Core Devs call #31 featured a demo by StreamingFast, which presented new tools designed to streamline the onboarding process for developers working with Substreams-powered subgraphs. Over the past few months, efforts have focused on simplifying how developers create these subgraphs, which use the Substreams engine instead of the traditional JSON-RPC node to pull blocks in Graph Node.

The presentation highlighted two modes of integrating Substreams with Graph Node: the original method, where Substreams create entities directly under subgraphs, and a new, more flexible trigger-based integration. This new method allows subgraphs to trigger AssemblyScript code in a chain-agnostic way, handling data from any backend or blockchain.

A contained development environment was introduced, available in a public repository. This environment utilizes containers integrated with IDEs like VS Code, allowing developers to set up and start coding with just a single keystroke from their GitHub repository. The setup includes all necessary tools such as IPFS, Graph Node, a PostgreSQL database, and a custom Substreams extension, making it possible to work entirely in the cloud or locally.

A demo was provided to show how to initialize and build a minimal Substreams project, illustrating how the environment’s interactive prompts and pre-installed tools simplify the process. The demo also showcased improvements to the Substreams GUI, including block navigation, logging, and other features that enhance the development experience.

To further demonstrate the environment’s flexibility, the development setup was shown working locally. This setup simplifies common tasks, provides immediate feedback, and allows for extensive customization, making it easier to develop and deploy Substreams and subgraphs efficiently.

Find Out More About StreamingFast’s Latest Developments Here:

EXPLORE MORE UPDATES FROM STREAMINGFAST IN THE FORUM


GRAPH HORIZON
PROGRESS & UPDATES (29:21)

Overview of Graph Horizon

GIP-0066 introduces a new data services protocol designed to extend The Graph’s functionality beyond just subgraphs to include a variety of data services. This protocol is modular, composable, and permissionless, allowing different data services to integrate and operate within a unified framework.

Key Roles in Graph Horizon

  • Service Providers: Entities offering data services.
  • Data Consumers: Entities using these services.
  • Payers: Entities paying for the services, often intermediaries like gateways.
  • Receivers: Service providers receiving payments.
  • Delegators: Entities that stake GRT to support service providers.

Staking and Provisions

In this system, a Service Provider stakes GRT tokens, which are initially deposited in the staking contract without being immediately utilized. The provider then assigns part of their stake to a specific data service in what is called a “provision,” making this stake available for slashing if the service fails to meet certain criteria. This provisioned stake is what provides economic security for the service. Additionally, Service Providers have the flexibility to “deprovision” (withdraw) and “reprovision” (reassign) their stake to different data services as needed, ensuring dynamic management of their resources.

Service Registration and Payment Flow

After provisioning, the Service Provider registers with the data service for discoverability and setup, allowing them to start providing services to Data Consumers. Payments for these services are handled through a decentralized mechanism where the Service Provider collects receipts or vouchers, which can be redeemed for fees. These payment flows are facilitated by “payment collectors,” which are tailored to specific types of payments and closely tied to the data service and its design.

Delegation Mechanics

Delegators enhance the economic security of the network by contributing additional stake to Service Providers, earning a share of the rewards in return. Delegation is now service-specific, meaning Delegators must specify which data service they are supporting, providing greater control and security. Importantly, delegations are slashing-enabled with protections: a Service Provider’s entire stake is slashed before any Delegator stake is affected, ensuring that Delegators are only at risk if the Service Provider’s stake is completely depleted.

Governance and Security Standards

Graph Horizon redefines The Graph by supporting a broader range of data services, ensuring flexibility, security, and scalability while maintaining decentralized operations through a well-structured staking and payments framework. Governance plays a crucial role in setting standards, such as the stake-to-fees ratio, ensuring that all payments are adequately collateralized and secure.

JOIN THE DISCUSSION ON THIS GIP IN THE FORUM


SUBGRAPH SERVICE (GIP-0068)
SUBGRAPHS IN GRAPH HORIZON (49:30)

Introduction and Transition

GIP-0068 introduces the Subgraph Service, the successor to current subgraphs in Graph Horizon, designed to manage the indexing of subgraphs and serve queries within The Graph Network. This service allows Indexers, now also termed Service Providers, to transition smoothly from the existing staking contract to the new Subgraph Service contract without any service disruption.

Key Functionalities and Stake Management

Key functionalities include registering Indexers, managing allocations, and facilitating payment collection for indexing and serving queries. Indexers must register on the Subgraph Service by providing necessary metadata and staking a minimum of 100,000 GRT through Graph Horizon’s provisions. This stake acts as collateral and is subject to slashing if disputes arise.

Allocation Management

Allocation management has been enhanced, with Indexers allocating portions of their stake to specific subgraphs to earn rewards. These allocations are long-lived, meaning they can remain open indefinitely without the need to close and reopen every 28 days. Indexers collect indexing rewards by posting Proofs of Indexing (POIs) periodically. Failure to present a POI results in the allocation becoming stale, and no rewards are earned until a new POI is presented.

Query Fees and Collateralization

Query fees are processed through Graph Horizon’s payment protocol, and like indexing rewards, they are collateralized by stake. This ensures that all fees are adequately backed by staked GRT, with specific ratios set by governance to balance security and efficiency.

Dispute Resolution

The GIP also introduces a new Dispute Manager contract, which handles disputes related to indexing and query responses. Fishermen can raise disputes with a bond, and arbitrators, appointed by governance, determine the appropriate slashing amount, typically starting at 2.5% of the total stake. This new mechanism enhances security while allowing flexibility based on the context of each dispute.

Transition and Backward Compatibility

The transition from the current protocol to Graph Horizon involves moving Indexer registration from the Service Registry to the Subgraph Service, with allocations now managed by the Subgraph Service instead of the staking contract. Allocations no longer need to be closed every 28 epochs; instead, POIs are required every 7 or 14 days. Query fees will be collected with a stake-locking mechanism, and disputes will be handled by a new Dispute Manager with flexible slashing rules. Curation remains unchanged, with future adjustments to be addressed in separate initiatives.

To ensure backward compatibility, the GIP outlines a transition period during which legacy allocations managed under the current staking contract can be closed before fully adopting the Subgraph Service. Eventually, the Service Registry and the current Dispute Manager will be deprecated as the new system becomes fully operational.

Overall, GIP-0066 and GIP-0068 propose a comprehensive framework that integrates subgraph functionality into the broader data services protocol of The Graph Network, offering enhanced security, efficiency, and operational flexibility for Indexers and other network participants.

JOIN THE DISCUSSION ON THIS GIP IN THE FORUM


Stay Tuned!

Join us next month for Core Devs Call #32
Keep up to date by joining discussions in the forum, following The Graph on X or joining the Discord server!

1 Like