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

refactoring!(state): extend SubmitPayForBlob method #1963

Conversation

vgonkivs
Copy link
Member

@vgonkivs vgonkivs commented Mar 24, 2023

Overview

Resolves #1840

Checklist

  • New and updated code has appropriate documentation
  • New and updated code has new and/or updated testing
  • Required CI checks are passing
  • Visual proof for any user facing features like CLI or documentation updates
  • Linked issues closed with keywords

@vgonkivs vgonkivs added area:state Related to fetching state and state execution kind:break! Attached to breaking PRs kind:refactor Attached to refactoring PRs labels Mar 24, 2023
@vgonkivs vgonkivs self-assigned this Mar 24, 2023
@codecov-commenter
Copy link

codecov-commenter commented Mar 24, 2023

Codecov Report

❗ No coverage uploaded for pull request base (feature_branch_blob_module@f5f5efb). Click here to learn what that means.
The diff coverage is n/a.

@@                      Coverage Diff                      @@
##             feature_branch_blob_module    #1963   +/-   ##
=============================================================
  Coverage                              ?   54.55%           
=============================================================
  Files                                 ?      216           
  Lines                                 ?    14021           
  Branches                              ?        0           
=============================================================
  Hits                                  ?     7649           
  Misses                                ?     5553           
  Partials                              ?      819           

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

state/core_access.go Outdated Show resolved Hide resolved
@vgonkivs vgonkivs requested a review from Wondertan March 24, 2023 12:40
Wondertan
Wondertan previously approved these changes Mar 27, 2023
Copy link
Collaborator

@distractedm1nd distractedm1nd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm worried about adding app types to the API. This means that someone wanting to use our client will now need to also import app. This endpoint was already a bit difficult to use, because users need to construct a namespace.ID, and the fee parameter is a string (math.Int), while gasLim is a uint64. This is just bad UX :/

I am wondering what the best alternative would be. I would handle the complexity inside of node and maybe create our own simple blob type to avoid imports for the user. Do users really need to know about the ShareVersion?

Do you have thoughts on changing the signature to
func SubmitPayForBlobs(ctx context.Context, fee, gasLim uint64, blobs ...blob.Blob) (*state.TxResponse, error)?

@Wondertan
Copy link
Member

  • Those who use us must import the app whether we rely on the type or not.
  • We cannot make state dependant on blob as blob is supposed to depend on it.
    • However, I assumed the modblob, and if we can make the root level blob with blob definition, we might avoid cyclical dependency
    • Yeah, state would depend on blob , and modblob would depend on it. No cyclic dep between modblob and state, so I think we should do it.
    • We can merge this one, then introduce blob with the same blob and update this one or punt this PR until we make blob, up to @vgonkivs

@vgonkivs
Copy link
Member Author

My idea was to merge this one and then update it after introducing the blob struct

Copy link
Member

@renaynay renaynay left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would actually prefer we hold off on breaking API right now (at least before next release).

@vgonkivs
Copy link
Member Author

vgonkivs commented Apr 4, 2023

Created a feature branch for the Blob Module. So, I can merge everything there and then we can test it

@vgonkivs vgonkivs changed the base branch from main to feature_branch_blob_module April 4, 2023 08:45
@vgonkivs
Copy link
Member Author

vgonkivs commented Apr 4, 2023

I'm worried about adding app types to the API

I agree here with you. We've discussed with Evan extracting the Blob type to a separate repo, so, we can re-use it. But it's not a high priority rn. I'd suggest leaving app types for now, keeping in mind that they will be changed in the future. (After extracting we can rework basic types)

@distractedm1nd

state/core_access.go Outdated Show resolved Hide resolved
@vgonkivs vgonkivs merged commit 18cb0c0 into celestiaorg:feature_branch_blob_module Apr 5, 2023
vgonkivs added a commit to vgonkivs/celestia-node that referenced this pull request Apr 11, 2023
vgonkivs added a commit to vgonkivs/celestia-node that referenced this pull request May 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:state Related to fetching state and state execution kind:break! Attached to breaking PRs kind:refactor Attached to refactoring PRs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

state: SubmitPayForBlob should support multiple blobs
6 participants