subgraphs icon indicating copy to clipboard operation
subgraphs copied to clipboard

feat(#major); balancer-forks; subgraph optimizations

Open dhruv-chauhan opened this issue 1 year ago • 3 comments

  • Huge arrays in beethoven-x-fantom deployment causing issues for other subgraphs in the shard.
  • The protocol._poolIds array with length > 2000 should be causing the stated issue. We can use .load() on derivedFrom entity Pool instead. query. Other arrays are either defined as derivedFrom fields or their lengths are bound by input tokens length.
  • Test deployment: https://okgraph.xyz/?q=dhruv-chauhan%2Fbeethoven-x-fantom
  • Other affected subgraphs:
    • https://okgraph.xyz/?q=dhruv-chauhan%2Fbeethoven-x-optimism
    • https://okgraph.xyz/?q=dhruv-chauhan%2Fbalancer-v2-arbitrum
    • https://okgraph.xyz/?q=dhruv-chauhan%2Fbalancer-v2-polygon
    • https://okgraph.xyz/?q=dhruv-chauhan%2Fbalancer-v2-ethereum

dhruv-chauhan avatar Feb 20 '24 13:02 dhruv-chauhan

Build is failing with error,

stdout: ERROR TS2339: Property 'loadRelated' does not exist on type '~lib/@graphprotocol/graph-ts/index/store'.

     let value = store.loadRelated(this._entity, this._id, this._field);
                       ~~~~~~~~~~~
 in generated/schema.ts(3402,23)

loadRelated method (= .load() on derivedFrom entity) became available starting graph-node v0.31.0, @graphprotocol/graph-ts v0.31.0, and @graphprotocol/graph-cli v0.51.0. I suspect some of these packages are not updated in the build checker.

dhruv-chauhan avatar Feb 20 '24 18:02 dhruv-chauhan

@dhruv-chauhan I see a new error now

Screenshot 2024-02-22 at 3 24 20 PM

melotik avatar Feb 22 '24 22:02 melotik

@dhruv-chauhan can you make sure to use:

indexerHints:
   prune: auto

wherever possible in subgraphs going forward.

https://thegraph.com/docs/en/developing/creating-a-subgraph/#the-subgraph-manifest

melotik avatar Feb 27 '24 17:02 melotik