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!: rejects invalid empty range proofs #180

Merged
merged 8 commits into from
Apr 25, 2023

Conversation

staheri14
Copy link
Contributor

@staheri14 staheri14 commented Apr 21, 2023

Overview

Resolves #164

Checklist

  • New and updated code has appropriate documentation
  • New and updated code has new and/or updated testing
  • Required CI checks are passing
  • Visual proof for any user facing features like CLI or documentation updates
  • Linked issues closed with keywords

@staheri14 staheri14 self-assigned this Apr 21, 2023
@staheri14 staheri14 changed the title feat!: updates the definition of an empty proof in VerifyNamespace feat!: updates the definition of empty proof in VerifyNamespace Apr 21, 2023
@codecov
Copy link

codecov bot commented Apr 21, 2023

Codecov Report

Merging #180 (9e3d8de) into master (0c70c1b) will increase coverage by 0.05%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master     #180      +/-   ##
==========================================
+ Coverage   94.04%   94.09%   +0.05%     
==========================================
  Files           5        5              
  Lines         537      542       +5     
==========================================
+ Hits          505      510       +5     
  Misses         18       18              
  Partials       14       14              
Impacted Files Coverage Δ
proof.go 87.50% <100.00%> (+0.47%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@staheri14 staheri14 changed the title feat!: updates the definition of empty proof in VerifyNamespace feat!: rejects invalid empty range proofs Apr 24, 2023
@staheri14 staheri14 marked this pull request as ready for review April 24, 2023 23:04
rootulp
rootulp previously approved these changes Apr 25, 2023
proof_test.go Outdated Show resolved Hide resolved
proof_test.go Outdated Show resolved Hide resolved
evan-forbes
evan-forbes previously approved these changes Apr 25, 2023
Copy link
Member

@evan-forbes evan-forbes left a comment

Choose a reason for hiding this comment

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

👍 👍 LGTM

@staheri14 staheri14 dismissed stale reviews from evan-forbes and rootulp via 8a27636 April 25, 2023 16:06
evan-forbes
evan-forbes previously approved these changes Apr 25, 2023
cmwaters
cmwaters previously approved these changes Apr 25, 2023
Copy link

@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.

👍

proof.go Outdated
Comment on lines 109 to 110
// IsOfEmptyProof checks whether the proof corresponds to an empty proof as defined in NMT specifications https://github.com/celestiaorg/nmt/blob/master/docs/spec/nmt.md.
func (proof Proof) IsOfEmptyProof() bool {

Choose a reason for hiding this comment

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

Suggested change
// IsOfEmptyProof checks whether the proof corresponds to an empty proof as defined in NMT specifications https://github.com/celestiaorg/nmt/blob/master/docs/spec/nmt.md.
func (proof Proof) IsOfEmptyProof() bool {
// IsEmptyProof checks whether the proof corresponds to an empty proof as defined in NMT specifications https://github.com/celestiaorg/nmt/blob/master/docs/spec/nmt.md.
func (proof Proof) IsEmptyProof() bool {

nit

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you for your suggestion. The reason behind this naming is to maintain consistency with the IsOfAbsence() function, that implements a similar logic.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh, I see your point, renamed it in 9e3d8de

@staheri14 staheri14 dismissed stale reviews from cmwaters and evan-forbes via 9e3d8de April 25, 2023 20:37
@staheri14 staheri14 merged commit 21c6427 into master Apr 25, 2023
@staheri14 staheri14 deleted the redefines-empty-namespace-proof branch April 25, 2023 21:12
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.

VerifyNamespace panics if called on an empty range, but with non-empty nodes
4 participants