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

Commit

Permalink
improve logs
Browse files Browse the repository at this point in the history
  • Loading branch information
cyberhorsey committed Jul 12, 2023
1 parent a1c9259 commit b3ee4b5
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions prover/prover.go
Original file line number Diff line number Diff line change
Expand Up @@ -508,14 +508,30 @@ func (p *Prover) onBlockProposed(
}

if !skipProofWindowExpiredCheck {
proofWindowExpired := uint64(time.Now().Unix()) > block.ProposedAt+block.ProofWindow
proofWindowExpiresAt := block.ProposedAt + block.ProofWindow
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", "blockID", event.BlockId, "prover", block.AssignedProver.Hex())
log.Info("Proposed block not proveable",
"blockID",
event.BlockId,
"prover",
block.AssignedProver.Hex(),
"proofWindowExpiresAt",
proofWindowExpiresAt,
)

// if we cant prove it now, but config is set to wait and try to prove
// expired proofs
if p.cfg.ProveUnassignedBlocks {
log.Info("Adding proposed block to wait for proof window expiration",
"blockID",
event.BlockId,
"prover",
block.AssignedProver.Hex(),
"proofWindowExpiresAt",
proofWindowExpiresAt,
)
p.currentBlocksWaitingForProofWindowMutex.Lock()
p.currentBlocksWaitingForProofWindow[event.Meta.Id] = event.Raw.BlockNumber
p.currentBlocksWaitingForProofWindowMutex.Unlock()
Expand Down

0 comments on commit b3ee4b5

Please sign in to comment.