diff --git a/.changeset/fresh-lobsters-fly.md b/.changeset/fresh-lobsters-fly.md new file mode 100644 index 00000000000..12b9c317dcb --- /dev/null +++ b/.changeset/fresh-lobsters-fly.md @@ -0,0 +1,5 @@ +--- +"chainlink": minor +--- + +#internal Refactored ChainComponents tests to run in parallel diff --git a/.changeset/sour-hairs-cross.md b/.changeset/sour-hairs-cross.md new file mode 100644 index 00000000000..fa12a38b5be --- /dev/null +++ b/.changeset/sour-hairs-cross.md @@ -0,0 +1,5 @@ +--- +"chainlink": patch +--- + +#internal depreciate keystone deployment library diff --git a/.github/actions/golangci-lint/action.yml b/.github/actions/golangci-lint/action.yml index 22a35682c2d..8fa3e1775d0 100644 --- a/.github/actions/golangci-lint/action.yml +++ b/.github/actions/golangci-lint/action.yml @@ -26,12 +26,14 @@ runs: # Only do a full checkout on merge_groups if: github.event_name == 'merge_group' with: + persist-credentials: false fetch-depth: 0 - name: Checkout repo uses: actions/checkout@v4.2.1 if: github.event_name != 'merge_group' with: + persist-credentials: false fetch-depth: 1 - name: Setup Go diff --git a/.github/actions/goreleaser-build-sign-publish/README.md b/.github/actions/goreleaser-build-sign-publish/README.md index afea60e1203..9b520c1741a 100644 --- a/.github/actions/goreleaser-build-sign-publish/README.md +++ b/.github/actions/goreleaser-build-sign-publish/README.md @@ -24,6 +24,8 @@ jobs: steps: - name: Checkout repository uses: actions/checkout@v4.2.1 + with: + persist-credentials: false - name: Configure aws credentials uses: aws-actions/configure-aws-credentials@010d0da01d0b5a38af31e9c3470dbfdabdecca3a # v4.0.1 with: diff --git a/.github/workflows/automation-ondemand-tests.yml b/.github/workflows/automation-ondemand-tests.yml index eef02dcddb2..ee917da0e56 100644 --- a/.github/workflows/automation-ondemand-tests.yml +++ b/.github/workflows/automation-ondemand-tests.yml @@ -52,45 +52,56 @@ jobs: outputs: test_list: ${{ steps.set-tests.outputs.test_list }} require_chainlink_image_versions_in_qa_ecr: ${{ steps.determine-chainlink-image-check.outputs.require_chainlink_image_versions_in_qa_ecr }} + env: + GH_INPUTS_CHAINLINK_IMAGE: ${{ inputs.chainlinkImage }} + GH_INPUTS_CHAINLINK_IMAGE_UPDATE: ${{ inputs.chainlinkImageUpdate }} + GH_INPUTS_CHAINLINK_VERSION: ${{ inputs.chainlinkVersion }} + GH_INPUTS_CHAINLINK_VERSION_UPDATE: ${{ inputs.chainlinkVersionUpdate }} steps: - name: Determine build to use id: determine-build shell: bash run: | - if [[ "${{ inputs.chainlinkImage }}" == "QA_ECR" ]]; then + if [[ "$GH_INPUTS_CHAINLINK_IMAGE" == "QA_ECR" ]]; then echo "image='{{ env.QA_CHAINLINK_IMAGE }}'" >> $GITHUB_ENV else - echo "image=${{ inputs.chainlinkImage }}" >> $GITHUB_ENV + echo "image=$GH_INPUTS_CHAINLINK_IMAGE" >> $GITHUB_ENV fi - if [[ "${{ inputs.chainlinkImageUpdate }}" == "QA_ECR" ]]; then + if [[ "$GH_INPUTS_CHAINLINK_IMAGE_UPDATE" == "QA_ECR" ]]; then echo "upgrade_image='{{ env.QA_CHAINLINK_IMAGE }}'" >> $GITHUB_ENV else - echo "upgrade_image=${{ inputs.chainlinkImageUpdate }}" >> $GITHUB_ENV + echo "upgrade_image=$GH_INPUTS_CHAINLINK_IMAGE_UPDATE" >> $GITHUB_ENV fi - if [[ -z "${{ inputs.chainlinkVersion }}" ]] && [[ "${{ inputs.chainlinkImage }}" == "QA_ECR" ]]; then + if [[ -z "$GH_INPUTS_CHAINLINK_VERSION" ]] && [[ "$CHAINLINK_IMAGE" == "QA_ECR" ]]; then echo "version=${{ github.sha }}" >> $GITHUB_ENV else - echo "version=${{ inputs.chainlinkVersion }}" >> $GITHUB_ENV + echo "version=$GH_INPUTS_CHAINLINK_VERSION" >> $GITHUB_ENV fi - if [[ -z "${{ inputs.chainlinkVersionUpdate }}" ]] && [[ "${{ inputs.chainlinkImageUpdate }}" == "QA_ECR" ]]; then + if [[ -z "$GH_INPUTS_CHAINLINK_VERSION_UPDATE" ]] && [[ "$GH_INPUTS_CHAINLINK_IMAGE_UPDATE" == "QA_ECR" ]]; then echo "upgrade_version=${{ github.sha }}" >> $GITHUB_ENV else - echo "upgrade_version=${{ inputs.chainlinkVersionUpdate }}" >> $GITHUB_ENV + echo "upgrade_version=$GH_INPUTS_CHAINLINK_VERSION_UPDATE" >> $GITHUB_ENV fi - name: Check if chainlink image check required id: determine-chainlink-image-check shell: bash + env: + CHAINLKINK_IMAGE: ${{ github.event.inputs.chainlinkImage }} + CHAINLINK_IMAGE_UPDATE: ${{ github.event.inputs.chainlinkImageUpdate }} run: | chainlink_image_versions="" - if [ "${{ github.event.inputs.chainlinkImage }}" = "QA_ECR" ]; then + if [ "$CHAINLKINK_IMAGE" = "QA_ECR" ]; then chainlink_image_versions+="${{ env.version }}," fi - if [ "${{ github.event.inputs.chainlinkImageUpdate }}" = "QA_ECR" ]; then + if [ "$CHAINLINK_IMAGE_UPDATE" = "QA_ECR" ]; then chainlink_image_versions+="${{ env.upgrade_version }}" fi echo "require_chainlink_image_versions_in_qa_ecr=$chainlink_image_versions" >> $GITHUB_OUTPUT - name: Set tests to run id: set-tests + env: + GH_EVENT_INPUTS_ENABLE_REORG: ${{ github.event.inputs.enableReorg }} + GH_EVENT_INPUTS_ENABLE_CHAOS: ${{ github.event.inputs.enableChaos }} run: | # Always run upgrade tests @@ -118,7 +129,7 @@ jobs: EOF # Run reorg tests if enabled - if [[ "${{ github.event.inputs.enableReorg }}" == 'true' ]]; then + if [[ "$GH_EVENT_INPUTS_ENABLE_REORG" == 'true' ]]; then cat >> test_list.yaml <> test_list.yaml <> $GITHUB_OUTPUT elif [ "$GITHUB_EVENT_NAME" = "workflow_dispatch" ]; then - if [ -n "${{ github.event.inputs.base64TestList }}" ]; then + if [ -n "$GH_EVENT_INPUTS_BASE64_TEST_LIST" ]; then echo "Base64-ed Test Input provided, ignoring EVM implementations" else - echo "Will test following EVM implementations: ${{ github.event.inputs.evmImplementations }}" - echo "evm_implementations=${{ github.event.inputs.evmImplementations }}" >> $GITHUB_OUTPUT + echo "Will test following EVM implementations: $GH_EVENT_INPUTS_EVM_IMPLEMENTATIONS" + echo "evm_implementations=$GH_EVENT_INPUTS_EVM_IMPLEMENTATIONS" >> $GITHUB_OUTPUT fi else echo "Will test all EVM implementations" @@ -196,6 +202,12 @@ jobs: fi - name: Select Chainlink version id: select-chainlink-version + env: + GH_EVENT_INPUTS_CHAINLINK_VERSION: ${{ github.event.inputs.chainlinkVersion }} + GH_EVENT_PULL_REQUEST_HEAD_SHA: ${{ github.event.pull_request.head.sha }} + GH_EVENT_MERGE_GROUP_HEAD_SHA: ${{ github.event.merge_group.head_sha }} + GH_REF_NAME: ${{ github.ref_name }} + GH_SHA: ${{ github.sha }} run: | PATH=$PATH:$(go env GOPATH)/bin export PATH @@ -209,9 +221,9 @@ jobs: cl_ref_path="releases" elif [ "$GITHUB_EVENT_NAME" = "workflow_dispatch" ]; then echo "Fetching Chainlink version from input" - if [ -n "${{ github.event.inputs.chainlinkVersion }}" ]; then + if [ -n "$GH_EVENT_INPUTS_CHAINLINK_VERSION" ]; then echo "Chainlink version provided in input" - chainlink_version="${{ github.event.inputs.chainlinkVersion }}" + chainlink_version="$GH_EVENT_INPUTS_CHAINLINK_VERSION" if [[ "$chainlink_version" =~ ^[0-9a-f]{40}$ ]]; then cl_ref_path="commit" chainlink_image_version=$chainlink_version @@ -222,23 +234,23 @@ jobs: fi else echo "Chainlink version not provided in input. Using latest commit SHA." - chainlink_version=${{ github.sha }} + chainlink_version=$GH_SHA chainlink_image_version=$chainlink_version cl_ref_path="commit" fi elif [ "$GITHUB_EVENT_NAME" = "pull_request" ]; then echo "Fetching Chainlink version from PR's head commit" - chainlink_version="${{ github.event.pull_request.head.sha }}" + chainlink_version="$GH_EVENT_PULL_REQUEST_HEAD_SHA" chainlink_image_version=$chainlink_version cl_ref_path="commit" elif [ "$GITHUB_EVENT_NAME" = "merge_queue" ]; then echo "Fetching Chainlink version from merge queue's head commit" - chainlink_version="${{ github.event.merge_group.head_sha }}" + chainlink_version="$GH_EVENT_MERGE_GROUP_HEAD_SHA" chainlink_image_version=$chainlink_version cl_ref_path="commit" elif [ "$GITHUB_REF_TYPE" = "tag" ]; then echo "Fetching Chainlink version from tag" - chainlink_version="${{ github.ref_name }}" + chainlink_version="$GH_REF_NAME" # strip the 'v' from the version, because we tag our Docker images without it chainlink_image_version="${chainlink_version#v}" cl_ref_path="releases" @@ -253,13 +265,16 @@ jobs: echo "cl_ref_path=$cl_ref_path" >> $GITHUB_OUTPUT - name: Get image count id: get-image-count + env: + GH_EVENT_INPUTS_BASE64_TEST_LIST: ${{ github.event.inputs.base64TestList }} + GH_EVENT_INPUTS_LATEST_VERSIONS_NUMBER: ${{ github.event.inputs.latestVersionsNumber }} run: | if [ "$GITHUB_EVENT_NAME" = "workflow_dispatch" ]; then echo "Fetching latest image count from input" - if [ -n "${{ github.event.inputs.base64TestList }}" ]; then + if [ -n "$GH_EVENT_INPUTS_BASE64_TEST_LIST" ]; then echo "Base64-ed Test Input provided, ignoring latest image count" else - image_count="${{ github.event.inputs.latestVersionsNumber }}" + image_count="$GH_EVENT_INPUTS_LATEST_VERSIONS_NUMBER" echo "image_count=$image_count" >> $GITHUB_OUTPUT fi else @@ -326,6 +341,7 @@ jobs: - name: Checkout the repo uses: actions/checkout@v4.2.1 with: + persist-credentials: false ref: ${{ needs.select-versions.outputs.chainlink_version }} - name: Build Chainlink Image uses: ./.github/actions/build-chainlink-image @@ -595,6 +611,7 @@ jobs: - name: Checkout the repo uses: actions/checkout@v4.2.1 with: + persist-credentials: false repository: smartcontractkit/chainlink ref: ${{ needs.select-versions.outputs.chainlink_version }} - name: Setup GAP for Grafana @@ -851,6 +868,7 @@ jobs: - name: Checkout the repo uses: actions/checkout@v4.2.1 with: + persist-credentials: false ref: ${{ needs.select-versions.outputs.chainlink_version }} - name: Get test results for ${{ matrix.product }} id: get-product-results diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index d90139e5292..c0294645465 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -23,6 +23,7 @@ jobs: - name: Checkout the repo uses: actions/checkout@v4.2.1 with: + persist-credentials: false repository: smartcontractkit/chainlink - uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2 id: changes @@ -55,6 +56,8 @@ jobs: steps: - name: Checkout repository uses: actions/checkout@v4.2.1 + with: + persist-credentials: false - name: Set up Go if: ${{ matrix.type.language == 'go' && matrix.type.should-run == 'true' }} diff --git a/.github/workflows/crib-integration-test.yml b/.github/workflows/crib-integration-test.yml index a6f995d57ba..4592bdbb70a 100644 --- a/.github/workflows/crib-integration-test.yml +++ b/.github/workflows/crib-integration-test.yml @@ -20,6 +20,8 @@ jobs: steps: - name: Checkout repository uses: actions/checkout@v4.2.1 + with: + persist-credentials: false - uses: cachix/install-nix-action@ba0dd844c9180cbf77aa72a116d6fbc515d0e87b # v27 with: @@ -93,6 +95,8 @@ jobs: product-image: ${{ secrets.AWS_SDLC_ECR_HOSTNAME }}/chainlink product-image-tag: develop - uses: actions/checkout@v4.2.1 + with: + persist-credentials: false - name: Set up Go uses: ./.github/actions/setup-go with: diff --git a/.github/workflows/delete-caches.yml b/.github/workflows/delete-caches.yml index 64b9e799665..aa714d38815 100644 --- a/.github/workflows/delete-caches.yml +++ b/.github/workflows/delete-caches.yml @@ -21,7 +21,9 @@ jobs: PR_NUMBER: ${{ github.event.pull_request.number }} steps: - name: Check out code - uses: actions/checkout@v4.1.2 + uses: actions/checkout@v4.2.1 + with: + persist-credentials: false - name: Setup gh-actions-cache extension env: diff --git a/.github/workflows/delete-deployments.yml b/.github/workflows/delete-deployments.yml index 547b29bceec..ff24db42229 100644 --- a/.github/workflows/delete-deployments.yml +++ b/.github/workflows/delete-deployments.yml @@ -12,6 +12,8 @@ jobs: steps: - name: Checkout repo uses: actions/checkout@v4.2.1 + with: + persist-credentials: false - name: Clean up integration environment uses: ./.github/actions/delete-deployments diff --git a/.github/workflows/dependency-check.yml b/.github/workflows/dependency-check.yml index 4b2a2f32f79..0b09747f509 100644 --- a/.github/workflows/dependency-check.yml +++ b/.github/workflows/dependency-check.yml @@ -26,6 +26,8 @@ jobs: steps: - name: Checkout repository uses: actions/checkout@v4.2.1 + with: + persist-credentials: false - name: Set up Go if: needs.changes.outputs.src == 'true' diff --git a/.github/workflows/flakeguard-nightly.yml b/.github/workflows/flakeguard-nightly.yml index 178d43d809a..025cca6d0a0 100644 --- a/.github/workflows/flakeguard-nightly.yml +++ b/.github/workflows/flakeguard-nightly.yml @@ -21,4 +21,5 @@ jobs: secrets: SLACK_BOT_TOKEN: ${{ secrets.QA_SLACK_API_KEY }} GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - + FLAKEGUARD_SPLUNK_ENDPOINT: ${{ secrets.FLAKEGUARD_SPLUNK_ENDPOINT }} + FLAKEGUARD_SPLUNK_HEC: ${{ secrets.FLAKEGUARD_SPLUNK_HEC }} diff --git a/.github/workflows/flakeguard-on-demand.yml b/.github/workflows/flakeguard-on-demand.yml index 4508da30e6b..f6df40616f7 100644 --- a/.github/workflows/flakeguard-on-demand.yml +++ b/.github/workflows/flakeguard-on-demand.yml @@ -69,4 +69,5 @@ jobs: secrets: SLACK_BOT_TOKEN: ${{ secrets.QA_SLACK_API_KEY }} GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - \ No newline at end of file + FLAKEGUARD_SPLUNK_ENDPOINT: ${{ secrets.FLAKEGUARD_SPLUNK_ENDPOINT }} + FLAKEGUARD_SPLUNK_HEC: ${{ secrets.FLAKEGUARD_SPLUNK_HEC }} diff --git a/.github/workflows/flakeguard.yml b/.github/workflows/flakeguard.yml index 3951c356a3b..e1c7bbb5f36 100644 --- a/.github/workflows/flakeguard.yml +++ b/.github/workflows/flakeguard.yml @@ -6,6 +6,7 @@ on: repoUrl: required: true type: string + default: 'https://github.com/smartcontractkit/chainlink' description: 'The URL of the repository to compare changes for detecting flaky tests.' projectPath: required: true @@ -54,6 +55,12 @@ on: required: false GH_TOKEN: required: true + FLAKEGUARD_SPLUNK_ENDPOINT: + description: "The Splunk HTTP Event Collector (HEC) endpoint." + required: true + FLAKEGUARD_SPLUNK_HEC: + description: "The Splunk HTTP Event Collector (HEC) token." + required: true env: GIT_BASE_REF: ${{ inputs.baseRef }} @@ -84,8 +91,9 @@ jobs: git_base_sha: ${{ steps.get_commit_sha.outputs.git_base_sha }} steps: - name: Checkout repository - uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2 + uses: actions/checkout@v4.2.1 with: + persist-credentials: false fetch-depth: 0 ref: ${{ env.GIT_HEAD_REF }} @@ -116,14 +124,15 @@ jobs: echo "git_base_sha=" >> $GITHUB_OUTPUT fi - - name: Set up Go 1.21.9 - uses: actions/setup-go@v5.0.2 + - name: Setup Go + uses: ./.github/actions/setup-go with: - cache: false + restore-build-cache-only: "true" - name: Install flakeguard + if: ${{ inputs.runAllTests == false }} shell: bash - run: go install github.com/smartcontractkit/chainlink-testing-framework/tools/flakeguard@ea4ffd8c51ce02efebf5ea6bca503fe10b6cee92 # flakguard@0.1.0 + run: go install github.com/smartcontractkit/chainlink-testing-framework/tools/flakeguard@7c45cff27ac6b0d4244754660661cdbfcfaf2f9e # flakguard@0.1.0 - name: Find new or updated test packages if: ${{ inputs.runAllTests == false }} @@ -132,11 +141,14 @@ jobs: env: # Needed to run go test -list CL_DATABASE_URL: postgresql://postgres@localhost:5432/chainlink_test?sslmode=disable + GH_INPUTS_PROJECT_PATH: ${{ inputs.projectPath }} + GH_INPUTS_FIND_BY_TEST_FILES_DIFF: ${{ inputs.findByTestFilesDiff }} + GH_INPUTS_FIND_BY_AFFECTED_PACKAGES: ${{ inputs.findByAffectedPackages }} run: | PATH=$PATH:$(go env GOPATH)/bin export PATH - PACKAGES=$(flakeguard find --find-by-test-files-diff=${{ inputs.findByTestFilesDiff }} --find-by-affected-packages=${{ inputs.findByAffectedPackages }} --base-ref=origin/${{ env.GIT_BASE_REF }} --project-path=${{ inputs.projectPath }}) + PACKAGES=$(flakeguard find --find-by-test-files-diff=$GH_INPUTS_FIND_BY_TEST_FILES_DIFF --find-by-affected-packages=$GH_INPUTS_FIND_BY_AFFECTED_PACKAGES --base-ref=origin/${{ env.GIT_BASE_REF }} --project-path=${GH_INPUTS_PROJECT_PATH}) echo $PACKAGES echo "packages=$PACKAGES" >> $GITHUB_OUTPUT @@ -147,19 +159,22 @@ jobs: env: # Needed to run go test -list CL_DATABASE_URL: postgresql://postgres@localhost:5432/chainlink_test?sslmode=disable + GH_INPUTS_PROJECT_PATH: ${{ inputs.projectPath }} run: | PATH=$PATH:$(go env GOPATH)/bin export PATH - TEST_FILES=$(flakeguard find --only-show-changed-test-files=true --base-ref=origin/${{ env.GIT_BASE_REF }} --project-path=${{ inputs.projectPath }}) + TEST_FILES=$(flakeguard find --only-show-changed-test-files=true --base-ref=origin/${{ env.GIT_BASE_REF }} --project-path=${GH_INPUTS_PROJECT_PATH}) echo $TEST_FILES echo "test_files=$TEST_FILES" >> $GITHUB_OUTPUT - name: Split test packages into groups id: split-packages shell: bash + env: + GH_INPUTS_RUN_ALL_TESTS: ${{ inputs.runAllTests }} run: | - if [[ "${{ inputs.runAllTests }}" == "true" ]]; then + if [[ "$GH_INPUTS_RUN_ALL_TESTS" == "true" ]]; then # Use ALL_TESTS_RUNNER for a specified number of groups, each with "./..." to run all tests ALL_TESTS_RUNNER_COUNT=${{ env.ALL_TESTS_RUNNER_COUNT }} @@ -227,8 +242,9 @@ jobs: DB_URL: postgresql://postgres:postgres@localhost:5432/chainlink_test?sslmode=disable steps: - name: Checkout repository - uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2 + uses: actions/checkout@v4.2.1 with: + persist-credentials: false ref: ${{ env.GIT_HEAD_REF }} - name: Setup NodeJS @@ -272,8 +288,10 @@ jobs: - name: Go mod tidy shell: bash + env: + GH_INPUTS_PROJECT_PATH: ${{ inputs.projectPath }} run: | - cd ${{ inputs.projectPath }} + cd $GH_INPUTS_PROJECT_PATH go mod tidy - name: Generate random id @@ -282,13 +300,15 @@ jobs: - name: Install flakeguard shell: bash - run: go install github.com/smartcontractkit/chainlink-testing-framework/tools/flakeguard@ea4ffd8c51ce02efebf5ea6bca503fe10b6cee92 # flakguard@0.1.0 + run: go install github.com/smartcontractkit/chainlink-testing-framework/tools/flakeguard@7c45cff27ac6b0d4244754660661cdbfcfaf2f9e # flakguard@0.1.0 - name: Run tests with flakeguard shell: bash - run: flakeguard run --project-path=${{ inputs.projectPath }} --test-packages=${{ matrix.testPackages }} --run-count=${{ env.TEST_REPEAT_COUNT }} --max-pass-ratio=${{ inputs.maxPassRatio }} --race=${{ env.RUN_WITH_RACE }} --shuffle=${{ env.RUN_WITH_SHUFFLE }} --shuffle-seed=${{ env.SHUFFLE_SEED }} --skip-tests=${{ env.SKIPPED_TESTS }} --output-json=test-result.json --omit-test-outputs-on-success=${{ env.OMIT_TEST_OUTPUTS_ON_SUCCESS }} env: + GH_INPUTS_PROJECT_PATH: ${{ inputs.projectPath }} + GH_INPUTS_MAX_PASS_RATIO: ${{ inputs.maxPassRatio }} CL_DATABASE_URL: ${{ env.DB_URL }} + run: flakeguard run --project-path=$GH_INPUTS_PROJECT_PATH} --test-packages=${{ matrix.testPackages }} --run-count=${{ env.TEST_REPEAT_COUNT }} --max-pass-ratio=$GH_INPUTS_MAX_PASS_RATIO --race=${{ env.RUN_WITH_RACE }} --shuffle=${{ env.RUN_WITH_SHUFFLE }} --shuffle-seed=${{ env.SHUFFLE_SEED }} --skip-tests=${{ env.SKIPPED_TESTS }} --output-json=test-result.json --omit-test-outputs-on-success=${{ env.OMIT_TEST_OUTPUTS_ON_SUCCESS }} - name: Upload test result as artifact if: always() @@ -307,17 +327,24 @@ jobs: test_results: ${{ steps.results.outputs.results }} steps: - name: Checkout repository - uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2 + uses: actions/checkout@v4.2.1 with: + persist-credentials: false ref: ${{ env.GIT_HEAD_REF }} + - name: Setup Go + uses: ./.github/actions/setup-go + with: + restore-build-cache-only: "true" - name: Set Pretty Project Path id: set_project_path_pretty + env: + GH_INPUTS_PROJECT_PATH: ${{ inputs.projectPath }} run: | - if [ "${{ inputs.projectPath }}" = "." ]; then + if [ "$GH_INPUTS_PROJECT_PATH" = "." ]; then echo "path=github.com/${{ github.repository }}" >> $GITHUB_OUTPUT else - echo "path=github.com/${{ github.repository }}/${{ inputs.projectPath }}" >> $GITHUB_OUTPUT + echo "path=github.com/${{ github.repository }}/${GH_INPUTS_PROJECT_PATH}" >> $GITHUB_OUTPUT fi - name: Download all test result artifacts @@ -329,11 +356,14 @@ jobs: - name: Install flakeguard shell: bash - run: go install github.com/smartcontractkit/chainlink-testing-framework/tools/flakeguard@ea4ffd8c51ce02efebf5ea6bca503fe10b6cee92 # flakguard@0.1.0 + run: go install github.com/smartcontractkit/chainlink-testing-framework/tools/flakeguard@7c45cff27ac6b0d4244754660661cdbfcfaf2f9e # flakguard@0.1.0 - name: Aggregate Flakeguard Results id: results shell: bash + env: + GH_INPUTS_REPO_URL: ${{ inputs.repoUrl }} + GH_INPUTS_MAX_PASS_RATIO: ${{ inputs.maxPassRatio }} run: | set -e # Exit immediately if a command exits with a non-zero status. @@ -350,11 +380,15 @@ jobs: --output-path ./flakeguard-report \ --repo-path "${{ github.workspace }}" \ --codeowners-path "${{ github.workspace }}/.github/CODEOWNERS" \ - --max-pass-ratio "${{ inputs.maxPassRatio }}" \ - --repo-url "${{ inputs.repoUrl }}" \ + --max-pass-ratio "$GH_INPUTS_MAX_PASS_RATIO" \ + --repo-url "$GH_INPUTS_REPO_URL" \ --base-sha "${{ needs.get-tests.outputs.git_base_sha }}" \ --head-sha "${{ needs.get-tests.outputs.git_head_sha }}" \ - --github-workflow-name "${{ github.workflow }}" + --github-workflow-name "${{ github.workflow }}" \ + --github-workflow-run-url "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" \ + --splunk-url "${{ secrets.FLAKEGUARD_SPLUNK_ENDPOINT }}" \ + --splunk-token "${{ secrets.FLAKEGUARD_SPLUNK_HEC }}" \ + --splunk-event "${{ github.event }}" # Print out the summary file echo -e "\nFlakeguard Summary:" @@ -365,7 +399,7 @@ jobs: echo "summary=$summary" >> $GITHUB_OUTPUT - name: Upload All Test Results as Artifact - if: ${{ fromJSON(steps.results.outputs.summary).total_tests > 0 }} + if: ${{ (success() || failure()) && fromJSON(steps.results.outputs.summary).total_tests > 0 }} uses: actions/upload-artifact@v4.4.3 with: path: ./flakeguard-report/all-test-results.json @@ -373,7 +407,7 @@ jobs: retention-days: 90 - name: Upload Failed Test Results as Artifact - if: ${{ fromJSON(steps.results.outputs.summary).failed_runs > 0 }} + if: ${{ (success() || failure()) && fromJSON(steps.results.outputs.summary).failed_runs > 0 }} uses: actions/upload-artifact@v4.4.3 with: path: ./flakeguard-report/failed-test-results.json @@ -381,7 +415,7 @@ jobs: retention-days: 90 - name: Upload Failed Test Results With Logs as Artifact - if: ${{ fromJSON(steps.results.outputs.summary).failed_runs > 0 }} + if: ${{ (success() || failure()) && fromJSON(steps.results.outputs.summary).failed_runs > 0 }} uses: actions/upload-artifact@v4.4.3 with: path: ./flakeguard-report/failed-test-results-with-logs.json @@ -390,8 +424,13 @@ jobs: - name: Generate Flakeguard Reports shell: bash + if: success() || failure() env: GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} + GH_INPUTS_MAX_PASS_RATIO: ${{ inputs.maxPassRatio }} + GH_EVENT_NAME: ${{ github.event_name }} + GH_EVENT_PULL_REQUEST_BASE_REF: ${{ github.event.pull_request.base.ref }} + GH_EVENT_PULL_REQUEST_HEAD_SHA: ${{ github.event.pull_request.head.sha }} run: | set -e # Exit immediately if a command exits with a non-zero status. @@ -400,7 +439,7 @@ jobs: export PATH # Check if the event is a pull request - if [ "${{ github.event_name }}" = "pull_request" ]; then + if [ "$GH_EVENT_NAME" = "pull_request" ]; then flakeguard generate-report \ --aggregated-results-path ./flakeguard-report/all-test-results.json \ --summary-path ./flakeguard-report/all-test-summary.json \ @@ -409,12 +448,12 @@ jobs: --github-run-id "${{ github.run_id }}" \ --failed-tests-artifact-name "failed-test-results-with-logs.json" \ --generate-pr-comment \ - --base-branch "${{ github.event.pull_request.base.ref }}" \ + --base-branch "$GH_EVENT_PULL_REQUEST_BASE_REF" \ --current-branch "${{ github.head_ref }}" \ - --current-commit-sha "${{ github.event.pull_request.head.sha }}" \ + --current-commit-sha "$GH_EVENT_PULL_REQUEST_HEAD_SHA" \ --repo-url "https://github.com/${{ github.repository }}" \ --action-run-id "${{ github.run_id }}" \ - --max-pass-ratio "${{ inputs.maxPassRatio }}" + --max-pass-ratio "$GH_INPUTS_MAX_PASS_RATIO" else flakeguard generate-report \ --aggregated-results-path ./flakeguard-report/all-test-results.json \ @@ -423,15 +462,16 @@ jobs: --github-repository "${{ github.repository }}" \ --github-run-id "${{ github.run_id }}" \ --failed-tests-artifact-name "failed-test-results-with-logs.json" \ - --base-branch "${{ github.event.pull_request.base.ref }}" \ + --base-branch "$GH_EVENT_PULL_REQUEST_BASE_REF" \ --current-branch "${{ github.head_ref }}" \ - --current-commit-sha "${{ github.event.pull_request.head.sha }}" \ + --current-commit-sha "$GH_EVENT_PULL_REQUEST_HEAD_SHA" \ --repo-url "https://github.com/${{ github.repository }}" \ --action-run-id "${{ github.run_id }}" \ - --max-pass-ratio "${{ inputs.maxPassRatio }}" + --max-pass-ratio "$GH_INPUTS_MAX_PASS_RATIO" fi - name: Add Github Summary + if: (success() || failure()) run: | FILE_SIZE=$(wc -c < ./flakeguard-report/all-test-summary.md) echo "File size: $FILE_SIZE bytes" @@ -446,7 +486,7 @@ jobs: fi - name: Post comment on PR if flaky tests found - if: ${{ fromJSON(steps.results.outputs.summary).flaky_tests > 0 && github.event_name == 'pull_request' }} + if: ${{ (success() || failure()) && fromJSON(steps.results.outputs.summary).flaky_tests > 0 && github.event_name == 'pull_request' }} uses: actions/github-script@v7 continue-on-error: true with: @@ -463,7 +503,7 @@ jobs: }); - name: Send Slack message for failed tests - if: ${{ inputs.slackNotificationAfterTestsChannelId != '' && fromJSON(steps.results.outputs.summary).flaky_tests > 0 }} + if: ${{ (success() || failure()) && inputs.slackNotificationAfterTestsChannelId != '' && fromJSON(steps.results.outputs.summary).flaky_tests > 0 }} uses: slackapi/slack-github-action@6c661ce58804a1a20f6dc5fbee7f0381b469e001 # v1.25.0 env: SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} @@ -516,7 +556,7 @@ jobs: - name: Send general Slack message uses: slackapi/slack-github-action@6c661ce58804a1a20f6dc5fbee7f0381b469e001 # v1.25.0 - if: ${{ inputs.slackNotificationAfterTestsChannelId != '' && fromJSON(steps.results.outputs.summary).flaky_tests == 0 && fromJSON(steps.results.outputs.summary).total_tests > 0 }} + if: ${{ (success() || failure()) && inputs.slackNotificationAfterTestsChannelId != '' && fromJSON(steps.results.outputs.summary).flaky_tests == 0 && fromJSON(steps.results.outputs.summary).total_tests > 0 }} id: slack env: SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} diff --git a/.github/workflows/go-mod-cache.yml b/.github/workflows/go-mod-cache.yml index 3caac1eff3f..e90e6a9f285 100644 --- a/.github/workflows/go-mod-cache.yml +++ b/.github/workflows/go-mod-cache.yml @@ -31,6 +31,8 @@ jobs: steps: - name: Checkout the repo uses: actions/checkout@v4.2.1 + with: + persist-credentials: false - name: Setup Go uses: ./.github/actions/setup-go diff --git a/.github/workflows/integration-in-memory-tests.yml b/.github/workflows/integration-in-memory-tests.yml index 341d66f641e..e124b12eb28 100644 --- a/.github/workflows/integration-in-memory-tests.yml +++ b/.github/workflows/integration-in-memory-tests.yml @@ -33,6 +33,7 @@ jobs: - name: Checkout the repo uses: actions/checkout@v4.2.1 with: + persist-credentials: false repository: smartcontractkit/chainlink ref: ${{ inputs.cl_ref }} - uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2 @@ -134,6 +135,7 @@ jobs: if: ${{ github.event_name == 'pull_request' }} uses: actions/checkout@v4.2.1 with: + persist-credentials: false repository: smartcontractkit/chainlink ref: ${{ inputs.cl_ref }} diff --git a/.github/workflows/integration-tests-publish.yml b/.github/workflows/integration-tests-publish.yml index df07cc1e231..523974b4aed 100644 --- a/.github/workflows/integration-tests-publish.yml +++ b/.github/workflows/integration-tests-publish.yml @@ -23,6 +23,7 @@ jobs: - name: Checkout the repo uses: actions/checkout@v4.2.1 with: + persist-credentials: false ref: ${{ github.event.pull_request.head.sha || github.sha }} - name: Setup Other Tags If Not Workflow Dispatch id: tags @@ -68,6 +69,7 @@ jobs: - name: Checkout the repo uses: actions/checkout@v4.2.1 with: + persist-credentials: false ref: ${{ github.sha }} - name: Build Chainlink Image uses: ./.github/actions/build-chainlink-image diff --git a/.github/workflows/integration-tests.yml b/.github/workflows/integration-tests.yml index e79956cc253..33bb7721d77 100644 --- a/.github/workflows/integration-tests.yml +++ b/.github/workflows/integration-tests.yml @@ -54,6 +54,7 @@ jobs: - name: Checkout the repo uses: actions/checkout@v4.2.1 with: + persist-credentials: false repository: smartcontractkit/chainlink ref: ${{ inputs.cl_ref }} - name: Check Merge Group Condition @@ -88,6 +89,7 @@ jobs: - name: Checkout the repo uses: actions/checkout@v4.2.1 with: + persist-credentials: false repository: smartcontractkit/chainlink ref: ${{ inputs.cl_ref }} - uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2 @@ -140,6 +142,7 @@ jobs: - name: Checkout the repo uses: actions/checkout@v4.2.1 with: + persist-credentials: false repository: smartcontractkit/chainlink ref: ${{ inputs.cl_ref || github.event.pull_request.head.sha || github.event.merge_group.head_sha }} - name: Setup Github Token @@ -386,6 +389,7 @@ jobs: if: ${{ github.event_name == 'pull_request' }} uses: actions/checkout@v4.2.1 with: + persist-credentials: false repository: smartcontractkit/chainlink ref: ${{ inputs.cl_ref }} @@ -405,6 +409,7 @@ jobs: - name: Checkout the repo uses: actions/checkout@v4.2.1 with: + persist-credentials: false repository: smartcontractkit/chainlink ref: ${{ inputs.cl_ref || github.event.pull_request.head.sha || github.event.merge_group.head_sha }} - name: Download All Artifacts @@ -429,6 +434,7 @@ jobs: - name: Checkout the repo uses: actions/checkout@v4.2.1 with: + persist-credentials: false repository: smartcontractkit/chainlink ref: ${{ inputs.cl_ref || github.event.pull_request.head.sha || github.event.merge_group.head_sha }} - name: Setup Go @@ -449,6 +455,7 @@ jobs: - name: Checkout solana uses: actions/checkout@v4.2.1 with: + persist-credentials: false repository: smartcontractkit/chainlink-solana ref: develop fetch-depth: 0 @@ -476,6 +483,7 @@ jobs: - name: Checkout the solana repo uses: actions/checkout@v4.2.1 with: + persist-credentials: false repository: smartcontractkit/chainlink-solana ref: ${{ needs.get_solana_sha.outputs.sha }} - name: Get ProjectSerum Version @@ -524,6 +532,7 @@ jobs: - name: Checkout the solana repo uses: actions/checkout@v4.2.1 with: + persist-credentials: false repository: smartcontractkit/chainlink-solana ref: ${{ needs.get_solana_sha.outputs.sha }} - name: Build contracts @@ -558,6 +567,7 @@ jobs: if: (needs.changes.outputs.core_changes == 'true' || github.event_name == 'workflow_dispatch') && needs.solana-test-image-exists.outputs.exists == 'false' uses: actions/checkout@v4.2.1 with: + persist-credentials: false repository: smartcontractkit/chainlink-solana ref: ${{ needs.get_solana_sha.outputs.sha }} - name: Download Artifacts @@ -606,6 +616,7 @@ jobs: - name: Checkout the repo uses: actions/checkout@v4.2.1 with: + persist-credentials: false repository: smartcontractkit/chainlink-solana ref: ${{ needs.get_solana_sha.outputs.sha }} - name: Run Setup @@ -646,10 +657,13 @@ jobs: yarn --cwd ./gauntlet build yarn --cwd ./gauntlet gauntlet - name: Generate config overrides + env: + GH_INPUTS_EVM_REF: ${{ inputs.evm-ref }} + GH_SHA: ${{ github.sha }} run: | # https://github.com/smartcontractkit/chainlink-testing-framework/lib/blob/main/config/README.md cat << EOF > config.toml [ChainlinkImage] - version="${{ inputs.evm-ref || github.sha }}" + version="${{ env.evm-ref || env.GH_SHA }}" [Common] user="${{ github.actor }}" internal_docker_repo = "${{ secrets.QA_AWS_ACCOUNT_NUMBER }}.dkr.ecr.${{ secrets.QA_AWS_REGION }}.amazonaws.com" diff --git a/.github/workflows/lint-gh-workflows.yml b/.github/workflows/lint-gh-workflows.yml index 9897c023576..a3aaacb1abe 100644 --- a/.github/workflows/lint-gh-workflows.yml +++ b/.github/workflows/lint-gh-workflows.yml @@ -8,5 +8,7 @@ jobs: steps: - name: Check out Code uses: actions/checkout@v4.2.1 + with: + persist-credentials: false - name: Run actionlint uses: reviewdog/action-actionlint@c6ee1eb0a5d47b2af53a203652b5dac0b6c4016e # v1.43.0 diff --git a/.github/workflows/on-demand-vrfv2-performance-test.yml b/.github/workflows/on-demand-vrfv2-performance-test.yml index f9aeaa0fa1f..2f3ea12cbe2 100644 --- a/.github/workflows/on-demand-vrfv2-performance-test.yml +++ b/.github/workflows/on-demand-vrfv2-performance-test.yml @@ -34,13 +34,17 @@ jobs: runs-on: ubuntu-latest outputs: test_list: ${{ steps.set-tests.outputs.test_list }} + env: + GH_INPUTS_TEST_LIST_REGEX: ${{ inputs.test_list_regex }} + GH_INPUTS_TEST_CONFIG_OVERRIDE_PATH: ${{ inputs.test_config_override_path }} + GH_INPUTS_PERFORMANCE_TEST_TYPE: ${{ inputs.performanceTestType }} steps: - name: Generate Test List JSON id: set-tests run: | - TEST_CMD='cd integration-tests/load && go test -v -count=1 -timeout 24h -run "${{ inputs.test_list_regex }}" ./vrfv2' - TEST_CONFIG_OVERRIDE_PATH=${{ inputs.test_config_override_path }} - TEST_TYPE=${{ inputs.performanceTestType }} + TEST_CMD='cd integration-tests/load && go test -v -count=1 -timeout 24h -run "$GH_INPUTS_TEST_LIST_REGEX" ./vrfv2' + TEST_CONFIG_OVERRIDE_PATH=$GH_INPUTS_TEST_CONFIG_OVERRIDE_PATH + TEST_TYPE=$GH_INPUTS_PERFORMANCE_TEST_TYPE TEST_LIST=$(jq -n -c \ --arg test_cmd "$TEST_CMD" \ diff --git a/.github/workflows/on-demand-vrfv2-smoke-tests.yml b/.github/workflows/on-demand-vrfv2-smoke-tests.yml index ad616dea744..db242c1aae2 100644 --- a/.github/workflows/on-demand-vrfv2-smoke-tests.yml +++ b/.github/workflows/on-demand-vrfv2-smoke-tests.yml @@ -41,13 +41,17 @@ jobs: steps: - name: Generate Test List JSON id: set-tests + env: + GH_INPUTS_TEST_SUITE: ${{ inputs.test_suite }} + GH_INPUTS_TEST_LIST_REGEX: ${{ inputs.test_list_regex }} + GH_INPUTS_TEST_CONFIG_OVERRIDE_PATH: ${{ inputs.test_config_override_path }} run: | - if [[ "${{ inputs.test_suite }}" == "All Tests" ]]; then + if [[ "$GH_INPUTS_TEST_SUITE" == "All Tests" ]]; then TEST_CMD="cd integration-tests/smoke && go test vrfv2_test.go -test.parallel=1 -timeout 3h -count=1 -json -v" else - TEST_CMD='cd integration-tests/smoke && go test -test.run "${{ inputs.test_list_regex }}" -test.parallel=1 -timeout 2h -count=1 -json -v' + TEST_CMD='cd integration-tests/smoke && go test -test.run "$GH_INPUTS_TEST_LIST_REGEX" -test.parallel=1 -timeout 2h -count=1 -json -v' fi - TEST_CONFIG_OVERRIDE_PATH=${{ inputs.test_config_override_path }} + TEST_CONFIG_OVERRIDE_PATH=$GH_INPUTS_TEST_CONFIG_OVERRIDE_PATH TEST_LIST=$(jq -n -c \ --arg test_cmd "$TEST_CMD" \ diff --git a/.github/workflows/on-demand-vrfv2plus-performance-test.yml b/.github/workflows/on-demand-vrfv2plus-performance-test.yml index b3a820e25a0..66878c552fd 100644 --- a/.github/workflows/on-demand-vrfv2plus-performance-test.yml +++ b/.github/workflows/on-demand-vrfv2plus-performance-test.yml @@ -34,13 +34,17 @@ jobs: runs-on: ubuntu-latest outputs: test_list: ${{ steps.set-tests.outputs.test_list }} + env: + GH_INPUTS_TEST_LIST_REGEX: ${{ inputs.test_list_regex }} + GH_INPUTS_TEST_CONFIG_OVERRIDE_PATH: ${{ inputs.test_config_override_path }} + GH_INPUTS_PERFORMANCE_TEST_TYPE: ${{ inputs.performanceTestType }} steps: - name: Generate Test List JSON id: set-tests run: | - TEST_CMD='cd integration-tests/load && go test -v -count=1 -timeout 24h -run "${{ inputs.test_list_regex }}" ./vrfv2plus' - TEST_CONFIG_OVERRIDE_PATH=${{ inputs.test_config_override_path }} - TEST_TYPE=${{ inputs.performanceTestType }} + TEST_CMD='cd integration-tests/load && go test -v -count=1 -timeout 24h -run "$GH_INPUTS_TEST_LIST_REGEX" ./vrfv2plus' + TEST_CONFIG_OVERRIDE_PATH=$GH_INPUTS_TEST_CONFIG_OVERRIDE_PATH + TEST_TYPE=$GH_INPUTS_PERFORMANCE_TEST_TYPE TEST_LIST=$(jq -n -c \ --arg test_cmd "$TEST_CMD" \ diff --git a/.github/workflows/on-demand-vrfv2plus-smoke-tests.yml b/.github/workflows/on-demand-vrfv2plus-smoke-tests.yml index 8561034b103..51c80af9bfa 100644 --- a/.github/workflows/on-demand-vrfv2plus-smoke-tests.yml +++ b/.github/workflows/on-demand-vrfv2plus-smoke-tests.yml @@ -41,13 +41,17 @@ jobs: steps: - name: Generate Test List JSON id: set-tests + env: + GH_INPUTS_TEST_SUITE: ${{ inputs.test_suite }} + GH_INPUTS_TEST_LIST_REGEX: ${{ inputs.test_list_regex }} + GH_INPUTS_TEST_CONFIG_OVERRIDE_PATH: ${{ inputs.test_config_override_path }} run: | - if [[ "${{ inputs.test_suite }}" == "All Tests" ]]; then + if [[ "$GH_INPUTS_TEST_SUITE" == "All Tests" ]]; then TEST_CMD="cd integration-tests/smoke && go test vrfv2plus_test.go -test.parallel=1 -timeout 3h -count=1 -json -v" else - TEST_CMD='cd integration-tests/smoke && go test -test.run "${{ inputs.test_list_regex }}" -test.parallel=1 -timeout 2h -count=1 -json -v' + TEST_CMD='cd integration-tests/smoke && go test -test.run "$GH_INPUTS_TEST_LIST_REGEX" -test.parallel=1 -timeout 2h -count=1 -json -v' fi - TEST_CONFIG_OVERRIDE_PATH=${{ inputs.test_config_override_path }} + TEST_CONFIG_OVERRIDE_PATH=$GH_INPUTS_TEST_CONFIG_OVERRIDE_PATH TEST_LIST=$(jq -n -c \ --arg test_cmd "$TEST_CMD" \ diff --git a/.github/workflows/operator-ui-ci.yml b/.github/workflows/operator-ui-ci.yml index 9bce18f8cff..7ea1cd8327b 100644 --- a/.github/workflows/operator-ui-ci.yml +++ b/.github/workflows/operator-ui-ci.yml @@ -33,6 +33,8 @@ jobs: - name: Checkout repository uses: actions/checkout@v4.2.1 + with: + persist-credentials: false - name: Get operator-ui tag id: get-operator-ui-tag diff --git a/.github/workflows/solidity-foundry-artifacts.yml b/.github/workflows/solidity-foundry-artifacts.yml index dbf31a4b442..460e3dfa7be 100644 --- a/.github/workflows/solidity-foundry-artifacts.yml +++ b/.github/workflows/solidity-foundry-artifacts.yml @@ -50,6 +50,7 @@ jobs: - name: Checkout the repo uses: actions/checkout@v4.2.1 with: + persist-credentials: false ref: ${{ env.head_ref }} - name: Find modified contracts uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2 @@ -86,8 +87,10 @@ jobs: - name: Transform modified files id: changes-transform shell: bash + env: + GH_INPUTS_PRODUCT: ${{ inputs.product }} run: | - if [ "${{ inputs.product }}" = "shared" ]; then + if [ "$GH_INPUTS_PRODUCT" = "shared" ]; then echo "::debug:: Product is shared, transforming changes" if [[ "${{ steps.changes-dorny.outputs.product }}" == "true" && "${{ steps.changes-dorny.outputs.other_shared }}" == "true" ]]; then echo "::debug:: Changes were found in 'shared' folder and in 'interfaces' and root folders" @@ -128,6 +131,8 @@ jobs: steps: - name: Checkout the repo uses: actions/checkout@v4.2.1 + with: + persist-credentials: false - name: Extract Foundry version id: extract-foundry-version @@ -137,8 +142,10 @@ jobs: - name: Should skip code coverage report id: skip-code-coverage + env: + GH_INPUTS_PRODUCT: ${{ inputs.product }} run: | - if [[ "${{ inputs.product }}" = "automation" || "${{ inputs.product }}" = "vrf" || "${{ inputs.product }}" = "functions" ]]; then + if [[ "$GH_INPUTS_PRODUCT" = "automation" || "$GH_INPUTS_PRODUCT" = "vrf" || "$GH_INPUTS_PRODUCT" = "functions" ]]; then echo "generate_code_coverage=false" >> $GITHUB_OUTPUT else echo "generate_code_coverage=true" >> $GITHUB_OUTPUT diff --git a/.github/workflows/solidity-foundry.yml b/.github/workflows/solidity-foundry.yml index 5c6889beaf8..618ab046e28 100644 --- a/.github/workflows/solidity-foundry.yml +++ b/.github/workflows/solidity-foundry.yml @@ -48,6 +48,8 @@ jobs: - name: Checkout the repo uses: actions/checkout@v4.2.1 + with: + persist-credentials: false - name: Extract Foundry version id: extract-foundry-version @@ -69,6 +71,8 @@ jobs: steps: - name: Checkout the repo uses: actions/checkout@v4.2.1 + with: + persist-credentials: false - name: Detect changes uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2 id: changes @@ -154,6 +158,7 @@ jobs: || needs.changes.outputs.non_src_changes == 'true' }} uses: actions/checkout@v4.2.1 with: + persist-credentials: false submodules: recursive # Only needed because we use the NPM versions of packages @@ -327,10 +332,13 @@ jobs: steps: - name: Checkout this repository uses: actions/checkout@v4.2.1 + with: + persist-credentials: false - name: Checkout .github repository uses: actions/checkout@v4.2.1 with: + persist-credentials: false repository: smartcontractkit/.github ref: b6e37806737eef87e8c9137ceeb23ef0bff8b1db # validate-solidity-artifacts@0.1.0 path: ./dot_github @@ -415,6 +423,7 @@ jobs: if: needs.changes.outputs.sol_mod_only == 'true' uses: actions/checkout@v4.2.1 with: + persist-credentials: false ref: ${{ github.base_ref }} - name: Download Slither scripts @@ -608,6 +617,7 @@ jobs: if: ${{ (contains(fromJson(needs.changes.outputs.all_changes), matrix.product.name) || needs.changes.outputs.non_src_changes == 'true') && matrix.product.setup.run-forge-fmt }} uses: actions/checkout@v4.2.1 with: + persist-credentials: false submodules: recursive - name: Setup NodeJS diff --git a/.github/workflows/solidity-hardhat.yml b/.github/workflows/solidity-hardhat.yml index 6f27f8ca2f8..e2da95eae6e 100644 --- a/.github/workflows/solidity-hardhat.yml +++ b/.github/workflows/solidity-hardhat.yml @@ -20,6 +20,8 @@ jobs: steps: - name: Checkout the repo uses: actions/checkout@v4.2.1 + with: + persist-credentials: false - uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2 id: changes with: @@ -40,6 +42,8 @@ jobs: steps: - name: Checkout the repo uses: actions/checkout@v4.2.1 + with: + persist-credentials: false - name: Setup NodeJS uses: ./.github/actions/setup-nodejs - name: Setup Hardhat diff --git a/.github/workflows/solidity-traceability.yml b/.github/workflows/solidity-traceability.yml index caa233ea8bb..a894175f6f3 100644 --- a/.github/workflows/solidity-traceability.yml +++ b/.github/workflows/solidity-traceability.yml @@ -23,6 +23,8 @@ jobs: steps: - name: Checkout the repo uses: actions/checkout@v4.2.1 + with: + persist-credentials: false - name: Filter paths uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2 @@ -59,6 +61,7 @@ jobs: - name: Checkout the repo uses: actions/checkout@v4.2.1 with: + persist-credentials: false ref: ${{ github.event.pull_request.head.sha }} - name: Assume role capable of dispatching action @@ -94,6 +97,7 @@ jobs: - name: Checkout .Github repository uses: actions/checkout@v4.2.1 with: + persist-credentials: false repository: smartcontractkit/.github ref: 6781e048ecc1aadf7d605722c32e8068a5f829ce # jira-tracing@0.3.0 path: ./dot_github diff --git a/.github/workflows/solidity-wrappers.yml b/.github/workflows/solidity-wrappers.yml index b2acdf6ca5e..941a3e2f196 100644 --- a/.github/workflows/solidity-wrappers.yml +++ b/.github/workflows/solidity-wrappers.yml @@ -24,6 +24,8 @@ jobs: steps: - name: Checkout the repo uses: actions/checkout@v4.2.1 + with: + persist-credentials: false - name: Detect changes id: ch uses: ./.github/actions/detect-solidity-file-changes @@ -41,6 +43,8 @@ jobs: steps: - name: Checkout the repo uses: actions/checkout@v4.2.1 + with: + persist-credentials: false - name: Setup Go uses: ./.github/actions/setup-go diff --git a/.github/workflows/solidity.yml b/.github/workflows/solidity.yml index 605b3f2e325..c162380940f 100644 --- a/.github/workflows/solidity.yml +++ b/.github/workflows/solidity.yml @@ -17,6 +17,8 @@ jobs: steps: - name: Checkout the repo uses: actions/checkout@v4.2.1 + with: + persist-credentials: false - name: Detect readonly solidity file changes id: ch uses: ./.github/actions/detect-solidity-readonly-file-changes @@ -29,6 +31,8 @@ jobs: steps: - name: Checkout the repo uses: actions/checkout@v4.2.1 + with: + persist-credentials: false - name: Detect changes id: ch uses: ./.github/actions/detect-solidity-file-changes @@ -44,6 +48,8 @@ jobs: pre-release-version: ${{ steps.release-tag-check.outputs.pre-release-version }} steps: - uses: actions/checkout@v4.2.1 + with: + persist-credentials: false - name: Check release tag id: release-tag-check uses: smartcontractkit/chainlink-github-actions/release/release-tag-check@5dd916d08c03cb5f9a97304f4f174820421bb946 # v2.3.11 @@ -62,6 +68,8 @@ jobs: steps: - name: Checkout the repo uses: actions/checkout@v4.2.1 + with: + persist-credentials: false - name: Setup NodeJS uses: ./.github/actions/setup-nodejs - name: Run Prepublish test @@ -77,11 +85,13 @@ jobs: - name: Checkout the repo uses: actions/checkout@v4.2.1 with: + persist-credentials: false path: chainlink - name: Checkout diff-so-fancy uses: actions/checkout@v4.2.1 with: + persist-credentials: false repository: so-fancy/diff-so-fancy ref: a673cb4d2707f64d92b86498a2f5f71c8e2643d5 # v1.4.3 path: diff-so-fancy @@ -128,6 +138,8 @@ jobs: steps: - name: Checkout the repo uses: actions/checkout@v4.2.1 + with: + persist-credentials: false - name: Setup NodeJS uses: ./.github/actions/setup-nodejs - name: Run pnpm lint @@ -148,6 +160,8 @@ jobs: steps: - name: Checkout the repo uses: actions/checkout@v4.2.1 + with: + persist-credentials: false - name: Setup NodeJS uses: ./.github/actions/setup-nodejs - name: Run prettier check @@ -162,6 +176,8 @@ jobs: steps: - name: Checkout the repo uses: actions/checkout@v4.2.1 + with: + persist-credentials: false - name: Setup NodeJS uses: ./.github/actions/setup-nodejs @@ -191,6 +207,8 @@ jobs: steps: - name: Checkout the repo uses: actions/checkout@v4.2.1 + with: + persist-credentials: false - name: Setup NodeJS uses: ./.github/actions/setup-nodejs diff --git a/.github/workflows/sync-develop-from-smartcontractkit-chainlink.yml b/.github/workflows/sync-develop-from-smartcontractkit-chainlink.yml index e635ce40922..061db3ae7f3 100644 --- a/.github/workflows/sync-develop-from-smartcontractkit-chainlink.yml +++ b/.github/workflows/sync-develop-from-smartcontractkit-chainlink.yml @@ -12,6 +12,7 @@ jobs: steps: - uses: actions/checkout@v4.2.1 with: + persist-credentials: false ref: develop if: env.GITHUB_REPOSITORY != 'smartcontractkit/chainlink' - name: Sync diff --git a/core/capabilities/compute/compute_test.go b/core/capabilities/compute/compute_test.go index 1b1b6e643e8..3e5f501fa61 100644 --- a/core/capabilities/compute/compute_test.go +++ b/core/capabilities/compute/compute_test.go @@ -77,7 +77,6 @@ func setup(t *testing.T, config Config) testHarness { } func TestComputeStartAddsToRegistry(t *testing.T) { - t.Parallel() th := setup(t, defaultConfig) require.NoError(t, th.compute.Start(tests.Context(t))) @@ -110,7 +109,6 @@ func TestComputeExecuteMissingConfig(t *testing.T) { } func TestComputeExecuteMissingBinary(t *testing.T) { - t.Parallel() th := setup(t, defaultConfig) require.NoError(t, th.compute.Start(tests.Context(t))) diff --git a/core/capabilities/integration_tests/keystone/workflow.go b/core/capabilities/integration_tests/keystone/workflow.go index 25a26bf3f9f..ce81b50dfdc 100644 --- a/core/capabilities/integration_tests/keystone/workflow.go +++ b/core/capabilities/integration_tests/keystone/workflow.go @@ -35,6 +35,7 @@ consensus: encoder: "EVM" encoder_config: abi: "(bytes32 FeedID, uint224 Price, uint32 Timestamp)[] Reports" + subabi: "map[string]string{"Reports.Price": "uint224 Price"}" targets: - id: "write_geth-testnet@1.0.0" diff --git a/core/internal/cltest/cltest.go b/core/internal/cltest/cltest.go index b8b34919b6e..a55c57cc9a2 100644 --- a/core/internal/cltest/cltest.go +++ b/core/internal/cltest/cltest.go @@ -999,7 +999,7 @@ func WaitForPipeline(t testing.TB, nodeID int, jobID int32, expectedPipelineRuns t.Helper() var pr []pipeline.Run - if !gomega.NewWithT(t).Eventually(func() bool { + gomega.NewWithT(t).Eventually(func() bool { prs, _, err := jo.PipelineRuns(testutils.Context(t), &jobID, 0, 1000) require.NoError(t, err) @@ -1029,9 +1029,7 @@ func WaitForPipeline(t testing.TB, nodeID int, jobID int32, expectedPipelineRuns jobID, len(pr), ), - ) { - t.Fatal() - } + ) return pr } diff --git a/core/internal/features/ocr2/features_ocr2_helper.go b/core/internal/features/ocr2/features_ocr2_helper.go index 76056d7d23d..9287d0df5b1 100644 --- a/core/internal/features/ocr2/features_ocr2_helper.go +++ b/core/internal/features/ocr2/features_ocr2_helper.go @@ -35,7 +35,6 @@ import ( ocrtypes2 "github.com/smartcontractkit/libocr/offchainreporting2plus/types" commonconfig "github.com/smartcontractkit/chainlink-common/pkg/config" - "github.com/smartcontractkit/chainlink-common/pkg/utils/tests" "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/testhelpers" "github.com/smartcontractkit/chainlink/v2/core/services/ocrbootstrap" @@ -202,7 +201,6 @@ func RunTestIntegrationOCR2(t *testing.T) { } { test := test t.Run(test.name, func(t *testing.T) { - t.Parallel() owner, b, ocrContractAddress, ocrContract := SetupOCR2Contracts(t) lggr := logger.TestLogger(t) @@ -558,7 +556,7 @@ updateInterval = "1m" return } // Want at least 2 runs so we see all the metadata. - pr := cltest.WaitForPipelineComplete(t, ic, jids[ic], len(completedRuns)+2, 7, apps[ic].JobORM(), tests.WaitTimeout(t), 5*time.Second) + pr := cltest.WaitForPipelineComplete(t, ic, jids[ic], len(completedRuns)+2, 7, apps[ic].JobORM(), 2*time.Minute, 5*time.Second) jb, err2 := pr[0].Outputs.MarshalJSON() if !assert.NoError(t, err2) { return @@ -570,13 +568,11 @@ updateInterval = "1m" // Trail #1: 4 oracles reporting 0, 10, 20, 30. Answer should be 20 (results[4/2]). // Trial #2: 4 oracles reporting 0, 20, 40, 60. Answer should be 40 (results[4/2]). - if !gomega.NewGomegaWithT(t).Eventually(func() string { + gomega.NewGomegaWithT(t).Eventually(func() string { answer, err2 := ocrContract.LatestAnswer(nil) require.NoError(t, err2) return answer.String() - }, tests.WaitTimeout(t), 200*time.Millisecond).Should(gomega.Equal(strconv.Itoa(2 * retVal))) { - t.Fatal() - } + }, 1*time.Minute, 200*time.Millisecond).Should(gomega.Equal(strconv.Itoa(2 * retVal))) for _, app := range apps { jobs, _, err2 := app.JobORM().FindJobs(ctx, 0, 1000) diff --git a/core/internal/features/ocr2/features_ocr2_test.go b/core/internal/features/ocr2/features_ocr2_test.go index a8a8886c50c..01c269d19e3 100644 --- a/core/internal/features/ocr2/features_ocr2_test.go +++ b/core/internal/features/ocr2/features_ocr2_test.go @@ -27,7 +27,6 @@ import ( confighelper2 "github.com/smartcontractkit/libocr/offchainreporting2plus/confighelper" ocrtypes2 "github.com/smartcontractkit/libocr/offchainreporting2plus/types" - "github.com/smartcontractkit/chainlink-common/pkg/utils/tests" "github.com/smartcontractkit/chainlink/v2/core/bridges" "github.com/smartcontractkit/chainlink/v2/core/internal/cltest" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" @@ -225,7 +224,7 @@ updateInterval = "1m" go func() { defer wg.Done() // Want at least 2 runs so we see all the metadata. - pr := cltest.WaitForPipelineComplete(t, ic, jids[ic], 2, 7, apps[ic].JobORM(), tests.WaitTimeout(t), 5*time.Second) + pr := cltest.WaitForPipelineComplete(t, ic, jids[ic], 2, 7, apps[ic].JobORM(), 2*time.Minute, 5*time.Second) jb, err := pr[0].Outputs.MarshalJSON() require.NoError(t, err) assert.Equal(t, []byte(fmt.Sprintf("[\"%d\"]", 10*ic)), jb, "pr[0] %+v pr[1] %+v", pr[0], pr[1]) @@ -235,13 +234,11 @@ updateInterval = "1m" wg.Wait() // 4 oracles reporting 0, 10, 20, 30. Answer should be 20 (results[4/2]). - if !gomega.NewGomegaWithT(t).Eventually(func() string { + gomega.NewGomegaWithT(t).Eventually(func() string { answer, err := ocrContract.LatestAnswer(nil) require.NoError(t, err) return answer.String() - }, tests.WaitTimeout(t), 200*time.Millisecond).Should(gomega.Equal("20")) { - t.Fatal() - } + }, 1*time.Minute, 200*time.Millisecond).Should(gomega.Equal("20")) for _, app := range apps { jobs, _, err := app.JobORM().FindJobs(ctx, 0, 1000) diff --git a/core/scripts/go.mod b/core/scripts/go.mod index caf67e0af2a..ffd99167c0b 100644 --- a/core/scripts/go.mod +++ b/core/scripts/go.mod @@ -12,8 +12,8 @@ replace github.com/smartcontractkit/chainlink/deployment => ../../deployment // Using a separate `require` here to avoid surrounding line changes // creating potential merge conflicts. require ( - github.com/smartcontractkit/chainlink/deployment v0.0.0-20241212011003-de1a8f5e5b42 - github.com/smartcontractkit/chainlink/v2 v2.0.0-20241212011003-de1a8f5e5b42 + github.com/smartcontractkit/chainlink/deployment v0.0.0-20241206210521-125d98cdaf66 + github.com/smartcontractkit/chainlink/v2 v2.14.0-mercury-20240807.0.20241106193309-5560cd76211a ) require ( @@ -33,10 +33,10 @@ require ( github.com/prometheus/client_golang v1.20.5 github.com/shopspring/decimal v1.4.0 github.com/smartcontractkit/chainlink-automation v0.8.1 - github.com/smartcontractkit/chainlink-common v0.4.1-0.20241217120918-bbe318cd0760 + github.com/smartcontractkit/chainlink-common v0.4.1-0.20241223143929-db7919d60550 github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20241216163550-fa030d178ba3 github.com/smartcontractkit/chainlink-testing-framework/lib v1.50.13 - github.com/smartcontractkit/libocr v0.0.0-20241007185508-adbe57025f12 + github.com/smartcontractkit/libocr v0.0.0-20241223215956-e5b78d8e3919 github.com/spf13/cobra v1.8.1 github.com/spf13/viper v1.19.0 github.com/stretchr/testify v1.9.0 @@ -312,7 +312,7 @@ require ( github.com/smartcontractkit/chainlink-feeds v0.1.1 // indirect github.com/smartcontractkit/chainlink-protos/job-distributor v0.6.0 // indirect github.com/smartcontractkit/chainlink-protos/orchestrator v0.4.0 // indirect - github.com/smartcontractkit/chainlink-solana v1.1.1-0.20241219173444-150f7443fdd3 // indirect + github.com/smartcontractkit/chainlink-solana v1.1.1-0.20241223151630-eac4f1508dce // indirect github.com/smartcontractkit/chainlink-starknet/relayer v0.1.1-0.20241202202529-2033490e77b8 // indirect github.com/smartcontractkit/grpc-proxy v0.0.0-20240830132753-a7e17fec5ab7 // indirect github.com/smartcontractkit/tdh2/go/ocr2/decryptionplugin v0.0.0-20241009055228-33d0c0bf38de // indirect diff --git a/core/scripts/go.sum b/core/scripts/go.sum index 744ad724688..7b004d6eae7 100644 --- a/core/scripts/go.sum +++ b/core/scripts/go.sum @@ -160,6 +160,8 @@ github.com/aws/aws-sdk-go v1.22.1/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN github.com/aws/aws-sdk-go v1.23.20/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= github.com/aws/aws-sdk-go v1.54.19 h1:tyWV+07jagrNiCcGRzRhdtVjQs7Vy41NwsuOcl0IbVI= github.com/aws/aws-sdk-go v1.54.19/go.mod h1:eRwEWoyTWFMVYVQzKMNHWP5/RV4xIUGMQfXQHfHkpNU= +github.com/aybabtme/rgbterm v0.0.0-20170906152045-cc83f3b3ce59 h1:WWB576BN5zNSZc/M9d/10pqEx5VHNhaQ/yOVAkmj5Yo= +github.com/aybabtme/rgbterm v0.0.0-20170906152045-cc83f3b3ce59/go.mod h1:q/89r3U2H7sSsE2t6Kca0lfwTK8JdoNGS/yzM/4iH5I= github.com/bahlo/generic-list-go v0.2.0 h1:5sz/EEAK+ls5wF+NeqDpk5+iNdMDXrh3z3nPnH1Wvgk= github.com/bahlo/generic-list-go v0.2.0/go.mod h1:2KvAjgMlE5NNynlg/5iLrrCCZ2+5xWbdbCW3pNTGyYg= github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= @@ -189,6 +191,8 @@ github.com/btcsuite/btcd/chaincfg/chainhash v1.1.0 h1:59Kx4K6lzOW5w6nFlA0v5+lk/6 github.com/btcsuite/btcd/chaincfg/chainhash v1.1.0/go.mod h1:7SFka0XMvUgj3hfZtydOrQY2mwhPclbT2snogU7SQQc= github.com/bufbuild/protocompile v0.4.0 h1:LbFKd2XowZvQ/kajzguUp2DC9UEIQhIq77fZZlaQsNA= github.com/bufbuild/protocompile v0.4.0/go.mod h1:3v93+mbWn/v3xzN+31nwkJfrEpAUwp+BagBSZWx+TP8= +github.com/buger/goterm v0.0.0-20200322175922-2f3e71b85129 h1:gfAMKE626QEuKG3si0pdTRcr/YEbBoxY+3GOH3gWvl4= +github.com/buger/goterm v0.0.0-20200322175922-2f3e71b85129/go.mod h1:u9UyCz2eTrSGy6fbupqJ54eY5c4IC8gREQ1053dK12U= github.com/buger/jsonparser v1.1.1 h1:2PnMjfWD7wBILjqQbt530v576A/cAbQvEW9gGIpYMUs= github.com/buger/jsonparser v1.1.1/go.mod h1:6RYKKt7H4d4+iWqouImQ9R2FZql3VbhNgx27UK13J/0= github.com/bytecodealliance/wasmtime-go/v23 v23.0.0 h1:NJvU4S8KEk1GnF6+FvlnzMD/8wXTj/mYJSG6Q4yu3Pw= @@ -407,6 +411,8 @@ github.com/gagliardetto/solana-go v1.8.4 h1:vmD/JmTlonyXGy39bAo0inMhmbdAwV7rXZtL github.com/gagliardetto/solana-go v1.8.4/go.mod h1:i+7aAyNDTHG0jK8GZIBSI4OVvDqkt2Qx+LklYclRNG8= github.com/gagliardetto/treeout v0.1.4 h1:ozeYerrLCmCubo1TcIjFiOWTTGteOOHND1twdFpgwaw= github.com/gagliardetto/treeout v0.1.4/go.mod h1:loUefvXTrlRG5rYmJmExNryyBRh8f89VZhmMOyCyqok= +github.com/gagliardetto/utilz v0.1.1 h1:/etW4hl607emKg6R6Lj9jRJ9d6ue2AQOyjhuAwjzs1U= +github.com/gagliardetto/utilz v0.1.1/go.mod h1:b+rGFkRHz3HWJD0RYMzat47JyvbTtpE0iEcYTRJTLLA= github.com/gballet/go-libpcsclite v0.0.0-20191108122812-4678299bea08 h1:f6D9Hr8xV8uYKlyuj8XIruxlh9WjVjdh1gIicAS7ays= github.com/gballet/go-libpcsclite v0.0.0-20191108122812-4678299bea08/go.mod h1:x7DCsMOv1taUwEWCzT4cmDeAkigA5/QCwUodaVOe8Ww= github.com/gedex/inflector v0.0.0-20170307190818-16278e9db813 h1:Uc+IZ7gYqAf/rSGFplbWBSHaGolEQlNLgMgSE3ccnIQ= @@ -668,6 +674,8 @@ github.com/gtank/merlin v0.1.1 h1:eQ90iG7K9pOhtereWsmyRJ6RAwcP4tHTDBHXNg+u5is= github.com/gtank/merlin v0.1.1/go.mod h1:T86dnYJhcGOh5BjZFCJWTDeTK7XW8uE+E21Cy/bIQ+s= github.com/gtank/ristretto255 v0.1.2 h1:JEqUCPA1NvLq5DwYtuzigd7ss8fwbYay9fi4/5uMzcc= github.com/gtank/ristretto255 v0.1.2/go.mod h1:Ph5OpO6c7xKUGROZfWVLiJf9icMDwUeIvY4OmlYW69o= +github.com/hako/durafmt v0.0.0-20200710122514-c0fb7b4da026 h1:BpJ2o0OR5FV7vrkDYfXYVJQeMNWa8RhklZOpW2ITAIQ= +github.com/hako/durafmt v0.0.0-20200710122514-c0fb7b4da026/go.mod h1:5Scbynm8dF1XAPwIwkGPqzkM/shndPm79Jd1003hTjE= github.com/hashicorp/consul/api v1.1.0/go.mod h1:VmuI/Lkw1nC05EYQWNKwWGbkg+FbDBtguAZLlVdkD9Q= github.com/hashicorp/consul/sdk v0.1.1/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= github.com/hashicorp/consul/sdk v0.16.1 h1:V8TxTnImoPD5cj0U9Spl0TUxcytjcbbJeADFF07KdHg= @@ -917,6 +925,8 @@ github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5 github.com/mfridman/interpolate v0.0.2 h1:pnuTK7MQIxxFz1Gr+rjSIx9u7qVjf5VOoM/u6BbAxPY= github.com/mfridman/interpolate v0.0.2/go.mod h1:p+7uk6oE07mpE/Ik1b8EckO0O4ZXiGAfshKBWLUM9Xg= github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= +github.com/miekg/dns v1.1.61 h1:nLxbwF3XxhwVSm8g9Dghm9MHPaUZuqhPiGL+675ZmEs= +github.com/miekg/dns v1.1.61/go.mod h1:mnAarhS3nWaW+NVP2wTkYVIZyHNJ098SJZUki3eykwQ= github.com/mimoo/StrobeGo v0.0.0-20181016162300-f8f6d4d2b643/go.mod h1:43+3pMjjKimDBf5Kr4ZFNGbLql1zKkbImw+fZbw3geM= github.com/mimoo/StrobeGo v0.0.0-20210601165009-122bf33a46e0 h1:QRUSJEgZn2Snx0EmT/QLXibWjSUDjKWvXIT19NBVp94= github.com/mimoo/StrobeGo v0.0.0-20210601165009-122bf33a46e0/go.mod h1:43+3pMjjKimDBf5Kr4ZFNGbLql1zKkbImw+fZbw3geM= @@ -1105,6 +1115,8 @@ github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQD github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= +github.com/ryanuber/go-glob v1.0.0 h1:iQh3xXAumdQ+4Ufa5b25cRpC5TYKlno6hsv6Cb3pkBk= +github.com/ryanuber/go-glob v1.0.0/go.mod h1:807d1WSdnB0XRJzKNil9Om6lcp/3a0v4qIHxIXzX/Yc= github.com/sagikazarmark/locafero v0.4.0 h1:HApY1R9zGo4DBgr7dqsTH/JJxLTTsOt7u6keLGt6kNQ= github.com/sagikazarmark/locafero v0.4.0/go.mod h1:Pe1W6UlPYUk/+wc/6KFhbORCfqzgYEpgQ3O5fPuL3H4= github.com/sagikazarmark/slog-shim v0.1.0 h1:diDBnUNK9N/354PgrxMywXnAwEr1QZcOr6gto+ugjYE= @@ -1150,8 +1162,8 @@ github.com/smartcontractkit/chainlink-automation v0.8.1 h1:sTc9LKpBvcKPc1JDYAmgB github.com/smartcontractkit/chainlink-automation v0.8.1/go.mod h1:Iij36PvWZ6blrdC5A/nrQUBuf3MH3JvsBB9sSyc9W08= github.com/smartcontractkit/chainlink-ccip v0.0.0-20241218114855-f74219171000 h1:6Zzr/R1j6P7bbvcUlt5WUIbItvrrGdGzIsiAzQezcwo= github.com/smartcontractkit/chainlink-ccip v0.0.0-20241218114855-f74219171000/go.mod h1:ncjd6mPZSRlelEqH/2KeLE1pU3UlqzBSn8RYkEoECzY= -github.com/smartcontractkit/chainlink-common v0.4.1-0.20241217120918-bbe318cd0760 h1:lB5A3TP0zOVuu1n0kEm6d8/o/4Knh6HLvsU/GChk+sI= -github.com/smartcontractkit/chainlink-common v0.4.1-0.20241217120918-bbe318cd0760/go.mod h1:yti7e1+G9hhkYhj+L5sVUULn9Bn3bBL5/AxaNqdJ5YQ= +github.com/smartcontractkit/chainlink-common v0.4.1-0.20241223143929-db7919d60550 h1:rRs74zjDJ7do5aYEXSU/sOnLnlbYCNqM8BrvEx/0NH8= +github.com/smartcontractkit/chainlink-common v0.4.1-0.20241223143929-db7919d60550/go.mod h1:yti7e1+G9hhkYhj+L5sVUULn9Bn3bBL5/AxaNqdJ5YQ= github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241202195413-82468150ac1e h1:PRoeby6ZlTuTkv2f+7tVU4+zboTfRzI+beECynF4JQ0= github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241202195413-82468150ac1e/go.mod h1:mUh5/woemsVaHgTorA080hrYmO3syBCmPdnWc/5dOqk= github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20241216163550-fa030d178ba3 h1:aeiBdBHGY8QNftps+VqrIk6OnfeeOD5z4jrAabW4ZSc= @@ -1162,16 +1174,16 @@ github.com/smartcontractkit/chainlink-protos/job-distributor v0.6.0 h1:0ewLMbAz3 github.com/smartcontractkit/chainlink-protos/job-distributor v0.6.0/go.mod h1:/dVVLXrsp+V0AbcYGJo3XMzKg3CkELsweA/TTopCsKE= github.com/smartcontractkit/chainlink-protos/orchestrator v0.4.0 h1:ZBat8EBvE2LpSQR9U1gEbRV6PfAkiFdINmQ8nVnXIAQ= github.com/smartcontractkit/chainlink-protos/orchestrator v0.4.0/go.mod h1:m/A3lqD7ms/RsQ9BT5P2uceYY0QX5mIt4KQxT2G6qEo= -github.com/smartcontractkit/chainlink-solana v1.1.1-0.20241219173444-150f7443fdd3 h1:AIIiwrZ5T4nEjFT33aLZKoXwD63JSMu72wWe/rUdfm0= -github.com/smartcontractkit/chainlink-solana v1.1.1-0.20241219173444-150f7443fdd3/go.mod h1:ARILnIgKelP0YkVzxXO111S9j0b4uKyt7iLpYjOkCtU= +github.com/smartcontractkit/chainlink-solana v1.1.1-0.20241223151630-eac4f1508dce h1:Mvpbr/Fi2IdU2EcmqCxhlCzs5ncnx+BwV80YweA4DZs= +github.com/smartcontractkit/chainlink-solana v1.1.1-0.20241223151630-eac4f1508dce/go.mod h1:qq+nW0JDnCCGMf2c38ZHjH8xgkAQnXKighjJr5JdDNE= github.com/smartcontractkit/chainlink-starknet/relayer v0.1.1-0.20241202202529-2033490e77b8 h1:tNS7U9lrxkFvEuyxQv11HHOiV9LPDGC9wYEy+yM/Jv4= github.com/smartcontractkit/chainlink-starknet/relayer v0.1.1-0.20241202202529-2033490e77b8/go.mod h1:EBrEgcdIbwepqguClkv8Ohy7CbyWSJaE4EC9aBJlQK0= github.com/smartcontractkit/chainlink-testing-framework/lib v1.50.13 h1:T0kbw07Vb6xUyA9MIJZfErMgWseWi1zf7cYvRpoq7ug= github.com/smartcontractkit/chainlink-testing-framework/lib v1.50.13/go.mod h1:1CKUOzoK+Ga19WuhRH9pxZ+qUUnrlIx108VEA6qSzeQ= github.com/smartcontractkit/grpc-proxy v0.0.0-20240830132753-a7e17fec5ab7 h1:12ijqMM9tvYVEm+nR826WsrNi6zCKpwBhuApq127wHs= github.com/smartcontractkit/grpc-proxy v0.0.0-20240830132753-a7e17fec5ab7/go.mod h1:FX7/bVdoep147QQhsOPkYsPEXhGZjeYx6lBSaSXtZOA= -github.com/smartcontractkit/libocr v0.0.0-20241007185508-adbe57025f12 h1:NzZGjaqez21I3DU7objl3xExTH4fxYvzTqar8DC6360= -github.com/smartcontractkit/libocr v0.0.0-20241007185508-adbe57025f12/go.mod h1:fb1ZDVXACvu4frX3APHZaEBp0xi1DIm34DcA0CwTsZM= +github.com/smartcontractkit/libocr v0.0.0-20241223215956-e5b78d8e3919 h1:IpGoPTXpvllN38kT2z2j13sifJMz4nbHglidvop7mfg= +github.com/smartcontractkit/libocr v0.0.0-20241223215956-e5b78d8e3919/go.mod h1:fb1ZDVXACvu4frX3APHZaEBp0xi1DIm34DcA0CwTsZM= github.com/smartcontractkit/tdh2/go/ocr2/decryptionplugin v0.0.0-20241009055228-33d0c0bf38de h1:n0w0rKF+SVM+S3WNlup6uabXj2zFlFNfrlsKCMMb/co= github.com/smartcontractkit/tdh2/go/ocr2/decryptionplugin v0.0.0-20241009055228-33d0c0bf38de/go.mod h1:Sl2MF/Fp3fgJIVzhdGhmZZX2BlnM0oUUyBP4s4xYb6o= github.com/smartcontractkit/tdh2/go/tdh2 v0.0.0-20241009055228-33d0c0bf38de h1:66VQxXx3lvTaAZrMBkIcdH9VEjujUEvmBQdnyOJnkOc= diff --git a/core/scripts/keystone/src/02_provision_ocr3_capability.go b/core/scripts/keystone/src/02_provision_ocr3_capability.go index f42b5b782ec..cd80bf4238b 100644 --- a/core/scripts/keystone/src/02_provision_ocr3_capability.go +++ b/core/scripts/keystone/src/02_provision_ocr3_capability.go @@ -11,7 +11,7 @@ import ( "github.com/smartcontractkit/chainlink/deployment" - ksdeploy "github.com/smartcontractkit/chainlink/deployment/keystone" + ksdeploy "github.com/smartcontractkit/chainlink/deployment/keystone/changeset" "github.com/smartcontractkit/libocr/offchainreporting2plus/types" @@ -97,7 +97,7 @@ func deployOCR3Contract( return o, true } -func generateOCR3Config(nodeKeys []NodeKeys, configFile string) ksdeploy.OCR2OracleConfig { +func generateOCR3Config(nodeKeys []NodeKeys, configFile string) ksdeploy.OCR3OnchainConfig { topLevelCfg := mustReadOCR3Config(configFile) cfg := topLevelCfg.OracleConfig secrets := deployment.XXXGenerateTestOCRSecrets() @@ -106,7 +106,7 @@ func generateOCR3Config(nodeKeys []NodeKeys, configFile string) ksdeploy.OCR2Ora return c } -func setOCRConfig(o *onchainMeta, env helpers.Environment, ocrConf ksdeploy.OCR2OracleConfig, artefacts string) { +func setOCRConfig(o *onchainMeta, env helpers.Environment, ocrConf ksdeploy.OCR3OnchainConfig, artefacts string) { fmt.Println("Setting OCR3 contract config...") tx, err := o.OCR3.SetConfig(env.Owner, ocrConf.Signers, diff --git a/core/scripts/keystone/src/88_ocr_helpers.go b/core/scripts/keystone/src/88_ocr_helpers.go index ea8e47ce435..7cdfd72ca52 100644 --- a/core/scripts/keystone/src/88_ocr_helpers.go +++ b/core/scripts/keystone/src/88_ocr_helpers.go @@ -6,10 +6,10 @@ import ( "github.com/ethereum/go-ethereum/common" "github.com/smartcontractkit/libocr/offchainreporting2/types" - ksdeploy "github.com/smartcontractkit/chainlink/deployment/keystone" + ksdeploy "github.com/smartcontractkit/chainlink/deployment/keystone/changeset" ) -func ocrConfToContractConfig(ocrConf ksdeploy.OCR2OracleConfig, configCount uint32) types.ContractConfig { +func ocrConfToContractConfig(ocrConf ksdeploy.OCR3OnchainConfig, configCount uint32) types.ContractConfig { cc := types.ContractConfig{ Signers: convertByteSliceToOnchainPublicKeys(ocrConf.Signers), Transmitters: convertAddressesToAccounts(ocrConf.Transmitters), diff --git a/core/services/relay/evm/cap_encoder.go b/core/services/relay/evm/cap_encoder.go index 713a9796dd2..1bf69b73fd3 100644 --- a/core/services/relay/evm/cap_encoder.go +++ b/core/services/relay/evm/cap_encoder.go @@ -18,9 +18,10 @@ import ( ) const ( - abiConfigFieldName = "abi" - subabiConfigFieldName = "subabi" - encoderName = "user" + abiConfigFieldName = "abi" + subabiConfigFieldName = "subabi" + subabi2ConfigFieldName = "subabi2" + encoderName = "user" ) type capEncoder struct { @@ -52,6 +53,8 @@ func NewEVMEncoder(config *values.Map) (consensustypes.Encoder, error) { TypeABI: string(jsonSelector), } + var modifierConfigs commoncodec.ModifiersConfig + var subabi map[string]string subabiConfig, ok := config.Underlying[subabiConfigFieldName] if ok { @@ -63,14 +66,31 @@ func NewEVMEncoder(config *values.Map) (consensustypes.Encoder, error) { if err2 != nil { return nil, err2 } - chainCodecConfig.ModifierConfigs = commoncodec.ModifiersConfig{ - &commoncodec.PreCodecModifierConfig{ - Fields: subabi, - Codecs: codecs, - }, + modifierConfigs = append(modifierConfigs, &commoncodec.PreCodecModifierConfig{ + Fields: subabi, + Codecs: codecs, + }) + } + + var subabi2 map[string]string + subabiConfig2, ok := config.Underlying[subabi2ConfigFieldName] + if ok { + err2 := subabiConfig2.UnwrapTo(&subabi2) + if err2 != nil { + return nil, err2 } + codecs2, err2 := makePreCodecModifierCodecs(subabi2) + if err2 != nil { + return nil, err2 + } + modifierConfigs = append(modifierConfigs, &commoncodec.PreCodecModifierConfig{ + Fields: subabi2, + Codecs: codecs2, + }) } + chainCodecConfig.ModifierConfigs = modifierConfigs + codecConfig := types.CodecConfig{Configs: map[string]types.ChainCodecConfig{ encoderName: chainCodecConfig, }} diff --git a/core/services/relay/evm/cap_encoder_test.go b/core/services/relay/evm/cap_encoder_test.go index 4c0285fc987..68c77762449 100644 --- a/core/services/relay/evm/cap_encoder_test.go +++ b/core/services/relay/evm/cap_encoder_test.go @@ -289,6 +289,84 @@ func TestEVMEncoder_SubABI(t *testing.T) { require.Equal(t, expected, hex.EncodeToString(encoded)) } +func TestEVMEncoder_SubABI2(t *testing.T) { + config := map[string]any{ + "abi": "(bytes Report)[] Reports", + "subabi2": map[string]string{ + "Reports.Report.Bundle": "uint256 Ask, uint256 Bid", + }, + "subabi": map[string]string{ + "Reports.Report": "bytes32 FeedID, bytes Bundle, uint32 Timestamp", + }, + } + wrapped, err := values.NewMap(config) + require.NoError(t, err) + enc, err := evm.NewEVMEncoder(wrapped) + require.NoError(t, err) + + type SubReport struct { + Ask int + Bid int + } + type ReportStruct struct { + FeedID [32]byte + Bundle SubReport + Timestamp uint32 + } + type ReportWrapper struct { + Report ReportStruct + } + reportOne := ReportWrapper{Report: ReportStruct{ + FeedID: [32]byte{1}, + Bundle: SubReport{ + Ask: 1, + Bid: 2, + }, + Timestamp: 47890122, + }} + reportTwo := ReportWrapper{Report: ReportStruct{ + FeedID: [32]byte{2}, + Bundle: SubReport{ + Ask: 3, + Bid: 4, + }, + Timestamp: 47890122, + }} + + // output of a reduce aggregator + metadata fields appended by OCR + input := map[string]any{ + "Reports": []any{reportOne, reportTwo}, + consensustypes.MetadataFieldName: getMetadata(workflowID), + } + wrapped, err = values.NewMap(input) + require.NoError(t, err) + encoded, err := enc.Encode(testutils.Context(t), *wrapped) + require.NoError(t, err) + + expected := + // start of the outer tuple + getHexMetadata() + + // start of the inner tuple (user_fields) + "0000000000000000000000000000000000000000000000000000000000000020" + // offset of Reports array + "0000000000000000000000000000000000000000000000000000000000000002" + // length of Reports array + "0000000000000000000000000000000000000000000000000000000000000040" + // offset of ReportOne + "0000000000000000000000000000000000000000000000000000000000000100" + // offset of ReportTwo + "0100000000000000000000000000000000000000000000000000000000000000" + // ReportOne FeedID + "0000000000000000000000000000000000000000000000000000000000000060" + // offset of ReportOne Bundle + "0000000000000000000000000000000000000000000000000000000002dabeca" + // ReportOne Timestamp + "0000000000000000000000000000000000000000000000000000000000000040" + // length of ReportOne Bundle + "0000000000000000000000000000000000000000000000000000000000000005" + // ReportOne Ask + "0000000000000000000000000000000000000000000000000000000000000006" + // ReportOne Bid + "0200000000000000000000000000000000000000000000000000000000000000" + // ReportTwo FeedID + "0000000000000000000000000000000000000000000000000000000000000060" + // offset of ReportTwo Bundle + "0000000000000000000000000000000000000000000000000000000002dabeca" + // ReportTwo Timestamp + "0000000000000000000000000000000000000000000000000000000000000040" + // length of ReportTwo Bundle + "0000000000000000000000000000000000000000000000000000000000000007" + // ReportTwo Ask + "0000000000000000000000000000000000000000000000000000000000000008" // ReportTwo Bid + + require.Equal(t, expected, hex.EncodeToString(encoded)) +} + func getHexMetadata() string { return "01" + executionID + timestampHex + donIDHex + configVersionHex + workflowID + workflowName + workflowOwnerID + reportID } @@ -306,3 +384,14 @@ func getMetadata(cid string) consensustypes.Metadata { ReportID: reportID, } } + +//0000000000000000000000000000000000000000000000000000000000000020 // offset of Reports array +//0000000000000000000000000000000000000000000000000000000000000001 // length of Reports array +//0000000000000000000000000000000000000000000000000000000000000020 // offset of ReportOne +//018bfe8840700040000000000000000000000000000000000000000000000000 +//000000000000000000000000000000000000000000000000000000006764774b +//0000000000000000000000000000000000000000000000000000000000000060 +//0000000000000000000000000000000000000000000000000000000000000020 +//0000000000000000000000000000000000000000000000000000000bb5c162c8 + +"0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000100010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000002dabeca000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000050000000000000000000000000000000000000000000000000000000000000006020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000002dabeca000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000070000000000000000000000000000000000000000000000000000000000000008" // ReportTwo Bid \ No newline at end of file diff --git a/core/services/relay/evm/chain_components_test.go b/core/services/relay/evm/chain_components_test.go index 1e8c47c51ec..006236c060a 100644 --- a/core/services/relay/evm/chain_components_test.go +++ b/core/services/relay/evm/chain_components_test.go @@ -9,6 +9,7 @@ import ( "math/big" "os" "strconv" + "sync" "testing" "time" @@ -27,11 +28,11 @@ import ( commontestutils "github.com/smartcontractkit/chainlink-common/pkg/loop/testutils" clcommontypes "github.com/smartcontractkit/chainlink-common/pkg/types" "github.com/smartcontractkit/chainlink-common/pkg/types/interfacetests" - "github.com/smartcontractkit/chainlink-common/pkg/utils/tests" htMocks "github.com/smartcontractkit/chainlink/v2/common/headtracker/mocks" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/assets" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/client" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/headtracker" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/logpoller" lpMocks "github.com/smartcontractkit/chainlink/v2/core/chains/evm/logpoller/mocks" evmtxmgr "github.com/smartcontractkit/chainlink/v2/core/chains/evm/txmgr" @@ -50,6 +51,7 @@ import ( ) const commonGasLimitOnEvms = uint64(4712388) +const finalityDepth = 4 func TestContractReaderEventsInitValidation(t *testing.T) { tests := []struct { @@ -228,17 +230,51 @@ func TestChainReader_HealthReport(t *testing.T) { } func TestChainComponents(t *testing.T) { - tests.SkipFlakey(t, "https://smartcontract-it.atlassian.net/browse/BCFR-1083") t.Parallel() - it := &EVMChainComponentsInterfaceTester[*testing.T]{Helper: &helper{}} - // TODO, generated binding tests are broken - it.DisableTests([]string{interfacetests.ContractReaderGetLatestValue}) - it.Init(t) - + // shared helper so all tests can run efficiently in parallel + helper := &helper{} + helper.Init(t) + deployLock := sync.Mutex{} // add new subtests here so that it can be run on real chains too - RunChainComponentsEvmTests(t, it) - RunChainComponentsInLoopEvmTests[*testing.T](t, commontestutils.WrapContractReaderTesterForLoop(it)) - RunChainComponentsInLoopEvmTests(t, WrapContractReaderTesterWithBindings(t, it)) + t.Run("RunChainComponentsEvmTests", func(t *testing.T) { + t.Parallel() + it := &EVMChainComponentsInterfaceTester[*testing.T]{Helper: helper, DeployLock: &deployLock} + // These tests are broken in develop as well, so disable them for now + it.DisableTests([]string{ + interfacetests.ContractReaderQueryKeysReturnsDataTwoEventTypes, + interfacetests.ContractReaderQueryKeysReturnsDataAsValuesDotValue, + interfacetests.ContractReaderQueryKeysCanFilterWithValueComparator, + }) + it.Setup(t) + + RunChainComponentsEvmTests(t, it) + }) + + t.Run("RunChainComponentsInLoopEvmTests", func(t *testing.T) { + t.Parallel() + it := &EVMChainComponentsInterfaceTester[*testing.T]{Helper: helper, DeployLock: &deployLock} + wrapped := commontestutils.WrapContractReaderTesterForLoop(it) + // These tests are broken in develop as well, so disable them for now + wrapped.DisableTests([]string{ + interfacetests.ContractReaderQueryKeysReturnsDataTwoEventTypes, + interfacetests.ContractReaderQueryKeysReturnsDataAsValuesDotValue, + interfacetests.ContractReaderQueryKeysCanFilterWithValueComparator, + }) + wrapped.Setup(t) + + RunChainComponentsInLoopEvmTests[*testing.T](t, wrapped, true) + }) + + t.Run("RunChainComponentsInLoopEvmTestsWithBindings", func(t *testing.T) { + t.Parallel() + it := &EVMChainComponentsInterfaceTester[*testing.T]{Helper: helper, DeployLock: &deployLock} + wrapped := WrapContractReaderTesterWithBindings(t, it) + // TODO, generated binding tests are broken + wrapped.DisableTests([]string{interfacetests.ContractReaderGetLatestValue}) + wrapped.Setup(t) + // generated tests are not compatible with parallel running atm + RunChainComponentsInLoopEvmTests(t, wrapped, false) + }) } type helper struct { @@ -249,6 +285,40 @@ type helper struct { txm evmtxmgr.TxManager client client.Client db *sqlx.DB + lp logpoller.LogPoller + ht logpoller.HeadTracker +} + +func getLPOpts() logpoller.Opts { + return logpoller.Opts{ + PollPeriod: time.Millisecond, + FinalityDepth: finalityDepth, + BackfillBatchSize: 1, + RpcBatchSize: 1, + KeepFinalizedBlocksDepth: 10000, + } +} + +func (h *helper) LogPoller(t *testing.T) logpoller.LogPoller { + if h.lp != nil { + return h.lp + } + ctx := testutils.Context(t) + lggr := logger.NullLogger + db := h.Database() + + h.lp = logpoller.NewLogPoller(logpoller.NewORM(h.ChainID(), db, lggr), h.Client(t), lggr, h.HeadTracker(t), getLPOpts()) + require.NoError(t, h.lp.Start(ctx)) + return h.lp +} + +func (h *helper) HeadTracker(t *testing.T) logpoller.HeadTracker { + if h.ht != nil { + return h.ht + } + lpOpts := getLPOpts() + h.ht = headtracker.NewSimulatedHeadTracker(h.Client(t), lpOpts.UseFinalityTag, lpOpts.FinalityDepth) + return h.ht } func (h *helper) Init(t *testing.T) { @@ -260,6 +330,7 @@ func (h *helper) Init(t *testing.T) { h.Backend() h.client = h.Client(t) + h.LogPoller(t) h.txm = h.TXM(t, h.client) } @@ -320,6 +391,10 @@ func (h *helper) ChainID() *big.Int { return testutils.SimulatedChainID } +func (h *helper) Database() *sqlx.DB { + return h.db +} + func (h *helper) NewSqlxDB(t *testing.T) *sqlx.DB { return pgtest.NewSqlxDB(t) } diff --git a/core/services/relay/evm/evmtesting/chain_components_interface_tester.go b/core/services/relay/evm/evmtesting/chain_components_interface_tester.go index 71bd94f0e9f..642a4350a64 100644 --- a/core/services/relay/evm/evmtesting/chain_components_interface_tester.go +++ b/core/services/relay/evm/evmtesting/chain_components_interface_tester.go @@ -2,8 +2,8 @@ package evmtesting import ( "context" - "encoding/json" "math/big" + "sync" "time" "github.com/ethereum/go-ethereum/accounts/abi/bind" @@ -15,13 +15,12 @@ import ( "github.com/stretchr/testify/require" "github.com/smartcontractkit/chainlink-common/pkg/codec" + "github.com/smartcontractkit/chainlink-common/pkg/services/servicetest" clcommontypes "github.com/smartcontractkit/chainlink-common/pkg/types" "github.com/smartcontractkit/chainlink-common/pkg/types/query/primitives" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/assets" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/client" - "github.com/smartcontractkit/chainlink/v2/core/chains/evm/gas" - "github.com/smartcontractkit/chainlink/v2/core/chains/evm/headtracker" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/logpoller" evmtxmgr "github.com/smartcontractkit/chainlink/v2/core/chains/evm/txmgr" evmtypes "github.com/smartcontractkit/chainlink/v2/core/chains/evm/types" @@ -40,14 +39,13 @@ const ( triggerWithAllTopics = "TriggeredWithFourTopics" triggerWithAllTopicsWithHashed = "TriggeredWithFourTopicsWithHashed" staticBytesEventName = "StaticBytes" - finalityDepth = 4 ) type EVMChainComponentsInterfaceTesterHelper[T TestingT[T]] interface { - Init(t T) Client(t T) client.Client Commit() Backend() bind.ContractBackend + Database() *sqlx.DB ChainID() *big.Int Context(t T) context.Context NewSqlxDB(t T) *sqlx.DB @@ -58,67 +56,21 @@ type EVMChainComponentsInterfaceTesterHelper[T TestingT[T]] interface { // To enable the historical wrappers required for Simulated Backend tests. ChainReaderEVMClient(ctx context.Context, t T, ht logpoller.HeadTracker, conf types.ChainReaderConfig) client.Client WrappedChainWriter(cw clcommontypes.ContractWriter, client client.Client) clcommontypes.ContractWriter + LogPoller(t T) logpoller.LogPoller + HeadTracker(t T) logpoller.HeadTracker } type EVMChainComponentsInterfaceTester[T TestingT[T]] struct { TestSelectionSupport Helper EVMChainComponentsInterfaceTesterHelper[T] + DeployLock *sync.Mutex client client.Client - address string - address2 string - contractTesters map[string]*chain_reader_tester.ChainReaderTester - chainReaderConfig types.ChainReaderConfig - chainWriterConfig types.ChainWriterConfig - deployerAuth *bind.TransactOpts - senderAuth *bind.TransactOpts - cr evm.ChainReaderService - cw evm.ChainWriterService - dirtyContracts bool - txm evmtxmgr.TxManager - gasEstimator gas.EvmFeeEstimator chainReaderConfigSupplier func(t T) types.ChainReaderConfig chainWriterConfigSupplier func(t T) types.ChainWriterConfig - dirtyConfig bool } -func (it *EVMChainComponentsInterfaceTester[T]) Setup(t T) { - t.Cleanup(func() { - // DB may be closed by the test already, ignore errors - if it.cr != nil { - _ = it.cr.Close() - } - it.cr = nil - - if it.dirtyContracts { - it.contractTesters = nil - } - - if it.cw != nil { - _ = it.cw.Close() - } - it.cw = nil - }) - - // can re-use the same chain for tests, just make new contract for each test - if it.client != nil && !it.dirtyConfig { - it.deployNewContracts(t) - return - } - - // Need to separate accounts to ensure the nonce doesn't get misaligned after the - // contract deployments. - accounts := it.Helper.Accounts(t) - it.deployerAuth = accounts[0] - it.senderAuth = accounts[1] - - it.chainReaderConfig = it.chainReaderConfigSupplier(t) - it.GetContractReader(t) - - it.txm = it.Helper.TXM(t, it.client) - it.chainWriterConfig = it.chainWriterConfigSupplier(t) - - it.deployNewContracts(t) - it.dirtyConfig = false +func (it *EVMChainComponentsInterfaceTester[T]) GetBindings(t T) []clcommontypes.BoundContract { + return it.deployNewContracts(t) } func (it *EVMChainComponentsInterfaceTester[T]) getChainReaderConfig(t T) types.ChainReaderConfig { @@ -357,138 +309,94 @@ func (it *EVMChainComponentsInterfaceTester[T]) GetAccountString(i int) string { func (it *EVMChainComponentsInterfaceTester[T]) GetContractReader(t T) clcommontypes.ContractReader { ctx := it.Helper.Context(t) - if it.cr != nil { - return it.cr - } - lggr := logger.NullLogger - db := it.Helper.NewSqlxDB(t) - lpOpts := logpoller.Opts{ - PollPeriod: time.Millisecond, - FinalityDepth: finalityDepth, - BackfillBatchSize: 1, - RpcBatchSize: 1, - KeepFinalizedBlocksDepth: 10000, - } - ht := headtracker.NewSimulatedHeadTracker(it.Helper.Client(t), lpOpts.UseFinalityTag, lpOpts.FinalityDepth) - lp := logpoller.NewLogPoller(logpoller.NewORM(it.Helper.ChainID(), db, lggr), it.Helper.Client(t), lggr, ht, lpOpts) - require.NoError(t, lp.Start(ctx)) - // encode and decode the config to ensure the test covers type issues - confBytes, err := json.Marshal(it.chainReaderConfig) + cr, err := evm.NewChainReaderService(ctx, lggr, it.Helper.LogPoller(t), it.Helper.HeadTracker(t), it.client, it.chainReaderConfigSupplier(t)) require.NoError(t, err) + servicetest.Run(t, cr) - conf, err := types.ChainReaderConfigFromBytes(confBytes) - require.NoError(t, err) - - cwh := it.Helper.ChainReaderEVMClient(ctx, t, ht, conf) - it.client = cwh - - cr, err := evm.NewChainReaderService(ctx, lggr, lp, ht, it.client, conf) - require.NoError(t, err) - require.NoError(t, cr.Start(ctx)) - it.cr = cr return cr } -// This function is no longer necessary for Simulated Backend or Testnet tests. -func (it *EVMChainComponentsInterfaceTester[T]) GenerateBlocksTillConfidenceLevel(t T, contractName, readName string, confidenceLevel primitives.ConfidenceLevel) { -} - func (it *EVMChainComponentsInterfaceTester[T]) GetContractWriter(t T) clcommontypes.ContractWriter { - ctx := it.Helper.Context(t) - if it.cw != nil { - return it.cw - } - - cw, err := evm.NewChainWriterService(logger.NullLogger, it.client, it.txm, it.gasEstimator, it.chainWriterConfig) + cw, err := evm.NewChainWriterService(logger.NullLogger, it.client, it.Helper.TXM(t, it.client), nil, it.chainWriterConfigSupplier(t)) require.NoError(t, err) - it.cw = it.Helper.WrappedChainWriter(cw, it.client) + + cw = it.Helper.WrappedChainWriter(cw, it.client) require.NoError(t, err) - require.NoError(t, cw.Start(ctx)) - return it.cw + + servicetest.Run(t, cw) + + return cw } -func (it *EVMChainComponentsInterfaceTester[T]) GetBindings(_ T) []clcommontypes.BoundContract { - return []clcommontypes.BoundContract{ - {Name: AnyContractName, Address: it.address}, - {Name: AnySecondContractName, Address: it.address2}, - } +// This function is no longer necessary for Simulated Backend or Testnet tests. +func (it *EVMChainComponentsInterfaceTester[T]) GenerateBlocksTillConfidenceLevel(t T, contractName, readName string, confidenceLevel primitives.ConfidenceLevel) { } func (it *EVMChainComponentsInterfaceTester[T]) DirtyContracts() { - it.dirtyContracts = true } func (it *EVMChainComponentsInterfaceTester[T]) GetAuthWithGasSet(t T) *bind.TransactOpts { - gasPrice, err := it.client.SuggestGasPrice(it.Helper.Context(t)) + auth := *it.Helper.Accounts(t)[0] + gasPrice, err := it.Helper.Client(t).SuggestGasPrice(it.Helper.Context(t)) require.NoError(t, err) extra := new(big.Int).Mul(gasPrice, big.NewInt(it.Helper.GasPriceBufferPercent())) extra = extra.Div(extra, big.NewInt(100)) - it.deployerAuth.GasPrice = gasPrice.Add(gasPrice, extra) - return it.deployerAuth -} - -func (it *EVMChainComponentsInterfaceTester[T]) IncNonce() { - if it.deployerAuth.Nonce == nil { - it.deployerAuth.Nonce = big.NewInt(1) - } else { - it.deployerAuth.Nonce = it.deployerAuth.Nonce.Add(it.deployerAuth.Nonce, big.NewInt(1)) - } + auth.GasPrice = gasPrice.Add(gasPrice, extra) + auth.GasLimit = 10552800 + nonce, err := it.client.PendingNonceAt(it.Helper.Context(t), auth.From) + require.NoError(t, err) + auth.Nonce = new(big.Int).SetUint64(nonce) + return &auth } func (it *EVMChainComponentsInterfaceTester[T]) AwaitTx(t T, tx *gethtypes.Transaction) { ctx := it.Helper.Context(t) - receipt, err := bind.WaitMined(ctx, it.client, tx) + receipt, err := bind.WaitMined(ctx, it.Helper.Client(t), tx) require.NoError(t, err) require.Equal(t, gethtypes.ReceiptStatusSuccessful, receipt.Status) } -func (it *EVMChainComponentsInterfaceTester[T]) deployNewContracts(t T) { - // First test deploy both contracts, otherwise only deploy contracts if cleanup decides that we need to. - if it.address == "" || it.contractTesters == nil { - it.contractTesters = make(map[string]*chain_reader_tester.ChainReaderTester, 2) - address, ts1 := it.deployNewContract(t) - address2, ts2 := it.deployNewContract(t) - it.address, it.address2 = address, address2 - it.contractTesters[it.address] = ts1 - it.contractTesters[it.address2] = ts2 - it.dirtyContracts = false +func (it *EVMChainComponentsInterfaceTester[T]) deployNewContracts(t T) []clcommontypes.BoundContract { + it.DeployLock.Lock() + defer it.DeployLock.Unlock() + address := it.deployNewContract(t) + address2 := it.deployNewContract(t) + return []clcommontypes.BoundContract{ + {Name: AnyContractName, Address: address}, + {Name: AnySecondContractName, Address: address2}, } } -func (it *EVMChainComponentsInterfaceTester[T]) deployNewContract(t T) (string, *chain_reader_tester.ChainReaderTester) { - // 105528 was in the error: gas too low: have 0, want 105528 - // Not sure if there's a better way to get it. - it.deployerAuth.GasLimit = 10552800 - - address, tx, ts, err := chain_reader_tester.DeployChainReaderTester(it.GetAuthWithGasSet(t), it.Helper.Backend()) +func (it *EVMChainComponentsInterfaceTester[T]) deployNewContract(t T) string { + address, tx, _, err := chain_reader_tester.DeployChainReaderTester(it.GetAuthWithGasSet(t), it.Helper.Backend()) require.NoError(t, err) - it.Helper.Commit() - it.IncNonce() it.AwaitTx(t, tx) - return address.String(), ts + return address.String() } func (it *EVMChainComponentsInterfaceTester[T]) MaxWaitTimeForEvents() time.Duration { return it.Helper.MaxWaitTimeForEvents() } -func (it *EVMChainComponentsInterfaceTester[T]) Init(t T) { - it.Helper.Init(t) - it.chainWriterConfigSupplier = func(t T) types.ChainWriterConfig { return it.getChainWriterConfig(t) } - it.chainReaderConfigSupplier = func(t T) types.ChainReaderConfig { return it.getChainReaderConfig(t) } +func (it *EVMChainComponentsInterfaceTester[T]) Setup(t T) { + if it.chainReaderConfigSupplier == nil { + it.chainReaderConfigSupplier = func(t T) types.ChainReaderConfig { return it.getChainReaderConfig(t) } + } + if it.chainWriterConfigSupplier == nil { + it.chainWriterConfigSupplier = func(t T) types.ChainWriterConfig { return it.getChainWriterConfig(t) } + } + it.client = it.Helper.ChainReaderEVMClient(it.Helper.Context(t), t, it.Helper.HeadTracker(t), it.chainReaderConfigSupplier(t)) } func (it *EVMChainComponentsInterfaceTester[T]) SetChainReaderConfigSupplier(chainReaderConfigSupplier func(t T) types.ChainReaderConfig) { - it.dirtyConfig = true it.chainReaderConfigSupplier = chainReaderConfigSupplier } func (it *EVMChainComponentsInterfaceTester[T]) SetChainWriterConfigSupplier(chainWriterConfigSupplier func(t T) types.ChainWriterConfig) { - it.dirtyConfig = true it.chainWriterConfigSupplier = chainWriterConfigSupplier } diff --git a/core/services/relay/evm/evmtesting/run_tests.go b/core/services/relay/evm/evmtesting/run_tests.go index b6abffdcb2f..469cc3594b8 100644 --- a/core/services/relay/evm/evmtesting/run_tests.go +++ b/core/services/relay/evm/evmtesting/run_tests.go @@ -37,31 +37,31 @@ func RunChainComponentsEvmTests[T TestingT[T]](t T, it *EVMChainComponentsInterf // Add ChainWriter tests here } -func RunChainComponentsInLoopEvmTests[T TestingT[T]](t T, it ChainComponentsInterfaceTester[T]) { - RunContractReaderInLoopTests[T](t, it) +func RunChainComponentsInLoopEvmTests[T TestingT[T]](t T, it ChainComponentsInterfaceTester[T], parallel bool) { + RunContractReaderInLoopTests[T](t, it, parallel) // Add ChainWriter tests here } func RunContractReaderEvmTests[T TestingT[T]](t T, it *EVMChainComponentsInterfaceTester[T]) { - RunContractReaderInterfaceTests[T](t, it, false) + RunContractReaderInterfaceTests[T](t, it, false, true) testCases := []Testcase[T]{ { Name: ContractReaderDynamicTypedTopicsFilterAndCorrectReturn, Test: func(t T) { - it.Setup(t) + cr := it.GetContractReader(t) + cw := it.GetContractWriter(t) + bindings := it.GetBindings(t) anyString := "foo" ctx := it.Helper.Context(t) - cr := it.GetContractReader(t) - bindings := it.GetBindings(t) require.NoError(t, cr.Bind(ctx, bindings)) type DynamicEvent struct { Field string } - SubmitTransactionToCW(t, it, "triggerEventWithDynamicTopic", DynamicEvent{Field: anyString}, bindings[0], types.Unconfirmed) + SubmitTransactionToCW(t, it, cw, "triggerEventWithDynamicTopic", DynamicEvent{Field: anyString}, bindings[0], types.Unconfirmed) input := struct{ Field string }{Field: anyString} tp := cr.(clcommontypes.ContractTypeProvider) @@ -88,17 +88,17 @@ func RunContractReaderEvmTests[T TestingT[T]](t T, it *EVMChainComponentsInterfa { Name: ContractReaderMultipleTopicCanFilterTogether, Test: func(t T) { - it.Setup(t) - ctx := it.Helper.Context(t) cr := it.GetContractReader(t) + cw := it.GetContractWriter(t) bindings := it.GetBindings(t) + ctx := it.Helper.Context(t) require.NoError(t, cr.Bind(ctx, bindings)) - triggerFourTopics(t, it, int32(1), int32(2), int32(3)) - triggerFourTopics(t, it, int32(2), int32(2), int32(3)) - triggerFourTopics(t, it, int32(1), int32(3), int32(3)) - triggerFourTopics(t, it, int32(1), int32(2), int32(4)) + triggerFourTopics(t, it, cw, bindings, int32(1), int32(2), int32(3)) + triggerFourTopics(t, it, cw, bindings, int32(2), int32(2), int32(3)) + triggerFourTopics(t, it, cw, bindings, int32(1), int32(3), int32(3)) + triggerFourTopics(t, it, cw, bindings, int32(1), int32(2), int32(4)) var bound types.BoundContract for idx := range bindings { @@ -121,17 +121,17 @@ func RunContractReaderEvmTests[T TestingT[T]](t T, it *EVMChainComponentsInterfa { Name: ContractReaderFilteringCanBeDoneOnHashedIndexedTopics, Test: func(t T) { - it.Setup(t) - cr := it.GetContractReader(t) - ctx := it.Helper.Context(t) + cw := it.GetContractWriter(t) bindings := it.GetBindings(t) + ctx := it.Helper.Context(t) + require.NoError(t, cr.Bind(ctx, bindings)) - triggerFourTopicsWithHashed(t, it, "1", [32]uint8{2}, [32]byte{5}) - triggerFourTopicsWithHashed(t, it, "2", [32]uint8{2}, [32]byte{3}) - triggerFourTopicsWithHashed(t, it, "1", [32]uint8{3}, [32]byte{3}) + triggerFourTopicsWithHashed(t, it, cw, bindings, "1", [32]uint8{2}, [32]byte{5}) + triggerFourTopicsWithHashed(t, it, cw, bindings, "2", [32]uint8{2}, [32]byte{3}) + triggerFourTopicsWithHashed(t, it, cw, bindings, "1", [32]uint8{3}, [32]byte{3}) var bound types.BoundContract for idx := range bindings { @@ -158,10 +158,9 @@ func RunContractReaderEvmTests[T TestingT[T]](t T, it *EVMChainComponentsInterfa { Name: ContractReaderBindReturnsErrorOnMissingContractAtAddress, Test: func(t T) { - it.Setup(t) + reader := it.GetContractReader(t) addr := common.BigToAddress(big.NewInt(42)) - reader := it.GetContractReader(t) ctx := it.Helper.Context(t) err := reader.Bind(ctx, []clcommontypes.BoundContract{{Name: AnyContractName, Address: addr.Hex()}}) @@ -170,29 +169,29 @@ func RunContractReaderEvmTests[T TestingT[T]](t T, it *EVMChainComponentsInterfa }, }, } - RunTests(t, it, testCases) + RunTestsInParallel(t, it, testCases) } -func RunContractReaderInLoopTests[T TestingT[T]](t T, it ChainComponentsInterfaceTester[T]) { - RunContractReaderInterfaceTests[T](t, it, false) +func RunContractReaderInLoopTests[T TestingT[T]](t T, it ChainComponentsInterfaceTester[T], parallel bool) { + RunContractReaderInterfaceTests[T](t, it, false, parallel) testCases := []Testcase[T]{ { Name: ContractReaderQueryKeyFilterOnDataWordsWithValueComparator, Test: func(t T) { - ctx := tests.Context(t) cr := it.GetContractReader(t) - require.NoError(t, cr.Bind(ctx, it.GetBindings(t))) + cw := it.GetContractWriter(t) bindings := it.GetBindings(t) - boundContract := BindingsByName(bindings, AnyContractName)[0] + ctx := tests.Context(t) require.NoError(t, cr.Bind(ctx, bindings)) + boundContract := BindingsByName(bindings, AnyContractName)[0] ts1 := CreateTestStruct[T](0, it) - _ = SubmitTransactionToCW(t, it, MethodTriggeringEvent, ts1, boundContract, types.Unconfirmed) + _ = SubmitTransactionToCW(t, it, cw, MethodTriggeringEvent, ts1, boundContract, types.Unconfirmed) ts2 := CreateTestStruct[T](15, it) - _ = SubmitTransactionToCW(t, it, MethodTriggeringEvent, ts2, boundContract, types.Unconfirmed) + _ = SubmitTransactionToCW(t, it, cw, MethodTriggeringEvent, ts2, boundContract, types.Unconfirmed) ts3 := CreateTestStruct[T](35, it) - _ = SubmitTransactionToCW(t, it, MethodTriggeringEvent, ts3, boundContract, types.Unconfirmed) + _ = SubmitTransactionToCW(t, it, cw, MethodTriggeringEvent, ts3, boundContract, types.Unconfirmed) ts := &TestStruct{} assert.Eventually(t, func() bool { sequences, err := cr.QueryKey(ctx, boundContract, query.KeyFilter{ @@ -211,19 +210,20 @@ func RunContractReaderInLoopTests[T TestingT[T]](t T, it ChainComponentsInterfac { Name: ContractReaderQueryKeyOnDataWordsWithValueComparatorOnNestedField, Test: func(t T) { - ctx := tests.Context(t) cr := it.GetContractReader(t) - require.NoError(t, cr.Bind(ctx, it.GetBindings(t))) + cw := it.GetContractWriter(t) bindings := it.GetBindings(t) + ctx := tests.Context(t) + boundContract := BindingsByName(bindings, AnyContractName)[0] require.NoError(t, cr.Bind(ctx, bindings)) ts1 := CreateTestStruct[T](0, it) - _ = SubmitTransactionToCW(t, it, MethodTriggeringEvent, ts1, boundContract, types.Unconfirmed) + _ = SubmitTransactionToCW(t, it, cw, MethodTriggeringEvent, ts1, boundContract, types.Unconfirmed) ts2 := CreateTestStruct[T](15, it) - _ = SubmitTransactionToCW(t, it, MethodTriggeringEvent, ts2, boundContract, types.Unconfirmed) + _ = SubmitTransactionToCW(t, it, cw, MethodTriggeringEvent, ts2, boundContract, types.Unconfirmed) ts3 := CreateTestStruct[T](35, it) - _ = SubmitTransactionToCW(t, it, MethodTriggeringEvent, ts3, boundContract, types.Unconfirmed) + _ = SubmitTransactionToCW(t, it, cw, MethodTriggeringEvent, ts3, boundContract, types.Unconfirmed) ts := &TestStruct{} assert.Eventually(t, func() bool { sequences, err := cr.QueryKey(ctx, boundContract, query.KeyFilter{ @@ -247,19 +247,19 @@ func RunContractReaderInLoopTests[T TestingT[T]](t T, it ChainComponentsInterfac { Name: ContractReaderQueryKeyFilterOnDataWordsWithValueComparatorOnDynamicField, Test: func(t T) { - ctx := tests.Context(t) cr := it.GetContractReader(t) - require.NoError(t, cr.Bind(ctx, it.GetBindings(t))) + cw := it.GetContractWriter(t) bindings := it.GetBindings(t) - boundContract := BindingsByName(bindings, AnyContractName)[0] + ctx := tests.Context(t) require.NoError(t, cr.Bind(ctx, bindings)) + boundContract := BindingsByName(bindings, AnyContractName)[0] ts1 := CreateTestStruct[T](0, it) - _ = SubmitTransactionToCW(t, it, MethodTriggeringEvent, ts1, boundContract, types.Unconfirmed) + _ = SubmitTransactionToCW(t, it, cw, MethodTriggeringEvent, ts1, boundContract, types.Unconfirmed) ts2 := CreateTestStruct[T](15, it) - _ = SubmitTransactionToCW(t, it, MethodTriggeringEvent, ts2, boundContract, types.Unconfirmed) + _ = SubmitTransactionToCW(t, it, cw, MethodTriggeringEvent, ts2, boundContract, types.Unconfirmed) ts3 := CreateTestStruct[T](35, it) - _ = SubmitTransactionToCW(t, it, MethodTriggeringEvent, ts3, boundContract, types.Unconfirmed) + _ = SubmitTransactionToCW(t, it, cw, MethodTriggeringEvent, ts3, boundContract, types.Unconfirmed) ts := &TestStruct{} assert.Eventually(t, func() bool { sequences, err := cr.QueryKey(ctx, boundContract, query.KeyFilter{ @@ -283,12 +283,12 @@ func RunContractReaderInLoopTests[T TestingT[T]](t T, it ChainComponentsInterfac { Name: ContractReaderQueryKeyFilteringOnDataWordsUsingValueComparatorsOnFieldsWithManualIndex, Test: func(t T) { - ctx := tests.Context(t) cr := it.GetContractReader(t) - require.NoError(t, cr.Bind(ctx, it.GetBindings(t))) + cw := it.GetContractWriter(t) bindings := it.GetBindings(t) - boundContract := BindingsByName(bindings, AnyContractName)[0] + ctx := tests.Context(t) require.NoError(t, cr.Bind(ctx, bindings)) + boundContract := BindingsByName(bindings, AnyContractName)[0] empty12Bytes := [12]byte{} val1, val2, val3, val4 := uint32(1), uint32(2), uint32(3), uint64(4) val5, val6, val7 := [32]byte{}, [32]byte{6}, [32]byte{7} @@ -313,10 +313,10 @@ func RunContractReaderInLoopTests[T TestingT[T]](t T, it ChainComponentsInterfac wrapExpectedRes := eventResAsStruct{Message: &resExpected} // emit the one we want to search for and a couple of random ones to confirm that filtering works - triggerStaticBytes(t, it, val1, val2, val3, val4, val5, val6, val7, raw) - triggerStaticBytes(t, it, 1337, 7331, 4747, val4, val5, val6, val7, raw) - triggerStaticBytes(t, it, 7331, 4747, 1337, val4, val5, val6, val7, raw) - triggerStaticBytes(t, it, 4747, 1337, 7331, val4, val5, val6, val7, raw) + triggerStaticBytes(t, it, cw, bindings, val1, val2, val3, val4, val5, val6, val7, raw) + triggerStaticBytes(t, it, cw, bindings, 1337, 7331, 4747, val4, val5, val6, val7, raw) + triggerStaticBytes(t, it, cw, bindings, 7331, 4747, 1337, val4, val5, val6, val7, raw) + triggerStaticBytes(t, it, cw, bindings, 4747, 1337, 7331, val4, val5, val6, val7, raw) assert.Eventually(t, func() bool { sequences, err := cr.QueryKey(ctx, boundContract, query.KeyFilter{ @@ -333,31 +333,33 @@ func RunContractReaderInLoopTests[T TestingT[T]](t T, it ChainComponentsInterfac }, }, } - RunTests(t, it, testCases) + if parallel { + RunTestsInParallel(t, it, testCases) + } else { + RunTests(t, it, testCases) + } } -func triggerFourTopics[T TestingT[T]](t T, it *EVMChainComponentsInterfaceTester[T], i1, i2, i3 int32) { +func triggerFourTopics[T TestingT[T]](t T, it *EVMChainComponentsInterfaceTester[T], cw clcommontypes.ContractWriter, bindings []clcommontypes.BoundContract, i1, i2, i3 int32) { type DynamicEvent struct { Field1 int32 Field2 int32 Field3 int32 } - contracts := it.GetBindings(t) - SubmitTransactionToCW(t, it, "triggerWithFourTopics", DynamicEvent{Field1: i1, Field2: i2, Field3: i3}, contracts[0], types.Unconfirmed) + SubmitTransactionToCW(t, it, cw, "triggerWithFourTopics", DynamicEvent{Field1: i1, Field2: i2, Field3: i3}, bindings[0], types.Unconfirmed) } -func triggerFourTopicsWithHashed[T TestingT[T]](t T, it *EVMChainComponentsInterfaceTester[T], i1 string, i2 [32]uint8, i3 [32]byte) { +func triggerFourTopicsWithHashed[T TestingT[T]](t T, it *EVMChainComponentsInterfaceTester[T], cw clcommontypes.ContractWriter, bindings []clcommontypes.BoundContract, i1 string, i2 [32]uint8, i3 [32]byte) { type DynamicEvent struct { Field1 string Field2 [32]uint8 Field3 [32]byte } - contracts := it.GetBindings(t) - SubmitTransactionToCW(t, it, "triggerWithFourTopicsWithHashed", DynamicEvent{Field1: i1, Field2: i2, Field3: i3}, contracts[0], types.Unconfirmed) + SubmitTransactionToCW(t, it, cw, "triggerWithFourTopicsWithHashed", DynamicEvent{Field1: i1, Field2: i2, Field3: i3}, bindings[0], types.Unconfirmed) } // triggerStaticBytes emits a staticBytes events and returns the expected event bytes. -func triggerStaticBytes[T TestingT[T]](t T, it ChainComponentsInterfaceTester[T], val1, val2, val3 uint32, val4 uint64, val5, val6, val7 [32]byte, raw []byte) { +func triggerStaticBytes[T TestingT[T]](t T, it ChainComponentsInterfaceTester[T], cw clcommontypes.ContractWriter, bindings []clcommontypes.BoundContract, val1, val2, val3 uint32, val4 uint64, val5, val6, val7 [32]byte, raw []byte) { type StaticBytesEvent struct { Val1 uint32 Val2 uint32 @@ -369,8 +371,7 @@ func triggerStaticBytes[T TestingT[T]](t T, it ChainComponentsInterfaceTester[T] Raw []byte } - contracts := it.GetBindings(t) - SubmitTransactionToCW(t, it, "triggerStaticBytes", + SubmitTransactionToCW(t, it, cw, "triggerStaticBytes", StaticBytesEvent{ Val1: val1, Val2: val2, @@ -381,5 +382,5 @@ func triggerStaticBytes[T TestingT[T]](t T, it ChainComponentsInterfaceTester[T] Val7: val7, Raw: raw, }, - contracts[0], types.Unconfirmed) + bindings[0], types.Unconfirmed) } diff --git a/deployment/go.mod b/deployment/go.mod index fe422003221..b01f2197114 100644 --- a/deployment/go.mod +++ b/deployment/go.mod @@ -29,10 +29,10 @@ require ( github.com/smartcontractkit/ccip-owner-contracts v0.0.0-salt-fix github.com/smartcontractkit/chain-selectors v1.0.34 github.com/smartcontractkit/chainlink-ccip v0.0.0-20241218114855-f74219171000 - github.com/smartcontractkit/chainlink-common v0.4.1-0.20241217120918-bbe318cd0760 + github.com/smartcontractkit/chainlink-common v0.4.1-0.20241223143929-db7919d60550 github.com/smartcontractkit/chainlink-protos/job-distributor v0.6.0 github.com/smartcontractkit/chainlink-testing-framework/lib v1.50.13 - github.com/smartcontractkit/libocr v0.0.0-20241007185508-adbe57025f12 + github.com/smartcontractkit/libocr v0.0.0-20241223215956-e5b78d8e3919 github.com/stretchr/testify v1.9.0 github.com/test-go/testify v1.1.4 github.com/testcontainers/testcontainers-go v0.34.0 @@ -411,7 +411,7 @@ require ( github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20241216163550-fa030d178ba3 // indirect github.com/smartcontractkit/chainlink-feeds v0.1.1 // indirect github.com/smartcontractkit/chainlink-protos/orchestrator v0.4.0 // indirect - github.com/smartcontractkit/chainlink-solana v1.1.1-0.20241219173444-150f7443fdd3 // indirect + github.com/smartcontractkit/chainlink-solana v1.1.1-0.20241223151630-eac4f1508dce // indirect github.com/smartcontractkit/chainlink-starknet/relayer v0.1.1-0.20241202202529-2033490e77b8 // indirect github.com/smartcontractkit/chainlink-testing-framework/lib/grafana v1.50.0 // indirect github.com/smartcontractkit/chainlink-testing-framework/seth v1.50.5 // indirect diff --git a/deployment/go.sum b/deployment/go.sum index cc0176b90a8..a364fc9b1ec 100644 --- a/deployment/go.sum +++ b/deployment/go.sum @@ -247,6 +247,8 @@ github.com/aws/jsii-runtime-go v1.104.0 h1:651Sh6J2FtatfnVzlOQ3/Ye1WWPAseZ6E/tSQ github.com/aws/jsii-runtime-go v1.104.0/go.mod h1:7ZmQXxV0AAhhvv/GaHX4n6zbgA1tSRVdnQYAJbIhXHk= github.com/aws/smithy-go v1.22.0 h1:uunKnWlcoL3zO7q+gG2Pk53joueEOsnNB28QdMsmiMM= github.com/aws/smithy-go v1.22.0/go.mod h1:irrKGvNn1InZwb2d7fkIRNucdfwR8R+Ts3wxYa/cJHg= +github.com/aybabtme/rgbterm v0.0.0-20170906152045-cc83f3b3ce59 h1:WWB576BN5zNSZc/M9d/10pqEx5VHNhaQ/yOVAkmj5Yo= +github.com/aybabtme/rgbterm v0.0.0-20170906152045-cc83f3b3ce59/go.mod h1:q/89r3U2H7sSsE2t6Kca0lfwTK8JdoNGS/yzM/4iH5I= github.com/bahlo/generic-list-go v0.2.0 h1:5sz/EEAK+ls5wF+NeqDpk5+iNdMDXrh3z3nPnH1Wvgk= github.com/bahlo/generic-list-go v0.2.0/go.mod h1:2KvAjgMlE5NNynlg/5iLrrCCZ2+5xWbdbCW3pNTGyYg= github.com/barkimedes/go-deepcopy v0.0.0-20220514131651-17c30cfc62df h1:GSoSVRLoBaFpOOds6QyY1L8AX7uoY+Ln3BHc22W40X0= @@ -284,6 +286,8 @@ github.com/btcsuite/btcd/chaincfg/chainhash v1.1.0 h1:59Kx4K6lzOW5w6nFlA0v5+lk/6 github.com/btcsuite/btcd/chaincfg/chainhash v1.1.0/go.mod h1:7SFka0XMvUgj3hfZtydOrQY2mwhPclbT2snogU7SQQc= github.com/bufbuild/protocompile v0.4.0 h1:LbFKd2XowZvQ/kajzguUp2DC9UEIQhIq77fZZlaQsNA= github.com/bufbuild/protocompile v0.4.0/go.mod h1:3v93+mbWn/v3xzN+31nwkJfrEpAUwp+BagBSZWx+TP8= +github.com/buger/goterm v0.0.0-20200322175922-2f3e71b85129 h1:gfAMKE626QEuKG3si0pdTRcr/YEbBoxY+3GOH3gWvl4= +github.com/buger/goterm v0.0.0-20200322175922-2f3e71b85129/go.mod h1:u9UyCz2eTrSGy6fbupqJ54eY5c4IC8gREQ1053dK12U= github.com/buger/jsonparser v1.1.1 h1:2PnMjfWD7wBILjqQbt530v576A/cAbQvEW9gGIpYMUs= github.com/buger/jsonparser v1.1.1/go.mod h1:6RYKKt7H4d4+iWqouImQ9R2FZql3VbhNgx27UK13J/0= github.com/bxcodec/faker v2.0.1+incompatible h1:P0KUpUw5w6WJXwrPfv35oc91i4d8nf40Nwln+M/+faA= @@ -543,6 +547,8 @@ github.com/gagliardetto/solana-go v1.8.4 h1:vmD/JmTlonyXGy39bAo0inMhmbdAwV7rXZtL github.com/gagliardetto/solana-go v1.8.4/go.mod h1:i+7aAyNDTHG0jK8GZIBSI4OVvDqkt2Qx+LklYclRNG8= github.com/gagliardetto/treeout v0.1.4 h1:ozeYerrLCmCubo1TcIjFiOWTTGteOOHND1twdFpgwaw= github.com/gagliardetto/treeout v0.1.4/go.mod h1:loUefvXTrlRG5rYmJmExNryyBRh8f89VZhmMOyCyqok= +github.com/gagliardetto/utilz v0.1.1 h1:/etW4hl607emKg6R6Lj9jRJ9d6ue2AQOyjhuAwjzs1U= +github.com/gagliardetto/utilz v0.1.1/go.mod h1:b+rGFkRHz3HWJD0RYMzat47JyvbTtpE0iEcYTRJTLLA= github.com/gballet/go-libpcsclite v0.0.0-20191108122812-4678299bea08 h1:f6D9Hr8xV8uYKlyuj8XIruxlh9WjVjdh1gIicAS7ays= github.com/gballet/go-libpcsclite v0.0.0-20191108122812-4678299bea08/go.mod h1:x7DCsMOv1taUwEWCzT4cmDeAkigA5/QCwUodaVOe8Ww= github.com/gedex/inflector v0.0.0-20170307190818-16278e9db813 h1:Uc+IZ7gYqAf/rSGFplbWBSHaGolEQlNLgMgSE3ccnIQ= @@ -835,6 +841,8 @@ github.com/gtank/merlin v0.1.1 h1:eQ90iG7K9pOhtereWsmyRJ6RAwcP4tHTDBHXNg+u5is= github.com/gtank/merlin v0.1.1/go.mod h1:T86dnYJhcGOh5BjZFCJWTDeTK7XW8uE+E21Cy/bIQ+s= github.com/gtank/ristretto255 v0.1.2 h1:JEqUCPA1NvLq5DwYtuzigd7ss8fwbYay9fi4/5uMzcc= github.com/gtank/ristretto255 v0.1.2/go.mod h1:Ph5OpO6c7xKUGROZfWVLiJf9icMDwUeIvY4OmlYW69o= +github.com/hako/durafmt v0.0.0-20200710122514-c0fb7b4da026 h1:BpJ2o0OR5FV7vrkDYfXYVJQeMNWa8RhklZOpW2ITAIQ= +github.com/hako/durafmt v0.0.0-20200710122514-c0fb7b4da026/go.mod h1:5Scbynm8dF1XAPwIwkGPqzkM/shndPm79Jd1003hTjE= github.com/hashicorp/consul/api v1.1.0/go.mod h1:VmuI/Lkw1nC05EYQWNKwWGbkg+FbDBtguAZLlVdkD9Q= github.com/hashicorp/consul/api v1.29.2 h1:aYyRn8EdE2mSfG14S1+L9Qkjtz8RzmaWh6AcNGRNwPw= github.com/hashicorp/consul/api v1.29.2/go.mod h1:0YObcaLNDSbtlgzIRtmRXI1ZkeuK0trCBxwZQ4MYnIk= @@ -1362,6 +1370,8 @@ github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQD github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= +github.com/ryanuber/go-glob v1.0.0 h1:iQh3xXAumdQ+4Ufa5b25cRpC5TYKlno6hsv6Cb3pkBk= +github.com/ryanuber/go-glob v1.0.0/go.mod h1:807d1WSdnB0XRJzKNil9Om6lcp/3a0v4qIHxIXzX/Yc= github.com/sagikazarmark/locafero v0.4.0 h1:HApY1R9zGo4DBgr7dqsTH/JJxLTTsOt7u6keLGt6kNQ= github.com/sagikazarmark/locafero v0.4.0/go.mod h1:Pe1W6UlPYUk/+wc/6KFhbORCfqzgYEpgQ3O5fPuL3H4= github.com/sagikazarmark/slog-shim v0.1.0 h1:diDBnUNK9N/354PgrxMywXnAwEr1QZcOr6gto+ugjYE= @@ -1417,8 +1427,8 @@ github.com/smartcontractkit/chainlink-automation v0.8.1 h1:sTc9LKpBvcKPc1JDYAmgB github.com/smartcontractkit/chainlink-automation v0.8.1/go.mod h1:Iij36PvWZ6blrdC5A/nrQUBuf3MH3JvsBB9sSyc9W08= github.com/smartcontractkit/chainlink-ccip v0.0.0-20241218114855-f74219171000 h1:6Zzr/R1j6P7bbvcUlt5WUIbItvrrGdGzIsiAzQezcwo= github.com/smartcontractkit/chainlink-ccip v0.0.0-20241218114855-f74219171000/go.mod h1:ncjd6mPZSRlelEqH/2KeLE1pU3UlqzBSn8RYkEoECzY= -github.com/smartcontractkit/chainlink-common v0.4.1-0.20241217120918-bbe318cd0760 h1:lB5A3TP0zOVuu1n0kEm6d8/o/4Knh6HLvsU/GChk+sI= -github.com/smartcontractkit/chainlink-common v0.4.1-0.20241217120918-bbe318cd0760/go.mod h1:yti7e1+G9hhkYhj+L5sVUULn9Bn3bBL5/AxaNqdJ5YQ= +github.com/smartcontractkit/chainlink-common v0.4.1-0.20241223143929-db7919d60550 h1:rRs74zjDJ7do5aYEXSU/sOnLnlbYCNqM8BrvEx/0NH8= +github.com/smartcontractkit/chainlink-common v0.4.1-0.20241223143929-db7919d60550/go.mod h1:yti7e1+G9hhkYhj+L5sVUULn9Bn3bBL5/AxaNqdJ5YQ= github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241202195413-82468150ac1e h1:PRoeby6ZlTuTkv2f+7tVU4+zboTfRzI+beECynF4JQ0= github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241202195413-82468150ac1e/go.mod h1:mUh5/woemsVaHgTorA080hrYmO3syBCmPdnWc/5dOqk= github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20241216163550-fa030d178ba3 h1:aeiBdBHGY8QNftps+VqrIk6OnfeeOD5z4jrAabW4ZSc= @@ -1429,8 +1439,8 @@ github.com/smartcontractkit/chainlink-protos/job-distributor v0.6.0 h1:0ewLMbAz3 github.com/smartcontractkit/chainlink-protos/job-distributor v0.6.0/go.mod h1:/dVVLXrsp+V0AbcYGJo3XMzKg3CkELsweA/TTopCsKE= github.com/smartcontractkit/chainlink-protos/orchestrator v0.4.0 h1:ZBat8EBvE2LpSQR9U1gEbRV6PfAkiFdINmQ8nVnXIAQ= github.com/smartcontractkit/chainlink-protos/orchestrator v0.4.0/go.mod h1:m/A3lqD7ms/RsQ9BT5P2uceYY0QX5mIt4KQxT2G6qEo= -github.com/smartcontractkit/chainlink-solana v1.1.1-0.20241219173444-150f7443fdd3 h1:AIIiwrZ5T4nEjFT33aLZKoXwD63JSMu72wWe/rUdfm0= -github.com/smartcontractkit/chainlink-solana v1.1.1-0.20241219173444-150f7443fdd3/go.mod h1:ARILnIgKelP0YkVzxXO111S9j0b4uKyt7iLpYjOkCtU= +github.com/smartcontractkit/chainlink-solana v1.1.1-0.20241223151630-eac4f1508dce h1:Mvpbr/Fi2IdU2EcmqCxhlCzs5ncnx+BwV80YweA4DZs= +github.com/smartcontractkit/chainlink-solana v1.1.1-0.20241223151630-eac4f1508dce/go.mod h1:qq+nW0JDnCCGMf2c38ZHjH8xgkAQnXKighjJr5JdDNE= github.com/smartcontractkit/chainlink-starknet/relayer v0.1.1-0.20241202202529-2033490e77b8 h1:tNS7U9lrxkFvEuyxQv11HHOiV9LPDGC9wYEy+yM/Jv4= github.com/smartcontractkit/chainlink-starknet/relayer v0.1.1-0.20241202202529-2033490e77b8/go.mod h1:EBrEgcdIbwepqguClkv8Ohy7CbyWSJaE4EC9aBJlQK0= github.com/smartcontractkit/chainlink-testing-framework/lib v1.50.13 h1:T0kbw07Vb6xUyA9MIJZfErMgWseWi1zf7cYvRpoq7ug= @@ -1443,8 +1453,8 @@ github.com/smartcontractkit/chainlink-testing-framework/wasp v1.50.2 h1:7bCdbTUW github.com/smartcontractkit/chainlink-testing-framework/wasp v1.50.2/go.mod h1:MltlNu3jcXm/DyLN98I5TFNtu/o1NNAcaPAFKMXWk70= github.com/smartcontractkit/grpc-proxy v0.0.0-20240830132753-a7e17fec5ab7 h1:12ijqMM9tvYVEm+nR826WsrNi6zCKpwBhuApq127wHs= github.com/smartcontractkit/grpc-proxy v0.0.0-20240830132753-a7e17fec5ab7/go.mod h1:FX7/bVdoep147QQhsOPkYsPEXhGZjeYx6lBSaSXtZOA= -github.com/smartcontractkit/libocr v0.0.0-20241007185508-adbe57025f12 h1:NzZGjaqez21I3DU7objl3xExTH4fxYvzTqar8DC6360= -github.com/smartcontractkit/libocr v0.0.0-20241007185508-adbe57025f12/go.mod h1:fb1ZDVXACvu4frX3APHZaEBp0xi1DIm34DcA0CwTsZM= +github.com/smartcontractkit/libocr v0.0.0-20241223215956-e5b78d8e3919 h1:IpGoPTXpvllN38kT2z2j13sifJMz4nbHglidvop7mfg= +github.com/smartcontractkit/libocr v0.0.0-20241223215956-e5b78d8e3919/go.mod h1:fb1ZDVXACvu4frX3APHZaEBp0xi1DIm34DcA0CwTsZM= github.com/smartcontractkit/tdh2/go/ocr2/decryptionplugin v0.0.0-20241009055228-33d0c0bf38de h1:n0w0rKF+SVM+S3WNlup6uabXj2zFlFNfrlsKCMMb/co= github.com/smartcontractkit/tdh2/go/ocr2/decryptionplugin v0.0.0-20241009055228-33d0c0bf38de/go.mod h1:Sl2MF/Fp3fgJIVzhdGhmZZX2BlnM0oUUyBP4s4xYb6o= github.com/smartcontractkit/tdh2/go/tdh2 v0.0.0-20241009055228-33d0c0bf38de h1:66VQxXx3lvTaAZrMBkIcdH9VEjujUEvmBQdnyOJnkOc= diff --git a/deployment/keystone/changeset/accept_ownership.go b/deployment/keystone/changeset/accept_ownership.go index 662a4c2dcfa..dd709523bc2 100644 --- a/deployment/keystone/changeset/accept_ownership.go +++ b/deployment/keystone/changeset/accept_ownership.go @@ -5,7 +5,7 @@ import ( "github.com/ethereum/go-ethereum/common" - kslib "github.com/smartcontractkit/chainlink/deployment/keystone" + kslib "github.com/smartcontractkit/chainlink/deployment/keystone/changeset/internal" "github.com/smartcontractkit/chainlink/deployment" "github.com/smartcontractkit/chainlink/deployment/common/changeset" diff --git a/deployment/keystone/changeset/accept_ownership_test.go b/deployment/keystone/changeset/accept_ownership_test.go index d949e63c7aa..4007fde4f79 100644 --- a/deployment/keystone/changeset/accept_ownership_test.go +++ b/deployment/keystone/changeset/accept_ownership_test.go @@ -35,7 +35,7 @@ func TestAcceptAllOwnership(t *testing.T) { }, { Changeset: commonchangeset.WrapChangeSet(changeset.DeployForwarder), - Config: registrySel, + Config: changeset.DeployForwarderRequest{}, }, { Changeset: commonchangeset.WrapChangeSet(changeset.DeployFeedsConsumer), diff --git a/deployment/keystone/changeset/addrbook_utils.go b/deployment/keystone/changeset/addrbook_utils.go index 3eb23011ef0..fa4dd27ca18 100644 --- a/deployment/keystone/changeset/addrbook_utils.go +++ b/deployment/keystone/changeset/addrbook_utils.go @@ -8,7 +8,8 @@ import ( ccipowner "github.com/smartcontractkit/ccip-owner-contracts/pkg/gethwrappers" "github.com/smartcontractkit/chainlink/deployment" - "github.com/smartcontractkit/chainlink/deployment/keystone" + + "github.com/smartcontractkit/chainlink/deployment/keystone/changeset/internal" capReg "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/keystone/generated/capabilities_registry_1_1_0" feeds_consumer "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/keystone/generated/feeds_consumer_1_0_0" keystoneForwarder "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/keystone/generated/forwarder_1_0_0" @@ -56,7 +57,7 @@ func capRegistriesFromAddrBook(addrBook deployment.AddressBook, chain deployment return getContractsFromAddrBook[capReg.CapabilitiesRegistry]( addrBook, chain, - keystone.CapabilitiesRegistry, + internal.CapabilitiesRegistry, capReg.NewCapabilitiesRegistry, ) } @@ -66,7 +67,7 @@ func ocr3FromAddrBook(addrBook deployment.AddressBook, chain deployment.Chain) ( return getContractsFromAddrBook[ocr3Capability.OCR3Capability]( addrBook, chain, - keystone.OCR3Capability, + internal.OCR3Capability, ocr3Capability.NewOCR3Capability, ) } @@ -76,7 +77,7 @@ func forwardersFromAddrBook(addrBook deployment.AddressBook, chain deployment.Ch return getContractsFromAddrBook[keystoneForwarder.KeystoneForwarder]( addrBook, chain, - keystone.KeystoneForwarder, + internal.KeystoneForwarder, keystoneForwarder.NewKeystoneForwarder, ) } @@ -86,7 +87,7 @@ func feedsConsumersFromAddrBook(addrBook deployment.AddressBook, chain deploymen return getContractsFromAddrBook[feeds_consumer.KeystoneFeedsConsumer]( addrBook, chain, - keystone.FeedConsumer, + internal.FeedConsumer, feeds_consumer.NewKeystoneFeedsConsumer, ) } @@ -96,7 +97,7 @@ func proposersFromAddrBook(addrBook deployment.AddressBook, chain deployment.Cha return getContractsFromAddrBook[ccipowner.ManyChainMultiSig]( addrBook, chain, - keystone.ProposerManyChainMultiSig, + internal.ProposerManyChainMultiSig, ccipowner.NewManyChainMultiSig, ) } @@ -106,7 +107,7 @@ func timelocksFromAddrBook(addrBook deployment.AddressBook, chain deployment.Cha return getContractsFromAddrBook[ccipowner.RBACTimelock]( addrBook, chain, - keystone.RBACTimelock, + internal.RBACTimelock, ccipowner.NewRBACTimelock, ) } diff --git a/deployment/keystone/changeset/append_node_capabilities.go b/deployment/keystone/changeset/append_node_capabilities.go index 688d4fd8d2f..d558cf39c95 100644 --- a/deployment/keystone/changeset/append_node_capabilities.go +++ b/deployment/keystone/changeset/append_node_capabilities.go @@ -8,7 +8,6 @@ import ( "github.com/smartcontractkit/ccip-owner-contracts/pkg/proposal/timelock" "github.com/smartcontractkit/chainlink/deployment" "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" - kslib "github.com/smartcontractkit/chainlink/deployment/keystone" "github.com/smartcontractkit/chainlink/deployment/keystone/changeset/internal" ) @@ -63,7 +62,7 @@ func (req *AppendNodeCapabilitiesRequest) convert(e deployment.Environment) (*in if !ok { return nil, fmt.Errorf("registry chain selector %d does not exist in environment", req.RegistryChainSel) } - resp, err := kslib.GetContractSets(e.Logger, &kslib.GetContractSetsRequest{ + resp, err := internal.GetContractSets(e.Logger, &internal.GetContractSetsRequest{ Chains: map[uint64]deployment.Chain{req.RegistryChainSel: registryChain}, AddressBook: e.ExistingAddresses, }) diff --git a/deployment/keystone/changeset/compatiblity.go b/deployment/keystone/changeset/compatiblity.go new file mode 100644 index 00000000000..7f80b6ab53d --- /dev/null +++ b/deployment/keystone/changeset/compatiblity.go @@ -0,0 +1,95 @@ +package changeset + +import "github.com/smartcontractkit/chainlink/deployment/keystone/changeset/internal" + +//TODO: KS-673 refactor internal package to reduce and remove the duplication + +// OracleConfig is the configuration for an oracle +type OracleConfig = internal.OracleConfig + +// OCR3OnchainConfig is the onchain configuration of an OCR2 contract +type OCR3OnchainConfig = internal.OCR2OracleConfig + +// NodeKeys is a set of public keys for a node +type NodeKeys = internal.NodeKeys + +// TopLevelConfigSource is the top level configuration source +type TopLevelConfigSource = internal.TopLevelConfigSource + +// GenerateOCR3Config generates an OCR3 config +var GenerateOCR3Config = internal.GenerateOCR3Config + +// FeedConsumer is a feed consumer contract type +var FeedConsumer = internal.FeedConsumer + +// KeystoneForwarder is a keystone forwarder contract type +var KeystoneForwarder = internal.KeystoneForwarder + +// GetContractSetsRequest is a request to get contract sets +type GetContractSetsRequest = internal.GetContractSetsRequest + +// GetContractSetsResponse is a response to get contract sets +type GetContractSetsResponse = internal.GetContractSetsResponse + +// GetContractSets gets contract sets +var GetContractSets = internal.GetContractSets + +// RegisterCapabilitiesRequest is a request to register capabilities +type RegisterCapabilitiesRequest = internal.RegisterCapabilitiesRequest + +// RegisterCapabilitiesResponse is a response to register capabilities +type RegisterCapabilitiesResponse = internal.RegisterCapabilitiesResponse + +// RegisterCapabilities registers capabilities +var RegisterCapabilities = internal.RegisterCapabilities + +// RegisterNOPSRequest is a request to register NOPS +type RegisterNOPSRequest = internal.RegisterNOPSRequest + +// RegisterNOPSResponse is a response to register NOPS +type RegisterNOPSResponse = internal.RegisterNOPSResponse + +// RegisterNOPS registers NOPS +var RegisterNOPS = internal.RegisterNOPS + +// RegisterNodesRequest is a request to register nodes with the capabilities registry +type RegisterNodesRequest = internal.RegisterNodesRequest + +// RegisterNodesResponse is a response to register nodes with the capabilities registry +type RegisterNodesResponse = internal.RegisterNodesResponse + +// RegisterNodes registers nodes with the capabilities registry +var RegisterNodes = internal.RegisterNodes + +// RegisteredCapability is a wrapper of a capability and its ID +type RegisteredCapability = internal.RegisteredCapability + +// FromCapabilitiesRegistryCapability converts a capabilities registry capability to a registered capability +var FromCapabilitiesRegistryCapability = internal.FromCapabilitiesRegistryCapability + +// RegisterDonsRequest is a request to register Dons with the capabilities registry +type RegisterDonsRequest = internal.RegisterDonsRequest + +// RegisterDonsResponse is a response to register Dons with the capabilities registry +type RegisterDonsResponse = internal.RegisterDonsResponse + +// RegisterDons registers Dons with the capabilities registry +var RegisterDons = internal.RegisterDons + +// DONToRegister is the minimal information needed to register a DON with the capabilities registry +type DONToRegister = internal.DONToRegister + +// ConfigureContractsRequest is a request to configure ALL the contracts +type ConfigureContractsRequest = internal.ConfigureContractsRequest + +// ConfigureContractsResponse is a response to configure ALL the contracts +type ConfigureContractsResponse = internal.ConfigureContractsResponse + +// DonCapabilities is a set of capabilities hosted by a set of node operators +// in is in a convenient form to handle the CLO representation of the nop data +type DonCapabilities = internal.DonCapabilities + +type DeployRequest = internal.DeployRequest +type DeployResponse = internal.DeployResponse + +type ContractSet = internal.ContractSet diff --git a/deployment/keystone/changeset/configure_contracts.go b/deployment/keystone/changeset/configure_contracts.go index 3a92782e12b..b57ebb0ed52 100644 --- a/deployment/keystone/changeset/configure_contracts.go +++ b/deployment/keystone/changeset/configure_contracts.go @@ -7,7 +7,7 @@ import ( "github.com/smartcontractkit/chainlink-common/pkg/logger" "github.com/smartcontractkit/chainlink/deployment" - kslib "github.com/smartcontractkit/chainlink/deployment/keystone" + kslib "github.com/smartcontractkit/chainlink/deployment/keystone/changeset/internal" ) var _ deployment.ChangeSet[InitialContractsCfg] = ConfigureInitialContractsChangeset diff --git a/deployment/keystone/changeset/deploy_consumer.go b/deployment/keystone/changeset/deploy_consumer.go index fc7992e2a7d..d94d7ac0adc 100644 --- a/deployment/keystone/changeset/deploy_consumer.go +++ b/deployment/keystone/changeset/deploy_consumer.go @@ -4,7 +4,7 @@ import ( "fmt" "github.com/smartcontractkit/chainlink/deployment" - kslib "github.com/smartcontractkit/chainlink/deployment/keystone" + kslib "github.com/smartcontractkit/chainlink/deployment/keystone/changeset/internal" ) type DeployFeedsConsumerRequest struct { diff --git a/deployment/keystone/changeset/deploy_forwarder.go b/deployment/keystone/changeset/deploy_forwarder.go index b4b242b72df..66923140e6a 100644 --- a/deployment/keystone/changeset/deploy_forwarder.go +++ b/deployment/keystone/changeset/deploy_forwarder.go @@ -2,26 +2,40 @@ package changeset import ( "fmt" + "maps" + "slices" "github.com/ethereum/go-ethereum/common" "github.com/smartcontractkit/ccip-owner-contracts/pkg/gethwrappers" "github.com/smartcontractkit/ccip-owner-contracts/pkg/proposal/timelock" "github.com/smartcontractkit/chainlink/deployment" "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" - kslib "github.com/smartcontractkit/chainlink/deployment/keystone" + "github.com/smartcontractkit/chainlink/deployment/keystone/changeset/internal" ) -var _ deployment.ChangeSet[uint64] = DeployForwarder +var _ deployment.ChangeSet[DeployForwarderRequest] = DeployForwarder + +type DeployForwarderRequest struct { + ChainSelectors []uint64 // filter to only deploy to these chains; if empty, deploy to all chains +} // DeployForwarder deploys the KeystoneForwarder contract to all chains in the environment // callers must merge the output addressbook with the existing one // TODO: add selectors to deploy only to specific chains -func DeployForwarder(env deployment.Environment, _ uint64) (deployment.ChangesetOutput, error) { +func DeployForwarder(env deployment.Environment, cfg DeployForwarderRequest) (deployment.ChangesetOutput, error) { lggr := env.Logger ab := deployment.NewMemoryAddressBook() - for _, chain := range env.Chains { + selectors := cfg.ChainSelectors + if len(selectors) == 0 { + selectors = slices.Collect(maps.Keys(env.Chains)) + } + for _, sel := range selectors { + chain, ok := env.Chains[sel] + if !ok { + return deployment.ChangesetOutput{}, fmt.Errorf("chain with selector %d not found", sel) + } lggr.Infow("deploying forwarder", "chainSelector", chain.Selector) - forwarderResp, err := kslib.DeployForwarder(chain, ab) + forwarderResp, err := internal.DeployForwarder(chain, ab) if err != nil { return deployment.ChangesetOutput{}, fmt.Errorf("failed to deploy KeystoneForwarder to chain selector %d: %w", chain.Selector, err) } @@ -55,7 +69,7 @@ func (r ConfigureForwardContractsRequest) UseMCMS() bool { } func ConfigureForwardContracts(env deployment.Environment, req ConfigureForwardContractsRequest) (deployment.ChangesetOutput, error) { - wfDon, err := kslib.NewRegisteredDon(env, kslib.RegisteredDonConfig{ + wfDon, err := internal.NewRegisteredDon(env, internal.RegisteredDonConfig{ NodeIDs: req.WFNodeIDs, Name: req.WFDonName, RegistryChainSel: req.RegistryChainSel, @@ -63,15 +77,15 @@ func ConfigureForwardContracts(env deployment.Environment, req ConfigureForwardC if err != nil { return deployment.ChangesetOutput{}, fmt.Errorf("failed to create registered don: %w", err) } - r, err := kslib.ConfigureForwardContracts(&env, kslib.ConfigureForwarderContractsRequest{ - Dons: []kslib.RegisteredDon{*wfDon}, + r, err := internal.ConfigureForwardContracts(&env, internal.ConfigureForwarderContractsRequest{ + Dons: []internal.RegisteredDon{*wfDon}, UseMCMS: req.UseMCMS(), }) if err != nil { return deployment.ChangesetOutput{}, fmt.Errorf("failed to configure forward contracts: %w", err) } - cresp, err := kslib.GetContractSets(env.Logger, &kslib.GetContractSetsRequest{ + cresp, err := internal.GetContractSets(env.Logger, &internal.GetContractSetsRequest{ Chains: env.Chains, AddressBook: env.ExistingAddresses, }) diff --git a/deployment/keystone/changeset/deploy_forwarder_test.go b/deployment/keystone/changeset/deploy_forwarder_test.go index f40b0f560c4..ec80a9432b0 100644 --- a/deployment/keystone/changeset/deploy_forwarder_test.go +++ b/deployment/keystone/changeset/deploy_forwarder_test.go @@ -34,7 +34,7 @@ func TestDeployForwarder(t *testing.T) { // deploy forwarder env.ExistingAddresses = ab - resp, err := changeset.DeployForwarder(env, registrySel) + resp, err := changeset.DeployForwarder(env, changeset.DeployForwarderRequest{}) require.NoError(t, err) require.NotNil(t, resp) // registry, ocr3, forwarder should be deployed on registry chain diff --git a/deployment/keystone/changeset/deploy_ocr3.go b/deployment/keystone/changeset/deploy_ocr3.go index 057bba4c12d..4e85590e521 100644 --- a/deployment/keystone/changeset/deploy_ocr3.go +++ b/deployment/keystone/changeset/deploy_ocr3.go @@ -11,7 +11,7 @@ import ( "github.com/smartcontractkit/chainlink/deployment" "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" - kslib "github.com/smartcontractkit/chainlink/deployment/keystone" + kslib "github.com/smartcontractkit/chainlink/deployment/keystone/changeset/internal" ) var _ deployment.ChangeSet[uint64] = DeployOCR3 diff --git a/deployment/keystone/changeset/deploy_ocr3_test.go b/deployment/keystone/changeset/deploy_ocr3_test.go index 1aa8f0a0caa..c12f6878835 100644 --- a/deployment/keystone/changeset/deploy_ocr3_test.go +++ b/deployment/keystone/changeset/deploy_ocr3_test.go @@ -15,8 +15,8 @@ import ( commonchangeset "github.com/smartcontractkit/chainlink/deployment/common/changeset" "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" "github.com/smartcontractkit/chainlink/deployment/environment/memory" - kslib "github.com/smartcontractkit/chainlink/deployment/keystone" "github.com/smartcontractkit/chainlink/deployment/keystone/changeset" + "github.com/smartcontractkit/chainlink/deployment/keystone/changeset/internal" "github.com/smartcontractkit/chainlink/deployment/keystone/changeset/test" ) @@ -48,7 +48,7 @@ func TestDeployOCR3(t *testing.T) { func TestConfigureOCR3(t *testing.T) { t.Parallel() - c := kslib.OracleConfig{ + c := internal.OracleConfig{ MaxFaultyOracles: 1, DeltaProgressMillis: 12345, } @@ -77,7 +77,7 @@ func TestConfigureOCR3(t *testing.T) { csOut, err := changeset.ConfigureOCR3Contract(te.Env, cfg) require.NoError(t, err) - var got kslib.OCR2OracleConfig + var got internal.OCR2OracleConfig err = json.Unmarshal(w.Bytes(), &got) require.NoError(t, err) assert.Len(t, got.Signers, 4) @@ -110,7 +110,7 @@ func TestConfigureOCR3(t *testing.T) { csOut, err := changeset.ConfigureOCR3Contract(te.Env, cfg) require.NoError(t, err) - var got kslib.OCR2OracleConfig + var got internal.OCR2OracleConfig err = json.Unmarshal(w.Bytes(), &got) require.NoError(t, err) assert.Len(t, got.Signers, 4) diff --git a/deployment/keystone/changeset/deploy_registry.go b/deployment/keystone/changeset/deploy_registry.go index d07e2728282..2b8342c06dd 100644 --- a/deployment/keystone/changeset/deploy_registry.go +++ b/deployment/keystone/changeset/deploy_registry.go @@ -4,7 +4,7 @@ import ( "fmt" "github.com/smartcontractkit/chainlink/deployment" - kslib "github.com/smartcontractkit/chainlink/deployment/keystone" + kslib "github.com/smartcontractkit/chainlink/deployment/keystone/changeset/internal" ) var _ deployment.ChangeSet[uint64] = DeployCapabilityRegistry diff --git a/deployment/keystone/changeset/internal/append_node_capabilities.go b/deployment/keystone/changeset/internal/append_node_capabilities.go index 652dff4693a..32fe8572da3 100644 --- a/deployment/keystone/changeset/internal/append_node_capabilities.go +++ b/deployment/keystone/changeset/internal/append_node_capabilities.go @@ -5,14 +5,14 @@ import ( "github.com/smartcontractkit/chainlink-common/pkg/logger" "github.com/smartcontractkit/chainlink/deployment" - kslib "github.com/smartcontractkit/chainlink/deployment/keystone" + kcr "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/keystone/generated/capabilities_registry_1_1_0" "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/p2pkey" ) type AppendNodeCapabilitiesRequest struct { Chain deployment.Chain - ContractSet *kslib.ContractSet + ContractSet *ContractSet P2pToCapabilities map[p2pkey.PeerID][]kcr.CapabilitiesRegistryCapability UseMCMS bool @@ -48,7 +48,7 @@ func AppendNodeCapabilitiesImpl(lggr logger.Logger, req *AppendNodeCapabilitiesR for _, cap := range req.P2pToCapabilities { capabilities = append(capabilities, cap...) } - op, err := kslib.AddCapabilities(lggr, req.ContractSet, req.Chain, capabilities, req.UseMCMS) + op, err := AddCapabilities(lggr, req.ContractSet, req.Chain, capabilities, req.UseMCMS) if err != nil { return nil, fmt.Errorf("failed to add capabilities: %w", err) } diff --git a/deployment/keystone/capability_definitions.go b/deployment/keystone/changeset/internal/capability_definitions.go similarity index 98% rename from deployment/keystone/capability_definitions.go rename to deployment/keystone/changeset/internal/capability_definitions.go index 2a234e18f52..21c2b4fce01 100644 --- a/deployment/keystone/capability_definitions.go +++ b/deployment/keystone/changeset/internal/capability_definitions.go @@ -1,4 +1,4 @@ -package keystone +package internal import kcr "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/keystone/generated/capabilities_registry_1_1_0" diff --git a/deployment/keystone/capability_management.go b/deployment/keystone/changeset/internal/capability_management.go similarity index 97% rename from deployment/keystone/capability_management.go rename to deployment/keystone/changeset/internal/capability_management.go index a643112457f..268b4fd0d01 100644 --- a/deployment/keystone/capability_management.go +++ b/deployment/keystone/changeset/internal/capability_management.go @@ -1,4 +1,4 @@ -package keystone +package internal import ( "fmt" @@ -27,7 +27,7 @@ func AddCapabilities(lggr logger.Logger, contractSet *ContractSet, chain deploym } tx, err := registry.AddCapabilities(txOpts, deduped) if err != nil { - err = DecodeErr(kcr.CapabilitiesRegistryABI, err) + err = deployment.DecodeErr(kcr.CapabilitiesRegistryABI, err) return nil, fmt.Errorf("failed to add capabilities: %w", err) } var batch *timelock.BatchChainOperation diff --git a/deployment/keystone/capability_registry_deployer.go b/deployment/keystone/changeset/internal/capability_registry_deployer.go similarity index 99% rename from deployment/keystone/capability_registry_deployer.go rename to deployment/keystone/changeset/internal/capability_registry_deployer.go index 217250cd606..492ba168c9d 100644 --- a/deployment/keystone/capability_registry_deployer.go +++ b/deployment/keystone/changeset/internal/capability_registry_deployer.go @@ -1,4 +1,4 @@ -package keystone +package internal import ( "context" diff --git a/deployment/keystone/consumer_deployer.go b/deployment/keystone/changeset/internal/consumer_deployer.go similarity index 98% rename from deployment/keystone/consumer_deployer.go rename to deployment/keystone/changeset/internal/consumer_deployer.go index 4886039e791..3c2de539ccb 100644 --- a/deployment/keystone/consumer_deployer.go +++ b/deployment/keystone/changeset/internal/consumer_deployer.go @@ -1,4 +1,4 @@ -package keystone +package internal import ( "fmt" diff --git a/deployment/keystone/contract_set.go b/deployment/keystone/changeset/internal/contract_set.go similarity index 86% rename from deployment/keystone/contract_set.go rename to deployment/keystone/changeset/internal/contract_set.go index 51b5c823600..e60f37d6f76 100644 --- a/deployment/keystone/contract_set.go +++ b/deployment/keystone/changeset/internal/contract_set.go @@ -1,4 +1,4 @@ -package keystone +package internal import ( "fmt" @@ -58,21 +58,6 @@ func DeployCapabilitiesRegistry(chain deployment.Chain, ab deployment.AddressBoo return capabilitiesRegistryResp, nil } -// DeployWorkflowRegistry deploys the WorkflowRegistry contract to the chain -// and saves the address in the address book. This mutates the address book. -func DeployWorkflowRegistry(chain deployment.Chain, ab deployment.AddressBook) (*DeployResponse, error) { - deployer, err := NewWorkflowRegistryDeployer() - resp, err := deployer.Deploy(DeployRequest{Chain: chain}) - if err != nil { - return nil, fmt.Errorf("failed to deploy WorkflowRegistry: %w", err) - } - err = ab.Save(chain.Selector, resp.Address.String(), resp.Tv) - if err != nil { - return nil, fmt.Errorf("failed to save WorkflowRegistry: %w", err) - } - return resp, nil -} - // DeployOCR3 deploys the OCR3Capability contract to the chain // and saves the address in the address book. This mutates the address book. func DeployOCR3(chain deployment.Chain, ab deployment.AddressBook) (*DeployResponse, error) { diff --git a/deployment/keystone/deploy.go b/deployment/keystone/changeset/internal/deploy.go similarity index 97% rename from deployment/keystone/deploy.go rename to deployment/keystone/changeset/internal/deploy.go index 58fbf07963c..5afcae11e93 100644 --- a/deployment/keystone/deploy.go +++ b/deployment/keystone/changeset/internal/deploy.go @@ -1,4 +1,4 @@ -package keystone +package internal import ( "bytes" @@ -540,7 +540,7 @@ func RegisterNOPS(ctx context.Context, lggr logger.Logger, req RegisterNOPSReque } tx, err := registry.AddNodeOperators(registryChain.DeployerKey, nops) if err != nil { - err = DecodeErr(capabilities_registry.CapabilitiesRegistryABI, err) + err = deployment.DecodeErr(capabilities_registry.CapabilitiesRegistryABI, err) return nil, fmt.Errorf("failed to call AddNodeOperators: %w", err) } // for some reason that i don't understand, the confirm must be called before the WaitMined or the latter will hang @@ -603,12 +603,6 @@ func DefaultCapConfig(capType uint8, nNodes int) *capabilitiespb.CapabilityConfi } } -// DEPRECATED: use deployment.DecodeErr instead -// todo: refactor all keystone deps to use deployment.DecodeErr -func DecodeErr(encodedABI string, err error) error { - return deployment.DecodeErr(encodedABI, err) -} - // register nodes type RegisterNodesRequest struct { Env *deployment.Environment @@ -624,7 +618,6 @@ type RegisterNodesResponse struct { // registerNodes registers the nodes with the registry. it assumes that the deployer key in the Chain // can sign the transactions update the contract state -// TODO: 467 refactor to support MCMS. Specifically need to separate the call data generation from the actual contract call func RegisterNodes(lggr logger.Logger, req *RegisterNodesRequest) (*RegisterNodesResponse, error) { registry, registryChain, err := GetRegistryContract(req.Env, req.RegistryChainSelector) if err != nil { @@ -727,7 +720,7 @@ func RegisterNodes(lggr logger.Logger, req *RegisterNodesRequest) (*RegisterNode lggr.Debugw("unique node params to add", "count", len(uniqueNodeParams), "params", uniqueNodeParams) tx, err := registry.AddNodes(registryChain.DeployerKey, uniqueNodeParams) if err != nil { - err = DecodeErr(capabilities_registry.CapabilitiesRegistryABI, err) + err = deployment.DecodeErr(capabilities_registry.CapabilitiesRegistryABI, err) // no typed errors in the abi, so we have to do string matching // try to add all nodes in one go, if that fails, fall back to 1-by-1 if !strings.Contains(err.Error(), "NodeAlreadyExists") { @@ -737,7 +730,7 @@ func RegisterNodes(lggr logger.Logger, req *RegisterNodesRequest) (*RegisterNode for _, singleNodeParams := range uniqueNodeParams { tx, err = registry.AddNodes(registryChain.DeployerKey, []capabilities_registry.CapabilitiesRegistryNodeParams{singleNodeParams}) if err != nil { - err = DecodeErr(capabilities_registry.CapabilitiesRegistryABI, err) + err = deployment.DecodeErr(capabilities_registry.CapabilitiesRegistryABI, err) if strings.Contains(err.Error(), "NodeAlreadyExists") { lggr.Warnw("node already exists, skipping", "p2pid", hex.EncodeToString(singleNodeParams.P2pId[:])) continue @@ -806,7 +799,7 @@ func RegisterDons(lggr logger.Logger, req RegisterDonsRequest) (*RegisterDonsRes donInfos, err := registry.GetDONs(&bind.CallOpts{}) if err != nil { - err = DecodeErr(capabilities_registry.CapabilitiesRegistryABI, err) + err = deployment.DecodeErr(capabilities_registry.CapabilitiesRegistryABI, err) return nil, fmt.Errorf("failed to call GetDONs: %w", err) } existingDONs := make(map[string]struct{}) @@ -860,7 +853,7 @@ func RegisterDons(lggr logger.Logger, req RegisterDonsRequest) (*RegisterDonsRes tx, err := registry.AddDON(registryChain.DeployerKey, p2pIds, cfgs, true, wfSupported, don.F) if err != nil { - err = DecodeErr(capabilities_registry.CapabilitiesRegistryABI, err) + err = deployment.DecodeErr(capabilities_registry.CapabilitiesRegistryABI, err) return nil, fmt.Errorf("failed to call AddDON for don '%s' p2p2Id hash %s capability %v: %w", don.Name, p2pSortedHash, cfgs, err) } _, err = registryChain.Confirm(tx) @@ -887,7 +880,7 @@ func RegisterDons(lggr logger.Logger, req RegisterDonsRequest) (*RegisterDonsRes } } if err != nil { - err = DecodeErr(capabilities_registry.CapabilitiesRegistryABI, err) + err = deployment.DecodeErr(capabilities_registry.CapabilitiesRegistryABI, err) return nil, fmt.Errorf("failed to call GetDONs: %w", err) } if !foundAll { @@ -943,13 +936,13 @@ func configureForwarder(lggr logger.Logger, chain deployment.Chain, contractSet } tx, err := fwdr.SetConfig(txOpts, dn.Info.Id, ver, dn.Info.F, signers) if err != nil { - err = DecodeErr(kf.KeystoneForwarderABI, err) + err = deployment.DecodeErr(kf.KeystoneForwarderABI, err) return nil, fmt.Errorf("failed to call SetConfig for forwarder %s on chain %d: %w", fwdr.Address().String(), chain.Selector, err) } if !useMCMS { _, err = chain.Confirm(tx) if err != nil { - err = DecodeErr(kf.KeystoneForwarderABI, err) + err = deployment.DecodeErr(kf.KeystoneForwarderABI, err) return nil, fmt.Errorf("failed to confirm SetConfig for forwarder %s: %w", fwdr.Address().String(), err) } } else { diff --git a/deployment/keystone/forwarder_deployer.go b/deployment/keystone/changeset/internal/forwarder_deployer.go similarity index 99% rename from deployment/keystone/forwarder_deployer.go rename to deployment/keystone/changeset/internal/forwarder_deployer.go index 33ff61eb834..2ce3ae88146 100644 --- a/deployment/keystone/forwarder_deployer.go +++ b/deployment/keystone/changeset/internal/forwarder_deployer.go @@ -1,4 +1,4 @@ -package keystone +package internal import ( "fmt" diff --git a/deployment/keystone/ocr3_deployer.go b/deployment/keystone/changeset/internal/ocr3_deployer.go similarity index 98% rename from deployment/keystone/ocr3_deployer.go rename to deployment/keystone/changeset/internal/ocr3_deployer.go index fae05cbfbcd..beafe9bb9e2 100644 --- a/deployment/keystone/ocr3_deployer.go +++ b/deployment/keystone/changeset/internal/ocr3_deployer.go @@ -1,4 +1,4 @@ -package keystone +package internal import ( "fmt" diff --git a/deployment/keystone/ocr3config.go b/deployment/keystone/changeset/internal/ocr3config.go similarity index 98% rename from deployment/keystone/ocr3config.go rename to deployment/keystone/changeset/internal/ocr3config.go index b23eaf8c462..74f8a9dabd5 100644 --- a/deployment/keystone/ocr3config.go +++ b/deployment/keystone/changeset/internal/ocr3config.go @@ -1,6 +1,6 @@ // TODO: KS-458 copied from https://github.com/smartcontractkit/chainlink/blob/65924811dc53a211613927c814d7f04fd85439a4/core/scripts/keystone/src/88_gen_ocr3_config.go#L1 // to unblock go mod issues when trying to import the scripts package -package keystone +package internal import ( "crypto/ed25519" @@ -327,15 +327,15 @@ func configureOCR3contract(req configureOCR3Request) (*configureOCR3Response, er ocrConfig.OffchainConfig, ) if err != nil { - err = DecodeErr(kocr3.OCR3CapabilityABI, err) - return nil, fmt.Errorf("failed to call SetConfig for OCR3 contract %s using mcms: %t: %w", req.contract.Address().String(), req.useMCMS, err) + err = deployment.DecodeErr(kocr3.OCR3CapabilityABI, err) + return nil, fmt.Errorf("failed to call SetConfig for OCR3 contract %s using mcms: %T: %w", req.contract.Address().String(), req.useMCMS, err) } var ops *timelock.BatchChainOperation if !req.useMCMS { _, err = req.chain.Confirm(tx) if err != nil { - err = DecodeErr(kocr3.OCR3CapabilityABI, err) + err = deployment.DecodeErr(kocr3.OCR3CapabilityABI, err) return nil, fmt.Errorf("failed to confirm SetConfig for OCR3 contract %s: %w", req.contract.Address().String(), err) } } else { diff --git a/deployment/keystone/ocr3config_test.go b/deployment/keystone/changeset/internal/ocr3config_test.go similarity index 99% rename from deployment/keystone/ocr3config_test.go rename to deployment/keystone/changeset/internal/ocr3config_test.go index 55fa16af68c..b412a727eb9 100644 --- a/deployment/keystone/ocr3config_test.go +++ b/deployment/keystone/changeset/internal/ocr3config_test.go @@ -1,6 +1,6 @@ // TODO: KS-458 copied from https://github.com/smartcontractkit/chainlink/blob/65924811dc53a211613927c814d7f04fd85439a4/core/scripts/keystone/src/88_gen_ocr3_config.go#L1 // to unblock go mod issues when trying to import the scripts package -package keystone +package internal import ( "encoding/json" diff --git a/deployment/keystone/state.go b/deployment/keystone/changeset/internal/state.go similarity index 99% rename from deployment/keystone/state.go rename to deployment/keystone/changeset/internal/state.go index 85259bdc342..d0817069d9a 100644 --- a/deployment/keystone/state.go +++ b/deployment/keystone/changeset/internal/state.go @@ -1,4 +1,4 @@ -package keystone +package internal import ( "fmt" diff --git a/deployment/keystone/changeset/internal/test/utils.go b/deployment/keystone/changeset/internal/test/utils.go index a0cad0039e8..cc7e3b27160 100644 --- a/deployment/keystone/changeset/internal/test/utils.go +++ b/deployment/keystone/changeset/internal/test/utils.go @@ -17,45 +17,11 @@ import ( "github.com/smartcontractkit/chainlink/deployment" "github.com/smartcontractkit/chainlink/deployment/environment/memory" - kslib "github.com/smartcontractkit/chainlink/deployment/keystone" "github.com/smartcontractkit/chainlink/deployment/keystone/changeset/internal" - "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/keystone/generated/capabilities_registry_1_1_0" - kcr "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/keystone/generated/capabilities_registry_1_1_0" - workflow_registry "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/workflow/generated/workflow_registry_wrapper" + capabilities_registry "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/keystone/generated/capabilities_registry_1_1_0" "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/p2pkey" ) -type SetupTestWorkflowRegistryResponse struct { - Registry *workflow_registry.WorkflowRegistry - Chain deployment.Chain - RegistrySelector uint64 - AddressBook deployment.AddressBook -} - -func SetupTestWorkflowRegistry(t *testing.T, lggr logger.Logger, chainSel uint64) *SetupTestWorkflowRegistryResponse { - chain := testChain(t) - - deployer, err := kslib.NewWorkflowRegistryDeployer() - require.NoError(t, err) - resp, err := deployer.Deploy(kslib.DeployRequest{Chain: chain}) - require.NoError(t, err) - - addressBook := deployment.NewMemoryAddressBookFromMap( - map[uint64]map[string]deployment.TypeAndVersion{ - chainSel: map[string]deployment.TypeAndVersion{ - resp.Address.Hex(): resp.Tv, - }, - }, - ) - - return &SetupTestWorkflowRegistryResponse{ - Registry: deployer.Contract(), - Chain: chain, - RegistrySelector: chain.Selector, - AddressBook: addressBook, - } -} - type Don struct { Name string P2PIDs []p2pkey.PeerID @@ -63,17 +29,17 @@ type Don struct { } type SetupTestRegistryRequest struct { - P2pToCapabilities map[p2pkey.PeerID][]kcr.CapabilitiesRegistryCapability - NopToNodes map[kcr.CapabilitiesRegistryNodeOperator][]*internal.P2PSignerEnc + P2pToCapabilities map[p2pkey.PeerID][]capabilities_registry.CapabilitiesRegistryCapability + NopToNodes map[capabilities_registry.CapabilitiesRegistryNodeOperator][]*internal.P2PSignerEnc Dons []Don // TODO maybe add support for MCMS at this level } type SetupTestRegistryResponse struct { - Registry *kcr.CapabilitiesRegistry + Registry *capabilities_registry.CapabilitiesRegistry Chain deployment.Chain RegistrySelector uint64 - ContractSet *kslib.ContractSet + ContractSet *internal.ContractSet } func SetupTestRegistry(t *testing.T, lggr logger.Logger, req *SetupTestRegistryRequest) *SetupTestRegistryResponse { @@ -81,7 +47,7 @@ func SetupTestRegistry(t *testing.T, lggr logger.Logger, req *SetupTestRegistryR // deploy the registry registry := deployCapReg(t, chain) // convert req to nodeoperators - nops := make([]kcr.CapabilitiesRegistryNodeOperator, 0) + nops := make([]capabilities_registry.CapabilitiesRegistryNodeOperator, 0) for nop := range req.NopToNodes { nops = append(nops, nop) } @@ -93,19 +59,19 @@ func SetupTestRegistry(t *testing.T, lggr logger.Logger, req *SetupTestRegistryR // add capabilities to registry capCache := NewCapabiltyCache(t) - var capabilities []kcr.CapabilitiesRegistryCapability + var capabilities []capabilities_registry.CapabilitiesRegistryCapability for _, caps := range req.P2pToCapabilities { capabilities = append(capabilities, caps...) } registeredCapabilities := capCache.AddCapabilities(lggr, chain, registry, capabilities) - expectedDeduped := make(map[kcr.CapabilitiesRegistryCapability]struct{}) + expectedDeduped := make(map[capabilities_registry.CapabilitiesRegistryCapability]struct{}) for _, cap := range capabilities { expectedDeduped[cap] = struct{}{} } require.Len(t, registeredCapabilities, len(expectedDeduped)) // make the nodes and register node - var nodeParams []kcr.CapabilitiesRegistryNodeParams + var nodeParams []capabilities_registry.CapabilitiesRegistryNodeParams initialp2pToCapabilities := make(map[p2pkey.PeerID][][32]byte) for p2pID := range req.P2pToCapabilities { initialp2pToCapabilities[p2pID] = mustCapabilityIds(t, registry, registeredCapabilities) @@ -116,7 +82,7 @@ func SetupTestRegistry(t *testing.T, lggr logger.Logger, req *SetupTestRegistryR require.Fail(t, "missing nopToNodes for %s", nop.Name) } for _, p2pSignerEnc := range req.NopToNodes[nop] { - nodeParams = append(nodeParams, kcr.CapabilitiesRegistryNodeParams{ + nodeParams = append(nodeParams, capabilities_registry.CapabilitiesRegistryNodeParams{ Signer: p2pSignerEnc.Signer, P2pId: p2pSignerEnc.P2PKey, EncryptionPublicKey: p2pSignerEnc.EncryptionPublicKey, @@ -134,21 +100,21 @@ func SetupTestRegistry(t *testing.T, lggr logger.Logger, req *SetupTestRegistryR Registry: registry, Chain: chain, RegistrySelector: chain.Selector, - ContractSet: &kslib.ContractSet{ + ContractSet: &internal.ContractSet{ CapabilitiesRegistry: registry, }, } } -func deployCapReg(t *testing.T, chain deployment.Chain) *kcr.CapabilitiesRegistry { - capabilitiesRegistryDeployer, err := kslib.NewCapabilitiesRegistryDeployer() +func deployCapReg(t *testing.T, chain deployment.Chain) *capabilities_registry.CapabilitiesRegistry { + capabilitiesRegistryDeployer, err := internal.NewCapabilitiesRegistryDeployer() require.NoError(t, err) - _, err = capabilitiesRegistryDeployer.Deploy(kslib.DeployRequest{Chain: chain}) + _, err = capabilitiesRegistryDeployer.Deploy(internal.DeployRequest{Chain: chain}) require.NoError(t, err) return capabilitiesRegistryDeployer.Contract() } -func addNops(t *testing.T, lggr logger.Logger, chain deployment.Chain, registry *kcr.CapabilitiesRegistry, nops []kcr.CapabilitiesRegistryNodeOperator) *kslib.RegisterNOPSResponse { +func addNops(t *testing.T, lggr logger.Logger, chain deployment.Chain, registry *capabilities_registry.CapabilitiesRegistry, nops []capabilities_registry.CapabilitiesRegistryNodeOperator) *internal.RegisterNOPSResponse { env := &deployment.Environment{ Logger: lggr, Chains: map[uint64]deployment.Chain{ @@ -157,13 +123,13 @@ func addNops(t *testing.T, lggr logger.Logger, chain deployment.Chain, registry ExistingAddresses: deployment.NewMemoryAddressBookFromMap(map[uint64]map[string]deployment.TypeAndVersion{ chain.Selector: { registry.Address().String(): deployment.TypeAndVersion{ - Type: kslib.CapabilitiesRegistry, + Type: internal.CapabilitiesRegistry, Version: deployment.Version1_0_0, }, }, }), } - resp, err := kslib.RegisterNOPS(context.TODO(), lggr, kslib.RegisterNOPSRequest{ + resp, err := internal.RegisterNOPS(context.TODO(), lggr, internal.RegisterNOPSRequest{ Env: env, RegistryChainSelector: chain.Selector, Nops: nops, @@ -172,23 +138,23 @@ func addNops(t *testing.T, lggr logger.Logger, chain deployment.Chain, registry return resp } -func addNodes(t *testing.T, lggr logger.Logger, chain deployment.Chain, registry *kcr.CapabilitiesRegistry, nodes []kcr.CapabilitiesRegistryNodeParams) { +func addNodes(t *testing.T, lggr logger.Logger, chain deployment.Chain, registry *capabilities_registry.CapabilitiesRegistry, nodes []capabilities_registry.CapabilitiesRegistryNodeParams) { tx, err := registry.AddNodes(chain.DeployerKey, nodes) if err != nil { - err2 := kslib.DecodeErr(kcr.CapabilitiesRegistryABI, err) + err2 := deployment.DecodeErr(capabilities_registry.CapabilitiesRegistryABI, err) require.Fail(t, fmt.Sprintf("failed to call AddNodes: %s: %s", err, err2)) } _, err = chain.Confirm(tx) require.NoError(t, err) } -func addDons(t *testing.T, lggr logger.Logger, chain deployment.Chain, registry *kcr.CapabilitiesRegistry, capCache *CapabilityCache, dons []Don) { +func addDons(t *testing.T, lggr logger.Logger, chain deployment.Chain, registry *capabilities_registry.CapabilitiesRegistry, capCache *CapabilityCache, dons []Don) { for _, don := range dons { acceptsWorkflows := false // lookup the capabilities - var capConfigs []kcr.CapabilitiesRegistryCapabilityConfiguration + var capConfigs []capabilities_registry.CapabilitiesRegistryCapabilityConfiguration for _, ccfg := range don.CapabilityConfigs { - var cc = kcr.CapabilitiesRegistryCapabilityConfiguration{ + var cc = capabilities_registry.CapabilitiesRegistryCapabilityConfiguration{ CapabilityId: [32]byte{}, Config: ccfg.Config, } @@ -208,7 +174,7 @@ func addDons(t *testing.T, lggr logger.Logger, chain deployment.Chain, registry f := len(don.P2PIDs)/3 + 1 tx, err := registry.AddDON(chain.DeployerKey, internal.PeerIDsToBytes(don.P2PIDs), capConfigs, isPublic, acceptsWorkflows, uint8(f)) if err != nil { - err2 := kslib.DecodeErr(kcr.CapabilitiesRegistryABI, err) + err2 := deployment.DecodeErr(capabilities_registry.CapabilitiesRegistryABI, err) require.Fail(t, fmt.Sprintf("failed to call AddDON: %s: %s", err, err2)) } _, err = chain.Confirm(tx) @@ -216,7 +182,7 @@ func addDons(t *testing.T, lggr logger.Logger, chain deployment.Chain, registry } } -func defaultCapConfig(t *testing.T, cap kcr.CapabilitiesRegistryCapability) []byte { +func defaultCapConfig(t *testing.T, cap capabilities_registry.CapabilitiesRegistryCapability) []byte { empty := &capabilitiespb.CapabilityConfig{ DefaultConfig: values.Proto(values.EmptyMap()).GetMapValue(), } @@ -237,24 +203,24 @@ func NewCapabiltyCache(t *testing.T) *CapabilityCache { nameToId: make(map[string][32]byte), } } -func (cc *CapabilityCache) Get(cap kcr.CapabilitiesRegistryCapability) ([32]byte, bool) { - id, exists := cc.nameToId[kslib.CapabilityID(cap)] +func (cc *CapabilityCache) Get(cap capabilities_registry.CapabilitiesRegistryCapability) ([32]byte, bool) { + id, exists := cc.nameToId[internal.CapabilityID(cap)] return id, exists } // AddCapabilities adds the capabilities to the registry and returns the registered capabilities // if the capability is already registered, it will not be re-registered // if duplicate capabilities are passed, they will be deduped -func (cc *CapabilityCache) AddCapabilities(lggr logger.Logger, chain deployment.Chain, registry *kcr.CapabilitiesRegistry, capabilities []kcr.CapabilitiesRegistryCapability) []kslib.RegisteredCapability { +func (cc *CapabilityCache) AddCapabilities(lggr logger.Logger, chain deployment.Chain, registry *capabilities_registry.CapabilitiesRegistry, capabilities []capabilities_registry.CapabilitiesRegistryCapability) []internal.RegisteredCapability { t := cc.t - var out []kslib.RegisteredCapability + var out []internal.RegisteredCapability // get the registered capabilities & dedup - seen := make(map[kcr.CapabilitiesRegistryCapability]struct{}) - var toRegister []kcr.CapabilitiesRegistryCapability + seen := make(map[capabilities_registry.CapabilitiesRegistryCapability]struct{}) + var toRegister []capabilities_registry.CapabilitiesRegistryCapability for _, cap := range capabilities { - id, cached := cc.nameToId[kslib.CapabilityID(cap)] + id, cached := cc.nameToId[internal.CapabilityID(cap)] if cached { - out = append(out, kslib.RegisteredCapability{ + out = append(out, internal.RegisteredCapability{ CapabilitiesRegistryCapability: cap, ID: id, }) @@ -271,7 +237,7 @@ func (cc *CapabilityCache) AddCapabilities(lggr logger.Logger, chain deployment. } tx, err := registry.AddCapabilities(chain.DeployerKey, toRegister) if err != nil { - err2 := kslib.DecodeErr(kcr.CapabilitiesRegistryABI, err) + err2 := deployment.DecodeErr(capabilities_registry.CapabilitiesRegistryABI, err) require.Fail(t, fmt.Sprintf("failed to call AddCapabilities: %s: %s", err, err2)) } _, err = chain.Confirm(tx) @@ -282,12 +248,12 @@ func (cc *CapabilityCache) AddCapabilities(lggr logger.Logger, chain deployment. capb := capb id, err := registry.GetHashedCapabilityId(&bind.CallOpts{}, capb.LabelledName, capb.Version) require.NoError(t, err) - out = append(out, kslib.RegisteredCapability{ + out = append(out, internal.RegisteredCapability{ CapabilitiesRegistryCapability: capb, ID: id, }) // cache the id - cc.nameToId[kslib.CapabilityID(capb)] = id + cc.nameToId[internal.CapabilityID(capb)] = id } return out } @@ -303,7 +269,7 @@ func testChain(t *testing.T) deployment.Chain { return chain } -func capabilityIds(registry *capabilities_registry.CapabilitiesRegistry, rcs []kslib.RegisteredCapability) ([][32]byte, error) { +func capabilityIds(registry *capabilities_registry.CapabilitiesRegistry, rcs []internal.RegisteredCapability) ([][32]byte, error) { out := make([][32]byte, len(rcs)) for i := range rcs { id, err := registry.GetHashedCapabilityId(&bind.CallOpts{}, rcs[i].LabelledName, rcs[i].Version) @@ -315,7 +281,7 @@ func capabilityIds(registry *capabilities_registry.CapabilitiesRegistry, rcs []k return out, nil } -func mustCapabilityIds(t *testing.T, registry *capabilities_registry.CapabilitiesRegistry, rcs []kslib.RegisteredCapability) [][32]byte { +func mustCapabilityIds(t *testing.T, registry *capabilities_registry.CapabilitiesRegistry, rcs []internal.RegisteredCapability) [][32]byte { t.Helper() out, err := capabilityIds(registry, rcs) require.NoError(t, err) diff --git a/deployment/keystone/testdata/testnet_wf_view.json b/deployment/keystone/changeset/internal/testdata/testnet_wf_view.json similarity index 100% rename from deployment/keystone/testdata/testnet_wf_view.json rename to deployment/keystone/changeset/internal/testdata/testnet_wf_view.json diff --git a/deployment/keystone/types.go b/deployment/keystone/changeset/internal/types.go similarity index 99% rename from deployment/keystone/types.go rename to deployment/keystone/changeset/internal/types.go index e12cf935d3d..173e3ba1ad0 100644 --- a/deployment/keystone/types.go +++ b/deployment/keystone/changeset/internal/types.go @@ -1,4 +1,4 @@ -package keystone +package internal import ( "errors" diff --git a/deployment/keystone/types_test.go b/deployment/keystone/changeset/internal/types_test.go similarity index 99% rename from deployment/keystone/types_test.go rename to deployment/keystone/changeset/internal/types_test.go index ea122837aa6..cfc953d6126 100644 --- a/deployment/keystone/types_test.go +++ b/deployment/keystone/changeset/internal/types_test.go @@ -1,4 +1,4 @@ -package keystone +package internal import ( "encoding/hex" diff --git a/deployment/keystone/changeset/internal/update_don.go b/deployment/keystone/changeset/internal/update_don.go index fd9288c7426..3cfc386b2ba 100644 --- a/deployment/keystone/changeset/internal/update_don.go +++ b/deployment/keystone/changeset/internal/update_don.go @@ -18,8 +18,6 @@ import ( "google.golang.org/protobuf/proto" kcr "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/keystone/generated/capabilities_registry_1_1_0" - - kslib "github.com/smartcontractkit/chainlink/deployment/keystone" ) // CapabilityConfig is a struct that holds a capability and its configuration @@ -30,7 +28,7 @@ type CapabilityConfig struct { type UpdateDonRequest struct { Chain deployment.Chain - ContractSet *kslib.ContractSet // contract set for the given chain + ContractSet *ContractSet // contract set for the given chain P2PIDs []p2pkey.PeerID // this is the unique identifier for the don CapabilityConfigs []CapabilityConfig // if Config subfield is nil, a default config is used @@ -97,7 +95,7 @@ func UpdateDon(lggr logger.Logger, req *UpdateDonRequest) (*UpdateDonResponse, e } tx, err := registry.UpdateDON(txOpts, don.Id, don.NodeP2PIds, cfgs, don.IsPublic, don.F) if err != nil { - err = kslib.DecodeErr(kcr.CapabilitiesRegistryABI, err) + err = deployment.DecodeErr(kcr.CapabilitiesRegistryABI, err) return nil, fmt.Errorf("failed to call UpdateDON: %w", err) } var ops *timelock.BatchChainOperation @@ -150,7 +148,7 @@ func computeConfigs(registry *kcr.CapabilitiesRegistry, caps []CapabilityConfig, } out[i].CapabilityId = id if out[i].Config == nil { - c := kslib.DefaultCapConfig(cap.Capability.CapabilityType, int(donInfo.F)) + c := DefaultCapConfig(cap.Capability.CapabilityType, int(donInfo.F)) cb, err := proto.Marshal(c) if err != nil { return nil, fmt.Errorf("failed to marshal capability config for %v: %w", c, err) diff --git a/deployment/keystone/changeset/internal/update_don_test.go b/deployment/keystone/changeset/internal/update_don_test.go index f4b5fd46fc7..57b15138538 100644 --- a/deployment/keystone/changeset/internal/update_don_test.go +++ b/deployment/keystone/changeset/internal/update_don_test.go @@ -13,8 +13,6 @@ import ( chainsel "github.com/smartcontractkit/chain-selectors" "github.com/smartcontractkit/chainlink-common/pkg/logger" "github.com/smartcontractkit/chainlink/deployment" - "github.com/smartcontractkit/chainlink/deployment/keystone" - kslib "github.com/smartcontractkit/chainlink/deployment/keystone" kscs "github.com/smartcontractkit/chainlink/deployment/keystone/changeset" "github.com/smartcontractkit/chainlink/deployment/keystone/changeset/internal" kstest "github.com/smartcontractkit/chainlink/deployment/keystone/changeset/internal/test" @@ -100,14 +98,14 @@ func TestUpdateDon(t *testing.T) { t.Run("empty", func(t *testing.T) { cfg := setupUpdateDonTestConfig{ - dons: []kslib.DonInfo{ + dons: []internal.DonInfo{ { Name: "don 1", Nodes: []deployment.Node{node_1, node_2, node_3, node_4}, Capabilities: []kcr.CapabilitiesRegistryCapability{initialCap}, }, }, - nops: []keystone.NOP{ + nops: []internal.NOP{ { Name: "nop 1", Nodes: []string{node_1.NodeID, node_2.NodeID, node_3.NodeID, node_4.NodeID}, @@ -223,8 +221,8 @@ func newNode(t *testing.T, cfg minimalNodeCfg) deployment.Node { } type setupUpdateDonTestConfig struct { - dons []kslib.DonInfo - nops []keystone.NOP + dons []internal.DonInfo + nops []internal.NOP } type setupUpdateDonTestResult struct { @@ -239,7 +237,7 @@ func registerTestDon(t *testing.T, lggr logger.Logger, cfg setupUpdateDonTestCon } -func newSetupTestRegistryRequest(t *testing.T, dons []kslib.DonInfo, nops []keystone.NOP) *kstest.SetupTestRegistryRequest { +func newSetupTestRegistryRequest(t *testing.T, dons []internal.DonInfo, nops []internal.NOP) *kstest.SetupTestRegistryRequest { t.Helper() nodes := make(map[string]deployment.Node) for _, don := range dons { @@ -258,7 +256,7 @@ func newSetupTestRegistryRequest(t *testing.T, dons []kslib.DonInfo, nops []keys return req } -func makeNopToNodes(t *testing.T, nops []keystone.NOP, nodes map[string]deployment.Node) map[kcr.CapabilitiesRegistryNodeOperator][]*internal.P2PSignerEnc { +func makeNopToNodes(t *testing.T, nops []internal.NOP, nodes map[string]deployment.Node) map[kcr.CapabilitiesRegistryNodeOperator][]*internal.P2PSignerEnc { nopToNodes := make(map[kcr.CapabilitiesRegistryNodeOperator][]*internal.P2PSignerEnc) for _, nop := range nops { @@ -282,7 +280,7 @@ func makeNopToNodes(t *testing.T, nops []keystone.NOP, nodes map[string]deployme return nopToNodes } -func makeP2PToCapabilities(t *testing.T, dons []kslib.DonInfo) map[p2pkey.PeerID][]kcr.CapabilitiesRegistryCapability { +func makeP2PToCapabilities(t *testing.T, dons []internal.DonInfo) map[p2pkey.PeerID][]kcr.CapabilitiesRegistryCapability { p2pToCapabilities := make(map[p2pkey.PeerID][]kcr.CapabilitiesRegistryCapability) for _, don := range dons { for _, node := range don.Nodes { @@ -296,7 +294,7 @@ func makeP2PToCapabilities(t *testing.T, dons []kslib.DonInfo) map[p2pkey.PeerID return p2pToCapabilities } -func makeTestDon(t *testing.T, dons []kslib.DonInfo) []kstest.Don { +func makeTestDon(t *testing.T, dons []internal.DonInfo) []kstest.Don { out := make([]kstest.Don, len(dons)) for i, don := range dons { out[i] = testDon(t, don) @@ -304,7 +302,7 @@ func makeTestDon(t *testing.T, dons []kslib.DonInfo) []kstest.Don { return out } -func testDon(t *testing.T, don kslib.DonInfo) kstest.Don { +func testDon(t *testing.T, don internal.DonInfo) kstest.Don { var p2pids []p2pkey.PeerID for _, node := range don.Nodes { // all chain configs are the same wrt admin address & node keys diff --git a/deployment/keystone/changeset/internal/update_node_capabilities.go b/deployment/keystone/changeset/internal/update_node_capabilities.go index fba8e78f7ab..16c37267060 100644 --- a/deployment/keystone/changeset/internal/update_node_capabilities.go +++ b/deployment/keystone/changeset/internal/update_node_capabilities.go @@ -5,14 +5,13 @@ import ( "github.com/smartcontractkit/chainlink-common/pkg/logger" "github.com/smartcontractkit/chainlink/deployment" - kslib "github.com/smartcontractkit/chainlink/deployment/keystone" kcr "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/keystone/generated/capabilities_registry_1_1_0" "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/p2pkey" ) type UpdateNodeCapabilitiesImplRequest struct { Chain deployment.Chain - ContractSet *kslib.ContractSet + ContractSet *ContractSet P2pToCapabilities map[p2pkey.PeerID][]kcr.CapabilitiesRegistryCapability UseMCMS bool @@ -38,7 +37,7 @@ func UpdateNodeCapabilitiesImpl(lggr logger.Logger, req *UpdateNodeCapabilitiesI for _, cap := range req.P2pToCapabilities { capabilities = append(capabilities, cap...) } - op, err := kslib.AddCapabilities(lggr, req.ContractSet, req.Chain, capabilities, req.UseMCMS) + op, err := AddCapabilities(lggr, req.ContractSet, req.Chain, capabilities, req.UseMCMS) if err != nil { return nil, fmt.Errorf("failed to add capabilities: %w", err) } diff --git a/deployment/keystone/changeset/internal/update_node_capabilities_test.go b/deployment/keystone/changeset/internal/update_node_capabilities_test.go index 804fc32e537..65da264dd01 100644 --- a/deployment/keystone/changeset/internal/update_node_capabilities_test.go +++ b/deployment/keystone/changeset/internal/update_node_capabilities_test.go @@ -8,7 +8,7 @@ import ( "github.com/smartcontractkit/chainlink-common/pkg/logger" "github.com/smartcontractkit/chainlink/deployment" - kslib "github.com/smartcontractkit/chainlink/deployment/keystone/changeset/internal" + "github.com/smartcontractkit/chainlink/deployment/keystone/changeset/internal" kstest "github.com/smartcontractkit/chainlink/deployment/keystone/changeset/internal/test" kcr "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/keystone/generated/capabilities_registry_1_1_0" "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/p2pkey" @@ -25,9 +25,9 @@ func TestUpdateNodeCapabilities(t *testing.T) { }, }, } - nopToNodes = map[kcr.CapabilitiesRegistryNodeOperator][]*kslib.P2PSignerEnc{ - testNop(t, "testNop"): []*kslib.P2PSignerEnc{ - &kslib.P2PSignerEnc{ + nopToNodes = map[kcr.CapabilitiesRegistryNodeOperator][]*internal.P2PSignerEnc{ + testNop(t, "testNop"): []*internal.P2PSignerEnc{ + &internal.P2PSignerEnc{ Signer: [32]byte{0: 1}, P2PKey: testPeerID(t, "0x1"), EncryptionPublicKey: [32]byte{3: 16, 4: 2}, @@ -40,7 +40,7 @@ func TestUpdateNodeCapabilities(t *testing.T) { type args struct { lggr logger.Logger - req *kslib.UpdateNodeCapabilitiesImplRequest // chain and registry are set in the test setup + req *internal.UpdateNodeCapabilitiesImplRequest // chain and registry are set in the test setup initialState *kstest.SetupTestRegistryRequest } tests := []struct { @@ -53,7 +53,7 @@ func TestUpdateNodeCapabilities(t *testing.T) { name: "invalid request", args: args{ lggr: lggr, - req: &kslib.UpdateNodeCapabilitiesImplRequest{ + req: &internal.UpdateNodeCapabilitiesImplRequest{ Chain: deployment.Chain{}, }, initialState: &kstest.SetupTestRegistryRequest{}, @@ -68,7 +68,7 @@ func TestUpdateNodeCapabilities(t *testing.T) { P2pToCapabilities: initialp2pToCapabilities, NopToNodes: nopToNodes, }, - req: &kslib.UpdateNodeCapabilitiesImplRequest{ + req: &internal.UpdateNodeCapabilitiesImplRequest{ P2pToCapabilities: map[p2pkey.PeerID][]kcr.CapabilitiesRegistryCapability{ testPeerID(t, "0x1"): []kcr.CapabilitiesRegistryCapability{ { @@ -95,7 +95,7 @@ func TestUpdateNodeCapabilities(t *testing.T) { tt.args.req.Chain = setupResp.Chain tt.args.req.ContractSet = setupResp.ContractSet - got, err := kslib.UpdateNodeCapabilitiesImpl(tt.args.lggr, tt.args.req) + got, err := internal.UpdateNodeCapabilitiesImpl(tt.args.lggr, tt.args.req) if (err != nil) != tt.wantErr { t.Errorf("UpdateNodeCapabilities() error = %v, wantErr %v", err, tt.wantErr) return diff --git a/deployment/keystone/changeset/internal/update_nodes.go b/deployment/keystone/changeset/internal/update_nodes.go index e483c5ddf87..b27c17ad19f 100644 --- a/deployment/keystone/changeset/internal/update_nodes.go +++ b/deployment/keystone/changeset/internal/update_nodes.go @@ -17,7 +17,6 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/p2pkey" "github.com/smartcontractkit/chainlink/deployment" - kslib "github.com/smartcontractkit/chainlink/deployment/keystone" ) type NodeUpdate struct { @@ -30,7 +29,7 @@ type NodeUpdate struct { type UpdateNodesRequest struct { Chain deployment.Chain - ContractSet *kslib.ContractSet // contract set for the given chain + ContractSet *ContractSet // contract set for the given chain P2pToUpdates map[p2pkey.PeerID]NodeUpdate @@ -60,7 +59,7 @@ func (req *UpdateNodesRequest) Validate() error { for peer, updates := range req.P2pToUpdates { seen := make(map[string]struct{}) for _, cap := range updates.Capabilities { - id := kslib.CapabilityID(cap) + id := CapabilityID(cap) if _, exists := seen[id]; exists { return fmt.Errorf("duplicate capability %s for %s", id, peer) } @@ -103,7 +102,7 @@ func UpdateNodes(lggr logger.Logger, req *UpdateNodesRequest) (*UpdateNodesRespo params, err := req.NodeParams() if err != nil { - err = kslib.DecodeErr(kcr.CapabilitiesRegistryABI, err) + err = deployment.DecodeErr(kcr.CapabilitiesRegistryABI, err) return nil, fmt.Errorf("failed to make node params: %w", err) } txOpts := req.Chain.DeployerKey @@ -113,7 +112,7 @@ func UpdateNodes(lggr logger.Logger, req *UpdateNodesRequest) (*UpdateNodesRespo registry := req.ContractSet.CapabilitiesRegistry tx, err := registry.UpdateNodes(txOpts, params) if err != nil { - err = kslib.DecodeErr(kcr.CapabilitiesRegistryABI, err) + err = deployment.DecodeErr(kcr.CapabilitiesRegistryABI, err) return nil, fmt.Errorf("failed to call UpdateNodes: %w", err) } @@ -183,8 +182,8 @@ func AppendCapabilities(lggr logger.Logger, registry *kcr.CapabilitiesRegistry, var deduped []kcr.CapabilitiesRegistryCapability seen := make(map[string]struct{}) for _, cap := range mergedCaps { - if _, ok := seen[kslib.CapabilityID(cap)]; !ok { - seen[kslib.CapabilityID(cap)] = struct{}{} + if _, ok := seen[CapabilityID(cap)]; !ok { + seen[CapabilityID(cap)] = struct{}{} deduped = append(deduped, cap) } } @@ -204,7 +203,7 @@ func makeNodeParams(registry *kcr.CapabilitiesRegistry, nodes, err := registry.GetNodesByP2PIds(&bind.CallOpts{}, PeerIDsToBytes(p2pIds)) if err != nil { - err = kslib.DecodeErr(kcr.CapabilitiesRegistryABI, err) + err = deployment.DecodeErr(kcr.CapabilitiesRegistryABI, err) return nil, fmt.Errorf("failed to get nodes by p2p ids: %w", err) } for _, node := range nodes { @@ -261,11 +260,11 @@ func makeNodeParams(registry *kcr.CapabilitiesRegistry, } -// fetchkslib.CapabilityIDs fetches the capability ids for the given capabilities +// fetchCapabilityIDs fetches the capability ids for the given capabilities func fetchCapabilityIDs(registry *kcr.CapabilitiesRegistry, caps []kcr.CapabilitiesRegistryCapability) (map[string][32]byte, error) { out := make(map[string][32]byte) for _, cap := range caps { - name := kslib.CapabilityID(cap) + name := CapabilityID(cap) if _, exists := out[name]; exists { continue } diff --git a/deployment/keystone/changeset/internal/update_nodes_test.go b/deployment/keystone/changeset/internal/update_nodes_test.go index a0810225762..0f22120998a 100644 --- a/deployment/keystone/changeset/internal/update_nodes_test.go +++ b/deployment/keystone/changeset/internal/update_nodes_test.go @@ -16,7 +16,6 @@ import ( "github.com/smartcontractkit/chainlink-common/pkg/logger" "github.com/smartcontractkit/chainlink/deployment" - kslib "github.com/smartcontractkit/chainlink/deployment/keystone" "github.com/smartcontractkit/chainlink/deployment/keystone/changeset/internal" kstest "github.com/smartcontractkit/chainlink/deployment/keystone/changeset/internal/test" @@ -30,7 +29,7 @@ func Test_UpdateNodesRequest_validate(t *testing.T) { p2pToUpdates map[p2pkey.PeerID]internal.NodeUpdate nopToNodes map[kcr.CapabilitiesRegistryNodeOperator][]*internal.P2PSignerEnc chain deployment.Chain - contractSet *kslib.ContractSet + contractSet *internal.ContractSet } tests := []struct { name string @@ -465,14 +464,14 @@ func TestUpdateNodes(t *testing.T) { require.NoError(t, err) // register the capabilities that the Update will use - expectedUpdatedCaps := make(map[p2pkey.PeerID][]kslib.RegisteredCapability) + expectedUpdatedCaps := make(map[p2pkey.PeerID][]internal.RegisteredCapability) capCache := kstest.NewCapabiltyCache(t) for p2p, update := range tt.args.req.P2pToUpdates { if len(update.Capabilities) > 0 { expectedCaps := capCache.AddCapabilities(tt.args.lggr, tt.args.req.Chain, registry, update.Capabilities) expectedUpdatedCaps[p2p] = expectedCaps } else { - expectedUpdatedCaps[p2p] = []kslib.RegisteredCapability{ + expectedUpdatedCaps[p2p] = []internal.RegisteredCapability{ {CapabilitiesRegistryCapability: phonyCap, ID: id}, } } @@ -564,7 +563,7 @@ func TestUpdateNodes(t *testing.T) { toRegister := p2pToCapabilitiesUpdated[testPeerID(t, "peerID_1")] tx, err := registry.AddCapabilities(chain.DeployerKey, toRegister) if err != nil { - err2 := kslib.DecodeErr(kcr.CapabilitiesRegistryABI, err) + err2 := deployment.DecodeErr(kcr.CapabilitiesRegistryABI, err) require.Fail(t, fmt.Sprintf("failed to call AddCapabilities: %s: %s", err, err2)) } _, err = chain.Confirm(tx) @@ -654,7 +653,7 @@ func TestAppendCapabilities(t *testing.T) { wantCaps = append(wantCaps, newCaps...) for i, got := range gotCaps { - assert.Equal(t, kslib.CapabilityID(wantCaps[i]), kslib.CapabilityID(got)) + assert.Equal(t, internal.CapabilityID(wantCaps[i]), internal.CapabilityID(got)) } // trying to append an existing capability should not change the result diff --git a/deployment/keystone/changeset/test/helpers.go b/deployment/keystone/changeset/test/helpers.go index 94a65920cf5..5ddaeda524e 100644 --- a/deployment/keystone/changeset/test/helpers.go +++ b/deployment/keystone/changeset/test/helpers.go @@ -22,9 +22,8 @@ import ( "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" commontypes "github.com/smartcontractkit/chainlink/deployment/common/types" "github.com/smartcontractkit/chainlink/deployment/environment/memory" - "github.com/smartcontractkit/chainlink/deployment/keystone" - kslib "github.com/smartcontractkit/chainlink/deployment/keystone" kschangeset "github.com/smartcontractkit/chainlink/deployment/keystone/changeset" + "github.com/smartcontractkit/chainlink/deployment/keystone/changeset/internal" "github.com/smartcontractkit/chainlink/deployment/keystone/changeset/workflowregistry" kcr "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/keystone/generated/capabilities_registry_1_1_0" "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/p2pkey" @@ -81,8 +80,8 @@ type TestEnv struct { AssetNodes map[string]memory.Node } -func (te TestEnv) ContractSets() map[uint64]kslib.ContractSet { - r, err := kslib.GetContractSets(te.Env.Logger, &kslib.GetContractSetsRequest{ +func (te TestEnv) ContractSets() map[uint64]internal.ContractSet { + r, err := internal.GetContractSets(te.Env.Logger, &internal.GetContractSetsRequest{ Chains: te.Env.Chains, AddressBook: te.Env.ExistingAddresses, }) @@ -118,7 +117,7 @@ func SetupTestEnv(t *testing.T, c TestConfig) TestEnv { }, { Changeset: commonchangeset.WrapChangeSet(kschangeset.DeployForwarder), - Config: registryChainSel, + Config: kschangeset.DeployForwarderRequest{}, }, { Changeset: commonchangeset.WrapChangeSet(workflowregistry.Deploy), @@ -153,35 +152,35 @@ func SetupTestEnv(t *testing.T, c TestConfig) TestEnv { // TODO: partition nodes into multiple nops - wfDon := keystone.DonCapabilities{ - Name: keystone.WFDonName, - Nops: []keystone.NOP{ + wfDon := internal.DonCapabilities{ + Name: internal.WFDonName, + Nops: []internal.NOP{ { Name: "nop 1", Nodes: maps.Keys(wfNodes), }, }, - Capabilities: []kcr.CapabilitiesRegistryCapability{keystone.OCR3Cap}, + Capabilities: []kcr.CapabilitiesRegistryCapability{internal.OCR3Cap}, } - cwDon := keystone.DonCapabilities{ - Name: keystone.TargetDonName, - Nops: []keystone.NOP{ + cwDon := internal.DonCapabilities{ + Name: internal.TargetDonName, + Nops: []internal.NOP{ { Name: "nop 2", Nodes: maps.Keys(cwNodes), }, }, - Capabilities: []kcr.CapabilitiesRegistryCapability{keystone.WriteChainCap}, + Capabilities: []kcr.CapabilitiesRegistryCapability{internal.WriteChainCap}, } - assetDon := keystone.DonCapabilities{ - Name: keystone.StreamDonName, - Nops: []keystone.NOP{ + assetDon := internal.DonCapabilities{ + Name: internal.StreamDonName, + Nops: []internal.NOP{ { Name: "nop 3", Nodes: maps.Keys(assetNodes), }, }, - Capabilities: []kcr.CapabilitiesRegistryCapability{keystone.StreamTriggerCap}, + Capabilities: []kcr.CapabilitiesRegistryCapability{internal.StreamTriggerCap}, } allChains := make(map[uint64]deployment.Chain) @@ -196,10 +195,10 @@ func SetupTestEnv(t *testing.T, c TestConfig) TestEnv { err = env.ExistingAddresses.Merge(e.ExistingAddresses) require.NoError(t, err) - var ocr3Config = keystone.OracleConfig{ + var ocr3Config = internal.OracleConfig{ MaxFaultyOracles: len(wfNodes) / 3, } - var allDons = []keystone.DonCapabilities{wfDon, cwDon, assetDon} + var allDons = []internal.DonCapabilities{wfDon, cwDon, assetDon} csOut, err := kschangeset.ConfigureInitialContractsChangeset(env, kschangeset.InitialContractsCfg{ RegistryChainSel: registryChainSel, @@ -209,12 +208,12 @@ func SetupTestEnv(t *testing.T, c TestConfig) TestEnv { require.NoError(t, err) require.Nil(t, csOut.AddressBook, "no new addresses should be created in configure initial contracts") - req := &keystone.GetContractSetsRequest{ + req := &internal.GetContractSetsRequest{ Chains: env.Chains, AddressBook: env.ExistingAddresses, } - contractSetsResp, err := keystone.GetContractSets(lggr, req) + contractSetsResp, err := internal.GetContractSets(lggr, req) require.NoError(t, err) require.Len(t, contractSetsResp.ContractSets, len(env.Chains)) // check the registry @@ -249,7 +248,7 @@ func SetupTestEnv(t *testing.T, c TestConfig) TestEnv { }) require.NoError(t, err) // extract the MCMS address - r, err := kslib.GetContractSets(lggr, &kslib.GetContractSetsRequest{ + r, err := internal.GetContractSets(lggr, &internal.GetContractSetsRequest{ Chains: env.Chains, AddressBook: env.ExistingAddresses, }) @@ -311,7 +310,7 @@ func validateInitialChainState(t *testing.T, env deployment.Environment, registr } containsForwarder := false for _, tv := range chainAddrs { - if tv.Type == keystone.KeystoneForwarder { + if tv.Type == internal.KeystoneForwarder { containsForwarder = true break } @@ -331,7 +330,7 @@ func validateNodes(t *testing.T, gotRegistry *kcr.CapabilitiesRegistry, nodes ma } // validateDon checks that the don exists and has the expected capabilities -func validateDon(t *testing.T, gotRegistry *kcr.CapabilitiesRegistry, nodes map[string]memory.Node, don kslib.DonCapabilities) { +func validateDon(t *testing.T, gotRegistry *kcr.CapabilitiesRegistry, nodes map[string]memory.Node, don internal.DonCapabilities) { gotDons, err := gotRegistry.GetDONs(nil) require.NoError(t, err) wantP2PID := sortedHash(p2pIDs(t, maps.Keys(nodes))) @@ -370,7 +369,7 @@ func p2pIDs(t *testing.T, vals []string) [][32]byte { return out } -func expectedHashedCapabilities(t *testing.T, registry *kcr.CapabilitiesRegistry, don kslib.DonCapabilities) [][32]byte { +func expectedHashedCapabilities(t *testing.T, registry *kcr.CapabilitiesRegistry, don internal.DonCapabilities) [][32]byte { out := make([][32]byte, len(don.Capabilities)) var err error for i, cap := range don.Capabilities { diff --git a/deployment/keystone/changeset/update_don.go b/deployment/keystone/changeset/update_don.go index fd1312448ef..5b381a4e498 100644 --- a/deployment/keystone/changeset/update_don.go +++ b/deployment/keystone/changeset/update_don.go @@ -4,7 +4,6 @@ import ( "fmt" "github.com/smartcontractkit/chainlink/deployment" - kslib "github.com/smartcontractkit/chainlink/deployment/keystone" "github.com/smartcontractkit/chainlink/deployment/keystone/changeset/internal" kcr "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/keystone/generated/capabilities_registry_1_1_0" @@ -100,7 +99,7 @@ func appendRequest(r *UpdateDonRequest) *AppendNodeCapabilitiesRequest { } func updateDonRequest(env deployment.Environment, r *UpdateDonRequest) (*internal.UpdateDonRequest, error) { - resp, err := kslib.GetContractSets(env.Logger, &kslib.GetContractSetsRequest{ + resp, err := internal.GetContractSets(env.Logger, &internal.GetContractSetsRequest{ Chains: env.Chains, AddressBook: env.ExistingAddresses, }) diff --git a/deployment/keystone/changeset/update_node_capabilities.go b/deployment/keystone/changeset/update_node_capabilities.go index c386228b4a2..8c4d01159ed 100644 --- a/deployment/keystone/changeset/update_node_capabilities.go +++ b/deployment/keystone/changeset/update_node_capabilities.go @@ -11,7 +11,6 @@ import ( "github.com/smartcontractkit/ccip-owner-contracts/pkg/proposal/timelock" "github.com/smartcontractkit/chainlink/deployment" "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" - kslib "github.com/smartcontractkit/chainlink/deployment/keystone" "github.com/smartcontractkit/chainlink/deployment/keystone/changeset/internal" kcr "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/keystone/generated/capabilities_registry_1_1_0" @@ -84,7 +83,7 @@ func (req *MutateNodeCapabilitiesRequest) updateNodeCapabilitiesImplRequest(e de if !ok { return nil, fmt.Errorf("registry chain selector %d does not exist in environment", req.RegistryChainSel) } - resp, err := kslib.GetContractSets(e.Logger, &kslib.GetContractSetsRequest{ + resp, err := internal.GetContractSets(e.Logger, &internal.GetContractSetsRequest{ Chains: map[uint64]deployment.Chain{req.RegistryChainSel: registryChain}, AddressBook: e.ExistingAddresses, }) diff --git a/deployment/keystone/changeset/update_nodes.go b/deployment/keystone/changeset/update_nodes.go index bb12f32cb94..10a7ad4e441 100644 --- a/deployment/keystone/changeset/update_nodes.go +++ b/deployment/keystone/changeset/update_nodes.go @@ -10,7 +10,6 @@ import ( "github.com/smartcontractkit/chainlink/deployment" "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" - kslib "github.com/smartcontractkit/chainlink/deployment/keystone" "github.com/smartcontractkit/chainlink/deployment/keystone/changeset/internal" "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/p2pkey" ) @@ -50,7 +49,7 @@ func UpdateNodes(env deployment.Environment, req *UpdateNodesRequest) (deploymen if !ok { return deployment.ChangesetOutput{}, fmt.Errorf("registry chain selector %d does not exist in environment", req.RegistryChainSel) } - cresp, err := kslib.GetContractSets(env.Logger, &kslib.GetContractSetsRequest{ + cresp, err := internal.GetContractSets(env.Logger, &internal.GetContractSetsRequest{ Chains: env.Chains, AddressBook: env.ExistingAddresses, }) diff --git a/deployment/keystone/changeset/view.go b/deployment/keystone/changeset/view.go index 417484ed6aa..9c8678d8778 100644 --- a/deployment/keystone/changeset/view.go +++ b/deployment/keystone/changeset/view.go @@ -8,14 +8,14 @@ import ( "github.com/smartcontractkit/chainlink/deployment" commonview "github.com/smartcontractkit/chainlink/deployment/common/view" - "github.com/smartcontractkit/chainlink/deployment/keystone" + "github.com/smartcontractkit/chainlink/deployment/keystone/changeset/internal" "github.com/smartcontractkit/chainlink/deployment/keystone/view" ) var _ deployment.ViewState = ViewKeystone func ViewKeystone(e deployment.Environment) (json.Marshaler, error) { - state, err := keystone.GetContractSets(e.Logger, &keystone.GetContractSetsRequest{ + state, err := internal.GetContractSets(e.Logger, &internal.GetContractSetsRequest{ Chains: e.Chains, AddressBook: e.ExistingAddresses, }) diff --git a/deployment/keystone/changeset/view_test.go b/deployment/keystone/changeset/view_test.go index 023b4462549..5b32699fd89 100644 --- a/deployment/keystone/changeset/view_test.go +++ b/deployment/keystone/changeset/view_test.go @@ -26,7 +26,7 @@ func TestKeystoneView(t *testing.T) { require.NoError(t, err) require.NotNil(t, resp) require.NoError(t, env.ExistingAddresses.Merge(resp.AddressBook)) - resp, err = DeployForwarder(env, registryChain) + resp, err = DeployForwarder(env, DeployForwarderRequest{}) require.NoError(t, err) require.NotNil(t, resp) require.NoError(t, env.ExistingAddresses.Merge(resp.AddressBook)) diff --git a/deployment/keystone/changeset/workflowregistry/deploy.go b/deployment/keystone/changeset/workflowregistry/deploy.go index 352336dd168..e55484aa711 100644 --- a/deployment/keystone/changeset/workflowregistry/deploy.go +++ b/deployment/keystone/changeset/workflowregistry/deploy.go @@ -4,7 +4,6 @@ import ( "fmt" "github.com/smartcontractkit/chainlink/deployment" - kslib "github.com/smartcontractkit/chainlink/deployment/keystone" ) var _ deployment.ChangeSet[uint64] = Deploy @@ -16,7 +15,7 @@ func Deploy(env deployment.Environment, registrySelector uint64) (deployment.Cha return deployment.ChangesetOutput{}, fmt.Errorf("chain not found in environment") } ab := deployment.NewMemoryAddressBook() - wrResp, err := kslib.DeployWorkflowRegistry(chain, ab) + wrResp, err := deployWorkflowRegistry(chain, ab) if err != nil { return deployment.ChangesetOutput{}, fmt.Errorf("failed to deploy CapabilitiesRegistry: %w", err) } diff --git a/deployment/keystone/changeset/workflowregistry/setup_test.go b/deployment/keystone/changeset/workflowregistry/setup_test.go new file mode 100644 index 00000000000..78e7d852080 --- /dev/null +++ b/deployment/keystone/changeset/workflowregistry/setup_test.go @@ -0,0 +1,54 @@ +package workflowregistry + +import ( + "testing" + + "github.com/smartcontractkit/chainlink-common/pkg/logger" + "github.com/smartcontractkit/chainlink/deployment" + "github.com/smartcontractkit/chainlink/deployment/environment/memory" + "github.com/smartcontractkit/chainlink/deployment/keystone/changeset" + workflow_registry "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/workflow/generated/workflow_registry_wrapper" + "github.com/stretchr/testify/require" +) + +type SetupTestWorkflowRegistryResponse struct { + Registry *workflow_registry.WorkflowRegistry + Chain deployment.Chain + RegistrySelector uint64 + AddressBook deployment.AddressBook +} + +func SetupTestWorkflowRegistry(t *testing.T, lggr logger.Logger, chainSel uint64) *SetupTestWorkflowRegistryResponse { + chain := testChain(t) + + deployer, err := newWorkflowRegistryDeployer() + require.NoError(t, err) + resp, err := deployer.Deploy(changeset.DeployRequest{Chain: chain}) + require.NoError(t, err) + + addressBook := deployment.NewMemoryAddressBookFromMap( + map[uint64]map[string]deployment.TypeAndVersion{ + chainSel: map[string]deployment.TypeAndVersion{ + resp.Address.Hex(): resp.Tv, + }, + }, + ) + + return &SetupTestWorkflowRegistryResponse{ + Registry: deployer.Contract(), + Chain: chain, + RegistrySelector: chain.Selector, + AddressBook: addressBook, + } +} + +func testChain(t *testing.T) deployment.Chain { + chains, _ := memory.NewMemoryChains(t, 1, 5) + var chain deployment.Chain + for _, c := range chains { + chain = c + break + } + require.NotEmpty(t, chain) + return chain +} diff --git a/deployment/keystone/changeset/workflowregistry/strategies.go b/deployment/keystone/changeset/workflowregistry/strategies.go index f799092d4ce..617d6e6e8dc 100644 --- a/deployment/keystone/changeset/workflowregistry/strategies.go +++ b/deployment/keystone/changeset/workflowregistry/strategies.go @@ -13,7 +13,6 @@ import ( "github.com/smartcontractkit/chainlink/deployment" "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" - kslib "github.com/smartcontractkit/chainlink/deployment/keystone" "github.com/smartcontractkit/chainlink/deployment/keystone/changeset" ) @@ -40,7 +39,7 @@ type mcmsTransaction struct { Description string Address common.Address ChainSel uint64 - ContractSet *kslib.ContractSet + ContractSet *changeset.ContractSet } func (m *mcmsTransaction) Apply(callFn func(opts *bind.TransactOpts) (*types.Transaction, error)) (deployment.ChangesetOutput, error) { diff --git a/deployment/keystone/changeset/workflowregistry/update_allowed_dons.go b/deployment/keystone/changeset/workflowregistry/update_allowed_dons.go index b07414221dd..5001370b552 100644 --- a/deployment/keystone/changeset/workflowregistry/update_allowed_dons.go +++ b/deployment/keystone/changeset/workflowregistry/update_allowed_dons.go @@ -9,7 +9,6 @@ import ( "github.com/smartcontractkit/chainlink/deployment" - kslib "github.com/smartcontractkit/chainlink/deployment/keystone" "github.com/smartcontractkit/chainlink/deployment/keystone/changeset" workflow_registry "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/workflow/generated/workflow_registry_wrapper" ) @@ -37,7 +36,7 @@ func UpdateAllowedDons(env deployment.Environment, req *UpdateAllowedDonsRequest return deployment.ChangesetOutput{}, err } - resp, err := kslib.GetContractSets(env.Logger, &kslib.GetContractSetsRequest{ + resp, err := changeset.GetContractSets(env.Logger, &changeset.GetContractSetsRequest{ Chains: env.Chains, AddressBook: env.ExistingAddresses, }) @@ -74,7 +73,7 @@ func UpdateAllowedDons(env deployment.Environment, req *UpdateAllowedDonsRequest return s.Apply(func(opts *bind.TransactOpts) (*types.Transaction, error) { tx, err := registry.UpdateAllowedDONs(opts, req.DonIDs, req.Allowed) if err != nil { - err = kslib.DecodeErr(workflow_registry.WorkflowRegistryABI, err) + err = deployment.DecodeErr(workflow_registry.WorkflowRegistryABI, err) } return tx, err }) diff --git a/deployment/keystone/changeset/workflowregistry/update_allowed_dons_test.go b/deployment/keystone/changeset/workflowregistry/update_allowed_dons_test.go index bb17a85b1aa..f24db609553 100644 --- a/deployment/keystone/changeset/workflowregistry/update_allowed_dons_test.go +++ b/deployment/keystone/changeset/workflowregistry/update_allowed_dons_test.go @@ -15,7 +15,6 @@ import ( commonchangeset "github.com/smartcontractkit/chainlink/deployment/common/changeset" "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" "github.com/smartcontractkit/chainlink/deployment/keystone/changeset" - kstest "github.com/smartcontractkit/chainlink/deployment/keystone/changeset/internal/test" "github.com/smartcontractkit/chainlink/deployment/keystone/changeset/test" "github.com/smartcontractkit/chainlink/deployment/keystone/changeset/workflowregistry" ) @@ -24,7 +23,7 @@ func TestUpdateAllowedDons(t *testing.T) { lggr := logger.Test(t) chainSel := chain_selectors.ETHEREUM_TESTNET_SEPOLIA.Selector - resp := kstest.SetupTestWorkflowRegistry(t, lggr, chainSel) + resp := workflowregistry.SetupTestWorkflowRegistry(t, lggr, chainSel) registry := resp.Registry dons, err := registry.GetAllAllowedDONs(&bind.CallOpts{}) diff --git a/deployment/keystone/changeset/workflowregistry/update_authorized_addresses.go b/deployment/keystone/changeset/workflowregistry/update_authorized_addresses.go index f05c6cd58c9..b2d5ffcce1e 100644 --- a/deployment/keystone/changeset/workflowregistry/update_authorized_addresses.go +++ b/deployment/keystone/changeset/workflowregistry/update_authorized_addresses.go @@ -10,7 +10,6 @@ import ( "github.com/smartcontractkit/chainlink/deployment" - kslib "github.com/smartcontractkit/chainlink/deployment/keystone" "github.com/smartcontractkit/chainlink/deployment/keystone/changeset" workflow_registry "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/workflow/generated/workflow_registry_wrapper" ) @@ -35,7 +34,7 @@ func (r *UpdateAuthorizedAddressesRequest) Validate() error { } func getWorkflowRegistry(env deployment.Environment, chainSel uint64) (*workflow_registry.WorkflowRegistry, error) { - resp, err := kslib.GetContractSets(env.Logger, &kslib.GetContractSetsRequest{ + resp, err := changeset.GetContractSets(env.Logger, &changeset.GetContractSetsRequest{ Chains: env.Chains, AddressBook: env.ExistingAddresses, }) @@ -57,7 +56,7 @@ func UpdateAuthorizedAddresses(env deployment.Environment, req *UpdateAuthorized return deployment.ChangesetOutput{}, err } - resp, err := kslib.GetContractSets(env.Logger, &kslib.GetContractSetsRequest{ + resp, err := changeset.GetContractSets(env.Logger, &changeset.GetContractSetsRequest{ Chains: env.Chains, AddressBook: env.ExistingAddresses, }) @@ -99,7 +98,7 @@ func UpdateAuthorizedAddresses(env deployment.Environment, req *UpdateAuthorized return s.Apply(func(opts *bind.TransactOpts) (*types.Transaction, error) { tx, err := registry.UpdateAuthorizedAddresses(opts, addr, req.Allowed) if err != nil { - err = kslib.DecodeErr(workflow_registry.WorkflowRegistryABI, err) + err = deployment.DecodeErr(workflow_registry.WorkflowRegistryABI, err) } return tx, err }) diff --git a/deployment/keystone/changeset/workflowregistry/update_authorized_addresses_test.go b/deployment/keystone/changeset/workflowregistry/update_authorized_addresses_test.go index 36dfd4371b1..a8d969fce0c 100644 --- a/deployment/keystone/changeset/workflowregistry/update_authorized_addresses_test.go +++ b/deployment/keystone/changeset/workflowregistry/update_authorized_addresses_test.go @@ -16,7 +16,6 @@ import ( commonchangeset "github.com/smartcontractkit/chainlink/deployment/common/changeset" "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" "github.com/smartcontractkit/chainlink/deployment/keystone/changeset" - kstest "github.com/smartcontractkit/chainlink/deployment/keystone/changeset/internal/test" "github.com/smartcontractkit/chainlink/deployment/keystone/changeset/test" "github.com/smartcontractkit/chainlink/deployment/keystone/changeset/workflowregistry" ) @@ -25,7 +24,7 @@ func TestUpdateAuthorizedAddresses(t *testing.T) { lggr := logger.Test(t) chainSel := chain_selectors.ETHEREUM_TESTNET_SEPOLIA.Selector - resp := kstest.SetupTestWorkflowRegistry(t, lggr, chainSel) + resp := workflowregistry.SetupTestWorkflowRegistry(t, lggr, chainSel) registry := resp.Registry dons, err := registry.GetAllAuthorizedAddresses(&bind.CallOpts{}) diff --git a/deployment/keystone/workflow_registry_deployer.go b/deployment/keystone/changeset/workflowregistry/workflow_registry_deployer.go similarity index 50% rename from deployment/keystone/workflow_registry_deployer.go rename to deployment/keystone/changeset/workflowregistry/workflow_registry_deployer.go index 794e6ad0202..ac5bbd16cc8 100644 --- a/deployment/keystone/workflow_registry_deployer.go +++ b/deployment/keystone/changeset/workflowregistry/workflow_registry_deployer.go @@ -1,4 +1,4 @@ -package keystone +package workflowregistry import ( "fmt" @@ -8,38 +8,34 @@ import ( "github.com/smartcontractkit/chainlink-common/pkg/logger" "github.com/smartcontractkit/chainlink/deployment" + "github.com/smartcontractkit/chainlink/deployment/keystone/changeset" workflow_registry "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/workflow/generated/workflow_registry_wrapper" ) -type WorkflowRegistryDeployer struct { +type workflowRegistryDeployer struct { lggr logger.Logger contract *workflow_registry.WorkflowRegistry } -func NewWorkflowRegistryDeployer() (*WorkflowRegistryDeployer, error) { +func newWorkflowRegistryDeployer() (*workflowRegistryDeployer, error) { lggr, err := logger.New() if err != nil { return nil, err } - return &WorkflowRegistryDeployer{lggr: lggr}, nil + return &workflowRegistryDeployer{lggr: lggr}, nil } -func (c *WorkflowRegistryDeployer) Contract() *workflow_registry.WorkflowRegistry { +func (c *workflowRegistryDeployer) Contract() *workflow_registry.WorkflowRegistry { return c.contract } -func (c *WorkflowRegistryDeployer) Deploy(req DeployRequest) (*DeployResponse, error) { - est, err := estimateDeploymentGas(req.Chain.Client, workflow_registry.WorkflowRegistryABI) - if err != nil { - return nil, fmt.Errorf("failed to estimate gas: %w", err) - } - c.lggr.Debugf("WorkflowRegistry estimated gas: %d", est) +func (c *workflowRegistryDeployer) Deploy(req changeset.DeployRequest) (*changeset.DeployResponse, error) { addr, tx, wr, err := workflow_registry.DeployWorkflowRegistry( req.Chain.DeployerKey, req.Chain.Client) if err != nil { - return nil, DecodeErr(workflow_registry.WorkflowRegistryABI, err) + return nil, deployment.DecodeErr(workflow_registry.WorkflowRegistryABI, err) } _, err = req.Chain.Confirm(tx) @@ -55,7 +51,7 @@ func (c *WorkflowRegistryDeployer) Deploy(req DeployRequest) (*DeployResponse, e if err != nil { return nil, fmt.Errorf("failed to parse type and version from %s: %w", tvStr, err) } - resp := &DeployResponse{ + resp := &changeset.DeployResponse{ Address: addr, Tx: tx.Hash(), Tv: tv, @@ -63,3 +59,18 @@ func (c *WorkflowRegistryDeployer) Deploy(req DeployRequest) (*DeployResponse, e c.contract = wr return resp, nil } + +// deployWorkflowRegistry deploys the WorkflowRegistry contract to the chain +// and saves the address in the address book. This mutates the address book. +func deployWorkflowRegistry(chain deployment.Chain, ab deployment.AddressBook) (*changeset.DeployResponse, error) { + deployer, err := newWorkflowRegistryDeployer() + resp, err := deployer.Deploy(changeset.DeployRequest{Chain: chain}) + if err != nil { + return nil, fmt.Errorf("failed to deploy WorkflowRegistry: %w", err) + } + err = ab.Save(chain.Selector, resp.Address.String(), resp.Tv) + if err != nil { + return nil, fmt.Errorf("failed to save WorkflowRegistry: %w", err) + } + return resp, nil +} diff --git a/deployment/keystone/deprecated.go b/deployment/keystone/deprecated.go new file mode 100644 index 00000000000..0e85cbedb17 --- /dev/null +++ b/deployment/keystone/deprecated.go @@ -0,0 +1,127 @@ +package keystone + +import "github.com/smartcontractkit/chainlink/deployment/keystone/changeset" + +//TODO: delete this after the downstream migration is done + +// DEPRECATED: Use changeset package instead +// OracleConfig is the configuration for an oracle +type OracleConfig = changeset.OracleConfig + +// DEPRECATED: Use changeset package instead +// OCR3OnchainConfig is the onchain configuration of an OCR2 contract +type OCR2OracleConfig = changeset.OCR3OnchainConfig + +// DEPRECATED: Use changeset package instead +// NodeKeys is a set of public keys for a node +type NodeKeys = changeset.NodeKeys + +// DEPRECATED: Use changeset package instead +// TopLevelConfigSource is the top level configuration source +type TopLevelConfigSource = changeset.TopLevelConfigSource + +// DEPRECATED: Use changeset package instead +// GenerateOCR3Config generates an OCR3 config +var GenerateOCR3Config = changeset.GenerateOCR3Config + +// DEPRECATED: Use changeset package instead +// FeedConsumer is a feed consumer contract type +var FeedConsumer = changeset.FeedConsumer + +// DEPRECATED: Use changeset package instead +// KeystoneForwarder is a keystone forwarder contract type +var KeystoneForwarder = changeset.KeystoneForwarder + +// DEPRECATED: Use changeset package instead +// GetContractSetsRequest is a request to get contract sets +type GetContractSetsRequest = changeset.GetContractSetsRequest + +// DEPRECATED: Use changeset package instead +// GetContractSetsResponse is a response to get contract sets +type GetContractSetsResponse = changeset.GetContractSetsResponse + +// DEPRECATED: Use changeset package instead +// GetContractSets gets contract sets +var GetContractSets = changeset.GetContractSets + +// DEPRECATED: Use changeset package instead +// RegisterCapabilitiesRequest is a request to register capabilities +type RegisterCapabilitiesRequest = changeset.RegisterCapabilitiesRequest + +// DEPRECATED: Use changeset package instead +// RegisterCapabilitiesResponse is a response to register capabilities +type RegisterCapabilitiesResponse = changeset.RegisterCapabilitiesResponse + +// DEPRECATED: Use changeset package instead +// RegisterCapabilities registers capabilities +var RegisterCapabilities = changeset.RegisterCapabilities + +// DEPRECATED: Use changeset package instead +// RegisterNOPSRequest is a request to register NOPS +type RegisterNOPSRequest = changeset.RegisterNOPSRequest + +// DEPRECATED: Use changeset package instead +// RegisterNOPSResponse is a response to register NOPS +type RegisterNOPSResponse = changeset.RegisterNOPSResponse + +// DEPRECATED: Use changeset package instead +// RegisterNOPS registers NOPS +var RegisterNOPS = changeset.RegisterNOPS + +// DEPRECATED: Use changeset package instead +// RegisterNodesRequest is a request to register nodes with the capabilities registry +type RegisterNodesRequest = changeset.RegisterNodesRequest + +// DEPRECATED: Use changeset package instead +// RegisterNodesResponse is a response to register nodes with the capabilities registry +type RegisterNodesResponse = changeset.RegisterNodesResponse + +// DEPRECATED: Use changeset package instead +// RegisterNodes registers nodes with the capabilities registry +var RegisterNodes = changeset.RegisterNodes + +// DEPRECATED: Use changeset package instead +// RegisteredCapability is a wrapper of a capability and its ID +type RegisteredCapability = changeset.RegisteredCapability + +// DEPRECATED: Use changeset package instead +// FromCapabilitiesRegistryCapability converts a capabilities registry capability to a registered capability +var FromCapabilitiesRegistryCapability = changeset.FromCapabilitiesRegistryCapability + +// DEPRECATED: Use changeset package instead +// RegisterDonsRequest is a request to register Dons with the capabilities registry +type RegisterDonsRequest = changeset.RegisterDonsRequest + +// DEPRECATED: Use changeset package instead +// RegisterDonsResponse is a response to register Dons with the capabilities registry +type RegisterDonsResponse = changeset.RegisterDonsResponse + +// DEPRECATED: Use changeset package instead +// RegisterDons registers Dons with the capabilities registry +var RegisterDons = changeset.RegisterDons + +// DEPRECATED: Use changeset package instead +// DONToRegister is the minimal information needed to register a DON with the capabilities registry +type DONToRegister = changeset.DONToRegister + +// DEPRECATED: Use changeset package instead +// ConfigureContractsRequest is a request to configure ALL the contracts +type ConfigureContractsRequest = changeset.ConfigureContractsRequest + +// DEPRECATED: Use changeset package instead +// ConfigureContractsResponse is a response to configure ALL the contracts +type ConfigureContractsResponse = changeset.ConfigureContractsResponse + +// DEPRECATED: Use changeset package instead +// DonCapabilities is a set of capabilities hosted by a set of node operators +// in is in a convenient form to handle the CLO representation of the nop data +type DonCapabilities = changeset.DonCapabilities + +// DEPRECATED: Use changeset package instead +type DeployRequest = changeset.DeployRequest + +// DEPRECATED: Use changeset package instead +type DeployResponse = changeset.DeployResponse + +// DEPRECATED: Use changeset package instead +type ContractSet = changeset.ContractSet diff --git a/deployment/keystone/test/changeset/capability_registry.go b/deployment/keystone/test/changeset/capability_registry.go index dad41415510..98f1e752f5a 100644 --- a/deployment/keystone/test/changeset/capability_registry.go +++ b/deployment/keystone/test/changeset/capability_registry.go @@ -7,8 +7,9 @@ import ( chainsel "github.com/smartcontractkit/chain-selectors" "github.com/smartcontractkit/chainlink/deployment" + "github.com/smartcontractkit/chainlink/deployment/common/view/v1_0" - "github.com/smartcontractkit/chainlink/deployment/keystone" + "github.com/smartcontractkit/chainlink/deployment/keystone/changeset" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/keystone/generated/capabilities_registry_1_1_0" ) @@ -33,7 +34,7 @@ func HydrateCapabilityRegistry(t *testing.T, v v1_0.CapabilityRegistryView, env return nil, fmt.Errorf("failed to deploy contract: %w", err) } - resp, err := keystone.GetContractSets(env.Logger, &keystone.GetContractSetsRequest{ + resp, err := changeset.GetContractSets(env.Logger, &changeset.GetContractSetsRequest{ Chains: env.Chains, AddressBook: changesetOutput.AddressBook, }) @@ -49,13 +50,13 @@ func HydrateCapabilityRegistry(t *testing.T, v v1_0.CapabilityRegistryView, env nopsParams := v.NopsToNopsParams() tx, err := deployedContract.AddNodeOperators(chain.DeployerKey, nopsParams) - if _, err = deployment.ConfirmIfNoError(chain, tx, keystone.DecodeErr(capabilities_registry.CapabilitiesRegistryABI, err)); err != nil { + if _, err = deployment.ConfirmIfNoError(chain, tx, deployment.DecodeErr(capabilities_registry.CapabilitiesRegistryABI, err)); err != nil { return nil, fmt.Errorf("failed to add node operators: %w", err) } capabilitiesParams := v.CapabilitiesToCapabilitiesParams() tx, err = deployedContract.AddCapabilities(chain.DeployerKey, capabilitiesParams) - if _, err = deployment.ConfirmIfNoError(chain, tx, keystone.DecodeErr(capabilities_registry.CapabilitiesRegistryABI, err)); err != nil { + if _, err = deployment.ConfirmIfNoError(chain, tx, deployment.DecodeErr(capabilities_registry.CapabilitiesRegistryABI, err)); err != nil { return nil, fmt.Errorf("failed to add capabilities: %w", err) } @@ -64,7 +65,7 @@ func HydrateCapabilityRegistry(t *testing.T, v v1_0.CapabilityRegistryView, env return nil, fmt.Errorf("failed to convert nodes to nodes params: %w", err) } tx, err = deployedContract.AddNodes(chain.DeployerKey, nodesParams) - if _, err = deployment.ConfirmIfNoError(chain, tx, keystone.DecodeErr(capabilities_registry.CapabilitiesRegistryABI, err)); err != nil { + if _, err = deployment.ConfirmIfNoError(chain, tx, deployment.DecodeErr(capabilities_registry.CapabilitiesRegistryABI, err)); err != nil { return nil, fmt.Errorf("failed to add nodes: %w", err) } @@ -78,7 +79,7 @@ func HydrateCapabilityRegistry(t *testing.T, v v1_0.CapabilityRegistryView, env peerIds = append(peerIds, id) } tx, err = deployedContract.AddDON(chain.DeployerKey, peerIds, cfgs, don.IsPublic, don.AcceptsWorkflows, don.F) - if _, err = deployment.ConfirmIfNoError(chain, tx, keystone.DecodeErr(capabilities_registry.CapabilitiesRegistryABI, err)); err != nil { + if _, err = deployment.ConfirmIfNoError(chain, tx, deployment.DecodeErr(capabilities_registry.CapabilitiesRegistryABI, err)); err != nil { return nil, fmt.Errorf("failed to add don: %w", err) } } diff --git a/go.mod b/go.mod index 4bfc5964ff7..8c3d465bfba 100644 --- a/go.mod +++ b/go.mod @@ -79,14 +79,14 @@ require ( github.com/smartcontractkit/chain-selectors v1.0.34 github.com/smartcontractkit/chainlink-automation v0.8.1 github.com/smartcontractkit/chainlink-ccip v0.0.0-20241218114855-f74219171000 - github.com/smartcontractkit/chainlink-common v0.4.1-0.20241217120918-bbe318cd0760 + github.com/smartcontractkit/chainlink-common v0.4.1-0.20241223143929-db7919d60550 github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241202195413-82468150ac1e github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20241216163550-fa030d178ba3 github.com/smartcontractkit/chainlink-feeds v0.1.1 github.com/smartcontractkit/chainlink-protos/orchestrator v0.4.0 - github.com/smartcontractkit/chainlink-solana v1.1.1-0.20241219173444-150f7443fdd3 + github.com/smartcontractkit/chainlink-solana v1.1.1-0.20241223151630-eac4f1508dce github.com/smartcontractkit/chainlink-starknet/relayer v0.1.1-0.20241202202529-2033490e77b8 - github.com/smartcontractkit/libocr v0.0.0-20241007185508-adbe57025f12 + github.com/smartcontractkit/libocr v0.0.0-20241223215956-e5b78d8e3919 github.com/smartcontractkit/tdh2/go/ocr2/decryptionplugin v0.0.0-20241009055228-33d0c0bf38de github.com/smartcontractkit/tdh2/go/tdh2 v0.0.0-20241009055228-33d0c0bf38de github.com/smartcontractkit/wsrpc v0.8.3 diff --git a/go.sum b/go.sum index c6f5b4a29e8..c185e1ad1d2 100644 --- a/go.sum +++ b/go.sum @@ -167,6 +167,8 @@ github.com/aws/aws-sdk-go v1.22.1/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN github.com/aws/aws-sdk-go v1.23.20/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= github.com/aws/aws-sdk-go v1.54.19 h1:tyWV+07jagrNiCcGRzRhdtVjQs7Vy41NwsuOcl0IbVI= github.com/aws/aws-sdk-go v1.54.19/go.mod h1:eRwEWoyTWFMVYVQzKMNHWP5/RV4xIUGMQfXQHfHkpNU= +github.com/aybabtme/rgbterm v0.0.0-20170906152045-cc83f3b3ce59 h1:WWB576BN5zNSZc/M9d/10pqEx5VHNhaQ/yOVAkmj5Yo= +github.com/aybabtme/rgbterm v0.0.0-20170906152045-cc83f3b3ce59/go.mod h1:q/89r3U2H7sSsE2t6Kca0lfwTK8JdoNGS/yzM/4iH5I= github.com/bahlo/generic-list-go v0.2.0 h1:5sz/EEAK+ls5wF+NeqDpk5+iNdMDXrh3z3nPnH1Wvgk= github.com/bahlo/generic-list-go v0.2.0/go.mod h1:2KvAjgMlE5NNynlg/5iLrrCCZ2+5xWbdbCW3pNTGyYg= github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= @@ -196,6 +198,8 @@ github.com/btcsuite/btcd/chaincfg/chainhash v1.1.0 h1:59Kx4K6lzOW5w6nFlA0v5+lk/6 github.com/btcsuite/btcd/chaincfg/chainhash v1.1.0/go.mod h1:7SFka0XMvUgj3hfZtydOrQY2mwhPclbT2snogU7SQQc= github.com/bufbuild/protocompile v0.4.0 h1:LbFKd2XowZvQ/kajzguUp2DC9UEIQhIq77fZZlaQsNA= github.com/bufbuild/protocompile v0.4.0/go.mod h1:3v93+mbWn/v3xzN+31nwkJfrEpAUwp+BagBSZWx+TP8= +github.com/buger/goterm v0.0.0-20200322175922-2f3e71b85129 h1:gfAMKE626QEuKG3si0pdTRcr/YEbBoxY+3GOH3gWvl4= +github.com/buger/goterm v0.0.0-20200322175922-2f3e71b85129/go.mod h1:u9UyCz2eTrSGy6fbupqJ54eY5c4IC8gREQ1053dK12U= github.com/buger/jsonparser v1.1.1 h1:2PnMjfWD7wBILjqQbt530v576A/cAbQvEW9gGIpYMUs= github.com/buger/jsonparser v1.1.1/go.mod h1:6RYKKt7H4d4+iWqouImQ9R2FZql3VbhNgx27UK13J/0= github.com/bytecodealliance/wasmtime-go/v23 v23.0.0 h1:NJvU4S8KEk1GnF6+FvlnzMD/8wXTj/mYJSG6Q4yu3Pw= @@ -406,6 +410,8 @@ github.com/gagliardetto/solana-go v1.8.4 h1:vmD/JmTlonyXGy39bAo0inMhmbdAwV7rXZtL github.com/gagliardetto/solana-go v1.8.4/go.mod h1:i+7aAyNDTHG0jK8GZIBSI4OVvDqkt2Qx+LklYclRNG8= github.com/gagliardetto/treeout v0.1.4 h1:ozeYerrLCmCubo1TcIjFiOWTTGteOOHND1twdFpgwaw= github.com/gagliardetto/treeout v0.1.4/go.mod h1:loUefvXTrlRG5rYmJmExNryyBRh8f89VZhmMOyCyqok= +github.com/gagliardetto/utilz v0.1.1 h1:/etW4hl607emKg6R6Lj9jRJ9d6ue2AQOyjhuAwjzs1U= +github.com/gagliardetto/utilz v0.1.1/go.mod h1:b+rGFkRHz3HWJD0RYMzat47JyvbTtpE0iEcYTRJTLLA= github.com/gballet/go-libpcsclite v0.0.0-20191108122812-4678299bea08 h1:f6D9Hr8xV8uYKlyuj8XIruxlh9WjVjdh1gIicAS7ays= github.com/gballet/go-libpcsclite v0.0.0-20191108122812-4678299bea08/go.mod h1:x7DCsMOv1taUwEWCzT4cmDeAkigA5/QCwUodaVOe8Ww= github.com/gedex/inflector v0.0.0-20170307190818-16278e9db813 h1:Uc+IZ7gYqAf/rSGFplbWBSHaGolEQlNLgMgSE3ccnIQ= @@ -654,6 +660,8 @@ github.com/gtank/merlin v0.1.1 h1:eQ90iG7K9pOhtereWsmyRJ6RAwcP4tHTDBHXNg+u5is= github.com/gtank/merlin v0.1.1/go.mod h1:T86dnYJhcGOh5BjZFCJWTDeTK7XW8uE+E21Cy/bIQ+s= github.com/gtank/ristretto255 v0.1.2 h1:JEqUCPA1NvLq5DwYtuzigd7ss8fwbYay9fi4/5uMzcc= github.com/gtank/ristretto255 v0.1.2/go.mod h1:Ph5OpO6c7xKUGROZfWVLiJf9icMDwUeIvY4OmlYW69o= +github.com/hako/durafmt v0.0.0-20200710122514-c0fb7b4da026 h1:BpJ2o0OR5FV7vrkDYfXYVJQeMNWa8RhklZOpW2ITAIQ= +github.com/hako/durafmt v0.0.0-20200710122514-c0fb7b4da026/go.mod h1:5Scbynm8dF1XAPwIwkGPqzkM/shndPm79Jd1003hTjE= github.com/hashicorp/consul/api v1.1.0/go.mod h1:VmuI/Lkw1nC05EYQWNKwWGbkg+FbDBtguAZLlVdkD9Q= github.com/hashicorp/consul/sdk v0.1.1/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= github.com/hashicorp/consul/sdk v0.16.0 h1:SE9m0W6DEfgIVCJX7xU+iv/hUl4m/nxqMTnCdMxDpJ8= @@ -905,6 +913,8 @@ github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5 github.com/mfridman/interpolate v0.0.2 h1:pnuTK7MQIxxFz1Gr+rjSIx9u7qVjf5VOoM/u6BbAxPY= github.com/mfridman/interpolate v0.0.2/go.mod h1:p+7uk6oE07mpE/Ik1b8EckO0O4ZXiGAfshKBWLUM9Xg= github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= +github.com/miekg/dns v1.1.61 h1:nLxbwF3XxhwVSm8g9Dghm9MHPaUZuqhPiGL+675ZmEs= +github.com/miekg/dns v1.1.61/go.mod h1:mnAarhS3nWaW+NVP2wTkYVIZyHNJ098SJZUki3eykwQ= github.com/mimoo/StrobeGo v0.0.0-20181016162300-f8f6d4d2b643/go.mod h1:43+3pMjjKimDBf5Kr4ZFNGbLql1zKkbImw+fZbw3geM= github.com/mimoo/StrobeGo v0.0.0-20210601165009-122bf33a46e0 h1:QRUSJEgZn2Snx0EmT/QLXibWjSUDjKWvXIT19NBVp94= github.com/mimoo/StrobeGo v0.0.0-20210601165009-122bf33a46e0/go.mod h1:43+3pMjjKimDBf5Kr4ZFNGbLql1zKkbImw+fZbw3geM= @@ -1096,6 +1106,8 @@ github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQD github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= +github.com/ryanuber/go-glob v1.0.0 h1:iQh3xXAumdQ+4Ufa5b25cRpC5TYKlno6hsv6Cb3pkBk= +github.com/ryanuber/go-glob v1.0.0/go.mod h1:807d1WSdnB0XRJzKNil9Om6lcp/3a0v4qIHxIXzX/Yc= github.com/sagikazarmark/locafero v0.4.0 h1:HApY1R9zGo4DBgr7dqsTH/JJxLTTsOt7u6keLGt6kNQ= github.com/sagikazarmark/locafero v0.4.0/go.mod h1:Pe1W6UlPYUk/+wc/6KFhbORCfqzgYEpgQ3O5fPuL3H4= github.com/sagikazarmark/slog-shim v0.1.0 h1:diDBnUNK9N/354PgrxMywXnAwEr1QZcOr6gto+ugjYE= @@ -1139,8 +1151,8 @@ github.com/smartcontractkit/chainlink-automation v0.8.1 h1:sTc9LKpBvcKPc1JDYAmgB github.com/smartcontractkit/chainlink-automation v0.8.1/go.mod h1:Iij36PvWZ6blrdC5A/nrQUBuf3MH3JvsBB9sSyc9W08= github.com/smartcontractkit/chainlink-ccip v0.0.0-20241218114855-f74219171000 h1:6Zzr/R1j6P7bbvcUlt5WUIbItvrrGdGzIsiAzQezcwo= github.com/smartcontractkit/chainlink-ccip v0.0.0-20241218114855-f74219171000/go.mod h1:ncjd6mPZSRlelEqH/2KeLE1pU3UlqzBSn8RYkEoECzY= -github.com/smartcontractkit/chainlink-common v0.4.1-0.20241217120918-bbe318cd0760 h1:lB5A3TP0zOVuu1n0kEm6d8/o/4Knh6HLvsU/GChk+sI= -github.com/smartcontractkit/chainlink-common v0.4.1-0.20241217120918-bbe318cd0760/go.mod h1:yti7e1+G9hhkYhj+L5sVUULn9Bn3bBL5/AxaNqdJ5YQ= +github.com/smartcontractkit/chainlink-common v0.4.1-0.20241223143929-db7919d60550 h1:rRs74zjDJ7do5aYEXSU/sOnLnlbYCNqM8BrvEx/0NH8= +github.com/smartcontractkit/chainlink-common v0.4.1-0.20241223143929-db7919d60550/go.mod h1:yti7e1+G9hhkYhj+L5sVUULn9Bn3bBL5/AxaNqdJ5YQ= github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241202195413-82468150ac1e h1:PRoeby6ZlTuTkv2f+7tVU4+zboTfRzI+beECynF4JQ0= github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241202195413-82468150ac1e/go.mod h1:mUh5/woemsVaHgTorA080hrYmO3syBCmPdnWc/5dOqk= github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20241216163550-fa030d178ba3 h1:aeiBdBHGY8QNftps+VqrIk6OnfeeOD5z4jrAabW4ZSc= @@ -1149,14 +1161,14 @@ github.com/smartcontractkit/chainlink-feeds v0.1.1 h1:JzvUOM/OgGQA1sOqTXXl52R6An github.com/smartcontractkit/chainlink-feeds v0.1.1/go.mod h1:55EZ94HlKCfAsUiKUTNI7QlE/3d3IwTlsU3YNa/nBb4= github.com/smartcontractkit/chainlink-protos/orchestrator v0.4.0 h1:ZBat8EBvE2LpSQR9U1gEbRV6PfAkiFdINmQ8nVnXIAQ= github.com/smartcontractkit/chainlink-protos/orchestrator v0.4.0/go.mod h1:m/A3lqD7ms/RsQ9BT5P2uceYY0QX5mIt4KQxT2G6qEo= -github.com/smartcontractkit/chainlink-solana v1.1.1-0.20241219173444-150f7443fdd3 h1:AIIiwrZ5T4nEjFT33aLZKoXwD63JSMu72wWe/rUdfm0= -github.com/smartcontractkit/chainlink-solana v1.1.1-0.20241219173444-150f7443fdd3/go.mod h1:ARILnIgKelP0YkVzxXO111S9j0b4uKyt7iLpYjOkCtU= +github.com/smartcontractkit/chainlink-solana v1.1.1-0.20241223151630-eac4f1508dce h1:Mvpbr/Fi2IdU2EcmqCxhlCzs5ncnx+BwV80YweA4DZs= +github.com/smartcontractkit/chainlink-solana v1.1.1-0.20241223151630-eac4f1508dce/go.mod h1:qq+nW0JDnCCGMf2c38ZHjH8xgkAQnXKighjJr5JdDNE= github.com/smartcontractkit/chainlink-starknet/relayer v0.1.1-0.20241202202529-2033490e77b8 h1:tNS7U9lrxkFvEuyxQv11HHOiV9LPDGC9wYEy+yM/Jv4= github.com/smartcontractkit/chainlink-starknet/relayer v0.1.1-0.20241202202529-2033490e77b8/go.mod h1:EBrEgcdIbwepqguClkv8Ohy7CbyWSJaE4EC9aBJlQK0= github.com/smartcontractkit/grpc-proxy v0.0.0-20240830132753-a7e17fec5ab7 h1:12ijqMM9tvYVEm+nR826WsrNi6zCKpwBhuApq127wHs= github.com/smartcontractkit/grpc-proxy v0.0.0-20240830132753-a7e17fec5ab7/go.mod h1:FX7/bVdoep147QQhsOPkYsPEXhGZjeYx6lBSaSXtZOA= -github.com/smartcontractkit/libocr v0.0.0-20241007185508-adbe57025f12 h1:NzZGjaqez21I3DU7objl3xExTH4fxYvzTqar8DC6360= -github.com/smartcontractkit/libocr v0.0.0-20241007185508-adbe57025f12/go.mod h1:fb1ZDVXACvu4frX3APHZaEBp0xi1DIm34DcA0CwTsZM= +github.com/smartcontractkit/libocr v0.0.0-20241223215956-e5b78d8e3919 h1:IpGoPTXpvllN38kT2z2j13sifJMz4nbHglidvop7mfg= +github.com/smartcontractkit/libocr v0.0.0-20241223215956-e5b78d8e3919/go.mod h1:fb1ZDVXACvu4frX3APHZaEBp0xi1DIm34DcA0CwTsZM= github.com/smartcontractkit/tdh2/go/ocr2/decryptionplugin v0.0.0-20241009055228-33d0c0bf38de h1:n0w0rKF+SVM+S3WNlup6uabXj2zFlFNfrlsKCMMb/co= github.com/smartcontractkit/tdh2/go/ocr2/decryptionplugin v0.0.0-20241009055228-33d0c0bf38de/go.mod h1:Sl2MF/Fp3fgJIVzhdGhmZZX2BlnM0oUUyBP4s4xYb6o= github.com/smartcontractkit/tdh2/go/tdh2 v0.0.0-20241009055228-33d0c0bf38de h1:66VQxXx3lvTaAZrMBkIcdH9VEjujUEvmBQdnyOJnkOc= diff --git a/integration-tests/go.mod b/integration-tests/go.mod index 0b6bacfd9b1..5b0f07eac72 100644 --- a/integration-tests/go.mod +++ b/integration-tests/go.mod @@ -47,14 +47,14 @@ require ( github.com/smartcontractkit/chain-selectors v1.0.34 github.com/smartcontractkit/chainlink-automation v0.8.1 github.com/smartcontractkit/chainlink-ccip v0.0.0-20241218114855-f74219171000 - github.com/smartcontractkit/chainlink-common v0.4.1-0.20241217120918-bbe318cd0760 + github.com/smartcontractkit/chainlink-common v0.4.1-0.20241223143929-db7919d60550 github.com/smartcontractkit/chainlink-protos/job-distributor v0.6.0 github.com/smartcontractkit/chainlink-testing-framework/havoc v1.50.2 github.com/smartcontractkit/chainlink-testing-framework/lib v1.50.19 github.com/smartcontractkit/chainlink-testing-framework/lib/grafana v1.50.0 github.com/smartcontractkit/chainlink-testing-framework/seth v1.50.9 github.com/smartcontractkit/chainlink-testing-framework/wasp v1.50.2 - github.com/smartcontractkit/libocr v0.0.0-20241007185508-adbe57025f12 + github.com/smartcontractkit/libocr v0.0.0-20241223215956-e5b78d8e3919 github.com/spf13/cobra v1.8.1 github.com/stretchr/testify v1.9.0 github.com/subosito/gotenv v1.6.0 @@ -428,7 +428,7 @@ require ( github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20241216163550-fa030d178ba3 // indirect github.com/smartcontractkit/chainlink-feeds v0.1.1 // indirect github.com/smartcontractkit/chainlink-protos/orchestrator v0.4.0 // indirect - github.com/smartcontractkit/chainlink-solana v1.1.1-0.20241219173444-150f7443fdd3 // indirect + github.com/smartcontractkit/chainlink-solana v1.1.1-0.20241223151630-eac4f1508dce // indirect github.com/smartcontractkit/chainlink-starknet/relayer v0.1.1-0.20241202202529-2033490e77b8 // indirect github.com/smartcontractkit/grpc-proxy v0.0.0-20240830132753-a7e17fec5ab7 // indirect github.com/smartcontractkit/tdh2/go/ocr2/decryptionplugin v0.0.0-20241009055228-33d0c0bf38de // indirect diff --git a/integration-tests/go.sum b/integration-tests/go.sum index b2101edcd73..1baff05f3f1 100644 --- a/integration-tests/go.sum +++ b/integration-tests/go.sum @@ -241,6 +241,8 @@ github.com/aws/jsii-runtime-go v1.104.0 h1:651Sh6J2FtatfnVzlOQ3/Ye1WWPAseZ6E/tSQ github.com/aws/jsii-runtime-go v1.104.0/go.mod h1:7ZmQXxV0AAhhvv/GaHX4n6zbgA1tSRVdnQYAJbIhXHk= github.com/aws/smithy-go v1.22.0 h1:uunKnWlcoL3zO7q+gG2Pk53joueEOsnNB28QdMsmiMM= github.com/aws/smithy-go v1.22.0/go.mod h1:irrKGvNn1InZwb2d7fkIRNucdfwR8R+Ts3wxYa/cJHg= +github.com/aybabtme/rgbterm v0.0.0-20170906152045-cc83f3b3ce59 h1:WWB576BN5zNSZc/M9d/10pqEx5VHNhaQ/yOVAkmj5Yo= +github.com/aybabtme/rgbterm v0.0.0-20170906152045-cc83f3b3ce59/go.mod h1:q/89r3U2H7sSsE2t6Kca0lfwTK8JdoNGS/yzM/4iH5I= github.com/bahlo/generic-list-go v0.2.0 h1:5sz/EEAK+ls5wF+NeqDpk5+iNdMDXrh3z3nPnH1Wvgk= github.com/bahlo/generic-list-go v0.2.0/go.mod h1:2KvAjgMlE5NNynlg/5iLrrCCZ2+5xWbdbCW3pNTGyYg= github.com/barkimedes/go-deepcopy v0.0.0-20220514131651-17c30cfc62df h1:GSoSVRLoBaFpOOds6QyY1L8AX7uoY+Ln3BHc22W40X0= @@ -276,6 +278,8 @@ github.com/btcsuite/btcd/chaincfg/chainhash v1.1.0 h1:59Kx4K6lzOW5w6nFlA0v5+lk/6 github.com/btcsuite/btcd/chaincfg/chainhash v1.1.0/go.mod h1:7SFka0XMvUgj3hfZtydOrQY2mwhPclbT2snogU7SQQc= github.com/bufbuild/protocompile v0.4.0 h1:LbFKd2XowZvQ/kajzguUp2DC9UEIQhIq77fZZlaQsNA= github.com/bufbuild/protocompile v0.4.0/go.mod h1:3v93+mbWn/v3xzN+31nwkJfrEpAUwp+BagBSZWx+TP8= +github.com/buger/goterm v0.0.0-20200322175922-2f3e71b85129 h1:gfAMKE626QEuKG3si0pdTRcr/YEbBoxY+3GOH3gWvl4= +github.com/buger/goterm v0.0.0-20200322175922-2f3e71b85129/go.mod h1:u9UyCz2eTrSGy6fbupqJ54eY5c4IC8gREQ1053dK12U= github.com/buger/jsonparser v1.1.1 h1:2PnMjfWD7wBILjqQbt530v576A/cAbQvEW9gGIpYMUs= github.com/buger/jsonparser v1.1.1/go.mod h1:6RYKKt7H4d4+iWqouImQ9R2FZql3VbhNgx27UK13J/0= github.com/bxcodec/faker v2.0.1+incompatible h1:P0KUpUw5w6WJXwrPfv35oc91i4d8nf40Nwln+M/+faA= @@ -545,6 +549,8 @@ github.com/gagliardetto/solana-go v1.8.4 h1:vmD/JmTlonyXGy39bAo0inMhmbdAwV7rXZtL github.com/gagliardetto/solana-go v1.8.4/go.mod h1:i+7aAyNDTHG0jK8GZIBSI4OVvDqkt2Qx+LklYclRNG8= github.com/gagliardetto/treeout v0.1.4 h1:ozeYerrLCmCubo1TcIjFiOWTTGteOOHND1twdFpgwaw= github.com/gagliardetto/treeout v0.1.4/go.mod h1:loUefvXTrlRG5rYmJmExNryyBRh8f89VZhmMOyCyqok= +github.com/gagliardetto/utilz v0.1.1 h1:/etW4hl607emKg6R6Lj9jRJ9d6ue2AQOyjhuAwjzs1U= +github.com/gagliardetto/utilz v0.1.1/go.mod h1:b+rGFkRHz3HWJD0RYMzat47JyvbTtpE0iEcYTRJTLLA= github.com/gballet/go-libpcsclite v0.0.0-20191108122812-4678299bea08 h1:f6D9Hr8xV8uYKlyuj8XIruxlh9WjVjdh1gIicAS7ays= github.com/gballet/go-libpcsclite v0.0.0-20191108122812-4678299bea08/go.mod h1:x7DCsMOv1taUwEWCzT4cmDeAkigA5/QCwUodaVOe8Ww= github.com/gedex/inflector v0.0.0-20170307190818-16278e9db813 h1:Uc+IZ7gYqAf/rSGFplbWBSHaGolEQlNLgMgSE3ccnIQ= @@ -840,6 +846,8 @@ github.com/gtank/merlin v0.1.1 h1:eQ90iG7K9pOhtereWsmyRJ6RAwcP4tHTDBHXNg+u5is= github.com/gtank/merlin v0.1.1/go.mod h1:T86dnYJhcGOh5BjZFCJWTDeTK7XW8uE+E21Cy/bIQ+s= github.com/gtank/ristretto255 v0.1.2 h1:JEqUCPA1NvLq5DwYtuzigd7ss8fwbYay9fi4/5uMzcc= github.com/gtank/ristretto255 v0.1.2/go.mod h1:Ph5OpO6c7xKUGROZfWVLiJf9icMDwUeIvY4OmlYW69o= +github.com/hako/durafmt v0.0.0-20200710122514-c0fb7b4da026 h1:BpJ2o0OR5FV7vrkDYfXYVJQeMNWa8RhklZOpW2ITAIQ= +github.com/hako/durafmt v0.0.0-20200710122514-c0fb7b4da026/go.mod h1:5Scbynm8dF1XAPwIwkGPqzkM/shndPm79Jd1003hTjE= github.com/hashicorp/consul/api v1.1.0/go.mod h1:VmuI/Lkw1nC05EYQWNKwWGbkg+FbDBtguAZLlVdkD9Q= github.com/hashicorp/consul/api v1.29.2 h1:aYyRn8EdE2mSfG14S1+L9Qkjtz8RzmaWh6AcNGRNwPw= github.com/hashicorp/consul/api v1.29.2/go.mod h1:0YObcaLNDSbtlgzIRtmRXI1ZkeuK0trCBxwZQ4MYnIk= @@ -1379,6 +1387,8 @@ github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQD github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= +github.com/ryanuber/go-glob v1.0.0 h1:iQh3xXAumdQ+4Ufa5b25cRpC5TYKlno6hsv6Cb3pkBk= +github.com/ryanuber/go-glob v1.0.0/go.mod h1:807d1WSdnB0XRJzKNil9Om6lcp/3a0v4qIHxIXzX/Yc= github.com/sagikazarmark/locafero v0.4.0 h1:HApY1R9zGo4DBgr7dqsTH/JJxLTTsOt7u6keLGt6kNQ= github.com/sagikazarmark/locafero v0.4.0/go.mod h1:Pe1W6UlPYUk/+wc/6KFhbORCfqzgYEpgQ3O5fPuL3H4= github.com/sagikazarmark/slog-shim v0.1.0 h1:diDBnUNK9N/354PgrxMywXnAwEr1QZcOr6gto+ugjYE= @@ -1438,8 +1448,8 @@ github.com/smartcontractkit/chainlink-automation v0.8.1 h1:sTc9LKpBvcKPc1JDYAmgB github.com/smartcontractkit/chainlink-automation v0.8.1/go.mod h1:Iij36PvWZ6blrdC5A/nrQUBuf3MH3JvsBB9sSyc9W08= github.com/smartcontractkit/chainlink-ccip v0.0.0-20241218114855-f74219171000 h1:6Zzr/R1j6P7bbvcUlt5WUIbItvrrGdGzIsiAzQezcwo= github.com/smartcontractkit/chainlink-ccip v0.0.0-20241218114855-f74219171000/go.mod h1:ncjd6mPZSRlelEqH/2KeLE1pU3UlqzBSn8RYkEoECzY= -github.com/smartcontractkit/chainlink-common v0.4.1-0.20241217120918-bbe318cd0760 h1:lB5A3TP0zOVuu1n0kEm6d8/o/4Knh6HLvsU/GChk+sI= -github.com/smartcontractkit/chainlink-common v0.4.1-0.20241217120918-bbe318cd0760/go.mod h1:yti7e1+G9hhkYhj+L5sVUULn9Bn3bBL5/AxaNqdJ5YQ= +github.com/smartcontractkit/chainlink-common v0.4.1-0.20241223143929-db7919d60550 h1:rRs74zjDJ7do5aYEXSU/sOnLnlbYCNqM8BrvEx/0NH8= +github.com/smartcontractkit/chainlink-common v0.4.1-0.20241223143929-db7919d60550/go.mod h1:yti7e1+G9hhkYhj+L5sVUULn9Bn3bBL5/AxaNqdJ5YQ= github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241202195413-82468150ac1e h1:PRoeby6ZlTuTkv2f+7tVU4+zboTfRzI+beECynF4JQ0= github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241202195413-82468150ac1e/go.mod h1:mUh5/woemsVaHgTorA080hrYmO3syBCmPdnWc/5dOqk= github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20241216163550-fa030d178ba3 h1:aeiBdBHGY8QNftps+VqrIk6OnfeeOD5z4jrAabW4ZSc= @@ -1450,8 +1460,8 @@ github.com/smartcontractkit/chainlink-protos/job-distributor v0.6.0 h1:0ewLMbAz3 github.com/smartcontractkit/chainlink-protos/job-distributor v0.6.0/go.mod h1:/dVVLXrsp+V0AbcYGJo3XMzKg3CkELsweA/TTopCsKE= github.com/smartcontractkit/chainlink-protos/orchestrator v0.4.0 h1:ZBat8EBvE2LpSQR9U1gEbRV6PfAkiFdINmQ8nVnXIAQ= github.com/smartcontractkit/chainlink-protos/orchestrator v0.4.0/go.mod h1:m/A3lqD7ms/RsQ9BT5P2uceYY0QX5mIt4KQxT2G6qEo= -github.com/smartcontractkit/chainlink-solana v1.1.1-0.20241219173444-150f7443fdd3 h1:AIIiwrZ5T4nEjFT33aLZKoXwD63JSMu72wWe/rUdfm0= -github.com/smartcontractkit/chainlink-solana v1.1.1-0.20241219173444-150f7443fdd3/go.mod h1:ARILnIgKelP0YkVzxXO111S9j0b4uKyt7iLpYjOkCtU= +github.com/smartcontractkit/chainlink-solana v1.1.1-0.20241223151630-eac4f1508dce h1:Mvpbr/Fi2IdU2EcmqCxhlCzs5ncnx+BwV80YweA4DZs= +github.com/smartcontractkit/chainlink-solana v1.1.1-0.20241223151630-eac4f1508dce/go.mod h1:qq+nW0JDnCCGMf2c38ZHjH8xgkAQnXKighjJr5JdDNE= github.com/smartcontractkit/chainlink-starknet/relayer v0.1.1-0.20241202202529-2033490e77b8 h1:tNS7U9lrxkFvEuyxQv11HHOiV9LPDGC9wYEy+yM/Jv4= github.com/smartcontractkit/chainlink-starknet/relayer v0.1.1-0.20241202202529-2033490e77b8/go.mod h1:EBrEgcdIbwepqguClkv8Ohy7CbyWSJaE4EC9aBJlQK0= github.com/smartcontractkit/chainlink-testing-framework/havoc v1.50.2 h1:GDGrC5OGiV0RyM1znYWehSQXyZQWTOzrEeJRYmysPCE= @@ -1466,8 +1476,8 @@ github.com/smartcontractkit/chainlink-testing-framework/wasp v1.50.2 h1:7bCdbTUW github.com/smartcontractkit/chainlink-testing-framework/wasp v1.50.2/go.mod h1:MltlNu3jcXm/DyLN98I5TFNtu/o1NNAcaPAFKMXWk70= github.com/smartcontractkit/grpc-proxy v0.0.0-20240830132753-a7e17fec5ab7 h1:12ijqMM9tvYVEm+nR826WsrNi6zCKpwBhuApq127wHs= github.com/smartcontractkit/grpc-proxy v0.0.0-20240830132753-a7e17fec5ab7/go.mod h1:FX7/bVdoep147QQhsOPkYsPEXhGZjeYx6lBSaSXtZOA= -github.com/smartcontractkit/libocr v0.0.0-20241007185508-adbe57025f12 h1:NzZGjaqez21I3DU7objl3xExTH4fxYvzTqar8DC6360= -github.com/smartcontractkit/libocr v0.0.0-20241007185508-adbe57025f12/go.mod h1:fb1ZDVXACvu4frX3APHZaEBp0xi1DIm34DcA0CwTsZM= +github.com/smartcontractkit/libocr v0.0.0-20241223215956-e5b78d8e3919 h1:IpGoPTXpvllN38kT2z2j13sifJMz4nbHglidvop7mfg= +github.com/smartcontractkit/libocr v0.0.0-20241223215956-e5b78d8e3919/go.mod h1:fb1ZDVXACvu4frX3APHZaEBp0xi1DIm34DcA0CwTsZM= github.com/smartcontractkit/tdh2/go/ocr2/decryptionplugin v0.0.0-20241009055228-33d0c0bf38de h1:n0w0rKF+SVM+S3WNlup6uabXj2zFlFNfrlsKCMMb/co= github.com/smartcontractkit/tdh2/go/ocr2/decryptionplugin v0.0.0-20241009055228-33d0c0bf38de/go.mod h1:Sl2MF/Fp3fgJIVzhdGhmZZX2BlnM0oUUyBP4s4xYb6o= github.com/smartcontractkit/tdh2/go/tdh2 v0.0.0-20241009055228-33d0c0bf38de h1:66VQxXx3lvTaAZrMBkIcdH9VEjujUEvmBQdnyOJnkOc= diff --git a/integration-tests/load/go.mod b/integration-tests/load/go.mod index 7f4888dcab8..54f5c05fbaf 100644 --- a/integration-tests/load/go.mod +++ b/integration-tests/load/go.mod @@ -27,7 +27,7 @@ require ( github.com/pkg/errors v0.9.1 github.com/rs/zerolog v1.33.0 github.com/slack-go/slack v0.15.0 - github.com/smartcontractkit/chainlink-common v0.4.1-0.20241217120918-bbe318cd0760 + github.com/smartcontractkit/chainlink-common v0.4.1-0.20241223143929-db7919d60550 github.com/smartcontractkit/chainlink-testing-framework/lib v1.50.19 github.com/smartcontractkit/chainlink-testing-framework/seth v1.50.9 github.com/smartcontractkit/chainlink-testing-framework/wasp v1.50.2 @@ -412,12 +412,12 @@ require ( github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20241216163550-fa030d178ba3 // indirect github.com/smartcontractkit/chainlink-feeds v0.1.1 // indirect github.com/smartcontractkit/chainlink-protos/orchestrator v0.4.0 // indirect - github.com/smartcontractkit/chainlink-solana v1.1.1-0.20241219173444-150f7443fdd3 // indirect + github.com/smartcontractkit/chainlink-solana v1.1.1-0.20241223151630-eac4f1508dce // indirect github.com/smartcontractkit/chainlink-starknet/relayer v0.1.1-0.20241202202529-2033490e77b8 // indirect github.com/smartcontractkit/chainlink-testing-framework/havoc v1.50.2 // indirect github.com/smartcontractkit/chainlink-testing-framework/lib/grafana v1.50.0 // indirect github.com/smartcontractkit/grpc-proxy v0.0.0-20240830132753-a7e17fec5ab7 // indirect - github.com/smartcontractkit/libocr v0.0.0-20241007185508-adbe57025f12 // indirect + github.com/smartcontractkit/libocr v0.0.0-20241223215956-e5b78d8e3919 // indirect github.com/smartcontractkit/tdh2/go/ocr2/decryptionplugin v0.0.0-20241009055228-33d0c0bf38de // indirect github.com/smartcontractkit/wsrpc v0.8.3 // indirect github.com/soheilhy/cmux v0.1.5 // indirect diff --git a/integration-tests/load/go.sum b/integration-tests/load/go.sum index bb187d252b5..48bdf1cb5b1 100644 --- a/integration-tests/load/go.sum +++ b/integration-tests/load/go.sum @@ -245,6 +245,8 @@ github.com/aws/jsii-runtime-go v1.104.0 h1:651Sh6J2FtatfnVzlOQ3/Ye1WWPAseZ6E/tSQ github.com/aws/jsii-runtime-go v1.104.0/go.mod h1:7ZmQXxV0AAhhvv/GaHX4n6zbgA1tSRVdnQYAJbIhXHk= github.com/aws/smithy-go v1.22.0 h1:uunKnWlcoL3zO7q+gG2Pk53joueEOsnNB28QdMsmiMM= github.com/aws/smithy-go v1.22.0/go.mod h1:irrKGvNn1InZwb2d7fkIRNucdfwR8R+Ts3wxYa/cJHg= +github.com/aybabtme/rgbterm v0.0.0-20170906152045-cc83f3b3ce59 h1:WWB576BN5zNSZc/M9d/10pqEx5VHNhaQ/yOVAkmj5Yo= +github.com/aybabtme/rgbterm v0.0.0-20170906152045-cc83f3b3ce59/go.mod h1:q/89r3U2H7sSsE2t6Kca0lfwTK8JdoNGS/yzM/4iH5I= github.com/bahlo/generic-list-go v0.2.0 h1:5sz/EEAK+ls5wF+NeqDpk5+iNdMDXrh3z3nPnH1Wvgk= github.com/bahlo/generic-list-go v0.2.0/go.mod h1:2KvAjgMlE5NNynlg/5iLrrCCZ2+5xWbdbCW3pNTGyYg= github.com/barkimedes/go-deepcopy v0.0.0-20220514131651-17c30cfc62df h1:GSoSVRLoBaFpOOds6QyY1L8AX7uoY+Ln3BHc22W40X0= @@ -280,6 +282,8 @@ github.com/btcsuite/btcd/chaincfg/chainhash v1.1.0 h1:59Kx4K6lzOW5w6nFlA0v5+lk/6 github.com/btcsuite/btcd/chaincfg/chainhash v1.1.0/go.mod h1:7SFka0XMvUgj3hfZtydOrQY2mwhPclbT2snogU7SQQc= github.com/bufbuild/protocompile v0.4.0 h1:LbFKd2XowZvQ/kajzguUp2DC9UEIQhIq77fZZlaQsNA= github.com/bufbuild/protocompile v0.4.0/go.mod h1:3v93+mbWn/v3xzN+31nwkJfrEpAUwp+BagBSZWx+TP8= +github.com/buger/goterm v0.0.0-20200322175922-2f3e71b85129 h1:gfAMKE626QEuKG3si0pdTRcr/YEbBoxY+3GOH3gWvl4= +github.com/buger/goterm v0.0.0-20200322175922-2f3e71b85129/go.mod h1:u9UyCz2eTrSGy6fbupqJ54eY5c4IC8gREQ1053dK12U= github.com/buger/jsonparser v1.1.1 h1:2PnMjfWD7wBILjqQbt530v576A/cAbQvEW9gGIpYMUs= github.com/buger/jsonparser v1.1.1/go.mod h1:6RYKKt7H4d4+iWqouImQ9R2FZql3VbhNgx27UK13J/0= github.com/bxcodec/faker v2.0.1+incompatible h1:P0KUpUw5w6WJXwrPfv35oc91i4d8nf40Nwln+M/+faA= @@ -539,6 +543,8 @@ github.com/gagliardetto/solana-go v1.8.4 h1:vmD/JmTlonyXGy39bAo0inMhmbdAwV7rXZtL github.com/gagliardetto/solana-go v1.8.4/go.mod h1:i+7aAyNDTHG0jK8GZIBSI4OVvDqkt2Qx+LklYclRNG8= github.com/gagliardetto/treeout v0.1.4 h1:ozeYerrLCmCubo1TcIjFiOWTTGteOOHND1twdFpgwaw= github.com/gagliardetto/treeout v0.1.4/go.mod h1:loUefvXTrlRG5rYmJmExNryyBRh8f89VZhmMOyCyqok= +github.com/gagliardetto/utilz v0.1.1 h1:/etW4hl607emKg6R6Lj9jRJ9d6ue2AQOyjhuAwjzs1U= +github.com/gagliardetto/utilz v0.1.1/go.mod h1:b+rGFkRHz3HWJD0RYMzat47JyvbTtpE0iEcYTRJTLLA= github.com/gballet/go-libpcsclite v0.0.0-20191108122812-4678299bea08 h1:f6D9Hr8xV8uYKlyuj8XIruxlh9WjVjdh1gIicAS7ays= github.com/gballet/go-libpcsclite v0.0.0-20191108122812-4678299bea08/go.mod h1:x7DCsMOv1taUwEWCzT4cmDeAkigA5/QCwUodaVOe8Ww= github.com/gedex/inflector v0.0.0-20170307190818-16278e9db813 h1:Uc+IZ7gYqAf/rSGFplbWBSHaGolEQlNLgMgSE3ccnIQ= @@ -838,6 +844,8 @@ github.com/gtank/merlin v0.1.1 h1:eQ90iG7K9pOhtereWsmyRJ6RAwcP4tHTDBHXNg+u5is= github.com/gtank/merlin v0.1.1/go.mod h1:T86dnYJhcGOh5BjZFCJWTDeTK7XW8uE+E21Cy/bIQ+s= github.com/gtank/ristretto255 v0.1.2 h1:JEqUCPA1NvLq5DwYtuzigd7ss8fwbYay9fi4/5uMzcc= github.com/gtank/ristretto255 v0.1.2/go.mod h1:Ph5OpO6c7xKUGROZfWVLiJf9icMDwUeIvY4OmlYW69o= +github.com/hako/durafmt v0.0.0-20200710122514-c0fb7b4da026 h1:BpJ2o0OR5FV7vrkDYfXYVJQeMNWa8RhklZOpW2ITAIQ= +github.com/hako/durafmt v0.0.0-20200710122514-c0fb7b4da026/go.mod h1:5Scbynm8dF1XAPwIwkGPqzkM/shndPm79Jd1003hTjE= github.com/hashicorp/consul/api v1.1.0/go.mod h1:VmuI/Lkw1nC05EYQWNKwWGbkg+FbDBtguAZLlVdkD9Q= github.com/hashicorp/consul/api v1.29.2 h1:aYyRn8EdE2mSfG14S1+L9Qkjtz8RzmaWh6AcNGRNwPw= github.com/hashicorp/consul/api v1.29.2/go.mod h1:0YObcaLNDSbtlgzIRtmRXI1ZkeuK0trCBxwZQ4MYnIk= @@ -1369,6 +1377,8 @@ github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQD github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= +github.com/ryanuber/go-glob v1.0.0 h1:iQh3xXAumdQ+4Ufa5b25cRpC5TYKlno6hsv6Cb3pkBk= +github.com/ryanuber/go-glob v1.0.0/go.mod h1:807d1WSdnB0XRJzKNil9Om6lcp/3a0v4qIHxIXzX/Yc= github.com/sagikazarmark/locafero v0.4.0 h1:HApY1R9zGo4DBgr7dqsTH/JJxLTTsOt7u6keLGt6kNQ= github.com/sagikazarmark/locafero v0.4.0/go.mod h1:Pe1W6UlPYUk/+wc/6KFhbORCfqzgYEpgQ3O5fPuL3H4= github.com/sagikazarmark/slog-shim v0.1.0 h1:diDBnUNK9N/354PgrxMywXnAwEr1QZcOr6gto+ugjYE= @@ -1429,8 +1439,8 @@ github.com/smartcontractkit/chainlink-automation v0.8.1 h1:sTc9LKpBvcKPc1JDYAmgB github.com/smartcontractkit/chainlink-automation v0.8.1/go.mod h1:Iij36PvWZ6blrdC5A/nrQUBuf3MH3JvsBB9sSyc9W08= github.com/smartcontractkit/chainlink-ccip v0.0.0-20241218114855-f74219171000 h1:6Zzr/R1j6P7bbvcUlt5WUIbItvrrGdGzIsiAzQezcwo= github.com/smartcontractkit/chainlink-ccip v0.0.0-20241218114855-f74219171000/go.mod h1:ncjd6mPZSRlelEqH/2KeLE1pU3UlqzBSn8RYkEoECzY= -github.com/smartcontractkit/chainlink-common v0.4.1-0.20241217120918-bbe318cd0760 h1:lB5A3TP0zOVuu1n0kEm6d8/o/4Knh6HLvsU/GChk+sI= -github.com/smartcontractkit/chainlink-common v0.4.1-0.20241217120918-bbe318cd0760/go.mod h1:yti7e1+G9hhkYhj+L5sVUULn9Bn3bBL5/AxaNqdJ5YQ= +github.com/smartcontractkit/chainlink-common v0.4.1-0.20241223143929-db7919d60550 h1:rRs74zjDJ7do5aYEXSU/sOnLnlbYCNqM8BrvEx/0NH8= +github.com/smartcontractkit/chainlink-common v0.4.1-0.20241223143929-db7919d60550/go.mod h1:yti7e1+G9hhkYhj+L5sVUULn9Bn3bBL5/AxaNqdJ5YQ= github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241202195413-82468150ac1e h1:PRoeby6ZlTuTkv2f+7tVU4+zboTfRzI+beECynF4JQ0= github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241202195413-82468150ac1e/go.mod h1:mUh5/woemsVaHgTorA080hrYmO3syBCmPdnWc/5dOqk= github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20241216163550-fa030d178ba3 h1:aeiBdBHGY8QNftps+VqrIk6OnfeeOD5z4jrAabW4ZSc= @@ -1441,8 +1451,8 @@ github.com/smartcontractkit/chainlink-protos/job-distributor v0.6.0 h1:0ewLMbAz3 github.com/smartcontractkit/chainlink-protos/job-distributor v0.6.0/go.mod h1:/dVVLXrsp+V0AbcYGJo3XMzKg3CkELsweA/TTopCsKE= github.com/smartcontractkit/chainlink-protos/orchestrator v0.4.0 h1:ZBat8EBvE2LpSQR9U1gEbRV6PfAkiFdINmQ8nVnXIAQ= github.com/smartcontractkit/chainlink-protos/orchestrator v0.4.0/go.mod h1:m/A3lqD7ms/RsQ9BT5P2uceYY0QX5mIt4KQxT2G6qEo= -github.com/smartcontractkit/chainlink-solana v1.1.1-0.20241219173444-150f7443fdd3 h1:AIIiwrZ5T4nEjFT33aLZKoXwD63JSMu72wWe/rUdfm0= -github.com/smartcontractkit/chainlink-solana v1.1.1-0.20241219173444-150f7443fdd3/go.mod h1:ARILnIgKelP0YkVzxXO111S9j0b4uKyt7iLpYjOkCtU= +github.com/smartcontractkit/chainlink-solana v1.1.1-0.20241223151630-eac4f1508dce h1:Mvpbr/Fi2IdU2EcmqCxhlCzs5ncnx+BwV80YweA4DZs= +github.com/smartcontractkit/chainlink-solana v1.1.1-0.20241223151630-eac4f1508dce/go.mod h1:qq+nW0JDnCCGMf2c38ZHjH8xgkAQnXKighjJr5JdDNE= github.com/smartcontractkit/chainlink-starknet/relayer v0.1.1-0.20241202202529-2033490e77b8 h1:tNS7U9lrxkFvEuyxQv11HHOiV9LPDGC9wYEy+yM/Jv4= github.com/smartcontractkit/chainlink-starknet/relayer v0.1.1-0.20241202202529-2033490e77b8/go.mod h1:EBrEgcdIbwepqguClkv8Ohy7CbyWSJaE4EC9aBJlQK0= github.com/smartcontractkit/chainlink-testing-framework/havoc v1.50.2 h1:GDGrC5OGiV0RyM1znYWehSQXyZQWTOzrEeJRYmysPCE= @@ -1457,8 +1467,8 @@ github.com/smartcontractkit/chainlink-testing-framework/wasp v1.50.2 h1:7bCdbTUW github.com/smartcontractkit/chainlink-testing-framework/wasp v1.50.2/go.mod h1:MltlNu3jcXm/DyLN98I5TFNtu/o1NNAcaPAFKMXWk70= github.com/smartcontractkit/grpc-proxy v0.0.0-20240830132753-a7e17fec5ab7 h1:12ijqMM9tvYVEm+nR826WsrNi6zCKpwBhuApq127wHs= github.com/smartcontractkit/grpc-proxy v0.0.0-20240830132753-a7e17fec5ab7/go.mod h1:FX7/bVdoep147QQhsOPkYsPEXhGZjeYx6lBSaSXtZOA= -github.com/smartcontractkit/libocr v0.0.0-20241007185508-adbe57025f12 h1:NzZGjaqez21I3DU7objl3xExTH4fxYvzTqar8DC6360= -github.com/smartcontractkit/libocr v0.0.0-20241007185508-adbe57025f12/go.mod h1:fb1ZDVXACvu4frX3APHZaEBp0xi1DIm34DcA0CwTsZM= +github.com/smartcontractkit/libocr v0.0.0-20241223215956-e5b78d8e3919 h1:IpGoPTXpvllN38kT2z2j13sifJMz4nbHglidvop7mfg= +github.com/smartcontractkit/libocr v0.0.0-20241223215956-e5b78d8e3919/go.mod h1:fb1ZDVXACvu4frX3APHZaEBp0xi1DIm34DcA0CwTsZM= github.com/smartcontractkit/tdh2/go/ocr2/decryptionplugin v0.0.0-20241009055228-33d0c0bf38de h1:n0w0rKF+SVM+S3WNlup6uabXj2zFlFNfrlsKCMMb/co= github.com/smartcontractkit/tdh2/go/ocr2/decryptionplugin v0.0.0-20241009055228-33d0c0bf38de/go.mod h1:Sl2MF/Fp3fgJIVzhdGhmZZX2BlnM0oUUyBP4s4xYb6o= github.com/smartcontractkit/tdh2/go/tdh2 v0.0.0-20241009055228-33d0c0bf38de h1:66VQxXx3lvTaAZrMBkIcdH9VEjujUEvmBQdnyOJnkOc=