Skip to content

Commit

Permalink
Merge branch 'develop' of github.com:smartcontractkit/chainlink into …
Browse files Browse the repository at this point in the history
…move-mockadapter
  • Loading branch information
b-gopalswami committed Nov 19, 2024
2 parents 929a4aa + 7682edc commit a3a95f5
Show file tree
Hide file tree
Showing 93 changed files with 1,045 additions and 340 deletions.
5 changes: 5 additions & 0 deletions .changeset/mean-dots-move.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"chainlink": patch
---

Add config var Mercury.Transmitter.TransmitConcurrency #added
6 changes: 6 additions & 0 deletions .changeset/shiny-owls-destroy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"chainlink": patch
---

Logging improvements for LLO
#internal
5 changes: 5 additions & 0 deletions .changeset/three-mayflies-learn.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"chainlink": minor
---

#updated Update few incorrect occurences of the password for notreal@fakeemail.ch.
106 changes: 103 additions & 3 deletions .github/e2e-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -961,7 +961,7 @@ runner-test-matrix:
pyroscope_env: ci-smoke-ccipv1_6-evm-simulated
test_env_vars:
E2E_TEST_SELECTED_NETWORK: SIMULATED_1,SIMULATED_2
E2E_JD_VERSION: 0.4.0
E2E_JD_VERSION: 0.6.0

- id: smoke/ccip_usdc_test.go:*
path: integration-tests/smoke/ccip_usdc_test.go
Expand All @@ -975,7 +975,7 @@ runner-test-matrix:
pyroscope_env: ci-smoke-ccipv1_6-evm-simulated
test_env_vars:
E2E_TEST_SELECTED_NETWORK: SIMULATED_1,SIMULATED_2
E2E_JD_VERSION: 0.4.0
E2E_JD_VERSION: 0.6.0

- id: smoke/fee_boosting_test.go:*
path: integration-tests/smoke/fee_boosting_test.go
Expand All @@ -989,7 +989,107 @@ runner-test-matrix:
pyroscope_env: ci-smoke-ccipv1_6-evm-simulated
test_env_vars:
E2E_TEST_SELECTED_NETWORK: SIMULATED_1,SIMULATED_2
E2E_JD_VERSION: 0.4.0
E2E_JD_VERSION: 0.6.0

- id: smoke/ccip_rmn_test.go:^TestRMN_TwoMessagesOnTwoLanesIncludingBatching$
path: integration-tests/smoke/ccip_rmn_test.go
test_env_type: docker
runs_on: ubuntu-latest
triggers:
- PR E2E Core Tests
- Merge Queue E2E Core Tests
- Nightly E2E Tests
test_cmd: cd integration-tests/smoke && go test -test.run ^TestRMN_TwoMessagesOnTwoLanesIncludingBatching$ -timeout 12m -test.parallel=1 -count=1 -json
pyroscope_env: ci-smoke-ccipv1_6-evm-simulated
test_env_vars:
E2E_TEST_SELECTED_NETWORK: SIMULATED_1,SIMULATED_2
E2E_JD_VERSION: 0.6.0
E2E_RMN_RAGEPROXY_VERSION: master-5208d09
E2E_RMN_AFN2PROXY_VERSION: master-5208d09

- id: smoke/ccip_rmn_test.go:^TestRMN_MultipleMessagesOnOneLaneNoWaitForExec$
path: integration-tests/smoke/ccip_rmn_test.go
test_env_type: docker
runs_on: ubuntu-latest
triggers:
- PR E2E Core Tests
- Merge Queue E2E Core Tests
- Nightly E2E Tests
test_cmd: cd integration-tests/smoke && go test -test.run ^TestRMN_MultipleMessagesOnOneLaneNoWaitForExec$ -timeout 12m -test.parallel=1 -count=1 -json
pyroscope_env: ci-smoke-ccipv1_6-evm-simulated
test_env_vars:
E2E_TEST_SELECTED_NETWORK: SIMULATED_1,SIMULATED_2
E2E_JD_VERSION: 0.6.0
E2E_RMN_RAGEPROXY_VERSION: master-5208d09
E2E_RMN_AFN2PROXY_VERSION: master-5208d09

# Enable after flaking issue is resolved
# - id: smoke/ccip_rmn_test.go:^TestRMN_NotEnoughObservers$
# path: integration-tests/smoke/ccip_rmn_test.go
# test_env_type: docker
# runs_on: ubuntu-latest
# triggers:
# - PR E2E Core Tests
# - Merge Queue E2E Core Tests
# - Nightly E2E Tests
# test_cmd: cd integration-tests/smoke && go test -test.run ^TestRMN_NotEnoughObservers$ -timeout 12m -test.parallel=1 -count=1 -json
# pyroscope_env: ci-smoke-ccipv1_6-evm-simulated
# test_env_vars:
# E2E_TEST_SELECTED_NETWORK: SIMULATED_1,SIMULATED_2
# E2E_JD_VERSION: 0.6.0
# E2E_RMN_RAGEPROXY_VERSION: master-5208d09
# E2E_RMN_AFN2PROXY_VERSION: master-5208d09

- id: smoke/ccip_rmn_test.go:^TestRMN_DifferentSigners$
path: integration-tests/smoke/ccip_rmn_test.go
test_env_type: docker
runs_on: ubuntu-latest
triggers:
- PR E2E Core Tests
- Merge Queue E2E Core Tests
- Nightly E2E Tests
test_cmd: cd integration-tests/smoke && go test -test.run ^TestRMN_DifferentSigners$ -timeout 12m -test.parallel=1 -count=1 -json
pyroscope_env: ci-smoke-ccipv1_6-evm-simulated
test_env_vars:
E2E_TEST_SELECTED_NETWORK: SIMULATED_1,SIMULATED_2
E2E_JD_VERSION: 0.6.0
E2E_RMN_RAGEPROXY_VERSION: master-5208d09
E2E_RMN_AFN2PROXY_VERSION: master-5208d09

# Enable after flaking issue is resolved
# - id: smoke/ccip_rmn_test.go:^TestRMN_NotEnoughSigners$
# path: integration-tests/smoke/ccip_rmn_test.go
# test_env_type: docker
# runs_on: ubuntu-latest
# triggers:
# - PR E2E Core Tests
# - Merge Queue E2E Core Tests
# - Nightly E2E Tests
# test_cmd: cd integration-tests/smoke && go test -test.run ^TestRMN_NotEnoughSigners$ -timeout 12m -test.parallel=1 -count=1 -json
# pyroscope_env: ci-smoke-ccipv1_6-evm-simulated
# test_env_vars:
# E2E_TEST_SELECTED_NETWORK: SIMULATED_1,SIMULATED_2
# E2E_JD_VERSION: 0.6.0
# E2E_RMN_RAGEPROXY_VERSION: master-5208d09
# E2E_RMN_AFN2PROXY_VERSION: master-5208d09


- id: smoke/ccip_rmn_test.go:^TestRMN_DifferentRmnNodesForDifferentChains$
path: integration-tests/smoke/ccip_rmn_test.go
test_env_type: docker
runs_on: ubuntu-latest
triggers:
- PR E2E Core Tests
- Merge Queue E2E Core Tests
- Nightly E2E Tests
test_cmd: cd integration-tests/smoke/ && go test -test.run ^TestRMN_DifferentRmnNodesForDifferentChains$ -timeout 12m -test.parallel=1 -count=1 -json
pyroscope_env: ci-smoke-ccipv1_6-evm-simulated
test_env_vars:
E2E_TEST_SELECTED_NETWORK: SIMULATED_1,SIMULATED_2
E2E_JD_VERSION: 0.6.0
E2E_RMN_RAGEPROXY_VERSION: master-5208d09
E2E_RMN_AFN2PROXY_VERSION: master-5208d09


# END: CCIPv1.6 tests

Expand Down
22 changes: 15 additions & 7 deletions .github/workflows/find-new-flaky-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ jobs:

- name: Install flakeguard
shell: bash
run: go install github.com/smartcontractkit/chainlink-testing-framework/tools/flakeguard@9c9821d6013f4838eb26970c2eef594f4d25398b
run: go install github.com/smartcontractkit/chainlink-testing-framework/tools/flakeguard@8b02ed1703ef40755a4c46ff454cf4ff2e89275d

- name: Find new or updated test packages
if: ${{ inputs.runAllTests == false }}
Expand Down Expand Up @@ -259,7 +259,7 @@ jobs:

- name: Install flakeguard
shell: bash
run: go install github.com/smartcontractkit/chainlink-testing-framework/tools/flakeguard@9c9821d6013f4838eb26970c2eef594f4d25398b
run: go install github.com/smartcontractkit/chainlink-testing-framework/tools/flakeguard@8b02ed1703ef40755a4c46ff454cf4ff2e89275d

- name: Run tests with flakeguard
shell: bash
Expand Down Expand Up @@ -301,7 +301,7 @@ jobs:

- name: Install flakeguard
shell: bash
run: go install github.com/smartcontractkit/chainlink-testing-framework/tools/flakeguard@9c9821d6013f4838eb26970c2eef594f4d25398b
run: go install github.com/smartcontractkit/chainlink-testing-framework/tools/flakeguard@8b02ed1703ef40755a4c46ff454cf4ff2e89275d

- name: Set combined test results
id: set_test_results
Expand All @@ -316,16 +316,16 @@ jobs:
PATH=$PATH:$(go env GOPATH)/bin
export PATH
# Use flakeguard aggregate-all to aggregate test results
flakeguard aggregate-all --results-path . --output-results ../all_tests.json
# Use flakeguard to aggregate all test results
flakeguard aggregate-results --results-path . --output-results ../all_tests.json
# Count all tests
ALL_TESTS_COUNT=$(jq 'length' ../all_tests.json)
echo "All tests count: $ALL_TESTS_COUNT"
echo "all_tests_count=$ALL_TESTS_COUNT" >> "$GITHUB_OUTPUT"
# Use flakeguard aggregate-failed to filter and output failed tests based on PassRatio threshold
flakeguard aggregate-failed --threshold "${{ inputs.runThreshold }}" --min-pass-ratio=${{ env.MIN_PASS_RATIO }} --results-path . --output-results ../failed_tests.json --output-logs ../failed_test_logs.json
# Use flakeguard to filter and output failed tests based on PassRatio threshold
flakeguard aggregate-results --filter-failed=true --threshold "${{ inputs.runThreshold }}" --min-pass-ratio=${{ env.MIN_PASS_RATIO }} --results-path . --output-results ../failed_tests.json --output-logs ../failed_test_logs.json
# Count failed tests
if [ -f "../failed_tests.json" ]; then
Expand All @@ -347,6 +347,14 @@ jobs:
threshold_percentage=$(echo '${{ inputs.runThreshold }}' | awk '{printf "%.0f", $1 * 100}')
echo "threshold_percentage=$threshold_percentage" >> $GITHUB_OUTPUT
- name: Upload All Test Results as Artifact
if: ${{ fromJson(steps.set_test_results.outputs.all_tests_count) > 0 }}
uses: actions/upload-artifact@v4.4.3
with:
path: all_tests.json
name: all-test-results.json
retention-days: 7

- name: Upload Failed Test Results as Artifact
if: ${{ fromJson(steps.set_test_results.outputs.failed_tests_count) > 0 }}
uses: actions/upload-artifact@v4.4.3
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ jobs:
contents: read
needs: [build-chainlink, changes]
if: github.event_name == 'pull_request' && ( needs.changes.outputs.core_changes == 'true' || needs.changes.outputs.github_ci_changes == 'true')
uses: smartcontractkit/.github/.github/workflows/run-e2e-tests.yml@5412507526722a7b1c5d719fa686eed5a1bc4035 # ctf-run-tests@0.2.0
uses: smartcontractkit/.github/.github/workflows/run-e2e-tests.yml@27467f0073162e0ca77d33ce26f649b3d0f4c188 #ctf-run-tests@0.2.0
with:
workflow_name: Run Core E2E Tests For PR
chainlink_version: ${{ inputs.evm-ref || github.sha }}
Expand Down Expand Up @@ -251,7 +251,7 @@ jobs:
contents: read
needs: [build-chainlink, changes]
if: github.event_name == 'merge_group' && ( needs.changes.outputs.core_changes == 'true' || needs.changes.outputs.github_ci_changes == 'true')
uses: smartcontractkit/.github/.github/workflows/run-e2e-tests.yml@5412507526722a7b1c5d719fa686eed5a1bc4035 # ctf-run-tests@0.2.0
uses: smartcontractkit/.github/.github/workflows/run-e2e-tests.yml@27467f0073162e0ca77d33ce26f649b3d0f4c188 #ctf-run-tests@1.0.0
with:
workflow_name: Run Core E2E Tests For Merge Queue
chainlink_version: ${{ inputs.evm-ref || github.sha }}
Expand Down
7 changes: 7 additions & 0 deletions contracts/.changeset/wet-eyes-accept.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'@chainlink/contracts': patch
---

Refactor MockCCIPRouter to support EVMExtraArgsV2

PR issue : CCIP-4288
13 changes: 8 additions & 5 deletions contracts/gas-snapshots/ccip.gas-snapshot
Original file line number Diff line number Diff line change
Expand Up @@ -257,11 +257,14 @@ MerkleMultiProofTest:test_EmptyLeaf_Revert() (gas: 3563)
MerkleMultiProofTest:test_MerkleRoot256() (gas: 394891)
MerkleMultiProofTest:test_MerkleRootSingleLeaf_Success() (gas: 3661)
MerkleMultiProofTest:test_SpecSync_gas() (gas: 34152)
MockRouterTest:test_ccipSendWithInsufficientNativeTokens_Revert() (gas: 34081)
MockRouterTest:test_ccipSendWithInvalidMsgValue_Revert() (gas: 60886)
MockRouterTest:test_ccipSendWithLinkFeeTokenAndValidMsgValue_Success() (gas: 126575)
MockRouterTest:test_ccipSendWithLinkFeeTokenbutInsufficientAllowance_Revert() (gas: 63499)
MockRouterTest:test_ccipSendWithSufficientNativeFeeTokens_Success() (gas: 44056)
MockRouterTest:test_ccipSendWithEVMExtraArgsV1_Success() (gas: 110095)
MockRouterTest:test_ccipSendWithEVMExtraArgsV2_Success() (gas: 132614)
MockRouterTest:test_ccipSendWithInsufficientNativeTokens_Revert() (gas: 34059)
MockRouterTest:test_ccipSendWithInvalidEVMExtraArgs_Revert() (gas: 106706)
MockRouterTest:test_ccipSendWithInvalidMsgValue_Revert() (gas: 60864)
MockRouterTest:test_ccipSendWithLinkFeeTokenAndValidMsgValue_Success() (gas: 126685)
MockRouterTest:test_ccipSendWithLinkFeeTokenbutInsufficientAllowance_Revert() (gas: 63477)
MockRouterTest:test_ccipSendWithSufficientNativeFeeTokens_Success() (gas: 44070)
MultiAggregateRateLimiter_applyRateLimiterConfigUpdates:test_ConfigRateMoreThanCapacity_Revert() (gas: 16554)
MultiAggregateRateLimiter_applyRateLimiterConfigUpdates:test_ConfigRateZero_Revert() (gas: 16634)
MultiAggregateRateLimiter_applyRateLimiterConfigUpdates:test_DiableConfigCapacityNonZero_Revert() (gas: 16585)
Expand Down
15 changes: 11 additions & 4 deletions contracts/src/v0.8/ccip/test/mocks/MockRouter.sol
Original file line number Diff line number Diff line change
Expand Up @@ -121,12 +121,19 @@ contract MockCCIPRouter is IRouter, IRouterClient {

function _fromBytes(
bytes calldata extraArgs
) internal pure returns (Client.EVMExtraArgsV1 memory) {
) internal pure returns (Client.EVMExtraArgsV2 memory) {
if (extraArgs.length == 0) {
return Client.EVMExtraArgsV1({gasLimit: DEFAULT_GAS_LIMIT});
return Client.EVMExtraArgsV2({gasLimit: DEFAULT_GAS_LIMIT, allowOutOfOrderExecution: false});
}
if (bytes4(extraArgs) != Client.EVM_EXTRA_ARGS_V1_TAG) revert InvalidExtraArgsTag();
return abi.decode(extraArgs[4:], (Client.EVMExtraArgsV1));

bytes4 extraArgsTag = bytes4(extraArgs);
if (extraArgsTag == Client.EVM_EXTRA_ARGS_V2_TAG) {
return abi.decode(extraArgs[4:], (Client.EVMExtraArgsV2));
} else if (extraArgsTag == Client.EVM_EXTRA_ARGS_V1_TAG) {
return Client.EVMExtraArgsV2({gasLimit: abi.decode(extraArgs[4:], (uint256)), allowOutOfOrderExecution: false});
}

revert InvalidExtraArgsTag();
}

/// @notice Always returns true to make sure this check can be performed on any chain.
Expand Down
20 changes: 20 additions & 0 deletions contracts/src/v0.8/ccip/test/mocks/test/MockRouterTest.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -65,4 +65,24 @@ contract MockRouterTest is TokenSetup {

mockRouter.ccipSend(MOCK_CHAIN_SELECTOR, message);
}

function test_ccipSendWithEVMExtraArgsV1_Success() public {
Client.EVMExtraArgsV1 memory extraArgs = Client.EVMExtraArgsV1({gasLimit: 500_000});
message.extraArgs = Client._argsToBytes(extraArgs);
mockRouter.ccipSend{value: 0.1 ether}(MOCK_CHAIN_SELECTOR, message);
}

function test_ccipSendWithEVMExtraArgsV2_Success() public {
Client.EVMExtraArgsV2 memory extraArgs = Client.EVMExtraArgsV2({gasLimit: 500_000, allowOutOfOrderExecution: true});
message.extraArgs = Client._argsToBytes(extraArgs);
mockRouter.ccipSend{value: 0.1 ether}(MOCK_CHAIN_SELECTOR, message);
}

function test_ccipSendWithInvalidEVMExtraArgs_Revert() public {
uint256 gasLimit = 500_000;
bytes4 invalidExtraArgsTag = bytes4(keccak256("CCIP EVMExtraArgsInvalid"));
message.extraArgs = abi.encodeWithSelector(invalidExtraArgsTag, gasLimit);
vm.expectRevert(MockCCIPRouter.InvalidExtraArgsTag.selector);
mockRouter.ccipSend{value: 0.1 ether}(MOCK_CHAIN_SELECTOR, message);
}
}
19 changes: 14 additions & 5 deletions core/capabilities/targets/write_target.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"encoding/hex"
"fmt"
"math/big"
"strings"
"time"

"github.com/ethereum/go-ethereum/common"
Expand Down Expand Up @@ -186,15 +187,23 @@ func evaluate(rawRequest capabilities.CapabilityRequest) (r Request, err error)
}

if hex.EncodeToString(reportMetadata.WorkflowExecutionID[:]) != rawRequest.Metadata.WorkflowExecutionID {
return r, fmt.Errorf("WorkflowExecutionID in the report does not match WorkflowExecutionID in the request metadata. Report WorkflowExecutionID: %+v, request WorkflowExecutionID: %+v", reportMetadata.WorkflowExecutionID, rawRequest.Metadata.WorkflowExecutionID)
return r, fmt.Errorf("WorkflowExecutionID in the report does not match WorkflowExecutionID in the request metadata. Report WorkflowExecutionID: %+v, request WorkflowExecutionID: %+v", hex.EncodeToString(reportMetadata.WorkflowExecutionID[:]), rawRequest.Metadata.WorkflowExecutionID)
}

if hex.EncodeToString(reportMetadata.WorkflowOwner[:]) != rawRequest.Metadata.WorkflowOwner {
return r, fmt.Errorf("WorkflowOwner in the report does not match WorkflowOwner in the request metadata. Report WorkflowOwner: %+v, request WorkflowOwner: %+v", reportMetadata.WorkflowOwner, rawRequest.Metadata.WorkflowOwner)
// case-insensitive verification of the owner address (so that a check-summed address matches its non-checksummed version).
if !strings.EqualFold(hex.EncodeToString(reportMetadata.WorkflowOwner[:]), rawRequest.Metadata.WorkflowOwner) {
return r, fmt.Errorf("WorkflowOwner in the report does not match WorkflowOwner in the request metadata. Report WorkflowOwner: %+v, request WorkflowOwner: %+v", hex.EncodeToString(reportMetadata.WorkflowOwner[:]), rawRequest.Metadata.WorkflowOwner)
}

if hex.EncodeToString(reportMetadata.WorkflowName[:]) != rawRequest.Metadata.WorkflowName {
return r, fmt.Errorf("WorkflowName in the report does not match WorkflowName in the request metadata. Report WorkflowName: %+v, request WorkflowName: %+v", reportMetadata.WorkflowName, rawRequest.Metadata.WorkflowName)
// workflowNames are padded to 10bytes
decodedName, err := hex.DecodeString(rawRequest.Metadata.WorkflowName)
if err != nil {
return r, err
}
var workflowName [10]byte
copy(workflowName[:], decodedName)
if !bytes.Equal(reportMetadata.WorkflowName[:], workflowName[:]) {
return r, fmt.Errorf("WorkflowName in the report does not match WorkflowName in the request metadata. Report WorkflowName: %+v, request WorkflowName: %+v", hex.EncodeToString(reportMetadata.WorkflowName[:]), hex.EncodeToString(workflowName[:]))
}

if hex.EncodeToString(reportMetadata.WorkflowCID[:]) != rawRequest.Metadata.WorkflowID {
Expand Down
Loading

0 comments on commit a3a95f5

Please sign in to comment.