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

share: ReadEDS #1104

Closed
Tracked by #1099
Wondertan opened this issue Sep 15, 2022 · 0 comments · Fixed by #1158
Closed
Tracked by #1099

share: ReadEDS #1104

Wondertan opened this issue Sep 15, 2022 · 0 comments · Fixed by #1158
Labels
area:shares Shares and samples

Comments

@Wondertan
Copy link
Member

Wondertan commented Sep 15, 2022

Context

As per #1099, we want to store EDSes as a whole. For this, the CAR format is chosen.

Implementation Details

To read an EDS from a stream/file, ReadEDS is introduced. Internally, it

  • Imports EDS with an empty pre-allocated slice. NOTE: Size can be taken from DataRoot Row/Col len
  • Wraps given io.Reader with BlockReader
  • Reads out blocks one by one and fills up the EDS quadrant via EDS.SetCell
    • In total, there should be shares-in-quadrant amount of reads.
  • Recomputes and validates via EDS.Repair
// ReadEDS reads an EDS quadrant(1/4) from an io.Reader CAR file.
// It expects strictly first EDS quadrant(top left).
// The returned EDS is guaranteed to be full and valid against the DataRoot, otherwise ReadEDS errors.
func ReadEDS(context.Context, io.Reader, DataRoot) (*rsmt2d.ExtendedDataSquare, error)
@Wondertan Wondertan added the area:shares Shares and samples label Sep 15, 2022
This was referenced Sep 15, 2022
@Wondertan Wondertan moved this to TODO in Celestia Node Sep 16, 2022
@distractedm1nd distractedm1nd moved this from TODO to In Review in Celestia Node Sep 23, 2022
distractedm1nd added a commit that referenced this issue Oct 20, 2022
Repository owner moved this from In Review to Done in Celestia Node Oct 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:shares Shares and samples
Projects
No open projects
Archived in project
Development

Successfully merging a pull request may close this issue.

1 participant