adapters

package
v0.0.0-...-d2009c8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 10, 2026 License: MIT Imports: 66 Imported by: 0

Documentation

Index

Constants

View Source
const CantonRemoteTokenPricesFamilyExtraKey = "cantonRemoteTokenPrices"

CantonRemoteTokenPricesFamilyExtraKey is an optional ConfigureChainForLanesInput.FamilyExtras entry for per-remote fee-token USD prices pushed via FeeQuoter::UpdatePrices during lane configure.

Shape (YAML-friendly):

cantonRemoteTokenPrices:
  "<remoteChainSelector>":
    "ccipOwner::1220...:link-token": "10"

Keys use "<adminParty>:<instrumentId>"; values are USD per whole token (e.g. "10" for $10 LINK). Canton FeeQuoter stores usdPerToken as DAML Decimal (see FeeQuoter.daml tests: 20.0 = $20/LINK).

View Source
const ConfigureLanesDataStoreFamilyExtraKey = "canton.dataStore"

ConfigureLanesDataStoreFamilyExtraKey passes e.DataStore into Canton lane configure when the pinned chainlink-ccip ConfigureChainForLanesInput type does not yet expose DataStore.

Variables

View Source
var CantonFamilySelector = [4]byte{0xdf, 0xaf, 0xaf, 0x4b}

Functions

func BuildFeeQuoterDestChainConfig

BuildFeeQuoterDestChainConfig merges adapter overrides onto Canton FQ dest defaults.

func BuildRemoteChainDefinition

func BuildRemoteChainDefinition(remoteSelector uint64, remoteCfg ccipadapters.RemoteChainConfig[[]byte, string]) (*lanes.ChainDefinition, error)

BuildRemoteChainDefinition maps a resolved remote chain config to a lane ChainDefinition.

func DefaultCantonFeeQuoterDestChainConfig

func DefaultCantonFeeQuoterDestChainConfig() lanes.FeeQuoterDestChainConfig

func ResolveCantonOutboundDestLane

func ResolveCantonOutboundDestLane(
	ds datastore.DataStore,
	cantonSelector, remoteDestSelector uint64,
	overrides OutboundDestFeeOverrides,
	defaultOutboundCCVQualifiers []string,
	executorQualifier string,
) (source *lanes.ChainDefinition, dest *lanes.ChainDefinition, err error)

ResolveCantonOutboundDestLane builds source/dest lane definitions for Canton outbound dest fee updates (GlobalConfig + FeeQuoter only). Non-fee fields come from adapter defaults and deployed contract refs so existing lane wiring is preserved.

func ResolveTokenPricesForRemoteDest

func ResolveTokenPricesForRemoteDest(
	ds datastore.DataStore,
	input ccipadapters.ConfigureChainForLanesInput,
	remoteSelector uint64,
	nativeInstrument *splice_api_token_holding_v1.InstrumentId,
) (map[string]*big.Int, error)

Types

type CantonAggregatorConfigAdapter

type CantonAggregatorConfigAdapter struct{}

func (*CantonAggregatorConfigAdapter) GetDeployedChains

func (a *CantonAggregatorConfigAdapter) GetDeployedChains(ds datastore.DataStore, qualifier string) []uint64

GetDeployedChains implements adapters.AggregatorConfigAdapter.

func (*CantonAggregatorConfigAdapter) ResolveDestinationVerifierAddress

func (a *CantonAggregatorConfigAdapter) ResolveDestinationVerifierAddress(ds datastore.DataStore, chainSelector uint64, qualifier string) (string, error)

ResolveDestinationVerifierAddress implements adapters.AggregatorConfigAdapter.

For Canton we want to resolve the aggregator destination verifier address to the raw instance address of the committee verifier so that users see the raw address in the indexer's verifier results for a specific message. This appears when users send a message from X -> Canton.

func (*CantonAggregatorConfigAdapter) ResolveSourceVerifierAddress

func (a *CantonAggregatorConfigAdapter) ResolveSourceVerifierAddress(ds datastore.DataStore, chainSelector uint64, qualifier string) (string, error)

ResolveSourceVerifierAddress implements adapters.AggregatorConfigAdapter.

For Canton we want to resolve the aggregator source verifier address to the hashed instance address of the committee verifier. This is because the CCIPMessageSentEvent onchain emits the hashed instance address, and the aggregator checks that the source verifier address it is configured with is present inside the message's CCV addresses. https://github.com/smartcontractkit/chainlink-ccv/blob/33b00afa3061efc6faca53e5cfb9658e4ad9d6e1/aggregator/pkg/quorum/evm_quorum_validator.go#L49-L51.

type CantonChainFamilyAdapter

type CantonChainFamilyAdapter struct{}

func (*CantonChainFamilyAdapter) AddressRefToBytes

func (a *CantonChainFamilyAdapter) AddressRefToBytes(ref datastore.AddressRef) ([]byte, error)

func (*CantonChainFamilyAdapter) ConfigureCommitteeVerifierForLanes

ConfigureCommitteeVerifierForLanes configures CommitteeVerifier lane settings only. Used by ConfigureCantonCommitteeVerifierForLanesFromTopology (Run 2).

func (*CantonChainFamilyAdapter) GetAddressBytesLength

func (a *CantonChainFamilyAdapter) GetAddressBytesLength() uint8

GetAddressBytesLength implements adapters.ChainFamily.

func (*CantonChainFamilyAdapter) GetChainFamilySelector

func (a *CantonChainFamilyAdapter) GetChainFamilySelector() [4]byte

GetChainFamilySelector implements adapters.ChainFamily.

func (*CantonChainFamilyAdapter) GetDefaultCommitteeVerifierRemoteChainConfig

func (a *CantonChainFamilyAdapter) GetDefaultCommitteeVerifierRemoteChainConfig() ccipadapters.CommitteeVerifierRemoteChainDefaults

GetDefaultCommitteeVerifierRemoteChainConfig implements adapters.ChainFamily.

func (*CantonChainFamilyAdapter) GetDefaultFeeQuoterDestChainConfig

func (a *CantonChainFamilyAdapter) GetDefaultFeeQuoterDestChainConfig(_, _ uint64, chainFamilySelector [4]byte) ccipadapters.FeeQuoterDestChainConfigOverrides

GetDefaultFeeQuoterDestChainConfig implements adapters.ChainFamily.

func (*CantonChainFamilyAdapter) GetDefaultFinalityConfig

func (a *CantonChainFamilyAdapter) GetDefaultFinalityConfig() finality.Config

GetDefaultFinalityConfig implements adapters.ChainFamily.

func (*CantonChainFamilyAdapter) GetDefaultRemoteChainConfig

func (a *CantonChainFamilyAdapter) GetDefaultRemoteChainConfig(_, _ uint64) ccipadapters.RemoteChainDefaults

GetDefaultRemoteChainConfig implements adapters.ChainFamily.

func (*CantonChainFamilyAdapter) GetFQAddress

func (a *CantonChainFamilyAdapter) GetFQAddress(ds datastore.DataStore, chainSelector uint64) ([]byte, error)

func (*CantonChainFamilyAdapter) GetOffRampAddress

func (a *CantonChainFamilyAdapter) GetOffRampAddress(ds datastore.DataStore, chainSelector uint64) ([]byte, error)

func (*CantonChainFamilyAdapter) GetOnRampAddress

func (a *CantonChainFamilyAdapter) GetOnRampAddress(ds datastore.DataStore, chainSelector uint64) ([]byte, error)

func (*CantonChainFamilyAdapter) GetRouterAddress

func (a *CantonChainFamilyAdapter) GetRouterAddress(ds datastore.DataStore, chainSelector uint64) ([]byte, error)

func (*CantonChainFamilyAdapter) GetTestRouter

func (a *CantonChainFamilyAdapter) GetTestRouter(ds datastore.DataStore, chainSelector uint64) ([]byte, error)

func (*CantonChainFamilyAdapter) ResolveExecutor

func (a *CantonChainFamilyAdapter) ResolveExecutor(ds datastore.DataStore, chainSelector uint64, qualifier string) (string, error)

func (*CantonChainFamilyAdapter) ValidateNOPsTopology

func (a *CantonChainFamilyAdapter) ValidateNOPsTopology(chainSelector string, nopCount int) error

type CantonCommitteeVerifierContractAdapter

type CantonCommitteeVerifierContractAdapter struct{}

func (CantonCommitteeVerifierContractAdapter) GetCommitteeVerifierResolver

func (c CantonCommitteeVerifierContractAdapter) GetCommitteeVerifierResolver(ds datastore.DataStore, chainSelector uint64, qualifier string) ([]datastore.AddressRef, error)

GetCommitteeVerifierResolver implements adapters.CommitteeVerifierContractAdapter. Canton has no separate versioned verifier resolver; the CommitteeVerifier is the lane CCV.

func (CantonCommitteeVerifierContractAdapter) ResolveCommitteeVerifierContracts

func (c CantonCommitteeVerifierContractAdapter) ResolveCommitteeVerifierContracts(ds datastore.DataStore, chainSelector uint64, qualifier string) ([]datastore.AddressRef, error)

type CantonCommitteeVerifierOnchain

type CantonCommitteeVerifierOnchain struct{}

func (*CantonCommitteeVerifierOnchain) ApplyAllowlistUpdates

func (a *CantonCommitteeVerifierOnchain) ApplyAllowlistUpdates(ctx context.Context, env deployment.Environment, chainSelector uint64, qualifier string, destChainSelector uint64, allowlistEnabled bool, addedSenders []string, removedSenders []string) error

ApplyAllowlistUpdates implements adapters.CommitteeVerifierOnchainAdapter.

func (*CantonCommitteeVerifierOnchain) ApplySignatureConfigs

func (a *CantonCommitteeVerifierOnchain) ApplySignatureConfigs(ctx context.Context, env deployment.Environment, destChainSelector uint64, qualifier string, change adapters.SignatureConfigChange) error

ApplySignatureConfigs implements adapters.CommitteeVerifierOnchainAdapter.

func (*CantonCommitteeVerifierOnchain) ScanCommitteeStates

func (a *CantonCommitteeVerifierOnchain) ScanCommitteeStates(ctx context.Context, env deployment.Environment, chainSelector uint64) ([]*adapters.CommitteeState, error)

ScanCommitteeStates implements adapters.CommitteeVerifierOnchainAdapter.

func (*CantonCommitteeVerifierOnchain) SetAllowedFinalityConfig

func (a *CantonCommitteeVerifierOnchain) SetAllowedFinalityConfig(ctx context.Context, env deployment.Environment, chainSelector uint64, qualifier string, waitForFinality bool, waitForSafe bool, blockDepth uint16) error

SetAllowedFinalityConfig implements adapters.CommitteeVerifierOnchainAdapter.

type CantonCurseAdapter

type CantonCurseAdapter struct {
	// contains filtered or unexported fields
}

func NewCantonCurseAdapter

func NewCantonCurseAdapter() *CantonCurseAdapter

func (*CantonCurseAdapter) Curse

Curse implements fastcurse.CurseAdapter.

func (*CantonCurseAdapter) Initialize

func (c *CantonCurseAdapter) Initialize(e deployment.Environment, selector uint64) error

Initialize implements fastcurse.CurseAdapter.

func (*CantonCurseAdapter) IsChainConnectedToTargetChain

func (c *CantonCurseAdapter) IsChainConnectedToTargetChain(e deployment.Environment, selector uint64, targetSel uint64) (bool, error)

IsChainConnectedToTargetChain implements fastcurse.CurseAdapter.

func (*CantonCurseAdapter) IsCurseEnabledForChain

func (c *CantonCurseAdapter) IsCurseEnabledForChain(e deployment.Environment, selector uint64) (bool, error)

IsCurseEnabledForChain implements fastcurse.CurseAdapter.

func (*CantonCurseAdapter) IsSubjectCursedOnChain

func (c *CantonCurseAdapter) IsSubjectCursedOnChain(e deployment.Environment, selector uint64, subject fastcurse.Subject) (bool, error)

IsSubjectCursedOnChain implements fastcurse.CurseAdapter.

func (*CantonCurseAdapter) ListConnectedChains

func (c *CantonCurseAdapter) ListConnectedChains(e deployment.Environment, selector uint64) ([]uint64, error)

ListConnectedChains implements fastcurse.CurseAdapter. TODO: go doc comment on the interface for this method is pretty confusing. It seems to want all configured source chains for the given chain selector.

func (*CantonCurseAdapter) SubjectToSelector

func (c *CantonCurseAdapter) SubjectToSelector(subject fastcurse.Subject) (uint64, error)

SubjectToSelector implements fastcurse.CurseAdapter.

func (*CantonCurseAdapter) Uncurse

Uncurse implements fastcurse.CurseAdapter.

type CantonCurseSubjectAdapter

type CantonCurseSubjectAdapter struct {
}

func NewCantonCurseSubjectAdapter

func NewCantonCurseSubjectAdapter() *CantonCurseSubjectAdapter

func (*CantonCurseSubjectAdapter) DeriveCurseAdapterVersion

func (c *CantonCurseSubjectAdapter) DeriveCurseAdapterVersion(e deployment.Environment, selector uint64) (*semver.Version, error)

DeriveCurseAdapterVersion implements fastcurse.CurseSubjectAdapter.

func (*CantonCurseSubjectAdapter) SelectorToSubject

func (c *CantonCurseSubjectAdapter) SelectorToSubject(selector uint64) fastcurse.Subject

SelectorToSubject implements fastcurse.CurseSubjectAdapter.

type CantonDeployChainContractsAdapter

type CantonDeployChainContractsAdapter struct{}

func (*CantonDeployChainContractsAdapter) BuildDeployContractParams

func (*CantonDeployChainContractsAdapter) GetDefaultDeployContractParams

func (c *CantonDeployChainContractsAdapter) GetDefaultDeployContractParams(_ uint64) ccipadapters.DeployContractParams

func (*CantonDeployChainContractsAdapter) ResolveDeployAddresses

type CantonExecutorConfigAdapter

type CantonExecutorConfigAdapter struct{}

func (*CantonExecutorConfigAdapter) BuildChainConfig

func (a *CantonExecutorConfigAdapter) BuildChainConfig(ds datastore.DataStore, chainSelector uint64, qualifier string) (ccvexecutor.ChainConfiguration, error)

func (*CantonExecutorConfigAdapter) GetDeployedChains

func (a *CantonExecutorConfigAdapter) GetDeployedChains(ds datastore.DataStore, qualifier string) []uint64

func (*CantonExecutorConfigAdapter) RequiresNodeChainSupportInJD

func (a *CantonExecutorConfigAdapter) RequiresNodeChainSupportInJD() bool

RequiresNodeChainSupportInJD returns false: Canton destination blocks are pushed onto existing EVM ccvexecutor jobs before Canton node chain configs exist in JD.

func (*CantonExecutorConfigAdapter) ResolveExecutorAddress

func (a *CantonExecutorConfigAdapter) ResolveExecutorAddress(ds datastore.DataStore, chainSelector uint64, qualifier string) (string, error)

ResolveExecutorAddress resolves the Canton executor address for the given chain and qualifier from the datastore.

type CantonIndexerConfigAdapter

type CantonIndexerConfigAdapter struct{}

func (*CantonIndexerConfigAdapter) ResolveVerifierAddresses

func (a *CantonIndexerConfigAdapter) ResolveVerifierAddresses(
	ds datastore.DataStore, chainSelector uint64, qualifier string, kind ccvadapters.VerifierKind,
) ([]string, error)

type CantonLaneAdapter

type CantonLaneAdapter struct{}

func (CantonLaneAdapter) GetDefaultGasPrice

func (c CantonLaneAdapter) GetDefaultGasPrice() *big.Int

func (CantonLaneAdapter) GetFQAddress

func (c CantonLaneAdapter) GetFQAddress(ds datastore.DataStore, chainSelector uint64) ([]byte, error)

func (CantonLaneAdapter) GetFeeQuoterDestChainConfig

func (c CantonLaneAdapter) GetFeeQuoterDestChainConfig() lanes.FeeQuoterDestChainConfig

func (CantonLaneAdapter) GetOffRampAddress

func (c CantonLaneAdapter) GetOffRampAddress(ds datastore.DataStore, chainSelector uint64) ([]byte, error)

func (CantonLaneAdapter) GetOnRampAddress

func (c CantonLaneAdapter) GetOnRampAddress(ds datastore.DataStore, chainSelector uint64) ([]byte, error)

func (CantonLaneAdapter) GetRouterAddress

func (c CantonLaneAdapter) GetRouterAddress(ds datastore.DataStore, chainSelector uint64) ([]byte, error)

type CantonMCMSReader

type CantonMCMSReader struct{}

func (*CantonMCMSReader) GetChainMetadata

func (r *CantonMCMSReader) GetChainMetadata(
	e cldf.Environment,
	chainSelector uint64,
	input ccipmcms.Input,
) (mcms_types.ChainMetadata, error)

func (*CantonMCMSReader) GetMCMSRef

func (r *CantonMCMSReader) GetMCMSRef(
	e cldf.Environment,
	chainSelector uint64,
	input ccipmcms.Input,
) (datastore.AddressRef, error)

func (*CantonMCMSReader) GetTimelockRef

func (r *CantonMCMSReader) GetTimelockRef(
	e cldf.Environment,
	chainSelector uint64,
	input ccipmcms.Input,
) (datastore.AddressRef, error)

type CantonTokenAdapter

type CantonTokenAdapter struct{}

func (CantonTokenAdapter) AddressRefToBytes

func (c CantonTokenAdapter) AddressRefToBytes(ref datastore.AddressRef) ([]byte, error)

func (CantonTokenAdapter) DeployTokenVerify

func (CantonTokenAdapter) DeriveTokenAddress

func (c CantonTokenAdapter) DeriveTokenAddress(e deployment.Environment, chainSelector uint64, poolRef datastore.AddressRef) (string, error)

func (CantonTokenAdapter) DeriveTokenDecimals

func (c CantonTokenAdapter) DeriveTokenDecimals(e deployment.Environment, chainSelector uint64, poolRef datastore.AddressRef, token []byte) (uint8, error)

func (CantonTokenAdapter) DeriveTokenPoolCounterpart

func (c CantonTokenAdapter) DeriveTokenPoolCounterpart(e deployment.Environment, chainSelector uint64, tokenPool []byte, token []byte) ([]byte, error)

type CantonTransferOwnershipAdapter

type CantonTransferOwnershipAdapter struct{}

CantonTransferOwnershipAdapter satisfies the cross-family deploy-chain-contracts timelock transfer hook. Canton CCIP contracts record mcms/ccipOwner on-ledger at deploy time (factory choices / proposal-driven deploy); they do not use the EVM Ownable2Step + timelock accept path.

func (*CantonTransferOwnershipAdapter) InitializeTimelockAddress

func (a *CantonTransferOwnershipAdapter) InitializeTimelockAddress(_ cldf.Environment, _ mcms.Input) error

func (*CantonTransferOwnershipAdapter) ShouldAcceptOwnershipWithTransferOwnership

func (a *CantonTransferOwnershipAdapter) ShouldAcceptOwnershipWithTransferOwnership(_ cldf.Environment, _ ccipdeploy.TransferOwnershipPerChainInput) (bool, error)

type CantonVerifierJobConfigAdapter

type CantonVerifierJobConfigAdapter struct{}

func (*CantonVerifierJobConfigAdapter) GetSignerAddressFamily

func (a *CantonVerifierJobConfigAdapter) GetSignerAddressFamily() string

GetSignerAddressFamily implements adapters.VerifierConfigAdapter.

func (*CantonVerifierJobConfigAdapter) ResolveVerifierContractAddresses

func (a *CantonVerifierJobConfigAdapter) ResolveVerifierContractAddresses(
	ds datastore.DataStore,
	chainSelector uint64,
	committeeQualifier string,
	executorQualifier string,
) (*ccvadapters.VerifierContractAddresses, error)

ResolveVerifierContractAddresses implements adapters.VerifierConfigAdapter.

type OutboundDestFeeOverrides

type OutboundDestFeeOverrides struct {
	MessageNetworkFeeUSDCents *uint16
	TokenNetworkFeeUSDCents   *uint16
	DefaultTokenFeeUSDCents   *uint16
}

OutboundDestFeeOverrides sets Canton→remote dest fee fields for outbound hardening.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL