From bd5a0b721818f300afe5a66188fbcc870f75a1e7 Mon Sep 17 00:00:00 2001 From: David Date: Fri, 14 Jul 2023 12:19:36 +0800 Subject: [PATCH] feat(prover): update open proving blocks check --- .github/workflows/docker.yml | 2 +- prover/prover.go | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 1b1491c56..c5dc00d5b 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -2,7 +2,7 @@ name: "Push docker image to GCR" on: push: - branches: [main] + branches: [main,update-open-proving-blocks-check] tags: - "v*" 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