-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
fix(deployment): enables multiple ocr3 contracts per chain #15767
base: develop
Are you sure you want to change the base?
fix(deployment): enables multiple ocr3 contracts per chain #15767
Conversation
AER Report: CI Coreaer_workflow , commit , Detect Changes , Scheduled Run Frequency , Clean Go Tidy & Generate , Flakeguard Root Project / Get Tests To Run , test-scripts , Core Tests (go_core_tests) , Core Tests (go_core_tests_integration) , Core Tests (go_core_ccip_deployment_tests) , Core Tests (go_core_fuzz) , Core Tests (go_core_race_tests) , GolangCI Lint (deployment) , Flakeguard Deployment Project / Get Tests To Run , Flakeguard Root Project / Run Tests , Flakeguard Root Project / Report , lint , Flakeguard Deployment Project / Run Tests (github.com/smartcontractkit/chainlink/deployment, ubuntu-latest) , Flakeguard Deployment Project / Run Tests (github.com/smartcontractkit/chainlink/deployment/keystone/changeset, ubuntu-latest) , Flakeguard Deployment Project / Report , SonarQube Scan , Flakey Test Detection 1. Undefined functions and variables in test file: [go_core_ccip_deployment_tests]Source of Error:
Why: The error is caused by missing or undefined functions and variables ( Suggested fix: Ensure that AER Report: Operator UI CI ran successfully ✅ |
5ef6aba
to
768abae
Compare
768abae
to
021dff7
Compare
Quality Gate passedIssues Measures |
|
||
// AddressFilterer is a function that filters the addresses a given address book. Filtering | ||
// mutates the input map so the input map should be a copy of the original map. | ||
AddressFilterer func(map[string]deployment.TypeAndVersion) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add a test for the case of multiple addresses of the same type and version and no filter
if i read the code correctly, that will cause the last one to be choosen (line#115)
instead we need to error if there are multiple instances of any contract.
that will be a backward incompatible change in the downstream repo: after you deploy an ocr3 contract all other invocations will be broken if they don't specify an input filter
that means we need to manage the filter configuration and plumb the filter func to all the existing config structs.
this seems error prone and burdensome if we end up will a handful of cor3 contracts
alternatively,
we can change the ContractSet to support a map[addr]*contract. and then all the call sites in this package that actually have use of ocr will have a config struct will non-optional addr/s
this seems better (though i originally opposed change the constructSet b/c i had not forseen this problem)
@@ -37,6 +37,7 @@ var _ deployment.ChangeSet[ConfigureOCR3Config] = ConfigureOCR3Contract | |||
type ConfigureOCR3Config struct { | |||
ChainSel uint64 | |||
NodeIDs []string | |||
OCR3ContractAddr *string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't want to provide the OCR contract address directly here. That's error prone, we already have the address book, why not use it. My suggestion was to provide some human-friendly config like DON name, why not do that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
after a lengthy conversation, the best path forward is use an explicit don->address mapping in the down stream repo.
this implies:
- no change to the address book
- change the contractSet to store map[addr]*ocr3contract
- change the ConfigureOCR func to take an explicit address
- use that to get the contract from the set
when this is plumbed to deployment repo we need to
- update ocr job distribution to take an explicit address
- create a persitent mapping btw don name and ocr addr so we can fetch it naturally
it is possible to deploy multiple OCR contracts per chain for workflow dons yet the behavior of fetching a
ContractSet
from an address book is non-deterministic in this case. this PR allowsAddressBook
clients to pass an address filterer that will be applied to the addresses fetched for the chain prior to transforming them into aContractSet
.modifies the
keystone
package to use an address filterer that removes all OCR3Capability contracts from an address book that don't match a specified address. the specified address should be passed as config to a changeset to configure OCR3.Requires
Supports