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

Update loop boundary for signature search #33

Merged
merged 3 commits into from
Oct 4, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 {} block_epoch {}", finality_checkpoint.epoch, compute_epoch_at_slot(block.slot));
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
Loading