sequences

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: 65 Imported by: 0

Documentation

Overview

Package sequences defines CLDF deployment sequences for Stellar CCIP.

Deploy chain contracts uses cldf_chain.BlockChains as the dependency type to match chainlink-ccip deployment/v2_0_0 adapter contracts. The sequence builds deployment/operations/stellardeps.StellarDeps and a CCIP devenv host from the CLDF Stellar chain entry, loads stashed offchain topology via TakeStellarDeployOffchainTopologyForSelector, then runs RunStellarCCIPFullDeploy. A missing stash fails: committee verifier [ApplySignatureConfigs] needs NOP signer data from that topology (registered in CCV PreDeployContractsForSelector). RunStellarCCIPFullDeployForCCV converts CCV environment topology and is used by ccv/chain; both paths require non-nil topology with NOP data for signature quorum. The sequence return type matches chainlink-ccip/deployment/v2_0_0/adapters.DeployChainContractsAdapter for the module version in go.mod. DeployStellarCCIPInnerInput carries ExistingAddresses from the CCIP changeset input so deploy can seed the in-memory datastore like EVM ExistingAddresses. AllSelectors lists every chain selector in the environment (derived from BlockChains in the adapter sequence).

Index

Constants

View Source
const StellarSetFeeAggregatorSequenceID = "stellar-set-fee-aggregator"

StellarSetFeeAggregatorSequenceID is the pipeline sequence ID for SetFeeAggregator on Stellar (OnRamp, VVR, Committee Verifier). Use [StellarFeeAggregatorAdapter.SetFeeAggregator], which wraps ApplyStellarFeeAggregator with the cldf.Environment needed for datastore lookups.

Variables

View Source
var DeployStellarMCMS = cldfops.NewSequence(
	"stellar-deploy-mcms",
	deploy.MCMSVersion,
	"Deploy single Soroban MCMS, set config, then deploy and initialize RBACTimelock (MCMS as proposer/bypasser/canceller)",
	func(b cldfops.Bundle, chains cldfchain.BlockChains, in deploy.MCMSDeploymentConfigPerChainWithAddress) (seqcore.OnChainOutput, error) {
		ch, ok := chains.StellarChains()[in.ChainSelector]
		if !ok {
			return seqcore.OnChainOutput{}, fmt.Errorf("stellar chain %d not found in environment", in.ChainSelector)
		}
		qual := mcmsutil.QualifierStr(in.Qualifier)
		merged, err := mcmsutil.MergeTripleMCMSConfig(in.Proposer, in.Bypasser, in.Canceller)
		if err != nil {
			return seqcore.OnChainOutput{}, err
		}
		signerAddrs, signerGroups, gq, gp, _, err := mcmsutil.ConfigToStellarSetConfig(merged, true)
		if err != nil {
			return seqcore.OnChainOutput{}, err
		}

		dep, err := stellarDeployerFromChain(ch)
		if err != nil {
			return seqcore.OnChainOutput{}, err
		}
		deps := stellardeps.FromDeployer(dep)

		contractID, _ := mcmsutil.FindExistingStellarMCMS(in.ExistingAddresses, in.ChainSelector, qual)
		if contractID == "" {
			wasmPath, err := mcmsutil.ResolveMCMSWasmPath()
			if err != nil {
				return seqcore.OnChainOutput{}, err
			}
			salt := mcmsutil.MCMSDeploySalt(in.ChainSelector, qual)
			depOut, err := cldfops.ExecuteOperation(b, mcmsops.Deploy, deps, stellarops.DeployInput{WasmPath: wasmPath, Salt: salt})
			if err != nil {
				return seqcore.OnChainOutput{}, fmt.Errorf("mcms deploy: %w", err)
			}
			contractID = depOut.Output.ContractID
			_, err = cldfops.ExecuteOperation(b, mcmsops.Initialize, deps, mcmsops.InitializeInput{
				ContractID:     contractID,
				Owner:          ch.Signer.Address(),
				ChainNetworkID: mcmsutil.ChainNetworkID(ch.NetworkPassphrase),
			})
			if err != nil {
				return seqcore.OnChainOutput{}, fmt.Errorf("mcms initialize: %w", err)
			}
		}

		_, err = cldfops.ExecuteOperation(b, mcmsops.SetConfig, deps, mcmsops.SetConfigInput{
			ContractID:      contractID,
			SignerAddresses: signerAddrs,
			SignerGroups:    signerGroups,
			GroupQuorums:    gq,
			GroupParents:    gp,
			ClearRoot:       true,
		})
		if err != nil {
			return seqcore.OnChainOutput{}, fmt.Errorf("mcms set_config: %w", err)
		}

		mcmsRefs := mcmsutil.StellarMCMSDatastoreRefs(in.ChainSelector, qual, contractID)
		mergedRefs := append(append([]datastore.AddressRef{}, in.ExistingAddresses...), mcmsRefs...)
		tlID, haveTL := mcmsutil.FindExistingStellarTimelock(mergedRefs, in.ChainSelector, qual)
		if !haveTL {
			tlWasm, err := mcmsutil.ResolveTimelockWasmPath()
			if err != nil {
				return seqcore.OnChainOutput{}, err
			}
			tlSalt := mcmsutil.TimelockDeploySalt(in.ChainSelector, qual)
			tlOut, err := cldfops.ExecuteOperation(b, timelockops.Deploy, deps, stellarops.DeployInput{WasmPath: tlWasm, Salt: tlSalt})
			if err != nil {
				return seqcore.OnChainOutput{}, fmt.Errorf("timelock deploy: %w", err)
			}
			tlID = tlOut.Output.ContractID
			admin, err := stellarTimelockAdmin(in, ch)
			if err != nil {
				return seqcore.OnChainOutput{}, err
			}
			var minDelay uint64
			if in.TimelockMinDelay != nil {
				if !in.TimelockMinDelay.IsUint64() {
					return seqcore.OnChainOutput{}, fmt.Errorf("timelockMinDelay must fit uint64")
				}
				minDelay = in.TimelockMinDelay.Uint64()
			}
			roleHolders := []string{contractID}
			_, err = cldfops.ExecuteOperation(b, timelockops.Initialize, deps, timelockops.InitializeInput{
				ContractID: tlID,
				MinDelay:   minDelay,
				Admin:      admin,
				Proposers:  roleHolders,
				Executors:  []string{},
				Cancellers: roleHolders,
				Bypassers:  roleHolders,
			})
			if err != nil {
				return seqcore.OnChainOutput{}, fmt.Errorf("timelock initialize: %w", err)
			}
		}

		out := append(mcmsRefs, mcmsutil.StellarTimelockDatastoreRef(in.ChainSelector, qual, tlID))
		return seqcore.OnChainOutput{Addresses: out}, nil
	},
)

DeployStellarMCMS deploys a single Soroban MCMS instance and applies the merged signer config.

View Source
var FinalizeStellarDeployMCMS = cldfops.NewSequence(
	"stellar-finalize-deploy-mcms",
	deploy.MCMSVersion,
	"No-op finalize for Stellar MCMS (initialize is synchronous with deploy)",
	func(b cldfops.Bundle, chains cldfchain.BlockChains, in deploy.MCMSDeploymentConfigPerChainWithAddress) (seqcore.OnChainOutput, error) {
		return seqcore.OnChainOutput{}, nil
	},
)

FinalizeStellarDeployMCMS is a no-op (initialize runs in DeployStellarMCMS).

View Source
var GrantAdminRoleToTimelockStellar = cldfops.NewSequence(
	"stellar-grant-admin-role-to-timelock",
	deploy.MCMSVersion,
	"No-op: Stellar has no CallProxy executor grant step (EVM parity stub)",
	func(b cldfops.Bundle, chains cldfchain.BlockChains, in deploy.GrantAdminRoleToTimelockConfigPerChainWithSelector) (seqcore.OnChainOutput, error) {
		return seqcore.OnChainOutput{}, nil
	},
)

GrantAdminRoleToTimelockStellar is a no-op (no Stellar CallProxy; timelock executors can be added in a follow-up).

View Source
var SequenceVersion = semver.MustParse("2.0.0")

SequenceVersion is the semver for Stellar CCIP deployment sequences aligned with deployment/v2_0_0 adapters.

View Source
var StellarAcceptOwnership = cldfops.NewSequence(
	"stellar-seq-accept-ownership",
	deploy.MCMSVersion,
	"Accepts Soroban contract ownership via MCMS or deployer",
	func(b cldfops.Bundle, chains cldfchain.BlockChains, in StellarTransferOwnershipInput) (output seqcore.OnChainOutput, err error) {
		ch, ok := chains.StellarChains()[in.ChainSelector]
		if !ok {
			return output, fmt.Errorf("stellar chain %d not found in environment", in.ChainSelector)
		}
		dep, err := stellardeployment.NewDeployerFromChain(ch)
		if err != nil {
			return output, err
		}
		deps := stellardeps.FromDeployer(dep)
		deployerAddr := dep.SignerAddress()
		ctx := b.GetContext()

		for _, ref := range in.ContractRef {
			owner, err := ownership.ContractOwner(ctx, deps, ref)
			if err != nil {
				return output, fmt.Errorf("read owner %s: %w", ref.Address, err)
			}
			if owner == in.ProposedOwner {
				continue
			}
			var wo evmcontract.WriteOutput
			switch {
			case in.ProposedOwner == deployerAddr:
				if err := ownership.ExecuteAcceptOwnership(b, deps, ref); err != nil {
					return output, fmt.Errorf("accept ownership %s: %w", ref.Address, err)
				}
				wo = evmcontract.WriteOutput{
					ChainSelector: in.ChainSelector,
					ExecInfo:      &evmcontract.ExecInfo{Hash: "stellar-direct-accept"},
				}
			case in.ProposedOwner == in.GovernanceAddr:
				data, err := mcmsutil.EncodeSorobanMCMSInvokePayload("accept_ownership", nil)
				if err != nil {
					return output, err
				}
				wo = evmcontract.WriteOutput{
					ChainSelector: in.ChainSelector,
					Tx: mcmstypes.Transaction{
						OperationMetadata: mcmstypes.OperationMetadata{
							ContractType: string(ref.Type),
						},
						To:               ref.Address,
						Data:             data,
						AdditionalFields: stellarMCMSTxAdditionalFields(),
					},
				}
			default:
				return output, fmt.Errorf(
					"accept routing: proposed owner %q must be deployer %q or governance %q for %s",
					in.ProposedOwner, deployerAddr, in.GovernanceAddr, ref.Address,
				)
			}
			batchOp, err := evmcontract.NewBatchOperationFromWrites([]evmcontract.WriteOutput{wo})
			if err != nil {
				return output, err
			}
			output.BatchOps = append(output.BatchOps, batchOp)
		}
		return output, nil
	},
)

StellarAcceptOwnership mirrors EVM OpAcceptOwnership: deployer accepts directly; when the pending owner is the timelock (governance), emit an MCMS batch op — no timelock==MCMS check.

View Source
var StellarApplyDestChainConfig = cldfops.NewSequence(
	"stellar-apply-dest-chain-config",
	stellarops.ContractDeploymentVersion,
	"Apply dest chain config updates on Stellar FeeQuoter",
	func(b cldfops.Bundle, chains cldfchain.BlockChains, in StellarApplyDestChainConfigInput) (seqcore.OnChainOutput, error) {
		ch, ok := chains.StellarChains()[in.Selector]
		if !ok {
			return seqcore.OnChainOutput{}, fmt.Errorf("stellar chain %d not found", in.Selector)
		}
		dep, err := stellardeployment.NewDeployerFromChain(ch)
		if err != nil {
			return seqcore.OnChainOutput{}, err
		}
		deps := stellardeps.FromDeployer(dep)

		var cfgArgs []fqbindings.DestChainConfigArgs
		for destSel, cfg := range in.Settings {
			cfgArgs = append(cfgArgs, fqbindings.DestChainConfigArgs{
				DestChainSelector: destSel,
				Config: fqbindings.DestChainConfig{
					IsEnabled:             cfg.IsEnabled,
					MaxDataBytes:          cfg.MaxDataBytes,
					MaxPerMsgGasLimit:     cfg.MaxPerMsgGasLimit,
					DestGasOverhead:       cfg.DestGasOverhead,
					DestGasPerPayloadByte: uint32(cfg.DestGasPerPayloadByteBase),
					DefaultTokenFeeUsd:    uint32(cfg.DefaultTokenFeeUSDCents),
					DefaultTokenDestGas:   cfg.DefaultTokenDestGasOverhead,
					DefaultTxGasLimit:     cfg.DefaultTxGasLimit,
					NetworkFeeUsdCents:    uint32(cfg.NetworkFeeUSDCents),
					LinkPremiumPercent:    uint32(cfg.V2Params.LinkFeeMultiplierPercent),
				},
			})
		}
		if len(cfgArgs) == 0 {
			return seqcore.OnChainOutput{}, nil
		}
		_, err = cldfops.ExecuteOperation(b, fqops.ApplyDestChainConfigs, deps, fqops.ApplyDestChainConfigsInput{
			ContractID: in.FQContractID,
			Configs:    cfgArgs,
		})
		if err != nil {
			return seqcore.OnChainOutput{}, fmt.Errorf("apply dest chain configs on chain %d: %w", in.Selector, err)
		}
		return seqcore.OnChainOutput{}, nil
	},
)

StellarApplyDestChainConfig applies destination chain configs on the Stellar FeeQuoter.

View Source
var StellarCurse = cldfops.NewSequence(
	"stellar-curse-rmn-remote",
	stellarops.ContractDeploymentVersion,
	"Curse subjects on Stellar RMN Remote",
	func(b cldfops.Bundle, chains cldfchain.BlockChains, in StellarCurseInput) (seqcore.OnChainOutput, error) {
		ch, ok := chains.StellarChains()[in.ChainSelector]
		if !ok {
			return seqcore.OnChainOutput{}, fmt.Errorf("stellar chain %d not found", in.ChainSelector)
		}
		dep, err := stellardeployment.NewDeployerFromChain(ch)
		if err != nil {
			return seqcore.OnChainOutput{}, err
		}
		deps := stellardeps.FromDeployer(dep)
		_, err = cldfops.ExecuteOperation(b, rmnremoteops.Curse, deps, rmnremoteops.CurseInput{
			ContractID: in.RMNContractID,
			Caller:     dep.SignerAddress(),
			Subjects:   in.Subjects,
		})
		if err != nil {
			return seqcore.OnChainOutput{}, fmt.Errorf("curse on chain %d: %w", in.ChainSelector, err)
		}
		return seqcore.OnChainOutput{}, nil
	},
)

StellarCurse curses subjects on a Stellar RMN Remote contract.

View Source
var StellarDeployChainContracts = cldf_ops.NewSequence(
	"stellar-deploy-chain-contracts",
	SequenceVersion,
	"Deploys Stellar Soroban CCIP contracts via CLDF Stellar chain (adapter path); uses pre-stashed offchain topology from CCV pre-deploy when present.",
	func(b cldf_ops.Bundle, chains cldf_chain.BlockChains, input ccvadapters.DeployChainContractsInput) (DeployChainContractsOutput, error) {
		ch, ok := chains.StellarChains()[input.ChainSelector]
		if !ok {
			return DeployChainContractsOutput{}, fmt.Errorf("stellar chain not found for selector %d", input.ChainSelector)
		}
		dep, err := stellardeployment.NewDeployerFromChain(ch)
		if err != nil {
			return DeployChainContractsOutput{}, fmt.Errorf("stellar deployer from chain: %w", err)
		}
		deps := stellardeps.FromDeployer(dep)
		lg := stellarccip.DefaultStellarDeployZerolog()
		host, err := stellarccip.NewCLDFStellarCCIPDevenvHost(ch, lg, dep)
		if err != nil {
			return DeployChainContractsOutput{}, fmt.Errorf("stellar devenv host: %w", err)
		}
		offTopo, _ := TakeStellarDeployOffchainTopologyForSelector(input.ChainSelector)
		if offTopo == nil {
			return DeployChainContractsOutput{}, fmt.Errorf("stellar deploy chain contracts: offchain topology required for selector %d (CCV PreDeployContractsForSelector must call RegisterStellarDeployOffchainTopologyForSelector before DeployChainContracts so committee verifier signature config can be applied)", input.ChainSelector)
		}
		output, err := RunStellarCCIPFullDeploy(b.GetContext(), b, deps, host, offTopo, DeployStellarCCIPInnerInput{
			ChainSelector:     input.ChainSelector,
			AllSelectors:      allSelectorsFromBlockChains(chains),
			ExistingAddresses: input.ExistingAddresses,
		})
		if err != nil {
			return DeployChainContractsOutput{}, err
		}
		return DeployChainContractsOutput{OnChainOutput: output}, nil
	},
)

StellarDeployChainContracts is the adapter sequence: DEP is BlockChains. It builds StellarDeps and a stellarccip.CCIPDevenvHost from the CLDF Stellar chain entry. CCV stashes offchain topology in RegisterStellarDeployOffchainTopologyForSelector during PreDeployContractsForSelector; this sequence TakeStellarDeployOffchainTopologyForSelector before RunStellarCCIPFullDeploy. A missing stash entry fails fast: signature quorum config requires NOP topology.

View Source
var StellarImportConfigForDeployContracts = cldf_ops.NewSequence(
	"stellar-import-config-for-deploy-chain-contracts",
	SequenceVersion,
	"Stellar devenv: pass through user deploy config (no v1.6 import path)",
	func(b cldf_ops.Bundle, chains cldf_chain.BlockChains, input ccvadapters.DeployChainConfigCreatorInput) (ccvadapters.DeployContractParams, error) {
		_ = b
		_ = chains
		return input.UserProvidedConfig, nil
	},
)

StellarImportConfigForDeployContracts passes through user deploy config (no v1.6 import path) for Stellar devenv.

View Source
var StellarSetTokenTransferFee = cldfops.NewSequence(
	"stellar-set-token-transfer-fee",
	stellarops.ContractDeploymentVersion,
	"Set per-token transfer fees on Stellar FeeQuoter",
	func(b cldfops.Bundle, chains cldfchain.BlockChains, in StellarSetTokenTransferFeeInput) (seqcore.OnChainOutput, error) {
		ch, ok := chains.StellarChains()[in.Selector]
		if !ok {
			return seqcore.OnChainOutput{}, fmt.Errorf("stellar chain %d not found", in.Selector)
		}
		dep, err := stellardeployment.NewDeployerFromChain(ch)
		if err != nil {
			return seqcore.OnChainOutput{}, err
		}
		deps := stellardeps.FromDeployer(dep)

		var cfgArgs []fqbindings.TokenFeeConfigArgs
		for destSel, tokenFees := range in.Settings {
			for token, feeArgs := range tokenFees {
				if feeArgs == nil {
					continue
				}
				cfgArgs = append(cfgArgs, fqbindings.TokenFeeConfigArgs{
					DestChainSelector: destSel,
					Token:             token,
					Config: fqbindings.TokenTransferFeeConfig{
						DestBytesOverhead: feeArgs.DestBytesOverhead,
						DestGasOverhead:   feeArgs.DestGasOverhead,
						FeeUsdCents:       feeArgs.MinFeeUSDCents,
						IsEnabled:         feeArgs.IsEnabled,
					},
				})
			}
		}
		if len(cfgArgs) == 0 {
			return seqcore.OnChainOutput{}, nil
		}
		_, err = cldfops.ExecuteOperation(b, fqops.ApplyTokenFeeConfigs, deps, fqops.ApplyTokenFeeConfigsInput{
			ContractID: in.FQContractID,
			AddConfigs: cfgArgs,
		})
		if err != nil {
			return seqcore.OnChainOutput{}, fmt.Errorf("apply token fee configs on chain %d: %w", in.Selector, err)
		}
		return seqcore.OnChainOutput{}, nil
	},
)

StellarSetTokenTransferFee applies per-token transfer fee configs on the Stellar FeeQuoter.

View Source
var StellarTransferOwnershipViaMCMS = cldfops.NewSequence(
	"stellar-seq-transfer-ownership-via-mcms",
	deploy.MCMSVersion,
	"Transfers Soroban contract ownership via MCMS or deployer",
	func(b cldfops.Bundle, chains cldfchain.BlockChains, in StellarTransferOwnershipInput) (output seqcore.OnChainOutput, err error) {
		ch, ok := chains.StellarChains()[in.ChainSelector]
		if !ok {
			return output, fmt.Errorf("stellar chain %d not found in environment", in.ChainSelector)
		}
		dep, err := stellardeployment.NewDeployerFromChain(ch)
		if err != nil {
			return output, err
		}
		deps := stellardeps.FromDeployer(dep)
		deployerAddr := dep.SignerAddress()
		ctx := b.GetContext()

		for _, ref := range in.ContractRef {
			owner, err := ownership.ContractOwner(ctx, deps, ref)
			if err != nil {
				return output, fmt.Errorf("read owner %s: %w", ref.Address, err)
			}
			if owner == in.ProposedOwner {
				continue
			}
			var wo evmcontract.WriteOutput
			switch {
			case owner == deployerAddr:
				if err := ownership.ExecuteTransferOwnership(b, deps, ref, in.ProposedOwner); err != nil {
					return output, fmt.Errorf("transfer ownership %s: %w", ref.Address, err)
				}
				wo = evmcontract.WriteOutput{
					ChainSelector: in.ChainSelector,
					ExecInfo:      &evmcontract.ExecInfo{Hash: "stellar-direct-transfer"},
				}
			case owner == in.GovernanceAddr:
				data, err := mcmsutil.EncodeSorobanMCMSInvokePayload("transfer_ownership", []xdr.ScVal{scval.AddressToScVal(in.ProposedOwner)})
				if err != nil {
					return output, err
				}
				wo = evmcontract.WriteOutput{
					ChainSelector: in.ChainSelector,
					Tx: mcmstypes.Transaction{
						OperationMetadata: mcmstypes.OperationMetadata{
							ContractType: string(ref.Type),
						},
						To:               ref.Address,
						Data:             data,
						AdditionalFields: stellarMCMSTxAdditionalFields(),
					},
				}
			default:
				return output, fmt.Errorf(
					"contract %s owner %q is neither deployer %q nor governance %q",
					ref.Address, owner, deployerAddr, in.GovernanceAddr,
				)
			}
			batchOp, err := evmcontract.NewBatchOperationFromWrites([]evmcontract.WriteOutput{wo})
			if err != nil {
				return output, err
			}
			output.BatchOps = append(output.BatchOps, batchOp)
		}
		return output, nil
	},
)

StellarTransferOwnershipViaMCMS mirrors EVM chains/evm/.../operations/mcms OpTransferOwnership: deployer sends the tx directly; when the current owner is the timelock (governance), emit an MCMS batch op (MCMS is the transport, not compared to timelock).

View Source
var StellarUncurse = cldfops.NewSequence(
	"stellar-uncurse-rmn-remote",
	stellarops.ContractDeploymentVersion,
	"Uncurse subjects on Stellar RMN Remote",
	func(b cldfops.Bundle, chains cldfchain.BlockChains, in StellarCurseInput) (seqcore.OnChainOutput, error) {
		ch, ok := chains.StellarChains()[in.ChainSelector]
		if !ok {
			return seqcore.OnChainOutput{}, fmt.Errorf("stellar chain %d not found", in.ChainSelector)
		}
		dep, err := stellardeployment.NewDeployerFromChain(ch)
		if err != nil {
			return seqcore.OnChainOutput{}, err
		}
		deps := stellardeps.FromDeployer(dep)
		_, err = cldfops.ExecuteOperation(b, rmnremoteops.Uncurse, deps, rmnremoteops.UncurseInput{
			ContractID: in.RMNContractID,
			Subjects:   in.Subjects,
		})
		if err != nil {
			return seqcore.OnChainOutput{}, fmt.Errorf("uncurse on chain %d: %w", in.ChainSelector, err)
		}
		return seqcore.OnChainOutput{}, nil
	},
)

StellarUncurse uncurses subjects on a Stellar RMN Remote contract.

View Source
var UpdateStellarMCMSConfig = cldfops.NewSequence(
	"stellar-update-mcms-config",
	deploy.MCMSVersion,
	"Updates signer config on Stellar MCMS (single instance)",
	func(b cldfops.Bundle, chains cldfchain.BlockChains, in deploy.UpdateMCMSConfigInputPerChainWithSelector) (seqcore.OnChainOutput, error) {
		ch, ok := chains.StellarChains()[in.ChainSelector]
		if !ok {
			return seqcore.OnChainOutput{}, fmt.Errorf("stellar chain %d not found in environment", in.ChainSelector)
		}
		dep, err := stellarDeployerFromChain(ch)
		if err != nil {
			return seqcore.OnChainOutput{}, err
		}
		deps := stellardeps.FromDeployer(dep)
		signerAddrs, signerGroups, gq, gp, _, err := mcmsutil.ConfigToStellarSetConfig(&in.MCMConfig, true)
		if err != nil {
			return seqcore.OnChainOutput{}, err
		}
		for _, ref := range in.MCMContracts {
			if ref.Address == "" {
				continue
			}
			_, err := cldfops.ExecuteOperation(b, mcmsops.SetConfig, deps, mcmsops.SetConfigInput{
				ContractID:      ref.Address,
				SignerAddresses: signerAddrs,
				SignerGroups:    signerGroups,
				GroupQuorums:    gq,
				GroupParents:    gp,
				ClearRoot:       true,
			})
			if err != nil {
				return seqcore.OnChainOutput{}, fmt.Errorf("set_config on %s: %w", ref.Address, err)
			}
		}
		return seqcore.OnChainOutput{}, nil
	},
)

UpdateStellarMCMSConfig applies set_config on each listed MCM contract address.

Functions

func ApplyStellarFeeAggregator

func ApplyStellarFeeAggregator(b cldfops.Bundle, chains cldfchain.BlockChains, env cldf.Environment, in fees.FeeAggregatorForChain) (seqcore.OnChainOutput, error)

ApplyStellarFeeAggregator updates the fee aggregator on Stellar contracts that hold CCIP fee funds. When in.Contracts is empty, OnRamp, Versioned Verifier Resolver, and Committee Verifier are updated.

func ClearStellarDeployOffchainTopologyForSelector

func ClearStellarDeployOffchainTopologyForSelector(selector uint64)

ClearStellarDeployOffchainTopologyForSelector deletes a stashed topology without returning it. Call from post-deploy after Take may have already run (idempotent cleanup).

func DeployStellarCCIPContracts

func DeployStellarCCIPContracts(
	ctx context.Context,
	opBundle cldfops.Bundle,
	host stellarccip.CCIPDevenvHost,
	allSelectors []uint64,
	selector uint64,
	topology *ccvdeployment.EnvironmentTopology,
	existingAddresses []datastore.AddressRef,
) (datastore.DataStore, error)

DeployStellarCCIPContracts deploys the full Stellar CCIP stack and returns a sealed in-memory datastore containing address refs for merge into the environment datastore. opBundle must be the CLDF bundle for this run (parent changeset bundle from sequences, or cldfops.NewBundle for tests). topology must be non-nil so committee verifier signature config can be applied (RunStellarCCIPFullDeployForCCV).

func RegisterStellarDeployOffchainTopologyForSelector

func RegisterStellarDeployOffchainTopologyForSelector(selector uint64, topo *offchain.EnvironmentTopology)

RegisterStellarDeployOffchainTopologyForSelector records offchain topology for the Stellar chain selector. It is overwritten if already present. nil topo is a no-op.

func RunStellarCCIPFullDeploy

RunStellarCCIPFullDeploy deploys and configures the full Stellar CCIP Soroban stack for devenv using CLDF operations on the given bundle. It mirrors the phased devenv pipeline (foundation → verification/fees → ramps → receiver + cross-family datastore refs).

topology must be non-nil with a non-nil NOP graph: committee verifier signature quorum configuration (ApplySignatureConfigs) is derived from offchain NOP/committee data. CCV supplies this via RegisterStellarDeployOffchainTopologyForSelector → Take in StellarDeployChainContracts, or RunStellarCCIPFullDeployForCCV which converts CCV topology before calling this function.

func RunStellarCCIPFullDeployForCCV

func RunStellarCCIPFullDeployForCCV(
	ctx context.Context,
	opBundle cldfops.Bundle,
	deps stellardeps.StellarDeps,
	host stellarccip.CCIPDevenvHost,
	allSelectors []uint64,
	selector uint64,
	topology *ccvdeployment.EnvironmentTopology,
	existingAddresses []datastore.AddressRef,
) (seq_core.OnChainOutput, error)

RunStellarCCIPFullDeployForCCV runs the full Stellar CCIP Soroban deploy with CCV environment topology (converted to offchain). Used by ccv/chain and by DeployStellarCCIPContracts. topology must be non-nil so committee verifier signature config can be derived after conversion.

func TakeStellarDeployOffchainTopologyForSelector

func TakeStellarDeployOffchainTopologyForSelector(selector uint64) (*offchain.EnvironmentTopology, bool)

TakeStellarDeployOffchainTopologyForSelector loads and removes the topology for selector. The second return is false if nothing was registered.

Types

type DeployChainContractsOutput

type DeployChainContractsOutput = ccvadapters.DeployChainContractsOutput

DeployChainContractsOutput wraps seq_core.OnChainOutput with additional adapter-specific fields. This type alias ensures compatibility with ccvadapters.DeployChainContractsOutput.

type DeployStellarCCIPInnerInput

type DeployStellarCCIPInnerInput struct {
	ChainSelector     uint64
	AllSelectors      []uint64
	ExistingAddresses []datastore.AddressRef
}

DeployStellarCCIPInnerInput carries per-chain inputs for the Stellar full-stack deploy sequence. AllSelectors must list every chain selector in the environment (from BlockChains).

type StellarApplyDestChainConfigInput

type StellarApplyDestChainConfigInput struct {
	fees.ApplyDestChainConfigSequenceInput
	FQContractID string
}

StellarApplyDestChainConfigInput is the sequence input for applying dest chain configs.

type StellarCCIPDeploySession

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

StellarCCIPDeploySession runs the full Stellar CCIP Soroban deploy via DeployStellarCCIPContracts.

func NewStellarCCIPDeploySession

func NewStellarCCIPDeploySession(
	ctx context.Context,
	opBundle cldfops.Bundle,
	host stellarccip.CCIPDevenvHost,
	allSelectors []uint64,
	selector uint64,
	topology *ccvdeployment.EnvironmentTopology,
	existingAddresses []datastore.AddressRef,
) (*StellarCCIPDeploySession, error)

NewStellarCCIPDeploySession validates inputs for a Stellar CCIP deploy run. opBundle must be a valid CLDF bundle (e.g. the parent changeset bundle from chainlink-ccv DeployContractsForSelector, or cldfops.NewBundle for standalone tests); all Soroban operations run on this bundle.

func (*StellarCCIPDeploySession) RunAllPhasesAndSeal

func (s *StellarCCIPDeploySession) RunAllPhasesAndSeal() (datastore.DataStore, error)

RunAllPhasesAndSeal deploys and configures the full stack and returns a sealed datastore view.

type StellarCurseInput

type StellarCurseInput struct {
	api.CurseInput
	RMNContractID string
}

StellarCurseInput extends the shared CurseInput with the resolved RMN Remote contract ID.

type StellarSetTokenTransferFeeInput

type StellarSetTokenTransferFeeInput struct {
	fees.SetTokenTransferFeeSequenceInput
	FQContractID string
}

StellarSetTokenTransferFeeInput is the sequence input for applying per-token transfer fees.

type StellarTransferOwnershipInput

type StellarTransferOwnershipInput struct {
	deploy.TransferOwnershipPerChainInput
	GovernanceAddr string
}

StellarTransferOwnershipInput extends the shared input with the RBAC timelock (governance) address from the datastore — same role as EVM OpTransferOwnershipInput.TimelockAddress.

Jump to

Keyboard shortcuts

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