verifier

package
v1.2.3-alpha.3 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2019 License: GPL-3.0 Imports: 18 Imported by: 8

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrVerifyAccountAddrFailed             = errors.New("account address doesn't exist, need receiveTx for more balance first")
	ErrVerifyHashFailed                    = errors.New("verify hash failed")
	ErrVerifySignatureFailed               = errors.New("verify signature failed")
	ErrVerifyNonceFailed                   = errors.New("check pow nonce failed")
	ErrVerifySnapshotOfReferredBlockFailed = errors.New("verify snapshotBlock of the referredBlock failed")
	ErrVerifyForVmGeneratorFailed          = errors.New("generator in verifier failed")
	ErrVerifyWithVmResultFailed            = errors.New("verify with vm result failed")
)
View Source
var TimeOutHeight = uint64(30 * types.SnapshotDayHeight)

Functions

This section is empty.

Types

type AccountBlockVerifyStat

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

func (*AccountBlockVerifyStat) ErrMsg

func (result *AccountBlockVerifyStat) ErrMsg() string

func (*AccountBlockVerifyStat) GetPendingTasks

func (result *AccountBlockVerifyStat) GetPendingTasks() ([]*AccountPendingTask, *SnapshotPendingTask)

func (*AccountBlockVerifyStat) VerifyResult

func (result *AccountBlockVerifyStat) VerifyResult() VerifyResult

type AccountHashH

type AccountHashH struct {
	Addr   *types.Address
	Hash   *types.Hash
	Height *big.Int
}

type AccountPendingTask

type AccountPendingTask struct {
	Addr *types.Address
	Hash *types.Hash
}

type AccountVerifier

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

func NewAccountVerifier

func NewAccountVerifier(chain chain.Chain, consensus Consensus) *AccountVerifier

func (*AccountVerifier) VerifyDataValidity

func (verifier *AccountVerifier) VerifyDataValidity(block *ledger.AccountBlock, sbHeight uint64, accType uint64) error

func (*AccountVerifier) VerifyDealTime added in v1.2.0

func (verifier *AccountVerifier) VerifyDealTime(block *ledger.AccountBlock) error

don't accept which timestamp doesn't satisfy within the (now + 1h) limit

func (*AccountVerifier) VerifyHash

func (verifier *AccountVerifier) VerifyHash(block *ledger.AccountBlock) error

func (*AccountVerifier) VerifyIsReceivedSucceed

func (verifier *AccountVerifier) VerifyIsReceivedSucceed(block *ledger.AccountBlock) bool

func (*AccountVerifier) VerifyNetAb

func (verifier *AccountVerifier) VerifyNetAb(block *ledger.AccountBlock) error

func (*AccountVerifier) VerifyNonce

func (verifier *AccountVerifier) VerifyNonce(block *ledger.AccountBlock, accountType uint64) error

func (*AccountVerifier) VerifyP2PDataValidity

func (verifier *AccountVerifier) VerifyP2PDataValidity(block *ledger.AccountBlock) error

func (*AccountVerifier) VerifyProducerLegality added in v1.2.0

func (verifier *AccountVerifier) VerifyProducerLegality(block *ledger.AccountBlock, accType uint64) error

func (*AccountVerifier) VerifyReferred

func (verifier *AccountVerifier) VerifyReferred(block *ledger.AccountBlock) (VerifyResult, *AccountBlockVerifyStat)

contractAddr's sendBlock don't call VerifyReferredforPool

func (*AccountVerifier) VerifySigature

func (verifier *AccountVerifier) VerifySigature(block *ledger.AccountBlock) error

func (*AccountVerifier) VerifySnapshotOfReferredBlock

func (verifier *AccountVerifier) VerifySnapshotOfReferredBlock(thisBlock *ledger.AccountBlock, referredBlock *ledger.AccountBlock) (VerifyResult, error)

referredBlock' snapshotBlock's sbHeight can't lower than thisBlock

func (*AccountVerifier) VerifyTimeOut

func (verifier *AccountVerifier) VerifyTimeOut(blockReferSb *ledger.SnapshotBlock) error

func (*AccountVerifier) VerifyforRPC

func (verifier *AccountVerifier) VerifyforRPC(block *ledger.AccountBlock) (blocks []*vm_context.VmAccountBlock, err error)

func (*AccountVerifier) VerifyforVM

func (verifier *AccountVerifier) VerifyforVM(block *ledger.AccountBlock) (blocks []*vm_context.VmAccountBlock, err error)

type BlockState added in v1.2.0

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

type Consensus

type Consensus interface {
	VerifyAccountProducer(block *ledger.AccountBlock) (bool, error)
}

type NetVerifier

type NetVerifier interface {
	VerifyNetSb(block *ledger.SnapshotBlock) error
	VerifyNetAb(block *ledger.AccountBlock) error
}

func NewNetVerifier

func NewNetVerifier(sv *SnapshotVerifier, av *AccountVerifier) NetVerifier

type SnapshotBlockVerifyStat

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

func (*SnapshotBlockVerifyStat) ErrMsg

func (self *SnapshotBlockVerifyStat) ErrMsg() string

func (*SnapshotBlockVerifyStat) Results

func (self *SnapshotBlockVerifyStat) Results() map[types.Address]VerifyResult

func (*SnapshotBlockVerifyStat) VerifyResult

func (self *SnapshotBlockVerifyStat) VerifyResult() VerifyResult

type SnapshotPendingTask

type SnapshotPendingTask struct {
	Hash *types.Hash
}

type SnapshotVerifier

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

func NewSnapshotVerifier

func NewSnapshotVerifier(ch chain.Chain, cs consensus.Verifier) *SnapshotVerifier

func (*SnapshotVerifier) VerifyAccountTimeout

func (self *SnapshotVerifier) VerifyAccountTimeout(addr types.Address, snapshotHeight uint64) (*ledger.HashHeight, error)

func (*SnapshotVerifier) VerifyNetSb

func (self *SnapshotVerifier) VerifyNetSb(block *ledger.SnapshotBlock) error

func (*SnapshotVerifier) VerifyReferred

func (self *SnapshotVerifier) VerifyReferred(block *ledger.SnapshotBlock) *SnapshotBlockVerifyStat

func (*SnapshotVerifier) VerifyTimeout

func (self *SnapshotVerifier) VerifyTimeout(nowHeight uint64, referHeight uint64) bool

type VerifyResult

type VerifyResult int
const (
	FAIL VerifyResult = iota
	PENDING
	SUCCESS
)

Jump to

Keyboard shortcuts

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