Versions in this module Expand all Collapse all v1 v1.0.0 Apr 25, 2019 Changes in this version + var ErrCRSNotReady = errors.New("crs is not ready") + var ErrConfigurationNotReady = errors.New("configuration is not ready") + var ErrIncorrectHash = errors.New("hash of block is incorrect") + var ErrIncorrectSignature = errors.New("signature of block is incorrect") + var ErrInvalidDKGMasterPublicKey = errors.New("invalid DKG master public key") + var ErrInvalidProposerID = errors.New("invalid proposer id") + var ErrNoBLSSigner = errors.New("bls signer not set") + var ErrNodeSetNotReady = errors.New("node set is not ready") + var ErrPayloadNotEmpty = errors.New("payload not empty") + func GetBAThreshold(config *types.Config) int + func GetCRSWithPanic(accessor crsAccessor, round uint64, logger common.Logger) common.Hash + func GetConfigWithPanic(accessor configAccessor, round uint64, logger common.Logger) *types.Config + func GetDKGThreshold(config *types.Config) int + func GetDKGValidThreshold(config *types.Config) int + func GetNextRoundValidationHeight(begin, length uint64) uint64 + func GetRoundHeight(accessor interface{}, round uint64) uint64 + func HashBlock(block *types.Block) (common.Hash, error) + func HashPosition(position types.Position) common.Hash + func HashVote(vote *types.Vote) common.Hash + func IsDKGValid(gov governanceAccessor, logger common.Logger, round, reset uint64) (valid bool, gpkInvalid bool) + func LaunchDummyReceiver(ctx context.Context, recv <-chan types.Msg, handler func(types.Msg)) (context.CancelFunc, <-chan struct{}) + func NeedPenaltyDKGPrivateShare(complaint *typesDKG.Complaint, mpk *typesDKG.MasterPublicKey) (bool, error) + func NeedPenaltyForkBlock(block1, block2 *types.Block) (bool, error) + func NeedPenaltyForkVote(vote1, vote2 *types.Vote) (bool, error) + func Rehash(hash common.Hash, count uint) common.Hash + func RoundEventRetryHandlerGenerator(rEvt *RoundEvent, hEvt *common.Event) func(uint64) + func SetDKGDelayRound(delay uint64) + func VerifyBlockSignature(b *types.Block) (err error) + func VerifyBlockSignatureWithoutPayload(b *types.Block) (err error) + func VerifyCRSSignature(block *types.Block, crs common.Hash, npks *typesDKG.NodePublicKeys) bool + func VerifyDKGComplaint(complaint *typesDKG.Complaint, mpk *typesDKG.MasterPublicKey) (bool, error) + func VerifyDKGComplaintSignature(complaint *typesDKG.Complaint) (bool, error) + func VerifyDKGFinalizeSignature(final *typesDKG.Finalize) (bool, error) + func VerifyDKGMPKReadySignature(ready *typesDKG.MPKReady) (bool, error) + func VerifyDKGMasterPublicKeySignature(mpk *typesDKG.MasterPublicKey) (bool, error) + func VerifyDKGPartialSignatureSignature(psig *typesDKG.PartialSignature) (bool, error) + func VerifyDKGPrivateShareSignature(prvShare *typesDKG.PrivateShare) (bool, error) + func VerifyDKGSuccessSignature(success *typesDKG.Success) (bool, error) + func VerifyVoteSignature(vote *types.Vote) (bool, error) + type ErrUnmatchedBlockHeightWithConfig struct + func (e ErrUnmatchedBlockHeightWithConfig) Error() string + type NodeSetCache struct + func NewNodeSetCache(nsIntf NodeSetCacheInterface) *NodeSetCache + func (cache *NodeSetCache) Exists(round uint64, nodeID types.NodeID) (exists bool, err error) + func (cache *NodeSetCache) GetNodeSet(round uint64) (*types.NodeSet, error) + func (cache *NodeSetCache) GetNotarySet(round uint64) (map[types.NodeID]struct{}, error) + func (cache *NodeSetCache) GetPublicKey(nodeID types.NodeID) (key crypto.PublicKey, exists bool) + func (cache *NodeSetCache) Purge(rID uint64) + func (cache *NodeSetCache) Touch(round uint64) (err error) + type NodeSetCacheInterface interface + CRS func(round uint64) common.Hash + Configuration func(round uint64) *types.Config + NodeSet func(round uint64) []crypto.PublicKey + type RoundBasedConfig struct + func (c *RoundBasedConfig) AppendTo(other RoundBasedConfig) + func (c *RoundBasedConfig) Contains(h uint64) bool + func (c *RoundBasedConfig) ExtendLength() + func (c *RoundBasedConfig) IsLastBlock(b *types.Block) bool + func (c *RoundBasedConfig) LastPeriodBeginHeight() uint64 + func (c *RoundBasedConfig) RoundEndHeight() uint64 + func (c *RoundBasedConfig) RoundID() uint64 + func (c *RoundBasedConfig) SetRoundBeginHeight(begin uint64) + func (c *RoundBasedConfig) SetupRoundBasedFields(roundID uint64, cfg *types.Config) + type RoundEvent struct + func NewRoundEvent(parentCtx context.Context, gov governanceAccessor, logger common.Logger, ...) (*RoundEvent, error) + func (e *RoundEvent) LastPeriod() (begin uint64, length uint64) + func (e *RoundEvent) Register(h roundEventFn) + func (e *RoundEvent) Stop() + func (e *RoundEvent) TriggerInitEvent() + func (e *RoundEvent) ValidateNextRound(blockHeight uint64) (count uint) + type RoundEventParam struct + BeginHeight uint64 + CRS common.Hash + Config *types.Config + Reset uint64 + Round uint64 + func (e RoundEventParam) NextCRSProposingHeight() uint64 + func (e RoundEventParam) NextDKGPreparationHeight() uint64 + func (e RoundEventParam) NextDKGRegisterHeight() uint64 + func (e RoundEventParam) NextDKGResetHeight() uint64 + func (e RoundEventParam) NextRoundHeight() uint64 + func (e RoundEventParam) NextRoundValidationHeight() uint64 + func (e RoundEventParam) NextTouchNodeSetCacheHeight() uint64 + func (e RoundEventParam) RoundEndHeight() uint64 + func (e RoundEventParam) String() string + type Signer struct + func NewSigner(prvKey crypto.PrivateKey) (s *Signer) + func (s *Signer) SetBLSSigner(signer blsSigner) + func (s *Signer) SignBlock(b *types.Block) (err error) + func (s *Signer) SignCRS(b *types.Block, crs common.Hash) (err error) + func (s *Signer) SignDKGComplaint(complaint *typesDKG.Complaint) (err error) + func (s *Signer) SignDKGFinalize(final *typesDKG.Finalize) (err error) + func (s *Signer) SignDKGMPKReady(ready *typesDKG.MPKReady) (err error) + func (s *Signer) SignDKGMasterPublicKey(mpk *typesDKG.MasterPublicKey) (err error) + func (s *Signer) SignDKGPartialSignature(pSig *typesDKG.PartialSignature) (err error) + func (s *Signer) SignDKGPrivateShare(prvShare *typesDKG.PrivateShare) (err error) + func (s *Signer) SignDKGSuccess(success *typesDKG.Success) (err error) + func (s *Signer) SignVote(v *types.Vote) (err error) + type VoteFilter struct + Confirm bool + LockIter uint64 + Period uint64 + Position types.Position + Voted map[types.VoteHeader]struct{} + func NewVoteFilter() *VoteFilter + func (vf *VoteFilter) AddVote(vote *types.Vote) + func (vf *VoteFilter) Filter(vote *types.Vote) bool