slashing

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2021 License: Apache-2.0, MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConsensusFault

type ConsensusFault struct {
	// Block1 and Block2 are two distinct blocks from an overlapping interval
	// signed by the same miner
	Block1, Block2 *block.Block
}

ConsensusFault is the information needed to submit a consensus fault

type ConsensusFaultChecker

type ConsensusFaultChecker struct {
	// contains filtered or unexported fields
}

Checks the validity of reported consensus faults.

func NewFaultChecker

func NewFaultChecker(chain chainReader, fork fork.IFork) *ConsensusFaultChecker

func (*ConsensusFaultChecker) VerifyConsensusFault

func (s *ConsensusFaultChecker) VerifyConsensusFault(ctx context.Context, h1, h2, extra []byte, view FaultStateView) (*runtime2.ConsensusFault, error)

Checks the validity of a consensus fault reported by serialized block headers h1, h2, and optional common-ancestor witness h3.

type ConsensusFaultDetector

type ConsensusFaultDetector struct {
	// contains filtered or unexported fields
}

ConsensusFaultDetector detects consensus faults -- misbehavior conditions where a single party produces multiple blocks at the same time.

func NewConsensusFaultDetector

func NewConsensusFaultDetector(faultCh chan ConsensusFault) *ConsensusFaultDetector

NewConsensusFaultDetector returns a fault detector given a fault channel

func (*ConsensusFaultDetector) CheckBlock

func (detector *ConsensusFaultDetector) CheckBlock(b *block.Block, p *block.TipSet) error

CheckBlock records a new block and checks for faults Preconditions: the signature is already checked and p is the parent

type FaultStateView

type FaultStateView interface {
	state.AccountStateView
	MinerInfo(ctx context.Context, maddr addr.Address, nv network.Version) (*miner.MinerInfo, error)
}

Jump to

Keyboard shortcuts

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