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

feat(keystone): support multiple OCR3 contracts #15803

Merged
merged 5 commits into from
Jan 6, 2025

Conversation

MStreet3
Copy link
Contributor

@MStreet3 MStreet3 commented Dec 23, 2024

It is possible to deploy multiple OCR contracts per chain for workflow dons. This PR:

  • enables changesets to configure a specific OCR contract by passing an address
  • makes it an error to attempt to configure the OCR3 contract for a chain if there are multiple OCR contracts and no address specified

Requires

Supports

@MStreet3 MStreet3 requested review from a team as code owners December 23, 2024 20:56
@MStreet3 MStreet3 force-pushed the cappl-404/ocr3-multiple-contracts branch from aacfe02 to 9682e41 Compare December 23, 2024 20:57
Copy link
Contributor

github-actions bot commented Dec 23, 2024

AER Report: CI Core ran successfully ✅

aer_workflow , commit

AER Report: Operator UI CI ran successfully ✅

aer_workflow , commit

deployment/keystone/changeset/configure_contracts.go Outdated Show resolved Hide resolved
deployment/keystone/changeset/deploy_ocr3.go Outdated Show resolved Hide resolved
deployment/keystone/changeset/internal/deploy.go Outdated Show resolved Hide resolved
deployment/keystone/changeset/internal/state.go Outdated Show resolved Hide resolved
@MStreet3 MStreet3 force-pushed the cappl-404/ocr3-multiple-contracts branch from 9682e41 to 0cdba03 Compare December 23, 2024 21:36
@MStreet3 MStreet3 force-pushed the cappl-404/ocr3-multiple-contracts branch from 9bad051 to 56c1438 Compare December 23, 2024 22:17
@MStreet3 MStreet3 requested a review from bolekk December 23, 2024 22:17
@MStreet3 MStreet3 enabled auto-merge December 23, 2024 22:22
bolekk
bolekk previously approved these changes Dec 23, 2024
deployment/keystone/changeset/internal/deploy.go Outdated Show resolved Hide resolved
deployment/keystone/changeset/internal/deploy.go Outdated Show resolved Hide resolved
@MStreet3 MStreet3 force-pushed the cappl-404/ocr3-multiple-contracts branch from e4990cd to 4d594bd Compare December 24, 2024 13:29
contract, err := contracts.GetOCR3Contract(nil)
if err != nil {
env.Logger.Errorf("failed to get OCR3 contract: %s", err)
return fmt.Errorf("failed to get OCR3 contract: %w", err)
Copy link
Contributor

Choose a reason for hiding this comment

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

@MStreet3 How come we need to both log + return an error here? Does the returned error not get bubbled up to the user when executing the changeset?

// contract in the set if there is no address specified. If an address is specified, it returns the
// contract with that address. If the address is specified but not found in the contract set, it returns
// an error.
func getOCR3Contract(contracts map[common.Address]*ocr3_capability.OCR3Capability, addr *common.Address) (*ocr3_capability.OCR3Capability, error) {
Copy link
Contributor

Choose a reason for hiding this comment

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

@MStreet3 Style nit: IMO this feels a bit like premature optimization -- why not just inline this code into the ContractSet GetOCR3Contract method?

@MStreet3 MStreet3 added this pull request to the merge queue Jan 6, 2025
Merged via the queue into develop with commit 1cebf39 Jan 6, 2025
170 of 171 checks passed
@MStreet3 MStreet3 deleted the cappl-404/ocr3-multiple-contracts branch January 6, 2025 17:41
joaoluisam pushed a commit that referenced this pull request Jan 9, 2025
* feat(keystone): enable multiple OCR contracts per chain

* fix(keystone/changeset): use common.Address vs string

* chore(keystone/changeset): adds unit test

* lint(keystone/changeset): fixes loop var lint

* refactor(keystone/changeset): move OCR3 selector func and add logs
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.

4 participants