From b34930cd4982672bbea962f3706cb83d7e964963 Mon Sep 17 00:00:00 2001 From: David Date: Fri, 14 Jul 2023 12:39:52 +0800 Subject: [PATCH] feat(prover): update open proving blocks check (#316) --- prover/prover.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/prover/prover.go b/prover/prover.go index 8e2d55ca1..3405e1091 100644 --- a/prover/prover.go +++ b/prover/prover.go @@ -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", @@ -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