-
Notifications
You must be signed in to change notification settings - Fork 969
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): Add ODS file #3482
Conversation
Lint will be get fixed after linter upgrade #3483 |
8164195
to
dda1b17
Compare
c4550bf
to
60e757e
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## shwap #3482 +/- ##
========================================
Coverage ? 44.10%
========================================
Files ? 291
Lines ? 16891
Branches ? 0
========================================
Hits ? 7450
Misses ? 8572
Partials ? 869 ☔ View full report in Codecov by Sentry. |
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.
First look, still have to go over the logic in square and the file
shares := make([]share.Share, len(original)*2) | ||
copy(shares, original) | ||
copy(shares[len(original):], parity) | ||
return shares, 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.
Feels like there is an optimization opportunity to avoid copying that we can return to later
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 to prealloc shares anyway, so copying is necessary. Can do implicitly by append tho
namespaceBytes := share.GetNamespace(sh) | ||
leave := make([]byte, len(sh)+len(namespaceBytes)) | ||
copy(leave, namespaceBytes) | ||
copy(leave[len(namespaceBytes):], sh) | ||
leaves = append(leaves, leave) |
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.
Is this a refactoring from appends to copies?
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.
I like that you noticed. There was a very nasty mutations bug that took me few hours to fix.
store/file/ods.go
Outdated
col, err := f.readCol(axisIdx, 0) | ||
return eds.AxisHalf{ | ||
Shares: col, | ||
IsParity: false, | ||
}, err | ||
case rsmt2d.Row: | ||
return f.readRow(axisIdx) | ||
row, err := f.readRow(axisIdx) | ||
return eds.AxisHalf{ | ||
Shares: row, | ||
IsParity: false, | ||
}, err | ||
} | ||
return nil, fmt.Errorf("unknown axis") | ||
return eds.AxisHalf{}, fmt.Errorf("unknown axis") |
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.
uber optional nit: dedup
This PR adds ods file, that implements eds.Accessor interface. The file stores ods part of eds on disk and lazily reads data upon request. If requested data is from Q4, it reads full ods in single read and stores it in-memory for later re-use.
This PR adds ods file, that implements eds.Accessor interface. The file stores ods part of eds on disk and lazily reads data upon request. If requested data is from Q4, it reads full ods in single read and stores it in-memory for later re-use.
Based on #3425