Skip to content

Commit

Permalink
Merge branch 'develop' into BCI-2454-extract-core-services-relay
Browse files Browse the repository at this point in the history
  • Loading branch information
DylanTinianov authored Dec 12, 2023
2 parents eeace29 + cf74cd0 commit bf22f95
Show file tree
Hide file tree
Showing 82 changed files with 503 additions and 594 deletions.
67 changes: 66 additions & 1 deletion .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -325,11 +325,73 @@ jobs:
- name: ocr
nodes: 1
os: ubuntu20.04-8cores-32GB
run: -run TestOCRJobReplacement
file: ocr
pyroscope_env: ci-smoke-ocr-evm-simulated
- name: ocr-geth
nodes: 1
os: ubuntu20.04-8cores-32GB
run: -run TestOCRBasic
file: ocr
client: geth
pyroscope_env: ci-smoke-ocr-evm-simulated
# Uncomment, when https://smartcontract-it.atlassian.net/browse/TT-753 is DONE
# - name: ocr-nethermind
# nodes: 1
# os: ubuntu20.04-8cores-32GB
# run: -run TestOCRBasic
# file: ocr
# client: nethermind
# pyroscope_env: ci-smoke-ocr-evm-simulated
- name: ocr-besu
nodes: 1
os: ubuntu20.04-8cores-32GB
run: -run TestOCRBasic
file: ocr
client: besu
pyroscope_env: ci-smoke-ocr-evm-simulated
- name: ocr-erigon
nodes: 1
os: ubuntu20.04-8cores-32GB
run: -run TestOCRBasic
file: ocr
client: erigon
pyroscope_env: ci-smoke-ocr-evm-simulated
- name: ocr2
nodes: 1
os: ubuntu20.04-8cores-32GB
run: -run TestOCRv2JobReplacement
file: ocr2
pyroscope_env: ci-smoke-ocr2-evm-simulated
- name: ocr2-geth
nodes: 1
os: ubuntu20.04-8cores-32GB
run: -run TestOCRv2Basic
file: ocr2
client: geth
pyroscope_env: ci-smoke-ocr2-evm-simulated
# Uncomment, when https://smartcontract-it.atlassian.net/browse/TT-753 is DONE
# - name: ocr2-nethermind
# nodes: 1
# os: ubuntu20.04-8cores-32GB
# run: -run TestOCRv2Basic
# file: ocr2
# client: nethermind
# pyroscope_env: ci-smoke-ocr2-evm-simulated
- name: ocr2-besu
nodes: 1
os: ubuntu20.04-8cores-32GB
run: -run TestOCRv2Basic
file: ocr2
client: besu
pyroscope_env: ci-smoke-ocr2-evm-simulated
- name: ocr2-erigon
nodes: 1
os: ubuntu20.04-8cores-32GB
run: -run TestOCRv2Basic
file: ocr2
client: erigon
pyroscope_env: ci-smoke-ocr2-evm-simulated
- name: ocr2
nodes: 1
os: ubuntu20.04-8cores-32GB
Expand All @@ -345,12 +407,14 @@ jobs:
pyroscope_env: ci-smoke-vrf-evm-simulated
- name: vrfv2
nodes: 1
run: -run TestVRFv2MultipleSendingKeys
file: vrfv2
os: ubuntu20.04-8cores-32GB
pyroscope_env: ci-smoke-vrf2-evm-simulated
- name: vrfv2plus
nodes: 1
os: ubuntu20.04-8cores-32GB
pyroscope_env: ci-smoke-vrf2plus-evm-simulated
pyroscope_env: ci-smoke-vrf2plus-evm-simulated
- name: forwarder_ocr
nodes: 1
os: ubuntu20.04-8cores-32GB
Expand Down Expand Up @@ -435,6 +499,7 @@ jobs:
PYROSCOPE_SERVER: ${{ matrix.product.pyroscope_env == '' && '' || !startsWith(github.ref, 'refs/tags/') && '' || secrets.QA_PYROSCOPE_INSTANCE }} # Avoid sending blank envs https://github.com/orgs/community/discussions/25725
PYROSCOPE_ENVIRONMENT: ${{ matrix.product.pyroscope_env }}
PYROSCOPE_KEY: ${{ secrets.QA_PYROSCOPE_KEY }}
ETH2_EL_CLIENT: ${{matrix.product.client}}
LOKI_TENANT_ID: ${{ vars.LOKI_TENANT_ID }}
LOKI_URL: ${{ secrets.LOKI_URL }}
LOKI_BASIC_AUTH: ${{ secrets.LOKI_BASIC_AUTH }}
Expand Down
70 changes: 70 additions & 0 deletions .github/workflows/on-demand-vrfv2-eth2-clients-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: On Demand VRFV2 Smoke Test (Ethereum clients)
on:
workflow_dispatch:
inputs:
client:
description: Execution client to use
type: choice
options:
- "geth"
- "nethermind"
- "besu"
- "erigon"
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.6.0"
configBase64:
description: TOML config in base64 (Needed when overriding config or providing contract addresses for existing env)
required: false
jobs:
vrfv2_smoke_test:
name: VRFV2 Smoke Test with ${{ inputs.client }} client
environment: integration
runs-on: ubuntu20.04-8cores-32GB
permissions:
checks: write
pull-requests: write
id-token: write
contents: read
env:
SELECTED_NETWORKS: "SIMULATED"
CONFIG: ${{ inputs.configBase64 }}
TEST_LOG_LEVEL: debug
REF_NAME: ${{ github.head_ref || github.ref_name }}
CHAINLINK_IMAGE: ${{ inputs.chainlinkImage }}
CHAINLINK_VERSION: ${{ inputs.chainlinkVersion }}
steps:
- name: Setup Push Tag
shell: bash
run: |
echo "### chainlink image used for this test run :link:" >>$GITHUB_STEP_SUMMARY
echo "\`${{ inputs.chainlinkVersion }}\`" >>$GITHUB_STEP_SUMMARY
echo "### chainlink-tests image tag for this test run :ship:" >>$GITHUB_STEP_SUMMARY
echo "\`${GITHUB_SHA}\`" >>$GITHUB_STEP_SUMMARY
- name: Checkout code
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
fetch-depth: 0
- name: Run Tests
uses: smartcontractkit/chainlink-github-actions/chainlink-testing-framework/run-tests@7d541cbbca52d45b8a718257af86d9cf49774d1f # v2.2.15
with:
test_command_to_run: cd ./integration-tests && go test -timeout 30m -count=1 -json -run TestVRFv2Basic ./smoke/vrfv2_test.go 2>&1 | tee /tmp/gotest.log | gotestfmt
test_download_vendor_packages_command: cd ./integration-tests && go mod download
cl_repo: ${{ inputs.chainlinkImage }}
cl_image_tag: ${{ inputs.chainlinkVersion }}
aws_registries: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }}
artifacts_name: vrf-test-logs
artifacts_location: ./integration-tests/smoke/logs/
token: ${{ secrets.GITHUB_TOKEN }}
go_mod_path: ./integration-tests/go.mod
should_cleanup: false
QA_AWS_REGION: ${{ secrets.QA_AWS_REGION }}
QA_AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }}
QA_KUBECONFIG: ""
env:
ETH2_EL_CLIENT: ${{ inputs.client }}
70 changes: 70 additions & 0 deletions .github/workflows/on-demand-vrfv2plus-eth2-clients-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: On Demand VRFV2Plus Smoke Test (Ethereum clients)
on:
workflow_dispatch:
inputs:
client:
description: Execution client to use
type: choice
options:
- "geth"
- "nethermind"
- "besu"
- "erigon"
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.6.0"
configBase64:
description: TOML config in base64 (Needed when overriding config or providing contract addresses for existing env)
required: false
jobs:
vrfv2plus_smoke_test:
name: VRFV2Plus Smoke Test with ${{ inputs.client }} client
environment: integration
runs-on: ubuntu20.04-8cores-32GB
permissions:
checks: write
pull-requests: write
id-token: write
contents: read
env:
SELECTED_NETWORKS: "SIMULATED"
CONFIG: ${{ inputs.configBase64 }}
TEST_LOG_LEVEL: debug
REF_NAME: ${{ github.head_ref || github.ref_name }}
CHAINLINK_IMAGE: ${{ inputs.chainlinkImage }}
CHAINLINK_VERSION: ${{ inputs.chainlinkVersion }}
steps:
- name: Setup Push Tag
shell: bash
run: |
echo "### chainlink image used for this test run :link:" >>$GITHUB_STEP_SUMMARY
echo "\`${{ inputs.chainlinkVersion }}\`" >>$GITHUB_STEP_SUMMARY
echo "### chainlink-tests image tag for this test run :ship:" >>$GITHUB_STEP_SUMMARY
echo "\`${GITHUB_SHA}\`" >>$GITHUB_STEP_SUMMARY
- name: Checkout code
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
fetch-depth: 0
- name: Run Tests
uses: smartcontractkit/chainlink-github-actions/chainlink-testing-framework/run-tests@7d541cbbca52d45b8a718257af86d9cf49774d1f # v2.2.15
with:
test_command_to_run: cd ./integration-tests && go test -timeout 30m -count=1 -json -run ^TestVRFv2Plus$/^Link_Billing$ ./smoke/vrfv2plus_test.go 2>&1 | tee /tmp/gotest.log | gotestfmt
test_download_vendor_packages_command: cd ./integration-tests && go mod download
cl_repo: ${{ inputs.chainlinkImage }}
cl_image_tag: ${{ inputs.chainlinkVersion }}
aws_registries: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }}
artifacts_name: vrfplus-test-logs
artifacts_location: ./integration-tests/smoke/logs/
token: ${{ secrets.GITHUB_TOKEN }}
go_mod_path: ./integration-tests/go.mod
should_cleanup: false
QA_AWS_REGION: ${{ secrets.QA_AWS_REGION }}
QA_AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }}
QA_KUBECONFIG: ""
env:
ETH2_EL_CLIENT: ${{ inputs.client }}
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -84,4 +84,4 @@ go.work*
tools/flakeytests/coverage.txt

.test_summary/
.run.id
.run.id
7 changes: 4 additions & 3 deletions common/client/node_lifecycle.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@ import (
"github.com/prometheus/client_golang/prometheus/promauto"

"github.com/smartcontractkit/chainlink-common/pkg/logger"
"github.com/smartcontractkit/chainlink-common/pkg/utils"
bigmath "github.com/smartcontractkit/chainlink-common/pkg/utils/big_math"

"github.com/smartcontractkit/chainlink/v2/core/utils"
iutils "github.com/smartcontractkit/chainlink/v2/common/internal/utils"
)

var (
Expand Down Expand Up @@ -360,7 +361,7 @@ func (n *node[CHAIN_ID, HEAD, RPC]) unreachableLoop() {
lggr := logger.Named(n.lfcLog, "Unreachable")
lggr.Debugw("Trying to revive unreachable RPC node", "nodeState", n.State())

dialRetryBackoff := utils.NewRedialBackoff()
dialRetryBackoff := iutils.NewRedialBackoff()

for {
select {
Expand Down Expand Up @@ -416,7 +417,7 @@ func (n *node[CHAIN_ID, HEAD, RPC]) invalidChainIDLoop() {
lggr := logger.Named(n.lfcLog, "InvalidChainID")
lggr.Debugw(fmt.Sprintf("Periodically re-checking RPC node %s with invalid chain ID", n.String()), "nodeState", n.State())

chainIDRecheckBackoff := utils.NewRedialBackoff()
chainIDRecheckBackoff := iutils.NewRedialBackoff()

for {
select {
Expand Down
2 changes: 1 addition & 1 deletion common/client/send_only_node_lifecycle.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"fmt"
"time"

"github.com/smartcontractkit/chainlink/v2/core/utils"
"github.com/smartcontractkit/chainlink/v2/common/internal/utils"
)

// verifyLoop may only be triggered once, on Start, if initial chain ID check
Expand Down
6 changes: 3 additions & 3 deletions common/headtracker/head_broadcaster.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ import (

"github.com/smartcontractkit/chainlink-common/pkg/logger"
"github.com/smartcontractkit/chainlink-common/pkg/services"
"github.com/smartcontractkit/chainlink-common/pkg/utils/mailbox"

"github.com/smartcontractkit/chainlink/v2/common/types"
"github.com/smartcontractkit/chainlink/v2/core/utils"
)

const TrackableCallbackTimeout = 2 * time.Second
Expand All @@ -30,7 +30,7 @@ type HeadBroadcaster[H types.Head[BLOCK_HASH], BLOCK_HASH types.Hashable] struct
services.StateMachine
logger logger.Logger
callbacks callbackSet[H, BLOCK_HASH]
mailbox *utils.Mailbox[H]
mailbox *mailbox.Mailbox[H]
mutex sync.Mutex
chClose services.StopChan
wgDone sync.WaitGroup
Expand All @@ -48,7 +48,7 @@ func NewHeadBroadcaster[
return &HeadBroadcaster[H, BLOCK_HASH]{
logger: logger.Named(lggr, "HeadBroadcaster"),
callbacks: make(callbackSet[H, BLOCK_HASH]),
mailbox: utils.NewSingleMailbox[H](),
mailbox: mailbox.NewSingle[H](),
chClose: make(chan struct{}),
}
}
Expand Down
2 changes: 1 addition & 1 deletion common/headtracker/head_listener.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ import (
"github.com/smartcontractkit/chainlink-common/pkg/services"

htrktypes "github.com/smartcontractkit/chainlink/v2/common/headtracker/types"
"github.com/smartcontractkit/chainlink/v2/common/internal/utils"
"github.com/smartcontractkit/chainlink/v2/common/types"
"github.com/smartcontractkit/chainlink/v2/core/utils"
)

var (
Expand Down
14 changes: 7 additions & 7 deletions common/headtracker/head_tracker.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ import (

"github.com/smartcontractkit/chainlink-common/pkg/logger"
"github.com/smartcontractkit/chainlink-common/pkg/services"
"github.com/smartcontractkit/chainlink-common/pkg/utils/mailbox"

htrktypes "github.com/smartcontractkit/chainlink/v2/common/headtracker/types"
"github.com/smartcontractkit/chainlink/v2/common/types"
"github.com/smartcontractkit/chainlink/v2/core/utils"
)

var (
Expand Down Expand Up @@ -43,14 +43,14 @@ type HeadTracker[
log logger.Logger
headBroadcaster types.HeadBroadcaster[HTH, BLOCK_HASH]
headSaver types.HeadSaver[HTH, BLOCK_HASH]
mailMon *utils.MailboxMonitor
mailMon *mailbox.Monitor
client htrktypes.Client[HTH, S, ID, BLOCK_HASH]
chainID ID
config htrktypes.Config
htConfig htrktypes.HeadTrackerConfig

backfillMB *utils.Mailbox[HTH]
broadcastMB *utils.Mailbox[HTH]
backfillMB *mailbox.Mailbox[HTH]
broadcastMB *mailbox.Mailbox[HTH]
headListener types.HeadListener[HTH, BLOCK_HASH]
chStop services.StopChan
wgDone sync.WaitGroup
Expand All @@ -70,7 +70,7 @@ func NewHeadTracker[
htConfig htrktypes.HeadTrackerConfig,
headBroadcaster types.HeadBroadcaster[HTH, BLOCK_HASH],
headSaver types.HeadSaver[HTH, BLOCK_HASH],
mailMon *utils.MailboxMonitor,
mailMon *mailbox.Monitor,
getNilHead func() HTH,
) types.HeadTracker[HTH, BLOCK_HASH] {
chStop := make(chan struct{})
Expand All @@ -82,8 +82,8 @@ func NewHeadTracker[
config: config,
htConfig: htConfig,
log: lggr,
backfillMB: utils.NewSingleMailbox[HTH](),
broadcastMB: utils.NewMailbox[HTH](HeadsBufferSize),
backfillMB: mailbox.NewSingle[HTH](),
broadcastMB: mailbox.New[HTH](HeadsBufferSize),
chStop: chStop,
headListener: NewHeadListener[HTH, S, ID, BLOCK_HASH](lggr, client, config, chStop),
headSaver: headSaver,
Expand Down
Loading

0 comments on commit bf22f95

Please sign in to comment.