graphprotocol / graphprotocol/graph-node

Prune Auto Issue

Open
#5,920 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

pruning question Stale
Dominant language
Rust
Stars
3.2k
Forks
1.1k
Avg merge
4d 1h
Merged PRs (30d)
1

Description

A user ran into this error after setting prune: auto in his manifest:

Failed to deploy to graph node 0.0.0.0:8020/: subgraph deployment error: store error: new row for relation "subgraph_manifest" violates check constraint "subgraph_manifest_history_blocks_check"

He is running graph-node 0.37.0 locally and does not have a min_history_blocks set in his environment variables. We may want to set this as a high number for a default figure (eg 100,000). Alternatively it might be better to remove the auto option and require the user state the specific history_blocks desired in the manifest.

https://github.com/graphprotocol/graph-node/blob/776afa14c324614abc84a72587f199cd7681153a/graph/src/data/subgraph/mod.rs#L603

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at graph/src/data/subgraph/mod.rs around line 603 and trace how prune:auto determines history_blocks when min_history_blocks is unset. Reproduce the graph-node 0.37.0 deployment failure with the manifest configuration described. Done means the intended handling of prune:auto is decided and deployments no longer violate the subgraph_manifest_history_blocks_check constraint.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
backend, databases
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.