Skip to content

Commit

Permalink
feat(beacon): validate HistoricalSummariesWithProof if finalized st…
Browse files Browse the repository at this point in the history
…ate root is available (#1491)
  • Loading branch information
ogenev authored Sep 27, 2024
1 parent 54314e3 commit 9e71e5c
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions trin-beacon/src/validation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ use light_client::{
use ssz::Decode;
use std::sync::Arc;
use tokio::sync::RwLock;
use tracing::debug;
use tree_hash::TreeHash;
use trin_validation::{
merkle::proof::verify_merkle_proof,
Expand Down Expand Up @@ -262,13 +263,17 @@ impl Validator<BeaconContentKey> for BeaconValidator {
.read()
.await
.get_finalized_state_root()
.await?;
.await;

Self::state_summaries_validation(
fork_versioned_historical_summaries,
latest_finalized_root,
)
.await?;
if let Ok(latest_finalized_root) = latest_finalized_root {
Self::state_summaries_validation(
fork_versioned_historical_summaries,
latest_finalized_root,
)
.await?;
} else {
debug!("Failed to get latest finalized state root. Bypassing historical summaries with proof validation");
}
}
}

Expand Down

0 comments on commit 9e71e5c

Please sign in to comment.