graphprotocol / graphprotocol/graph-node

`BlockStore.chain_head_pointers` gets confused when the same chain is in multiple stores

Open
#3,286 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

The method BlockStore.chain_head_pointers iterates over all shards slurping up information about chain head pointers without checking whether that data actually comes from the shard that is configured for any given chain. If a chain is present in more than one store (e.g., because it was moved to another shard) the information returned can be incorrect since old data might clobber new data.

The method needs to make sure that it only reads data from the correct shards. That's complicated a bit by the fact that we want to read all chain head pointers from a shard at once for performance, i.e. one query per shard, rather than one query per chain.

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 by locating BlockStore.chain_head_pointers and reading how it gathers chain head pointers across shards. Trace how each chain's configured shard is represented, then verify the result when a chain exists in multiple stores; done means one query per shard remains while stale data cannot overwrite the configured shard's data.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.