syncmanager

package
v1.0.0-alpha.16 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 19, 2024 License: Apache-2.0 Imports: 4 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var NewEvents = event.CreateGroupConstructor(func() (newEvents *Events) {
	return &Events{
		UpdatedStatus: event.New1[*SyncStatus](),
	}
})

Functions

This section is empty.

Types

type Events

type Events struct {
	UpdatedStatus *event.Event1[*SyncStatus]

	event.Group[Events, *Events]
}

type SyncManager

type SyncManager interface {
	// SyncStatus returns the sync status of a node.
	SyncStatus() *SyncStatus

	// IsBootstrapped returns bool indicating if a node is bootstrapped.
	IsBootstrapped() bool

	// IsNodeSynced returns bool indicating if a node is synced.
	IsNodeSynced() bool

	// IsFinalizationDelayed returns bool indicating if the finalization is delayed
	// (latest committed slot - latest finalized slot > max committable age).
	IsFinalizationDelayed() bool

	// LastAcceptedBlockSlot returns the slot of the latest accepted block.
	LastAcceptedBlockSlot() iotago.SlotIndex

	// LastConfirmedBlockSlot returns slot of the latest confirmed block.
	LastConfirmedBlockSlot() iotago.SlotIndex

	// LatestCommitment returns the latest commitment.
	LatestCommitment() *model.Commitment

	// LatestFinalizedSlot returns the latest finalized slot index.
	LatestFinalizedSlot() iotago.SlotIndex

	// LastPrunedEpoch returns the last pruned epoch index.
	LastPrunedEpoch() (iotago.EpochIndex, bool)

	// Reset resets the component to a clean state as if it was created at the last commitment.
	Reset()

	module.Module
}

type SyncStatus

type SyncStatus struct {
	NodeBootstrapped       bool
	NodeSynced             bool
	FinalizationDelayed    bool
	LastAcceptedBlockSlot  iotago.SlotIndex
	LastConfirmedBlockSlot iotago.SlotIndex
	LatestCommitment       *model.Commitment
	LatestFinalizedSlot    iotago.SlotIndex
	LastPrunedEpoch        iotago.EpochIndex
	HasPruned              bool
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL