Skip to content

Tech: Block's receipt field #255

@andy-shi88

Description

@andy-shi88

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

Breakdown

  • add receipt wrapper for storing the intermediate_hashes
  • add slice of receipt wrapper to block struct for publishing receipts in block.

Metadata

Metadata

Assignees

No one assigned

    Labels

    COREcore functionalitiesFEATURENew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions