graphprotocol / graphprotocol/graph-node

Remove some unused code from `ChainStore`

Open
#3,042 0 comments 0 reactions 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 ChainStore.confirm_block_hash is not used anymore.

The method ChainStore.block_hashes_by_block_number is only used in the copy command, but it looks like we can get rid of that if we follow the chain back block_offset steps instead of calculating a block pointer.

Both these methods should be removed.

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

Search for ChainStore.confirm_block_hash and ChainStore.block_hashes_by_block_number, then inspect the copy command that still uses the latter. Remove both unused methods and update the copy command to follow the chain back block_offset steps; done means neither method remains and the copy command no longer depends on block pointer calculation.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
backend, blockchain
Issue type
Refactor
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.