keeper

package
v0.1.30 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2025 License: MIT Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewMsgServerImpl

func NewMsgServerImpl(keeper Keeper) types.MsgServer

NewMsgServerImpl returns an implementation of the MsgServer interface for the provided Keeper.

func NewSettlementContext added in v0.1.9

func NewSettlementContext(
	ctx context.Context,
	tokenomicsKeeper *Keeper,
	logger cosmoslog.Logger,
) *settlementContext

NewSettlementContext creates a new settlement context with all necessary caches initialized. This function establishes an efficient memory structure that prevents redundant KV store operations during claim processing, improving settlement performance for high volume operations.

Types

type Keeper

type Keeper struct {
	// contains filtered or unexported fields
}

func NewKeeper

func NewKeeper(
	cdc codec.BinaryCodec,
	storeService store.KVStoreService,
	logger log.Logger,
	authority string,

	bankKeeper types.BankKeeper,
	accountKeeper types.AccountKeeper,
	applicationKeeper types.ApplicationKeeper,
	supplierKeeper types.SupplierKeeper,
	proofKeeper types.ProofKeeper,
	sharedKeeper types.SharedKeeper,
	sessionKeeper types.SessionKeeper,
	serviceKeeper types.ServiceKeeper,
	stakingKeeper types.StakingKeeper,

	tokenLogicModules []tlm.TokenLogicModule,
) Keeper

func (Keeper) ExecutePendingExpiredResults added in v0.0.11

func (k Keeper) ExecutePendingExpiredResults(
	ctx cosmostypes.Context,
	settlementContext *settlementContext,
	expiredResults tlm.ClaimSettlementResults,
) error

ExecutePendingExpiredResults executes all pending supplier slashing operations.

func (Keeper) ExecutePendingSettledResults added in v0.0.11

func (k Keeper) ExecutePendingSettledResults(ctx cosmostypes.Context, settledResults tlm.ClaimSettlementResults) error

ExecutePendingSettledResults executes all pending mint, burn, and transfer operations.

func (Keeper) GetAuthority

func (k Keeper) GetAuthority() string

GetAuthority returns the x/tokenomics module's authority.

func (Keeper) GetExpiringClaimsIterator added in v0.1.2

func (k Keeper) GetExpiringClaimsIterator(
	ctx cosmostypes.Context,
	settlementContext *settlementContext,
	blockHeight int64,
) (expiringClaimsIterator sharedtypes.RecordIterator[prooftypes.Claim])

GetExpiringClaimsIterator returns an iterator of all claims expiring at the current block height. DEV_NOTE: It is exported for testing purposes.

func (Keeper) GetParams

func (k Keeper) GetParams(ctx context.Context) (params types.Params)

GetParams get all parameters as types.Params

func (Keeper) Logger

func (k Keeper) Logger() log.Logger

Logger returns a module-specific logger.

func (Keeper) Params

func (Keeper) ProcessTokenLogicModules added in v0.0.6

func (k Keeper) ProcessTokenLogicModules(
	ctx context.Context,
	settlementContext *settlementContext,
	pendingResult *tokenomicstypes.ClaimSettlementResult,
) error

ProcessTokenLogicModules is the entrypoint for all TLM processing.

It is responsible for running all the independent TLMs necessary to limit, burn, mint or transfer tokens as a result of the amount of work (i.e. relays, compute units) done in proportion to the global governance parameters.

Prior to running the TLMs, it handles the business logic of converting the claimed amount to the actual settlement amount and handling the case for overserviced applications.

IMPORTANT: It is assumed that the proof for the claim has been validated BEFORE calling this function.

func (Keeper) SetParams

func (k Keeper) SetParams(ctx context.Context, params types.Params) error

SetParams set the params

func (Keeper) SettlePendingClaims

func (k Keeper) SettlePendingClaims(ctx cosmostypes.Context) (
	settledResults tlm.ClaimSettlementResults,
	expiredResults tlm.ClaimSettlementResults,
	numDiscardedFaultyClaims uint64,
	err error,
)

SettlePendingClaims settles all pending (i.e. expiring) claims. - Settling a claim: If a claim is expired AND requires a proof AND a proof IS available. - Settling a claim: If a claim is expired AND does NOT require a proof. - Deleting a claim: If a claim is expired AND requires a proof AND a proof IS NOT available. Events are emitted for each claim that is settled or removed. Onchain Claims & Proofs are deleted after they're settled or expired to free up space.

func (Keeper) UpdateRelayMiningDifficulty added in v0.0.3

func (k Keeper) UpdateRelayMiningDifficulty(
	ctx context.Context,
	relaysPerServiceMap map[string]uint64,
) (difficultyPerServiceMap map[string]types.RelayMiningDifficulty, err error)

UpdateRelayMiningDifficulty updates the onchain relay mining difficulty. It is a function of onchain relays per service, given a map of serviceId->numRelays.

This is a wrapper around the service keeper's UpdateRelayMiningDifficulty method to allow the tokenomics EndBlocker to update the relay mining difficulty after all claims have settled.

Jump to

Keyboard shortcuts

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