mcms

package
v1.0.0-preupgrade Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2026 License: MIT Imports: 16 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	QualifierCCIPOwner = "CLLCCIP"
	QualifierCCVOwner  = "ccvOwner"
	// QualifierRMNOwner uses "RMNMCMS" (not the Canton owner party name "rmnOwner") so Canton
	// and EVM chains share the same MCMS lookup key in address_refs.json. Future cross-family RMN
	// proposals (e.g. Curse) require one mcms.qualifier across all chains in the batch; EVM prod
	// uses RMNMCMS. The on-ledger signatory remains the rmnOwner:: party — only the datastore
	// label changes.
	QualifierRMNOwner = "RMNMCMS"
)

MCMS datastore qualifiers for Canton triple-owner governance. Each qualifier maps to a distinct MCMS contract instance (separate instanceId@owner).

QualifierCCIPOwner uses "CLLCCIP" (not the Canton owner party name "ccipOwner") so Canton and EVM chains share the same MCMS lookup key in address_refs.json. Cross-family merged proposals (e.g. Canton ↔ Sepolia lane configure) require one mcms.qualifier across all chains in the batch; EVM prod uses CLLCCIP. The on-ledger signatory remains the ccipOwner:: party — only the datastore label changes. deploy_mcms already defaults empty qualifier to CLLCCIP; staging_testnet_canton uses the same pattern.

View Source
const DefaultTimelockExpirationHours = 72

Variables

This section is empty.

Functions

func BuildBatchFromOutputs

func BuildBatchFromOutputs(outputs []opcontract.ExerciseOutput) (mcms_types.BatchOperation, error)

BuildBatchFromOutputs is a convenience wrapper around opcontract.NewBatchOperationFromExercises.

func BuildDualTimelockProposalsFromBatchOps

func BuildDualTimelockProposalsFromBatchOps(
	ctx context.Context,
	e cldf.Environment,
	chain canton.Chain,
	chainSelector uint64,
	batchOps []mcms_types.BatchOperation,
	input ccipmcms.Input,
	description string,
) ([]mcms.TimelockProposal, error)

BuildDualTimelockProposalsFromBatchOps builds ccipOwner, ccvOwner, and rmnOwner timelock proposals for one Canton chain. Proposals target separate MCMS instances and may be signed in parallel.

func BuildTimelockProposalForOwner

func BuildTimelockProposalForOwner(
	ctx context.Context,
	e cldf.Environment,
	chain canton.Chain,
	chainSelector uint64,
	ownerQualifier string,
	batchOps []mcms_types.BatchOperation,
	input ccipmcms.Input,
	description string,
) (*mcms.TimelockProposal, error)

BuildTimelockProposalForOwner builds one timelock proposal against the MCMS instance for ownerQualifier.

func ConsolidateBatchOpsPerChain

func ConsolidateBatchOpsPerChain(ops []mcms_types.BatchOperation) []mcms_types.BatchOperation

ConsolidateBatchOpsPerChain merges multiple batch operations for the same chain into one.

func GenerateTimelockProposal

func GenerateTimelockProposal(
	ctx context.Context,
	stateClient apiv2.StateServiceClient,
	mcmsParties []string,
	config ProposalConfig,
	batchOps []mcms_types.BatchOperation,
) (*mcms.TimelockProposal, error)

GenerateTimelockProposal builds a valid mcms.TimelockProposal by querying on-chain MCMS state and assembling all required metadata. This mirrors Sui's GenerateProposal helper.

func SplitBatchOpsByOwner

func SplitBatchOpsByOwner(batchOps []mcms_types.BatchOperation) (ccip, ccv, rmn []mcms_types.BatchOperation)

SplitBatchOpsByOwner separates Canton MCMS transactions into ccipOwner, ccvOwner, and rmnOwner batches.

Types

type MCMSContractInfo

type MCMSContractInfo struct {
	// RawInstanceAddress is the "instanceId@partyId" format of the MCMS contract.
	RawInstanceAddress contracts.RawInstanceAddress
	// InstanceAddress is the 32-byte Keccak256 hash of the raw instance address.
	InstanceAddress contracts.InstanceAddress
}

MCMSContractInfo describes an on-chain MCMS contract needed for proposal generation.

type ProposalConfig

type ProposalConfig struct {
	// MCMSContract describes the MCMS contract to build the proposal for.
	MCMSContract MCMSContractInfo
	// ChainSelector is the Canton chain selector.
	ChainSelector mcms_types.ChainSelector
	// TimelockAddress is the timelock address for this chain (same as MCMS instance address hex for Canton).
	TimelockAddress string
	// Description is a human-readable description of the proposal.
	Description string
	// MinDelay is the timelock execution delay.
	MinDelay time.Duration
	// OverridePreviousRoot overrides the existing root if true.
	OverridePreviousRoot bool
	// Action is the timelock action (schedule, cancel, bypass).
	Action mcms_types.TimelockAction
	// ValidUntil is the Unix timestamp when the proposal expires. If zero, defaults to now + 72h.
	ValidUntil uint32
	// Role determines which MCMS role state to query for OpCount (proposer, canceller, bypasser).
	Role cantonsdk.TimelockRole
}

ProposalConfig holds parameters for generating an MCMS timelock proposal.

Jump to

Keyboard shortcuts

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