github.com/prysmaticlabs/prysm@v1.4.4/beacon-chain/slasher/types/types.go (about)

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