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

Add update sparse commitment #149

Merged
merged 8 commits into from
Feb 15, 2024

Conversation

dragan2234
Copy link
Contributor

@dragan2234 dragan2234 commented Feb 12, 2024

Adding updateSparseCommitment with test. This can be merged after #146

Closes #129

public void testUpdateCommitmentSparse() {
// Numbers and result is taken from: https://github.com/crate-crypto/rust-verkle/blob/bb5af2f2fe9788d49d2896b9614a3125f8227818/ffi_interface/src/lib.rs#L576
// Identity element
byte[] old_commitment = new byte[]{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
Copy link
Contributor

Choose a reason for hiding this comment

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

we are more using camelCase convention in this project. I think it will be better to keep the same convenstion everywhere in this code

}

@Test
public void testUpdateCommitmentSparse() {
Copy link
Contributor

Choose a reason for hiding this comment

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

https://github.com/crate-crypto/rust-verkle/blob/bb5af2f2fe9788d49d2896b9614a3125f8227818/ffi_interface/src/lib.rs#L529. maybe we need to add this test. it seems to add only test with commitment which is identity(empty) is just testing a part of the code

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@matkt thanks, added it now

byte[] old_commitment = new byte[]{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};

byte[] old_scalar_new_scalar_index = new byte[]{2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
Copy link
Contributor

Choose a reason for hiding this comment

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

why not having that in hex ? maybe simpler ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@matkt fixed that now too

@matkt
Copy link
Contributor

matkt commented Feb 12, 2024

build is failing because of rust version you need to update

curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain 1.68.2
as we did for https://github.com/dragan2234/besu-native/blob/add-update-sparse-commitment/.github/workflows/build.yml#L30

Signed-off-by: Dragan Pilipovic <draganpilipovic1997bp@gmail.com>
Signed-off-by: Dragan Pilipovic <draganpilipovic1997bp@gmail.com>
Signed-off-by: Dragan Pilipovic <draganpilipovic1997bp@gmail.com>
Signed-off-by: Dragan Pilipovic <draganpilipovic1997bp@gmail.com>
Signed-off-by: Dragan Pilipovic <draganpilipovic1997bp@gmail.com>
Signed-off-by: Dragan Pilipovic <draganpilipovic1997bp@gmail.com>
Signed-off-by: Dragan Pilipovic <draganpilipovic1997bp@gmail.com>
Copy link
Contributor

@matkt matkt left a comment

Choose a reason for hiding this comment

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

LGTM

@gfukushima
Copy link
Contributor

gfukushima commented Feb 14, 2024

Can we merge this? Or we're waiting on something before merging it?

@dragan2234
Copy link
Contributor Author

@gfukushima From my side it's fine to merge, this is needed for the work on Java trie (it's not used currently).

Copy link
Contributor

@matkt matkt left a comment

Choose a reason for hiding this comment

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

LGTM

@matkt matkt merged commit 7198352 into hyperledger:main Feb 15, 2024
11 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.

Add update commitment to ipa_multipoint
3 participants