syncmanager

package
v1.0.0-beta.4 Latest Latest
Warning

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

Go to latest
Published: May 15, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

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