Skip to content

Commit

Permalink
[FAB-4974] Ledger proto messages enhancement for sidedb
Browse files Browse the repository at this point in the history
This CR enhances the proto message for supporting the
hashed read-write set and private read-write set for the
private data. To summarize - under a namespace (chaincodeid),
there could be one or more sub-spaces (referred to as collections)
for managing private state. The hashed read-write set is intented
be part of the block and the private read-write set is intented to be
transferred to the need-to-have peers only.

Change-Id: I2f5127f93c945ab6559ed625f677d467e67bbcda
Signed-off-by: manish <manish.sethi@gmail.com>
  • Loading branch information
manish-sethi committed Aug 4, 2017
1 parent a4b4107 commit 4c11ed7
Show file tree
Hide file tree
Showing 10 changed files with 497 additions and 61 deletions.
182 changes: 140 additions & 42 deletions protos/ledger/rwset/kvrwset/kv_rwset.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 22 additions & 0 deletions protos/ledger/rwset/kvrwset/kv_rwset.proto
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,19 @@ option java_package = "org.hyperledger.fabric.protos.ledger.rwset.kvrwset";
package kvrwset;

// 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
message KVRWSet {
repeated KVRead reads = 1;
repeated RangeQueryInfo range_queries_info = 2;
repeated KVWrite writes = 3;
}

// HashedRWSet encapsulates hashed representation of a private read-write set for KV or Document data model
message HashedRWSet {
repeated KVReadHash hashed_reads = 1;
repeated KVWriteHash hashed_writes = 2;
}

// KVRead captures a read operation performed during transaction simulation
// A 'nil' version indicates a non-existing key read by the transaction
message KVRead {
Expand All @@ -42,6 +49,21 @@ message KVWrite {
bytes value = 3;
}

// 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
message KVReadHash {
bytes key_hash = 1;
Version version = 2;
}

// KVWriteHash is similar to the KVWrite in spiritcaptures a write (update/delete) operation performed during transaction simulation
message KVWriteHash {
bytes key_hash = 1;
bool is_delete = 2;
bytes value_hash = 3;
}

// 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 height of the transaction
Expand Down
2 changes: 2 additions & 0 deletions protos/ledger/rwset/kvrwset/tests/.gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Define binary file attributes.
kvrwsetV1ProtoBytes binary
Loading

0 comments on commit 4c11ed7

Please sign in to comment.