types

package
v0.1.0-beta.2 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ModuleName   = apiorch.ModuleName
	QuerierRoute = apiorch.QuerierRoute
	RouterKey    = apiorch.RouterKey

	TypeMsgSubmitOrchestrationResponse = apiorch.TypeMsgSubmitOrchestrationResponse

	EventTypeOrchestrationResponseSubmitted = apiorch.EventTypeOrchestrationResponseSubmitted

	AttrKeyMessageID     = apiorch.AttrKeyMessageID
	AttrKeyProvider      = apiorch.AttrKeyProvider
	AttrKeyLeaseOwner    = apiorch.AttrKeyLeaseOwner
	AttrKeyLeaseDSeq     = apiorch.AttrKeyLeaseDSeq
	AttrKeyMessageType   = apiorch.AttrKeyMessageType
	AttrKeyCorrelationID = apiorch.AttrKeyCorrelationID
	AttrKeyPayloadBytes  = apiorch.AttrKeyPayloadBytes
)
View Source
const (
	// StoreKey defines the primary module store key.
	//
	// The orchestration module itself does not persist consensus state of its
	// own; it writes into `app.Orchestration` (the OrchestrationKeeper facade
	// that reuses the wasm KV store). A dedicated StoreKey constant is still
	// required so that the module can satisfy SDK plumbing in tests and so
	// that future state can be added without an extra migration.
	StoreKey = ModuleName

	// TStoreKey is the transient store key used for per-block rate-limit
	// counters. The SDK zeros transient stores at the end of every block, so
	// these counters naturally reset without an explicit BeginBlock hook.
	TStoreKey = "transient_" + ModuleName
)

ModuleName, QuerierRoute and RouterKey moved to the shared api module with the rest of the wire surface (see alias.go); the store keys below are node-local KV layout and stay here.

View Source
const (
	// DefaultMaxResponsePayload bounds the size of the `payload` field on a
	// MsgSubmitOrchestrationResponse, in bytes.
	DefaultMaxResponsePayload uint64 = 8 * 1024 // 8 KiB

	// DefaultMaxResponsesPerLeasePerBlock is the maximum number of responses
	// a single lease may enqueue in a single block.
	DefaultMaxResponsesPerLeasePerBlock uint32 = 16

	// DefaultMaxResponseBytesPerProviderPerBlock is the maximum aggregate
	// response payload bytes a single provider may submit across all its
	// leases in a single block.
	DefaultMaxResponseBytesPerProviderPerBlock uint64 = 256 * 1024 // 256 KiB

	// DefaultTTLBlocks is used when a submission specifies ttl_blocks = 0.
	// Kept aligned with OrchestrationMessage's implicit 100-block TTL in
	// node/app/types/orchestration_messages.go.
	DefaultTTLBlocks uint64 = 100

	// DefaultMaxMessagesPerLease caps pending orchestration queue entries for
	// a single lease. This mirrors the pre-P1 app-level queue constant so the
	// default behavior is unchanged while making the limit visible to
	// operators.
	DefaultMaxMessagesPerLease uint32 = 50

	// DefaultMaxMessagesTotal caps all pending orchestration queue entries.
	DefaultMaxMessagesTotal uint32 = 500

	// DefaultMaxMessageBytes caps each queued message payload. This protects
	// non-tx enqueue paths in addition to MsgSubmitOrchestrationResponse's
	// MaxResponsePayload check.
	DefaultMaxMessageBytes uint64 = 8 * 1024 // 8 KiB
)

Default parameter values. These are the knobs specified in §P0.1 of docs/REVIEW-RESPONSE-AND-ROADMAP.md.

Variables

View Source
var (
	RegisterLegacyAminoCodec = apiorch.RegisterLegacyAminoCodec
	RegisterInterfaces       = apiorch.RegisterInterfaces
	NewMsgClient             = apiorch.NewMsgClient
	RegisterMsgServer        = apiorch.RegisterMsgServer

	ErrInvalidSigner      = apiorch.ErrInvalidSigner
	ErrLeaseNotFound      = apiorch.ErrLeaseNotFound
	ErrLeaseInactive      = apiorch.ErrLeaseInactive
	ErrPayloadTooLarge    = apiorch.ErrPayloadTooLarge
	ErrRateLimitLease     = apiorch.ErrRateLimitLease
	ErrRateLimitProvider  = apiorch.ErrRateLimitProvider
	ErrUnknownMessageType = apiorch.ErrUnknownMessageType
	ErrInvalidMessage     = apiorch.ErrInvalidMessage
	ErrQueueSendFailed    = apiorch.ErrQueueSendFailed
)
View Source
var (
	KeyPrefixLeaseCount    = []byte{0x01}
	KeyPrefixProviderBytes = []byte{0x02}
)

KV store prefixes for per-block counters (namespaced by block height so they are naturally isolated even when the transient store isn't flushed in tests).

Functions

func DefaultAllowedMessageTypes

func DefaultAllowedMessageTypes() []string

DefaultAllowedMessageTypes is the allow-list of `message_type` values the chain will accept. Values must match the MsgType* constants in node/app/types/orchestration_messages.go.

Types

type HealthAttestationMirror

type HealthAttestationMirror struct {
	LeaseID   mv1.LeaseID
	Provider  string
	Status    int32
	Timestamp int64
	Message   string
}

HealthAttestationMirror is a decoupled copy of node/x/market/keeper.HealthAttestationMsg. We redeclare it here rather than importing the market keeper's internal type to avoid a cyclic dependency between modules and to let this module compile / test with a stub MarketKeeper.

type MarketKeeper

type MarketKeeper interface {
	GetLease(ctx sdk.Context, id mv1.LeaseID) (mv1.Lease, bool)
	SubmitHealthAttestation(ctx sdk.Context, msg *HealthAttestationMirror) error
}

MarketKeeper is the subset of the market keeper that the orchestration module needs: enough to (1) verify a lease exists and is active and (2) mirror health_response submissions into the legacy market-health store for backward compatibility (see §P0.1 "transitional fold" in the roadmap).

type MsgClient

type MsgClient = apiorch.MsgClient

type MsgServer

type MsgServer = apiorch.MsgServer

type MsgSubmitOrchestrationResponse

type MsgSubmitOrchestrationResponse = apiorch.MsgSubmitOrchestrationResponse

type OrchestrationQueueKeeper

type OrchestrationQueueKeeper interface {
	Enqueue(
		ctx sdk.Context,
		from string,
		to string,
		messageType string,
		leaseID QueueLeaseID,
		payload interface{},
		correlationID string,
	) (messageID string, err error)
}

OrchestrationQueueKeeper is the subset of the app-level OrchestrationKeeper (node/app/types.OrchestrationKeeper) that this module invokes. Kept as an interface so tests can supply a stub without constructing the full app keeper chain. The concrete implementation is wrapped by keeper.queueAdapter which maps the string messageType to the app-level OrchestrationMessageType enum.

type Params

type Params struct {
	MaxResponsePayload                  uint64
	MaxResponsesPerLeasePerBlock        uint32
	MaxResponseBytesPerProviderPerBlock uint64
	DefaultTTLBlocks                    uint64
	MaxMessagesPerLease                 uint32
	MaxMessagesTotal                    uint32
	MaxMessageBytes                     uint64
	AllowedMessageTypes                 []string
}

Params holds orchestration module parameters.

Kept as a plain Go struct (not a proto message) because the module has no on-chain params store in this sprint — values are defaults at genesis and overridable via a future param-store migration (§P1.1 in the roadmap).

func DefaultParams

func DefaultParams() Params

DefaultParams returns the default orchestration module parameters.

func (Params) IsAllowedMessageType

func (p Params) IsAllowedMessageType(msgType string) bool

IsAllowedMessageType returns true iff msgType is in p.AllowedMessageTypes.

type QueueLeaseID

type QueueLeaseID struct {
	Owner    string
	DSeq     uint64
	GSeq     uint32
	OSeq     uint32
	Provider string
}

QueueLeaseID mirrors node/app/types.LeaseIdentifier without introducing a cyclic import. The concrete adapter in keeper/adapter.go converts between the two.

type UnimplementedMsgServer

type UnimplementedMsgServer = apiorch.UnimplementedMsgServer

Jump to

Keyboard shortcuts

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