Skip to content

Commit

Permalink
Fixes CI conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
kalverra committed Aug 7, 2024
1 parent df9e35a commit 0ff7c54
Show file tree
Hide file tree
Showing 10 changed files with 193 additions and 1,331 deletions.
105 changes: 103 additions & 2 deletions .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -531,6 +531,82 @@ jobs:
fail-fast: false
matrix:
product:
- name: ccip-smoke
nodes: 1
os: ubuntu-latest
file: ccip
dir: ccip-tests/smoke
run: -run ^TestSmokeCCIPForBidirectionalLane$
- name: ccip-smoke-1.4-pools
nodes: 1
os: ubuntu-latest
file: ccip
dir: ccip-tests/smoke
run: -run ^TestSmokeCCIPForBidirectionalLane$
config_path: ./integration-tests/ccip-tests/testconfig/tomls/contract-version1.4.toml
- name: ccip-smoke-usdc
nodes: 1
os: ubuntu-latest
file: ccip
dir: ccip-tests/smoke
run: -run ^TestSmokeCCIPForBidirectionalLane$
config_path: ./integration-tests/ccip-tests/testconfig/tomls/usdc_mock_deployment.toml
- name: ccip-smoke-db-compatibility
nodes: 1
os: ubuntu-latest
file: ccip
dir: ccip-tests/smoke
run: -run ^TestSmokeCCIPForBidirectionalLane$
config_path: ./integration-tests/ccip-tests/testconfig/tomls/db-compatibility.toml
- name: ccip-smoke-rate-limit
nodes: 1
dir: ccip-tests/smoke
os: ubuntu-latest
file: ccip
run: -run ^TestSmokeCCIPRateLimit$
- name: ccip-smoke-rate-limit
nodes: 1
dir: ccip-tests/smoke
os: ubuntu-latest
file: ccip
run: -run ^TestSmokeCCIPTokenPoolRateLimits$
- name: ccip-smoke-multicall
nodes: 1
dir: ccip-tests/smoke
os: ubuntu-latest
file: ccip
run: -run ^TestSmokeCCIPMulticall$
- name: ccip-smoke-manual-exec
nodes: 1
dir: ccip-tests/smoke
os: ubuntu-latest
file: ccip
run: -run ^TestSmokeCCIPManuallyExecuteAfterExecutionFailingDueToInsufficientGas$
- name: ccip-smoke-on-ramp-limits
nodes: 1
dir: ccip-tests/smoke
os: ubuntu-latest
file: ccip
run: -run ^TestSmokeCCIPOnRampLimits$
- name: ccip-smoke-off-ramp-capacity
nodes: 1
dir: ccip-tests/smoke
os: ubuntu-latest
file: ccip
run: -run ^TestSmokeCCIPOffRampCapacityLimit$
- name: ccip-smoke-off-ramp-agg-rate-limit
nodes: 1
dir: ccip-tests/smoke
os: ubuntu-latest
file: ccip
run: -run ^TestSmokeCCIPOffRampAggRateLimit$
- name: ccip-smoke-leader-lane
nodes: 15
dir: ccip-tests/smoke
os: ubuntu-latest
file: ccip
run: -run ^TestSmokeCCIPForBidirectionalLane$
config_path: ./integration-tests/ccip-tests/testconfig/tomls/leader-lane.toml
- name: runlog
id: runlog
nodes: 2
Expand Down Expand Up @@ -621,11 +697,17 @@ jobs:
- name: Build Go Test Command
id: build-go-test-command
run: |
# if dir is provided use it, otherwise use the smoke dir
if [ "${{ matrix.product.dir }}" != "" ]; then
dir=${{ matrix.product.dir }}
else
dir=smoke
fi
# if the matrix.product.run is set, use it for a different command
if [ "${{ matrix.product.run }}" != "" ]; then
echo "run_command=${{ matrix.product.run }} ./smoke/${{ matrix.product.file }}_test.go" >> "$GITHUB_OUTPUT"
echo "run_command=${{ matrix.product.run }} ./${dir}/${{ matrix.product.file }}_test.go" >> "$GITHUB_OUTPUT"
else
echo "run_command=./smoke/${{ matrix.product.name }}_test.go" >> "$GITHUB_OUTPUT"
echo "run_command=./${dir}/${{ matrix.product.name }}_test.go" >> "$GITHUB_OUTPUT"
fi
- name: Check for "enable tracing" label
id: check-label
Expand Down Expand Up @@ -693,6 +775,25 @@ jobs:
# other inputs
duplicate-authorization-header: "true"

- name: Prepare Base64 CCIP TOML secrets
uses: ./.github/actions/setup-create-base64-config-ccip
with:
runId: ${{ github.run_id }}
pyroscopeServer: ${{ matrix.product.pyroscope_env == '' && '' || !startsWith(github.ref, 'refs/tags/') && '' || secrets.QA_PYROSCOPE_INSTANCE }} # Avoid sending blank envs https://github.com/orgs/community/discussions/25725
pyroscopeEnvironment: ${{ matrix.product.pyroscope_env }}
pyroscopeKey: ${{ secrets.QA_PYROSCOPE_KEY }}
testLogCollect: ${{ vars.TEST_LOG_COLLECT }}
selectedNetworks: SIMULATED_1,SIMULATED_2
chainlinkImage: ${{ env.CHAINLINK_IMAGE }}
chainlinkVersion: ${{ github.sha }}
lokiEndpoint: https://${{ secrets.GRAFANA_INTERNAL_HOST }}/loki/api/v1/push
lokiTenantId: ${{ vars.LOKI_TENANT_ID }}
lokiBasicAuth: ${{ secrets.LOKI_BASIC_AUTH }}
logstreamLogTargets: ${{ vars.LOGSTREAM_LOG_TARGETS }}
grafanaUrl: "http://localhost:8080/primary"
grafanaDashboardUrl: "/d/ddf75041-1e39-42af-aa46-361fe4c36e9e/ci-e2e-tests-logs"
grafanaBearerToken: ${{ secrets.GRAFANA_INTERNAL_URL_SHORTENER_TOKEN }}

## Run this step when changes that require tests to be run are made
- name: Run Tests
if: needs.changes.outputs.src == 'true' || github.event_name == 'workflow_dispatch'
Expand Down
12 changes: 3 additions & 9 deletions integration-tests/ccip-tests/actions/ccip_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -4022,7 +4022,6 @@ func (c *CCIPTestEnv) ConnectToExistingNodes(envConfig *testconfig.Common) error
if err != nil {
return fmt.Errorf("failed to create chainlink client: %w for node %d config %v", err, i+1, cfg)
}
clClient.ChainlinkClient.WithRetryCount(3)
c.CLNodes = append(c.CLNodes, clClient)
c.nodeMutexes = append(c.nodeMutexes, &sync.Mutex{})
}
Expand All @@ -4036,7 +4035,7 @@ func (c *CCIPTestEnv) ConnectToDeployedNodes() error {
for _, chainlinkNode := range c.LocalCluster.ClCluster.Nodes {
c.nodeMutexes = append(c.nodeMutexes, &sync.Mutex{})
c.CLNodes = append(c.CLNodes, &client.ChainlinkK8sClient{
ChainlinkClient: chainlinkNode.API.WithRetryCount(3),
ChainlinkClient: chainlinkNode.API,
})
}
} else {
Expand All @@ -4050,17 +4049,12 @@ func (c *CCIPTestEnv) ConnectToDeployedNodes() error {
return fmt.Errorf("no CL node found")
}

for i := range chainlinkK8sNodes {
chainlinkK8sNodes[i].ChainlinkClient.WithRetryCount(3)
for range chainlinkK8sNodes {
c.nodeMutexes = append(c.nodeMutexes, &sync.Mutex{})
}
c.CLNodes = chainlinkK8sNodes
if _, exists := c.K8Env.URLs[mockserver.InternalURLsKey]; exists {
mockServer, err := ctfClient.ConnectMockServer(c.K8Env)
if err != nil {
return fmt.Errorf("failed to connect to mock server: %w", err)
}
c.MockServer = mockServer
c.MockServer = ctfClient.ConnectMockServer(c.K8Env)
}
}
return nil
Expand Down
31 changes: 0 additions & 31 deletions integration-tests/ccip-tests/actions/lm_helpers.go

This file was deleted.

120 changes: 64 additions & 56 deletions integration-tests/ccip-tests/contracts/contract_deployer.go
Original file line number Diff line number Diff line change
Expand Up @@ -1044,6 +1044,7 @@ func (e *CCIPContractsDeployer) DeployOnRamp(
MaxPerMsgGasLimit: 4_000_000,
DefaultTokenFeeUSDCents: 50,
DefaultTokenDestGasOverhead: 125_000,
DefaultTokenDestBytesOverhead: 500,
},
evm_2_evm_onramp.RateLimiterConfig{
Capacity: opts.Capacity,
Expand Down Expand Up @@ -1288,61 +1289,61 @@ func OCR2ParamsForCommit(blockTime time.Duration) contracts.OffChainAggregatorV2
// slow blocktime chains like Ethereum
if blockTime >= 10*time.Second {
return contracts.OffChainAggregatorV2Config{
DeltaProgress: config.MustNewDuration(2 * time.Minute),
DeltaResend: config.MustNewDuration(5 * time.Second),
DeltaRound: config.MustNewDuration(90 * time.Second),
DeltaGrace: config.MustNewDuration(5 * time.Second),
DeltaStage: config.MustNewDuration(60 * time.Second),
MaxDurationQuery: config.MustNewDuration(100 * time.Millisecond),
MaxDurationObservation: config.MustNewDuration(35 * time.Second),
MaxDurationReport: config.MustNewDuration(10 * time.Second),
MaxDurationShouldAcceptFinalizedReport: config.MustNewDuration(5 * time.Second),
MaxDurationShouldTransmitAcceptedReport: config.MustNewDuration(10 * time.Second),
DeltaProgress: 2 * time.Minute,
DeltaResend: 5 * time.Second,
DeltaRound: 90 * time.Second,
DeltaGrace: 5 * time.Second,
DeltaStage: 60 * time.Second,
MaxDurationQuery: 100 * time.Millisecond,
MaxDurationObservation: 35 * time.Second,
MaxDurationReport: 10 * time.Second,
MaxDurationShouldAcceptFinalizedReport: 5 * time.Second,
MaxDurationShouldTransmitAcceptedReport: 10 * time.Second,
}
}
// fast blocktime chains like Avalanche
return contracts.OffChainAggregatorV2Config{
DeltaProgress: config.MustNewDuration(2 * time.Minute),
DeltaResend: config.MustNewDuration(5 * time.Second),
DeltaRound: config.MustNewDuration(60 * time.Second),
DeltaGrace: config.MustNewDuration(5 * time.Second),
DeltaStage: config.MustNewDuration(25 * time.Second),
MaxDurationQuery: config.MustNewDuration(100 * time.Millisecond),
MaxDurationObservation: config.MustNewDuration(35 * time.Second),
MaxDurationReport: config.MustNewDuration(10 * time.Second),
MaxDurationShouldAcceptFinalizedReport: config.MustNewDuration(5 * time.Second),
MaxDurationShouldTransmitAcceptedReport: config.MustNewDuration(10 * time.Second),
DeltaProgress: 2 * time.Minute,
DeltaResend: 5 * time.Second,
DeltaRound: 60 * time.Second,
DeltaGrace: 5 * time.Second,
DeltaStage: 25 * time.Second,
MaxDurationQuery: 100 * time.Millisecond,
MaxDurationObservation: 35 * time.Second,
MaxDurationReport: 10 * time.Second,
MaxDurationShouldAcceptFinalizedReport: 5 * time.Second,
MaxDurationShouldTransmitAcceptedReport: 10 * time.Second,
}
}

func OCR2ParamsForExec(blockTime time.Duration) contracts.OffChainAggregatorV2Config {
// slow blocktime chains like Ethereum
if blockTime >= 10*time.Second {
return contracts.OffChainAggregatorV2Config{
DeltaProgress: config.MustNewDuration(2 * time.Minute),
DeltaResend: config.MustNewDuration(5 * time.Second),
DeltaRound: config.MustNewDuration(90 * time.Second),
DeltaGrace: config.MustNewDuration(5 * time.Second),
DeltaStage: config.MustNewDuration(60 * time.Second),
MaxDurationQuery: config.MustNewDuration(100 * time.Millisecond),
MaxDurationObservation: config.MustNewDuration(35 * time.Second),
MaxDurationReport: config.MustNewDuration(10 * time.Second),
MaxDurationShouldAcceptFinalizedReport: config.MustNewDuration(5 * time.Second),
MaxDurationShouldTransmitAcceptedReport: config.MustNewDuration(10 * time.Second),
DeltaProgress: 2 * time.Minute,
DeltaResend: 5 * time.Second,
DeltaRound: 90 * time.Second,
DeltaGrace: 5 * time.Second,
DeltaStage: 60 * time.Second,
MaxDurationQuery: 100 * time.Millisecond,
MaxDurationObservation: 35 * time.Second,
MaxDurationReport: 10 * time.Second,
MaxDurationShouldAcceptFinalizedReport: 5 * time.Second,
MaxDurationShouldTransmitAcceptedReport: 10 * time.Second,
}
}
// fast blocktime chains like Avalanche
return contracts.OffChainAggregatorV2Config{
DeltaProgress: config.MustNewDuration(120 * time.Second),
DeltaResend: config.MustNewDuration(5 * time.Second),
DeltaRound: config.MustNewDuration(30 * time.Second),
DeltaGrace: config.MustNewDuration(5 * time.Second),
DeltaStage: config.MustNewDuration(10 * time.Second),
MaxDurationQuery: config.MustNewDuration(100 * time.Millisecond),
MaxDurationObservation: config.MustNewDuration(35 * time.Second),
MaxDurationReport: config.MustNewDuration(10 * time.Second),
MaxDurationShouldAcceptFinalizedReport: config.MustNewDuration(5 * time.Second),
MaxDurationShouldTransmitAcceptedReport: config.MustNewDuration(10 * time.Second),
DeltaProgress: 120 * time.Second,
DeltaResend: 5 * time.Second,
DeltaRound: 30 * time.Second,
DeltaGrace: 5 * time.Second,
DeltaStage: 10 * time.Second,
MaxDurationQuery: 100 * time.Millisecond,
MaxDurationObservation: 35 * time.Second,
MaxDurationReport: 10 * time.Second,
MaxDurationShouldAcceptFinalizedReport: 5 * time.Second,
MaxDurationShouldTransmitAcceptedReport: 10 * time.Second,
}
}

Expand All @@ -1363,8 +1364,8 @@ func OffChainAggregatorV2ConfigWithNodes(numberNodes int, inflightExpiry time.Du
if faultyNodes == 0 {
faultyNodes = 1
}
if cfg.DeltaStage == nil {
cfg.DeltaStage = config.MustNewDuration(inflightExpiry)
if cfg.DeltaStage == 0 {
cfg.DeltaStage = inflightExpiry
}
return contracts.OffChainAggregatorV2Config{
DeltaProgress: cfg.DeltaProgress,
Expand Down Expand Up @@ -1400,7 +1401,8 @@ func NewCommitOffchainConfig(
TokenPriceHeartBeat config.Duration,
TokenPriceDeviationPPB uint32,
InflightCacheExpiry config.Duration,
priceReportingDisabled bool) (ccipconfig.OffchainConfig, error) {
_ bool, // TODO: priceReportingDisabled added after this merge
) (ccipconfig.OffchainConfig, error) {
switch VersionMap[CommitStoreContract] {
case Latest:
return testhelpers.NewCommitOffchainConfig(
Expand All @@ -1410,7 +1412,6 @@ func NewCommitOffchainConfig(
TokenPriceHeartBeat,
TokenPriceDeviationPPB,
InflightCacheExpiry,
priceReportingDisabled,
), nil
case V1_2_0:
return testhelpers_1_4_0.NewCommitOffchainConfig(
Expand All @@ -1420,7 +1421,6 @@ func NewCommitOffchainConfig(
TokenPriceHeartBeat,
TokenPriceDeviationPPB,
InflightCacheExpiry,
priceReportingDisabled,
), nil
default:
return nil, fmt.Errorf("version not supported: %s", VersionMap[CommitStoreContract])
Expand Down Expand Up @@ -1450,7 +1450,15 @@ func NewExecOnchainConfig(
) (abihelpers.AbiDefined, error) {
switch VersionMap[OffRampContract] {
case Latest:
return testhelpers.NewExecOnchainConfig(PermissionLessExecutionThresholdSeconds, Router, PriceRegistry, MaxNumberOfTokensPerMsg, MaxDataBytes), nil
return testhelpers.NewExecOnchainConfig(
PermissionLessExecutionThresholdSeconds,
Router,
PriceRegistry,
MaxNumberOfTokensPerMsg,
MaxDataBytes,
MaxPoolReleaseOrMintGas, // TODO: obsolete soon after this merge
50_000, // TODO: MaxTokenTransferGas, obsolete soon after this merge
), nil
case V1_2_0:
return testhelpers_1_4_0.NewExecOnchainConfig(
PermissionLessExecutionThresholdSeconds,
Expand Down Expand Up @@ -1557,20 +1565,20 @@ func NewOffChainAggregatorV2ConfigForCCIPPlugin[T ccipconfig.OffchainConfig](
}

_, _, f_, onchainConfig_, offchainConfigVersion, offchainConfig, err = ocrconfighelper2.ContractSetConfigArgsForTests(
ocrConfig.DeltaProgress.Duration(),
ocrConfig.DeltaResend.Duration(),
ocrConfig.DeltaRound.Duration(),
ocrConfig.DeltaGrace.Duration(),
ocrConfig.DeltaStage.Duration(),
ocrConfig.DeltaProgress,
ocrConfig.DeltaResend,
ocrConfig.DeltaRound,
ocrConfig.DeltaGrace,
ocrConfig.DeltaStage,
ocrConfig.RMax,
ocrConfig.S,
ocrConfig.Oracles,
ocrConfig.ReportingPluginConfig,
ocrConfig.MaxDurationQuery.Duration(),
ocrConfig.MaxDurationObservation.Duration(),
ocrConfig.MaxDurationReport.Duration(),
ocrConfig.MaxDurationShouldAcceptFinalizedReport.Duration(),
ocrConfig.MaxDurationShouldTransmitAcceptedReport.Duration(),
ocrConfig.MaxDurationQuery,
ocrConfig.MaxDurationObservation,
ocrConfig.MaxDurationReport,
ocrConfig.MaxDurationShouldAcceptFinalizedReport,
ocrConfig.MaxDurationShouldTransmitAcceptedReport,
ocrConfig.F,
ocrConfig.OnchainConfig,
)
Expand Down
Loading

0 comments on commit 0ff7c54

Please sign in to comment.