Skip to content
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

Merged
merged 40 commits into from
Sep 16, 2024
Merged

Conversation

AnieeG
Copy link
Contributor

@AnieeG AnieeG commented Sep 6, 2024

  • Adds CCIP missing jobtype in Feeds Service and numerous other place where Job Type is validated in node before starting the service.
  • Added an integration smoke test to integrate CCIP nodes with JD in docker environment, apply changeset and send CCIP requests
  • Modified existing test assertions and actions to make these applicable for all deployment environments
  • Modified integration test config to include custom test config for CCIP
  • Exposed graphQL queries to fetch different keys from node.

Not included -

  • Adding the smoke test in CI

@AnieeG AnieeG requested review from a team as code owners September 6, 2024 03:47
@AnieeG AnieeG marked this pull request as draft September 6, 2024 03:47
@AnieeG AnieeG changed the title Feat/ccip localenv Creating Local docker tests for ccip smoke Sep 9, 2024
@AnieeG AnieeG requested a review from connorwstein September 9, 2024 14:53
@AnieeG AnieeG changed the title Creating Local docker tests for ccip smoke CCIP-3055 Creating Local docker tests for ccip smoke Sep 9, 2024
@AnieeG AnieeG requested a review from a team as a code owner September 11, 2024 16:55
Tofel
Tofel previously approved these changes Sep 12, 2024
Comment on lines 1133 to 1139
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
}
Copy link
Contributor

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

Copy link
Contributor Author

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.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unnecessary newline

Comment on lines 58 to 61
ocrKeyBundleIDs = map[string]string{
// TODO: Validate that that all EVM chains are using the same keybundle.
relay.NetworkEVM: chainConfig.Ocr2Config.OcrKeyBundle.BundleId,
}
Copy link
Contributor

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 {
Copy link
Contributor

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 {
Copy link
Contributor

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 {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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 {
Copy link
Contributor

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) (
Copy link
Contributor

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?

Copy link
Contributor

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) {
Copy link
Contributor

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 {
Copy link
Contributor

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?

@AnieeG AnieeG enabled auto-merge September 16, 2024 14:05
@Tofel Tofel self-requested a review September 16, 2024 14:12
@AnieeG AnieeG added this pull request to the merge queue Sep 16, 2024
Merged via the queue into develop with commit ac3523a Sep 16, 2024
151 of 153 checks passed
@AnieeG AnieeG deleted the feat/ccip-localenv branch September 16, 2024 14:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants