keeper

package
v1.13.4 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: 28 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ErrValidatorWithAddrNotFound   = whoops.Errorf("validator does not exist")
	ErrValidatorNotInKeepAlive     = whoops.Errorf("validator is not in keep alive store %s")
	ErrMaxNumberOfExternalAccounts = whoops.Errorf("trying to submit %d accounts while the limit is %d")
	ErrValidatorCannotBePigeon     = whoops.Errorf("validator %s cannot be a pigeon")

	ErrSigningKeyNotFound             = whoops.Errorf("signing key for valAddr %s, chainType %s and chainReferenceID %s not found")
	ErrExternalChainAlreadyRegistered = whoops.Errorf("external account already registered: %s, %s, %s. Existing owner: %s, New owner: %s")
	ErrExternalAddressNotFound        = whoops.Errorf("external address (%s, %s, %s) for validator %s was not founds")

	ErrCannotJailValidator = whoops.Errorf("cannot jail validator: %s")

	ErrValidatorAlreadyJailed   = whoops.Errorf("validator already jailed: %s")
	ErrValidatorPigeonOutOfDate = whoops.Errorf("validator %s pigeon is out of date.  Version %s less than required %s")
)

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.

Types

type Keeper

type Keeper struct {
	EvmKeeper         types.EvmKeeper
	SnapshotListeners []types.OnSnapshotBuiltListener

	AddressCodec address.Codec
	// contains filtered or unexported fields
}

func NewKeeper

func NewKeeper(
	cdc codec.BinaryCodec,
	storeKey cosmosstore.KVStoreService,
	ps paramtypes.Subspace,
	staking types.StakingKeeper,
	slashing types.SlashingKeeper,
	minimumPigeonVersion string,
	powerReduction sdkmath.Int,
	addressCodec address.Codec,
) *Keeper

func (Keeper) AddExternalChainInfo

func (k Keeper) AddExternalChainInfo(ctx context.Context, valAddr sdk.ValAddress, newChainInfo []*types.ExternalChainInfo) error

addExternalChainInfo adds external chain info, such as this conductor's address on outside chains so that we can attribute rewards for running the jobs.

func (Keeper) CanAcceptKeepAlive added in v1.6.0

func (k Keeper) CanAcceptKeepAlive(ctx context.Context, valAddr sdk.ValAddress, pigeonVersion string) error

func (Keeper) CanAcceptValidator

func (k Keeper) CanAcceptValidator(ctx context.Context, valAddr sdk.ValAddress) error

func (Keeper) FindSnapshotByID

func (k Keeper) FindSnapshotByID(ctx context.Context, id uint64) (*types.Snapshot, error)

func (Keeper) GetAlivePigeons added in v0.8.0

func (Keeper) GetAllChainInfos added in v1.8.0

func (k Keeper) GetAllChainInfos(ctx context.Context) ([]*types.ValidatorExternalAccounts, error)

func (Keeper) GetCurrentSnapshot

func (k Keeper) GetCurrentSnapshot(ctx context.Context) (*types.Snapshot, error)

GetCurrentSnapshot returns the currently active snapshot.

func (Keeper) GetLatestPublishedSnapshot added in v1.9.0

func (Keeper) GetLatestSnapshotOnChain added in v1.2.0

func (k Keeper) GetLatestSnapshotOnChain(ctx context.Context, chainReferenceID string) (*types.Snapshot, error)

func (Keeper) GetParams

func (k Keeper) GetParams(ctx sdk.Context) types.Params

GetParams get all parameters as types.Params

func (Keeper) GetSigningKey

func (k Keeper) GetSigningKey(ctx context.Context, valAddr sdk.ValAddress, chainType, chainReferenceID, signedByAddress string) ([]byte, error)

GetSigningKey returns a signing key used by the conductor to sign arbitrary messages.

func (Keeper) GetUnjailedValidators added in v1.5.0

func (k Keeper) GetUnjailedValidators(ctx context.Context) []stakingtypes.ValidatorI

func (Keeper) GetValidatorAliveUntil added in v0.6.0

func (Keeper) GetValidatorChainInfos added in v0.8.0

func (k Keeper) GetValidatorChainInfos(ctx context.Context, valAddr sdk.ValAddress) ([]*types.ExternalChainInfo, error)

func (Keeper) GetValidatorJailReason added in v0.6.0

func (Keeper) IsJailed

func (k Keeper) IsJailed(ctx context.Context, val sdk.ValAddress) (bool, error)

IsJailed returns if the current validator is jailed or not.

func (Keeper) IsValidatorAlive added in v0.6.0

func (k Keeper) IsValidatorAlive(ctx context.Context, valAddr sdk.ValAddress) (bool, error)

func (Keeper) Jail added in v0.6.0

func (k Keeper) Jail(_ctx context.Context, valAddr sdk.ValAddress, reason string) error

func (Keeper) JailInactiveValidators added in v0.6.0

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

func (Keeper) KeepValidatorAlive added in v0.6.0

func (k Keeper) KeepValidatorAlive(ctx context.Context, valAddr sdk.ValAddress, pigeonVersion string) error

func (Keeper) Logger

func (k Keeper) Logger(ctx context.Context) log.Logger

func (Keeper) Params

func (Keeper) SaveModifiedSnapshot added in v1.2.0

func (k Keeper) SaveModifiedSnapshot(ctx context.Context, snapshot *types.Snapshot) error

SaveModifiedSnapshot is needed for integration tests

func (Keeper) SetExternalChainInfoState

func (k Keeper) SetExternalChainInfoState(ctx context.Context, valAddr sdk.ValAddress, chainInfos []*types.ExternalChainInfo) error

func (Keeper) SetParams

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

SetParams set the params

func (Keeper) SetSnapshotOnChain added in v1.2.0

func (k Keeper) SetSnapshotOnChain(ctx context.Context, snapshotID uint64, chainReferenceID string) error

func (Keeper) SetValidatorBalance added in v0.6.0

func (k Keeper) SetValidatorBalance(ctx context.Context, valAddr sdk.ValAddress, chainType string, chainReferenceID string, externalAddress string, balance *big.Int) error

func (Keeper) TriggerSnapshotBuild

func (k Keeper) TriggerSnapshotBuild(ctx context.Context) (*types.Snapshot, error)

TriggerSnapshotBuild creates the snapshot of currently active validators that are active and registered as conductors.

func (Keeper) UpdateGracePeriod added in v1.5.0

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

UpdateGracePeriod will compare the list of active validators against the snapshot taken during the last block. Any new members will receive a grace period of n blocks. Active validators are stored as one flattened entry to relief pressure on reads every block. Call this during the EndBlock logic.

func (Keeper) ValidatorAliveUntil added in v0.6.0

func (k Keeper) ValidatorAliveUntil(ctx context.Context, valAddr sdk.ValAddress) (int64, error)

func (Keeper) ValidatorInfo

ValidatorInfo returns validator info. It's not related to a snapshot.

func (Keeper) ValidatorSupportsAllChains added in v1.7.0

func (k Keeper) ValidatorSupportsAllChains(ctx context.Context, validatorAddress sdk.ValAddress) bool

ValidatorSupportsAllChains returns true if the validator supports all chains in the keeper

Jump to

Keyboard shortcuts

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