Documentation ¶
Index ¶
- type KeyLevelValidationParameterManager
- type KeyLevelValidationParameterManagerImpl
- func (m *KeyLevelValidationParameterManagerImpl) ExtractValidationParameterDependency(blockNum, txNum uint64, rwsetBytes []byte)
- func (m *KeyLevelValidationParameterManagerImpl) GetValidationParameterForKey(cc, coll, key string, blockNum, txNum uint64) ([]byte, error)
- func (m *KeyLevelValidationParameterManagerImpl) SetTxValidationResult(ns string, blockNum, txNum uint64, err error)
- type KeyLevelValidator
- func (klv *KeyLevelValidator) PostValidate(cc string, blockNum, txNum uint64, err error)
- func (klv *KeyLevelValidator) PreValidate(txNum uint64, block *common.Block)
- func (klv *KeyLevelValidator) Validate(cc string, blockNum, txNum uint64, rwsetBytes, prp, ccEP []byte, ...) commonerrors.TxValidationError
- type ValidationParameterUpdatedError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type KeyLevelValidationParameterManager ¶
type KeyLevelValidationParameterManager interface { //GetValidationParameterWorkey返回的验证参数 //在指定块上由(cc,coll,key)标识的提供的kvs密钥 //height h. The function returns the validation parameter and no error in case of //成功,否则为零,否则为错误。一个可能是 //返回的是validationParameterUpdatedErr,如果 //给定kvs密钥的验证参数已被事务更改 //with txNum smaller than the one supplied by the caller. This protects from a //事务更改验证参数标记为有效的方案 //由VSCC执行,随后由于其他原因(如MVCC)被提交人取消。 //冲突)。此功能可能被阻止,直到有足够的信息 //已通过(通过调用ApplyRwsetUpdates和ApplyValidateRwsetupdates)的 //所有TxNum小于调用方提供的TxE。 GetValidationParameterForKey(cc, coll, key string, blockNum, txNum uint64) ([]byte, error) //ExtractValidationParameterDependency用于确定哪些验证参数是 //由高度为'blocknum,txnum'的事务更新。这是需要的 //确定哪些Txe依赖于特定的验证参数,并将 //确定GetValidationParameterWorksey是否可以阻止。 ExtractValidationParameterDependency(blockNum, txNum uint64, rwset []byte) //settxvalidationresult设置高度事务的验证结果 //`blocknum,txnum`用于指定的链码'cc`。 //这用于确定依赖项是否由 //是否提取验证参数依赖项。 SetTxValidationResult(cc string, blockNum, txNum uint64, err error) }
验证插件依次使用keyLevelValidationParameterManager 检索各个KVS密钥的验证参数。 应按以下顺序调用函数: 1)为验证某个Tx而调用的验证插件调用ExtractValidationParameterDependency 以便经理能够确定分类帐中的验证参数 可以使用,或者是否由该块中的事务更新。 2)验证插件对GetValidationParameterWorkey发出0个或多个调用。 3) the validation plugin determines the validation code for the tx and calls SetTxValidationCode.
type KeyLevelValidationParameterManagerImpl ¶
type KeyLevelValidationParameterManagerImpl struct { StateFetcher validation.StateFetcher // contains filtered or unexported fields }
func (*KeyLevelValidationParameterManagerImpl) ExtractValidationParameterDependency ¶
func (m *KeyLevelValidationParameterManagerImpl) ExtractValidationParameterDependency(blockNum, txNum uint64, rwsetBytes []byte)
ExtractValidationParameterDependency实现了 keyLevelValidationParameterManager接口的相同名称 Note that this function doesn't take any namespace argument. 这是 因为我们要检查此事务所针对的所有命名空间 修改元数据。
func (*KeyLevelValidationParameterManagerImpl) GetValidationParameterForKey ¶
func (m *KeyLevelValidationParameterManagerImpl) GetValidationParameterForKey(cc, coll, key string, blockNum, txNum uint64) ([]byte, error)
GetValidationParameterWorkey实现的方法 keyLevelValidationParameterManager接口的相同名称
func (*KeyLevelValidationParameterManagerImpl) SetTxValidationResult ¶
func (m *KeyLevelValidationParameterManagerImpl) SetTxValidationResult(ns string, blockNum, txNum uint64, err error)
settxvalidationcode实现与 KeyLevelValidationParameterManager接口。注意 此函数接收一个命名空间参数,以便记录 此事务和链码的验证结果。
type KeyLevelValidator ¶
type KeyLevelValidator struct {
// contains filtered or unexported fields
}
keylevalidator根据密钥级ep验证实现
func NewKeyLevelValidator ¶
func NewKeyLevelValidator(policySupport validation.PolicyEvaluator, vpmgr KeyLevelValidationParameterManager) *KeyLevelValidator
func (*KeyLevelValidator) PostValidate ¶
func (klv *KeyLevelValidator) PostValidate(cc string, blockNum, txNum uint64, err error)
postvalidate实现statebasedvalidator接口的功能
func (*KeyLevelValidator) PreValidate ¶
func (klv *KeyLevelValidator) PreValidate(txNum uint64, block *common.Block)
prevalidate实现statebasedvalidator接口的功能
func (*KeyLevelValidator) Validate ¶
func (klv *KeyLevelValidator) Validate(cc string, blockNum, txNum uint64, rwsetBytes, prp, ccEP []byte, endorsements []*peer.Endorsement) commonerrors.TxValidationError
validate实现statebasedvalidator接口的功能