Documentation ¶
Overview ¶
nolint
Index ¶
- type Body
- type Config
- type ConsensusOutput
- type Hare
- type IterRound
- func (ir IterRound) Absolute() uint32
- func (t *IterRound) DecodeScale(dec *scale.Decoder) (total int, err error)
- func (ir IterRound) Delay(since IterRound) uint32
- func (t *IterRound) EncodeScale(enc *scale.Encoder) (total int, err error)
- func (ir IterRound) Grade(since IterRound) grade
- func (ir IterRound) IsMessageRound() bool
- type Message
- func (t *Message) DecodeScale(dec *scale.Decoder) (total int, err error)
- func (t *Message) EncodeScale(enc *scale.Encoder) (total int, err error)
- func (m *Message) MarshalLogObject(encoder zapcore.ObjectEncoder) error
- func (m *Message) ToBytes() []byte
- func (m *Message) ToHash() types.Hash32
- func (m *Message) ToMalfeasanceProof() types.HareProofMsg
- func (m *Message) ToMetadata() types.HareMetadata
- func (m *Message) Validate() error
- type Opt
- type Round
- type Tracer
- type Value
- type WeakCoinOutput
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { Enable bool `mapstructure:"enable"` EnableLayer types.LayerID `mapstructure:"enable-layer"` DisableLayer types.LayerID `mapstructure:"disable-layer"` Committee uint16 `mapstructure:"committee"` Leaders uint16 `mapstructure:"leaders"` IterationsLimit uint8 `mapstructure:"iterations-limit"` PreroundDelay time.Duration `mapstructure:"preround-delay"` RoundDuration time.Duration `mapstructure:"round-duration"` // LogStats if true will log iteration statistics with INFO level at the start of the next iteration. // This requires additional computation and should be used for debugging only. LogStats bool `mapstructure:"log-stats"` ProtocolName string }
func DefaultConfig ¶
func DefaultConfig() Config
func (*Config) MarshalLogObject ¶
func (cfg *Config) MarshalLogObject(encoder zapcore.ObjectEncoder) error
type ConsensusOutput ¶
type ConsensusOutput struct { Layer types.LayerID Proposals []types.ProposalID }
type Hare ¶
type Hare struct {
// contains filtered or unexported fields
}
func New ¶
func New( nodeclock nodeclock, pubsub pubsub.PublishSubsciber, db *datastore.CachedDB, verifier *signing.EdVerifier, oracle oracle, sync system.SyncStateProvider, patrol *layerpatrol.LayerPatrol, opts ...Opt, ) *Hare
func (*Hare) Coins ¶
func (h *Hare) Coins() <-chan WeakCoinOutput
func (*Hare) Results ¶
func (h *Hare) Results() <-chan ConsensusOutput
type IterRound ¶
func (*IterRound) DecodeScale ¶
func (*IterRound) EncodeScale ¶
func (IterRound) IsMessageRound ¶
type Message ¶
type Message struct { Body Sender types.NodeID Signature types.EdSignature }
func (*Message) DecodeScale ¶
func (*Message) EncodeScale ¶
func (*Message) MarshalLogObject ¶
func (m *Message) MarshalLogObject(encoder zapcore.ObjectEncoder) error
func (*Message) ToMalfeasanceProof ¶
func (m *Message) ToMalfeasanceProof() types.HareProofMsg
func (*Message) ToMetadata ¶
func (m *Message) ToMetadata() types.HareMetadata
type Opt ¶
type Opt func(*Hare)
func WithConfig ¶
func WithLogger ¶
func WithTracer ¶
func WithWallclock ¶
type Value ¶
type Value struct { // Proposals is set in messages for preround and propose rounds. Proposals []types.ProposalID `scale:"max=500"` // Reference is set in messages for commit and notify rounds. Reference *types.Hash32 }
func (*Value) DecodeScale ¶
func (*Value) EncodeScale ¶
type WeakCoinOutput ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.