Documentation
¶
Index ¶
- Constants
- Variables
- func DefaultAllowedMessageTypes() []string
- type HealthAttestationMirror
- type MarketKeeper
- type MsgClient
- type MsgServer
- type MsgSubmitOrchestrationResponse
- type MsgSubmitOrchestrationResponseResponse
- type OrchestrationQueueKeeper
- type Params
- type QueueLeaseID
- type UnimplementedMsgServer
Constants ¶
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 )
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.
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 ¶
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 )
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 MsgSubmitOrchestrationResponse ¶
type MsgSubmitOrchestrationResponse = apiorch.MsgSubmitOrchestrationResponse
type MsgSubmitOrchestrationResponseResponse ¶
type MsgSubmitOrchestrationResponseResponse = apiorch.MsgSubmitOrchestrationResponseResponse
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 ¶
IsAllowedMessageType returns true iff msgType is in p.AllowedMessageTypes.
type QueueLeaseID ¶
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