I am trying to get block data (extrinsics) for finalised blocks only in the client (not runtime). I can see that there is an RPC endpoint called chain_getBlock
. Am i correct in thinking that this endpoint does not filter on finalised blocks only?
And if that's the case, is it enough to check if Justification is not None if I only care about finalised blocks?
Thanks
I would get extrinsics of the finalized head by:
chain_getFinalizeHead uses the client's local information, so it is not coming from the runtime.
In the use case you describe, I do not think it makes sense to use the justification field to check if a block is finalized. Most blocks from a GRANDPA based chain will not have a justification for several reasons:
It is worth noting that the client does store justification alongside each block in its local DB, but other than the cases mentioned above, they are not part of runtime state.
Credits to André Silva, as most of this response is information he explained to me.