Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding ocr2 to configs #11952

Merged
merged 13 commits into from
Feb 7, 2024
13 changes: 13 additions & 0 deletions .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1021,6 +1021,19 @@ jobs:

# Remove the created container
docker rm "$CONTAINER_ID"
- name: Generate config overrides
run: | # https://github.com/smartcontractkit/chainlink-testing-framework/blob/main/config/README.md
cat << EOF > config.toml
[ChainlinkImage]
image="${{ env.CHAINLINK_IMAGE }}"
version="${{ github.sha }}"
EOF
# shellcheck disable=SC2002
BASE64_CONFIG_OVERRIDE=$(cat config.toml | base64 -w 0)
# shellcheck disable=SC2086
echo ::add-mask::$BASE64_CONFIG_OVERRIDE
# shellcheck disable=SC2086
echo "BASE64_CONFIG_OVERRIDE=$BASE64_CONFIG_OVERRIDE" >> $GITHUB_ENV
- name: Run Tests
if: needs.changes.outputs.src == 'true' || github.event_name == 'workflow_dispatch'
uses: smartcontractkit/chainlink-github-actions/chainlink-testing-framework/run-tests@ea889b3133bd7f16ab19ba4ba130de5d9162c669 # v2.3.4
Expand Down
2 changes: 1 addition & 1 deletion core/scripts/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ require (
github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20240206150430-fbccaa95af62 // indirect
github.com/smartcontractkit/chainlink-data-streams v0.0.0-20231204152908-a6e3fe8ff2a1 // indirect
github.com/smartcontractkit/chainlink-feeds v0.0.0-20240119021347-3c541a78cdb8 // indirect
github.com/smartcontractkit/chainlink-solana v1.0.3-0.20240206143340-111b7c0fe592 // indirect
github.com/smartcontractkit/chainlink-solana v1.0.3-0.20240207182351-414a66663857 // indirect
github.com/smartcontractkit/chainlink-starknet/relayer v0.0.1-beta-test.0.20240206145519-35a4346b5944 // indirect
github.com/smartcontractkit/tdh2/go/ocr2/decryptionplugin v0.0.0-20230906073235-9e478e5e19f1 // indirect
github.com/smartcontractkit/tdh2/go/tdh2 v0.0.0-20230906073235-9e478e5e19f1 // indirect
Expand Down
4 changes: 2 additions & 2 deletions core/scripts/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1177,8 +1177,8 @@ github.com/smartcontractkit/chainlink-data-streams v0.0.0-20231204152908-a6e3fe8
github.com/smartcontractkit/chainlink-data-streams v0.0.0-20231204152908-a6e3fe8ff2a1/go.mod h1:GuPvyXryvbiUZIHmPeLBz4L+yJKeyGUjrDfd1KNne+o=
github.com/smartcontractkit/chainlink-feeds v0.0.0-20240119021347-3c541a78cdb8 h1:1BcjXuviSAKttOX7BZoVHRZZGfxqoA2+AL8tykmkdoc=
github.com/smartcontractkit/chainlink-feeds v0.0.0-20240119021347-3c541a78cdb8/go.mod h1:vy1L7NybTy2F/Yv7BOh+oZBa1MACD6gzd1+DkcSkfp8=
github.com/smartcontractkit/chainlink-solana v1.0.3-0.20240206143340-111b7c0fe592 h1:MpdmitSRjN3nhGoTtm8ZAponZAAV7iEM/ycAv933UyA=
github.com/smartcontractkit/chainlink-solana v1.0.3-0.20240206143340-111b7c0fe592/go.mod h1:NCy9FZ8xONgJ618kmJbks6wCN0nALodUmhZuvwY5hHs=
github.com/smartcontractkit/chainlink-solana v1.0.3-0.20240207182351-414a66663857 h1:HTJykZVLsHFTNIZYR/QioAPdImmb3ftOmNZ5UXJFiYo=
github.com/smartcontractkit/chainlink-solana v1.0.3-0.20240207182351-414a66663857/go.mod h1:NCy9FZ8xONgJ618kmJbks6wCN0nALodUmhZuvwY5hHs=
github.com/smartcontractkit/chainlink-starknet/relayer v0.0.1-beta-test.0.20240206145519-35a4346b5944 h1:1Cb/XqEs38SFpkBHHxdhYqS8RZR7qXGaXH9+lxtMGJo=
github.com/smartcontractkit/chainlink-starknet/relayer v0.0.1-beta-test.0.20240206145519-35a4346b5944/go.mod h1:pGnBsaraD3vPjnak8jbu9U+OWZrCVHzGMjA/5++E1PI=
github.com/smartcontractkit/chainlink-vrf v0.0.0-20231120191722-fef03814f868 h1:FFdvEzlYwcuVHkdZ8YnZR/XomeMGbz5E2F2HZI3I3w8=
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ require (
github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20240206150430-fbccaa95af62
github.com/smartcontractkit/chainlink-data-streams v0.0.0-20231204152908-a6e3fe8ff2a1
github.com/smartcontractkit/chainlink-feeds v0.0.0-20240119021347-3c541a78cdb8
github.com/smartcontractkit/chainlink-solana v1.0.3-0.20240206143340-111b7c0fe592
github.com/smartcontractkit/chainlink-solana v1.0.3-0.20240207182351-414a66663857
github.com/smartcontractkit/chainlink-starknet/relayer v0.0.1-beta-test.0.20240206145519-35a4346b5944
github.com/smartcontractkit/chainlink-vrf v0.0.0-20231120191722-fef03814f868
github.com/smartcontractkit/libocr v0.0.0-20240112202000-6359502d2ff1
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1172,8 +1172,8 @@ github.com/smartcontractkit/chainlink-data-streams v0.0.0-20231204152908-a6e3fe8
github.com/smartcontractkit/chainlink-data-streams v0.0.0-20231204152908-a6e3fe8ff2a1/go.mod h1:GuPvyXryvbiUZIHmPeLBz4L+yJKeyGUjrDfd1KNne+o=
github.com/smartcontractkit/chainlink-feeds v0.0.0-20240119021347-3c541a78cdb8 h1:1BcjXuviSAKttOX7BZoVHRZZGfxqoA2+AL8tykmkdoc=
github.com/smartcontractkit/chainlink-feeds v0.0.0-20240119021347-3c541a78cdb8/go.mod h1:vy1L7NybTy2F/Yv7BOh+oZBa1MACD6gzd1+DkcSkfp8=
github.com/smartcontractkit/chainlink-solana v1.0.3-0.20240206143340-111b7c0fe592 h1:MpdmitSRjN3nhGoTtm8ZAponZAAV7iEM/ycAv933UyA=
github.com/smartcontractkit/chainlink-solana v1.0.3-0.20240206143340-111b7c0fe592/go.mod h1:NCy9FZ8xONgJ618kmJbks6wCN0nALodUmhZuvwY5hHs=
github.com/smartcontractkit/chainlink-solana v1.0.3-0.20240207182351-414a66663857 h1:HTJykZVLsHFTNIZYR/QioAPdImmb3ftOmNZ5UXJFiYo=
github.com/smartcontractkit/chainlink-solana v1.0.3-0.20240207182351-414a66663857/go.mod h1:NCy9FZ8xONgJ618kmJbks6wCN0nALodUmhZuvwY5hHs=
github.com/smartcontractkit/chainlink-starknet/relayer v0.0.1-beta-test.0.20240206145519-35a4346b5944 h1:1Cb/XqEs38SFpkBHHxdhYqS8RZR7qXGaXH9+lxtMGJo=
github.com/smartcontractkit/chainlink-starknet/relayer v0.0.1-beta-test.0.20240206145519-35a4346b5944/go.mod h1:pGnBsaraD3vPjnak8jbu9U+OWZrCVHzGMjA/5++E1PI=
github.com/smartcontractkit/chainlink-vrf v0.0.0-20231120191722-fef03814f868 h1:FFdvEzlYwcuVHkdZ8YnZR/XomeMGbz5E2F2HZI3I3w8=
Expand Down
2 changes: 1 addition & 1 deletion integration-tests/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ require (
github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20240206150430-fbccaa95af62 // indirect
github.com/smartcontractkit/chainlink-data-streams v0.0.0-20231204152908-a6e3fe8ff2a1 // indirect
github.com/smartcontractkit/chainlink-feeds v0.0.0-20240119021347-3c541a78cdb8 // indirect
github.com/smartcontractkit/chainlink-solana v1.0.3-0.20240206143340-111b7c0fe592 // indirect
github.com/smartcontractkit/chainlink-solana v1.0.3-0.20240207182351-414a66663857 // indirect
github.com/smartcontractkit/chainlink-starknet/relayer v0.0.1-beta-test.0.20240206145519-35a4346b5944 // indirect
github.com/smartcontractkit/tdh2/go/ocr2/decryptionplugin v0.0.0-20230906073235-9e478e5e19f1 // indirect
github.com/smartcontractkit/wsrpc v0.7.2 // indirect
Expand Down
4 changes: 2 additions & 2 deletions integration-tests/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1510,8 +1510,8 @@ github.com/smartcontractkit/chainlink-data-streams v0.0.0-20231204152908-a6e3fe8
github.com/smartcontractkit/chainlink-data-streams v0.0.0-20231204152908-a6e3fe8ff2a1/go.mod h1:GuPvyXryvbiUZIHmPeLBz4L+yJKeyGUjrDfd1KNne+o=
github.com/smartcontractkit/chainlink-feeds v0.0.0-20240119021347-3c541a78cdb8 h1:1BcjXuviSAKttOX7BZoVHRZZGfxqoA2+AL8tykmkdoc=
github.com/smartcontractkit/chainlink-feeds v0.0.0-20240119021347-3c541a78cdb8/go.mod h1:vy1L7NybTy2F/Yv7BOh+oZBa1MACD6gzd1+DkcSkfp8=
github.com/smartcontractkit/chainlink-solana v1.0.3-0.20240206143340-111b7c0fe592 h1:MpdmitSRjN3nhGoTtm8ZAponZAAV7iEM/ycAv933UyA=
github.com/smartcontractkit/chainlink-solana v1.0.3-0.20240206143340-111b7c0fe592/go.mod h1:NCy9FZ8xONgJ618kmJbks6wCN0nALodUmhZuvwY5hHs=
github.com/smartcontractkit/chainlink-solana v1.0.3-0.20240207182351-414a66663857 h1:HTJykZVLsHFTNIZYR/QioAPdImmb3ftOmNZ5UXJFiYo=
github.com/smartcontractkit/chainlink-solana v1.0.3-0.20240207182351-414a66663857/go.mod h1:NCy9FZ8xONgJ618kmJbks6wCN0nALodUmhZuvwY5hHs=
github.com/smartcontractkit/chainlink-starknet/relayer v0.0.1-beta-test.0.20240206145519-35a4346b5944 h1:1Cb/XqEs38SFpkBHHxdhYqS8RZR7qXGaXH9+lxtMGJo=
github.com/smartcontractkit/chainlink-starknet/relayer v0.0.1-beta-test.0.20240206145519-35a4346b5944/go.mod h1:pGnBsaraD3vPjnak8jbu9U+OWZrCVHzGMjA/5++E1PI=
github.com/smartcontractkit/chainlink-testing-framework v1.23.2 h1:haXPd9Pg++Zs5/QIZnhFd9RElmz/d0+4nNeletUg9ZM=
Expand Down
96 changes: 96 additions & 0 deletions integration-tests/testconfig/ocr2/example.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
# Example of full config with all fields
# General part
[ChainlinkImage]
image="public.ecr.aws/chainlink/chainlink"
version="2.7.0"

[Logging]
# if set to true will save logs even if test did not fail
test_log_collect=false

[Logging.LogStream]
# supported targets: file, loki, in-memory. if empty no logs will be persistet
log_targets=["file"]
# context timeout for starting log producer and also time-frame for requesting logs
log_producer_timeout="10s"
# number of retries before log producer gives up and stops listening to logs
log_producer_retry_limit=10

[Logging.Loki]
tenant_id="tenant_id"
# full URL of Loki ingest endpoint
endpoint="https://loki.url/api/v3/push"
# currently only needed when using public instance
basic_auth="loki-basic-auth"
# only needed for cloud grafana
bearer_token="bearer_token"

# LogStream will try to shorten Grafana URLs by default (if all 3 variables are set)
[Logging.Grafana]
# grafana url (trailing "/" will be stripped)
base_url="http://grafana.url"
# url of your grafana dashboard (prefix and suffix "/" are stirpped), example: /d/ad61652-2712-1722/my-dashboard
dashboard_url="/d/your-dashboard"
bearer_token="my-awesome-token"

# if you want to use polygon_mumbial
[Network]
selected_networks=["polygon_mumbai"]

[Network.RpcHttpUrls]
polygon_mumbai = ["https://my-rpc-endpoint.io"]

[Network.RpcWsUrls]
polygon_mumbai = ["https://my-rpc-endpoint.io"]

[Network.WalletKeys]
polygon_mumbai = ["change-me-to-your-PK"]

[PrivateEthereumNetwork]
# pos or pow
consensus_type="pos"
# only prysm supported currently
consensus_layer="prysm"
# geth, besu, nethermind or erigon
execution_layer="geth"
# if true after env started it will wait for at least 1 epoch to be finalised before continuing
wait_for_finalization=false

[PrivateEthereumNetwork.EthereumChainConfig]
# duration of single slot, lower => faster block production, must be >= 4
seconds_per_slot=12
# numer of slots in epoch, lower => faster epoch finalisation, must be >= 4
slots_per_epoch=6
# extra genesis gelay, no need to modify, but it should be after all validators/beacon chain starts
genesis_delay=15
# number of validators in the network
validator_count=8
chain_id=1337
# list of addresses to be prefunded in genesis
addresses_to_fund=["0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266"]

# load test specific configuration
[Load.OCR]
[Load.OCR.Common]
eth_funds = 3

[Load.OCR.Load]
test_duration = "3m"
rate_limit_unit_duration = "1m"
rate = 3
verification_interval = "5s"
verification_timeout = "3m"
ea_change_interval = "5s"

# soak test specific configuration
[Soak.Common]
chainlink_node_funding = 100

[Soak.OCR]
[Soak.OCR.Common]
test_duration="15m"

[Soak.OCR.Soak]
ocr_version="1"
number_of_contracts=2
time_between_rounds="1m"
57 changes: 57 additions & 0 deletions integration-tests/testconfig/ocr2/ocr2.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
package ocr

import (
"errors"

"github.com/smartcontractkit/chainlink-testing-framework/blockchain"
)

type Config struct {
Soak *SoakConfig `toml:"Soak"`
Common *Common `toml:"Common"`
}

func (o *Config) Validate() error {
if o.Common != nil {
if err := o.Common.Validate(); err != nil {
return err
}
}
if o.Soak != nil {
if err := o.Soak.Validate(); err != nil {
return err
}
}
return nil
}

type Common struct {
ETHFunds *int `toml:"eth_funds"`
TestDuration *blockchain.StrDuration `toml:"test_duration"`
}

func (o *Common) Validate() error {
if o.ETHFunds != nil && *o.ETHFunds < 0 {
return errors.New("eth_funds must be set and cannot be negative")
}
return nil
}

type SoakConfig struct {
OCRVersion *string `toml:"ocr_version"`
NumberOfContracts *int `toml:"number_of_contracts"`
TimeBetweenRounds *blockchain.StrDuration `toml:"time_between_rounds"`
}

func (o *SoakConfig) Validate() error {
if o.OCRVersion == nil || *o.OCRVersion == "" {
return errors.New("ocr_version must be set to either 1 or 2")
}
if o.NumberOfContracts == nil || *o.NumberOfContracts <= 1 {
return errors.New("number_of_contracts must be set and be greater than 1")
}
if o.TimeBetweenRounds == nil || o.TimeBetweenRounds.Duration == 0 {
return errors.New("time_between_rounds must be set and be a positive integer")
}
return nil
}
43 changes: 43 additions & 0 deletions integration-tests/testconfig/ocr2/ocr2.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# product defaults
[Common]
chainlink_node_funding = 0.5

# load test specific configuration
[Load.OCR]
[Load.OCR.Common]
eth_funds = 3

[Load.OCR.Load]
test_duration = "3m"
rate_limit_unit_duration = "1m"
rate = 3
verification_interval = "5s"
verification_timeout = "3m"
ea_change_interval = "5s"

# volume test specific configuration
[Volume.OCR]
[Volume.OCR.Common]
eth_funds = 3

[Volume.OCR.Volume]
test_duration = "3m"
rate_limit_unit_duration = "1m"
vu_requests_per_unit = 10
rate = 1
verification_interval = "5s"
verification_timeout = "3m"
ea_change_interval = "5s"

# soak test specific configuration
[Soak.Common]
chainlink_node_funding = 100

[Soak.OCR]
[Soak.OCR.Common]
test_duration="15m"

[Soak.OCR.Soak]
ocr_version="1"
number_of_contracts=2
time_between_rounds="1m"
6 changes: 6 additions & 0 deletions integration-tests/testconfig/testconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import (
keeper_config "github.com/smartcontractkit/chainlink/integration-tests/testconfig/keeper"
lp_config "github.com/smartcontractkit/chainlink/integration-tests/testconfig/log_poller"
ocr_config "github.com/smartcontractkit/chainlink/integration-tests/testconfig/ocr"
ocr2_config "github.com/smartcontractkit/chainlink/integration-tests/testconfig/ocr2"
vrf_config "github.com/smartcontractkit/chainlink/integration-tests/testconfig/vrf"
vrfv2_config "github.com/smartcontractkit/chainlink/integration-tests/testconfig/vrfv2"
vrfv2plus_config "github.com/smartcontractkit/chainlink/integration-tests/testconfig/vrfv2plus"
Expand Down Expand Up @@ -68,6 +69,10 @@ type OcrTestConfig interface {
GetOCRConfig() *ocr_config.Config
}

type Ocr2TestConfig interface {
GetOCR2Config() *ocr2_config.Config
}

type NamedConfiguration interface {
GetConfigurationName() string
}
Expand All @@ -86,6 +91,7 @@ type TestConfig struct {
Keeper *keeper_config.Config `toml:"Keeper"`
LogPoller *lp_config.Config `toml:"LogPoller"`
OCR *ocr_config.Config `toml:"OCR"`
OCR2 *ocr2_config.Config `toml:"OCR2"`
VRF *vrf_config.Config `toml:"VRF"`
VRFv2 *vrfv2_config.Config `toml:"VRFv2"`
VRFv2Plus *vrfv2plus_config.Config `toml:"VRFv2Plus"`
Expand Down
6 changes: 6 additions & 0 deletions integration-tests/types/testconfigs.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,9 @@ type OcrTestConfig interface {
tc.CommonTestConfig
tc.OcrTestConfig
}

type Ocr2TestConfig interface {
tc.GlobalTestConfig
tc.CommonTestConfig
tc.Ocr2TestConfig
}
Loading