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

chore!: consistent share prefix for tail padding #1353

Merged
merged 2 commits into from
Feb 8, 2023

Conversation

rootulp
Copy link
Collaborator

@rootulp rootulp commented Feb 7, 2023

Closes #1350

After updating tail padding to have the same share prefix as namespace padding, I realized it was possible to make a few refactors so that all padding is consistent with respect to naming and tests:

  1. Move all 3 types of padding to padding.go
  2. Rename "namespaced padded" => "namespace padding" to conform to "tail padding"
  3. Rename ReservedNamespacePadding => ReservedPaddingNamespaceID to conform to the other appconsts that are namespace IDs
  4. Define a share.IsPadding method

@rootulp rootulp self-assigned this Feb 7, 2023
Comment on lines +28 to +29
0x25, 0x77, 0x60, 0x46, 0x19, 0x93, 0xf8, 0xf1, 0x97, 0xb4, 0x21, 0xec, 0x74, 0x35, 0xf3, 0xc3,
0x6c, 0x37, 0x34, 0x92, 0x3e, 0x3d, 0xa9, 0xa4, 0x2d, 0xc7, 0x3b, 0x5, 0xf0, 0x7b, 0x3d, 0x8,
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

[for reviewers] this hash had to be updated because the schema for tail padding shares is now different which results in a completely different hash.

pkg/da/data_availability_header_test.go Show resolved Hide resolved
@rootulp rootulp marked this pull request as ready for review February 7, 2023 23:07
@codecov-commenter
Copy link

Codecov Report

Merging #1353 (dd0e5f4) into main (990c720) will decrease coverage by 0.04%.
The diff coverage is 92.64%.

@@            Coverage Diff             @@
##             main    #1353      +/-   ##
==========================================
- Coverage   48.31%   48.28%   -0.04%     
==========================================
  Files          79       78       -1     
  Lines        4425     4422       -3     
==========================================
- Hits         2138     2135       -3     
  Misses       2107     2107              
  Partials      180      180              
Impacted Files Coverage Δ
pkg/shares/shares.go 87.50% <90.90%> (-0.66%) ⬇️
pkg/shares/padding.go 93.10% <93.10%> (ø)
pkg/da/data_availability_header.go 78.50% <100.00%> (-1.15%) ⬇️
pkg/shares/parse_sparse_shares.go 64.40% <100.00%> (ø)
pkg/shares/share_splitting.go 75.78% <100.00%> (ø)
pkg/shares/split_sparse_shares.go 65.16% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

Copy link
Member

@evan-forbes evan-forbes left a comment

Choose a reason for hiding this comment

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

nice refactor, it is much appreciated

pkg/da/data_availability_header_test.go Show resolved Hide resolved
@evan-forbes evan-forbes added this to the Mainnet milestone Feb 7, 2023
@rootulp rootulp merged commit 85d9e16 into celestiaorg:main Feb 8, 2023
@rootulp rootulp deleted the rp/consistent-padding branch February 8, 2023 04:12
rootulp added a commit that referenced this pull request Feb 8, 2023
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.

Consider consistent share prefix for all padding shares
3 participants