blockchain

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: 85 Imported by: 6

Documentation

Index

Constants

View Source
const (
	MAX_COMMITTEE_SIZE_48_FEATURE = "maxcommitteesize48"
	INSTANT_FINALITY_FEATURE      = "instantfinality"
	BLOCKTIME_DEFAULT             = "blocktimedef"
	BLOCKTIME_20                  = "blocktime20"
	BLOCKTIME_10                  = "blocktime10"
	EPOCHV2                       = "epochparamv2"
	INSTANT_FINALITY_FEATURE_V2   = "instantfinalityv2"
	REDUCE_FIX_NODE               = "reduce_fix_node"
	REDUCE_FIX_NODE_V2            = "reduce_fix_node_v2"
	REDUCE_FIX_NODE_V3            = "reduce_fix_node_v3"
	BEACON_STAKING_FLOW_V4        = "beacon_staking_flow_v4"
)
View Source
const (
	// SHARD_BLOCK_VERSION is the current latest supported block version.
	VERSION                            = 1
	RANDOM_NUMBER                      = 3
	SHARD_BLOCK_VERSION                = 1
	DefaultMaxBlkReqPerPeer            = 900
	MinCommitteeSize                   = 3 // min size to run bft
	WorkerNumber                       = 5
	MAX_S2B_BLOCK                      = 30
	MAX_BEACON_BLOCK                   = 20
	LowerBoundPercentForIncDAO         = 3
	UpperBoundPercentForIncDAO         = 10
	TestRandom                         = true
	ValidateTimeForSpamRequestTxs      = 1581565837 // GMT: Thursday, February 13, 2020 3:50:37 AM. From this time, block will be checked spam request-reward tx
	TransactionBatchSize               = 30
	SpareTime                          = 1000             // in mili-second
	DefaultMaxBlockSyncTime            = 30 * time.Second // in second
	NumberOfFixedBeaconBlockValidators = 4
	NumberOfFixedShardBlockValidators  = 4
	Duration                           = 1000000
	MaxSubsetCommittees                = 2

	DEQUEUE_THRESHOLD_PERCENT = 0.5
)
View Source
const (
	UnExpectedError = iota
	UpdateMerkleTreeForBlockError
	UnmashallJsonShardBlockError
	MashallJsonShardBlockError
	UnmashallJsonShardBestStateError
	MashallJsonShardBestStateError
	UnmashallJsonBeaconBlockError
	MashallJsonBeaconBlockError
	UnmashallJsonBeaconBestStateError
	MashallJsonBeaconBestStateError
	MashallJsonError
	CanNotCheckDoubleSpendError
	HashError
	WrongVersionError
	WrongBlockHeightError
	DatabaseError
	EpochError
	WrongTimestampError
	WrongTimeslotError
	InstructionHashError
	ShardStateHashError
	RandomError
	VerificationError
	ShardError
	BeaconError
	SignatureError
	CrossShardBlockError
	CandidateError
	ShardIDError
	ProducerError
	ShardStateError
	TransactionFromNewBlockError
	GenerateInstructionError
	ProcessInstructionFromBeaconError
	SwapError
	DuplicateShardBlockError
	CommitteeOrValidatorError
	ShardBlockSanityError
	StoreIncomingCrossShardError
	DeleteIncomingCrossShardError
	WrongShardIDError
	CloneShardBestStateError
	CloneBeaconBestStateError
	ShardBestStateNotCompatibleError
	RegisterEstimatorFeeError
	FetchPreviousBlockError
	TransactionRootHashError
	ShardTransactionRootHashError
	CrossShardTransactionRootHashError
	FetchBeaconBlocksError
	WrongBlockTotalFeeError
	ShardIntructionFromTransactionAndInstructionError
	InstructionsHashError
	FlattenAndConvertStringInstError
	InstructionMerkleRootError
	FetchBeaconBlockHashError
	FetchBeaconBlockError
	FetchShardBlockError
	BeaconBlockNotCompatibleError
	SwapInstructionError
	TransactionCreatedByMinerError
	ResponsedTransactionWithMetadataError
	UnmashallJsonShardCommitteesError
	MashallJsonShardCommitteesError
	VerifyCrossShardBlockError
	NextCrossShardBlockError
	FetchShardCommitteeError
	CrossTransactionHashError
	VerifyCrossShardCustomTokenError
	ShardCommitteeRootHashError
	ShardPendingValidatorRootHashError
	ShardStakingTxRootHashError
	BeaconCommitteeAndPendingValidatorRootError
	ShardCommitteeAndPendingValidatorRootError
	ShardCandidateRootError
	BeaconCandidateRootError
	StoreShardBlockError
	StoreBestStateError
	FetchAndStoreTransactionError
	FetchAndStoreCrossTransactionError
	RemoveCommitteeRewardError
	StoreBurningConfirmError
	SwapValidatorError
	CrossShardBitMapError
	ShardCommitteeLengthAndCommitteeIndexError
	UpdateBridgeIssuanceStatusError
	BeaconCommitteeLengthAndCommitteeIndexError
	BuildRewardInstructionError
	BuildBridgeError
	BuildBridgeAggError
	GenerateBeaconCommitteeAndValidatorRootError
	GenerateShardCommitteeAndValidatorRootError
	GenerateBeaconCandidateRootError
	GenerateShardCandidateRootError
	GenerateShardStateError
	GenerateShardCommitteeError
	GenerateShardPendingValidatorError
	ProduceSignatureError
	BeaconBestStateBestBlockNotCompatibleError
	BeaconBlockProducerError
	BeaconBlockSignatureError
	WrongEpochError
	GenerateInstructionHashError
	GetShardBlocksForBeaconProcessError
	GetDequeueInstructionError
	ShardStateHeightError
	ShardStateCrossShardBitMapError
	ShardBlockSignatureError
	ShardBestStateBeaconHeightNotCompatibleError
	BeaconBestStateBestShardHeightNotCompatibleError
	ProcessRandomInstructionError
	ProcessSwapInstructionError
	AssignValidatorToShardError
	ShuffleBeaconCandidateError
	CleanBackUpError
	BackUpBestStateError
	StoreBeaconBlockError
	StoreBeaconBlockIndexError
	GetStakingTransactionError
	DecodeHashError
	GetTransactionFromDatabaseError
	ProcessBridgeInstructionError
	UpdateDatabaseWithBlockRewardInfoError
	CreateCrossShardBlockError
	VerifyCrossShardBlockShardTxRootError
	WalletKeySerializedError
	InitSalaryTransactionError
	GetAndCheckBurnError
	RemoveOldDataAfterProcessingError
	WrongMetadataTypeError
	StakeInstructionError
	StoreRewardReceiverByHeightError
	CreateNormalTokenTxForCrossShardError
	SnapshotCommitteeError
	ExtractPublicKeyFromCommitteeKeyListError
	PendingValidatorRootError
	CommitteeHashError
	StakingTxHashError
	StopAutoStakingRequestHashError
	StopAutoStakingMetadataError
	AutoStakingRootHashError
	ShardSyncValidatorHashError
	FetchAllCommitteeValidatorCandidateError
	BackupFromTxViewPointError
	BackupFromCrossTxViewPointError
	BackupDatabaseFromBeaconInstructionError
	SnapshotRewardReceiverError
	StoreAutoStakingByHeightError
	FetchAutoStakingByHeightError
	ProcessSlashingError
	ConvertCommitteePubKeyToBase58Error
	ConsensusIsOngoingError
	RevertStateError
	NotEnoughRewardError
	InitPDETradeResponseTransactionError
	ProcessPDEInstructionError
	ProcessPortalInstructionError
	InitBeaconStateError
	GetListDecryptedOutputCoinsByKeysetError
	GetListDecryptedOutputCoinsV1ByKeysetError
	InitShardStateError
	ProcessSalaryInstructionsError
	GetShardIDFromTxError
	GetValueFromTxError
	ValidateBlockWithPreviousShardBestStateError
	ValidateBlockWithPreviousBeaconBestStateError
	BackUpShardStateError
	BackupCurrentBeaconStateError
	ProcessAutoStakingError
	ProcessPortalRelayingError
	GetTotalLockedCollateralError
	InsertShardBlockError
	GetShardBlockHeightByHashError
	GetShardBlockByHashError
	ResponsedTransactionFromBeaconInstructionsError
	UpgradeBeaconCommitteeStateError
	UpgradeShardCommitteeStateError
	BuildIncurredInstructionError
	ReturnStakingInstructionHandlerError
	CountMissingSignatureError
	ReplacePreviousValidationDataError
	CommitteeFromBlockNotFoundError
	GetListOutputCoinsByKeysetError
	ShardBlockAlreadyExist
	PDEStateDBError
	UpdateBFTV3StatsError
	FinishSyncInstructionError
	OutdatedCodeError
)

Variables

View Source
var BLogger = DeBridgeLogger{}
View Source
var CommitteeFromBlockCache, _ = lru.New(500)

CommitteesByShardID ...

View Source
var (
	EnableIndexingCoinByOTAKey bool
)
View Source
var ErrCodeMessage = map[int]struct {
	Code    int
	message string

}{}/* 179 elements not displayed */
View Source
var Logger = BlockChainLogger{}

Global instant to use

View Source
var SFV3_MinShardCommitteeSize = 8

Network fixed params

Functions

func CalcMerkleRoot

func CalcMerkleRoot(txns []metadata.Transaction) common.Hash

func CalculateNumberOfByteToRead

func CalculateNumberOfByteToRead(amountBytes int) []byte

-------------- Start of Blockchain BackUp And Restore --------------

func CreateCrossShardByteArray

func CreateCrossShardByteArray(txList []metadata.Transaction, fromShardID byte) ([]byte, error)

func CreateGenesisBeaconBlock

func CreateGenesisBeaconBlock() *types.BeaconBlock

func CreateGenesisBlocks

func CreateGenesisBlocks()

func CreateGenesisShardBlock

func CreateGenesisShardBlock() *types.ShardBlock

func CreateMerkleCrossTransaction

func CreateMerkleCrossTransaction(crossTransactions map[byte][]types.CrossTransaction) (*common.Hash, error)

func CreateNewFeatureStatMessage

func CreateNewFeatureStatMessage(beaconView *BeaconBestState, inSyncPool bool, reportFeatures []string, validators []*consensus.Validator) (*wire.MessageFeature, error)

filter validators that is in sync pool ( inSyncPool = true), or in pending&committee (isInPool = false), then create feature stat message

func CreateShardBridgeAggUnshieldActionsFromTxs

func CreateShardBridgeAggUnshieldActionsFromTxs(
	transactions []metadata.Transaction,
	bc *BlockChain, shardID byte,
	shardHeight, beaconHeight uint64,
) ([][]string, error)

CreateShardBridgeAggUnshieldActionsFromTxs create bridge agg unshield insts from transactions in shard block

func CreateShardBridgeUnshieldActionsFromTxs

func CreateShardBridgeUnshieldActionsFromTxs(
	transactions []metadata.Transaction,
	bc *BlockChain, shardID byte,
	shardHeight, beaconHeight uint64,
) ([][]string, error)

CreateShardBridgeUnshieldActionsFromTxs create bridge unshield insts from transactions in shard block

func CreateShardInstructionsFromTransactionAndInstruction

func CreateShardInstructionsFromTransactionAndInstruction(
	transactions []metadata.Transaction,
	bc *BlockChain, shardID byte,
	shardHeight, beaconHeight uint64,
	shouldCollectPdexTxs bool,
) (instructions [][]string, pdexTxs map[uint][]metadata.Transaction, err error)

CreateShardInstructionsFromTransactionAndInstruction create inst from transactions in shard block

func DecodeInstruction

func DecodeInstruction(inst []string) ([]byte, error)

decodeInstruction appends all part of an instruction and decode them if necessary (for special instruction that needed to be decoded before submitting to Ethereum)

func DecryptOutputCoinByKey

func DecryptOutputCoinByKey(transactionStateDB *statedb.StateDB, outCoin privacy.Coin, keySet *incognitokey.KeySet, tokenID *common.Hash, shardID byte) (privacy.PlainCoin, error)

DecryptOutputCoinByKey process outputcoin to get outputcoin data which relate to keyset Param keyset: (private key, payment address, read only key) in case private key: return unspent outputcoin tx in case read only key: return all outputcoin tx with amount value in case payment address: return all outputcoin tx with no amount value

func FetchBeaconBlockFromHeight

func FetchBeaconBlockFromHeight(blockchain *BlockChain, from uint64, to uint64) ([]*types.BeaconBlock, error)

func FilterSigningCommitteeV3

func FilterSigningCommitteeV3(fullCommittees []incognitokey.CommitteePublicKey, proposerIndex int) []incognitokey.CommitteePublicKey

func FilterSigningCommitteeV3StringValue

func FilterSigningCommitteeV3StringValue(fullCommittees []string, proposerIndex int) []string

func FlattenAndConvertStringInst

func FlattenAndConvertStringInst(insts [][]string) ([][]byte, error)

FlattenAndConvertStringInst receives a slice of insts; concats each inst ([]string) and converts to []byte to build merkle tree later

func GetBeaconSwapInstructionKeyListV2

func GetBeaconSwapInstructionKeyListV2(epoch uint64) ([]string, []string)

func GetBlockTimeInterval

func GetBlockTimeInterval(blkTimeFeature string) int64

func GetCoinIndexer

func GetCoinIndexer() *coinIndexer.CoinIndexer

func GetFeeInfo

func GetFeeInfo(md metadata.Metadata, feeEstimator FeeEstimator) (minFeePerKB uint64, minFeePerTx uint64)

func GetFirstBeaconHeightInEpoch

func GetFirstBeaconHeightInEpoch(epoch uint64) uint64

func GetMaxCommitteeSize

func GetMaxCommitteeSize(currentMaxShardCommittee int, triggerFeature map[string]uint64, blkHeight uint64) int

func GetNumberBlkPerYear

func GetNumberBlkPerYear(blkTimeFeature string) uint64

func GetNumberOfByteToRead

func GetNumberOfByteToRead(value []byte) (int, error)

func GetProposer

func GetProposer(
	ts int64, committees []incognitokey.CommitteePublicKey,
	lenProposers int) (incognitokey.CommitteePublicKey, int)

func GetProposerByTimeSlot

func GetProposerByTimeSlot(ts int64, committeeLen int) int

func GetShardSwapInstructionKeyListV2

func GetShardSwapInstructionKeyListV2(epoch uint64, minCommitteeSize int, activeShard int) (map[byte][]string, map[byte][]string)

func GetSubsetID

func GetSubsetID(proposerIndex int) int

func GetSubsetIDByKey

func GetSubsetIDByKey(fullCommittees []incognitokey.CommitteePublicKey, miningKey string, consensusName string) (int, int)

GetSubsetIDByKey compare based on consensus mining key

func GetSubsetIDFromProposerTimeV2

func GetSubsetIDFromProposerTimeV2(proposerTimeSlot int64, validators int) int

TODO

func InitShardCommitteeState

func InitShardCommitteeState(
	version int,
	consensusStateDB *statedb.StateDB,
	shardHeight uint64,
	shardID byte,
	block *types.ShardBlock,
	bc *BlockChain) committeestate.ShardCommitteeState

func NewTxsVerifier

func NewTxsVerifier(
	txDB *statedb.StateDB,
	tp txpool.TxPool,
	whitelist map[string]interface{},
	estimator FeeEstimator,
) txpool.TxVerifier

func NextPowerOfTwo

func NextPowerOfTwo(n int) int

nextPowerOfTwo returns the next highest power of two from a given number if it is not already a power of two. This is a helper function used during the calculation of a merkle tree.

func VerifyMerkleCrossTransaction

func VerifyMerkleCrossTransaction(crossTransactions map[byte][]types.CrossTransaction, rootHash common.Hash) bool

Types

type BackupManager

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

func NewBackupManager

func NewBackupManager(bc *BlockChain) *BackupManager

func (*BackupManager) Backup

func (s *BackupManager) Backup(backupHeight uint64)

func (*BackupManager) GetBackupReader

func (s *BackupManager) GetBackupReader(checkpoint string, cid int) string

func (*BackupManager) GetFileID

func (s *BackupManager) GetFileID(cid int, blockheight uint64) uint64

func (*BackupManager) GetLastestBootstrap

func (s *BackupManager) GetLastestBootstrap() BackupProcessInfo

func (*BackupManager) StartDownload

func (s *BackupManager) StartDownload(checkpoint string)

func (*BackupManager) StopDownload

func (s *BackupManager) StopDownload(checkpoint string)

type BackupProcessInfo

type BackupProcessInfo struct {
	CheckpointName  string
	BeaconView      *BeaconBestState
	ShardView       map[int]*ShardBestState
	MinBeaconHeight uint64
}

type BeaconBestState

type BeaconBestState struct {
	BestBlockHash                    common.Hash          `json:"BestBlockHash"`         // The hash of the block.
	PreviousBestBlockHash            common.Hash          `json:"PreviousBestBlockHash"` // The hash of the block.
	BestBlock                        types.BeaconBlock    `json:"BestBlock"`             // The block.
	BestShardHash                    map[byte]common.Hash `json:"BestShardHash"`
	BestShardHeight                  map[byte]uint64      `json:"BestShardHeight"`
	Epoch                            uint64               `json:"Epoch"`
	BeaconHeight                     uint64               `json:"BeaconHeight"`
	BeaconProposerIndex              int                  `json:"BeaconProposerIndex"`
	CurrentRandomNumber              int64                `json:"CurrentRandomNumber"`
	CurrentRandomTimeStamp           int64                `json:"CurrentRandomTimeStamp"` // random timestamp for this epoch
	IsGetRandomNumber                bool                 `json:"IsGetRandomNumber"`
	MaxBeaconCommitteeSize           int                  `json:"MaxBeaconCommitteeSize"`
	MinBeaconCommitteeSize           int                  `json:"MinBeaconCommitteeSize"`
	MaxShardCommitteeSize            int                  `json:"MaxShardCommitteeSize"`
	MinShardCommitteeSize            int                  `json:"MinShardCommitteeSize"`
	ActiveShards                     int                  `json:"ActiveShards"`
	ConsensusAlgorithm               string               `json:"ConsensusAlgorithm"`
	ShardConsensusAlgorithm          map[byte]string      `json:"ShardConsensusAlgorithm"`
	NumberOfShardBlock               map[byte]uint        `json:"NumberOfShardBlock"`
	TriggeredFeature                 map[string]uint64    `json:"TriggeredFeature"`
	NumberOfFixedShardBlockValidator int                  `json:"NumberOfFixedShardBlockValidator"`
	RewardMinted                     uint64               `json:"RewardMinted"`
	TSManager                        TSManager
	ShardTSManager                   map[byte]*TSManager

	// cross shard state for all the shard. from shardID -> to crossShard shardID -> last height
	// e.g 1 -> 2 -> 3 // shard 1 send cross shard to shard 2 at  height 3
	// e.g 1 -> 3 -> 2 // shard 1 send cross shard to shard 3 at  height 2
	LastCrossShardState map[byte]map[byte]uint64 `json:"LastCrossShardState"`
	ShardHandle         map[byte]bool            `json:"ShardHandle"` // lock sync.RWMutex
	// Number of blocks produced by producers in epoch
	BlockInterval      time.Duration
	BlockMaxCreateTime time.Duration

	ConsensusStateDBRootHash common.Hash

	RewardStateDBRootHash common.Hash

	FeatureStateDBRootHash common.Hash

	SlashStateDBRootHash common.Hash

	LastBlockProcessBridge uint64
	// contains filtered or unexported fields
}

func NewBeaconBestState

func NewBeaconBestState() *BeaconBestState

func NewBeaconBestStateWithConfig

func NewBeaconBestStateWithConfig(beaconCommitteeState committeestate.BeaconCommitteeState) *BeaconBestState

func (*BeaconBestState) BlockHash

func (beaconBestState *BeaconBestState) BlockHash() common.Hash

func (*BeaconBestState) BridgeAggManager

func (beaconBestState *BeaconBestState) BridgeAggManager() *bridgeagg.Manager

func (*BeaconBestState) CalculateDelegationSharePrice

func (bestView *BeaconBestState) CalculateDelegationSharePrice(bc *BlockChain, delegationReward uint64) ([][]string, error)

func (*BeaconBestState) CalculateExpectedTotalBlock

func (b *BeaconBestState) CalculateExpectedTotalBlock(blockVersion int) map[byte]uint

func (*BeaconBestState) CalculateTimeSlot

func (beaconBestState *BeaconBestState) CalculateTimeSlot(t int64) int64

func (*BeaconBestState) CandidateWaitingForNextRandom

func (beaconBestState *BeaconBestState) CandidateWaitingForNextRandom() []incognitokey.CommitteePublicKey

func (*BeaconBestState) CheckCommitteeSize

func (beaconBestState *BeaconBestState) CheckCommitteeSize() error

func (*BeaconBestState) CloneBeaconBestStateFrom

func (beaconBestState *BeaconBestState) CloneBeaconBestStateFrom(target *BeaconBestState) error

func (*BeaconBestState) CommitteeStateVersion

func (beaconBestState *BeaconBestState) CommitteeStateVersion() int

CommitteeStateVersion ...

func (*BeaconBestState) CompareCommitteeFromBlock

func (x *BeaconBestState) CompareCommitteeFromBlock(_y multiview.View) int

func (*BeaconBestState) ExtractAllFinishSyncingValidators

func (beaconBestState *BeaconBestState) ExtractAllFinishSyncingValidators(validatorFromUserKeys []*consensus.Validator) ([]*consensus.Validator, []string)

func (*BeaconBestState) ExtractFinishSyncingValidators

func (beaconBestState *BeaconBestState) ExtractFinishSyncingValidators(validatorFromUserKeys []*consensus.Validator, shardID byte) ([]*consensus.Validator, []string)

func (*BeaconBestState) ExtractPendingAndCommittee

func (beaconBestState *BeaconBestState) ExtractPendingAndCommittee(validatorFromUserKeys []*consensus.Validator) ([]*consensus.Validator, []string)

func (*BeaconBestState) GenerateInstruction

func (curView *BeaconBestState) GenerateInstruction(
	newBeaconHeight uint64,
	shardInstruction *shardInstruction,
	duplicateKeyStakeInstruction *duplicateKeyStakeInstruction,
	bridgeInstructions [][]string,
	acceptedRewardInstructions [][]string,
	blockchain *BlockChain,
	shardsState map[byte][]types.ShardState,
) ([][]string, error)

GenerateInstruction generate instruction for new beacon block

func (*BeaconBestState) GetAShardCommittee

func (beaconBestState *BeaconBestState) GetAShardCommittee(shardID byte) []incognitokey.CommitteePublicKey

func (*BeaconBestState) GetAShardPendingValidator

func (beaconBestState *BeaconBestState) GetAShardPendingValidator(shardID byte) []incognitokey.CommitteePublicKey

func (*BeaconBestState) GetAllBridgeTokens

func (beaconBestState *BeaconBestState) GetAllBridgeTokens() ([]common.Hash, error)

func (*BeaconBestState) GetAllCommitteeValidatorCandidateFlattenListFromDatabase

func (beaconBestState *BeaconBestState) GetAllCommitteeValidatorCandidateFlattenListFromDatabase() ([]string, error)

func (*BeaconBestState) GetAutoStaking

func (beaconBestState *BeaconBestState) GetAutoStaking() map[string]bool

func (*BeaconBestState) GetAutoStakingList

func (beaconBestState *BeaconBestState) GetAutoStakingList() map[string]bool

func (*BeaconBestState) GetBeaconCandidate

func (beaconBestState *BeaconBestState) GetBeaconCandidate() []incognitokey.CommitteePublicKey

func (*BeaconBestState) GetBeaconCandidateUID

func (beaconBestState *BeaconBestState) GetBeaconCandidateUID(candidatePK string) (string, error)

func (*BeaconBestState) GetBeaconCommittee

func (beaconBestState *BeaconBestState) GetBeaconCommittee() []incognitokey.CommitteePublicKey

func (*BeaconBestState) GetBeaconCommitteeState

func (x *BeaconBestState) GetBeaconCommitteeState() committeestate.BeaconCommitteeState

func (*BeaconBestState) GetBeaconConsensusStateDB

func (beaconBestState *BeaconBestState) GetBeaconConsensusStateDB() *statedb.StateDB

func (*BeaconBestState) GetBeaconFeatureStateDB

func (beaconBestState *BeaconBestState) GetBeaconFeatureStateDB() *statedb.StateDB

func (*BeaconBestState) GetBeaconHeight

func (beaconBestState *BeaconBestState) GetBeaconHeight() uint64

func (*BeaconBestState) GetBeaconLocking

func (beaconBestState *BeaconBestState) GetBeaconLocking() []incognitokey.CommitteePublicKey

func (*BeaconBestState) GetBeaconPendingValidator

func (beaconBestState *BeaconBestState) GetBeaconPendingValidator() []incognitokey.CommitteePublicKey

func (*BeaconBestState) GetBeaconRewardStateDB

func (beaconBestState *BeaconBestState) GetBeaconRewardStateDB() *statedb.StateDB

func (*BeaconBestState) GetBeaconSlashStateDB

func (beaconBestState *BeaconBestState) GetBeaconSlashStateDB() *statedb.StateDB

func (*BeaconBestState) GetBeaconStakerInfo

func (beaconBestState *BeaconBestState) GetBeaconStakerInfo(stakerPubkey string) (*statedb.BeaconStakerInfo, bool, error)

func (*BeaconBestState) GetBeaconWaiting

func (beaconBestState *BeaconBestState) GetBeaconWaiting() []incognitokey.CommitteePublicKey

func (*BeaconBestState) GetBestHeightOfShard

func (beaconBestState *BeaconBestState) GetBestHeightOfShard(shardID byte) uint64

func (*BeaconBestState) GetBestShardHash

func (beaconBestState *BeaconBestState) GetBestShardHash() map[byte]common.Hash

func (*BeaconBestState) GetBestShardHeight

func (beaconBestState *BeaconBestState) GetBestShardHeight() map[byte]uint64

func (*BeaconBestState) GetBlock

func (beaconBestState *BeaconBestState) GetBlock() types.BlockInterface

func (*BeaconBestState) GetBlockTime

func (beaconBestState *BeaconBestState) GetBlockTime() int64

func (*BeaconBestState) GetCandidateBeaconWaitingForCurrentRandom

func (beaconBestState *BeaconBestState) GetCandidateBeaconWaitingForCurrentRandom() []incognitokey.CommitteePublicKey

func (*BeaconBestState) GetCandidateBeaconWaitingForNextRandom

func (beaconBestState *BeaconBestState) GetCandidateBeaconWaitingForNextRandom() []incognitokey.CommitteePublicKey

func (*BeaconBestState) GetCandidateShardWaitingForCurrentRandom

func (beaconBestState *BeaconBestState) GetCandidateShardWaitingForCurrentRandom() []incognitokey.CommitteePublicKey

func (*BeaconBestState) GetCandidateShardWaitingForNextRandom

func (beaconBestState *BeaconBestState) GetCandidateShardWaitingForNextRandom() []incognitokey.CommitteePublicKey

func (*BeaconBestState) GetCommittee

func (beaconBestState *BeaconBestState) GetCommittee() []incognitokey.CommitteePublicKey

func (*BeaconBestState) GetCurrentShard

func (beaconBestState *BeaconBestState) GetCurrentShard() byte

func (*BeaconBestState) GetCurrentTimeSlot

func (beaconBestState *BeaconBestState) GetCurrentTimeSlot() int64

func (*BeaconBestState) GetExpectedTotalBlock

func (b *BeaconBestState) GetExpectedTotalBlock(blockVersion int) map[string]uint

func (*BeaconBestState) GetHash

func (beaconBestState *BeaconBestState) GetHash() *common.Hash

func (*BeaconBestState) GetHeight

func (beaconBestState *BeaconBestState) GetHeight() uint64

func (*BeaconBestState) GetMissingSignaturePenalty

func (beaconBestState *BeaconBestState) GetMissingSignaturePenalty() map[string]signaturecounter.Penalty

func (*BeaconBestState) GetNonSlashingCommittee

func (beaconBestState *BeaconBestState) GetNonSlashingCommittee(committees []*statedb.StakerInfoSlashingVersion, epoch uint64, shardID byte) ([]*statedb.StakerInfoSlashingVersion, error)

func (*BeaconBestState) GetNumberOfMissingSignature

func (beaconBestState *BeaconBestState) GetNumberOfMissingSignature() map[string]signaturecounter.MissingSignature

func (*BeaconBestState) GetPreviousBlockCommittee

func (beaconBestState *BeaconBestState) GetPreviousBlockCommittee(db incdb.Database) ([]incognitokey.CommitteePublicKey, error)

func (*BeaconBestState) GetPreviousHash

func (beaconBestState *BeaconBestState) GetPreviousHash() *common.Hash

func (*BeaconBestState) GetProducerIndexFromBlock

func (beaconBestState *BeaconBestState) GetProducerIndexFromBlock(block *types.BeaconBlock) int

func (*BeaconBestState) GetProposerByTimeSlot

func (beaconBestState *BeaconBestState) GetProposerByTimeSlot(
	ts int64,
	version int,
) (incognitokey.CommitteePublicKey, int)

func (*BeaconBestState) GetProposerLength

func (curView *BeaconBestState) GetProposerLength() int

func (*BeaconBestState) GetRewardReceiver

func (beaconBestState *BeaconBestState) GetRewardReceiver() map[string]privacy.PaymentAddress

func (*BeaconBestState) GetShardCandidate

func (beaconBestState *BeaconBestState) GetShardCandidate() []incognitokey.CommitteePublicKey

func (*BeaconBestState) GetShardCommittee

func (beaconBestState *BeaconBestState) GetShardCommittee() (res map[byte][]incognitokey.CommitteePublicKey)

func (*BeaconBestState) GetShardCommitteeFlattenList

func (beaconBestState *BeaconBestState) GetShardCommitteeFlattenList() []string

func (*BeaconBestState) GetShardConsensusAlgorithm

func (beaconBestState *BeaconBestState) GetShardConsensusAlgorithm() map[byte]string

func (*BeaconBestState) GetShardPendingFlattenList

func (beaconBestState *BeaconBestState) GetShardPendingFlattenList() []string

func (*BeaconBestState) GetShardPendingValidator

func (beaconBestState *BeaconBestState) GetShardPendingValidator() (res map[byte][]incognitokey.CommitteePublicKey)

func (*BeaconBestState) GetShardProposerLength

func (curView *BeaconBestState) GetShardProposerLength() int

func (*BeaconBestState) GetStakerInfo

func (beaconBestState *BeaconBestState) GetStakerInfo(stakerPubkey string) (*statedb.StakerInfo, bool, error)

GetStakerInfo : Return staker info from statedb

func (*BeaconBestState) GetStakingTx

func (beaconBestState *BeaconBestState) GetStakingTx() map[string]common.Hash

func (*BeaconBestState) GetSyncingValidators

func (beaconBestState *BeaconBestState) GetSyncingValidators() map[byte][]incognitokey.CommitteePublicKey

func (*BeaconBestState) GetSyncingValidatorsString

func (beaconBestState *BeaconBestState) GetSyncingValidatorsString() map[byte][]string

func (*BeaconBestState) GetValidStakers

func (beaconBestState *BeaconBestState) GetValidStakers(stakers []string) []string

func (*BeaconBestState) Hash

func (beaconBestState *BeaconBestState) Hash() common.Hash

func (*BeaconBestState) InitStateRootHash

func (beaconBestState *BeaconBestState) InitStateRootHash(bc *BlockChain) error

func (*BeaconBestState) IsValidMintNftRequireAmount

func (beaconBestState *BeaconBestState) IsValidMintNftRequireAmount(db incdb.Database, pdexv3StateCached interface{}, amount uint64) error

func (*BeaconBestState) IsValidNftID

func (beaconBestState *BeaconBestState) IsValidNftID(db incdb.Database, pdexv3StateCached interface{}, nftID string) error

func (*BeaconBestState) IsValidPdexv3ShareAmount

func (beaconBestState *BeaconBestState) IsValidPdexv3ShareAmount(db incdb.Database, pdexv3StateCached interface{}, poolPairID, nftID string, shareAmount uint64) error

func (*BeaconBestState) IsValidPdexv3StakingPool

func (beaconBestState *BeaconBestState) IsValidPdexv3StakingPool(db incdb.Database, pdexv3StateCached interface{}, tokenID string) error

func (*BeaconBestState) IsValidPdexv3UnstakingAmount

func (beaconBestState *BeaconBestState) IsValidPdexv3UnstakingAmount(db incdb.Database, pdexv3StateCached interface{}, tokenID, nftID string, unstakingAmount uint64) error

func (*BeaconBestState) IsValidPoolPairID

func (beaconBestState *BeaconBestState) IsValidPoolPairID(db incdb.Database, pdexv3StateCached interface{}, poolPairID string) error

func (*BeaconBestState) MarshalJSON

func (beaconBestState *BeaconBestState) MarshalJSON() ([]byte, error)

func (BeaconBestState) NewBeaconCommitteeStateEnvironment

func (beaconBestState BeaconBestState) NewBeaconCommitteeStateEnvironment() *committeestate.BeaconCommitteeStateEnvironment

func (BeaconBestState) NewBeaconCommitteeStateEnvironmentWithValue

func (beaconBestState BeaconBestState) NewBeaconCommitteeStateEnvironmentWithValue(
	bc *BlockChain,
	header types.BeaconHeader,
	beaconInstructions [][]string,
	isFoundRandomInstruction bool,
	isBeaconRandomTime bool,
) *committeestate.BeaconCommitteeStateEnvironment

func (*BeaconBestState) PastHalfTimeslot

func (beaconBestState *BeaconBestState) PastHalfTimeslot(t int64) bool

func (*BeaconBestState) PdeState

func (beaconBestState *BeaconBestState) PdeState(version uint) pdex.State

func (*BeaconBestState) ReplaceBlock

func (beaconBestState *BeaconBestState) ReplaceBlock(replaceBlock types.BlockInterface)

func (*BeaconBestState) RestoreBeaconViewStateFromHash

func (beaconBestState *BeaconBestState) RestoreBeaconViewStateFromHash(
	blockchain *BlockChain, includeCommittee, includePdexv3, includeBridgeAgg bool,
) error

RestoreBeaconViewStateFromHash ...

func (*BeaconBestState) SetBestShardHeight

func (beaconBestState *BeaconBestState) SetBestShardHeight(shardID byte, height uint64)

func (*BeaconBestState) SetMaxBeaconCommitteeSize

func (beaconBestState *BeaconBestState) SetMaxBeaconCommitteeSize(maxBeaconCommitteeSize int) bool

func (*BeaconBestState) SetMaxShardCommitteeSize

func (beaconBestState *BeaconBestState) SetMaxShardCommitteeSize(maxShardCommitteeSize int) bool

func (*BeaconBestState) SetMinBeaconCommitteeSize

func (beaconBestState *BeaconBestState) SetMinBeaconCommitteeSize(minBeaconCommitteeSize int) bool

func (*BeaconBestState) SetMinShardCommitteeSize

func (beaconBestState *BeaconBestState) SetMinShardCommitteeSize(minShardCommitteeSize int) bool

func (*BeaconBestState) SetMissingSignatureCounter

func (curView *BeaconBestState) SetMissingSignatureCounter(missingSignatureCounter signaturecounter.IMissingSignatureCounter)

func (*BeaconBestState) UpdateLastCrossShardState

func (beaconBestState *BeaconBestState) UpdateLastCrossShardState(shardStates map[byte][]types.ShardState)

type BeaconChain

type BeaconChain struct {
	BlockGen     *BlockGenerator
	Blockchain   *BlockChain
	BlockStorage *BlockStorage

	ChainName string
	Ready     bool //when has peerstate
	// contains filtered or unexported fields
}

func NewBeaconChain

func NewBeaconChain(multiView multiview.MultiView, blockGen *BlockGenerator, blockchain *BlockChain, chainName string) *BeaconChain

func (*BeaconChain) BestViewCommitteeFromBlock

func (chain *BeaconChain) BestViewCommitteeFromBlock() common.Hash

BestViewCommitteeFromBlock ...

func (*BeaconChain) CheckExistedBlk

func (chain *BeaconChain) CheckExistedBlk(block types.BlockInterface) bool

func (*BeaconChain) CloneMultiView

func (chain *BeaconChain) CloneMultiView() multiview.MultiView

func (*BeaconChain) CollectTxs

func (chain *BeaconChain) CollectTxs(view multiview.View)

func (*BeaconChain) CommitteeEngineVersion

func (chain *BeaconChain) CommitteeEngineVersion() int

func (*BeaconChain) CommitteeStateVersion

func (chain *BeaconChain) CommitteeStateVersion() int

func (*BeaconChain) CommitteesFromViewHashForShard

func (chain *BeaconChain) CommitteesFromViewHashForShard(hash common.Hash, shardID byte) ([]incognitokey.CommitteePublicKey, error)

func (*BeaconChain) CreateNewBlock

func (chain *BeaconChain) CreateNewBlock(
	version int, proposer string, round int, startTime int64,
	committees []incognitokey.CommitteePublicKey,
	committeeViewHash common.Hash,
) (types.BlockInterface, error)

func (*BeaconChain) CreateNewBlockFromOldBlock

func (chain *BeaconChain) CreateNewBlockFromOldBlock(oldBlock types.BlockInterface, proposer string, startTime int64, isValidRePropose bool) (types.BlockInterface, error)

this function for version 2

func (*BeaconChain) CurrentHeight

func (chain *BeaconChain) CurrentHeight() uint64

func (*BeaconChain) FinalView

func (chain *BeaconChain) FinalView() multiview.View

func (*BeaconChain) GetActiveShardNumber

func (chain *BeaconChain) GetActiveShardNumber() int

func (*BeaconChain) GetAllCommittees

func (chain *BeaconChain) GetAllCommittees() map[string]map[string][]incognitokey.CommitteePublicKey

func (*BeaconChain) GetAllView

func (chain *BeaconChain) GetAllView() []multiview.View

func (*BeaconChain) GetAllViewHash

func (chain *BeaconChain) GetAllViewHash() (res []common.Hash)

func (*BeaconChain) GetBeaconPendingList

func (chain *BeaconChain) GetBeaconPendingList() []incognitokey.CommitteePublicKey

func (*BeaconChain) GetBeaconWaitingList

func (chain *BeaconChain) GetBeaconWaitingList() []incognitokey.CommitteePublicKey

func (*BeaconChain) GetBestView

func (chain *BeaconChain) GetBestView() multiview.View

func (*BeaconChain) GetBestViewHash

func (s *BeaconChain) GetBestViewHash() string

func (*BeaconChain) GetBestViewHeight

func (s *BeaconChain) GetBestViewHeight() uint64

func (*BeaconChain) GetBlockByHash

func (chain *BeaconChain) GetBlockByHash(hash common.Hash) (types.BlockInterface, error)

func (*BeaconChain) GetBlockConsensusData

func (chain *BeaconChain) GetBlockConsensusData() map[int]types.BlockConsensusData

this get consensus data for all latest shard state

func (*BeaconChain) GetChainDatabase

func (chain *BeaconChain) GetChainDatabase() incdb.Database

func (*BeaconChain) GetChainName

func (chain *BeaconChain) GetChainName() string

func (*BeaconChain) GetCommittee

func (chain *BeaconChain) GetCommittee() []incognitokey.CommitteePublicKey

func (*BeaconChain) GetCommitteeByHash

func (chain *BeaconChain) GetCommitteeByHash(blockHash common.Hash, blockHeight uint64) ([]incognitokey.CommitteePublicKey, error)

func (*BeaconChain) GetCommitteeByHeight

func (chain *BeaconChain) GetCommitteeByHeight(h uint64) ([]incognitokey.CommitteePublicKey, error)

func (*BeaconChain) GetCommitteeForSync

func (chain *BeaconChain) GetCommitteeForSync(block types.BlockInterface) ([]incognitokey.CommitteePublicKey, error)

func (*BeaconChain) GetCommitteeSize

func (chain *BeaconChain) GetCommitteeSize() int

func (*BeaconChain) GetConsensusType

func (chain *BeaconChain) GetConsensusType() string

func (*BeaconChain) GetCurrentCrossShardHeightToShard

func (s *BeaconChain) GetCurrentCrossShardHeightToShard(sid byte) map[byte]uint64

func (*BeaconChain) GetDatabase

func (chain *BeaconChain) GetDatabase() incdb.Database

func (*BeaconChain) GetEpoch

func (s *BeaconChain) GetEpoch() uint64

func (*BeaconChain) GetFinalView

func (chain *BeaconChain) GetFinalView() multiview.View

func (*BeaconChain) GetFinalViewHash

func (s *BeaconChain) GetFinalViewHash() string

func (*BeaconChain) GetFinalViewHeight

func (s *BeaconChain) GetFinalViewHeight() uint64

func (*BeaconChain) GetFinalViewState

func (chain *BeaconChain) GetFinalViewState() *BeaconBestState

func (*BeaconChain) GetLastBlockTimeStamp

func (chain *BeaconChain) GetLastBlockTimeStamp() int64

func (*BeaconChain) GetLastCommittee

func (chain *BeaconChain) GetLastCommittee() []incognitokey.CommitteePublicKey

func (*BeaconChain) GetLastProposerIndex

func (chain *BeaconChain) GetLastProposerIndex() int

func (*BeaconChain) GetMaxBlkCreateTime

func (chain *BeaconChain) GetMaxBlkCreateTime() time.Duration

func (*BeaconChain) GetMinBlkInterval

func (chain *BeaconChain) GetMinBlkInterval() time.Duration

func (*BeaconChain) GetMultiView

func (chain *BeaconChain) GetMultiView() multiview.MultiView

func (*BeaconChain) GetNumberOfFixedNode

func (chain *BeaconChain) GetNumberOfFixedNode(
	blockHeight uint64,
) int

func (*BeaconChain) GetPendingCommittee

func (chain *BeaconChain) GetPendingCommittee() []incognitokey.CommitteePublicKey

func (*BeaconChain) GetPortalParamsV4

func (chain *BeaconChain) GetPortalParamsV4(beaconHeight uint64) portalv4.PortalParams

func (*BeaconChain) GetProposerByTimeSlotFromCommitteeList

func (chain *BeaconChain) GetProposerByTimeSlotFromCommitteeList(ts int64, committees []incognitokey.CommitteePublicKey) (incognitokey.CommitteePublicKey, int)

func (*BeaconChain) GetPubKeyCommitteeIndex

func (chain *BeaconChain) GetPubKeyCommitteeIndex(pubkey string) int

func (*BeaconChain) GetShardBestViewHash

func (s *BeaconChain) GetShardBestViewHash() map[byte]common.Hash

func (*BeaconChain) GetShardBestViewHeight

func (s *BeaconChain) GetShardBestViewHeight() map[byte]uint64

func (*BeaconChain) GetShardID

func (chain *BeaconChain) GetShardID() int

func (*BeaconChain) GetShardsPendingList

func (chain *BeaconChain) GetShardsPendingList() map[string]map[string][]incognitokey.CommitteePublicKey

func (*BeaconChain) GetShardsWaitingList

func (chain *BeaconChain) GetShardsWaitingList() []incognitokey.CommitteePublicKey

func (*BeaconChain) GetSigningCommittees

func (chain *BeaconChain) GetSigningCommittees(
	proposerIndex int,
	committees []incognitokey.CommitteePublicKey,
	blockVersion int,
) []incognitokey.CommitteePublicKey

func (*BeaconChain) GetSyncingValidators

func (chain *BeaconChain) GetSyncingValidators() map[byte][]incognitokey.CommitteePublicKey

func (*BeaconChain) GetViewByHash

func (chain *BeaconChain) GetViewByHash(hash common.Hash) multiview.View

func (*BeaconChain) GetWaitingCommittee

func (chain *BeaconChain) GetWaitingCommittee() []incognitokey.CommitteePublicKey

func (*BeaconChain) InsertAndBroadcastBlock

func (chain *BeaconChain) InsertAndBroadcastBlock(block types.BlockInterface) error

func (*BeaconChain) InsertAndBroadcastBlockWithPrevValidationData

func (chain *BeaconChain) InsertAndBroadcastBlockWithPrevValidationData(block types.BlockInterface, s string) error

func (*BeaconChain) InsertBlock

func (chain *BeaconChain) InsertBlock(block types.BlockInterface, shouldValidate bool) error

TODO: change name

func (*BeaconChain) InsertWithPrevValidationData

func (chain *BeaconChain) InsertWithPrevValidationData(types.BlockInterface, string) error

func (*BeaconChain) IsBeaconChain

func (chain *BeaconChain) IsBeaconChain() bool

func (*BeaconChain) IsReady

func (chain *BeaconChain) IsReady() bool

func (*BeaconChain) ReplacePreviousValidationData

func (chain *BeaconChain) ReplacePreviousValidationData(previousBlockHash common.Hash, previousProposeHash common.Hash, previousCommittees []incognitokey.CommitteePublicKey, newValidationData string) error

this is call when create new block

func (*BeaconChain) SetMultiView

func (chain *BeaconChain) SetMultiView(multiView multiview.MultiView)

func (*BeaconChain) SetReady

func (chain *BeaconChain) SetReady(ready bool)

func (*BeaconChain) StoreFinalityProof

func (chain *BeaconChain) StoreFinalityProof(block types.BlockInterface, finalityProof interface{}, reProposeSig interface{}) error

func (*BeaconChain) UnmarshalBlock

func (chain *BeaconChain) UnmarshalBlock(blockString []byte) (types.BlockInterface, error)

func (*BeaconChain) ValidateBlockSignatures

func (chain *BeaconChain) ValidateBlockSignatures(block types.BlockInterface, committees []incognitokey.CommitteePublicKey, numOfFixNode int) error

func (*BeaconChain) ValidatePreSignBlock

func (chain *BeaconChain) ValidatePreSignBlock(block types.BlockInterface, signingCommittees, committees []incognitokey.CommitteePublicKey) error

type BeaconRootHash

type BeaconRootHash struct {
	ConsensusStateDBRootHash common.Hash
	FeatureStateDBRootHash   common.Hash
	RewardStateDBRootHash    common.Hash
	SlashStateDBRootHash     common.Hash
}

func GetBeaconRootsHashByBlockHash

func GetBeaconRootsHashByBlockHash(db incdb.Database, hash common.Hash) (*BeaconRootHash, error)

type BlockChain

type BlockChain struct {
	BeaconChain *BeaconChain
	ShardChain  []*ShardChain

	IsTest        bool
	BackupManager *BackupManager
	// contains filtered or unexported fields
}

func NewBlockChain

func NewBlockChain(config *Config, isTest bool) *BlockChain

func (*BlockChain) AddFinishedSyncValidators

func (blockchain *BlockChain) AddFinishedSyncValidators(committeePublicKeys []string, signatures [][]byte, shardID byte)

AddFinishedSyncValidators add finishedSyncValidators from message to all current beacon views

func (*BlockChain) AddRelayShard

func (s *BlockChain) AddRelayShard(sid int) error

func (*BlockChain) AddTempTxPool

func (blockchain *BlockChain) AddTempTxPool(temptxpool TxPool)

func (*BlockChain) AddTxPool

func (blockchain *BlockChain) AddTxPool(txpool TxPool)

func (*BlockChain) BackupBeaconChain

func (blockchain *BlockChain) BackupBeaconChain(writer io.Writer) error

func (*BlockChain) BackupBeaconViews

func (blockchain *BlockChain) BackupBeaconViews(db incdb.KeyValueWriter, multiView multiview.MultiView) error

TODO: current implement: backup all view data Optimize: backup view -> backup view hash instead of view restore: get view from hash and create new view, then insert into multiview

Backup all BeaconView into Database

func (*BlockChain) BackupShardChain

func (blockchain *BlockChain) BackupShardChain(writer io.Writer, shardID byte) error

func (*BlockChain) BackupShardViews

func (blockchain *BlockChain) BackupShardViews(db incdb.KeyValueWriter, shardID byte, simulatedMultiView multiview.MultiView) error

Backup shard views

func (*BlockChain) BuildResponseTransactionFromTxsWithMetadata

func (blockchain *BlockChain) BuildResponseTransactionFromTxsWithMetadata(view *ShardBestState, transactions []metadata.Transaction, blkProducerPrivateKey *privacy.PrivateKey, shardID byte) ([]metadata.Transaction, error)

@Notice: change from body.Transaction -> transactions

func (*BlockChain) CalculateMintedPRVWithDefaultBlocktime

func (bc *BlockChain) CalculateMintedPRVWithDefaultBlocktime(shardHeights map[byte]uint64) uint64

func (*BlockChain) CheckBlockTimeIsReached

func (blockchain *BlockChain) CheckBlockTimeIsReached(recentBeaconHeight, beaconHeight, recentShardHeight, shardHeight uint64, duration time.Duration) bool

convertDurationTimeToBeaconBlocks returns number of beacon blocks corresponding to duration time

func (*BlockChain) CheckBlockTimeIsReachedByBeaconHeight

func (blockchain *BlockChain) CheckBlockTimeIsReachedByBeaconHeight(recentBeaconHeight, beaconHeight uint64, duration time.Duration) bool

func (*BlockChain) CreateAndSaveCrossTransactionViewPointFromBlock

func (blockchain *BlockChain) CreateAndSaveCrossTransactionViewPointFromBlock(shardBlock *types.ShardBlock, transactionStateRoot *statedb.StateDB) error

func (*BlockChain) CreateAndSaveTxViewPointFromBlock

func (blockchain *BlockChain) CreateAndSaveTxViewPointFromBlock(shardBlock *types.ShardBlock, transactionStateRoot *statedb.StateDB) error

CreateAndSaveTxViewPointFromBlock - fetch data from block, put into txviewpoint variable and save into db still storage full data of commitments, serial number, snderivator to check double spend this function only work for transaction transfer token/prv within shard

func (*BlockChain) FetchConfirmBeaconBlockByHeight

func (s *BlockChain) FetchConfirmBeaconBlockByHeight(height uint64) (*types.BeaconBlock, error)

func (*BlockChain) FetchNextCrossShard

func (s *BlockChain) FetchNextCrossShard(fromSID, toSID int, currentHeight uint64) *NextCrossShardInfo

func (*BlockChain) GenerateBeaconBlockBody

func (blockchain *BlockChain) GenerateBeaconBlockBody(
	newBeaconBlock *types.BeaconBlock,
	curView *BeaconBestState,
	portalParams portal.PortalParams,
	allShardBlocks map[byte][]*types.ShardBlock,
) ([][]string, map[byte][]types.ShardState, error)

GenerateBeaconBlockBody generate beacon instructions and shard states

func (*BlockChain) GetActiveShardNumber

func (blockchain *BlockChain) GetActiveShardNumber() int

func (*BlockChain) GetAllBridgeTokens

func (blockchain *BlockChain) GetAllBridgeTokens() ([]common.Hash, []*rawdbv2.BridgeTokenInfo, error)

func (*BlockChain) GetAllBridgeTokensByHeight

func (blockchain *BlockChain) GetAllBridgeTokensByHeight(height uint64) ([]common.Hash, []*rawdbv2.BridgeTokenInfo, error)

func (*BlockChain) GetAllCommitteeStakeInfo

func (bc *BlockChain) GetAllCommitteeStakeInfo(epoch uint64) (map[int][]*statedb.StakerInfo, error)

func (*BlockChain) GetAllCommitteeStakeInfoSlashingVersion

func (bc *BlockChain) GetAllCommitteeStakeInfoSlashingVersion(epoch uint64) (map[int][]*statedb.StakerInfoSlashingVersion, error)

func (*BlockChain) GetAllOutputCoinsByKeyset

func (blockchain *BlockChain) GetAllOutputCoinsByKeyset(keyset *incognitokey.KeySet, shardID byte, tokenID *common.Hash, withVersion1 bool) ([]privacy.PlainCoin, []privacy.Coin, error)

GetAllOutputCoinsByKeyset retrieves and tries to decrypt all output coins of a key-set.

Any coins that failed to decrypt are returned as privacy.Coin

func (*BlockChain) GetAllTokenBalancesV1

func (blockchain *BlockChain) GetAllTokenBalancesV1(keySet *incognitokey.KeySet) (map[string]uint64, error)

GetAllTokenBalancesV1 returns the balance v1 of all tokens.

func (*BlockChain) GetAllTokenBalancesV2

func (blockchain *BlockChain) GetAllTokenBalancesV2(keySet *incognitokey.KeySet) (map[string]uint64, error)

GetAllTokenBalancesV2 returns the balance v2 of all tokens.

func (*BlockChain) GetBNBChainID

func (blockchain *BlockChain) GetBNBChainID() string

func (*BlockChain) GetBNBDataHash

func (blockchain *BlockChain) GetBNBDataHash(
	blockHeight int64,
) ([]byte, error)

GetBNBDataHash calls RPC to fullnode bnb to get bnb data hash in header

func (*BlockChain) GetBNBHeader

func (blockchain *BlockChain) GetBNBHeader(
	blockHeight int64,
) (*types.Header, error)

GetBNBHeader calls RPC to fullnode bnb to get bnb header by block height

func (*BlockChain) GetBNBHeaderChain

func (blockchain *BlockChain) GetBNBHeaderChain() *bnbrelaying.BNBChainState

func (*BlockChain) GetBTCChainID

func (blockchain *BlockChain) GetBTCChainID() string

func (*BlockChain) GetBTCChainParams

func (blockchain *BlockChain) GetBTCChainParams() *chaincfg.Params

func (*BlockChain) GetBTCHeaderChain

func (blockchain *BlockChain) GetBTCHeaderChain() *btcrelaying.BlockChain

func (*BlockChain) GetBasicRewardByVersion

func (blockchain *BlockChain) GetBasicRewardByVersion(version int) (uint64, error)

func (*BlockChain) GetBeaconBestState

func (bc *BlockChain) GetBeaconBestState() *BeaconBestState

func (*BlockChain) GetBeaconBlockByHash

func (blockchain *BlockChain) GetBeaconBlockByHash(beaconBlockHash common.Hash) (*types.BeaconBlock, uint64, error)

func (*BlockChain) GetBeaconBlockByHashWithLatestValidationData

func (blockchain *BlockChain) GetBeaconBlockByHashWithLatestValidationData(beaconBlockHash common.Hash) (*types.BeaconBlock, uint64, error)

func (*BlockChain) GetBeaconBlockByHeight

func (blockchain *BlockChain) GetBeaconBlockByHeight(height uint64) ([]*types.BeaconBlock, error)

func (*BlockChain) GetBeaconBlockByHeightV1

func (blockchain *BlockChain) GetBeaconBlockByHeightV1(height uint64) (*types.BeaconBlock, error)

func (*BlockChain) GetBeaconBlockByView

func (blockchain *BlockChain) GetBeaconBlockByView(view multiview.View, height uint64) (*types.BeaconBlock, error)

func (*BlockChain) GetBeaconBlockHashByHeight

func (blockchain *BlockChain) GetBeaconBlockHashByHeight(finalView, bestView multiview.View, height uint64) (*common.Hash, error)

get beacon block hash by height, with current view

func (*BlockChain) GetBeaconBlockHashByView

func (blockchain *BlockChain) GetBeaconBlockHashByView(view multiview.View, height uint64) (*common.Hash, error)

func (*BlockChain) GetBeaconBlockOrderInEpoch

func (bc *BlockChain) GetBeaconBlockOrderInEpoch(beaconHeight uint64) (uint64, uint64)

func (*BlockChain) GetBeaconChainDatabase

func (blockchain *BlockChain) GetBeaconChainDatabase() incdb.Database

func (*BlockChain) GetBeaconCommitteeOfEpoch

func (blockchain *BlockChain) GetBeaconCommitteeOfEpoch(epoch uint64) ([]incognitokey.CommitteePublicKey, error)

func (*BlockChain) GetBeaconConsensusRootHash

func (blockchain *BlockChain) GetBeaconConsensusRootHash(beaconbestState *BeaconBestState, height uint64) (common.Hash, error)

func (*BlockChain) GetBeaconFeatureRootHash

func (blockchain *BlockChain) GetBeaconFeatureRootHash(beaconbestState *BeaconBestState, height uint64) (common.Hash, error)

func (*BlockChain) GetBeaconRootsHash

func (blockchain *BlockChain) GetBeaconRootsHash(height uint64) (*BeaconRootHash, error)

func (*BlockChain) GetBeaconRootsHashFromBlockHeight

func (blockchain *BlockChain) GetBeaconRootsHashFromBlockHeight(height uint64) (*BeaconRootHash, error)

func (*BlockChain) GetBeaconSharePriceByEpoch

func (blockchain *BlockChain) GetBeaconSharePriceByEpoch(epoch uint64, uid string) (uint64, error)

func (*BlockChain) GetBeaconViewStateDataFromBlockHash

func (blockchain *BlockChain) GetBeaconViewStateDataFromBlockHash(
	blockHash common.Hash, includeCommittee, includePdexv3, includeBridgeAgg bool,
) (*BeaconBestState, error)

func (*BlockChain) GetBestStateBeaconFeatureStateDB

func (blockchain *BlockChain) GetBestStateBeaconFeatureStateDB() *statedb.StateDB

func (*BlockChain) GetBestStateBeaconFeatureStateDBByHeight

func (blockchain *BlockChain) GetBestStateBeaconFeatureStateDBByHeight(height uint64, db incdb.Database) (*statedb.StateDB, error)

func (*BlockChain) GetBestStateShard

func (blockchain *BlockChain) GetBestStateShard(shardID byte) *ShardBestState

func (*BlockChain) GetBestStateShardRewardStateDB

func (blockchain *BlockChain) GetBestStateShardRewardStateDB(shardID byte) *statedb.StateDB

func (*BlockChain) GetBestStateTransactionStateDB

func (blockchain *BlockChain) GetBestStateTransactionStateDB(shardID byte) *statedb.StateDB

func (*BlockChain) GetBlockByHash

func (bc *BlockChain) GetBlockByHash(
	blkType proto.BlkType,
	hash *common.Hash,
	fromcID byte,
	tocID byte,
) (
	interface{},
	error,
)

func (*BlockChain) GetBlockByHeight

func (bc *BlockChain) GetBlockByHeight(
	blkType proto.BlkType,
	height uint64,
	fromcID byte,
	tocID byte,
) (
	interface{},
	error,
)

func (*BlockChain) GetBlockTimeByBlockVersion

func (blockchain *BlockChain) GetBlockTimeByBlockVersion(blkVersion int) (int64, error)

func (*BlockChain) GetBurningAddress

func (blockchain *BlockChain) GetBurningAddress(beaconHeight uint64) string

func (*BlockChain) GetCentralizedWebsitePaymentAddress

func (blockchain *BlockChain) GetCentralizedWebsitePaymentAddress(beaconHeight uint64) string

func (*BlockChain) GetChain

func (blockchain *BlockChain) GetChain(cid int) common.ChainInterface

func (*BlockChain) GetClonedAShardBestState

func (blockchain *BlockChain) GetClonedAShardBestState(shardID byte) (*ShardBestState, error)

GetReadOnlyShard - return a copy of Shard of BestState

func (*BlockChain) GetClonedAllShardBestState

func (blockchain *BlockChain) GetClonedAllShardBestState() map[byte]*ShardBestState

GetReadOnlyShard - return a copy of Shard of BestState

func (*BlockChain) GetClonedBeaconBestState

func (blockchain *BlockChain) GetClonedBeaconBestState() (*BeaconBestState, error)

func (*BlockChain) GetConfig

func (blockchain *BlockChain) GetConfig() *Config

GetConfig returns blockchain's config

func (*BlockChain) GetCurrentBeaconBlockHeight

func (blockchain *BlockChain) GetCurrentBeaconBlockHeight(shardID byte) uint64

func (*BlockChain) GetCurrentEpochLength

func (bc *BlockChain) GetCurrentEpochLength(beaconHeight uint64) uint64

GetEpochLength return the current length of epoch it depends on current final view height

func (*BlockChain) GetDelegationRewardAmount

func (blockchain *BlockChain) GetDelegationRewardAmount(stateDB *statedb.StateDB, pk privacy.PublicKey) (uint64, error)

func (*BlockChain) GetEpochByHeight

func (bc *BlockChain) GetEpochByHeight(beaconHeight uint64) uint64

func (*BlockChain) GetEpochNextHeight

func (bc *BlockChain) GetEpochNextHeight(beaconHeight uint64) (uint64, bool)

func (*BlockChain) GetFinalBeaconHeight

func (blockchain *BlockChain) GetFinalBeaconHeight() uint64

func (*BlockChain) GetKeySubmissionInfo

func (blockchain *BlockChain) GetKeySubmissionInfo(keyStr string) (int, error)

func (*BlockChain) GetLastBeaconHeightInEpoch

func (bc *BlockChain) GetLastBeaconHeightInEpoch(epoch uint64) uint64

func (*BlockChain) GetLatestBNBBlkHeight

func (blockchain *BlockChain) GetLatestBNBBlkHeight() (int64, error)

GetBNBHeader calls RPC to fullnode bnb to get latest bnb block height

func (*BlockChain) GetListDecryptedOutputCoinsByKeyset

func (blockchain *BlockChain) GetListDecryptedOutputCoinsByKeyset(keyset *incognitokey.KeySet, shardID byte, tokenID *common.Hash, shardHeight uint64) ([]privacy.PlainCoin, []privacy.Coin, uint64, error)

GetListDecryptedOutputCoinsByKeyset - Read all blocks to get txs(not action tx) which can be decrypt by readonly secret key. With private-key, we can check unspent tx by check serialNumber from database - Param #1: keyset - (priv-key, payment-address, readonlykey) in case priv-key: return unspent outputcoin tx in case readonly-key: return all outputcoin tx with amount value in case payment-address: return all outputcoin tx with no amount value - Param #2: coinType - which type of joinsplitdesc(COIN or BOND)

func (*BlockChain) GetListDecryptedOutputCoinsVer1ByKeyset

func (blockchain *BlockChain) GetListDecryptedOutputCoinsVer1ByKeyset(keyset *incognitokey.KeySet, shardID byte, tokenID *common.Hash) ([]privacy.PlainCoin, []privacy.Coin, error)

func (*BlockChain) GetListDecryptedOutputCoinsVer2ByKeyset

func (blockchain *BlockChain) GetListDecryptedOutputCoinsVer2ByKeyset(keyset *incognitokey.KeySet, shardID byte, tokenID *common.Hash, startHeight uint64) ([]privacy.PlainCoin, []privacy.Coin, uint64, error)

func (*BlockChain) GetMinAmountPortalToken

func (blockchain *BlockChain) GetMinAmountPortalToken(tokenIDStr string, beaconHeight uint64, version uint) (uint64, error)

func (*BlockChain) GetPdexv3Cached

func (blockchain *BlockChain) GetPdexv3Cached(blockHash common.Hash) interface{}

func (*BlockChain) GetPoolManager

func (blockchain *BlockChain) GetPoolManager() *txpool.PoolManager

func (*BlockChain) GetPortalETHContractAddrStr

func (blockchain *BlockChain) GetPortalETHContractAddrStr(beaconHeight uint64) string

func (*BlockChain) GetPortalFeederAddress

func (blockchain *BlockChain) GetPortalFeederAddress(beaconHeight uint64) string

func (*BlockChain) GetPortalParams

func (blockchain *BlockChain) GetPortalParams() portal.PortalParams
================== Retriever for portal v3 ==================

GetPortalParams returns portal params in beaconheight

func (*BlockChain) GetPortalParamsV3

func (blockchain *BlockChain) GetPortalParamsV3(beaconHeight uint64) portalv3.PortalParams

func (*BlockChain) GetPortalParamsV4

func (blockchain *BlockChain) GetPortalParamsV4(beaconHeight uint64) portalv4.PortalParams

func (*BlockChain) GetPortalReplacementAddress

func (blockchain *BlockChain) GetPortalReplacementAddress(beaconHeight uint64) string

func (*BlockChain) GetPortalV4GeneralMultiSigAddress

func (blockchain *BlockChain) GetPortalV4GeneralMultiSigAddress(tokenIDStr string, beaconHeight uint64) string

func (*BlockChain) GetPortalV4MinUnshieldAmount

func (blockchain *BlockChain) GetPortalV4MinUnshieldAmount(tokenIDStr string, beaconHeight uint64) uint64

func (*BlockChain) GetPortalV4MultipleTokenAmount

func (blockchain *BlockChain) GetPortalV4MultipleTokenAmount(tokenIDStr string, beaconHeight uint64) uint64

func (*BlockChain) GetPrivacyTokenState

func (blockchain *BlockChain) GetPrivacyTokenState(tokenID common.Hash, shardID byte) (*statedb.TokenState, bool, error)

Check Privacy Custom token ID is existed

func (*BlockChain) GetRandomTimeInEpoch

func (bc *BlockChain) GetRandomTimeInEpoch(epoch uint64) uint64

func (*BlockChain) GetRewardAmount

func (blockchain *BlockChain) GetRewardAmount(shardID byte, shardVersion int, shardHeight uint64) (uint64, error)

func (*BlockChain) GetShardBlockByHash

func (blockchain *BlockChain) GetShardBlockByHash(hash common.Hash) (*types.ShardBlock, uint64, error)

func (*BlockChain) GetShardBlockByHashWithShardID

func (blockchain *BlockChain) GetShardBlockByHashWithShardID(hash common.Hash, shardID byte) (*types.ShardBlock, uint64, error)

func (*BlockChain) GetShardBlockByHeight

func (blockchain *BlockChain) GetShardBlockByHeight(height uint64, shardID byte) (map[common.Hash]*types.ShardBlock, error)

func (*BlockChain) GetShardBlockByHeightV1

func (blockchain *BlockChain) GetShardBlockByHeightV1(height uint64, shardID byte) (*types.ShardBlock, error)

func (*BlockChain) GetShardBlockByView

func (blockchain *BlockChain) GetShardBlockByView(view multiview.View, height uint64, shardID byte) (*types.ShardBlock, error)

func (*BlockChain) GetShardBlockForBeaconProducer

func (blockchain *BlockChain) GetShardBlockForBeaconProducer(bestShardHeights map[byte]uint64) map[byte][]*types.ShardBlock

func (*BlockChain) GetShardBlockForBridge

func (blockchain *BlockChain) GetShardBlockForBridge(from uint64, to common.Hash, newBeaconBlock *types.BeaconBlock, blockShardStates map[byte][]types.ShardState) (map[byte][]*types.ShardBlock, map[uint64]map[byte][]*types.ShardBlock, error)

traverse finalview back to certain block height from beacon chain

func (*BlockChain) GetShardBlockHashByHeight

func (blockchain *BlockChain) GetShardBlockHashByHeight(finalView, bestView multiview.View, height uint64) (*common.Hash, error)

SHARD

func (*BlockChain) GetShardBlockHashByView

func (blockchain *BlockChain) GetShardBlockHashByView(view multiview.View, height uint64) (*common.Hash, error)

func (*BlockChain) GetShardBlockWithLatestValidation

func (blockchain *BlockChain) GetShardBlockWithLatestValidation(height uint64, shardID byte) (*types.ShardBlock, error)

func (*BlockChain) GetShardBlocksForBeaconValidator

func (blockchain *BlockChain) GetShardBlocksForBeaconValidator(allRequiredShardBlockHeight map[byte][]uint64) (map[byte][]*types.ShardBlock, error)

func (*BlockChain) GetShardChainDatabase

func (blockchain *BlockChain) GetShardChainDatabase(shardID byte) incdb.Database

func (*BlockChain) GetShardCommitteeFromBeaconHash

func (blockchain *BlockChain) GetShardCommitteeFromBeaconHash(
	committeeFromBlock common.Hash, shardID byte) ([]incognitokey.CommitteePublicKey, error)

func (*BlockChain) GetShardFeatureStateDB

func (blockchain *BlockChain) GetShardFeatureStateDB(shardID byte) *statedb.StateDB

func (*BlockChain) GetShardFixedNodes

func (blockchain *BlockChain) GetShardFixedNodes() []incognitokey.CommitteePublicKey

func (*BlockChain) GetShardIDs

func (blockchain *BlockChain) GetShardIDs() []int

func (*BlockChain) GetShardRootsHash

func (blockchain *BlockChain) GetShardRootsHash(shardBestState *ShardBestState, shardID byte, height uint64) (*ShardRootHash, error)

func (*BlockChain) GetShardRootsHashFromBlockHeight

func (blockchain *BlockChain) GetShardRootsHashFromBlockHeight(shardID byte, height uint64) (*ShardRootHash, error)

func (*BlockChain) GetShardStakingTx

func (blockchain *BlockChain) GetShardStakingTx(shardID byte, beaconHeight uint64) (map[string]string, error)

func (*BlockChain) GetShardStateFromBlock

func (blockchain *BlockChain) GetShardStateFromBlock(
	curView *BeaconBestState,
	newBeaconHeight uint64,
	shardBlock *types.ShardBlock,
	shardID byte,
	validUnstakePublicKeys map[string]bool,
	validStakePublicKeys []string,
) (map[byte]types.ShardState, *shardInstruction, *duplicateKeyStakeInstruction,
	[]string, [][]string, map[uint][]metadata.Transaction, error)

GetShardStateFromBlock get state (information) from shard-to-beacon block state will be presented as instruction

Return Params:
1. ShardState
2. Stake Instruction
3. Swap Instruction
4. Bridge Instruction
5. Accepted BlockReward Instruction
6. StopAutoStakingInstruction

func (*BlockChain) GetTotalStaker

func (bc *BlockChain) GetTotalStaker() (int, error)

func (*BlockChain) GetTransactionByHash

func (blockchain *BlockChain) GetTransactionByHash(txHash common.Hash) (byte, common.Hash, uint64, int, metadata.Transaction, error)

func (*BlockChain) GetTransactionByHashWithShardID

func (blockchain *BlockChain) GetTransactionByHashWithShardID(txHash common.Hash, shardID byte) (common.Hash, int, metadata.Transaction, error)

func (*BlockChain) GetTransactionHashByReceiver

func (blockchain *BlockChain) GetTransactionHashByReceiver(keySet *incognitokey.KeySet) (map[byte][]common.Hash, error)

GetTransactionHashByReceiver - return list tx id which receiver get from any sender this feature only apply on full node, because full node get all data from all shard

func (*BlockChain) GetTransactionHashByReceiverV2

func (blockchain *BlockChain) GetTransactionHashByReceiverV2(
	keySet *incognitokey.KeySet,
	skip, limit uint,
) (map[byte][]common.Hash, error)

GetTransactionHashByReceiverV2 - return list tx id which a receiver receives from any senders in paging fashion this feature only apply on full node, because full node get all data from all shard

func (*BlockChain) GetTransactionsByHashesWithShardID

func (blockchain *BlockChain) GetTransactionsByHashesWithShardID(
	hashes []common.Hash,
	shardID byte,
) ([]metadata.Transaction, error)

func (*BlockChain) GetWantedShard

func (blockchain *BlockChain) GetWantedShard(isBeaconFullnode bool) map[byte]struct{}

func (*BlockChain) GetWhiteList

func (blockchain *BlockChain) GetWhiteList() (map[string]interface{}, error)

func (*BlockChain) GetYearOfBeacon

func (blockchain *BlockChain) GetYearOfBeacon(blockHeight uint64) (uint64, error)

func (*BlockChain) GetYearOfShard

func (blockchain *BlockChain) GetYearOfShard(sID byte, blockHeight uint64) (uint64, error)

func (*BlockChain) Init

func (blockchain *BlockChain) Init(config *Config) error

Init - init a blockchain view from config

func (*BlockChain) InitChainState

func (blockchain *BlockChain) InitChainState() error

InitChainState attempts to load and initialize the chain state from the database. When the db does not yet contain any chain state, both it and the chain state are initialized to the genesis block.

func (*BlockChain) InitChannelBlockchain

func (blockchain *BlockChain) InitChannelBlockchain(cRemovedTxs chan metadata.Transaction)

func (*BlockChain) InitFeatureStat

func (bc *BlockChain) InitFeatureStat()

func (*BlockChain) InitShardState

func (blockchain *BlockChain) InitShardState(shardID byte) error

// createChainState initializes both the database and the chain state to the // genesis block. This includes creating the necessary buckets and inserting // the genesis block, so it must only be called on an uninitialized database.

func (*BlockChain) InitTxSalaryByCoinID

func (blockchain *BlockChain) InitTxSalaryByCoinID(
	payToAddress *privacy.PaymentAddress,
	amount uint64,
	payByPrivateKey *privacy.PrivateKey,
	transactionStateDB *statedb.StateDB,
	bridgeStateDB *statedb.StateDB,
	meta *metadata.WithDrawRewardResponse,
	coinID common.Hash,
	shardID byte,
) (metadata.Transaction, error)

func (*BlockChain) InsertBeaconBlock

func (blockchain *BlockChain) InsertBeaconBlock(beaconBlock *types.BeaconBlock, shouldValidate bool) error

var bcTmp time.Duration var bcStart time.Time var bcAllTime time.Duration

func (*BlockChain) InsertShardBlock

func (blockchain *BlockChain) InsertShardBlock(shardBlock *types.ShardBlock, shouldValidate bool) error

InsertShardBlock Insert Shard Block into blockchain this block must have full information (complete block)

func (*BlockChain) IsAfterNewZKPCheckPoint

func (blockchain *BlockChain) IsAfterNewZKPCheckPoint(beaconHeight uint64) bool

func (*BlockChain) IsAfterPdexv3CheckPoint

func (blockchain *BlockChain) IsAfterPdexv3CheckPoint(beaconHeight uint64) bool

func (*BlockChain) IsAfterPrivacyV2CheckPoint

func (blockchain *BlockChain) IsAfterPrivacyV2CheckPoint(beaconHeight uint64) bool

func (*BlockChain) IsEnableFeature

func (blockchain *BlockChain) IsEnableFeature(featureFlag string, epoch uint64) bool

func (*BlockChain) IsEqualToRandomTime

func (bc *BlockChain) IsEqualToRandomTime(beaconHeight uint64) bool

func (*BlockChain) IsFirstBeaconHeightInEpoch

func (bc *BlockChain) IsFirstBeaconHeightInEpoch(beaconHeight uint64) bool

func (*BlockChain) IsGreaterThanRandomTime

func (bc *BlockChain) IsGreaterThanRandomTime(beaconHeight uint64) bool

func (*BlockChain) IsLastBeaconHeightInEpoch

func (bc *BlockChain) IsLastBeaconHeightInEpoch(beaconHeight uint64) bool

func (*BlockChain) IsPortalExchangeRateToken

func (blockchain *BlockChain) IsPortalExchangeRateToken(beaconHeight uint64, tokenIDStr string) bool

func (*BlockChain) IsPortalToken

func (blockchain *BlockChain) IsPortalToken(beaconHeight uint64, tokenIDStr string, version uint) (bool, error)

IsPortalToken check tokenIDStr is the valid portal token on portal v3 or not

func (*BlockChain) IsSupportedTokenCollateralV3

func (blockchain *BlockChain) IsSupportedTokenCollateralV3(beaconHeight uint64, externalTokenID string) bool

func (*BlockChain) IsValidPortalRemoteAddress

func (blockchain *BlockChain) IsValidPortalRemoteAddress(
	tokenIDStr string, remoteAddr string, beaconHeight uint64, version uint) (bool, error)

func (*BlockChain) ListAllPrivacyCustomTokenAndPRV

func (blockchain *BlockChain) ListAllPrivacyCustomTokenAndPRV() (map[common.Hash]*statedb.TokenState, error)

func (*BlockChain) ListAllPrivacyCustomTokenAndPRVWithTxs

func (blockchain *BlockChain) ListAllPrivacyCustomTokenAndPRVWithTxs() (map[common.Hash]*statedb.TokenState, error)

func (*BlockChain) ListAllPrivacyCustomTokensAndPRVFromCache

func (blockchain *BlockChain) ListAllPrivacyCustomTokensAndPRVFromCache() map[common.Hash]interface{}

func (*BlockChain) ListPrivacyCustomTokenAndPRVByShardID

func (blockchain *BlockChain) ListPrivacyCustomTokenAndPRVByShardID(shardID byte) (map[common.Hash]*statedb.TokenState, error)

ListCustomToken - return all custom token which existed in network

func (*BlockChain) ListPrivacyCustomTokenAndPRVByShardIDWithTxs

func (blockchain *BlockChain) ListPrivacyCustomTokenAndPRVByShardIDWithTxs(shardID byte) (map[common.Hash]*statedb.TokenState, error)

ListCustomToken - return all custom token which existed in network

func (*BlockChain) ListPrivacyTokenAndBridgeTokenAndPRVByShardID

func (blockchain *BlockChain) ListPrivacyTokenAndBridgeTokenAndPRVByShardID(shardID byte) ([]common.Hash, error)

func (*BlockChain) MintDelegationRewardFromInstructionRequests

func (blockchain *BlockChain) MintDelegationRewardFromInstructionRequests(insts []*instruction.RequestDelegationRewardInstruction, stateDB *statedb.StateDB) ([][]string, error)

func (*BlockChain) NewBlockBeacon

func (blockchain *BlockChain) NewBlockBeacon(
	curView *BeaconBestState,
	version int, proposer string, round int, startTime int64) (*types.BeaconBlock, error)

NewBlockBeacon create new beacon block

func (*BlockChain) NewBlockShard

func (blockchain *BlockChain) NewBlockShard(curView *ShardBestState,
	version int, proposer string, round int, start int64,
	committees []incognitokey.CommitteePublicKey,
	committeeFinalViewHash common.Hash) (*types.ShardBlock, error)

NewBlockShard Create New block Shard:

  1. Identify Beacon State for this Shard Block: Beacon Hash & Beacon Height & Epoch + Get Beacon Block (B) from Beacon Best State (from Beacon Chain of Shard Node) + Beacon Block (B) must have the same epoch With New Shard Block (S): + If Beacon Block (B) have different height previous shard block PS (previous of S) Then Beacon Block (B) epoch greater than Shard Block (S) epoch exact 1 value BUT This only works if Shard Best State have the Beacon Height divisible by epoch + Ex: 1 epoch has 50 block Example 1: shard block with height 10, epoch: 1, beacon block height: 49 then shard block with height 11 must have epoch: 1, beacon block height: must be 49 or 50 Example 2: shard block with height 10, epoch: 1, beacon block height: 50 then shard block with height is 11 can have 2 option: a. epoch: 1, if beacon block height remain 50 b. epoch: 2, and beacon block must in range from 51-100 Can have beacon block with height > 100
  2. Build Shard Block Body: a. Get Cross Transaction from other shard && Build Cross Shard Tx Custom Token Transaction (if exist) b. Get Transactions for New Block c. Process Assign Instructions from Beacon Blocks c. Generate Instructions
  3. Build Shard Block Essential Data for Header
  4. Update Cloned ShardBestState with New Shard Block
  5. Create Root Hash from New Shard Block and updated Clone Shard Beststate Data

func (*BlockChain) PrivacyCustomTokenIDExistedV2

func (blockchain *BlockChain) PrivacyCustomTokenIDExistedV2(tokenID *common.Hash, shardID byte) bool

Check Privacy Custom token ID is existed

func (*BlockChain) PrivacyTokenIDExistedInNetwork

func (blockchain *BlockChain) PrivacyTokenIDExistedInNetwork(curView *BeaconBestState, tokenID common.Hash) (bool, error)

PrivacyTokenIDExistedInNetwork checks if a token has existed in the network by

  1. Checking if it has existed in the beacon database
  2. Checking if it has existed in one of the shard databases

func (BlockChain) RandomCommitmentsAndPublicKeysProcess

func (blockchain BlockChain) RandomCommitmentsAndPublicKeysProcess(numOutputs int, shardID byte, tokenID *common.Hash) ([]uint64, [][]byte, [][]byte, [][]byte, error)

func (BlockChain) RandomCommitmentsProcess

func (blockchain BlockChain) RandomCommitmentsProcess(usableInputCoins []coin.PlainCoin, randNum int, shardID byte, tokenID *common.Hash) (commitmentIndexs []uint64, myCommitmentIndexs []uint64, commitments [][]byte)

func (*BlockChain) ReceiveFeatureReport

func (blockchain *BlockChain) ReceiveFeatureReport(timestamp int, committeePublicKeys []string, signatures [][]byte, features []string)

receive feature report from other node, add to list feature stat if node is

func (*BlockChain) ReloadDatabase

func (blockChain *BlockChain) ReloadDatabase(cid int) (err error)

func (*BlockChain) RemoveRelayShard

func (s *BlockChain) RemoveRelayShard(sid int)

func (*BlockChain) RestoreBeaconViews

func (blockchain *BlockChain) RestoreBeaconViews() error

Restart all BeaconView from Database

func (*BlockChain) RestoreShardViews

func (blockchain *BlockChain) RestoreShardViews(shardID byte) error

Restart all BeaconView from Database

func (*BlockChain) SendFeatureStat

func (bc *BlockChain) SendFeatureStat()

func (*BlockChain) SetFeeEstimator

func (blockchain *BlockChain) SetFeeEstimator(feeEstimator txpool.FeeEstimator, shardID byte)

func (*BlockChain) SetIsBlockGenStarted

func (blockchain *BlockChain) SetIsBlockGenStarted(value bool)

-------------- Start of Blockchain retriever's implementation --------------

func (*BlockChain) StoreCommitmentsFromTxViewPoint

func (blockchain *BlockChain) StoreCommitmentsFromTxViewPoint(stateDB *statedb.StateDB, view TxViewPoint, shardID byte) error

func (*BlockChain) StoreOnetimeAddressesFromTxViewPoint

func (blockchain *BlockChain) StoreOnetimeAddressesFromTxViewPoint(stateDB *statedb.StateDB, view TxViewPoint, shardID byte) error

func (*BlockChain) StoreSNDerivatorsFromTxViewPoint

func (blockchain *BlockChain) StoreSNDerivatorsFromTxViewPoint(stateDB *statedb.StateDB, view TxViewPoint) error

func (*BlockChain) StoreSerialNumbersFromTxViewPoint

func (blockchain *BlockChain) StoreSerialNumbersFromTxViewPoint(stateDB *statedb.StateDB, view TxViewPoint) error

func (*BlockChain) StoreTxByPublicKey

func (blockchain *BlockChain) StoreTxByPublicKey(db incdb.Database, view *TxViewPoint) error

func (*BlockChain) StoreTxBySerialNumber

func (blockchain *BlockChain) StoreTxBySerialNumber(txList []metadata.Transaction, shardID byte) error

func (*BlockChain) StreamBlockByHash

func (bc *BlockChain) StreamBlockByHash(
	fromPool bool,
	req *proto.BlockByHashRequest,
) chan interface{}

func (*BlockChain) StreamBlockByHeight

func (bc *BlockChain) StreamBlockByHeight(
	fromPool bool,
	req *proto.BlockByHeightRequest,
) chan interface{}

func (*BlockChain) SubmitOTAKey

func (blockchain *BlockChain) SubmitOTAKey(otaKey privacy.OTAKey, accessToken string, isReset bool, heightToSyncFrom uint64) error

func (*BlockChain) TryGetAllOutputCoinsByKeyset

func (blockchain *BlockChain) TryGetAllOutputCoinsByKeyset(keyset *incognitokey.KeySet, shardID byte, tokenID *common.Hash, withVersion1 bool) ([]privacy.PlainCoin, error)

TryGetAllOutputCoinsByKeyset gets and decrypts all output coins of a tokenID given the keySet. Any coins that are failed to decrypt are skipped.

func (*BlockChain) UsingNewPool

func (blockchain *BlockChain) UsingNewPool() bool

func (*BlockChain) ValidateMintDRewardTxsFromBeaconInstructions

func (blockchain *BlockChain) ValidateMintDRewardTxsFromBeaconInstructions(
	curView *ShardBestState,
	beaconBlocks []*types.BeaconBlock,
	shardBlock *types.ShardBlock,
	shardID byte,
) error

func (*BlockChain) ValidatePortalRemoteAddresses

func (blockchain *BlockChain) ValidatePortalRemoteAddresses(remoteAddresses map[string]string, beaconHeight uint64, version uint) (bool, error)

Validate portal remote addresses for portal tokens (BTC, BNB)

func (*BlockChain) ValidateResponseTransactionFromBeaconInstructions

func (blockchain *BlockChain) ValidateResponseTransactionFromBeaconInstructions(
	curView *ShardBestState,
	shardBlock *types.ShardBlock,
	beaconBlocks []*types.BeaconBlock,
	shardID byte,
) error

func (*BlockChain) ValidateResponseTransactionFromTxsWithMetadata

func (blockchain *BlockChain) ValidateResponseTransactionFromTxsWithMetadata(shardBlock *types.ShardBlock) error

func (*BlockChain) ValidateReturnStakingTxFromBeaconInstructions

func (blockchain *BlockChain) ValidateReturnStakingTxFromBeaconInstructions(
	curView *ShardBestState,
	beaconBlocks []*types.BeaconBlock,
	shardBlock *types.ShardBlock,
	shardID byte,
) error

func (*BlockChain) VerifyPreSignBeaconBlock

func (blockchain *BlockChain) VerifyPreSignBeaconBlock(beaconBlock *types.BeaconBlock, isPreSign bool) error

VerifyPreSignBeaconBlock should receives block in consensus round It verify validity of this function before sign it This should be verify in the first round of consensus

Step:
1. Verify Pre proccessing data
2. Retrieve beststate for new block, store in local variable
3. Update: process local beststate with new block
4. Verify Post processing: updated local beststate and newblock
Return:
- No error: valid and can be sign
- Error: invalid new block

func (*BlockChain) VerifyPreSignShardBlock

func (blockchain *BlockChain) VerifyPreSignShardBlock(
	shardBlock *types.ShardBlock,
	signingCommittees []incognitokey.CommitteePublicKey,
	committees []incognitokey.CommitteePublicKey,
	shardID byte,
) error

VerifyPreSignShardBlock Verify Shard Block Before Signing Used for PBFT consensus this block doesn't have full information (incomplete block)

func (*BlockChain) WhiteListTx

func (blockchain *BlockChain) WhiteListTx() map[string]bool

type BlockChainError

type BlockChainError struct {
	Code    int
	Message string
	// contains filtered or unexported fields
}

func NewBlockChainError

func NewBlockChainError(key int, err error) *BlockChainError

func (BlockChainError) Error

func (e BlockChainError) Error() string

type BlockChainLogger

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

func (*BlockChainLogger) Init

func (self *BlockChainLogger) Init(inst common.Logger)

type BlockGenerator

type BlockGenerator struct {
	CQuit       chan struct{}
	CPendingTxs <-chan metadata.Transaction
	CRemovedTxs <-chan metadata.Transaction
	PendingTxs  map[common.Hash]metadata.Transaction
	// contains filtered or unexported fields
}

func NewBlockGenerator

func NewBlockGenerator(txPool TxPool, chain *BlockChain, syncker Syncker, cPendingTxs chan metadata.Transaction, cRemovedTxs chan metadata.Transaction) (*BlockGenerator, error)

func (*BlockGenerator) AddTransactionV2

func (blockGenerator *BlockGenerator) AddTransactionV2(tx metadata.Transaction)

func (*BlockGenerator) AddTransactionV2Worker

func (blockGenerator *BlockGenerator) AddTransactionV2Worker(cPendingTx <-chan metadata.Transaction)

func (*BlockGenerator) GetPendingTxsV2

func (blockGenerator *BlockGenerator) GetPendingTxsV2(shardID byte) []metadata.Transaction

func (*BlockGenerator) RemoveTransactionV2

func (blockGenerator *BlockGenerator) RemoveTransactionV2(tx metadata.Transaction)

func (*BlockGenerator) RemoveTransactionV2Worker

func (blockGenerator *BlockGenerator) RemoveTransactionV2Worker(cRemoveTx <-chan metadata.Transaction)

func (*BlockGenerator) Start

func (blockGenerator *BlockGenerator) Start(cQuit chan struct{})

type BlockStorage

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

func NewBlockStorage

func NewBlockStorage(db incdb.Database, ffPath string, cid int, useFF bool) *BlockStorage

func (*BlockStorage) ChangeMainDir

func (s *BlockStorage) ChangeMainDir(tmpDir, mainDir string) error

func (*BlockStorage) GetBeaconConfirmShardBlockByHeight

func (s *BlockStorage) GetBeaconConfirmShardBlockByHeight(shardID byte, height uint64) (*common.Hash, error)

func (*BlockStorage) GetBlock

func (s *BlockStorage) GetBlock(blkHash common.Hash) (types.BlockInterface, int, error)

func (*BlockStorage) GetBlockWithLatestValidationData

func (s *BlockStorage) GetBlockWithLatestValidationData(hash common.Hash) (types.BlockInterface, int, error)

func (*BlockStorage) GetFinalizedBeaconBlock

func (s *BlockStorage) GetFinalizedBeaconBlock(index uint64) (*common.Hash, error)

func (*BlockStorage) GetFinalizedShardBlockHashByIndex

func (s *BlockStorage) GetFinalizedShardBlockHashByIndex(index uint64) (*common.Hash, error)

func (*BlockStorage) GetStakingTx

func (s *BlockStorage) GetStakingTx(hash common.Hash) (metadata.Transaction, error)

func (*BlockStorage) GetTXIndex

func (s *BlockStorage) GetTXIndex(tx common.Hash) (common.Hash, int, error)

func (*BlockStorage) IsExisted

func (s *BlockStorage) IsExisted(blkHash common.Hash) bool

func (*BlockStorage) ReplaceBlock

func (s *BlockStorage) ReplaceBlock(blk types.BlockInterface) error

func (*BlockStorage) StoreBeaconConfirmShardBlockByHeight

func (s *BlockStorage) StoreBeaconConfirmShardBlockByHeight(shardID byte, height uint64, hash common.Hash) error

func (*BlockStorage) StoreBlock

func (s *BlockStorage) StoreBlock(blk types.BlockInterface) error

func (*BlockStorage) StoreFinalizedBeaconBlock

func (s *BlockStorage) StoreFinalizedBeaconBlock(index uint64, hash common.Hash) error

func (*BlockStorage) StoreFinalizedShardBlock

func (s *BlockStorage) StoreFinalizedShardBlock(index uint64, hash common.Hash) error

func (*BlockStorage) StoreTXIndex

func (s *BlockStorage) StoreTXIndex(blk *types.ShardBlock) error

func (*BlockStorage) Truncate

func (s *BlockStorage) Truncate() error

type BootstrapManager

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

func NewBootstrapManager

func NewBootstrapManager(hosts []string, bc *BlockChain) *BootstrapManager

func (*BootstrapManager) BootstrapBeacon

func (s *BootstrapManager) BootstrapBeacon()

func (*BootstrapManager) BootstrapShard

func (s *BootstrapManager) BootstrapShard(sid int, force bool)

type BurningReqAction

type BurningReqAction struct {
	Meta          metadataBridge.BurningPRVRequest `json:"meta"`
	RequestedTxID *common.Hash                     `json:"RequestedTxID"`
}

type CheckpointInfo

type CheckpointInfo struct {
	Hash   string
	Height int64
}

type Config

type Config struct {
	BTCChain      *btcrelaying.BlockChain
	BNBChainState *bnbrelaying.BNBChainState
	DataBase      map[int]incdb.Database
	MemCache      *memcache.MemoryCache
	Interrupt     <-chan struct{}
	RelayShards   []byte
	// NodeMode          string
	BlockGen          *BlockGenerator
	TxPool            TxPool
	TempTxPool        TxPool
	CRemovedTxs       chan metadata.Transaction
	FeeEstimator      map[byte]FeeEstimator
	IsBlockGenStarted bool
	PubSubManager     Pubsub
	Syncker           Syncker
	Server            Server
	ConsensusEngine   ConsensusEngine
	Highway           Highway
	OutCoinByOTAKeyDb *incdb.Database
	IndexerWorkers    int64
	IndexerToken      string
	PoolManager       *txpool.PoolManager
	// contains filtered or unexported fields
}

Config is a descriptor which specifies the blockchain instblockchain/beaconstatefulinsts.goance configuration.

type ConsensusEngine

type ConsensusEngine interface {
	ValidateProducerPosition(blk types.BlockInterface, lastProposerIdx int, committee []incognitokey.CommitteePublicKey, minCommitteeSize int, produceTimeSlot int64, proposeTimeSlot int64) error
	ValidateProducerSig(block types.BlockInterface, consensusType string) error
	ValidateBlockCommitteSig(block types.BlockInterface, committee []incognitokey.CommitteePublicKey, numFixNode int) error
	GetCurrentMiningPublicKey() (string, string)
	GetAllMiningPublicKeys() []string
	ExtractBridgeValidationData(block types.BlockInterface) ([][]byte, []int, error)
	ExtractPortalV4ValidationData(block types.BlockInterface) ([]*portalprocessv4.PortalSig, error)
	GetAllValidatorKeyState() map[string]consensus.MiningState
	GetUserRole() (string, string, int)
	GetValidators() []*consensus.Validator
}

type DeBridgeLogger

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

func (*DeBridgeLogger) Init

func (self *DeBridgeLogger) Init(inst common.Logger)

type ErrMsg

type ErrMsg struct {
	Code       int
	Message    string
	StackTrace string
}

type FeatureReportInfo

type FeatureReportInfo struct {
	ValidatorStat map[string]map[int]uint64 // feature -> shardid -> stat
	CommitteeStat map[string]map[int]uint64 // feature -> shardid -> stat
	ValidatorSize map[int]int               // chainid -> all validator size
}

type FeatureStat

type FeatureStat struct {
	// contains filtered or unexported fields
}
var DefaultFeatureStat *FeatureStat

func (*FeatureStat) IsContainLatestFeature

func (stat *FeatureStat) IsContainLatestFeature(curView *BeaconBestState, cpk string) bool

contain all trigger & untrigger feature

func (*FeatureStat) ReceiveMsg

func (stat *FeatureStat) ReceiveMsg(msg *wire.MessageFeature)

func (*FeatureStat) Report

func (stat *FeatureStat) Report(beaconView *BeaconBestState) FeatureReportInfo

type FeeEstimator

type FeeEstimator interface {
	RegisterBlock(block *types.ShardBlock) error
	EstimateFee(numBlocks uint64, tokenId *common.Hash) (uint64, error)
	GetLimitFeeForNativeToken() uint64
	GetMinFeePerTx() uint64
	GetSpecifiedFeeTx() uint64
	GetSpecifiedFeePerKBType2() uint64
	GetSpecifiedFeePerTxType2() uint64
}

type FileObject

type FileObject struct {
	Name string
	Size uint64
}

type Highway

type Highway interface {
	BroadcastCommittee(uint64, []incognitokey.CommitteePublicKey, map[byte][]incognitokey.CommitteePublicKey, map[byte][]incognitokey.CommitteePublicKey)
	GetConnectionStatus() interface{}
}

type IncProof

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

type IncProofInterface

type IncProofInterface interface {
	FindConfirmInst(insts [][]string, txID *common.Hash) ([]string, int)
	FindBeaconBlockWithConfirmInst(beaconBlocks []*types.BeaconBlock, inst []string) (*types.BeaconBlock, int)
	ConvertInstToBytes(inst []string) ([]byte, error)
}

func NewIncProof

func NewIncProof(metaType int) IncProofInterface

type Merkle

type Merkle struct {
}

func (Merkle) BuildMerkleTreeOfHashes

func (merkle Merkle) BuildMerkleTreeOfHashes(shardsHash []*common.Hash, length int) []*common.Hash

func (Merkle) BuildMerkleTreeOfHashes2

func (merkle Merkle) BuildMerkleTreeOfHashes2(shardsHashes []common.Hash, length int) []common.Hash

func (Merkle) BuildMerkleTreeStore

func (merkle Merkle) BuildMerkleTreeStore(transactions []metadata.Transaction) []*common.Hash

BuildMerkleTreeStore creates a merkle tree from a slice of transactions, stores it using a linear array, and returns a slice of the backing array. A linear array was chosen as opposed to an actual tree structure since it uses about half as much memory. The following describes a merkle tree and how it is stored in a linear array.

A merkle tree is a tree in which every non-leaf node is the hash of its children nodes. A diagram depicting how this works for Incognito transactions where h(x) is a double sha256 follows:

         root = h1234 = h(h12 + h34)
        /                           \
  h12 = h(h1 + h2)            h34 = h(h3 + h4)
   /            \              /            \
h1 = h(tx1)  h2 = h(tx2)    h3 = h(tx3)  h4 = h(tx4)

The above stored as a linear array is as follows:

[h1 h2 h3 h4 h12 h34 root]

As the above shows, the merkle root is always the last element in the array.

The number of inputs is not always a power of two which results in a balanced tree structure as above. In that case, parent nodes with no children are also zero and parent nodes with only a single left node are calculated by concatenating the left node with itself before hashing. Since this function uses nodes that are pointers to the hashes, empty nodes will be nil.

The additional bool parameter indicates if we are generating the merkle tree using witness transaction id's rather than regular transaction id's. This also presents an additional case wherein the wtxid of the salary transaction is the zeroHash.

func (Merkle) GetMerklePathForCrossShard

func (merkle Merkle) GetMerklePathForCrossShard(length int, merkleTree []common.Hash, shardID byte) (merklePathShard []common.Hash, merkleShardRoot common.Hash)

func (Merkle) VerifyMerkleRootFromMerklePath

func (merkle Merkle) VerifyMerkleRootFromMerklePath(leaf common.Hash, merklePath []common.Hash, merkleRoot common.Hash, receiverShardID byte) bool

func (Merkle) VerifyMerkleRootOfHashes

func (merkle Merkle) VerifyMerkleRootOfHashes(merkleTree []*common.Hash, merkleRoot *common.Hash, length int) bool

func (Merkle) VerifyMerkleRootOfHashes2

func (merkle Merkle) VerifyMerkleRootOfHashes2(merkleTree []common.Hash, merkleRoot common.Hash, length int) bool

type NextCrossShardInfo

type NextCrossShardInfo struct {
	NextCrossShardHeight uint64
	NextCrossShardHash   string
	ConfirmBeaconHeight  uint64
	ConfirmBeaconHash    string
}

type NodeFeatureInfo

type NodeFeatureInfo struct {
	Features  []string
	Timestamp int
}

type PortalWithdrawCollateralProof

type PortalWithdrawCollateralProof struct {
	*IncProof
}

func (PortalWithdrawCollateralProof) ConvertInstToBytes

func (withdrawProof PortalWithdrawCollateralProof) ConvertInstToBytes(inst []string) ([]byte, error)

func (PortalWithdrawCollateralProof) FindBeaconBlockWithConfirmInst

func (withdrawProof PortalWithdrawCollateralProof) FindBeaconBlockWithConfirmInst(beaconBlocks []*types.BeaconBlock, inst []string) (*types.BeaconBlock, int)

FindBeaconBlockWithConfirmInst finds a beacon block with a specific incognito instruction and the instruction's index; nil if not found

func (PortalWithdrawCollateralProof) FindConfirmInst

func (withdrawProof PortalWithdrawCollateralProof) FindConfirmInst(insts [][]string, txID *common.Hash) ([]string, int)

FindConfirmInst finds a specific instruction in a list, returns it along with its index

type PreFetchContext

type PreFetchContext struct {
	context.Context
	NumTxRemain int64
	MaxTime     time.Duration
	MaxSize     uint64
	// contains filtered or unexported fields
}

func NewPreFetchContext

func NewPreFetchContext() *PreFetchContext

func (*PreFetchContext) DecreaseNumTXRemain

func (s *PreFetchContext) DecreaseNumTXRemain()

func (*PreFetchContext) GetMaxSize

func (s *PreFetchContext) GetMaxSize() uint64

func (*PreFetchContext) GetMaxTime

func (s *PreFetchContext) GetMaxTime() time.Duration

func (*PreFetchContext) GetNumTxRemain

func (s *PreFetchContext) GetNumTxRemain() int64

func (*PreFetchContext) IsRunning

func (s *PreFetchContext) IsRunning() bool

type PreFetchTx

type PreFetchTx struct {
	BlockChain   *BlockChain
	BestView     *ShardBestState
	BeaconBlocks []*types.BeaconBlock
	ResponseTxs  map[common.Hash]metadata.Transaction
	CollectedTxs map[common.Hash]metadata.Transaction
	Error        string
	WgStop       *sync.WaitGroup
	Ctx          *PreFetchContext
}

func (*PreFetchTx) GetTxForBlockProducing

func (s *PreFetchTx) GetTxForBlockProducing() []metadata.Transaction

get response tx and mempool tx

func (*PreFetchTx) Reset

func (s *PreFetchTx) Reset(view *ShardBestState)

call whenever there is new view

func (*PreFetchTx) Start

func (s *PreFetchTx) Start(curView *ShardBestState)

call when next timeslot is proposer => prepare tx

func (*PreFetchTx) Stop

func (s *PreFetchTx) Stop()

call when start propose block

type Pubsub

type Pubsub interface {
	PublishMessage(message *pubsub.Message)
}

type Server

type Server interface {
	PushBlockToAll(block types.BlockInterface, previousValidationData string, isBeacon bool) error
	PushMessageToBeacon(msg wire.Message, exclusivePeerIDs map[libp2p.ID]bool) error
	RequestMissingViewViaStream(peerID string, hashes [][]byte, fromCID int, chainName string) (err error)
	InsertNewShardView(*ShardBestState)
}

type ShardBestState

type ShardBestState struct {
	BestBlockHash                    common.Hash       `json:"BestBlockHash"` // hash of block.
	BestBlock                        *types.ShardBlock `json:"BestBlock"`     // block data
	BestBeaconHash                   common.Hash       `json:"BestBeaconHash"`
	BeaconHeight                     uint64            `json:"BeaconHeight"`
	ShardID                          byte              `json:"ShardID"`
	Epoch                            uint64            `json:"Epoch"`
	ShardHeight                      uint64            `json:"ShardHeight"`
	MaxShardCommitteeSize            int               `json:"MaxShardCommitteeSize"`
	MinShardCommitteeSize            int               `json:"MinShardCommitteeSize"`
	NumberOfFixedShardBlockValidator int               `json:"NumberOfFixedValidator"`
	ShardProposerIdx                 int               `json:"ShardProposerIdx"`
	BestCrossShard                   map[byte]uint64   `json:"BestCrossShard"`         // Best cross shard block by heigh
	NumTxns                          uint64            `json:"NumTxns"`                // The number of txns in the block.
	TotalTxns                        uint64            `json:"TotalTxns"`              // The total number of txns in the chain.
	TotalTxnsExcludeSalary           uint64            `json:"TotalTxnsExcludeSalary"` // for testing and benchmark
	ActiveShards                     int               `json:"ActiveShards"`
	ConsensusAlgorithm               string            `json:"ConsensusAlgorithm"`

	TriggeredFeature map[string]uint64 `json:"TriggeredFeature"`
	// Number of blocks produced by producers in epoch
	NumOfBlocksByProducers  map[string]uint64 `json:"NumOfBlocksByProducers"`
	BlockInterval           time.Duration
	BlockMaxCreateTime      time.Duration
	MetricBlockHeight       uint64
	MaxTxsPerBlockRemainder int64
	TSManager               TSManager

	ConsensusStateDBRootHash common.Hash

	TransactionStateDBRootHash common.Hash

	FeatureStateDBRootHash common.Hash

	RewardStateDBRootHash common.Hash

	SlashStateDBRootHash common.Hash
	// contains filtered or unexported fields
}

func NewBestStateShardWithConfig

func NewBestStateShardWithConfig(shardID byte, shardCommitteeState committeestate.ShardCommitteeState) *ShardBestState

func NewShardBestState

func NewShardBestState() *ShardBestState

func NewShardBestStateWithShardID

func NewShardBestStateWithShardID(shardID byte) *ShardBestState

func (*ShardBestState) CalculateTimeSlot

func (shardBestState *ShardBestState) CalculateTimeSlot(t int64) int64

func (*ShardBestState) CommitteeFromBlock

func (shardBestState *ShardBestState) CommitteeFromBlock() common.Hash

func (*ShardBestState) CommitteeStateVersion

func (shardBestState *ShardBestState) CommitteeStateVersion() int

CommitteeEngineVersion ...

func (*ShardBestState) CompareCommitteeFromBlock

func (x *ShardBestState) CompareCommitteeFromBlock(_y multiview.View) int

func (ShardBestState) GetBeaconHash

func (shardBestState ShardBestState) GetBeaconHash() common.Hash

func (ShardBestState) GetBeaconHeight

func (shardBestState ShardBestState) GetBeaconHeight() uint64

func (*ShardBestState) GetBlock

func (shardBestState *ShardBestState) GetBlock() types.BlockInterface

func (*ShardBestState) GetBlockTime

func (shardBestState *ShardBestState) GetBlockTime() int64

func (*ShardBestState) GetBlockVersion

func (shardBestState *ShardBestState) GetBlockVersion() int

func (*ShardBestState) GetBytes

func (shardBestState *ShardBestState) GetBytes() []byte

Get role of a public key base on best state shard

func (*ShardBestState) GetCommittee

func (shardBestState *ShardBestState) GetCommittee() []incognitokey.CommitteePublicKey

func (*ShardBestState) GetCopiedConsensusStateDB

func (shardBestState *ShardBestState) GetCopiedConsensusStateDB() *statedb.StateDB

func (*ShardBestState) GetCopiedFeatureStateDB

func (shardBestState *ShardBestState) GetCopiedFeatureStateDB() *statedb.StateDB

func (*ShardBestState) GetCopiedTransactionStateDB

func (shardBestState *ShardBestState) GetCopiedTransactionStateDB() *statedb.StateDB

func (*ShardBestState) GetCurrentTimeSlot

func (shardBestState *ShardBestState) GetCurrentTimeSlot() int64

func (*ShardBestState) GetEpoch

func (shardBestState *ShardBestState) GetEpoch() uint64

func (*ShardBestState) GetHash

func (shardBestState *ShardBestState) GetHash() *common.Hash

func (*ShardBestState) GetHeight

func (shardBestState *ShardBestState) GetHeight() uint64

func (*ShardBestState) GetPreviousBlockCommittee

func (shardBestState *ShardBestState) GetPreviousBlockCommittee(db incdb.Database) ([]incognitokey.CommitteePublicKey, error)

func (*ShardBestState) GetPreviousHash

func (shardBestState *ShardBestState) GetPreviousHash() *common.Hash

func (*ShardBestState) GetProposerByTimeSlot

func (shardBestState *ShardBestState) GetProposerByTimeSlot(
	ts int64,
	version int,
) (incognitokey.CommitteePublicKey, int)

GetProposerByTimeSlot return proposer by timeslot from current committee of shard view

func (*ShardBestState) GetProposerLength

func (curView *ShardBestState) GetProposerLength() int

func (*ShardBestState) GetShardCommittee

func (shardBestState *ShardBestState) GetShardCommittee() []incognitokey.CommitteePublicKey

func (ShardBestState) GetShardHeight

func (shardBestState ShardBestState) GetShardHeight() uint64

func (ShardBestState) GetShardID

func (shardBestState ShardBestState) GetShardID() byte

func (*ShardBestState) GetShardPendingValidator

func (shardBestState *ShardBestState) GetShardPendingValidator() []incognitokey.CommitteePublicKey

func (*ShardBestState) GetShardRewardStateDB

func (shardBestState *ShardBestState) GetShardRewardStateDB() *statedb.StateDB

func (*ShardBestState) GetStakingTx

func (shardBestState *ShardBestState) GetStakingTx() map[string]string

func (*ShardBestState) GetTriggeredFeature

func (shardBestState *ShardBestState) GetTriggeredFeature() map[string]uint64

func (*ShardBestState) Hash

func (shardBestState *ShardBestState) Hash() common.Hash

func (*ShardBestState) InitStateRootHash

func (shardBestState *ShardBestState) InitStateRootHash(db incdb.Database) error

func (*ShardBestState) ListShardPrivacyTokenAndPRV

func (shardBestState *ShardBestState) ListShardPrivacyTokenAndPRV() []common.Hash

func (*ShardBestState) MarshalJSON

func (shardBestState *ShardBestState) MarshalJSON() ([]byte, error)

MarshalJSON - remember to use lock

func (*ShardBestState) NewShardCommitteeStateEnvironmentWithValue

func (shardBestState *ShardBestState) NewShardCommitteeStateEnvironmentWithValue(
	shardBlock *types.ShardBlock,
	bc *BlockChain,
	beaconInstructions [][]string,
	tempCommittees []string,
	genesisBeaconHash common.Hash) *committeestate.ShardCommitteeStateEnvironment

func (*ShardBestState) PastHalfTimeslot

func (shardBestState *ShardBestState) PastHalfTimeslot(t int64) bool

func (*ShardBestState) ReplaceBlock

func (shardBestState *ShardBestState) ReplaceBlock(replaceBlock types.BlockInterface)

func (*ShardBestState) SetMaxShardCommitteeSize

func (shardBestState *ShardBestState) SetMaxShardCommitteeSize(maxShardCommitteeSize int) bool

func (*ShardBestState) SetMinShardCommitteeSize

func (shardBestState *ShardBestState) SetMinShardCommitteeSize(minShardCommitteeSize int) bool

func (*ShardBestState) SetTransactonDB

func (shardBestState *ShardBestState) SetTransactonDB(h common.Hash, txDB *statedb.StateDB)

for test only

func (*ShardBestState) ShardCommitteeEngine

func (shardBestState *ShardBestState) ShardCommitteeEngine() committeestate.ShardCommitteeState

ShardCommitteeEngine : getter of shardCommitteeState ...

type ShardChain

type ShardChain struct {
	BlockGen     *BlockGenerator
	Blockchain   *BlockChain
	BlockStorage *BlockStorage

	ChainName string
	Ready     bool

	TxPool      txpool.TxPool
	TxsVerifier txpool.TxVerifier

	PreFetchTx *PreFetchTx
	// contains filtered or unexported fields
}

func NewShardChain

func NewShardChain(
	shardID int,
	multiView multiview.MultiView,
	blockGen *BlockGenerator,
	blockchain *BlockChain,
	chainName string,
	tp txpool.TxPool,
	tv txpool.TxVerifier,
) *ShardChain

func (*ShardChain) AddView

func (chain *ShardChain) AddView(view multiview.View) bool

func (*ShardChain) BestViewCommitteeFromBlock

func (chain *ShardChain) BestViewCommitteeFromBlock() common.Hash

BestViewCommitteeFromBlock ...

func (*ShardChain) CheckExistedBlk

func (chain *ShardChain) CheckExistedBlk(block types.BlockInterface) bool

func (*ShardChain) CloneMultiView

func (chain *ShardChain) CloneMultiView() multiview.MultiView

func (*ShardChain) CollectTxs

func (chain *ShardChain) CollectTxs(view multiview.View)

func (*ShardChain) CommitteeEngineVersion

func (chain *ShardChain) CommitteeEngineVersion() int

func (*ShardChain) CommitteeStateVersion

func (chain *ShardChain) CommitteeStateVersion() int

func (*ShardChain) CreateNewBlock

func (chain *ShardChain) CreateNewBlock(
	version int, proposer string, round int, startTime int64,
	committees []incognitokey.CommitteePublicKey,
	committeeViewHash common.Hash) (types.BlockInterface, error)

func (*ShardChain) CreateNewBlockFromOldBlock

func (chain *ShardChain) CreateNewBlockFromOldBlock(oldBlock types.BlockInterface, proposer string, startTime int64, isValidRePropose bool) (types.BlockInterface, error)

func (*ShardChain) CurrentHeight

func (chain *ShardChain) CurrentHeight() uint64

func (*ShardChain) GetActiveShardNumber

func (chain *ShardChain) GetActiveShardNumber() int

func (*ShardChain) GetAllView

func (chain *ShardChain) GetAllView() []multiview.View

func (*ShardChain) GetAllViewHash

func (s *ShardChain) GetAllViewHash() (res []common.Hash)

func (*ShardChain) GetBestState

func (chain *ShardChain) GetBestState() *ShardBestState

func (*ShardChain) GetBestView

func (chain *ShardChain) GetBestView() multiview.View

func (*ShardChain) GetBestViewHash

func (s *ShardChain) GetBestViewHash() string

func (*ShardChain) GetBestViewHeight

func (s *ShardChain) GetBestViewHeight() uint64

func (*ShardChain) GetBlockByHash

func (chain *ShardChain) GetBlockByHash(hash common.Hash) (types.BlockInterface, error)

func (*ShardChain) GetBlockConsensusData

func (chain *ShardChain) GetBlockConsensusData() map[int]types.BlockConsensusData

this get consensus data for beacon

func (*ShardChain) GetChainDatabase

func (chain *ShardChain) GetChainDatabase() incdb.Database

func (*ShardChain) GetChainName

func (chain *ShardChain) GetChainName() string

func (*ShardChain) GetCommittee

func (chain *ShardChain) GetCommittee() []incognitokey.CommitteePublicKey

func (*ShardChain) GetCommitteeByHeight

func (chain *ShardChain) GetCommitteeByHeight(h uint64) ([]incognitokey.CommitteePublicKey, error)

func (*ShardChain) GetCommitteeForSync

func (chain *ShardChain) GetCommitteeForSync(block types.BlockInterface) ([]incognitokey.CommitteePublicKey, error)

CommitteesV2 get committees by block for shardChain Input block must be ShardBlock

func (*ShardChain) GetCommitteeSize

func (chain *ShardChain) GetCommitteeSize() int

func (*ShardChain) GetConsensusType

func (chain *ShardChain) GetConsensusType() string

func (*ShardChain) GetCrossShardState

func (s *ShardChain) GetCrossShardState() map[byte]uint64

func (*ShardChain) GetDatabase

func (chain *ShardChain) GetDatabase() incdb.Database

func (*ShardChain) GetEpoch

func (s *ShardChain) GetEpoch() uint64

func (*ShardChain) GetFinalView

func (chain *ShardChain) GetFinalView() multiview.View

func (*ShardChain) GetFinalViewHash

func (s *ShardChain) GetFinalViewHash() string

func (*ShardChain) GetFinalViewHeight

func (s *ShardChain) GetFinalViewHeight() uint64

func (*ShardChain) GetFinalityProof

func (chain *ShardChain) GetFinalityProof(hash common.Hash) (*types.ShardBlock, map[string]interface{}, error)

func (*ShardChain) GetInsertLock

func (chain *ShardChain) GetInsertLock() *sync.Mutex

func (*ShardChain) GetLastBlockTimeStamp

func (chain *ShardChain) GetLastBlockTimeStamp() int64

func (*ShardChain) GetLastCommittee

func (chain *ShardChain) GetLastCommittee() []incognitokey.CommitteePublicKey

func (*ShardChain) GetLastProposerIndex

func (chain *ShardChain) GetLastProposerIndex() int

func (*ShardChain) GetMaxBlkCreateTime

func (chain *ShardChain) GetMaxBlkCreateTime() time.Duration

func (*ShardChain) GetMinBlkInterval

func (chain *ShardChain) GetMinBlkInterval() time.Duration

func (*ShardChain) GetMultiView

func (chain *ShardChain) GetMultiView() multiview.MultiView

func (*ShardChain) GetPendingCommittee

func (chain *ShardChain) GetPendingCommittee() []incognitokey.CommitteePublicKey

func (*ShardChain) GetPortalParamsV4

func (chain *ShardChain) GetPortalParamsV4(beaconHeight uint64) portalv4.PortalParams

func (*ShardChain) GetProposerByTimeSlotFromCommitteeList

func (chain *ShardChain) GetProposerByTimeSlotFromCommitteeList(ts int64, committees []incognitokey.CommitteePublicKey) (incognitokey.CommitteePublicKey, int)

ProposerByTimeSlot ...

func (*ShardChain) GetPubKeyCommitteeIndex

func (chain *ShardChain) GetPubKeyCommitteeIndex(pubkey string) int

func (*ShardChain) GetShardID

func (chain *ShardChain) GetShardID() int

func (*ShardChain) GetSigningCommittees

func (chain *ShardChain) GetSigningCommittees(
	proposerIndex int, committees []incognitokey.CommitteePublicKey, blockVersion int,
) []incognitokey.CommitteePublicKey

func (*ShardChain) GetViewByHash

func (chain *ShardChain) GetViewByHash(hash common.Hash) multiview.View

func (*ShardChain) InsertAndBroadcastBlock

func (chain *ShardChain) InsertAndBroadcastBlock(block types.BlockInterface) error

func (*ShardChain) InsertAndBroadcastBlockWithPrevValidationData

func (chain *ShardChain) InsertAndBroadcastBlockWithPrevValidationData(block types.BlockInterface, newValidationData string) error

func (*ShardChain) InsertBatchBlock

func (s *ShardChain) InsertBatchBlock([]types.BlockInterface) (int, error)

func (*ShardChain) InsertBlock

func (chain *ShardChain) InsertBlock(block types.BlockInterface, shouldValidate bool) error

func (*ShardChain) InsertWithPrevValidationData

func (chain *ShardChain) InsertWithPrevValidationData(block types.BlockInterface, newValidationData string) error

func (*ShardChain) IsBeaconChain

func (chain *ShardChain) IsBeaconChain() bool

func (*ShardChain) IsReady

func (chain *ShardChain) IsReady() bool

func (*ShardChain) ReplacePreviousValidationData

func (chain *ShardChain) ReplacePreviousValidationData(previousBlockHash common.Hash, previousProposeHash common.Hash, _ []incognitokey.CommitteePublicKey, newValidationData string) error

this is only call when insert block successfully, the previous block is replace

func (*ShardChain) SetMultiView

func (chain *ShardChain) SetMultiView(multiView multiview.MultiView)

func (*ShardChain) SetReady

func (chain *ShardChain) SetReady(ready bool)

func (*ShardChain) UnmarshalBlock

func (chain *ShardChain) UnmarshalBlock(blockString []byte) (types.BlockInterface, error)

func (*ShardChain) ValidateBlockSignatures

func (chain *ShardChain) ValidateBlockSignatures(block types.BlockInterface, committees []incognitokey.CommitteePublicKey, numOfFixNode int) error

func (*ShardChain) ValidatePreSignBlock

func (chain *ShardChain) ValidatePreSignBlock(block types.BlockInterface, signingCommittees, committees []incognitokey.CommitteePublicKey) error

func (*ShardChain) VerifyFinalityAndReplaceBlockConsensusData

func (chain *ShardChain) VerifyFinalityAndReplaceBlockConsensusData(consensusData types.BlockConsensusData) error

consensusData contain beacon finality consensus data

type ShardRootHash

type ShardRootHash struct {
	ConsensusStateDBRootHash   common.Hash
	TransactionStateDBRootHash common.Hash
	FeatureStateDBRootHash     common.Hash
	RewardStateDBRootHash      common.Hash
	SlashStateDBRootHash       common.Hash
}

func GetShardRootsHashByBlockHash

func GetShardRootsHashByBlockHash(db incdb.Database, shardID byte, hash common.Hash) (*ShardRootHash, error)

type StateDBData

type StateDBData struct {
	K []byte
	V []byte
}

type Syncker

type Syncker interface {
	GetCrossShardBlocksForShardProducer(view *ShardBestState, list map[byte][]uint64) map[byte][]interface{}
	GetCrossShardBlocksForShardValidator(view *ShardBestState, list map[byte][]uint64) (map[byte][]interface{}, error)
	SyncMissingBeaconBlock(ctx context.Context, peerID string, fromHash common.Hash)
	SyncMissingShardBlock(ctx context.Context, peerID string, sid byte, fromHash common.Hash)
	ReceiveBlock(block interface{}, previousValidationData string, peerID string)
}

type TSManager

type TSManager struct {
	Anchors []anchorTime
	//below fields save the last enablefeature block for shard
	//when we see update version in shardstate, these value help us retrieve checkpoint information
	CurrentBlockVersion int
	CurrentBlockTS      int64
	CurrentProposeTime  int64
}

type TxPool

type TxPool interface {
	HaveTransaction(hash *common.Hash) bool
	// RemoveTx remove tx from tx resource
	RemoveTx(txs []metadata.Transaction, isInBlock bool)
	RemoveCandidateList([]string)
	EmptyPool() bool
	MaybeAcceptTransactionForBlockProducing(metadata.Transaction, int64, *ShardBestState) (*metadata.TxDesc, error)
	MaybeAcceptBatchTransactionForBlockProducing(byte, []metadata.Transaction, int64, *ShardBestState) ([]*metadata.TxDesc, error)
	MaybeAcceptSalaryTransactionForBlockProducing(byte, metadata.Transaction, int64, *ShardBestState) (*metadata.TxDesc, error)
}

type TxViewPoint

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

TxViewPoint is used to contain data which is fetched from tx of every block

func NewTxViewPoint

func NewTxViewPoint(shardID byte, bHeight, height uint64) *TxViewPoint

NewTxViewPoint Create a TxNormal view point, which contains data about serialNumbers and commitments

func (*TxViewPoint) ListSerialNumbers

func (view *TxViewPoint) ListSerialNumbers() [][]byte

ListSerialNumbers returns list serialNumber which is contained in TxViewPoint

#1: joinSplitDescType is "Coin" Or "Bond" or other token

func (*TxViewPoint) ListSerialNumnbersEclipsePoint

func (view *TxViewPoint) ListSerialNumnbersEclipsePoint() []*privacy.Point

func (*TxViewPoint) MapSnDerivators

func (view *TxViewPoint) MapSnDerivators() map[string][][]byte
func (view *TxViewPoint) ListSnDerivators() []big.Int {
	return view.listSnD
}

type TxsVerifier

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

func (*TxsVerifier) FilterWhitelistTxs

func (v *TxsVerifier) FilterWhitelistTxs(txs []metadata.Transaction) []metadata.Transaction

func (*TxsVerifier) FullValidateTransactions

func (v *TxsVerifier) FullValidateTransactions(
	chainRetriever metadata.ChainRetriever,
	shardViewRetriever metadata.ShardViewRetriever,
	beaconViewRetriever metadata.BeaconViewRetriever,
	txs []metadata.Transaction,
) (bool, error)

func (*TxsVerifier) LoadCommitment

func (v *TxsVerifier) LoadCommitment(
	tx metadata.Transaction,
	shardViewRetriever metadata.ShardViewRetriever,
) (bool, error)

func (*TxsVerifier) PrepareDataForTxs

func (v *TxsVerifier) PrepareDataForTxs(
	validTxs []metadata.Transaction,
	newTxs []metadata.Transaction,
	shardViewRetriever metadata.ShardViewRetriever,
) (bool, error)

func (*TxsVerifier) UpdateFeeEstimator

func (v *TxsVerifier) UpdateFeeEstimator(
	estimator txpool.FeeEstimator,
)

func (*TxsVerifier) UpdateTransactionStateDB

func (v *TxsVerifier) UpdateTransactionStateDB(
	newSDB *statedb.StateDB,
)

func (*TxsVerifier) ValidateWithChainState

func (v *TxsVerifier) ValidateWithChainState(
	tx metadata.Transaction,
	chainRetriever metadata.ChainRetriever,
	shardViewRetriever metadata.ShardViewRetriever,
	beaconViewRetriever metadata.BeaconViewRetriever,
	beaconHeight uint64,
) (bool, error)

func (*TxsVerifier) ValidateWithoutChainstate

func (v *TxsVerifier) ValidateWithoutChainstate(tx metadata.Transaction) (bool, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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