Change Bundle::receipts from Vec<Receipt> to Receipt#1528
Merged
Conversation
Pure refactoring with some dead code removed Signed-off-by: linning <linningde25@gmail.com>
Load the receipt at (head_receipt_number + One::one()).min(available_best_receipt_number) for bundle construction, this commit also skip domain slot if the primary block number is zero such that we don't need to construct a dummy receipt (and all the special handling) in this case, and make the code cleaner. Signed-off-by: linning <linningde25@gmail.com>
Signed-off-by: linning <linningde25@gmail.com>
Signed-off-by: linning <linningde25@gmail.com>
liuchengxu
reviewed
Jun 10, 2023
Contributor
liuchengxu
left a comment
There was a problem hiding this comment.
Look good to me as a refactoring towards the next step, TODOs are fine, I believe we'll rewrite a lot of things once spec is done.
Signed-off-by: linning <linningde25@gmail.com>
liuchengxu
reviewed
Jun 12, 2023
Contributor
liuchengxu
left a comment
There was a problem hiding this comment.
We're good to go once the conflicts (should be renamings caused by #1531) are resolved.
i1i1
added a commit
to autonomys/subspace-pulsar-sdk
that referenced
this pull request
Jun 22, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
close #1512
This PR change Bundle::receipts from Vec to Receipt, mostly refactoring with some notable changes in the client:
Vec<Receipt>toReceipt, we can use a dummy receipt but it will bring a lot of special handling for this receipt thus I chose to simply skip the slot to make life easier.(head_receipt_number + One::one()).min(available_best_receipt_number)for bundle construction, it mostly matches our design except that in some caseavailable_best_receipt_numbermay point to an older receipt than the current head receipt, that may required non-trivial work to handle, I have left a TODO for now.Code contributor checklist: