Skip to content

Commit 18a8209

Browse files
committed
Define semantics for block metadata array positions
Created an enum to define human readable semantic for block metadata array content. Change-Id: I0b55340c3aa720d563d87d3e2ebc7cdb1b26c8f9 Signed-off-by: Artem Barger <[email protected]>
1 parent 5c9fcc3 commit 18a8209

File tree

3 files changed

+85
-47
lines changed

3 files changed

+85
-47
lines changed

protos/common/block.go

+3-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,9 @@ func NewBlock(seqNum uint64, previousHash []byte) *Block {
2828
block.Header.Number = seqNum
2929
block.Header.PreviousHash = previousHash
3030
block.Data = &BlockData{}
31-
block.Metadata = &BlockMetadata{}
31+
block.Metadata = &BlockMetadata{
32+
Metadata: [][]byte{[]byte{}, []byte{}, []byte{}},
33+
}
3234
return block
3335
}
3436

protos/common/common.pb.go

+75-46
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

protos/common/common.proto

+7
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,13 @@ enum HeaderType {
4141
ENDORSER_TRANSACTION = 3; // Used by the SDK to submit endorser based transactions
4242
}
4343

44+
// This enum enlist indexes of the block metadata array
45+
enum BlockMetadataIndex {
46+
SIGNATURES = 0; // Block metadata array position for block signatures
47+
LAST_CONFIGURATION = 1; // Block metadata array poistion to store last configuration block sequence number
48+
TRANSACTIONS_FILTER = 2; // Block metadata array poistion to store serialized bit array filter of invalid transactions
49+
}
50+
4451
message Header {
4552
ChainHeader chainHeader = 1;
4653
SignatureHeader signatureHeader = 2;

0 commit comments

Comments
 (0)