operations

package
v0.0.0-...-92c9f9d Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2026 License: MIT Imports: 5 Imported by: 0

README

Stellar deployment operations

This directory holds Chainlink Deployments Framework (CLDF) operations for Stellar CCIP Soroban contracts: small, composable units that perform at most one on-chain side effect per execution (one deploy, one contract invoke, etc.). Read-only simulate flows and event polling helpers belong in callers or dedicated read operations, not mixed into mutating ops.

References (patterns to mirror)

Stellar bindings are hand-written Soroban clients under bindings/contracts/…; operations should wrap those clients and accept stellardeps.StellarDeps (see stellardeps/) for deploy + invoke, rather than reaching into deployment.Deployer directly from every op.

Conventions

  • Operation IDs: kebab-case, namespaced by contract and action (e.g. offramp:deploy, offramp:apply-source-chain-cfg-updates).
  • Semver: Each operations.NewOperation gets a *semver.Version. Shared baseline for this repo: operations.ContractDeploymentVersion (2.0.0) until per-contract release lines exist.
  • ContractType (datastore alignment): Use PascalCase strings consistent with CCIP lane tooling, e.g. OffRamp, OnRamp, Router, FeeQuoter, RmnRemote, RmnProxy, RampRegistry, TokenAdminRegistry, CommitteeVerifier, VersionedVerifierResolver, LockReleasePool, BurnMintPool, SiloedLockReleasePool, TokenLockBox, MCMS, Timelock, CCIPReceiver (example receiver), CREForwarder.
  • WASM paths: Built artifacts live at target/wasm32v1-none/release/<crate>.wasm relative to the repo root; <crate> follows Cargo’s underscore rules (hyphens in [package].name become underscores).

Bundle usage (tests and runners)

CLDF expects a Bundle with context, logger, and reporter:

bundle := operations.NewBundle(
    func() context.Context { return ctx },
    cldflogger.Test(t), // or cldflogger.Nop()
    operations.NewMemoryReporter(),
)
_, err := operations.ExecuteOperation(bundle, someOp, deps, input)

Handlers use the signature func(b operations.Bundle, deps DEP, input IN) (OUT, error) (see chainlink-deployments-framework/operations). Inputs and outputs must be JSON-serializable unless you opt into framework escape hatches.

Contract inventory (bindings → WASM → role)

Bindings package Suggested ContractType release/*.wasm Notes
offramp OffRamp offramp.wasm Lane sink: init, source chain config, execution, fee updates, ownership
onramp OnRamp onramp.wasm Lane source: init, dest chain allowlists, fee/family config, sends
router Router router.wasm OffRamp routing, RMN config, ownership
fee_quoter FeeQuoter fee_quoter.wasm Token price / fee config mutators
rmn_remote RmnRemote rmn_remote.wasm RMN curse updates
rmn_proxy RmnProxy rmn_proxy.wasm Proxy admin / routing to remote
ramp_registry RampRegistry ccip_ramp_registry.wasm Ramp registration and lookups
token_admin_registry TokenAdminRegistry token_admin_registry.wasm Token admin / pool registry updates
committee_verifier CommitteeVerifier ccvs_committee_verifier.wasm Verifier set / digest config; CLDF committee-verifier:withdraw-fee-tokens (WithdrawFeeTokensInput: contract_id, fee_tokens) sends fee token balances to the configured fee aggregator
versioned_verifier_resolver VersionedVerifierResolver ccvs_versioned_verifier_resolver.wasm Resolver binding updates; CLDF versioned-verifier-resolver:withdraw-fee-tokens (same input shape) for VVR fee aggregator withdrawals
lock_release_pool LockReleasePool pools_lock_release_pool.wasm Pool-specific init and lock/release I/O
burn_mint_pool BurnMintPool pools_burn_mint_pool.wasm Burn/mint style pool
siloed_lock_release_pool SiloedLockReleasePool pools_siloed_lock_release_pool.wasm Siloed L/R pool
token_lock_box TokenLockBox pools_token_lock_box.wasm Lock box transfers / admin
token_pool (per deployment) (see pool crates) Shared interface used by concrete pool clients
mcms MCMS mcms.wasm MCMS roots, ops, role changes
timelock Timelock timelock.wasm Timelock schedule / execute
ccip_receiver CCIPReceiver ccip_receiver_example.wasm Example receiver (dev / tests)
cre (forwarder client) CREForwarder forwarder.wasm CRE report dispatch; owner-gated DON signer config + transmitter registry (MCMS/timelock-governed after handoff)

WASM filenames follow cargo build --release output for workspace members under contracts/.

Layout

  • stellardeps/ — StellarDeps (Deploy + Invoker) and FromDeployer(*deployment.Deployer).
  • types.go / deploy.go — shared Void, DeployInput / DeployOutput, and NewDeployOperation(id, description) for WASM deploy ops.
  • Per-contract packages (each exports ContractType and operations.NewOperation vars): offramp/, onramp/, router/, rmn_remote/, rmn_proxy/, fee_quoter/, ramp_registry/, committee_verifier/, versioned_verifier_resolver/, ccip_receiver/, cre_forwarder/, token_admin_registry/, token_pool/, burn_mint_pool/, siloed_lock_release_pool/, token_lock_box/, mcms/, timelock/.

Stellar deploy stack (devenv / CCV)

Soroban deploy and post-deploy run on a caller-supplied CLDF Bundle (same as EVM/Solana: the parent changeset bundle from ExecuteSequence, or operations.NewBundle in standalone tests). Full-stack deploy helpers live in deployment/sequences: DeployStellarCCIPContracts, RunStellarCCIPFullDeployForCCV, NewStellarCCIPDeploySession, and post-deploy in deployment/ccip: DeployLockReleaseTestTokenPool. The adapter sequence StellarDeployChainContracts uses the same underlying RunStellarCCIPFullDeploy. Topology: non-nil CCV/offchain topology (with NOP data) is required—committee verifier signature quorum is applied from it; CCV PreDeployContractsForSelector registers stashed offchain topology for the CLDF adapter path. FeeQuoter price updates: RunStellarCCIPFullDeploy calls the CLDF operation fee-quoter:update-prices (fqops.UpdatePrices); the handler wraps the generated FeeQuoterClient and invokes update_prices on-chain—the same pattern as other Stellar ops. UpdatePricesInput embeds scval.U128 (xdr.UInt128Parts); for tooling that serializes operation arguments as JSON, payloads encode those fields as numeric Hi/Lo parts—fine for encoding/json, but watch schema expectations if an external consumer assumes decimal strings or another u128 wire shape.

Documentation

Overview

Package operations hosts CLDF-style deployment operations for Stellar Soroban contracts (thin wrappers around generated bindings plus chain I/O).

Conventions, contract inventory, shared deploy helpers, and per-contract packages live in README.md in this directory.

Index

Constants

View Source
const (
	// DestinationChainNotEnabledCode is FeeQuoter/Executor get_dest_chain_config
	// for a destination chain with no config.
	DestinationChainNotEnabledCode uint32 = 25
	// DestinationChainNotSupportedCode is OnRamp get_dest_chain_config for a
	// destination chain with no config.
	DestinationChainNotSupportedCode uint32 = 37
	// UnsupportedDestinationChainCode is Router get_onramp for a destination
	// chain with no OnRamp routed.
	UnsupportedDestinationChainCode uint32 = 63
	// SourceChainNotEnabledCode is OffRamp get_source_chain_config for a source
	// chain with no config.
	SourceChainNotEnabledCode uint32 = 100
	// SourceSignersNotConfiguredCode is CommitteeVerifier get_signature_config
	// for a source chain with no signature quorum configured.
	SourceSignersNotConfiguredCode uint32 = 19
)

Soroban contract error codes (contracts/common/error/src/lib.rs CCIPError) that read ops treat as "lane not configured". Reads must keep this list narrow: only the code the target contract's getter actually defines.

Variables

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

ContractDeploymentVersion is the semver stamped on Stellar Soroban deployment operations in this tree until contract releases are versioned independently.

Functions

func IsContractErrorCode

func IsContractErrorCode(err error, code uint32) bool

IsContractErrorCode reports whether err carries the Soroban host's rendering of the given contract error code. The RPC client surfaces simulation diagnostics as "Error(Contract, #<code>)" inside the returned error's message; there is no typed error to unwrap, so a substring match on the rendered code is the established pattern (see adapters/ccv_committee_verifier_onchain.go, sourceSignersNotConfiguredCode).

Callers must keep the match narrow: pass the exact code and only treat a match as "not configured" for the contract/error pair that actually defines that code.

func NewDeployOperation

func NewDeployOperation(id, description string) *cldfops.Operation[DeployInput, DeployOutput, stellardeps.StellarDeps]

NewDeployOperation returns a CLDF operation that deploys WASM using SorobanContractDeployer. Use a distinct id per contract family (e.g. "onramp:deploy", "router:deploy").

Types

type DeployInput

type DeployInput struct {
	WasmPath string   `json:"wasm_path"`
	Salt     [32]byte `json:"salt"`
}

DeployInput is the standard input for uploading Soroban WASM with a salt.

type DeployOutput

type DeployOutput struct {
	ContractID string `json:"contract_id"`
}

DeployOutput carries the deployed contract address (StrKey).

type Void

type Void struct{}

Void is the output type for on-chain calls that return no structured payload.

Directories

Path Synopsis
Package lock_release_pool defines CLDF operations for the Soroban lock-release pool contract.
Package lock_release_pool defines CLDF operations for the Soroban lock-release pool contract.
Package offramp defines CLDF operations for the Soroban OffRamp contract.
Package offramp defines CLDF operations for the Soroban OffRamp contract.
Package operationstest provides shared stubs for unit-testing Soroban deployment operations without a live network: a recording invoker that captures every InvokeContract/SimulateContract call, a no-op fake deployer, and a test bundle builder.
Package operationstest provides shared stubs for unit-testing Soroban deployment operations without a live network: a recording invoker that captures every InvokeContract/SimulateContract call, a no-op fake deployer, and a test bundle builder.

Jump to

Keyboard shortcuts

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