performance

package
v1.0.0-alpha.19 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2024 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Tracker

type Tracker struct {
	log.Logger
	// contains filtered or unexported fields
}

func NewTracker

func NewTracker(
	rewardsStorePerEpochFunc func(epoch iotago.EpochIndex) (kvstore.KVStore, error),
	poolStatsStore epochstore.Store[*model.PoolsStats],
	committeeStore epochstore.Store[*account.SeatedAccounts],
	committeeCandidatesInEpochFunc func(epoch iotago.EpochIndex) (*kvstore.TypedStore[iotago.AccountID, iotago.SlotIndex], error),
	validatorPerformancesFunc func(slot iotago.SlotIndex) (*slotstore.Store[iotago.AccountID, *model.ValidatorPerformance], error),
	latestAppliedEpoch iotago.EpochIndex,
	apiProvider iotago.APIProvider,
	errHandler func(error),
	logger log.Logger,
) *Tracker

func (*Tracker) ApplyEpoch

func (t *Tracker) ApplyEpoch(epoch iotago.EpochIndex, committee *account.SeatedAccounts) error

ApplyEpoch calculates and stores pool stats and rewards for the given epoch.

func (*Tracker) ClearCandidates

func (t *Tracker) ClearCandidates()

func (*Tracker) DelegatorReward

func (t *Tracker) DelegatorReward(validatorID iotago.AccountID, delegatedAmount iotago.BaseToken, epochStart iotago.EpochIndex, epochEnd iotago.EpochIndex, claimingEpoch iotago.EpochIndex) (delegatorReward iotago.Mana, firstRewardEpoch iotago.EpochIndex, lastRewardEpoch iotago.EpochIndex, err error)

func (*Tracker) EligibleValidatorCandidates

func (t *Tracker) EligibleValidatorCandidates(epoch iotago.EpochIndex) (ds.Set[iotago.AccountID], error)

EligibleValidatorCandidates returns the eligible validator candidates registered in the given epoch for the next epoch.

func (*Tracker) Export

func (t *Tracker) Export(writer io.WriteSeeker, targetSlotIndex iotago.SlotIndex) error

func (*Tracker) Import

func (t *Tracker) Import(reader io.ReadSeeker) error

func (*Tracker) LoadCommitteeForEpoch

func (t *Tracker) LoadCommitteeForEpoch(epoch iotago.EpochIndex) (committee *account.SeatedAccounts, exists bool)

func (*Tracker) PoolRewardsForAccount

func (t *Tracker) PoolRewardsForAccount(accountID iotago.AccountID) (
	poolRewardsForAccount iotago.Mana,
	exists bool,
	err error,
)

func (*Tracker) Reset

func (t *Tracker) Reset(lastCommittedSlot iotago.SlotIndex)

func (*Tracker) RewardsRoot

func (t *Tracker) RewardsRoot(epoch iotago.EpochIndex) (iotago.Identifier, error)

func (*Tracker) TrackCandidateBlock

func (t *Tracker) TrackCandidateBlock(block *blocks.Block)

func (*Tracker) TrackValidationBlock

func (t *Tracker) TrackValidationBlock(block *blocks.Block)

func (*Tracker) ValidatorCandidates

func (t *Tracker) ValidatorCandidates(epoch iotago.EpochIndex) (ds.Set[iotago.AccountID], error)

ValidatorCandidates returns the eligible validator candidates registered in the given epoch for the next epoch.

func (*Tracker) ValidatorReward

func (t *Tracker) ValidatorReward(validatorID iotago.AccountID, stakingFeature *iotago.StakingFeature, claimingEpoch iotago.EpochIndex) (validatorReward iotago.Mana, firstRewardEpoch iotago.EpochIndex, lastRewardEpoch iotago.EpochIndex, err error)

Jump to

Keyboard shortcuts

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