Documentation ¶
Index ¶
- type Config
- type Opinion
- type Opt
- type Tortoise
- func (trtl *Tortoise) BaseBallot(ctx context.Context) (types.BallotID, [][]types.BlockID, error)
- func (trtl *Tortoise) HandleIncomingLayer(ctx context.Context, layerID types.LayerID) (types.LayerID, types.LayerID, bool)
- func (trtl *Tortoise) LatestComplete() types.LayerID
- func (trtl *Tortoise) Stop()
- func (trtl *Tortoise) WaitReady(ctx context.Context) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶ added in v1.0.0
type Config struct { Hdist uint32 `mapstructure:"tortoise-hdist"` // hare/input vector lookback distance Zdist uint32 `mapstructure:"tortoise-zdist"` // hare result wait distance ConfidenceParam uint32 `mapstructure:"tortoise-confidence-param"` // layers to wait for global consensus WindowSize uint32 `mapstructure:"tortoise-window-size"` // size of the tortoise sliding window (in layers) GlobalThreshold *big.Rat `mapstructure:"tortoise-global-threshold"` // threshold for finalizing blocks and layers LocalThreshold *big.Rat `mapstructure:"tortoise-local-threshold"` // threshold for choosing when to use weak coin RerunInterval time.Duration `mapstructure:"tortoise-rerun-interval"` MaxExceptions int `mapstructure:"tortoise-max-exceptions"` // if candidate for base block has more than max exceptions it will be ignored LayerSize uint32 BadBeaconVoteDelayLayers uint32 // number of layers to delay votes for blocks with bad beacon values during self-healing MeshProcessed types.LayerID }
Config for protocol parameters.
type Opt ¶ added in v1.0.0
type Opt func(t *Tortoise)
Opt for configuring tortoise.
func WithConfig ¶ added in v1.0.0
WithConfig defines protocol parameters.
func WithContext ¶
WithContext defines context for tortoise.
func WithLogger ¶ added in v1.0.0
WithLogger defines logger for tortoise.
type Tortoise ¶
type Tortoise struct {
// contains filtered or unexported fields
}
Tortoise is a thread safe verifying tortoise wrapper, it just locks all actions.
func New ¶ added in v1.0.0
func New(mdb blockDataProvider, atxdb atxDataProvider, beacons system.BeaconGetter, opts ...Opt) *Tortoise
New creates Tortoise instance.
func (*Tortoise) BaseBallot ¶
BaseBallot chooses a base ballot and creates a differences list. needs the hare results for latest layers.
func (*Tortoise) HandleIncomingLayer ¶ added in v0.1.11
func (trtl *Tortoise) HandleIncomingLayer(ctx context.Context, layerID types.LayerID) (types.LayerID, types.LayerID, bool)
HandleIncomingLayer processes all layer block votes returns the old verified layer and new verified layer after taking into account the blocks votes.
func (*Tortoise) LatestComplete ¶
LatestComplete returns the latest verified layer.
Source Files ¶
Click to show internal directories.
Click to hide internal directories.