-
Notifications
You must be signed in to change notification settings - Fork 198
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
[disperser] Return commitment as a struct #223
[disperser] Return commitment as a struct #223
Conversation
c28ab33
to
19ef534
Compare
19ef534
to
7929d22
Compare
894ba5f
to
f38cf8a
Compare
api/proto/disperser/disperser.proto
Outdated
@@ -179,6 +179,13 @@ enum BlobStatus { | |||
INSUFFICIENT_SIGNATURES = 5; | |||
} | |||
|
|||
message Commitment { |
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.
Disperser API change
api/proto/node/node.proto
Outdated
@@ -105,15 +105,33 @@ message Bundle { | |||
repeated bytes chunks = 1; | |||
} | |||
|
|||
message G1Commitment { |
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.
Node API change
@@ -121,10 +121,10 @@ func (b *BlobHeader) EncodedSizeAllQuorums() int64 { | |||
|
|||
// BlomCommitments contains the blob's commitment, degree proof, and the actual degree. | |||
type BlobCommitments struct { |
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.
BlobCommitments
data structure change
type Commitment struct { | ||
*bn254.G1Point | ||
} | ||
type G1Commitment bn254.G1Point |
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.
G1Commitment
& G2Commitment
are typed as G1Point
and G2Point
.
They're not being type aliased so that we can add instance methods such as Serialize
and Deserialize
.
d7ed800
to
e449d6c
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.
looks good!
e449d6c
to
16230e2
Compare
16230e2
to
b319aaf
Compare
Why are these changes needed?
In the external API, the commitment in blob header was being returned as serialized bytes. This serialization is done using
glob
library which is part of go's standard library. For those using other languages, it would be difficult to deserialize these bytes withoutglob
library implemented in that language.Commitment
,LengthCommitment
, andLengthProof
Note: this is a breaking change for rollups. While this kind of backward incompatible change in the API isn't ideal, this is added as an exception as we want to keep the API as close to what will be shipped on production (mainnet), and not many rollups have been integrated using the existing API yet.
Checks