Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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/actions/build-cl/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ runs:
uses: actions/checkout@v5
with:
repository: smartcontractkit/chainlink
ref: becbfb2fc0774c97f7168780563ac9090aa3e3f1
ref: 585838629ce2be9fcf3f0ae9d79b72de6b892f08
Copy link
Collaborator

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?

Copy link
Collaborator

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)

Copy link
Collaborator Author

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

  • merge in chainlink repo
  • merge this branch
  • bump to the main version in chainlink repo and merge as well

path: chainlink-repo

- name: Setup path to go.mod
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ import (
aggregator "github.com/smartcontractkit/chainlink-ccv/aggregator/pkg"
"github.com/smartcontractkit/chainlink-ccv/devenv/internal/util"
"github.com/smartcontractkit/chainlink-ccv/protocol"
"github.com/smartcontractkit/chainlink-ccv/verifier"
"github.com/smartcontractkit/chainlink-ccv/verifier/commit"
"github.com/smartcontractkit/chainlink-deployments-framework/datastore"
"github.com/smartcontractkit/chainlink-testing-framework/framework"
"github.com/smartcontractkit/chainlink-testing-framework/framework/components/blockchain"
)

//go:embed verifier.template.toml
//go:embed committeeVerifier.template.toml
var verifierConfigTemplate string

const (
Expand Down Expand Up @@ -145,7 +145,7 @@ committeeVerifierConfig = """
), nil
}

func (v *VerifierInput) buildVerifierConfiguration(config *verifier.Config) error {
func (v *VerifierInput) buildVerifierConfiguration(config *commit.Config) error {
if _, err := toml.Decode(verifierConfigTemplate, &config); err != nil {
return fmt.Errorf("failed to decode verifier config template: %w", err)
}
Expand All @@ -168,13 +168,13 @@ func (v *VerifierInput) buildVerifierConfiguration(config *verifier.Config) erro

func (v *VerifierInput) GenerateConfigWithBlockchainInfos(blockchainInfos map[string]*protocol.BlockchainInfo) (verifierTomlConfig []byte, err error) {
// Build base configuration
var baseConfig verifier.Config
var baseConfig commit.Config
if err := v.buildVerifierConfiguration(&baseConfig); err != nil {
return nil, err
}

// Wrap in ConfigWithBlockchainInfo and add blockchain infos
config := verifier.ConfigWithBlockchainInfos{
config := commit.ConfigWithBlockchainInfos{
Config: baseConfig,
BlockchainInfos: blockchainInfos,
}
Expand All @@ -188,7 +188,7 @@ func (v *VerifierInput) GenerateConfigWithBlockchainInfos(blockchainInfos map[st
}

func (v *VerifierInput) GenerateConfig() (verifierTomlConfig []byte, err error) {
var config verifier.Config
var config commit.Config
err = v.buildVerifierConfiguration(&config)
if err != nil {
return nil, fmt.Errorf("failed to build verifier configuration: %w", err)
Expand Down
4 changes: 2 additions & 2 deletions cmd/verifier/committee/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -292,8 +292,8 @@ func main() {
lggr.Infow("Committee service stopped gracefully")
}

func loadConfiguration(filepath string) (*verifier.Config, map[string]*protocol.BlockchainInfo, error) {
var config verifier.ConfigWithBlockchainInfos
func loadConfiguration(filepath string) (*commit.Config, map[string]*protocol.BlockchainInfo, error) {
var config commit.ConfigWithBlockchainInfos
if _, err := toml.DecodeFile(filepath, &config); err != nil {
return nil, nil, err
}
Expand Down
3 changes: 2 additions & 1 deletion cmd/verifier/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import (
"github.com/smartcontractkit/chainlink-ccv/pkg/chainaccess"
"github.com/smartcontractkit/chainlink-ccv/protocol"
"github.com/smartcontractkit/chainlink-ccv/verifier"
"github.com/smartcontractkit/chainlink-ccv/verifier/commit"
"github.com/smartcontractkit/chainlink-ccv/verifier/pkg/monitoring"
"github.com/smartcontractkit/chainlink-ccv/verifier/token"
"github.com/smartcontractkit/chainlink-common/pkg/beholder"
Expand Down Expand Up @@ -85,7 +86,7 @@ func LoadBlockchainReadersForCommit(
lggr logger.Logger,
blockchainHelper *protocol.BlockchainHelper,
chainClients map[protocol.ChainSelector]client.Client,
config verifier.Config,
config commit.Config,
) map[protocol.ChainSelector]chainaccess.SourceReader {
sourceReaders := make(map[protocol.ChainSelector]chainaccess.SourceReader)

Expand Down
2 changes: 1 addition & 1 deletion integration/pkg/constructors/committee_verifier.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import (
// Signing is passed in because it's managed differently in the CL node vs standalone modes.
func NewVerificationCoordinator(
lggr logger.Logger,
cfg verifier.Config,
cfg commit.Config,
aggregatorSecret *hmac.ClientConfig,
signingAddress protocol.UnknownAddress,
signer verifier.MessageSigner,
Expand Down
4 changes: 2 additions & 2 deletions integration/pkg/constructors/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ package constructors

import (
"github.com/smartcontractkit/chainlink-ccv/executor"
"github.com/smartcontractkit/chainlink-ccv/verifier"
"github.com/smartcontractkit/chainlink-ccv/verifier/commit"
)

// CCVConfig holds the configuration needed to configure the CCV services.
type CCVConfig struct {
Verifiers []verifier.Config
Verifiers []commit.Config
Executor executor.Configuration
}

Expand Down
3 changes: 0 additions & 3 deletions verifier/Justfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link
Collaborator

Choose a reason for hiding this comment

The 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?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The 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
Expand Down
84 changes: 84 additions & 0 deletions verifier/commit/config.go
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
}
78 changes: 0 additions & 78 deletions verifier/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,36 +2,8 @@ package verifier

import (
"fmt"

"github.com/smartcontractkit/chainlink-ccv/protocol"
)

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 MonitoringConfig `toml:"monitoring"`
}

// MonitoringConfig provides monitoring configuration for executor.
type MonitoringConfig struct {
// Enabled enables the monitoring system.
Expand Down Expand Up @@ -62,56 +34,6 @@ type BeholderConfig struct {
TraceBatchTimeout int64 `toml:"TraceBatchTimeout"`
}

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
}

// Validate performs validation on the monitoring configuration.
func (m *MonitoringConfig) Validate() error {
if m.Enabled && m.Type == "" {
Expand Down
Loading