Documentation ¶
Index ¶
- Constants
- func NewMsgServerImpl(keeper Keeper) types.MsgServer
- func NewRegistry() *registry
- type FeeProvider
- type Keeper
- func (k *Keeper) AddMessageConsensusAttestedListener(l metrixtypes.OnConsensusMessageAttestedListener)
- func (k Keeper) AddMessageEvidence(ctx context.Context, valAddr sdk.ValAddress, msg *types.MsgAddEvidence) error
- func (k Keeper) AddMessageGasEstimates(ctx context.Context, valAddr sdk.ValAddress, ...) error
- func (k Keeper) AddMessageSignature(ctx context.Context, valAddr sdk.ValAddress, ...) error
- func (k Keeper) CheckAndProcessAttestedMessages(ctx context.Context) error
- func (k Keeper) CheckAndProcessEstimatedMessages(ctx context.Context) (err error)
- func (k Keeper) DeleteJob(ctx context.Context, queueTypeName string, id uint64) (err error)
- func (k Keeper) GetAllQueueNames(goCtx context.Context, req *types.QueryGetAllQueueNamesRequest) (*types.QueryGetAllQueueNamesResponse, error)
- func (k Keeper) GetMessagesForAttesting(ctx context.Context, queueTypeName string, valAddress sdk.ValAddress) (msgs []types.QueuedSignedMessageI, err error)
- func (k Keeper) GetMessagesForGasEstimation(ctx context.Context, queueTypeName string, valAddress sdk.ValAddress) (msgs []types.QueuedSignedMessageI, err error)
- func (k Keeper) GetMessagesForRelaying(ctx context.Context, queueTypeName string, valAddress sdk.ValAddress) (msgs []types.QueuedSignedMessageI, err error)
- func (k Keeper) GetMessagesForSigning(ctx context.Context, queueTypeName string, valAddress sdk.ValAddress) (msgs []types.QueuedSignedMessageI, err error)
- func (k Keeper) GetMessagesFromQueue(ctx context.Context, queueTypeName string, n int) (msgs []types.QueuedSignedMessageI, err error)
- func (k Keeper) GetMessagesThatHaveReachedConsensus(ctx context.Context, queueTypeName string) ([]types.QueuedSignedMessageI, error)
- func (k Keeper) GetParams(ctx context.Context) types.Params
- func (k Keeper) GetPendingValsetUpdates(ctx context.Context, queueTypeName string) ([]types.QueuedSignedMessageI, error)
- func (k *Keeper) LateInject(evm types.EvmKeeper)
- func (k Keeper) Logger(ctx context.Context) log.Logger
- func (k Keeper) MessageByID(goCtx context.Context, req *types.QueryMessageByIDRequest) (*types.MessageQueryResult, error)
- func (k Keeper) MessagesInQueue(goCtx context.Context, req *types.QueryMessagesInQueueRequest) (*types.QueryMessagesInQueueResponse, error)
- func (k Keeper) ModuleName() string
- func (k Keeper) Params(c context.Context, req *types.QueryParamsRequest) (*types.QueryParamsResponse, error)
- func (k Keeper) PruneJob(sdkCtx sdk.Context, queueTypeName string, id uint64) error
- func (k Keeper) PruneOldMessages(ctx sdk.Context, blocksAgo int64) error
- func (k Keeper) PutMessageInQueue(ctx context.Context, queueTypeName string, msg consensus.ConsensusMsg, ...) (uint64, error)
- func (k Keeper) QueuedMessagesForAttesting(goCtx context.Context, req *types.QueryQueuedMessagesForAttestingRequest) (*types.QueryQueuedMessagesForAttestingResponse, error)
- func (k Keeper) QueuedMessagesForGasEstimation(goCtx context.Context, req *types.QueryQueuedMessagesForGasEstimationRequest) (*types.QueryQueuedMessagesForGasEstimationResponse, error)
- func (k Keeper) QueuedMessagesForRelaying(goCtx context.Context, req *types.QueryQueuedMessagesForRelayingRequest) (*types.QueryQueuedMessagesForRelayingResponse, error)
- func (k Keeper) QueuedMessagesForSigning(goCtx context.Context, req *types.QueryQueuedMessagesForSigningRequest) (*types.QueryQueuedMessagesForSigningResponse, error)
- func (k Keeper) ReassignOrphanedMessages(ctx sdk.Context, blockAge int64) (err error)
- func (k Keeper) RemoveConsensusQueue(ctx context.Context, queueTypeName string) error
- func (k Keeper) SetMessageErrorData(ctx context.Context, valAddr sdk.ValAddress, msg *types.MsgSetErrorData) error
- func (k Keeper) SetMessagePublicAccessData(ctx context.Context, valAddr sdk.ValAddress, msg *types.MsgSetPublicAccessData) error
- func (k Keeper) SetParams(ctx context.Context, params types.Params)
- func (k Keeper) Store(ctx context.Context) storetypes.KVStore
Constants ¶
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 ¶
NewMsgServerImpl returns an implementation of the MsgServer interface for the provided Keeper.
func NewRegistry ¶
func NewRegistry() *registry
Types ¶
type FeeProvider ¶
type FeeProvider interface {
GetCombinedFeesForRelay(ctx context.Context, valAddress sdk.ValAddress, chainReferenceID string) (*types.MessageFeeSettings, error)
}
type Keeper ¶
type Keeper struct {
// contains filtered or unexported fields
}
func NewKeeper ¶
func NewKeeper( cdc codec.Codec, storeKey store.KVStoreService, ps paramtypes.Subspace, valsetKeeper types.ValsetKeeper, reg *registry, fp FeeProvider, ) *Keeper
func (*Keeper) AddMessageConsensusAttestedListener ¶
func (k *Keeper) AddMessageConsensusAttestedListener(l metrixtypes.OnConsensusMessageAttestedListener)
func (Keeper) AddMessageEvidence ¶
func (k Keeper) AddMessageEvidence( ctx context.Context, valAddr sdk.ValAddress, msg *types.MsgAddEvidence, ) error
func (Keeper) AddMessageGasEstimates ¶
func (k Keeper) AddMessageGasEstimates( ctx context.Context, valAddr sdk.ValAddress, msgs []*types.MsgAddMessageGasEstimates_GasEstimate, ) 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 ¶
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) CheckAndProcessEstimatedMessages ¶
CheckAndProcessEstimatedMessages is supposed to be used within the EndBlocker. It will get messages which have received gas estimates and try to process them.
func (Keeper) GetAllQueueNames ¶
func (k Keeper) GetAllQueueNames(goCtx context.Context, req *types.QueryGetAllQueueNamesRequest) (*types.QueryGetAllQueueNamesResponse, error)
func (Keeper) GetMessagesForAttesting ¶
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) GetMessagesForGasEstimation ¶
func (k Keeper) GetMessagesForGasEstimation(ctx context.Context, queueTypeName string, valAddress sdk.ValAddress) (msgs []types.QueuedSignedMessageI, err error)
func (Keeper) GetMessagesForRelaying ¶
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) GetPendingValsetUpdates ¶
func (k Keeper) GetPendingValsetUpdates(ctx context.Context, queueTypeName string) ([]types.QueuedSignedMessageI, error)
TODO: The infusion of EVM types into the consensus module is a bit of a code smell. We should consider moving the entire logic of message assignment and retrieval to the EVM module to keep the consensus module content-agnostic.
func (*Keeper) LateInject ¶
func (Keeper) MessageByID ¶
func (k Keeper) MessageByID(goCtx context.Context, req *types.QueryMessageByIDRequest) (*types.MessageQueryResult, error)
func (Keeper) MessagesInQueue ¶
func (k Keeper) MessagesInQueue(goCtx context.Context, req *types.QueryMessagesInQueueRequest) (*types.QueryMessagesInQueueResponse, error)
func (Keeper) ModuleName ¶
func (Keeper) Params ¶
func (k Keeper) Params(c context.Context, req *types.QueryParamsRequest) (*types.QueryParamsResponse, error)
func (Keeper) PruneJob ¶
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 ¶
func (Keeper) PutMessageInQueue ¶
func (k Keeper) PutMessageInQueue(ctx context.Context, queueTypeName string, msg consensus.ConsensusMsg, opts *consensus.PutOptions) (uint64, error)
func (Keeper) QueuedMessagesForAttesting ¶
func (k Keeper) QueuedMessagesForAttesting(goCtx context.Context, req *types.QueryQueuedMessagesForAttestingRequest) (*types.QueryQueuedMessagesForAttestingResponse, error)
func (Keeper) QueuedMessagesForGasEstimation ¶
func (k Keeper) QueuedMessagesForGasEstimation(goCtx context.Context, req *types.QueryQueuedMessagesForGasEstimationRequest) (*types.QueryQueuedMessagesForGasEstimationResponse, error)
func (Keeper) QueuedMessagesForRelaying ¶
func (k Keeper) QueuedMessagesForRelaying(goCtx context.Context, req *types.QueryQueuedMessagesForRelayingRequest) (*types.QueryQueuedMessagesForRelayingResponse, error)
func (Keeper) QueuedMessagesForSigning ¶
func (k Keeper) QueuedMessagesForSigning(goCtx context.Context, req *types.QueryQueuedMessagesForSigningRequest) (*types.QueryQueuedMessagesForSigningResponse, error)
func (Keeper) ReassignOrphanedMessages ¶
func (Keeper) RemoveConsensusQueue ¶
func (Keeper) SetMessageErrorData ¶
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
Source Files ¶
- attest.go
- cleanup.go
- concensus_keeper.go
- errors.go
- estimate.go
- grpc_query.go
- grpc_query_get_all_queue_names.go
- grpc_query_messages_in_queue.go
- grpc_query_params.go
- keeper.go
- msg_server.go
- msg_server_add_evidence.go
- msg_server_set_error_data.go
- msg_server_set_public_access_data.go
- params.go
- query_queued_messages_for_attesting.go
- query_queued_messages_for_gas_estimation.go
- query_queued_messages_for_relaying.go
- query_queued_messages_for_signing.go
- registry.go