Skip to content
This repository has been archived by the owner on Nov 10, 2023. It is now read-only.

Commit

Permalink
change loop exit case for signature block search
Browse files Browse the repository at this point in the history
  • Loading branch information
Wizdave97 committed Oct 4, 2023
1 parent 9438b05 commit 883445b
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions prover/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -243,9 +243,9 @@ impl SyncCommitteeProver {
let state_period =
compute_sync_committee_period_at_slot(client_state.finalized_header.slot);
loop {
// If we get to an epoch that is less than the attested epoch for the last known
// finalized header we exit
if compute_epoch_at_slot(block.slot) < client_state.latest_finalized_epoch + 2 {
// If we get to an epoch that is less than the finalized epoch for the notification
if compute_epoch_at_slot(block.slot) <= finality_checkpoint.epoch {
debug!(target: "prover", "Signature block search has reached epoch <= finalized epoch {} finalized+2{}", compute_epoch_at_slot(block.slot), finality_checkpoint.epoch);
return Ok(None)
}

Expand All @@ -267,7 +267,6 @@ impl SyncCommitteeProver {
let attested_header = self.fetch_header(&attested_block_id).await?;
let mut attested_state =
self.fetch_beacon_state(&get_block_id(attested_header.state_root)).await?;

if attested_state.finalized_checkpoint.root == Node::default() {
return Ok(None)
}
Expand Down

0 comments on commit 883445b

Please sign in to comment.