-
Notifications
You must be signed in to change notification settings - Fork 971
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(shwap/ods_file): tail padding trim #3620
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice trick with io.EOF triggering padding!
4cccb18
to
5a4dff4
Compare
5a4dff4
to
5b76ed5
Compare
5ccec35
to
e242456
Compare
21198cc
to
9e6bcb9
Compare
a8c83e7
to
4ee148f
Compare
share/new_eds/testing.go
Outdated
func testEDSes(t *testing.T, size int) map[string]*rsmt2d.ExtendedDataSquare { | ||
fullEDS := edstest.RandEDS(t, size) | ||
|
||
padding := rand.IntN(size * size) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be at least 1 padding share
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
for i := range shares { | ||
shares[i] = axsData[i*shrLn : (i+1)*shrLn] | ||
if i > shrsRead-1 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just curious, where is -1 comes from?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
number of read shares starts from 1, while i
from 0, so shrsRead
has to be shifted
if share.GetNamespace(shr).Equals(share.TailPaddingNamespace) { | ||
return nil | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need test for ods file to ensure file store was actually trimmed
37648e7
to
2e27c60
Compare
Besides it parrallelizes the test to run them quicker
Implements tail padding share trimming a.k.a. compression with supporting changes. The actual trimming logic turned out extremely simple and does not even require any form of indexing.
Implements tail padding share trimming a.k.a. compression with supporting changes. The actual trimming logic turned out extremely simple and does not even require any form of indexing. (896bdd3)
This PR is reviewable commit-by-commit and is supposed to merge as so.
Depends on #3643