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

refactor: remove compact and spare shares #30

Open
rootulp opened this issue Jun 5, 2023 · 2 comments
Open

refactor: remove compact and spare shares #30

rootulp opened this issue Jun 5, 2023 · 2 comments
Labels
enhancement New feature or request

Comments

@rootulp
Copy link
Collaborator

rootulp commented Jun 5, 2023

Context

celestiaorg/celestia-app#1880

Problem

Currently the pkg/shares implementation treats compact and spare shares differently. Instead of describing shares as compact or sparse, one can describe all shares as using the sparse format with the addition that Celestia transaction & PFB transaction shares encode additional metadata in their blobs (in the form of reserved bytes). In this way we could describe a share structure that applies to all shares and a way of encoding blob data (i.e. the current compact share schema) that enables developers to parse shares in the middle of a sequence.

Proposal

Refactor pkg/shares to treat all shares identically. The high level structure may be:

  1. parse(shares) => share sequences
  2. getBlob(shareSequence) => blob
  3. parseCelestiaTransactions(blob) => transactions or PFB transactions
@cmwaters
Copy link
Collaborator

cmwaters commented Jun 14, 2023

I didn't see this issue beforehand but 100% agree with refactoring it to this structure.

My personal preference would be to have another package called aggregate (or combine. I don't really mind the naming) which implements the "compact" part. Thus you would have:

Celestia []Txs -> aggregator -> Blob -> splitter -> []Shares

@rootulp rootulp transferred this issue from celestiaorg/celestia-app Feb 5, 2024
@rootulp
Copy link
Collaborator Author

rootulp commented Jul 18, 2024

I briefly explored this issue and the CompactShareSplitter can't easily be decoupled from share indexes because it is aware of ShareRanges. If we remove the index from PFB txs (CIP-20) then this refactor becomes significantly easier / cleaner.

Separately, we're punting this refactor for now to work on higher priority issues.

@rootulp rootulp removed their assignment Jul 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants