validator

package
v0.0.0-...-8c7b936 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckBlockHeight

func CheckBlockHeight(tx []byte) uint32

func CheckBlockTimestamp

func CheckBlockTimestamp(tx []byte) int64

func CheckFromShardId

func CheckFromShardId(tx []byte) uint8

Types

type BlockchainState

type BlockchainState struct {
	Database dbm.DB
	Size     int64
	Height   int64
	AppHash  []byte
}

func NewBlockchainState

func NewBlockchainState(name string, dir string) *BlockchainState

type ShardCrosslinkMsg

type ShardCrosslinkMsg struct {
	CL *aq.Queue // queue used to store CrossLink's transactions
}

In the current implementation, we decompose transactions from each CrossLink to ShardCLMsgs for simplicity

type ValidatorInterface

type ValidatorInterface struct {
	BCState              *BlockchainState
	ShardCLMsgs          []ShardCrosslinkMsg // ShardCLMsgs[i].CL contains a list of transactions from consecutive CrossLinks
	ShardCLPool          []ShardCrosslinkMsg
	ShardLastBlockHeight []uint32
	ValidTSRange         [2]int64
	ShardBlockLastTS     []int64
	Leader               bool

	Start_Order bool
	// contains filtered or unexported fields
}

func NewValidatorInterface

func NewValidatorInterface(bcstate *BlockchainState, shard_num uint8, leader bool, in_addr hctypes.HaechiAddress, out_addrs []hctypes.HaechiAddress) *ValidatorInterface

func (*ValidatorInterface) DeliverCallList

func (nw *ValidatorInterface) DeliverCallList(shard_id uint8)

TODO: 1) compress data transmissionk; 2) speed up the formation of CallList

func (*ValidatorInterface) DeliverCallLists

func (nw *ValidatorInterface) DeliverCallLists()

TODO: concurrency control

func (*ValidatorInterface) FormCCLs

func (nw *ValidatorInterface) FormCCLs()

func (*ValidatorInterface) GlobalOrdering

func (nw *ValidatorInterface) GlobalOrdering()

func (*ValidatorInterface) StartOrder

func (nw *ValidatorInterface) StartOrder() bool

func (*ValidatorInterface) UpdateOrderParameters

func (nw *ValidatorInterface) UpdateOrderParameters(blockts int64, shardid uint8, blockheight uint32)

func (*ValidatorInterface) UpdateShardCrosslinkMsgs

func (nw *ValidatorInterface) UpdateShardCrosslinkMsgs(request []byte)

func (*ValidatorInterface) UpdateTimestampRange

func (nw *ValidatorInterface) UpdateTimestampRange()

Jump to

Keyboard shortcuts

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