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

fix(types): Implement nil check on commit.ValidateBasic #1094

Merged

Conversation

renaynay
Copy link
Member

Found in celestia-node header validation check. If a malformed ExtendedHeader with a nil Commit is broadcasted through the network, it would cause recipients to panic. We decided the check belongs in core as ValidatorSet also does a nil check.

…il commit will short-circuit without causing panic
Copy link
Contributor

@cmwaters cmwaters left a comment

Choose a reason for hiding this comment

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

I'll see if we can upstream this

@cmwaters
Copy link
Contributor

Probably doesn't make too much sense because the checks are all prior to the ValidateBasic call:

https://github.com/cometbft/cometbft/blob/0459474fed602545a5fcc373e5d36a1e04083a8a/types/block.go#L68

@Wondertan
Copy link
Member

Wondertan commented Sep 25, 2023

It make sense to remove the call from there and keep it inside of ValidateBasic. Also, SignedHeader does the same check that could be moved. The main reason is to be consistent with other ValidateBasics that do the nil check internally

@evan-forbes evan-forbes merged commit 13b9e92 into celestiaorg:main Sep 25, 2023
14 checks passed
cmwaters pushed a commit that referenced this pull request Sep 28, 2023
Found in celestia-node header validation check. If a malformed
`ExtendedHeader` with a nil Commit is broadcasted through the network,
it would cause recipients to panic. We decided the check belongs in core
as ValidatorSet also does a nil check.
evan-forbes pushed a commit that referenced this pull request Sep 28, 2023
Found in celestia-node header validation check. If a malformed
`ExtendedHeader` with a nil Commit is broadcasted through the network,
it would cause recipients to panic. We decided the check belongs in core
as ValidatorSet also does a nil check.
@faddat faddat mentioned this pull request Feb 22, 2024
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants