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: EDSStore definition and constructor #1107

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

share: EDSStore definition and constructor #1107

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

Comments

@Wondertan
Copy link
Member

Wondertan commented Sep 15, 2022

Context

FNs/BNs keep an EDSStore to manage every EDS on the disk. The EDSStore type is introduced in the share pkg. Each EDS, together with its Merkle Proofs, serializes into a CARv1 file. All the serialized CARv1 file blobs are mounted on DAGStore via Local FS Mounts and registered as Shards.

The introduced EDSStore also maintains (via DAGStore) a top-level index enabling granular and efficient random access to every share and/or Merkle proof over every registered CARv1 file. The EDSStore provides a custom Blockstore interface implementation to achieve access. The main use-case is randomized sampling over the whole chain of EDS block data and getting data by namespace.

Implementation Details

NOTES:

  • EDSStore should have lifecycle methods(Start/Stop).
  • The approximate definition is given below and may change in the actual implementation.
type EDSStore struct {
 basepath string 
 dgstr dagstore.DAGStore
 topIdx index.Inverted 
 carIdx index.FullIndexRepo
 mounts  *mount.Registry
 ...
}

// NewEDSStore constructs EDStore over OS directory to store CARv1 files of EDSes and indices for them.
// Datastore is used to keep the inverted/top-level index.
func NewEDSStore(basepath string, ds datastore.Batching) *EDSStore {
 topIdx := index.NewInverted(datastore)
 carIdx := index.NewFSRepo(basepath + "/index")
 mounts := mount.NewRegistry()
 r := mount.NewRegistry()
 err = r.Register("fs", &mount.FSMount{FS: os.DirFS(basePath + "/eds/")}) // registration is a must 
 if err != nil {
  panic(err)
 }
 
 return &EDSStore{
  basepath: basepath,
  dgst: dagstore.New(dagstore.Config{...}),
  topIdx: index.NewInverted(datastore),
  carIdx: index.NewFSRepo(basepath + "/index")
  mounts: mounts,
 }   
}

Refs

Depends on #878

@Wondertan Wondertan added the area:shares Shares and samples label 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 Nov 9, 2022
@distractedm1nd distractedm1nd self-assigned this Nov 9, 2022
distractedm1nd pushed a commit that referenced this issue Nov 23, 2022
Co-authored-by: rene <41963722+renaynay@users.noreply.github.com>
Co-authored-by: Hlib Kanunnikov <hlibwondertan@gmail.com>
Closes #1107
Closes #1108
Closes #1110
Closes #1111
Closes #1112
Repository owner moved this from In Review to Done in Celestia Node Nov 23, 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.

2 participants