deploy

package
v0.2.0-rc.2 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package deploy is the target-agnostic deployment engine: manifest-driven, idempotent steps over a per-target Target implementation.

Index

Constants

View Source
const (
	CheckOK     = "ok"
	CheckFailed = "failed"
)

Check statuses.

View Source
const (
	ActionSkipped  = "skipped"
	ActionExecuted = "executed"
	ActionPlanned  = "planned"
)

StepResult actions.

View Source
const GMPPortID = "gmpport"

GMPPortID is the fixed IBC port the ICS27-GMP app registers under (ICS27Lib.DEFAULT_PORT_ID). ICS27GMP.onRecvPacket requires this exact port, so the app is only reachable when registered here.

Variables

This section is empty.

Functions

func ValidClientID

func ValidClientID(id string) bool

ValidClientID reports whether id is a valid custom client identifier: 4-128 chars, alphanumerics plus [-._+#<>\[\]], and not in the generated "client-"/"channel-" namespaces reserved by routers.

Types

type AttestationParams

type AttestationParams manifest.AttestationParams

AttestationParams are the constructor inputs for an attestation client, recorded in the manifest as they are.

type BesuParams

type BesuParams struct {
	IBCRouter             common.Address
	InitialHeight         uint64
	InitialConsensusState besumsgs.IBesuLightClientMsgsConsensusState
	TrustingPeriod        uint64
	TrustLevel            besumsgs.IBesuLightClientMsgsTrustThreshold
}

BesuParams are the constructor inputs for a Besu client. The trusting period is in seconds; the max clock drift is always besu.MaxClockDrift.

type BesuSource

type BesuSource interface {
	// BesuHead returns a recent sealed header with a timestamp at most
	// notAfter.
	BesuHead(ctx context.Context, notAfter uint64) (*besu.ParsedHeader, error)
}

BesuSource is implemented by targets whose chain runs Besu and can serve a sealed header, which a new client tracking them starts trusting.

type BridgeSpec

type BridgeSpec struct {
	ClientID            string
	CounterpartyIFT     string
	SendCallConstructor string
}

BridgeSpec describes one IFT bridge to register on a token.

type Check

type Check struct {
	Name   string `json:"name"`
	Status string `json:"status"`
	Detail string `json:"detail,omitempty"`
}

Check is one verification result.

type ClientParams

type ClientParams interface {
	// contains filtered or unexported methods
}

ClientParams are the constructor inputs of one client type.

type ClientRef

type ClientRef struct {
	Address string
}

ClientRef is the result of provisioning a light client contract.

type ClientSpec

type ClientSpec struct {
	ClientID             string
	CounterpartyChainID  string
	CounterpartyClientID string
	Params               ClientParams
}

ClientSpec describes one light client to provision and register.

type CoreParams

type CoreParams struct {
	ChainID string
}

CoreParams parameterizes core-stack provisioning.

type CoreRef

type CoreRef struct {
	Router     string
	TargetData map[string]string
}

CoreRef is the result of provisioning the core stack.

type GMPRef

type GMPRef struct {
	Address      string // proxy
	AccountLogic string // beacon logic impl
}

GMPRef is the result of provisioning the ICS27-GMP app.

type IFTRateLimit

type IFTRateLimit struct {
	Capacity *big.Int
	Window   uint64
}

IFTRateLimit is an IFT token's rate limit: each direction lets up to Capacity base units through when full, and refills completely over Window seconds.

func (IFTRateLimit) Equal

func (l IFTRateLimit) Equal(o IFTRateLimit) bool

Equal reports whether l and o are the same rate limit.

type IFTRef

type IFTRef struct {
	Address string // proxy
}

IFTRef is the result of provisioning an IFT token.

type IFTSpec

type IFTSpec struct {
	Owner  string
	Name   string
	Symbol string
	// RateLimit is set on the token after deployment; IFT rejects every
	// transfer until it has one. Nil leaves it to the owner, which must then
	// set it itself.
	RateLimit *IFTRateLimit
}

IFTSpec describes one IFT token to deploy.

type MulticallRef

type MulticallRef struct {
	Address        string
	Implementation string
}

MulticallRef is the deployed multicall proxy and its implementation.

type Report

type Report struct {
	Checks []Check `json:"checks"`
}

Report is the outcome of verifying a manifest against live chain state.

func (Report) Failed

func (r Report) Failed() []Check

Failed returns the checks that did not pass.

type Step

type Step struct {
	Name string
	Done func(ctx context.Context) (bool, error)
	Run  func(ctx context.Context) error
}

Step is one idempotent deployment step. A nil Done means never pre-satisfied.

func ClientSteps

func ClientSteps(t Target, dir, chainID string, spec ClientSpec) []Step

ClientSteps provisions and registers one light client on chainID's router and records it in the manifest. Requires the core step to have run.

func CoreSteps

func CoreSteps(t Target, dir, chainID string) []Step

CoreSteps provisions the core routing stack on one chain and records it in the chain's manifest.

func GMPSteps

func GMPSteps(t Target, dir, chainID string) []Step

GMPSteps provisions the ICS27-GMP app on chainID's router and records it in the manifest. Requires the core step to have run.

func IFTBridgeSteps

func IFTBridgeSteps(t Target, dir, chainID, iftAddr, ctorOverride string, spec BridgeSpec) []Step

IFTBridgeSteps deploys the EVM send-call constructor (unless an override is supplied or one is already recorded) and registers a bridge on iftAddr pointing at spec.CounterpartyIFT over spec.ClientID. Requires core and a registered client on chainID. The bridge is recorded on the manifest token matching iftAddr when one exists.

func IFTSteps

func IFTSteps(t Target, dir, chainID string, spec IFTSpec) []Step

IFTSteps provisions one IFT token on chainID and records it in the manifest, then sets spec.RateLimit on it unless nil. A rerun with a different rate limit updates it. Requires the gmp step to have run.

type StepResult

type StepResult struct {
	Name   string `json:"name"`
	Action string `json:"action"`
}

StepResult records what happened to one step.

func RunSteps

func RunSteps(ctx context.Context, log *slog.Logger, dryRun bool, steps []Step) ([]StepResult, error)

RunSteps executes steps in order, skipping satisfied ones. With dryRun it only reports what would run. Stops at the first error.

type Target

type Target interface {
	// ProvisionCore deploys the core routing stack.
	ProvisionCore(ctx context.Context, p CoreParams) (CoreRef, error)
	// ProvisionMulticall deploys a multicall governed by the core's access manager.
	ProvisionMulticall(ctx context.Context, accessManager string) (MulticallRef, error)
	// ProvisionClient deploys a light client governed by router, without
	// registering it.
	ProvisionClient(ctx context.Context, router string, spec ClientSpec) (ClientRef, error)
	// RegisterClient registers a provisioned client on the router and returns
	// the registered client ID.
	RegisterClient(ctx context.Context, router string, spec ClientSpec, client ClientRef) (string, error)
	// ClientRegistered reports whether clientID is registered on router,
	// returning the registered client address when it is.
	ClientRegistered(ctx context.Context, router, clientID string) (string, bool, error)
	// HasCode reports whether an on-chain artifact exists at address.
	HasCode(ctx context.Context, address string) (bool, error)
	// Head returns the chain's current height and timestamp (seconds).
	Head(ctx context.Context) (height, timestamp uint64, err error)
	// Verify checks a manifest's recorded deployment against live chain
	// state.
	Verify(ctx context.Context, m *manifest.Manifest) (Report, error)
	// ProvisionGMP deploys the ICS27-GMP app (account logic + impl + proxy).
	ProvisionGMP(ctx context.Context, router, accessManager string) (GMPRef, error)
	// RegisterApp registers app on the router under port.
	RegisterApp(ctx context.Context, router, app, port string) error
	// AppRegistered reports whether an app is registered at port, returning its
	// address when it is.
	AppRegistered(ctx context.Context, router, port string) (string, bool, error)
	// ProvisionIFT deploys an IFT token governed by the GMP app.
	ProvisionIFT(ctx context.Context, gmp string, spec IFTSpec) (IFTRef, error)
	// SetIFTRateLimit sets an IFT token's rate limit. Only the token owner
	// may.
	SetIFTRateLimit(ctx context.Context, ift string, limit IFTRateLimit) error
	// IFTRateLimit returns an IFT token's configured rate limit.
	IFTRateLimit(ctx context.Context, ift string) (IFTRateLimit, error)
	// ProvisionSendCallConstructor deploys the stateless EVM IFT send-call
	// constructor and returns its address.
	ProvisionSendCallConstructor(ctx context.Context) (string, error)
	// RegisterIFTBridge registers a bridge on an IFT token.
	RegisterIFTBridge(ctx context.Context, ift string, spec BridgeSpec) error
	// IFTBridge reports whether a bridge for clientID exists on the token,
	// returning its counterparty IFT address and send-call constructor when it
	// does.
	IFTBridge(ctx context.Context, ift, clientID string) (counterparty, constructor string, registered bool, err error)
}

Target deploys and wires IBC on one deployment-target ecosystem. Provision* verbs use the target's idiomatic tooling; the rest are IBC wiring and reads.

Directories

Path Synopsis
Package evm implements the deploy Target for EVM chains.
Package evm implements the deploy Target for EVM chains.
Package manifest stores generated per-chain deployment records.
Package manifest stores generated per-chain deployment records.

Jump to

Keyboard shortcuts

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