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: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AvailabilitySourceBid        = "bid"
	AvailabilitySourceMissedBid  = "missed_bid"
	AvailabilitySourceHealthOK   = "health_ok"
	AvailabilitySourceHealthFail = "health_failed"
	AvailabilitySourceHealthDegr = "health_degraded"
)

Availability event source labels. These are recorded verbatim on the AvailabilityEvent so consumers can disambiguate why the score moved.

New labels MUST be added together with their caller so we don't ship "claimed" sources with no on-chain provenance. Reserved-but-unused labels (e.g. an admin-only "manual" source) belong to a feature-flag branch, not this file.

View Source
const (
	// EventTypeScoreSubmitted is emitted on every successful
	// MsgSubmitProviderScore.
	EventTypeScoreSubmitted = "reputation_score_submitted"

	// EventTypeParamsUpdated is emitted on every successful
	// MsgUpdateParams.
	EventTypeParamsUpdated = "reputation_params_updated"

	AttrKeyTenant           = "tenant"
	AttrKeySigner           = "signer"
	AttrKeyProvider         = "provider"
	AttrKeyLeaseID          = "lease_id"
	AttrKeyBPS              = "bps"
	AttrKeyWeight           = "weight"
	AttrKeyAggregateBPS     = "aggregate_bps"
	AttrKeyObservationCount = "observation_count"

	// EventTypeAvailabilityRecorded is emitted whenever an availability
	// event is folded into a provider's availability aggregate.
	EventTypeAvailabilityRecorded = "reputation_availability_recorded"

	AttrKeyAvailabilityKind   = "availability_kind"
	AttrKeyAvailabilitySource = "availability_source"
	AttrKeyAvailabilityBPS    = "availability_bps"
	AttrKeyRespondedBids      = "responded_bids"
	AttrKeyMissedEligibleBids = "missed_eligible_bids"
	AttrKeyOnlineBlocks       = "online_blocks"
	AttrKeyOfflineBlocks      = "offline_blocks"
	AttrKeyReference          = "reference"
)

Stable event vocabulary for the reputation module. These constants are the public on-chain interface for downstream consumers (CosmWasm contracts, off-chain indexers, automation labels). They MUST NOT be changed without a backward-compatible migration path.

View Source
const (
	// ModuleName is the canonical module name for x/reputation.
	ModuleName = "reputation"

	// StoreKey is the primary KV store key for x/reputation.
	StoreKey = ModuleName

	// QuerierRoute is the legacy querier route name; matches ModuleName so
	// gRPC service routing stays trivial.
	QuerierRoute = ModuleName

	// RouterKey is the legacy router key (proto-routed in practice).
	RouterKey = ModuleName
)
View Source
const (
	// DefaultMinTransferredForScore is the minimum payment.Withdrawn
	// amount (uakt) required to make a tenant eligible to score the
	// closed lease's provider. Default is 1uakt — i.e. any non-zero
	// payment qualifies. Operators are expected to tune this upward via
	// gov before mainnet.
	DefaultMinTransferredForScore = "1"

	// DefaultScoreDenom is the bond denom of MinTransferredForScore.
	DefaultScoreDenom = "uakt"

	// DefaultMaxBPS is 10000 (= 100%). Submissions are validated to be
	// in [0, MaxBPS].
	DefaultMaxBPS uint32 = 10000

	// DefaultHalfLifeBlocks is approximately 7 days at a 5s block
	// time. Operators may tune this to make reputation longer- or
	// shorter-lived.
	DefaultHalfLifeBlocks uint64 = 120960

	// DefaultMaxScoreHistoryPerProvider caps the per-provider on-chain
	// audit trail. The aggregate is incrementally maintained, so this
	// cap only affects ProviderHistory queries.
	DefaultMaxScoreHistoryPerProvider uint32 = 5000

	// DefaultMaxQueryPageSize is the upper bound on a single gRPC /
	// wasm query result page. Callers that request more are silently
	// clamped.
	DefaultMaxQueryPageSize uint32 = 100

	// DefaultMaxAvailabilityHistoryPerProvider caps availability event
	// history rows per provider (FIFO prune).
	DefaultMaxAvailabilityHistoryPerProvider uint32 = 5000
)

Default parameter values. All numeric tunables of the reputation module are sourced from this struct (or the on-chain Params record after migration). No constant should be referenced from any other package; if a new tunable is needed, add it here first.

Variables

View Source
var (
	// KeyPrefixAvailability stores ProviderAvailability at
	// {KeyPrefixAvailability, len(provider), provider}.
	KeyPrefixAvailability = []byte{0x06}

	// KeyPrefixAvailabilityEvent stores AvailabilityEvent rows at
	// {KeyPrefixAvailabilityEvent, len(provider), provider,
	//  height_be8, seq_be8}.
	// height-prefixed so chronological scans and FIFO pruning are cheap.
	KeyPrefixAvailabilityEvent = []byte{0x07}

	// KeyPrefixAvailabilitySeq stores a per-provider monotonic
	// uint64 sequence used to disambiguate multiple events at the
	// same height. Stored at {KeyPrefixAvailabilitySeq, len(provider),
	// provider} -> uint64-be8.
	KeyPrefixAvailabilitySeq = []byte{0x08}
)
View Source
var (
	ErrLeaseNotFound = errors.Register(ModuleName, 2,
		"lease not found")
	ErrLeaseNotClosed = errors.Register(ModuleName, 3,
		"lease must be closed before submitting a score")
	ErrNotLeaseOwner = errors.Register(ModuleName, 4,
		"signer is not the lease owner")
	ErrProviderMismatch = errors.Register(ModuleName, 5,
		"provider in message does not match the lease's provider")
	ErrInsufficientTransfer = errors.Register(ModuleName, 6,
		"escrow withdrawn amount is below MinTransferredForScore")
	ErrAlreadyScored = errors.Register(ModuleName, 7,
		"lease has already been scored")
	ErrInvalidBPS = errors.Register(ModuleName, 8,
		"bps is out of range [0, MaxBPS]")
	ErrInvalidAddress = errors.Register(ModuleName, 9,
		"address is not a valid bech32")
	ErrInvalidParams = errors.Register(ModuleName, 10,
		"reputation module params failed validation")
	ErrUnauthorized = errors.Register(ModuleName, 11,
		"signer is not the module authority")
	ErrPaymentNotFound = errors.Register(ModuleName, 12,
		"escrow payment not found for lease")
)

Error codes for the reputation module. The first error in a module must be code 2 (1 is reserved by the SDK for "unknown error").

View Source
var (
	// KeyPrefixParams stores the singleton Params record at
	// {KeyPrefixParams, paramsKeySingleton}.
	KeyPrefixParams = []byte{0x01}

	// KeyPrefixAggregate stores ProviderAggregate at
	// {KeyPrefixAggregate, len(provider), provider}.
	KeyPrefixAggregate = []byte{0x02}

	// KeyPrefixEntry stores ScoreEntry rows at
	// {KeyPrefixEntry, len(provider), provider, height_be8, leasePk}.
	// Height-prefixed so we can range-scan chronologically and FIFO-prune.
	KeyPrefixEntry = []byte{0x03}

	// KeyPrefixByTenant indexes ScoreEntry rows from the tenant side at
	// {KeyPrefixByTenant, len(tenant), tenant, len(provider), provider, leasePk}.
	// Stores a tombstone (single 0x01 byte) — the canonical entry is
	// kept at KeyPrefixEntry/.
	KeyPrefixByTenant = []byte{0x04}

	// KeyPrefixByLease is the per-lease tombstone enforcing "exactly one
	// score per closed lease". Key:
	// {KeyPrefixByLease, leasePk}.
	KeyPrefixByLease = []byte{0x05}
)

KV-store key prefixes. We use a single byte per top-level prefix to keep scans cheap and to reserve plenty of room for future schemas without a migration. Sub-keys use big-endian encodings so that lexicographic order matches numeric order on heights.

View Source
var TombstoneValue = []byte{0x01}

TombstoneValue is the constant non-empty value written to all tombstone-style keys. Stores can't distinguish "absent" from "empty value", so we always write at least one byte.

Functions

func AggregateKey

func AggregateKey(provider string) []byte

AggregateKey returns the absolute KV key for the aggregate of the given provider bech32 address.

func AggregatePrefix

func AggregatePrefix() []byte

AggregatePrefix returns the prefix used to scan all aggregates.

func AvailabilityEventKey

func AvailabilityEventKey(provider string, height int64, seq uint64) []byte

AvailabilityEventKey returns the KV key for a single event row. The height and seq are big-endian encoded so chronological scans are lexicographic.

func AvailabilityEventProviderHeightPrefix

func AvailabilityEventProviderHeightPrefix(provider string, height int64) []byte

AvailabilityEventProviderHeightPrefix returns the partial scan prefix {KeyPrefix, provider, height_be8} useful for "since height H" range queries.

func AvailabilityEventProviderPrefix

func AvailabilityEventProviderPrefix(provider string) []byte

AvailabilityEventProviderPrefix returns the scan prefix for all events of a given provider in chronological order.

func AvailabilityKey

func AvailabilityKey(provider string) []byte

AvailabilityKey returns the KV key for the aggregate of the given provider.

func AvailabilityPrefix

func AvailabilityPrefix() []byte

AvailabilityPrefix returns the scan prefix used to iterate every availability aggregate.

func AvailabilitySeqKey

func AvailabilitySeqKey(provider string) []byte

AvailabilitySeqKey returns the KV key for the per-provider event sequence counter.

func ByLeaseKey

func ByLeaseKey(leasePk string) []byte

ByLeaseKey returns the absolute key for the per-lease tombstone.

func ByTenantKey

func ByTenantKey(tenant, provider, leasePk string) []byte

ByTenantKey returns the absolute KV key for the tenant-side index tombstone.

func ByTenantPrefix

func ByTenantPrefix(tenant string) []byte

ByTenantPrefix returns the scan prefix for all entries belonging to a tenant.

func DecodeUint64BE

func DecodeUint64BE(b []byte) uint64

DecodeUint64BE is the inverse of EncodeUint64BE.

func EncodeUint64BE

func EncodeUint64BE(v uint64) []byte

EncodeUint64BE is a small helper used by the keeper and tests to produce the canonical big-endian encoding used in keys.

func EntryKey

func EntryKey(provider string, height int64, leasePk string) []byte

EntryKey returns the absolute KV key for a single ScoreEntry. The height is stored big-endian so chronological scans are lexicographic.

func EntryProviderHeightPrefix

func EntryProviderHeightPrefix(provider string, height int64) []byte

EntryProviderHeightPrefix returns the partial scan prefix {KeyPrefixEntry, provider, height_be8} useful for "since height H" queries.

func EntryProviderPrefix

func EntryProviderPrefix(provider string) []byte

EntryProviderPrefix returns the scan prefix for all entries of a given provider, ordered chronologically.

func LeasePK

func LeasePK(id mv1.LeaseID) string

LeasePK is the canonical primary-key string used in storage and API surfaces. Format: "owner/dseq/gseq/oseq/provider".

func ParamsKey

func ParamsKey() []byte

ParamsKey returns the absolute KV key for the singleton Params record.

func RegisterInterfaces

func RegisterInterfaces(registry cdctypes.InterfaceRegistry)

RegisterInterfaces registers the module's sdk.Msg implementations with the interface registry so that Any-packed txs can resolve the concrete type.

func RegisterLegacyAminoCodec

func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino)

RegisterLegacyAminoCodec registers concrete msg types on the legacy amino codec. The proto path goes through RegisterInterfaces.

func RegisterMsgServer

func RegisterMsgServer(s grpc1.Server, srv MsgServer)

func RegisterQueryServer

func RegisterQueryServer(s grpc1.Server, srv QueryServer)

Types

type AvailabilityAuditEntry

type AvailabilityAuditEntry struct {
	Provider             string   `protobuf:"bytes,1,opt,name=provider,proto3" json:"provider,omitempty"`
	Kind                 string   `protobuf:"bytes,2,opt,name=kind,proto3" json:"kind,omitempty"`
	Height               int64    `protobuf:"varint,3,opt,name=height,proto3" json:"height,omitempty"`
	Source               string   `protobuf:"bytes,4,opt,name=source,proto3" json:"source,omitempty"`
	Reference            string   `protobuf:"bytes,5,opt,name=reference,proto3" json:"reference,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

AvailabilityAuditEntry is the wire/proto view of one availability history row (JSON under aevt/…).

func NewAvailabilityAuditEntryProto

func NewAvailabilityAuditEntryProto(e AvailabilityEvent) AvailabilityAuditEntry

NewAvailabilityAuditEntryProto maps a stored availability event to the gRPC wire type.

func (*AvailabilityAuditEntry) Descriptor

func (*AvailabilityAuditEntry) Descriptor() ([]byte, []int)

func (*AvailabilityAuditEntry) GetHeight

func (m *AvailabilityAuditEntry) GetHeight() int64

func (*AvailabilityAuditEntry) GetKind

func (m *AvailabilityAuditEntry) GetKind() string

func (*AvailabilityAuditEntry) GetProvider

func (m *AvailabilityAuditEntry) GetProvider() string

func (*AvailabilityAuditEntry) GetReference

func (m *AvailabilityAuditEntry) GetReference() string

func (*AvailabilityAuditEntry) GetSource

func (m *AvailabilityAuditEntry) GetSource() string

func (*AvailabilityAuditEntry) ProtoMessage

func (*AvailabilityAuditEntry) ProtoMessage()

func (*AvailabilityAuditEntry) Reset

func (m *AvailabilityAuditEntry) Reset()

func (*AvailabilityAuditEntry) String

func (m *AvailabilityAuditEntry) String() string

func (*AvailabilityAuditEntry) XXX_DiscardUnknown

func (m *AvailabilityAuditEntry) XXX_DiscardUnknown()

func (*AvailabilityAuditEntry) XXX_Marshal

func (m *AvailabilityAuditEntry) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*AvailabilityAuditEntry) XXX_Merge

func (m *AvailabilityAuditEntry) XXX_Merge(src proto.Message)

func (*AvailabilityAuditEntry) XXX_Size

func (m *AvailabilityAuditEntry) XXX_Size() int

func (*AvailabilityAuditEntry) XXX_Unmarshal

func (m *AvailabilityAuditEntry) XXX_Unmarshal(b []byte) error

type AvailabilityEvent

type AvailabilityEvent struct {
	Provider  string           `json:"provider"`
	Kind      AvailabilityKind `json:"kind"`
	Height    int64            `json:"height"`
	Source    string           `json:"source"`
	Reference string           `json:"reference,omitempty"`
}

AvailabilityEvent is one chronological row of availability evidence kept for audit/history. The aggregate is updated incrementally so this row is informational; consumers use it for charts and dashboards.

Stored at: aevt/{provider}/{height_be8}/{seq_be8} -> json.

func (AvailabilityEvent) Validate

func (e AvailabilityEvent) Validate() error

Validate performs the cheap shape checks so callers can fail fast before paying the KV-store cost.

type AvailabilityKind

type AvailabilityKind uint8

AvailabilityKind enumerates the categories of availability events the reputation module records for a provider. The numeric values are stable: history rows are persisted with this kind in their JSON payload, and external indexers depend on them not changing.

const (
	// AvailabilityUnknown is the zero value. It must never be persisted
	// directly; it exists only so that uninitialised values are
	// distinguishable from real signals.
	AvailabilityUnknown AvailabilityKind = 0
	// AvailabilityOnline is positive evidence: the provider performed an
	// action observable on-chain that proves it was reachable, for
	// example creating a bid against an open order or successfully
	// passing a health attestation.
	AvailabilityOnline AvailabilityKind = 1
	// AvailabilityOffline is negative evidence: the provider missed a
	// bid window for which it was eligible, or a health signal returned
	// failed/unreachable.
	AvailabilityOffline AvailabilityKind = 2
	// AvailabilityDegraded is a soft negative used by health signals
	// that are not a clean offline (e.g. valiporacle "quorum_uncertain"
	// or partial failure). It moves availability_bps down but does not
	// reset the current online window.
	AvailabilityDegraded AvailabilityKind = 3
)

func (AvailabilityKind) String

func (k AvailabilityKind) String() string

String returns the short label used in events, attribute values and CLI output.

type AvailabilitySummary

type AvailabilitySummary struct {
	Provider                 string   `protobuf:"bytes,1,opt,name=provider,proto3" json:"provider,omitempty"`
	RespondedBids            uint64   `protobuf:"varint,2,opt,name=responded_bids,json=respondedBids,proto3" json:"responded_bids,omitempty"`
	MissedEligibleBids       uint64   `protobuf:"varint,3,opt,name=missed_eligible_bids,json=missedEligibleBids,proto3" json:"missed_eligible_bids,omitempty"`
	OnlineBlocks             uint64   `protobuf:"varint,4,opt,name=online_blocks,json=onlineBlocks,proto3" json:"online_blocks,omitempty"`
	OfflineBlocks            uint64   `protobuf:"varint,5,opt,name=offline_blocks,json=offlineBlocks,proto3" json:"offline_blocks,omitempty"`
	FirstSeenHeight          int64    `protobuf:"varint,6,opt,name=first_seen_height,json=firstSeenHeight,proto3" json:"first_seen_height,omitempty"`
	LastSeenHeight           int64    `protobuf:"varint,7,opt,name=last_seen_height,json=lastSeenHeight,proto3" json:"last_seen_height,omitempty"`
	LastOfflineHeight        int64    `protobuf:"varint,8,opt,name=last_offline_height,json=lastOfflineHeight,proto3" json:"last_offline_height,omitempty"`
	CurrentWindowStartHeight int64    `` /* 138-byte string literal not displayed */
	CurrentStateOnline       bool     `protobuf:"varint,10,opt,name=current_state_online,json=currentStateOnline,proto3" json:"current_state_online,omitempty"`
	LastEventHeight          int64    `protobuf:"varint,11,opt,name=last_event_height,json=lastEventHeight,proto3" json:"last_event_height,omitempty"`
	AvailabilityBps          uint32   `protobuf:"varint,12,opt,name=availability_bps,json=availabilityBps,proto3" json:"availability_bps,omitempty"`
	ObservationCount         uint32   `protobuf:"varint,13,opt,name=observation_count,json=observationCount,proto3" json:"observation_count,omitempty"`
	XXX_NoUnkeyedLiteral     struct{} `json:"-"`
	XXX_unrecognized         []byte   `json:"-"`
	XXX_sizecache            int32    `json:"-"`
}

AvailabilitySummary is the wire/proto view of the JSON-backed ProviderAvailability aggregate stored under avail/{provider}.

func NewAvailabilitySummaryProto

func NewAvailabilitySummaryProto(a ProviderAvailability) AvailabilitySummary

NewAvailabilitySummaryProto maps the JSON-backed aggregate to the gRPC wire type.

func (*AvailabilitySummary) Descriptor

func (*AvailabilitySummary) Descriptor() ([]byte, []int)

func (*AvailabilitySummary) GetAvailabilityBps

func (m *AvailabilitySummary) GetAvailabilityBps() uint32

func (*AvailabilitySummary) GetCurrentStateOnline

func (m *AvailabilitySummary) GetCurrentStateOnline() bool

func (*AvailabilitySummary) GetCurrentWindowStartHeight

func (m *AvailabilitySummary) GetCurrentWindowStartHeight() int64

func (*AvailabilitySummary) GetFirstSeenHeight

func (m *AvailabilitySummary) GetFirstSeenHeight() int64

func (*AvailabilitySummary) GetLastEventHeight

func (m *AvailabilitySummary) GetLastEventHeight() int64

func (*AvailabilitySummary) GetLastOfflineHeight

func (m *AvailabilitySummary) GetLastOfflineHeight() int64

func (*AvailabilitySummary) GetLastSeenHeight

func (m *AvailabilitySummary) GetLastSeenHeight() int64

func (*AvailabilitySummary) GetMissedEligibleBids

func (m *AvailabilitySummary) GetMissedEligibleBids() uint64

func (*AvailabilitySummary) GetObservationCount

func (m *AvailabilitySummary) GetObservationCount() uint32

func (*AvailabilitySummary) GetOfflineBlocks

func (m *AvailabilitySummary) GetOfflineBlocks() uint64

func (*AvailabilitySummary) GetOnlineBlocks

func (m *AvailabilitySummary) GetOnlineBlocks() uint64

func (*AvailabilitySummary) GetProvider

func (m *AvailabilitySummary) GetProvider() string

func (*AvailabilitySummary) GetRespondedBids

func (m *AvailabilitySummary) GetRespondedBids() uint64

func (*AvailabilitySummary) ProtoMessage

func (*AvailabilitySummary) ProtoMessage()

func (*AvailabilitySummary) Reset

func (m *AvailabilitySummary) Reset()

func (*AvailabilitySummary) String

func (m *AvailabilitySummary) String() string

func (*AvailabilitySummary) XXX_DiscardUnknown

func (m *AvailabilitySummary) XXX_DiscardUnknown()

func (*AvailabilitySummary) XXX_Marshal

func (m *AvailabilitySummary) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*AvailabilitySummary) XXX_Merge

func (m *AvailabilitySummary) XXX_Merge(src proto.Message)

func (*AvailabilitySummary) XXX_Size

func (m *AvailabilitySummary) XXX_Size() int

func (*AvailabilitySummary) XXX_Unmarshal

func (m *AvailabilitySummary) XXX_Unmarshal(b []byte) error

type ContractInfo

type ContractInfo struct {
	Admin string
}

ContractInfo is the minimal slice of wasmd's ContractInfo we need to authorise a contract's admin to score on the contract's behalf. Held behind an interface-shaped struct so the reputation module can stay independent of wasmd at the type-import level: callers that wire a real wasm keeper marshal the wasmd struct down to this shape.

type EscrowKeeper

type EscrowKeeper interface {
	GetPayment(ctx sdk.Context, id escrowid.Payment) (etypes.Payment, error)
}

EscrowKeeper is the minimal subset of the escrow keeper used to read per-lease payment state. We only need GetPayment.

type GenesisState

type GenesisState struct {
	Params     Params              `protobuf:"bytes,1,opt,name=params,proto3" json:"params"`
	Aggregates []ProviderAggregate `protobuf:"bytes,2,rep,name=aggregates,proto3" json:"aggregates"`
	Entries    []ScoreEntry        `protobuf:"bytes,3,rep,name=entries,proto3" json:"entries"`
	// Availability aggregates (JSON-backed on-chain; exported for chain
	// upgrades / analysis). Event history is intentionally not exported in
	// genesis to keep exports bounded.
	Availability         []AvailabilitySummary `protobuf:"bytes,4,rep,name=availability,proto3" json:"availability"`
	XXX_NoUnkeyedLiteral struct{}              `json:"-"`
	XXX_unrecognized     []byte                `json:"-"`
	XXX_sizecache        int32                 `json:"-"`
}

GenesisState is the data the reputation module exports / imports across chain restarts and upgrades.

func DefaultGenesis

func DefaultGenesis() GenesisState

DefaultGenesis returns a genesis state with default Params and no pre-existing aggregates / entries.

func (*GenesisState) Descriptor

func (*GenesisState) Descriptor() ([]byte, []int)

func (*GenesisState) GetAggregates

func (m *GenesisState) GetAggregates() []ProviderAggregate

func (*GenesisState) GetAvailability

func (m *GenesisState) GetAvailability() []AvailabilitySummary

func (*GenesisState) GetEntries

func (m *GenesisState) GetEntries() []ScoreEntry

func (*GenesisState) GetParams

func (m *GenesisState) GetParams() Params

func (*GenesisState) ProtoMessage

func (*GenesisState) ProtoMessage()

func (*GenesisState) Reset

func (m *GenesisState) Reset()

func (*GenesisState) String

func (m *GenesisState) String() string

func (GenesisState) Validate

func (gs GenesisState) Validate() error

Validate checks invariants on the genesis state. Aggregates are indexed by provider; entries by (provider, height, lease). We do shallow-only validation here; deep cross-references are enforced by keeper.InitGenesis.

func (*GenesisState) XXX_DiscardUnknown

func (m *GenesisState) XXX_DiscardUnknown()

func (*GenesisState) XXX_Marshal

func (m *GenesisState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*GenesisState) XXX_Merge

func (m *GenesisState) XXX_Merge(src proto.Message)

func (*GenesisState) XXX_Size

func (m *GenesisState) XXX_Size() int

func (*GenesisState) XXX_Unmarshal

func (m *GenesisState) XXX_Unmarshal(b []byte) error

type LeaseID

type LeaseID struct {
	Owner                string   `protobuf:"bytes,1,opt,name=owner,proto3" json:"owner,omitempty"`
	Dseq                 uint64   `protobuf:"varint,2,opt,name=dseq,proto3" json:"dseq,omitempty"`
	Gseq                 uint32   `protobuf:"varint,3,opt,name=gseq,proto3" json:"gseq,omitempty"`
	Oseq                 uint32   `protobuf:"varint,4,opt,name=oseq,proto3" json:"oseq,omitempty"`
	Provider             string   `protobuf:"bytes,5,opt,name=provider,proto3" json:"provider,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

LeaseID is a flat copy of pkg.akt.dev/go/node/market/v1.LeaseID kept inside this proto namespace so the tx descriptor doesn't pull a hard dependency on the market proto. Field numbering matches the upstream LeaseID for binary compatibility.

func (*LeaseID) Descriptor

func (*LeaseID) Descriptor() ([]byte, []int)

func (*LeaseID) GetDseq

func (m *LeaseID) GetDseq() uint64

func (*LeaseID) GetGseq

func (m *LeaseID) GetGseq() uint32

func (*LeaseID) GetOseq

func (m *LeaseID) GetOseq() uint32

func (*LeaseID) GetOwner

func (m *LeaseID) GetOwner() string

func (*LeaseID) GetProvider

func (m *LeaseID) GetProvider() string

func (*LeaseID) ProtoMessage

func (*LeaseID) ProtoMessage()

func (*LeaseID) Reset

func (m *LeaseID) Reset()

func (*LeaseID) String

func (m *LeaseID) String() string

func (*LeaseID) XXX_DiscardUnknown

func (m *LeaseID) XXX_DiscardUnknown()

func (*LeaseID) XXX_Marshal

func (m *LeaseID) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*LeaseID) XXX_Merge

func (m *LeaseID) XXX_Merge(src proto.Message)

func (*LeaseID) XXX_Size

func (m *LeaseID) XXX_Size() int

func (*LeaseID) XXX_Unmarshal

func (m *LeaseID) XXX_Unmarshal(b []byte) error

type MarketKeeper

type MarketKeeper interface {
	GetLease(ctx sdk.Context, id mv1.LeaseID) (mv1.Lease, bool)
}

MarketKeeper is the minimal subset of the market keeper we need: just enough to look up a lease by ID. Declared here as an interface to keep this module loosely coupled and testable.

type MsgClient

type MsgClient interface {
	// SubmitProviderScore accepts a tenant-side reputation submission for
	// a closed, paid lease. See MsgSubmitProviderScore.
	SubmitProviderScore(ctx context.Context, in *MsgSubmitProviderScore, opts ...grpc.CallOption) (*MsgSubmitProviderScoreResponse, error)
	// UpdateParams applies a new parameter set. Gov-only.
	UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error)
}

MsgClient is the client API for Msg service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewMsgClient

func NewMsgClient(cc grpc1.ClientConn) MsgClient

type MsgServer

type MsgServer interface {
	// SubmitProviderScore accepts a tenant-side reputation submission for
	// a closed, paid lease. See MsgSubmitProviderScore.
	SubmitProviderScore(context.Context, *MsgSubmitProviderScore) (*MsgSubmitProviderScoreResponse, error)
	// UpdateParams applies a new parameter set. Gov-only.
	UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error)
}

MsgServer is the server API for Msg service.

type MsgSubmitProviderScore

type MsgSubmitProviderScore struct {
	// Tenant is the lease.Owner; must equal the tx signer.
	Tenant string `protobuf:"bytes,1,opt,name=tenant,proto3" json:"tenant,omitempty"`
	// Provider is the lease.ID.Provider whose reputation is being scored.
	Provider string `protobuf:"bytes,2,opt,name=provider,proto3" json:"provider,omitempty"`
	// LeaseId is the fully-qualified lease this score is against.
	LeaseId LeaseID `protobuf:"bytes,3,opt,name=lease_id,json=leaseId,proto3" json:"lease_id"`
	// Bps is the score itself, 0..Params.MaxBPS.
	Bps                  uint32   `protobuf:"varint,4,opt,name=bps,proto3" json:"bps,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

MsgSubmitProviderScore lets a tenant who has paid (i.e. whose escrow payment for the referenced lease has Withdrawn >= MinTransferredForScore) submit a one-shot score against the lease's provider. Eligibility is re-verified server-side; ValidateBasic only enforces the cheap shape invariants.

Exactly one score is accepted per closed lease (enforced by a per-lease tombstone in keeper state). Subsequent submissions for the same lease are rejected with ErrAlreadyScored.

func (*MsgSubmitProviderScore) Descriptor

func (*MsgSubmitProviderScore) Descriptor() ([]byte, []int)

func (*MsgSubmitProviderScore) GetBps

func (m *MsgSubmitProviderScore) GetBps() uint32

func (*MsgSubmitProviderScore) GetLeaseId

func (m *MsgSubmitProviderScore) GetLeaseId() LeaseID

func (*MsgSubmitProviderScore) GetProvider

func (m *MsgSubmitProviderScore) GetProvider() string

func (MsgSubmitProviderScore) GetSigners

func (m MsgSubmitProviderScore) GetSigners() []sdk.AccAddress

GetSigners returns the tenant address; the signer on the tx must match.

func (*MsgSubmitProviderScore) GetTenant

func (m *MsgSubmitProviderScore) GetTenant() string

func (*MsgSubmitProviderScore) ProtoMessage

func (*MsgSubmitProviderScore) ProtoMessage()

func (*MsgSubmitProviderScore) Reset

func (m *MsgSubmitProviderScore) Reset()

func (*MsgSubmitProviderScore) String

func (m *MsgSubmitProviderScore) String() string

func (MsgSubmitProviderScore) ToMarketLeaseID

func (m MsgSubmitProviderScore) ToMarketLeaseID() mv1.LeaseID

ToMarketLeaseID converts the in-tx LeaseID copy to the upstream pkg.akt.dev/go/node/market/v1.LeaseID, which is what the market keeper consumes. We deliberately do not propagate BSeq because it is not addressable in the closed-lease lookup path used by our eligibility checker.

func (MsgSubmitProviderScore) ValidateBasic

func (m MsgSubmitProviderScore) ValidateBasic() error

ValidateBasic performs stateless checks on a score submission. The stateful checks (lease state, owner match, withdrawn amount, per-lease tombstone) live in the keeper.

func (*MsgSubmitProviderScore) XXX_DiscardUnknown

func (m *MsgSubmitProviderScore) XXX_DiscardUnknown()

func (*MsgSubmitProviderScore) XXX_Marshal

func (m *MsgSubmitProviderScore) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*MsgSubmitProviderScore) XXX_Merge

func (m *MsgSubmitProviderScore) XXX_Merge(src proto.Message)

func (*MsgSubmitProviderScore) XXX_Size

func (m *MsgSubmitProviderScore) XXX_Size() int

func (*MsgSubmitProviderScore) XXX_Unmarshal

func (m *MsgSubmitProviderScore) XXX_Unmarshal(b []byte) error

type MsgSubmitProviderScoreResponse

type MsgSubmitProviderScoreResponse struct {
	// WeightedBps is the new aggregate score for the provider after this
	// submission has been folded in.
	WeightedBps uint32 `protobuf:"varint,1,opt,name=weighted_bps,json=weightedBps,proto3" json:"weighted_bps,omitempty"`
	// ObservationCount is the new observation count after this submission.
	ObservationCount     uint32   `protobuf:"varint,2,opt,name=observation_count,json=observationCount,proto3" json:"observation_count,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

MsgSubmitProviderScoreResponse is the success result.

func (*MsgSubmitProviderScoreResponse) Descriptor

func (*MsgSubmitProviderScoreResponse) Descriptor() ([]byte, []int)

func (*MsgSubmitProviderScoreResponse) GetObservationCount

func (m *MsgSubmitProviderScoreResponse) GetObservationCount() uint32

func (*MsgSubmitProviderScoreResponse) GetWeightedBps

func (m *MsgSubmitProviderScoreResponse) GetWeightedBps() uint32

func (*MsgSubmitProviderScoreResponse) ProtoMessage

func (*MsgSubmitProviderScoreResponse) ProtoMessage()

func (*MsgSubmitProviderScoreResponse) Reset

func (m *MsgSubmitProviderScoreResponse) Reset()

func (*MsgSubmitProviderScoreResponse) String

func (*MsgSubmitProviderScoreResponse) XXX_DiscardUnknown

func (m *MsgSubmitProviderScoreResponse) XXX_DiscardUnknown()

func (*MsgSubmitProviderScoreResponse) XXX_Marshal

func (m *MsgSubmitProviderScoreResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*MsgSubmitProviderScoreResponse) XXX_Merge

func (m *MsgSubmitProviderScoreResponse) XXX_Merge(src proto.Message)

func (*MsgSubmitProviderScoreResponse) XXX_Size

func (m *MsgSubmitProviderScoreResponse) XXX_Size() int

func (*MsgSubmitProviderScoreResponse) XXX_Unmarshal

func (m *MsgSubmitProviderScoreResponse) XXX_Unmarshal(b []byte) error

type MsgUpdateParams

type MsgUpdateParams struct {
	// Authority is the address that controls the module (typically gov).
	Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"`
	// Params is the full set of new parameters to apply atomically.
	Params               Params   `protobuf:"bytes,2,opt,name=params,proto3" json:"params"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

MsgUpdateParams updates the reputation module parameters. The signer must be the gov module account.

func (*MsgUpdateParams) Descriptor

func (*MsgUpdateParams) Descriptor() ([]byte, []int)

func (*MsgUpdateParams) GetAuthority

func (m *MsgUpdateParams) GetAuthority() string

func (*MsgUpdateParams) GetParams

func (m *MsgUpdateParams) GetParams() Params

func (MsgUpdateParams) GetSigners

func (m MsgUpdateParams) GetSigners() []sdk.AccAddress

GetSigners returns the authority address; the signer on the tx must match (typically gov).

func (*MsgUpdateParams) ProtoMessage

func (*MsgUpdateParams) ProtoMessage()

func (*MsgUpdateParams) Reset

func (m *MsgUpdateParams) Reset()

func (*MsgUpdateParams) String

func (m *MsgUpdateParams) String() string

func (MsgUpdateParams) ValidateBasic

func (m MsgUpdateParams) ValidateBasic() error

ValidateBasic for MsgUpdateParams.

func (*MsgUpdateParams) XXX_DiscardUnknown

func (m *MsgUpdateParams) XXX_DiscardUnknown()

func (*MsgUpdateParams) XXX_Marshal

func (m *MsgUpdateParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*MsgUpdateParams) XXX_Merge

func (m *MsgUpdateParams) XXX_Merge(src proto.Message)

func (*MsgUpdateParams) XXX_Size

func (m *MsgUpdateParams) XXX_Size() int

func (*MsgUpdateParams) XXX_Unmarshal

func (m *MsgUpdateParams) XXX_Unmarshal(b []byte) error

type MsgUpdateParamsResponse

type MsgUpdateParamsResponse struct {
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

MsgUpdateParamsResponse is the empty response for MsgUpdateParams.

func (*MsgUpdateParamsResponse) Descriptor

func (*MsgUpdateParamsResponse) Descriptor() ([]byte, []int)

func (*MsgUpdateParamsResponse) ProtoMessage

func (*MsgUpdateParamsResponse) ProtoMessage()

func (*MsgUpdateParamsResponse) Reset

func (m *MsgUpdateParamsResponse) Reset()

func (*MsgUpdateParamsResponse) String

func (m *MsgUpdateParamsResponse) String() string

func (*MsgUpdateParamsResponse) XXX_DiscardUnknown

func (m *MsgUpdateParamsResponse) XXX_DiscardUnknown()

func (*MsgUpdateParamsResponse) XXX_Marshal

func (m *MsgUpdateParamsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*MsgUpdateParamsResponse) XXX_Merge

func (m *MsgUpdateParamsResponse) XXX_Merge(src proto.Message)

func (*MsgUpdateParamsResponse) XXX_Size

func (m *MsgUpdateParamsResponse) XXX_Size() int

func (*MsgUpdateParamsResponse) XXX_Unmarshal

func (m *MsgUpdateParamsResponse) XXX_Unmarshal(b []byte) error

type Params

type Params struct {
	// MinTransferredForScore is the minimum payment.Withdrawn amount (uakt)
	// required for the closed-lease tenant to be eligible to submit a score.
	// It is encoded as a stringified sdk.Coin amount to keep the proto stable
	// when the chain swaps denoms or scales precision.
	MinTransferredForScore string `` /* 164-byte string literal not displayed */
	// ScoreDenom is the denomination of MinTransferredForScore (e.g. "uakt").
	ScoreDenom string `protobuf:"bytes,2,opt,name=score_denom,json=scoreDenom,proto3" json:"score_denom,omitempty" yaml:"score_denom"`
	// MaxBPS is the upper bound for any single submitted score, in basis
	// points (10000 = 100%).
	MaxBps uint32 `protobuf:"varint,3,opt,name=max_bps,json=maxBps,proto3" json:"max_bps,omitempty" yaml:"max_bps"`
	// HalfLifeBlocks is the half-life (in blocks) for the time-decayed
	// weighted-average aggregation. A score that is HalfLifeBlocks old
	// contributes half of its original weight; 2*HalfLifeBlocks old → 1/4;
	// and so on. Must be > 0.
	HalfLifeBlocks uint64 `` /* 130-byte string literal not displayed */
	// MaxScoreHistoryPerProvider caps the number of ScoreEntry rows kept per
	// provider. Older entries are pruned FIFO when this cap is exceeded; the
	// pruning is informational-only because the aggregate is already
	// maintained incrementally and does not require the history.
	MaxScoreHistoryPerProvider uint32 `` /* 184-byte string literal not displayed */
	// MaxQueryPageSize clamps the per-call result limit on paginated gRPC /
	// wasm queries. Callers requesting more than this get clamped silently.
	MaxQueryPageSize uint32 `` /* 141-byte string literal not displayed */
	// MaxAvailabilityHistoryPerProvider caps the number of AvailabilityEvent
	// rows retained per provider. Older rows are pruned FIFO when exceeded.
	MaxAvailabilityHistoryPerProvider uint32   `` /* 212-byte string literal not displayed */
	XXX_NoUnkeyedLiteral              struct{} `json:"-"`
	XXX_unrecognized                  []byte   `json:"-"`
	XXX_sizecache                     int32    `json:"-"`
}

Params holds the governance-tunable parameters for the reputation module.

All thresholds and scaling factors that can affect the on-chain aggregation logic live here. They are loaded at module init and may be updated through MsgUpdateParams (gov-only). No magic numbers are used in the keeper or msg_server — every constant is sourced from this struct.

func DefaultParams

func DefaultParams() Params

DefaultParams returns the default parameters for the reputation module.

func (*Params) Descriptor

func (*Params) Descriptor() ([]byte, []int)

func (*Params) GetHalfLifeBlocks

func (m *Params) GetHalfLifeBlocks() uint64

func (*Params) GetMaxAvailabilityHistoryPerProvider

func (m *Params) GetMaxAvailabilityHistoryPerProvider() uint32

func (*Params) GetMaxBps

func (m *Params) GetMaxBps() uint32

func (*Params) GetMaxQueryPageSize

func (m *Params) GetMaxQueryPageSize() uint32

func (*Params) GetMaxScoreHistoryPerProvider

func (m *Params) GetMaxScoreHistoryPerProvider() uint32

func (*Params) GetMinTransferredForScore

func (m *Params) GetMinTransferredForScore() string

func (*Params) GetScoreDenom

func (m *Params) GetScoreDenom() string

func (Params) MinTransferredForScoreInt

func (p Params) MinTransferredForScoreInt() sdkmath.Int

MinTransferredForScoreInt parses MinTransferredForScore into a sdkmath.Int. Validate must be called first; this method panics on a malformed value because the keeper has already validated the params before persisting them.

func (*Params) ProtoMessage

func (*Params) ProtoMessage()

func (*Params) Reset

func (m *Params) Reset()

func (*Params) String

func (m *Params) String() string

func (Params) Validate

func (p Params) Validate() error

Validate checks the parameters for sane values. Called from ValidateGenesis and from MsgUpdateParams handler.

func (*Params) XXX_DiscardUnknown

func (m *Params) XXX_DiscardUnknown()

func (*Params) XXX_Marshal

func (m *Params) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Params) XXX_Merge

func (m *Params) XXX_Merge(src proto.Message)

func (*Params) XXX_Size

func (m *Params) XXX_Size() int

func (*Params) XXX_Unmarshal

func (m *Params) XXX_Unmarshal(b []byte) error

type ProviderAggregate

type ProviderAggregate struct {
	// Provider is the bech32 address of the subject.
	Provider string `protobuf:"bytes,1,opt,name=provider,proto3" json:"provider,omitempty"`
	// WeightedBps is the latest computed weighted-average score, in basis
	// points (0..MaxBPS). It is the response value most consumers actually
	// care about.
	WeightedBps uint32 `protobuf:"varint,2,opt,name=weighted_bps,json=weightedBps,proto3" json:"weighted_bps,omitempty"`
	// WeightTotal is the (decayed) sum of all weights so far. Stored as
	// sdkmath.LegacyDec string so we don't lose precision across decay
	// multiplications. A weight_total of zero means there are no usable
	// observations (all decayed to dust); in that case weighted_bps is
	// meaningless and consumers should treat the provider as "no
	// reputation".
	WeightTotal string `protobuf:"bytes,3,opt,name=weight_total,json=weightTotal,proto3" json:"weight_total,omitempty"`
	// NumeratorBps is the (decayed) sum of bps*weight contributions, in the
	// same LegacyDec encoding as WeightTotal. Kept on-chain so subsequent
	// updates are O(1) and idempotent regardless of submission frequency.
	NumeratorBps string `protobuf:"bytes,4,opt,name=numerator_bps,json=numeratorBps,proto3" json:"numerator_bps,omitempty"`
	// ObservationCount is a monotonic counter of accepted submissions for
	// this provider (does not decay; useful for a "minimum number of
	// observations" filter from contracts).
	ObservationCount uint32 `protobuf:"varint,5,opt,name=observation_count,json=observationCount,proto3" json:"observation_count,omitempty"`
	// LastUpdateHeight is the height of the most recent ScoreEntry recorded
	// for this provider. Equal to LastRecomputedHeight on a successful
	// submission; tracked separately to allow cheap "was this provider
	// scored recently?" filters in queries.
	LastUpdateHeight int64 `protobuf:"varint,6,opt,name=last_update_height,json=lastUpdateHeight,proto3" json:"last_update_height,omitempty"`
	// LastRecomputedHeight is the height at which the running aggregate was
	// last decayed. Used as the anchor for the next decay multiplication.
	LastRecomputedHeight int64    `protobuf:"varint,7,opt,name=last_recomputed_height,json=lastRecomputedHeight,proto3" json:"last_recomputed_height,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

ProviderAggregate is the running weighted-average reputation for a single provider, maintained incrementally on every score submission so that no full-history scan is needed at read time.

Stored at: agg/{provider} -> ProviderAggregate.

Decay model: at submission time we age the existing numerator and denominator by exp2(-(currentHeight - last_recomputed_height) / HalfLifeBlocks), then add (bps*weight, weight). This keeps the weighted-average exponentially decayed without a sliding window.

func (*ProviderAggregate) Descriptor

func (*ProviderAggregate) Descriptor() ([]byte, []int)

func (*ProviderAggregate) GetLastRecomputedHeight

func (m *ProviderAggregate) GetLastRecomputedHeight() int64

func (*ProviderAggregate) GetLastUpdateHeight

func (m *ProviderAggregate) GetLastUpdateHeight() int64

func (*ProviderAggregate) GetNumeratorBps

func (m *ProviderAggregate) GetNumeratorBps() string

func (*ProviderAggregate) GetObservationCount

func (m *ProviderAggregate) GetObservationCount() uint32

func (*ProviderAggregate) GetProvider

func (m *ProviderAggregate) GetProvider() string

func (*ProviderAggregate) GetWeightTotal

func (m *ProviderAggregate) GetWeightTotal() string

func (*ProviderAggregate) GetWeightedBps

func (m *ProviderAggregate) GetWeightedBps() uint32

func (*ProviderAggregate) ProtoMessage

func (*ProviderAggregate) ProtoMessage()

func (*ProviderAggregate) Reset

func (m *ProviderAggregate) Reset()

func (*ProviderAggregate) String

func (m *ProviderAggregate) String() string

func (*ProviderAggregate) XXX_DiscardUnknown

func (m *ProviderAggregate) XXX_DiscardUnknown()

func (*ProviderAggregate) XXX_Marshal

func (m *ProviderAggregate) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ProviderAggregate) XXX_Merge

func (m *ProviderAggregate) XXX_Merge(src proto.Message)

func (*ProviderAggregate) XXX_Size

func (m *ProviderAggregate) XXX_Size() int

func (*ProviderAggregate) XXX_Unmarshal

func (m *ProviderAggregate) XXX_Unmarshal(b []byte) error

type ProviderAvailability

type ProviderAvailability struct {
	Provider string `json:"provider"`

	RespondedBids      uint64 `json:"responded_bids"`
	MissedEligibleBids uint64 `json:"missed_eligible_bids"`

	OnlineBlocks  uint64 `json:"online_blocks"`
	OfflineBlocks uint64 `json:"offline_blocks"`

	FirstSeenHeight   int64 `json:"first_seen_height"`
	LastSeenHeight    int64 `json:"last_seen_height"`
	LastOfflineHeight int64 `json:"last_offline_height"`

	// CurrentWindowStartHeight is the height at which the current state
	// window started. Combined with CurrentStateOnline it yields the
	// in-flight duration of the active window.
	CurrentWindowStartHeight int64 `json:"current_window_start_height"`

	// CurrentStateOnline reports the latest observed availability state.
	// Defaults to false on a fresh aggregate; the first AvailabilityOnline
	// event flips it true.
	CurrentStateOnline bool `json:"current_state_online"`

	// LastEventHeight is the height at which the last event was applied;
	// used as the anchor for the next window accumulation.
	LastEventHeight int64 `json:"last_event_height"`

	// AvailabilityBps is the latest derived score in basis points
	// (0..10000). 0 means "no positive evidence yet"; consumers SHOULD
	// treat ObservationCount == 0 as "no opinion" rather than "bad
	// provider".
	AvailabilityBps uint32 `json:"availability_bps"`

	// ObservationCount counts the total number of availability events
	// applied to this aggregate. Useful for "minimum observations"
	// filters from contracts that don't want to act on a single data
	// point.
	ObservationCount uint32 `json:"observation_count"`
}

ProviderAvailability is the chain-derived availability and service-duration record for a single provider. It lives alongside the proto-defined ProviderAggregate but is stored separately, in JSON, under a dedicated KV prefix so the existing proto schema is not disturbed.

Stored at: avail/{provider} -> json.

Semantics:

  • RespondedBids is a monotonic counter of bid placements observed for this provider.
  • MissedEligibleBids only ticks when an external module asserts the provider was eligible to bid on an order but did not, so price / attribute / capacity filtering does NOT count as offline.
  • OnlineBlocks and OfflineBlocks accumulate completed windows. The in-flight window is implicit in CurrentWindowStartHeight and is added on the next state transition or query.
  • AvailabilityBps is recomputed on every state update and is the value the wasm bindings and HA contract consume directly.

func ProviderAvailabilityFromProto

func ProviderAvailabilityFromProto(s AvailabilitySummary) ProviderAvailability

ProviderAvailabilityFromProto maps a genesis / query proto aggregate back into the JSON-backed keeper struct.

func (ProviderAvailability) AggregateOfflineBlocks

func (a ProviderAvailability) AggregateOfflineBlocks(currentHeight int64) uint64

AggregateOfflineBlocks returns OfflineBlocks plus the in-flight portion of the current window when the provider is currently offline.

func (ProviderAvailability) AggregateOnlineBlocks

func (a ProviderAvailability) AggregateOnlineBlocks(currentHeight int64) uint64

AggregateOnlineBlocks returns OnlineBlocks plus the in-flight portion of the current window when the provider is currently online. The aggregate is read-only.

func (ProviderAvailability) AvailabilityRatioBps

func (a ProviderAvailability) AvailabilityRatioBps(currentHeight int64) uint32

AvailabilityRatioBps returns the live availability ratio as basis points (online / (online+offline) * 10000), counting the in-flight window. Returns 0 when there is no data at all.

type QueryClient

type QueryClient interface {
	// Params returns the current module parameters.
	Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error)
	// ProviderScore returns the latest aggregate for a single provider.
	ProviderScore(ctx context.Context, in *QueryProviderScoreRequest, opts ...grpc.CallOption) (*QueryProviderScoreResponse, error)
	// Providers returns a filtered, sorted, paginated provider list.
	Providers(ctx context.Context, in *QueryProvidersRequest, opts ...grpc.CallOption) (*QueryProvidersResponse, error)
	// ProviderHistory returns chronological score entries for a provider.
	ProviderHistory(ctx context.Context, in *QueryProviderHistoryRequest, opts ...grpc.CallOption) (*QueryProviderHistoryResponse, error)
	// TenantSubmissions returns all submissions made by a tenant.
	TenantSubmissions(ctx context.Context, in *QueryTenantSubmissionsRequest, opts ...grpc.CallOption) (*QueryTenantSubmissionsResponse, error)
	// ProviderAvailability returns the chain-derived availability aggregate.
	ProviderAvailability(ctx context.Context, in *QueryProviderAvailabilityRequest, opts ...grpc.CallOption) (*QueryProviderAvailabilityResponse, error)
	// ProviderAvailabilityHistory returns chronological availability events.
	ProviderAvailabilityHistory(ctx context.Context, in *QueryProviderAvailabilityHistoryRequest, opts ...grpc.CallOption) (*QueryProviderAvailabilityHistoryResponse, error)
}

QueryClient is the client API for Query service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewQueryClient

func NewQueryClient(cc grpc1.ClientConn) QueryClient

type QueryParamsRequest

type QueryParamsRequest struct {
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

QueryParamsRequest is the request type for the Query/Params RPC.

func (*QueryParamsRequest) Descriptor

func (*QueryParamsRequest) Descriptor() ([]byte, []int)

func (*QueryParamsRequest) ProtoMessage

func (*QueryParamsRequest) ProtoMessage()

func (*QueryParamsRequest) Reset

func (m *QueryParamsRequest) Reset()

func (*QueryParamsRequest) String

func (m *QueryParamsRequest) String() string

func (*QueryParamsRequest) XXX_DiscardUnknown

func (m *QueryParamsRequest) XXX_DiscardUnknown()

func (*QueryParamsRequest) XXX_Marshal

func (m *QueryParamsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*QueryParamsRequest) XXX_Merge

func (m *QueryParamsRequest) XXX_Merge(src proto.Message)

func (*QueryParamsRequest) XXX_Size

func (m *QueryParamsRequest) XXX_Size() int

func (*QueryParamsRequest) XXX_Unmarshal

func (m *QueryParamsRequest) XXX_Unmarshal(b []byte) error

type QueryParamsResponse

type QueryParamsResponse struct {
	Params               Params   `protobuf:"bytes,1,opt,name=params,proto3" json:"params"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

QueryParamsResponse is the response type for the Query/Params RPC.

func (*QueryParamsResponse) Descriptor

func (*QueryParamsResponse) Descriptor() ([]byte, []int)

func (*QueryParamsResponse) GetParams

func (m *QueryParamsResponse) GetParams() Params

func (*QueryParamsResponse) ProtoMessage

func (*QueryParamsResponse) ProtoMessage()

func (*QueryParamsResponse) Reset

func (m *QueryParamsResponse) Reset()

func (*QueryParamsResponse) String

func (m *QueryParamsResponse) String() string

func (*QueryParamsResponse) XXX_DiscardUnknown

func (m *QueryParamsResponse) XXX_DiscardUnknown()

func (*QueryParamsResponse) XXX_Marshal

func (m *QueryParamsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*QueryParamsResponse) XXX_Merge

func (m *QueryParamsResponse) XXX_Merge(src proto.Message)

func (*QueryParamsResponse) XXX_Size

func (m *QueryParamsResponse) XXX_Size() int

func (*QueryParamsResponse) XXX_Unmarshal

func (m *QueryParamsResponse) XXX_Unmarshal(b []byte) error

type QueryProviderAvailabilityHistoryRequest

type QueryProviderAvailabilityHistoryRequest struct {
	Provider             string   `protobuf:"bytes,1,opt,name=provider,proto3" json:"provider,omitempty"`
	FromHeight           int64    `protobuf:"varint,2,opt,name=from_height,json=fromHeight,proto3" json:"from_height,omitempty"`
	ToHeight             int64    `protobuf:"varint,3,opt,name=to_height,json=toHeight,proto3" json:"to_height,omitempty"`
	Limit                uint32   `protobuf:"varint,4,opt,name=limit,proto3" json:"limit,omitempty"`
	PageKey              []byte   `protobuf:"bytes,5,opt,name=page_key,json=pageKey,proto3" json:"page_key,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

QueryProviderAvailabilityHistoryRequest pages availability events.

func (*QueryProviderAvailabilityHistoryRequest) Descriptor

func (*QueryProviderAvailabilityHistoryRequest) Descriptor() ([]byte, []int)

func (*QueryProviderAvailabilityHistoryRequest) GetFromHeight

func (*QueryProviderAvailabilityHistoryRequest) GetLimit

func (*QueryProviderAvailabilityHistoryRequest) GetPageKey

func (*QueryProviderAvailabilityHistoryRequest) GetProvider

func (*QueryProviderAvailabilityHistoryRequest) GetToHeight

func (*QueryProviderAvailabilityHistoryRequest) ProtoMessage

func (*QueryProviderAvailabilityHistoryRequest) Reset

func (*QueryProviderAvailabilityHistoryRequest) String

func (*QueryProviderAvailabilityHistoryRequest) XXX_DiscardUnknown

func (m *QueryProviderAvailabilityHistoryRequest) XXX_DiscardUnknown()

func (*QueryProviderAvailabilityHistoryRequest) XXX_Marshal

func (m *QueryProviderAvailabilityHistoryRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*QueryProviderAvailabilityHistoryRequest) XXX_Merge

func (*QueryProviderAvailabilityHistoryRequest) XXX_Size

func (*QueryProviderAvailabilityHistoryRequest) XXX_Unmarshal

func (m *QueryProviderAvailabilityHistoryRequest) XXX_Unmarshal(b []byte) error

type QueryProviderAvailabilityHistoryResponse

type QueryProviderAvailabilityHistoryResponse struct {
	Events               []AvailabilityAuditEntry `protobuf:"bytes,1,rep,name=events,proto3" json:"events"`
	NextPageKey          []byte                   `protobuf:"bytes,2,opt,name=next_page_key,json=nextPageKey,proto3" json:"next_page_key,omitempty"`
	Count                uint32                   `protobuf:"varint,3,opt,name=count,proto3" json:"count,omitempty"`
	XXX_NoUnkeyedLiteral struct{}                 `json:"-"`
	XXX_unrecognized     []byte                   `json:"-"`
	XXX_sizecache        int32                    `json:"-"`
}

QueryProviderAvailabilityHistoryResponse is the paginated event list.

func (*QueryProviderAvailabilityHistoryResponse) Descriptor

func (*QueryProviderAvailabilityHistoryResponse) Descriptor() ([]byte, []int)

func (*QueryProviderAvailabilityHistoryResponse) GetCount

func (*QueryProviderAvailabilityHistoryResponse) GetEvents

func (*QueryProviderAvailabilityHistoryResponse) GetNextPageKey

func (m *QueryProviderAvailabilityHistoryResponse) GetNextPageKey() []byte

func (*QueryProviderAvailabilityHistoryResponse) ProtoMessage

func (*QueryProviderAvailabilityHistoryResponse) Reset

func (*QueryProviderAvailabilityHistoryResponse) String

func (*QueryProviderAvailabilityHistoryResponse) XXX_DiscardUnknown

func (m *QueryProviderAvailabilityHistoryResponse) XXX_DiscardUnknown()

func (*QueryProviderAvailabilityHistoryResponse) XXX_Marshal

func (m *QueryProviderAvailabilityHistoryResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*QueryProviderAvailabilityHistoryResponse) XXX_Merge

func (*QueryProviderAvailabilityHistoryResponse) XXX_Size

func (*QueryProviderAvailabilityHistoryResponse) XXX_Unmarshal

func (m *QueryProviderAvailabilityHistoryResponse) XXX_Unmarshal(b []byte) error

type QueryProviderAvailabilityRequest

type QueryProviderAvailabilityRequest struct {
	Provider string `protobuf:"bytes,1,opt,name=provider,proto3" json:"provider,omitempty"`
	// AtHeight optionally folds the in-flight window at this height; zero
	// means the current block height.
	AtHeight             int64    `protobuf:"varint,2,opt,name=at_height,json=atHeight,proto3" json:"at_height,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

QueryProviderAvailabilityRequest fetches the availability summary for a provider.

func (*QueryProviderAvailabilityRequest) Descriptor

func (*QueryProviderAvailabilityRequest) Descriptor() ([]byte, []int)

func (*QueryProviderAvailabilityRequest) GetAtHeight

func (m *QueryProviderAvailabilityRequest) GetAtHeight() int64

func (*QueryProviderAvailabilityRequest) GetProvider

func (m *QueryProviderAvailabilityRequest) GetProvider() string

func (*QueryProviderAvailabilityRequest) ProtoMessage

func (*QueryProviderAvailabilityRequest) ProtoMessage()

func (*QueryProviderAvailabilityRequest) Reset

func (*QueryProviderAvailabilityRequest) String

func (*QueryProviderAvailabilityRequest) XXX_DiscardUnknown

func (m *QueryProviderAvailabilityRequest) XXX_DiscardUnknown()

func (*QueryProviderAvailabilityRequest) XXX_Marshal

func (m *QueryProviderAvailabilityRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*QueryProviderAvailabilityRequest) XXX_Merge

func (*QueryProviderAvailabilityRequest) XXX_Size

func (m *QueryProviderAvailabilityRequest) XXX_Size() int

func (*QueryProviderAvailabilityRequest) XXX_Unmarshal

func (m *QueryProviderAvailabilityRequest) XXX_Unmarshal(b []byte) error

type QueryProviderAvailabilityResponse

type QueryProviderAvailabilityResponse struct {
	Found                bool                `protobuf:"varint,1,opt,name=found,proto3" json:"found,omitempty"`
	Availability         AvailabilitySummary `protobuf:"bytes,2,opt,name=availability,proto3" json:"availability"`
	XXX_NoUnkeyedLiteral struct{}            `json:"-"`
	XXX_unrecognized     []byte              `json:"-"`
	XXX_sizecache        int32               `json:"-"`
}

QueryProviderAvailabilityResponse returns availability data; found=false when no record exists yet.

func (*QueryProviderAvailabilityResponse) Descriptor

func (*QueryProviderAvailabilityResponse) Descriptor() ([]byte, []int)

func (*QueryProviderAvailabilityResponse) GetAvailability

func (*QueryProviderAvailabilityResponse) GetFound

func (*QueryProviderAvailabilityResponse) ProtoMessage

func (*QueryProviderAvailabilityResponse) ProtoMessage()

func (*QueryProviderAvailabilityResponse) Reset

func (*QueryProviderAvailabilityResponse) String

func (*QueryProviderAvailabilityResponse) XXX_DiscardUnknown

func (m *QueryProviderAvailabilityResponse) XXX_DiscardUnknown()

func (*QueryProviderAvailabilityResponse) XXX_Marshal

func (m *QueryProviderAvailabilityResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*QueryProviderAvailabilityResponse) XXX_Merge

func (*QueryProviderAvailabilityResponse) XXX_Size

func (m *QueryProviderAvailabilityResponse) XXX_Size() int

func (*QueryProviderAvailabilityResponse) XXX_Unmarshal

func (m *QueryProviderAvailabilityResponse) XXX_Unmarshal(b []byte) error

type QueryProviderHistoryRequest

type QueryProviderHistoryRequest struct {
	Provider             string   `protobuf:"bytes,1,opt,name=provider,proto3" json:"provider,omitempty"`
	FromHeight           int64    `protobuf:"varint,2,opt,name=from_height,json=fromHeight,proto3" json:"from_height,omitempty"`
	ToHeight             int64    `protobuf:"varint,3,opt,name=to_height,json=toHeight,proto3" json:"to_height,omitempty"`
	Limit                uint32   `protobuf:"varint,4,opt,name=limit,proto3" json:"limit,omitempty"`
	PageKey              []byte   `protobuf:"bytes,5,opt,name=page_key,json=pageKey,proto3" json:"page_key,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

QueryProviderHistoryRequest fetches a chronological list of scores for a single provider in the (optional) [from_height, to_height] range.

func (*QueryProviderHistoryRequest) Descriptor

func (*QueryProviderHistoryRequest) Descriptor() ([]byte, []int)

func (*QueryProviderHistoryRequest) GetFromHeight

func (m *QueryProviderHistoryRequest) GetFromHeight() int64

func (*QueryProviderHistoryRequest) GetLimit

func (m *QueryProviderHistoryRequest) GetLimit() uint32

func (*QueryProviderHistoryRequest) GetPageKey

func (m *QueryProviderHistoryRequest) GetPageKey() []byte

func (*QueryProviderHistoryRequest) GetProvider

func (m *QueryProviderHistoryRequest) GetProvider() string

func (*QueryProviderHistoryRequest) GetToHeight

func (m *QueryProviderHistoryRequest) GetToHeight() int64

func (*QueryProviderHistoryRequest) ProtoMessage

func (*QueryProviderHistoryRequest) ProtoMessage()

func (*QueryProviderHistoryRequest) Reset

func (m *QueryProviderHistoryRequest) Reset()

func (*QueryProviderHistoryRequest) String

func (m *QueryProviderHistoryRequest) String() string

func (*QueryProviderHistoryRequest) XXX_DiscardUnknown

func (m *QueryProviderHistoryRequest) XXX_DiscardUnknown()

func (*QueryProviderHistoryRequest) XXX_Marshal

func (m *QueryProviderHistoryRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*QueryProviderHistoryRequest) XXX_Merge

func (m *QueryProviderHistoryRequest) XXX_Merge(src proto.Message)

func (*QueryProviderHistoryRequest) XXX_Size

func (m *QueryProviderHistoryRequest) XXX_Size() int

func (*QueryProviderHistoryRequest) XXX_Unmarshal

func (m *QueryProviderHistoryRequest) XXX_Unmarshal(b []byte) error

type QueryProviderHistoryResponse

type QueryProviderHistoryResponse struct {
	Entries              []ScoreEntry `protobuf:"bytes,1,rep,name=entries,proto3" json:"entries"`
	NextPageKey          []byte       `protobuf:"bytes,2,opt,name=next_page_key,json=nextPageKey,proto3" json:"next_page_key,omitempty"`
	Count                uint32       `protobuf:"varint,3,opt,name=count,proto3" json:"count,omitempty"`
	XXX_NoUnkeyedLiteral struct{}     `json:"-"`
	XXX_unrecognized     []byte       `json:"-"`
	XXX_sizecache        int32        `json:"-"`
}

QueryProviderHistoryResponse is the paginated history response.

func (*QueryProviderHistoryResponse) Descriptor

func (*QueryProviderHistoryResponse) Descriptor() ([]byte, []int)

func (*QueryProviderHistoryResponse) GetCount

func (m *QueryProviderHistoryResponse) GetCount() uint32

func (*QueryProviderHistoryResponse) GetEntries

func (m *QueryProviderHistoryResponse) GetEntries() []ScoreEntry

func (*QueryProviderHistoryResponse) GetNextPageKey

func (m *QueryProviderHistoryResponse) GetNextPageKey() []byte

func (*QueryProviderHistoryResponse) ProtoMessage

func (*QueryProviderHistoryResponse) ProtoMessage()

func (*QueryProviderHistoryResponse) Reset

func (m *QueryProviderHistoryResponse) Reset()

func (*QueryProviderHistoryResponse) String

func (*QueryProviderHistoryResponse) XXX_DiscardUnknown

func (m *QueryProviderHistoryResponse) XXX_DiscardUnknown()

func (*QueryProviderHistoryResponse) XXX_Marshal

func (m *QueryProviderHistoryResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*QueryProviderHistoryResponse) XXX_Merge

func (m *QueryProviderHistoryResponse) XXX_Merge(src proto.Message)

func (*QueryProviderHistoryResponse) XXX_Size

func (m *QueryProviderHistoryResponse) XXX_Size() int

func (*QueryProviderHistoryResponse) XXX_Unmarshal

func (m *QueryProviderHistoryResponse) XXX_Unmarshal(b []byte) error

type QueryProviderScoreRequest

type QueryProviderScoreRequest struct {
	Provider             string   `protobuf:"bytes,1,opt,name=provider,proto3" json:"provider,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

QueryProviderScoreRequest fetches the latest aggregate for a single provider.

func (*QueryProviderScoreRequest) Descriptor

func (*QueryProviderScoreRequest) Descriptor() ([]byte, []int)

func (*QueryProviderScoreRequest) GetProvider

func (m *QueryProviderScoreRequest) GetProvider() string

func (*QueryProviderScoreRequest) ProtoMessage

func (*QueryProviderScoreRequest) ProtoMessage()

func (*QueryProviderScoreRequest) Reset

func (m *QueryProviderScoreRequest) Reset()

func (*QueryProviderScoreRequest) String

func (m *QueryProviderScoreRequest) String() string

func (*QueryProviderScoreRequest) XXX_DiscardUnknown

func (m *QueryProviderScoreRequest) XXX_DiscardUnknown()

func (*QueryProviderScoreRequest) XXX_Marshal

func (m *QueryProviderScoreRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*QueryProviderScoreRequest) XXX_Merge

func (m *QueryProviderScoreRequest) XXX_Merge(src proto.Message)

func (*QueryProviderScoreRequest) XXX_Size

func (m *QueryProviderScoreRequest) XXX_Size() int

func (*QueryProviderScoreRequest) XXX_Unmarshal

func (m *QueryProviderScoreRequest) XXX_Unmarshal(b []byte) error

type QueryProviderScoreResponse

type QueryProviderScoreResponse struct {
	Found                bool              `protobuf:"varint,1,opt,name=found,proto3" json:"found,omitempty"`
	Aggregate            ProviderAggregate `protobuf:"bytes,2,opt,name=aggregate,proto3" json:"aggregate"`
	XXX_NoUnkeyedLiteral struct{}          `json:"-"`
	XXX_unrecognized     []byte            `json:"-"`
	XXX_sizecache        int32             `json:"-"`
}

QueryProviderScoreResponse returns the provider aggregate; when the provider has never been scored, found=false and aggregate is the zero value.

func (*QueryProviderScoreResponse) Descriptor

func (*QueryProviderScoreResponse) Descriptor() ([]byte, []int)

func (*QueryProviderScoreResponse) GetAggregate

func (*QueryProviderScoreResponse) GetFound

func (m *QueryProviderScoreResponse) GetFound() bool

func (*QueryProviderScoreResponse) ProtoMessage

func (*QueryProviderScoreResponse) ProtoMessage()

func (*QueryProviderScoreResponse) Reset

func (m *QueryProviderScoreResponse) Reset()

func (*QueryProviderScoreResponse) String

func (m *QueryProviderScoreResponse) String() string

func (*QueryProviderScoreResponse) XXX_DiscardUnknown

func (m *QueryProviderScoreResponse) XXX_DiscardUnknown()

func (*QueryProviderScoreResponse) XXX_Marshal

func (m *QueryProviderScoreResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*QueryProviderScoreResponse) XXX_Merge

func (m *QueryProviderScoreResponse) XXX_Merge(src proto.Message)

func (*QueryProviderScoreResponse) XXX_Size

func (m *QueryProviderScoreResponse) XXX_Size() int

func (*QueryProviderScoreResponse) XXX_Unmarshal

func (m *QueryProviderScoreResponse) XXX_Unmarshal(b []byte) error

type QueryProvidersRequest

type QueryProvidersRequest struct {
	MinBps  uint32 `protobuf:"varint,1,opt,name=min_bps,json=minBps,proto3" json:"min_bps,omitempty"`
	SortBy  string `protobuf:"bytes,2,opt,name=sort_by,json=sortBy,proto3" json:"sort_by,omitempty"`
	Limit   uint32 `protobuf:"varint,3,opt,name=limit,proto3" json:"limit,omitempty"`
	PageKey []byte `protobuf:"bytes,4,opt,name=page_key,json=pageKey,proto3" json:"page_key,omitempty"`
	// MinObservations filters out providers with fewer than this many
	// recorded scores. Zero disables the filter.
	MinObservations uint32 `protobuf:"varint,5,opt,name=min_observations,json=minObservations,proto3" json:"min_observations,omitempty"`
	// MinAvailabilityBps filters by chain-derived availability_bps (inclusive).
	// Zero disables the filter.
	MinAvailabilityBps uint32 `protobuf:"varint,6,opt,name=min_availability_bps,json=minAvailabilityBps,proto3" json:"min_availability_bps,omitempty"`
	// MinOnlineBlocks requires aggregate online blocks (including in-flight
	// window at query height) >= this value. Zero disables.
	MinOnlineBlocks uint64 `protobuf:"varint,7,opt,name=min_online_blocks,json=minOnlineBlocks,proto3" json:"min_online_blocks,omitempty"`
	// MaxMissedEligibleBids filters to providers with missed_eligible_bids <=
	// this value. Zero disables.
	MaxMissedEligibleBids uint64   `` /* 129-byte string literal not displayed */
	XXX_NoUnkeyedLiteral  struct{} `json:"-"`
	XXX_unrecognized      []byte   `json:"-"`
	XXX_sizecache         int32    `json:"-"`
}

QueryProvidersRequest filters and sorts the on-chain aggregates.

MinBps is the inclusive lower bound on weighted_bps. Sort is one of "bps_desc", "weight_desc", "recent_desc". Limit is clamped to Params.MaxQueryPageSize. PageKey is an opaque cursor returned by the previous response (empty for first page).

func (*QueryProvidersRequest) Descriptor

func (*QueryProvidersRequest) Descriptor() ([]byte, []int)

func (*QueryProvidersRequest) GetLimit

func (m *QueryProvidersRequest) GetLimit() uint32

func (*QueryProvidersRequest) GetMaxMissedEligibleBids

func (m *QueryProvidersRequest) GetMaxMissedEligibleBids() uint64

func (*QueryProvidersRequest) GetMinAvailabilityBps

func (m *QueryProvidersRequest) GetMinAvailabilityBps() uint32

func (*QueryProvidersRequest) GetMinBps

func (m *QueryProvidersRequest) GetMinBps() uint32

func (*QueryProvidersRequest) GetMinObservations

func (m *QueryProvidersRequest) GetMinObservations() uint32

func (*QueryProvidersRequest) GetMinOnlineBlocks

func (m *QueryProvidersRequest) GetMinOnlineBlocks() uint64

func (*QueryProvidersRequest) GetPageKey

func (m *QueryProvidersRequest) GetPageKey() []byte

func (*QueryProvidersRequest) GetSortBy

func (m *QueryProvidersRequest) GetSortBy() string

func (*QueryProvidersRequest) ProtoMessage

func (*QueryProvidersRequest) ProtoMessage()

func (*QueryProvidersRequest) Reset

func (m *QueryProvidersRequest) Reset()

func (*QueryProvidersRequest) String

func (m *QueryProvidersRequest) String() string

func (*QueryProvidersRequest) XXX_DiscardUnknown

func (m *QueryProvidersRequest) XXX_DiscardUnknown()

func (*QueryProvidersRequest) XXX_Marshal

func (m *QueryProvidersRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*QueryProvidersRequest) XXX_Merge

func (m *QueryProvidersRequest) XXX_Merge(src proto.Message)

func (*QueryProvidersRequest) XXX_Size

func (m *QueryProvidersRequest) XXX_Size() int

func (*QueryProvidersRequest) XXX_Unmarshal

func (m *QueryProvidersRequest) XXX_Unmarshal(b []byte) error

type QueryProvidersResponse

type QueryProvidersResponse struct {
	Providers []ProviderAggregate `protobuf:"bytes,1,rep,name=providers,proto3" json:"providers"`
	// NextPageKey is the cursor to pass back as page_key for the next page;
	// empty when the result set is exhausted.
	NextPageKey          []byte   `protobuf:"bytes,2,opt,name=next_page_key,json=nextPageKey,proto3" json:"next_page_key,omitempty"`
	Count                uint32   `protobuf:"varint,3,opt,name=count,proto3" json:"count,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

QueryProvidersResponse is the paginated provider list response.

func (*QueryProvidersResponse) Descriptor

func (*QueryProvidersResponse) Descriptor() ([]byte, []int)

func (*QueryProvidersResponse) GetCount

func (m *QueryProvidersResponse) GetCount() uint32

func (*QueryProvidersResponse) GetNextPageKey

func (m *QueryProvidersResponse) GetNextPageKey() []byte

func (*QueryProvidersResponse) GetProviders

func (m *QueryProvidersResponse) GetProviders() []ProviderAggregate

func (*QueryProvidersResponse) ProtoMessage

func (*QueryProvidersResponse) ProtoMessage()

func (*QueryProvidersResponse) Reset

func (m *QueryProvidersResponse) Reset()

func (*QueryProvidersResponse) String

func (m *QueryProvidersResponse) String() string

func (*QueryProvidersResponse) XXX_DiscardUnknown

func (m *QueryProvidersResponse) XXX_DiscardUnknown()

func (*QueryProvidersResponse) XXX_Marshal

func (m *QueryProvidersResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*QueryProvidersResponse) XXX_Merge

func (m *QueryProvidersResponse) XXX_Merge(src proto.Message)

func (*QueryProvidersResponse) XXX_Size

func (m *QueryProvidersResponse) XXX_Size() int

func (*QueryProvidersResponse) XXX_Unmarshal

func (m *QueryProvidersResponse) XXX_Unmarshal(b []byte) error

type QueryServer

type QueryServer interface {
	// Params returns the current module parameters.
	Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error)
	// ProviderScore returns the latest aggregate for a single provider.
	ProviderScore(context.Context, *QueryProviderScoreRequest) (*QueryProviderScoreResponse, error)
	// Providers returns a filtered, sorted, paginated provider list.
	Providers(context.Context, *QueryProvidersRequest) (*QueryProvidersResponse, error)
	// ProviderHistory returns chronological score entries for a provider.
	ProviderHistory(context.Context, *QueryProviderHistoryRequest) (*QueryProviderHistoryResponse, error)
	// TenantSubmissions returns all submissions made by a tenant.
	TenantSubmissions(context.Context, *QueryTenantSubmissionsRequest) (*QueryTenantSubmissionsResponse, error)
	// ProviderAvailability returns the chain-derived availability aggregate.
	ProviderAvailability(context.Context, *QueryProviderAvailabilityRequest) (*QueryProviderAvailabilityResponse, error)
	// ProviderAvailabilityHistory returns chronological availability events.
	ProviderAvailabilityHistory(context.Context, *QueryProviderAvailabilityHistoryRequest) (*QueryProviderAvailabilityHistoryResponse, error)
}

QueryServer is the server API for Query service.

type QueryTenantSubmissionsRequest

type QueryTenantSubmissionsRequest struct {
	Tenant               string   `protobuf:"bytes,1,opt,name=tenant,proto3" json:"tenant,omitempty"`
	Limit                uint32   `protobuf:"varint,2,opt,name=limit,proto3" json:"limit,omitempty"`
	PageKey              []byte   `protobuf:"bytes,3,opt,name=page_key,json=pageKey,proto3" json:"page_key,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

QueryTenantSubmissionsRequest fetches all submissions made by a single tenant.

func (*QueryTenantSubmissionsRequest) Descriptor

func (*QueryTenantSubmissionsRequest) Descriptor() ([]byte, []int)

func (*QueryTenantSubmissionsRequest) GetLimit

func (m *QueryTenantSubmissionsRequest) GetLimit() uint32

func (*QueryTenantSubmissionsRequest) GetPageKey

func (m *QueryTenantSubmissionsRequest) GetPageKey() []byte

func (*QueryTenantSubmissionsRequest) GetTenant

func (m *QueryTenantSubmissionsRequest) GetTenant() string

func (*QueryTenantSubmissionsRequest) ProtoMessage

func (*QueryTenantSubmissionsRequest) ProtoMessage()

func (*QueryTenantSubmissionsRequest) Reset

func (m *QueryTenantSubmissionsRequest) Reset()

func (*QueryTenantSubmissionsRequest) String

func (*QueryTenantSubmissionsRequest) XXX_DiscardUnknown

func (m *QueryTenantSubmissionsRequest) XXX_DiscardUnknown()

func (*QueryTenantSubmissionsRequest) XXX_Marshal

func (m *QueryTenantSubmissionsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*QueryTenantSubmissionsRequest) XXX_Merge

func (m *QueryTenantSubmissionsRequest) XXX_Merge(src proto.Message)

func (*QueryTenantSubmissionsRequest) XXX_Size

func (m *QueryTenantSubmissionsRequest) XXX_Size() int

func (*QueryTenantSubmissionsRequest) XXX_Unmarshal

func (m *QueryTenantSubmissionsRequest) XXX_Unmarshal(b []byte) error

type QueryTenantSubmissionsResponse

type QueryTenantSubmissionsResponse struct {
	Entries              []ScoreEntry `protobuf:"bytes,1,rep,name=entries,proto3" json:"entries"`
	NextPageKey          []byte       `protobuf:"bytes,2,opt,name=next_page_key,json=nextPageKey,proto3" json:"next_page_key,omitempty"`
	Count                uint32       `protobuf:"varint,3,opt,name=count,proto3" json:"count,omitempty"`
	XXX_NoUnkeyedLiteral struct{}     `json:"-"`
	XXX_unrecognized     []byte       `json:"-"`
	XXX_sizecache        int32        `json:"-"`
}

QueryTenantSubmissionsResponse is the paginated tenant-side response.

func (*QueryTenantSubmissionsResponse) Descriptor

func (*QueryTenantSubmissionsResponse) Descriptor() ([]byte, []int)

func (*QueryTenantSubmissionsResponse) GetCount

func (m *QueryTenantSubmissionsResponse) GetCount() uint32

func (*QueryTenantSubmissionsResponse) GetEntries

func (m *QueryTenantSubmissionsResponse) GetEntries() []ScoreEntry

func (*QueryTenantSubmissionsResponse) GetNextPageKey

func (m *QueryTenantSubmissionsResponse) GetNextPageKey() []byte

func (*QueryTenantSubmissionsResponse) ProtoMessage

func (*QueryTenantSubmissionsResponse) ProtoMessage()

func (*QueryTenantSubmissionsResponse) Reset

func (m *QueryTenantSubmissionsResponse) Reset()

func (*QueryTenantSubmissionsResponse) String

func (*QueryTenantSubmissionsResponse) XXX_DiscardUnknown

func (m *QueryTenantSubmissionsResponse) XXX_DiscardUnknown()

func (*QueryTenantSubmissionsResponse) XXX_Marshal

func (m *QueryTenantSubmissionsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*QueryTenantSubmissionsResponse) XXX_Merge

func (m *QueryTenantSubmissionsResponse) XXX_Merge(src proto.Message)

func (*QueryTenantSubmissionsResponse) XXX_Size

func (m *QueryTenantSubmissionsResponse) XXX_Size() int

func (*QueryTenantSubmissionsResponse) XXX_Unmarshal

func (m *QueryTenantSubmissionsResponse) XXX_Unmarshal(b []byte) error

type ScoreEntry

type ScoreEntry struct {
	// Tenant is the bech32 address of the lease owner who submitted the
	// score. Eligibility is enforced at submit time; this field is recorded
	// only as audit metadata.
	Tenant string `protobuf:"bytes,1,opt,name=tenant,proto3" json:"tenant,omitempty"`
	// Provider is the bech32 address of the lease's provider.
	Provider string `protobuf:"bytes,2,opt,name=provider,proto3" json:"provider,omitempty"`
	// LeaseId is a flat string of the lease's primary key in the form
	// "owner/dseq/gseq/oseq/provider/bseq". Stored flat (not nested) so the
	// history queries can sort/group without proto-decode cost.
	LeaseId string `protobuf:"bytes,3,opt,name=lease_id,json=leaseId,proto3" json:"lease_id,omitempty"`
	// Bps is the score itself (0..MaxBPS, see Params).
	Bps uint32 `protobuf:"varint,4,opt,name=bps,proto3" json:"bps,omitempty"`
	// Weight is the uakt amount transferred for this lease (i.e.
	// payment.State.Withdrawn.Amount). Encoded as string so it can carry the
	// full sdk.Int range. A score's contribution to the aggregate is
	// weight * decay(blocks_since_submit).
	Weight string `protobuf:"bytes,5,opt,name=weight,proto3" json:"weight,omitempty"`
	// SubmittedHeight is the block height at which the tenant submitted the
	// score. Used as a prefix in the entry key so range scans are
	// chronological.
	SubmittedHeight      int64    `protobuf:"varint,6,opt,name=submitted_height,json=submittedHeight,proto3" json:"submitted_height,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

ScoreEntry is one tenant-submitted, on-chain reputation observation.

Stored at: entry/{provider}/{height_be8}/{leasePk} -> ScoreEntry. Used for: history queries and audit trail. NOT consulted by the aggregation update path (which is incremental, in O(1)).

func (*ScoreEntry) Descriptor

func (*ScoreEntry) Descriptor() ([]byte, []int)

func (*ScoreEntry) GetBps

func (m *ScoreEntry) GetBps() uint32

func (*ScoreEntry) GetLeaseId

func (m *ScoreEntry) GetLeaseId() string

func (*ScoreEntry) GetProvider

func (m *ScoreEntry) GetProvider() string

func (*ScoreEntry) GetSubmittedHeight

func (m *ScoreEntry) GetSubmittedHeight() int64

func (*ScoreEntry) GetTenant

func (m *ScoreEntry) GetTenant() string

func (*ScoreEntry) GetWeight

func (m *ScoreEntry) GetWeight() string

func (*ScoreEntry) ProtoMessage

func (*ScoreEntry) ProtoMessage()

func (*ScoreEntry) Reset

func (m *ScoreEntry) Reset()

func (*ScoreEntry) String

func (m *ScoreEntry) String() string

func (*ScoreEntry) XXX_DiscardUnknown

func (m *ScoreEntry) XXX_DiscardUnknown()

func (*ScoreEntry) XXX_Marshal

func (m *ScoreEntry) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ScoreEntry) XXX_Merge

func (m *ScoreEntry) XXX_Merge(src proto.Message)

func (*ScoreEntry) XXX_Size

func (m *ScoreEntry) XXX_Size() int

func (*ScoreEntry) XXX_Unmarshal

func (m *ScoreEntry) XXX_Unmarshal(b []byte) error

type UnimplementedMsgServer

type UnimplementedMsgServer struct {
}

UnimplementedMsgServer can be embedded to have forward compatible implementations.

func (*UnimplementedMsgServer) SubmitProviderScore

func (*UnimplementedMsgServer) UpdateParams

type UnimplementedQueryServer

type UnimplementedQueryServer struct {
}

UnimplementedQueryServer can be embedded to have forward compatible implementations.

func (*UnimplementedQueryServer) Params

func (*UnimplementedQueryServer) ProviderHistory

func (*UnimplementedQueryServer) ProviderScore

func (*UnimplementedQueryServer) Providers

func (*UnimplementedQueryServer) TenantSubmissions

type WasmKeeper

type WasmKeeper interface {
	HasContractInfo(ctx context.Context, addr sdk.AccAddress) bool
	GetContractInfo(ctx context.Context, addr sdk.AccAddress) *ContractInfo
}

WasmKeeper is the minimal subset of the wasm keeper used by VerifyEligibility to authorise a contract admin as a valid signer for MsgSubmitProviderScore on contract-owned leases. Optional: when nil, only the lease.owner itself can sign (legacy behaviour).

Jump to

Keyboard shortcuts

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