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

Create new share repo #847

Closed
rootulp opened this issue Aug 30, 2022 · 2 comments
Closed

Create new share repo #847

rootulp opened this issue Aug 30, 2022 · 2 comments

Comments

@rootulp
Copy link
Collaborator

rootulp commented Aug 30, 2022

Summary

There exist two copies of share related code.

  1. https://github.com/celestiaorg/celestia-core/blob/v0.34.x-celestia/types/share_splitting.go
  2. https://github.com/celestiaorg/celestia-app/blob/main/pkg/shares/share_splitting.go

Problem Definition

It will be difficult to maintain two copies of this code across separate repos because changes applied to one will not immediately apply to the other. celestia-core needs some share logic (ex. SplitTx) but ideally this application specific logic would live in our application specific repo (celestia-app). celestia-core can't import this code from celestia-app because that would introduce a circular dependency.

Proposal

Create a new repo and public Go module that can be depended on by both celestia-core and celestia-app.

Note: the celestia-app version has been refactored (see celestiaorg/celestia-app#637) so it should likely be the candidate for migration.

Pros

  • Moves share logic out of celestia-core and therefore minimizes the diff between celestia-core and tendermint/tendermint.

Cons

  • Additional version friction when developing across repos. In other words, a change that modifies share logic entails making the change, cutting a new release, bumping to that version in both consuming apps, and then using that change where applicable.

Alternatives

Keep share logic in celestia-core. Delete share logic from celestia-app. Import share code from celestia-core into celestia-app. This works and does involve adding any new dependencies.

Ref: https://github.com/celestiaorg/celestia-app/blob/13076a62c567f624b2508752b7e129467cd71bf9/go.mod#L164

Blocked by

Blocking

@evan-forbes
Copy link
Member

Another thing to note is that the new encoding code relies entirely on the use of malleated transactions, a concept only known to the app. In fact, properly testing the share encoding and decoding logic is impossible with out the use of similar if not identical application logic encoded in PreprocessProposal. This was the entire reason why the splitting and merging logic was moved to the app in the first place.

The best solution is to remove the need for logic in core, and then only keep this logic in the application where it can be properly tested and easily maintained. Unfortunately, this is not possible due to us needing to provide inclusion proofs to txs, and tendermint's keeping the rpc server and block store within its scope instead of the application's (IOTWAL).

@evan-forbes
Copy link
Member

evan-forbes commented Aug 30, 2022

I know I keep changing my preference for what we should do, but given that each option is terrible in its own way, we might want to continue chewing on this and eventually find a solution that isn't.

@rootulp rootulp closed this as not planned Won't fix, can't repro, duplicate, stale Sep 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants