kvrwset

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2023 License: Apache-2.0 Imports: 4 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_ledger_rwset_kvrwset_kv_rwset_proto protoreflect.FileDescriptor

Functions

This section is empty.

Types

type HashedRWSet

type HashedRWSet struct {
	HashedReads    []*KVReadHash          `protobuf:"bytes,1,rep,name=hashed_reads,json=hashedReads,proto3" json:"hashed_reads,omitempty"`
	HashedWrites   []*KVWriteHash         `protobuf:"bytes,2,rep,name=hashed_writes,json=hashedWrites,proto3" json:"hashed_writes,omitempty"`
	MetadataWrites []*KVMetadataWriteHash `protobuf:"bytes,3,rep,name=metadata_writes,json=metadataWrites,proto3" json:"metadata_writes,omitempty"`
	// contains filtered or unexported fields
}

HashedRWSet encapsulates hashed representation of a private read-write set for KV or Document data model

func (*HashedRWSet) Descriptor deprecated

func (*HashedRWSet) Descriptor() ([]byte, []int)

Deprecated: Use HashedRWSet.ProtoReflect.Descriptor instead.

func (*HashedRWSet) GetHashedReads

func (x *HashedRWSet) GetHashedReads() []*KVReadHash

func (*HashedRWSet) GetHashedWrites

func (x *HashedRWSet) GetHashedWrites() []*KVWriteHash

func (*HashedRWSet) GetMetadataWrites

func (x *HashedRWSet) GetMetadataWrites() []*KVMetadataWriteHash

func (*HashedRWSet) ProtoMessage

func (*HashedRWSet) ProtoMessage()

func (*HashedRWSet) ProtoReflect

func (x *HashedRWSet) ProtoReflect() protoreflect.Message

func (*HashedRWSet) Reset

func (x *HashedRWSet) Reset()

func (*HashedRWSet) String

func (x *HashedRWSet) String() string

type KVMetadataEntry

type KVMetadataEntry struct {
	Name  string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	Value []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"`
	// contains filtered or unexported fields
}

KVMetadataEntry captures a 'name'ed entry in the metadata of a key/key-hash.

func (*KVMetadataEntry) Descriptor deprecated

func (*KVMetadataEntry) Descriptor() ([]byte, []int)

Deprecated: Use KVMetadataEntry.ProtoReflect.Descriptor instead.

func (*KVMetadataEntry) GetName

func (x *KVMetadataEntry) GetName() string

func (*KVMetadataEntry) GetValue

func (x *KVMetadataEntry) GetValue() []byte

func (*KVMetadataEntry) ProtoMessage

func (*KVMetadataEntry) ProtoMessage()

func (*KVMetadataEntry) ProtoReflect

func (x *KVMetadataEntry) ProtoReflect() protoreflect.Message

func (*KVMetadataEntry) Reset

func (x *KVMetadataEntry) Reset()

func (*KVMetadataEntry) String

func (x *KVMetadataEntry) String() string

type KVMetadataWrite

type KVMetadataWrite struct {
	Key     string             `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
	Entries []*KVMetadataEntry `protobuf:"bytes,2,rep,name=entries,proto3" json:"entries,omitempty"`
	// contains filtered or unexported fields
}

KVMetadataWrite captures all the entries in the metadata associated with a key

func (*KVMetadataWrite) Descriptor deprecated

func (*KVMetadataWrite) Descriptor() ([]byte, []int)

Deprecated: Use KVMetadataWrite.ProtoReflect.Descriptor instead.

func (*KVMetadataWrite) GetEntries

func (x *KVMetadataWrite) GetEntries() []*KVMetadataEntry

func (*KVMetadataWrite) GetKey

func (x *KVMetadataWrite) GetKey() string

func (*KVMetadataWrite) ProtoMessage

func (*KVMetadataWrite) ProtoMessage()

func (*KVMetadataWrite) ProtoReflect

func (x *KVMetadataWrite) ProtoReflect() protoreflect.Message

func (*KVMetadataWrite) Reset

func (x *KVMetadataWrite) Reset()

func (*KVMetadataWrite) String

func (x *KVMetadataWrite) String() string

type KVMetadataWriteHash

type KVMetadataWriteHash struct {
	KeyHash []byte             `protobuf:"bytes,1,opt,name=key_hash,json=keyHash,proto3" json:"key_hash,omitempty"`
	Entries []*KVMetadataEntry `protobuf:"bytes,2,rep,name=entries,proto3" json:"entries,omitempty"`
	// contains filtered or unexported fields
}

KVMetadataWriteHash captures all the upserts to the metadata associated with a key hash

func (*KVMetadataWriteHash) Descriptor deprecated

func (*KVMetadataWriteHash) Descriptor() ([]byte, []int)

Deprecated: Use KVMetadataWriteHash.ProtoReflect.Descriptor instead.

func (*KVMetadataWriteHash) GetEntries

func (x *KVMetadataWriteHash) GetEntries() []*KVMetadataEntry

func (*KVMetadataWriteHash) GetKeyHash

func (x *KVMetadataWriteHash) GetKeyHash() []byte

func (*KVMetadataWriteHash) ProtoMessage

func (*KVMetadataWriteHash) ProtoMessage()

func (*KVMetadataWriteHash) ProtoReflect

func (x *KVMetadataWriteHash) ProtoReflect() protoreflect.Message

func (*KVMetadataWriteHash) Reset

func (x *KVMetadataWriteHash) Reset()

func (*KVMetadataWriteHash) String

func (x *KVMetadataWriteHash) String() string

type KVRWSet

type KVRWSet struct {
	Reads            []*KVRead          `protobuf:"bytes,1,rep,name=reads,proto3" json:"reads,omitempty"`
	RangeQueriesInfo []*RangeQueryInfo  `protobuf:"bytes,2,rep,name=range_queries_info,json=rangeQueriesInfo,proto3" json:"range_queries_info,omitempty"`
	Writes           []*KVWrite         `protobuf:"bytes,3,rep,name=writes,proto3" json:"writes,omitempty"`
	MetadataWrites   []*KVMetadataWrite `protobuf:"bytes,4,rep,name=metadata_writes,json=metadataWrites,proto3" json:"metadata_writes,omitempty"`
	// contains filtered or unexported fields
}

KVRWSet encapsulates the read-write set for a chaincode that operates upon a KV or Document data model This structure is used for both the public data and the private data

func (*KVRWSet) Descriptor deprecated

func (*KVRWSet) Descriptor() ([]byte, []int)

Deprecated: Use KVRWSet.ProtoReflect.Descriptor instead.

func (*KVRWSet) GetMetadataWrites

func (x *KVRWSet) GetMetadataWrites() []*KVMetadataWrite

func (*KVRWSet) GetRangeQueriesInfo

func (x *KVRWSet) GetRangeQueriesInfo() []*RangeQueryInfo

func (*KVRWSet) GetReads

func (x *KVRWSet) GetReads() []*KVRead

func (*KVRWSet) GetWrites

func (x *KVRWSet) GetWrites() []*KVWrite

func (*KVRWSet) ProtoMessage

func (*KVRWSet) ProtoMessage()

func (*KVRWSet) ProtoReflect

func (x *KVRWSet) ProtoReflect() protoreflect.Message

func (*KVRWSet) Reset

func (x *KVRWSet) Reset()

func (*KVRWSet) String

func (x *KVRWSet) String() string

type KVRead

type KVRead struct {
	Key     string   `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
	Version *Version `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"`
	// contains filtered or unexported fields
}

KVRead captures a read operation performed during transaction simulation A 'nil' version indicates a non-existing key read by the transaction

func (*KVRead) Descriptor deprecated

func (*KVRead) Descriptor() ([]byte, []int)

Deprecated: Use KVRead.ProtoReflect.Descriptor instead.

func (*KVRead) GetKey

func (x *KVRead) GetKey() string

func (*KVRead) GetVersion

func (x *KVRead) GetVersion() *Version

func (*KVRead) ProtoMessage

func (*KVRead) ProtoMessage()

func (*KVRead) ProtoReflect

func (x *KVRead) ProtoReflect() protoreflect.Message

func (*KVRead) Reset

func (x *KVRead) Reset()

func (*KVRead) String

func (x *KVRead) String() string

type KVReadHash

type KVReadHash struct {
	KeyHash []byte   `protobuf:"bytes,1,opt,name=key_hash,json=keyHash,proto3" json:"key_hash,omitempty"`
	Version *Version `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"`
	// contains filtered or unexported fields
}

KVReadHash is similar to the KVRead in spirit. However, it captures the hash of the key instead of the key itself version is kept as is for now. However, if the version also needs to be privacy-protected, it would need to be the hash of the version and hence of 'bytes' type

func (*KVReadHash) Descriptor deprecated

func (*KVReadHash) Descriptor() ([]byte, []int)

Deprecated: Use KVReadHash.ProtoReflect.Descriptor instead.

func (*KVReadHash) GetKeyHash

func (x *KVReadHash) GetKeyHash() []byte

func (*KVReadHash) GetVersion

func (x *KVReadHash) GetVersion() *Version

func (*KVReadHash) ProtoMessage

func (*KVReadHash) ProtoMessage()

func (*KVReadHash) ProtoReflect

func (x *KVReadHash) ProtoReflect() protoreflect.Message

func (*KVReadHash) Reset

func (x *KVReadHash) Reset()

func (*KVReadHash) String

func (x *KVReadHash) String() string

type KVWrite

type KVWrite struct {
	Key      string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
	IsDelete bool   `protobuf:"varint,2,opt,name=is_delete,json=isDelete,proto3" json:"is_delete,omitempty"`
	Value    []byte `protobuf:"bytes,3,opt,name=value,proto3" json:"value,omitempty"`
	// contains filtered or unexported fields
}

KVWrite captures a write (update/delete) operation performed during transaction simulation

func (*KVWrite) Descriptor deprecated

func (*KVWrite) Descriptor() ([]byte, []int)

Deprecated: Use KVWrite.ProtoReflect.Descriptor instead.

func (*KVWrite) GetIsDelete

func (x *KVWrite) GetIsDelete() bool

func (*KVWrite) GetKey

func (x *KVWrite) GetKey() string

func (*KVWrite) GetValue

func (x *KVWrite) GetValue() []byte

func (*KVWrite) ProtoMessage

func (*KVWrite) ProtoMessage()

func (*KVWrite) ProtoReflect

func (x *KVWrite) ProtoReflect() protoreflect.Message

func (*KVWrite) Reset

func (x *KVWrite) Reset()

func (*KVWrite) String

func (x *KVWrite) String() string

type KVWriteHash

type KVWriteHash struct {
	KeyHash   []byte `protobuf:"bytes,1,opt,name=key_hash,json=keyHash,proto3" json:"key_hash,omitempty"`
	IsDelete  bool   `protobuf:"varint,2,opt,name=is_delete,json=isDelete,proto3" json:"is_delete,omitempty"`
	ValueHash []byte `protobuf:"bytes,3,opt,name=value_hash,json=valueHash,proto3" json:"value_hash,omitempty"`
	IsPurge   bool   `protobuf:"varint,4,opt,name=is_purge,json=isPurge,proto3" json:"is_purge,omitempty"`
	// contains filtered or unexported fields
}

KVWriteHash is similar to the KVWrite. It captures a write (update/delete) operation performed during transaction simulation

func (*KVWriteHash) Descriptor deprecated

func (*KVWriteHash) Descriptor() ([]byte, []int)

Deprecated: Use KVWriteHash.ProtoReflect.Descriptor instead.

func (*KVWriteHash) GetIsDelete

func (x *KVWriteHash) GetIsDelete() bool

func (*KVWriteHash) GetIsPurge added in v0.2.0

func (x *KVWriteHash) GetIsPurge() bool

func (*KVWriteHash) GetKeyHash

func (x *KVWriteHash) GetKeyHash() []byte

func (*KVWriteHash) GetValueHash

func (x *KVWriteHash) GetValueHash() []byte

func (*KVWriteHash) ProtoMessage

func (*KVWriteHash) ProtoMessage()

func (*KVWriteHash) ProtoReflect

func (x *KVWriteHash) ProtoReflect() protoreflect.Message

func (*KVWriteHash) Reset

func (x *KVWriteHash) Reset()

func (*KVWriteHash) String

func (x *KVWriteHash) String() string

type QueryReads

type QueryReads struct {
	KvReads []*KVRead `protobuf:"bytes,1,rep,name=kv_reads,json=kvReads,proto3" json:"kv_reads,omitempty"`
	// contains filtered or unexported fields
}

QueryReads encapsulates the KVReads for the items read by a transaction as a result of a query execution

func (*QueryReads) Descriptor deprecated

func (*QueryReads) Descriptor() ([]byte, []int)

Deprecated: Use QueryReads.ProtoReflect.Descriptor instead.

func (*QueryReads) GetKvReads

func (x *QueryReads) GetKvReads() []*KVRead

func (*QueryReads) ProtoMessage

func (*QueryReads) ProtoMessage()

func (*QueryReads) ProtoReflect

func (x *QueryReads) ProtoReflect() protoreflect.Message

func (*QueryReads) Reset

func (x *QueryReads) Reset()

func (*QueryReads) String

func (x *QueryReads) String() string

type QueryReadsMerkleSummary

type QueryReadsMerkleSummary struct {
	MaxDegree      uint32   `protobuf:"varint,1,opt,name=max_degree,json=maxDegree,proto3" json:"max_degree,omitempty"`
	MaxLevel       uint32   `protobuf:"varint,2,opt,name=max_level,json=maxLevel,proto3" json:"max_level,omitempty"`
	MaxLevelHashes [][]byte `protobuf:"bytes,3,rep,name=max_level_hashes,json=maxLevelHashes,proto3" json:"max_level_hashes,omitempty"`
	// contains filtered or unexported fields
}

QueryReadsMerkleSummary encapsulates the Merkle-tree hashes for the QueryReads This allows to reduce the size of RWSet in the presence of query results by storing certain hashes instead of actual results. maxDegree field refers to the maximum number of children in the tree at any level maxLevel field contains the lowest level which has lesser nodes than maxDegree (starting from leaf level)

func (*QueryReadsMerkleSummary) Descriptor deprecated

func (*QueryReadsMerkleSummary) Descriptor() ([]byte, []int)

Deprecated: Use QueryReadsMerkleSummary.ProtoReflect.Descriptor instead.

func (*QueryReadsMerkleSummary) GetMaxDegree

func (x *QueryReadsMerkleSummary) GetMaxDegree() uint32

func (*QueryReadsMerkleSummary) GetMaxLevel

func (x *QueryReadsMerkleSummary) GetMaxLevel() uint32

func (*QueryReadsMerkleSummary) GetMaxLevelHashes

func (x *QueryReadsMerkleSummary) GetMaxLevelHashes() [][]byte

func (*QueryReadsMerkleSummary) ProtoMessage

func (*QueryReadsMerkleSummary) ProtoMessage()

func (*QueryReadsMerkleSummary) ProtoReflect

func (x *QueryReadsMerkleSummary) ProtoReflect() protoreflect.Message

func (*QueryReadsMerkleSummary) Reset

func (x *QueryReadsMerkleSummary) Reset()

func (*QueryReadsMerkleSummary) String

func (x *QueryReadsMerkleSummary) String() string

type RangeQueryInfo

type RangeQueryInfo struct {
	StartKey     string `protobuf:"bytes,1,opt,name=start_key,json=startKey,proto3" json:"start_key,omitempty"`
	EndKey       string `protobuf:"bytes,2,opt,name=end_key,json=endKey,proto3" json:"end_key,omitempty"`
	ItrExhausted bool   `protobuf:"varint,3,opt,name=itr_exhausted,json=itrExhausted,proto3" json:"itr_exhausted,omitempty"`
	// Types that are assignable to ReadsInfo:
	//
	//	*RangeQueryInfo_RawReads
	//	*RangeQueryInfo_ReadsMerkleHashes
	ReadsInfo isRangeQueryInfo_ReadsInfo `protobuf_oneof:"reads_info"`
	// contains filtered or unexported fields
}

RangeQueryInfo encapsulates the details of a range query performed by a transaction during simulation. This helps protect transactions from phantom reads by varifying during validation whether any new items got committed within the given range between transaction simuation and validation (in addition to regular checks for updates/deletes of the existing items). readInfo field contains either the KVReads (for the items read by the range query) or a merkle-tree hash if the KVReads exceeds a pre-configured numbers

func (*RangeQueryInfo) Descriptor deprecated

func (*RangeQueryInfo) Descriptor() ([]byte, []int)

Deprecated: Use RangeQueryInfo.ProtoReflect.Descriptor instead.

func (*RangeQueryInfo) GetEndKey

func (x *RangeQueryInfo) GetEndKey() string

func (*RangeQueryInfo) GetItrExhausted

func (x *RangeQueryInfo) GetItrExhausted() bool

func (*RangeQueryInfo) GetRawReads

func (x *RangeQueryInfo) GetRawReads() *QueryReads

func (*RangeQueryInfo) GetReadsInfo

func (m *RangeQueryInfo) GetReadsInfo() isRangeQueryInfo_ReadsInfo

func (*RangeQueryInfo) GetReadsMerkleHashes

func (x *RangeQueryInfo) GetReadsMerkleHashes() *QueryReadsMerkleSummary

func (*RangeQueryInfo) GetStartKey

func (x *RangeQueryInfo) GetStartKey() string

func (*RangeQueryInfo) ProtoMessage

func (*RangeQueryInfo) ProtoMessage()

func (*RangeQueryInfo) ProtoReflect

func (x *RangeQueryInfo) ProtoReflect() protoreflect.Message

func (*RangeQueryInfo) Reset

func (x *RangeQueryInfo) Reset()

func (*RangeQueryInfo) String

func (x *RangeQueryInfo) String() string

type RangeQueryInfo_RawReads

type RangeQueryInfo_RawReads struct {
	RawReads *QueryReads `protobuf:"bytes,4,opt,name=raw_reads,json=rawReads,proto3,oneof"`
}

type RangeQueryInfo_ReadsMerkleHashes

type RangeQueryInfo_ReadsMerkleHashes struct {
	ReadsMerkleHashes *QueryReadsMerkleSummary `protobuf:"bytes,5,opt,name=reads_merkle_hashes,json=readsMerkleHashes,proto3,oneof"`
}

type Version

type Version struct {
	BlockNum uint64 `protobuf:"varint,1,opt,name=block_num,json=blockNum,proto3" json:"block_num,omitempty"`
	TxNum    uint64 `protobuf:"varint,2,opt,name=tx_num,json=txNum,proto3" json:"tx_num,omitempty"`
	// contains filtered or unexported fields
}

Version encapsulates the version of a Key A version of a committed key is maintained as the height of the transaction that committed the key. The height is represenetd as a tuple <blockNum, txNum> where the txNum is the position of the transaction (starting with 0) within block

func (*Version) Descriptor deprecated

func (*Version) Descriptor() ([]byte, []int)

Deprecated: Use Version.ProtoReflect.Descriptor instead.

func (*Version) GetBlockNum

func (x *Version) GetBlockNum() uint64

func (*Version) GetTxNum

func (x *Version) GetTxNum() uint64

func (*Version) ProtoMessage

func (*Version) ProtoMessage()

func (*Version) ProtoReflect

func (x *Version) ProtoReflect() protoreflect.Message

func (*Version) Reset

func (x *Version) Reset()

func (*Version) String

func (x *Version) String() string

Jump to

Keyboard shortcuts

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