-
Notifications
You must be signed in to change notification settings - Fork 13
/
slashing_protection.go
23 lines (20 loc) · 1.03 KB
/
slashing_protection.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
package core
import (
eth "github.com/prysmaticlabs/prysm/proto/prysm/v1alpha1"
)
// SlashingProtector represents the behavior of the slashing protector
type SlashingProtector interface {
IsSlashableAttestation(pubKey []byte, attestation *eth.AttestationData) (*AttestationSlashStatus, error)
IsSlashableProposal(pubKey []byte, block *eth.BeaconBlock) (*ProposalSlashStatus, error)
// Will potentially update the highest attestation given this latest attestation.
UpdateHighestAttestation(pubKey []byte, attestation *eth.AttestationData) error
UpdateHighestProposal(pubKey []byte, block *eth.BeaconBlock) error
RetrieveHighestAttestation(pubKey []byte) (*eth.AttestationData, error)
}
// SlashingStore represents the behavior of the slashing store
type SlashingStore interface {
SaveHighestAttestation(pubKey []byte, attestation *eth.AttestationData) error
RetrieveHighestAttestation(pubKey []byte) *eth.AttestationData
SaveHighestProposal(pubKey []byte, block *eth.BeaconBlock) error
RetrieveHighestProposal(pubKey []byte) *eth.BeaconBlock
}