Skip to content

Tech: Smithing - Publish Receipts #211

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
andy-shi88 opened this issue Sep 4, 2019 · 0 comments · Fixed by #324
Closed

Tech: Smithing - Publish Receipts #211

andy-shi88 opened this issue Sep 4, 2019 · 0 comments · Fixed by #324
Labels
FEATURE New feature or request
Milestone

Comments

@andy-shi88
Copy link
Contributor

andy-shi88 commented Sep 4, 2019

Description

Publish set of selected receipts when broadcasting block.

Breakdown

  • Update block structure to have receipts in it that contains
Block {
    ...
    receipts: [
        {
             receipt: {
                 ...
             },
             hashes: [
                 ...
                 xxxx,
             ],
             linked: true,
        },
        {
             receipt: {
                 ...
             },
             hashes: [],
             linked: false,
        },
        ....
    ]
    ...
}
  • from the receiving side: Store all the receipt in the block received, to the network_receipts table. *(validation of receipt will be resolved in another issue, let's keep this simple here and just do normal block validation)

  • rules:

    • published receipt must have sender of current node
    • published receipt must have unique receipt recipient, and datum_hash
    • published receipts can have reference to the same merkle root that has been published in a block before.

Additional Diagram / File

Put additional diagram or file

@andy-shi88 andy-shi88 added the FEATURE New feature or request label Sep 4, 2019
@andy-shi88 andy-shi88 added this to the Sprint 5 milestone Sep 4, 2019
@andy-shi88 andy-shi88 self-assigned this Sep 11, 2019
@andy-shi88 andy-shi88 modified the milestones: Sprint 5, Sprint 6 Sep 18, 2019
@andy-shi88 andy-shi88 modified the milestones: Sprint 6, Sprint 7 Oct 3, 2019
astaphobia pushed a commit that referenced this issue Oct 16, 2019
* #211 checkpoint publish receipt, add receipt service that will take care of receipts filtering

* #211 checkpoint: injected receipt service to block service

* #211 change block receipts representation

* #211 rename receipt to receipt hash in block receipt

* #211 use receipt hash instead of the receipt object

* #211 store whole receipt data instead of hash only

* #211 checkpoint: filter rmr from published receipt table

* #211 remove BlockReceipt and use PublishedReceipt instead

* #211 checkpoint: add published receipt query

* #211 add flatten and recover for intermediate hash structure

* #211 change intermediate hashes from 2d array to 1d array representation to reflect what is possible in the database

* #211 flatten and restore the intermediate hash before processing into the block

* #211 checkpoint: unique recipient on the receipt

* #211 checkpoint: add unique selection

* #211 add timestamp to merkle tree table for sorting latest merkle root

* #211 add unique in receipt selection

* #211 fix generate merkle root from leaf and intermediate hashes function

* #211 fix receipt selection

* #211 add checker for linked receipt

* #211 handle hashing order in calculating the merkle root

* #211 add receipt index when validating the merkle root

* #211 include the receipt index in the tree for validation purpose

* #211 separate published receipt index, and receipt index

* #211 add published_index

* #211 rename index to published_index due to sql keyword

* #211 fix affected tests and implementation from new develop

* #211 update schema commit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
FEATURE New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant