Skip to content

Commit

Permalink
Merge branch 'develop' into feature/re-1696-add-ci-lint-chaincli
Browse files Browse the repository at this point in the history
  • Loading branch information
momentmaker authored Oct 10, 2023
2 parents 5bb5966 + 5e51734 commit ad85da9
Show file tree
Hide file tree
Showing 572 changed files with 17,291 additions and 10,050 deletions.
2 changes: 1 addition & 1 deletion .github/actions/build-test-image/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ runs:
file: ./integration-tests/test.Dockerfile
build-args: |
BASE_IMAGE=${{ inputs.QA_AWS_ACCOUNT_NUMBER }}.dkr.ecr.${{ inputs.QA_AWS_REGION }}.amazonaws.com/test-base-image
IMAGE_VERSION=v0.32.9
IMAGE_VERSION=v0.38.2
SUITES="${{ inputs.suites }}"
AWS_REGION: ${{ inputs.QA_AWS_REGION }}
AWS_ROLE_TO_ASSUME: ${{ inputs.QA_AWS_ROLE_TO_ASSUME }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/automation-benchmark-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
description: Chainlink image version to use
required: true
type: string
default: 2.0.0
default: 2.5.0
chainlinkImage:
description: Chainlink image repo to use
required: true
Expand Down
27 changes: 20 additions & 7 deletions .github/workflows/automation-ondemand-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,16 @@ on:
description: Chainlink image repo to use (Leave empty to build from head/ref)
required: false
type: string
chainlinkVersionUpdate:
description: Chainlink image version to use initially for upgrade test
default: latest
required: true
type: string
chainlinkImageUpdate:
description: Chainlink image repo to use initially for upgrade test
required: true
default: public.ecr.aws/chainlink/chainlink
type: string

env:
ENV_JOB_IMAGE: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }}.dkr.ecr.${{ secrets.QA_AWS_REGION }}.amazonaws.com/chainlink-tests:${{ github.sha }}
Expand Down Expand Up @@ -130,8 +140,8 @@ jobs:
command: -run ^TestAutomationReorg$ ./reorg
- name: upgrade
suite: smoke
nodes: 1
os: ubuntu-latest
nodes: 3
os: ubuntu20.04-8cores-32GB
pyroscope_env: ci-automation-on-demand-upgrade
network: SIMULATED
command: -run ^TestAutomationNodeUpgrade$ ./smoke
Expand All @@ -150,14 +160,16 @@ jobs:
echo "image=${{ env.CHAINLINK_IMAGE }}" >>$GITHUB_OUTPUT
echo "version=${{ github.sha }}" >>$GITHUB_OUTPUT
echo "upgrade_version=${{ github.sha }}" >>$GITHUB_OUTPUT
echo "upgrade_image=${{ env.CHAINLINK_IMAGE }}" >>$GITHUB_OUTPUT
else
echo "image=${{ inputs.chainlinkImage }}" >>$GITHUB_OUTPUT
echo "version=${{ inputs.chainlinkVersion }}" >>$GITHUB_OUTPUT
echo "upgrade_version=${{ inputs.chainlinkVersion }}" >>$GITHUB_OUTPUT
echo "upgrade_image=${{ inputs.chainlinkImage }}" >>$GITHUB_OUTPUT
fi
if [[ "${{ matrix.tests.name }}" == "upgrade" ]]; then
echo "image=${{ env.CHAINLINK_IMAGE }}" >>$GITHUB_OUTPUT
echo "version=develop" >>$GITHUB_OUTPUT
echo "image=${{ inputs.chainlinkImageUpdate }}" >>$GITHUB_OUTPUT
echo "version=${{ inputs.chainlinkVersionUpdate }}" >>$GITHUB_OUTPUT
fi
- name: Run Tests
uses: smartcontractkit/chainlink-github-actions/chainlink-testing-framework/run-tests@eccde1970eca69f079d3efb3409938a72ade8497 # v2.2.13
Expand All @@ -167,13 +179,14 @@ jobs:
PYROSCOPE_KEY: ${{ secrets.QA_PYROSCOPE_KEY }}
SELECTED_NETWORKS: ${{ matrix.tests.network }}
TEST_SUITE: ${{ matrix.tests.suite }}
TEST_UPGRADE_VERSION: ${{ steps.determine-build.outputs.upgrade_version }}
TEST_UPGRADE_IMAGE: ${{ env.CHAINLINK_IMAGE }}
UPGRADE_VERSION: ${{ steps.determine-build.outputs.upgrade_version }}
UPGRADE_IMAGE: ${{ steps.determine-build.outputs.upgrade_image }}
with:
test_command_to_run: make test_need_operator_assets && cd ./integration-tests && go test -timeout 30m -count=1 -json -test.parallel=${{ matrix.tests.nodes }} ${{ matrix.tests.command }} 2>&1 | tee /tmp/gotest.log | gotestfmt
test_command_to_run: make test_need_operator_assets && cd ./integration-tests && go test -timeout 60m -count=1 -json -test.parallel=${{ matrix.tests.nodes }} ${{ matrix.tests.command }} 2>&1 | tee /tmp/gotest.log | gotestfmt
test_download_vendor_packages_command: cd ./integration-tests && go mod download
cl_repo: ${{ steps.determine-build.outputs.image }}
cl_image_tag: ${{ steps.determine-build.outputs.version }}
aws_registries: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }}
artifacts_location: ./integration-tests/${{ matrix.tests.suite }}/logs
publish_check_name: Automation On Demand Results ${{ matrix.tests.name }}
token: ${{ secrets.GITHUB_TOKEN }}
Expand Down
9 changes: 6 additions & 3 deletions .github/workflows/ci-core.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ jobs:
- name: Download Go vendor packages
run: go mod download
- name: Build binary
run: go build -tags test -o chainlink.test .
run: go build -o chainlink.test .
- name: Setup DB
run: ./chainlink.test local db preparetest
- name: Increase Race Timeout
Expand All @@ -75,11 +75,14 @@ jobs:
USE_TEE: false
run: ./tools/bin/${{ matrix.cmd }} ./...
- name: Print Filtered Test Results
if: failure()
if: ${{ failure() && matrix.cmd == 'go_core_tests' }}
uses: smartcontractkit/chainlink-github-actions/go/go-test-results-parsing@eccde1970eca69f079d3efb3409938a72ade8497 # v2.2.13
with:
results-file: ./output.txt
output-file: ./output-short.txt
- name: Print Races
if: ${{ failure() && matrix.cmd == 'go_core_race_tests' }}
run: find race.* | xargs cat
- name: Store logs artifacts
if: always()
uses: actions/upload-artifact@3cea5372237819ed00197afe530f5a7ea3e805c8 # v3.1.0
Expand Down Expand Up @@ -138,7 +141,7 @@ jobs:
- name: Download Go vendor packages
run: go mod download
- name: Build binary
run: go build -tags test -o chainlink.test .
run: go build -o chainlink.test .
- name: Setup DB
run: ./chainlink.test local db preparetest
- name: Load test outputs
Expand Down
28 changes: 24 additions & 4 deletions .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -449,8 +449,8 @@ jobs:
CHAINLINK_COMMIT_SHA: ${{ github.sha }}
CHAINLINK_ENV_USER: ${{ github.actor }}
CHAINLINK_IMAGE: public.ecr.aws/chainlink/chainlink
TEST_UPGRADE_VERSION: ${{ github.sha }}
TEST_UPGRADE_IMAGE: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }}.dkr.ecr.${{ secrets.QA_AWS_REGION }}.amazonaws.com/chainlink
UPGRADE_VERSION: ${{ github.sha }}
UPGRADE_IMAGE: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }}.dkr.ecr.${{ secrets.QA_AWS_REGION }}.amazonaws.com/chainlink
TEST_LOG_LEVEL: debug
TEST_SUITE: migration
steps:
Expand Down Expand Up @@ -663,7 +663,7 @@ jobs:
- run: echo "this exists so we don't have to run anything else if the build is skipped"
if: needs.changes.outputs.src == 'false' || needs.solana-test-image-exists.outputs.exists == 'true'

solana-smoke-tests:
solana-smoke-tests-matrix:
if: ${{ !contains(join(github.event.pull_request.labels.*.name, ' '), 'skip-smoke-tests') }}
environment: integration
permissions:
Expand All @@ -674,7 +674,7 @@ jobs:
strategy:
matrix:
image:
- name: ""
- name: (legacy)
tag-suffix: ""
- name: (plugins)
tag-suffix: -plugins
Expand Down Expand Up @@ -732,6 +732,26 @@ jobs:
path: /tmp/gotest.log
retention-days: 7
continue-on-error: true

### Used to check the required checks box when the matrix completes
solana-smoke-tests:
if: always()
runs-on: ubuntu-latest
name: Solana Smoke Tests
needs: [solana-smoke-tests-matrix]
steps:
- name: Check smoke test matrix status
if: needs.solana-smoke-tests-matrix.result != 'success'
run: exit 1
- name: Collect Metrics
if: always()
id: collect-gha-metrics
uses: smartcontractkit/push-gha-metrics-action@d2c2b7bdc9012651230b2608a1bcb0c48538b6ec
with:
basic-auth: ${{ secrets.GRAFANA_CLOUD_BASIC_AUTH }}
hostname: ${{ secrets.GRAFANA_CLOUD_HOST }}
this-job-name: Solana Smoke Tests
continue-on-error: true
### End Solana Section

### Start Live Testnet Section
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint-gh-workflows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
- name: Check out Code
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
- name: Run actionlint
uses: reviewdog/action-actionlint@17ea0452ae2cd009a22ca629732a9ce7f49a55e6 # v1.39.0
uses: reviewdog/action-actionlint@82693e9e3b239f213108d6e412506f8b54003586 # v1.39.1
- name: Collect Metrics
if: always()
id: collect-gha-metrics
Expand Down
116 changes: 116 additions & 0 deletions .github/workflows/on-demand-vrfv2plus-load-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
name: On Demand VRFV2 Plus Load Test
on:
workflow_dispatch:
inputs:
network:
description: Network to run tests on
type: choice
options:
- "ETHEREUM_MAINNET"
- "SIMULATED"
- "SEPOLIA"
- "OPTIMISM_MAINNET"
- "OPTIMISM_GOERLI"
- "ARBITRUM_MAINNET"
- "ARBITRUM_GOERLI"
- "BSC_MAINNET"
- "BSC_TESTNET"
- "POLYGON_MAINNET"
- "MUMBAI"
- "AVALANCHE_FUJI"
- "AVALANCHE_MAINNET"
fundingPrivateKey:
description: Private funding key (Skip for Simulated)
required: false
type: string
wsURL:
description: WS URL for the network (Skip for Simulated)
required: false
type: string
httpURL:
description: HTTP URL for the network (Skip for Simulated)
required: false
type: string
chainlinkImage:
description: Container image location for the Chainlink nodes
required: true
default: public.ecr.aws/chainlink/chainlink
chainlinkVersion:
description: Container image version for the Chainlink nodes
required: true
default: "2.5.0"
testDuration:
description: Duration of the test (time string)
required: false
default: 1m
chainlinkNodeFunding:
description: How much to fund each Chainlink node (in ETH)
required: false
default: ".1"
rps:
description: Requests Per Second
required: false
default: 1
rateLimitDuration:
description: How long to wait between requests
required: false
default: 1m
randomnessRequestCountPerRequest:
description: Randomness request Count per one TX request
required: false
default: 1
jobs:
vrfv2plus_load_test:
name: ${{ inputs.network }} VRFV2 Plus Load Test
environment: integration
runs-on: ubuntu20.04-8cores-32GB
permissions:
checks: write
pull-requests: write
id-token: write
contents: read
env:
SELECTED_NETWORKS: ${{ inputs.network }}
VRFV2PLUS_TEST_DURATION: ${{ inputs.testDuration }}
VRFV2PLUS_CHAINLINK_NODE_FUNDING: ${{ inputs.chainlinkNodeFunding }}
VRFV2PLUS_RATE_LIMIT_UNIT_DURATION: ${{ inputs.rateLimitDuration }}
VRFV2PLUS_RPS: ${{ inputs.rps }}
VRFV2PLUS_RANDOMNESS_REQUEST_COUNT_PER_REQUEST: ${{ inputs.randomnessRequestCountPerRequest }}

TEST_LOG_LEVEL: debug
REF_NAME: ${{ github.head_ref || github.ref_name }}
ENV_JOB_IMAGE_BASE: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }}.dkr.ecr.${{ secrets.QA_AWS_REGION }}.amazonaws.com/chainlink-tests

WASP_LOG_LEVEL: info
steps:
- name: Collect Metrics
id: collect-gha-metrics
uses: smartcontractkit/push-gha-metrics-action@d2c2b7bdc9012651230b2608a1bcb0c48538b6ec
with:
basic-auth: ${{ secrets.GRAFANA_CLOUD_BASIC_AUTH }}
hostname: ${{ secrets.GRAFANA_CLOUD_HOST }}
this-job-name: ${{ inputs.network }} VRFV2 Plus Load Test
continue-on-error: true
- name: Get Inputs
run: |
EVM_URLS=$(jq -r '.inputs.wsURL' $GITHUB_EVENT_PATH)
EVM_HTTP_URLS=$(jq -r '.inputs.httpURL' $GITHUB_EVENT_PATH)
EVM_KEYS=$(jq -r '.inputs.fundingPrivateKey' $GITHUB_EVENT_PATH)
echo ::add-mask::$EVM_URLS
echo ::add-mask::$EVM_HTTP_URLS
echo ::add-mask::$EVM_KEYS
echo EVM_URLS=$EVM_URLS >> $GITHUB_ENV
echo EVM_HTTP_URLS=$EVM_HTTP_URLS >> $GITHUB_ENV
echo EVM_KEYS=$EVM_KEYS >> $GITHUB_ENV
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Run E2E soak tests
run: |
cd integration-tests/load/vrfv2plus
go test -v -timeout 8h -run TestVRFV2PlusLoad/vrfv2plus_soak_test
3 changes: 2 additions & 1 deletion .github/workflows/solidity-foundry.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ jobs:
tests:
strategy:
fail-fast: false
matrix:
product: [vrf, automation, llo-feeds, functions, shared]
needs: [changes]
Expand All @@ -54,7 +55,7 @@ jobs:
uses: foundry-rs/foundry-toolchain@v1
with:
# Has to match the `make foundry` version.
version: nightly-ca67d15f4abd46394b324c50e21e66f306a1162d
version: nightly-e0722a10b45859892ec3b998df958a9edc77c202

- name: Run Forge build
run: |
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/solidity.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,8 @@ jobs:
uses: ./.github/actions/setup-nodejs
- name: Run pnpm lint
run: pnpm lint
- name: Run solhint
run: pnpm solhint
- name: Collect Metrics
id: collect-gha-metrics
uses: smartcontractkit/push-gha-metrics-action@d2c2b7bdc9012651230b2608a1bcb0c48538b6ec
Expand Down
16 changes: 13 additions & 3 deletions CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# CODEOWNERS Best Practices
# 1. Per Github docs: "Order is important; the last matching pattern takes the most precedence."
# 1. Per Github docs: "Order is important; the last matching pattern takes the most precedence."
# Please define less specific codeowner paths before more specific codeowner paths in order for the more specific rule to have priority

# Misc
Expand Down Expand Up @@ -37,6 +37,10 @@
# VRF-related services
/core/services/vrf @smartcontractkit/vrf-team
/core/services/blockhashstore @smartcontractkit/vrf-team
/core/services/blockheaderfeeder @smartcontractkit/vrf-team
/core/services/pipeline/task.vrf.go @smartcontractkit/vrf-team
/core/services/pipeline/task.vrfv2.go @smartcontractkit/vrf-team
/core/services/pipeline/task.vrfv2plus.go @smartcontractkit/vrf-team
/core/services/ocr2/plugins/dkg @smartcontractkit/vrf-team
/core/services/ocr2/plugins/ocr2vrf @smartcontractkit/vrf-team

Expand Down Expand Up @@ -67,13 +71,17 @@ core/scripts/gateway @bolekk @pinebit
/operator-ui/ @DeividasK @jkongie

# Contracts
/contracts/ @se3000 @connorwstein
/contracts/ @se3000 @connorwstein @RensR
/contracts/**/*Keeper* @smartcontractkit/keepers
/contracts/**/*Upkeep* @smartcontractkit/keepers
/contracts/**/*Functions* @smartcontractkit/functions
/contracts/src/v0.8/functions @smartcontractkit/functions
contracts/test/v0.8/functions @smartcontractkit/functions
/contracts/test/v0.8/functions @smartcontractkit/functions
/contracts/src/v0.8/llo-feeds @austinborn @Fletch153
/contracts/src/v0.8/vrf @smartcontractkit/vrf-team
/contracts/src/v0.8/dev/vrf @smartcontractkit/vrf-team
/contracts/src/v0.8/dev/BlockhashStore.sol @smartcontractkit/vrf-team
/contracts/src/v0.8/dev/VRFConsumerBaseV2Upgradeable.sol @smartcontractkit/vrf-team

# Tests
/integration-tests/ @smartcontractkit/test-tooling-team
Expand All @@ -86,6 +94,8 @@ contracts/test/v0.8/functions @smartcontractkit/functions
/.github/workflows/integration-chaos-tests.yml @smartcontractkit/test-tooling-team
/.github/workflows/integration-tests-publish.yml @smartcontractkit/test-tooling-team
/.github/workflows/performance-tests.yml @smartcontractkit/test-tooling-team
/.github/workflows/automation-ondemand-tests.yml @smartcontractkit/keepers
/.github/workflows/automation-benchmark-tests.yml @smartcontractkit/keepers

/core/chainlink.Dockerfile @smartcontractkit/prodsec-public

Expand Down
6 changes: 3 additions & 3 deletions GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ chainlink-dev: operator-ui ## Build a dev build of chainlink binary.
go build -tags dev $(GOFLAGS) .

chainlink-test: operator-ui ## Build a test build of chainlink binary.
go build -tags test $(GOFLAGS) .
go build $(GOFLAGS) .

.PHONY: chainlink-local-start
chainlink-local-start:
Expand Down Expand Up @@ -105,11 +105,11 @@ testscripts-update: ## Update testdata/scripts/* files via testscript.

.PHONY: testdb
testdb: ## Prepares the test database.
go run -tags test . local db preparetest
go run . local db preparetest

.PHONY: testdb
testdb-user-only: ## Prepares the test database with user only.
go run -tags test . local db preparetest --user-only
go run . local db preparetest --user-only

# Format for CI
.PHONY: presubmit
Expand Down
Loading

0 comments on commit ad85da9

Please sign in to comment.