actorutils

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2025 License: Apache-2.0 Imports: 14 Imported by: 0

README

This package contains utilities to deal with actors (workers, reputers).

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CloseReputerNonce

func CloseReputerNonce(
	k *keeper.Keeper,
	ctx sdk.Context,
	topic types.Topic,
	nonce types.Nonce,
) (err error)

Closes an open reputer nonce.

func CloseWorkerNonce

func CloseWorkerNonce(k *keeper.Keeper, ctx sdk.Context, topic types.Topic, nonce types.Nonce) (err error)

Closes an open worker nonce.

func FilterUnacceptedWorkersFromReputerValueBundle

func FilterUnacceptedWorkersFromReputerValueBundle(
	k *keeper.Keeper,
	ctx context.Context,
	topicId uint64,
	reputerRequestNonce types.ReputerRequestNonce,
	reputerValueBundle *types.ReputerValueBundle,
) (*types.ReputerValueBundle, error)

Filter out values of unaccepted workers. It is assumed that the work of inferers and forecasters stored at the nonce is already filtered for acceptance. This also removes duplicate values of the same worker.

func FindTopNByScoreDesc

func FindTopNByScoreDesc(
	ctx sdk.Context,
	n uint64,
	scores []emissionstypes.Score,
	randSeed int64,
) (topNActorsSorted []emissionstypes.Score, allActorsSorted []emissionstypes.Score, actorIsTop map[string]struct{})

Sorts the given actors by score, desc, breaking ties randomly Returns the top N actors as a map with the actor as the key and a boolean (True) as the value

func ProcessAndStoreNetworkInferences added in v0.10.0

func ProcessAndStoreNetworkInferences(
	k *keeper.Keeper,
	ctx sdk.Context,
	topicId uint64,
	blockHeight int64,
	activeInferences *types.Inferences,
	activeForecasts *types.Forecasts,
) error

ProcessAndStoreNetworkInferences calculates and stores both regular and outlier-resistant network inferences for a given topic and block height.

Types

This section is empty.

Jump to

Keyboard shortcuts

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