Documentation ¶
Overview ¶
nolint autogenerated code using github.com/rigelrozanski/multitool aliases generated for the following subdirectories: ALIASGEN: github.com/Dipper-Labs/Dipper-Protocol/app/v0/slashing/types
nolint
Index ¶
- Constants
- Variables
- func BeginBlocker(ctx sdk.Context, req abci.RequestBeginBlock, sk Keeper)
- func ExportGenesis(ctx sdk.Context, keeper Keeper) (data types.GenesisState)
- func GenDowntimeJailDuration(r *rand.Rand) time.Duration
- func GenMinSignedPerWindow(r *rand.Rand) sdk.Dec
- func GenSignedBlocksWindow(r *rand.Rand) int64
- func GenSlashFractionDoubleSign(r *rand.Rand) sdk.Dec
- func GenSlashFractionDowntime(r *rand.Rand) sdk.Dec
- func InitGenesis(ctx sdk.Context, keeper Keeper, stakingKeeper types.StakingKeeper, ...)
- func NewHandler(k Keeper) sdk.Handler
- func NewQuerier(k Keeper) sdk.Querier
- func NewTestMsgCreateValidator(address sdk.ValAddress, pubKey crypto.PubKey, amt sdk.Int) staking.MsgCreateValidator
- func ParamChanges(r *rand.Rand) []simtypes.ParamChange
- func RandomizedGenState(simState *module.SimulationState)
- func SimulateMsgUnjail(ak AccountKeeper, k Keeper, sk stakingkeeper.Keeper) simtypes.Operation
- func WeightedOperations(appParams simtypes.AppParams, cdc *codec.Codec, ak AccountKeeper, k Keeper, ...) simulation.WeightedOperations
- type AccountKeeper
- type AppModule
- func (am AppModule) BeginBlock(ctx sdk.Context, req abci.RequestBeginBlock)
- func (AppModule) EndBlock(_ sdk.Context, _ abci.RequestEndBlock) []abci.ValidatorUpdate
- func (am AppModule) ExportGenesis(ctx sdk.Context) json.RawMessage
- func (am AppModule) GenerateGenesisState(simState *module.SimulationState)
- func (am AppModule) InitGenesis(ctx sdk.Context, data json.RawMessage) []abci.ValidatorUpdate
- func (AppModule) Name() string
- func (am AppModule) NewHandler() sdk.Handler
- func (am AppModule) NewQuerierHandler() sdk.Querier
- func (am AppModule) ProposalContents(simState module.SimulationState) []simtypes.WeightedProposalContent
- func (AppModule) QuerierRoute() string
- func (am AppModule) RandomizedParams(r *rand.Rand) []simtypes.ParamChange
- func (am AppModule) RegisterInvariants(_ sdk.InvariantRegistry)
- func (AppModule) Route() string
- func (am AppModule) WeightedOperations(simState module.SimulationState) []simtypes.WeightedOperation
- func (am *AppModule) WithAccountKeeper(ak AccountKeeper) *AppModule
- func (am *AppModule) WithStakingKeeper(sk stakingkeeper.Keeper) *AppModule
- type AppModuleBasic
- func (AppModuleBasic) DefaultGenesis() json.RawMessage
- func (AppModuleBasic) GetQueryCmd(cdc *codec.Codec) *cobra.Command
- func (AppModuleBasic) GetTxCmd(cdc *codec.Codec) *cobra.Command
- func (AppModuleBasic) Name() string
- func (AppModuleBasic) RegisterCodec(cdc *codec.Codec)
- func (AppModuleBasic) RegisterRESTRoutes(ctx context.CLIContext, rtr *mux.Router)
- func (AppModuleBasic) ValidateGenesis(bz json.RawMessage) error
- type GenesisState
- type Hooks
- func (h Hooks) AfterDelegationModified(_ sdk.Context, _ sdk.AccAddress, _ sdk.ValAddress)
- func (h Hooks) AfterValidatorBeginUnbonding(_ sdk.Context, _ sdk.ConsAddress, _ sdk.ValAddress)
- func (h Hooks) AfterValidatorBonded(ctx sdk.Context, consAddr sdk.ConsAddress, valAddr sdk.ValAddress)
- func (h Hooks) AfterValidatorCreated(ctx sdk.Context, valAddr sdk.ValAddress)
- func (h Hooks) AfterValidatorRemoved(ctx sdk.Context, consAddr sdk.ConsAddress, _ sdk.ValAddress)
- func (h Hooks) BeforeDelegationCreated(_ sdk.Context, _ sdk.AccAddress, _ sdk.ValAddress)
- func (h Hooks) BeforeDelegationRemoved(_ sdk.Context, _ sdk.AccAddress, _ sdk.ValAddress)
- func (h Hooks) BeforeDelegationSharesModified(_ sdk.Context, _ sdk.AccAddress, _ sdk.ValAddress)
- func (h Hooks) BeforeValidatorModified(_ sdk.Context, _ sdk.ValAddress)
- func (h Hooks) BeforeValidatorSlashed(_ sdk.Context, _ sdk.ValAddress, _ sdk.Dec)
- type Keeper
- func (k Keeper) AfterValidatorBonded(ctx sdk.Context, address sdk.ConsAddress, _ sdk.ValAddress)
- func (k Keeper) AfterValidatorCreated(ctx sdk.Context, valAddr sdk.ValAddress)
- func (k Keeper) AfterValidatorRemoved(ctx sdk.Context, address sdk.ConsAddress)
- func (k Keeper) DowntimeJailDuration(ctx sdk.Context) (res time.Duration)
- func (k Keeper) GetParams(ctx sdk.Context) (params types.Params)
- func (k Keeper) GetValidatorSigningInfo(ctx sdk.Context, address sdk.ConsAddress) (info types.ValidatorSigningInfo, found bool)
- func (k Keeper) HandleDoubleSign(ctx sdk.Context, addr crypto.Address, infractionHeight int64, ...)
- func (k Keeper) HandleValidatorSignature(ctx sdk.Context, addr crypto.Address, power int64, signed bool)
- func (k Keeper) Hooks() Hooks
- func (k Keeper) IterateValidatorMissedBlockBitArray(ctx sdk.Context, address sdk.ConsAddress, ...)
- func (k Keeper) IterateValidatorSigningInfos(ctx sdk.Context, ...)
- func (k Keeper) Logger(ctx sdk.Context) log.Logger
- func (k Keeper) MaxEvidenceAge(ctx sdk.Context) (res time.Duration)
- func (k Keeper) MinSignedPerWindow(ctx sdk.Context) int64
- func (k Keeper) SetValidatorSigningInfo(ctx sdk.Context, address sdk.ConsAddress, info types.ValidatorSigningInfo)
- 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)
- type MissedBlock
- type MsgUnjail
- type Params
- type QuerySigningInfoParams
- type QuerySigningInfosParams
- type ValidatorSigningInfo
Constants ¶
const ( ModuleName = types.ModuleName StoreKey = types.StoreKey RouterKey = types.RouterKey QuerierRoute = types.QuerierRoute QueryParameters = types.QueryParameters QuerySigningInfo = types.QuerySigningInfo QuerySigningInfos = types.QuerySigningInfos DefaultParamspace = types.DefaultParamspace DefaultMaxEvidenceAge = types.DefaultMaxEvidenceAge DefaultSignedBlocksWindow = types.DefaultSignedBlocksWindow DefaultDowntimeJailDuration = types.DefaultDowntimeJailDuration )
const ( SignedBlocksWindow = "signed_blocks_window" MinSignedPerWindow = "min_signed_per_window" DowntimeJailDuration = "downtime_jail_duration" SlashFractionDoubleSign = "slash_fraction_double_sign" SlashFractionDowntime = "slash_fraction_downtime" )
Simulation parameter constants
const (
OpWeightMsgUnjail = "op_weight_msg_unjail"
)
Simulation operation weights constants
Variables ¶
var ( // functions aliases RegisterCodec = types.RegisterCodec ErrNoValidatorForAddress = types.ErrNoValidatorForAddress ErrBadValidatorAddr = types.ErrBadValidatorAddr ErrValidatorJailed = types.ErrValidatorJailed ErrValidatorNotJailed = types.ErrValidatorNotJailed ErrDelegatorExceedMaxLever = types.ErrDelegatorExceedMaxLever ErrMissingSelfDelegation = types.ErrMissingSelfDelegation ErrSelfDelegationTooLowToUnjail = types.ErrSelfDelegationTooLowToUnjail ErrNoSigningInfoFound = types.ErrNoSigningInfoFound NewGenesisState = types.NewGenesisState DefaultGenesisState = types.DefaultGenesisState ValidateGenesis = types.ValidateGenesis GetValidatorSigningInfoKey = types.GetValidatorSigningInfoKey GetValidatorSigningInfoAddress = types.GetValidatorSigningInfoAddress GetValidatorMissedBlockBitArrayPrefixKey = types.GetValidatorMissedBlockBitArrayPrefixKey GetValidatorMissedBlockBitArrayKey = types.GetValidatorMissedBlockBitArrayKey GetAddrPubkeyRelationKey = types.GetAddrPubkeyRelationKey NewMsgUnjail = types.NewMsgUnjail ParamKeyTable = types.ParamKeyTable NewParams = types.NewParams DefaultParams = types.DefaultParams NewQuerySigningInfoParams = types.NewQuerySigningInfoParams NewQuerySigningInfosParams = types.NewQuerySigningInfosParams NewValidatorSigningInfo = types.NewValidatorSigningInfo // variable aliases ModuleCdc = types.ModuleCdc ValidatorSigningInfoKey = types.ValidatorSigningInfoKey ValidatorMissedBlockBitArrayKey = types.ValidatorMissedBlockBitArrayKey AddrPubkeyRelationKey = types.AddrPubkeyRelationKey DoubleSignJailEndTime = types.DoubleSignJailEndTime DefaultMinSignedPerWindow = types.DefaultMinSignedPerWindow DefaultSlashFractionDoubleSign = types.DefaultSlashFractionDoubleSign DefaultSlashFractionDowntime = types.DefaultSlashFractionDowntime KeyMaxEvidenceAge = types.KeyMaxEvidenceAge KeySignedBlocksWindow = types.KeySignedBlocksWindow KeyMinSignedPerWindow = types.KeyMinSignedPerWindow KeyDowntimeJailDuration = types.KeyDowntimeJailDuration KeySlashFractionDoubleSign = types.KeySlashFractionDoubleSign KeySlashFractionDowntime = types.KeySlashFractionDowntime )
Functions ¶
func BeginBlocker ¶
func BeginBlocker(ctx sdk.Context, req abci.RequestBeginBlock, sk Keeper)
slashing begin block functionality
func ExportGenesis ¶
func ExportGenesis(ctx sdk.Context, keeper Keeper) (data types.GenesisState)
ExportGenesis writes the current store values to a genesis file, which can be imported again with InitGenesis
func GenDowntimeJailDuration ¶
GenDowntimeJailDuration randomized DowntimeJailDuration
func GenMinSignedPerWindow ¶
GenMinSignedPerWindow randomized MinSignedPerWindow
func GenSignedBlocksWindow ¶
GenSignedBlocksWindow randomized SignedBlocksWindow
func GenSlashFractionDoubleSign ¶
GenSlashFractionDoubleSign randomized SlashFractionDoubleSign
func GenSlashFractionDowntime ¶
GenSlashFractionDowntime randomized SlashFractionDowntime
func InitGenesis ¶
func InitGenesis(ctx sdk.Context, keeper Keeper, stakingKeeper types.StakingKeeper, data types.GenesisState)
InitGenesis initialize default parameters and the keeper's address to pubkey map
func NewHandler ¶
func NewQuerier ¶
NewQuerier creates a new querier for slashing clients.
func NewTestMsgCreateValidator ¶
func NewTestMsgCreateValidator(address sdk.ValAddress, pubKey crypto.PubKey, amt sdk.Int) staking.MsgCreateValidator
func ParamChanges ¶
func ParamChanges(r *rand.Rand) []simtypes.ParamChange
ParamChanges defines the parameters that can be modified by param change proposals on the simulation
func RandomizedGenState ¶
func RandomizedGenState(simState *module.SimulationState)
RandomizedGenState generates a random GenesisState for slashing
func SimulateMsgUnjail ¶
func SimulateMsgUnjail( ak AccountKeeper, k Keeper, sk stakingkeeper.Keeper) simtypes.Operation
SimulateMsgUnjail generates a MsgUnjail with random values nolint: interfacer
func WeightedOperations ¶
func WeightedOperations( appParams simtypes.AppParams, cdc *codec.Codec, ak AccountKeeper, k Keeper, sk stakingkeeper.Keeper) simulation.WeightedOperations
WeightedOperations returns all the operations from the module with their respective weights
Types ¶
type AccountKeeper ¶
type AppModule ¶
type AppModule struct { AppModuleBasic // contains filtered or unexported fields }
___________________________ app module
func NewAppModule ¶
func NewAppModule(keeper Keeper, stakingKeeper types.StakingKeeper) AppModule
NewAppModule creates a new AppModule object
func (AppModule) BeginBlock ¶
func (am AppModule) BeginBlock(ctx sdk.Context, req abci.RequestBeginBlock)
module begin-block
func (AppModule) EndBlock ¶
func (AppModule) EndBlock(_ sdk.Context, _ abci.RequestEndBlock) []abci.ValidatorUpdate
module end-block
func (AppModule) ExportGenesis ¶
func (am AppModule) ExportGenesis(ctx sdk.Context) json.RawMessage
module export genesis
func (AppModule) GenerateGenesisState ¶
func (am AppModule) GenerateGenesisState(simState *module.SimulationState)
for simulation
func (AppModule) InitGenesis ¶
func (am AppModule) InitGenesis(ctx sdk.Context, data json.RawMessage) []abci.ValidatorUpdate
module init-genesis
func (AppModule) NewQuerierHandler ¶
module querier
func (AppModule) ProposalContents ¶
func (am AppModule) ProposalContents(simState module.SimulationState) []simtypes.WeightedProposalContent
func (AppModule) RandomizedParams ¶
func (am AppModule) RandomizedParams(r *rand.Rand) []simtypes.ParamChange
func (AppModule) RegisterInvariants ¶
func (am AppModule) RegisterInvariants(_ sdk.InvariantRegistry)
register invariants
func (AppModule) WeightedOperations ¶
func (am AppModule) WeightedOperations(simState module.SimulationState) []simtypes.WeightedOperation
func (*AppModule) WithAccountKeeper ¶
func (am *AppModule) WithAccountKeeper(ak AccountKeeper) *AppModule
func (*AppModule) WithStakingKeeper ¶
func (am *AppModule) WithStakingKeeper(sk stakingkeeper.Keeper) *AppModule
type AppModuleBasic ¶
type AppModuleBasic struct{}
app module basics object
func (AppModuleBasic) DefaultGenesis ¶
func (AppModuleBasic) DefaultGenesis() json.RawMessage
default genesis state
func (AppModuleBasic) GetQueryCmd ¶
func (AppModuleBasic) GetQueryCmd(cdc *codec.Codec) *cobra.Command
GetQueryCmd returns the root query command for the slashing module.
func (AppModuleBasic) GetTxCmd ¶
func (AppModuleBasic) GetTxCmd(cdc *codec.Codec) *cobra.Command
get the root tx command of this module
func (AppModuleBasic) RegisterCodec ¶
func (AppModuleBasic) RegisterCodec(cdc *codec.Codec)
register module codec
func (AppModuleBasic) RegisterRESTRoutes ¶
func (AppModuleBasic) RegisterRESTRoutes(ctx context.CLIContext, rtr *mux.Router)
register rest routes
func (AppModuleBasic) ValidateGenesis ¶
func (AppModuleBasic) ValidateGenesis(bz json.RawMessage) error
module validate genesis
type GenesisState ¶
type GenesisState = types.GenesisState
type Hooks ¶
type Hooks struct {
// contains filtered or unexported fields
}
Hooks wrapper struct for slashing keeper
func (Hooks) AfterDelegationModified ¶
func (h Hooks) AfterDelegationModified(_ sdk.Context, _ sdk.AccAddress, _ sdk.ValAddress)
AfterDelegationModified - unused hooks
func (Hooks) AfterValidatorBeginUnbonding ¶
func (h Hooks) AfterValidatorBeginUnbonding(_ sdk.Context, _ sdk.ConsAddress, _ sdk.ValAddress)
AfterValidatorBeginUnbonding - unused hooks
func (Hooks) AfterValidatorBonded ¶
func (h Hooks) AfterValidatorBonded(ctx sdk.Context, consAddr sdk.ConsAddress, valAddr sdk.ValAddress)
AfterValidatorBonded - Implements sdk.ValidatorHooks
func (Hooks) AfterValidatorCreated ¶
func (h Hooks) AfterValidatorCreated(ctx sdk.Context, valAddr sdk.ValAddress)
AfterValidatorCreated - Implements sdk.ValidatorHooks
func (Hooks) AfterValidatorRemoved ¶
func (h Hooks) AfterValidatorRemoved(ctx sdk.Context, consAddr sdk.ConsAddress, _ sdk.ValAddress)
AfterValidatorRemoved - Implements sdk.ValidatorHooks
func (Hooks) BeforeDelegationCreated ¶
func (h Hooks) BeforeDelegationCreated(_ sdk.Context, _ sdk.AccAddress, _ sdk.ValAddress)
BeforeDelegationCreated - unused hooks
func (Hooks) BeforeDelegationRemoved ¶
func (h Hooks) BeforeDelegationRemoved(_ sdk.Context, _ sdk.AccAddress, _ sdk.ValAddress)
BeforeDelegationRemoved - unused hooks
func (Hooks) BeforeDelegationSharesModified ¶
func (h Hooks) BeforeDelegationSharesModified(_ sdk.Context, _ sdk.AccAddress, _ sdk.ValAddress)
BeforeDelegationSharesModified - unused hooks
func (Hooks) BeforeValidatorModified ¶
func (h Hooks) BeforeValidatorModified(_ sdk.Context, _ sdk.ValAddress)
BeforeValidatorModified - unused hooks
func (Hooks) BeforeValidatorSlashed ¶
BeforeValidatorSlashed - unused hooks
type Keeper ¶
type Keeper struct {
// contains filtered or unexported fields
}
Keeper of the slashing store
func NewKeeper ¶
func NewKeeper(cdc *codec.Codec, key sdk.StoreKey, sk types.StakingKeeper, paramspace params.Subspace) Keeper
NewKeeper creates a slashing keeper
func (Keeper) AfterValidatorBonded ¶
func (k Keeper) AfterValidatorBonded(ctx sdk.Context, address sdk.ConsAddress, _ sdk.ValAddress)
AfterValidatorBonded - call hook if registered
func (Keeper) AfterValidatorCreated ¶
func (k Keeper) AfterValidatorCreated(ctx sdk.Context, valAddr sdk.ValAddress)
AfterValidatorCreated - When a validator is created, add the address-pubkey relation.
func (Keeper) AfterValidatorRemoved ¶
func (k Keeper) AfterValidatorRemoved(ctx sdk.Context, address sdk.ConsAddress)
AfterValidatorRemoved - When a validator is removed, delete the address-pubkey relation.
func (Keeper) DowntimeJailDuration ¶
DowntimeJailDuration - downtime unbond duration
func (Keeper) GetValidatorSigningInfo ¶
func (k Keeper) GetValidatorSigningInfo(ctx sdk.Context, address sdk.ConsAddress) (info types.ValidatorSigningInfo, found bool)
Stored by *validator* address (not operator address)
func (Keeper) HandleDoubleSign ¶
func (k Keeper) HandleDoubleSign(ctx sdk.Context, addr crypto.Address, infractionHeight int64, timestamp time.Time, power int64)
handle a validator signing two blocks at the same height power: power of the double-signing validator at the height of infraction
func (Keeper) HandleValidatorSignature ¶
func (k Keeper) HandleValidatorSignature(ctx sdk.Context, addr crypto.Address, power int64, signed bool)
handle a validator signature, must be called once per validator per block TODO refactor to take in a consensus address, additionally should maybe just take in the pubkey too
func (Keeper) IterateValidatorMissedBlockBitArray ¶
func (k Keeper) IterateValidatorMissedBlockBitArray(ctx sdk.Context, address sdk.ConsAddress, handler func(index int64, missed bool) (stop bool))
Stored by *validator* address (not operator address)
func (Keeper) IterateValidatorSigningInfos ¶
func (k Keeper) IterateValidatorSigningInfos(ctx sdk.Context, handler func(address sdk.ConsAddress, info types.ValidatorSigningInfo) (stop bool))
Stored by *validator* address (not operator address)
func (Keeper) MaxEvidenceAge ¶
MaxEvidenceAge - max age for evidence
func (Keeper) MinSignedPerWindow ¶
MinSignedPerWindow - downtime slashing threshold
func (Keeper) SetValidatorSigningInfo ¶
func (k Keeper) SetValidatorSigningInfo(ctx sdk.Context, address sdk.ConsAddress, info types.ValidatorSigningInfo)
Stored by *validator* address (not operator address)
func (Keeper) SignedBlocksWindow ¶
SignedBlocksWindow - sliding window for downtime slashing
func (Keeper) SlashFractionDoubleSign ¶
SlashFractionDoubleSign
type MissedBlock ¶
type MissedBlock = types.MissedBlock
type QuerySigningInfoParams ¶
type QuerySigningInfoParams = types.QuerySigningInfoParams
type QuerySigningInfosParams ¶
type QuerySigningInfosParams = types.QuerySigningInfosParams
type ValidatorSigningInfo ¶
type ValidatorSigningInfo = types.ValidatorSigningInfo