Skip to content

Tech: [receipt-selection] : Receipt Batch  #1290

Open
@andy-shi88

Description

@andy-shi88

Description

Prepare a ReceiptBatch storage, that store the receipts collected at every block's data.

[]map[hash_hex][]BatchReceipt [ // slice
   block_height_1: {
       receipts: [
           [
                block_0_peer_1_receipt,
                block_0_peer_2_receipt,
                block_0_peer_3_receipt,
           ],
          [
                block_1_tx_1_peer_1_receipt,
                block_1_tx_1_peer_2_receipt,
                block_1_tx_1_peer_3_receipt,
           ],
           ...,
       ],
      merkle: {
           root: []byte,
           tree: []byte,
      }
   },
   block_height_2: {
        ...
   },
   ...,
   block_height_41: {
        ...
   },
]

The data represented at every block_height is their content (txs) + receipt collected from its previous block. This data will be used in a way where:

  • we look up the height first (for free receipt current_height - 40), which is why it's important to store in array
  • pick a random data to broadcast the batch, batch[random_idx]
  • publish the receipt along with its batch_height reference (for free receipt)

Breakdown

  • create storage to store the receipt
  • add interface to select free receipt

Metadata

Metadata

Assignees

No one assigned

    Labels

    COREcore functionalitiesREQUIRE_RESETrequire changes that are not backward compatible, blockchain reset needed

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions