From 1eda1ee311c1251d35bf2dc3bafbfd32b0ef8288 Mon Sep 17 00:00:00 2001 From: Akshay Aggarwal <71980293+infiloop2@users.noreply.github.com> Date: Mon, 18 Sep 2023 10:20:57 +0100 Subject: [PATCH] Set trigger config when node cannot find setConfig logs during refresh (#10617) * Set trigger config when node cannot find setConfig logs during refresh * update comment --- .../services/ocr2/plugins/ocr2keeper/evm21/registry.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/core/services/ocr2/plugins/ocr2keeper/evm21/registry.go b/core/services/ocr2/plugins/ocr2keeper/evm21/registry.go index a4684e67078..590e5138b3e 100644 --- a/core/services/ocr2/plugins/ocr2keeper/evm21/registry.go +++ b/core/services/ocr2/plugins/ocr2keeper/evm21/registry.go @@ -337,14 +337,16 @@ func (r *EvmRegistry) refreshLogTriggerUpkeepsBatch(logTriggerIDs []*big.Int) er for _, id := range logTriggerIDs { logBlock, ok := configSetBlockNumbers[id.String()] if !ok { - r.lggr.Warnf("unable to find finalized config set block number for %s, skipping refresh", id.String()) - continue + r.lggr.Warnf("unable to find finalized config set block number for %s, using 0 as config start block", id.String()) + // Use zero as config update block so it can be updated if an actual event is found later + logBlock = 0 } config, ok := perUpkeepConfig[id.String()] if !ok { - r.lggr.Warnf("unable to find per finalized log config for %s, skipping refresh", id.String()) - continue + r.lggr.Warnf("unable to find per finalized log config for %s, will fetch latest config from chain", id.String()) + // Set it to empty bytes so that latest config is fetched within r.updateTriggerConfig + config = []byte{} } // In case an upkeep was paused then unpaused after a config set event, start the config from the unpaused block number