Documentation ¶
Index ¶
- type Config
- type Opinion
- type ThreadSafeVerifyingTortoise
- func (trtl *ThreadSafeVerifyingTortoise) BaseBlock(ctx context.Context) (types.BlockID, [][]types.BlockID, error)
- func (trtl *ThreadSafeVerifyingTortoise) HandleIncomingLayer(ctx context.Context, layerID types.LayerID) (types.LayerID, types.LayerID, bool)
- func (trtl *ThreadSafeVerifyingTortoise) LatestComplete() types.LayerID
- func (trtl *ThreadSafeVerifyingTortoise) Persist(ctx context.Context) error
- func (trtl *ThreadSafeVerifyingTortoise) Stop()
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 { LayerSize uint32 Database database.Database MeshDatabase blockDataProvider Beacons blocks.BeaconGetter ATXDB atxDataProvider Hdist uint32 // hare lookback distance: the distance over which we use the input vector/hare results Zdist uint32 // hare result wait distance: the distance over which we're willing to wait for hare results ConfidenceParam uint32 // confidence wait distance: how long we wait for global consensus to be established GlobalThreshold *big.Rat // threshold required to finalize blocks and layers LocalThreshold *big.Rat // threshold that determines whether a node votes based on local or global opinion WindowSize uint32 // tortoise sliding window: how many layers we store data for Log log.Log RerunInterval time.Duration // how often to rerun from genesis BadBeaconVoteDelayLayers uint32 // number of layers to delay votes for blocks with bad beacon values during self-healing }
Config holds the arguments and dependencies to create a verifying tortoise instance.
type ThreadSafeVerifyingTortoise ¶
type ThreadSafeVerifyingTortoise struct {
// contains filtered or unexported fields
}
ThreadSafeVerifyingTortoise is a thread safe verifying tortoise wrapper, it just locks all actions.
func NewVerifyingTortoise ¶
func NewVerifyingTortoise(ctx context.Context, cfg Config) *ThreadSafeVerifyingTortoise
NewVerifyingTortoise creates ThreadSafeVerifyingTortoise instance.
func (*ThreadSafeVerifyingTortoise) BaseBlock ¶
func (trtl *ThreadSafeVerifyingTortoise) BaseBlock(ctx context.Context) (types.BlockID, [][]types.BlockID, error)
BaseBlock chooses a base block and creates a differences list. needs the hare results for latest layers.
func (*ThreadSafeVerifyingTortoise) HandleIncomingLayer ¶
func (trtl *ThreadSafeVerifyingTortoise) 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 (*ThreadSafeVerifyingTortoise) LatestComplete ¶
func (trtl *ThreadSafeVerifyingTortoise) LatestComplete() types.LayerID
LatestComplete returns the latest verified layer.
func (*ThreadSafeVerifyingTortoise) Persist ¶
func (trtl *ThreadSafeVerifyingTortoise) Persist(ctx context.Context) error
Persist saves a copy of the current tortoise state to the database.
func (*ThreadSafeVerifyingTortoise) Stop ¶
func (trtl *ThreadSafeVerifyingTortoise) Stop()
Stop background workers.