-
Notifications
You must be signed in to change notification settings - Fork 19
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
types: blob - extract createcommitment #32
Conversation
There seems to be an issue that happens only when passing commitment:
Edit: Fixed. We're reusing |
@tuxcanfly can you split the code in types/blob/commitment.go to multiple files? its too large and not a good idea to dump everything to one file. you can retain the structure/names as in celestia-app or make up your own meaningful structure/names. |
@gupadhyaya Done. Also modified appns.New(blob.NamespaceVersion, blob.NamespaceID) becomes namespace.From(blob.Namespace) As a reminder, type Blob struct {
// NamespaceVersion is the version of the namespace. Used in conjunction
// with NamespaceID to determine the namespace of this blob.
NamespaceVersion uint8
// NamespaceID defines the namespace ID of this blob. Used in conjunction
// with NamespaceVersion to determine the namespace of this blob.
NamespaceID []byte
// Data is the actual data of the blob.
// (e.g. a block of a virtual sidechain).
Data []byte
// ShareVersion is the version of the share format that this blob should use
// when encoded into shares.
ShareVersion uint8
} while type Blob struct {
types.Blob `json:"blob"`
Commitment Commitment `json:"commitment"`
// the celestia-node's namespace type
// this is to avoid converting to and from app's type
namespace share.Namespace
} where // Namespace represents namespace of a Share.
// Consists of version byte and namespace ID.
type Namespace []byte Since we need to pass the combined tldr: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM: just resolve any of my previous comments once the corresponding issues have been created in app
9c3113a
to
2d4e8d9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe we could add a readme that has a brief explanation of why the code is currently here, and also points to the original code. That might help the folks that are source diving and trying to link this code to the rest of what is going on.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll defer to other reviewers, but I didn't see anything weird or out of the ordinary 🙂
wip: rm share dep; blob test
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you !
Overview
This PR extracts
CreateCommitment
fromcelestia-app
. This can be used to submit blob commitments with minimal dependencies.Fixes #25
Checklist