ChainHead APIs: add option to timeout subscriptions if no events received in N seconds
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 489
- Forks
- 293
- Avg merge
- 18h 35m
- Merged PRs (30d)
- 3
Description
See https://github.com/paritytech/polkadot-staking-miner/pull/1119#discussion_r2251094304
On occasion, these subscriptions seem to stop receiving events. It's not clear why offhand, but would be good to be able to catch and handle such failures. The obvious way to do this is having a timeout such that if no more events are received for a certain amount of time, assume something went wrong / recreate the subscription.
For now, we could add a configurable timeout in the ChainHead backend which errors out if it stops receiving events. This owuld also cover runtime updates, and anything else using the same stream.
I perhaps would add similar the the legacy APIs, though offhand can't recall if we could do something nice for runtime updates or not.
Contributor guide
No contributing guide indexed for this repository
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 with the linked pull request discussion and inspect the ChainHead backend subscription handling. Determine how a configurable no-event timeout should report an error and whether runtime updates use the same stream; done means the ChainHead backend can apply that timeout reliably, with legacy APIs considered separately.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- backend-api-design
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100