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

[TT-1345] option to use predeployed contracts in OCR tests #13758

Merged
merged 14 commits into from
Sep 19, 2024

Conversation

Tofel
Copy link
Contributor

@Tofel Tofel commented Jul 4, 2024

This PR adds the ability to use existing LINK token and OCRv1 / OCRv2 contracts in OCR soak/smoke & load tests. It allows to specify number of OCR contracts to deploy as well as deciding whether existing contracts should be use as-is or whether they should be configured.

This functionality is crucial for testing OCR on chains like zkSync, where we cannot deploy contracts using our testing code, but we can do it using other tools. Since interaction with zkSync contracts is possible using geth wrappers we can execute test logic there.

Tests executed:

  • 1 OCRv1 contract used by smoke test @ Polygon Amoy
  • 1 OCRv2contract used by smoke test @ Polygon Amoy
  • 1 OCRv1 contract used by smoke test @ zkSync Era
  • 1 OCRv2 contract used by smoke test @ zkSync Era
  • 1 OCRv1 contract used by soak test @ zkSync Era
  • 2 OCRv1 contract used by soak test @ zkSync Era

New contract number configuration format:

## OLD
# for OCRv1
[Soak.OCR.Soak]
number_of_contracts=2

## NEW
# for OCRv1
[OCR.Common]
number_of_contracts=2

## OLD
# for OCRv2
[Soak.OCR2.Soak]
number_of_contracts=2

## NEW
# for OCRv2
[OCR2.Common]
number_of_contracts=2

In nutshell: previously we could configure number of contracts only for Soak tests, now we can configure it for ALL tests, because it's no longer tightly coupled to test type.

@cl-sonarqube-production
Copy link

@chudilka1 chudilka1 self-requested a review July 8, 2024 12:18
Copy link
Contributor

@chudilka1 chudilka1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If that is a new change/feature, and there is no info about this in README, it would be nice to update the later and explain how it works. Thanks.

@Tofel Tofel force-pushed the tt_1345_predeployed_contracts_ocr_tests branch from 2b5d0d4 to 09960cf Compare August 13, 2024 09:59
@Tofel Tofel marked this pull request as ready for review August 30, 2024 16:52
@Tofel Tofel requested a review from a team as a code owner August 30, 2024 16:52
@Tofel Tofel requested a review from chudilka1 August 31, 2024 15:30
time.Sleep(2 * time.Second)
} else {
// Load contract wrappers
for _, address := range ocrContractsConfig.OffChainAggregatorsContractsAddresses() {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Tofel, out of curiosity, why do we use an interface like OffChainAggregatorsConfig? Wouldn’t it be simpler to use config methods or fields directly?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have some logic underneath that returns empty array if contracts are disabled on some level. That way the caller doesn't have to know anything about that logic.

lukaszcl
lukaszcl previously approved these changes Sep 2, 2024
Copy link
Collaborator

@lukaszcl lukaszcl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Tofel added few questions but overall lgtm

@polygon
Copy link

polygon commented Sep 2, 2024

Please stop mentioning me in these tickets and spamming my notifications, thank you.

davidcauchi
davidcauchi previously approved these changes Sep 11, 2024
davidcauchi
davidcauchi previously approved these changes Sep 19, 2024
@Tofel Tofel dismissed stale reviews from davidcauchi and gheorghestrimtu via 87f10b9 September 19, 2024 14:50
@Tofel Tofel added this pull request to the merge queue Sep 19, 2024
Merged via the queue into develop with commit e9a9444 Sep 19, 2024
136 checks passed
@Tofel Tofel deleted the tt_1345_predeployed_contracts_ocr_tests branch September 19, 2024 16:50
momentmaker added a commit that referenced this pull request Sep 19, 2024
…tractkit/chainlink into re-2964/goreleaser-ccip

* 're-2964/goreleaser-ccip' of https://github.com/smartcontractkit/chainlink:
  Fix data race in TestLogPoller_Replay (#14431)
  Fix CCIP Load Test Faulty Fund Return (#14499)
  use tx in insertLogsWithinTx (#14361)
  Bring KMS client and multiclient over to chainlink (#14484)
  CCIP-3420: Fix IsRequestTriggeredWithinTimeframe (#1445) (#14498)
  [TT-1345] option to use predeployed contracts in OCR tests (#13758)
  CCIP-3428 Enabling ccip smoke test for testnet (#14452)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants