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 ErrNoValidatorForAddress(codespace sdk.CodespaceType) sdk.Error
- func ErrValidatorJailed(codespace sdk.CodespaceType) sdk.Error
- func GetValidatorSigningBitArrayKey(v sdk.Address, i int64) []byte
- func GetValidatorSigningInfoKey(v sdk.Address) []byte
- func NewHandler(k Keeper) sdk.Handler
- func RegisterWire(cdc *wire.Codec)
- type CodeType
- type Keeper
- type MsgUnrevoke
- type ValidatorSigningInfo
Constants ¶
View Source
const ( // MaxEvidenceAge - Max age for evidence - 21 days (3 weeks) // TODO Should this be a governance parameter or just modifiable with SoftwareUpgradeProposals? // MaxEvidenceAge = 60 * 60 * 24 * 7 * 3 // TODO Temporarily set to 2 minutes for testnets. MaxEvidenceAge int64 = 60 * 2 // SignedBlocksWindow - sliding window for downtime slashing // TODO Governance parameter? // TODO Temporarily set to 100 blocks for testnets SignedBlocksWindow int64 = 100 // Downtime slashing threshold - 50% // TODO Governance parameter? MinSignedPerWindow int64 = SignedBlocksWindow / 2 // Downtime unbond duration // TODO Governance parameter? // TODO Temporarily set to 10 minutes for testnets DowntimeUnbondDuration int64 = 60 * 10 )
View Source
const MsgType = "slashing"
name to identify transaction types
Variables ¶
Functions ¶
func BeginBlocker ¶
slashing begin block functionality
func ErrBadValidatorAddr ¶
func ErrBadValidatorAddr(codespace sdk.CodespaceType) sdk.Error
func ErrNoValidatorForAddress ¶
func ErrNoValidatorForAddress(codespace sdk.CodespaceType) sdk.Error
func ErrValidatorJailed ¶
func ErrValidatorJailed(codespace sdk.CodespaceType) sdk.Error
func GetValidatorSigningBitArrayKey ¶
Stored by *validator* address (not owner address)
func GetValidatorSigningInfoKey ¶
Stored by *validator* address (not owner address)
func NewHandler ¶
Types ¶
type CodeType ¶
Local code type
const ( // Default slashing codespace DefaultCodespace sdk.CodespaceType = 10 // Invalid validator CodeInvalidValidator CodeType = 201 // Validator jailed CodeValidatorJailed CodeType = 202 )
type Keeper ¶
type Keeper struct {
// contains filtered or unexported fields
}
Keeper of the slashing store
type MsgUnrevoke ¶
type MsgUnrevoke struct {
ValidatorAddr sdk.Address `json:"address"` // address of the validator owner
}
MsgUnrevoke - struct for unrevoking revoked validator
func NewMsgUnrevoke ¶
func NewMsgUnrevoke(validatorAddr sdk.Address) MsgUnrevoke
func (MsgUnrevoke) GetSignBytes ¶
func (msg MsgUnrevoke) GetSignBytes() []byte
get the bytes for the message signer to sign on
func (MsgUnrevoke) GetSigners ¶
func (msg MsgUnrevoke) GetSigners() []sdk.Address
func (MsgUnrevoke) ValidateBasic ¶
func (msg MsgUnrevoke) ValidateBasic() sdk.Error
quick validity check
type ValidatorSigningInfo ¶
type ValidatorSigningInfo struct { StartHeight int64 `json:"start_height"` // height at which validator was first a candidate OR was unrevoked IndexOffset int64 `json:"index_offset"` // index offset into signed block bit array JailedUntil int64 `json:"jailed_until"` // timestamp validator cannot be unrevoked until SignedBlocksCounter int64 `json:"signed_blocks_counter"` // signed blocks counter (to avoid scanning the array every time) }
Signing info for a validator
func NewValidatorSigningInfo ¶ added in v0.19.0
func NewValidatorSigningInfo(startHeight int64, indexOffset int64, jailedUntil int64, signedBlocksCounter int64) ValidatorSigningInfo
Construct a new `ValidatorSigningInfo` struct
func (ValidatorSigningInfo) HumanReadableString ¶
func (i ValidatorSigningInfo) HumanReadableString() string
Return human readable signing info
Source Files ¶
Click to show internal directories.
Click to hide internal directories.