graphprotocol / graphprotocol/graph-node
Error retries seem to lose the Firehose cursor
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 3.2k
- Forks
- 1.1k
- Avg merge
- 4d 1h
- Merged PRs (30d)
- 1
Description
We're seeing logs like this one frequently:
WARN Firehose selected first streamed block's parent should match subgraph start block, reverting to last know final chain segment,
firehose_start_block: #18746373 (5ca99c16915d2cd025e4fc1b3962c08eb75d171840d70116d2ff9204d3a1c5cc), subgraph_current_block: #18746373 (ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff)
The subgraph will then revert by exactly 200 blocks which is a hardcoded value in FirehoseMapper::final_block_ptr_for.
I think this reproduces when a subgraph retries a deterministic error, so it may be that we're losing the current block hash in this retry process. Given that those retries happen frequently and reverting makes the retry process more expensive, it would be good to look into how we can avoid this situation.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing deterministic-error retry handling and how the current block hash reaches FirehoseMapper::final_block_ptr_for. Reproduce the logged Firehose cursor mismatch if possible and verify that retries retain the cursor instead of triggering the hardcoded 200-block revert.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- backend, blockchain
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100