Skip to content

Commit 4c11ed7

Browse files
committed
[FAB-4974] Ledger proto messages enhancement for sidedb
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>
1 parent a4b4107 commit 4c11ed7

File tree

10 files changed

+497
-61
lines changed

10 files changed

+497
-61
lines changed

protos/ledger/rwset/kvrwset/kv_rwset.pb.go

Lines changed: 140 additions & 42 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

protos/ledger/rwset/kvrwset/kv_rwset.proto

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,19 @@ option java_package = "org.hyperledger.fabric.protos.ledger.rwset.kvrwset";
2222
package kvrwset;
2323

2424
// KVRWSet encapsulates the read-write set for a chaincode that operates upon a KV or Document data model
25+
// This structure is used for both the public data and the private data
2526
message KVRWSet {
2627
repeated KVRead reads = 1;
2728
repeated RangeQueryInfo range_queries_info = 2;
2829
repeated KVWrite writes = 3;
2930
}
3031

32+
// HashedRWSet encapsulates hashed representation of a private read-write set for KV or Document data model
33+
message HashedRWSet {
34+
repeated KVReadHash hashed_reads = 1;
35+
repeated KVWriteHash hashed_writes = 2;
36+
}
37+
3138
// KVRead captures a read operation performed during transaction simulation
3239
// A 'nil' version indicates a non-existing key read by the transaction
3340
message KVRead {
@@ -42,6 +49,21 @@ message KVWrite {
4249
bytes value = 3;
4350
}
4451

52+
// KVReadHash is similar to the KVRead in spirit. However, it captures the hash of the key instead of the key itself
53+
// version is kept as is for now. However, if the version also needs to be privacy-protected, it would need to be the
54+
// hash of the version and hence of 'bytes' type
55+
message KVReadHash {
56+
bytes key_hash = 1;
57+
Version version = 2;
58+
}
59+
60+
// KVWriteHash is similar to the KVWrite in spiritcaptures a write (update/delete) operation performed during transaction simulation
61+
message KVWriteHash {
62+
bytes key_hash = 1;
63+
bool is_delete = 2;
64+
bytes value_hash = 3;
65+
}
66+
4567
// Version encapsulates the version of a Key
4668
// A version of a committed key is maintained as the height of the transaction that committed the key.
4769
// The height is represenetd as a tuple <blockNum, txNum> where the txNum is the height of the transaction
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Define binary file attributes.
2+
kvrwsetV1ProtoBytes binary

0 commit comments

Comments
 (0)