Documentation ¶
Index ¶
- Variables
- type AccountBlockVerifyStat
- type AccountHashH
- type AccountPendingTask
- type AccountReader
- type AccountVerifier
- func (verifier *AccountVerifier) VerifyDataValidity(block *ledger.AccountBlock) error
- func (verifier *AccountVerifier) VerifyHash(block *ledger.AccountBlock) error
- func (verifier *AccountVerifier) VerifyIsReceivedSucceed(block *ledger.AccountBlock) bool
- func (verifier *AccountVerifier) VerifyNetAb(block *ledger.AccountBlock) error
- func (verifier *AccountVerifier) VerifyNonce(block *ledger.AccountBlock, accountType uint64) error
- func (verifier *AccountVerifier) VerifyP2PDataValidity(block *ledger.AccountBlock) error
- func (verifier *AccountVerifier) VerifyReferred(block *ledger.AccountBlock) (VerifyResult, *AccountBlockVerifyStat)
- func (verifier *AccountVerifier) VerifySigature(block *ledger.AccountBlock) error
- func (verifier *AccountVerifier) VerifySnapshotOfReferredBlock(thisBlock *ledger.AccountBlock, referredBlock *ledger.AccountBlock) (VerifyResult, error)
- func (verifier *AccountVerifier) VerifyTimeNotYet(block *ledger.AccountBlock) error
- func (verifier *AccountVerifier) VerifyTimeOut(blockReferSb *ledger.SnapshotBlock) error
- func (verifier *AccountVerifier) VerifyforRPC(block *ledger.AccountBlock) (blocks []*vm_context.VmAccountBlock, err error)
- func (verifier *AccountVerifier) VerifyforVM(block *ledger.AccountBlock) (blocks []*vm_context.VmAccountBlock, err error)
- type Chain
- type Consensus
- type NetVerifier
- type OnRoad
- type SnapshotBlockVerifyStat
- type SnapshotPendingTask
- type SnapshotReader
- type SnapshotVerifier
- func (self *SnapshotVerifier) VerifyAccountTimeout(addr types.Address, snapshotHeight uint64) (*ledger.HashHeight, error)
- func (self *SnapshotVerifier) VerifyNetSb(block *ledger.SnapshotBlock) error
- func (self *SnapshotVerifier) VerifyReferred(block *ledger.SnapshotBlock) *SnapshotBlockVerifyStat
- func (self *SnapshotVerifier) VerifyTimeout(nowHeight uint64, referHeight uint64) bool
- type VerifyResult
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 AccountReader ¶
type AccountReader interface { GetLatestAccountBlock(addr *types.Address) (*ledger.AccountBlock, error) GetAccountBlockByHash(blockHash *types.Hash) (*ledger.AccountBlock, error) GetContractGid(addr *types.Address) (*types.Gid, error) AccountType(address *types.Address) (uint64, error) GetAccount(address *types.Address) (*ledger.Account, error) GetConfirmAccountBlock(snapshotHeight uint64, address *types.Address) (*ledger.AccountBlock, error) GetStateTrie(hash *types.Hash) *trie.Trie NewStateTrie() *trie.Trie }
type AccountVerifier ¶
type AccountVerifier struct {
// contains filtered or unexported fields
}
func NewAccountVerifier ¶
func NewAccountVerifier(chain Chain, consensus Consensus) *AccountVerifier
func (*AccountVerifier) VerifyDataValidity ¶
func (verifier *AccountVerifier) VerifyDataValidity(block *ledger.AccountBlock) error
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) 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)
func (*AccountVerifier) VerifyTimeNotYet ¶
func (verifier *AccountVerifier) VerifyTimeNotYet(block *ledger.AccountBlock) error
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 Chain ¶
type Chain interface { AccountReader SnapshotReader OnRoad }
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 SnapshotReader ¶
type SnapshotReader interface { GetSnapshotBlockByHash(hash *types.Hash) (*ledger.SnapshotBlock, error) GetConfirmBlock(accountBlockHash *types.Hash) (*ledger.SnapshotBlock, error) GetConfirmTimes(accountBlockHash *types.Hash) (uint64, error) GetLatestSnapshotBlock() *ledger.SnapshotBlock GetSnapshotBlockByHeight(height uint64) (*ledger.SnapshotBlock, error) GetSnapshotBlocksByHeight(height uint64, count uint64, forward, containSnapshotContent bool) ([]*ledger.SnapshotBlock, error) GetGenesisSnapshotBlock() *ledger.SnapshotBlock GetSnapshotBlockBeforeTime(timestamp *time.Time) (*ledger.SnapshotBlock, error) }
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
Click to show internal directories.
Click to hide internal directories.