Skip to content
Draft
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
5 changes: 2 additions & 3 deletions integration/pkg/constructors/committee_verifier.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import (
"github.com/smartcontractkit/chainlink-ccv/verifier/pkg/monitoring"
"github.com/smartcontractkit/chainlink-common/pkg/beholder"
"github.com/smartcontractkit/chainlink-common/pkg/logger"
"github.com/smartcontractkit/chainlink-evm/pkg/chains/legacyevm"
)

// NewVerificationCoordinator starts the Committee Verifier with evm chains.
Expand All @@ -28,7 +27,7 @@ func NewVerificationCoordinator(
cfg verifier.Config,
signingAddress protocol.UnknownAddress,
signer verifier.MessageSigner,
relayers map[protocol.ChainSelector]legacyevm.Chain,
providers map[protocol.ChainSelector]CCVProvider,
) (*verifier.Coordinator, error) {
if err := cfg.Validate(); err != nil {
lggr.Errorw("Invalid CCV verifier configuration.", "error", err)
Expand Down Expand Up @@ -60,7 +59,7 @@ func NewVerificationCoordinator(
sourceReaders := make(map[protocol.ChainSelector]verifier.SourceReader)
sourceConfigs := make(map[protocol.ChainSelector]verifier.SourceConfig)
headTrackers := make(map[protocol.ChainSelector]chainaccess.HeadTracker)
for sel, chain := range relayers {
for sel, chain := range providers {
if _, ok := onRampAddrs[sel]; !ok {
lggr.Warnw("No onramp address for chain, skipping.", "chainID", sel)
continue
Expand Down
7 changes: 3 additions & 4 deletions integration/pkg/constructors/executor.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import (
"github.com/smartcontractkit/chainlink-ccv/protocol"
"github.com/smartcontractkit/chainlink-common/pkg/beholder"
"github.com/smartcontractkit/chainlink-common/pkg/logger"
"github.com/smartcontractkit/chainlink-evm/pkg/chains/legacyevm"
"github.com/smartcontractkit/chainlink-evm/pkg/keys"

x "github.com/smartcontractkit/chainlink-ccv/executor/pkg/executor"
Expand All @@ -26,8 +25,8 @@ import (
func NewExecutorCoordinator(
lggr logger.Logger,
cfg executor.Configuration,
// TODO: all these are EVM specific, shouldn't be.
relayers map[protocol.ChainSelector]legacyevm.Chain,
providers map[protocol.ChainSelector]CCVProvider,
// TODO: move to CCV provider. Keys are not part of the keystore, so a container object is needed.
keys map[protocol.ChainSelector]keys.RoundRobin,
fromAddresses map[protocol.ChainSelector][]common.Address,
) (*executor.Coordinator, error) {
Expand All @@ -39,7 +38,7 @@ func NewExecutorCoordinator(

transmitters := make(map[protocol.ChainSelector]executor.ContractTransmitter)
destReaders := make(map[protocol.ChainSelector]executor.DestinationReader)
for sel, chain := range relayers {
for sel, chain := range providers {
if _, ok := offRampAddresses[sel]; !ok {
lggr.Warnw("No offramp configured for chain, skipping.", "chainID", sel)
continue
Expand Down
28 changes: 28 additions & 0 deletions integration/pkg/constructors/provider.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package constructors

import (
"github.com/smartcontractkit/chainlink-evm/pkg/client"
"github.com/smartcontractkit/chainlink-evm/pkg/heads"
"github.com/smartcontractkit/chainlink-evm/pkg/txmgr"
)

// CCVProvider is a work in progress! It will eventually become the chain agnostic interface implemented
// by all chain families to support the Committee Verifier and Executor services. For now it reflects
// the EVM-Centric nature of the initial implementation and is a simple downcast of the legacyevm.Chain
// object.
//
// Note: many of the chainlink-evm objects used here already have a generic interface in the
// chainlink-frameworks library. The way generics are used prevents us from using them in a polymorphic way.
// This means some sort of adapter will be required for each chain type we want to support.
// Until that adapter interface exists, we only support EVM.
//
// Next steps:
// - Identify the full set of functions required by client.Client, heads.Tracker and txmg.TxManager
// - Redefine those functions in this interface, using protocol types where possible.
// - Create an adapter layer for legacyevm.Chain that implements this interface.
// - Define a LOOPP client for this interface.
type CCVProvider interface {
Client() client.Client // verifier, executor

Check failure on line 25 in integration/pkg/constructors/provider.go

View workflow job for this annotation

GitHub Actions / lint

exported: public interface method CCVProvider.Client should be commented (revive)
Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't know how this is gonna work for non-EVMs, the clients may have literally nothing in common.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I think the SourceReader interface should serve all of our chain reading purposes, if it doesn't then its not complete IMO

Copy link
Collaborator

Choose a reason for hiding this comment

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

(Analogous to ChainAccessLayer in 1.6)

HeadTracker() heads.Tracker // verifier

Check failure on line 26 in integration/pkg/constructors/provider.go

View workflow job for this annotation

GitHub Actions / lint

exported: public interface method CCVProvider.HeadTracker should be commented (revive)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can we replace this with the HeadTracker interface we use in the verifier?

TxManager() txmgr.TxManager // executor

Check failure on line 27 in integration/pkg/constructors/provider.go

View workflow job for this annotation

GitHub Actions / lint

exported: public interface method CCVProvider.TxManager should be commented (revive)
}
Loading