Documentation ¶
Index ¶
- func NewMsgServerImpl(keeper Keeper) types.MsgServer
- type BlsSigner
- type CheckpointsState
- func (cs CheckpointsState) CreateRawCkptWithMeta(ckptWithMeta *types.RawCheckpointWithMeta) error
- func (cs CheckpointsState) GetRawCkptWithMeta(epoch uint64) (*types.RawCheckpointWithMeta, error)
- func (cs CheckpointsState) GetRawCkptsWithMetaByStatus(status types.CheckpointStatus, f func(*types.RawCheckpointWithMeta) bool) error
- func (cs CheckpointsState) UpdateCheckpoint(ckpt *types.RawCheckpointWithMeta) error
- func (cs CheckpointsState) UpdateCkptStatus(ckpt *types.RawCheckpoint, status types.CheckpointStatus) error
- type Keeper
- func (k Keeper) AddRawCheckpoint(ctx sdk.Context, ckptWithMeta *types.RawCheckpointWithMeta) error
- func (k Keeper) AfterBlsKeyRegistered(ctx sdk.Context, valAddr sdk.ValAddress) error
- func (k Keeper) AfterRawCheckpointBlsSigVerified(ctx sdk.Context, ckpt *types.RawCheckpoint) error
- func (k Keeper) AfterRawCheckpointConfirmed(ctx sdk.Context, epoch uint64) error
- func (k Keeper) AfterRawCheckpointFinalized(ctx sdk.Context, epoch uint64) error
- func (k Keeper) AfterRawCheckpointForgotten(ctx sdk.Context, ckpt *types.RawCheckpoint) error
- func (k Keeper) BlsPublicKeyList(c context.Context, req *types.QueryBlsPublicKeyListRequest) (*types.QueryBlsPublicKeyListResponse, error)
- func (k Keeper) BuildRawCheckpoint(ctx sdk.Context, epochNum uint64, lch types.LastCommitHash) (*types.RawCheckpointWithMeta, error)
- func (k Keeper) CheckpointsState(ctx sdk.Context) CheckpointsState
- func (k Keeper) ClearValidatorSet(ctx sdk.Context, epochNumber uint64)
- func (k Keeper) CreateRegistration(ctx sdk.Context, blsPubKey bls12381.PublicKey, valAddr sdk.ValAddress) error
- func (k Keeper) EpochStatus(ctx context.Context, req *types.QueryEpochStatusRequest) (*types.QueryEpochStatusResponse, error)
- func (k Keeper) GetBLSPubKeySet(ctx sdk.Context, epochNumber uint64) ([]*types.ValidatorWithBlsKey, error)
- func (k Keeper) GetBlsPubKey(ctx sdk.Context, address sdk.ValAddress) (bls12381.PublicKey, error)
- func (k Keeper) GetCurrentValidatorBlsKeySet(ctx sdk.Context) *types.ValidatorWithBlsKeySet
- func (k Keeper) GetEpoch(ctx sdk.Context) *epochingtypes.Epoch
- func (k Keeper) GetLastCheckpointedEpoch(ctx sdk.Context) (uint64, error)
- func (k Keeper) GetRawCheckpoint(ctx sdk.Context, epochNum uint64) (*types.RawCheckpointWithMeta, error)
- func (k Keeper) GetStatus(ctx sdk.Context, epochNum uint64) (types.CheckpointStatus, error)
- func (k Keeper) GetTotalVotingPower(ctx sdk.Context, epochNumber uint64) int64
- func (k Keeper) GetValidatorBlsKeySet(ctx sdk.Context, epochNumber uint64) *types.ValidatorWithBlsKeySet
- func (k Keeper) GetValidatorSet(ctx sdk.Context, epochNumber uint64) epochingtypes.ValidatorSet
- func (k Keeper) InitValidatorBLSSet(ctx sdk.Context) error
- func (k Keeper) LastCheckpointWithStatus(ctx context.Context, req *types.QueryLastCheckpointWithStatusRequest) (*types.QueryLastCheckpointWithStatusResponse, error)
- func (k Keeper) Logger(ctx sdk.Context) log.Logger
- func (k Keeper) RawCheckpoint(ctx context.Context, req *types.QueryRawCheckpointRequest) (*types.QueryRawCheckpointResponse, error)
- func (k Keeper) RawCheckpointList(ctx context.Context, req *types.QueryRawCheckpointListRequest) (*types.QueryRawCheckpointListResponse, error)
- func (k Keeper) RawCheckpoints(ctx context.Context, req *types.QueryRawCheckpointsRequest) (*types.QueryRawCheckpointsResponse, error)
- func (k Keeper) RecentEpochStatusCount(ctx context.Context, req *types.QueryRecentEpochStatusCountRequest) (*types.QueryRecentEpochStatusCountResponse, error)
- func (k Keeper) RegistrationState(ctx sdk.Context) RegistrationState
- func (k Keeper) SendBlsSig(ctx sdk.Context, epochNum uint64, lch types.LastCommitHash, ...) error
- func (k Keeper) SetCheckpointConfirmed(ctx sdk.Context, epoch uint64)
- func (k Keeper) SetCheckpointFinalized(ctx sdk.Context, epoch uint64)
- func (k Keeper) SetCheckpointForgotten(ctx sdk.Context, epoch uint64)
- func (k Keeper) SetCheckpointSubmitted(ctx sdk.Context, epoch uint64)
- func (k *Keeper) SetEpochingKeeper(ek types.EpochingKeeper)
- func (k Keeper) SetGenBlsKeys(ctx sdk.Context, genKeys []*types.GenesisKey)
- func (k *Keeper) SetHooks(sh types.CheckpointingHooks) *Keeper
- func (k Keeper) UpdateCheckpoint(ctx sdk.Context, ckptWithMeta *types.RawCheckpointWithMeta) error
- func (k Keeper) VerifyCheckpoint(ctx sdk.Context, checkpoint txformat.RawBtcCheckpoint) error
- type RegistrationState
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewMsgServerImpl ¶
NewMsgServerImpl returns an implementation of the MsgServer interface for the provided Keeper.
Types ¶
type CheckpointsState ¶
type CheckpointsState struct {
// contains filtered or unexported fields
}
func (CheckpointsState) CreateRawCkptWithMeta ¶
func (cs CheckpointsState) CreateRawCkptWithMeta(ckptWithMeta *types.RawCheckpointWithMeta) error
CreateRawCkptWithMeta inserts the raw checkpoint with meta into the storage by its epoch number a new checkpoint is created with the status of UNCEHCKPOINTED
func (CheckpointsState) GetRawCkptWithMeta ¶
func (cs CheckpointsState) GetRawCkptWithMeta(epoch uint64) (*types.RawCheckpointWithMeta, error)
GetRawCkptWithMeta retrieves a raw checkpoint with meta by its epoch number
func (CheckpointsState) GetRawCkptsWithMetaByStatus ¶
func (cs CheckpointsState) GetRawCkptsWithMetaByStatus(status types.CheckpointStatus, f func(*types.RawCheckpointWithMeta) bool) error
GetRawCkptsWithMetaByStatus retrieves raw checkpoints with meta by their status by the descending order of epoch
func (CheckpointsState) UpdateCheckpoint ¶
func (cs CheckpointsState) UpdateCheckpoint(ckpt *types.RawCheckpointWithMeta) error
UpdateCheckpoint overwrites an existing checkpoint
func (CheckpointsState) UpdateCkptStatus ¶
func (cs CheckpointsState) UpdateCkptStatus(ckpt *types.RawCheckpoint, status types.CheckpointStatus) error
UpdateCkptStatus updates the checkpoint's status
type Keeper ¶
type Keeper struct {
// contains filtered or unexported fields
}
func NewKeeper ¶
func NewKeeper( cdc codec.BinaryCodec, storeKey, memKey storetypes.StoreKey, signer BlsSigner, ek types.EpochingKeeper, clientCtx client.Context, ) Keeper
func (Keeper) AddRawCheckpoint ¶
AddRawCheckpoint adds a raw checkpoint into the storage
func (Keeper) AfterBlsKeyRegistered ¶
AfterBlsKeyRegistered - call hook if registered
func (Keeper) AfterRawCheckpointBlsSigVerified ¶
AfterRawCheckpointBlsSigVerified - call hook if the checkpoint's BLS sig is verified
func (Keeper) AfterRawCheckpointConfirmed ¶
AfterRawCheckpointConfirmed - call hook if the checkpoint is confirmed
func (Keeper) AfterRawCheckpointFinalized ¶
AfterRawCheckpointFinalized - call hook if the checkpoint is finalized
func (Keeper) AfterRawCheckpointForgotten ¶
func (Keeper) BlsPublicKeyList ¶
func (k Keeper) BlsPublicKeyList(c context.Context, req *types.QueryBlsPublicKeyListRequest) (*types.QueryBlsPublicKeyListResponse, error)
func (Keeper) BuildRawCheckpoint ¶
func (k Keeper) BuildRawCheckpoint(ctx sdk.Context, epochNum uint64, lch types.LastCommitHash) (*types.RawCheckpointWithMeta, error)
func (Keeper) CheckpointsState ¶
func (k Keeper) CheckpointsState(ctx sdk.Context) CheckpointsState
func (Keeper) ClearValidatorSet ¶
ClearValidatorSet removes the validator BLS set of a given epoch TODO: This is called upon the epoch is checkpointed
func (Keeper) CreateRegistration ¶
func (Keeper) EpochStatus ¶
func (k Keeper) EpochStatus(ctx context.Context, req *types.QueryEpochStatusRequest) (*types.QueryEpochStatusResponse, error)
EpochStatus returns the status of the checkpoint at a given epoch
func (Keeper) GetBLSPubKeySet ¶
func (k Keeper) GetBLSPubKeySet(ctx sdk.Context, epochNumber uint64) ([]*types.ValidatorWithBlsKey, error)
GetBLSPubKeySet returns the set of BLS public keys in the same order of the validator set for a given epoch
func (Keeper) GetBlsPubKey ¶
func (Keeper) GetCurrentValidatorBlsKeySet ¶
func (k Keeper) GetCurrentValidatorBlsKeySet(ctx sdk.Context) *types.ValidatorWithBlsKeySet
func (Keeper) GetLastCheckpointedEpoch ¶
GetLastCheckpointedEpoch returns the last epoch number that associates with a checkpoint
func (Keeper) GetRawCheckpoint ¶
func (Keeper) GetTotalVotingPower ¶
func (Keeper) GetValidatorBlsKeySet ¶
func (k Keeper) GetValidatorBlsKeySet(ctx sdk.Context, epochNumber uint64) *types.ValidatorWithBlsKeySet
GetValidatorBlsKeySet returns the set of validators of a given epoch with BLS public key the validators are ordered by their address in ascending order
func (Keeper) GetValidatorSet ¶
func (k Keeper) GetValidatorSet(ctx sdk.Context, epochNumber uint64) epochingtypes.ValidatorSet
func (Keeper) InitValidatorBLSSet ¶
InitValidatorBLSSet stores the validator set with BLS keys in the beginning of the current epoch This is called upon BeginBlock
func (Keeper) LastCheckpointWithStatus ¶
func (k Keeper) LastCheckpointWithStatus(ctx context.Context, req *types.QueryLastCheckpointWithStatusRequest) (*types.QueryLastCheckpointWithStatusResponse, error)
LastCheckpointWithStatus returns the last checkpoint with the given status if the checkpoint with the given status does not exist, return the last checkpoint that is more mature than the given status
func (Keeper) RawCheckpoint ¶
func (k Keeper) RawCheckpoint(ctx context.Context, req *types.QueryRawCheckpointRequest) (*types.QueryRawCheckpointResponse, error)
RawCheckpoint returns a checkpoint by epoch number
func (Keeper) RawCheckpointList ¶
func (k Keeper) RawCheckpointList(ctx context.Context, req *types.QueryRawCheckpointListRequest) (*types.QueryRawCheckpointListResponse, error)
RawCheckpointList returns a list of checkpoint by status in the ascending order of epoch
func (Keeper) RawCheckpoints ¶ added in v0.6.0
func (k Keeper) RawCheckpoints(ctx context.Context, req *types.QueryRawCheckpointsRequest) (*types.QueryRawCheckpointsResponse, error)
RawCheckpoints returns checkpoints for given epoch range specified in pagination params
func (Keeper) RecentEpochStatusCount ¶
func (k Keeper) RecentEpochStatusCount(ctx context.Context, req *types.QueryRecentEpochStatusCountRequest) (*types.QueryRecentEpochStatusCountResponse, error)
RecentEpochStatusCount returns the count of epochs with each status of the checkpoint
func (Keeper) RegistrationState ¶
func (k Keeper) RegistrationState(ctx sdk.Context) RegistrationState
func (Keeper) SendBlsSig ¶
func (k Keeper) SendBlsSig(ctx sdk.Context, epochNum uint64, lch types.LastCommitHash, valSet epochingtypes.ValidatorSet) error
SendBlsSig prepares a BLS signature message and sends it to Tendermint
func (Keeper) SetCheckpointConfirmed ¶
SetCheckpointConfirmed sets the status of a checkpoint to CONFIRMED, and records the associated state update in lifecycle
func (Keeper) SetCheckpointFinalized ¶
SetCheckpointFinalized sets the status of a checkpoint to FINALIZED, and records the associated state update in lifecycle
func (Keeper) SetCheckpointForgotten ¶
SetCheckpointForgotten rolls back the status of a checkpoint to Sealed, and records the associated state update in lifecycle
func (Keeper) SetCheckpointSubmitted ¶
SetCheckpointSubmitted sets the status of a checkpoint to SUBMITTED, and records the associated state update in lifecycle
func (*Keeper) SetEpochingKeeper ¶
func (k *Keeper) SetEpochingKeeper(ek types.EpochingKeeper)
func (Keeper) SetGenBlsKeys ¶
func (k Keeper) SetGenBlsKeys(ctx sdk.Context, genKeys []*types.GenesisKey)
SetGenBlsKeys registers BLS keys with each validator at genesis
func (*Keeper) SetHooks ¶
func (k *Keeper) SetHooks(sh types.CheckpointingHooks) *Keeper
SetHooks sets the validator hooks
func (Keeper) UpdateCheckpoint ¶
func (Keeper) VerifyCheckpoint ¶
VerifyCheckpoint verifies checkpoint from BTC. It verifies the raw checkpoint and decides whether it is an invalid checkpoint or a conflicting checkpoint. A conflicting checkpoint indicates the existence of a fork
type RegistrationState ¶
type RegistrationState struct {
// contains filtered or unexported fields
}
func (RegistrationState) CreateRegistration ¶
func (rs RegistrationState) CreateRegistration(key bls12381.PublicKey, valAddr sdk.ValAddress) error
CreateRegistration inserts the BLS key into the addr -> key and key -> addr storage
func (RegistrationState) Exists ¶
func (rs RegistrationState) Exists(addr sdk.ValAddress) bool
Exists checks whether a BLS key exists
func (RegistrationState) GetBlsPubKey ¶
func (rs RegistrationState) GetBlsPubKey(addr sdk.ValAddress) (bls12381.PublicKey, error)
GetBlsPubKey retrieves BLS public key by validator's address