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: optimize merkle tree hashing (#6513) (#9446) #25

Merged
merged 4 commits into from
Apr 24, 2024

Conversation

czarcas7ic
Copy link
Member

  • crypto/merkle: optimize merkle tree hashing (#6513)

Upstream celestiaorg/celestia-core#351 to optimize merkle tree hashing

benchmark                                 old ns/op     new ns/op     delta
BenchmarkHashAlternatives/recursive-8     22914         21949         -4.21%
BenchmarkHashAlternatives/iterative-8     21634         21939         +1.41%

benchmark                                 old allocs     new allocs     delta
BenchmarkHashAlternatives/recursive-8     398            200            -49.75%
BenchmarkHashAlternatives/iterative-8     399            301            -24.56%

benchmark                                 old bytes     new bytes     delta
BenchmarkHashAlternatives/recursive-8     19088         6496          -65.97%
BenchmarkHashAlternatives/iterative-8     21776         13984         -35.78%

cc @odeke-em @cuonglm

  • update pending log

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

* crypto/merkle: optimize merkle tree hashing (#6513)

Upstream celestiaorg/celestia-core#351 to optimize merkle tree hashing

```
benchmark                                 old ns/op     new ns/op     delta
BenchmarkHashAlternatives/recursive-8     22914         21949         -4.21%
BenchmarkHashAlternatives/iterative-8     21634         21939         +1.41%

benchmark                                 old allocs     new allocs     delta
BenchmarkHashAlternatives/recursive-8     398            200            -49.75%
BenchmarkHashAlternatives/iterative-8     399            301            -24.56%

benchmark                                 old bytes     new bytes     delta
BenchmarkHashAlternatives/recursive-8     19088         6496          -65.97%
BenchmarkHashAlternatives/iterative-8     21776         13984         -35.78%
```

cc @odeke-em @cuonglm

* update pending log

Co-authored-by: Marko <marbar3778@yahoo.com>
@czarcas7ic czarcas7ic added the S:backport/v24 backport to the osmo-v24/v0.37.4 branch label Apr 23, 2024
Comment on lines 53 to 55
if rootHash == nil {
return fmt.Errorf("invalid root hash: cannot be nil")
}
Copy link
Member Author

Choose a reason for hiding this comment

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

Want to verify this is okay, this was not from the PR but was a part of the diff between this and the branch the original feat was merged to.

@czarcas7ic czarcas7ic marked this pull request as ready for review April 23, 2024 03:39
@czarcas7ic czarcas7ic merged commit ae63093 into osmo/v0.37.4 Apr 24, 2024
3 of 16 checks passed
czarcas7ic added a commit that referenced this pull request Apr 24, 2024
…25) (#26)

* crypto/merkle: optimize merkle tree hashing (#6513) (#9446)

* crypto/merkle: optimize merkle tree hashing (#6513)

Upstream celestiaorg/celestia-core#351 to optimize merkle tree hashing

```
benchmark                                 old ns/op     new ns/op     delta
BenchmarkHashAlternatives/recursive-8     22914         21949         -4.21%
BenchmarkHashAlternatives/iterative-8     21634         21939         +1.41%

benchmark                                 old allocs     new allocs     delta
BenchmarkHashAlternatives/recursive-8     398            200            -49.75%
BenchmarkHashAlternatives/iterative-8     399            301            -24.56%

benchmark                                 old bytes     new bytes     delta
BenchmarkHashAlternatives/recursive-8     19088         6496          -65.97%
BenchmarkHashAlternatives/iterative-8     21776         13984         -35.78%
```

cc @odeke-em @cuonglm

* update pending log

Co-authored-by: Marko <marbar3778@yahoo.com>
(cherry picked from commit 8e787f0)

* add changelog

(cherry picked from commit 9e015e0)

* add back rootHash nil check

(cherry picked from commit 4b602f8)

* update changelog

(cherry picked from commit 6b1d05f)

---------

Co-authored-by: JayT106 <JayT106@users.noreply.github.com>
Co-authored-by: Adam Tucker <adamleetucker@outlook.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S:backport/v24 backport to the osmo-v24/v0.37.4 branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants