internodesync

package
v1.3.17 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2020 License: MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const UNKNOWN_BLOCK_HEIGHT = primitives.BlockHeight(0)

Variables

View Source
var LogTag = log.String("flow", "block-sync")

Functions

func NewStateFactory

func NewStateFactory(
	config blockSyncConfig,
	gossip gossiptopics.BlockSync,
	storage BlockSyncStorage,
	conduit blockSyncConduit,
	logger log.Logger,
	factory metric.Factory,
) *stateFactory

func NewStateFactoryWithTimers

func NewStateFactoryWithTimers(
	config blockSyncConfig,
	gossip gossiptopics.BlockSync,
	storage BlockSyncStorage,
	conduit blockSyncConduit,
	createCollectTimeoutTimer func() *synchronization.Timer,
	createNoCommitTimeoutTimer func() *synchronization.Timer,
	createWaitForChunksTimeoutTimer func() *synchronization.Timer,
	logger log.Logger,
	factory metric.Factory,
) *stateFactory

Types

type BlockSync

type BlockSync struct {
	govnr.TreeSupervisor
	// contains filtered or unexported fields
}

func NewBlockSync

func NewBlockSync(ctx context.Context, config blockSyncConfig, gossip gossiptopics.BlockSync, storage BlockSyncStorage, parentLogger log.Logger, metricFactory metric.Factory) *BlockSync

func (*BlockSync) HandleBlockAvailabilityResponse

func (bs *BlockSync) HandleBlockAvailabilityResponse(ctx context.Context, input *gossiptopics.BlockAvailabilityResponseInput) (*gossiptopics.EmptyOutput, error)

func (*BlockSync) HandleBlockCommitted

func (bs *BlockSync) HandleBlockCommitted(ctx context.Context)

func (*BlockSync) HandleBlockSyncResponse

func (bs *BlockSync) HandleBlockSyncResponse(ctx context.Context, input *gossiptopics.BlockSyncResponseInput) (*gossiptopics.EmptyOutput, error)

type BlockSyncStorage

type BlockSyncStorage interface {
	GetLastCommittedBlockHeight(ctx context.Context, input *services.GetLastCommittedBlockHeightInput) (*services.GetLastCommittedBlockHeightOutput, error)
	NodeSyncCommitBlock(ctx context.Context, input *services.CommitBlockInput) (*services.CommitBlockOutput, error)
	ValidateBlockForCommit(ctx context.Context, input *services.ValidateBlockForCommitInput) (*services.ValidateBlockForCommitOutput, error)
	UpdateConsensusAlgosAboutLastCommittedBlockInLocalPersistence(ctx context.Context)
	GetBlock(height primitives.BlockHeight) (*protocol.BlockPairContainer, error)
	GetSyncState() SyncState
}

type SyncState added in v1.3.15

type SyncState struct {
	TopHeight        primitives.BlockHeight
	InOrderHeight    primitives.BlockHeight
	LastSyncedHeight primitives.BlockHeight
}

Jump to

Keyboard shortcuts

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