consensusfault

package
v0.9.8 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2021 License: Apache-2.0, MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

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) (*runtime5.ConsensusFault, error)

Checks validity of the submitted consensus fault with the two block headers needed to prove the fault and an optional extra one to check common ancestry (as needed). Note that the blocks are ordered: the method requires a.Epoch() <= b.Epoch().

type FaultStateView

type FaultStateView interface {
	ResolveToKeyAddr(ctx context.Context, address address.Address) (address.Address, error)
	MinerInfo(ctx context.Context, maddr address.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