-
Notifications
You must be signed in to change notification settings - Fork 2
CIP-8334 Minor cleanup in verifier code #428
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -18,9 +18,6 @@ publish-rc registry version: | |
| docker tag verifier:rc {{registry}}/chainlink-ccv-verifier:{{version}}-rc | ||
| docker push {{registry}}/chainlink-ccv-verifier:{{version}}-rc | ||
|
|
||
| docker tag verifier:rc {{registry}}/chainlink-ccv-token-verifier:{{version}}-rc | ||
| docker push {{registry}}/chainlink-ccv-token-verifier:{{version}}-rc | ||
|
Comment on lines
-21
to
-22
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this no longer needed? If we're running in standalone we'll need these images no?
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It breaks the build, so temporary removing it. It won't be needed until we actuallly need to deploy on staging |
||
|
|
||
| clean: | ||
| docker rmi verifier:latest | ||
| docker rmi token-verifier:latest | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,84 @@ | ||
| package commit | ||
|
|
||
| import ( | ||
| "fmt" | ||
|
|
||
| "github.com/smartcontractkit/chainlink-ccv/protocol" | ||
| "github.com/smartcontractkit/chainlink-ccv/verifier" | ||
| ) | ||
|
|
||
| type ConfigWithBlockchainInfos struct { | ||
| Config | ||
| BlockchainInfos map[string]*protocol.BlockchainInfo `toml:"blockchain_infos"` | ||
| } | ||
|
|
||
| type Config struct { | ||
| VerifierID string `toml:"verifier_id"` | ||
| AggregatorAddress string `toml:"aggregator_address"` | ||
|
|
||
| SignerAddress string `toml:"signer_address"` | ||
|
|
||
| PyroscopeURL string `toml:"pyroscope_url"` | ||
| // CommitteeVerifierAddresses is a map the addresses of the committee verifiers for each chain selector. | ||
| CommitteeVerifierAddresses map[string]string `toml:"committee_verifier_addresses"` | ||
| // OnRampAddresses is a map the addresses of the on ramps for each chain selector. | ||
| OnRampAddresses map[string]string `toml:"on_ramp_addresses"` | ||
| // DefaultExecutorOnRampAddresses is a map the addresses of the default executor on ramps for each chain selector. | ||
| // The committee verifier will verify messages that specify the default executor even if they don't | ||
| // specify the committee verifier. | ||
| DefaultExecutorOnRampAddresses map[string]string `toml:"default_executor_on_ramp_addresses"` | ||
| // RMNRemoteAddresses is a map of RMN Remote contract addresses for each chain selector. | ||
| // Required for curse detection. | ||
| RMNRemoteAddresses map[string]string `toml:"rmn_remote_addresses"` | ||
| Monitoring verifier.MonitoringConfig `toml:"monitoring"` | ||
| } | ||
|
|
||
| func (c *Config) Validate() error { | ||
| // Collect chain selectors as sets (map[string]struct{}) | ||
| onRampSet := make(map[string]struct{}) | ||
| for k := range c.OnRampAddresses { | ||
| onRampSet[k] = struct{}{} | ||
| } | ||
| committeeVerifierSet := make(map[string]struct{}) | ||
| for k := range c.CommitteeVerifierAddresses { | ||
| committeeVerifierSet[k] = struct{}{} | ||
| } | ||
| rmnRemoteSet := make(map[string]struct{}) | ||
| for k := range c.RMNRemoteAddresses { | ||
| rmnRemoteSet[k] = struct{}{} | ||
| } | ||
|
|
||
| // Compare set lengths first | ||
| if len(onRampSet) != len(committeeVerifierSet) || | ||
| len(onRampSet) != len(rmnRemoteSet) { | ||
| return fmt.Errorf("invalid verifier configuration, mismatched chain selectors for onramp, committee verifier, and RMN Remote addresses") | ||
| } | ||
|
|
||
| // Compare set values (they should all be equal) | ||
| for k := range onRampSet { | ||
| if _, ok := committeeVerifierSet[k]; !ok { | ||
| return fmt.Errorf("invalid verifier configuration, chain selector in onramp (%s) not in committee verifier addresses", k) | ||
| } | ||
| if _, ok := rmnRemoteSet[k]; !ok { | ||
| return fmt.Errorf("invalid verifier configuration, chain selector in onramp (%s) not in RMN Remote addresses", k) | ||
| } | ||
| } | ||
| for k := range committeeVerifierSet { | ||
| if _, ok := onRampSet[k]; !ok { | ||
| return fmt.Errorf("invalid verifier configuration, chain selector in committee verifier (%s) not in onramp addresses", k) | ||
| } | ||
| if _, ok := rmnRemoteSet[k]; !ok { | ||
| return fmt.Errorf("invalid verifier configuration, chain selector in committee verifier (%s) not in RMN Remote addresses", k) | ||
| } | ||
| } | ||
| for k := range rmnRemoteSet { | ||
| if _, ok := onRampSet[k]; !ok { | ||
| return fmt.Errorf("invalid verifier configuration, chain selector in RMN Remote (%s) not in onramp addresses", k) | ||
| } | ||
| if _, ok := committeeVerifierSet[k]; !ok { | ||
| return fmt.Errorf("invalid verifier configuration, chain selector in RMN Remote (%s) not in committee verifier addresses", k) | ||
| } | ||
| } | ||
|
|
||
| return nil | ||
| } |
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.
Is there a reason for bumping or just staying up to date w/ latest develop on chainlink?
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.
Actually this looks like a non-develop branch, if you can't merge the chainlink PR in time make sure to re-bump after a merge (and keep that branch un-deleted on remote)
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.
Yeah, I need a fix in a chainlink repo, so I need