headerCheck

package
v1.7.2 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2024 License: GPL-3.0 Imports: 16 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrIndexNotSelected = errors.New("index is not selected")

ErrIndexNotSelected signals that the given index is not selected

View Source
var ErrIndexOutOfBounds = errors.New("index is out of bounds")

ErrIndexOutOfBounds signals that the given index is outside expected bounds

View Source
var ErrInvalidChainID = errors.New("invalid chain ID")

ErrInvalidChainID signals that an invalid chain ID has been provided

View Source
var ErrInvalidReferenceChainID = errors.New("invalid reference Chain ID provided")

ErrInvalidReferenceChainID signals that the provided reference chain ID is not valid

View Source
var ErrNilHeaderVersionHandler = errors.New("nil header version handler")

ErrNilHeaderVersionHandler signals that the provided header version handler is nil

View Source
var ErrNotEnoughSignatures = errors.New("not enough signatures in block")

ErrNotEnoughSignatures signals that a block is not signed by at least the minimum number of validators from the consensus group

View Source
var ErrWrongSizeBitmap = errors.New("wrong size bitmap has been provided")

ErrWrongSizeBitmap signals that the provided bitmap's length is bigger than the one that was required

Functions

func ComputeConsensusGroup added in v1.6.14

func ComputeConsensusGroup(header data.HeaderHandler, nodesCoordinator nodesCoordinator.NodesCoordinator) (validatorsGroup []nodesCoordinator.Validator, err error)

ComputeConsensusGroup will compute the consensus group that assembled the provided block

func ComputeSignersPublicKeys added in v1.6.15

func ComputeSignersPublicKeys(consensusGroup []string, bitmap []byte) []string

ComputeSignersPublicKeys will extract from the provided consensus group slice only the strings that matched with the bitmap

func NewHeaderIntegrityVerifier

func NewHeaderIntegrityVerifier(
	referenceChainID []byte,
	headerVersionHandler factory.HeaderVersionHandler,
) (*headerIntegrityVerifier, error)

NewHeaderIntegrityVerifier returns a new instance of a structure capable of verifying the integrity of a provided header

Types

type ArgsHeaderSigVerifier

type ArgsHeaderSigVerifier struct {
	Marshalizer             marshal.Marshalizer
	Hasher                  hashing.Hasher
	NodesCoordinator        nodesCoordinator.NodesCoordinator
	MultiSigContainer       cryptoCommon.MultiSignerContainer
	SingleSigVerifier       crypto.SingleSigner
	KeyGen                  crypto.KeyGenerator
	FallbackHeaderValidator process.FallbackHeaderValidator
}

ArgsHeaderSigVerifier is used to store all components that are needed to create a new HeaderSigVerifier

type HeaderSigVerifier

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

HeaderSigVerifier is component used to check if a header is valid

func NewHeaderSigVerifier

func NewHeaderSigVerifier(arguments *ArgsHeaderSigVerifier) (*HeaderSigVerifier, error)

NewHeaderSigVerifier will create a new instance of HeaderSigVerifier

func (*HeaderSigVerifier) IsInterfaceNil

func (hsv *HeaderSigVerifier) IsInterfaceNil() bool

IsInterfaceNil will check if interface is nil

func (*HeaderSigVerifier) VerifyLeaderSignature

func (hsv *HeaderSigVerifier) VerifyLeaderSignature(header data.HeaderHandler) error

VerifyLeaderSignature will check if leader signature is correct

func (*HeaderSigVerifier) VerifyRandSeed

func (hsv *HeaderSigVerifier) VerifyRandSeed(header data.HeaderHandler) error

VerifyRandSeed will check if rand seed is correct

func (*HeaderSigVerifier) VerifyRandSeedAndLeaderSignature

func (hsv *HeaderSigVerifier) VerifyRandSeedAndLeaderSignature(header data.HeaderHandler) error

VerifyRandSeedAndLeaderSignature will check if rand seed and leader signature is correct

func (*HeaderSigVerifier) VerifySignature

func (hsv *HeaderSigVerifier) VerifySignature(header data.HeaderHandler) error

VerifySignature will check if signature is correct

Jump to

Keyboard shortcuts

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