multiview

package
v0.0.0-...-7ece11e Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewMultiView

func NewMultiView() *multiView

Types

type BeaconMultiView

type BeaconMultiView struct {
	// contains filtered or unexported fields
}

func NewBeaconMultiView

func NewBeaconMultiView() *BeaconMultiView

func (*BeaconMultiView) AddView

func (s *BeaconMultiView) AddView(v View) (int, error)

func (BeaconMultiView) ClearBranch

func (s BeaconMultiView) ClearBranch()

func (BeaconMultiView) Clone

func (s BeaconMultiView) Clone() MultiView

func (BeaconMultiView) FinalizeView

func (s BeaconMultiView) FinalizeView(hashToFinalize common.Hash) error

forward final view to specific view Instant finality: Beacon chain will forward to expected final view. Shard chain will forward to shard view that beacon confirm need to check if it is still compatible with best view

func (BeaconMultiView) GetAllViewsWithBFS

func (s BeaconMultiView) GetAllViewsWithBFS() []View

func (BeaconMultiView) GetBestView

func (s BeaconMultiView) GetBestView() View

func (BeaconMultiView) GetExpectedFinalView

func (s BeaconMultiView) GetExpectedFinalView() View

func (BeaconMultiView) GetFinalView

func (s BeaconMultiView) GetFinalView() View

func (BeaconMultiView) GetViewByHash

func (s BeaconMultiView) GetViewByHash(hash common.Hash) View

func (BeaconMultiView) IsInstantFinality

func (s BeaconMultiView) IsInstantFinality() bool

func (BeaconMultiView) ReplaceBlockIfImproveFinality

func (s BeaconMultiView) ReplaceBlockIfImproveFinality(b types.BlockInterface) (bool, error)

for instant finality only 2 usecases, when proposer propose a block, it give - previous block for finality check - consensusData (shard confirm beacon, beacon confirm shard) for making consensus on other chain finality

func (BeaconMultiView) Reset

func (s BeaconMultiView) Reset()

func (BeaconMultiView) RunCleanProcess

func (s BeaconMultiView) RunCleanProcess()

func (*BeaconMultiView) SimulateAddView

func (s *BeaconMultiView) SimulateAddView(view View) (cloneMultiview MultiView)

type MultiView

type MultiView interface {
	ReplaceBlockIfImproveFinality(block types.BlockInterface) (bool, error)
	IsInstantFinality() bool
	GetViewByHash(hash common.Hash) View
	SimulateAddView(view View) (cloneMultiview MultiView)
	GetBestView() View
	GetFinalView() View
	FinalizeView(hashToFinalize common.Hash) error
	GetExpectedFinalView() View
	GetAllViewsWithBFS() []View
	RunCleanProcess()
	Clone() MultiView
	Reset()
	AddView(v View) (int, error)
}

type ShardMultiView

type ShardMultiView struct {
	// contains filtered or unexported fields
}

func NewShardMultiView

func NewShardMultiView() *ShardMultiView

func (*ShardMultiView) AddView

func (s *ShardMultiView) AddView(v View) (res int, err error)

func (ShardMultiView) ClearBranch

func (s ShardMultiView) ClearBranch()

func (ShardMultiView) Clone

func (s ShardMultiView) Clone() MultiView

func (ShardMultiView) FinalizeView

func (s ShardMultiView) FinalizeView(hashToFinalize common.Hash) error

forward final view to specific view Instant finality: Beacon chain will forward to expected final view. Shard chain will forward to shard view that beacon confirm need to check if it is still compatible with best view

func (ShardMultiView) GetAllViewsWithBFS

func (s ShardMultiView) GetAllViewsWithBFS() []View

func (ShardMultiView) GetBestView

func (s ShardMultiView) GetBestView() View

func (ShardMultiView) GetExpectedFinalView

func (s ShardMultiView) GetExpectedFinalView() View

func (ShardMultiView) GetFinalView

func (s ShardMultiView) GetFinalView() View

func (ShardMultiView) GetViewByHash

func (s ShardMultiView) GetViewByHash(hash common.Hash) View

func (ShardMultiView) IsInstantFinality

func (s ShardMultiView) IsInstantFinality() bool

func (ShardMultiView) ReplaceBlockIfImproveFinality

func (s ShardMultiView) ReplaceBlockIfImproveFinality(b types.BlockInterface) (bool, error)

for instant finality only 2 usecases, when proposer propose a block, it give - previous block for finality check - consensusData (shard confirm beacon, beacon confirm shard) for making consensus on other chain finality

func (ShardMultiView) Reset

func (s ShardMultiView) Reset()

func (ShardMultiView) RunCleanProcess

func (s ShardMultiView) RunCleanProcess()

func (*ShardMultiView) SimulateAddView

func (s *ShardMultiView) SimulateAddView(view View) MultiView

type View

type View interface {
	CalculateTimeSlot(int64) int64
	GetCurrentTimeSlot() int64
	GetHash() *common.Hash
	GetPreviousHash() *common.Hash
	GetHeight() uint64
	GetCommittee() []incognitokey.CommitteePublicKey
	GetPreviousBlockCommittee(db incdb.Database) ([]incognitokey.CommitteePublicKey, error)
	CommitteeStateVersion() int
	GetBlock() types.BlockInterface
	ReplaceBlock(blk types.BlockInterface)
	GetBeaconHeight() uint64
	GetProposerByTimeSlot(ts int64, version int) (incognitokey.CommitteePublicKey, int)
	GetProposerLength() int
	CompareCommitteeFromBlock(View) int
	PastHalfTimeslot(int64) bool
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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