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: validate chunk size is a multiple of 64 bytes #246

Merged
merged 3 commits into from
Jul 10, 2023

Conversation

rootulp
Copy link
Collaborator

@rootulp rootulp commented Jul 7, 2023

Closes #235

@rootulp rootulp self-assigned this Jul 7, 2023
@rootulp rootulp changed the title feat: validate chunk size feat: validate chunk size is a multiple of 64 bytes Jul 7, 2023
@codecov
Copy link

codecov bot commented Jul 7, 2023

Codecov Report

Merging #246 (3a4f72a) into main (658af68) will increase coverage by 0.14%.
The diff coverage is 84.61%.

@@            Coverage Diff             @@
##             main     #246      +/-   ##
==========================================
+ Coverage   78.30%   78.44%   +0.14%     
==========================================
  Files           7        7              
  Lines         553      566      +13     
==========================================
+ Hits          433      444      +11     
- Misses         73       74       +1     
- Partials       47       48       +1     
Impacted Files Coverage Δ
codecs.go 50.00% <ø> (ø)
extendeddatasquare.go 73.48% <77.77%> (+0.31%) ⬆️
leopard.go 80.95% <100.00%> (+2.00%) ⬆️

@rootulp rootulp enabled auto-merge (squash) July 10, 2023 13:19
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.

If we expect codecs to only support one chunk size (i.e. 64 in this case), wouldn't be better if the interface was instead ChunkSize() int and we compared that value with the chunk size provided.

@rootulp rootulp merged commit 964ba61 into celestiaorg:main Jul 10, 2023
@rootulp
Copy link
Collaborator Author

rootulp commented Jul 10, 2023

If we expect codecs to only support one chunk size (i.e. 64 in this case), wouldn't be better if the interface was instead ChunkSize() int and we compared that value with the chunk size provided.

We expect codecs to support more than one chunk size. In this case, leopard supports chunks of size 64, 128, 192, etc.

In other words, leopard supports chunks that are a multiple of 64 bytes.

@rootulp rootulp deleted the rp/validate-chunk-size branch July 10, 2023 14:22
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.

enforce that chunkSize is a multiple of 64
3 participants