diff --git a/deployment/ccip/changeset/cs_add_chain.go b/deployment/ccip/changeset/cs_add_chain.go index d589d16b779..b3d0df04c93 100644 --- a/deployment/ccip/changeset/cs_add_chain.go +++ b/deployment/ccip/changeset/cs_add_chain.go @@ -169,21 +169,14 @@ func (a AddDonAndSetCandidateChangesetConfig) Validate(e deployment.Environment, } // check that chain config is set up for the new chain - // TODO: feels like we should just have a getter for a particular chain, this pagination - // logic seems a bit out of place here. - allConfigs, err := state.Chains[a.HomeChainSelector].CCIPHome.GetAllChainConfigs(nil, big.NewInt(0), big.NewInt(100)) + chainConfig, err := state.Chains[a.HomeChainSelector].CCIPHome.GetChainConfig(nil, a.NewChainSelector) if err != nil { return nil, fmt.Errorf("get all chain configs: %w", err) } - var found bool - for _, chainConfig := range allConfigs { - if chainConfig.ChainSelector == a.NewChainSelector { - found = true - break - } - } - if !found { - return nil, fmt.Errorf("chain config not set for chain %d", a.NewChainSelector) + + // FChain should never be zero if a chain config is set in CCIPHome + if chainConfig.FChain == 0 { + return nil, fmt.Errorf("chain config not set up for new chain %d", a.NewChainSelector) } err = a.CCIPOCRParams.Validate()