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: 26 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ErrConsensusQueueNotImplemented   = whoops.Errorf("consensus queue not implemented for queueTypeName %s")
	ErrUnableToFindPubKeyForValidator = whoops.Errorf("unable to find public key for validator: %s")
	ErrSignatureVerificationFailed    = whoops.Errorf("signature verification failed (msgId: %d, valAddr: %s, pubKey: %s)")
	ErrInvalidLimitValue              = whoops.Errorf("invalid N value: %d")
)

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.

func NewRegistry

func NewRegistry() *registry

Types

type Keeper

type Keeper struct {
	// contains filtered or unexported fields
}

func NewKeeper

func NewKeeper(
	cdc codec.BinaryCodec,
	storeKey store.KVStoreService,
	ps paramtypes.Subspace,
	valsetKeeper types.ValsetKeeper,
	reg *registry,
) *Keeper

func (Keeper) AddMessageEvidence

func (k Keeper) AddMessageEvidence(
	ctx context.Context,
	valAddr sdk.ValAddress,
	msg *types.MsgAddEvidence,
) error

func (Keeper) AddMessageSignature

func (k Keeper) AddMessageSignature(
	ctx context.Context,
	valAddr sdk.ValAddress,
	msgs []*types.ConsensusMessageSignature,
) error

AddMessageSignature adds signatures to the messages.

func (Keeper) CheckAndProcessAttestedMessages

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

CheckAndProcessAttestedMessages is supposed to be used within the EndBlocker. It will get messages for the attestators that have reached a consensus and process them.

func (Keeper) DeleteJob added in v0.6.0

func (k Keeper) DeleteJob(ctx context.Context, queueTypeName string, id uint64) (err error)

func (Keeper) GetMessagesForAttesting added in v1.4.0

func (k Keeper) GetMessagesForAttesting(ctx context.Context, queueTypeName string, valAddress sdk.ValAddress) (msgs []types.QueuedSignedMessageI, err error)

GetMessagesForAttesting returns messages for a single validator to attest.

func (Keeper) GetMessagesForRelaying added in v1.4.0

func (k Keeper) GetMessagesForRelaying(ctx context.Context, queueTypeName string, valAddress sdk.ValAddress) (msgs []types.QueuedSignedMessageI, err error)

GetMessagesForRelaying returns messages for a single validator to relay.

func (Keeper) GetMessagesForSigning

func (k Keeper) GetMessagesForSigning(ctx context.Context, queueTypeName string, valAddress sdk.ValAddress) (msgs []types.QueuedSignedMessageI, err error)

GetMessagesForSigning returns messages for a single validator that needs to be signed.

func (Keeper) GetMessagesFromQueue

func (k Keeper) GetMessagesFromQueue(ctx context.Context, queueTypeName string, n int) (msgs []types.QueuedSignedMessageI, err error)

GetMessagesFromQueue gets N messages from the queue.

func (Keeper) GetMessagesThatHaveReachedConsensus

func (k Keeper) GetMessagesThatHaveReachedConsensus(ctx context.Context, queueTypeName string) ([]types.QueuedSignedMessageI, error)

GetMessagesThatHaveReachedConsensus returns messages from a given queueTypeName that have reached consensus based on the latest snapshot available. TODO: This is never used?

func (Keeper) GetParams

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

GetParams get all parameters as types.Params

func (*Keeper) LateInject added in v1.10.2

func (k *Keeper) LateInject(evm types.EvmKeeper)

func (Keeper) Logger

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

func (Keeper) MessageByID added in v1.12.2

func (Keeper) ModuleName added in v1.10.2

func (k Keeper) ModuleName() string

func (Keeper) Params

func (Keeper) PruneJob added in v1.12.2

func (k Keeper) PruneJob(ctx sdk.Context, queueTypeName string, id uint64) (err error)

PruneJob should only be called during the EndBlocker, it will automatically jail any validators who failed to supply evidence for this message. Any message that actually reached consensus will be removed from the queue during attestation, other messages like superfluous valset updates will get removed in their respective logic flows, but none of them should be using this function.

func (Keeper) PruneOldMessages added in v1.10.2

func (k Keeper) PruneOldMessages(ctx sdk.Context, blocksAgo int64) error

func (Keeper) PutMessageInQueue added in v0.6.0

func (k Keeper) PutMessageInQueue(ctx context.Context, queueTypeName string, msg consensus.ConsensusMsg, opts *consensus.PutOptions) (uint64, error)

func (Keeper) QueuedMessagesForAttesting added in v1.4.0

func (Keeper) QueuedMessagesForRelaying added in v1.4.0

func (Keeper) ReassignOrphanedMessages added in v1.10.2

func (k Keeper) ReassignOrphanedMessages(ctx sdk.Context, blockAge int64) (err error)

func (Keeper) RemoveConsensusQueue

func (k Keeper) RemoveConsensusQueue(ctx context.Context, queueTypeName string) error

func (Keeper) SetMessageErrorData added in v1.3.0

func (k Keeper) SetMessageErrorData(
	ctx context.Context,
	valAddr sdk.ValAddress,
	msg *types.MsgSetErrorData,
) error

func (Keeper) SetMessagePublicAccessData

func (k Keeper) SetMessagePublicAccessData(
	ctx context.Context,
	valAddr sdk.ValAddress,
	msg *types.MsgSetPublicAccessData,
) error

func (Keeper) SetParams

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

SetParams set the params

func (Keeper) Store

func (k Keeper) Store(ctx context.Context) storetypes.KVStore

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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