Currently we have get_block_number, but there are also cases where, given a block address (e.g. returned by get_latest_finalized_block_address) you might want to get the block timestamp, or perhaps the state root or something else in the future.
I ran into this in the builder where it would be useful to be able to fetch the previous block number and timestamp in one query.
Perhaps we can achieve this by changing get_block_number to get_block_header and return all of the block "header" info?
For now, this could just be a tuple with the number and timestamp (u64, Duration), but ideally in the future we might have some essential-node-types crate with a BlockHeader type that would have number: i64, timestamp: Duration and maybe also other fields like state root or whatever else.
Currently we have
get_block_number
, but there are also cases where, given a block address (e.g. returned byget_latest_finalized_block_address
) you might want to get the block timestamp, or perhaps the state root or something else in the future.I ran into this in the builder where it would be useful to be able to fetch the previous block number and timestamp in one query.
Perhaps we can achieve this by changing
get_block_number
toget_block_header
and return all of the block "header" info?For now, this could just be a tuple with the number and timestamp
(u64, Duration)
, but ideally in the future we might have someessential-node-types
crate with aBlockHeader
type that would havenumber: i64
,timestamp: Duration
and maybe also other fields like state root or whatever else.