From 3f664f04549b77326758bea051b946fdfd968a20 Mon Sep 17 00:00:00 2001 From: Makram Kamaleddine Date: Thu, 4 Jan 2024 16:52:15 +0200 Subject: [PATCH] don't fetch follower configs in LatestConfigDetails LatestConfigDetails only needs to return the changedInBlock and the config digest, not the entire config contents. --- .../evm/ocr3/multichain_config_tracker.go | 30 ------------------- 1 file changed, 30 deletions(-) diff --git a/core/services/relay/evm/ocr3/multichain_config_tracker.go b/core/services/relay/evm/ocr3/multichain_config_tracker.go index abc2deafc87..3bf8a469605 100644 --- a/core/services/relay/evm/ocr3/multichain_config_tracker.go +++ b/core/services/relay/evm/ocr3/multichain_config_tracker.go @@ -202,35 +202,5 @@ func (m *multichainConfigTracker) LatestConfigDetails(ctx context.Context) (chan return 0, ocrtypes.ConfigDigest{}, err } - // check all other chains for their config - var followerConfigs []ocrtypes.ContractConfig - for id, lp := range m.logPollers { - if id == m.masterChain { - continue - } - - latest, err := lp.LatestLogByEventSigWithConfs(ConfigSet, m.contractAddresses[id], 1, pg.WithParentCtx(ctx)) - if err != nil { - if errors.Is(err, sql.ErrNoRows) { - // TODO: try RPC call for config - return 0, ocrtypes.ConfigDigest{}, err - } - return 0, ocrtypes.ConfigDigest{}, err - } - - followerConfig, err := configFromLog(latest.Data) - if err != nil { - return 0, ocrtypes.ConfigDigest{}, err - } - - followerConfigs = append(followerConfigs, followerConfig) - } - - // at this point we can combine the configs into a single one - combined, err := m.combiner(masterConfig, followerConfigs) - if err != nil { - return 0, ocrtypes.ConfigDigest{}, err - } - return uint64(latest.BlockNumber), masterConfig.ConfigDigest, nil }