Documentation ¶
Index ¶
- Variables
- func NewHeaderIntegrityVerifier(referenceChainID []byte, versionsByEpochs []config.VersionByEpochs, ...) (*headerIntegrityVerifier, error)
- type ArgsHeaderSigVerifier
- type HeaderSigVerifier
- func (hsv *HeaderSigVerifier) IsInterfaceNil() bool
- func (hsv *HeaderSigVerifier) VerifyLeaderSignature(header data.HeaderHandler) error
- func (hsv *HeaderSigVerifier) VerifyRandSeed(header data.HeaderHandler) error
- func (hsv *HeaderSigVerifier) VerifyRandSeedAndLeaderSignature(header data.HeaderHandler) error
- func (hsv *HeaderSigVerifier) VerifySignature(header data.HeaderHandler) error
Constants ¶
This section is empty.
Variables ¶
var ErrEmptyVersionsByEpochsList = errors.New("empty versions by epochs list")
ErrEmptyVersionsByEpochsList signals that an empty versions by epochs list was provided
var ErrInvalidChainID = errors.New("invalid chain ID")
ErrInvalidChainID signals that an invalid chain ID has been provided
var ErrInvalidReferenceChainID = errors.New("invalid reference Chain ID provided")
ErrInvalidReferenceChainID signals that the provided reference chain ID is not valid
var ErrInvalidSoftwareVersion = errors.New("invalid software version")
ErrInvalidSoftwareVersion signals that invalid software version was provided
var ErrInvalidVersionOnEpochValues = errors.New("invalid version provided on epoch values")
ErrInvalidVersionOnEpochValues signals that the version element is not accepted because the epoch values are invalid
var ErrInvalidVersionStringTooLong = errors.New("invalid version provided: string too large")
ErrInvalidVersionStringTooLong signals that the version element is not accepted because it contains too large strings
var ErrNilCacher = errors.New("nil cacher")
ErrNilCacher signals that a nil cacher has been provided
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
var ErrSoftwareVersionMismatch = errors.New("software versions mismatch")
ErrSoftwareVersionMismatch signals that the software versions mismatch
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 NewHeaderIntegrityVerifier ¶ added in v1.0.117
func NewHeaderIntegrityVerifier( referenceChainID []byte, versionsByEpochs []config.VersionByEpochs, defaultVersion string, versionCache storage.Cacher, ) (*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 sharding.NodesCoordinator MultiSigVerifier crypto.MultiSigVerifier 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 ¶ added in v1.1.2
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