Skip to content

Commit

Permalink
print log when checks the executed block matches the sealed result
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangchiqing committed Nov 7, 2024
1 parent a80d4c5 commit 56b220a
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions engine/execution/checker/core.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ func NewCore(

// checkMyCommitWithSealedCommit is the main check of the checker engine
func checkMyCommitWithSealedCommit(
logger zerolog.Logger,
executedBlock *flow.Header,
myCommit flow.StateCommitment,
sealedCommit flow.StateCommitment,
Expand All @@ -50,6 +51,11 @@ func checkMyCommitWithSealedCommit(
)
}

logger.Info().
Uint64("height", executedBlock.Height).
Str("block_id", executedBlock.ID().String()).
Msg("execution result matches the sealed result")

// match
return nil
}
Expand All @@ -65,7 +71,7 @@ func (c *Core) RunCheck() error {
mycommitAtLastSealed, err := c.execState.StateCommitmentByBlockID(lastSealedBlock.ID())
if err == nil {
// if last sealed block has been executed, then check if they match
return checkMyCommitWithSealedCommit(lastSealedBlock, mycommitAtLastSealed, seal.FinalState)
return checkMyCommitWithSealedCommit(c.log, lastSealedBlock, mycommitAtLastSealed, seal.FinalState)
}

// if last sealed block has not been executed, then check if recent executed block has
Expand Down Expand Up @@ -102,7 +108,7 @@ func (c *Core) RunCheck() error {
return fmt.Errorf("could not get my state commitment OnFinalizedBlock, blockID: %v", seal.BlockID)
}

return checkMyCommitWithSealedCommit(sealedExecuted, mycommit, sealedCommit)
return checkMyCommitWithSealedCommit(c.log, sealedExecuted, mycommit, sealedCommit)
}

// findLastSealedBlock finds the last sealed block
Expand Down

0 comments on commit 56b220a

Please sign in to comment.