mirror of
https://github.com/sigp/lighthouse.git
synced 2026-04-22 15:28:28 +00:00
Add parent_block_number to payload SSE (#4053)
## Issue Addressed In #4027 I forgot to add the `parent_block_number` to the payload attributes SSE. ## Proposed Changes Compute the parent block number while computing the pre-payload attributes. Pass it on to the SSE stream. ## Additional Info Not essential for v3.5.1 as I suspect most builders don't need the `parent_block_root`. I would like to use it for my dummy no-op builder however.
This commit is contained in:
@@ -167,6 +167,17 @@ impl<E: EthSpec> CachedHead<E> {
|
||||
.map(|payload| payload.prev_randao())
|
||||
}
|
||||
|
||||
/// Returns the execution block number of the block at the head of the chain.
|
||||
///
|
||||
/// Returns an error if the chain is prior to Bellatrix.
|
||||
pub fn head_block_number(&self) -> Result<u64, BeaconStateError> {
|
||||
self.snapshot
|
||||
.beacon_block
|
||||
.message()
|
||||
.execution_payload()
|
||||
.map(|payload| payload.block_number())
|
||||
}
|
||||
|
||||
/// Returns the active validator count for the current epoch of the head state.
|
||||
///
|
||||
/// Should only return `None` if the caches have not been built on the head state (this should
|
||||
|
||||
Reference in New Issue
Block a user