-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
types.go
53 lines (45 loc) · 1.65 KB
/
types.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
package types
import (
"github.com/prysmaticlabs/prysm/v4/consensus-types/primitives"
ethpb "github.com/prysmaticlabs/prysm/v4/proto/prysm/v1alpha1"
)
// ChunkKind to differentiate what kind of span we are working
// with for slashing detection, either min or max span.
type ChunkKind uint
const (
MinSpan ChunkKind = iota
MaxSpan
)
// IndexedAttestationWrapper contains an indexed attestation with its
// signing root to reduce duplicated computation.
type IndexedAttestationWrapper struct {
IndexedAttestation *ethpb.IndexedAttestation
SigningRoot [32]byte
}
// AttesterDoubleVote represents a double vote instance
// which is a slashable event for attesters.
type AttesterDoubleVote struct {
Target primitives.Epoch
ValidatorIndex primitives.ValidatorIndex
PrevAttestationWrapper *IndexedAttestationWrapper
AttestationWrapper *IndexedAttestationWrapper
}
// DoubleBlockProposal containing an incoming and an existing proposal's signing root.
type DoubleBlockProposal struct {
Slot primitives.Slot
ValidatorIndex primitives.ValidatorIndex
PrevBeaconBlockWrapper *SignedBlockHeaderWrapper
BeaconBlockWrapper *SignedBlockHeaderWrapper
}
// SignedBlockHeaderWrapper contains an signed beacon block header with its
// signing root to reduce duplicated computation.
type SignedBlockHeaderWrapper struct {
SignedBeaconBlockHeader *ethpb.SignedBeaconBlockHeader
SigningRoot [32]byte
}
// AttestedEpochForValidator encapsulates a previously attested epoch
// for a validator index.
type AttestedEpochForValidator struct {
ValidatorIndex primitives.ValidatorIndex
Epoch primitives.Epoch
}