types

package
v0.3.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 25, 2020 License: GPL-3.0 Imports: 1 Imported by: 39

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DetectionKind

type DetectionKind uint8

DetectionKind defines an enum type that gives us information on the type of slashable offense found when analyzing validator min-max spans.

const (
	// DoubleVote denotes a slashable offense in which
	// a validator cast two conflicting attestations within
	// the same target epoch.
	DoubleVote DetectionKind = iota
	// SurroundVote denotes a slashable offense in which
	// a validator surrounded or was surrounded by a previous
	// attestation created by the same validator.
	SurroundVote
)

type DetectionResult

type DetectionResult struct {
	ValidatorIndex uint64
	SlashableEpoch uint64
	Kind           DetectionKind
	SigBytes       [2]byte
}

DetectionResult tells us the kind of slashable offense found from detecting on min-max spans + the slashable epoch for the offense. Also includes the signature bytes for assistance in finding the attestation for the slashing proof.

func (*DetectionResult) Marshal added in v0.3.4

func (result *DetectionResult) Marshal() []byte

Marshal the result into bytes, used for removing duplicates.

type Span

type Span struct {
	MinSpan     uint16
	MaxSpan     uint16
	SigBytes    [2]byte
	HasAttested bool
}

Span defines the structure used for detecting surround and double votes.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL