Skip to content
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

feat: throw error when parsing unsupported share version #837

Merged
merged 4 commits into from
Oct 5, 2022

Conversation

rootulp
Copy link
Collaborator

@rootulp rootulp commented Oct 4, 2022

Closes #830 specifically:

Alternatively, if we don't want this to be a ProcessProposal validity rule, we can enforce this type of check when we parse the data square back into block data (e.g. here)

@rootulp rootulp requested a review from rach-id October 4, 2022 19:00
@rootulp rootulp self-assigned this Oct 4, 2022
@rootulp rootulp marked this pull request as ready for review October 4, 2022 19:13
Copy link
Member

@rach-id rach-id left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

utAck, LGTM, some questions to understand more

pkg/shares/utils.go Outdated Show resolved Hide resolved
pkg/shares/parse_compact_shares.go Outdated Show resolved Hide resolved
pkg/appconsts/appconsts.go Outdated Show resolved Hide resolved
// intermediate state roots, or evidence. The returned [][]byte do not have
// namespaces, info bytes, data length delimiter, or unit length
// delimiters and are ready to be unmarshalled
func parseCompactShares(shares [][]byte) (data [][]byte, err error) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Non Blocking][Question]
Where is this actually called? I found it being used in func Merge(eds...), but I don't see this latter being used anywhere

Copy link
Collaborator Author

@rootulp rootulp Oct 5, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where is this actually called?

  1. https://github.com/rootulp/celestia-app/blob/24ddfce6c6b523f4e0dc5de6dd780bc3ad5ed272/pkg/shares/share_merging.go#L80
  2. https://github.com/rootulp/celestia-app/blob/24ddfce6c6b523f4e0dc5de6dd780bc3ad5ed272/pkg/shares/share_merging.go#L80

which get called from func Merge(eds...) like you said. I also don't see Merge used anywhere outside tests. Couldn't find its usage in celestia-node either

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As far as I understand, this was moved from core to app as it was mainly used in app. And, this was done prior to non-interactive defaults as intended to be used by that.
I don't want to mention Evan as he's on vacation and if I mention him, he will respond :D

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed. It seems non-blocking to find usage of this Merge(eds...) function so I think this can merge irrespective of investigating that further

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we create an issue for that so that we remmeber it? or just keep it in mind until Evan is back?
I am fine with any. Approooving

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Created #840

@rootulp rootulp requested a review from rach-id October 5, 2022 16:08
@rootulp rootulp mentioned this pull request Oct 5, 2022
@rootulp rootulp merged commit d8a9272 into celestiaorg:main Oct 5, 2022
@rootulp rootulp deleted the rp/unsupported-share-version branch October 5, 2022 19:26
rach-id added a commit to rach-id/celestia-app that referenced this pull request Nov 16, 2022
…#837)

Closes celestiaorg#830
specifically:

> Alternatively, if we don't want this to be a ProcessProposal validity
rule, we can enforce this type of check when we parse the data square
back into block data (e.g.
[here](https://github.com/celestiaorg/celestia-app/blob/6b86e91eea1063c27c1ae461eddbe505f778df08/pkg/shares/parse_compact_shares.go#L14))

Co-authored-by: CHAMI Rachid <chamirachid1@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

All shares must contain a share version that belongs to a list of supported versions
2 participants