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

crypto/merkle: Add error handling #558

Merged
merged 13 commits into from
Apr 13, 2023
Merged

crypto/merkle: Add error handling #558

merged 13 commits into from
Apr 13, 2023

Conversation

lasarojc
Copy link
Contributor

@lasarojc lasarojc commented Mar 20, 2023

Contributes to #557


PR checklist

  • Tests written/updated
  • Changelog entry added in .changelog (we use unclog to manage our changelog)
  • Updated relevant documentation (docs/ or spec/) and code comments

@lasarojc lasarojc requested a review from a team as a code owner March 20, 2023 12:34
@lasarojc lasarojc marked this pull request as draft March 20, 2023 12:49
Copy link
Collaborator

@cason cason left a comment

Choose a reason for hiding this comment

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

I think the "problematic" method ComputeRootHash should be made private.

crypto/merkle/proof.go Outdated Show resolved Hide resolved
@lasarojc lasarojc marked this pull request as ready for review March 29, 2023 14:03
@thanethomson thanethomson changed the title Port 10011 crypto/merkle: Add error handling Mar 29, 2023
.changelog/unreleased/breaking-changes/558-tm10011.md Outdated Show resolved Hide resolved
go.mod Outdated Show resolved Hide resolved
@thanethomson
Copy link
Contributor

It seems we have to backport all the way back to v0.34, right?

@adizere
Copy link
Member

adizere commented Apr 1, 2023

It seems we have to backport all the way back to v0.34, right?

Since this involves a Go API change, can it be safely backported without potentially breaking something in the code of users?

@lasarojc
Copy link
Contributor Author

lasarojc commented Apr 5, 2023

We can leave the renaming of the function to avoid the breaking on back ports.

@lasarojc
Copy link
Contributor Author

@adizere I've wrapped the private function into a public one, that panics in the case of error. So there is a change of behavior, but not of interface.
This will be back ported.

In a future PR I will remove the public one.

@thanethomson thanethomson added backport-to-v0.34.x Tell Mergify to backport the PR to v0.34.x backport-to-v0.37.x Tell Mergify to backport the PR to v0.37.x backport-to-v0.38.x Tell Mergify to backport the PR to v0.38.x labels Apr 13, 2023
Copy link
Contributor

@thanethomson thanethomson left a comment

Choose a reason for hiding this comment

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

Excellent, thanks @lasarojc!

@lasarojc lasarojc merged commit d067b74 into main Apr 13, 2023
@lasarojc lasarojc deleted the lasarojc/tm-10011/port-pr branch April 13, 2023 10:30
mergify bot pushed a commit that referenced this pull request Apr 13, 2023
* porting pr

* Disallow nil root hashes

* linting

* making computeRootHash private

* Update release notes.

* Update .changelog/unreleased/breaking-changes/558-tm10011.md

Co-authored-by: Thane Thomson <[email protected]>

* Wrapping the private function into a public one with the old signature.

* update comment

* remove dependency on amino

* Update .changelog/unreleased/breaking-changes/558-tm10011.md

Co-authored-by: Thane Thomson <[email protected]>

---------

Co-authored-by: Thane Thomson <[email protected]>
(cherry picked from commit d067b74)
mergify bot pushed a commit that referenced this pull request Apr 13, 2023
* porting pr

* Disallow nil root hashes

* linting

* making computeRootHash private

* Update release notes.

* Update .changelog/unreleased/breaking-changes/558-tm10011.md

Co-authored-by: Thane Thomson <[email protected]>

* Wrapping the private function into a public one with the old signature.

* update comment

* remove dependency on amino

* Update .changelog/unreleased/breaking-changes/558-tm10011.md

Co-authored-by: Thane Thomson <[email protected]>

---------

Co-authored-by: Thane Thomson <[email protected]>
(cherry picked from commit d067b74)

# Conflicts:
#	crypto/merkle/proof.go
mergify bot pushed a commit that referenced this pull request Apr 13, 2023
* porting pr

* Disallow nil root hashes

* linting

* making computeRootHash private

* Update release notes.

* Update .changelog/unreleased/breaking-changes/558-tm10011.md

Co-authored-by: Thane Thomson <[email protected]>

* Wrapping the private function into a public one with the old signature.

* update comment

* remove dependency on amino

* Update .changelog/unreleased/breaking-changes/558-tm10011.md

Co-authored-by: Thane Thomson <[email protected]>

---------

Co-authored-by: Thane Thomson <[email protected]>
(cherry picked from commit d067b74)

# Conflicts:
#	crypto/merkle/proof.go
#	crypto/merkle/proof_test.go
@lasarojc lasarojc mentioned this pull request Apr 13, 2023
3 tasks
lasarojc added a commit that referenced this pull request Apr 13, 2023
* porting pr

* Disallow nil root hashes

* linting

* making computeRootHash private

* Update release notes.

* Update .changelog/unreleased/breaking-changes/558-tm10011.md

Co-authored-by: Thane Thomson <[email protected]>

* Wrapping the private function into a public one with the old signature.

* update comment

* remove dependency on amino

* Update .changelog/unreleased/breaking-changes/558-tm10011.md

Co-authored-by: Thane Thomson <[email protected]>

---------

Co-authored-by: Thane Thomson <[email protected]>
(cherry picked from commit d067b74)

Co-authored-by: Lasaro <[email protected]>
lasarojc added a commit that referenced this pull request Apr 13, 2023
* crypto/merkle: Add error handling (#558)

* porting pr

* Disallow nil root hashes

* linting

* making computeRootHash private

* Update release notes.

* Update .changelog/unreleased/breaking-changes/558-tm10011.md

Co-authored-by: Thane Thomson <[email protected]>

* Wrapping the private function into a public one with the old signature.

* update comment

* remove dependency on amino

* Update .changelog/unreleased/breaking-changes/558-tm10011.md

Co-authored-by: Thane Thomson <[email protected]>

---------

Co-authored-by: Thane Thomson <[email protected]>
(cherry picked from commit d067b74)

# Conflicts:
#	crypto/merkle/proof.go
#	crypto/merkle/proof_test.go

* fix conflicts

---------

Co-authored-by: Lasaro <[email protected]>
lasarojc added a commit that referenced this pull request Apr 13, 2023
* crypto/merkle: Add error handling (#558)

* porting pr

* Disallow nil root hashes

* linting

* making computeRootHash private

* Update release notes.

* Update .changelog/unreleased/breaking-changes/558-tm10011.md

Co-authored-by: Thane Thomson <[email protected]>

* Wrapping the private function into a public one with the old signature.

* update comment

* remove dependency on amino

* Update .changelog/unreleased/breaking-changes/558-tm10011.md

Co-authored-by: Thane Thomson <[email protected]>

---------

Co-authored-by: Thane Thomson <[email protected]>
(cherry picked from commit d067b74)

# Conflicts:
#	crypto/merkle/proof.go

* fix conflict

---------

Co-authored-by: Lasaro <[email protected]>
thanethomson added a commit that referenced this pull request May 6, 2023
* porting pr

* Disallow nil root hashes

* linting

* making computeRootHash private

* Update release notes.

* Update .changelog/unreleased/breaking-changes/558-tm10011.md

Co-authored-by: Thane Thomson <[email protected]>

* Wrapping the private function into a public one with the old signature.

* update comment

* remove dependency on amino

* Update .changelog/unreleased/breaking-changes/558-tm10011.md

Co-authored-by: Thane Thomson <[email protected]>

---------

Co-authored-by: Thane Thomson <[email protected]>
roy-dydx pushed a commit to dydxprotocol/cometbft that referenced this pull request Jul 11, 2023
* crypto/merkle: Add error handling (cometbft#558)

* porting pr

* Disallow nil root hashes

* linting

* making computeRootHash private

* Update release notes.

* Update .changelog/unreleased/breaking-changes/558-tm10011.md

Co-authored-by: Thane Thomson <[email protected]>

* Wrapping the private function into a public one with the old signature.

* update comment

* remove dependency on amino

* Update .changelog/unreleased/breaking-changes/558-tm10011.md

Co-authored-by: Thane Thomson <[email protected]>

---------

Co-authored-by: Thane Thomson <[email protected]>
(cherry picked from commit d067b74)

# Conflicts:
#	crypto/merkle/proof.go

* fix conflict

---------

Co-authored-by: Lasaro <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-to-v0.34.x Tell Mergify to backport the PR to v0.34.x backport-to-v0.37.x Tell Mergify to backport the PR to v0.37.x backport-to-v0.38.x Tell Mergify to backport the PR to v0.38.x
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

4 participants