Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
75 changes: 38 additions & 37 deletions build/devenv/environment.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,6 @@ import (
chainsel "github.com/smartcontractkit/chain-selectors"
"github.com/smartcontractkit/chainlink-ccv/bootstrap"

ccipAdapters "github.com/smartcontractkit/chainlink-ccip/deployment/v2_0_0/adapters"
ccipChangesets "github.com/smartcontractkit/chainlink-ccip/deployment/v2_0_0/changesets"
ccipOffchain "github.com/smartcontractkit/chainlink-ccip/deployment/v2_0_0/offchain"
"github.com/smartcontractkit/chainlink-ccip/deployment/v2_0_0/offchain/shared"
"github.com/smartcontractkit/chainlink-ccv/build/devenv/cciptestinterfaces"
devenvcommon "github.com/smartcontractkit/chainlink-ccv/build/devenv/common"
"github.com/smartcontractkit/chainlink-ccv/build/devenv/jobs"
Expand All @@ -36,6 +32,11 @@ import (
"github.com/smartcontractkit/chainlink-ccv/build/devenv/services/committeeverifier"
executorsvc "github.com/smartcontractkit/chainlink-ccv/build/devenv/services/executor"
"github.com/smartcontractkit/chainlink-ccv/build/devenv/util"
ccvdeployment "github.com/smartcontractkit/chainlink-ccv/deployment"
ccvadapters "github.com/smartcontractkit/chainlink-ccv/deployment/adapters"
ccvchangesets "github.com/smartcontractkit/chainlink-ccv/deployment/changesets"
ccvshared "github.com/smartcontractkit/chainlink-ccv/deployment/shared"
_ "github.com/smartcontractkit/chainlink-ccv/evm"
"github.com/smartcontractkit/chainlink-ccv/executor"
"github.com/smartcontractkit/chainlink-ccv/indexer/pkg/config"
"github.com/smartcontractkit/chainlink-ccv/protocol"
Expand Down Expand Up @@ -120,7 +121,7 @@ type Cfg struct {
// IndexerInternalEndpoints holds internal Docker network URLs for all indexers.
IndexerInternalEndpoints []string `toml:"indexer_internal_endpoints"`
// EnvironmentTopology is the shared environment configuration for NOPs, committees, and executor pools.
EnvironmentTopology *ccipOffchain.EnvironmentTopology `toml:"environment_topology" validate:"required"`
EnvironmentTopology *ccvdeployment.EnvironmentTopology `toml:"environment_topology" validate:"required"`
// JDInfra holds the runtime JD infrastructure (not from config, populated at runtime).
JDInfra *jobs.JDInfrastructure `toml:"-"`
// ClientLookup provides ChainlinkClient lookup by NOP alias (populated at runtime).
Expand Down Expand Up @@ -235,7 +236,7 @@ func (c *Cfg) expandAggregators() error {

aggContainerName := fmt.Sprintf("%s-%s", cloneName, services.AggregatorContainerNameSuffix)
cloneAddr := fmt.Sprintf("%s:%d", aggContainerName, services.DefaultAggregatorGRPCPort)
committee.Aggregators = append(committee.Aggregators, ccipOffchain.AggregatorConfig{
committee.Aggregators = append(committee.Aggregators, ccvdeployment.AggregatorConfig{
Name: cloneName,
Address: cloneAddr,
InsecureAggregatorConnection: insecure,
Expand Down Expand Up @@ -460,7 +461,7 @@ func NewProductConfigurationFromNetwork(typ string) (cciptestinterfaces.CCIP17Co
//
// Signer key selection is delegated to each registered ImplFactory via DefaultSignerKey,
// so adding a new chain family requires no changes here.
func enrichEnvironmentTopology(cfg *ccipOffchain.EnvironmentTopology, verifiers []*committeeverifier.Input) {
func enrichEnvironmentTopology(cfg *ccvdeployment.EnvironmentTopology, verifiers []*committeeverifier.Input) {
factories := GetAllImplFactories()

seenAliases := make(map[string]struct{})
Expand All @@ -469,7 +470,7 @@ func enrichEnvironmentTopology(cfg *ccipOffchain.EnvironmentTopology, verifiers
continue
}
nop, ok := cfg.NOPTopology.GetNOP(ver.NOPAlias)
if !ok || nop.GetMode() == shared.NOPModeCL {
if !ok || nop.GetMode() == ccvshared.NOPModeCL {
continue
}

Expand All @@ -492,7 +493,7 @@ func enrichEnvironmentTopology(cfg *ccipOffchain.EnvironmentTopology, verifiers
// and verifier changesets as the single source of truth.
// For each chain_config entry that lacks a FeeAggregator, the corresponding
// chain's deployer key is used as a fallback via the registered ImplFactory.
func buildEnvironmentTopology(in *Cfg, e *deployment.Environment) *ccipOffchain.EnvironmentTopology {
func buildEnvironmentTopology(in *Cfg, e *deployment.Environment) *ccvdeployment.EnvironmentTopology {
if in.EnvironmentTopology == nil {
return nil
}
Expand Down Expand Up @@ -543,7 +544,7 @@ func generateExecutorJobSpecs(
in *Cfg,
selectors []uint64,
impls []cciptestinterfaces.CCIP17Configuration,
topology *ccipOffchain.EnvironmentTopology,
topology *ccvdeployment.EnvironmentTopology,
ds datastore.MutableDataStore,
) (map[string]bootstrap.JobSpec, error) {
executorJobSpecs := make(map[string]bootstrap.JobSpec)
Expand All @@ -569,11 +570,11 @@ func generateExecutorJobSpecs(
execNOPAliases = append(execNOPAliases, exec.NOPAlias)
}

cs := ccipChangesets.ApplyExecutorConfig(ccipAdapters.GetExecutorConfigRegistry())
output, err := cs.Apply(*e, ccipChangesets.ApplyExecutorConfigInput{
cs := ccvchangesets.ApplyExecutorConfig(ccvadapters.GetRegistry())
output, err := cs.Apply(*e, ccvchangesets.ApplyExecutorConfigInput{
Topology: topology,
ExecutorQualifier: qualifier,
TargetNOPs: shared.ConvertStringToNopAliases(execNOPAliases),
TargetNOPs: ccvshared.ConvertStringToNopAliases(execNOPAliases),
})
if err != nil {
return nil, fmt.Errorf("failed to generate executor configs for qualifier %s: %w", qualifier, err)
Expand All @@ -584,8 +585,8 @@ func generateExecutorJobSpecs(
}

for _, exec := range qualifierExecutors {
jobSpecID := shared.NewExecutorJobID(shared.NOPAlias(exec.NOPAlias), shared.ExecutorJobScope{ExecutorQualifier: qualifier})
job, err := ccipOffchain.GetJob(output.DataStore.Seal(), shared.NOPAlias(exec.NOPAlias), jobSpecID.ToJobID())
jobSpecID := ccvshared.NewExecutorJobID(ccvshared.NOPAlias(exec.NOPAlias), ccvshared.ExecutorJobScope{ExecutorQualifier: qualifier})
job, err := ccvdeployment.GetJob(output.DataStore.Seal(), ccvshared.NOPAlias(exec.NOPAlias), jobSpecID.ToJobID())
if err != nil {
return nil, fmt.Errorf("failed to get executor job spec for %s: %w", exec.ContainerName, err)
}
Expand Down Expand Up @@ -691,7 +692,7 @@ func generateVerifierJobSpecs(
e *deployment.Environment,
in *Cfg,
selectors []uint64,
topology *ccipOffchain.EnvironmentTopology,
topology *ccvdeployment.EnvironmentTopology,
sharedTLSCerts *services.TLSCertPaths,
ds datastore.MutableDataStore,
) (map[string][]bootstrap.JobSpec, error) {
Expand Down Expand Up @@ -722,16 +723,16 @@ func generateVerifierJobSpecs(
}

for family := range families {
verNOPAliases := make([]shared.NOPAlias, 0, len(committeeVerifiers))
verNOPAliases := make([]ccvshared.NOPAlias, 0, len(committeeVerifiers))
for _, ver := range committeeVerifiers {
if ver.ChainFamily == family {
verNOPAliases = append(verNOPAliases, shared.NOPAlias(ver.NOPAlias))
verNOPAliases = append(verNOPAliases, ccvshared.NOPAlias(ver.NOPAlias))
}
}

disableFinalityCheckers := disableFinalityCheckersPerFamily[family]
cs := ccipChangesets.ApplyVerifierConfig(ccipAdapters.GetVerifierJobConfigRegistry())
output, err := cs.Apply(*e, ccipChangesets.ApplyVerifierConfigInput{
cs := ccvchangesets.ApplyVerifierConfig(ccvadapters.GetRegistry())
output, err := cs.Apply(*e, ccvchangesets.ApplyVerifierConfigInput{
Topology: topology,
CommitteeQualifier: committeeName,
DefaultExecutorQualifier: devenvcommon.DefaultExecutorQualifier,
Expand Down Expand Up @@ -767,8 +768,8 @@ func generateVerifierJobSpecs(

allJobSpecs := make([]bootstrap.JobSpec, 0, len(aggNames))
for _, aggName := range aggNames {
jobSpecID := shared.NewVerifierJobID(shared.NOPAlias(ver.NOPAlias), aggName, shared.VerifierJobScope{CommitteeQualifier: committeeName})
job, err := ccipOffchain.GetJob(output.DataStore.Seal(), shared.NOPAlias(ver.NOPAlias), jobSpecID.ToJobID())
jobSpecID := ccvshared.NewVerifierJobID(ccvshared.NOPAlias(ver.NOPAlias), aggName, ccvshared.VerifierJobScope{CommitteeQualifier: committeeName})
job, err := ccvdeployment.GetJob(output.DataStore.Seal(), ccvshared.NOPAlias(ver.NOPAlias), jobSpecID.ToJobID())
if err != nil {
return nil, fmt.Errorf("failed to get verifier job spec for %s aggregator %s: %w", ver.ContainerName, aggName, err)
}
Expand Down Expand Up @@ -994,7 +995,7 @@ func NewEnvironment() (in *Cfg, err error) {
clModeNopAliases := make([]string, 0)
if in.EnvironmentTopology != nil && in.EnvironmentTopology.NOPTopology != nil {
for _, nop := range in.EnvironmentTopology.NOPTopology.NOPs {
if nop.GetMode() == shared.NOPModeCL {
if nop.GetMode() == ccvshared.NOPModeCL {
clModeNopAliases = append(clModeNopAliases, nop.Alias)
}
}
Expand Down Expand Up @@ -1108,7 +1109,7 @@ func NewEnvironment() (in *Cfg, err error) {
capsBySelector[networkInfo.ChainSelector] = nil
}
}
combos := devenvcommon.ComputeTokenCombinations(capsBySelector, topology)
combos := devenvcommon.ComputeTokenCombinations(capsBySelector, convertTopologyToCCIP(topology))

ds := datastore.NewMemoryDataStore()
for i, impl := range impls {
Expand Down Expand Up @@ -1244,8 +1245,8 @@ func NewEnvironment() (in *Cfg, err error) {

// Use changeset to generate committee config from on-chain state
instanceName := aggregatorInput.InstanceName()
cs := ccipChangesets.GenerateAggregatorConfig(ccipAdapters.GetAggregatorConfigRegistry())
output, err := cs.Apply(*e, ccipChangesets.GenerateAggregatorConfigInput{
cs := ccvchangesets.GenerateAggregatorConfig(ccvadapters.GetRegistry())
output, err := cs.Apply(*e, ccvchangesets.GenerateAggregatorConfigInput{
Topology: topology,
ServiceIdentifier: instanceName + "-aggregator",
CommitteeQualifier: aggregatorInput.CommitteeName,
Expand Down Expand Up @@ -1285,8 +1286,8 @@ func NewEnvironment() (in *Cfg, err error) {
// One shared config is generated; all indexers use the same config and duplicated secrets/auth.
if len(in.Aggregator) > 0 && len(in.Indexer) > 0 {
firstIdx := in.Indexer[0]
cs := ccipChangesets.GenerateIndexerConfig(ccipAdapters.GetIndexerConfigRegistry())
output, err := cs.Apply(*e, ccipChangesets.GenerateIndexerConfigInput{
cs := ccvchangesets.GenerateIndexerConfig(ccvadapters.GetRegistry())
output, err := cs.Apply(*e, ccvchangesets.GenerateIndexerConfigInput{
ServiceIdentifier: "indexer",
CommitteeVerifierNameToQualifier: firstIdx.CommitteeVerifierNameToQualifier,
CCTPVerifierNameToQualifier: firstIdx.CCTPVerifierNameToQualifier,
Expand Down Expand Up @@ -1502,15 +1503,15 @@ func NewEnvironment() (in *Cfg, err error) {
}

// Use changeset to generate token verifier config from on-chain state
cs := ccipChangesets.GenerateTokenVerifierConfig(ccipAdapters.GetTokenVerifierConfigRegistry())
output, err := cs.Apply(*e, ccipChangesets.GenerateTokenVerifierConfigInput{
cs := ccvchangesets.GenerateTokenVerifierConfig(ccvadapters.GetRegistry())
output, err := cs.Apply(*e, ccvchangesets.GenerateTokenVerifierConfigInput{
ServiceIdentifier: "TokenVerifier",
ChainSelectors: selectors,
PyroscopeURL: template.PyroscopeURL,
Monitoring: shared.MonitoringInput{
Monitoring: ccvdeployment.MonitoringConfig{
Enabled: template.Monitoring.Enabled,
Type: template.Monitoring.Type,
Beholder: shared.BeholderInput{
Beholder: ccvdeployment.BeholderConfig{
InsecureConnection: template.Monitoring.Beholder.InsecureConnection,
CACertFile: template.Monitoring.Beholder.CACertFile,
OtelExporterGRPCEndpoint: template.Monitoring.Beholder.OtelExporterGRPCEndpoint,
Expand All @@ -1521,12 +1522,12 @@ func NewEnvironment() (in *Cfg, err error) {
TraceBatchTimeout: template.Monitoring.Beholder.TraceBatchTimeout,
},
},
Lombard: ccipChangesets.LombardConfigInput{
Lombard: ccvchangesets.LombardConfigInput{
VerifierID: "LombardVerifier",
Qualifier: devenvcommon.LombardContractsQualifier,
AttestationAPI: fakeOut.InternalHTTPURL + "/lombard",
},
CCTP: ccipChangesets.CCTPConfigInput{
CCTP: ccvchangesets.CCTPConfigInput{
VerifierID: "CCTPVerifier",
AttestationAPI: fakeOut.InternalHTTPURL + "/cctp",
},
Expand Down Expand Up @@ -1702,10 +1703,10 @@ func launchCLNodes(
return nil, fmt.Errorf("no API key pairs found for client %s on aggregator %s", apiClient.ClientID, agg.InstanceName())
}
apiKeyPair := apiClient.APIKeyPairs[0]
verifierID := shared.NewVerifierJobID(
shared.NOPAlias(ver.NOPAlias),
verifierID := ccvshared.NewVerifierJobID(
ccvshared.NOPAlias(ver.NOPAlias),
aggName,
shared.VerifierJobScope{CommitteeQualifier: ver.CommitteeName},
ccvshared.VerifierJobScope{CommitteeQualifier: ver.CommitteeName},
).GetVerifierID()
Plog.Debug().
Int("nodeIndex", index).
Expand Down
16 changes: 8 additions & 8 deletions build/devenv/expand_ha_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import (
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"

"github.com/smartcontractkit/chainlink-ccip/deployment/v2_0_0/offchain"
"github.com/smartcontractkit/chainlink-ccv/build/devenv/services"
ccvdeployment "github.com/smartcontractkit/chainlink-ccv/deployment"
"github.com/smartcontractkit/chainlink-ccv/indexer/pkg/config"
)

Expand Down Expand Up @@ -387,12 +387,12 @@ type cfgOption func(*Cfg)
func buildCfgPtr(opts ...cfgOption) *Cfg {
c := &Cfg{
HighAvailability: true,
EnvironmentTopology: &offchain.EnvironmentTopology{
NOPTopology: &offchain.NOPTopology{
NOPs: []offchain.NOPConfig{
EnvironmentTopology: &ccvdeployment.EnvironmentTopology{
NOPTopology: &ccvdeployment.NOPTopology{
NOPs: []ccvdeployment.NOPConfig{
{Alias: "nop-1", Name: "nop-1"},
},
Committees: make(map[string]offchain.CommitteeConfig),
Committees: make(map[string]ccvdeployment.CommitteeConfig),
},
},
}
Expand Down Expand Up @@ -437,17 +437,17 @@ func withAggregatorWithClients(committee string, hostPort, dbPort, redisPort, re

func withTopologyCommittee(name, qualifier string, insecure bool) cfgOption {
return func(c *Cfg) {
c.EnvironmentTopology.NOPTopology.Committees[name] = offchain.CommitteeConfig{
c.EnvironmentTopology.NOPTopology.Committees[name] = ccvdeployment.CommitteeConfig{
Qualifier: qualifier,
VerifierVersion: semver.MustParse("2.0.0"),
Aggregators: []offchain.AggregatorConfig{
Aggregators: []ccvdeployment.AggregatorConfig{
{
Name: "default",
Address: fmt.Sprintf("%s-aggregator:50051", name),
InsecureAggregatorConnection: insecure,
},
},
ChainConfigs: map[string]offchain.ChainCommitteeConfig{
ChainConfigs: map[string]ccvdeployment.ChainCommitteeConfig{
"3379446385462418246": {
NOPAliases: []string{"nop-1"},
Threshold: 1,
Expand Down
8 changes: 7 additions & 1 deletion build/devenv/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ go 1.25.7

replace github.com/smartcontractkit/chainlink-ccv => ../..

replace github.com/smartcontractkit/chainlink-ccv/deployment => ../../deployment

replace github.com/smartcontractkit/chainlink-ccv/evm => ../../evm

require (
github.com/BurntSushi/toml v1.6.0
github.com/Masterminds/semver/v3 v3.4.0
Expand Down Expand Up @@ -35,7 +39,9 @@ require (
github.com/jmoiron/sqlx v1.4.0
github.com/lib/pq v1.11.1
github.com/sethvargo/go-retry v0.3.0
github.com/smartcontractkit/chainlink-ccv v0.0.0-20260218133052-8e7fe2f457f9
github.com/smartcontractkit/chainlink-ccv v0.0.0
github.com/smartcontractkit/chainlink-ccv/deployment v0.0.0
github.com/smartcontractkit/chainlink-ccv/evm v0.0.0
github.com/smartcontractkit/chainlink-common/keystore v1.0.2
github.com/smartcontractkit/chainlink-evm/gethwrappers v0.0.0-20260119171452-39c98c3b33cd
github.com/smartcontractkit/chainlink-protos/chainlink-ccv/committee-verifier v0.0.0-20251211142334-5c3421fe2c8d
Expand Down
Loading
Loading