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

fix!: Share splitting bug #1111

Merged
merged 6 commits into from
Dec 19, 2022
Merged

Conversation

evan-forbes
Copy link
Member

Overview

fixes the bug described in #1108

the modified tests fails on main. Also see #1110, which we should really get to as soon as we don't have more important things as this code is ancient

closes #1108

Checklist

  • New and updated code has appropriate documentation
  • New and updated code has new and/or updated testing
  • Required CI checks are passing
  • Visual proof for any user facing features like CLI or documentation updates
  • Linked issues closed with keywords

@evan-forbes evan-forbes added bug Something isn't working consensus breaking modifies block validity rules in a way that will break consensus unless all nodes update their rules labels Dec 13, 2022
@evan-forbes evan-forbes self-assigned this Dec 13, 2022
Comment on lines 48 to 51
// force msgIndexes to be the first share index
if len(blobIndexes) != 0 && useShareIndexes {
blobShareStart = int(blobIndexes[0])
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Are we able to specifically add a unit test for this?

Copy link
Member Author

Choose a reason for hiding this comment

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

👍 yeah defo needed, thanks. fails on main
c679765

also #1110 (comment)

rootulp
rootulp previously approved these changes Dec 13, 2022
pkg/shares/share_splitting.go Outdated Show resolved Hide resolved
rahulghangas
rahulghangas previously approved these changes Dec 13, 2022
Co-authored-by: Rootul P <rootulp@gmail.com>
@codecov-commenter
Copy link

Codecov Report

Merging #1111 (c679765) into main (12e77d0) will increase coverage by 0.87%.
The diff coverage is 96.49%.

@@            Coverage Diff             @@
##             main    #1111      +/-   ##
==========================================
+ Coverage   47.43%   48.30%   +0.87%     
==========================================
  Files          71       71              
  Lines        3970     3993      +23     
==========================================
+ Hits         1883     1929      +46     
+ Misses       1915     1898      -17     
+ Partials      172      166       -6     
Impacted Files Coverage Δ
pkg/shares/split_sparse_shares.go 68.26% <0.00%> (ø)
pkg/shares/share_merging.go 80.45% <100.00%> (ø)
pkg/shares/share_splitting.go 73.56% <100.00%> (+13.33%) ⬆️
pkg/shares/shares.go 96.92% <100.00%> (+28.63%) ⬆️
pkg/shares/split_compact_shares.go 84.93% <100.00%> (ø)

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

@@ -62,6 +64,32 @@ func TestMerge(t *testing.T) {
}
}

// TestPadFirstIndexedBlob ensures that we are adding padding to the first share
// instead of calculating the value.
Copy link
Collaborator

Choose a reason for hiding this comment

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

[non-blocking] sorry I don't understand what "calculating the value" means in this context. Do you mind elaborating? It doesn't strictly have to go into the comment b/c I don't want to block this PR's merge.

Copy link
Member Author

Choose a reason for hiding this comment

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

calculate using the non-interactive defaults, previously this is what it was doing. The estimation process was accurate enough that this was the case the vast majority of the time, but not for all cases.

@evan-forbes evan-forbes merged commit 328e72c into main Dec 19, 2022
@evan-forbes evan-forbes deleted the evan/fix-share-splitting-bug-main branch December 19, 2022 12:27
@evan-forbes evan-forbes added this to the Incentivized Testnet milestone Dec 19, 2022
rootulp added a commit to rootulp/celestia-app that referenced this pull request Dec 19, 2022
## Overview

fixes the bug described in celestiaorg#1108

the modified tests fails on main. Also see celestiaorg#1110, which we should really
get to as soon as we don't have more important things as this code is
ancient

closes celestiaorg#1108

## Checklist

- [x] New and updated code has appropriate documentation
- [x] New and updated code has new and/or updated testing
- [x] Required CI checks are passing
- [x] Visual proof for any user facing features like CLI or
documentation updates
- [x] Linked issues closed with keywords

Co-authored-by: Rootul P <rootulp@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working consensus breaking modifies block validity rules in a way that will break consensus unless all nodes update their rules
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug: Share splitting with use the incorrect index when many small blobs are submitted
5 participants