Skip to content
This repository has been archived by the owner on May 11, 2024. It is now read-only.

Commit

Permalink
feat(prover): update open proving blocks check (#316)
Browse files Browse the repository at this point in the history
  • Loading branch information
davidtaikocha authored Jul 14, 2023
1 parent df640d9 commit b34930c
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions prover/prover.go
Original file line number Diff line number Diff line change
Expand Up @@ -512,7 +512,8 @@ func (p *Prover) onBlockProposed(
proofWindowExpired := uint64(time.Now().Unix()) > proofWindowExpiresAt
// zero address means anyone can prove, proofWindowExpired means anyone can prove even if not zero address
if block.AssignedProver != p.proverAddress && block.AssignedProver != zeroAddress && !proofWindowExpired {
log.Info("Proposed block not proveable",
log.Info(
"Proposed block not proveable",
"blockID",
event.BlockId,
"prover",
Expand Down Expand Up @@ -542,8 +543,9 @@ func (p *Prover) onBlockProposed(

// if set not to prove unassigned blocks, this block is still not provable
// by us even though its open proving.
if block.AssignedProver == zeroAddress && !p.cfg.ProveUnassignedBlocks {
log.Info("Skipping proposed open proving block, not assigned to us",
if (block.AssignedProver == zeroAddress || proofWindowExpired) && !p.cfg.ProveUnassignedBlocks {
log.Info(
"Skipping proposed open proving block, not assigned to us",
"blockID", event.BlockId,
)
return nil
Expand Down

0 comments on commit b34930c

Please sign in to comment.