actorutils

package
v0.6.3 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2024 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) error

Closes an open reputer nonce.

func CloseWorkerNonce

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

Closes an open worker nonce.

func FilterUnacceptedWorkersFromReputerValueBundle added in v0.3.1

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

Types

This section is empty.

Jump to

Keyboard shortcuts

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