Skip to content

Commit

Permalink
Merge pull request #6559 from onflow/leo/log-execution-matching-checks
Browse files Browse the repository at this point in the history
Print log when checks the executed block matches the sealed result
  • Loading branch information
zhangchiqing authored Nov 8, 2024
2 parents aeabf4c + 56b220a commit aaaf9be
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 aaaf9be

Please sign in to comment.