-
Notifications
You must be signed in to change notification settings - Fork 976
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(ipld/plugin): don't truncate a type byte when it's not in the data #1196
Conversation
nice find |
Should we have a test for this as well? we don't have coverage for Write in the current tests. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree that we should add some test coverage - not only for having tests, but also as a sort of "secondary documentation" showing usage
I'll add a simple test. Re "secondary documentation": this hasher is not supposed to be used outside. |
58afb1c
to
4ada8c0
Compare
Codecov Report
@@ Coverage Diff @@
## main #1196 +/- ##
==========================================
- Coverage 60.25% 55.68% -4.57%
==========================================
Files 161 160 -1
Lines 9736 9509 -227
==========================================
- Hits 5866 5295 -571
- Misses 3337 3688 +351
+ Partials 533 526 -7
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
4ada8c0
to
90562fa
Compare
The code has a special case for the share data with type byte and without. However, it truncates the type byte like it is always there. The #1139 is the first user of share data without a type byte, which uncovered the bug. The type byte causes issues for us again. refactor(ipld/plugin): extract namespaceHasher into a separate file with some additional cleanups In preparation for the upcoming test for the namespaceHasher, we extract it into a separate file. Also, some additional cosmetics were done reducing the API surfuce of the pkg, hiding things that are not supposed to be used outside. test(ipld/plugin): write dummy unit test for the namespaceHasher docs(ipld/plugin): godocs for the namespaceHasher perf(ipld/plugin): use sha256-simd to gain 40% speedup for hash computations
90562fa
to
c9a3b99
Compare
The code has a special case for the share data with type byte and without. However, it truncates the type byte like it is always there.
The #1139 is the first user of share data without a type byte, which uncovered the bug. The type byte causes issues for us again.
refactor(ipld/plugin): extract namespaceHasher into a separate file with some additional cleanups
In preparation for the upcoming test for the namespaceHasher, we extract it into a separate file. Also, some additional cosmetics were done
reducing the API surfuce of the pkg, hiding things that are not supposed to be used outside.
test(ipld/plugin): write dummy unit test for the namespaceHasher
docs(ipld/plugin): godocs for the namespaceHasher
perf(ipld/plugin): use sha256-simd to gain 40% speedup for hash computations