block verification changes

This commit is contained in:
Eitan Seri- Levi
2026-02-13 15:00:31 -08:00
parent ebaca3144c
commit e5598d529c
8 changed files with 138 additions and 44 deletions

View File

@@ -383,10 +383,7 @@ impl ProtoArray {
/// Updates the node's `payload_status` from `PENDING` to `FULL`.
///
/// Returns an error if the block is unknown to fork choice.
pub fn on_execution_payload(
&mut self,
block_root: Hash256,
) -> Result<(), Error> {
pub fn on_execution_payload(&mut self, block_root: Hash256) -> Result<(), Error> {
let index = self
.indices
.get(&block_root)

View File

@@ -491,10 +491,7 @@ impl ProtoArrayForkChoice {
/// Register that a valid execution payload envelope has been received for `block_root`.
///
/// See `ProtoArray::on_execution_payload` for documentation.
pub fn on_execution_payload(
&mut self,
block_root: Hash256,
) -> Result<(), String> {
pub fn on_execution_payload(&mut self, block_root: Hash256) -> Result<(), String> {
self.proto_array
.on_execution_payload(block_root)
.map_err(|e| format!("on_execution_payload error: {:?}", e))
@@ -899,6 +896,16 @@ impl ProtoArrayForkChoice {
Some(block.execution_status)
}
/// Returns the first *beacon block root* which contains an execution payload with the given
/// `block_hash`, if any.
pub fn execution_block_hash_to_beacon_block_root(
&self,
block_hash: &ExecutionBlockHash,
) -> Option<Hash256> {
self.proto_array
.execution_block_hash_to_beacon_block_root(block_hash)
}
/// Returns the weight of a given block.
pub fn get_weight(&self, block_root: &Hash256) -> Option<u64> {
let block_index = self.proto_array.indices.get(block_root)?;