From cb19d4b54686d489a33f781c0e4b6696035da5b7 Mon Sep 17 00:00:00 2001 From: amirylm Date: Wed, 14 Feb 2024 11:40:53 +0200 Subject: [PATCH] identify retryTimeout + placeholder for err handler --- .../evmregistry/v21/mercury/streams/streams.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/mercury/streams/streams.go b/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/mercury/streams/streams.go index 48ee0492f9e..5101c8b1661 100644 --- a/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/mercury/streams/streams.go +++ b/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/mercury/streams/streams.go @@ -15,6 +15,7 @@ import ( "github.com/ethereum/go-ethereum/common/hexutil" "github.com/patrickmn/go-cache" + "github.com/smartcontractkit/chainlink-automation/pkg/v3/types" "github.com/smartcontractkit/chainlink-common/pkg/services" ocr2keepers "github.com/smartcontractkit/chainlink-common/pkg/types/automation" @@ -251,6 +252,19 @@ func (s *streams) DoMercuryRequest(ctx context.Context, lookup *mercury.StreamsL checkResults[i].RetryInterval = retryInterval checkResults[i].PipelineExecutionState = uint8(state) checkResults[i].IneligibilityReason = uint8(reason) + retryTimeout := retryInterval == mercury.RetryIntervalTimeout + if retryTimeout { + // in case of retry timeout, setting retryable to false + checkResults[i].Retryable = false + } + upkeepType := core.GetUpkeepType(checkResults[i].UpkeepID) + switch state { + case encoding.MercuryFlakyFailure: + if retryTimeout && upkeepType == types.LogTrigger && retryable { + // TODO: prepare for error handler + } + default: + } return nil, err }