github graphprotocol/graph-tooling v0.16.0

latest releases: @graphprotocol/graph-cli@0.71.1, @graphprotocol/graph-ts@0.35.1, @graphprotocol/graph-cli@0.71.0...
4 years ago

Start block for data sources

Until now, subgraphs were always indexing from the genesis block. This involved scanning the entire chain for relevant blocks, logs and traces, even if the subgraph contracts were only deployed recently.

This was fine initially. However, with more expensive features—such as block and call handlers—being added and more advanced subgraphs being developed, it has often become desirable to skip irrelevant old blocks entirely to speed up indexing.

This is now possible. As of this release, data sources can specify an optional startBlock number in the manifest:

dataSources:
  - name: Gravity
    source:
      address: '0x2E645469f354BB4F5c8a05B3b30A929361cf77eC'
      abi: Gravity
      startBlock: 6000000

The subgraph will then start indexing from this block. If there are multiple data sources with or without start blocks, the earliest of these blocks is used as the starting point. The absence of a startBlock is equivalent to 0 (aka the genesis block).

Other changes

  • Fix exit codes used in graph deploy command.
  • Validate data source network fields. Data sources (and templates) must either have no network set or they must all use the same network value.
  • Dependency updates (glob, tern, jayson, graphql, yaml, eslint).

Don't miss a new graph-tooling release

NewReleases is sending notifications on new releases.