Documentation ¶
Overview ¶
nolint
Index ¶
- Constants
- Variables
- func BeginBlocker(ctx sdk.Context, req abci.RequestBeginBlock, sk Keeper) (tags sdk.Tags)
- func ErrBadValidatorAddr(codespace sdk.CodespaceType) sdk.Error
- func ErrDuplicateDowntimeClaim(codespace sdk.CodespaceType) sdk.Error
- func ErrEvidenceHasBeenHandled(codespace sdk.CodespaceType) sdk.Error
- func ErrExpiredEvidence(codespace sdk.CodespaceType) sdk.Error
- func ErrFailedToSlash(codespace sdk.CodespaceType, msg string) sdk.Error
- func ErrInvalidClaim(codespace sdk.CodespaceType, msg string) sdk.Error
- func ErrInvalidEvidence(codespace sdk.CodespaceType, msg string) sdk.Error
- func ErrInvalidInput(codespace sdk.CodespaceType, msg string) sdk.Error
- func ErrInvalidSideChainId(codespace sdk.CodespaceType) sdk.Error
- func ErrMissingSelfDelegation(codespace sdk.CodespaceType) sdk.Error
- func ErrNoValidatorForAddress(codespace sdk.CodespaceType) sdk.Error
- func ErrSelfDelegationTooLowToUnjail(codespace sdk.CodespaceType) sdk.Error
- func ErrValidatorJailed(codespace sdk.CodespaceType) sdk.Error
- func ErrValidatorNotJailed(codespace sdk.CodespaceType) sdk.Error
- func GetSlashRecordKey(consAddr []byte, infractionType byte, infractionHeight uint64) []byte
- func GetSlashRecordsByAddrAndTypeIndexKey(sideConsAddr []byte, infractionType byte) []byte
- func GetSlashRecordsByAddrIndexKey(sideConsAddr []byte) []byte
- func GetValidatorMissedBlockBitArrayKey(v sdk.ConsAddress, i int64) []byte
- func GetValidatorMissedBlockBitArrayPrefixKey(v sdk.ConsAddress) []byte
- func GetValidatorSigningInfoKey(consAddr []byte) []byte
- func GetValidatorSlashingPeriodKey(v sdk.ConsAddress, startHeight int64) []byte
- func GetValidatorSlashingPeriodPrefix(v sdk.ConsAddress) []byte
- func InitGenesis(ctx sdk.Context, keeper Keeper, data GenesisState, sdata types.GenesisState)
- func MarshalSlashRecord(cdc *codec.Codec, record SlashRecord) ([]byte, error)
- func MustMarshalSlashRecord(cdc *codec.Codec, record SlashRecord) []byte
- func NewHandler(k Keeper) sdk.Handler
- func NewQuerier(k Keeper, cdc *codec.Codec) sdk.Querier
- func NewSlashingHandler(k Keeper) sdk.Handler
- func NewTestMsgCreateValidator(address sdk.ValAddress, pubKey crypto.PubKey, amt int64) stake.MsgCreateValidator
- func ParamTypeTable() params.TypeTable
- func RegisterCodec(cdc *codec.Codec)
- func RequestPrepare(ctx sdk.Context, k Keeper, req abci.RequestQuery, p types.SideChainIder) (newCtx sdk.Context, err sdk.Error)
- func SideChainIdFromText(str string) (*big.Int, error)
- type BaseParams
- type CodeType
- type GenesisState
- type Hooks
- func (h Hooks) OnDelegationCreated(_ sdk.Context, _ sdk.AccAddress, _ sdk.ValAddress)
- func (h Hooks) OnDelegationRemoved(_ sdk.Context, _ sdk.AccAddress, _ sdk.ValAddress)
- func (h Hooks) OnDelegationSharesModified(_ sdk.Context, _ sdk.AccAddress, _ sdk.ValAddress)
- func (h Hooks) OnSelfDelDropBelowMin(ctx sdk.Context, operator sdk.ValAddress)
- func (h Hooks) OnSideChainValidatorBeginUnbonding(ctx sdk.Context, sideConsAddr []byte, operator sdk.ValAddress)
- func (h Hooks) OnSideChainValidatorBonded(ctx sdk.Context, sideConsAddr []byte, operator sdk.ValAddress)
- func (h Hooks) OnValidatorBeginUnbonding(ctx sdk.Context, address sdk.ConsAddress, operator sdk.ValAddress)
- func (h Hooks) OnValidatorBonded(ctx sdk.Context, address sdk.ConsAddress, operator sdk.ValAddress)
- func (h Hooks) OnValidatorCreated(_ sdk.Context, _ sdk.ValAddress)
- func (h Hooks) OnValidatorModified(_ sdk.Context, _ sdk.ValAddress)
- func (h Hooks) OnValidatorRemoved(_ sdk.Context, _ sdk.ValAddress)
- type Keeper
- func (k Keeper) AddValidators(ctx sdk.Context, vals []abci.ValidatorUpdate)
- func (k Keeper) DoubleSignSlashAmount(ctx sdk.Context) (slashAmt int64)
- func (k Keeper) DoubleSignUnbondDuration(ctx sdk.Context) (res time.Duration)
- func (k Keeper) DowntimeSlashAmount(ctx sdk.Context) (slashAmt int64)
- func (k Keeper) DowntimeSlashFee(ctx sdk.Context) (downtimeSlashFee int64)
- func (k Keeper) DowntimeUnbondDuration(ctx sdk.Context) (res time.Duration)
- func (k *Keeper) ExecuteAckPackage(ctx sdk.Context, payload []byte) sdk.ExecuteResult
- func (k *Keeper) ExecuteFailAckPackage(ctx sdk.Context, payload []byte) sdk.ExecuteResult
- func (k *Keeper) ExecuteSynPackage(ctx sdk.Context, payload []byte, _ int64) sdk.ExecuteResult
- func (k Keeper) Hooks() Hooks
- func (k Keeper) MaxEvidenceAge(ctx sdk.Context) (res time.Duration)
- func (k Keeper) MinSignedPerWindow(ctx sdk.Context) int64
- func (k Keeper) SetParams(ctx sdk.Context, params Params)
- func (k *Keeper) SetPbsbServer(server *pubsub.Server)
- func (k *Keeper) SetSideChain(scKeeper *sidechain.Keeper)
- func (k Keeper) SignedBlocksWindow(ctx sdk.Context) (res int64)
- func (k Keeper) SlashFractionDoubleSign(ctx sdk.Context) (res sdk.Dec)
- func (k Keeper) SlashFractionDowntime(ctx sdk.Context) (res sdk.Dec)
- func (k Keeper) SubmitterReward(ctx sdk.Context) (submitterReward int64)
- func (k *Keeper) SubscribeParamChange(hub types.ParamChangePublisher)
- func (k Keeper) TooLowDelUnbondDuration(ctx sdk.Context) (res time.Duration)
- func (k Keeper) Unjail(ctx sdk.Context, validatorAddr sdk.ValAddress) sdk.Error
- type MsgAxcSubmitEvidence
- func (msg MsgAxcSubmitEvidence) GetInvolvedAddresses() []sdk.AccAddress
- func (msg MsgAxcSubmitEvidence) GetSignBytes() []byte
- func (msg MsgAxcSubmitEvidence) GetSigners() []sdk.AccAddress
- func (MsgAxcSubmitEvidence) Route() string
- func (MsgAxcSubmitEvidence) Type() string
- func (msg MsgAxcSubmitEvidence) ValidateBasic() sdk.Error
- type MsgSideChainUnjail
- func (msg MsgSideChainUnjail) GetInvolvedAddresses() []sdk.AccAddress
- func (msg MsgSideChainUnjail) GetSignBytes() []byte
- func (msg MsgSideChainUnjail) GetSigners() []sdk.AccAddress
- func (msg MsgSideChainUnjail) Route() string
- func (msg MsgSideChainUnjail) Type() string
- func (msg MsgSideChainUnjail) ValidateBasic() sdk.Error
- type MsgUnjail
- type Params
- type QueryConsAddrParams
- type QueryConsAddrTypeParams
- type SideDowntimeSlashPackage
- type SideSlashEvent
- type SlashRecord
- type ValidatorSigningInfo
- type ValidatorSlashingPeriod
- type ValidatorSlashingPeriodValue
Constants ¶
const ( MsgRoute = "slashing" TypeMsgUnjail = "unjail" TypeMsgSideChainUnjail = "side_chain_unjail" TypeMsgAxcSubmitEvidence = "axc_submit_evidence" )
name to identify transaction types
const ( QueryConsAddrSlashRecords = "consAddrSlashHistories" QueryConsAddrTypeSlashRecords = "consAddrTypeSlashHistories" )
const ( DoubleSign byte = iota Downtime )
const ChannelId = types.ChannelID(11)
const ChannelName = "slashing"
const (
DefaultParamspace = "slashing"
)
Default parameter namespace
const Topic = pubsub.Topic("slashing")
Variables ¶
var ( SideChainIdAxc = big.NewInt(56) SideChainIdChapel = big.NewInt(97) SideChainIdRialto = big.NewInt(714) )
var ( ValidatorSigningInfoKey = []byte{0x01} // Prefix for signing info ValidatorMissedBlockBitArrayKey = []byte{0x02} // Prefix for missed block bit array ValidatorSlashingPeriodKey = []byte{0x03} // Prefix for slashing period AddrPubkeyRelationKey = []byte{0x04} // Prefix for address-pubkey relation SlashRecordKey = []byte{0x05} // Prefix for slash record )
key prefix bytes
var ( KeyMaxEvidenceAge = []byte("MaxEvidenceAge") KeySignedBlocksWindow = []byte("SignedBlocksWindow") KeyMinSignedPerWindow = []byte("MinSignedPerWindow") KeyDoubleSignUnbondDuration = []byte("DoubleSignUnbondDuration") KeyDowntimeUnbondDuration = []byte("DowntimeUnbondDuration") KeyTooLowDelUnbondDuration = []byte("TooLowDelUnbondDuration") KeySlashFractionDoubleSign = []byte("SlashFractionDoubleSign") KeySlashFractionDowntime = []byte("SlashFractionDowntime") KeyDoubleSignSlashAmount = []byte("DoubleSignSlashAmount") KeyDowntimeSlashAmount = []byte("DowntimeSlashAmount") KeySubmitterReward = []byte("SubmitterReward") KeyDowntimeSlashFee = []byte("DowntimeSlashFee") )
Parameter store key
var MsgCdc *codec.Codec
generic sealed codec to be used throughout sdk
Functions ¶
func BeginBlocker ¶
slashing begin block functionality
func ErrBadValidatorAddr ¶
func ErrBadValidatorAddr(codespace sdk.CodespaceType) sdk.Error
func ErrDuplicateDowntimeClaim ¶
func ErrDuplicateDowntimeClaim(codespace sdk.CodespaceType) sdk.Error
func ErrEvidenceHasBeenHandled ¶
func ErrEvidenceHasBeenHandled(codespace sdk.CodespaceType) sdk.Error
func ErrExpiredEvidence ¶
func ErrExpiredEvidence(codespace sdk.CodespaceType) sdk.Error
func ErrFailedToSlash ¶
func ErrFailedToSlash(codespace sdk.CodespaceType, msg string) sdk.Error
func ErrInvalidClaim ¶
func ErrInvalidClaim(codespace sdk.CodespaceType, msg string) sdk.Error
func ErrInvalidEvidence ¶
func ErrInvalidEvidence(codespace sdk.CodespaceType, msg string) sdk.Error
func ErrInvalidInput ¶
func ErrInvalidInput(codespace sdk.CodespaceType, msg string) sdk.Error
func ErrInvalidSideChainId ¶
func ErrInvalidSideChainId(codespace sdk.CodespaceType) sdk.Error
func ErrMissingSelfDelegation ¶
func ErrMissingSelfDelegation(codespace sdk.CodespaceType) sdk.Error
func ErrNoValidatorForAddress ¶
func ErrNoValidatorForAddress(codespace sdk.CodespaceType) sdk.Error
func ErrSelfDelegationTooLowToUnjail ¶
func ErrSelfDelegationTooLowToUnjail(codespace sdk.CodespaceType) sdk.Error
func ErrValidatorJailed ¶
func ErrValidatorJailed(codespace sdk.CodespaceType) sdk.Error
func ErrValidatorNotJailed ¶
func ErrValidatorNotJailed(codespace sdk.CodespaceType) sdk.Error
func GetSlashRecordKey ¶
func GetValidatorMissedBlockBitArrayKey ¶
func GetValidatorMissedBlockBitArrayKey(v sdk.ConsAddress, i int64) []byte
stored by *Tendermint* address (not operator address)
func GetValidatorMissedBlockBitArrayPrefixKey ¶
func GetValidatorMissedBlockBitArrayPrefixKey(v sdk.ConsAddress) []byte
stored by *Tendermint* address (not operator address)
func GetValidatorSigningInfoKey ¶
stored by *Tendermint* address (not operator address)
func GetValidatorSlashingPeriodKey ¶
func GetValidatorSlashingPeriodKey(v sdk.ConsAddress, startHeight int64) []byte
stored by *Tendermint* address (not operator address) followed by start height
func GetValidatorSlashingPeriodPrefix ¶
func GetValidatorSlashingPeriodPrefix(v sdk.ConsAddress) []byte
stored by *Tendermint* address (not operator address)
func InitGenesis ¶
func InitGenesis(ctx sdk.Context, keeper Keeper, data GenesisState, sdata types.GenesisState)
InitGenesis initialize default parameters and the keeper's address to pubkey map
func MarshalSlashRecord ¶
func MarshalSlashRecord(cdc *codec.Codec, record SlashRecord) ([]byte, error)
func MustMarshalSlashRecord ¶
func MustMarshalSlashRecord(cdc *codec.Codec, record SlashRecord) []byte
func NewHandler ¶
func NewQuerier ¶
creates a querier for staking REST endpoints
func NewSlashingHandler ¶
func NewTestMsgCreateValidator ¶
func NewTestMsgCreateValidator(address sdk.ValAddress, pubKey crypto.PubKey, amt int64) stake.MsgCreateValidator
func RequestPrepare ¶
Types ¶
type BaseParams ¶
type BaseParams struct {
SideChainId string
}
BaseParams
func NewBaseParams ¶
func NewBaseParams(sideChainId string) BaseParams
func (BaseParams) GetSideChainId ¶
func (p BaseParams) GetSideChainId() string
type CodeType ¶
Local code type
const ( // Default slashing codespace DefaultCodespace sdk.CodespaceType = 10 CodeInvalidInput CodeType = 100 CodeInvalidValidator CodeType = 101 CodeValidatorJailed CodeType = 102 CodeValidatorNotJailed CodeType = 103 CodeMissingSelfDelegation CodeType = 104 CodeSelfDelegationTooLowToUnjail CodeType = 105 CodeInvalidClaim CodeType = 106 CodeExpiredEvidence CodeType = 201 CodeFailSlash CodeType = 202 CodeHandledEvidence CodeType = 203 CodeInvalidEvidence CodeType = 204 CodeInvalidSideChain CodeType = 205 CodeDuplicateDowntimeClaim CodeType = 206 )
type GenesisState ¶
type GenesisState struct {
Params Params
}
GenesisState - all slashing state that must be provided at genesis
func DefaultGenesisState ¶
func DefaultGenesisState() GenesisState
HubDefaultGenesisState - default GenesisState used by Cosmos Hub
type Hooks ¶
type Hooks struct {
// contains filtered or unexported fields
}
Wrapper struct
func (Hooks) OnDelegationCreated ¶
func (h Hooks) OnDelegationCreated(_ sdk.Context, _ sdk.AccAddress, _ sdk.ValAddress)
func (Hooks) OnDelegationRemoved ¶
func (h Hooks) OnDelegationRemoved(_ sdk.Context, _ sdk.AccAddress, _ sdk.ValAddress)
func (Hooks) OnDelegationSharesModified ¶
func (h Hooks) OnDelegationSharesModified(_ sdk.Context, _ sdk.AccAddress, _ sdk.ValAddress)
func (Hooks) OnSelfDelDropBelowMin ¶
func (h Hooks) OnSelfDelDropBelowMin(ctx sdk.Context, operator sdk.ValAddress)
Implements sdk.ValidatorHooks
func (Hooks) OnSideChainValidatorBeginUnbonding ¶
func (Hooks) OnSideChainValidatorBonded ¶
func (h Hooks) OnSideChainValidatorBonded(ctx sdk.Context, sideConsAddr []byte, operator sdk.ValAddress)
Implements sdk.ValidatorHooks
func (Hooks) OnValidatorBeginUnbonding ¶
func (h Hooks) OnValidatorBeginUnbonding(ctx sdk.Context, address sdk.ConsAddress, operator sdk.ValAddress)
Implements sdk.ValidatorHooks
func (Hooks) OnValidatorBonded ¶
func (h Hooks) OnValidatorBonded(ctx sdk.Context, address sdk.ConsAddress, operator sdk.ValAddress)
Implements sdk.ValidatorHooks
func (Hooks) OnValidatorCreated ¶
func (h Hooks) OnValidatorCreated(_ sdk.Context, _ sdk.ValAddress)
nolint - unused hooks
func (Hooks) OnValidatorModified ¶
func (h Hooks) OnValidatorModified(_ sdk.Context, _ sdk.ValAddress)
func (Hooks) OnValidatorRemoved ¶
func (h Hooks) OnValidatorRemoved(_ sdk.Context, _ sdk.ValAddress)
type Keeper ¶
type Keeper struct { // codespace Codespace sdk.CodespaceType BankKeeper bank.Keeper ScKeeper *sidechain.Keeper PbsbServer *pubsub.Server // contains filtered or unexported fields }
Keeper of the slashing store
func NewKeeper ¶
func NewKeeper(cdc *codec.Codec, key sdk.StoreKey, vs sdk.ValidatorSet, paramspace param.Subspace, codespace sdk.CodespaceType, bk bank.Keeper) Keeper
NewKeeper creates a slashing keeper
func (Keeper) AddValidators ¶
func (k Keeper) AddValidators(ctx sdk.Context, vals []abci.ValidatorUpdate)
AddValidators adds the validators to the keepers validator addr to pubkey mapping.
func (Keeper) DoubleSignSlashAmount ¶
func (Keeper) DoubleSignUnbondDuration ¶
Double-sign unbond duration
func (Keeper) DowntimeSlashAmount ¶
func (Keeper) DowntimeSlashFee ¶
func (Keeper) DowntimeUnbondDuration ¶
Downtime unbond duration
func (*Keeper) ExecuteAckPackage ¶
func (*Keeper) ExecuteFailAckPackage ¶
When the ack application crash, payload is the payload of the origin package.
func (*Keeper) ExecuteSynPackage ¶
implement cross chain app
func (Keeper) MaxEvidenceAge ¶
MaxEvidenceAge - Max age for evidence - 21 days (3 weeks) MaxEvidenceAge = 60 * 60 * 24 * 7 * 3
func (Keeper) MinSignedPerWindow ¶
Downtime slashing thershold - default 50% of the SignedBlocksWindow
func (*Keeper) SetPbsbServer ¶
func (*Keeper) SetSideChain ¶
func (Keeper) SignedBlocksWindow ¶
SignedBlocksWindow - sliding window for downtime slashing
func (Keeper) SlashFractionDoubleSign ¶
SlashFractionDoubleSign - currently default 5%
func (Keeper) SlashFractionDowntime ¶
SlashFractionDowntime - currently default 1%
func (Keeper) SubmitterReward ¶
func (*Keeper) SubscribeParamChange ¶
func (k *Keeper) SubscribeParamChange(hub types.ParamChangePublisher)
func (Keeper) TooLowDelUnbondDuration ¶
type MsgAxcSubmitEvidence ¶
type MsgAxcSubmitEvidence struct { Submitter sdk.AccAddress `json:"submitter"` Headers []axc.Header `json:"headers"` }
func NewMsgAxcSubmitEvidence ¶
func NewMsgAxcSubmitEvidence(submitter sdk.AccAddress, headers []axc.Header) MsgAxcSubmitEvidence
func (MsgAxcSubmitEvidence) GetInvolvedAddresses ¶
func (msg MsgAxcSubmitEvidence) GetInvolvedAddresses() []sdk.AccAddress
func (MsgAxcSubmitEvidence) GetSignBytes ¶
func (msg MsgAxcSubmitEvidence) GetSignBytes() []byte
func (MsgAxcSubmitEvidence) GetSigners ¶
func (msg MsgAxcSubmitEvidence) GetSigners() []sdk.AccAddress
func (MsgAxcSubmitEvidence) Route ¶
func (MsgAxcSubmitEvidence) Route() string
func (MsgAxcSubmitEvidence) Type ¶
func (MsgAxcSubmitEvidence) Type() string
func (MsgAxcSubmitEvidence) ValidateBasic ¶
func (msg MsgAxcSubmitEvidence) ValidateBasic() sdk.Error
type MsgSideChainUnjail ¶
type MsgSideChainUnjail struct { ValidatorAddr sdk.ValAddress `json:"address"` // address of the validator operator SideChainId string `json:"side_chain_id"` }
MsgSideChainUnjail - struct for unjailing jailed side chain validator
func NewMsgSideChainUnjail ¶
func NewMsgSideChainUnjail(validatorAddr sdk.ValAddress, sideChainId string) MsgSideChainUnjail
func (MsgSideChainUnjail) GetInvolvedAddresses ¶
func (msg MsgSideChainUnjail) GetInvolvedAddresses() []sdk.AccAddress
func (MsgSideChainUnjail) GetSignBytes ¶
func (msg MsgSideChainUnjail) GetSignBytes() []byte
get the bytes for the message signer to sign on
func (MsgSideChainUnjail) GetSigners ¶
func (msg MsgSideChainUnjail) GetSigners() []sdk.AccAddress
func (MsgSideChainUnjail) Type ¶
func (msg MsgSideChainUnjail) Type() string
func (MsgSideChainUnjail) ValidateBasic ¶
func (msg MsgSideChainUnjail) ValidateBasic() sdk.Error
quick validity check
type MsgUnjail ¶
type MsgUnjail struct {
ValidatorAddr sdk.ValAddress `json:"address"` // address of the validator operator
}
MsgUnjail - struct for unjailing jailed validator
func NewMsgUnjail ¶
func NewMsgUnjail(validatorAddr sdk.ValAddress) MsgUnjail
func (MsgUnjail) GetInvolvedAddresses ¶
func (msg MsgUnjail) GetInvolvedAddresses() []sdk.AccAddress
func (MsgUnjail) GetSignBytes ¶
get the bytes for the message signer to sign on
func (MsgUnjail) GetSigners ¶
func (msg MsgUnjail) GetSigners() []sdk.AccAddress
func (MsgUnjail) ValidateBasic ¶
quick validity check
type Params ¶
type Params struct { MaxEvidenceAge time.Duration `json:"max_evidence_age"` SignedBlocksWindow int64 `json:"signed_blocks_window"` MinSignedPerWindow sdk.Dec `json:"min_signed_per_window"` DoubleSignUnbondDuration time.Duration `json:"double_sign_unbond_duration"` DowntimeUnbondDuration time.Duration `json:"downtime_unbond_duration"` TooLowDelUnbondDuration time.Duration `json:"too_low_del_unbond_duration"` SlashFractionDoubleSign sdk.Dec `json:"slash_fraction_double_sign"` SlashFractionDowntime sdk.Dec `json:"slash_fraction_downtime"` DoubleSignSlashAmount int64 `json:"double_sign_slash_amount"` DowntimeSlashAmount int64 `json:"downtime_slash_amount"` SubmitterReward int64 `json:"submitter_reward"` DowntimeSlashFee int64 `json:"downtime_slash_fee"` }
Params - used for initializing default parameter for slashing at genesis
func (*Params) GetParamAttribute ¶
func (*Params) KeyValuePairs ¶
func (p *Params) KeyValuePairs() params.KeyValuePairs
Implements params.ParamStruct
func (*Params) UpdateCheck ¶
type QueryConsAddrParams ¶
type QueryConsAddrParams struct { BaseParams ConsAddr []byte }
type QueryConsAddrTypeParams ¶
type QueryConsAddrTypeParams struct { BaseParams ConsAddr []byte InfractionType byte }
type SideSlashEvent ¶
type SideSlashEvent struct { Validator sdk.ValAddress InfractionType byte InfractionHeight int64 SlashHeight int64 JailUtil time.Time SlashAmt int64 ToFeePool int64 SideChainId string Submitter sdk.AccAddress SubmitterReward int64 ValidatorsCompensation map[string]int64 }
func (SideSlashEvent) GetTopic ¶
func (event SideSlashEvent) GetTopic() pubsub.Topic
type SlashRecord ¶
type SlashRecord struct { ConsAddr []byte InfractionType byte InfractionHeight uint64 SlashHeight int64 JailUntil time.Time SlashAmt int64 SideChainId string }
func MustUnmarshalSlashRecord ¶
func MustUnmarshalSlashRecord(cdc *codec.Codec, key []byte, value []byte) SlashRecord
func UnmarshalSlashRecord ¶
func (SlashRecord) HumanReadableString ¶
func (r SlashRecord) HumanReadableString() (string, error)
type ValidatorSigningInfo ¶
type ValidatorSigningInfo struct { StartHeight int64 `json:"start_height"` // height at which validator was first a candidate OR was unjailed IndexOffset int64 `json:"index_offset"` // index offset into signed block bit array JailedUntil time.Time `json:"jailed_until"` // timestamp validator cannot be unjailed until MissedBlocksCounter int64 `json:"missed_blocks_counter"` // missed blocks counter (to avoid scanning the array every time) }
Signing info for a validator
func NewValidatorSigningInfo ¶
func NewValidatorSigningInfo(startHeight int64, indexOffset int64, jailedUntil time.Time, missedBlocksCounter int64) ValidatorSigningInfo
Construct a new `ValidatorSigningInfo` struct
func (ValidatorSigningInfo) HumanReadableString ¶
func (i ValidatorSigningInfo) HumanReadableString() string
Return human readable signing info
type ValidatorSlashingPeriod ¶
type ValidatorSlashingPeriod struct { ValidatorAddr sdk.ConsAddress `json:"validator_addr"` // validator which this slashing period is for StartHeight int64 `json:"start_height"` // starting height of the slashing period EndHeight int64 `json:"end_height"` // ending height of the slashing period, or sentinel value of 0 for in-progress SlashedSoFar sdk.Dec `json:"slashed_so_far"` // fraction of validator stake slashed so far in this slashing period }
Slashing period for a validator
func NewValidatorSlashingPeriod ¶
func NewValidatorSlashingPeriod(startHeight int64, endHeight int64, slashedSoFar sdk.Dec) ValidatorSlashingPeriod
Construct a new `ValidatorSlashingPeriod` struct
func (ValidatorSlashingPeriod) HumanReadableString ¶
func (p ValidatorSlashingPeriod) HumanReadableString() string
Return human readable slashing period
type ValidatorSlashingPeriodValue ¶
type ValidatorSlashingPeriodValue struct { EndHeight int64 `json:"end_height"` SlashedSoFar sdk.Dec `json:"slashed_so_far"` }
Value part of slashing period (validator address & start height are stored in the key)