-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
[move][natives] added batch bulletproof natives #15832
base: main
Are you sure you want to change the base?
[move][natives] added batch bulletproof natives #15832
Conversation
@@ -76,6 +76,7 @@ pub enum FeatureFlag { | |||
GasPayerEnabled, | |||
AptosUniqueIdentifiers, | |||
BulletproofsNatives, | |||
BulletproofsBatchNatives, |
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.
this has to go the end of the list so existing feature -> id mapping remain the same.
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.
oh maybe for this enum it doesn't matter... still recommend put it at the end though
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.
Reordered
@@ -129,6 +251,17 @@ module aptos_std::ristretto255_bulletproofs { | |||
num_bits: u64, | |||
dst: vector<u8>): bool; | |||
|
|||
/// Aborts with `error::invalid_argument(E_DESERIALIZE_RANGE_PROOF)` if `proof` is not a valid serialization of a |
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.
It seems our move api accepts arbitrary bytes as RangeProof
. In case of invalid serialization, better return false
instead of aborting? just from API design perspective.
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.
Made E_DESERIALIZE_RANGE_PROOF
deprecated
@@ -83,8 +93,10 @@ module aptos_std::ristretto255_bulletproofs { | |||
) | |||
} | |||
|
|||
/// Verifies a zero-knowledge range proof that the value `v` committed in `com` (as v * val_base + r * rand_base, | |||
/// for some randomness `r`) satisfies `v` in `[0, 2^num_bits)`. Only works for `num_bits` in `{8, 16, 32, 64}`. | |||
/// Verifies a zero-knowledge range proof for a batch of commitments `comms` (each of the form |
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.
accidentally copied from the batch version?
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.
Thanks, fixed
cc4a57b
to
b07b143
Compare
b07b143
to
49abefc
Compare
@@ -30,7 +30,7 @@ use std::collections::VecDeque; | |||
pub mod abort_codes { | |||
/// Abort code when deserialization fails (leading 0x01 == INVALID_ARGUMENT) | |||
/// NOTE: This must match the code in the Move implementation | |||
pub const NFE_DESERIALIZE_RANGE_PROOF: u64 = 0x01_0001; | |||
pub const _NFE_DESERIALIZE_RANGE_PROOF: u64 = 0x01_0001; |
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.
we can delete.
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.
Done
Description
How Has This Been Tested?
Key Areas to Review
Type of Change
Which Components or Systems Does This Change Impact?
Checklist