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

Fail when writing key lengths >= 256 bytes to Store #90

Merged
merged 4 commits into from Oct 25, 2021

Conversation

mappum
Copy link
Contributor

@mappum mappum commented Oct 18, 2021

This is an easy safety fix to prevent a case where a key >= 256 bytes written to the store will cause the entire block to fail when writing to merk.

Will wait to merge this after #79 (will require changing the returned error) in the interest of not keeping that PR open forever.

Closes #61

In the future, we can do a better form of checking at compile-time once ed has some sort of const generic length encoding length fields.

@codecov-commenter
Copy link

codecov-commenter commented Oct 20, 2021

Codecov Report

Merging #90 (b3a4984) into develop (b7ed050) will decrease coverage by 0.00%.
The diff coverage is 50.00%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop      #90      +/-   ##
===========================================
- Coverage    55.89%   55.89%   -0.01%     
===========================================
  Files           39       39              
  Lines         3136     3138       +2     
===========================================
+ Hits          1753     1754       +1     
- Misses        1383     1384       +1     
Impacted Files Coverage Δ
src/store/store.rs 94.73% <50.00%> (-1.63%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b7ed050...b3a4984. Read the comment docs.

@mappum mappum merged commit 1aaf003 into develop Oct 25, 2021
@mappum mappum deleted the assert-key-length branch October 25, 2021 18:27
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.

Prevent keys with length >= 256
2 participants