Documentation
¶
Index ¶
- Constants
- Variables
- func DefaultValidatorAlertIncentiveStrategy(sk types.StakingKeeper, bk types.BankKeeper) incentivetypes.Strategy
- func NewValidatorAlertIncentive(validator cmtabci.Validator, alertHeight uint64, signer sdk.AccAddress) incentivetypes.Incentive
- func NewValidatorAlertIncentiveStrategy(sk types.StakingKeeper, bk types.BankKeeper, slashFactor math.LegacyDec) incentivetypes.Strategy
- func RegisterInterfaces(registry types.InterfaceRegistry)
- func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino)
- type ValidatorAlertIncentive
- func (b ValidatorAlertIncentive) Copy() incentivetypes.Incentive
- func (*ValidatorAlertIncentive) Descriptor() ([]byte, []int)
- func (m *ValidatorAlertIncentive) GetAlertHeight() uint64
- func (m *ValidatorAlertIncentive) GetAlertSigner() string
- func (m *ValidatorAlertIncentive) GetValidator() types.Validator
- func (m *ValidatorAlertIncentive) Marshal() (dAtA []byte, err error)
- func (m *ValidatorAlertIncentive) MarshalTo(dAtA []byte) (int, error)
- func (m *ValidatorAlertIncentive) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*ValidatorAlertIncentive) ProtoMessage()
- func (m *ValidatorAlertIncentive) Reset()
- func (m *ValidatorAlertIncentive) Size() (n int)
- func (m *ValidatorAlertIncentive) String() string
- func (b ValidatorAlertIncentive) Type() string
- func (m *ValidatorAlertIncentive) Unmarshal(dAtA []byte) error
- func (b ValidatorAlertIncentive) ValidateBasic() error
- func (m *ValidatorAlertIncentive) XXX_DiscardUnknown()
- func (m *ValidatorAlertIncentive) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *ValidatorAlertIncentive) XXX_Merge(src proto.Message)
- func (m *ValidatorAlertIncentive) XXX_Size() int
- func (m *ValidatorAlertIncentive) XXX_Unmarshal(b []byte) error
- type ValidatorIncentiveHandler
Constants ¶
const (
// ValidatorAlertIncentiveType is the type of incentive issued for validators upon being referenced in a Conclusion.
ValidatorAlertIncentiveType = "validator_alert"
)
Variables ¶
Functions ¶
func DefaultValidatorAlertIncentiveStrategy ¶
func DefaultValidatorAlertIncentiveStrategy(sk types.StakingKeeper, bk types.BankKeeper) incentivetypes.Strategy
DefaultValidatorAlertIncentiveStrategy is the default strategy for issuing incentives to validators upon being deemed at fault for an x/alerts alert. This method returns a Strategy that executes wrt. the given StakingKeeper / BankKeeper.
NOTICE: The DefaultSlashFactor is 50% of each validator's stake. See NewValidatorAlertIncentiveStrategy for more details.
func NewValidatorAlertIncentive ¶
func NewValidatorAlertIncentive(validator cmtabci.Validator, alertHeight uint64, signer sdk.AccAddress) incentivetypes.Incentive
NewValidatorAlertIncentive returns a new ValidatorAlertIncentive. ValidatorAlertIncentive defines the incentive strategy to be executed for a validator that has been confirmed to have at fault for an x/alerts alert. This strategy is expected to slash half of the validator's stake, and reward the slashed stake to the alerter.
func NewValidatorAlertIncentiveStrategy ¶
func NewValidatorAlertIncentiveStrategy(sk types.StakingKeeper, bk types.BankKeeper, slashFactor math.LegacyDec) incentivetypes.Strategy
NewValidatorAlertIncentiveStrategy is the default strategy for issuing incentives to validators upon being referenced in a Conclusion. This method returns a Strategy that executes wrt. the given StakingKeeper / BankKeeper. Notice, this strategy will slash half of the validator's stake, and mint the amount slashed to the alerter.
CONTRACT: as of v0.50.0-rc2 of the Cosmos SDK, the Slash method will burn staked tokens, this is crucial to our logic in order for this operation to not inflate the bond-denom's total supply.
func RegisterInterfaces ¶
func RegisterInterfaces(registry types.InterfaceRegistry)
RegisterInterfaces registers the x/incentives messages + message service w/ the InterfaceRegistry (registry).
func RegisterLegacyAminoCodec ¶
func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino)
RegisterLegacyAminoCodec registers the necessary x/incentives interfaces (messages) on the cdc. These types are used for amino serialization
Types ¶
type ValidatorAlertIncentive ¶
type ValidatorAlertIncentive struct { // The validator that has been confirmed to have been at fault for an alert. Validator types.Validator `protobuf:"bytes,1,opt,name=validator,proto3" json:"validator"` // AlertSigner is the signer of the alert referenced by the conclusion that created this incentive. AlertSigner string `protobuf:"bytes,2,opt,name=alert_signer,json=alertSigner,proto3" json:"alert_signer,omitempty"` // AlertHeight is the height at which the infraction occurred AlertHeight uint64 `protobuf:"varint,3,opt,name=alert_height,json=alertHeight,proto3" json:"alert_height,omitempty"` }
ValidatorAlertIncentive defines the incentive strategy to be executed for a validator that has been confirmed to have at fault for an x/alerts alert. This strategy is expected to slash half of the validator's stake.
func (ValidatorAlertIncentive) Copy ¶
func (b ValidatorAlertIncentive) Copy() incentivetypes.Incentive
Copy returns a copy of the incentive.
func (*ValidatorAlertIncentive) Descriptor ¶
func (*ValidatorAlertIncentive) Descriptor() ([]byte, []int)
func (*ValidatorAlertIncentive) GetAlertHeight ¶
func (m *ValidatorAlertIncentive) GetAlertHeight() uint64
func (*ValidatorAlertIncentive) GetAlertSigner ¶
func (m *ValidatorAlertIncentive) GetAlertSigner() string
func (*ValidatorAlertIncentive) GetValidator ¶
func (m *ValidatorAlertIncentive) GetValidator() types.Validator
func (*ValidatorAlertIncentive) Marshal ¶
func (m *ValidatorAlertIncentive) Marshal() (dAtA []byte, err error)
func (*ValidatorAlertIncentive) MarshalTo ¶
func (m *ValidatorAlertIncentive) MarshalTo(dAtA []byte) (int, error)
func (*ValidatorAlertIncentive) MarshalToSizedBuffer ¶
func (m *ValidatorAlertIncentive) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*ValidatorAlertIncentive) ProtoMessage ¶
func (*ValidatorAlertIncentive) ProtoMessage()
func (*ValidatorAlertIncentive) Reset ¶
func (m *ValidatorAlertIncentive) Reset()
func (*ValidatorAlertIncentive) Size ¶
func (m *ValidatorAlertIncentive) Size() (n int)
func (*ValidatorAlertIncentive) String ¶
func (m *ValidatorAlertIncentive) String() string
func (ValidatorAlertIncentive) Type ¶
func (b ValidatorAlertIncentive) Type() string
Type returns the type of the incentive.
func (*ValidatorAlertIncentive) Unmarshal ¶
func (m *ValidatorAlertIncentive) Unmarshal(dAtA []byte) error
func (ValidatorAlertIncentive) ValidateBasic ¶
func (b ValidatorAlertIncentive) ValidateBasic() error
ValidateBasic does a basic stateless validation check on the ValidatorAlertIncentive. Specifically, this method checks that the validator's address is valid, and it's power is non-negative.
func (*ValidatorAlertIncentive) XXX_DiscardUnknown ¶
func (m *ValidatorAlertIncentive) XXX_DiscardUnknown()
func (*ValidatorAlertIncentive) XXX_Marshal ¶
func (m *ValidatorAlertIncentive) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*ValidatorAlertIncentive) XXX_Merge ¶
func (m *ValidatorAlertIncentive) XXX_Merge(src proto.Message)
func (*ValidatorAlertIncentive) XXX_Size ¶
func (m *ValidatorAlertIncentive) XXX_Size() int
func (*ValidatorAlertIncentive) XXX_Unmarshal ¶
func (m *ValidatorAlertIncentive) XXX_Unmarshal(b []byte) error
type ValidatorIncentiveHandler ¶
type ValidatorIncentiveHandler func(ve cmtabci.ExtendedVoteInfo, pb types.PriceBound, a types.Alert, cpID uint64) (incentivetypes.Incentive, error)
ValidatorIncentiveHandler determines whether a validator's price report deviated significantly from what was expected off-chain, and returns the alert to be issued to the incentives keeper if so
func DefaultHandleValidatorIncentive ¶
func DefaultHandleValidatorIncentive() ValidatorIncentiveHandler
DefaultHandleValidatorIncentive returns a ValidatorIncentiveHandler which creates a ValidatorAlertIncentive if a validator reported a price that lied outside the bounds of what was expected off-chain. If a validator failed to report a price for the ticker, or their price was within the bounds, no incentive is issued.
NOTICE: no signature checks are performed on the vote-extension, as it is expected that the caller has verified the ExtendedVoteInfo's signature before calling this function.