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
Browse files Browse the repository at this point in the history
  • Loading branch information
davidtaikocha committed Jul 14, 2023
1 parent df640d9 commit bd5a0b7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: "Push docker image to GCR"

on:
push:
branches: [main]
branches: [main,update-open-proving-blocks-check]
tags:
- "v*"

Expand Down
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 bd5a0b7

Please sign in to comment.