keeper

package
v1.7.0-rc3 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Keeper

type Keeper struct {
	*stakingkeeper.Keeper
	// contains filtered or unexported fields
}

func NewKeeper

func NewKeeper(
	cdc codec.BinaryCodec, storeService store.KVStoreService, ak stakingtypes.AccountKeeper,
	bk stakingtypes.BankKeeper, govModAddress string, vk types.VolunteerKeeper,
	validatorAddressCodec address.Codec, consensusAddressCodec address.Codec,
) *Keeper

func (Keeper) ApplyAndReturnValidatorSetUpdates

func (k Keeper) ApplyAndReturnValidatorSetUpdates(ctx context.Context) (updates []abci.ValidatorUpdate, err error)

ApplyAndReturnValidatorSetUpdates applies and return accumulated updates to the bonded validator set. Also, * Updates the active valset as keyed by LastValidatorPowerKey. * Updates the total power as keyed by LastTotalPowerKey. * Updates validator status' according to updated powers. * Updates the fee pool bonded vs not-bonded tokens. * Updates relevant indices. It gets called once after genesis, another time maybe after genesis transactions, then once at every EndBlock.

CONTRACT: Only validators with non-zero power or zero-power that were bonded at the previous block height or were removed from the validator set entirely are returned to CometBFT.

func (Keeper) BlockValidatorUpdates

func (k Keeper) BlockValidatorUpdates(ctx context.Context) ([]abci.ValidatorUpdate, error)

BlockValidatorUpdates calculates the ValidatorUpdates for the current block Called in each EndBlock

func (Keeper) GetLastValidators

func (k Keeper) GetLastValidators(ctx context.Context) (validators []types.Validator, err error)

GetLastValidators gets the group of the bonded validators

func (Keeper) TrackHistoricalInfo

func (k Keeper) TrackHistoricalInfo(ctx context.Context) error

TrackHistoricalInfo saves the latest historical-info and deletes the oldest heights that are below pruning height

Jump to

Keyboard shortcuts

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