-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CCIP-3055 Creating Local docker tests for ccip smoke #14357
Conversation
…feat/ccip-localenv
…feat/ccip-localenv
core/services/job/orm.go
Outdated
if err != nil { | ||
if !errors.Is(err, sql.ErrNoRows) { | ||
err = fmt.Errorf("error searching for job for CCIP (capabilityName,capabilityVersion) ('%s','%s'): %w", spec.CapabilityLabelledName, spec.CapabilityVersion, err) | ||
} | ||
err = fmt.Errorf("FindJobIDByCapabilityNameAndVersion failed: %w", err) | ||
return | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Error handling logic here feels kinda clunky. If sql.ErrNoRows
is not an error in this particular scenario, why not do something like this:
if err != nil && !errors.Is(err, sql.ErrNoRows) {
return fmt.Errorf(FindJobIDByCapabilityNameAndVersion failed: %w", err)
}
return nil
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Blindly followed existing FindJob methods like FindOCR2JobIDByAddress
. you are right,changed
@@ -183,17 +183,18 @@ func DeployCCIPContracts(e deployment.Environment, c DeployCCIPContractConfig) ( | |||
} | |||
|
|||
// For each chain, we create a DON on the home chain. | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unnecessary newline
ocrKeyBundleIDs = map[string]string{ | ||
// TODO: Validate that that all EVM chains are using the same keybundle. | ||
relay.NetworkEVM: chainConfig.Ocr2Config.OcrKeyBundle.BundleId, | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah yeah good find, I guess we don't need this field for the bootstrap job
@@ -73,3 +78,117 @@ func NewDeployedTestEnvironment(t *testing.T, lggr logger.Logger) DeployedTestEn | |||
Nodes: nodes, | |||
} | |||
} | |||
|
|||
type DeployedLocalDevEnvironment struct { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Go doc comment on this struct would be useful
} | ||
} | ||
|
||
func AddLanesForAll(e deployment.Environment, state CCIPOnChainState) error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Go doc comment on this would be nice
// it works under assumption that the node is already registered with the job distributor | ||
// expects bootstrap nodes to have type label set as bootstrap | ||
// It fetches the account address, peer id, OCR2 key bundle id and creates the JobDistributorChainConfig | ||
func (n *Node) CreateCCIPOCR2SupportedChains(ctx context.Context, chains []ChainConfig) error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
func (n *Node) CreateCCIPOCR2SupportedChains(ctx context.Context, chains []ChainConfig) error { | |
func (n *Node) CreateCCIPOCR3SupportedChains(ctx context.Context, chains []ChainConfig) error { |
// fetch node labels to know if the node is bootstrap or plugin | ||
isBootstrap := false | ||
for _, label := range n.labels { | ||
if label.Key == NodeLabelType && pointer.GetString(label.Value) == NodeLabelBootstrap { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I recommend renaming NodeLabelType
to NodeLabelKeyType
} | ||
|
||
// DeployPrivateChains deploys private chains and returns the chain configs and a function to deploy the Chainlink nodes | ||
func DeployPrivateChains(t *testing.T) ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does "private" mean in this context?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also this function is massive and would benefit from splitting it up into multiple smaller functions to make it easier to understand.
creds credentials.TransportCredentials | ||
} | ||
|
||
func NewClientConnection(cfg JDConfig) (*grpc.ClientConn, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NewClientConnection to what? If this is connecting to JD, lets add that in the func name. The package is just devenv
so it doesn't give me much info as to what kind of client this is creating.
@@ -197,3 +224,8 @@ func NodeInfo(nodeIDs []string, oc OffchainClient) (Nodes, error) { | |||
|
|||
return nodes, nil | |||
} | |||
|
|||
type RegistryConfig struct { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This type is duplicated elsewhere, maybe consolidate?
Quality Gate passedIssues Measures |
Not included -