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!: increase share size to 512 bytes #850

Merged
merged 6 commits into from
Oct 18, 2022

Conversation

rootulp
Copy link
Collaborator

@rootulp rootulp commented Oct 7, 2022

Closes #825
Opens #883

@rootulp rootulp self-assigned this Oct 7, 2022
@rootulp rootulp changed the title feat: define reserved_bytes.go feat!: increase share size to 512 bytes Oct 7, 2022
@codecov-commenter
Copy link

codecov-commenter commented Oct 9, 2022

Codecov Report

Merging #850 (faca891) into main (ded7346) will increase coverage by 0.14%.
The diff coverage is 83.33%.

@@            Coverage Diff             @@
##             main     #850      +/-   ##
==========================================
+ Coverage   26.15%   26.30%   +0.14%     
==========================================
  Files          75       76       +1     
  Lines        9344     9368      +24     
==========================================
+ Hits         2444     2464      +20     
- Misses       6674     6676       +2     
- Partials      226      228       +2     
Impacted Files Coverage Δ
pkg/shares/split_compact_shares.go 82.16% <80.95%> (+1.11%) ⬆️
pkg/shares/reserved_bytes.go 85.00% <85.00%> (ø)
testutil/testnode/full_node.go 75.29% <100.00%> (ø)
pkg/shares/parse_compact_shares.go 61.66% <0.00%> (-5.00%) ⬇️
pkg/shares/share_merging.go 77.10% <0.00%> (+0.60%) ⬆️

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

Comment on lines -28 to +30
{"random small block square size 4", 0, 1, appconsts.SparseShareContentSize, 4},
{"random small block square size 2", 0, 1, appconsts.SparseShareContentSize, 2},
{"random small block square size 4", 0, 1, appconsts.SparseShareContentSize * 10, 4},
{"random small block w/ 10 normal txs square size 4", 10, 1, appconsts.SparseShareContentSize, 8},
{"random small block w/ 10 normal txs square size 4", 10, 1, appconsts.SparseShareContentSize, 4},
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Since the share size increased, these test cases can fit in slightly smaller square sizes

@@ -30,7 +30,7 @@ const (

// CompactShareReservedBytes is the number of bytes reserved for the location of
// the first unit (transaction, ISR, evidence) in a compact share.
CompactShareReservedBytes = 1
CompactShareReservedBytes = 2
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

needed because #711 (comment)

pkg/da/data_availability_header_test.go Show resolved Hide resolved
pkg/da/data_availability_header_test.go Show resolved Hide resolved
Comment on lines -91 to -95
{
name: "wrong but valid square size",
msg: badSquareSizeMsg,
wantErr: ErrInvalidShareCommit,
},
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I'm not sure why this test fails now. Attempts to fix it result in a different error: ErrInvalidShareCommitments and not ErrInvalidShareCommit.

I don't think this test is still necessary because we test for ErrInvalidShareCommit here but curious for reviewers thoughts.

Copy link
Member

Choose a reason for hiding this comment

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

I think this is just because the after we increase the share size, it makes the commitment to the message the same for different sizes since it can now fit on one row. If we change the test data to create valid pfd with 4000 byte msg instead of 2000, this test passes

@rootulp rootulp marked this pull request as ready for review October 9, 2022 06:06
Copy link
Member

@rach-id rach-id left a comment

Choose a reason for hiding this comment

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

Awesome stuff 🚀
Left some questions.

pkg/da/data_availability_header_test.go Show resolved Hide resolved
pkg/shares/reserved_bytes.go Outdated Show resolved Hide resolved
pkg/shares/reserved_bytes.go Outdated Show resolved Hide resolved
pkg/shares/reserved_bytes.go Outdated Show resolved Hide resolved
pkg/shares/share_splitting_test.go Outdated Show resolved Hide resolved
fix: remove unnecssary conditional
chore: introduce fillShare to differentiate from padShare
Copy link
Member

@rach-id rach-id left a comment

Choose a reason for hiding this comment

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

Approved. Thanks a lot for discussion 🔥
Will defer to Evan to approve it as I'm still exploring this part of the codebase.

@evan-forbes
Copy link
Member

will try to review this soon, and can help debug why TestFuzzPrepareProcessProposal is failing. Likely just a silly oversight in the non-interactive defaults code.

@rootulp
Copy link
Collaborator Author

rootulp commented Oct 10, 2022

It looks like tests on CI have failed for separate issues. Attempt number:

  1. https://github.com/celestiaorg/celestia-app/actions/runs/3215621970/jobs/5256852009#step:6:153
    FAIL: TestIntegrationTestSuite/TestMaxBlockSize (14.41s)
  2. https://github.com/celestiaorg/celestia-app/actions/runs/3215621970/jobs/5258908752#step:6:147
    FAIL: TestFuzzPrepareProcessProposal/randomized_inputs_to_Prepare_and_Process_Proposal#05
  3. https://github.com/celestiaorg/celestia-app/actions/runs/3215621970/jobs/5267387987#step:6:153
    FAIL: TestIntegrationTestSuite/TestMaxBlockSize (16.24s)

Passed on fourth attempt so this PR isn't blocked on #574 but we should do it soon anyway

@evan-forbes
Copy link
Member

evan-forbes commented Oct 10, 2022

this is dooooope, can we keep this as a draft until we plan to merge? I will review as if its not a draft tho

@rootulp rootulp marked this pull request as draft October 10, 2022 22:04
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.

would prefer to try to fix the test as described in the comment, but tbh, I think its fine as well.

this LGTM, I think we're ready to merge when we need to. Have we tried this out with celestia-node yet? perhaps we could just upgrade arabica to v0.8.0 since its basically ready

edit: the tests for celestia-node worked locally after creating an updated branch w/ this change

@rootulp rootulp marked this pull request as ready for review October 17, 2022 23:57
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.

8MB blocks, nbd

@evan-forbes evan-forbes merged commit ecc9423 into celestiaorg:main Oct 18, 2022
@rootulp rootulp deleted the rp/increase-share-size branch October 18, 2022 01:26
rach-id pushed a commit to rach-id/celestia-app that referenced this pull request Nov 16, 2022
Closes celestiaorg#825

This is ready for review but we may not merge it b/c we haven't made a
final decision on what the share size should be

Co-authored-by: evan-forbes <evan.samuel.forbes@gmail.com>
rootulp added a commit that referenced this pull request Dec 12, 2022
Update godoc comment for `FirstCompactShareSequenceLengthBytes` to account for #850
rootulp added a commit that referenced this pull request Dec 13, 2022
Update godoc comment for `FirstCompactShareSequenceLengthBytes` to
account for #850
@evan-forbes evan-forbes added this to the Incentivized Testnet milestone Jan 3, 2023
0xchainlover pushed a commit to celestia-org/celestia-app that referenced this pull request Aug 1, 2024
Update godoc comment for `FirstCompactShareSequenceLengthBytes` to
account for celestiaorg/celestia-app#850
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Create a test branch with a larger share size
4 participants