Skip to content

Commit

Permalink
don't fetch follower configs in LatestConfigDetails
Browse files Browse the repository at this point in the history
LatestConfigDetails only needs to return the changedInBlock and the
config digest, not the entire config contents.
  • Loading branch information
makramkd committed Jan 4, 2024
1 parent 7f482a9 commit 3f664f0
Showing 1 changed file with 0 additions and 30 deletions.
30 changes: 0 additions & 30 deletions core/services/relay/evm/ocr3/multichain_config_tracker.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

0 comments on commit 3f664f0

Please sign in to comment.