ccvchain

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2026 License: MIT Imports: 70 Imported by: 0

Documentation

Overview

Package ccvchain implements the Stellar chain for chainlink-ccv devenv (runtime wiring lives in other files in this package).

Registration relationship with deployment/adapters/init.go:

  • That package’s init registers Stellar with chainlink-ccip CCIP 2.0 tooling, shared registries (MCMS, fees, tokens, curse), and chainlink-ccv/deployment/adapters.

  • This file registers chainlink-ccv/build/devenv-only hooks via RegisterStellarDevenvComponents (modifiers, ImplFactory, CLDF provider, extra-args serializers, chain config loader).

This package blank-imports deployment/adapters so its init runs as soon as ccvchain loads. Loading ccvchain does not call RegisterStellarDevenvComponents; devenv mains and tests must invoke RegisterStellarDevenvComponents or RegisterStellarComponents for those hooks.

Index

Constants

View Source
const CcipReceiverContractType = stellarccip.CcipReceiverContractType

CcipReceiverContractType is the datastore contract type for the example CCIP receiver deployed on Stellar so that GetEOAReceiverAddress can return a valid Wasm contract address in tests.

View Source
const LockReleaseTokenPoolContractType = stellarccip.LockReleaseTokenPoolContractType
View Source
const TokenAdminRegistryContractType = stellarccip.TokenAdminRegistryContractType

Variables

This section is empty.

Functions

func NewCLDFProviderFactory

func NewCLDFProviderFactory() chainreg.CLDFProviderFactory

NewCLDFProviderFactory returns a chainreg.CLDFProviderFactory that creates an initialized Stellar CLDF BlockChain provider from a blockchain.Input.

func RegisterStellarComponents

func RegisterStellarComponents()

RegisterStellarComponents is an alias for RegisterStellarDevenvComponents.

func RegisterStellarDevenvComponents

func RegisterStellarDevenvComponents()

RegisterStellarDevenvComponents registers Stellar with chainlink-ccv **build/devenv** (chain config loader, modifiers, ImplFactory, CLDF provider, extra-args serializers). It does not replace deployment/adapters init; see package doc.

func ResolveEVMTokenPoolForStellar

func ResolveEVMTokenPoolForStellar(refs []datastore.AddressRef, chainSelector uint64) (pool, token datastore.AddressRef, found bool)

ResolveEVMTokenPoolForStellar selects the EVM token/pool pair used for EVM-to-Stellar token transfers. Prefer BurnMint -> LockRelease combinations because the Stellar test pool is lock-release, then fall back to any BurnMint pool with a matching test token.

func StellarChainConfigLoader

func StellarChainConfigLoader(outputs []*blockchain.Output) (map[string]any, error)

StellarChainConfigLoader is a [chainconfig.ChainConfigLoader] that returns placeholder blockchain info for each Stellar chain in outputs.

The committee verifier service calls this to hydrate its per-chain configuration before the verifier container is launched. For Stellar, the real values (network passphrase and Soroban RPC URL) are populated via the bind-mounted config file written by the Stellar modifier; here we return placeholder values so that the framework knows a Stellar chain entry exists for the given selector.

Types

type Chain

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

Chain implements the CCIP17 and CCIP17Configuration interfaces for Stellar/Soroban.

func New

func New(logger zerolog.Logger, selector uint64) *Chain

New creates a new Stellar Chain instance.

func (*Chain) BuildChainMessage

BuildChainMessage implements cciptestinterfaces.ChainAsSource.

The pre-2026-04-27 signature took a destination chain selector and a MessageOptions struct, and the source was responsible for serialising the extra args. The new signature receives pre-serialised GenericExtraArgs from the caller (load gun / scenario / CLI) along with destination-family awareness via the (family, version) lookup. For Stellar-as-source the pre-serialised extra args are not directly usable because the Stellar OnRamp expects Soroban GenericExtraArgsV3 XDR rather than the destination's wire format, so we ignore the provided extraArgs and re-encode using the Stellar-side helper.

func (*Chain) CCIPDevenvHost

func (c *Chain) CCIPDevenvHost() stellarccip.CCIPDevenvHost

CCIPDevenvHost returns the Soroban devenv host used by github.com/smartcontractkit/chainlink-stellar/deployment/sequences.DeployStellarCCIPContracts, github.com/smartcontractkit/chainlink-stellar/deployment/ccip.DeployLockReleaseTestTokenPool, and sequences when building from CLDF BlockChains.

func (*Chain) ChainFamily

func (c *Chain) ChainFamily() string

ChainFamily implements cciptestinterfaces.CCIP17Configuration.

func (*Chain) ChainSelector

func (c *Chain) ChainSelector() uint64

ChainSelector implements cciptestinterfaces.CCIP17. Returns the selector for this chain.

func (*Chain) ConfigureNodes

func (c *Chain) ConfigureNodes(ctx context.Context, bc *blockchain.Input) (string, error)

ConfigureNodes implements cciptestinterfaces.CCIP17Configuration. Returns TOML configuration for Chainlink nodes to connect to Stellar.

func (*Chain) ConfirmExecOnDest

ConfirmExecOnDest implements cciptestinterfaces.Chain.

func (*Chain) ConfirmSendOnSource

ConfirmSendOnSource implements cciptestinterfaces.Chain.

func (*Chain) DeployLocalNetwork

func (c *Chain) DeployLocalNetwork(ctx context.Context, input *blockchain.Input) (*blockchain.Output, error)

DeployLocalNetwork implements cciptestinterfaces.CCIP17Configuration. Deploys a local Stellar network for testing.

func (*Chain) DeployStellarCCIPContracts

func (c *Chain) DeployStellarCCIPContracts(ctx context.Context, opBundle cldf_ops.Bundle, allSelectors []uint64, selector uint64, topology *ccvdeployment.EnvironmentTopology, existingAddresses []datastore.AddressRef) (seq_core.OnChainOutput, error)

DeployStellarCCIPContracts runs the sequences-based full Soroban CCIP deploy and returns output for the shared DeployChainContracts changeset merge path. opBundle is the CLDF bundle from the executing sequence (same bundle as nested ExecuteOperation). topology must be non-nil (with NOP data): Stellar full deploy configures committee verifier signature quorum from the converted offchain topology.

func (*Chain) ExposeMetrics

func (c *Chain) ExposeMetrics(ctx context.Context, source, dest uint64) ([]string, *prometheus.Registry, error)

ExposeMetrics implements cciptestinterfaces.CCIP17. Exposes Prometheus metrics for monitoring.

func (*Chain) FeeQuoterClient

func (c *Chain) FeeQuoterClient() *fqbindings.FeeQuoterClient

FeeQuoterClient returns the FeeQuoter contract client, or nil if deploy has not initialized it yet.

func (*Chain) FundAddresses

func (c *Chain) FundAddresses(ctx context.Context, input *blockchain.Input, addresses []protocol.UnknownAddress, nativeAmount *big.Int) error

FundAddresses implements cciptestinterfaces.CCIP17Configuration. Funds addresses with native Stellar Lumens (XLM). Addresses that are not exactly 32 bytes (ed25519 public keys) are silently skipped.

func (*Chain) FundNodes

func (c *Chain) FundNodes(ctx context.Context, cls []*simple_node_set.Input, bc *blockchain.Input, linkAmount, nativeAmount *big.Int) error

FundNodes implements cciptestinterfaces.CCIP17Configuration. Funds Chainlink nodes with XLM and LINK tokens.

func (*Chain) GetChainLaneProfile

func (c *Chain) GetChainLaneProfile(_ *deployment.Environment, selector uint64) (cciptestinterfaces.ChainLaneProfile, error)

GetChainLaneProfile implements cciptestinterfaces.OnChainConfigurable. Returns the lane profile for Stellar as a destination chain, mirroring the values used in GetConnectionProfile and stellarFeeQuoterDestChainConfigOverride.

func (*Chain) GetConnectionProfile

GetConnectionProfile implements cciptestinterfaces.OnChainConfigurable. Returns a ChainDefinition describing this Stellar chain as a lane endpoint, plus the default committee verifier config to apply for each remote chain.

func (*Chain) GetDeployChainContractsCfg

func (c *Chain) GetDeployChainContractsCfg(env *deployment.Environment, selector uint64, topology *ccvdeployment.EnvironmentTopology) (ccipChangesets.DeployChainContractsPerChainCfg, error)

GetDeployChainContractsCfg implements cciptestinterfaces.OnChainConfigurable.

func (*Chain) GetEOAReceiverAddress

func (c *Chain) GetEOAReceiverAddress() (protocol.UnknownAddress, error)

GetEOAReceiverAddress implements cciptestinterfaces.CCIP17. On Stellar, CCIP receivers must be deployed Wasm contracts (the OffRamp checks executable() on the receiver address). This returns the address of the ccip_receiver_example contract deployed during DeployContractsForSelector. TODO: check if this assumption is always correct or if it only applies to arbitrary messages?

func (*Chain) GetExecutorArgs

func (c *Chain) GetExecutorArgs(opts any) (cciptestinterfaces.MessageV3ExecutorArgs, error)

GetExecutorArgs implements cciptestinterfaces.MessageV3Destination. Returns empty executor args for Stellar (executor args are destination-specific).

func (*Chain) GetExpectedNextSequenceNumber

func (c *Chain) GetExpectedNextSequenceNumber(ctx context.Context, to uint64) (uint64, error)

GetExpectedNextSequenceNumber implements cciptestinterfaces.CCIP17. Gets the expected next sequence number for messages to the specified destination.

func (*Chain) GetMaxDataBytes

func (c *Chain) GetMaxDataBytes(ctx context.Context, remoteChainSelector uint64) (uint32, error)

GetMaxDataBytes implements cciptestinterfaces.CCIP17. Gets the maximum data size for a CCIP message to the specified remote chain.

func (*Chain) GetReceiverContractAddress

func (c *Chain) GetReceiverContractAddress() (string, error)

GetReceiverContractAddress returns the CCIP receiver contract ID deployed during DeployContractsForSelector.

func (*Chain) GetSenderAddress

func (c *Chain) GetSenderAddress() (protocol.UnknownAddress, error)

GetSenderAddress implements cciptestinterfaces.CCIP17. Gets the sender address for this chain (the deployer's address).

func (*Chain) GetSupportedPools

func (c *Chain) GetSupportedPools() []devenvcommon.PoolCapability

GetSupportedPools returns the pool types and versions the Stellar chain can deploy. Returning nil keeps Stellar out of the ComputeTokenCombinations matrix (Stellar pool pairing is handled in PostConnect, not via the shared TokenExpansion / ConfigureTokensForTransfers pipeline).

func (*Chain) GetTokenAddress

func (c *Chain) GetTokenAddress() (string, error)

GetTokenAddress returns the SAC contract ID of the test token deployed during DeployContractsForSelector, or an error if no token was deployed.

func (*Chain) GetTokenArgs

func (c *Chain) GetTokenArgs(opts any) (cciptestinterfaces.MessageV3TokenArgs, error)

GetTokenArgs implements cciptestinterfaces.MessageV3Destination. Returns empty token args for Stellar (token args are destination-specific).

func (*Chain) GetTokenBalance

func (c *Chain) GetTokenBalance(ctx context.Context, address, tokenAddress protocol.UnknownAddress) (*big.Int, error)

GetTokenBalance implements cciptestinterfaces.CCIP17. Gets the balance of a token for a raw Stellar account address by calling the SAC balance function. Use GetTokenBalanceForAddress for contract holders.

func (*Chain) GetTokenBalanceForAddress

func (c *Chain) GetTokenBalanceForAddress(ctx context.Context, holderAddress string, tokenAddress protocol.UnknownAddress) (*big.Int, error)

GetTokenBalanceForAddress gets a token balance for a typed Stellar holder address. Use this for contract holders, because raw 32-byte Stellar addresses do not carry the Soroban account-vs-contract address tag.

func (*Chain) GetTokenExpansionConfigs

GetTokenExpansionConfigs returns nil because Stellar deploys its own test token and lock-release pool in PostDeployContractsForSelector.

func (*Chain) GetTokenReceiver

func (c *Chain) GetTokenReceiver(opts any) (cciptestinterfaces.MessageV3TokenReceiver, error)

GetTokenReceiver implements cciptestinterfaces.MessageV3Destination. Returns nil for Stellar as token receiver is typically the same as message receiver.

func (*Chain) GetTokenTransferConfigs

GetTokenTransferConfigs returns nil because Stellar-EVM cross-chain pool pairing is wired in PostConnect rather than through the shared ConfigureAllTokenTransfers pipeline. The shared pipeline requires strict symmetric grouping by pool identity, which does not align with the asymmetric LockRelease (Stellar) <-> BurnMint (EVM) pairing model.

func (*Chain) ManuallyExecuteMessage

func (c *Chain) ManuallyExecuteMessage(ctx context.Context, message protocol.Message, gasLimit uint64, ccvs []protocol.UnknownAddress, verifierResults [][]byte) (cciptestinterfaces.ExecutionStateChangedEvent, error)

ManuallyExecuteMessage implements cciptestinterfaces.CCIP17. Manually executes a CCIP message on this chain.

func (*Chain) NativeBalance

func (c *Chain) NativeBalance(ctx context.Context, address protocol.UnknownAddress) (*big.Int, error)

func (*Chain) NetworkPassphrase

func (c *Chain) NetworkPassphrase() string

NetworkPassphrase returns the network passphrase for this chain.

func (*Chain) PostConnect

func (c *Chain) PostConnect(env *deployment.Environment, selector uint64, remoteSelectors []uint64) error

PostConnect implements cciptestinterfaces.OnChainConfigurable. Runs Stellar-specific setup after the centralized lane configuration changeset has connected all chains (e.g. Router onramp/offramp mappings).

func (*Chain) PostDeployContractsForSelector

func (c *Chain) PostDeployContractsForSelector(ctx context.Context, env *deployment.Environment, selector uint64, topology *ccvdeployment.EnvironmentTopology) (datastore.DataStore, error)

PostDeployContractsForSelector implements cciptestinterfaces.OnChainConfigurable. Post-deploy parity with EVM: deploys legacy + siloed lock-release test pools (with token lock box), applies FeeQuoter pricing for the test token (stellarccip.ApplyFeeQuoterTestTokenConfig), and returns a datastore delta with siloed pool, legacy pool, lock box, and test token AddressRefs.

func (*Chain) PostTokenDeploy

func (c *Chain) PostTokenDeploy(
	_ *deployment.Environment,
	_ uint64,
	_ []datastore.AddressRef,
) error

PostTokenDeploy is a no-op; Stellar handles post-deploy work in PostDeployContractsForSelector (FeeQuoter pricing, TAR registration).

func (*Chain) PreDeployContractsForSelector

func (c *Chain) PreDeployContractsForSelector(ctx context.Context, env *deployment.Environment, selector uint64, topology *ccvdeployment.EnvironmentTopology) (datastore.DataStore, error)

PreDeployContractsForSelector implements cciptestinterfaces.OnChainConfigurable. Stellar has no CREATE2-style pre-bootstrap like EVM; this stage only applies topology fixes that must run before the shared DeployChainContracts changeset (adapter path).

func (*Chain) SendChainMessage

SendChainMessage implements cciptestinterfaces.ChainAsSource. msg must be the routerbindings.StellarToAnyMessage returned from BuildChainMessage.

func (*Chain) SendMessage

SendMessage implements cciptestinterfaces.Chain.

DEPRECATED upstream in chainlink-ccv changelog/2026-04-27_extra_args_data_provider.md. New callers should use BuildChainMessage + SendChainMessage directly.

Stellar-as-source builds its own Soroban GenericExtraArgsV3 XDR blob inside BuildChainMessage and ignores the provider-shaped extra args supplied here, so we accept any ExtraArgsDataProvider and any messageVersion without type-asserting.

func (*Chain) StellarDepsForDeploy

func (c *Chain) StellarDepsForDeploy() stellardeps.StellarDeps

StellarDepsForDeploy returns CLDF Stellar operation dependencies from this chain's deployer (same role as passing evm.Chain into EVM ops).

func (*Chain) TransferNative

func (c *Chain) TransferNative(ctx context.Context, from, to protocol.UnknownAddress, amount *big.Int) error

type ImplFactory

type ImplFactory struct{}

ImplFactory creates Stellar CCIP17 chain implementations. It implements [registry.ImplFactory] and is registered with the global factory registry via RegisterImplFactory(chainsel.FamilyStellar, NewImplFactory()).

func NewImplFactory

func NewImplFactory() *ImplFactory

NewImplFactory returns a new Stellar ImplFactory.

func (*ImplFactory) DefaultFeeAggregator

func (f *ImplFactory) DefaultFeeAggregator(env *deployment.Environment, chainSelector uint64) string

DefaultFeeAggregator implements chainreg.ImplFactory. Returns the CLDF Stellar deployer account address when topology omits fee_aggregator for this chain.

func (*ImplFactory) DefaultSignerKey

func (f *ImplFactory) DefaultSignerKey(keys ccvservices.BootstrapKeys) string

DefaultSignerKey returns the default verifier-result signer key for this chain family given the bootstrap keys from a verifier node. devenv calls this from enrichEnvironmentTopology; the returned address is recorded in the verifier's commit.Config.SignerAddress and ends up as the signer expected by the on-chain committee_verifier.

Despite Stellar transmitting Soroban transactions with an Ed25519 keypair, the committee_verifier contract on Stellar stores 20-byte ETH-style signer addresses (see contracts/common/verifier ETH_ADDRESS_OFFSET and ccv/chain/adapter/aggregator_config_adapter.go reading signer[12:32]). That means the verifier signs results with its ECDSA key — the same one EVM verifiers use — so we return keys.ECDSAAddress here. The Stellar Ed25519 transmitter / deployer keypair is a separate concern handled by the accessor's KeystoreSetter path.

Pre-2026-05-01 this read keys.EdDSAPublicKey and produced a Stellar G... address, but that never matched the 20-byte ETH-style on-chain entry; the fallback "fetch signing keys from JD" path masked the mismatch. With chainlink-ccv changelog/2026-05-01_executor_keystore_transmitter.md the EdDSA field was removed from BootstrapKeys, so we now return the correct ECDSA address directly.

func (*ImplFactory) New

New implements chainreg.ImplFactory. Returns a fully initialised Chain for test interactions against an already-deployed network. It reconstructs all necessary state (RPC client, deployer keypair, OnRamp client) from the CLDF environment chain entry and the deployment datastore.

func (*ImplFactory) NewEmpty

NewEmpty implements chainreg.ImplFactory. Returns a bare Chain used by NewEnvironment() to call DeployLocalNetwork and the shared DeployChainContracts path (Pre/GetDeployChainContractsCfg/Post).

func (*ImplFactory) SupportsFunding

func (f *ImplFactory) SupportsFunding() bool

SupportsFunding reports whether this chain family supports native token funding of executor addresses. Families that lack on-chain transfer primitives in devenv (e.g. Canton) return false.

type StellarSendOptions

type StellarSendOptions struct{}

StellarSendOptions is the cciptestinterfaces.ChainSendOption implementation for Stellar. Fields may be extended (e.g. alternate signer); unknown sendOption values are ignored.

func (StellarSendOptions) IsSendOption

func (StellarSendOptions) IsSendOption()

IsSendOption implements cciptestinterfaces.ChainSendOption.

Per chainlink-ccv changelog/2026-04-27_extra_args_data_provider.md the marker no longer returns a bool — the previous return value was never inspected.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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