This repository has been archived by the owner on Nov 15, 2023. It is now read-only.
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.
Closed
Description
The block pinning is a feature required by the RPC Spec V2.
The block pinning feature should be called for subscribers of the chainHead_unstable_follow
method.
Each block produced by the chainHead_unstable_follow
(new block, best block, finalized block) subscription should
be pinned to offer data access for:
- block body (the old
chain_getBlock
RPC) - block header (the old
chain_getHeader
RPC) - storage
- runtime call
The substrate has pin and unpin functionality but it is only preserving the state of the block.
Extend the database and client to offer support for pin_block
and unpin_block
to reference count
the desired block and prevent it from pruning.