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

VRF-897: refactoring VRF v2 and V2 Plus e2e tests #12208

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
65552bb
VRF-897: refactoring VRF v2 and V2 Plus e2e tests
iljapavlovs Feb 28, 2024
09c6cda
VRF-897: fixing test
iljapavlovs Feb 28, 2024
51e71f3
VRF-897: refactoring VRF v2 load test
iljapavlovs Feb 28, 2024
6a5d350
VRF-897: fixing v2 load test
iljapavlovs Feb 28, 2024
c2f3aaa
VRF-897: adding possibility to run vrf v2 test against existing env
iljapavlovs Feb 29, 2024
7bc69f0
VRF-897: removing code
iljapavlovs Feb 29, 2024
39d5d59
Merge branch 'develop' into chore/VRF-897-adjust-e2e-test-to-run-agai…
iljapavlovs Feb 29, 2024
7df3e9c
VRF-897: fixing lint issue
iljapavlovs Feb 29, 2024
2818165
VRF-897: finishing V2 test refactoring
iljapavlovs Feb 29, 2024
9da1075
VRF-897: fixing BHS test
iljapavlovs Feb 29, 2024
6dec156
VRF-897: fixing VRF V2 Basic test
iljapavlovs Feb 29, 2024
d0d7bc4
VRF-897: fixing VRF V2 Basic test
iljapavlovs Mar 1, 2024
404d929
Merge branch 'develop' into chore/VRF-897-adjust-e2e-test-to-run-agai…
iljapavlovs Mar 1, 2024
08ff507
VRF-897: small refactoring
iljapavlovs Mar 1, 2024
fc62610
VRF-897: fixing lint issues
iljapavlovs Mar 1, 2024
b0a1f4d
VRF-897: fixing VRF v2 test
iljapavlovs Mar 1, 2024
359742d
VRF-897: fixing VRF v2 test
iljapavlovs Mar 1, 2024
58ee620
VRF-897: fixing VRF v2 test
iljapavlovs Mar 1, 2024
585a1e0
VRF-897: fixing VRF v2 test
iljapavlovs Mar 1, 2024
1458300
VRF-897: fixing VRF v2 test
iljapavlovs Mar 1, 2024
b6c6494
VRF-897: adding VRF Owner test
iljapavlovs Mar 1, 2024
954f9e7
VRF-897: fixing VRF Owner test
iljapavlovs Mar 2, 2024
94b7d71
VRF-897: adding BHS Load Test
iljapavlovs Mar 8, 2024
c26c079
VRF-897: rerun tests
iljapavlovs Mar 8, 2024
c89b306
VRF-897: removing perf test to run setting
iljapavlovs Mar 8, 2024
e871357
VRF-897: removing logging
iljapavlovs Mar 12, 2024
a99c329
VRF-897: sync with develop
iljapavlovs Mar 12, 2024
ed29e10
Merge branch 'develop' of github.com:smartcontractkit/chainlink into …
iljapavlovs Mar 12, 2024
179042b
Merge branch 'develop' into chore/VRF-897-adjust-e2e-test-to-run-agai…
iljapavlovs Mar 12, 2024
ef3b16a
Merge remote-tracking branch 'origin/chore/VRF-897-adjust-e2e-test-to…
iljapavlovs Mar 12, 2024
b343bba
VRF-897: small fix
iljapavlovs Mar 12, 2024
a9cbd0a
VRF-897: fixing compilation issues
iljapavlovs Mar 12, 2024
06d7652
VRF-897: fixing lint issues
iljapavlovs Mar 12, 2024
9fd9f66
VRF-897: fixing lint issues
iljapavlovs Mar 12, 2024
9f93438
VRF-897: refactoring
iljapavlovs Mar 18, 2024
7c50993
VRF-897: refactoring; syncing with develop
iljapavlovs Mar 18, 2024
68099bf
Merge branch 'develop' into chore/VRF-897-adjust-e2e-test-to-run-agai…
iljapavlovs Mar 18, 2024
a1db9ed
VRF-897: fixing lint
iljapavlovs Mar 18, 2024
11473c7
VRF-897: fixing vrfv2plus test
iljapavlovs Mar 19, 2024
c8eba1e
VRF-897: fixing vrfv2plus and vrfv2 test
iljapavlovs Mar 19, 2024
1e88f1a
VRF-897: fixing vrfv2plus and vrfv2 test
iljapavlovs Mar 19, 2024
4b2fbcf
Merge branch 'develop' into chore/VRF-897-adjust-e2e-test-to-run-agai…
iljapavlovs Mar 19, 2024
72d5245
VRF-897: fixing vrfv2plus and vrfv2 test
iljapavlovs Mar 19, 2024
ba117b7
VRF-897: fixing vrfv2plus and vrfv2 test
iljapavlovs Mar 19, 2024
b66e274
Merge branch 'develop' into chore/VRF-897-adjust-e2e-test-to-run-agai…
iljapavlovs Mar 19, 2024
f2b1b3c
VRF-897: fixing vrfv2plus
iljapavlovs Mar 19, 2024
4f2394d
VRF-897: fixing vrfv2plus test
iljapavlovs Mar 19, 2024
e05fb56
VRF-897: fixing vrfv2plus test
iljapavlovs Mar 19, 2024
ec2a33f
Merge branch 'develop' into chore/VRF-897-adjust-e2e-test-to-run-agai…
iljapavlovs Mar 19, 2024
a3198cf
VRF-897: PR comments
iljapavlovs Mar 19, 2024
2696cb4
Merge remote-tracking branch 'origin/chore/VRF-897-adjust-e2e-test-to…
iljapavlovs Mar 19, 2024
d359099
Merge branch 'develop' into chore/VRF-897-adjust-e2e-test-to-run-agai…
iljapavlovs Mar 19, 2024
dc8994a
VRF-897: adding default value for bhs load test
iljapavlovs Mar 19, 2024
fc2e54e
VRF-897: adding default value for bhs load test
iljapavlovs Mar 19, 2024
df6f12e
VRF-897: adjusting default value for bhs load test
iljapavlovs Mar 19, 2024
1b3bf58
VRF-897: fixing load test for existing env
iljapavlovs Mar 19, 2024
efa54cd
Merge branch 'develop' into chore/VRF-897-adjust-e2e-test-to-run-agai…
iljapavlovs Mar 19, 2024
4113d75
VRF-897: fixing sub funds return to eoa wallet
iljapavlovs Mar 19, 2024
4d94b60
Merge branch 'develop' into chore/VRF-897-adjust-e2e-test-to-run-agai…
iljapavlovs Mar 19, 2024
2795451
VRF-897:sync with develop
iljapavlovs Mar 20, 2024
3f6198c
VRF-897:sync with develop
iljapavlovs Mar 21, 2024
d7197a3
Merge branch 'develop' into chore/VRF-897-adjust-e2e-test-to-run-agai…
iljapavlovs Mar 21, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -517,7 +517,7 @@ jobs:
os: ubuntu-latest
pyroscope_env: ci-smoke-vrf2-evm-simulated
- name: vrfv2plus
nodes: 5
nodes: 6
os: ubuntu-latest
pyroscope_env: ci-smoke-vrf2plus-evm-simulated
- name: forwarder_ocr
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/on-demand-vrfv2-performance-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ jobs:
- name: Run Tests
uses: smartcontractkit/chainlink-github-actions/chainlink-testing-framework/run-tests@5bee84d30d90295010bda68b0cd46be3a1eea917 # v2.3.9
with:
test_command_to_run: cd ./integration-tests/load && go test -v -count=1 -timeout 24h -run TestVRFV2Performance/vrfv2_performance_test ./vrfv2
test_command_to_run: cd ./integration-tests/load && go test -v -count=1 -timeout 24h -run TestVRFV2Performance ./vrfv2
test_download_vendor_packages_command: cd ./integration-tests && go mod download
cl_repo: ${{ env.CHAINLINK_IMAGE }}
cl_image_tag: ${{ env.CHAINLINK_VERSION }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ jobs:
- name: Run Tests
uses: smartcontractkit/chainlink-github-actions/chainlink-testing-framework/run-tests@5bee84d30d90295010bda68b0cd46be3a1eea917 # v2.3.9
with:
test_command_to_run: cd ./integration-tests/load && go test -v -count=1 -timeout 24h -run TestVRFV2PlusPerformance/vrfv2plus_performance_test ./vrfv2plus
test_command_to_run: cd ./integration-tests/load && go test -v -count=1 -timeout 24h -run TestVRFV2PlusPerformance ./vrfv2plus
test_download_vendor_packages_command: cd ./integration-tests && go mod download
cl_repo: ${{ env.CHAINLINK_IMAGE }}
cl_image_tag: ${{ env.CHAINLINK_VERSION }}
Expand Down
40 changes: 38 additions & 2 deletions integration-tests/actions/vrf/common/actions.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
"github.com/rs/zerolog"

"github.com/smartcontractkit/chainlink-testing-framework/blockchain"
"github.com/smartcontractkit/chainlink-testing-framework/utils/conversions"
"github.com/smartcontractkit/chainlink/integration-tests/actions"
"github.com/smartcontractkit/chainlink/integration-tests/client"
"github.com/smartcontractkit/chainlink/integration-tests/contracts"
Expand Down Expand Up @@ -191,14 +192,17 @@ func retrieveLoadTestMetrics(
metricsChannel <- metrics
}

func CreateNodeTypeToNodeMap(cluster *test_env.ClCluster, nodesToCreate []VRFNodeType) map[VRFNodeType]*VRFNode {
func CreateNodeTypeToNodeMap(cluster *test_env.ClCluster, nodesToCreate []VRFNodeType) (map[VRFNodeType]*VRFNode, error) {
var nodesMap = make(map[VRFNodeType]*VRFNode)
if len(cluster.Nodes) < len(nodesToCreate) {
return nil, fmt.Errorf("not enough nodes in the cluster (cluster size is %d nodes) to create %d nodes", len(cluster.Nodes), len(nodesToCreate))
}
for i, nodeType := range nodesToCreate {
nodesMap[nodeType] = &VRFNode{
CLNode: cluster.Nodes[i],
}
}
return nodesMap
return nodesMap, nil
}

func CreateVRFKeyOnVRFNode(vrfNode *VRFNode, l zerolog.Logger) (*client.VRFKey, string, error) {
Expand All @@ -216,3 +220,35 @@ func CreateVRFKeyOnVRFNode(vrfNode *VRFNode, l zerolog.Logger) (*client.VRFKey,
Msg("VRF Key created on the Node")
return vrfKey, pubKeyCompressed, nil
}

func FundNodesIfNeeded(ctx context.Context, existingEnvConfig *vrf_common_config.ExistingEnvConfig, client blockchain.EVMClient, l zerolog.Logger) error {
if *existingEnvConfig.NodeSendingKeyFundingMin > 0 {
for _, sendingKey := range existingEnvConfig.NodeSendingKeys {
address := common.HexToAddress(sendingKey)
sendingKeyBalance, err := client.BalanceAt(ctx, address)
if err != nil {
return err
}
fundingAtLeast := conversions.EtherToWei(big.NewFloat(*existingEnvConfig.NodeSendingKeyFundingMin))
fundingToSendWei := new(big.Int).Sub(fundingAtLeast, sendingKeyBalance)
iljapavlovs marked this conversation as resolved.
Show resolved Hide resolved
fundingToSendEth := conversions.WeiToEther(fundingToSendWei)
log := l.Info().
Str("Sending Key", sendingKey).
Str("Sending Key Current Balance", sendingKeyBalance.String()).
Str("Should have at least", fundingAtLeast.String())
if fundingToSendWei.Cmp(big.NewInt(0)) == 1 {
log.
Str("Funding Amount in ETH", fundingToSendEth.String()).
Msg("Funding Node's Sending Key")
err := actions.FundAddress(client, sendingKey, fundingToSendEth)
if err != nil {
return err
}
} else {
log.
Msg("Skipping Node's Sending Key funding as it has enough funds")
}
}
}
return nil
}
11 changes: 10 additions & 1 deletion integration-tests/actions/vrf/common/models.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,10 @@ type VRFContracts struct {
CoordinatorV2Plus contracts.VRFCoordinatorV2_5
VRFOwner contracts.VRFOwner
BHS contracts.BlockHashStore
VRFV2Consumer []contracts.VRFv2LoadTestConsumer
VRFV2Consumers []contracts.VRFv2LoadTestConsumer
VRFV2PlusConsumer []contracts.VRFv2PlusLoadTestConsumer
LinkToken contracts.LinkToken
MockETHLINKFeed contracts.VRFMockETHLINKFeed
}

type VRFOwnerConfig struct {
Expand All @@ -74,3 +76,10 @@ type VRFJobSpecConfig struct {
type VRFLoadTestConsumer interface {
GetLoadTestMetrics(ctx context.Context) (*contracts.VRFLoadTestMetrics, error)
}

type NewEnvConfig struct {
NodesToCreate []VRFNodeType
NumberOfTxKeysToCreate int
UseVRFOwner bool
UseTestCoordinator bool
}
Loading
Loading