Skip to content

Commit

Permalink
compare checkblock and log block
Browse files Browse the repository at this point in the history
  • Loading branch information
infiloop2 committed Sep 24, 2023
1 parent d0cec31 commit 8f08e64
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@ const (
// checkBlockTooOldRange is the number of blocks that can be behind the latest block before
// we return a CheckBlockTooOld error
checkBlockTooOldRange = 128
// block range till which a checkBlock is considered fresh where certain RPC issues are treated
// as retryable as they might have flaky race conditions
freshCheckBlockRange = 10
)

type checkResult struct {
Expand Down Expand Up @@ -130,6 +127,12 @@ func (r *EvmRegistry) verifyCheckBlock(_ context.Context, checkBlock, upkeepId *
func (r *EvmRegistry) verifyLogExists(upkeepId *big.Int, p ocr2keepers.UpkeepPayload) (encoding.UpkeepFailureReason, encoding.PipelineExecutionState, bool) {
logBlockNumber := int64(p.Trigger.LogTriggerExtension.BlockNumber)
logBlockHash := common.BytesToHash(p.Trigger.LogTriggerExtension.BlockHash[:])
checkBlockHash := common.BytesToHash(p.Trigger.BlockHash[:])
if checkBlockHash.String() == logBlockHash.String() {
// log verification would be covered by checkBlock verification as they are the same. Return early from
// log verificaion
return encoding.UpkeepFailureReasonNone, encoding.NoPipelineError, false
}
// if log block number is populated, check log block number and block hash
if logBlockNumber != 0 {
h, ok := r.bs.queryBlocksMap(logBlockNumber)
Expand Down

0 comments on commit 8f08e64

Please sign in to comment.