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

Use serialized bytes for commitments proto #851

Merged

Conversation

ian-shim
Copy link
Contributor

Why are these changes needed?

Instead of specifying each field of G1/G2 commitment, use serialized bytes to represent them like it does for encoding today.

Checks

  • I've made sure the lint is passing in this PR.
  • I've made sure the tests are passing. Note that there might be a few flaky tests, in that case, please comment that they are not relevant.
  • I've checked the new test coverage and the coverage percentage didn't drop.
  • Testing Strategy
    • Unit tests
    • Integration tests
    • This PR is not tested :(

@@ -9,24 +9,13 @@ message G1Commitment {
bytes y = 2;
}

message G2Commitment {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

shouldn't be used other than in BlobCommitment in this file, which isn't in production use

// The A1 element of the Y coordinate of G2 point.
bytes y_a1 = 4;
}

// BlobCommitment represents commitment of a specific blob, containing its
// KZG commitment, degree proof, the actual degree, and data length in number of symbols.
message BlobCommitment {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

only used in v2 protos, not in production use

@ian-shim ian-shim marked this pull request as ready for review October 31, 2024 01:14
@ian-shim ian-shim mentioned this pull request Oct 31, 2024
6 tasks
@@ -7,7 +7,8 @@ service Encoder {
rpc EncodeBlob(EncodeBlobRequest) returns (EncodeBlobReply) {}
}

// BlomCommitments contains the blob's commitment, degree proof, and the actual degree
// BlobCommitments contains the blob's commitment, degree proof, and the actual degree
// DEPRECATED: use common.BlobCommitment instead
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copying this existing scheme in common instead of moving because this is currently being used by encoders

Copy link
Contributor

Choose a reason for hiding this comment

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

Once we are fully on v2 we can remove this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes!

G2Commitment length_commitment = 2;
G2Commitment length_proof = 3;
uint32 data_length = 4;
bytes commitment = 1;
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: can we make sure the spacing is consistent in the file

@@ -7,7 +7,8 @@ service Encoder {
rpc EncodeBlob(EncodeBlobRequest) returns (EncodeBlobReply) {}
}

// BlomCommitments contains the blob's commitment, degree proof, and the actual degree
// BlobCommitments contains the blob's commitment, degree proof, and the actual degree
// DEPRECATED: use common.BlobCommitment instead
Copy link
Contributor

Choose a reason for hiding this comment

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

Once we are fully on v2 we can remove this?

@ian-shim ian-shim force-pushed the commitments-proto-serialized-bytes branch from cc0f8b2 to 9856181 Compare October 31, 2024 03:25
@ian-shim ian-shim merged commit b22ddf2 into Layr-Labs:master Oct 31, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants