headerCheck

package
v1.11.11 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2026 License: GPL-3.0 Imports: 18 Imported by: 2 modules, 1 package

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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 ErrProofHeaderHashMismatch = errors.New("proof header hash mismatch")

ErrProofHeaderHashMismatch signals that the proof header hash does not match the header hash

View Source
var ErrProofNotExpected = errors.New("proof not expected")

ErrProofNotExpected signals that the proof is not expected

View Source
var ErrProofShardMismatch = errors.New("proof shard mismatch")

ErrProofShardMismatch signals that the proof shard does not match the header shard

Functions

func ComputeConsensusGroup added in v1.6.14

func ComputeConsensusGroup(header data.HeaderHandler, nodesCoordinator nodesCoordinator.NodesCoordinator) (leader nodesCoordinator.Validator, 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
	EnableEpochsHandler     common.EnableEpochsHandler
	HeadersPool             dataRetriever.HeadersPool
	ProofsPool              dataRetriever.ProofsPool
	StorageService          dataRetriever.StorageService
}

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) VerifyHeaderProof added in v1.9.0

func (hsv *HeaderSigVerifier) VerifyHeaderProof(proofHandler data.HeaderProofHandler) error

VerifyHeaderProof checks if the proof is correct for the header

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

func (*HeaderSigVerifier) VerifySignatureForHash added in v1.9.0

func (hsv *HeaderSigVerifier) VerifySignatureForHash(header data.HeaderHandler, hash []byte, pubkeysBitmap []byte, signature []byte) error

VerifySignatureForHash will check if signature is correct for the provided hash

Jump to

Keyboard shortcuts

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