diff --git a/.changeset/breezy-kings-clean.md b/.changeset/breezy-kings-clean.md new file mode 100644 index 00000000000..b72a0689019 --- /dev/null +++ b/.changeset/breezy-kings-clean.md @@ -0,0 +1,5 @@ +--- +"chainlink": patch +--- + +Potential bug introduced from chain selector refactor, not causing issue now since only EVM is used, but need to fix #bugfix diff --git a/core/capabilities/ccip/oraclecreator/plugin.go b/core/capabilities/ccip/oraclecreator/plugin.go index 6b63491f8e6..f8868b5d9b9 100644 --- a/core/capabilities/ccip/oraclecreator/plugin.go +++ b/core/capabilities/ccip/oraclecreator/plugin.go @@ -299,7 +299,7 @@ func (i *pluginOracleCreator) createReadersAndWriters( pluginType cctypes.PluginType, config cctypes.OCR3ConfigWithMeta, publicCfg ocr3confighelper.PublicConfig, - chainFamily string, + destChainFamily string, ) ( map[cciptypes.ChainSelector]types.ContractReader, map[cciptypes.ChainSelector]types.ContractWriter, @@ -328,8 +328,8 @@ func (i *pluginOracleCreator) createReadersAndWriters( chainWriters := make(map[cciptypes.ChainSelector]types.ContractWriter) for relayID, relayer := range i.relayers { chainID := relayID.ChainID - - chainSelector, err1 := i.getChainSelector(chainID, chainFamily) + relayChainFamily := relayID.Network + chainSelector, err1 := i.getChainSelector(chainID, relayChainFamily) if err1 != nil { return nil, nil, fmt.Errorf("failed to get chain selector from chain ID %s: %w", chainID, err1) } @@ -344,7 +344,7 @@ func (i *pluginOracleCreator) createReadersAndWriters( return nil, nil, err1 } - if chainID == destChainID { + if chainID == destChainID && destChainFamily == relayChainFamily { offrampAddressHex := common.BytesToAddress(config.Config.OfframpAddress).Hex() err2 := cr.Bind(ctx, []types.BoundContract{ { @@ -367,7 +367,7 @@ func (i *pluginOracleCreator) createReadersAndWriters( relayer, i.transmitters, execBatchGasLimit, - chainFamily) + relayChainFamily) if err1 != nil { return nil, nil, err1 }