Skip to content

Commit

Permalink
Properly check Chainlink node count
Browse files Browse the repository at this point in the history
  • Loading branch information
kalverra committed Oct 16, 2024
1 parent a1358c5 commit 67b0a15
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions integration-tests/ccip-tests/testsetups/ccip.go
Original file line number Diff line number Diff line change
Expand Up @@ -1363,19 +1363,19 @@ func (o *CCIPTestSetUpOutputs) CreateEnvironment(
ccipEnv.NumOfCommitNodes = testConfig.TestGroupInput.NoOfCommitNodes
ccipEnv.NumOfExecNodes = ccipEnv.NumOfCommitNodes
if !pointer.GetBool(testConfig.TestGroupInput.CommitAndExecuteOnSameDON) {
if len(ccipEnv.CLNodesWithKeys) < 11 {
if len(ccipEnv.CLNodesWithKeys[chains[0].GetChainID().String()]) < 11 {
return fmt.Errorf("not enough CL nodes for separate commit and execution nodes, need at least 11 CL nodes, found %d", len(ccipEnv.CLNodesWithKeys))
}
if testConfig.TestGroupInput.NoOfCommitNodes >= totalNodes {
return fmt.Errorf("number of commit nodes can not be greater than total number of nodes in DON")
return fmt.Errorf("number of commit nodes can not be greater than total number of nodes in DON, found %d commit nodes and %d total nodes", testConfig.TestGroupInput.NoOfCommitNodes, totalNodes)
}
if ccipEnv.NumOfExecNodes < 4 {
return fmt.Errorf("insufficient number of exec nodes, need at least 4 exec nodes, found %d", ccipEnv.NumOfExecNodes)
}
// first two nodes are reserved for bootstrap commit and bootstrap exec
ccipEnv.CommitNodeStartIndex = 2
ccipEnv.ExecNodeStartIndex = 2 + testConfig.TestGroupInput.NoOfCommitNodes
ccipEnv.NumOfExecNodes = totalNodes - (2 + testConfig.TestGroupInput.NoOfCommitNodes)
if ccipEnv.NumOfExecNodes < 4 {
return fmt.Errorf("insufficient number of exec nodes")
}
}
ccipEnv.NumOfAllowedFaultyExec = (ccipEnv.NumOfExecNodes - 1) / 3
ccipEnv.NumOfAllowedFaultyCommit = (ccipEnv.NumOfCommitNodes - 1) / 3
Expand Down

0 comments on commit 67b0a15

Please sign in to comment.