-
Notifications
You must be signed in to change notification settings - Fork 3
Closed
Labels
Milestone
Description
Description
In generating block, now we will need to publish receipts
.
Add receipts
field in the block
message proto, the receipt field will need to be wrapped in the following way to enable passing intermediate_hashes
for merkle root validation purpose.
block {
ID: 111111,
PreviousBlockHash: []byte{...},
...
Receipts: [ // slice
{ // wrapper
receipt: Receipt, // receipt object
intermediateHashes: [
[]byte{...},
...
]
},
...,
]
...
}
With this implementation we can do the following when receiving block:
- for every Block.Receipts as br
- if len(br.intermediateHashes) == 0 then
this is unlinked
- else
this is linked
then- validate the receipt and the hashes
- if len(br.intermediateHashes) == 0 then
Breakdown
- add receipt wrapper for storing the
intermediate_hashes
- add slice of receipt wrapper to block struct for publishing receipts in block.