Documentation ¶
Index ¶
- func NewMultiView() *multiView
- type BeaconMultiView
- func (s *BeaconMultiView) AddView(v View) (int, error)
- func (s BeaconMultiView) ClearBranch()
- func (s BeaconMultiView) Clone() MultiView
- func (s BeaconMultiView) FinalizeView(hashToFinalize common.Hash) error
- func (s BeaconMultiView) GetAllViewsWithBFS() []View
- func (s BeaconMultiView) GetBestView() View
- func (s BeaconMultiView) GetExpectedFinalView() View
- func (s BeaconMultiView) GetFinalView() View
- func (s BeaconMultiView) GetViewByHash(hash common.Hash) View
- func (s BeaconMultiView) IsInstantFinality() bool
- func (s BeaconMultiView) ReplaceBlockIfImproveFinality(b types.BlockInterface) (bool, error)
- func (s BeaconMultiView) Reset()
- func (s BeaconMultiView) RunCleanProcess()
- func (s *BeaconMultiView) SimulateAddView(view View) (cloneMultiview MultiView)
- type MultiView
- type ShardMultiView
- func (s *ShardMultiView) AddView(v View) (res int, err error)
- func (s ShardMultiView) ClearBranch()
- func (s ShardMultiView) Clone() MultiView
- func (s ShardMultiView) FinalizeView(hashToFinalize common.Hash) error
- func (s ShardMultiView) GetAllViewsWithBFS() []View
- func (s ShardMultiView) GetBestView() View
- func (s ShardMultiView) GetExpectedFinalView() View
- func (s ShardMultiView) GetFinalView() View
- func (s ShardMultiView) GetViewByHash(hash common.Hash) View
- func (s ShardMultiView) IsInstantFinality() bool
- func (s ShardMultiView) ReplaceBlockIfImproveFinality(b types.BlockInterface) (bool, error)
- func (s ShardMultiView) Reset()
- func (s ShardMultiView) RunCleanProcess()
- func (s *ShardMultiView) SimulateAddView(view View) MultiView
- type View
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) ClearBranch ¶
func (s BeaconMultiView) ClearBranch()
func (BeaconMultiView) FinalizeView ¶
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 (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) 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) ClearBranch ¶
func (s ShardMultiView) ClearBranch()
func (ShardMultiView) FinalizeView ¶
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 (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) 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 }