Documentation ¶
Index ¶
- Constants
- func CalculateSegments(payloadSize, segmentSize uint64) uint64
- func NewMsgServerImpl(keeper Keeper) types.MsgServer
- func RandomObjectId(seed []byte, objectCount sdkmath.Uint) sdkmath.Uint
- func RandomRedundancyIndex(seed []byte, sps uint64) int32
- func RandomSegmentIndex(seed []byte, segments uint64) uint32
- func SeedFromRandaoMix(randaoMix []byte, number uint64) []byte
- type BlsSignedMsg
- type Keeper
- func (k Keeper) ChallengeCountPerBlock(ctx sdk.Context) (res uint64)
- func (k Keeper) ExistsSlash(ctx sdk.Context, spOperatorAddress sdk.AccAddress, objectId sdkmath.Uint) bool
- func (k Keeper) GetAttestChallengeId(ctx sdk.Context) uint64
- func (k Keeper) GetChallengeCountCurrentBlock(ctx sdk.Context) uint64
- func (k Keeper) GetOngoingChallengeId(ctx sdk.Context) uint64
- func (k Keeper) GetParams(ctx sdk.Context) types.Params
- func (k Keeper) HeartbeatInterval(ctx sdk.Context) (res uint64)
- func (k Keeper) IncrChallengeCountCurrentBlock(ctx sdk.Context)
- func (k Keeper) LatestAttestedChallenge(goCtx context.Context, req *types.QueryLatestAttestedChallengeRequest) (*types.QueryLatestAttestedChallengeResponse, error)
- func (k Keeper) Logger(ctx sdk.Context) log.Logger
- func (k Keeper) Params(c context.Context, req *types.QueryParamsRequest) (*types.QueryParamsResponse, error)
- func (k Keeper) RemoveSlashUntil(ctx sdk.Context, height uint64)
- func (k Keeper) RewardSubmitterRatio(ctx sdk.Context) (res sdk.Dec)
- func (k Keeper) RewardSubmitterThreshold(ctx sdk.Context) (res math.Int)
- func (k Keeper) RewardValidatorRatio(ctx sdk.Context) (res sdk.Dec)
- func (k Keeper) SaveSlash(ctx sdk.Context, slash types.Slash)
- func (k Keeper) SetAttestChallengeId(ctx sdk.Context, challengeId uint64)
- func (k Keeper) SetOngoingChallengeId(ctx sdk.Context, challengeId uint64)
- func (k Keeper) SetParams(ctx sdk.Context, params types.Params)
- func (k Keeper) SlashAmountMax(ctx sdk.Context) (res math.Int)
- func (k Keeper) SlashAmountMin(ctx sdk.Context) (res math.Int)
- func (k Keeper) SlashAmountSizeRate(ctx sdk.Context) (res sdk.Dec)
- func (k Keeper) SlashCoolingOffPeriod(ctx sdk.Context) (res uint64)
Constants ¶
const RandaoMixLength = 64
RandaoMixLength is the length of randao mix in Tendermint header
Variables ¶
This section is empty.
Functions ¶
func CalculateSegments ¶
CalculateSegments calculates the number of segments for the payload size.
func NewMsgServerImpl ¶
NewMsgServerImpl returns an implementation of the MsgServer interface for the provided Keeper.
func RandomObjectId ¶
RandomObjectId generates a random object id for challenge. Be noted: id starts from 1.
func RandomRedundancyIndex ¶
RandomRedundancyIndex generates a random redundancy index (storage provider) for challenge. Be noted: RedundancyIndex starts from -1 (the primary sp).
func RandomSegmentIndex ¶
RandomSegmentIndex generates a random segment index for challenge.
func SeedFromRandaoMix ¶
SeedFromRandaoMix generates seed from randao mix.
Types ¶
type BlsSignedMsg ¶
type Keeper ¶
type Keeper struct { StorageKeeper types.StorageKeeper SpKeeper types.SpKeeper // contains filtered or unexported fields }
func NewKeeper ¶
func NewKeeper( cdc codec.BinaryCodec, storeKey, memKey, tKey storetypes.StoreKey, ps paramtypes.Subspace, bankKeeper types.BankKeeper, storageKeeper types.StorageKeeper, spKeeper types.SpKeeper, stakingKeeper types.StakingKeeper, paymentKeeper types.PaymentKeeper, ) *Keeper
func (Keeper) ChallengeCountPerBlock ¶
ChallengeCountPerBlock returns the ChallengeCountPerBlock param
func (Keeper) ExistsSlash ¶
func (k Keeper) ExistsSlash(ctx sdk.Context, spOperatorAddress sdk.AccAddress, objectId sdkmath.Uint) bool
ExistsSlash check whether there exists recent slash for a pair of sp and object info or not
func (Keeper) GetAttestChallengeId ¶
GetAttestChallengeId gets the challenge id of the latest attestation challenge
func (Keeper) GetChallengeCountCurrentBlock ¶
GetChallengeCountCurrentBlock gets the count of challenges
func (Keeper) GetOngoingChallengeId ¶
GetOngoingChallengeId gets the highest challenge id
func (Keeper) HeartbeatInterval ¶
HeartbeatInterval returns the HeartbeatInterval param
func (Keeper) IncrChallengeCountCurrentBlock ¶
IncrChallengeCountCurrentBlock increases the count of challenge by one
func (Keeper) LatestAttestedChallenge ¶
func (k Keeper) LatestAttestedChallenge(goCtx context.Context, req *types.QueryLatestAttestedChallengeRequest) (*types.QueryLatestAttestedChallengeResponse, error)
func (Keeper) Params ¶
func (k Keeper) Params(c context.Context, req *types.QueryParamsRequest) (*types.QueryParamsResponse, error)
func (Keeper) RemoveSlashUntil ¶
RemoveSlashUntil removes slashes which are created earlier
func (Keeper) RewardSubmitterRatio ¶
RewardSubmitterRatio returns the RewardSubmitterRatio param
func (Keeper) RewardSubmitterThreshold ¶
RewardSubmitterThreshold returns the RewardSubmitterThreshold param
func (Keeper) RewardValidatorRatio ¶
RewardValidatorRatio returns the RewardValidatorRatio param
func (Keeper) SetAttestChallengeId ¶
SetAttestChallengeId sets the new id of challenge to the store
func (Keeper) SetOngoingChallengeId ¶
SetOngoingChallengeId sets the new challenge id to the store
func (Keeper) SlashAmountMax ¶
SlashAmountMax returns the SlashAmountMax param
func (Keeper) SlashAmountMin ¶
SlashAmountMin returns the SlashAmountMin param
func (Keeper) SlashAmountSizeRate ¶
SlashAmountSizeRate returns the SlashAmountSizeRate param