Documentation ¶
Index ¶
- type NoProtection
- func (p *NoProtection) FetchHighestAttestation(pubKey []byte) (*phase0.AttestationData, bool, error)
- func (p *NoProtection) FetchHighestProposal(pubKey []byte) (phase0.Slot, bool, error)
- func (p *NoProtection) IsSlashableAttestation(pubKey []byte, attestation *phase0.AttestationData) (*core.AttestationSlashStatus, error)
- func (p *NoProtection) IsSlashableProposal(pubKey []byte, slot phase0.Slot) (*core.ProposalSlashStatus, error)
- func (p *NoProtection) UpdateHighestAttestation(pubKey []byte, attestation *phase0.AttestationData) error
- func (p *NoProtection) UpdateHighestProposal(pubKey []byte, slot phase0.Slot) error
- type NormalProtection
- func (protector *NormalProtection) FetchHighestAttestation(pubKey []byte) (*phase0.AttestationData, bool, error)
- func (protector *NormalProtection) FetchHighestProposal(pubKey []byte) (phase0.Slot, bool, error)
- func (protector *NormalProtection) IsSlashableAttestation(pubKey []byte, attestation *phase0.AttestationData) (*core.AttestationSlashStatus, error)
- func (protector *NormalProtection) IsSlashableProposal(pubKey []byte, slot phase0.Slot) (*core.ProposalSlashStatus, error)
- func (protector *NormalProtection) UpdateHighestAttestation(pubKey []byte, attestation *phase0.AttestationData) error
- func (protector *NormalProtection) UpdateHighestProposal(key []byte, slot phase0.Slot) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type NoProtection ¶
type NoProtection struct { }
NoProtection implements slashing protector interface with dummy implementation
func (*NoProtection) FetchHighestAttestation ¶ added in v1.3.0
func (p *NoProtection) FetchHighestAttestation(pubKey []byte) (*phase0.AttestationData, bool, error)
FetchHighestAttestation does nothing
func (*NoProtection) FetchHighestProposal ¶ added in v1.3.0
FetchHighestProposal returns highest proposal data
func (*NoProtection) IsSlashableAttestation ¶
func (p *NoProtection) IsSlashableAttestation(pubKey []byte, attestation *phase0.AttestationData) (*core.AttestationSlashStatus, error)
IsSlashableAttestation returns always nils
func (*NoProtection) IsSlashableProposal ¶
func (p *NoProtection) IsSlashableProposal(pubKey []byte, slot phase0.Slot) (*core.ProposalSlashStatus, error)
IsSlashableProposal returns always valid result
func (*NoProtection) UpdateHighestAttestation ¶
func (p *NoProtection) UpdateHighestAttestation(pubKey []byte, attestation *phase0.AttestationData) error
UpdateHighestAttestation does nothing
func (*NoProtection) UpdateHighestProposal ¶
func (p *NoProtection) UpdateHighestProposal(pubKey []byte, slot phase0.Slot) error
UpdateHighestProposal does nothing
type NormalProtection ¶
type NormalProtection struct {
// contains filtered or unexported fields
}
NormalProtection implements normal protection logic
func NewNormalProtection ¶
func NewNormalProtection(store core.SlashingStore) *NormalProtection
NewNormalProtection is the constructor of NormalProtection
func (*NormalProtection) FetchHighestAttestation ¶ added in v1.3.0
func (protector *NormalProtection) FetchHighestAttestation(pubKey []byte) (*phase0.AttestationData, bool, error)
FetchHighestAttestation returns highest attestation data
func (*NormalProtection) FetchHighestProposal ¶ added in v1.3.0
FetchHighestProposal returns highest proposal data
func (*NormalProtection) IsSlashableAttestation ¶
func (protector *NormalProtection) IsSlashableAttestation(pubKey []byte, attestation *phase0.AttestationData) (*core.AttestationSlashStatus, error)
IsSlashableAttestation detects double, surround and surrounded slashable events
func (*NormalProtection) IsSlashableProposal ¶
func (protector *NormalProtection) IsSlashableProposal(pubKey []byte, slot phase0.Slot) (*core.ProposalSlashStatus, error)
IsSlashableProposal detects slashable proposal request
func (*NormalProtection) UpdateHighestAttestation ¶
func (protector *NormalProtection) UpdateHighestAttestation(pubKey []byte, attestation *phase0.AttestationData) error
UpdateHighestAttestation potentially updates the highest attestation given this latest attestation.
func (*NormalProtection) UpdateHighestProposal ¶
func (protector *NormalProtection) UpdateHighestProposal(key []byte, slot phase0.Slot) error
UpdateHighestProposal updates highest proposal