From da035740c1302af86c429b5642cc1fd7bbf5766f Mon Sep 17 00:00:00 2001 From: raychu86 <14917648+raychu86@users.noreply.github.com> Date: Mon, 16 Oct 2023 19:11:55 -0400 Subject: [PATCH 001/298] Check unconfirmed transaction ids in check_subdag_transmissions --- ledger/block/src/verify.rs | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/ledger/block/src/verify.rs b/ledger/block/src/verify.rs index 3af7a20b9a..0b77a6ea71 100644 --- a/ledger/block/src/verify.rs +++ b/ledger/block/src/verify.rs @@ -486,8 +486,10 @@ impl Block { ) -> Result<()> { // Prepare an iterator over the solution IDs. let mut solutions = solutions.as_ref().map(|s| s.deref()).into_iter().flatten().peekable(); - // Prepare an iterator over the transaction IDs. - let mut transaction_ids = transactions.transaction_ids().peekable(); + // Prepare an iterator over the unconfirmed transaction IDs. + let unconfirmed_transaction_ids: Vec<_> = + transactions.iter().map(|confirmed| confirmed.to_unconfirmed_transaction_id()).try_collect()?; + let mut unconfirmed_transaction_ids = unconfirmed_transaction_ids.iter().peekable(); // Initialize a list of already seen transmission IDs. let mut seen_transmission_ids = HashSet::new(); @@ -519,11 +521,11 @@ impl Block { } } TransmissionID::Transaction(transaction_id) => { - match transaction_ids.peek() { + match unconfirmed_transaction_ids.peek() { // Check the next transaction matches the expected transaction. Some(expected_id) if transaction_id == *expected_id => { - // Increment the transaction ID iterator. - transaction_ids.next(); + // Increment the unconfirmed transaction ID iterator. + unconfirmed_transaction_ids.next(); } // Otherwise, add the transaction ID to the aborted or existing list. _ => aborted_or_existing_transaction_ids.push(*transaction_id), @@ -535,7 +537,7 @@ impl Block { // Ensure there are no more solutions in the block. ensure!(solutions.next().is_none(), "There exists more solutions than expected."); // Ensure there are no more transactions in the block. - ensure!(transaction_ids.next().is_none(), "There exists more transactions than expected."); + ensure!(unconfirmed_transaction_ids.next().is_none(), "There exists more transactions than expected."); // Ensure there are no aborted or existing solution IDs. ensure!(aborted_or_existing_solution_ids.is_empty(), "Block contains aborted or already-existing solutions."); From 38e5848b32baa00a2e650c33d343d1335204a797 Mon Sep 17 00:00:00 2001 From: raychu86 <14917648+raychu86@users.noreply.github.com> Date: Mon, 16 Oct 2023 20:32:11 -0400 Subject: [PATCH 002/298] Prototype check for existing transaction ids --- ledger/block/src/verify.rs | 33 +++++++++++++++++++++++---------- ledger/src/check_next_block.rs | 9 ++++++++- 2 files changed, 31 insertions(+), 11 deletions(-) diff --git a/ledger/block/src/verify.rs b/ledger/block/src/verify.rs index 0b77a6ea71..4f0d7cd656 100644 --- a/ledger/block/src/verify.rs +++ b/ledger/block/src/verify.rs @@ -32,12 +32,12 @@ impl Block { current_epoch_challenge: &EpochChallenge, current_timestamp: i64, ratified_finalize_operations: Vec>, - ) -> Result<()> { + ) -> Result> { // Ensure the block hash is correct. self.verify_hash(previous_block.height(), previous_block.hash())?; // Ensure the block authority is correct. - let (expected_round, expected_height, expected_timestamp) = + let (expected_round, expected_height, expected_timestamp, expected_existing_transaction_ids) = self.verify_authority(previous_block.round(), previous_block.height(), current_committee)?; // Ensure the block solutions are correct. @@ -89,7 +89,10 @@ impl Block { expected_last_coinbase_timestamp, expected_timestamp, current_timestamp, - ) + )?; + + // Re + Ok(expected_existing_transaction_ids) } } @@ -133,7 +136,7 @@ impl Block { previous_round: u64, previous_height: u32, current_committee: &Committee, - ) -> Result<(u64, u32, i64)> { + ) -> Result<(u64, u32, i64, Vec)> { // Determine the expected height. let expected_height = previous_height.saturating_add(1); // Ensure the block type is correct. @@ -172,7 +175,8 @@ impl Block { ); // Ensure the block authority is correct. - match &self.authority { + // Determine the transaction IDs expected to be in previous blocks. + let expected_existing_transaction_ids = match &self.authority { Authority::Beacon(signature) => { // Retrieve the signer. let signer = signature.to_address(); @@ -186,6 +190,8 @@ impl Block { signature.verify(&signer, &[*self.block_hash]), "Signature is invalid in block {expected_height}" ); + + vec![] } Authority::Quorum(subdag) => { // Compute the expected leader. @@ -202,9 +208,9 @@ impl Block { &self.solutions, &self.transactions, &self.aborted_transaction_ids, - )?; + )? } - } + }; // Determine the expected timestamp. let expected_timestamp = match &self.authority { @@ -215,7 +221,7 @@ impl Block { }; // Return success. - Ok((expected_round, expected_height, expected_timestamp)) + Ok((expected_round, expected_height, expected_timestamp, expected_existing_transaction_ids)) } /// Ensures the block ratifications are correct. @@ -483,7 +489,7 @@ impl Block { solutions: &Option>, transactions: &Transactions, aborted_transaction_ids: &[N::TransactionID], - ) -> Result<()> { + ) -> Result> { // Prepare an iterator over the solution IDs. let mut solutions = solutions.as_ref().map(|s| s.deref()).into_iter().flatten().peekable(); // Prepare an iterator over the unconfirmed transaction IDs. @@ -551,6 +557,13 @@ impl Block { } } - Ok(()) + // Retrieve the transaction ids that should already exist in the ledger. + let existing_transaction_ids: Vec<_> = aborted_or_existing_transaction_ids + .iter() + .filter(|id| aborted_transaction_ids.contains(id)) + .copied() + .collect(); + + Ok(existing_transaction_ids) } } diff --git a/ledger/src/check_next_block.rs b/ledger/src/check_next_block.rs index b8f36d68d6..fecff986ed 100644 --- a/ledger/src/check_next_block.rs +++ b/ledger/src/check_next_block.rs @@ -106,7 +106,7 @@ impl> Ledger { } // Ensure the block is correct. - block.verify( + let expected_existing_transaction_ids = block.verify( &self.latest_block(), self.latest_state_root(), &self.latest_committee()?, @@ -116,6 +116,13 @@ impl> Ledger { ratified_finalize_operations, )?; + // Ensure that each existing transaction id from the block exists in the ledger. + for existing_transaction_id in expected_existing_transaction_ids { + if !self.contains_transaction_id(&existing_transaction_id)? { + bail!("Transaction ID '{existing_transaction_id}' does not exist in the ledger"); + } + } + Ok(()) } } From 74196051c518cb759e7416482ff573382dcb3cba Mon Sep 17 00:00:00 2001 From: raychu86 <14917648+raychu86@users.noreply.github.com> Date: Tue, 17 Oct 2023 17:00:15 -0400 Subject: [PATCH 003/298] Update filtering of existing transaction ids --- ledger/block/src/verify.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ledger/block/src/verify.rs b/ledger/block/src/verify.rs index 4f0d7cd656..be6c78aa5b 100644 --- a/ledger/block/src/verify.rs +++ b/ledger/block/src/verify.rs @@ -560,7 +560,7 @@ impl Block { // Retrieve the transaction ids that should already exist in the ledger. let existing_transaction_ids: Vec<_> = aborted_or_existing_transaction_ids .iter() - .filter(|id| aborted_transaction_ids.contains(id)) + .filter(|id| !aborted_transaction_ids.contains(id)) .copied() .collect(); From 58e03b2545b0c36fd8492f0cc91f2c3a14c6c42f Mon Sep 17 00:00:00 2001 From: Alessandro Coglio Date: Thu, 26 Oct 2023 15:16:45 -0700 Subject: [PATCH 004/298] Fix circuit for cast lossy field to group. This resolves the underconstraining bug that was found in that circuit. The fix involves the creation of two new circuits, which are more general and may have other uses: - A circuit for square roots flagged nondeterministic, which return both square roots, in no specified order (hence 'nondeterministic'), if the input is a non-zero square, and returns an error flag set if the input is not a square. - A circuit for turning an x coordinate into the (unique, if it exists) point in the subgroup with that x coordinate, with an error flag set if there is no such point in the subgroup. This circuit makes use of the previous one to solve the curve equation, i.e. to find whether and where x intersects the elliptic curve. The new circuit for cast lossy field to group is realized by using the latter circuit to attempt to find the point in the subgroup with the given value as x coordinate. If none exists, we return the generator if the input is 0, otherwise the result of Elligator-2 is returned, which is always a subgroup point. The use of the new circuits for flagged operations eliminate the underconstraining without eliminating desired solutions (which would happen by enforcing constraints without taking flags into account). --- .../src/data/literal/cast_lossy/field.rs | 40 ++++------- circuit/types/field/src/square_root.rs | 63 +++++++++++++++++ .../group/src/helpers/from_x_coordinate.rs | 70 +++++++++++++++++++ 3 files changed, 147 insertions(+), 26 deletions(-) diff --git a/circuit/program/src/data/literal/cast_lossy/field.rs b/circuit/program/src/data/literal/cast_lossy/field.rs index b2be939819..9763f1039b 100644 --- a/circuit/program/src/data/literal/cast_lossy/field.rs +++ b/circuit/program/src/data/literal/cast_lossy/field.rs @@ -61,9 +61,12 @@ impl CastLossy> for Field { #[inline] fn cast_lossy(&self) -> Group { // This method requires that an `x-coordinate` of 1 is an invalid group element. - // This is used by the ternary below, which uses 'is_one' to determine whether to return the generator. + // This is used by the ternary below, which uses 'is_x_one' to determine whether to return the generator. debug_assert!(console::Group::from_x_coordinate( as console::One>::one()).is_err()); + // Attempt to find a group element with self as the x-coordinate. + let (x_is_not_in_group, point_with_x) = Group::from_x_coordinate_flagged(self.clone()); + // Determine if the field element is zero. let is_x_zero = self.is_zero(); // Determine if the field element is one. @@ -73,35 +76,20 @@ impl CastLossy> for Field { let generator = Group::generator(); // Determine the input to Elligator-2, based on the x-coordinate. + // If self is 0, we pass 1 to Elligator-2 instead. + // Note that, in this case, we won't use the result of Elligator-2, + // because the point (0, 1) is in the subgroup, and that is what we return. let elligator_input = Field::ternary(&is_x_zero, &Field::one(), self); // Perform Elligator-2 on the field element, to recover a group element. - let elligator = Elligator2::encode(&elligator_input); - - // Determine the initial x-coordinate, if the given field element is one. - let initial_x = Field::ternary(&is_x_one, &generator.to_x_coordinate(), &elligator.to_x_coordinate()); - // Determine the initial y-coordinate, if the given field element is one. - let initial_y = Field::ternary(&is_x_one, &generator.to_y_coordinate(), &elligator.to_y_coordinate()); - - // Determine the y-coordinate, if the x-coordinate is valid. - let possible_y: Field = { - // Set the x-coordinate. - let x = self.clone(); - // Derive the y-coordinate. - witness!(|x| match console::Group::from_x_coordinate(x) { - Ok(point) => point.to_y_coordinate(), - Err(_) => console::Zero::zero(), - }) - }; - // Determine if the recovered y-coordinate is zero. - let is_y_zero = possible_y.is_zero(); + let elligator_point = Elligator2::encode(&elligator_input); - // Determine the final x-coordinate, based on whether the possible y-coordinate is zero. - let final_x = Field::ternary(&is_y_zero, &initial_x, self); - // Determine the final y-coordinate, based on whether the possible y-coordinate is zero. - let final_y = Field::ternary(&is_y_zero, &initial_y, &possible_y); + // Select either the generator or the result of Elligator-2, depending on whether x is 1 or not. + // This is only used when x is not in the group, see below. + let generator_or_elligator_point = Group::ternary(&is_x_one, &generator, &elligator_point); - // Return the result. - Group::from_xy_coordinates(final_x, final_y) + // Select either the group point with x or the generator or the result of Elligator-2, + // depending on whether x is in the group or not, and, if it is not, based on whether it is 1 or not. + Group::ternary(&x_is_not_in_group, &generator_or_elligator_point, &point_with_x) } } diff --git a/circuit/types/field/src/square_root.rs b/circuit/types/field/src/square_root.rs index 8430d0ae29..e3e83e87d4 100644 --- a/circuit/types/field/src/square_root.rs +++ b/circuit/types/field/src/square_root.rs @@ -63,6 +63,69 @@ impl Field { } } +impl Field { + /// Returns both square roots of `self` (hence the plural 'roots' in the name of the function), + /// along with a boolean error flag, which is set iff `self` is not a square. + /// + /// In the console computation: + /// if `self` is a non-zero square, + /// the first field result is the positive root (i.e. closer to 0) + /// and the second field result is the negative root (i.e. closer to the prime); + /// if `self` is 0, both field results are 0; + /// if `self` is not a square, both field results are 0, but immaterial. + /// + /// The 'nondeterministic' part of the function name refers to the synthesized circuit, + /// whose represented computation, unlike the console computation just described, + /// returns the two roots (if `self` is a non-zero square) in no specified order. + /// This nondeterminism saves constraints, but generally this circuit should be only used + /// as part of larger circuits for which the nondeterminism in the order of the two roots does not matter, + /// and where the larger circuits represent deterministic computations despite this internal nondeterminism. + pub fn square_roots_flagged_nondeterministic(&self) -> (Boolean, Self, Self) { + // Obtain (p-1)/2, as a constant field element. + let modulus_minus_one_div_two = match E::BaseField::from_bigint(E::BaseField::modulus_minus_one_div_two()) { + Some(modulus_minus_one_div_two) => Field::constant(console::Field::new(modulus_minus_one_div_two)), + None => E::halt("Failed to initialize (modulus - 1) / 2"), + }; + + // Use Euler's criterion: self is a non-zero square iff self^((p-1)/2) is 1. + let euler = self.pow(modulus_minus_one_div_two); + let is_nonzero_square = euler.is_equal(&Field::one()); + + // Calculate the witness for the first square result. + // The called function square_root returns the square root closer to 0. + let root_witness = match self.eject_value().square_root() { + Ok(root) => root, + Err(_) => E::halt("Failed to calculate square root witness"), + }; + + // In order to avoid actually calculating the square root in the circuit, + // we would like to generate a constraint saying that squaring the root yields self. + // But this constraint would have no solutions if self is not a square. + // So we introduce a new variable that is either self (if square) or 0 (otherwise): + // either way, this new variable is a square. + let square = Self::ternary(&is_nonzero_square, self, &Field::zero()); + + // We introduce a variable for the first root we return, + // and constrain it to yield, when squared, the square introduced just above. + // Thus, if self is a square this is a square root of self; otherwise it is 0, because only 0 yields 0 when squared. + // The variable is actually a constant if self is constant, otherwise it is private (even if self is public). + let mode = if self.eject_mode() == Mode::Constant { Mode::Constant } else { Mode::Private }; + let first_root = Field::new(mode, root_witness); + E::enforce(|| (&first_root, &first_root, &square)); + + // The second root returned by this function is the negation of the first one. + // So if self is a non-zero square, this is always different from the first root, + // but in the circuit it can be either positive (and the other negative) or vice versa. + let second_root = first_root.clone().neg(); + + // The error flag is set iff self is a non-square, i.e. it is neither zero nor a non-zero square. + let is_nonzero = self.is_not_equal(&Field::zero()); + let error_flag = is_nonzero.bitand(is_nonzero_square.not()); + + (error_flag, first_root, second_root) + } +} + impl Metrics>> for Field { type Case = Mode; diff --git a/circuit/types/group/src/helpers/from_x_coordinate.rs b/circuit/types/group/src/helpers/from_x_coordinate.rs index acf87bf2f9..bbdd5b2be7 100644 --- a/circuit/types/group/src/helpers/from_x_coordinate.rs +++ b/circuit/types/group/src/helpers/from_x_coordinate.rs @@ -26,6 +26,76 @@ impl Group { Self::from_xy_coordinates(x, y) } + + /// Initializes an affine group element from a given x-coordinate field element. + /// Also returns an error flag, set if there is no group element with the given x-coordinate; + /// in that case, the returned point is `(0, 0)`, but immaterial. + pub fn from_x_coordinate_flagged(x: Field) -> (Boolean, Self) { + // Obtain the A and D coefficients of the elliptic curve. + let a = Field::constant(console::Field::new(E::EDWARDS_A)); + let d = Field::constant(console::Field::new(E::EDWARDS_D)); + + // Compute x^2. + let xx = &x * &x; + + // Compute a * x^2 - 1. + let a_xx_minus_1 = a * &xx - Field::one(); + + // Compute d * x^2 - 1. + let d_xx_minus_1 = d * &xx - Field::one(); + + // Compute y^2 = (a * x^2 - 1) / (d * x^2 - 1), i.e. solve the curve equation for y^2. + let yy: Field = witness!(|a_xx_minus_1, d_xx_minus_1| { a_xx_minus_1 / d_xx_minus_1 }); + E::enforce(|| (&yy, &d_xx_minus_1, &a_xx_minus_1)); + + // Compute both square roots of y^2, in no specified order, with a flag saying whether y^2 is a square or not. + // That is, finish solving the curve equation for y. + // If the x-coordinate line does not intersect the elliptic curve, this returns (1, 0, 0). + let (yy_is_not_square, y1, y2) = yy.square_roots_flagged_nondeterministic(); + + // Form the two points, which are on the curve if yy_is_not_square is false. + // Note that the Group type is not restricted to the points in the subgroup or even on the curve; + // it includes all possible points, i.e. all possible pairs of field elements. + let point1 = Self { x: x.clone(), y: y1.clone() }; + let point2 = Self { x: x.clone(), y: y2.clone() }; + + // We need to check whether either of the two points is in the subgroup. + // There may be at most one, but in a circuit we need to always represent both computation paths. + // In fact, we represent this computation also when yy_is_not_square is true, + // in which case the results of checking whether either point is in the subgroup are meaningless, + // but ignored in the final selection of the results returned below. + // The criterion for membership in the subgroup is that + // multiplying the point by the subgroup order yields the zero point (0, 1). + // The group operation that we use here is for the type `Group` of the subgroup, + // which as mentioned above it can be performed on points outside the subgroup as well. + // We turn the subgroup order into big endian bits, + // to get around the issue that the subgroup order is not of Scalar type. + let order = E::ScalarField::modulus(); + let order_bits_be = order.to_bits_be(); + let mut order_bits_be_constants = Vec::new(); + for bit in order_bits_be.iter() { + order_bits_be_constants.push(Boolean::constant(bit.clone())); + } + let point1_times_order = order_bits_be_constants.mul(point1); + let point2_times_order = order_bits_be_constants.mul(point2); + let point1_is_in_subgroup = point1_times_order.is_equal(&Self::zero()); + let point2_is_in_subgroup = point2_times_order.is_equal(&Self::zero()); + + // We select y1 if (x, y1) is in the subgroup (which implies that (x, y2) is not in the subgroup), + // or y2 if (x, y2) is in the subgroup (which implies that (x, y1) is not in the subgroup), + // or 0 if neither is in the subgroup, or x does not even intersect the elliptic curve. + // Since at most one of the two points can be in the subgroup, the order of y1 and y2 returned by square root is immaterial: + // that nondeterminism (in the circuit) is resolved, and the circuit for from_x_coordinate_flagged is deterministic. + let y2_or_zero = Field::ternary(&point2_is_in_subgroup, &y2, &Field::zero()); + let y1_or_y2_or_zero = Field::ternary(&point1_is_in_subgroup, &y1, &y2_or_zero); + let y = Field::ternary(&yy_is_not_square, &Field::zero(), &y1_or_y2_or_zero); + + // The error flag is set iff x does not intersect the elliptic curve or neither intersection point is in the subgroup. + let neither_in_subgroup = point1_is_in_subgroup.not().bitand(point2_is_in_subgroup.not()); + let error_flag = yy_is_not_square.bitor(&neither_in_subgroup); + + (error_flag, Self { x, y }) + } } #[cfg(test)] From ca3699d8f44206cafc1bbb721224f0bee13e003d Mon Sep 17 00:00:00 2001 From: Alessandro Coglio Date: Fri, 27 Oct 2023 09:25:11 -0700 Subject: [PATCH 005/298] Appease Clippy. --- circuit/types/group/src/helpers/from_x_coordinate.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/circuit/types/group/src/helpers/from_x_coordinate.rs b/circuit/types/group/src/helpers/from_x_coordinate.rs index bbdd5b2be7..b78ecaf615 100644 --- a/circuit/types/group/src/helpers/from_x_coordinate.rs +++ b/circuit/types/group/src/helpers/from_x_coordinate.rs @@ -74,7 +74,7 @@ impl Group { let order_bits_be = order.to_bits_be(); let mut order_bits_be_constants = Vec::new(); for bit in order_bits_be.iter() { - order_bits_be_constants.push(Boolean::constant(bit.clone())); + order_bits_be_constants.push(Boolean::constant(*bit)); } let point1_times_order = order_bits_be_constants.mul(point1); let point2_times_order = order_bits_be_constants.mul(point2); From 532033f26a0429649d0c51c3600230a811dc7f0d Mon Sep 17 00:00:00 2001 From: Alessandro Coglio Date: Fri, 27 Oct 2023 13:16:45 -0700 Subject: [PATCH 006/298] Totalize calculation of square root. Since this is a flagged operation, it must never fail. --- circuit/types/field/src/square_root.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/circuit/types/field/src/square_root.rs b/circuit/types/field/src/square_root.rs index e3e83e87d4..15a3af5d62 100644 --- a/circuit/types/field/src/square_root.rs +++ b/circuit/types/field/src/square_root.rs @@ -95,7 +95,7 @@ impl Field { // The called function square_root returns the square root closer to 0. let root_witness = match self.eject_value().square_root() { Ok(root) => root, - Err(_) => E::halt("Failed to calculate square root witness"), + Err(_) => console::Field::zero(), }; // In order to avoid actually calculating the square root in the circuit, From b886930a9068c41c79c2ce1cc889161ae75586c7 Mon Sep 17 00:00:00 2001 From: Alessandro Coglio Date: Fri, 27 Oct 2023 13:17:25 -0700 Subject: [PATCH 007/298] Update constraint counts. --- .../src/data/literal/cast_lossy/field.rs | 12 +- .../src/data/literal/cast_lossy/integer.rs | 120 +++++++++--------- .../src/data/literal/cast_lossy/scalar.rs | 12 +- 3 files changed, 72 insertions(+), 72 deletions(-) diff --git a/circuit/program/src/data/literal/cast_lossy/field.rs b/circuit/program/src/data/literal/cast_lossy/field.rs index 9763f1039b..e9e7e054d6 100644 --- a/circuit/program/src/data/literal/cast_lossy/field.rs +++ b/circuit/program/src/data/literal/cast_lossy/field.rs @@ -145,15 +145,15 @@ mod tests { fn test_field_to_address() { check_cast_lossy::, console_root::types::Address>( Mode::Constant, - count_less_than!(551, 0, 0, 0), + count_less_than!(4303, 0, 0, 0), ); check_cast_lossy::, console_root::types::Address>( Mode::Public, - count_is!(277, 0, 899, 904), + count_is!(2029, 0, 6745, 6750), ); check_cast_lossy::, console_root::types::Address>( Mode::Private, - count_is!(277, 0, 899, 904), + count_is!(2029, 0, 6745, 6750), ); } @@ -184,15 +184,15 @@ mod tests { fn test_field_to_group() { check_cast_lossy::, console_root::types::Group>( Mode::Constant, - count_less_than!(551, 0, 0, 0), + count_less_than!(4303, 0, 0, 0), ); check_cast_lossy::, console_root::types::Group>( Mode::Public, - count_is!(277, 0, 899, 904), + count_is!(2029, 0, 6745, 6750), ); check_cast_lossy::, console_root::types::Group>( Mode::Private, - count_is!(277, 0, 899, 904), + count_is!(2029, 0, 6745, 6750), ); } diff --git a/circuit/program/src/data/literal/cast_lossy/integer.rs b/circuit/program/src/data/literal/cast_lossy/integer.rs index 4531e0e504..7d2244c7ff 100644 --- a/circuit/program/src/data/literal/cast_lossy/integer.rs +++ b/circuit/program/src/data/literal/cast_lossy/integer.rs @@ -130,15 +130,15 @@ mod tests { fn test_i8_to_address() { check_cast_lossy::, console_root::types::Address>( Mode::Constant, - count_less_than!(551, 0, 0, 0), + count_less_than!(4303, 0, 0, 0), ); check_cast_lossy::, console_root::types::Address>( Mode::Public, - count_is!(277, 0, 899, 904), + count_is!(2029, 0, 6745, 6750), ); check_cast_lossy::, console_root::types::Address>( Mode::Private, - count_is!(277, 0, 899, 904), + count_is!(2029, 0, 6745, 6750), ); } @@ -178,15 +178,15 @@ mod tests { fn test_i8_to_group() { check_cast_lossy::, console_root::types::Group>( Mode::Constant, - count_less_than!(551, 0, 0, 0), + count_less_than!(4303, 0, 0, 0), ); check_cast_lossy::, console_root::types::Group>( Mode::Public, - count_is!(277, 0, 899, 904), + count_is!(2029, 0, 6745, 6750), ); check_cast_lossy::, console_root::types::Group>( Mode::Private, - count_is!(277, 0, 899, 904), + count_is!(2029, 0, 6745, 6750), ); } @@ -306,15 +306,15 @@ mod tests { fn test_i16_to_address() { check_cast_lossy::, console_root::types::Address>( Mode::Constant, - count_less_than!(551, 0, 0, 0), + count_less_than!(4303, 0, 0, 0), ); check_cast_lossy::, console_root::types::Address>( Mode::Public, - count_is!(277, 0, 899, 904), + count_is!(2029, 0, 6745, 6750), ); check_cast_lossy::, console_root::types::Address>( Mode::Private, - count_is!(277, 0, 899, 904), + count_is!(2029, 0, 6745, 6750), ); } @@ -354,15 +354,15 @@ mod tests { fn test_i16_to_group() { check_cast_lossy::, console_root::types::Group>( Mode::Constant, - count_less_than!(551, 0, 0, 0), + count_less_than!(4303, 0, 0, 0), ); check_cast_lossy::, console_root::types::Group>( Mode::Public, - count_is!(277, 0, 899, 904), + count_is!(2029, 0, 6745, 6750), ); check_cast_lossy::, console_root::types::Group>( Mode::Private, - count_is!(277, 0, 899, 904), + count_is!(2029, 0, 6745, 6750), ); } @@ -482,15 +482,15 @@ mod tests { fn test_i32_to_address() { check_cast_lossy::, console_root::types::Address>( Mode::Constant, - count_less_than!(551, 0, 0, 0), + count_less_than!(4303, 0, 0, 0), ); check_cast_lossy::, console_root::types::Address>( Mode::Public, - count_is!(277, 0, 899, 904), + count_is!(2029, 0, 6745, 6750), ); check_cast_lossy::, console_root::types::Address>( Mode::Private, - count_is!(277, 0, 899, 904), + count_is!(2029, 0, 6745, 6750), ); } @@ -530,15 +530,15 @@ mod tests { fn test_i32_to_group() { check_cast_lossy::, console_root::types::Group>( Mode::Constant, - count_less_than!(551, 0, 0, 0), + count_less_than!(4303, 0, 0, 0), ); check_cast_lossy::, console_root::types::Group>( Mode::Public, - count_is!(277, 0, 899, 904), + count_is!(2029, 0, 6745, 6750), ); check_cast_lossy::, console_root::types::Group>( Mode::Private, - count_is!(277, 0, 899, 904), + count_is!(2029, 0, 6745, 6750), ); } @@ -658,15 +658,15 @@ mod tests { fn test_i64_to_address() { check_cast_lossy::, console_root::types::Address>( Mode::Constant, - count_less_than!(551, 0, 0, 0), + count_less_than!(4303, 0, 0, 0), ); check_cast_lossy::, console_root::types::Address>( Mode::Public, - count_is!(277, 0, 899, 904), + count_is!(2029, 0, 6745, 6750), ); check_cast_lossy::, console_root::types::Address>( Mode::Private, - count_is!(277, 0, 899, 904), + count_is!(2029, 0, 6745, 6750), ); } @@ -706,15 +706,15 @@ mod tests { fn test_i64_to_group() { check_cast_lossy::, console_root::types::Group>( Mode::Constant, - count_less_than!(551, 0, 0, 0), + count_less_than!(4303, 0, 0, 0), ); check_cast_lossy::, console_root::types::Group>( Mode::Public, - count_is!(277, 0, 899, 904), + count_is!(2029, 0, 6745, 6750), ); check_cast_lossy::, console_root::types::Group>( Mode::Private, - count_is!(277, 0, 899, 904), + count_is!(2029, 0, 6745, 6750), ); } @@ -834,15 +834,15 @@ mod tests { fn test_i128_to_address() { check_cast_lossy::, console_root::types::Address>( Mode::Constant, - count_less_than!(551, 0, 0, 0), + count_less_than!(4303, 0, 0, 0), ); check_cast_lossy::, console_root::types::Address>( Mode::Public, - count_is!(277, 0, 899, 904), + count_is!(2029, 0, 6745, 6750), ); check_cast_lossy::, console_root::types::Address>( Mode::Private, - count_is!(277, 0, 899, 904), + count_is!(2029, 0, 6745, 6750), ); } @@ -882,15 +882,15 @@ mod tests { fn test_i128_to_group() { check_cast_lossy::, console_root::types::Group>( Mode::Constant, - count_less_than!(551, 0, 0, 0), + count_less_than!(4303, 0, 0, 0), ); check_cast_lossy::, console_root::types::Group>( Mode::Public, - count_is!(277, 0, 899, 904), + count_is!(2029, 0, 6745, 6750), ); check_cast_lossy::, console_root::types::Group>( Mode::Private, - count_is!(277, 0, 899, 904), + count_is!(2029, 0, 6745, 6750), ); } @@ -1006,15 +1006,15 @@ mod tests { fn test_u8_to_address() { check_cast_lossy::, console_root::types::Address>( Mode::Constant, - count_less_than!(551, 0, 0, 0), + count_less_than!(4303, 0, 0, 0), ); check_cast_lossy::, console_root::types::Address>( Mode::Public, - count_is!(277, 0, 899, 904), + count_is!(2029, 0, 6745, 6750), ); check_cast_lossy::, console_root::types::Address>( Mode::Private, - count_is!(277, 0, 899, 904), + count_is!(2029, 0, 6745, 6750), ); } @@ -1054,15 +1054,15 @@ mod tests { fn test_u8_to_group() { check_cast_lossy::, console_root::types::Group>( Mode::Constant, - count_less_than!(551, 0, 0, 0), + count_less_than!(4303, 0, 0, 0), ); check_cast_lossy::, console_root::types::Group>( Mode::Public, - count_is!(277, 0, 899, 904), + count_is!(2029, 0, 6745, 6750), ); check_cast_lossy::, console_root::types::Group>( Mode::Private, - count_is!(277, 0, 899, 904), + count_is!(2029, 0, 6745, 6750), ); } @@ -1182,15 +1182,15 @@ mod tests { fn test_u16_to_address() { check_cast_lossy::, console_root::types::Address>( Mode::Constant, - count_less_than!(551, 0, 0, 0), + count_less_than!(4303, 0, 0, 0), ); check_cast_lossy::, console_root::types::Address>( Mode::Public, - count_is!(277, 0, 899, 904), + count_is!(2029, 0, 6745, 6750), ); check_cast_lossy::, console_root::types::Address>( Mode::Private, - count_is!(277, 0, 899, 904), + count_is!(2029, 0, 6745, 6750), ); } @@ -1230,15 +1230,15 @@ mod tests { fn test_u16_to_group() { check_cast_lossy::, console_root::types::Group>( Mode::Constant, - count_less_than!(551, 0, 0, 0), + count_less_than!(4303, 0, 0, 0), ); check_cast_lossy::, console_root::types::Group>( Mode::Public, - count_is!(277, 0, 899, 904), + count_is!(2029, 0, 6745, 6750), ); check_cast_lossy::, console_root::types::Group>( Mode::Private, - count_is!(277, 0, 899, 904), + count_is!(2029, 0, 6745, 6750), ); } @@ -1358,15 +1358,15 @@ mod tests { fn test_u32_to_address() { check_cast_lossy::, console_root::types::Address>( Mode::Constant, - count_less_than!(551, 0, 0, 0), + count_less_than!(4303, 0, 0, 0), ); check_cast_lossy::, console_root::types::Address>( Mode::Public, - count_is!(277, 0, 899, 904), + count_is!(2029, 0, 6745, 6750), ); check_cast_lossy::, console_root::types::Address>( Mode::Private, - count_is!(277, 0, 899, 904), + count_is!(2029, 0, 6745, 6750), ); } @@ -1406,15 +1406,15 @@ mod tests { fn test_u32_to_group() { check_cast_lossy::, console_root::types::Group>( Mode::Constant, - count_less_than!(551, 0, 0, 0), + count_less_than!(4303, 0, 0, 0), ); check_cast_lossy::, console_root::types::Group>( Mode::Public, - count_is!(277, 0, 899, 904), + count_is!(2029, 0, 6745, 6750), ); check_cast_lossy::, console_root::types::Group>( Mode::Private, - count_is!(277, 0, 899, 904), + count_is!(2029, 0, 6745, 6750), ); } @@ -1534,15 +1534,15 @@ mod tests { fn test_u64_to_address() { check_cast_lossy::, console_root::types::Address>( Mode::Constant, - count_less_than!(551, 0, 0, 0), + count_less_than!(4303, 0, 0, 0), ); check_cast_lossy::, console_root::types::Address>( Mode::Public, - count_is!(277, 0, 899, 904), + count_is!(2029, 0, 6745, 6750), ); check_cast_lossy::, console_root::types::Address>( Mode::Private, - count_is!(277, 0, 899, 904), + count_is!(2029, 0, 6745, 6750), ); } @@ -1582,15 +1582,15 @@ mod tests { fn test_u64_to_group() { check_cast_lossy::, console_root::types::Group>( Mode::Constant, - count_less_than!(551, 0, 0, 0), + count_less_than!(4303, 0, 0, 0), ); check_cast_lossy::, console_root::types::Group>( Mode::Public, - count_is!(277, 0, 899, 904), + count_is!(2029, 0, 6745, 6750), ); check_cast_lossy::, console_root::types::Group>( Mode::Private, - count_is!(277, 0, 899, 904), + count_is!(2029, 0, 6745, 6750), ); } @@ -1710,15 +1710,15 @@ mod tests { fn test_u128_to_address() { check_cast_lossy::, console_root::types::Address>( Mode::Constant, - count_less_than!(551, 0, 0, 0), + count_less_than!(4303, 0, 0, 0), ); check_cast_lossy::, console_root::types::Address>( Mode::Public, - count_is!(277, 0, 899, 904), + count_is!(2029, 0, 6745, 6750), ); check_cast_lossy::, console_root::types::Address>( Mode::Private, - count_is!(277, 0, 899, 904), + count_is!(2029, 0, 6745, 6750), ); } @@ -1758,15 +1758,15 @@ mod tests { fn test_u128_to_group() { check_cast_lossy::, console_root::types::Group>( Mode::Constant, - count_less_than!(551, 0, 0, 0), + count_less_than!(4303, 0, 0, 0), ); check_cast_lossy::, console_root::types::Group>( Mode::Public, - count_is!(277, 0, 899, 904), + count_is!(2029, 0, 6745, 6750), ); check_cast_lossy::, console_root::types::Group>( Mode::Private, - count_is!(277, 0, 899, 904), + count_is!(2029, 0, 6745, 6750), ); } diff --git a/circuit/program/src/data/literal/cast_lossy/scalar.rs b/circuit/program/src/data/literal/cast_lossy/scalar.rs index 95fddba50b..1b3d77475c 100644 --- a/circuit/program/src/data/literal/cast_lossy/scalar.rs +++ b/circuit/program/src/data/literal/cast_lossy/scalar.rs @@ -118,15 +118,15 @@ mod tests { fn test_scalar_to_address() { check_cast_lossy::, console_root::types::Address>( Mode::Constant, - count_less_than!(551, 0, 0, 0), + count_less_than!(4303, 0, 0, 0), ); check_cast_lossy::, console_root::types::Address>( Mode::Public, - count_is!(277, 0, 899, 904), + count_is!(2029, 0, 6745, 6750), ); check_cast_lossy::, console_root::types::Address>( Mode::Private, - count_is!(277, 0, 899, 904), + count_is!(2029, 0, 6745, 6750), ); } @@ -157,15 +157,15 @@ mod tests { fn test_scalar_to_group() { check_cast_lossy::, console_root::types::Group>( Mode::Constant, - count_less_than!(551, 0, 0, 0), + count_less_than!(4303, 0, 0, 0), ); check_cast_lossy::, console_root::types::Group>( Mode::Public, - count_is!(277, 0, 899, 904), + count_is!(2029, 0, 6745, 6750), ); check_cast_lossy::, console_root::types::Group>( Mode::Private, - count_is!(277, 0, 899, 904), + count_is!(2029, 0, 6745, 6750), ); } From b34f8fb5cbd5e953370b07d460ea84ebd0dd439b Mon Sep 17 00:00:00 2001 From: Alessandro Coglio Date: Fri, 27 Oct 2023 14:11:50 -0700 Subject: [PATCH 008/298] Appease Clippy. --- circuit/program/src/data/literal/cast_lossy/mod.rs | 5 ----- 1 file changed, 5 deletions(-) diff --git a/circuit/program/src/data/literal/cast_lossy/mod.rs b/circuit/program/src/data/literal/cast_lossy/mod.rs index eae6120f6f..ff36351fde 100644 --- a/circuit/program/src/data/literal/cast_lossy/mod.rs +++ b/circuit/program/src/data/literal/cast_lossy/mod.rs @@ -24,12 +24,8 @@ use snarkvm_circuit_network::Aleo; use snarkvm_circuit_types::prelude::{ bail, integers::Integer, - rename_selfs, - witness, - witness_mode, Address, Boolean, - Eject, Environment, Field, FromBits, @@ -38,7 +34,6 @@ use snarkvm_circuit_types::prelude::{ Group, Inject, IntegerType, - Mode, One, Result, Scalar, From a598b04d0436e304e70c34d17e3a466ecf3c6a96 Mon Sep 17 00:00:00 2001 From: Alessandro Coglio Date: Sat, 28 Oct 2023 13:02:45 -0700 Subject: [PATCH 009/298] Add tests for square roots flagged nondeterministic. --- circuit/types/field/src/square_root.rs | 46 ++++++++++++++++++++++++-- 1 file changed, 44 insertions(+), 2 deletions(-) diff --git a/circuit/types/field/src/square_root.rs b/circuit/types/field/src/square_root.rs index 15a3af5d62..ed7364a6df 100644 --- a/circuit/types/field/src/square_root.rs +++ b/circuit/types/field/src/square_root.rs @@ -159,7 +159,7 @@ mod tests { for _ in 0..ITERATIONS { // Sample a random element. let given: console::Field<::Network> = Uniform::rand(rng); - // Compute it's square root, or skip this iteration if it does not natively exist. + // Compute its square root, or skip this iteration if it does not natively exist. if let Ok(expected) = given.square_root() { let input = Field::::new(mode, given); @@ -186,7 +186,7 @@ mod tests { for _ in 0..ITERATIONS { // Sample a random element. let given: console::Field<::Network> = Uniform::rand(rng); - // Compute it's square root, or skip this iteration if it does not natively exist. + // Compute its square root, or skip this iteration if it does not natively exist. if let Ok(expected) = given.even_square_root() { let input = Field::::new(mode, given); @@ -200,6 +200,39 @@ mod tests { } } + fn check_square_roots_flagged_nondeterministic( + name: &str, + mode: Mode, + rng: &mut TestRng, + num_constants: u64, + num_public: u64, + num_private: u64, + num_constraints: u64, + ) { + for _ in 0..ITERATIONS { + // Sample a random element. + let given: console::Field<::Network> = Uniform::rand(rng); + // Compute square roots and error flag in console-land. + let (expected_error_flag, expected_positive_root, expected_negative_root) = match given.square_root() { + Ok(root) => (false, root, -root), + Err(_) => (true, console::Field::zero(), console::Field::zero()), + }; + // Compute square roots and error flag in circuit-land. + let input = Field::::new(mode, given); + Circuit::scope(name, || { + let (candidate_error_flag, candidate_first_root, candidate_second_root) = + input.square_roots_flagged_nondeterministic(); + // Although the order of the roots is unspecified in the circuit, + // the witness values are in a fixed order (first positive, then negative). + assert_eq!(expected_error_flag, candidate_error_flag.eject_value()); + assert_eq!(expected_positive_root, candidate_first_root.eject_value()); + assert_eq!(expected_negative_root, candidate_second_root.eject_value()); + assert_scope!(num_constants, num_public, num_private, num_constraints); + }); + Circuit::reset(); + } + } + #[test] fn test_square_root() { let mut rng = TestRng::default(); @@ -217,4 +250,13 @@ mod tests { check_even_square_root("Public", &mut rng, Mode::Public, 0, 0, 506, 509); check_even_square_root("Private", &mut rng, Mode::Private, 0, 0, 506, 509); } + + #[test] + fn test_square_roots_flagged_nondeterministic() { + let mut rng = TestRng::default(); + + check_square_roots_flagged_nondeterministic("Constant", Mode::Constant, &mut rng, 257, 0, 0, 0); + check_square_roots_flagged_nondeterministic("Public", Mode::Public, &mut rng, 254, 0, 344, 344); + check_square_roots_flagged_nondeterministic("Private", Mode::Private, &mut rng, 254, 0, 344, 344); + } } From 15e5ccce2a34ab23bb49caf8560b330aec7e3760 Mon Sep 17 00:00:00 2001 From: Alessandro Coglio Date: Sat, 28 Oct 2023 13:30:17 -0700 Subject: [PATCH 010/298] Add tests for `from_x_coordinate_flagged`. --- .../group/src/helpers/from_x_coordinate.rs | 44 +++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/circuit/types/group/src/helpers/from_x_coordinate.rs b/circuit/types/group/src/helpers/from_x_coordinate.rs index b78ecaf615..1a6c4a0f6c 100644 --- a/circuit/types/group/src/helpers/from_x_coordinate.rs +++ b/circuit/types/group/src/helpers/from_x_coordinate.rs @@ -130,6 +130,35 @@ mod tests { } } + fn check_from_x_coordinate_flagged( + mode: Mode, + num_constants: u64, + num_public: u64, + num_private: u64, + num_constraints: u64, + ) { + let mut rng = TestRng::default(); + + for i in 0..ITERATIONS { + // Sample a random x coordinate. + let x: console::Field<::Network> = Uniform::rand(&mut rng); + // Compute error flag and point in console-land. + let (expected_error_flag, expected_point) = match console::Group::from_x_coordinate(x) { + Ok(point) => (false, point), + Err(_) => (true, console::Group::from_xy_coordinates_unchecked(x, console::Field::zero())), + }; + // Compute error flag and point in circuit-land. + let input = Field::::new(mode, x); + Circuit::scope(format!("{mode} {i}"), || { + let (candidate_error_flag, candidate_point) = Group::from_x_coordinate_flagged(input); + assert_eq!(expected_error_flag, candidate_error_flag.eject_value()); + assert_eq!(expected_point, candidate_point.eject_value()); + assert_scope!(num_constants, num_public, num_private, num_constraints); + }); + Circuit::reset(); + } + } + #[test] fn test_from_x_coordinate_constant() { check_from_x_coordinate(Mode::Constant, 9, 0, 0, 0); @@ -144,4 +173,19 @@ mod tests { fn test_from_x_coordinate_private() { check_from_x_coordinate(Mode::Private, 4, 0, 13, 13); } + + #[test] + fn test_from_x_coordinate_flagged_constant() { + check_from_x_coordinate_flagged(Mode::Constant, 3764, 0, 0, 0); + } + + #[test] + fn test_from_x_coordinate_flagged_public() { + check_from_x_coordinate_flagged(Mode::Public, 1756, 0, 5861, 5861); + } + + #[test] + fn test_from_x_coordinate_flagged_private() { + check_from_x_coordinate_flagged(Mode::Private, 1756, 0, 5861, 5861); + } } From 76abeefec6b3bf14a6ebf641bfa01c1b7dd8ba24 Mon Sep 17 00:00:00 2001 From: Victor Sint Nicolaas Date: Mon, 6 Nov 2023 09:13:37 +0100 Subject: [PATCH 011/298] Create compute_function_id helper which enforces minimal TLV encoding --- circuit/program/src/function_id/mod.rs | 37 ++++++++++++++++++ circuit/program/src/lib.rs | 3 ++ circuit/program/src/request/mod.rs | 2 +- circuit/program/src/request/verify.rs | 11 ++---- circuit/program/src/response/from_outputs.rs | 5 +-- circuit/program/src/response/mod.rs | 2 +- .../response/process_outputs_from_callback.rs | 5 +-- console/program/src/function_id/mod.rs | 39 +++++++++++++++++++ console/program/src/lib.rs | 3 ++ console/program/src/request/mod.rs | 2 +- console/program/src/request/sign.rs | 10 ++--- console/program/src/request/verify.rs | 7 +--- console/program/src/response/mod.rs | 7 ++-- ledger/block/src/transition/mod.rs | 6 +-- synthesizer/process/src/lib.rs | 2 +- synthesizer/process/src/verify_execution.rs | 14 ++----- synthesizer/process/src/verify_fee.rs | 18 ++++----- 17 files changed, 119 insertions(+), 54 deletions(-) create mode 100644 circuit/program/src/function_id/mod.rs create mode 100644 console/program/src/function_id/mod.rs diff --git a/circuit/program/src/function_id/mod.rs b/circuit/program/src/function_id/mod.rs new file mode 100644 index 0000000000..af13541502 --- /dev/null +++ b/circuit/program/src/function_id/mod.rs @@ -0,0 +1,37 @@ +// Copyright (C) 2019-2023 Aleo Systems Inc. +// This file is part of the snarkVM library. + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at: +// http://www.apache.org/licenses/LICENSE-2.0 + +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +use crate::{Identifier, ProgramID}; +use snarkvm_circuit_network::Aleo; +use snarkvm_circuit_types::{environment::prelude::*, Field, U16}; + +/// Compute the function ID as `Hash(network_id, program_id.len(), program_id, function_name.len(), function_name)`. +pub fn compute_function_id( + network_id: &U16, + program_id: &ProgramID, + function_name: &Identifier, +) -> Field { + A::hash_bhp1024( + &( + network_id, + program_id.name().size_in_bits(), + program_id.name(), + program_id.network().size_in_bits(), + program_id.network(), + function_name.size_in_bits(), + function_name, + ) + .to_bits_le(), + ) +} diff --git a/circuit/program/src/lib.rs b/circuit/program/src/lib.rs index cf9be261cd..ffc7c64960 100644 --- a/circuit/program/src/lib.rs +++ b/circuit/program/src/lib.rs @@ -22,6 +22,9 @@ use snarkvm_circuit_network::AleoV0 as Circuit; mod data; pub use data::*; +mod function_id; +pub use function_id::*; + mod id; pub use id::*; diff --git a/circuit/program/src/request/mod.rs b/circuit/program/src/request/mod.rs index 0a7424667a..cd70d748e6 100644 --- a/circuit/program/src/request/mod.rs +++ b/circuit/program/src/request/mod.rs @@ -18,7 +18,7 @@ use snarkvm_circuit_types::environment::assert_scope; mod to_tpk; mod verify; -use crate::{Identifier, Plaintext, ProgramID, Record, Value}; +use crate::{compute_function_id, Identifier, Plaintext, ProgramID, Record, Value}; use snarkvm_circuit_account::Signature; use snarkvm_circuit_network::Aleo; use snarkvm_circuit_types::{environment::prelude::*, Address, Boolean, Field, Group, U16}; diff --git a/circuit/program/src/request/verify.rs b/circuit/program/src/request/verify.rs index 86dd773a28..a095dcaa32 100644 --- a/circuit/program/src/request/verify.rs +++ b/circuit/program/src/request/verify.rs @@ -21,10 +21,8 @@ impl Request { /// Verifies (challenge == challenge') && (address == address') && (serial_numbers == serial_numbers') where: /// challenge' := HashToScalar(r * G, pk_sig, pr_sig, signer, \[tvk, tcm, function ID, input IDs\]) pub fn verify(&self, input_types: &[console::ValueType], tpk: &Group) -> Boolean { - // Compute the function ID as `Hash(network_id, program_id, function_name)`. - let function_id = A::hash_bhp1024( - &(&self.network_id, self.program_id.name(), self.program_id.network(), &self.function_name).to_bits_le(), - ); + // Compute the function ID + let function_id = compute_function_id(&self.network_id, &self.program_id, &self.function_name); // Construct the signature message as `[tvk, tcm, function ID, input IDs]`. let mut message = Vec::with_capacity(3 + 4 * self.input_ids.len()); @@ -111,9 +109,8 @@ impl Request { false => assert!(signature.is_none()), } - // Compute the function ID as `Hash(network_id, program_id, function_name)`. - let function_id = - A::hash_bhp1024(&(network_id, program_id.name(), program_id.network(), function_name).to_bits_le()); + // Compute the function ID. + let function_id = compute_function_id(network_id, program_id, function_name); // Initialize a vector for a message. let mut message = Vec::new(); diff --git a/circuit/program/src/response/from_outputs.rs b/circuit/program/src/response/from_outputs.rs index 5618e8702d..2cfee2ccae 100644 --- a/circuit/program/src/response/from_outputs.rs +++ b/circuit/program/src/response/from_outputs.rs @@ -27,9 +27,8 @@ impl Response { output_types: &[console::ValueType], // Note: Console type output_registers: &[Option>], // Note: Console type ) -> Self { - // Compute the function ID as `Hash(network_id, program_id, function_name)`. - let function_id = - A::hash_bhp1024(&(network_id, program_id.name(), program_id.network(), function_name).to_bits_le()); + // Compute the function ID. + let function_id = compute_function_id(network_id, program_id, function_name); // Compute the output IDs. let output_ids = outputs diff --git a/circuit/program/src/response/mod.rs b/circuit/program/src/response/mod.rs index 897f1c09a9..288e8f4653 100644 --- a/circuit/program/src/response/mod.rs +++ b/circuit/program/src/response/mod.rs @@ -18,7 +18,7 @@ use snarkvm_circuit_types::environment::assert_scope; mod from_outputs; mod process_outputs_from_callback; -use crate::{Identifier, ProgramID, Value}; +use crate::{compute_function_id, Identifier, ProgramID, Value}; use snarkvm_circuit_network::Aleo; use snarkvm_circuit_types::{environment::prelude::*, Field, U16}; diff --git a/circuit/program/src/response/process_outputs_from_callback.rs b/circuit/program/src/response/process_outputs_from_callback.rs index 287c8fd549..4905eaa66c 100644 --- a/circuit/program/src/response/process_outputs_from_callback.rs +++ b/circuit/program/src/response/process_outputs_from_callback.rs @@ -26,9 +26,8 @@ impl Response { outputs: Vec>, // Note: Console type output_types: &[console::ValueType], // Note: Console type ) -> Vec> { - // Compute the function ID as `Hash(network_id, program_id, function_name)`. - let function_id = - A::hash_bhp1024(&(network_id, program_id.name(), program_id.network(), function_name).to_bits_le()); + // Compute the function ID. + let function_id = compute_function_id(network_id, program_id, function_name); match outputs .iter() diff --git a/console/program/src/function_id/mod.rs b/console/program/src/function_id/mod.rs new file mode 100644 index 0000000000..91c17ec162 --- /dev/null +++ b/console/program/src/function_id/mod.rs @@ -0,0 +1,39 @@ +// Copyright (C) 2019-2023 Aleo Systems Inc. +// This file is part of the snarkVM library. + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at: +// http://www.apache.org/licenses/LICENSE-2.0 + +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +use crate::{Identifier, ProgramID}; +use snarkvm_console_account::ToBits; +use snarkvm_console_algorithms::Result; +use snarkvm_console_network::Network; +use snarkvm_console_types::{Field, U16, U8}; + +/// Compute the function ID as `Hash(network_id, program_id.len(), program_id, function_name.len(), function_name)`. +pub fn compute_function_id( + network_id: &U16, + program_id: &ProgramID, + function_name: &Identifier, +) -> Result> { + N::hash_bhp1024( + &( + *network_id, + U8::::new(program_id.name().size_in_bits()), + program_id.name(), + U8::::new(program_id.network().size_in_bits()), + program_id.network(), + U8::::new(function_name.size_in_bits()), + function_name, + ) + .to_bits_le(), + ) +} diff --git a/console/program/src/lib.rs b/console/program/src/lib.rs index 8547b46694..bb14280f53 100644 --- a/console/program/src/lib.rs +++ b/console/program/src/lib.rs @@ -30,6 +30,9 @@ pub use data::*; mod data_types; pub use data_types::*; +mod function_id; +pub use function_id::*; + mod id; pub use id::*; diff --git a/console/program/src/request/mod.rs b/console/program/src/request/mod.rs index 9fa69a0d95..528d4c044b 100644 --- a/console/program/src/request/mod.rs +++ b/console/program/src/request/mod.rs @@ -21,7 +21,7 @@ mod sign; mod string; mod verify; -use crate::{Identifier, Plaintext, ProgramID, Record, Value, ValueType}; +use crate::{compute_function_id, Identifier, Plaintext, ProgramID, Record, Value, ValueType}; use snarkvm_console_account::{Address, ComputeKey, GraphKey, PrivateKey, Signature, ViewKey}; use snarkvm_console_network::Network; use snarkvm_console_types::prelude::*; diff --git a/console/program/src/request/sign.rs b/console/program/src/request/sign.rs index c71c7fa56a..00e8a4f171 100644 --- a/console/program/src/request/sign.rs +++ b/console/program/src/request/sign.rs @@ -64,10 +64,10 @@ impl Request { // Compute the transition commitment `tcm` as `Hash(tvk)`. let tcm = N::hash_psd2(&[tvk])?; - // Compute the function ID as `Hash(network_id, program_id, function_name)`. - let function_id = N::hash_bhp1024( - &(U16::::new(N::ID), program_id.name(), program_id.network(), function_name).to_bits_le(), - )?; + // Get the network id + let network_id = U16::new(N::ID); + // Compute the function id + let function_id = compute_function_id(&network_id, &program_id, &function_name)?; // Construct the hash input as `(r * G, pk_sig, pr_sig, signer, [tvk, tcm, function ID, input IDs])`. let mut message = Vec::with_capacity(9 + 2 * inputs.len()); @@ -222,7 +222,7 @@ impl Request { Ok(Self { signer, - network_id: U16::new(N::ID), + network_id, program_id, function_name, input_ids, diff --git a/console/program/src/request/verify.rs b/console/program/src/request/verify.rs index c1004818c4..6e4ee00a74 100644 --- a/console/program/src/request/verify.rs +++ b/console/program/src/request/verify.rs @@ -43,11 +43,8 @@ impl Request { // Retrieve the response from the signature. let response = self.signature.response(); - // Compute the function ID as `Hash(network_id, program_id, function_name)`. - let function_id = match N::hash_bhp1024( - &(U16::::new(N::ID), self.program_id.name(), self.program_id.network(), &self.function_name) - .to_bits_le(), - ) { + // Compute the function ID. + let function_id = match compute_function_id(&self.network_id, &self.program_id, &self.function_name) { Ok(function_id) => function_id, Err(error) => { eprintln!("Failed to construct the function ID: {error}"); diff --git a/console/program/src/response/mod.rs b/console/program/src/response/mod.rs index 1c3d774b0b..f54e7f9dca 100644 --- a/console/program/src/response/mod.rs +++ b/console/program/src/response/mod.rs @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -use crate::{Identifier, ProgramID, Register, Value, ValueType}; +use crate::{compute_function_id, Identifier, ProgramID, Register, Value, ValueType}; use snarkvm_console_network::Network; use snarkvm_console_types::prelude::*; @@ -60,9 +60,8 @@ impl Response { output_types: &[ValueType], output_operands: &[Option>], ) -> Result { - // Compute the function ID as `Hash(network_id, program_id, function_name)`. - let function_id = - N::hash_bhp1024(&(*network_id, program_id.name(), program_id.network(), function_name).to_bits_le())?; + // Compute the function ID. + let function_id = compute_function_id(network_id, program_id, function_name)?; // Compute the output IDs. let output_ids = outputs diff --git a/ledger/block/src/transition/mod.rs b/ledger/block/src/transition/mod.rs index 26ee80ac41..508cf157f7 100644 --- a/ledger/block/src/transition/mod.rs +++ b/ledger/block/src/transition/mod.rs @@ -26,6 +26,7 @@ mod string; use console::{ network::prelude::*, program::{ + compute_function_id, Ciphertext, Identifier, InputID, @@ -93,9 +94,8 @@ impl Transition { let function_name = *request.function_name(); let num_inputs = request.inputs().len(); - // Compute the function ID as `Hash(network_id, program_id, function_name)`. - let function_id = - N::hash_bhp1024(&(network_id, program_id.name(), program_id.network(), function_name).to_bits_le())?; + // Compute the function ID. + let function_id = compute_function_id(&network_id, &program_id, &function_name)?; let inputs = request .input_ids() diff --git a/synthesizer/process/src/lib.rs b/synthesizer/process/src/lib.rs index eaa24104e4..dd65320dc0 100644 --- a/synthesizer/process/src/lib.rs +++ b/synthesizer/process/src/lib.rs @@ -42,7 +42,7 @@ mod tests; use console::{ account::PrivateKey, network::prelude::*, - program::{Identifier, Literal, Locator, Plaintext, ProgramID, Record, Response, Value}, + program::{compute_function_id, Identifier, Literal, Locator, Plaintext, ProgramID, Record, Response, Value}, types::{Field, U16, U64}, }; use ledger_block::{Deployment, Execution, Fee, Input, Transition}; diff --git a/synthesizer/process/src/verify_execution.rs b/synthesizer/process/src/verify_execution.rs index f4c57cf744..13e04e9c13 100644 --- a/synthesizer/process/src/verify_execution.rs +++ b/synthesizer/process/src/verify_execution.rs @@ -73,16 +73,10 @@ impl Process { // Ensure the number of outputs is within the allowed range. ensure!(transition.outputs().len() <= N::MAX_OUTPUTS, "Transition exceeded maximum number of outputs"); - // Compute the function ID as `Hash(network_id, program_id, function_name)`. - let function_id = N::hash_bhp1024( - &( - U16::::new(N::ID), - transition.program_id().name(), - transition.program_id().network(), - transition.function_name(), - ) - .to_bits_le(), - )?; + // Get the network id + let network_id = U16::new(N::ID); + // Compute the function ID. + let function_id = compute_function_id(&network_id, transition.program_id(), transition.function_name())?; // Ensure each input is valid. if transition diff --git a/synthesizer/process/src/verify_fee.rs b/synthesizer/process/src/verify_fee.rs index 5d7a9455c4..5d36866d3d 100644 --- a/synthesizer/process/src/verify_fee.rs +++ b/synthesizer/process/src/verify_fee.rs @@ -76,11 +76,10 @@ impl Process { fn verify_fee_private(&self, fee: &&Fee) -> Result<()> { let timer = timer!("Process::verify_fee_private"); - // Compute the function ID as `Hash(network_id, program_id, function_name)`. - let function_id = N::hash_bhp1024( - &(U16::::new(N::ID), fee.program_id().name(), fee.program_id().network(), fee.function_name()) - .to_bits_le(), - )?; + // Get the network id + let network_id = U16::new(N::ID); + // Compute the function ID. + let function_id = compute_function_id(&network_id, fee.program_id(), fee.function_name())?; // Ensure the fee contains 1 input record. ensure!( @@ -146,11 +145,10 @@ impl Process { fn verify_fee_public(&self, fee: &&Fee) -> Result<()> { let timer = timer!("Process::verify_fee_public"); - // Compute the function ID as `Hash(network_id, program_id, function_name)`. - let function_id = N::hash_bhp1024( - &(U16::::new(N::ID), fee.program_id().name(), fee.program_id().network(), fee.function_name()) - .to_bits_le(), - )?; + // Get the network id + let network_id = U16::new(N::ID); + // Compute the function ID. + let function_id = compute_function_id(&network_id, fee.program_id(), fee.function_name())?; // Ensure the fee contains all public inputs. ensure!( From 92e20034f60d02a5f53823afaf6d015236adbd31 Mon Sep 17 00:00:00 2001 From: Victor Sint Nicolaas Date: Mon, 6 Nov 2023 12:05:08 +0100 Subject: [PATCH 012/298] Update tests --- circuit/program/src/request/verify.rs | 6 +++--- circuit/program/src/response/from_outputs.rs | 4 ++-- .../program/src/response/process_outputs_from_callback.rs | 6 +++--- synthesizer/src/vm/mod.rs | 6 +++--- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/circuit/program/src/request/verify.rs b/circuit/program/src/request/verify.rs index a095dcaa32..3869ac86e5 100644 --- a/circuit/program/src/request/verify.rs +++ b/circuit/program/src/request/verify.rs @@ -391,16 +391,16 @@ mod tests { // Note: This is correct. At this (high) level of a program, we override the default mode in the `Record` case, // based on the user-defined visibility in the record type. Thus, we have nonzero private and constraint values. // These bounds are determined experimentally. - check_verify(Mode::Constant, 42520, 0, 17494, 17518) + check_verify(Mode::Constant, 42629, 0, 17494, 17518) } #[test] fn test_sign_and_verify_public() -> Result<()> { - check_verify(Mode::Public, 40018, 0, 26401, 26429) + check_verify(Mode::Public, 40130, 0, 26401, 26429) } #[test] fn test_sign_and_verify_private() -> Result<()> { - check_verify(Mode::Private, 40018, 0, 26401, 26429) + check_verify(Mode::Private, 40130, 0, 26401, 26429) } } diff --git a/circuit/program/src/response/from_outputs.rs b/circuit/program/src/response/from_outputs.rs index 2cfee2ccae..b42ef9d875 100644 --- a/circuit/program/src/response/from_outputs.rs +++ b/circuit/program/src/response/from_outputs.rs @@ -301,11 +301,11 @@ mod tests { #[test] fn test_from_outputs_public() -> Result<()> { - check_from_outputs(Mode::Public, 24793, 6, 13962, 13983) + check_from_outputs(Mode::Public, 24849, 6, 13962, 13983) } #[test] fn test_from_outputs_private() -> Result<()> { - check_from_outputs(Mode::Private, 24793, 6, 13962, 13983) + check_from_outputs(Mode::Private, 24849, 6, 13962, 13983) } } diff --git a/circuit/program/src/response/process_outputs_from_callback.rs b/circuit/program/src/response/process_outputs_from_callback.rs index 4905eaa66c..dfadc178e3 100644 --- a/circuit/program/src/response/process_outputs_from_callback.rs +++ b/circuit/program/src/response/process_outputs_from_callback.rs @@ -325,16 +325,16 @@ mod tests { #[test] fn test_from_callback_constant() -> Result<()> { - check_from_callback(Mode::Constant, 20788, 5, 4922, 4931) + check_from_callback(Mode::Constant, 20844, 5, 4922, 4931) } #[test] fn test_from_callback_public() -> Result<()> { - check_from_callback(Mode::Public, 20788, 5, 6217, 6226) + check_from_callback(Mode::Public, 20844, 5, 6217, 6226) } #[test] fn test_from_callback_private() -> Result<()> { - check_from_callback(Mode::Private, 20788, 5, 6217, 6226) + check_from_callback(Mode::Private, 20844, 5, 6217, 6226) } } diff --git a/synthesizer/src/vm/mod.rs b/synthesizer/src/vm/mod.rs index baa491b906..8e94608319 100644 --- a/synthesizer/src/vm/mod.rs +++ b/synthesizer/src/vm/mod.rs @@ -893,12 +893,12 @@ function a: sample_next_block(&vm, &caller_private_key, &[deployment_3.clone(), deployment_4.clone()], rng).unwrap(); vm.add_next_block(&deployment_block).unwrap(); - // Check that the iterator ordering is not the same as the deployment ordering. + // Check that the iterator ordering is the same as the deployment ordering. let deployment_transaction_ids = vm.transaction_store().deployment_transaction_ids().map(|id| *id).collect::>(); - // This `assert_ne` check is here to ensure that we are properly loading imports even though any order will work for `VM::from`. + // This assert check is here to ensure that we are properly loading imports even though any order will work for `VM::from`. // Note: `deployment_transaction_ids` is sorted lexicographically by transaction id, so the order may change if we update internal methods. - assert_ne!(deployment_transaction_ids, vec![ + assert_eq!(deployment_transaction_ids, vec![ deployment_1.id(), deployment_2.id(), deployment_3.id(), From b9abacc658453546e2841d9774b344e6a1a25691 Mon Sep 17 00:00:00 2001 From: Victor Sint Nicolaas Date: Mon, 6 Nov 2023 12:18:22 +0100 Subject: [PATCH 013/298] Update test expectations --- .../arrays_in_finalize.out | 12 +++++----- .../execute_and_finalize/child_and_parent.out | 20 ++++++++-------- .../complex_finalization.out | 12 +++++----- .../vm/execute_and_finalize/count_usages.out | 14 +++++------ .../vm/execute_and_finalize/hello.out | 20 ++++++++-------- .../mapping_operations.out | 16 ++++++------- .../execute_and_finalize/mint_and_split.out | 2 +- .../execute_and_finalize/program_callable.out | 14 +++++------ .../vm/execute_and_finalize/public_wallet.out | 6 ++--- .../read_external_mapping.out | 24 +++++++++---------- .../vm/execute_and_finalize/test_branch.out | 12 +++++----- .../vm/execute_and_finalize/test_rand.out | 16 ++++++------- .../vm/execute_and_finalize/timelock.out | 8 +++---- .../execute_and_finalize/unused_position.out | 4 ++-- .../vm/execute_and_finalize/user_callable.out | 6 ++--- 15 files changed, 93 insertions(+), 93 deletions(-) diff --git a/synthesizer/tests/expectations/vm/execute_and_finalize/arrays_in_finalize.out b/synthesizer/tests/expectations/vm/execute_and_finalize/arrays_in_finalize.out index 2f99747752..c932e53679 100644 --- a/synthesizer/tests/expectations/vm/execute_and_finalize/arrays_in_finalize.out +++ b/synthesizer/tests/expectations/vm/execute_and_finalize/arrays_in_finalize.out @@ -4,15 +4,15 @@ outputs: execute: arrays_in_finalize.aleo/test_arrays: outputs: - - '{"type":"public","id":"8423501051492945494142580898503776230777967039101310769883569628562838106961field","value":"[\n [\n true,\n false,\n true,\n false\n ]\n]"}' - - '{"type":"public","id":"6373810658910535946682884531888342268371302467625666065790785860646654788892field","value":"[\n [\n false,\n true,\n false,\n true\n ]\n]"}' - - '{"type":"public","id":"3091501445020687319877822274133758457934608796618645756988915091755405157586field","value":"[\n [\n false,\n false,\n false,\n false\n ]\n]"}' - - '{"type":"private","id":"6526736422839961003683955650152924988761580233649162767954364194151255194053field","value":"ciphertext1qvqr73dv3clq8jtx7trf8k9l3eshmh0tyvvp2ta7a0y3pedjj99eczrpwk6045wektcw7mmjzdrm8f67x7egd4dfch3slf4q6ag3lxn0p6cryuecunyl2d9ffr8ntj57dvmv9rg7fhlrtc995w2ruju7j20qgndw85u"}' - - '{"type":"future","id":"5831343183208330086568343850686282945376722092994016952161543991067519254136field","value":"{\n program_id: arrays_in_finalize.aleo,\n function_name: test_arrays,\n arguments: [\n [\n [\n true,\n false,\n true,\n false\n ]\n],\n [\n [\n false,\n true,\n false,\n true\n ]\n]\n ]\n}"}' + - '{"type":"public","id":"7051868022199538281983484726334868585120214850709506400685648463568311074059field","value":"[\n [\n true,\n false,\n true,\n false\n ]\n]"}' + - '{"type":"public","id":"2698854010946894280403857018674102550683827066821274282398230616068613628761field","value":"[\n [\n false,\n true,\n false,\n true\n ]\n]"}' + - '{"type":"public","id":"6734503747161420974974766078278270196733130665586322841403208897932027830291field","value":"[\n [\n false,\n false,\n false,\n false\n ]\n]"}' + - '{"type":"private","id":"5168391188395506111029592681206431247443904847166129464977071139926165416103field","value":"ciphertext1qvqrg9enxaw2x8xm8ce0c8xz80envgf2p4hyfr9p2rx0mqfjm303spra4893t20aekwz55slyz7y9j3pln2ul2qx5qmtsxhut9vg0yf2q59xuu5fr3x6pczq932km4n476v2arehnst66ppuxkghhwtdsz8qqpdkmdl"}' + - '{"type":"future","id":"4517957061576175622472518204577133206661336185041169936924799458890521883925field","value":"{\n program_id: arrays_in_finalize.aleo,\n function_name: test_arrays,\n arguments: [\n [\n [\n true,\n false,\n true,\n false\n ]\n],\n [\n [\n false,\n true,\n false,\n true\n ]\n]\n ]\n}"}' speculate: the execution was accepted add_next_block: succeeded. additional: - child_outputs: credits.aleo/fee_public: outputs: - - '{"type":"future","id":"611935698929626281656171069026748974326705967123466685855354594539166326131field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1y9t0y4lvhm43qdzlfjmfzh8985vfnx9ms368p07x5lsemet5ey8qt0ssjn,\n 21758u64\n ]\n}"}' + - '{"type":"future","id":"2476798995127334960005895658235454048189044193444863602770662307552278795852field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1y9t0y4lvhm43qdzlfjmfzh8985vfnx9ms368p07x5lsemet5ey8qt0ssjn,\n 21758u64\n ]\n}"}' diff --git a/synthesizer/tests/expectations/vm/execute_and_finalize/child_and_parent.out b/synthesizer/tests/expectations/vm/execute_and_finalize/child_and_parent.out index 6aab0a972c..2d9421d6ac 100644 --- a/synthesizer/tests/expectations/vm/execute_and_finalize/child_and_parent.out +++ b/synthesizer/tests/expectations/vm/execute_and_finalize/child_and_parent.out @@ -4,30 +4,30 @@ outputs: execute: child.aleo/foo: outputs: - - '{"type":"public","id":"389051587023874025297792889573178986947322645231926608183742711950919559411field","value":"aleo1qr2ha4pfs5l28aze88yn6fhleeythklkczrule2v838uwj65n5gqxt9djx"}' - - '{"type":"public","id":"764027935495423951991221261588244508770271800988614802602832277026356994499field","value":"aleo1qr2ha4pfs5l28aze88yn6fhleeythklkczrule2v838uwj65n5gqxt9djx"}' + - '{"type":"public","id":"4404941057821897234460846736708985506912590484378613605920261232780052938368field","value":"aleo1qr2ha4pfs5l28aze88yn6fhleeythklkczrule2v838uwj65n5gqxt9djx"}' + - '{"type":"public","id":"6863425187346818199213777711361503911686928486889277167846555491973904299237field","value":"aleo1qr2ha4pfs5l28aze88yn6fhleeythklkczrule2v838uwj65n5gqxt9djx"}' speculate: the execution was accepted add_next_block: succeeded. - verified: true execute: parent.aleo/foo: outputs: - - '{"type":"public","id":"1750346614465839730584856482412734170916382156473722062953642664481181629739field","value":"aleo16w8t56s7v6ud7vu33fr388ph0dq0c7yhp597cyjt88rr3nultcyqcyk9yy"}' - - '{"type":"public","id":"5344219132331075098560420486516441520509044320380266746188928734352154985147field","value":"aleo1qr2ha4pfs5l28aze88yn6fhleeythklkczrule2v838uwj65n5gqxt9djx"}' - - '{"type":"public","id":"1573682489501842474093724226520469727912427938089152276506875941161556613092field","value":"aleo1qr2ha4pfs5l28aze88yn6fhleeythklkczrule2v838uwj65n5gqxt9djx"}' - - '{"type":"public","id":"5522952276718822387440091782615844704170996655370860689760310532706413315373field","value":"aleo1qr2ha4pfs5l28aze88yn6fhleeythklkczrule2v838uwj65n5gqxt9djx"}' + - '{"type":"public","id":"4032348389279619478903783724973856974914153220001634992136284294521719106457field","value":"aleo16w8t56s7v6ud7vu33fr388ph0dq0c7yhp597cyjt88rr3nultcyqcyk9yy"}' + - '{"type":"public","id":"6894525838799766649380797171209727527303688311818489325879915601418369029651field","value":"aleo1qr2ha4pfs5l28aze88yn6fhleeythklkczrule2v838uwj65n5gqxt9djx"}' + - '{"type":"public","id":"4203796530460145754809632057281111766599705667889223511936495853688112519168field","value":"aleo1qr2ha4pfs5l28aze88yn6fhleeythklkczrule2v838uwj65n5gqxt9djx"}' + - '{"type":"public","id":"7823270598048228254405827126617626178209628613624185509023926075521007972087field","value":"aleo1qr2ha4pfs5l28aze88yn6fhleeythklkczrule2v838uwj65n5gqxt9djx"}' speculate: the execution was accepted add_next_block: succeeded. additional: - child_outputs: credits.aleo/fee_public: outputs: - - '{"type":"future","id":"6557860754730668406004469054379794576334242764827542178306889009454484547032field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1qr2ha4pfs5l28aze88yn6fhleeythklkczrule2v838uwj65n5gqxt9djx,\n 1244u64\n ]\n}"}' + - '{"type":"future","id":"2483571147486478105991602705188841356032984629663296862118724692881212920175field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1qr2ha4pfs5l28aze88yn6fhleeythklkczrule2v838uwj65n5gqxt9djx,\n 1244u64\n ]\n}"}' - child_outputs: child.aleo/foo: outputs: - - '{"type":"public","id":"5712527802009221538913597905008159571083800168555613323828114175105395494302field","value":"aleo16w8t56s7v6ud7vu33fr388ph0dq0c7yhp597cyjt88rr3nultcyqcyk9yy"}' - - '{"type":"public","id":"2170761061395221552321793888804720334493316122331828231173520748015857657389field","value":"aleo1qr2ha4pfs5l28aze88yn6fhleeythklkczrule2v838uwj65n5gqxt9djx"}' + - '{"type":"public","id":"200002908579085284998521086275289275746160962451836392081488485911047931043field","value":"aleo16w8t56s7v6ud7vu33fr388ph0dq0c7yhp597cyjt88rr3nultcyqcyk9yy"}' + - '{"type":"public","id":"7350968487086023676016513382715106449866153082012832343288974503948378937589field","value":"aleo1qr2ha4pfs5l28aze88yn6fhleeythklkczrule2v838uwj65n5gqxt9djx"}' credits.aleo/fee_public: outputs: - - '{"type":"future","id":"6934683053495529076879804638371439764251999038469408002617655045734104381794field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1qr2ha4pfs5l28aze88yn6fhleeythklkczrule2v838uwj65n5gqxt9djx,\n 2123u64\n ]\n}"}' + - '{"type":"future","id":"2385771550748706618588353711817373130237795779368565655313787366409876227847field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1qr2ha4pfs5l28aze88yn6fhleeythklkczrule2v838uwj65n5gqxt9djx,\n 2123u64\n ]\n}"}' diff --git a/synthesizer/tests/expectations/vm/execute_and_finalize/complex_finalization.out b/synthesizer/tests/expectations/vm/execute_and_finalize/complex_finalization.out index 968809fe2f..1d25fe3e01 100644 --- a/synthesizer/tests/expectations/vm/execute_and_finalize/complex_finalization.out +++ b/synthesizer/tests/expectations/vm/execute_and_finalize/complex_finalization.out @@ -4,23 +4,23 @@ outputs: execute: four_program.aleo/a: outputs: - - '{"type":"future","id":"7070877344843470845071680218340128414876561588663484899722739079133777261690field","value":"{\n program_id: four_program.aleo,\n function_name: a,\n arguments: [\n {\n program_id: two_program.aleo,\n function_name: b,\n arguments: [\n {\n program_id: zero_program.aleo,\n function_name: c,\n arguments: [\n aleo1kw4knandael9qcpxs6g36rr6h7dwvjz6q25ueah6zz9v57zjlvxsx5llq8\n ]\n },\n {\n program_id: one_program.aleo,\n function_name: d,\n arguments: [\n aleo1kw4knandael9qcpxs6g36rr6h7dwvjz6q25ueah6zz9v57zjlvxsx5llq8\n ]\n },\n aleo1kw4knandael9qcpxs6g36rr6h7dwvjz6q25ueah6zz9v57zjlvxsx5llq8\n ]\n },\n {\n program_id: three_program.aleo,\n function_name: e,\n arguments: [\n {\n program_id: two_program.aleo,\n function_name: b,\n arguments: [\n {\n program_id: zero_program.aleo,\n function_name: c,\n arguments: [\n aleo1kw4knandael9qcpxs6g36rr6h7dwvjz6q25ueah6zz9v57zjlvxsx5llq8\n ]\n },\n {\n program_id: one_program.aleo,\n function_name: d,\n arguments: [\n aleo1kw4knandael9qcpxs6g36rr6h7dwvjz6q25ueah6zz9v57zjlvxsx5llq8\n ]\n },\n aleo1kw4knandael9qcpxs6g36rr6h7dwvjz6q25ueah6zz9v57zjlvxsx5llq8\n ]\n },\n {\n program_id: one_program.aleo,\n function_name: d,\n arguments: [\n aleo1kw4knandael9qcpxs6g36rr6h7dwvjz6q25ueah6zz9v57zjlvxsx5llq8\n ]\n },\n {\n program_id: zero_program.aleo,\n function_name: c,\n arguments: [\n aleo1kw4knandael9qcpxs6g36rr6h7dwvjz6q25ueah6zz9v57zjlvxsx5llq8\n ]\n },\n aleo1kw4knandael9qcpxs6g36rr6h7dwvjz6q25ueah6zz9v57zjlvxsx5llq8\n ]\n },\n aleo1kw4knandael9qcpxs6g36rr6h7dwvjz6q25ueah6zz9v57zjlvxsx5llq8\n ]\n}"}' + - '{"type":"future","id":"867729512285113675919875604295021952375691596478307346915672564097817162044field","value":"{\n program_id: four_program.aleo,\n function_name: a,\n arguments: [\n {\n program_id: two_program.aleo,\n function_name: b,\n arguments: [\n {\n program_id: zero_program.aleo,\n function_name: c,\n arguments: [\n aleo1kw4knandael9qcpxs6g36rr6h7dwvjz6q25ueah6zz9v57zjlvxsx5llq8\n ]\n },\n {\n program_id: one_program.aleo,\n function_name: d,\n arguments: [\n aleo1kw4knandael9qcpxs6g36rr6h7dwvjz6q25ueah6zz9v57zjlvxsx5llq8\n ]\n },\n aleo1kw4knandael9qcpxs6g36rr6h7dwvjz6q25ueah6zz9v57zjlvxsx5llq8\n ]\n },\n {\n program_id: three_program.aleo,\n function_name: e,\n arguments: [\n {\n program_id: two_program.aleo,\n function_name: b,\n arguments: [\n {\n program_id: zero_program.aleo,\n function_name: c,\n arguments: [\n aleo1kw4knandael9qcpxs6g36rr6h7dwvjz6q25ueah6zz9v57zjlvxsx5llq8\n ]\n },\n {\n program_id: one_program.aleo,\n function_name: d,\n arguments: [\n aleo1kw4knandael9qcpxs6g36rr6h7dwvjz6q25ueah6zz9v57zjlvxsx5llq8\n ]\n },\n aleo1kw4knandael9qcpxs6g36rr6h7dwvjz6q25ueah6zz9v57zjlvxsx5llq8\n ]\n },\n {\n program_id: one_program.aleo,\n function_name: d,\n arguments: [\n aleo1kw4knandael9qcpxs6g36rr6h7dwvjz6q25ueah6zz9v57zjlvxsx5llq8\n ]\n },\n {\n program_id: zero_program.aleo,\n function_name: c,\n arguments: [\n aleo1kw4knandael9qcpxs6g36rr6h7dwvjz6q25ueah6zz9v57zjlvxsx5llq8\n ]\n },\n aleo1kw4knandael9qcpxs6g36rr6h7dwvjz6q25ueah6zz9v57zjlvxsx5llq8\n ]\n },\n aleo1kw4knandael9qcpxs6g36rr6h7dwvjz6q25ueah6zz9v57zjlvxsx5llq8\n ]\n}"}' speculate: the execution was accepted add_next_block: succeeded. additional: - child_outputs: zero_program.aleo/c: outputs: - - '{"type":"future","id":"6477965281694625542813245938794172569328608429706708191922101843636085582648field","value":"{\n program_id: zero_program.aleo,\n function_name: c,\n arguments: [\n aleo1kw4knandael9qcpxs6g36rr6h7dwvjz6q25ueah6zz9v57zjlvxsx5llq8\n ]\n}"}' + - '{"type":"future","id":"6023713305098041369267397706416191328025594696092005758834659886286613475748field","value":"{\n program_id: zero_program.aleo,\n function_name: c,\n arguments: [\n aleo1kw4knandael9qcpxs6g36rr6h7dwvjz6q25ueah6zz9v57zjlvxsx5llq8\n ]\n}"}' one_program.aleo/d: outputs: - - '{"type":"future","id":"7600562933389723321829659564857024316904973330057294558938622149411503122565field","value":"{\n program_id: one_program.aleo,\n function_name: d,\n arguments: [\n aleo1kw4knandael9qcpxs6g36rr6h7dwvjz6q25ueah6zz9v57zjlvxsx5llq8\n ]\n}"}' + - '{"type":"future","id":"6562004736027208776543041380361518509926930856889216555330996078767924219181field","value":"{\n program_id: one_program.aleo,\n function_name: d,\n arguments: [\n aleo1kw4knandael9qcpxs6g36rr6h7dwvjz6q25ueah6zz9v57zjlvxsx5llq8\n ]\n}"}' two_program.aleo/b: outputs: - - '{"type":"future","id":"1088466287454699993852527092566314082160141085274506025284078608454717245108field","value":"{\n program_id: two_program.aleo,\n function_name: b,\n arguments: [\n {\n program_id: zero_program.aleo,\n function_name: c,\n arguments: [\n aleo1kw4knandael9qcpxs6g36rr6h7dwvjz6q25ueah6zz9v57zjlvxsx5llq8\n ]\n },\n {\n program_id: one_program.aleo,\n function_name: d,\n arguments: [\n aleo1kw4knandael9qcpxs6g36rr6h7dwvjz6q25ueah6zz9v57zjlvxsx5llq8\n ]\n },\n aleo1kw4knandael9qcpxs6g36rr6h7dwvjz6q25ueah6zz9v57zjlvxsx5llq8\n ]\n}"}' + - '{"type":"future","id":"668645730802382062346901896989661985007590566040463370470872766825827822177field","value":"{\n program_id: two_program.aleo,\n function_name: b,\n arguments: [\n {\n program_id: zero_program.aleo,\n function_name: c,\n arguments: [\n aleo1kw4knandael9qcpxs6g36rr6h7dwvjz6q25ueah6zz9v57zjlvxsx5llq8\n ]\n },\n {\n program_id: one_program.aleo,\n function_name: d,\n arguments: [\n aleo1kw4knandael9qcpxs6g36rr6h7dwvjz6q25ueah6zz9v57zjlvxsx5llq8\n ]\n },\n aleo1kw4knandael9qcpxs6g36rr6h7dwvjz6q25ueah6zz9v57zjlvxsx5llq8\n ]\n}"}' three_program.aleo/e: outputs: - - '{"type":"future","id":"7841227793321257675149138943803344962284191528517008231244304707117434937108field","value":"{\n program_id: three_program.aleo,\n function_name: e,\n arguments: [\n {\n program_id: two_program.aleo,\n function_name: b,\n arguments: [\n {\n program_id: zero_program.aleo,\n function_name: c,\n arguments: [\n aleo1kw4knandael9qcpxs6g36rr6h7dwvjz6q25ueah6zz9v57zjlvxsx5llq8\n ]\n },\n {\n program_id: one_program.aleo,\n function_name: d,\n arguments: [\n aleo1kw4knandael9qcpxs6g36rr6h7dwvjz6q25ueah6zz9v57zjlvxsx5llq8\n ]\n },\n aleo1kw4knandael9qcpxs6g36rr6h7dwvjz6q25ueah6zz9v57zjlvxsx5llq8\n ]\n },\n {\n program_id: one_program.aleo,\n function_name: d,\n arguments: [\n aleo1kw4knandael9qcpxs6g36rr6h7dwvjz6q25ueah6zz9v57zjlvxsx5llq8\n ]\n },\n {\n program_id: zero_program.aleo,\n function_name: c,\n arguments: [\n aleo1kw4knandael9qcpxs6g36rr6h7dwvjz6q25ueah6zz9v57zjlvxsx5llq8\n ]\n },\n aleo1kw4knandael9qcpxs6g36rr6h7dwvjz6q25ueah6zz9v57zjlvxsx5llq8\n ]\n}"}' + - '{"type":"future","id":"1350294781374667373450127305160654687819360174207149219930198334406776418824field","value":"{\n program_id: three_program.aleo,\n function_name: e,\n arguments: [\n {\n program_id: two_program.aleo,\n function_name: b,\n arguments: [\n {\n program_id: zero_program.aleo,\n function_name: c,\n arguments: [\n aleo1kw4knandael9qcpxs6g36rr6h7dwvjz6q25ueah6zz9v57zjlvxsx5llq8\n ]\n },\n {\n program_id: one_program.aleo,\n function_name: d,\n arguments: [\n aleo1kw4knandael9qcpxs6g36rr6h7dwvjz6q25ueah6zz9v57zjlvxsx5llq8\n ]\n },\n aleo1kw4knandael9qcpxs6g36rr6h7dwvjz6q25ueah6zz9v57zjlvxsx5llq8\n ]\n },\n {\n program_id: one_program.aleo,\n function_name: d,\n arguments: [\n aleo1kw4knandael9qcpxs6g36rr6h7dwvjz6q25ueah6zz9v57zjlvxsx5llq8\n ]\n },\n {\n program_id: zero_program.aleo,\n function_name: c,\n arguments: [\n aleo1kw4knandael9qcpxs6g36rr6h7dwvjz6q25ueah6zz9v57zjlvxsx5llq8\n ]\n },\n aleo1kw4knandael9qcpxs6g36rr6h7dwvjz6q25ueah6zz9v57zjlvxsx5llq8\n ]\n}"}' credits.aleo/fee_public: outputs: - - '{"type":"future","id":"1237672223493374809326586125815613616482431271830981051687054520069740484800field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1kw4knandael9qcpxs6g36rr6h7dwvjz6q25ueah6zz9v57zjlvxsx5llq8,\n 1312883u64\n ]\n}"}' + - '{"type":"future","id":"6301101036530348220774048833800673255589427955562002044410042853343083209551field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1kw4knandael9qcpxs6g36rr6h7dwvjz6q25ueah6zz9v57zjlvxsx5llq8,\n 1312883u64\n ]\n}"}' diff --git a/synthesizer/tests/expectations/vm/execute_and_finalize/count_usages.out b/synthesizer/tests/expectations/vm/execute_and_finalize/count_usages.out index 21f59e8527..ec576d813c 100644 --- a/synthesizer/tests/expectations/vm/execute_and_finalize/count_usages.out +++ b/synthesizer/tests/expectations/vm/execute_and_finalize/count_usages.out @@ -4,20 +4,20 @@ outputs: execute: count_usages.aleo/add_and_subtract: outputs: - - '{"type":"private","id":"3123182017432916757124403751790889348245620410758014315114714729237515860473field","value":"ciphertext1qyqwsyyjjx85zuu3rh9ujc7lt33dgqj28xcpxa5vz0uscttkelcm2yglca4ja"}' - - '{"type":"future","id":"3075184327471252279705776826446991266718083739660015565935642091055852740382field","value":"{\n program_id: count_usages.aleo,\n function_name: add_and_subtract,\n arguments: [\n {\n program_id: basic_math.aleo,\n function_name: add_and_count,\n arguments: [\n aleo1mrughg5ssadd9fc2uwve7l6u24xn76kyz24zsjtzta03vgkq4vpqggl6fg\n ]\n },\n {\n program_id: basic_math.aleo,\n function_name: sub_and_count,\n arguments: [\n aleo1mrughg5ssadd9fc2uwve7l6u24xn76kyz24zsjtzta03vgkq4vpqggl6fg\n ]\n }\n \n ]\n}"}' + - '{"type":"private","id":"5995165900489236048724189329217011788885182262230664342189030052523170979761field","value":"ciphertext1qyq9fpp2wkapda6cfaprteayg2gjzn66n5nxtfje93r83crs2zmv2qcsx08xs"}' + - '{"type":"future","id":"6684150603764937916097990120387351299053371864904660697581502582495528413682field","value":"{\n program_id: count_usages.aleo,\n function_name: add_and_subtract,\n arguments: [\n {\n program_id: basic_math.aleo,\n function_name: add_and_count,\n arguments: [\n aleo1mrughg5ssadd9fc2uwve7l6u24xn76kyz24zsjtzta03vgkq4vpqggl6fg\n ]\n },\n {\n program_id: basic_math.aleo,\n function_name: sub_and_count,\n arguments: [\n aleo1mrughg5ssadd9fc2uwve7l6u24xn76kyz24zsjtzta03vgkq4vpqggl6fg\n ]\n }\n \n ]\n}"}' speculate: the execution was accepted add_next_block: succeeded. additional: - child_outputs: basic_math.aleo/add_and_count: outputs: - - '{"type":"private","id":"4561312717108467882490189383753688162224283446985485227292501566765195528324field","value":"ciphertext1qyqxqf95wz9zvjvpar4mvg0uh8xuc3dwd0g3z7rggzs37wgn59lk5rqeqev0f"}' - - '{"type":"future","id":"1823043499627326708916435552316425587964911687609516559408234217585811375291field","value":"{\n program_id: basic_math.aleo,\n function_name: add_and_count,\n arguments: [\n aleo1mrughg5ssadd9fc2uwve7l6u24xn76kyz24zsjtzta03vgkq4vpqggl6fg\n ]\n}"}' + - '{"type":"private","id":"3562582071813318695601339206379553874880317250955926920878856239987857090099field","value":"ciphertext1qyqvwzwh7vwxxxn32ra57g7fukrpq428ng9segyha7qsu6z3ynzwkpcsmpvm4"}' + - '{"type":"future","id":"2644372658124242589810135509629749775455722126762863704192983367572616340676field","value":"{\n program_id: basic_math.aleo,\n function_name: add_and_count,\n arguments: [\n aleo1mrughg5ssadd9fc2uwve7l6u24xn76kyz24zsjtzta03vgkq4vpqggl6fg\n ]\n}"}' basic_math.aleo/sub_and_count: outputs: - - '{"type":"private","id":"6179141860878239968710321244474677697823391063964518415169464613412286673421field","value":"ciphertext1qyqd9vtp4hdlacy9n322hvdywk84crzw47vfygjmxe253v2tgjqpxqcq5jx54"}' - - '{"type":"future","id":"6353584285709285028969780236537279966694496448826640752394833353716781489471field","value":"{\n program_id: basic_math.aleo,\n function_name: sub_and_count,\n arguments: [\n aleo1mrughg5ssadd9fc2uwve7l6u24xn76kyz24zsjtzta03vgkq4vpqggl6fg\n ]\n}"}' + - '{"type":"private","id":"8158447991679565922495513079548529697115407945439289249853999408064177634278field","value":"ciphertext1qyq2zz9lhxnjmlxnsuqhmmfjv7ww6gz72ftenallydt3wqnq9qyvgygepnsuc"}' + - '{"type":"future","id":"4766970023193296466180554436491060950590195351430280244328867821742777104427field","value":"{\n program_id: basic_math.aleo,\n function_name: sub_and_count,\n arguments: [\n aleo1mrughg5ssadd9fc2uwve7l6u24xn76kyz24zsjtzta03vgkq4vpqggl6fg\n ]\n}"}' credits.aleo/fee_public: outputs: - - '{"type":"future","id":"1724410343181243501519372165830316719575121816257937877011429517054089311771field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1kw4knandael9qcpxs6g36rr6h7dwvjz6q25ueah6zz9v57zjlvxsx5llq8,\n 263392u64\n ]\n}"}' + - '{"type":"future","id":"1235679768483539988482826629865991343820249330910597217240061174279706292035field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1kw4knandael9qcpxs6g36rr6h7dwvjz6q25ueah6zz9v57zjlvxsx5llq8,\n 263392u64\n ]\n}"}' diff --git a/synthesizer/tests/expectations/vm/execute_and_finalize/hello.out b/synthesizer/tests/expectations/vm/execute_and_finalize/hello.out index 4ee4b5c467..daf8680d45 100644 --- a/synthesizer/tests/expectations/vm/execute_and_finalize/hello.out +++ b/synthesizer/tests/expectations/vm/execute_and_finalize/hello.out @@ -4,46 +4,46 @@ outputs: execute: hello.aleo/hello: outputs: - - '{"type":"private","id":"6254379462913920094060616443827416926361791013133233839133894947200598009041field","value":"ciphertext1qyqpmnatnq3sjej6qves695qtxu5r6lqnfnx8ck87ce3pez28x90qzgzeh4qh"}' + - '{"type":"private","id":"5614495356603750498135893718149497613043561511832919802810225365170046755923field","value":"ciphertext1qyq88y70cav8grzelac7neap9xpazde4c2l32nqc3k4lvghxtpvegzgzg4k77"}' speculate: the execution was accepted add_next_block: succeeded. - verified: true execute: hello.aleo/hello: outputs: - - '{"type":"private","id":"4161183151518570414349285932182760288961689691043823886807644299644687930091field","value":"ciphertext1qyqreg8a27jzsgm7m5umh98nr9nwyxhkv3aus5htm6vepdkr67zh5zqc4uzpd"}' + - '{"type":"private","id":"5846203644134005241685407588279763961599502145912037616385648077427742296434field","value":"ciphertext1qyqthzxggdnrwyymmgkv8slllxrq8tmtltunsrf4dcrhgcdwt4dnqqqysj50a"}' speculate: the execution was accepted add_next_block: succeeded. - verified: true execute: hello.aleo/goodbye: outputs: - - '{"type":"public","id":"5242826180235740795678885917758843199455932502638973701040836238216490364326field","value":"1u32"}' - - '{"type":"future","id":"5032744372214352919665806641360511690042524830912111693095233654380228978511field","value":"{\n program_id: hello.aleo,\n function_name: goodbye,\n arguments: [\n 1u32,\n 1u32\n ]\n}"}' + - '{"type":"public","id":"2642075470205745915437917544815624260503750815963975814259588973697216004583field","value":"1u32"}' + - '{"type":"future","id":"361930204229325680459927289502858977396610521545960746195272244038942015328field","value":"{\n program_id: hello.aleo,\n function_name: goodbye,\n arguments: [\n 1u32,\n 1u32\n ]\n}"}' speculate: the execution was accepted add_next_block: succeeded. - verified: true execute: hello.aleo/goodbye: outputs: - - '{"type":"public","id":"5954748469306089505201665920330448486455515953532955699388262149494774760375field","value":"1u32"}' - - '{"type":"future","id":"4063241715105271542572794266017703704121932214929814829482077839560118863776field","value":"{\n program_id: hello.aleo,\n function_name: goodbye,\n arguments: [\n 0u32,\n 1u32\n ]\n}"}' + - '{"type":"public","id":"550576093903942253365649001372853409216678285833302653743507502904817079079field","value":"1u32"}' + - '{"type":"future","id":"1100347856065732999293020778220654433001118051401564613677868274591240788877field","value":"{\n program_id: hello.aleo,\n function_name: goodbye,\n arguments: [\n 0u32,\n 1u32\n ]\n}"}' speculate: the execution was rejected add_next_block: succeeded. additional: - child_outputs: credits.aleo/fee_public: outputs: - - '{"type":"future","id":"5633762070565015506869877991983247311752566772551740661334199093127666173285field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo10knkelvnd55fsaarm25wch7p9suf2tqlgwy5k4nxwms6d262xyfqm2tccr,\n 1285u64\n ]\n}"}' + - '{"type":"future","id":"7906474663973043796048283030690525601153234950413516032749407211316830590611field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo10knkelvnd55fsaarm25wch7p9suf2tqlgwy5k4nxwms6d262xyfqm2tccr,\n 1285u64\n ]\n}"}' - child_outputs: credits.aleo/fee_public: outputs: - - '{"type":"future","id":"4168535226825329132770722118865464284070271653060849404506023921600553004505field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo10knkelvnd55fsaarm25wch7p9suf2tqlgwy5k4nxwms6d262xyfqm2tccr,\n 1285u64\n ]\n}"}' + - '{"type":"future","id":"4986645378558620768411028218075955547643001067189312101390486886806339263135field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo10knkelvnd55fsaarm25wch7p9suf2tqlgwy5k4nxwms6d262xyfqm2tccr,\n 1285u64\n ]\n}"}' - child_outputs: credits.aleo/fee_public: outputs: - - '{"type":"future","id":"7264507997475302694771209211625280132862970630053323876707987175500028146955field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo10knkelvnd55fsaarm25wch7p9suf2tqlgwy5k4nxwms6d262xyfqm2tccr,\n 5334u64\n ]\n}"}' + - '{"type":"future","id":"5042637910997219548198459244163194670599413522595257047810590515596700797862field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo10knkelvnd55fsaarm25wch7p9suf2tqlgwy5k4nxwms6d262xyfqm2tccr,\n 5334u64\n ]\n}"}' - child_outputs: credits.aleo/fee_public: outputs: - - '{"type":"future","id":"2296589459402270097535149680764663519350069575816165257148428557434644368237field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo10knkelvnd55fsaarm25wch7p9suf2tqlgwy5k4nxwms6d262xyfqm2tccr,\n 5334u64\n ]\n}"}' + - '{"type":"future","id":"1608310067080883240382072451203651565784203539071743117295230341585705099606field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo10knkelvnd55fsaarm25wch7p9suf2tqlgwy5k4nxwms6d262xyfqm2tccr,\n 5334u64\n ]\n}"}' diff --git a/synthesizer/tests/expectations/vm/execute_and_finalize/mapping_operations.out b/synthesizer/tests/expectations/vm/execute_and_finalize/mapping_operations.out index 6b2773e6cf..8aa61ade0f 100644 --- a/synthesizer/tests/expectations/vm/execute_and_finalize/mapping_operations.out +++ b/synthesizer/tests/expectations/vm/execute_and_finalize/mapping_operations.out @@ -4,44 +4,44 @@ outputs: execute: mapping_operations.aleo/empty_remove: outputs: - - '{"type":"future","id":"7635640739633293853436744163909014640199975942090334368682977334784204769011field","value":"{\n program_id: mapping_operations.aleo,\n function_name: empty_remove,\n arguments: [\n 10u8\n ]\n}"}' + - '{"type":"future","id":"513976670430165590671975854207176640474722360754218511139582421307363127239field","value":"{\n program_id: mapping_operations.aleo,\n function_name: empty_remove,\n arguments: [\n 10u8\n ]\n}"}' speculate: the execution was accepted add_next_block: succeeded. - verified: true execute: mapping_operations.aleo/insert_contains_remove: outputs: - - '{"type":"future","id":"2222820579352641087756930842916349134795974577897148450258189134473958563715field","value":"{\n program_id: mapping_operations.aleo,\n function_name: insert_contains_remove,\n arguments: [\n 0u8,\n 0u8\n ]\n}"}' + - '{"type":"future","id":"4694759841672908832036638375867859148189802436433991047332612043424830909025field","value":"{\n program_id: mapping_operations.aleo,\n function_name: insert_contains_remove,\n arguments: [\n 0u8,\n 0u8\n ]\n}"}' speculate: the execution was accepted add_next_block: succeeded. - verified: true execute: mapping_operations.aleo/insert_contains_remove: outputs: - - '{"type":"future","id":"7976126249407457464284575267611007374057326939931567034459595303517614384513field","value":"{\n program_id: mapping_operations.aleo,\n function_name: insert_contains_remove,\n arguments: [\n 0u8,\n 0u8\n ]\n}"}' + - '{"type":"future","id":"853544788270499381306658592151445821754762116076336414387883404121303374960field","value":"{\n program_id: mapping_operations.aleo,\n function_name: insert_contains_remove,\n arguments: [\n 0u8,\n 0u8\n ]\n}"}' speculate: the execution was accepted add_next_block: succeeded. - verified: true execute: mapping_operations.aleo/insert_contains_remove: outputs: - - '{"type":"future","id":"7584999017838461056060100707559452462656710499900127442904227073384510302747field","value":"{\n program_id: mapping_operations.aleo,\n function_name: insert_contains_remove,\n arguments: [\n 0u8,\n 1u8\n ]\n}"}' + - '{"type":"future","id":"2512373776423473614600491202863965271515634672166785663979141185347250398174field","value":"{\n program_id: mapping_operations.aleo,\n function_name: insert_contains_remove,\n arguments: [\n 0u8,\n 1u8\n ]\n}"}' speculate: the execution was accepted add_next_block: succeeded. additional: - child_outputs: credits.aleo/fee_public: outputs: - - '{"type":"future","id":"3701652920213282423281084685169254121653756184853703028504071363673532942725field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1eakarna6a70pg9r0l9qal20faejwctgur5xt7lnc2a42wj2yssfqc89rk8,\n 11245u64\n ]\n}"}' + - '{"type":"future","id":"3650557045662795765128227441824141380803288967908940644428422428167011339441field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1eakarna6a70pg9r0l9qal20faejwctgur5xt7lnc2a42wj2yssfqc89rk8,\n 11245u64\n ]\n}"}' - child_outputs: credits.aleo/fee_public: outputs: - - '{"type":"future","id":"767852843394263062723803642109980847781175859546892255347263461730875281315field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1eakarna6a70pg9r0l9qal20faejwctgur5xt7lnc2a42wj2yssfqc89rk8,\n 154810u64\n ]\n}"}' + - '{"type":"future","id":"3620478332538502782812242728702848880528883213602671188379828492788562304407field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1eakarna6a70pg9r0l9qal20faejwctgur5xt7lnc2a42wj2yssfqc89rk8,\n 154810u64\n ]\n}"}' - child_outputs: credits.aleo/fee_public: outputs: - - '{"type":"future","id":"5831877738131393412656336446760308055442933218729238434398743654782252530700field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1eakarna6a70pg9r0l9qal20faejwctgur5xt7lnc2a42wj2yssfqc89rk8,\n 154810u64\n ]\n}"}' + - '{"type":"future","id":"2964198291690383602020631875256968523060877520512567622589116733179614057067field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1eakarna6a70pg9r0l9qal20faejwctgur5xt7lnc2a42wj2yssfqc89rk8,\n 154810u64\n ]\n}"}' - child_outputs: credits.aleo/fee_public: outputs: - - '{"type":"future","id":"3924911723698610328779426182874581891939297874519691347932588542992608923909field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1eakarna6a70pg9r0l9qal20faejwctgur5xt7lnc2a42wj2yssfqc89rk8,\n 154810u64\n ]\n}"}' + - '{"type":"future","id":"3020010695955343053148471079248966957289673742622392677872488217076402723391field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1eakarna6a70pg9r0l9qal20faejwctgur5xt7lnc2a42wj2yssfqc89rk8,\n 154810u64\n ]\n}"}' diff --git a/synthesizer/tests/expectations/vm/execute_and_finalize/mint_and_split.out b/synthesizer/tests/expectations/vm/execute_and_finalize/mint_and_split.out index bd63f8cfca..6a6fe1d760 100644 --- a/synthesizer/tests/expectations/vm/execute_and_finalize/mint_and_split.out +++ b/synthesizer/tests/expectations/vm/execute_and_finalize/mint_and_split.out @@ -13,6 +13,6 @@ additional: - child_outputs: credits.aleo/fee_public: outputs: - - '{"type":"future","id":"2224596965693604846363254284152512550549945382876106932610187515185636813504field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo19e6k5ferx3k8a9k79xtj4uuaztt2jl4eza7k43pygsu977yazypqqwdmw6,\n 1414u64\n ]\n}"}' + - '{"type":"future","id":"8121404646185643523817169669755623614020572191631587303252879200167824265866field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo19e6k5ferx3k8a9k79xtj4uuaztt2jl4eza7k43pygsu977yazypqqwdmw6,\n 1414u64\n ]\n}"}' - {} - {} diff --git a/synthesizer/tests/expectations/vm/execute_and_finalize/program_callable.out b/synthesizer/tests/expectations/vm/execute_and_finalize/program_callable.out index 35b4c94e05..284a02cf4c 100644 --- a/synthesizer/tests/expectations/vm/execute_and_finalize/program_callable.out +++ b/synthesizer/tests/expectations/vm/execute_and_finalize/program_callable.out @@ -5,10 +5,10 @@ outputs: execute: parent.aleo/foo: outputs: - - '{"type":"public","id":"2113639263284598783237184890483589485263377586770518008730201564727239039871field","value":"aleo16w8t56s7v6ud7vu33fr388ph0dq0c7yhp597cyjt88rr3nultcyqcyk9yy"}' - - '{"type":"public","id":"7678040084911633492076681690048450077835769459926508481383981892807233674714field","value":"aleo1qr2ha4pfs5l28aze88yn6fhleeythklkczrule2v838uwj65n5gqxt9djx"}' - - '{"type":"public","id":"4672581957597248464578193953626136889647685708065995338030805320939951875503field","value":"aleo1qr2ha4pfs5l28aze88yn6fhleeythklkczrule2v838uwj65n5gqxt9djx"}' - - '{"type":"public","id":"5713124416526318631344949557472532527559170952243278345561593407764623253620field","value":"aleo1qr2ha4pfs5l28aze88yn6fhleeythklkczrule2v838uwj65n5gqxt9djx"}' + - '{"type":"public","id":"6049712460155995828523152500393536918871074022306329456906710276304587970379field","value":"aleo16w8t56s7v6ud7vu33fr388ph0dq0c7yhp597cyjt88rr3nultcyqcyk9yy"}' + - '{"type":"public","id":"2740706569542577003808436999130973392534330809561977171541677539931212249672field","value":"aleo1qr2ha4pfs5l28aze88yn6fhleeythklkczrule2v838uwj65n5gqxt9djx"}' + - '{"type":"public","id":"5997746732150998134520308152454644187306942813043732622886516248552296057793field","value":"aleo1qr2ha4pfs5l28aze88yn6fhleeythklkczrule2v838uwj65n5gqxt9djx"}' + - '{"type":"public","id":"4348572907158660174432251268689708036520910856015863771761601734457842939077field","value":"aleo1qr2ha4pfs5l28aze88yn6fhleeythklkczrule2v838uwj65n5gqxt9djx"}' speculate: the execution was accepted add_next_block: succeeded. additional: @@ -16,8 +16,8 @@ additional: - child_outputs: child.aleo/foo: outputs: - - '{"type":"public","id":"8256096006685601051730823022659471790701845130080598423319521977566444421040field","value":"aleo16w8t56s7v6ud7vu33fr388ph0dq0c7yhp597cyjt88rr3nultcyqcyk9yy"}' - - '{"type":"public","id":"5221989025862141472722693152948767316757289409356062808145501796303456062879field","value":"aleo1qr2ha4pfs5l28aze88yn6fhleeythklkczrule2v838uwj65n5gqxt9djx"}' + - '{"type":"public","id":"1097693885727802075210095734699286799830893447062213874449124538610566843509field","value":"aleo16w8t56s7v6ud7vu33fr388ph0dq0c7yhp597cyjt88rr3nultcyqcyk9yy"}' + - '{"type":"public","id":"1361684151990533064498798090536285369593274539262537088973935658855702638606field","value":"aleo1qr2ha4pfs5l28aze88yn6fhleeythklkczrule2v838uwj65n5gqxt9djx"}' credits.aleo/fee_public: outputs: - - '{"type":"future","id":"2015747658045377273535220569098051012671760616560705166778921345457847058512field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1qr2ha4pfs5l28aze88yn6fhleeythklkczrule2v838uwj65n5gqxt9djx,\n 2123u64\n ]\n}"}' + - '{"type":"future","id":"1654089975904775845803610306576708885251110717047795439165401945844221766915field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1qr2ha4pfs5l28aze88yn6fhleeythklkczrule2v838uwj65n5gqxt9djx,\n 2123u64\n ]\n}"}' diff --git a/synthesizer/tests/expectations/vm/execute_and_finalize/public_wallet.out b/synthesizer/tests/expectations/vm/execute_and_finalize/public_wallet.out index 96fdcea20c..1f679a7d99 100644 --- a/synthesizer/tests/expectations/vm/execute_and_finalize/public_wallet.out +++ b/synthesizer/tests/expectations/vm/execute_and_finalize/public_wallet.out @@ -4,14 +4,14 @@ outputs: execute: public_wallet.aleo/init: outputs: - - '{"type":"future","id":"2740109864087873652477151933781698204925175410187376817867987810696050546048field","value":"{\n program_id: public_wallet.aleo,\n function_name: init,\n arguments: [\n {\n program_id: token.aleo,\n function_name: mint_public,\n arguments: [\n aleo1sry3pke49ykrf0aeshf889tr98r4c86p5f4ms766795ssdwfdyqq9jdg0j,\n 10u64\n ]\n }\n \n ]\n}"}' + - '{"type":"future","id":"4464942226841699051231230836770437274733784749720398875079497729457972358531field","value":"{\n program_id: public_wallet.aleo,\n function_name: init,\n arguments: [\n {\n program_id: token.aleo,\n function_name: mint_public,\n arguments: [\n aleo1sry3pke49ykrf0aeshf889tr98r4c86p5f4ms766795ssdwfdyqq9jdg0j,\n 10u64\n ]\n }\n \n ]\n}"}' speculate: the execution was accepted add_next_block: succeeded. additional: - child_outputs: token.aleo/mint_public: outputs: - - '{"type":"future","id":"3040250960739602137216192760697867018750676343790464348994684811613512872895field","value":"{\n program_id: token.aleo,\n function_name: mint_public,\n arguments: [\n aleo1sry3pke49ykrf0aeshf889tr98r4c86p5f4ms766795ssdwfdyqq9jdg0j,\n 10u64\n ]\n}"}' + - '{"type":"future","id":"6098437191130915695667989920256721987374768522520468547273384697927217987040field","value":"{\n program_id: token.aleo,\n function_name: mint_public,\n arguments: [\n aleo1sry3pke49ykrf0aeshf889tr98r4c86p5f4ms766795ssdwfdyqq9jdg0j,\n 10u64\n ]\n}"}' credits.aleo/fee_public: outputs: - - '{"type":"future","id":"4373249435479943424484888940718424132561120812144078253060284512525421799293field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1d3e2je2m2hsxwdsvntvf4jnnlj459ywfry6ch2qwrpy6l6r6yvpq8e88h5,\n 131201u64\n ]\n}"}' + - '{"type":"future","id":"546462310004815308785340027890541933050085460472488305954420334597248699563field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1d3e2je2m2hsxwdsvntvf4jnnlj459ywfry6ch2qwrpy6l6r6yvpq8e88h5,\n 131201u64\n ]\n}"}' diff --git a/synthesizer/tests/expectations/vm/execute_and_finalize/read_external_mapping.out b/synthesizer/tests/expectations/vm/execute_and_finalize/read_external_mapping.out index a729b3163e..1fdcaac0db 100644 --- a/synthesizer/tests/expectations/vm/execute_and_finalize/read_external_mapping.out +++ b/synthesizer/tests/expectations/vm/execute_and_finalize/read_external_mapping.out @@ -5,7 +5,7 @@ outputs: relay.aleo/send: outputs: - '{"type":"record","id":"5505341694097720023583674648027312667621444458172921945164834002648638744768field","checksum":"4170712463954366904268628656227022271867279479485549214633981747772705648157field","value":"record1qyqsp358e054av498aavwel28wr36tg0ay27k4fc539ffmwz2nddl8gqqyzxgct5vy3sqqspqpfgwnp3rnwprhd2q3h8gmxcnldlczrvszade4vzxlu7dmfeg6j3rd8mwuzysqtgl6603ey2zzry8hjwmn3pt3twclpkkvssc4l4jzsvd6lxar"}' - - '{"type":"future","id":"5336913895922947334887041593466841136470735988519588898509306662059714980450field","value":"{\n program_id: relay.aleo,\n function_name: send,\n arguments: [\n aleo1f6eg623knp66cwx0926w3plgdgzcmfpgyrzgnjz90mucgs3z7s9qls4upm\n ]\n}"}' + - '{"type":"future","id":"5442196731199501033516997315536802286771381654648404072656864347298151743003field","value":"{\n program_id: relay.aleo,\n function_name: send,\n arguments: [\n aleo1f6eg623knp66cwx0926w3plgdgzcmfpgyrzgnjz90mucgs3z7s9qls4upm\n ]\n}"}' speculate: the execution was rejected add_next_block: succeeded. - verified: true @@ -13,14 +13,14 @@ outputs: relay.aleo/send_without_check: outputs: - '{"type":"record","id":"4755207731349921544198839760105069860415948248486655350742993041864954064196field","checksum":"7848435433502532569425287419063381736913355859517668180377091558079541996646field","value":"record1qyqsp83ncqrtrev57v03h3j8qcysfgef256zh7pmh7zgj83h6g7tfkq0qyzxgct5vy3sqqspqzx4ww05zz3grf6hxgr46csu2vmzr2lgq0f48kxp4j383l68ufqsq45f8wqk6jxfnkm6v92cq48xea0tfrg0fwwr249m95t4eka6jkgv0c5y7k"}' - - '{"type":"future","id":"1027044606530325120447980237911983680107621060206232306337126914234987187002field","value":"{\n program_id: relay.aleo,\n function_name: send_without_check,\n arguments: [\n aleo1f6eg623knp66cwx0926w3plgdgzcmfpgyrzgnjz90mucgs3z7s9qls4upm\n ]\n}"}' + - '{"type":"future","id":"7096105927658574358527187665040993539615241837502198163087038919436093048144field","value":"{\n program_id: relay.aleo,\n function_name: send_without_check,\n arguments: [\n aleo1f6eg623knp66cwx0926w3plgdgzcmfpgyrzgnjz90mucgs3z7s9qls4upm\n ]\n}"}' speculate: the execution was accepted add_next_block: succeeded. - verified: true execute: registry.aleo/register: outputs: - - '{"type":"future","id":"4059159583881077685368973757192878822018897618745592372395499886263264340961field","value":"{\n program_id: registry.aleo,\n function_name: register,\n arguments: [\n aleo1f6eg623knp66cwx0926w3plgdgzcmfpgyrzgnjz90mucgs3z7s9qls4upm\n ]\n}"}' + - '{"type":"future","id":"5446972737672342654865490167952496634158426704624044659644067337703357547983field","value":"{\n program_id: registry.aleo,\n function_name: register,\n arguments: [\n aleo1f6eg623knp66cwx0926w3plgdgzcmfpgyrzgnjz90mucgs3z7s9qls4upm\n ]\n}"}' speculate: the execution was accepted add_next_block: succeeded. - verified: true @@ -28,14 +28,14 @@ outputs: relay.aleo/send: outputs: - '{"type":"record","id":"2277384653342632398532359071690090462344215994043547853708800775056671259572field","checksum":"3071210942562837171924171313096615835242397071199450951002063969440885822680field","value":"record1qyqspfwaru0f2lj0s2k6p9jfmmkzyvkzl5qpagt00edyuf9qn3gnu5g9qyzxgct5vy3sqqspqrncgctd3wfmz2ggx0v7l5cggxxad49wcmtlyrjnk8fqulmkg3h3rleuqh8nmwn5d9z8cpf6z75sy880xenua6hu9wk6ptzwh9vnzps3l7743a"}' - - '{"type":"future","id":"6015012441862221318333000102440691156905727650418067306609473392233853855381field","value":"{\n program_id: relay.aleo,\n function_name: send,\n arguments: [\n aleo1f6eg623knp66cwx0926w3plgdgzcmfpgyrzgnjz90mucgs3z7s9qls4upm\n ]\n}"}' + - '{"type":"future","id":"4556110991549826207824540984103632227024449543743135915491677376919472371272field","value":"{\n program_id: relay.aleo,\n function_name: send,\n arguments: [\n aleo1f6eg623knp66cwx0926w3plgdgzcmfpgyrzgnjz90mucgs3z7s9qls4upm\n ]\n}"}' speculate: the execution was accepted add_next_block: succeeded. - verified: true execute: registry.aleo/unregister: outputs: - - '{"type":"future","id":"621057053984946494815874859056940220465065220086041076777338967969133345871field","value":"{\n program_id: registry.aleo,\n function_name: unregister,\n arguments: [\n aleo1f6eg623knp66cwx0926w3plgdgzcmfpgyrzgnjz90mucgs3z7s9qls4upm\n ]\n}"}' + - '{"type":"future","id":"3937468794217695767514352020825733704009053357618910412289449201022528183129field","value":"{\n program_id: registry.aleo,\n function_name: unregister,\n arguments: [\n aleo1f6eg623knp66cwx0926w3plgdgzcmfpgyrzgnjz90mucgs3z7s9qls4upm\n ]\n}"}' speculate: the execution was accepted add_next_block: succeeded. - verified: true @@ -43,31 +43,31 @@ outputs: relay.aleo/send: outputs: - '{"type":"record","id":"6497977440830787207175874226764101265608813002804421333613230199582364410758field","checksum":"319323911748946858530605909565888788506340329996151513367076865761846915611field","value":"record1qyqsqnajqear5neee3l8fykp4vcq35sgwreyz7hz3png3cn2yyljdscfqyzxgct5vy3sqqspqzu6lezptk9xjpx35xdrv5tztz0v9qs9xx803pyqury2j47x2d5seymhf3xa2wefz7mkas7r7m3uf4kte7fdwm00ral53q2mhclx95qte8mpvc"}' - - '{"type":"future","id":"2216932771373637316148105432054544027092193801977530259105019952220093166242field","value":"{\n program_id: relay.aleo,\n function_name: send,\n arguments: [\n aleo1f6eg623knp66cwx0926w3plgdgzcmfpgyrzgnjz90mucgs3z7s9qls4upm\n ]\n}"}' + - '{"type":"future","id":"3229366919318219679638161067381792227991045093986357075456487847991962063680field","value":"{\n program_id: relay.aleo,\n function_name: send,\n arguments: [\n aleo1f6eg623knp66cwx0926w3plgdgzcmfpgyrzgnjz90mucgs3z7s9qls4upm\n ]\n}"}' speculate: the execution was rejected add_next_block: succeeded. additional: - child_outputs: credits.aleo/fee_public: outputs: - - '{"type":"future","id":"2373837014611692049497129045871775574464197133932453792739782919776486496194field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1xe2fps8f9xpdas2q0fqy22uraenk84tvvzetrsyxgnwy6445h59s6wv78x,\n 28479u64\n ]\n}"}' + - '{"type":"future","id":"287714326547065147632386041381462772277143739683750779413781861533324542908field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1xe2fps8f9xpdas2q0fqy22uraenk84tvvzetrsyxgnwy6445h59s6wv78x,\n 28479u64\n ]\n}"}' - child_outputs: credits.aleo/fee_public: outputs: - - '{"type":"future","id":"6963949699870804211203514659901328830518734684604845622658837353595728006898field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1xe2fps8f9xpdas2q0fqy22uraenk84tvvzetrsyxgnwy6445h59s6wv78x,\n 28507u64\n ]\n}"}' + - '{"type":"future","id":"6649629637207372964857345430403866145654153614971187041628192785611251123180field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1xe2fps8f9xpdas2q0fqy22uraenk84tvvzetrsyxgnwy6445h59s6wv78x,\n 28507u64\n ]\n}"}' - child_outputs: credits.aleo/fee_public: outputs: - - '{"type":"future","id":"786151097471386478439918490898626420968604200995134718973623517242949574field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1f6eg623knp66cwx0926w3plgdgzcmfpgyrzgnjz90mucgs3z7s9qls4upm,\n 101210u64\n ]\n}"}' + - '{"type":"future","id":"6313149385997960507862814561552986754297687946640717773734483139258266930884field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1f6eg623knp66cwx0926w3plgdgzcmfpgyrzgnjz90mucgs3z7s9qls4upm,\n 101210u64\n ]\n}"}' - child_outputs: credits.aleo/fee_public: outputs: - - '{"type":"future","id":"7962216909726487379370954492051267200961073450060603523391007597642835489177field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1xe2fps8f9xpdas2q0fqy22uraenk84tvvzetrsyxgnwy6445h59s6wv78x,\n 28479u64\n ]\n}"}' + - '{"type":"future","id":"4275231109424124634535800322540895777297870484284382855497078926857012238518field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1xe2fps8f9xpdas2q0fqy22uraenk84tvvzetrsyxgnwy6445h59s6wv78x,\n 28479u64\n ]\n}"}' - child_outputs: credits.aleo/fee_public: outputs: - - '{"type":"future","id":"5340444358291789813118792762028331134214990505407681376089964565359528622453field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1f6eg623knp66cwx0926w3plgdgzcmfpgyrzgnjz90mucgs3z7s9qls4upm,\n 101214u64\n ]\n}"}' + - '{"type":"future","id":"4672593758915782759444776821290902637872156268641425969525459952369605821638field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1f6eg623knp66cwx0926w3plgdgzcmfpgyrzgnjz90mucgs3z7s9qls4upm,\n 101214u64\n ]\n}"}' - child_outputs: credits.aleo/fee_public: outputs: - - '{"type":"future","id":"7708776674386621879381619680665250794376507748822342974632850445134733330595field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1xe2fps8f9xpdas2q0fqy22uraenk84tvvzetrsyxgnwy6445h59s6wv78x,\n 28479u64\n ]\n}"}' + - '{"type":"future","id":"4563984273654878917898732677226757277037946841102836189913527591453113921149field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1xe2fps8f9xpdas2q0fqy22uraenk84tvvzetrsyxgnwy6445h59s6wv78x,\n 28479u64\n ]\n}"}' diff --git a/synthesizer/tests/expectations/vm/execute_and_finalize/test_branch.out b/synthesizer/tests/expectations/vm/execute_and_finalize/test_branch.out index 7c414c0ce3..7c49e67449 100644 --- a/synthesizer/tests/expectations/vm/execute_and_finalize/test_branch.out +++ b/synthesizer/tests/expectations/vm/execute_and_finalize/test_branch.out @@ -4,33 +4,33 @@ outputs: execute: test_branch.aleo/run_test: outputs: - - '{"type":"future","id":"6853588955800014673009987953241306389090845327747907984198222141108269232573field","value":"{\n program_id: test_branch.aleo,\n function_name: run_test,\n arguments: [\n 1u8,\n 1u8\n ]\n}"}' + - '{"type":"future","id":"3591346548818546005072841126926165574136175856345199266519780799284817280600field","value":"{\n program_id: test_branch.aleo,\n function_name: run_test,\n arguments: [\n 1u8,\n 1u8\n ]\n}"}' speculate: the execution was rejected add_next_block: succeeded. - verified: true execute: test_branch.aleo/run_test: outputs: - - '{"type":"future","id":"7316910653703512796159979382480893246542312648132879967453276886284034879075field","value":"{\n program_id: test_branch.aleo,\n function_name: run_test,\n arguments: [\n 0u8,\n 1u8\n ]\n}"}' + - '{"type":"future","id":"7814101611196855827915898756837844994575969450427591648084996663195531996561field","value":"{\n program_id: test_branch.aleo,\n function_name: run_test,\n arguments: [\n 0u8,\n 1u8\n ]\n}"}' speculate: the execution was rejected add_next_block: succeeded. - verified: true execute: test_branch.aleo/run_test: outputs: - - '{"type":"future","id":"6402417637041760480107523094357167265585878714433227566435547816691472198663field","value":"{\n program_id: test_branch.aleo,\n function_name: run_test,\n arguments: [\n 0u8,\n 0u8\n ]\n}"}' + - '{"type":"future","id":"2097297249273458526117790667287124784692256429234303674845630058419196175092field","value":"{\n program_id: test_branch.aleo,\n function_name: run_test,\n arguments: [\n 0u8,\n 0u8\n ]\n}"}' speculate: the execution was accepted add_next_block: succeeded. additional: - child_outputs: credits.aleo/fee_public: outputs: - - '{"type":"future","id":"8176559465483810586872674176090912007328770812617215482809916166686904238834field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1x3r205zqql5ywy0cqqt74k0r0htuusn0d037ycxe8ftt9ep8hyzsmqz4dh,\n 17268u64\n ]\n}"}' + - '{"type":"future","id":"6940404295839257166773786677864202896936117578403567412842677588206657634231field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1x3r205zqql5ywy0cqqt74k0r0htuusn0d037ycxe8ftt9ep8hyzsmqz4dh,\n 17268u64\n ]\n}"}' - child_outputs: credits.aleo/fee_public: outputs: - - '{"type":"future","id":"885516194992930770292437059317184478627651975125735363573325083543887608918field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1x3r205zqql5ywy0cqqt74k0r0htuusn0d037ycxe8ftt9ep8hyzsmqz4dh,\n 17268u64\n ]\n}"}' + - '{"type":"future","id":"7204592238320861038815794761930169044297399772374442647756219229048743123164field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1x3r205zqql5ywy0cqqt74k0r0htuusn0d037ycxe8ftt9ep8hyzsmqz4dh,\n 17268u64\n ]\n}"}' - child_outputs: credits.aleo/fee_public: outputs: - - '{"type":"future","id":"6884773732489674095657820682011451719106395760464004244662697484163781295818field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1x3r205zqql5ywy0cqqt74k0r0htuusn0d037ycxe8ftt9ep8hyzsmqz4dh,\n 17268u64\n ]\n}"}' + - '{"type":"future","id":"6592199022535314305941469788916413763767223102452838589981136115277934350646field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1x3r205zqql5ywy0cqqt74k0r0htuusn0d037ycxe8ftt9ep8hyzsmqz4dh,\n 17268u64\n ]\n}"}' diff --git a/synthesizer/tests/expectations/vm/execute_and_finalize/test_rand.out b/synthesizer/tests/expectations/vm/execute_and_finalize/test_rand.out index 4fefc62cfd..01142551fb 100644 --- a/synthesizer/tests/expectations/vm/execute_and_finalize/test_rand.out +++ b/synthesizer/tests/expectations/vm/execute_and_finalize/test_rand.out @@ -4,44 +4,44 @@ outputs: execute: test_rand.aleo/rand_chacha_with_literals: outputs: - - '{"type":"future","id":"859791478012828215720348494076914719205244104520150752280307504054509554398field","value":"{\n program_id: test_rand.aleo,\n function_name: rand_chacha_with_literals,\n arguments: [\n 0scalar,\n 0group,\n 0u8,\n 2i16,\n 4u32,\n 7i64,\n 8u128,\n 10field\n ]\n}"}' + - '{"type":"future","id":"1765454680055977470133663998792825807893959339496402455206491781821113014267field","value":"{\n program_id: test_rand.aleo,\n function_name: rand_chacha_with_literals,\n arguments: [\n 0scalar,\n 0group,\n 0u8,\n 2i16,\n 4u32,\n 7i64,\n 8u128,\n 10field\n ]\n}"}' speculate: the execution was accepted add_next_block: succeeded. - verified: true execute: test_rand.aleo/rand_chacha_with_struct: outputs: - - '{"type":"future","id":"1067916594854496467910772380664552622025523070198727493475463622599909707249field","value":"{\n program_id: test_rand.aleo,\n function_name: rand_chacha_with_struct,\n arguments: [\n {\n first: 0field,\n second: 0field,\n third: 0field,\n fourth: 0field,\n fifth: 0field\n}\n ]\n}"}' + - '{"type":"future","id":"1342337531921565545247998733341343470047235865406486394533997372459329935477field","value":"{\n program_id: test_rand.aleo,\n function_name: rand_chacha_with_struct,\n arguments: [\n {\n first: 0field,\n second: 0field,\n third: 0field,\n fourth: 0field,\n fifth: 0field\n}\n ]\n}"}' speculate: the execution was accepted add_next_block: succeeded. - verified: true execute: test_rand.aleo/rand_chacha_check: outputs: - - '{"type":"future","id":"3721325135151760660773959530505944451747681933722462808964783147996869797702field","value":"{\n program_id: test_rand.aleo,\n function_name: rand_chacha_check,\n arguments: [\n 0field,\n false\n ]\n}"}' + - '{"type":"future","id":"488590592441422127997725386233571306457829570948543232762424611162021835080field","value":"{\n program_id: test_rand.aleo,\n function_name: rand_chacha_check,\n arguments: [\n 0field,\n false\n ]\n}"}' speculate: the execution was accepted add_next_block: succeeded. - verified: true execute: test_rand.aleo/rand_chacha_check: outputs: - - '{"type":"future","id":"887371549615679800380522845098080464570119184210350810479392117984911457950field","value":"{\n program_id: test_rand.aleo,\n function_name: rand_chacha_check,\n arguments: [\n 1field,\n true\n ]\n}"}' + - '{"type":"future","id":"884323248557348741020456011434839803868309861690594536593949575748229817915field","value":"{\n program_id: test_rand.aleo,\n function_name: rand_chacha_check,\n arguments: [\n 1field,\n true\n ]\n}"}' speculate: the execution was accepted add_next_block: succeeded. additional: - child_outputs: credits.aleo/fee_public: outputs: - - '{"type":"future","id":"6314628133780265670801554258125814886017405269745792760682853845340140460175field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1uchf7kruskpp8thlnfeya9qeklcjss27j6rtu74zz7ch559neqystgslsp,\n 601806u64\n ]\n}"}' + - '{"type":"future","id":"5434435027697006436788114543338997352452472129161114538117990254445136075185field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1uchf7kruskpp8thlnfeya9qeklcjss27j6rtu74zz7ch559neqystgslsp,\n 601806u64\n ]\n}"}' - child_outputs: credits.aleo/fee_public: outputs: - - '{"type":"future","id":"3725939744341267737290273038160661629630343114766507174134842826652488781816field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1uchf7kruskpp8thlnfeya9qeklcjss27j6rtu74zz7ch559neqystgslsp,\n 26679u64\n ]\n}"}' + - '{"type":"future","id":"1455465546409944304007956260384028107498636362872802223193183597053222860412field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1uchf7kruskpp8thlnfeya9qeklcjss27j6rtu74zz7ch559neqystgslsp,\n 26679u64\n ]\n}"}' - child_outputs: credits.aleo/fee_public: outputs: - - '{"type":"future","id":"5227003534986816857285932061757797688706802206018964764622184983760566708322field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1uchf7kruskpp8thlnfeya9qeklcjss27j6rtu74zz7ch559neqystgslsp,\n 28344u64\n ]\n}"}' + - '{"type":"future","id":"3897237322641678007226763707031207042005562444025847421658930358169707454055field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1uchf7kruskpp8thlnfeya9qeklcjss27j6rtu74zz7ch559neqystgslsp,\n 28344u64\n ]\n}"}' - child_outputs: credits.aleo/fee_public: outputs: - - '{"type":"future","id":"5806769723479332130567002952494928256138310337461654699762319212831997850826field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1uchf7kruskpp8thlnfeya9qeklcjss27j6rtu74zz7ch559neqystgslsp,\n 28344u64\n ]\n}"}' + - '{"type":"future","id":"3612589588414986325528303980793223423887868113647957048451367367231068740385field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1uchf7kruskpp8thlnfeya9qeklcjss27j6rtu74zz7ch559neqystgslsp,\n 28344u64\n ]\n}"}' diff --git a/synthesizer/tests/expectations/vm/execute_and_finalize/timelock.out b/synthesizer/tests/expectations/vm/execute_and_finalize/timelock.out index 425f80af2e..e2f399d0c9 100644 --- a/synthesizer/tests/expectations/vm/execute_and_finalize/timelock.out +++ b/synthesizer/tests/expectations/vm/execute_and_finalize/timelock.out @@ -4,22 +4,22 @@ outputs: execute: timelock.aleo/lock: outputs: - - '{"type":"future","id":"5726101227699718662507291026879175619949633046158707589853378418659241463316field","value":"{\n program_id: timelock.aleo,\n function_name: lock,\n arguments: []\n}"}' + - '{"type":"future","id":"7519916640716130495448528557347618353867911739810990318131281151848970103498field","value":"{\n program_id: timelock.aleo,\n function_name: lock,\n arguments: []\n}"}' speculate: the execution was rejected add_next_block: succeeded. - verified: true execute: timelock.aleo/lock: outputs: - - '{"type":"future","id":"5825781590715337627504208073275179158827587281138872289977731167576414664969field","value":"{\n program_id: timelock.aleo,\n function_name: lock,\n arguments: []\n}"}' + - '{"type":"future","id":"1692329568288717165704659211644970574488153730247332824408199047029733666363field","value":"{\n program_id: timelock.aleo,\n function_name: lock,\n arguments: []\n}"}' speculate: the execution was rejected add_next_block: succeeded. additional: - child_outputs: credits.aleo/fee_public: outputs: - - '{"type":"future","id":"2868527388214006275127069563021857572887489216649877337285946162120321568912field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo12tksdptp7hvxly8tkm3um08fvf53qpehsgdgqfvy9pe3sewcq5ysjg5myy,\n 5164u64\n ]\n}"}' + - '{"type":"future","id":"1981714784621045992744318877440212508684512329787653326579443667006655157948field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo12tksdptp7hvxly8tkm3um08fvf53qpehsgdgqfvy9pe3sewcq5ysjg5myy,\n 5164u64\n ]\n}"}' - child_outputs: credits.aleo/fee_public: outputs: - - '{"type":"future","id":"3666380379303443004933801395245329857516145915761366182794264005536589963556field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo12tksdptp7hvxly8tkm3um08fvf53qpehsgdgqfvy9pe3sewcq5ysjg5myy,\n 5164u64\n ]\n}"}' + - '{"type":"future","id":"4220420961055570727047249271117595746967454704804978518496773456626487015950field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo12tksdptp7hvxly8tkm3um08fvf53qpehsgdgqfvy9pe3sewcq5ysjg5myy,\n 5164u64\n ]\n}"}' diff --git a/synthesizer/tests/expectations/vm/execute_and_finalize/unused_position.out b/synthesizer/tests/expectations/vm/execute_and_finalize/unused_position.out index c5e300b026..f975c5d742 100644 --- a/synthesizer/tests/expectations/vm/execute_and_finalize/unused_position.out +++ b/synthesizer/tests/expectations/vm/execute_and_finalize/unused_position.out @@ -4,11 +4,11 @@ outputs: execute: unused_position.aleo/foo: outputs: - - '{"type":"future","id":"4435915382452600913825742955271157728527943603774006701552876898718102875463field","value":"{\n program_id: unused_position.aleo,\n function_name: foo,\n arguments: []\n}"}' + - '{"type":"future","id":"5049235690692170805152663732952500738215296477247651613244805919801146018013field","value":"{\n program_id: unused_position.aleo,\n function_name: foo,\n arguments: []\n}"}' speculate: the execution was accepted add_next_block: succeeded. additional: - child_outputs: credits.aleo/fee_public: outputs: - - '{"type":"future","id":"5889749875317192883762347751185109427367185401929794748301981981444845203330field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo12tksdptp7hvxly8tkm3um08fvf53qpehsgdgqfvy9pe3sewcq5ysjg5myy,\n 2176u64\n ]\n}"}' + - '{"type":"future","id":"845968501377643125837736950607122134527128597439414117623743716037006712304field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo12tksdptp7hvxly8tkm3um08fvf53qpehsgdgqfvy9pe3sewcq5ysjg5myy,\n 2176u64\n ]\n}"}' diff --git a/synthesizer/tests/expectations/vm/execute_and_finalize/user_callable.out b/synthesizer/tests/expectations/vm/execute_and_finalize/user_callable.out index 77e6a29dd6..6b54043a85 100644 --- a/synthesizer/tests/expectations/vm/execute_and_finalize/user_callable.out +++ b/synthesizer/tests/expectations/vm/execute_and_finalize/user_callable.out @@ -4,8 +4,8 @@ outputs: execute: child.aleo/foo: outputs: - - '{"type":"public","id":"389051587023874025297792889573178986947322645231926608183742711950919559411field","value":"aleo1qr2ha4pfs5l28aze88yn6fhleeythklkczrule2v838uwj65n5gqxt9djx"}' - - '{"type":"public","id":"764027935495423951991221261588244508770271800988614802602832277026356994499field","value":"aleo1qr2ha4pfs5l28aze88yn6fhleeythklkczrule2v838uwj65n5gqxt9djx"}' + - '{"type":"public","id":"4404941057821897234460846736708985506912590484378613605920261232780052938368field","value":"aleo1qr2ha4pfs5l28aze88yn6fhleeythklkczrule2v838uwj65n5gqxt9djx"}' + - '{"type":"public","id":"6863425187346818199213777711361503911686928486889277167846555491973904299237field","value":"aleo1qr2ha4pfs5l28aze88yn6fhleeythklkczrule2v838uwj65n5gqxt9djx"}' speculate: the execution was accepted add_next_block: succeeded. - execute: 'Failed to evaluate instruction (call child.aleo/foo into r0 r1;): Failed to evaluate instruction (assert.eq self.caller self.signer ;): ''assert.eq'' failed: ''aleo16w8t56s7v6ud7vu33fr388ph0dq0c7yhp597cyjt88rr3nultcyqcyk9yy'' is not equal to ''aleo1qr2ha4pfs5l28aze88yn6fhleeythklkczrule2v838uwj65n5gqxt9djx'' (should be equal)' @@ -13,5 +13,5 @@ additional: - child_outputs: credits.aleo/fee_public: outputs: - - '{"type":"future","id":"6557860754730668406004469054379794576334242764827542178306889009454484547032field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1qr2ha4pfs5l28aze88yn6fhleeythklkczrule2v838uwj65n5gqxt9djx,\n 1244u64\n ]\n}"}' + - '{"type":"future","id":"2483571147486478105991602705188841356032984629663296862118724692881212920175field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1qr2ha4pfs5l28aze88yn6fhleeythklkczrule2v838uwj65n5gqxt9djx,\n 1244u64\n ]\n}"}' - {} From b6177fcaa19073b9d227fdcb3f595124b86301e1 Mon Sep 17 00:00:00 2001 From: raychu86 <14917648+raychu86@users.noreply.github.com> Date: Mon, 6 Nov 2023 18:28:02 -0800 Subject: [PATCH 014/298] Update committee member sorting --- ledger/committee/src/lib.rs | 41 ++++++++++++++++++++++++++++++++++++- 1 file changed, 40 insertions(+), 1 deletion(-) diff --git a/ledger/committee/src/lib.rs b/ledger/committee/src/lib.rs index 6a08e72b51..4335673668 100644 --- a/ledger/committee/src/lib.rs +++ b/ledger/committee/src/lib.rs @@ -198,7 +198,8 @@ impl Committee { /// Note: This ensures the method returns a deterministic result that is SNARK-friendly. fn sorted_members(&self) -> indexmap::map::IntoIter, (u64, bool)> { let members = self.members.clone(); - members.sorted_unstable_by(|address1, stake1, address2, stake2| { + // Note: The use of 'sorted_unstable_by' is safe here because the addresses are guaranteed to be unique. + members.sorted_unstable_by(|address1, (stake1, _), address2, (stake2, _)| { // Sort by stake in decreasing order. let cmp = stake2.cmp(stake1); // If the stakes are equal, sort by x-coordinate in decreasing order. @@ -282,6 +283,22 @@ pub mod test_helpers { Committee::::new(round, committee_members).unwrap() } + /// Samples a committee where all validators have the same stake. + pub fn sample_committee_equal_stake_committee(num_members: u16, rng: &mut TestRng) -> Committee { + assert!(num_members >= 4); + // Sample the members. + let mut members = IndexMap::new(); + // Add in the minimum and maximum staked nodes. + members.insert(Address::::new(rng.gen()), (MIN_VALIDATOR_STAKE, false)); + while members.len() < num_members as usize - 1 { + let stake = MIN_VALIDATOR_STAKE as f64; + let is_open = rng.gen(); + members.insert(Address::::new(rng.gen()), (stake as u64, is_open)); + } + // Return the committee. + Committee::::new(1, members).unwrap() + } + /// Samples a random committee. pub fn sample_committee_custom(num_members: u16, rng: &mut TestRng) -> Committee { assert!(num_members >= 4); @@ -405,4 +422,26 @@ mod tests { } } } + + #[test] + fn test_sorted_members_with_equal_stake() { + // Initialize the RNG. + let rng = &mut TestRng::default(); + // Sample a committee. + let committee = crate::test_helpers::sample_committee_equal_stake_committee(200, rng); + // Start a timer. + let timer = std::time::Instant::now(); + // Sort the members. + let sorted_members = committee.sorted_members().collect::>(); + println!("sorted_members: {}ms", timer.elapsed().as_millis()); + // Check that the members are sorted based on our sorting criteria. + for i in 0..sorted_members.len() - 1 { + let (address1, (stake1, _)) = sorted_members[i]; + let (address2, (stake2, _)) = sorted_members[i + 1]; + assert!(stake1 >= stake2); + if stake1 == stake2 { + assert!(address1.to_x_coordinate() > address2.to_x_coordinate()); + } + } + } } From 10042a85fb7a68858c8c5be7c603071511440199 Mon Sep 17 00:00:00 2001 From: Howard Wu <9260812+howardwu@users.noreply.github.com> Date: Thu, 9 Nov 2023 18:41:32 -0800 Subject: [PATCH 015/298] Update the doc message in test --- synthesizer/src/vm/mod.rs | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/synthesizer/src/vm/mod.rs b/synthesizer/src/vm/mod.rs index 8e94608319..b92ece292d 100644 --- a/synthesizer/src/vm/mod.rs +++ b/synthesizer/src/vm/mod.rs @@ -893,17 +893,18 @@ function a: sample_next_block(&vm, &caller_private_key, &[deployment_3.clone(), deployment_4.clone()], rng).unwrap(); vm.add_next_block(&deployment_block).unwrap(); - // Check that the iterator ordering is the same as the deployment ordering. - let deployment_transaction_ids = - vm.transaction_store().deployment_transaction_ids().map(|id| *id).collect::>(); - // This assert check is here to ensure that we are properly loading imports even though any order will work for `VM::from`. - // Note: `deployment_transaction_ids` is sorted lexicographically by transaction id, so the order may change if we update internal methods. - assert_eq!(deployment_transaction_ids, vec![ - deployment_1.id(), - deployment_2.id(), - deployment_3.id(), - deployment_4.id() - ]); + // Sanity check the ordering of the deployment transaction IDs from storage. + { + let deployment_transaction_ids = + vm.transaction_store().deployment_transaction_ids().map(|id| *id).collect::>(); + // This assert check is here to ensure that we are properly loading imports even though any order will work for `VM::from`. + // Note: `deployment_transaction_ids` is sorted lexicographically by transaction id, so the order may change if we update internal methods. + assert_eq!( + deployment_transaction_ids, + vec![deployment_1.id(), deployment_2.id(), deployment_3.id(), deployment_4.id()], + "Update me if serialization has changed" + ); + } // Enforce that the VM can load properly with the imports. assert!(VM::from(vm.store.clone()).is_ok()); From b2c1be6fa3fcf7ad7eafb1236a113965ffd76560 Mon Sep 17 00:00:00 2001 From: raychu86 <14917648+raychu86@users.noreply.github.com> Date: Mon, 13 Nov 2023 13:26:38 -0800 Subject: [PATCH 016/298] Introduce FINALIZE_ID_DEPTH --- console/program/src/state_path/configuration/mod.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/console/program/src/state_path/configuration/mod.rs b/console/program/src/state_path/configuration/mod.rs index b8ddef30cf..ddfa6651f8 100644 --- a/console/program/src/state_path/configuration/mod.rs +++ b/console/program/src/state_path/configuration/mod.rs @@ -19,8 +19,10 @@ use snarkvm_console_network::BHPMerkleTree; pub const BLOCKS_DEPTH: u8 = 32; /// The depth of the Merkle tree for the block header. pub const HEADER_DEPTH: u8 = 3; +/// The depth of the Merkle tree for finalize operations in a transaction. +pub const FINALIZE_ID_DEPTH: u8 = TRANSACTION_DEPTH + 4; // 4 for 16 finalize operations per transition. /// The depth of the Merkle tree for finalize operations in a block. -pub const FINALIZE_OPERATIONS_DEPTH: u8 = 20; +pub const FINALIZE_OPERATIONS_DEPTH: u8 = TRANSACTIONS_DEPTH + 1; /// The depth of the Merkle tree for the ratifications in a block. pub const RATIFICATIONS_DEPTH: u8 = 16; /// The depth the Merkle tree for the subdag certificates in a block. From ba0c521936822d80bab58479e09cde7053e71c38 Mon Sep 17 00:00:00 2001 From: raychu86 <14917648+raychu86@users.noreply.github.com> Date: Mon, 13 Nov 2023 13:28:42 -0800 Subject: [PATCH 017/298] Implement to_finalize_id for confirmed transactions --- ledger/block/src/transactions/confirmed/mod.rs | 13 ++++++++++++- ledger/block/src/transactions/mod.rs | 1 + 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/ledger/block/src/transactions/confirmed/mod.rs b/ledger/block/src/transactions/confirmed/mod.rs index 9d16b7915d..d942c94d5e 100644 --- a/ledger/block/src/transactions/confirmed/mod.rs +++ b/ledger/block/src/transactions/confirmed/mod.rs @@ -17,7 +17,7 @@ mod serialize; mod string; use crate::{rejected::Rejected, Transaction}; -use console::{network::prelude::*, types::Field}; +use console::{network::prelude::*, program::FINALIZE_ID_DEPTH, types::Field}; use synthesizer_program::FinalizeOperation; pub type NumFinalizeSize = u16; @@ -314,6 +314,17 @@ impl ConfirmedTransaction { ), } } + + /// Returns the finalize id, by computing the root for a Merkle tree of the finalize operations. + pub fn to_finalize_id(&self) -> Result> { + // Prepare the leaves. + let leaves = self.finalize_operations().iter().map(ToBits::to_bits_le); + // Compute the finalize id tree. + // Note: This call will check the number of finalize operations is within the size of the Merkle tree. + let tree = N::merkle_tree_bhp::(&leaves.collect::>())?; + // Return the finalize id. + Ok(*tree.root()) + } } impl Deref for ConfirmedTransaction { diff --git a/ledger/block/src/transactions/mod.rs b/ledger/block/src/transactions/mod.rs index 2eb3a31372..6fe4cf695e 100644 --- a/ledger/block/src/transactions/mod.rs +++ b/ledger/block/src/transactions/mod.rs @@ -32,6 +32,7 @@ use console::{ Record, TransactionsPath, TransactionsTree, + FINALIZE_ID_DEPTH, FINALIZE_OPERATIONS_DEPTH, TRANSACTIONS_DEPTH, }, From 0c0a451f94bf18983298124cfdb526570a351ad8 Mon Sep 17 00:00:00 2001 From: raychu86 <14917648+raychu86@users.noreply.github.com> Date: Mon, 13 Nov 2023 13:37:04 -0800 Subject: [PATCH 018/298] Use finalize ids to construct finalize root --- ledger/block/src/transactions/merkle.rs | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/ledger/block/src/transactions/merkle.rs b/ledger/block/src/transactions/merkle.rs index 4efc914ba5..fa651d0f72 100644 --- a/ledger/block/src/transactions/merkle.rs +++ b/ledger/block/src/transactions/merkle.rs @@ -17,11 +17,24 @@ use super::*; impl Transactions { /// Returns the finalize root of the transactions. pub fn to_finalize_root(&self, ratified_finalize_operations: Vec>) -> Result> { + // Prepare the finalize ids for the ratify-finalize operations. + let ratified_finalize_id = *N::merkle_tree_bhp::( + &ratified_finalize_operations.iter().map(ToBits::to_bits_le).collect::>(), + )? + .root(); + // Prepare the leaves. - let leaves = self.finalize_operations().chain(&ratified_finalize_operations).map(ToBits::to_bits_le); + let mut leaves = self + .iter() + .map(ConfirmedTransaction::to_finalize_id) + .map(|res| res.map(|id| id.to_bits_le())) + .collect::>>()?; + // Append the finalize id for the ratifications. + leaves.push(ratified_finalize_id.to_bits_le()); + // Compute the finalize tree. // Note: This call will check the number of finalize operations is within the size of the Merkle tree. - let tree = N::merkle_tree_bhp::(&leaves.collect::>())?; + let tree = N::merkle_tree_bhp::(&leaves)?; // Return the finalize root. Ok(*tree.root()) } From 4d3ba64bb6140b8d9e2315d9ff563e95781e9170 Mon Sep 17 00:00:00 2001 From: raychu86 <14917648+raychu86@users.noreply.github.com> Date: Mon, 13 Nov 2023 13:37:49 -0800 Subject: [PATCH 019/298] nit --- ledger/block/src/transactions/merkle.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ledger/block/src/transactions/merkle.rs b/ledger/block/src/transactions/merkle.rs index fa651d0f72..ed25919766 100644 --- a/ledger/block/src/transactions/merkle.rs +++ b/ledger/block/src/transactions/merkle.rs @@ -17,7 +17,7 @@ use super::*; impl Transactions { /// Returns the finalize root of the transactions. pub fn to_finalize_root(&self, ratified_finalize_operations: Vec>) -> Result> { - // Prepare the finalize ids for the ratify-finalize operations. + // Prepare the finalize id for the ratified finalize operations. let ratified_finalize_id = *N::merkle_tree_bhp::( &ratified_finalize_operations.iter().map(ToBits::to_bits_le).collect::>(), )? From 3553add660b67883cae0df03d6679e5d439b142b Mon Sep 17 00:00:00 2001 From: evan-schott <53463459+evan-schott@users.noreply.github.com> Date: Mon, 13 Nov 2023 17:10:46 -0800 Subject: [PATCH 020/298] remove test limitation --- ledger/block/src/verify.rs | 3 --- 1 file changed, 3 deletions(-) diff --git a/ledger/block/src/verify.rs b/ledger/block/src/verify.rs index 9fa6093229..7d77d38511 100644 --- a/ledger/block/src/verify.rs +++ b/ledger/block/src/verify.rs @@ -137,9 +137,6 @@ impl Block { previous_height: u32, current_committee: &Committee, ) -> Result<(u64, u32, i64)> { - #[cfg(not(any(test, feature = "test")))] - ensure!(self.authority.is_quorum(), "The next block must be a quorum block"); - // Determine the expected height. let expected_height = previous_height.saturating_add(1); From 9335023d246580056ba6cdd5e751dbf1d26edeb3 Mon Sep 17 00:00:00 2001 From: Howard Wu <9260812+howardwu@users.noreply.github.com> Date: Sat, 25 Nov 2023 12:29:09 -0800 Subject: [PATCH 021/298] Add back limitation --- ledger/block/src/verify.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ledger/block/src/verify.rs b/ledger/block/src/verify.rs index 7c68ba6602..eee243e537 100644 --- a/ledger/block/src/verify.rs +++ b/ledger/block/src/verify.rs @@ -137,6 +137,10 @@ impl Block { previous_height: u32, current_committee: &Committee, ) -> Result<(u64, u32, i64)> { + // Note: Do not remove this. This ensures that all blocks after genesis are quorum blocks. + #[cfg(not(any(test, feature = "test")))] + ensure!(self.authority.is_quorum(), "The next block must be a quorum block"); + // Determine the expected height. let expected_height = previous_height.saturating_add(1); From 60a7f2575f811f1f4b907c0697f07b045eae0bf2 Mon Sep 17 00:00:00 2001 From: Howard Wu <9260812+howardwu@users.noreply.github.com> Date: Sat, 25 Nov 2023 12:51:26 -0800 Subject: [PATCH 022/298] Reduce finalize ops tree to 2^16 instead of 2^17 --- .../src/state_path/configuration/mod.rs | 6 +++-- .../block/src/transactions/confirmed/mod.rs | 21 +++++++-------- ledger/block/src/transactions/merkle.rs | 27 ++++++++++--------- ledger/block/src/transactions/mod.rs | 2 +- ledger/narwhal/batch-header/src/lib.rs | 2 +- 5 files changed, 30 insertions(+), 28 deletions(-) diff --git a/console/program/src/state_path/configuration/mod.rs b/console/program/src/state_path/configuration/mod.rs index ddfa6651f8..17cb02942d 100644 --- a/console/program/src/state_path/configuration/mod.rs +++ b/console/program/src/state_path/configuration/mod.rs @@ -20,14 +20,16 @@ pub const BLOCKS_DEPTH: u8 = 32; /// The depth of the Merkle tree for the block header. pub const HEADER_DEPTH: u8 = 3; /// The depth of the Merkle tree for finalize operations in a transaction. -pub const FINALIZE_ID_DEPTH: u8 = TRANSACTION_DEPTH + 4; // 4 for 16 finalize operations per transition. +pub const FINALIZE_ID_DEPTH: u8 = TRANSACTION_DEPTH + 4; // '+ 4' is to support 16 finalize operations per transition. /// The depth of the Merkle tree for finalize operations in a block. -pub const FINALIZE_OPERATIONS_DEPTH: u8 = TRANSACTIONS_DEPTH + 1; +pub const FINALIZE_OPERATIONS_DEPTH: u8 = TRANSACTIONS_DEPTH; /// The depth of the Merkle tree for the ratifications in a block. pub const RATIFICATIONS_DEPTH: u8 = 16; /// The depth the Merkle tree for the subdag certificates in a block. pub const SUBDAG_CERTIFICATES_DEPTH: u8 = 16; /// The depth of the Merkle tree for transactions in a block. +/// Note: The technical limit is 2^16 - 1 transactions, to allow compatibility with the +/// finalize operations tree, which requires 1 leaf for the ratified finalize ID. pub const TRANSACTIONS_DEPTH: u8 = 16; /// The depth of the Merkle tree for the transaction. pub const TRANSACTION_DEPTH: u8 = 5; diff --git a/ledger/block/src/transactions/confirmed/mod.rs b/ledger/block/src/transactions/confirmed/mod.rs index d942c94d5e..c617c1b3f4 100644 --- a/ledger/block/src/transactions/confirmed/mod.rs +++ b/ledger/block/src/transactions/confirmed/mod.rs @@ -261,6 +261,16 @@ impl ConfirmedTransaction { } } + /// Returns the finalize ID, by computing the root of a (small) Merkle tree comprised of + /// the ordered finalize operations for the transaction. + pub fn to_finalize_id(&self) -> Result> { + // Prepare the leaves. + let leaves = self.finalize_operations().iter().map(ToBits::to_bits_le).collect::>(); + // Compute the finalize ID. + // Note: This call will ensure the number of finalize operations is within the size of the Merkle tree. + Ok(*N::merkle_tree_bhp::(&leaves)?.root()) + } + /// Returns the rejected ID, if the confirmed transaction is rejected. pub fn to_rejected_id(&self) -> Result>> { match self { @@ -314,17 +324,6 @@ impl ConfirmedTransaction { ), } } - - /// Returns the finalize id, by computing the root for a Merkle tree of the finalize operations. - pub fn to_finalize_id(&self) -> Result> { - // Prepare the leaves. - let leaves = self.finalize_operations().iter().map(ToBits::to_bits_le); - // Compute the finalize id tree. - // Note: This call will check the number of finalize operations is within the size of the Merkle tree. - let tree = N::merkle_tree_bhp::(&leaves.collect::>())?; - // Return the finalize id. - Ok(*tree.root()) - } } impl Deref for ConfirmedTransaction { diff --git a/ledger/block/src/transactions/merkle.rs b/ledger/block/src/transactions/merkle.rs index ed25919766..7f666f4ff5 100644 --- a/ledger/block/src/transactions/merkle.rs +++ b/ledger/block/src/transactions/merkle.rs @@ -17,26 +17,23 @@ use super::*; impl Transactions { /// Returns the finalize root of the transactions. pub fn to_finalize_root(&self, ratified_finalize_operations: Vec>) -> Result> { - // Prepare the finalize id for the ratified finalize operations. + // Prepare the ratified finalize ID - a Merkle tree composed of the ratified finalize operations. let ratified_finalize_id = *N::merkle_tree_bhp::( &ratified_finalize_operations.iter().map(ToBits::to_bits_le).collect::>(), )? .root(); - // Prepare the leaves. - let mut leaves = self + // Prepare the leaves, composed of: + // | transaction_0 finalize ID, ..., transaction_n finalize ID | ratified finalize ID | + let leaves = self .iter() - .map(ConfirmedTransaction::to_finalize_id) - .map(|res| res.map(|id| id.to_bits_le())) + .map(|tx| tx.to_finalize_id().map(|id| id.to_bits_le())) + .chain(std::iter::once(Ok(ratified_finalize_id.to_bits_le()))) .collect::>>()?; - // Append the finalize id for the ratifications. - leaves.push(ratified_finalize_id.to_bits_le()); - // Compute the finalize tree. - // Note: This call will check the number of finalize operations is within the size of the Merkle tree. - let tree = N::merkle_tree_bhp::(&leaves)?; - // Return the finalize root. - Ok(*tree.root()) + // Compute the finalize root. + // Note: This call will ensure the number of finalize operations is within the size of the Merkle tree. + Ok(*N::merkle_tree_bhp::(&leaves)?.root()) } } @@ -87,6 +84,10 @@ mod tests { #[test] fn test_transactions_depth() { // Ensure the log2 relationship between depth and the maximum number of transactions. - assert_eq!(2usize.pow(TRANSACTIONS_DEPTH as u32), Transactions::::MAX_TRANSACTIONS); + // Note: This test uses 'checked_sub' to ensure the depth is not zero. + assert_eq!( + 2usize.pow(TRANSACTIONS_DEPTH as u32).checked_sub(1).expect("Invalid depth"), + Transactions::::MAX_TRANSACTIONS + ); } } diff --git a/ledger/block/src/transactions/mod.rs b/ledger/block/src/transactions/mod.rs index 6fe4cf695e..6d10a510f1 100644 --- a/ledger/block/src/transactions/mod.rs +++ b/ledger/block/src/transactions/mod.rs @@ -168,7 +168,7 @@ impl Transactions { impl Transactions { /// The maximum number of transactions allowed in a block. - pub const MAX_TRANSACTIONS: usize = usize::pow(2, TRANSACTIONS_DEPTH as u32); + pub const MAX_TRANSACTIONS: usize = usize::pow(2, TRANSACTIONS_DEPTH as u32).saturating_sub(1); /// Returns an iterator over all transactions, for all transactions in `self`. pub fn iter(&self) -> impl '_ + ExactSizeIterator> { diff --git a/ledger/narwhal/batch-header/src/lib.rs b/ledger/narwhal/batch-header/src/lib.rs index 3801498a30..8e2fb65cf2 100644 --- a/ledger/narwhal/batch-header/src/lib.rs +++ b/ledger/narwhal/batch-header/src/lib.rs @@ -52,7 +52,7 @@ impl BatchHeader { /// The maximum number of solutions in a batch. pub const MAX_SOLUTIONS: usize = N::MAX_SOLUTIONS; /// The maximum number of transactions in a batch. - pub const MAX_TRANSACTIONS: usize = usize::pow(2, console::program::TRANSACTIONS_DEPTH as u32); + pub const MAX_TRANSACTIONS: usize = usize::pow(2, console::program::TRANSACTIONS_DEPTH as u32).saturating_sub(1); /// The maximum number of transmissions in a batch. pub const MAX_TRANSMISSIONS: usize = Self::MAX_SOLUTIONS + Self::MAX_TRANSACTIONS; } From 0cd63eef7d645baba9d5664400659f64c931a78a Mon Sep 17 00:00:00 2001 From: Howard Wu <9260812+howardwu@users.noreply.github.com> Date: Sat, 25 Nov 2023 13:40:20 -0800 Subject: [PATCH 023/298] Resample parameter --- .../src/testnet3/resources/block.genesis | Bin 13728 -> 13728 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/parameters/src/testnet3/resources/block.genesis b/parameters/src/testnet3/resources/block.genesis index c33b0398b64573fa23e04bacd903dfb75872c709..86ecc70d467e739bf7694ff790f69ccbac41569a 100644 GIT binary patch delta 11336 zcmY+KRajixwr;Bm3U_yRw?J@r2~Kc#2<}pa1t+*WAxH=g!QCymyAy)D1a4OLS?An6 zpU3yjIr~E!t@r-t+vnSp14)z_-nN%o%?)$2?cvP?Kc2yTmdUYTjUcq^{4L9yAV!rS zPAT?@-K=($s=+ooQ@~~phvRu-xg)HjN|GJj!(SRUGZ0Ld>nMkd+WJOFl~*Eut^LZ9`s2C5~t=7ZLicdT90>HX8$cJ;U})5Os-~|#Bbn& zm_e+D(Hd{6<1sS-H0Ej5!WKoxW1b7bD*{TCR|v2!6Zj1%NkM(#7ylK3I;1K!Yo#0` zw2DRXc1$nhhqf}^B~pwzCJ+d8%FNEz>OLT>MQaU#rgvZlQXU(dw1smVYYbzdTKonl zQDQJb0&!bjx0Uom2CmbD@}Ff==gq#?!&+Jw+>w70kcjO?0)ha{TArx2N>n+guL}P0 z9*z_4iz*?x=Y#L4K*UvVEyED{*rJ&tDeFTFLbE#gdVrgQCMmvGMngRE`7P~kC5;$B zz=h+ckRsRpB$48tp2DUT-G{;>j^8c%An|R;kdna-00=+<05FPY4*>uG2nK~$rMWRQ z9p{QJ641z(*_?fZxJIQ6`S{uw(sqXVfXTD`o@ZyyX}L^yI|h-j#Mc9ry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$^3u^nEtPW^*wFR{w@{)qTw&{T^XSvpWEKsn* zg>30YxGtY?XkFRO(lmiJAu&YLo4->a2P{Yg%Duu9(mzYn zD8nz5dlCvf4ovEm55c38#X2ih1H1;#c;D6@>uwav11awydPq_EE^SDnAu7Fb>$_hp z%n_3EYoGX%f_9U$vW_sKAfiUjTvTv%#7__wbaHqAEd>aA1`LA{NY7O& z_bHA}il%jclg?c+n3IzSfvYwO?bkhxuPVPb1 zT8h0jrk~ zyhv`~@rDv}bUnS~n?{?k6EM{FK(3*rTuJI$9WTKmPvF=Sha>*PkK2-BKp5w~U0gt(#eO_Q?NG;c3z)4y(7FC^!%0yAY z#NEuFzA@cQB|&@p2|WR(SXPY+ZTY(iA2@I$Gg~xKeeN76l}Fxh$iicmM+O)3_|9@d z-}dyeaIeQi!%-&}F=q8YUE;~1egTzv1WAdb8ohRkFI-F;wD#ey$9>)}Ft{@ePK~r^ zF2u}eJ#tow#@>G)3cg_5BuGPDjJGFs@4eE5ErK%=gghhMU7sum=@kuqM{{*Qz|6s^ z)GoZF(=O=b3^c^WN@Yh2&YGyw^2{g{k@rp`c!o7bpj_m1M#{#FY}xZ` zs5ack<#+fxZ&nGahAxt@PjX#<98clrp$6LELaWxQO}PwiYiA zY4>9EshxU0kT}dHR88Lt@yX>i(^-iFfdf~mRt824hgiKe8{MeRg1iJ_b`1cl`?sv?c-y*5FE{+aDk`{|$R*yZQ-*VM_z bOGHY1|F9^4{xka-{-`)V>9!i Date: Sat, 25 Nov 2023 13:51:58 -0800 Subject: [PATCH 024/298] Reduces the maximum transmissions per batch --- ledger/block/src/transactions/mod.rs | 15 +++++++++++---- ledger/narwhal/batch-header/src/bytes.rs | 4 ++-- ledger/narwhal/batch-header/src/lib.rs | 9 ++++----- 3 files changed, 17 insertions(+), 11 deletions(-) diff --git a/ledger/block/src/transactions/mod.rs b/ledger/block/src/transactions/mod.rs index 2eb3a31372..d4b5c6cb9e 100644 --- a/ledger/block/src/transactions/mod.rs +++ b/ledger/block/src/transactions/mod.rs @@ -343,14 +343,21 @@ pub mod test_helpers { #[cfg(test)] mod tests { use super::*; + use ledger_narwhal_batch_header::BatchHeader; type CurrentNetwork = console::network::Testnet3; #[test] - fn test_max_transactions() { - assert_eq!( - Transactions::::MAX_TRANSACTIONS, - ledger_narwhal_batch_header::BatchHeader::::MAX_TRANSACTIONS + fn test_max_transmissions() { + // Determine the maximum number of transmissions in a batch. + let max_transmissions = BatchHeader::::MAX_TRANSMISSIONS_PER_BATCH + * BatchHeader::::MAX_CERTIFICATES + * 2; // 2 is for the BFT (1 block per 2 rounds) + + // Note: The maximum number of *transmissions* in a round cannot exceed the maximum number of *transactions* in a block. + assert!( + max_transmissions <= Transactions::::MAX_TRANSACTIONS, + "The maximum number of transmissions in a batch is too large" ); } } diff --git a/ledger/narwhal/batch-header/src/bytes.rs b/ledger/narwhal/batch-header/src/bytes.rs index 386ee958d3..e187d20443 100644 --- a/ledger/narwhal/batch-header/src/bytes.rs +++ b/ledger/narwhal/batch-header/src/bytes.rs @@ -36,10 +36,10 @@ impl FromBytes for BatchHeader { // Read the number of transmission IDs. let num_transmission_ids = u32::read_le(&mut reader)?; // Ensure the number of transmission IDs is within bounds. - if num_transmission_ids as usize > Self::MAX_TRANSMISSIONS { + if num_transmission_ids as usize > Self::MAX_TRANSMISSIONS_PER_BATCH { return Err(error(format!( "Number of transmission IDs ({num_transmission_ids}) exceeds the maximum ({})", - Self::MAX_TRANSMISSIONS, + Self::MAX_TRANSMISSIONS_PER_BATCH, ))); } // Read the transmission IDs. diff --git a/ledger/narwhal/batch-header/src/lib.rs b/ledger/narwhal/batch-header/src/lib.rs index 3801498a30..0156e3428e 100644 --- a/ledger/narwhal/batch-header/src/lib.rs +++ b/ledger/narwhal/batch-header/src/lib.rs @@ -49,12 +49,11 @@ pub struct BatchHeader { impl BatchHeader { /// The maximum number of certificates in a batch. pub const MAX_CERTIFICATES: usize = 200; - /// The maximum number of solutions in a batch. - pub const MAX_SOLUTIONS: usize = N::MAX_SOLUTIONS; - /// The maximum number of transactions in a batch. - pub const MAX_TRANSACTIONS: usize = usize::pow(2, console::program::TRANSACTIONS_DEPTH as u32); /// The maximum number of transmissions in a batch. - pub const MAX_TRANSMISSIONS: usize = Self::MAX_SOLUTIONS + Self::MAX_TRANSACTIONS; + /// Note: This limit is set to 50 as part of safety measures to prevent DoS attacks. + /// This limit can be increased in the future as performance improves. Alternatively, + /// the rate of block production can be sped up to compensate for the limit set here. + pub const MAX_TRANSMISSIONS_PER_BATCH: usize = 50; } impl BatchHeader { From 53eb83f874195b7aec14e8f456968548edffb372 Mon Sep 17 00:00:00 2001 From: Howard Wu <9260812+howardwu@users.noreply.github.com> Date: Sat, 25 Nov 2023 14:43:22 -0800 Subject: [PATCH 025/298] Increase the transactions per block to 2^20 to reflect subdag requirements --- .../src/state_path/configuration/mod.rs | 2 +- ledger/block/src/transactions/mod.rs | 18 +++++++----- ledger/block/src/transition/merkle.rs | 4 +-- ledger/narwhal/batch-header/src/lib.rs | 3 ++ ledger/narwhal/subdag/src/lib.rs | 29 +++++++++++++++---- 5 files changed, 40 insertions(+), 16 deletions(-) diff --git a/console/program/src/state_path/configuration/mod.rs b/console/program/src/state_path/configuration/mod.rs index b8ddef30cf..04d2950c8e 100644 --- a/console/program/src/state_path/configuration/mod.rs +++ b/console/program/src/state_path/configuration/mod.rs @@ -26,7 +26,7 @@ pub const RATIFICATIONS_DEPTH: u8 = 16; /// The depth the Merkle tree for the subdag certificates in a block. pub const SUBDAG_CERTIFICATES_DEPTH: u8 = 16; /// The depth of the Merkle tree for transactions in a block. -pub const TRANSACTIONS_DEPTH: u8 = 16; +pub const TRANSACTIONS_DEPTH: u8 = 20; /// The depth of the Merkle tree for the transaction. pub const TRANSACTION_DEPTH: u8 = 5; /// The depth of the Merkle tree for the transition. diff --git a/ledger/block/src/transactions/mod.rs b/ledger/block/src/transactions/mod.rs index d4b5c6cb9e..61119a73d2 100644 --- a/ledger/block/src/transactions/mod.rs +++ b/ledger/block/src/transactions/mod.rs @@ -349,15 +349,17 @@ mod tests { #[test] fn test_max_transmissions() { - // Determine the maximum number of transmissions in a batch. - let max_transmissions = BatchHeader::::MAX_TRANSMISSIONS_PER_BATCH - * BatchHeader::::MAX_CERTIFICATES - * 2; // 2 is for the BFT (1 block per 2 rounds) - - // Note: The maximum number of *transmissions* in a round cannot exceed the maximum number of *transactions* in a block. + // Determine the maximum number of transmissions in a block. + let max_transmissions_per_block = BatchHeader::::MAX_TRANSMISSIONS_PER_BATCH + * usize::try_from(BatchHeader::::MAX_GC_ROUNDS).unwrap() + * BatchHeader::::MAX_CERTIFICATES; + + // Note: The maximum number of *transmissions* in a block cannot exceed the maximum number of *transactions* in a block. + // If you intended to change the number of 'MAX_TRANSACTIONS', note that this will break the inclusion proof, + // and you will need to migrate all users to a new circuit for the inclusion proof. assert!( - max_transmissions <= Transactions::::MAX_TRANSACTIONS, - "The maximum number of transmissions in a batch is too large" + max_transmissions_per_block <= Transactions::::MAX_TRANSACTIONS, + "The maximum number of transmissions in a block is too large" ); } } diff --git a/ledger/block/src/transition/merkle.rs b/ledger/block/src/transition/merkle.rs index d5a8fb33b1..e2f05de05b 100644 --- a/ledger/block/src/transition/merkle.rs +++ b/ledger/block/src/transition/merkle.rs @@ -36,7 +36,7 @@ impl Transition { // Check if the input ID matches the given ID. if id == input.id() { // Return the transition leaf. - return Ok(input.to_transition_leaf(index as u8)); + return Ok(input.to_transition_leaf(u8::try_from(index)?)); } } // Error if the input ID was not found. @@ -48,7 +48,7 @@ impl Transition { // Check if the output ID matches the given ID. if id == output.id() { // Return the transition leaf. - return Ok(output.to_transition_leaf((self.inputs.len() + index) as u8)); + return Ok(output.to_transition_leaf(u8::try_from(self.inputs.len() + index)?)); } } // Error if the output ID was not found. diff --git a/ledger/narwhal/batch-header/src/lib.rs b/ledger/narwhal/batch-header/src/lib.rs index 0156e3428e..8999829986 100644 --- a/ledger/narwhal/batch-header/src/lib.rs +++ b/ledger/narwhal/batch-header/src/lib.rs @@ -49,6 +49,9 @@ pub struct BatchHeader { impl BatchHeader { /// The maximum number of certificates in a batch. pub const MAX_CERTIFICATES: usize = 200; + /// The maximum number of rounds to store before garbage collecting. + pub const MAX_GC_ROUNDS: u64 = 100; + // rounds /// The maximum number of transmissions in a batch. /// Note: This limit is set to 50 as part of safety measures to prevent DoS attacks. /// This limit can be increased in the future as performance improves. Alternatively, diff --git a/ledger/narwhal/subdag/src/lib.rs b/ledger/narwhal/subdag/src/lib.rs index 8fb93cfe9b..b62a1f6b3b 100644 --- a/ledger/narwhal/subdag/src/lib.rs +++ b/ledger/narwhal/subdag/src/lib.rs @@ -159,7 +159,7 @@ impl Subdag { } } - /// Returns the subdag root of the transactions. + /// Returns the subdag root of the certificates. pub fn to_subdag_root(&self) -> Result> { // Prepare the leaves. let leaves = cfg_iter!(self.subdag) @@ -168,10 +168,8 @@ impl Subdag { }) .collect::>(); - // Compute the subdag tree. - let tree = N::merkle_tree_bhp::(&leaves)?; - // Return the subdag root. - Ok(*tree.root()) + // Compute the subdag root. + Ok(*N::merkle_tree_bhp::(&leaves)?.root()) } } @@ -255,3 +253,24 @@ pub mod test_helpers { sample } } + +#[cfg(test)] +mod tests { + use super::*; + use narwhal_batch_header::BatchHeader; + + type CurrentNetwork = console::network::Testnet3; + + #[test] + fn test_max_certificates() { + // Determine the maximum number of certificates in a block. + let max_certificates_per_block = usize::try_from(BatchHeader::::MAX_GC_ROUNDS).unwrap() + * BatchHeader::::MAX_CERTIFICATES; + + // Note: The maximum number of certificates in a block must be able to be Merklized. + assert!( + max_certificates_per_block <= 2u32.checked_pow(SUBDAG_CERTIFICATES_DEPTH as u32).unwrap() as usize, + "The maximum number of certificates in a block is too large" + ); + } +} From 9750ce467bef855849259b0fcd947fcdb2eae41b Mon Sep 17 00:00:00 2001 From: Howard Wu <9260812+howardwu@users.noreply.github.com> Date: Sat, 25 Nov 2023 14:54:35 -0800 Subject: [PATCH 026/298] Resample parameters --- .../src/testnet3/resources/block.genesis | Bin 13728 -> 13728 bytes .../src/testnet3/resources/inclusion.metadata | 6 +++--- .../src/testnet3/resources/inclusion.verifier | Bin 665 -> 665 bytes 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/parameters/src/testnet3/resources/block.genesis b/parameters/src/testnet3/resources/block.genesis index c33b0398b64573fa23e04bacd903dfb75872c709..a668899939e0755010352583f933fc95ea92daa7 100644 GIT binary patch delta 11333 zcmY+~WmHsq!0++dbTA!CLx+Gg(nxoAcS)zDbayw`<9*J3?%A(r zt(p11`0mgCt(|3^Wlaufl*XjfNey<`J|o~xms-{-uo0-13Md%Ue5`vTE^CGnLoOyN z9LD0De8m$+s5*9&W}J!dIN?n$)t@0k>_em-KR%5fUOyY;4XUsF0-Yy0q*)`|c|a?3 z-Z?)1^)mSh$^#QBCc9D8KhCFRh2=3_odkm9YJ4&l$HQx%Tk=geIrJGe{2elg9hc0h zpp$;}qou(LMS%D`P46-R$arK&{lr;^@hbyRlLC|h60o`SMoqXQ$FaCanKoCs?cps= z+aK9~7wLKgQZ7+7!T|s<5mffOZ@`y)>me8w$|aZ*z2s$gqs-P#X5#=p8(9H}Bgdcz zhsL@)KFg7v!r7fTkwkb|PQPvuF!#POPuGs(5ZdCz0H8oz11g6ctOLI|qX}^!fd+72 zw({h+cDT}xN=bygkbufEp&39!Aza5t~Tz&du<}L;GLeO*j?$)p* zq5t{opq*_+HUjbi+vgP-O*0ghSi}|FHpe|L9{Zr%hK5y;@Kx%~qh27%s}=lR_oI?Sra|GfG)WK7H=5cl$OG%2qo#}djmarW zqdBeOc~35b=7;nmXQ^;gJV5#OI)ERMpbJV~DAx#)=sI?Z`zD;o8Y@9kU4El*t0YR0 z)1_=?F8n3q1*I4%&X0i|Y-y94MzO}xqZ709$fCR#_Kd=CGbn`{jN|*THzcWA@A;1%GHUWkICY8@+1-2)I_bniB0ygrMAL*JZ-{*2-mkhob< zXbAI{uYiO(K!1MAG!ZnBh4Qu@O)Sx}(DmIbe?}|0u+35Ty!1LA#sgf*1V5B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55I>gC}LwZPr1~yn0Llal%Pkz)H$+UtB%TN Date: Sat, 25 Nov 2023 15:17:57 -0800 Subject: [PATCH 027/298] Update constraint counts --- circuit/program/src/state_path/mod.rs | 6 ++-- circuit/program/src/state_path/verify.rs | 36 ++++++++++++------------ 2 files changed, 21 insertions(+), 21 deletions(-) diff --git a/circuit/program/src/state_path/mod.rs b/circuit/program/src/state_path/mod.rs index d8cf025aa6..6e8a30ed74 100644 --- a/circuit/program/src/state_path/mod.rs +++ b/circuit/program/src/state_path/mod.rs @@ -191,16 +191,16 @@ mod tests { #[test] fn test_state_path_new_constant() -> Result<()> { - check_new(Mode::Constant, 446, 1, 0, 0) + check_new(Mode::Constant, 450, 1, 0, 0) } #[test] fn test_state_path_new_public() -> Result<()> { - check_new(Mode::Public, 0, 447, 0, 376) + check_new(Mode::Public, 0, 451, 0, 376) } #[test] fn test_state_path_new_private() -> Result<()> { - check_new(Mode::Private, 0, 1, 446, 376) + check_new(Mode::Private, 0, 1, 450, 376) } } diff --git a/circuit/program/src/state_path/verify.rs b/circuit/program/src/state_path/verify.rs index f4c6e624cc..9101486ff9 100644 --- a/circuit/program/src/state_path/verify.rs +++ b/circuit/program/src/state_path/verify.rs @@ -225,43 +225,43 @@ mod tests { #[test] fn test_state_path_verify_global_constant() -> Result<()> { - check_verify_global(Mode::Constant, true, 106309, 1, 2, 2)?; - check_verify_global(Mode::Constant, false, 106309, 1, 2, 2) + check_verify_global(Mode::Constant, true, 112709, 1, 2, 2)?; + check_verify_global(Mode::Constant, false, 112709, 1, 2, 2) } #[test] fn test_state_path_verify_global_public() -> Result<()> { - check_verify_global(Mode::Public, true, 27814, 449, 123343, 123982)?; - check_verify_global(Mode::Public, false, 27814, 449, 123343, 123982) + check_verify_global(Mode::Public, true, 29450, 453, 130867, 131522)?; + check_verify_global(Mode::Public, false, 29450, 453, 130867, 131522) } #[test] fn test_state_path_verify_global_private() -> Result<()> { - check_verify_global(Mode::Private, true, 27814, 1, 123791, 123982)?; - check_verify_global(Mode::Private, false, 27814, 1, 123791, 123982) + check_verify_global(Mode::Private, true, 29450, 1, 131319, 131522)?; + check_verify_global(Mode::Private, false, 29450, 1, 131319, 131522) } #[test] fn test_state_path_verify_local_constant() -> Result<()> { - check_verify_local(Mode::Constant, false, true, 106309, 1, 2, 2)?; - check_verify_local(Mode::Constant, false, false, 106309, 1, 2, 2)?; - check_verify_local(Mode::Constant, true, true, 106309, 1, 2, 2)?; - check_verify_local(Mode::Constant, true, false, 106309, 1, 2, 2) + check_verify_local(Mode::Constant, false, true, 112709, 1, 2, 2)?; + check_verify_local(Mode::Constant, false, false, 112709, 1, 2, 2)?; + check_verify_local(Mode::Constant, true, true, 112709, 1, 2, 2)?; + check_verify_local(Mode::Constant, true, false, 112709, 1, 2, 2) } #[test] fn test_state_path_verify_local_public() -> Result<()> { - check_verify_local(Mode::Public, false, true, 27814, 449, 123343, 123982)?; - check_verify_local(Mode::Public, false, false, 27814, 449, 123343, 123982)?; - check_verify_local(Mode::Public, true, true, 27814, 449, 123343, 123982)?; - check_verify_local(Mode::Public, true, false, 27814, 449, 123343, 123982) + check_verify_local(Mode::Public, false, true, 29450, 453, 130867, 131522)?; + check_verify_local(Mode::Public, false, false, 29450, 453, 130867, 131522)?; + check_verify_local(Mode::Public, true, true, 29450, 453, 130867, 131522)?; + check_verify_local(Mode::Public, true, false, 29450, 453, 130867, 131522) } #[test] fn test_state_path_verify_local_private() -> Result<()> { - check_verify_local(Mode::Private, false, true, 27814, 1, 123791, 123982)?; - check_verify_local(Mode::Private, false, false, 27814, 1, 123791, 123982)?; - check_verify_local(Mode::Private, true, true, 27814, 1, 123791, 123982)?; - check_verify_local(Mode::Private, true, false, 27814, 1, 123791, 123982) + check_verify_local(Mode::Private, false, true, 29450, 1, 131319, 131522)?; + check_verify_local(Mode::Private, false, false, 29450, 1, 131319, 131522)?; + check_verify_local(Mode::Private, true, true, 29450, 1, 131319, 131522)?; + check_verify_local(Mode::Private, true, false, 29450, 1, 131319, 131522) } } From 5a68ae4e2ebbaf3c43286735b2332ea122a03f48 Mon Sep 17 00:00:00 2001 From: Howard Wu <9260812+howardwu@users.noreply.github.com> Date: Sat, 25 Nov 2023 15:31:45 -0800 Subject: [PATCH 028/298] Fix Subdag::MAX_ROUNDS --- ledger/narwhal/subdag/src/bytes.rs | 2 +- ledger/narwhal/subdag/src/lib.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ledger/narwhal/subdag/src/bytes.rs b/ledger/narwhal/subdag/src/bytes.rs index d4ed42913b..9b2880251f 100644 --- a/ledger/narwhal/subdag/src/bytes.rs +++ b/ledger/narwhal/subdag/src/bytes.rs @@ -27,7 +27,7 @@ impl FromBytes for Subdag { // Read the number of rounds. let num_rounds = u32::read_le(&mut reader)?; // Ensure the number of rounds is within bounds. - if num_rounds as usize > Self::MAX_ROUNDS { + if num_rounds as u64 > Self::MAX_ROUNDS { return Err(error(format!("Number of rounds ({num_rounds}) exceeds the maximum ({})", Self::MAX_ROUNDS))); } // Read the round certificates. diff --git a/ledger/narwhal/subdag/src/lib.rs b/ledger/narwhal/subdag/src/lib.rs index b62a1f6b3b..e1cf04c7ae 100644 --- a/ledger/narwhal/subdag/src/lib.rs +++ b/ledger/narwhal/subdag/src/lib.rs @@ -104,7 +104,7 @@ impl Subdag { impl Subdag { /// The maximum number of rounds in a subdag (bounded up to GC depth). - pub const MAX_ROUNDS: usize = 50; + pub const MAX_ROUNDS: u64 = BatchHeader::::MAX_GC_ROUNDS; } impl Subdag { From 811d7381aa29c6aef84b40b18018fe4dd33a7940 Mon Sep 17 00:00:00 2001 From: Howard Wu <9260812+howardwu@users.noreply.github.com> Date: Sat, 25 Nov 2023 15:38:58 -0800 Subject: [PATCH 029/298] Sets max committee size to max certificates --- ledger/block/src/transactions/mod.rs | 2 +- ledger/committee/Cargo.toml | 8 ++++---- ledger/committee/src/lib.rs | 8 +++----- ledger/narwhal/batch-header/src/bytes.rs | 6 +++--- ledger/narwhal/batch-header/src/lib.rs | 2 +- ledger/narwhal/subdag/src/bytes.rs | 6 +++--- ledger/narwhal/subdag/src/lib.rs | 2 +- 7 files changed, 16 insertions(+), 18 deletions(-) diff --git a/ledger/block/src/transactions/mod.rs b/ledger/block/src/transactions/mod.rs index 14d3141606..98ee5f02ab 100644 --- a/ledger/block/src/transactions/mod.rs +++ b/ledger/block/src/transactions/mod.rs @@ -353,7 +353,7 @@ mod tests { // Determine the maximum number of transmissions in a block. let max_transmissions_per_block = BatchHeader::::MAX_TRANSMISSIONS_PER_BATCH * usize::try_from(BatchHeader::::MAX_GC_ROUNDS).unwrap() - * BatchHeader::::MAX_CERTIFICATES; + * BatchHeader::::MAX_CERTIFICATES as usize; // Note: The maximum number of *transmissions* in a block cannot exceed the maximum number of *transactions* in a block. // If you intended to change the number of 'MAX_TRANSACTIONS', note that this will break the inclusion proof, diff --git a/ledger/committee/Cargo.toml b/ledger/committee/Cargo.toml index 51284ebe8d..f885d78f5d 100644 --- a/ledger/committee/Cargo.toml +++ b/ledger/committee/Cargo.toml @@ -35,6 +35,10 @@ package = "snarkvm-console" path = "../../console" version = "=0.16.11" +[dependencies.ledger-narwhal-batch-header] +package = "snarkvm-ledger-narwhal-batch-header" +path = "../narwhal/batch-header" + [dependencies.indexmap] version = "2.0" features = [ "serde", "rayon" ] @@ -82,7 +86,3 @@ version = "1" [dev-dependencies.snarkvm-ledger-committee] path = "." features = [ "prop-tests" ] - -[dev-dependencies.ledger-narwhal-batch-header] -package = "snarkvm-ledger-narwhal-batch-header" -path = "../narwhal/batch-header" diff --git a/ledger/committee/src/lib.rs b/ledger/committee/src/lib.rs index 74c392c35b..17ade7ba5a 100644 --- a/ledger/committee/src/lib.rs +++ b/ledger/committee/src/lib.rs @@ -26,6 +26,7 @@ use console::{ }; use indexmap::IndexMap; +use ledger_narwhal_batch_header::BatchHeader; use std::collections::HashSet; /// The minimum amount of stake required for a validator to bond. @@ -45,7 +46,7 @@ pub struct Committee { impl Committee { /// The maximum number of members that may be in a committee. - pub const MAX_COMMITTEE_SIZE: u16 = 200; + pub const MAX_COMMITTEE_SIZE: u16 = BatchHeader::::MAX_CERTIFICATES; /// Initializes a new `Committee` instance. pub fn new_genesis(members: IndexMap, (u64, bool)>) -> Result { @@ -447,9 +448,6 @@ mod tests { #[test] fn test_maximum_committee_size() { - assert_eq!( - Committee::::MAX_COMMITTEE_SIZE as usize, - ledger_narwhal_batch_header::BatchHeader::::MAX_CERTIFICATES - ); + assert_eq!(Committee::::MAX_COMMITTEE_SIZE, BatchHeader::::MAX_CERTIFICATES); } } diff --git a/ledger/narwhal/batch-header/src/bytes.rs b/ledger/narwhal/batch-header/src/bytes.rs index e187d20443..b34242e553 100644 --- a/ledger/narwhal/batch-header/src/bytes.rs +++ b/ledger/narwhal/batch-header/src/bytes.rs @@ -50,9 +50,9 @@ impl FromBytes for BatchHeader { } // Read the number of previous certificate IDs. - let num_previous_certificate_ids = u32::read_le(&mut reader)?; + let num_previous_certificate_ids = u16::read_le(&mut reader)?; // Ensure the number of previous certificate IDs is within bounds. - if num_previous_certificate_ids as usize > Self::MAX_CERTIFICATES { + if num_previous_certificate_ids > Self::MAX_CERTIFICATES { return Err(error(format!( "Number of previous certificate IDs ({num_previous_certificate_ids}) exceeds the maximum ({})", Self::MAX_CERTIFICATES @@ -101,7 +101,7 @@ impl ToBytes for BatchHeader { transmission_id.write_le(&mut writer)?; } // Write the number of previous certificate IDs. - u32::try_from(self.previous_certificate_ids.len()).map_err(|e| error(e.to_string()))?.write_le(&mut writer)?; + u16::try_from(self.previous_certificate_ids.len()).map_err(|e| error(e.to_string()))?.write_le(&mut writer)?; // Write the previous certificate IDs. for certificate_id in &self.previous_certificate_ids { // Write the certificate ID. diff --git a/ledger/narwhal/batch-header/src/lib.rs b/ledger/narwhal/batch-header/src/lib.rs index 55397d8700..0afdb243b8 100644 --- a/ledger/narwhal/batch-header/src/lib.rs +++ b/ledger/narwhal/batch-header/src/lib.rs @@ -48,7 +48,7 @@ pub struct BatchHeader { impl BatchHeader { /// The maximum number of certificates in a batch. - pub const MAX_CERTIFICATES: usize = 200; + pub const MAX_CERTIFICATES: u16 = 200; /// The maximum number of rounds to store before garbage collecting. pub const MAX_GC_ROUNDS: u64 = 100; /// The maximum number of transmissions in a batch. diff --git a/ledger/narwhal/subdag/src/bytes.rs b/ledger/narwhal/subdag/src/bytes.rs index 9b2880251f..09032ccf22 100644 --- a/ledger/narwhal/subdag/src/bytes.rs +++ b/ledger/narwhal/subdag/src/bytes.rs @@ -36,9 +36,9 @@ impl FromBytes for Subdag { // Read the round. let round = u64::read_le(&mut reader)?; // Read the number of certificates. - let num_certificates = u32::read_le(&mut reader)?; + let num_certificates = u16::read_le(&mut reader)?; // Ensure the number of certificates is within bounds. - if num_certificates as usize > BatchHeader::::MAX_CERTIFICATES { + if num_certificates > BatchHeader::::MAX_CERTIFICATES { return Err(error(format!( "Number of certificates ({num_certificates}) exceeds the maximum ({})", BatchHeader::::MAX_CERTIFICATES @@ -70,7 +70,7 @@ impl ToBytes for Subdag { // Write the round. round.write_le(&mut writer)?; // Write the number of certificates. - u32::try_from(certificates.len()).map_err(error)?.write_le(&mut writer)?; + u16::try_from(certificates.len()).map_err(error)?.write_le(&mut writer)?; // Write the certificates. for certificate in certificates { // Write the certificate. diff --git a/ledger/narwhal/subdag/src/lib.rs b/ledger/narwhal/subdag/src/lib.rs index e1cf04c7ae..e1d26ffb2f 100644 --- a/ledger/narwhal/subdag/src/lib.rs +++ b/ledger/narwhal/subdag/src/lib.rs @@ -265,7 +265,7 @@ mod tests { fn test_max_certificates() { // Determine the maximum number of certificates in a block. let max_certificates_per_block = usize::try_from(BatchHeader::::MAX_GC_ROUNDS).unwrap() - * BatchHeader::::MAX_CERTIFICATES; + * BatchHeader::::MAX_CERTIFICATES as usize; // Note: The maximum number of certificates in a block must be able to be Merklized. assert!( From 6238fc29d0c3ab5281bbb0279884d5c14481c4af Mon Sep 17 00:00:00 2001 From: Howard Wu <9260812+howardwu@users.noreply.github.com> Date: Sat, 25 Nov 2023 15:54:14 -0800 Subject: [PATCH 030/298] Resample expectations --- .../tests/expectations/vm/execute_and_finalize/test_rand.out | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/synthesizer/tests/expectations/vm/execute_and_finalize/test_rand.out b/synthesizer/tests/expectations/vm/execute_and_finalize/test_rand.out index 4fefc62cfd..d753dcf2b4 100644 --- a/synthesizer/tests/expectations/vm/execute_and_finalize/test_rand.out +++ b/synthesizer/tests/expectations/vm/execute_and_finalize/test_rand.out @@ -19,14 +19,14 @@ outputs: test_rand.aleo/rand_chacha_check: outputs: - '{"type":"future","id":"3721325135151760660773959530505944451747681933722462808964783147996869797702field","value":"{\n program_id: test_rand.aleo,\n function_name: rand_chacha_check,\n arguments: [\n 0field,\n false\n ]\n}"}' - speculate: the execution was accepted + speculate: the execution was rejected add_next_block: succeeded. - verified: true execute: test_rand.aleo/rand_chacha_check: outputs: - '{"type":"future","id":"887371549615679800380522845098080464570119184210350810479392117984911457950field","value":"{\n program_id: test_rand.aleo,\n function_name: rand_chacha_check,\n arguments: [\n 1field,\n true\n ]\n}"}' - speculate: the execution was accepted + speculate: the execution was rejected add_next_block: succeeded. additional: - child_outputs: From c1007c87b68bf1359e7791a009fba659dc82af65 Mon Sep 17 00:00:00 2001 From: Pranav Gaddamadugu <23022326+d0cd@users.noreply.github.com> Date: Wed, 22 Nov 2023 16:59:56 -0800 Subject: [PATCH 031/298] Track and enforce committee size in credits.aleo --- .../program/src/resources/credits.aleo | 153 +++++++++++------- 1 file changed, 94 insertions(+), 59 deletions(-) diff --git a/synthesizer/program/src/resources/credits.aleo b/synthesizer/program/src/resources/credits.aleo index 534bb4ce86..013cf52190 100644 --- a/synthesizer/program/src/resources/credits.aleo +++ b/synthesizer/program/src/resources/credits.aleo @@ -34,6 +34,16 @@ struct committee_state: /**********************************************************************************************************************/ +/// The `committee_size` mapping stores the current size of the committee at the zero index. +mapping committee_size: + // The key represents the index at which the size is stored. + // The key must **always** be `0u8`. + key as u8.public; + // The value represents the size of the committee. + value as u8.public; + +/**********************************************************************************************************************/ + // The `bonded` mapping represents the amount of microcredits that are currently bonded. mapping bonded: // The key represents the address of the staker, which includes the validators and their delegators. @@ -124,54 +134,72 @@ finalize bond_public: /* Committee */ + // Check if the validator is already in the committee. + contains committee[r1] into r4; + // If the validator is already in the committee, jump to the `continue_bond_validator` logic. + branch.eq r4 true to continue_bond_validator; + // Get the committee size. + get committee_size[0u8] into r5; + // Increment the committee size by one. + add r5 1u8 into r6; + // Determine if the committee size is less than or equal to 200. + lte r6 200u8 into r7; + // Enforce that the committee size is less than or equal to 200. + assert.eq r7 true; + // Set the new committee size. + set r6 into committee_size[0u8]; + + // Continues the rest of the `bond_validator` logic. + position continue_bond_validator; + // Construct the initial committee state. // Note: We set the initial 'is_open' state to 'true'. - cast 0u64 true into r4 as committee_state; + cast 0u64 true into r8 as committee_state; // Retrieve the committee state of the specified validator. - get.or_use committee[r0] r4 into r5; + get.or_use committee[r0] r8 into r9; // Ensure that the validator is open to stakers. - assert.eq r5.is_open true; + assert.eq r9.is_open true; // Increment the stake for the specified validator. - add r5.microcredits r2 into r6; + add r9.microcredits r2 into r10; // Construct the updated committee state. - cast r6 r5.is_open into r7 as committee_state; + cast r10 r9.is_open into r11 as committee_state; /* Bonded */ // Construct the initial bond state. - cast r1 0u64 into r8 as bond_state; + cast r1 0u64 into r12 as bond_state; // Get the bond state for the caller, or default to the initial bond state. - get.or_use bonded[r0] r8 into r9; + get.or_use bonded[r0] r12 into r13; // Enforce the validator matches in the bond state. - assert.eq r9.validator r1; + assert.eq r13.validator r1; // Increment the microcredits in the bond state. - add r9.microcredits r2 into r10; + add r9.microcredits r2 into r14; // Determine if the amount is at least one million credits. - gte r10 1_000_000_000_000u64 into r11; + gte r14 1_000_000_000_000u64 into r15; // Enforce the amount is at least one million credits. - assert.eq r11 true; + assert.eq r15 true; // Construct the updated bond state. - cast r1 r10 into r12 as bond_state; + cast r1 r14 into r16 as bond_state; /* Account */ // Get the balance of the caller. // If the account does not exist, this finalize scope will fail. - get account[r0] into r13; + get account[r0] into r17; // Decrement the balance of the caller. - sub r13 r2 into r14; + sub r17 r2 into r18; /* Writes */ // Update the committee state of the specified validator. - set r7 into committee[r0]; + set r11 into committee[r0]; // Update the bond state for the caller. - set r12 into bonded[r0]; + set r16 into bonded[r0]; // Update the balance of the caller. - set r14 into account[r0]; + set r18 into account[r0]; // Ends the `bond_validator` logic. branch.eq true true to end; @@ -184,56 +212,56 @@ finalize bond_public: /* Committee */ // Check if the caller is a validator. - contains committee[r0] into r15; + contains committee[r0] into r19; // Enforce the caller is *not* a validator. - assert.eq r15 false; + assert.eq r19 false; // Get the stake for the specified validator. // If the validator does not exist, this finalize scope will fail. - get committee[r1] into r16; + get committee[r1] into r20; // Ensure that the validator is open to stakers. - assert.eq r16.is_open true; + assert.eq r20.is_open true; // Increment the stake for the specified validator. - add r16.microcredits r2 into r17; + add r20.microcredits r2 into r21; // Construct the updated committee state. - cast r17 r16.is_open into r18 as committee_state; + cast r21 r20.is_open into r22 as committee_state; /* Bonded */ // Construct the initial bond state. - cast r1 0u64 into r19 as bond_state; + cast r1 0u64 into r23 as bond_state; // Get the bond state for the caller, or default to the initial bond state. - get.or_use bonded[r0] r19 into r20; + get.or_use bonded[r0] r23 into r24; // Enforce the validator matches in the bond state. - assert.eq r20.validator r1; + assert.eq r24.validator r1; // Increment the microcredits in the bond state. - add r20.microcredits r2 into r21; + add r24.microcredits r2 into r25; // Determine if the amount is at least 10 credits. - gte r21 10_000_000u64 into r22; + gte r25 10_000_000u64 into r26; // Enforce the amount is at least 10 credits. - assert.eq r22 true; + assert.eq r26 true; // Construct the updated bond state. - cast r1 r21 into r23 as bond_state; + cast r1 r25 into r27 as bond_state; /* Account */ // Get the balance of the caller. // If the account does not exist, this finalize scope will fail. - get account[r0] into r24; + get account[r0] into r28; // Decrement the balance of the caller. - sub r24 r2 into r25; + sub r28 r2 into r29; /* Writes */ // Update the committee state for the specified validator. - set r18 into committee[r1]; + set r22 into committee[r1]; // Update the bond state for the caller. - set r23 into bonded[r0]; + set r27 into bonded[r0]; // Update the balance of the caller. - set r25 into account[r0]; + set r29 into account[r0]; // The terminus. position end; @@ -348,6 +376,13 @@ finalize unbond_public: // Remove the validator from the committee. remove committee[r0]; + // Get the committee size. + get committee_size[0u8] into r15; + // Decrement the committee size by one. + sub r15 1u8 into r16; + // Set the new committee size. + set r16 into committee_size[0u8]; + /* Bonded */ // Remove the bond state for the validator. @@ -356,12 +391,12 @@ finalize unbond_public: /* Unbonding */ // Increment the microcredits in the unbond state. - add r3.microcredits r8.microcredits into r15; + add r3.microcredits r8.microcredits into r17; // Construct the updated unbond state. - cast r15 r4 into r16 as unbond_state; + cast r15 r4 into r18 as unbond_state; // Update the unbond state for the caller. - set r16 into unbonding[r0]; + set r18 into unbonding[r0]; // Ends the `remove_validator` logic. branch.eq true true to end; @@ -372,17 +407,17 @@ finalize unbond_public: position unbond_delegator; // Get the bond state for the caller, or fail if it does not exist. - get bonded[r0] into r17; + get bonded[r0] into r19; // Decrement the microcredits in the bond state. - sub r17.microcredits r1 into r18; + sub r19.microcredits r1 into r18; // Determine if the remaining bond is at least 10 credits. - gte r18 10_000_000u64 into r19; + gte r20 10_000_000u64 into r21; // If the remaining balance is at least 10 credits, jump to the `decrement_delegator` logic. - branch.eq r19 true to decrement_delegator; + branch.eq r21 true to decrement_delegator; // If the remaining balance is less than 10 credits, jump to the `remove_delegator` logic. - branch.eq r19 false to remove_delegator; + branch.eq r21 false to remove_delegator; /*** Decrement Delegator ***/ @@ -393,30 +428,30 @@ finalize unbond_public: // Get the stake for the specified validator. // If the validator does not exist, this finalize scope will fail. - get committee[r17.validator] into r20; + get committee[r19.validator] into r22; // Decrement the stake for the specified validator. - sub r20.microcredits r1 into r21; + sub r22.microcredits r1 into r23; // Construct the updated committee state. - cast r21 r20.is_open into r22 as committee_state; + cast r23 r22.is_open into r24 as committee_state; // Update the stake for the specified validator. - set r22 into committee[r17.validator]; + set r24 into committee[r19.validator]; /* Bonded */ // Construct the updated bond state. - cast r17.validator r18 into r23 as bond_state; + cast r19.validator r20 into r25 as bond_state; // Update the bond state for the caller. - set r23 into bonded[r0]; + set r25 into bonded[r0]; /* Unbonding */ // Increment the microcredits in the unbond state. - add r3.microcredits r1 into r24; + add r3.microcredits r1 into r26; // Construct the updated unbond state. - cast r24 r4 into r25 as unbond_state; + cast r26 r4 into r27 as unbond_state; // Update the unbond state for the caller. - set r25 into unbonding[r0]; + set r27 into unbonding[r0]; // Ends the `decrement_delegator` logic. branch.eq true true to end; @@ -430,13 +465,13 @@ finalize unbond_public: // Get the stake for the specified validator. // If the validator does not exist, this finalize scope will fail. - get committee[r17.validator] into r26; + get committee[r19.validator] into r28; // Decrement the stake for the specified validator. - sub r26.microcredits r17.microcredits into r27; + sub r28.microcredits r19.microcredits into r29; // Construct the updated committee state. - cast r27 r26.is_open into r28 as committee_state; + cast r29 r28.is_open into r30 as committee_state; // Update the stake for the specified validator. - set r28 into committee[r17.validator]; + set r30 into committee[r19.validator]; /* Bonded */ @@ -446,12 +481,12 @@ finalize unbond_public: /* Unbonding */ // Increment the microcredits in the unbond state. - add r3.microcredits r17.microcredits into r29; + add r3.microcredits r19.microcredits into r31; // Construct the updated unbond state. - cast r29 r4 into r30 as unbond_state; + cast r31 r4 into r32 as unbond_state; // Update the unbond state for the caller. - set r30 into unbonding[r0]; + set r32 into unbonding[r0]; // The terminus. position end; From 96b3934e18c4077cd4c102e1a33c40200d462fca Mon Sep 17 00:00:00 2001 From: Pranav Gaddamadugu <23022326+d0cd@users.noreply.github.com> Date: Mon, 27 Nov 2023 16:59:13 -0800 Subject: [PATCH 032/298] Fix typos --- synthesizer/program/src/resources/credits.aleo | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/synthesizer/program/src/resources/credits.aleo b/synthesizer/program/src/resources/credits.aleo index 013cf52190..3cc7ac5f7f 100644 --- a/synthesizer/program/src/resources/credits.aleo +++ b/synthesizer/program/src/resources/credits.aleo @@ -394,7 +394,7 @@ finalize unbond_public: add r3.microcredits r8.microcredits into r17; // Construct the updated unbond state. - cast r15 r4 into r18 as unbond_state; + cast r17 r4 into r18 as unbond_state; // Update the unbond state for the caller. set r18 into unbonding[r0]; @@ -409,7 +409,7 @@ finalize unbond_public: // Get the bond state for the caller, or fail if it does not exist. get bonded[r0] into r19; // Decrement the microcredits in the bond state. - sub r19.microcredits r1 into r18; + sub r19.microcredits r1 into r20; // Determine if the remaining bond is at least 10 credits. gte r20 10_000_000u64 into r21; From 1c593a55a72e141aa211872a55612f96766925eb Mon Sep 17 00:00:00 2001 From: raychu86 <14917648+raychu86@users.noreply.github.com> Date: Mon, 27 Nov 2023 21:19:47 -0500 Subject: [PATCH 033/298] Implement size_in_bits for LiteralType --- .../src/data_types/literal_type/mod.rs | 3 ++ .../data_types/literal_type/size_in_bits.rs | 41 +++++++++++++++++++ 2 files changed, 44 insertions(+) create mode 100644 console/program/src/data_types/literal_type/size_in_bits.rs diff --git a/console/program/src/data_types/literal_type/mod.rs b/console/program/src/data_types/literal_type/mod.rs index cb5e4dae49..868942afbf 100644 --- a/console/program/src/data_types/literal_type/mod.rs +++ b/console/program/src/data_types/literal_type/mod.rs @@ -15,8 +15,11 @@ mod bytes; mod parse; mod serialize; +mod size_in_bits; +use snarkvm_console_account::Signature; use snarkvm_console_network::prelude::*; +use snarkvm_console_types::{prelude::*, Boolean}; use core::fmt::{self, Debug, Display}; use num_derive::FromPrimitive; diff --git a/console/program/src/data_types/literal_type/size_in_bits.rs b/console/program/src/data_types/literal_type/size_in_bits.rs new file mode 100644 index 0000000000..4e6fd24b56 --- /dev/null +++ b/console/program/src/data_types/literal_type/size_in_bits.rs @@ -0,0 +1,41 @@ +// Copyright (C) 2019-2023 Aleo Systems Inc. +// This file is part of the snarkVM library. + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at: +// http://www.apache.org/licenses/LICENSE-2.0 + +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +use super::*; + +impl LiteralType { + /// Returns the number of bits of this literal. + pub fn size_in_bits(&self) -> usize { + match self { + Self::Address => Address::::size_in_bits(), + Self::Boolean => Boolean::::size_in_bits(), + Self::Field => Field::::size_in_bits(), + Self::Group => Group::::size_in_bits(), + Self::I8 => I8::::size_in_bits(), + Self::I16 => I16::::size_in_bits(), + Self::I32 => I32::::size_in_bits(), + Self::I64 => I64::::size_in_bits(), + Self::I128 => I128::::size_in_bits(), + Self::U8 => U8::::size_in_bits(), + Self::U16 => U16::::size_in_bits(), + Self::U32 => U32::::size_in_bits(), + Self::U64 => U64::::size_in_bits(), + Self::U128 => U128::::size_in_bits(), + Self::Scalar => Scalar::::size_in_bits(), + Self::Signature => Signature::::size_in_bits(), + // TODO (raychu86): This uses the maximum size of a string, but it should be the size of the string literal. + Self::String => N::MAX_STRING_BYTES.saturating_mul(8) as usize, + } + } +} From fa250976c5f1d5763d2b22a1c4898304c650d1c1 Mon Sep 17 00:00:00 2001 From: raychu86 <14917648+raychu86@users.noreply.github.com> Date: Mon, 27 Nov 2023 21:57:07 -0500 Subject: [PATCH 034/298] Finalize SET fees based on storage size --- synthesizer/src/vm/helpers/cost.rs | 277 ++++++++++++++++++++++++++++- 1 file changed, 271 insertions(+), 6 deletions(-) diff --git a/synthesizer/src/vm/helpers/cost.rs b/synthesizer/src/vm/helpers/cost.rs index 6f349baa84..9a1767a456 100644 --- a/synthesizer/src/vm/helpers/cost.rs +++ b/synthesizer/src/vm/helpers/cost.rs @@ -12,14 +12,17 @@ // See the License for the specific language governing permissions and // limitations under the License. -use crate::VM; +use crate::{ + prelude::{Stack, StackProgramTypes}, + VM, +}; use console::{ prelude::*, - program::{LiteralType, PlaintextType}, + program::{FinalizeType, LiteralType, PlaintextType}, }; use ledger_block::{Deployment, Execution}; use ledger_store::ConsensusStorage; -use synthesizer_program::{Command, Finalize, Instruction}; +use synthesizer_program::{Command, Finalize, Instruction, Operand, StackProgram}; use std::collections::HashMap; @@ -80,7 +83,7 @@ pub fn execution_cost>( let program = lookup.get(program_id).ok_or(anyhow!("Program '{program_id}' is missing"))?; // Retrieve the finalize cost. let cost = match program.get_function(function_name)?.finalize_logic() { - Some(finalize) => cost_in_microcredits(finalize)?, + Some(finalize) => cost_in_microcredits(vm.process().read().get_stack(program.id())?, finalize)?, None => continue, }; // Accumulate the finalize cost. @@ -98,7 +101,65 @@ pub fn execution_cost>( } /// Returns the minimum number of microcredits required to run the finalize. -pub fn cost_in_microcredits(finalize: &Finalize) -> Result { +pub fn cost_in_microcredits(stack: &Stack, finalize: &Finalize) -> Result { + // Retrieve the finalize types. + let finalize_types = stack.get_finalize_types(finalize.name())?; + + // Helper function to get the plaintext type in bytes + fn plaintext_size_in_bytes(stack: &Stack, plaintext_type: &PlaintextType) -> Result { + match plaintext_type { + PlaintextType::Literal(literal_type) => { + // Retrieve the literal size in bits. + let literal_size_in_bits = literal_type.size_in_bits::() as u64; + + // Compute the size in bytes. + let literal_size_in_bytes = literal_size_in_bits.saturating_add(7).saturating_div(8); + + // Return the size of the literal. + Ok(literal_size_in_bytes) + } + PlaintextType::Struct(struct_identifier) => { + // Retrieve the struct from the stack. + let plaintext_struct = stack.program().get_struct(struct_identifier)?; + + // Retrieve the size of the struct identifier. + let identifier_size = plaintext_struct.name().to_bytes_le()?.len() as u64; + + // Retrieve the size of all the members of the struct. + let size_of_members = plaintext_struct + .members() + .iter() + .map(|(_, member_type)| plaintext_size_in_bytes(stack, member_type)) + .sum::>()?; + + // Return the size of the struct. + Ok(identifier_size.saturating_add(size_of_members)) + } + PlaintextType::Array(array_type) => { + // Retrieve the number of elements in the array + let num_array_elements = **array_type.length() as u64; + + // Retrieve the size of the internal array types. + Ok(num_array_elements.saturating_mul(plaintext_size_in_bytes(stack, array_type.next_element_type())?)) + } + } + } + + // Helper function to get the size of the operand type. + let operand_size_in_bytes = |operand: &Operand| { + // Get the finalize type from the operand. + let finalize_type = finalize_types.get_type_from_operand(stack, operand)?; + + // Get the plaintext type from the finalize type. + let plaintext_type = match finalize_type { + FinalizeType::Plaintext(plaintext_type) => plaintext_type, + FinalizeType::Future(_) => bail!("`Future` types are not supported in storage cost computation."), + }; + + // Get the size of the operand type. + plaintext_size_in_bytes(stack, &plaintext_type) + }; + // Defines the cost of each command. let cost = |command: &Command| match command { Command::Instruction(Instruction::Abs(_)) => Ok(2_000), @@ -195,7 +256,21 @@ pub fn cost_in_microcredits(finalize: &Finalize) -> Result { Command::GetOrUse(_) => Ok(25_000), Command::RandChaCha(_) => Ok(25_000), Command::Remove(_) => Ok(10_000), - Command::Set(_) => Ok(100_000), + Command::Set(set) => { + // TODO (raychu86): Adjust this multiplier. + // The cost in microcredits per byte of storage used by the `set` command. + const SET_COMMAND_BYTE_MULTIPLIER: u64 = 1000; + + // Get the size in bytes of the key and value types. + let key_size_in_bytes = operand_size_in_bytes(set.key())?; + let value_size_in_bytes = operand_size_in_bytes(set.value())?; + + // Calculate the size in bytes of the key and value. + let stored_size_in_bytes = key_size_in_bytes.saturating_add(value_size_in_bytes); + + // Calculate the cost. + Ok(stored_size_in_bytes.saturating_mul(SET_COMMAND_BYTE_MULTIPLIER)) + } Command::BranchEq(_) | Command::BranchNeq(_) => Ok(5_000), Command::Position(_) => Ok(1_000), }; @@ -205,3 +280,193 @@ pub fn cost_in_microcredits(finalize: &Finalize) -> Result { .map(cost) .try_fold(0u64, |acc, res| res.and_then(|x| acc.checked_add(x).ok_or(anyhow!("Finalize cost overflowed")))) } + +#[cfg(test)] +mod tests { + use super::*; + use crate::{vm::test_helpers::CurrentNetwork, Process, Program}; + use circuit::network::AleoV0; + use console::program::Identifier; + + #[test] + fn test_credits_finalize_costs() { + // Get the credits.aleo program. + let program = Program::::credits().unwrap(); + + // Load the process. + let process = Process::::load().unwrap(); + + // Get the stack. + let stack = process.get_stack(program.id()).unwrap(); + + // Function: `bond_public` + let function = program.get_function(&Identifier::from_str("bond_public").unwrap()).unwrap(); + let finalize_cost = cost_in_microcredits(stack, function.finalize_logic().unwrap()).unwrap(); + assert_eq!(602500, finalize_cost); + + // Function: `unbond_public` + let function = program.get_function(&Identifier::from_str("unbond_public").unwrap()).unwrap(); + let finalize_cost = cost_in_microcredits(stack, function.finalize_logic().unwrap()).unwrap(); + assert_eq!(897500, finalize_cost); + + // Function: `unbond_delegator_as_validator` + let function = program.get_function(&Identifier::from_str("unbond_delegator_as_validator").unwrap()).unwrap(); + let finalize_cost = cost_in_microcredits(stack, function.finalize_logic().unwrap()).unwrap(); + assert_eq!(237500, finalize_cost); + + // Function `claim_unbond_public` + let function = program.get_function(&Identifier::from_str("claim_unbond_public").unwrap()).unwrap(); + let finalize_cost = cost_in_microcredits(stack, function.finalize_logic().unwrap()).unwrap(); + assert_eq!(106000, finalize_cost); + + // Function `set_validator_state` + let function = program.get_function(&Identifier::from_str("set_validator_state").unwrap()).unwrap(); + let finalize_cost = cost_in_microcredits(stack, function.finalize_logic().unwrap()).unwrap(); + assert_eq!(84000, finalize_cost); + + // Function: `transfer_public` + let function = program.get_function(&Identifier::from_str("transfer_public").unwrap()).unwrap(); + let finalize_cost = cost_in_microcredits(stack, function.finalize_logic().unwrap()).unwrap(); + assert_eq!(142000, finalize_cost); + + // Function: `transfer_private` + let function = program.get_function(&Identifier::from_str("transfer_private").unwrap()).unwrap(); + assert!(function.finalize_logic().is_none()); + + // Function: `transfer_private_to_public` + let function = program.get_function(&Identifier::from_str("transfer_private_to_public").unwrap()).unwrap(); + let finalize_cost = cost_in_microcredits(stack, function.finalize_logic().unwrap()).unwrap(); + assert_eq!(67000, finalize_cost); + + // Function: `transfer_public_to_private` + let function = program.get_function(&Identifier::from_str("transfer_public_to_private").unwrap()).unwrap(); + let finalize_cost = cost_in_microcredits(stack, function.finalize_logic().unwrap()).unwrap(); + assert_eq!(75000, finalize_cost); + + // Function: `join` + let function = program.get_function(&Identifier::from_str("join").unwrap()).unwrap(); + assert!(function.finalize_logic().is_none()); + + // Function: `split` + let function = program.get_function(&Identifier::from_str("split").unwrap()).unwrap(); + assert!(function.finalize_logic().is_none()); + + // Function: `fee_private` + let function = program.get_function(&Identifier::from_str("fee_private").unwrap()).unwrap(); + assert!(function.finalize_logic().is_none()); + + // Function: `fee_public` + let function = program.get_function(&Identifier::from_str("fee_public").unwrap()).unwrap(); + let finalize_cost = cost_in_microcredits(stack, function.finalize_logic().unwrap()).unwrap(); + assert_eq!(75000, finalize_cost); + } + + #[test] + fn test_finalize_costs_structs() { + let rng = &mut TestRng::default(); + + // Define a program + let program_str = r" +program test_program.aleo; +struct small: + a as u64; + b as u64; + c as u64; +struct medium: + a as small; + b as small; + c as small; +struct large: + a as medium; + b as medium; + c as medium; +struct xlarge: + a as large; + b as large; + c as large; +mapping storage_small: + key as u64.public; + value as small.public; +mapping storage_medium: + key as u64.public; + value as medium.public; +mapping storage_large: + key as u64.public; + value as large.public; +mapping storage_xlarge: + key as u64.public; + value as xlarge.public; +function store_small: + input r0 as u64.public; + input r1 as small.public; + async store_small r0 r1 into r2; + output r2 as test_program.aleo/store_small.future; +finalize store_small: + input r0 as u64.public; + input r1 as small.public; + set r1 into storage_small[r0]; +function store_medium: + input r0 as u64.public; + input r1 as medium.public; + async store_medium r0 r1 into r2; + output r2 as test_program.aleo/store_medium.future; +finalize store_medium: + input r0 as u64.public; + input r1 as medium.public; + set r1 into storage_medium[r0]; +function store_large: + input r0 as u64.public; + input r1 as large.public; + async store_large r0 r1 into r2; + output r2 as test_program.aleo/store_large.future; +finalize store_large: + input r0 as u64.public; + input r1 as large.public; + set r1 into storage_large[r0]; +function store_xlarge: + input r0 as u64.public; + input r1 as xlarge.public; + async store_xlarge r0 r1 into r2; + output r2 as test_program.aleo/store_xlarge.future; +finalize store_xlarge: + input r0 as u64.public; + input r1 as xlarge.public; + set r1 into storage_xlarge[r0]; + "; + + // Compile the program. + let program = Program::::from_str(program_str).unwrap(); + + // Load the process. + let mut process = Process::::load().unwrap(); + + // Deploy and load the program. + let deployment = process.deploy::(&program, rng).unwrap(); + process.load_deployment(&deployment).unwrap(); + + // Get the stack. + let stack = process.get_stack(program.id()).unwrap(); + + // Test the price of each execution. + + // Function: `store_small` + let function = program.get_function(&Identifier::from_str("store_small").unwrap()).unwrap(); + let finalize_cost = cost_in_microcredits(stack, function.finalize_logic().unwrap()).unwrap(); + assert_eq!(38000, finalize_cost); + + // Function: `store_medium` + let function = program.get_function(&Identifier::from_str("store_medium").unwrap()).unwrap(); + let finalize_cost = cost_in_microcredits(stack, function.finalize_logic().unwrap()).unwrap(); + assert_eq!(105000, finalize_cost); + + // Function: `store_large` + let function = program.get_function(&Identifier::from_str("store_large").unwrap()).unwrap(); + let finalize_cost = cost_in_microcredits(stack, function.finalize_logic().unwrap()).unwrap(); + assert_eq!(305000, finalize_cost); + + // Function: `store_xlarge` + let function = program.get_function(&Identifier::from_str("store_xlarge").unwrap()).unwrap(); + let finalize_cost = cost_in_microcredits(stack, function.finalize_logic().unwrap()).unwrap(); + assert_eq!(906000, finalize_cost); + } +} From 5242e207a1dfe8d5c76309f9a0d529f3dd09fd82 Mon Sep 17 00:00:00 2001 From: Pranav Gaddamadugu <23022326+d0cd@users.noreply.github.com> Date: Mon, 27 Nov 2023 22:32:30 -0800 Subject: [PATCH 035/298] Add tests --- synthesizer/src/vm/helpers/cost.rs | 164 +++++++++++++++++++++++++++++ 1 file changed, 164 insertions(+) diff --git a/synthesizer/src/vm/helpers/cost.rs b/synthesizer/src/vm/helpers/cost.rs index 9a1767a456..f31bfc471d 100644 --- a/synthesizer/src/vm/helpers/cost.rs +++ b/synthesizer/src/vm/helpers/cost.rs @@ -469,4 +469,168 @@ finalize store_xlarge: let finalize_cost = cost_in_microcredits(stack, function.finalize_logic().unwrap()).unwrap(); assert_eq!(906000, finalize_cost); } + + #[test] + fn test_finalize_costs_arrays() { + let rng = &mut TestRng::default(); + + // Define a program + let program_str = r" +program test_program.aleo; +mapping storage_small: + key as u64.public; + value as [boolean; 8u32].public; +mapping storage_medium: + key as u64.public; + value as [[boolean; 8u32]; 8u32].public; +mapping storage_large: + key as u64.public; + value as [[[boolean; 8u32]; 8u32]; 8u32].public; +mapping storage_xlarge: + key as u64.public; + value as [[[[boolean; 8u32]; 8u32]; 8u32]; 8u32].public; +function store_small: + input r0 as u64.public; + input r1 as [boolean; 8u32].public; + async store_small r0 r1 into r2; + output r2 as test_program.aleo/store_small.future; +finalize store_small: + input r0 as u64.public; + input r1 as [boolean; 8u32].public; + set r1 into storage_small[r0]; +function store_medium: + input r0 as u64.public; + input r1 as [[boolean; 8u32]; 8u32].public; + async store_medium r0 r1 into r2; + output r2 as test_program.aleo/store_medium.future; +finalize store_medium: + input r0 as u64.public; + input r1 as [[boolean; 8u32]; 8u32].public; + set r1 into storage_medium[r0]; +function store_large: + input r0 as u64.public; + input r1 as [[[boolean; 8u32]; 8u32]; 8u32].public; + async store_large r0 r1 into r2; + output r2 as test_program.aleo/store_large.future; +finalize store_large: + input r0 as u64.public; + input r1 as [[[boolean; 8u32]; 8u32]; 8u32].public; + set r1 into storage_large[r0]; +function store_xlarge: + input r0 as u64.public; + input r1 as [[[[boolean; 8u32]; 8u32]; 8u32]; 8u32].public; + async store_xlarge r0 r1 into r2; + output r2 as test_program.aleo/store_xlarge.future; +finalize store_xlarge: + input r0 as u64.public; + input r1 as [[[[boolean; 8u32]; 8u32]; 8u32]; 8u32].public; + set r1 into storage_xlarge[r0]; + "; + + // Compile the program. + let program = Program::::from_str(program_str).unwrap(); + + // Load the process. + let mut process = Process::::load().unwrap(); + + // Deploy and load the program. + let deployment = process.deploy::(&program, rng).unwrap(); + process.load_deployment(&deployment).unwrap(); + + // Get the stack. + let stack = process.get_stack(program.id()).unwrap(); + + // Test the price of each execution. + + // Function: `store_small` + let function = program.get_function(&Identifier::from_str("store_small").unwrap()).unwrap(); + let finalize_cost = cost_in_microcredits(stack, function.finalize_logic().unwrap()).unwrap(); + assert_eq!(16000, finalize_cost); + + // Function: `store_medium` + let function = program.get_function(&Identifier::from_str("store_medium").unwrap()).unwrap(); + let finalize_cost = cost_in_microcredits(stack, function.finalize_logic().unwrap()).unwrap(); + assert_eq!(72000, finalize_cost); + + // Function: `store_large` + let function = program.get_function(&Identifier::from_str("store_large").unwrap()).unwrap(); + let finalize_cost = cost_in_microcredits(stack, function.finalize_logic().unwrap()).unwrap(); + assert_eq!(520000, finalize_cost); + + // Function: `store_xlarge` + let function = program.get_function(&Identifier::from_str("store_xlarge").unwrap()).unwrap(); + let finalize_cost = cost_in_microcredits(stack, function.finalize_logic().unwrap()).unwrap(); + assert_eq!(4104000, finalize_cost); + } + + #[test] + fn test_finalize_costs_big_finalize() { + let rng = &mut TestRng::default(); + + // Define a program + let program_str = r" +program test_program.aleo; +mapping big_map: + key as u128.public; + value as [[[u8; 32u32]; 32u32]; 32u32].public; +function big_finalize: + async big_finalize into r0; + output r0 as test_program.aleo/big_finalize.future; +finalize big_finalize: + rand.chacha into r0 as u128; + cast 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 into r1 as [u8; 32u32]; + cast r1 r1 r1 r1 r1 r1 r1 r1 r1 r1 r1 r1 r1 r1 r1 r1 r1 r1 r1 r1 r1 r1 r1 r1 r1 r1 r1 r1 r1 r1 r1 r1 into r2 as [[u8; 32u32]; 32u32]; + cast r2 r2 r2 r2 r2 r2 r2 r2 r2 r2 r2 r2 r2 r2 r2 r2 r2 r2 r2 r2 r2 r2 r2 r2 r2 r2 r2 r2 r2 r2 r2 r2 into r3 as [[[u8; 32u32]; 32u32]; 32u32]; + add.w r0 0u128 into r4; + set r3 into big_map[r4]; + add.w r0 1u128 into r5; + set r3 into big_map[r5]; + add.w r0 2u128 into r6; + set r3 into big_map[r6]; + add.w r0 3u128 into r7; + set r3 into big_map[r7]; + add.w r0 4u128 into r8; + set r3 into big_map[r8]; + add.w r0 5u128 into r9; + set r3 into big_map[r9]; + add.w r0 6u128 into r10; + set r3 into big_map[r10]; + add.w r0 7u128 into r11; + set r3 into big_map[r11]; + add.w r0 8u128 into r12; + set r3 into big_map[r12]; + add.w r0 9u128 into r13; + set r3 into big_map[r13]; + add.w r0 10u128 into r14; + set r3 into big_map[r14]; + add.w r0 11u128 into r15; + set r3 into big_map[r15]; + add.w r0 12u128 into r16; + set r3 into big_map[r16]; + add.w r0 13u128 into r17; + set r3 into big_map[r17]; + add.w r0 14u128 into r18; + set r3 into big_map[r18]; + add.w r0 15u128 into r19; + set r3 into big_map[r19]; + "; + + // Compile the program. + let program = Program::::from_str(program_str).unwrap(); + + // Load the process. + let mut process = Process::::load().unwrap(); + + // Deploy and load the program. + let deployment = process.deploy::(&program, rng).unwrap(); + process.load_deployment(&deployment).unwrap(); + + // Get the stack. + let stack = process.get_stack(program.id()).unwrap(); + + // Test the price of `big_finalize`. + let function = program.get_function(&Identifier::from_str("big_finalize").unwrap()).unwrap(); + let finalize_cost = cost_in_microcredits(stack, function.finalize_logic().unwrap()).unwrap(); + assert_eq!(524_607_000, finalize_cost); + } } From 15f81693759486057bc9dbf208f361efb8ca71c0 Mon Sep 17 00:00:00 2001 From: raychu86 <14917648+raychu86@users.noreply.github.com> Date: Tue, 28 Nov 2023 17:23:06 -0500 Subject: [PATCH 036/298] Rewrite expectations --- .../vm/execute_and_finalize/complex_finalization.out | 2 +- .../expectations/vm/execute_and_finalize/count_usages.out | 2 +- .../vm/execute_and_finalize/mapping_operations.out | 6 +++--- .../expectations/vm/execute_and_finalize/public_wallet.out | 2 +- .../vm/execute_and_finalize/read_external_mapping.out | 4 ++-- .../expectations/vm/execute_and_finalize/test_rand.out | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/synthesizer/tests/expectations/vm/execute_and_finalize/complex_finalization.out b/synthesizer/tests/expectations/vm/execute_and_finalize/complex_finalization.out index d413523f61..3d334c70e9 100644 --- a/synthesizer/tests/expectations/vm/execute_and_finalize/complex_finalization.out +++ b/synthesizer/tests/expectations/vm/execute_and_finalize/complex_finalization.out @@ -23,4 +23,4 @@ additional: - '{"type":"future","id":"6324349534667114127832388996854882573236888808429320919855235417654165379333field","value":"{\n program_id: three_program.aleo,\n function_name: e,\n arguments: [\n {\n program_id: two_program.aleo,\n function_name: b,\n arguments: [\n {\n program_id: zero_program.aleo,\n function_name: c,\n arguments: [\n aleo1kw4knandael9qcpxs6g36rr6h7dwvjz6q25ueah6zz9v57zjlvxsx5llq8\n ]\n },\n {\n program_id: one_program.aleo,\n function_name: d,\n arguments: [\n aleo1kw4knandael9qcpxs6g36rr6h7dwvjz6q25ueah6zz9v57zjlvxsx5llq8\n ]\n },\n aleo1kw4knandael9qcpxs6g36rr6h7dwvjz6q25ueah6zz9v57zjlvxsx5llq8\n ]\n },\n {\n program_id: one_program.aleo,\n function_name: d,\n arguments: [\n aleo1kw4knandael9qcpxs6g36rr6h7dwvjz6q25ueah6zz9v57zjlvxsx5llq8\n ]\n },\n {\n program_id: zero_program.aleo,\n function_name: c,\n arguments: [\n aleo1kw4knandael9qcpxs6g36rr6h7dwvjz6q25ueah6zz9v57zjlvxsx5llq8\n ]\n },\n aleo1kw4knandael9qcpxs6g36rr6h7dwvjz6q25ueah6zz9v57zjlvxsx5llq8\n ]\n}"}' credits.aleo/fee_public: outputs: - - '{"type":"future","id":"2642525527921148655203140665689909230400981948693155278410222306693462629362field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1kw4knandael9qcpxs6g36rr6h7dwvjz6q25ueah6zz9v57zjlvxsx5llq8,\n 1312883u64\n ]\n}"}' + - '{"type":"future","id":"1003216346885695376870169458907160355062312400269389091484793100175598845653field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1kw4knandael9qcpxs6g36rr6h7dwvjz6q25ueah6zz9v57zjlvxsx5llq8,\n 712883u64\n ]\n}"}' diff --git a/synthesizer/tests/expectations/vm/execute_and_finalize/count_usages.out b/synthesizer/tests/expectations/vm/execute_and_finalize/count_usages.out index bc0c5af71d..812dccf919 100644 --- a/synthesizer/tests/expectations/vm/execute_and_finalize/count_usages.out +++ b/synthesizer/tests/expectations/vm/execute_and_finalize/count_usages.out @@ -20,4 +20,4 @@ additional: - '{"type":"future","id":"4663027849889985446453275863200868545411574358675486387787337708909316167962field","value":"{\n program_id: basic_math.aleo,\n function_name: sub_and_count,\n arguments: [\n aleo1mrughg5ssadd9fc2uwve7l6u24xn76kyz24zsjtzta03vgkq4vpqggl6fg\n ]\n}"}' credits.aleo/fee_public: outputs: - - '{"type":"future","id":"3084534457419184182612834880575828543753579447019853593724174249884664876235field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1kw4knandael9qcpxs6g36rr6h7dwvjz6q25ueah6zz9v57zjlvxsx5llq8,\n 263392u64\n ]\n}"}' + - '{"type":"future","id":"6985362900212603644551686892600867999486376242303585232041632704681627259499field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1kw4knandael9qcpxs6g36rr6h7dwvjz6q25ueah6zz9v57zjlvxsx5llq8,\n 143392u64\n ]\n}"}' diff --git a/synthesizer/tests/expectations/vm/execute_and_finalize/mapping_operations.out b/synthesizer/tests/expectations/vm/execute_and_finalize/mapping_operations.out index 6b2773e6cf..0fed322828 100644 --- a/synthesizer/tests/expectations/vm/execute_and_finalize/mapping_operations.out +++ b/synthesizer/tests/expectations/vm/execute_and_finalize/mapping_operations.out @@ -36,12 +36,12 @@ additional: - child_outputs: credits.aleo/fee_public: outputs: - - '{"type":"future","id":"767852843394263062723803642109980847781175859546892255347263461730875281315field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1eakarna6a70pg9r0l9qal20faejwctgur5xt7lnc2a42wj2yssfqc89rk8,\n 154810u64\n ]\n}"}' + - '{"type":"future","id":"5492905059437618366315175771112666246009652456224371187043657574203689511771field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1eakarna6a70pg9r0l9qal20faejwctgur5xt7lnc2a42wj2yssfqc89rk8,\n 56810u64\n ]\n}"}' - child_outputs: credits.aleo/fee_public: outputs: - - '{"type":"future","id":"5831877738131393412656336446760308055442933218729238434398743654782252530700field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1eakarna6a70pg9r0l9qal20faejwctgur5xt7lnc2a42wj2yssfqc89rk8,\n 154810u64\n ]\n}"}' + - '{"type":"future","id":"1619381297841458647844879660108283659411957164827472701126495305911845966515field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1eakarna6a70pg9r0l9qal20faejwctgur5xt7lnc2a42wj2yssfqc89rk8,\n 56810u64\n ]\n}"}' - child_outputs: credits.aleo/fee_public: outputs: - - '{"type":"future","id":"3924911723698610328779426182874581891939297874519691347932588542992608923909field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1eakarna6a70pg9r0l9qal20faejwctgur5xt7lnc2a42wj2yssfqc89rk8,\n 154810u64\n ]\n}"}' + - '{"type":"future","id":"7570456544657971579817904744342961494960811049540321970948562312143091998181field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1eakarna6a70pg9r0l9qal20faejwctgur5xt7lnc2a42wj2yssfqc89rk8,\n 56810u64\n ]\n}"}' diff --git a/synthesizer/tests/expectations/vm/execute_and_finalize/public_wallet.out b/synthesizer/tests/expectations/vm/execute_and_finalize/public_wallet.out index cbb7f2d77c..2f27505a44 100644 --- a/synthesizer/tests/expectations/vm/execute_and_finalize/public_wallet.out +++ b/synthesizer/tests/expectations/vm/execute_and_finalize/public_wallet.out @@ -14,4 +14,4 @@ additional: - '{"type":"future","id":"2095235103073153862497986952383880687050623273703041876358116424903602929020field","value":"{\n program_id: token.aleo,\n function_name: mint_public,\n arguments: [\n aleo1sry3pke49ykrf0aeshf889tr98r4c86p5f4ms766795ssdwfdyqq9jdg0j,\n 10u64\n ]\n}"}' credits.aleo/fee_public: outputs: - - '{"type":"future","id":"4373249435479943424484888940718424132561120812144078253060284512525421799293field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1d3e2je2m2hsxwdsvntvf4jnnlj459ywfry6ch2qwrpy6l6r6yvpq8e88h5,\n 131201u64\n ]\n}"}' + - '{"type":"future","id":"752603519355388488344541941006084587989070851840045134266360370597355180437field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1d3e2je2m2hsxwdsvntvf4jnnlj459ywfry6ch2qwrpy6l6r6yvpq8e88h5,\n 71201u64\n ]\n}"}' diff --git a/synthesizer/tests/expectations/vm/execute_and_finalize/read_external_mapping.out b/synthesizer/tests/expectations/vm/execute_and_finalize/read_external_mapping.out index a729b3163e..83f288f724 100644 --- a/synthesizer/tests/expectations/vm/execute_and_finalize/read_external_mapping.out +++ b/synthesizer/tests/expectations/vm/execute_and_finalize/read_external_mapping.out @@ -58,7 +58,7 @@ additional: - child_outputs: credits.aleo/fee_public: outputs: - - '{"type":"future","id":"786151097471386478439918490898626420968604200995134718973623517242949574field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1f6eg623knp66cwx0926w3plgdgzcmfpgyrzgnjz90mucgs3z7s9qls4upm,\n 101210u64\n ]\n}"}' + - '{"type":"future","id":"4798782098680099470248294668059347661300087988012655978338556209977486754623field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1f6eg623knp66cwx0926w3plgdgzcmfpgyrzgnjz90mucgs3z7s9qls4upm,\n 34210u64\n ]\n}"}' - child_outputs: credits.aleo/fee_public: outputs: @@ -66,7 +66,7 @@ additional: - child_outputs: credits.aleo/fee_public: outputs: - - '{"type":"future","id":"5340444358291789813118792762028331134214990505407681376089964565359528622453field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1f6eg623knp66cwx0926w3plgdgzcmfpgyrzgnjz90mucgs3z7s9qls4upm,\n 101214u64\n ]\n}"}' + - '{"type":"future","id":"2726390131420083267342010856698473010970750552488908118155270428634427391060field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1f6eg623knp66cwx0926w3plgdgzcmfpgyrzgnjz90mucgs3z7s9qls4upm,\n 34214u64\n ]\n}"}' - child_outputs: credits.aleo/fee_public: outputs: diff --git a/synthesizer/tests/expectations/vm/execute_and_finalize/test_rand.out b/synthesizer/tests/expectations/vm/execute_and_finalize/test_rand.out index 4fefc62cfd..b632f5d939 100644 --- a/synthesizer/tests/expectations/vm/execute_and_finalize/test_rand.out +++ b/synthesizer/tests/expectations/vm/execute_and_finalize/test_rand.out @@ -19,7 +19,7 @@ outputs: test_rand.aleo/rand_chacha_check: outputs: - '{"type":"future","id":"3721325135151760660773959530505944451747681933722462808964783147996869797702field","value":"{\n program_id: test_rand.aleo,\n function_name: rand_chacha_check,\n arguments: [\n 0field,\n false\n ]\n}"}' - speculate: the execution was accepted + speculate: the execution was rejected add_next_block: succeeded. - verified: true execute: From 65ee7c9852d38828ca7a24567ad7706ea2278510 Mon Sep 17 00:00:00 2001 From: raychu86 <14917648+raychu86@users.noreply.github.com> Date: Thu, 30 Nov 2023 16:31:03 -0500 Subject: [PATCH 037/298] Use weighted median timestamp for subdags --- Cargo.lock | 1 + ledger/narwhal/subdag/Cargo.toml | 5 ++++ ledger/narwhal/subdag/src/lib.rs | 39 +++++++++++++++++++++++++------- 3 files changed, 37 insertions(+), 8 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 30dbab2ec4..534faa0223 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3264,6 +3264,7 @@ dependencies = [ "rayon", "serde_json", "snarkvm-console", + "snarkvm-ledger-committee", "snarkvm-ledger-narwhal-batch-certificate", "snarkvm-ledger-narwhal-batch-header", "snarkvm-ledger-narwhal-subdag", diff --git a/ledger/narwhal/subdag/Cargo.toml b/ledger/narwhal/subdag/Cargo.toml index 67d87d0544..b21a2e84ae 100644 --- a/ledger/narwhal/subdag/Cargo.toml +++ b/ledger/narwhal/subdag/Cargo.toml @@ -44,6 +44,11 @@ package = "snarkvm-ledger-narwhal-batch-header" path = "../batch-header" version = "=0.16.12" +[dependencies.ledger-committee] +package = "snarkvm-ledger-committee" +path = "../../committee" +version = "=0.16.12" + [dependencies.narwhal-transmission-id] package = "snarkvm-ledger-narwhal-transmission-id" path = "../transmission-id" diff --git a/ledger/narwhal/subdag/src/lib.rs b/ledger/narwhal/subdag/src/lib.rs index e1d26ffb2f..7cff50bc0a 100644 --- a/ledger/narwhal/subdag/src/lib.rs +++ b/ledger/narwhal/subdag/src/lib.rs @@ -20,6 +20,7 @@ mod serialize; mod string; use console::{account::Address, prelude::*, program::SUBDAG_CERTIFICATES_DEPTH, types::Field}; +use ledger_committee::Committee; use narwhal_batch_certificate::BatchCertificate; use narwhal_batch_header::BatchHeader; use narwhal_transmission_id::TransmissionID; @@ -141,20 +142,42 @@ impl Subdag { self.values().flatten().flat_map(BatchCertificate::transmission_ids) } - /// Returns the timestamp of the anchor round, defined as the median timestamp of the subdag. - pub fn timestamp(&self) -> i64 { + /// Returns the timestamp of the anchor round, defined as the weighted median timestamp of the subdag. + pub fn timestamp(&self, committee: &Committee) -> i64 { match self.leader_certificate() { BatchCertificate::V1 { .. } => self.leader_certificate().timestamp(), BatchCertificate::V2 { .. } => { - // Retrieve the timestamps of the certificates. - let mut timestamps = self.values().flatten().map(BatchCertificate::timestamp).collect::>(); + // Retrieve the timestamps and stakes of the certificates. + let mut timestamps = self + .values() + .flatten() + .map(|certificate| (certificate.timestamp(), committee.get_stake(certificate.author()))) + .collect::>(); + // Sort the timestamps. #[cfg(not(feature = "serial"))] - timestamps.par_sort_unstable(); + timestamps.par_sort_unstable_by_key(|(timestamp, _)| *timestamp); #[cfg(feature = "serial")] - timestamps.sort_unstable(); - // Return the median timestamp. - timestamps[timestamps.len() / 2] + timestamps.sort_unstable_by_key(|(timestamp, _)| *timestamp); + + // Calculate the total stake of the authors. + let total_stake = timestamps.iter().map(|(_, stake)| *stake).sum::(); + + // Initialize the current timestamp and accumulated stake. + let mut current_timestamp: i64 = 0; + let mut accumulated_stake: u64 = 0; + + // Find the weighted median timestamp. + for (timestamp, stake) in timestamps.iter() { + accumulated_stake = accumulated_stake.saturating_add(*stake); + current_timestamp = *timestamp; + if accumulated_stake >= total_stake.saturating_div(2) { + break; + } + } + + // Return the weighted median timestamp + current_timestamp } } } From b06f76931fbc578e7a74540810f66fc15d8ae4f6 Mon Sep 17 00:00:00 2001 From: raychu86 <14917648+raychu86@users.noreply.github.com> Date: Thu, 30 Nov 2023 16:32:26 -0500 Subject: [PATCH 038/298] Update usage of Subdag::timestamp --- ledger/block/src/verify.rs | 4 ++-- ledger/src/advance.rs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ledger/block/src/verify.rs b/ledger/block/src/verify.rs index eee243e537..cb5805f020 100644 --- a/ledger/block/src/verify.rs +++ b/ledger/block/src/verify.rs @@ -209,8 +209,8 @@ impl Block { let expected_timestamp = match &self.authority { // Beacon blocks do not have a timestamp check. Authority::Beacon(..) => self.timestamp(), - // Quorum blocks use the median timestamp from the subdag. - Authority::Quorum(subdag) => subdag.timestamp(), + // Quorum blocks use the weighted median timestamp from the subdag. + Authority::Quorum(subdag) => subdag.timestamp(current_committee), }; // Return success. diff --git a/ledger/src/advance.rs b/ledger/src/advance.rs index b8896e7611..7453204e3a 100644 --- a/ledger/src/advance.rs +++ b/ledger/src/advance.rs @@ -168,7 +168,7 @@ impl> Ledger { let next_height = previous_block.height().saturating_add(1); // Determine the timestamp for the next block. let next_timestamp = match subdag { - Some(subdag) => subdag.timestamp(), + Some(subdag) => subdag.timestamp(&self.latest_committee()?), None => OffsetDateTime::now_utc().unix_timestamp(), }; // Compute the next cumulative weight. From 40ec86ed348190cdf24dd32f7baa09fba609661c Mon Sep 17 00:00:00 2001 From: raychu86 <14917648+raychu86@users.noreply.github.com> Date: Mon, 4 Dec 2023 21:30:18 -0500 Subject: [PATCH 039/298] Extract the weighted_median function and add tests --- ledger/narwhal/subdag/src/lib.rs | 113 ++++++++++++++++++++++++------- 1 file changed, 89 insertions(+), 24 deletions(-) diff --git a/ledger/narwhal/subdag/src/lib.rs b/ledger/narwhal/subdag/src/lib.rs index 7cff50bc0a..dc3f5995c1 100644 --- a/ledger/narwhal/subdag/src/lib.rs +++ b/ledger/narwhal/subdag/src/lib.rs @@ -79,6 +79,36 @@ fn sanity_check_subdag_with_dfs(subdag: &BTreeMap) -> i64 { + let mut timestamps_and_stake = timestamps_and_stake; + + // Sort the timestamps. + #[cfg(not(feature = "serial"))] + timestamps_and_stake.par_sort_unstable_by_key(|(timestamp, _)| *timestamp); + #[cfg(feature = "serial")] + timestamps_and_stake.sort_unstable_by_key(|(timestamp, _)| *timestamp); + + // Calculate the total stake of the authors. + let total_stake = timestamps_and_stake.iter().map(|(_, stake)| *stake).sum::(); + + // Initialize the current timestamp and accumulated stake. + let mut current_timestamp: i64 = 0; + let mut accumulated_stake: u64 = 0; + + // Find the weighted median timestamp. + for (timestamp, stake) in timestamps_and_stake.iter() { + accumulated_stake = accumulated_stake.saturating_add(*stake); + current_timestamp = *timestamp; + if accumulated_stake >= total_stake.saturating_div(2) { + break; + } + } + + // Return the weighted median timestamp + current_timestamp +} + #[derive(Clone, PartialEq, Eq)] pub struct Subdag { /// The subdag of round certificates. @@ -148,36 +178,14 @@ impl Subdag { BatchCertificate::V1 { .. } => self.leader_certificate().timestamp(), BatchCertificate::V2 { .. } => { // Retrieve the timestamps and stakes of the certificates. - let mut timestamps = self + let timestamps_and_stakes = self .values() .flatten() .map(|certificate| (certificate.timestamp(), committee.get_stake(certificate.author()))) .collect::>(); - // Sort the timestamps. - #[cfg(not(feature = "serial"))] - timestamps.par_sort_unstable_by_key(|(timestamp, _)| *timestamp); - #[cfg(feature = "serial")] - timestamps.sort_unstable_by_key(|(timestamp, _)| *timestamp); - - // Calculate the total stake of the authors. - let total_stake = timestamps.iter().map(|(_, stake)| *stake).sum::(); - - // Initialize the current timestamp and accumulated stake. - let mut current_timestamp: i64 = 0; - let mut accumulated_stake: u64 = 0; - - // Find the weighted median timestamp. - for (timestamp, stake) in timestamps.iter() { - accumulated_stake = accumulated_stake.saturating_add(*stake); - current_timestamp = *timestamp; - if accumulated_stake >= total_stake.saturating_div(2) { - break; - } - } - // Return the weighted median timestamp - current_timestamp + weighted_median(timestamps_and_stakes) } } } @@ -284,6 +292,8 @@ mod tests { type CurrentNetwork = console::network::Testnet3; + const ITERATIONS: u64 = 100; + #[test] fn test_max_certificates() { // Determine the maximum number of certificates in a block. @@ -296,4 +306,59 @@ mod tests { "The maximum number of certificates in a block is too large" ); } + + #[test] + fn test_weighted_median_simple() { + // Test a simple case with equal weights. + let data = vec![(1, 10), (2, 10), (3, 10)]; + assert_eq!(weighted_median(data), 2); + + // Test a case with a single element. + let data = vec![(5, 10)]; + assert_eq!(weighted_median(data), 5); + + // Test a case with an even number of elements + let data = vec![(1, 10), (2, 30), (3, 20), (4, 40)]; + assert_eq!(weighted_median(data), 3); + + // Test a case with a skewed weight. + let data = vec![(100, 100), (200, 10000), (300, 500)]; + assert_eq!(weighted_median(data), 200); + + // Test a case with a empty set. + assert_eq!(weighted_median(vec![]), 0); + + // Test a case where weights of 0 do not affect the median. + let data = vec![(1, 10), (2, 0), (3, 0), (4, 0), (5, 20), (6, 0), (7, 10)]; + assert_eq!(weighted_median(data), 5); + } + + #[test] + fn test_weighted_median_range() { + let mut rng = TestRng::default(); + + for _ in 0..ITERATIONS { + let data: Vec<(i64, u64)> = (0..10).map(|_| (rng.gen_range(1..100), rng.gen_range(10..100))).collect(); + let min = data.iter().min_by_key(|x| x.0).unwrap().0; + let max = data.iter().max_by_key(|x| x.0).unwrap().0; + let median = weighted_median(data); + assert!(median >= min && median <= max); + } + } + + #[test] + fn test_weighted_median_scaled_weights() { + let mut rng = TestRng::default(); + + for _ in 0..ITERATIONS { + let data: Vec<(i64, u64)> = (0..10).map(|_| (rng.gen_range(1..100), rng.gen_range(10..100) * 2)).collect(); + let scaled_data: Vec<(i64, u64)> = data.iter().map(|&(t, s)| (t, s * 10)).collect(); + + if weighted_median(data.clone()) != weighted_median(scaled_data.clone()) { + println!("data: {:?}", data); + println!("scaled_data: {:?}", scaled_data); + } + assert_eq!(weighted_median(data), weighted_median(scaled_data)); + } + } } From cb294c3ae986191a51fb1bf59ee94d20f68f6d98 Mon Sep 17 00:00:00 2001 From: Pranav Gaddamadugu <23022326+d0cd@users.noreply.github.com> Date: Tue, 5 Dec 2023 14:49:27 -0800 Subject: [PATCH 040/298] Add reserved keyword --- synthesizer/program/src/lib.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/synthesizer/program/src/lib.rs b/synthesizer/program/src/lib.rs index 26f9b7c2b8..6e32c776f8 100644 --- a/synthesizer/program/src/lib.rs +++ b/synthesizer/program/src/lib.rs @@ -575,6 +575,7 @@ impl, Command: CommandTrait> Pro "u64", "u128", "scalar", + "signature", "string", // Boolean "true", From 14a9e5fed74e0328f94795864913b8fb00d012b0 Mon Sep 17 00:00:00 2001 From: Howard Wu <9260812+howardwu@users.noreply.github.com> Date: Tue, 5 Dec 2023 16:51:48 -0800 Subject: [PATCH 041/298] Clippy --- ledger/committee/src/lib.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ledger/committee/src/lib.rs b/ledger/committee/src/lib.rs index dca9462ee9..042ca103af 100644 --- a/ledger/committee/src/lib.rs +++ b/ledger/committee/src/lib.rs @@ -295,9 +295,9 @@ pub mod test_helpers { // Add in the minimum and maximum staked nodes. members.insert(Address::::new(rng.gen()), (MIN_VALIDATOR_STAKE, false)); while members.len() < num_members as usize - 1 { - let stake = MIN_VALIDATOR_STAKE as f64; + let stake = MIN_VALIDATOR_STAKE; let is_open = rng.gen(); - members.insert(Address::::new(rng.gen()), (stake as u64, is_open)); + members.insert(Address::::new(rng.gen()), (stake, is_open)); } // Return the committee. Committee::::new(1, members).unwrap() From bfe8729c94aaa73ba4af0fae1d47065c1862bde0 Mon Sep 17 00:00:00 2001 From: Pranav Gaddamadugu <23022326+d0cd@users.noreply.github.com> Date: Fri, 8 Dec 2023 09:56:31 -0800 Subject: [PATCH 042/298] Track number of delegators, ensure count is under 1M --- .../program/src/resources/credits.aleo | 103 ++++++++++++------ 1 file changed, 69 insertions(+), 34 deletions(-) diff --git a/synthesizer/program/src/resources/credits.aleo b/synthesizer/program/src/resources/credits.aleo index 3cc7ac5f7f..1b552166c6 100644 --- a/synthesizer/program/src/resources/credits.aleo +++ b/synthesizer/program/src/resources/credits.aleo @@ -34,13 +34,16 @@ struct committee_state: /**********************************************************************************************************************/ -/// The `committee_size` mapping stores the current size of the committee at the zero index. -mapping committee_size: - // The key represents the index at which the size is stored. - // The key must **always** be `0u8`. - key as u8.public; - // The value represents the size of the committee. - value as u8.public; +/// The `metadata` mapping stores: +/// - The number of members in the committee. +/// - The number of delegators bonded to each validator. +mapping metadata: + // The key represents the index at which the count is stored. + // - The zero address (aleo1qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq3ljyzc) stores the number of members in the committee. + // - The address of the validator stores the number of delegators bonded to the validator. + key as address.public; + // The value represents the count. + value as u32.public; /**********************************************************************************************************************/ @@ -139,15 +142,15 @@ finalize bond_public: // If the validator is already in the committee, jump to the `continue_bond_validator` logic. branch.eq r4 true to continue_bond_validator; // Get the committee size. - get committee_size[0u8] into r5; + get metadata[aleo1qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq3ljyzc] into r5; // Increment the committee size by one. - add r5 1u8 into r6; + add r5 1u32 into r6; // Determine if the committee size is less than or equal to 200. - lte r6 200u8 into r7; + lte r6 200u32 into r7; // Enforce that the committee size is less than or equal to 200. assert.eq r7 true; // Set the new committee size. - set r6 into committee_size[0u8]; + set r6 into metadata[aleo1qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq3ljyzc]; // Continues the rest of the `bond_validator` logic. position continue_bond_validator; @@ -227,41 +230,59 @@ finalize bond_public: // Construct the updated committee state. cast r21 r20.is_open into r22 as committee_state; + // Check if the delegator is already bonded to the validator. + contains bonded[r0] into r23; + // If the delegator is already bonded to the validator, jump to the `continue_bond_delegator` logic. + branch.eq r23 true to continue_bond_delegator; + // Get the number of delegators bonded to the validator. + get metadata[r1] into r24; + // Increment the number of delegators bonded to the validator by one. + add r24 1u32 into r25; + // Determine if the number of delegators bonded to the validator is less than or equal to 1_000_000. + lte r25 1_000_000u32 into r26; + // Enforce that the number of delegators bonded to the validator is less than or equal to 1_000_000. + assert.eq r26 true; + // Set the new number of delegators bonded to the validator. + set r25 into metadata[r1]; + + // Continues the rest of the `bond_delegator` logic. + position continue_bond_delegator; + /* Bonded */ // Construct the initial bond state. - cast r1 0u64 into r23 as bond_state; + cast r1 0u64 into r27 as bond_state; // Get the bond state for the caller, or default to the initial bond state. - get.or_use bonded[r0] r23 into r24; + get.or_use bonded[r0] r27 into r28; // Enforce the validator matches in the bond state. - assert.eq r24.validator r1; + assert.eq r28.validator r1; // Increment the microcredits in the bond state. - add r24.microcredits r2 into r25; + add r24.microcredits r2 into r29; // Determine if the amount is at least 10 credits. - gte r25 10_000_000u64 into r26; + gte r29 10_000_000u64 into r30; // Enforce the amount is at least 10 credits. - assert.eq r26 true; + assert.eq r30 true; // Construct the updated bond state. - cast r1 r25 into r27 as bond_state; + cast r1 r29 into r31 as bond_state; /* Account */ // Get the balance of the caller. // If the account does not exist, this finalize scope will fail. - get account[r0] into r28; + get account[r0] into r32; // Decrement the balance of the caller. - sub r28 r2 into r29; + sub r32 r2 into r33; /* Writes */ // Update the committee state for the specified validator. set r22 into committee[r1]; // Update the bond state for the caller. - set r27 into bonded[r0]; + set r31 into bonded[r0]; // Update the balance of the caller. - set r29 into account[r0]; + set r33 into account[r0]; // The terminus. position end; @@ -377,11 +398,11 @@ finalize unbond_public: remove committee[r0]; // Get the committee size. - get committee_size[0u8] into r15; + get metadata[aleo1qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq3ljyzc] into r15; // Decrement the committee size by one. - sub r15 1u8 into r16; + sub r15 1u32 into r16; // Set the new committee size. - set r16 into committee_size[0u8]; + set r16 into metadata[aleo1qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq3ljyzc]; /* Bonded */ @@ -473,6 +494,13 @@ finalize unbond_public: // Update the stake for the specified validator. set r30 into committee[r19.validator]; + // Get the number of delegators bonded to the validator. + get metadata[r19.validator] into r31; + // Decrement the number of delegators bonded to the validator by one. + sub r31 1u32 into r32; + // Set the new number of delegators bonded to the validator. + set r32 into metadata[r19.validator]; + /* Bonded */ // Remove the caller from the bonded mapping. @@ -481,12 +509,12 @@ finalize unbond_public: /* Unbonding */ // Increment the microcredits in the unbond state. - add r3.microcredits r19.microcredits into r31; + add r3.microcredits r19.microcredits into r33; // Construct the updated unbond state. - cast r31 r4 into r32 as unbond_state; + cast r33 r4 into r34 as unbond_state; // Update the unbond state for the caller. - set r32 into unbonding[r0]; + set r34 into unbonding[r0]; // The terminus. position end; @@ -540,23 +568,28 @@ finalize unbond_delegator_as_validator: // Construct the updated committee state. cast r5 r2.is_open into r6 as committee_state; + // Get the number of delegators bonded to the validator. + get metadata[r0] into r7; + // Decrement the number of delegators bonded to the validator by one. + sub r7 1u32 into r8; + /* End Committee */ /* Start Unbond */ // Construct the initial unbond state. - cast 0u64 0u32 into r7 as unbond_state; + cast 0u64 0u32 into r9 as unbond_state; // Get the unbond state for the delegator, or default to the initial unbond state. - get.or_use unbonding[r1] r7 into r8; + get.or_use unbonding[r1] r9 into r10; // Increment the microcredits in the unbond state. - add r8.microcredits r4.microcredits into r9; + add r10.microcredits r4.microcredits into r11; // Compute the height at which the unbonding will be complete, starting from the current block. // Note: Calling unbond across multiple blocks before the unbonding is complete will reset the height each time. - add block.height 360u32 into r10; + add block.height 360u32 into r12; // Construct the updated unbond state. - cast r9 r10 into r11 as unbond_state; + cast r11 r12 into r13 as unbond_state; /* End Unbond */ @@ -567,7 +600,9 @@ finalize unbond_delegator_as_validator: // Remove the bond state for the delegator. remove bonded[r1]; // Update the unbond state for the delegator. - set r11 into unbonding[r1]; + set r13 into unbonding[r1]; + // Update the number of delegators bonded to the validator. + set r8 into metadata[r0]; /* End Writes */ From ccbb62f1bd214cabfb001e23e04617f4374885eb Mon Sep 17 00:00:00 2001 From: Pranav Gaddamadugu <23022326+d0cd@users.noreply.github.com> Date: Fri, 8 Dec 2023 10:30:01 -0800 Subject: [PATCH 043/298] Fix --- synthesizer/program/src/resources/credits.aleo | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/synthesizer/program/src/resources/credits.aleo b/synthesizer/program/src/resources/credits.aleo index 1b552166c6..2480be9f48 100644 --- a/synthesizer/program/src/resources/credits.aleo +++ b/synthesizer/program/src/resources/credits.aleo @@ -258,7 +258,7 @@ finalize bond_public: assert.eq r28.validator r1; // Increment the microcredits in the bond state. - add r24.microcredits r2 into r29; + add r28.microcredits r2 into r29; // Determine if the amount is at least 10 credits. gte r29 10_000_000u64 into r30; // Enforce the amount is at least 10 credits. From 0f3cb653f5bdf01a0fe3c2307fd60294ddbf8a98 Mon Sep 17 00:00:00 2001 From: Pranav Gaddamadugu <23022326+d0cd@users.noreply.github.com> Date: Fri, 8 Dec 2023 14:49:09 -0800 Subject: [PATCH 044/298] Fix --- synthesizer/program/src/resources/credits.aleo | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/synthesizer/program/src/resources/credits.aleo b/synthesizer/program/src/resources/credits.aleo index 2480be9f48..44b7ab449b 100644 --- a/synthesizer/program/src/resources/credits.aleo +++ b/synthesizer/program/src/resources/credits.aleo @@ -142,7 +142,7 @@ finalize bond_public: // If the validator is already in the committee, jump to the `continue_bond_validator` logic. branch.eq r4 true to continue_bond_validator; // Get the committee size. - get metadata[aleo1qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq3ljyzc] into r5; + get.or_use metadata[aleo1qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq3ljyzc] 0u32 into r5; // Increment the committee size by one. add r5 1u32 into r6; // Determine if the committee size is less than or equal to 200. @@ -235,7 +235,7 @@ finalize bond_public: // If the delegator is already bonded to the validator, jump to the `continue_bond_delegator` logic. branch.eq r23 true to continue_bond_delegator; // Get the number of delegators bonded to the validator. - get metadata[r1] into r24; + get.or_use metadata[r1] 0u32 into r24; // Increment the number of delegators bonded to the validator by one. add r24 1u32 into r25; // Determine if the number of delegators bonded to the validator is less than or equal to 1_000_000. From 5d3d838b409a9a0ac868d1629c74ecfb99ea261c Mon Sep 17 00:00:00 2001 From: Pranav Gaddamadugu <23022326+d0cd@users.noreply.github.com> Date: Fri, 8 Dec 2023 15:26:23 -0800 Subject: [PATCH 045/298] Fix test --- ledger/committee/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ledger/committee/src/lib.rs b/ledger/committee/src/lib.rs index 042ca103af..1e29ea7586 100644 --- a/ledger/committee/src/lib.rs +++ b/ledger/committee/src/lib.rs @@ -398,7 +398,7 @@ mod tests { // Set the number of rounds. const NUM_ROUNDS: u64 = 256 * 2_000; // Sample the number of members. - let num_members = rng.gen_range(3..50); + let num_members = rng.gen_range(4..50); // Sample a committee. let committee = crate::test_helpers::sample_committee_custom(num_members, rng); // Check the leader distribution. From 72b8b3f3ca8791331071259df968c35b878f513e Mon Sep 17 00:00:00 2001 From: Victor Sint Nicolaas Date: Mon, 4 Dec 2023 21:13:22 +0100 Subject: [PATCH 046/298] Use evaluate_function for CallStack::PackageRun; Sample response for CallStack::CheckDeployment --- synthesizer/process/src/stack/call/mod.rs | 80 +++++++++++++++++-- synthesizer/process/src/stack/evaluate.rs | 8 +- .../process/src/stack/helpers/matches.rs | 2 +- .../process/src/stack/helpers/sample.rs | 74 ++++++++++++----- synthesizer/process/src/stack/mod.rs | 21 +++++ .../program/src/traits/stack_and_registers.rs | 9 +++ 6 files changed, 166 insertions(+), 28 deletions(-) diff --git a/synthesizer/process/src/stack/call/mod.rs b/synthesizer/process/src/stack/call/mod.rs index 5d6578ab73..2eb7d31ae7 100644 --- a/synthesizer/process/src/stack/call/mod.rs +++ b/synthesizer/process/src/stack/call/mod.rs @@ -12,12 +12,24 @@ // See the License for the specific language governing permissions and // limitations under the License. -use crate::{CallStack, Registers, RegistersCall, StackEvaluate, StackExecute}; +use crate::{ + stack::{ + Address, + ValueType::{ExternalRecord, Record}, + }, + CallStack, + Registers, + RegistersCall, + StackEvaluate, + StackExecute, + StackProgramTypes, +}; use aleo_std::prelude::{finish, lap, timer}; use console::{network::prelude::*, program::Request}; use synthesizer_program::{ Call, CallOperator, + Operand, RegistersLoad, RegistersLoadCircuit, RegistersSigner, @@ -39,7 +51,7 @@ pub trait CallTrait { /// Executes the instruction. fn execute, R: CryptoRng + Rng>( &self, - stack: &(impl StackEvaluate + StackExecute + StackMatches + StackProgram), + stack: &(impl StackEvaluate + StackExecute + StackMatches + StackProgram + StackProgramTypes), registers: &mut ( impl RegistersCall + RegistersSignerCircuit @@ -132,7 +144,7 @@ impl CallTrait for Call { #[inline] fn execute, R: Rng + CryptoRng>( &self, - stack: &(impl StackEvaluate + StackExecute + StackMatches + StackProgram), + stack: &(impl StackEvaluate + StackExecute + StackMatches + StackProgram + StackProgramTypes), registers: &mut ( impl RegistersCall + RegistersSignerCircuit @@ -241,7 +253,7 @@ impl CallTrait for Call { // Return the request and response. (request, response) } - CallStack::CheckDeployment(_, private_key, ..) | CallStack::PackageRun(_, private_key, ..) => { + CallStack::PackageRun(_, private_key, ..) => { // Compute the request. let request = Request::sign( &private_key, @@ -258,7 +270,65 @@ impl CallTrait for Call { call_stack.push(request.clone())?; // Execute the request. - let response = substack.execute_function::(call_stack, console_caller, rng)?; + let response = substack.evaluate_function::(call_stack, console_caller)?; + + // Return the request and response. + (request, response) + } + CallStack::CheckDeployment(_, private_key, ..) => { + // Compute the request. + let request = Request::sign( + &private_key, + *substack.program_id(), + *function.name(), + inputs.iter(), + &function.input_types(), + rng, + )?; + + // Compute the address. + let address = Address::try_from(&private_key)?; + // Sample dummy outputs + let outputs = function + .outputs() + .iter() + .map(|output| match output.value_type() { + ExternalRecord(locator) => { + // Retrieve the external stack. + let stack = substack.get_external_stack(locator.program_id())?; + // Sample the input. + stack.sample_value(&address, &Record(*locator.resource()), rng) + } + _ => substack.sample_value(&address, output.value_type(), rng), + }) + .collect::>>()?; + + // Retrieve the output operands. + let output_operands = + &function.outputs().iter().map(|output| output.operand()).collect::>(); + + // Map the output operands to registers. + let output_registers = output_operands + .iter() + .map(|operand| match operand { + Operand::Register(register) => Some(register.clone()), + _ => None, + }) + .collect::>(); + + // Compute the response. + let response = crate::Response::new( + request.network_id(), + substack.program().id(), + function.name(), + request.inputs().len(), + request.tvk(), + request.tcm(), + outputs, + &function.output_types(), + &output_registers, + )?; + // Return the request and response. (request, response) } diff --git a/synthesizer/process/src/stack/evaluate.rs b/synthesizer/process/src/stack/evaluate.rs index 9dda9b6db2..6d6b6f5761 100644 --- a/synthesizer/process/src/stack/evaluate.rs +++ b/synthesizer/process/src/stack/evaluate.rs @@ -106,6 +106,10 @@ impl StackEvaluate for Stack { // Retrieve the next request, based on the call stack mode. let (request, call_stack) = match &call_stack { CallStack::Evaluate(authorization) => (authorization.next()?, call_stack), + CallStack::PackageRun(requests, _, _) => { + let last_request = requests.last().ok_or(anyhow!("CallStack does not contain request"))?.clone(); + (last_request, call_stack) + } // If the evaluation is performed in the `Execute` mode, create a new `Evaluate` mode. // This is done to ensure that evaluation during execution is performed consistently. CallStack::Execute(authorization, _) => { @@ -116,7 +120,9 @@ impl StackEvaluate for Stack { let call_stack = CallStack::Evaluate(authorization); (request, call_stack) } - _ => bail!("Illegal operation: call stack must be `Evaluate` or `Execute` in `evaluate_function`."), + _ => bail!( + "Illegal operation: call stack must be `PackageRun`, `Evaluate` or `Execute` in `evaluate_function`." + ), }; lap!(timer, "Retrieve the next request"); diff --git a/synthesizer/process/src/stack/helpers/matches.rs b/synthesizer/process/src/stack/helpers/matches.rs index 975045943f..3deac24df9 100644 --- a/synthesizer/process/src/stack/helpers/matches.rs +++ b/synthesizer/process/src/stack/helpers/matches.rs @@ -13,7 +13,7 @@ // limitations under the License. use super::*; -use console::program::{Argument, FinalizeType}; +pub use console::program::{Argument, FinalizeType}; impl StackMatches for Stack { /// Checks that the given value matches the layout of the value type. diff --git a/synthesizer/process/src/stack/helpers/sample.rs b/synthesizer/process/src/stack/helpers/sample.rs index 0ad9f94171..8b9c56e5d8 100644 --- a/synthesizer/process/src/stack/helpers/sample.rs +++ b/synthesizer/process/src/stack/helpers/sample.rs @@ -13,29 +13,9 @@ // limitations under the License. use super::*; +use crate::stack::helpers::matches::{Argument, FinalizeType}; impl Stack { - /// Returns a value for the given value type. - pub fn sample_value( - &self, - burner_address: &Address, - value_type: &ValueType, - rng: &mut R, - ) -> Result> { - match value_type { - ValueType::Constant(plaintext_type) - | ValueType::Public(plaintext_type) - | ValueType::Private(plaintext_type) => Ok(Value::Plaintext(self.sample_plaintext(plaintext_type, rng)?)), - ValueType::Record(record_name) => { - Ok(Value::Record(self.sample_record(burner_address, record_name, rng)?)) - } - ValueType::ExternalRecord(locator) => { - bail!("Illegal operation: Cannot sample external records (for '{locator}.record').") - } - ValueType::Future(locator) => bail!("Illegal operation: Cannot sample futures (for '{locator}.future')."), - } - } - /// Returns a record for the given record name, with the given burner address. pub fn sample_record( &self, @@ -64,6 +44,16 @@ impl Stack { // Return the plaintext value. Ok(plaintext) } + + /// Samples a future value according to the given future type. + pub fn sample_future(&self, locator: &Locator, rng: &mut R) -> Result> { + // Sample a future value. + let future = self.sample_future_internal(locator, 0, rng)?; + // Ensure the plaintext value matches the plaintext type. + self.matches_future(&future, locator)?; + // Return the plaintext value. + Ok(future) + } } impl Stack { @@ -182,4 +172,46 @@ impl Stack { // Return the plaintext. Ok(plaintext) } + + /// Returns a future for the given TODO. + fn sample_future_internal( + &self, + locator: &Locator, + depth: usize, + rng: &mut R, + ) -> Result> { + // Retrieve the associated function. + let function = match locator.program_id() == self.program_id() { + true => self.get_function_ref(locator.resource())?, + false => self.get_external_program(locator.program_id())?.get_function_ref(locator.resource())?, + }; + + // Retrieve the finalize inputs. + let inputs = match function.finalize_logic() { + Some(finalize_logic) => finalize_logic.inputs(), + None => bail!("Function '{locator}' does not have a finalize block"), + }; + + let arguments = inputs + .into_iter() + .map(|input| { + match input.finalize_type() { + FinalizeType::Plaintext(plaintext_type) => { + // Sample the plaintext value. + let plaintext = self.sample_plaintext_internal(plaintext_type, depth + 1, rng)?; + // Return the argument. + Ok(Argument::Plaintext(plaintext)) + } + FinalizeType::Future(locator) => { + // Sample the future value. + let future = self.sample_future_internal(locator, depth + 1, rng)?; + // Return the argument. + Ok(Argument::Future(future)) + } + } + }) + .collect::>>()?; + + Ok(Future::new(*locator.program_id(), *locator.resource(), arguments)) + } } diff --git a/synthesizer/process/src/stack/mod.rs b/synthesizer/process/src/stack/mod.rs index 2b95b46fb7..30b9f74fd2 100644 --- a/synthesizer/process/src/stack/mod.rs +++ b/synthesizer/process/src/stack/mod.rs @@ -292,6 +292,27 @@ impl StackProgram for Stack { } Ok(num_calls) } + + /// Returns a value for the given value type. + fn sample_value( + &self, + burner_address: &Address, + value_type: &ValueType, + rng: &mut R, + ) -> Result> { + match value_type { + ValueType::Constant(plaintext_type) + | ValueType::Public(plaintext_type) + | ValueType::Private(plaintext_type) => Ok(Value::Plaintext(self.sample_plaintext(plaintext_type, rng)?)), + ValueType::Record(record_name) => { + Ok(Value::Record(self.sample_record(burner_address, record_name, rng)?)) + } + ValueType::ExternalRecord(locator) => { + bail!("Illegal operation: Cannot sample external records (for '{locator}.record').") + } + ValueType::Future(locator) => Ok(Value::Future(self.sample_future(locator, rng)?)), + } + } } impl StackProgramTypes for Stack { diff --git a/synthesizer/program/src/traits/stack_and_registers.rs b/synthesizer/program/src/traits/stack_and_registers.rs index 50418e894f..326cd14e3d 100644 --- a/synthesizer/program/src/traits/stack_and_registers.rs +++ b/synthesizer/program/src/traits/stack_and_registers.rs @@ -35,6 +35,7 @@ use console::{ }, types::{Address, Field}, }; +use rand::{CryptoRng, Rng}; pub trait StackMatches { /// Checks that the given value matches the layout of the value type. @@ -83,6 +84,14 @@ pub trait StackProgram { /// Returns the expected number of calls for the given function name. fn get_number_of_calls(&self, function_name: &Identifier) -> Result; + + /// Samples a value for the given value_type + fn sample_value( + &self, + burner_address: &Address, + value_type: &ValueType, + rng: &mut R, + ) -> Result>; } pub trait FinalizeRegistersState { From b881c2101517130db9128a4219cae256cbff17d1 Mon Sep 17 00:00:00 2001 From: Victor Sint Nicolaas Date: Mon, 4 Dec 2023 21:17:21 +0100 Subject: [PATCH 047/298] Remove unused StackProgramTypes --- synthesizer/process/src/stack/call/mod.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/synthesizer/process/src/stack/call/mod.rs b/synthesizer/process/src/stack/call/mod.rs index 2eb7d31ae7..8977056e03 100644 --- a/synthesizer/process/src/stack/call/mod.rs +++ b/synthesizer/process/src/stack/call/mod.rs @@ -22,7 +22,6 @@ use crate::{ RegistersCall, StackEvaluate, StackExecute, - StackProgramTypes, }; use aleo_std::prelude::{finish, lap, timer}; use console::{network::prelude::*, program::Request}; @@ -51,7 +50,7 @@ pub trait CallTrait { /// Executes the instruction. fn execute, R: CryptoRng + Rng>( &self, - stack: &(impl StackEvaluate + StackExecute + StackMatches + StackProgram + StackProgramTypes), + stack: &(impl StackEvaluate + StackExecute + StackMatches + StackProgram), registers: &mut ( impl RegistersCall + RegistersSignerCircuit @@ -144,7 +143,7 @@ impl CallTrait for Call { #[inline] fn execute, R: Rng + CryptoRng>( &self, - stack: &(impl StackEvaluate + StackExecute + StackMatches + StackProgram + StackProgramTypes), + stack: &(impl StackEvaluate + StackExecute + StackMatches + StackProgram), registers: &mut ( impl RegistersCall + RegistersSignerCircuit From 5b68ab697c7700159c2debbd97818b517722c76d Mon Sep 17 00:00:00 2001 From: Victor Sint Nicolaas Date: Fri, 8 Dec 2023 11:12:26 +0100 Subject: [PATCH 048/298] Import and comment cleanups --- synthesizer/process/src/stack/call/mod.rs | 2 +- synthesizer/process/src/stack/helpers/matches.rs | 1 - synthesizer/process/src/stack/helpers/sample.rs | 7 +++---- synthesizer/process/src/stack/mod.rs | 2 ++ synthesizer/program/src/traits/stack_and_registers.rs | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/synthesizer/process/src/stack/call/mod.rs b/synthesizer/process/src/stack/call/mod.rs index 8977056e03..ff31b63684 100644 --- a/synthesizer/process/src/stack/call/mod.rs +++ b/synthesizer/process/src/stack/call/mod.rs @@ -295,7 +295,7 @@ impl CallTrait for Call { ExternalRecord(locator) => { // Retrieve the external stack. let stack = substack.get_external_stack(locator.program_id())?; - // Sample the input. + // Sample the output. stack.sample_value(&address, &Record(*locator.resource()), rng) } _ => substack.sample_value(&address, output.value_type(), rng), diff --git a/synthesizer/process/src/stack/helpers/matches.rs b/synthesizer/process/src/stack/helpers/matches.rs index 3deac24df9..4ed9a81de7 100644 --- a/synthesizer/process/src/stack/helpers/matches.rs +++ b/synthesizer/process/src/stack/helpers/matches.rs @@ -13,7 +13,6 @@ // limitations under the License. use super::*; -pub use console::program::{Argument, FinalizeType}; impl StackMatches for Stack { /// Checks that the given value matches the layout of the value type. diff --git a/synthesizer/process/src/stack/helpers/sample.rs b/synthesizer/process/src/stack/helpers/sample.rs index 8b9c56e5d8..c6a2dfe556 100644 --- a/synthesizer/process/src/stack/helpers/sample.rs +++ b/synthesizer/process/src/stack/helpers/sample.rs @@ -13,7 +13,6 @@ // limitations under the License. use super::*; -use crate::stack::helpers::matches::{Argument, FinalizeType}; impl Stack { /// Returns a record for the given record name, with the given burner address. @@ -49,9 +48,9 @@ impl Stack { pub fn sample_future(&self, locator: &Locator, rng: &mut R) -> Result> { // Sample a future value. let future = self.sample_future_internal(locator, 0, rng)?; - // Ensure the plaintext value matches the plaintext type. + // Ensure the future value matches the future type. self.matches_future(&future, locator)?; - // Return the plaintext value. + // Return the future value. Ok(future) } } @@ -173,7 +172,7 @@ impl Stack { Ok(plaintext) } - /// Returns a future for the given TODO. + /// Samples a future value according to the given locator. fn sample_future_internal( &self, locator: &Locator, diff --git a/synthesizer/process/src/stack/mod.rs b/synthesizer/process/src/stack/mod.rs index 30b9f74fd2..04bb867b91 100644 --- a/synthesizer/process/src/stack/mod.rs +++ b/synthesizer/process/src/stack/mod.rs @@ -41,8 +41,10 @@ use console::{ account::{Address, PrivateKey}, network::prelude::*, program::{ + Argument, Entry, EntryType, + FinalizeType, Future, Identifier, Literal, diff --git a/synthesizer/program/src/traits/stack_and_registers.rs b/synthesizer/program/src/traits/stack_and_registers.rs index 326cd14e3d..d3a5961141 100644 --- a/synthesizer/program/src/traits/stack_and_registers.rs +++ b/synthesizer/program/src/traits/stack_and_registers.rs @@ -85,7 +85,7 @@ pub trait StackProgram { /// Returns the expected number of calls for the given function name. fn get_number_of_calls(&self, function_name: &Identifier) -> Result; - /// Samples a value for the given value_type + /// Samples a value for the given value_type. fn sample_value( &self, burner_address: &Address, From 9e8a5243c18679fb4fedfc1c8c79fcf8a73cf967 Mon Sep 17 00:00:00 2001 From: Raymond Chu <14917648+raychu86@users.noreply.github.com> Date: Sun, 17 Dec 2023 14:42:21 -0800 Subject: [PATCH 049/298] Update ledger/block/src/verify.rs Signed-off-by: Raymond Chu <14917648+raychu86@users.noreply.github.com> --- ledger/block/src/verify.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ledger/block/src/verify.rs b/ledger/block/src/verify.rs index be948920fb..051dfa65cf 100644 --- a/ledger/block/src/verify.rs +++ b/ledger/block/src/verify.rs @@ -94,7 +94,7 @@ impl Block { current_timestamp, )?; - // Re + // Return the expected existing transaction ids. Ok(expected_existing_transaction_ids) } } From 1ce77cd80b4f1d4baf814376557ae8c5cceb7f93 Mon Sep 17 00:00:00 2001 From: Howard Wu <9260812+howardwu@users.noreply.github.com> Date: Sun, 17 Dec 2023 16:01:13 -0800 Subject: [PATCH 050/298] Update ledger/committee/src/lib.rs Signed-off-by: Howard Wu <9260812+howardwu@users.noreply.github.com> --- ledger/committee/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ledger/committee/src/lib.rs b/ledger/committee/src/lib.rs index 1e29ea7586..042ca103af 100644 --- a/ledger/committee/src/lib.rs +++ b/ledger/committee/src/lib.rs @@ -398,7 +398,7 @@ mod tests { // Set the number of rounds. const NUM_ROUNDS: u64 = 256 * 2_000; // Sample the number of members. - let num_members = rng.gen_range(4..50); + let num_members = rng.gen_range(3..50); // Sample a committee. let committee = crate::test_helpers::sample_committee_custom(num_members, rng); // Check the leader distribution. From e58dd326b55bcffaae144e63a12bb7423eb81e9a Mon Sep 17 00:00:00 2001 From: Pranav Gaddamadugu <23022326+d0cd@users.noreply.github.com> Date: Thu, 21 Dec 2023 03:11:13 +0900 Subject: [PATCH 051/298] Set hard limit for delegators to 1000000 --- .../program/src/resources/credits.aleo | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/synthesizer/program/src/resources/credits.aleo b/synthesizer/program/src/resources/credits.aleo index 44b7ab449b..4df644b3f8 100644 --- a/synthesizer/program/src/resources/credits.aleo +++ b/synthesizer/program/src/resources/credits.aleo @@ -39,8 +39,8 @@ struct committee_state: /// - The number of delegators bonded to each validator. mapping metadata: // The key represents the index at which the count is stored. - // - The zero address (aleo1qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq3ljyzc) stores the number of members in the committee. - // - The address of the validator stores the number of delegators bonded to the validator. + // - This address (aleo1qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq3ljyzc) stores the number of members in the committee. + // - This address (aleo1qgqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqanmpl0) stores the total number of **delegators**. key as address.public; // The value represents the count. value as u32.public; @@ -234,16 +234,16 @@ finalize bond_public: contains bonded[r0] into r23; // If the delegator is already bonded to the validator, jump to the `continue_bond_delegator` logic. branch.eq r23 true to continue_bond_delegator; - // Get the number of delegators bonded to the validator. - get.or_use metadata[r1] 0u32 into r24; - // Increment the number of delegators bonded to the validator by one. + // Get the total number of bonded delegators. + get.or_use metadata[aleo1qgqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqanmpl0] 0u32 into r24; + // Increment the number of bonded delegators by one. add r24 1u32 into r25; - // Determine if the number of delegators bonded to the validator is less than or equal to 1_000_000. + // Determine if the number of bonded delegators is less than or equal to 1_000_000. lte r25 1_000_000u32 into r26; - // Enforce that the number of delegators bonded to the validator is less than or equal to 1_000_000. + // Enforce that the number of bonded delegators is less than or equal to 1_000_000. assert.eq r26 true; // Set the new number of delegators bonded to the validator. - set r25 into metadata[r1]; + set r25 into metadata[aleo1qgqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqanmpl0]; // Continues the rest of the `bond_delegator` logic. position continue_bond_delegator; @@ -494,12 +494,12 @@ finalize unbond_public: // Update the stake for the specified validator. set r30 into committee[r19.validator]; - // Get the number of delegators bonded to the validator. - get metadata[r19.validator] into r31; - // Decrement the number of delegators bonded to the validator by one. + // Get the number of bonded delegators. + get metadata[aleo1qgqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqanmpl0] into r31; + // Decrement the number of bonded delegators by one. sub r31 1u32 into r32; - // Set the new number of delegators bonded to the validator. - set r32 into metadata[r19.validator]; + // Set the new number of bonded delegators. + set r32 into metadata[aleo1qgqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqanmpl0]; /* Bonded */ From f5c9ff2ec73232b0966a67a633831334a456625d Mon Sep 17 00:00:00 2001 From: Pranav Gaddamadugu <23022326+d0cd@users.noreply.github.com> Date: Thu, 21 Dec 2023 03:32:12 +0900 Subject: [PATCH 052/298] Fix --- synthesizer/program/src/resources/credits.aleo | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/synthesizer/program/src/resources/credits.aleo b/synthesizer/program/src/resources/credits.aleo index 4df644b3f8..27da101cc0 100644 --- a/synthesizer/program/src/resources/credits.aleo +++ b/synthesizer/program/src/resources/credits.aleo @@ -568,9 +568,9 @@ finalize unbond_delegator_as_validator: // Construct the updated committee state. cast r5 r2.is_open into r6 as committee_state; - // Get the number of delegators bonded to the validator. - get metadata[r0] into r7; - // Decrement the number of delegators bonded to the validator by one. + // Get the number of bonded delegators. + get metadata[aleo1qgqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqanmpl0] into r7; + // Decrement the number of bonded delegators by one. sub r7 1u32 into r8; /* End Committee */ @@ -601,8 +601,8 @@ finalize unbond_delegator_as_validator: remove bonded[r1]; // Update the unbond state for the delegator. set r13 into unbonding[r1]; - // Update the number of delegators bonded to the validator. - set r8 into metadata[r0]; + // Update the number of bonded delegators. + set r8 into metadata[aleo1qgqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqanmpl0]; /* End Writes */ From fb526454e9f15ffd84939c5c8287904bec4092e0 Mon Sep 17 00:00:00 2001 From: Howard Wu <9260812+howardwu@users.noreply.github.com> Date: Tue, 26 Dec 2023 16:48:26 -0800 Subject: [PATCH 053/298] Fix type compatibility compilation issues --- ledger/narwhal/batch-certificate/src/bytes.rs | 4 +-- ledger/narwhal/batch-certificate/src/lib.rs | 6 ++-- ledger/narwhal/batch-header/src/lib.rs | 34 ++++++++++++++----- 3 files changed, 31 insertions(+), 13 deletions(-) diff --git a/ledger/narwhal/batch-certificate/src/bytes.rs b/ledger/narwhal/batch-certificate/src/bytes.rs index 446a0d4193..baa793c1ff 100644 --- a/ledger/narwhal/batch-certificate/src/bytes.rs +++ b/ledger/narwhal/batch-certificate/src/bytes.rs @@ -32,7 +32,7 @@ impl FromBytes for BatchCertificate { // Read the number of signatures. let num_signatures = u32::read_le(&mut reader)?; // Ensure the number of signatures is within bounds. - if num_signatures as usize > Self::MAX_SIGNATURES { + if num_signatures > Self::MAX_SIGNATURES as u32 { return Err(error(format!( "Number of signatures ({num_signatures}) exceeds the maximum ({})", Self::MAX_SIGNATURES @@ -56,7 +56,7 @@ impl FromBytes for BatchCertificate { // Read the number of signatures. let num_signatures = u16::read_le(&mut reader)?; // Ensure the number of signatures is within bounds. - if num_signatures as usize > Self::MAX_SIGNATURES { + if num_signatures > Self::MAX_SIGNATURES { return Err(error(format!( "Number of signatures ({num_signatures}) exceeds the maximum ({})", Self::MAX_SIGNATURES diff --git a/ledger/narwhal/batch-certificate/src/lib.rs b/ledger/narwhal/batch-certificate/src/lib.rs index 3e9fede619..c053433e5c 100644 --- a/ledger/narwhal/batch-certificate/src/lib.rs +++ b/ledger/narwhal/batch-certificate/src/lib.rs @@ -54,7 +54,7 @@ pub enum BatchCertificate { impl BatchCertificate { /// The maximum number of signatures in a batch certificate. - pub const MAX_SIGNATURES: usize = BatchHeader::::MAX_CERTIFICATES; + pub const MAX_SIGNATURES: u16 = BatchHeader::::MAX_CERTIFICATES; } impl BatchCertificate { @@ -84,7 +84,7 @@ impl BatchCertificate { N::hash_bhp1024(&preimage.to_bits_le()) } // Ensure that the number of signatures is within bounds. - ensure!(signatures.len() <= Self::MAX_SIGNATURES, "Invalid number of signatures"); + ensure!(signatures.len() <= Self::MAX_SIGNATURES as usize, "Invalid number of signatures"); // Compute the certificate ID. if certificate_id != compute_certificate_id(batch_header.batch_id(), &signatures)? { bail!("Invalid batch certificate ID") @@ -103,7 +103,7 @@ impl BatchCertificate { /// Initializes a new batch certificate. pub fn from(batch_header: BatchHeader, signatures: IndexSet>) -> Result { // Ensure that the number of signatures is within bounds. - ensure!(signatures.len() <= Self::MAX_SIGNATURES, "Invalid number of signatures"); + ensure!(signatures.len() <= Self::MAX_SIGNATURES as usize, "Invalid number of signatures"); // Verify the signatures are valid. cfg_iter!(signatures).try_for_each(|signature| { diff --git a/ledger/narwhal/batch-header/src/lib.rs b/ledger/narwhal/batch-header/src/lib.rs index 8bfe2d8673..237406a4ec 100644 --- a/ledger/narwhal/batch-header/src/lib.rs +++ b/ledger/narwhal/batch-header/src/lib.rs @@ -94,13 +94,22 @@ impl BatchHeader { } // Ensure that the number of transmissions is within bounds. - ensure!(transmission_ids.len() <= Self::MAX_TRANSMISSIONS, "Invalid number of transmission ids"); + ensure!( + transmission_ids.len() <= Self::MAX_TRANSMISSIONS_PER_BATCH, + "Invalid number of transmission ids ({})", + transmission_ids.len() + ); // Ensure that the number of previous certificate IDs is within bounds. - ensure!(previous_certificate_ids.len() <= Self::MAX_CERTIFICATES, "Invalid number of previous certificate IDs"); + ensure!( + previous_certificate_ids.len() <= Self::MAX_CERTIFICATES as usize, + "Invalid number of previous certificate IDs ({})", + previous_certificate_ids.len() + ); // Ensure the number of last election certificate IDs is within bounds. ensure!( - last_election_certificate_ids.len() <= Self::MAX_CERTIFICATES, - "Invalid number of last election certificate IDs" + last_election_certificate_ids.len() <= Self::MAX_CERTIFICATES as usize, + "Invalid number of last election certificate IDs ({})", + last_election_certificate_ids.len() ); // Retrieve the address. @@ -154,13 +163,22 @@ impl BatchHeader { } // Ensure that the number of transmissions is within bounds. - ensure!(transmission_ids.len() <= Self::MAX_TRANSMISSIONS, "Invalid number of transmission ids"); + ensure!( + transmission_ids.len() <= Self::MAX_TRANSMISSIONS_PER_BATCH, + "Invalid number of transmission ids ({})", + transmission_ids.len() + ); // Ensure that the number of previous certificate IDs is within bounds. - ensure!(previous_certificate_ids.len() <= Self::MAX_CERTIFICATES, "Invalid number of previous certificate IDs"); + ensure!( + previous_certificate_ids.len() <= Self::MAX_CERTIFICATES as usize, + "Invalid number of previous certificate IDs ({})", + previous_certificate_ids.len() + ); // Ensure the number of last election certificate IDs is within bounds. ensure!( - last_election_certificate_ids.len() <= Self::MAX_CERTIFICATES, - "Invalid number of last election certificate IDs" + last_election_certificate_ids.len() <= Self::MAX_CERTIFICATES as usize, + "Invalid number of last election certificate IDs ({})", + last_election_certificate_ids.len() ); // Compute the batch ID. From c2acc5f1848c517c89b545b670e526f31cbb5aab Mon Sep 17 00:00:00 2001 From: Howard Wu <9260812+howardwu@users.noreply.github.com> Date: Tue, 26 Dec 2023 21:36:40 -0800 Subject: [PATCH 054/298] Update synthesizer/process/src/stack/call/mod.rs Signed-off-by: Howard Wu <9260812+howardwu@users.noreply.github.com> --- synthesizer/process/src/stack/call/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/synthesizer/process/src/stack/call/mod.rs b/synthesizer/process/src/stack/call/mod.rs index ff31b63684..8fa4d0eef5 100644 --- a/synthesizer/process/src/stack/call/mod.rs +++ b/synthesizer/process/src/stack/call/mod.rs @@ -268,7 +268,7 @@ impl CallTrait for Call { // Push the request onto the call stack. call_stack.push(request.clone())?; - // Execute the request. + // Evaluate the request. let response = substack.evaluate_function::(call_stack, console_caller)?; // Return the request and response. From 66a56544359b069bf0a7cdfa9106ef1cfe621423 Mon Sep 17 00:00:00 2001 From: Alessandro Coglio Date: Tue, 26 Dec 2023 22:28:53 -0800 Subject: [PATCH 055/298] Use is_zero(). --- circuit/types/field/src/square_root.rs | 2 +- circuit/types/group/src/helpers/from_x_coordinate.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/circuit/types/field/src/square_root.rs b/circuit/types/field/src/square_root.rs index ed7364a6df..d6abc7b09e 100644 --- a/circuit/types/field/src/square_root.rs +++ b/circuit/types/field/src/square_root.rs @@ -119,7 +119,7 @@ impl Field { let second_root = first_root.clone().neg(); // The error flag is set iff self is a non-square, i.e. it is neither zero nor a non-zero square. - let is_nonzero = self.is_not_equal(&Field::zero()); + let is_nonzero = !self.is_zero(); let error_flag = is_nonzero.bitand(is_nonzero_square.not()); (error_flag, first_root, second_root) diff --git a/circuit/types/group/src/helpers/from_x_coordinate.rs b/circuit/types/group/src/helpers/from_x_coordinate.rs index 1a6c4a0f6c..42bb31352f 100644 --- a/circuit/types/group/src/helpers/from_x_coordinate.rs +++ b/circuit/types/group/src/helpers/from_x_coordinate.rs @@ -78,8 +78,8 @@ impl Group { } let point1_times_order = order_bits_be_constants.mul(point1); let point2_times_order = order_bits_be_constants.mul(point2); - let point1_is_in_subgroup = point1_times_order.is_equal(&Self::zero()); - let point2_is_in_subgroup = point2_times_order.is_equal(&Self::zero()); + let point1_is_in_subgroup = point1_times_order.is_zero(); + let point2_is_in_subgroup = point2_times_order.is_zero(); // We select y1 if (x, y1) is in the subgroup (which implies that (x, y2) is not in the subgroup), // or y2 if (x, y2) is in the subgroup (which implies that (x, y1) is not in the subgroup), From e4886be9e3d9c98c78ccb12d94b53371e157b066 Mon Sep 17 00:00:00 2001 From: Alessandro Coglio Date: Tue, 26 Dec 2023 22:31:15 -0800 Subject: [PATCH 056/298] Use is_one(). --- circuit/types/field/src/square_root.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/circuit/types/field/src/square_root.rs b/circuit/types/field/src/square_root.rs index d6abc7b09e..56dbef4623 100644 --- a/circuit/types/field/src/square_root.rs +++ b/circuit/types/field/src/square_root.rs @@ -89,7 +89,7 @@ impl Field { // Use Euler's criterion: self is a non-zero square iff self^((p-1)/2) is 1. let euler = self.pow(modulus_minus_one_div_two); - let is_nonzero_square = euler.is_equal(&Field::one()); + let is_nonzero_square = euler.is_one(); // Calculate the witness for the first square result. // The called function square_root returns the square root closer to 0. From b4e1b096a534639a464fae104b9dc20d9473b7c8 Mon Sep 17 00:00:00 2001 From: Alessandro Coglio Date: Tue, 26 Dec 2023 22:41:48 -0800 Subject: [PATCH 057/298] Use Vec::with_capacity(). --- circuit/types/group/src/helpers/from_x_coordinate.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/circuit/types/group/src/helpers/from_x_coordinate.rs b/circuit/types/group/src/helpers/from_x_coordinate.rs index 42bb31352f..374549a940 100644 --- a/circuit/types/group/src/helpers/from_x_coordinate.rs +++ b/circuit/types/group/src/helpers/from_x_coordinate.rs @@ -72,7 +72,7 @@ impl Group { // to get around the issue that the subgroup order is not of Scalar type. let order = E::ScalarField::modulus(); let order_bits_be = order.to_bits_be(); - let mut order_bits_be_constants = Vec::new(); + let mut order_bits_be_constants = Vec::with_capacity(order_bits_be.len()); for bit in order_bits_be.iter() { order_bits_be_constants.push(Boolean::constant(*bit)); } From 3435f202632e019239c60875aa05c51601da55bc Mon Sep 17 00:00:00 2001 From: Alessandro Coglio Date: Tue, 26 Dec 2023 22:48:45 -0800 Subject: [PATCH 058/298] Change result order of from_x_coordinate_flagged. --- circuit/program/src/data/literal/cast_lossy/field.rs | 2 +- circuit/types/group/src/helpers/from_x_coordinate.rs | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/circuit/program/src/data/literal/cast_lossy/field.rs b/circuit/program/src/data/literal/cast_lossy/field.rs index e9e7e054d6..310ec630cc 100644 --- a/circuit/program/src/data/literal/cast_lossy/field.rs +++ b/circuit/program/src/data/literal/cast_lossy/field.rs @@ -65,7 +65,7 @@ impl CastLossy> for Field { debug_assert!(console::Group::from_x_coordinate( as console::One>::one()).is_err()); // Attempt to find a group element with self as the x-coordinate. - let (x_is_not_in_group, point_with_x) = Group::from_x_coordinate_flagged(self.clone()); + let (point_with_x, x_is_not_in_group) = Group::from_x_coordinate_flagged(self.clone()); // Determine if the field element is zero. let is_x_zero = self.is_zero(); diff --git a/circuit/types/group/src/helpers/from_x_coordinate.rs b/circuit/types/group/src/helpers/from_x_coordinate.rs index 374549a940..e6e4245f32 100644 --- a/circuit/types/group/src/helpers/from_x_coordinate.rs +++ b/circuit/types/group/src/helpers/from_x_coordinate.rs @@ -30,7 +30,7 @@ impl Group { /// Initializes an affine group element from a given x-coordinate field element. /// Also returns an error flag, set if there is no group element with the given x-coordinate; /// in that case, the returned point is `(0, 0)`, but immaterial. - pub fn from_x_coordinate_flagged(x: Field) -> (Boolean, Self) { + pub fn from_x_coordinate_flagged(x: Field) -> (Self, Boolean) { // Obtain the A and D coefficients of the elliptic curve. let a = Field::constant(console::Field::new(E::EDWARDS_A)); let d = Field::constant(console::Field::new(E::EDWARDS_D)); @@ -94,7 +94,7 @@ impl Group { let neither_in_subgroup = point1_is_in_subgroup.not().bitand(point2_is_in_subgroup.not()); let error_flag = yy_is_not_square.bitor(&neither_in_subgroup); - (error_flag, Self { x, y }) + (Self { x, y }, error_flag) } } @@ -150,7 +150,7 @@ mod tests { // Compute error flag and point in circuit-land. let input = Field::::new(mode, x); Circuit::scope(format!("{mode} {i}"), || { - let (candidate_error_flag, candidate_point) = Group::from_x_coordinate_flagged(input); + let (candidate_point, candidate_error_flag) = Group::from_x_coordinate_flagged(input); assert_eq!(expected_error_flag, candidate_error_flag.eject_value()); assert_eq!(expected_point, candidate_point.eject_value()); assert_scope!(num_constants, num_public, num_private, num_constraints); From c5a5d535e6a63a0ad2646c3d62e8f7514dcb557e Mon Sep 17 00:00:00 2001 From: Alessandro Coglio Date: Tue, 26 Dec 2023 22:54:51 -0800 Subject: [PATCH 059/298] Change result order of square_roots_flagged_nondeterministic. --- circuit/types/field/src/square_root.rs | 6 +++--- circuit/types/group/src/helpers/from_x_coordinate.rs | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/circuit/types/field/src/square_root.rs b/circuit/types/field/src/square_root.rs index 56dbef4623..27dd44f9dd 100644 --- a/circuit/types/field/src/square_root.rs +++ b/circuit/types/field/src/square_root.rs @@ -80,7 +80,7 @@ impl Field { /// This nondeterminism saves constraints, but generally this circuit should be only used /// as part of larger circuits for which the nondeterminism in the order of the two roots does not matter, /// and where the larger circuits represent deterministic computations despite this internal nondeterminism. - pub fn square_roots_flagged_nondeterministic(&self) -> (Boolean, Self, Self) { + pub fn square_roots_flagged_nondeterministic(&self) -> (Self, Self, Boolean) { // Obtain (p-1)/2, as a constant field element. let modulus_minus_one_div_two = match E::BaseField::from_bigint(E::BaseField::modulus_minus_one_div_two()) { Some(modulus_minus_one_div_two) => Field::constant(console::Field::new(modulus_minus_one_div_two)), @@ -122,7 +122,7 @@ impl Field { let is_nonzero = !self.is_zero(); let error_flag = is_nonzero.bitand(is_nonzero_square.not()); - (error_flag, first_root, second_root) + (first_root, second_root, error_flag) } } @@ -220,7 +220,7 @@ mod tests { // Compute square roots and error flag in circuit-land. let input = Field::::new(mode, given); Circuit::scope(name, || { - let (candidate_error_flag, candidate_first_root, candidate_second_root) = + let (candidate_first_root, candidate_second_root, candidate_error_flag) = input.square_roots_flagged_nondeterministic(); // Although the order of the roots is unspecified in the circuit, // the witness values are in a fixed order (first positive, then negative). diff --git a/circuit/types/group/src/helpers/from_x_coordinate.rs b/circuit/types/group/src/helpers/from_x_coordinate.rs index e6e4245f32..c2093d3d83 100644 --- a/circuit/types/group/src/helpers/from_x_coordinate.rs +++ b/circuit/types/group/src/helpers/from_x_coordinate.rs @@ -51,7 +51,7 @@ impl Group { // Compute both square roots of y^2, in no specified order, with a flag saying whether y^2 is a square or not. // That is, finish solving the curve equation for y. // If the x-coordinate line does not intersect the elliptic curve, this returns (1, 0, 0). - let (yy_is_not_square, y1, y2) = yy.square_roots_flagged_nondeterministic(); + let (y1, y2, yy_is_not_square) = yy.square_roots_flagged_nondeterministic(); // Form the two points, which are on the curve if yy_is_not_square is false. // Note that the Group type is not restricted to the points in the subgroup or even on the curve; From de2579ac79691fe070729bab5ad51175191d93ac Mon Sep 17 00:00:00 2001 From: ljedrz Date: Wed, 20 Dec 2023 12:45:33 +0100 Subject: [PATCH 060/298] perf: optimize the split into (un)verified solutions Signed-off-by: ljedrz --- ledger/src/advance.rs | 56 ++++++++++++++++++++++++++++++------------- 1 file changed, 39 insertions(+), 17 deletions(-) diff --git a/ledger/src/advance.rs b/ledger/src/advance.rs index ee49488d93..b3dab14e3a 100644 --- a/ledger/src/advance.rs +++ b/ledger/src/advance.rs @@ -115,7 +115,7 @@ impl> Ledger { previous_block: &Block, subdag: Option<&Subdag>, candidate_ratifications: Vec>, - candidate_solutions: Vec>, + mut candidate_solutions: Vec>, candidate_transactions: Vec>, ) -> Result<(Header, Ratifications, Option>, Transactions, Vec)> { @@ -127,26 +127,48 @@ impl> Ledger { let coinbase_verifying_key = self.coinbase_puzzle.coinbase_verifying_key(); // Retrieve the latest epoch challenge. let latest_epoch_challenge = self.latest_epoch_challenge()?; - // TODO: For mainnet - Add `aborted_solution_ids` to the block. And optimize this logic. - // Verify the candidate solutions. - let verification_results: Vec<_> = cfg_into_iter!(candidate_solutions) - .map(|solution| { - ( - solution, - solution - .verify(coinbase_verifying_key, &latest_epoch_challenge, self.latest_proof_target()) - .unwrap_or(false), - ) - }) - .collect(); + // TODO: For mainnet - Add `aborted_solution_ids` to the block. // Separate the candidate solutions into valid and aborted solutions. let mut valid_candidate_solutions = Vec::with_capacity(N::MAX_SOLUTIONS); let mut aborted_candidate_solutions = Vec::new(); - for (solution, is_valid) in verification_results.into_iter() { - if is_valid && valid_candidate_solutions.len() < N::MAX_SOLUTIONS { - valid_candidate_solutions.push(solution); + // Reverse the candidate solutions in order to be able to chunk them more efficiently. + candidate_solutions.reverse(); + // Verify the candidate solutions in chunks. This is done so that we can potentially + // perform these operations in parallel while keeping the end result deterministic. + let chunk_size = 16; + while !candidate_solutions.is_empty() { + // Check if the collection of valid solutions is full. + if valid_candidate_solutions.len() >= N::MAX_SOLUTIONS { + // If that's the case, mark the rest of the candidates as aborted. + aborted_candidate_solutions.extend(candidate_solutions.into_iter().rev()); + break; + } + + // Split off a chunk of the candidate solutions. + let candidates_chunk = if candidate_solutions.len() > chunk_size { + candidate_solutions.split_off(candidate_solutions.len() - chunk_size) } else { - aborted_candidate_solutions.push(solution); + std::mem::take(&mut candidate_solutions) + }; + // Verify the solutions in the chunk. + let verification_results: Vec<_> = cfg_into_iter!(candidates_chunk) + .rev() + .map(|solution| { + ( + solution, + solution + .verify(coinbase_verifying_key, &latest_epoch_challenge, self.latest_proof_target()) + .unwrap_or(false), + ) + }) + .collect(); + // Process the results of the verification. + for (solution, is_valid) in verification_results.into_iter() { + if is_valid && valid_candidate_solutions.len() < N::MAX_SOLUTIONS { + valid_candidate_solutions.push(solution); + } else { + aborted_candidate_solutions.push(solution); + } } } From f31b4c03b8a44c4238d75b2c61297193549176b0 Mon Sep 17 00:00:00 2001 From: ljedrz Date: Thu, 28 Dec 2023 10:59:41 +0100 Subject: [PATCH 061/298] refactor: isolate and abstract the candidate solution processing logic Signed-off-by: ljedrz --- ledger/src/advance.rs | 105 +++++++++++++++++++++++++----------------- 1 file changed, 62 insertions(+), 43 deletions(-) diff --git a/ledger/src/advance.rs b/ledger/src/advance.rs index b3dab14e3a..99521e72fc 100644 --- a/ledger/src/advance.rs +++ b/ledger/src/advance.rs @@ -107,6 +107,61 @@ impl> Ledger { } } +/// Splits candidate solutions into a collection of accepted ones and aborted ones. +fn split_candidate_solutions( + mut candidate_solutions: Vec, + max_solutions: usize, + verification_fn: F, +) -> (Vec, Vec) +where + T: Sized + Send, + F: Fn(&T) -> bool + Send + Sync, +{ + // Separate the candidate solutions into valid and aborted solutions. + let mut valid_candidate_solutions = Vec::with_capacity(max_solutions); + let mut aborted_candidate_solutions = Vec::new(); + // Reverse the candidate solutions in order to be able to chunk them more efficiently. + candidate_solutions.reverse(); + // Verify the candidate solutions in chunks. This is done so that we can potentially + // perform these operations in parallel while keeping the end result deterministic. + let chunk_size = 16; + while !candidate_solutions.is_empty() { + // Check if the collection of valid solutions is full. + if valid_candidate_solutions.len() >= max_solutions { + // If that's the case, mark the rest of the candidates as aborted. + aborted_candidate_solutions.extend(candidate_solutions.into_iter().rev()); + break; + } + + // Split off a chunk of the candidate solutions. + let candidates_chunk = if candidate_solutions.len() > chunk_size { + candidate_solutions.split_off(candidate_solutions.len() - chunk_size) + } else { + std::mem::take(&mut candidate_solutions) + }; + + // Verify the solutions in the chunk. + let verification_results: Vec<_> = cfg_into_iter!(candidates_chunk) + .rev() + .map(|solution| { + let verified = verification_fn(&solution); + (solution, verified) + }) + .collect(); + + // Process the results of the verification. + for (solution, is_valid) in verification_results.into_iter() { + if is_valid && valid_candidate_solutions.len() < max_solutions { + valid_candidate_solutions.push(solution); + } else { + aborted_candidate_solutions.push(solution); + } + } + } + + (valid_candidate_solutions, aborted_candidate_solutions) +} + impl> Ledger { /// Constructs a block template for the next block in the ledger. #[allow(clippy::type_complexity)] @@ -115,7 +170,7 @@ impl> Ledger { previous_block: &Block, subdag: Option<&Subdag>, candidate_ratifications: Vec>, - mut candidate_solutions: Vec>, + candidate_solutions: Vec>, candidate_transactions: Vec>, ) -> Result<(Header, Ratifications, Option>, Transactions, Vec)> { @@ -129,48 +184,12 @@ impl> Ledger { let latest_epoch_challenge = self.latest_epoch_challenge()?; // TODO: For mainnet - Add `aborted_solution_ids` to the block. // Separate the candidate solutions into valid and aborted solutions. - let mut valid_candidate_solutions = Vec::with_capacity(N::MAX_SOLUTIONS); - let mut aborted_candidate_solutions = Vec::new(); - // Reverse the candidate solutions in order to be able to chunk them more efficiently. - candidate_solutions.reverse(); - // Verify the candidate solutions in chunks. This is done so that we can potentially - // perform these operations in parallel while keeping the end result deterministic. - let chunk_size = 16; - while !candidate_solutions.is_empty() { - // Check if the collection of valid solutions is full. - if valid_candidate_solutions.len() >= N::MAX_SOLUTIONS { - // If that's the case, mark the rest of the candidates as aborted. - aborted_candidate_solutions.extend(candidate_solutions.into_iter().rev()); - break; - } - - // Split off a chunk of the candidate solutions. - let candidates_chunk = if candidate_solutions.len() > chunk_size { - candidate_solutions.split_off(candidate_solutions.len() - chunk_size) - } else { - std::mem::take(&mut candidate_solutions) - }; - // Verify the solutions in the chunk. - let verification_results: Vec<_> = cfg_into_iter!(candidates_chunk) - .rev() - .map(|solution| { - ( - solution, - solution - .verify(coinbase_verifying_key, &latest_epoch_challenge, self.latest_proof_target()) - .unwrap_or(false), - ) - }) - .collect(); - // Process the results of the verification. - for (solution, is_valid) in verification_results.into_iter() { - if is_valid && valid_candidate_solutions.len() < N::MAX_SOLUTIONS { - valid_candidate_solutions.push(solution); - } else { - aborted_candidate_solutions.push(solution); - } - } - } + let (valid_candidate_solutions, _aborted_candidate_solutions) = + split_candidate_solutions(candidate_solutions, N::MAX_SOLUTIONS, |solution| { + solution + .verify(coinbase_verifying_key, &latest_epoch_challenge, self.latest_proof_target()) + .unwrap_or(false) + }); // Check if there are any valid solutions. match valid_candidate_solutions.is_empty() { From 95af1d21f27c3fa7e035109af487e854558e0845 Mon Sep 17 00:00:00 2001 From: ljedrz Date: Thu, 28 Dec 2023 11:31:59 +0100 Subject: [PATCH 062/298] tests: add test_split_candidate_solutions Signed-off-by: ljedrz --- ledger/src/advance.rs | 2 +- ledger/src/tests.rs | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/ledger/src/advance.rs b/ledger/src/advance.rs index 99521e72fc..30d7576b70 100644 --- a/ledger/src/advance.rs +++ b/ledger/src/advance.rs @@ -108,7 +108,7 @@ impl> Ledger { } /// Splits candidate solutions into a collection of accepted ones and aborted ones. -fn split_candidate_solutions( +pub fn split_candidate_solutions( mut candidate_solutions: Vec, max_solutions: usize, verification_fn: F, diff --git a/ledger/src/tests.rs b/ledger/src/tests.rs index 273394ac95..997a3a875e 100644 --- a/ledger/src/tests.rs +++ b/ledger/src/tests.rs @@ -13,6 +13,7 @@ // limitations under the License. use crate::{ + advance::split_candidate_solutions, test_helpers::{CurrentLedger, CurrentNetwork}, RecordsFilter, }; @@ -828,3 +829,20 @@ finalize foo2: assert!(ledger.vm.transaction_store().contains_transaction_id(&deployment_1_id).unwrap()); assert!(ledger.vm.block_store().contains_rejected_or_aborted_transaction_id(&deployment_2_id).unwrap()); } + +#[test] +fn test_split_candidate_solutions() { + let rng = &mut TestRng::default(); + + let max_solutions = CurrentNetwork::MAX_SOLUTIONS; + + const ITERATIONS: usize = 1_000; + + for _ in 0..ITERATIONS { + let num_candidates = rng.gen_range(0..max_solutions * 2); + let candidate_solutions: Vec = rng.sample_iter(Standard).take(num_candidates).collect(); + + let (_accepted, _aborted) = + split_candidate_solutions(candidate_solutions, max_solutions, |candidate| candidate % 2 == 0); + } +} From 5859f714e10a816c9663cf28b9c4ee676af3b05c Mon Sep 17 00:00:00 2001 From: Victor Sint Nicolaas Date: Thu, 28 Dec 2023 12:48:35 +0100 Subject: [PATCH 063/298] Only declare the public 1 variable once. Both R1CS and Assignment added one. --- algorithms/src/errors.rs | 3 +++ algorithms/src/r1cs/linear_combination.rs | 7 ++++++- .../varuna/data_structures/test_circuit.rs | 7 +++++-- algorithms/src/snark/varuna/tests.rs | 21 ++++++++----------- algorithms/src/snark/varuna/varuna.rs | 16 ++++++++++---- circuit/environment/src/helpers/assignment.rs | 16 ++++++++------ circuit/environment/src/helpers/converter.rs | 17 +++++++++------ 7 files changed, 56 insertions(+), 31 deletions(-) diff --git a/algorithms/src/errors.rs b/algorithms/src/errors.rs index a1dedf9f12..dd932b2b28 100644 --- a/algorithms/src/errors.rs +++ b/algorithms/src/errors.rs @@ -41,6 +41,9 @@ pub enum SNARKError { #[error("Batch size was different between public input and proof")] BatchSizeMismatch, + #[error("Public input size was different from the circuit")] + PublicInputSizeMismatch, + #[error("Circuit not found")] CircuitNotFound, } diff --git a/algorithms/src/r1cs/linear_combination.rs b/algorithms/src/r1cs/linear_combination.rs index b0d0a38763..20465fca64 100644 --- a/algorithms/src/r1cs/linear_combination.rs +++ b/algorithms/src/r1cs/linear_combination.rs @@ -114,7 +114,12 @@ impl AddAssign<(F, Variable)> for LinearCombination { #[inline] fn add_assign(&mut self, (coeff, var): (F, Variable)) { match self.get_var_loc(&var) { - Ok(found) => self.0[found].1 += &coeff, + Ok(found) => { + self.0[found].1 += &coeff; + if self.0[found].1.is_zero() { + self.0.remove(found); + } + } Err(not_found) => self.0.insert(not_found, (var, coeff)), } } diff --git a/algorithms/src/snark/varuna/data_structures/test_circuit.rs b/algorithms/src/snark/varuna/data_structures/test_circuit.rs index e269ef7d46..cdd93694a9 100644 --- a/algorithms/src/snark/varuna/data_structures/test_circuit.rs +++ b/algorithms/src/snark/varuna/data_structures/test_circuit.rs @@ -91,7 +91,9 @@ impl TestCircuit { num_variables: usize, rng: &mut R, ) -> (Self, Vec) { - let mut public_inputs: Vec = Vec::with_capacity(mul_depth); + let mut public_inputs: Vec = Vec::with_capacity(1 + mul_depth); + public_inputs.push(F::one()); + let a = F::rand(rng); let b = F::rand(rng); @@ -114,7 +116,8 @@ impl TestCircuit { num_constraints: usize, num_variables: usize, ) -> (Self, Vec) { - let mut public_inputs: Vec = Vec::with_capacity(mul_depth); + let mut public_inputs: Vec = Vec::with_capacity(1 + mul_depth); + public_inputs.push(F::one()); let a = F::from(a); let b = F::from(b); for j in 1..(mul_depth + 1) { diff --git a/algorithms/src/snark/varuna/tests.rs b/algorithms/src/snark/varuna/tests.rs index 2d2f20bccb..2271c9f703 100644 --- a/algorithms/src/snark/varuna/tests.rs +++ b/algorithms/src/snark/varuna/tests.rs @@ -26,6 +26,7 @@ mod varuna { }, traits::{AlgebraicSponge, SNARK}, }; + use std::collections::BTreeMap; use snarkvm_curves::bls12_377::{Bls12_377, Fq, Fr}; @@ -57,6 +58,8 @@ mod varuna { let mul_depth = 1; println!("running test with SM::ZK: {}, mul_depth: {}, num_constraints: {}, num_variables: {}", $snark_mode::ZK, mul_depth + i, num_constraints + i, num_variables + i); let (circ, public_inputs) = TestCircuit::gen_rand(mul_depth + i, num_constraints + i, num_variables + i, rng); + let mut fake_inputs = public_inputs.clone(); + fake_inputs[public_inputs.len() - 1] = random; let (index_pk, index_vk) = $snark_inst::circuit_setup(&universal_srs, &circ).unwrap(); println!("Called circuit setup"); @@ -76,7 +79,7 @@ mod varuna { assert!($snark_inst::verify(universal_verifier, &fs_parameters, &index_vk, public_inputs, &proof).unwrap()); println!("Called verifier"); eprintln!("\nShould not verify (i.e. verifier messages should print below):"); - assert!(!$snark_inst::verify(universal_verifier, &fs_parameters, &index_vk, [random, random], &proof).unwrap()); + assert!(!$snark_inst::verify(universal_verifier, &fs_parameters, &index_vk, fake_inputs, &proof).unwrap()); } for circuit_batch_size in (0..4).map(|i| 2usize.pow(i)) { @@ -129,7 +132,8 @@ mod varuna { for instance_input in vks_to_inputs.values() { let mut fake_instance_input = Vec::with_capacity(instance_input.len()); for input in instance_input.iter() { - let fake_input: Vec<_> = (0..input.len()).map(|_| Fr::rand(rng)).collect(); + let mut fake_input = input.clone(); + fake_input[input.len() - 1] = Fr::rand(rng); fake_instance_input.push(fake_input); } fake_instance_inputs.push(fake_instance_input); @@ -332,6 +336,8 @@ mod varuna_hiding { for _ in 0..num_times { let mul_depth = 2; let (circuit, public_inputs) = TestCircuit::gen_rand(mul_depth, num_constraints, num_variables, rng); + let mut fake_inputs = public_inputs.clone(); + fake_inputs[public_inputs.len() - 1] = Fr::rand(rng); let (index_pk, index_vk) = VarunaInst::circuit_setup(&universal_srs, &circuit).unwrap(); println!("Called circuit setup"); @@ -342,16 +348,7 @@ mod varuna_hiding { assert!(VarunaInst::verify(universal_verifier, &fs_parameters, &index_vk, public_inputs, &proof).unwrap()); println!("Called verifier"); eprintln!("\nShould not verify (i.e. verifier messages should print below):"); - assert!( - !VarunaInst::verify( - universal_verifier, - &fs_parameters, - &index_vk, - [Fr::rand(rng), Fr::rand(rng)], - &proof - ) - .unwrap() - ); + assert!(!VarunaInst::verify(universal_verifier, &fs_parameters, &index_vk, fake_inputs, &proof).unwrap()); } } diff --git a/algorithms/src/snark/varuna/varuna.rs b/algorithms/src/snark/varuna/varuna.rs index df01ee4425..fc43ded6e9 100644 --- a/algorithms/src/snark/varuna/varuna.rs +++ b/algorithms/src/snark/varuna/varuna.rs @@ -670,17 +670,25 @@ where let input_fields = public_inputs_i .iter() - .map(|input| input.borrow().to_field_elements()) + .map(|input| { + let input = input.borrow().to_field_elements()?; + ensure!(input.len() > 0); + ensure!(input[0] == E::Fr::one()); + if input.len() > input_domain.size() { + bail!(SNARKError::PublicInputSizeMismatch); + } + Ok(input) + }) .collect::, _>>()?; let (padded_public_inputs_i, parsed_public_inputs_i): (Vec<_>, Vec<_>) = { input_fields .iter() .map(|input| { - let mut new_input = Vec::with_capacity((1 + input.len()).max(input_domain.size())); - new_input.push(E::Fr::one()); + let input_len = input.len().max(input_domain.size()); + let mut new_input = Vec::with_capacity(input_len); new_input.extend_from_slice(input); - new_input.resize(input.len().max(input_domain.size()), E::Fr::zero()); + new_input.resize(input_len, E::Fr::zero()); if cfg!(debug_assertions) { println!("Number of padded public variables: {}", new_input.len()); } diff --git a/circuit/environment/src/helpers/assignment.rs b/circuit/environment/src/helpers/assignment.rs index acea1bc67e..0d0bffc73f 100644 --- a/circuit/environment/src/helpers/assignment.rs +++ b/circuit/environment/src/helpers/assignment.rs @@ -166,14 +166,18 @@ impl snarkvm_algorithms::r1cs::ConstraintSynthesizer for Assig assert_eq!(0, cs.num_private_variables()); assert_eq!(0, cs.num_constraints()); + let result = converter.public.insert(0, CS::one()); + assert!(result.is_none(), "Overwrote an existing public variable in the converter"); + // Allocate the public variables. - for (i, (index, value)) in self.public.iter().enumerate() { - assert_eq!(i as u64, *index, "Public variables in first system must be processed in lexicographic order"); + // NOTE: we skip the first public `One` variable because we already allocated it in the `ConstraintSystem` constructor. + for (i, (index, value)) in self.public.iter().skip(1).enumerate() { + assert_eq!((i + 1) as u64, *index, "Public vars in first system must be processed in lexicographic order"); let gadget = cs.alloc_input(|| format!("Public {i}"), || Ok(*value))?; assert_eq!( - snarkvm_algorithms::r1cs::Index::Public((index + 1) as usize), + snarkvm_algorithms::r1cs::Index::Public(*index as usize), gadget.get_unchecked(), "Public variables in the second system must match the first system (with an off-by-1 for the public case)" ); @@ -218,7 +222,7 @@ impl snarkvm_algorithms::r1cs::ConstraintSynthesizer for Assig AssignmentVariable::Public(index) => { let gadget = converter.public.get(index).unwrap(); assert_eq!( - snarkvm_algorithms::r1cs::Index::Public((index + 1) as usize), + snarkvm_algorithms::r1cs::Index::Public(*index as usize), gadget.get_unchecked(), "Failed during constraint translation. The public variable in the second system must match the first system (with an off-by-1 for the public case)" ); @@ -257,7 +261,7 @@ impl snarkvm_algorithms::r1cs::ConstraintSynthesizer for Assig } // Ensure the given `cs` matches in size with the first system. - assert_eq!(self.num_public() + 1, cs.num_public_variables() as u64); + assert_eq!(self.num_public(), cs.num_public_variables() as u64); assert_eq!(self.num_private(), cs.num_private_variables() as u64); assert_eq!(self.num_constraints(), cs.num_constraints() as u64); @@ -308,7 +312,7 @@ mod tests { assignment.generate_constraints(&mut cs).unwrap(); { use snarkvm_algorithms::r1cs::ConstraintSystem; - assert_eq!(assignment.num_public() + 1, cs.num_public_variables() as u64); + assert_eq!(assignment.num_public(), cs.num_public_variables() as u64); assert_eq!(assignment.num_private(), cs.num_private_variables() as u64); assert_eq!(assignment.num_constraints(), cs.num_constraints() as u64); assert!(cs.is_satisfied()); diff --git a/circuit/environment/src/helpers/converter.rs b/circuit/environment/src/helpers/converter.rs index 2466c5954d..6347d13f4c 100644 --- a/circuit/environment/src/helpers/converter.rs +++ b/circuit/environment/src/helpers/converter.rs @@ -47,21 +47,26 @@ impl R1CS { assert_eq!(0, cs.num_private_variables()); assert_eq!(0, cs.num_constraints()); + let result = converter.public.insert(0, CS::one()); + assert!(result.is_none(), "Overwrote an existing public variable in the converter"); + // Allocate the public variables. - for (i, public) in self.to_public_variables().iter().enumerate() { + // NOTE: we skip the first public `One` variable because we already allocated it in the `ConstraintSystem` constructor. + for (i, public) in self.to_public_variables().iter().skip(1).enumerate() { match public { Variable::Public(index_value) => { let (index, value) = index_value.as_ref(); assert_eq!( - i as u64, *index, - "Public variables in first system must be processed in lexicographic order" + (i + 1) as u64, + *index, + "Public vars in first system must be processed in lexicographic order" ); let gadget = cs.alloc_input(|| format!("Public {i}"), || Ok(*value))?; assert_eq!( - snarkvm_algorithms::r1cs::Index::Public((index + 1) as usize), + snarkvm_algorithms::r1cs::Index::Public(*index as usize), gadget.get_unchecked(), "Public variables in the second system must match the first system (with an off-by-1 for the public case)" ); @@ -165,7 +170,7 @@ impl R1CS { } // Ensure the given `cs` matches in size with the first system. - assert_eq!(self.num_public() + 1, cs.num_public_variables() as u64); + assert_eq!(self.num_public(), cs.num_public_variables() as u64); assert_eq!(self.num_private(), cs.num_private_variables() as u64); assert_eq!(self.num_constraints(), cs.num_constraints() as u64); @@ -211,7 +216,7 @@ mod tests { Circuit.generate_constraints(&mut cs).unwrap(); { use snarkvm_algorithms::r1cs::ConstraintSystem; - assert_eq!(Circuit::num_public() + 1, cs.num_public_variables() as u64); + assert_eq!(Circuit::num_public(), cs.num_public_variables() as u64); assert_eq!(Circuit::num_private(), cs.num_private_variables() as u64); assert_eq!(Circuit::num_constraints(), cs.num_constraints() as u64); assert!(cs.is_satisfied()); From a9f348306279c47c47613b7d444cc090a0f73bb4 Mon Sep 17 00:00:00 2001 From: Victor Sint Nicolaas Date: Thu, 28 Dec 2023 21:38:08 +0100 Subject: [PATCH 064/298] Sample ExternalRecord in sample_value --- synthesizer/process/src/stack/call/mod.rs | 22 ++-------------------- synthesizer/process/src/stack/mod.rs | 5 ++++- 2 files changed, 6 insertions(+), 21 deletions(-) diff --git a/synthesizer/process/src/stack/call/mod.rs b/synthesizer/process/src/stack/call/mod.rs index 8fa4d0eef5..013b1d0ef5 100644 --- a/synthesizer/process/src/stack/call/mod.rs +++ b/synthesizer/process/src/stack/call/mod.rs @@ -12,17 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -use crate::{ - stack::{ - Address, - ValueType::{ExternalRecord, Record}, - }, - CallStack, - Registers, - RegistersCall, - StackEvaluate, - StackExecute, -}; +use crate::{stack::Address, CallStack, Registers, RegistersCall, StackEvaluate, StackExecute}; use aleo_std::prelude::{finish, lap, timer}; use console::{network::prelude::*, program::Request}; use synthesizer_program::{ @@ -291,15 +281,7 @@ impl CallTrait for Call { let outputs = function .outputs() .iter() - .map(|output| match output.value_type() { - ExternalRecord(locator) => { - // Retrieve the external stack. - let stack = substack.get_external_stack(locator.program_id())?; - // Sample the output. - stack.sample_value(&address, &Record(*locator.resource()), rng) - } - _ => substack.sample_value(&address, output.value_type(), rng), - }) + .map(|output| substack.sample_value(&address, output.value_type(), rng)) .collect::>>()?; // Retrieve the output operands. diff --git a/synthesizer/process/src/stack/mod.rs b/synthesizer/process/src/stack/mod.rs index 04bb867b91..c432938a82 100644 --- a/synthesizer/process/src/stack/mod.rs +++ b/synthesizer/process/src/stack/mod.rs @@ -310,7 +310,10 @@ impl StackProgram for Stack { Ok(Value::Record(self.sample_record(burner_address, record_name, rng)?)) } ValueType::ExternalRecord(locator) => { - bail!("Illegal operation: Cannot sample external records (for '{locator}.record').") + // Retrieve the external stack. + let stack = self.get_external_stack(locator.program_id())?; + // Sample the output. + Ok(Value::Record(stack.sample_record(burner_address, locator.resource(), rng)?)) } ValueType::Future(locator) => Ok(Value::Future(self.sample_future(locator, rng)?)), } From 53c69a83ea7325dbcebf556a6cd9bc3cc6383ffc Mon Sep 17 00:00:00 2001 From: Victor Sint Nicolaas Date: Thu, 28 Dec 2023 21:38:29 +0100 Subject: [PATCH 065/298] Prevent allocation --- synthesizer/process/src/stack/call/mod.rs | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/synthesizer/process/src/stack/call/mod.rs b/synthesizer/process/src/stack/call/mod.rs index 013b1d0ef5..d34e31d91f 100644 --- a/synthesizer/process/src/stack/call/mod.rs +++ b/synthesizer/process/src/stack/call/mod.rs @@ -283,15 +283,11 @@ impl CallTrait for Call { .iter() .map(|output| substack.sample_value(&address, output.value_type(), rng)) .collect::>>()?; - - // Retrieve the output operands. - let output_operands = - &function.outputs().iter().map(|output| output.operand()).collect::>(); - // Map the output operands to registers. - let output_registers = output_operands + let output_registers = function + .outputs() .iter() - .map(|operand| match operand { + .map(|output| match output.operand() { Operand::Register(register) => Some(register.clone()), _ => None, }) From 88364b06b23b38d7c5a81ef153f29be4902908ef Mon Sep 17 00:00:00 2001 From: Victor Sint Nicolaas Date: Fri, 29 Dec 2023 20:00:31 +0100 Subject: [PATCH 066/298] Limit the number of allowed constraints for deployments --- circuit/environment/src/circuit.rs | 19 +++++++++++++++++ circuit/environment/src/environment.rs | 3 +++ circuit/network/src/v0.rs | 5 +++++ console/network/src/lib.rs | 4 ++++ .../block/src/transaction/deployment/mod.rs | 5 +++++ synthesizer/process/src/stack/call/mod.rs | 5 +++++ synthesizer/process/src/stack/deploy.rs | 21 +++++++++++++++---- synthesizer/process/src/stack/execute.rs | 7 ++++++- synthesizer/process/src/stack/mod.rs | 15 +++++++------ synthesizer/process/src/tests/test_credits.rs | 5 ++++- synthesizer/src/vm/deploy.rs | 2 +- synthesizer/src/vm/helpers/cost.rs | 13 +++++++++--- 12 files changed, 88 insertions(+), 16 deletions(-) diff --git a/circuit/environment/src/circuit.rs b/circuit/environment/src/circuit.rs index be60fe946b..5f7fc42821 100644 --- a/circuit/environment/src/circuit.rs +++ b/circuit/environment/src/circuit.rs @@ -24,6 +24,7 @@ type Field = ::Field; thread_local! { pub(super) static CIRCUIT: RefCell> = RefCell::new(R1CS::new()); pub(super) static IN_WITNESS: Cell = Cell::new(false); + pub(super) static MAX_NUM_CONSTRAINTS: Cell = Cell::new(u64::MAX); pub(super) static ZERO: LinearCombination = LinearCombination::zero(); pub(super) static ONE: LinearCombination = LinearCombination::one(); } @@ -146,6 +147,13 @@ impl Environment for Circuit { // Ensure we are not in witness mode. if !in_witness.get() { CIRCUIT.with(|circuit| { + // Ensure we do not surpass maximum allowed number of constraints + MAX_NUM_CONSTRAINTS.with(|max_constraints| { + if circuit.borrow().num_constraints() > max_constraints.get() { + Self::halt("Surpassing maximum allowed number of constraints") + } + }); + let (a, b, c) = constraint(); let (a, b, c) = (a.into(), b.into(), c.into()); @@ -275,6 +283,8 @@ impl Environment for Circuit { CIRCUIT.with(|circuit| { // Reset the witness mode. IN_WITNESS.with(|in_witness| in_witness.replace(false)); + // Reset the max num constraints. + MAX_NUM_CONSTRAINTS.with(|max_num_constraints| max_num_constraints.replace(u64::MAX)); // Eject the R1CS instance. let r1cs = circuit.replace(R1CS::<::BaseField>::new()); // Ensure the circuit is now empty. @@ -294,6 +304,8 @@ impl Environment for Circuit { CIRCUIT.with(|circuit| { // Reset the witness mode. IN_WITNESS.with(|in_witness| in_witness.replace(false)); + // Reset the num constraints. + MAX_NUM_CONSTRAINTS.with(|max_num_constraints| max_num_constraints.replace(u64::MAX)); // Eject the R1CS instance. let r1cs = circuit.replace(R1CS::<::BaseField>::new()); assert_eq!(0, circuit.borrow().num_constants()); @@ -305,11 +317,18 @@ impl Environment for Circuit { }) } + /// Sets a maximum amount of allowed constraints + fn set_constraint_maximum(new_max_num_constraints: u64) { + MAX_NUM_CONSTRAINTS.with(|max_num_constraints| max_num_constraints.replace(new_max_num_constraints)); + } + /// Clears the circuit and initializes an empty environment. fn reset() { CIRCUIT.with(|circuit| { // Reset the witness mode. IN_WITNESS.with(|in_witness| in_witness.replace(false)); + // Reset the max num constraints. + MAX_NUM_CONSTRAINTS.with(|max_num_constraints| max_num_constraints.replace(u64::MAX)); *circuit.borrow_mut() = R1CS::<::BaseField>::new(); assert_eq!(0, circuit.borrow().num_constants()); assert_eq!(1, circuit.borrow().num_public()); diff --git a/circuit/environment/src/environment.rs b/circuit/environment/src/environment.rs index 34ef4370ea..789cfd61a2 100644 --- a/circuit/environment/src/environment.rs +++ b/circuit/environment/src/environment.rs @@ -169,6 +169,9 @@ pub trait Environment: 'static + Copy + Clone + fmt::Debug + fmt::Display + Eq + /// Returns the R1CS assignment of the circuit, resetting the circuit. fn eject_assignment_and_reset() -> Assignment<::Field>; + /// Sets a maximum amount of allowed constraints + fn set_constraint_maximum(new_max_num_constraints: u64); + /// Clears and initializes an empty environment. fn reset(); } diff --git a/circuit/network/src/v0.rs b/circuit/network/src/v0.rs index 9dc7a9d8da..7f76af350e 100644 --- a/circuit/network/src/v0.rs +++ b/circuit/network/src/v0.rs @@ -481,6 +481,11 @@ impl Environment for AleoV0 { E::eject_assignment_and_reset() } + /// Sets a maximum amount of allowed constraints + fn set_constraint_maximum(new_max_num_constraints: u64) { + E::set_constraint_maximum(new_max_num_constraints) + } + /// Clears the circuit and initializes an empty environment. fn reset() { E::reset() diff --git a/console/network/src/lib.rs b/console/network/src/lib.rs index 717946cba2..20f8e94201 100644 --- a/console/network/src/lib.rs +++ b/console/network/src/lib.rs @@ -98,6 +98,10 @@ pub trait Network: const STARTING_SUPPLY: u64 = 1_500_000_000_000_000; // 1.5B credits /// The cost in microcredits per byte for the deployment transaction. const DEPLOYMENT_FEE_MULTIPLIER: u64 = 1_000; // 1 millicredit per byte + /// The cost in microcredits per constraint for the deployment transaction. + const SYNTH_FEE_MULTIPLIER: u64 = 25; // 25 microcredit per constraint to synthesize + /// The maximum number of constraints in a deployment + const MAX_DEPLOYMENT_CONSTRAINTS: u64 = 300_000; /// The maximum number of microcredits that can be spent as a fee. const MAX_FEE: u64 = 1_000_000_000_000_000; diff --git a/ledger/block/src/transaction/deployment/mod.rs b/ledger/block/src/transaction/deployment/mod.rs index 01d4cac081..ddb4790c2d 100644 --- a/ledger/block/src/transaction/deployment/mod.rs +++ b/ledger/block/src/transaction/deployment/mod.rs @@ -124,6 +124,11 @@ impl Deployment { &self.verifying_keys } + /// Returns the total number of constraints. + pub fn num_constraints(&self) -> u64 { + self.verifying_keys.iter().map(|(_, (vk, _))| vk.circuit_info.num_constraints).sum::() as u64 + } + /// Returns the deployment ID. pub fn to_deployment_id(&self) -> Result> { Ok(*Transaction::deployment_tree(self, None)?.root()) diff --git a/synthesizer/process/src/stack/call/mod.rs b/synthesizer/process/src/stack/call/mod.rs index 5d6578ab73..e22c0c33ca 100644 --- a/synthesizer/process/src/stack/call/mod.rs +++ b/synthesizer/process/src/stack/call/mod.rs @@ -298,6 +298,11 @@ impl CallTrait for Call { // Inject the existing circuit. A::inject_r1cs(r1cs); + // If the circuit is in CheckDeployment mode, set a constraint maximum. + if let CallStack::CheckDeployment(_, _, _, num_constraints) = ®isters.call_stack() { + A::set_constraint_maximum(*num_constraints); + } + use circuit::Inject; // Inject the network ID as `Mode::Constant`. diff --git a/synthesizer/process/src/stack/deploy.rs b/synthesizer/process/src/stack/deploy.rs index 39b46f2f6f..08e158adac 100644 --- a/synthesizer/process/src/stack/deploy.rs +++ b/synthesizer/process/src/stack/deploy.rs @@ -73,11 +73,17 @@ impl Stack { let program_id = self.program.id(); + // Check that the deployment does not require too many constraints + let total_num_constraints = deployment.num_constraints(); + ensure!(total_num_constraints <= N::MAX_DEPLOYMENT_CONSTRAINTS); + // Construct the call stacks and assignments used to verify the certificates. let mut call_stacks = Vec::with_capacity(deployment.verifying_keys().len()); // Iterate through the program functions and construct the callstacks and corresponding assignments. - for function in deployment.program().functions().values() { + for (function, (_, (verifying_key, _))) in + deployment.program().functions().values().zip_eq(deployment.verifying_keys()) + { // Initialize a burner private key. let burner_private_key = PrivateKey::new(rng)?; // Compute the burner address. @@ -109,20 +115,27 @@ impl Stack { rng, )?; lap!(timer, "Compute the request for {}", function.name()); + // Get the expected number of constraints + let expected_num_constraints = verifying_key.circuit_info.num_constraints as u64; // Initialize the assignments. let assignments = Assignments::::default(); // Initialize the call stack. - let call_stack = CallStack::CheckDeployment(vec![request], burner_private_key, assignments.clone()); + let call_stack = CallStack::CheckDeployment( + vec![request], + burner_private_key, + assignments.clone(), + expected_num_constraints, + ); // Append the function name, callstack, and assignments. call_stacks.push((function.name(), call_stack, assignments)); } // Verify the certificates. let rngs = (0..call_stacks.len()).map(|_| StdRng::from_seed(rng.gen())).collect::>(); - cfg_iter!(call_stacks).zip_eq(deployment.verifying_keys()).zip_eq(rngs).try_for_each( + cfg_into_iter!(call_stacks).zip_eq(deployment.verifying_keys()).zip_eq(rngs).try_for_each( |(((function_name, call_stack, assignments), (_, (verifying_key, certificate))), mut rng)| { // Synthesize the circuit. - if let Err(err) = self.execute_function::(call_stack.clone(), None, &mut rng) { + if let Err(err) = self.execute_function::(call_stack, None, &mut rng) { bail!("Failed to synthesize the circuit for '{function_name}': {err}") } // Check the certificate. diff --git a/synthesizer/process/src/stack/execute.rs b/synthesizer/process/src/stack/execute.rs index 20758e5e84..9215f02c72 100644 --- a/synthesizer/process/src/stack/execute.rs +++ b/synthesizer/process/src/stack/execute.rs @@ -142,6 +142,11 @@ impl StackExecute for Stack { // Ensure the circuit environment is clean. A::reset(); + // If the circuit is in CheckDeployment mode, set a constraint maximum. + if let CallStack::CheckDeployment(_, _, _, num_constraints) = &call_stack { + A::set_constraint_maximum(*num_constraints); + } + // Retrieve the next request. let console_request = call_stack.pop()?; @@ -416,7 +421,7 @@ impl StackExecute for Stack { lap!(timer, "Save the transition"); } // If the circuit is in `CheckDeployment` mode, then save the assignment. - else if let CallStack::CheckDeployment(_, _, ref assignments) = registers.call_stack() { + else if let CallStack::CheckDeployment(_, _, ref assignments, _) = registers.call_stack() { // Construct the call metrics. let metrics = CallMetrics { program_id: *self.program_id(), diff --git a/synthesizer/process/src/stack/mod.rs b/synthesizer/process/src/stack/mod.rs index 2b95b46fb7..739e1ac9c8 100644 --- a/synthesizer/process/src/stack/mod.rs +++ b/synthesizer/process/src/stack/mod.rs @@ -79,7 +79,7 @@ pub type Assignments = Arc pub enum CallStack { Authorize(Vec>, PrivateKey, Authorization), Synthesize(Vec>, PrivateKey, Authorization), - CheckDeployment(Vec>, PrivateKey, Assignments), + CheckDeployment(Vec>, PrivateKey, Assignments, u64), Evaluate(Authorization), Execute(Authorization, Arc>>), PackageRun(Vec>, PrivateKey, Assignments), @@ -107,11 +107,14 @@ impl CallStack { CallStack::Synthesize(requests, private_key, authorization) => { CallStack::Synthesize(requests.clone(), *private_key, authorization.replicate()) } - CallStack::CheckDeployment(requests, private_key, assignments) => CallStack::CheckDeployment( - requests.clone(), - *private_key, - Arc::new(RwLock::new(assignments.read().clone())), - ), + CallStack::CheckDeployment(requests, private_key, assignments, num_constraints) => { + CallStack::CheckDeployment( + requests.clone(), + *private_key, + Arc::new(RwLock::new(assignments.read().clone())), + *num_constraints, + ) + } CallStack::Evaluate(authorization) => CallStack::Evaluate(authorization.replicate()), CallStack::Execute(authorization, trace) => { CallStack::Execute(authorization.replicate(), Arc::new(RwLock::new(trace.read().clone()))) diff --git a/synthesizer/process/src/tests/test_credits.rs b/synthesizer/process/src/tests/test_credits.rs index aefae59a3c..9b2b2d3732 100644 --- a/synthesizer/process/src/tests/test_credits.rs +++ b/synthesizer/process/src/tests/test_credits.rs @@ -1524,8 +1524,11 @@ mod sanity_checks { let request = Request::sign(private_key, program_id, function_name, inputs.iter(), &input_types, rng).unwrap(); // Initialize the assignments. let assignments = Assignments::::default(); + // Set max num constraints + let max_num_constraints = u64::MAX; // Initialize the call stack. - let call_stack = CallStack::CheckDeployment(vec![request], *private_key, assignments.clone()); + let call_stack = + CallStack::CheckDeployment(vec![request], *private_key, assignments.clone(), max_num_constraints); // Synthesize the circuit. let _response = stack.execute_function::(call_stack, None, rng).unwrap(); // Retrieve the assignment. diff --git a/synthesizer/src/vm/deploy.rs b/synthesizer/src/vm/deploy.rs index e080ba54d9..f9e260793c 100644 --- a/synthesizer/src/vm/deploy.rs +++ b/synthesizer/src/vm/deploy.rs @@ -40,7 +40,7 @@ impl> VM { let owner = ProgramOwner::new(private_key, deployment_id, rng)?; // Compute the minimum deployment cost. - let (minimum_deployment_cost, (_, _)) = deployment_cost(&deployment)?; + let (minimum_deployment_cost, _) = deployment_cost(&deployment)?; // Authorize the fee. let fee_authorization = match fee_record { Some(record) => self.authorize_fee_private( diff --git a/synthesizer/src/vm/helpers/cost.rs b/synthesizer/src/vm/helpers/cost.rs index 6f349baa84..7e90b98ad7 100644 --- a/synthesizer/src/vm/helpers/cost.rs +++ b/synthesizer/src/vm/helpers/cost.rs @@ -23,14 +23,16 @@ use synthesizer_program::{Command, Finalize, Instruction}; use std::collections::HashMap; -/// Returns the *minimum* cost in microcredits to publish the given deployment (total cost, (storage cost, namespace cost)). -pub fn deployment_cost(deployment: &Deployment) -> Result<(u64, (u64, u64))> { +/// Returns the *minimum* cost in microcredits to publish the given deployment (total cost, (storage cost, namespace cost, synthesis cost)). +pub fn deployment_cost(deployment: &Deployment) -> Result<(u64, (u64, u64, u64))> { // Determine the number of bytes in the deployment. let size_in_bytes = deployment.size_in_bytes()?; // Retrieve the program ID. let program_id = deployment.program_id(); // Determine the number of characters in the program ID. let num_characters = u32::try_from(program_id.name().to_string().len())?; + // Determine the number of constraints in the program + let num_constraints = deployment.num_constraints(); // Compute the storage cost in microcredits. let storage_cost = size_in_bytes @@ -43,12 +45,17 @@ pub fn deployment_cost(deployment: &Deployment) -> Result<(u64, ( .ok_or(anyhow!("The namespace cost computation overflowed for a deployment"))? .saturating_mul(1_000_000); // 1 microcredit = 1e-6 credits. + // Compute the synthesis cost in credits + let synthesis_cost = num_constraints * N::SYNTH_FEE_MULTIPLIER; + // Compute the total cost in microcredits. let total_cost = storage_cost .checked_add(namespace_cost) + .ok_or(anyhow!("The total cost computation overflowed for a deployment"))? + .checked_add(synthesis_cost) .ok_or(anyhow!("The total cost computation overflowed for a deployment"))?; - Ok((total_cost, (storage_cost, namespace_cost))) + Ok((total_cost, (storage_cost, namespace_cost, synthesis_cost))) } /// Returns the *minimum* cost in microcredits to publish the given execution (total cost, (storage cost, namespace cost)). From 5e0e2f6f4da9720f18219f1ac24d42d6f4d90dc1 Mon Sep 17 00:00:00 2001 From: Victor Sint Nicolaas Date: Fri, 29 Dec 2023 21:27:42 +0100 Subject: [PATCH 067/298] Increase allowed number of deployment constraints for existing test suite --- console/network/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/console/network/src/lib.rs b/console/network/src/lib.rs index 20f8e94201..69807dc6db 100644 --- a/console/network/src/lib.rs +++ b/console/network/src/lib.rs @@ -101,7 +101,7 @@ pub trait Network: /// The cost in microcredits per constraint for the deployment transaction. const SYNTH_FEE_MULTIPLIER: u64 = 25; // 25 microcredit per constraint to synthesize /// The maximum number of constraints in a deployment - const MAX_DEPLOYMENT_CONSTRAINTS: u64 = 300_000; + const MAX_DEPLOYMENT_CONSTRAINTS: u64 = 1_000_000; /// The maximum number of microcredits that can be spent as a fee. const MAX_FEE: u64 = 1_000_000_000_000_000; From 160d295864bba883c19be4529e25322d367fb748 Mon Sep 17 00:00:00 2001 From: Pranav Gaddamadugu <23022326+d0cd@users.noreply.github.com> Date: Tue, 2 Jan 2024 12:11:30 +0530 Subject: [PATCH 068/298] Documentation --- circuit/types/field/src/square_root.rs | 48 +++++++--------- .../group/src/helpers/from_x_coordinate.rs | 57 +++++++------------ circuit/types/group/src/lib.rs | 40 +++++++++++++ 3 files changed, 80 insertions(+), 65 deletions(-) diff --git a/circuit/types/field/src/square_root.rs b/circuit/types/field/src/square_root.rs index 27dd44f9dd..6c2180947f 100644 --- a/circuit/types/field/src/square_root.rs +++ b/circuit/types/field/src/square_root.rs @@ -64,22 +64,22 @@ impl Field { } impl Field { - /// Returns both square roots of `self` (hence the plural 'roots' in the name of the function), - /// along with a boolean error flag, which is set iff `self` is not a square. + /// Returns both square roots of `self` and a `Boolean` flag, which is set iff `self` is not a square. /// - /// In the console computation: - /// if `self` is a non-zero square, - /// the first field result is the positive root (i.e. closer to 0) - /// and the second field result is the negative root (i.e. closer to the prime); - /// if `self` is 0, both field results are 0; - /// if `self` is not a square, both field results are 0, but immaterial. + /// If `self` is a non-zero square, + /// - the first field result is the positive root (i.e. closer to 0) + /// - the second field result is the negative root (i.e. closer to the prime) + /// - the flag is 0 /// - /// The 'nondeterministic' part of the function name refers to the synthesized circuit, - /// whose represented computation, unlike the console computation just described, - /// returns the two roots (if `self` is a non-zero square) in no specified order. - /// This nondeterminism saves constraints, but generally this circuit should be only used - /// as part of larger circuits for which the nondeterminism in the order of the two roots does not matter, - /// and where the larger circuits represent deterministic computations despite this internal nondeterminism. + /// If `self` is 0, + /// - both field results are 0 + /// - the flag is 0 + /// + /// If `self` is not a square, + /// - both field results are 0 + /// - the flag is 1 + /// + /// Note that there is no ordering on the two roots returned by this function. pub fn square_roots_flagged_nondeterministic(&self) -> (Self, Self, Boolean) { // Obtain (p-1)/2, as a constant field element. let modulus_minus_one_div_two = match E::BaseField::from_bigint(E::BaseField::modulus_minus_one_div_two()) { @@ -92,30 +92,24 @@ impl Field { let is_nonzero_square = euler.is_one(); // Calculate the witness for the first square result. - // The called function square_root returns the square root closer to 0. + // Note that the function `square_root` returns the square root closer to 0. let root_witness = match self.eject_value().square_root() { Ok(root) => root, Err(_) => console::Field::zero(), }; - // In order to avoid actually calculating the square root in the circuit, - // we would like to generate a constraint saying that squaring the root yields self. - // But this constraint would have no solutions if self is not a square. - // So we introduce a new variable that is either self (if square) or 0 (otherwise): - // either way, this new variable is a square. + // Initialize the square element, which is either `self` or 0, depending on whether `self` is a square. let square = Self::ternary(&is_nonzero_square, self, &Field::zero()); - // We introduce a variable for the first root we return, - // and constrain it to yield, when squared, the square introduced just above. - // Thus, if self is a square this is a square root of self; otherwise it is 0, because only 0 yields 0 when squared. - // The variable is actually a constant if self is constant, otherwise it is private (even if self is public). + // Initialize a new variable for the first root. let mode = if self.eject_mode() == Mode::Constant { Mode::Constant } else { Mode::Private }; let first_root = Field::new(mode, root_witness); + + // Enforce that the first root squared is equal to the square. + // Note that if `self` is not a square, then `first_root` and `square` are both zero and the constraint is satisfied. E::enforce(|| (&first_root, &first_root, &square)); - // The second root returned by this function is the negation of the first one. - // So if self is a non-zero square, this is always different from the first root, - // but in the circuit it can be either positive (and the other negative) or vice versa. + // Initialize the second root as the negation of the first root. let second_root = first_root.clone().neg(); // The error flag is set iff self is a non-square, i.e. it is neither zero nor a non-zero square. diff --git a/circuit/types/group/src/helpers/from_x_coordinate.rs b/circuit/types/group/src/helpers/from_x_coordinate.rs index c2093d3d83..d23f182af4 100644 --- a/circuit/types/group/src/helpers/from_x_coordinate.rs +++ b/circuit/types/group/src/helpers/from_x_coordinate.rs @@ -28,8 +28,8 @@ impl Group { } /// Initializes an affine group element from a given x-coordinate field element. - /// Also returns an error flag, set if there is no group element with the given x-coordinate; - /// in that case, the returned point is `(0, 0)`, but immaterial. + /// Returns an error flag, indicating if there is a group element with the given x-coordinate; + /// If the error flag is set, the returned point is `(0, 0)`. pub fn from_x_coordinate_flagged(x: Field) -> (Self, Boolean) { // Obtain the A and D coefficients of the elliptic curve. let a = Field::constant(console::Field::new(E::EDWARDS_A)); @@ -48,50 +48,31 @@ impl Group { let yy: Field = witness!(|a_xx_minus_1, d_xx_minus_1| { a_xx_minus_1 / d_xx_minus_1 }); E::enforce(|| (&yy, &d_xx_minus_1, &a_xx_minus_1)); - // Compute both square roots of y^2, in no specified order, with a flag saying whether y^2 is a square or not. - // That is, finish solving the curve equation for y. - // If the x-coordinate line does not intersect the elliptic curve, this returns (1, 0, 0). + // Compute both square roots of y^2, with a flag indicating whether y^2 is a square or not. + // Note that there is **no** ordering on the square roots. + // Note that if the x-coordinate line does not intersect the elliptic curve, this returns (0, 0, false). let (y1, y2, yy_is_not_square) = yy.square_roots_flagged_nondeterministic(); - // Form the two points, which are on the curve if yy_is_not_square is false. - // Note that the Group type is not restricted to the points in the subgroup or even on the curve; - // it includes all possible points, i.e. all possible pairs of field elements. + // Construct the two points. + // Note that if `yy_is_not_square` is `false`, the points are guaranteed to be on the curve. + // Note that the two points are **not** necessarily in the subgroup. let point1 = Self { x: x.clone(), y: y1.clone() }; let point2 = Self { x: x.clone(), y: y2.clone() }; - // We need to check whether either of the two points is in the subgroup. - // There may be at most one, but in a circuit we need to always represent both computation paths. - // In fact, we represent this computation also when yy_is_not_square is true, - // in which case the results of checking whether either point is in the subgroup are meaningless, - // but ignored in the final selection of the results returned below. - // The criterion for membership in the subgroup is that - // multiplying the point by the subgroup order yields the zero point (0, 1). - // The group operation that we use here is for the type `Group` of the subgroup, - // which as mentioned above it can be performed on points outside the subgroup as well. - // We turn the subgroup order into big endian bits, - // to get around the issue that the subgroup order is not of Scalar type. - let order = E::ScalarField::modulus(); - let order_bits_be = order.to_bits_be(); - let mut order_bits_be_constants = Vec::with_capacity(order_bits_be.len()); - for bit in order_bits_be.iter() { - order_bits_be_constants.push(Boolean::constant(*bit)); - } - let point1_times_order = order_bits_be_constants.mul(point1); - let point2_times_order = order_bits_be_constants.mul(point2); - let point1_is_in_subgroup = point1_times_order.is_zero(); - let point2_is_in_subgroup = point2_times_order.is_zero(); - - // We select y1 if (x, y1) is in the subgroup (which implies that (x, y2) is not in the subgroup), - // or y2 if (x, y2) is in the subgroup (which implies that (x, y1) is not in the subgroup), - // or 0 if neither is in the subgroup, or x does not even intersect the elliptic curve. - // Since at most one of the two points can be in the subgroup, the order of y1 and y2 returned by square root is immaterial: - // that nondeterminism (in the circuit) is resolved, and the circuit for from_x_coordinate_flagged is deterministic. - let y2_or_zero = Field::ternary(&point2_is_in_subgroup, &y2, &Field::zero()); - let y1_or_y2_or_zero = Field::ternary(&point1_is_in_subgroup, &y1, &y2_or_zero); + // Determine if either of the two points is in the subgroup. + // Note that at most **one** of the points can be in the subgroup. + let point1_is_in_group = point1.is_in_group(); + let point2_is_in_group = point2.is_in_group(); + + // Select y1 if (x, y1) is in the subgroup. + // Otherwise, select y2 if (x, y2) is in the subgroup. + // Otherwise, use the zero field element. + let y2_or_zero = Field::ternary(&point2_is_in_group, &y2, &Field::zero()); + let y1_or_y2_or_zero = Field::ternary(&point1_is_in_group, &y1, &y2_or_zero); let y = Field::ternary(&yy_is_not_square, &Field::zero(), &y1_or_y2_or_zero); // The error flag is set iff x does not intersect the elliptic curve or neither intersection point is in the subgroup. - let neither_in_subgroup = point1_is_in_subgroup.not().bitand(point2_is_in_subgroup.not()); + let neither_in_subgroup = point1_is_in_group.not().bitand(point2_is_in_group.not()); let error_flag = yy_is_not_square.bitor(&neither_in_subgroup); (Self { x, y }, error_flag) diff --git a/circuit/types/group/src/lib.rs b/circuit/types/group/src/lib.rs index 36d1f7f821..9a294e7f37 100644 --- a/circuit/types/group/src/lib.rs +++ b/circuit/types/group/src/lib.rs @@ -129,6 +129,18 @@ impl Group { // i.e. that it is 4 (= cofactor) times the postulated point on the curve. double_point.enforce_double(self); } + + /// Returns a `Boolean` indicating if `self` is in the largest prime-order subgroup. + pub fn is_in_group(&self) -> Boolean { + let order = E::ScalarField::modulus(); + let order_bits_be = order.to_bits_be(); + let mut order_bits_be_constants = Vec::with_capacity(order_bits_be.len()); + for bit in order_bits_be.iter() { + order_bits_be_constants.push(Boolean::constant(*bit)); + } + let self_times_order = order_bits_be_constants.mul(self); + self_times_order.is_zero() + } } #[cfg(console)] @@ -382,4 +394,32 @@ mod tests { } } } + + #[test] + fn test_is_in_group() { + fn check_is_in_group(mode: Mode, num_constants: u64, num_public: u64, num_private: u64, num_constraints: u64) { + let mut rng = TestRng::default(); + + for i in 0..ITERATIONS { + // Sample a random element. + let point: console::Group<::Network> = Uniform::rand(&mut rng); + + // Inject the x-coordinate. + let x_coordinate = Field::new(mode, point.to_x_coordinate()); + + // Initialize the group element. + let element = Group::::from_x_coordinate(x_coordinate); + + Circuit::scope(format!("{mode} {i}"), || { + let is_in_group = element.is_in_group(); + assert!(is_in_group.eject_value()); + assert_scope!(num_constants, num_public, num_private, num_constraints); + }); + Circuit::reset(); + } + } + check_is_in_group(Mode::Constant, 1752, 0, 0, 0); + check_is_in_group(Mode::Public, 750, 0, 2755, 2755); + check_is_in_group(Mode::Private, 750, 0, 2755, 2755); + } } From cc51afa3ab7f78c828460fe3d65beabb4a7d79b0 Mon Sep 17 00:00:00 2001 From: Pranav Gaddamadugu <23022326+d0cd@users.noreply.github.com> Date: Mon, 20 Nov 2023 16:42:13 -0800 Subject: [PATCH 069/298] Enable lossy casts for all target types expect group elements --- .../src/stack/finalize_types/initialize.rs | 27 ++++++- .../src/stack/register_types/initialize.rs | 27 ++++++- .../src/logic/instruction/operation/cast.rs | 72 ++++++++++++++++--- .../process/execute/lossy_casts.out | 57 +++++++++++++++ .../tests/process/execute/lossy_casts.aleo | 48 +++++++++++++ 5 files changed, 220 insertions(+), 11 deletions(-) create mode 100644 synthesizer/tests/expectations/process/execute/lossy_casts.out create mode 100644 synthesizer/tests/tests/process/execute/lossy_casts.aleo diff --git a/synthesizer/process/src/stack/finalize_types/initialize.rs b/synthesizer/process/src/stack/finalize_types/initialize.rs index 9a7bc33440..6044b0c7f7 100644 --- a/synthesizer/process/src/stack/finalize_types/initialize.rs +++ b/synthesizer/process/src/stack/finalize_types/initialize.rs @@ -581,7 +581,32 @@ impl FinalizeTypes { } } } - "cast.lossy" => bail!("Instruction '{instruction}' is not supported yet."), + "cast.lossy" => { + // Retrieve the cast operation. + let operation = match instruction { + Instruction::CastLossy(operation) => operation, + _ => bail!("Instruction '{instruction}' is not a cast.lossy operation."), + }; + + // Ensure the instruction has one destination register. + ensure!( + instruction.destinations().len() == 1, + "Instruction '{instruction}' has multiple destinations." + ); + + // Ensure the casted register type is valid and defined. + match operation.cast_type() { + CastType::Plaintext(PlaintextType::Literal(literal_type)) => { + // TODO (@d0cd) Remove restriction on lossy casts to a group element. + ensure!( + !matches!(literal_type, LiteralType::Group), + "Casting to a group element is not supported for `cast.lossy (yet)`" + ); + ensure!(instruction.operands().len() == 1, "Expected 1 operand."); + } + _ => bail!("`cast.lossy` is only supported for casting to a literal"), + } + } _ => bail!("Instruction '{instruction}' is not for opcode '{opcode}'."), }, Opcode::Command(opcode) => { diff --git a/synthesizer/process/src/stack/register_types/initialize.rs b/synthesizer/process/src/stack/register_types/initialize.rs index 387f0e0d2e..59662c7068 100644 --- a/synthesizer/process/src/stack/register_types/initialize.rs +++ b/synthesizer/process/src/stack/register_types/initialize.rs @@ -540,7 +540,32 @@ impl RegisterTypes { } } } - "cast.lossy" => bail!("Instruction '{instruction}' is not supported yet."), + "cast.lossy" => { + // Retrieve the cast operation. + let operation = match instruction { + Instruction::CastLossy(operation) => operation, + _ => bail!("Instruction '{instruction}' is not a cast.lossy operation."), + }; + + // Ensure the instruction has one destination register. + ensure!( + instruction.destinations().len() == 1, + "Instruction '{instruction}' has multiple destinations." + ); + + // Ensure the casted register type is valid and defined. + match operation.cast_type() { + CastType::Plaintext(PlaintextType::Literal(literal_type)) => { + // TODO (@d0cd) Remove restriction on lossy casts to a group element. + ensure!( + !matches!(literal_type, LiteralType::Group), + "Casting to a group element is not supported for `cast.lossy (yet)`" + ); + ensure!(instruction.operands().len() == 1, "Expected 1 operand."); + } + _ => bail!("`cast.lossy` is only supported for casting to a literal"), + } + } _ => bail!("Instruction '{instruction}' is not for opcode '{opcode}'."), }, Opcode::Command(opcode) => { diff --git a/synthesizer/program/src/logic/instruction/operation/cast.rs b/synthesizer/program/src/logic/instruction/operation/cast.rs index a516daf425..f52da2dd84 100644 --- a/synthesizer/program/src/logic/instruction/operation/cast.rs +++ b/synthesizer/program/src/logic/instruction/operation/cast.rs @@ -206,9 +206,12 @@ impl CastOperation { stack: &(impl StackMatches + StackProgram), registers: &mut (impl RegistersSigner + RegistersLoad + RegistersStore), ) -> Result<()> { - // TODO (howardwu & d0cd): Re-enable after stabilizing. + // If the variant is `cast.lossy`, then check that the `cast_type` is a `PlaintextType::Literal`. if VARIANT == CastVariant::CastLossy as u8 { - bail!("cast.lossy is not supported (yet)") + ensure!( + matches!(self.cast_type, CastType::Plaintext(PlaintextType::Literal(..))), + "`cast.lossy` is only supported for casting to a literal" + ) } // Load the operands values. @@ -236,7 +239,17 @@ impl CastOperation { let value = match &inputs[0] { Value::Plaintext(Plaintext::Literal(literal, ..)) => match VARIANT { 0 => literal.cast(*literal_type)?, - 1 => literal.cast_lossy(*literal_type)?, + 1 => { + // TODO (@d0cd) Remove restriction on lossy casts to a group element. + ensure!( + !matches!( + &self.cast_type, + CastType::Plaintext(PlaintextType::Literal(LiteralType::Group)) + ), + "Casting to a group element is not supported for `cast.lossy (yet)`" + ); + literal.cast_lossy(*literal_type)? + } 2.. => unreachable!("Invalid cast variant"), }, _ => bail!("Casting to a literal requires a literal"), @@ -333,9 +346,12 @@ impl CastOperation { stack: &(impl StackMatches + StackProgram), registers: &mut (impl RegistersSignerCircuit + RegistersLoadCircuit + RegistersStoreCircuit), ) -> Result<()> { - // TODO (howardwu & d0cd): Re-enable after stabilizing. + // If the variant is `cast.lossy`, then check that the `cast_type` is a `PlaintextType::Literal`. if VARIANT == CastVariant::CastLossy as u8 { - bail!("cast.lossy is not supported (yet)") + ensure!( + matches!(self.cast_type, CastType::Plaintext(PlaintextType::Literal(..))), + "`cast.lossy` is only supported for casting to a literal" + ) } use circuit::{Eject, Inject}; @@ -378,7 +394,17 @@ impl CastOperation { let value = match &inputs[0] { circuit::Value::Plaintext(circuit::Plaintext::Literal(literal, ..)) => match VARIANT { 0 => literal.cast(*literal_type)?, - 1 => literal.cast_lossy(*literal_type)?, + 1 => { + // TODO (@d0cd) Remove restriction on lossy casts to a group element. + ensure!( + !matches!( + &self.cast_type, + CastType::Plaintext(PlaintextType::Literal(LiteralType::Group)) + ), + "Casting to a group element is not supported for `cast.lossy (yet)`" + ); + literal.cast_lossy(*literal_type)? + } 2.. => unreachable!("Invalid cast variant"), }, _ => bail!("Casting to a literal requires a literal"), @@ -582,9 +608,12 @@ impl CastOperation { stack: &(impl StackMatches + StackProgram), registers: &mut (impl RegistersLoad + RegistersStore), ) -> Result<()> { - // TODO (howardwu & d0cd): Re-enable after stabilizing. + // If the variant is `cast.lossy`, then check that the `cast_type` is a `PlaintextType::Literal`. if VARIANT == CastVariant::CastLossy as u8 { - bail!("cast.lossy is not supported (yet)") + ensure!( + matches!(self.cast_type, CastType::Plaintext(PlaintextType::Literal(..))), + "`cast.lossy` is only supported for casting to a literal" + ) } // Load the operands values. @@ -612,7 +641,17 @@ impl CastOperation { let value = match &inputs[0] { Value::Plaintext(Plaintext::Literal(literal, ..)) => match VARIANT { 0 => literal.cast(*literal_type)?, - 1 => literal.cast_lossy(*literal_type)?, + 1 => { + // TODO (@d0cd) Remove restriction on lossy casts to a group element. + ensure!( + !matches!( + &self.cast_type, + CastType::Plaintext(PlaintextType::Literal(LiteralType::Group)) + ), + "Casting to a group element is not supported for `cast.lossy (yet)`" + ); + literal.cast_lossy(*literal_type)? + } 2.. => unreachable!("Invalid cast variant"), }, _ => bail!("Casting to a literal requires a literal"), @@ -641,6 +680,14 @@ impl CastOperation { stack: &impl StackProgram, input_types: &[RegisterType], ) -> Result>> { + // If the variant is `cast.lossy`, then check that the `cast_type` is a `PlaintextType::Literal`. + if VARIANT == CastVariant::CastLossy as u8 { + ensure!( + matches!(self.cast_type, CastType::Plaintext(PlaintextType::Literal(..))), + "`cast.lossy` is only supported for casting to a literal" + ) + } + // Ensure the number of operands is correct. ensure!( input_types.len() == self.operands.len(), @@ -661,6 +708,13 @@ impl CastOperation { ); } CastType::Plaintext(PlaintextType::Literal(..)) => { + // TODO (@d0cd) Remove restriction on lossy casts to a group element. + if VARIANT == CastVariant::CastLossy as u8 { + ensure!( + !matches!(&self.cast_type, CastType::Plaintext(PlaintextType::Literal(LiteralType::Group))), + "Casting to a group element is not supported for `cast.lossy (yet)`" + ) + } ensure!(input_types.len() == 1, "Casting to a literal requires exactly 1 operand"); } CastType::Plaintext(PlaintextType::Struct(struct_name)) => { diff --git a/synthesizer/tests/expectations/process/execute/lossy_casts.out b/synthesizer/tests/expectations/process/execute/lossy_casts.out new file mode 100644 index 0000000000..37e96a15c0 --- /dev/null +++ b/synthesizer/tests/expectations/process/execute/lossy_casts.out @@ -0,0 +1,57 @@ +errors: [] +outputs: +- - 93754672984613362290390329026198290544u128 + - 93754672984613362290390329026198290544i128 + - 16982649547548967024u64 + - -1464094526160584592i64 + - 446349424u32 + - 446349424i32 + - 49264u16 + - -16272i16 + - 112u8 + - 112i8 + - 'false' +- - 0u128 + - 0i128 + - 0u64 + - 0i64 + - 0u32 + - 0i32 + - 0u16 + - 0i16 + - 0u8 + - 0i8 + - 'false' +- - 1u128 + - 1i128 + - 1u64 + - 1i64 + - 1u32 + - 1i32 + - 1u16 + - 1i16 + - 1u8 + - 1i8 + - 'true' +- - 0u128 + - 0i128 + - 0u64 + - 0i64 + - 0u32 + - 0i32 + - 0u16 + - 0i16 + - 0u8 + - 0i8 + - 'false' +- - 1u128 + - 1i128 + - 1u64 + - 1i64 + - 1u32 + - 1i32 + - 1u16 + - 1i16 + - 1u8 + - 1i8 + - 'true' diff --git a/synthesizer/tests/tests/process/execute/lossy_casts.aleo b/synthesizer/tests/tests/process/execute/lossy_casts.aleo new file mode 100644 index 0000000000..538b2f7a10 --- /dev/null +++ b/synthesizer/tests/tests/process/execute/lossy_casts.aleo @@ -0,0 +1,48 @@ +/* +randomness: 902384 +cases: + - program: lossy_casts.aleo + function: test_lossy_cast + inputs: [79363714989903307245735717098563574705733591463163614225748337416674727625843187853442697973404985688481508350822field] + - program: lossy_casts.aleo + function: test_lossy_cast + inputs: [0field] + - program: lossy_casts.aleo + function: test_lossy_cast + inputs: [1field] + - program: lossy_casts.aleo + function: test_lossy_cast + inputs: [340_282_366_920_938_463_463_374_607_431_768_211_456field] + - program: lossy_casts.aleo + function: test_lossy_cast + inputs: [340_282_366_920_938_463_463_374_607_431_768_211_457field] + + +*/ + +program lossy_casts.aleo; + +function test_lossy_cast: + input r0 as field.private; + cast.lossy r0 into r1 as u128; + cast.lossy r0 into r2 as i128; + cast.lossy r0 into r3 as u64; + cast.lossy r0 into r4 as i64; + cast.lossy r0 into r5 as u32; + cast.lossy r0 into r6 as i32; + cast.lossy r0 into r7 as u16; + cast.lossy r0 into r8 as i16; + cast.lossy r0 into r9 as u8; + cast.lossy r0 into r10 as i8; + cast.lossy r0 into r11 as boolean; + output r1 as u128.private; + output r2 as i128.private; + output r3 as u64.private; + output r4 as i64.private; + output r5 as u32.private; + output r6 as i32.private; + output r7 as u16.private; + output r8 as i16.private; + output r9 as u8.private; + output r10 as i8.private; + output r11 as boolean.private; From 351609aa34ca2d81b950e7251c7b94dbc52ee720 Mon Sep 17 00:00:00 2001 From: Pranav Gaddamadugu <23022326+d0cd@users.noreply.github.com> Date: Tue, 21 Nov 2023 20:01:23 -0800 Subject: [PATCH 070/298] Remove unnecessary constant in circuit --- circuit/program/src/data/literal/cast/integer.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/circuit/program/src/data/literal/cast/integer.rs b/circuit/program/src/data/literal/cast/integer.rs index 6c5aae4e5b..78655df65d 100644 --- a/circuit/program/src/data/literal/cast/integer.rs +++ b/circuit/program/src/data/literal/cast/integer.rs @@ -79,7 +79,7 @@ impl Cast> for // Then instantiate the new integer from the lower bits. false => { Boolean::assert_bits_are_zero(&bits_le[(I1::BITS.saturating_sub(1) as usize)..]); - Integer::::from_bits_le(&bits_le[..(I1::BITS.saturating_sub(1) as usize)]) + Integer::::from_bits_le(&bits_le[..(I1::BITS as usize)]) } }, // If the source type is signed and the destination type is unsigned, perform the required checks. @@ -88,7 +88,7 @@ impl Cast> for // Then instantiate the new integer from the lower bits. true => { E::assert(!&bits_le[I0::BITS.saturating_sub(1) as usize]); - Integer::::from_bits_le(&bits_le[..(I0::BITS.saturating_sub(1) as usize)]) + Integer::::from_bits_le(&bits_le) } // If the source type is larger than the destination type, check that the upper bits are zero. // Then instantiate the new integer from the lower bits. From 10c54f584884bb32650296d1a937577f5347a81a Mon Sep 17 00:00:00 2001 From: Pranav Gaddamadugu <23022326+d0cd@users.noreply.github.com> Date: Tue, 2 Jan 2024 13:52:15 +0530 Subject: [PATCH 071/298] Enable cast.lossy to groups --- .../src/stack/finalize_types/initialize.rs | 9 +--- .../src/stack/register_types/initialize.rs | 9 +--- .../src/logic/instruction/operation/cast.rs | 51 +++---------------- .../process/execute/lossy_casts.out | 5 ++ .../tests/process/execute/lossy_casts.aleo | 2 + 5 files changed, 18 insertions(+), 58 deletions(-) diff --git a/synthesizer/process/src/stack/finalize_types/initialize.rs b/synthesizer/process/src/stack/finalize_types/initialize.rs index 6044b0c7f7..5937d71d62 100644 --- a/synthesizer/process/src/stack/finalize_types/initialize.rs +++ b/synthesizer/process/src/stack/finalize_types/initialize.rs @@ -596,15 +596,10 @@ impl FinalizeTypes { // Ensure the casted register type is valid and defined. match operation.cast_type() { - CastType::Plaintext(PlaintextType::Literal(literal_type)) => { - // TODO (@d0cd) Remove restriction on lossy casts to a group element. - ensure!( - !matches!(literal_type, LiteralType::Group), - "Casting to a group element is not supported for `cast.lossy (yet)`" - ); + CastType::Plaintext(PlaintextType::Literal(_)) => { ensure!(instruction.operands().len() == 1, "Expected 1 operand."); } - _ => bail!("`cast.lossy` is only supported for casting to a literal"), + _ => bail!("`cast.lossy` is only supported for casting to a literal type."), } } _ => bail!("Instruction '{instruction}' is not for opcode '{opcode}'."), diff --git a/synthesizer/process/src/stack/register_types/initialize.rs b/synthesizer/process/src/stack/register_types/initialize.rs index 59662c7068..5582f7eb4b 100644 --- a/synthesizer/process/src/stack/register_types/initialize.rs +++ b/synthesizer/process/src/stack/register_types/initialize.rs @@ -555,15 +555,10 @@ impl RegisterTypes { // Ensure the casted register type is valid and defined. match operation.cast_type() { - CastType::Plaintext(PlaintextType::Literal(literal_type)) => { - // TODO (@d0cd) Remove restriction on lossy casts to a group element. - ensure!( - !matches!(literal_type, LiteralType::Group), - "Casting to a group element is not supported for `cast.lossy (yet)`" - ); + CastType::Plaintext(PlaintextType::Literal(_)) => { ensure!(instruction.operands().len() == 1, "Expected 1 operand."); } - _ => bail!("`cast.lossy` is only supported for casting to a literal"), + _ => bail!("`cast.lossy` is only supported for casting to a literal type."), } } _ => bail!("Instruction '{instruction}' is not for opcode '{opcode}'."), diff --git a/synthesizer/program/src/logic/instruction/operation/cast.rs b/synthesizer/program/src/logic/instruction/operation/cast.rs index f52da2dd84..2cf60e79a8 100644 --- a/synthesizer/program/src/logic/instruction/operation/cast.rs +++ b/synthesizer/program/src/logic/instruction/operation/cast.rs @@ -210,7 +210,7 @@ impl CastOperation { if VARIANT == CastVariant::CastLossy as u8 { ensure!( matches!(self.cast_type, CastType::Plaintext(PlaintextType::Literal(..))), - "`cast.lossy` is only supported for casting to a literal" + "`cast.lossy` is only supported for casting to a literal type" ) } @@ -239,17 +239,7 @@ impl CastOperation { let value = match &inputs[0] { Value::Plaintext(Plaintext::Literal(literal, ..)) => match VARIANT { 0 => literal.cast(*literal_type)?, - 1 => { - // TODO (@d0cd) Remove restriction on lossy casts to a group element. - ensure!( - !matches!( - &self.cast_type, - CastType::Plaintext(PlaintextType::Literal(LiteralType::Group)) - ), - "Casting to a group element is not supported for `cast.lossy (yet)`" - ); - literal.cast_lossy(*literal_type)? - } + 1 => literal.cast_lossy(*literal_type)?, 2.. => unreachable!("Invalid cast variant"), }, _ => bail!("Casting to a literal requires a literal"), @@ -350,7 +340,7 @@ impl CastOperation { if VARIANT == CastVariant::CastLossy as u8 { ensure!( matches!(self.cast_type, CastType::Plaintext(PlaintextType::Literal(..))), - "`cast.lossy` is only supported for casting to a literal" + "`cast.lossy` is only supported for casting to a literal type" ) } @@ -394,17 +384,7 @@ impl CastOperation { let value = match &inputs[0] { circuit::Value::Plaintext(circuit::Plaintext::Literal(literal, ..)) => match VARIANT { 0 => literal.cast(*literal_type)?, - 1 => { - // TODO (@d0cd) Remove restriction on lossy casts to a group element. - ensure!( - !matches!( - &self.cast_type, - CastType::Plaintext(PlaintextType::Literal(LiteralType::Group)) - ), - "Casting to a group element is not supported for `cast.lossy (yet)`" - ); - literal.cast_lossy(*literal_type)? - } + 1 => literal.cast_lossy(*literal_type)?, 2.. => unreachable!("Invalid cast variant"), }, _ => bail!("Casting to a literal requires a literal"), @@ -612,7 +592,7 @@ impl CastOperation { if VARIANT == CastVariant::CastLossy as u8 { ensure!( matches!(self.cast_type, CastType::Plaintext(PlaintextType::Literal(..))), - "`cast.lossy` is only supported for casting to a literal" + "`cast.lossy` is only supported for casting to a literal type" ) } @@ -641,17 +621,7 @@ impl CastOperation { let value = match &inputs[0] { Value::Plaintext(Plaintext::Literal(literal, ..)) => match VARIANT { 0 => literal.cast(*literal_type)?, - 1 => { - // TODO (@d0cd) Remove restriction on lossy casts to a group element. - ensure!( - !matches!( - &self.cast_type, - CastType::Plaintext(PlaintextType::Literal(LiteralType::Group)) - ), - "Casting to a group element is not supported for `cast.lossy (yet)`" - ); - literal.cast_lossy(*literal_type)? - } + 1 => literal.cast_lossy(*literal_type)?, 2.. => unreachable!("Invalid cast variant"), }, _ => bail!("Casting to a literal requires a literal"), @@ -684,7 +654,7 @@ impl CastOperation { if VARIANT == CastVariant::CastLossy as u8 { ensure!( matches!(self.cast_type, CastType::Plaintext(PlaintextType::Literal(..))), - "`cast.lossy` is only supported for casting to a literal" + "`cast.lossy` is only supported for casting to a literal type" ) } @@ -708,13 +678,6 @@ impl CastOperation { ); } CastType::Plaintext(PlaintextType::Literal(..)) => { - // TODO (@d0cd) Remove restriction on lossy casts to a group element. - if VARIANT == CastVariant::CastLossy as u8 { - ensure!( - !matches!(&self.cast_type, CastType::Plaintext(PlaintextType::Literal(LiteralType::Group))), - "Casting to a group element is not supported for `cast.lossy (yet)`" - ) - } ensure!(input_types.len() == 1, "Casting to a literal requires exactly 1 operand"); } CastType::Plaintext(PlaintextType::Struct(struct_name)) => { diff --git a/synthesizer/tests/expectations/process/execute/lossy_casts.out b/synthesizer/tests/expectations/process/execute/lossy_casts.out index 37e96a15c0..0a3a6279bc 100644 --- a/synthesizer/tests/expectations/process/execute/lossy_casts.out +++ b/synthesizer/tests/expectations/process/execute/lossy_casts.out @@ -11,6 +11,7 @@ outputs: - 112u8 - 112i8 - 'false' + - 4764330560507562969049837239139509827871889319573451509694277586124473432540group - - 0u128 - 0i128 - 0u64 @@ -22,6 +23,7 @@ outputs: - 0u8 - 0i8 - 'false' + - 0group - - 1u128 - 1i128 - 1u64 @@ -33,6 +35,7 @@ outputs: - 1u8 - 1i8 - 'true' + - 1540945439182663264862696551825005342995406165131907382295858612069623286213group - - 0u128 - 0i128 - 0u64 @@ -44,6 +47,7 @@ outputs: - 0u8 - 0i8 - 'false' + - 340282366920938463463374607431768211456group - - 1u128 - 1i128 - 1u64 @@ -55,3 +59,4 @@ outputs: - 1u8 - 1i8 - 'true' + - 2207376757013908562861143127796680436121374163712359508096962653679714303999group diff --git a/synthesizer/tests/tests/process/execute/lossy_casts.aleo b/synthesizer/tests/tests/process/execute/lossy_casts.aleo index 538b2f7a10..6513c1bb00 100644 --- a/synthesizer/tests/tests/process/execute/lossy_casts.aleo +++ b/synthesizer/tests/tests/process/execute/lossy_casts.aleo @@ -35,6 +35,7 @@ function test_lossy_cast: cast.lossy r0 into r9 as u8; cast.lossy r0 into r10 as i8; cast.lossy r0 into r11 as boolean; + cast.lossy r0 into r12 as group; output r1 as u128.private; output r2 as i128.private; output r3 as u64.private; @@ -46,3 +47,4 @@ function test_lossy_cast: output r9 as u8.private; output r10 as i8.private; output r11 as boolean.private; + output r12 as group.private; From f42970198d6dc5c0cabc49b00539541cf05a1fde Mon Sep 17 00:00:00 2001 From: Victor Sint Nicolaas Date: Tue, 2 Jan 2024 13:46:30 +0100 Subject: [PATCH 072/298] Correct test expectations. The RNG depends on FinalizeState --- .../tests/expectations/vm/execute_and_finalize/test_rand.out | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/synthesizer/tests/expectations/vm/execute_and_finalize/test_rand.out b/synthesizer/tests/expectations/vm/execute_and_finalize/test_rand.out index 4fefc62cfd..d753dcf2b4 100644 --- a/synthesizer/tests/expectations/vm/execute_and_finalize/test_rand.out +++ b/synthesizer/tests/expectations/vm/execute_and_finalize/test_rand.out @@ -19,14 +19,14 @@ outputs: test_rand.aleo/rand_chacha_check: outputs: - '{"type":"future","id":"3721325135151760660773959530505944451747681933722462808964783147996869797702field","value":"{\n program_id: test_rand.aleo,\n function_name: rand_chacha_check,\n arguments: [\n 0field,\n false\n ]\n}"}' - speculate: the execution was accepted + speculate: the execution was rejected add_next_block: succeeded. - verified: true execute: test_rand.aleo/rand_chacha_check: outputs: - '{"type":"future","id":"887371549615679800380522845098080464570119184210350810479392117984911457950field","value":"{\n program_id: test_rand.aleo,\n function_name: rand_chacha_check,\n arguments: [\n 1field,\n true\n ]\n}"}' - speculate: the execution was accepted + speculate: the execution was rejected add_next_block: succeeded. additional: - child_outputs: From 696d33282ed4b409ebaa0049cdf9dec2bf4fe1b7 Mon Sep 17 00:00:00 2001 From: Victor Sint Nicolaas Date: Tue, 2 Jan 2024 14:10:14 +0100 Subject: [PATCH 073/298] Add test for too many constraints --- synthesizer/src/vm/mod.rs | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/synthesizer/src/vm/mod.rs b/synthesizer/src/vm/mod.rs index a9e29d1594..d4ba2bab2b 100644 --- a/synthesizer/src/vm/mod.rs +++ b/synthesizer/src/vm/mod.rs @@ -1077,6 +1077,40 @@ function check: assert!(vm.contains_program(&ProgramID::from_str("parent_program.aleo").unwrap())); } + #[test] + fn test_deployment_synthesis_overload() { + let rng = &mut TestRng::default(); + + // Initialize a private key. + let private_key = sample_genesis_private_key(rng); + + // Initialize the genesis block. + let genesis = sample_genesis_block(rng); + + // Initialize the VM. + let vm = sample_vm(); + // Update the VM. + vm.add_next_block(&genesis).unwrap(); + + // Deploy the base program. + let program = Program::from_str( + r" +program program_layer_0.aleo; + +function do: + input r0 as [[u128; 32u32]; 2u32].private; + hash.sha3_256 r0 into r1 as field; + output r1 as field.public;", + ) + .unwrap(); + + // Create the Deployment Transaction + let deployment = vm.deploy(&private_key, &program, None, 0, None, rng).unwrap(); + + // Verify the Deployment Transaction. It should fail because there are too many constraints. + assert!(vm.check_transaction(&deployment, None, rng).is_err()); + } + #[test] #[ignore] fn test_deployment_memory_overload() { From 1beef8eb028a2c588356af539253ea523207bb22 Mon Sep 17 00:00:00 2001 From: Victor Sint Nicolaas Date: Wed, 27 Dec 2023 14:07:08 +0100 Subject: [PATCH 074/298] Prevent trunction of delegated requests by signing is_root --- circuit/program/src/request/verify.rs | 30 +++++++++++++++---- console/program/src/request/mod.rs | 7 +++-- console/program/src/request/sign.rs | 5 +++- console/program/src/request/verify.rs | 13 ++++++-- synthesizer/process/src/stack/authorize.rs | 4 ++- synthesizer/process/src/stack/call/mod.rs | 5 ++++ synthesizer/process/src/stack/deploy.rs | 3 ++ synthesizer/process/src/stack/evaluate.rs | 8 ++--- synthesizer/process/src/stack/execute.rs | 4 +-- .../process/src/stack/helpers/synthesize.rs | 13 ++++++-- synthesizer/process/src/tests/test_credits.rs | 13 ++++---- 11 files changed, 80 insertions(+), 25 deletions(-) diff --git a/circuit/program/src/request/verify.rs b/circuit/program/src/request/verify.rs index 86dd773a28..f4aed7d64a 100644 --- a/circuit/program/src/request/verify.rs +++ b/circuit/program/src/request/verify.rs @@ -20,17 +20,26 @@ impl Request { /// /// Verifies (challenge == challenge') && (address == address') && (serial_numbers == serial_numbers') where: /// challenge' := HashToScalar(r * G, pk_sig, pr_sig, signer, \[tvk, tcm, function ID, input IDs\]) - pub fn verify(&self, input_types: &[console::ValueType], tpk: &Group) -> Boolean { + pub fn verify( + &self, + input_types: &[console::ValueType], + tpk: &Group, + is_root: Boolean, + ) -> Boolean { // Compute the function ID as `Hash(network_id, program_id, function_name)`. let function_id = A::hash_bhp1024( &(&self.network_id, self.program_id.name(), self.program_id.network(), &self.function_name).to_bits_le(), ); + // Compute the is_root field + let is_root = Ternary::ternary(&is_root, &Field::::one(), &Field::::zero()); + // Construct the signature message as `[tvk, tcm, function ID, input IDs]`. let mut message = Vec::with_capacity(3 + 4 * self.input_ids.len()); message.push(self.tvk.clone()); message.push(self.tcm.clone()); message.push(function_id); + message.push(is_root); // Check the input IDs and construct the rest of the signature message. let (input_checks, append_to_message) = Self::check_input_ids::( @@ -350,17 +359,28 @@ mod tests { console::ValueType::from_str("token.aleo/token.record").unwrap(), ]; + // Sample is_root. + let is_root = true; + // Compute the signed request. - let request = - console::Request::sign(&private_key, program_id, function_name, inputs.iter(), &input_types, rng)?; - assert!(request.verify(&input_types)); + let request = console::Request::sign( + &private_key, + program_id, + function_name, + inputs.iter(), + &input_types, + is_root, + rng, + )?; + assert!(request.verify(&input_types, is_root)); // Inject the request into a circuit. let tpk = Group::::new(mode, request.to_tpk()); let request = Request::::new(mode, request); + let is_root = Boolean::new(mode, is_root); Circuit::scope(format!("Request {i}"), || { - let candidate = request.verify(&input_types, &tpk); + let candidate = request.verify(&input_types, &tpk, is_root); assert!(candidate.eject_value()); match mode.is_constant() { true => assert_scope!(<=num_constants, <=num_public, <=num_private, <=num_constraints), diff --git a/console/program/src/request/mod.rs b/console/program/src/request/mod.rs index 9fa69a0d95..35ed1a2e9f 100644 --- a/console/program/src/request/mod.rs +++ b/console/program/src/request/mod.rs @@ -184,6 +184,9 @@ mod test_helpers { let input_external_record = Value::from_str(&record_string).unwrap(); let inputs = vec![input_constant, input_public, input_private, input_record, input_external_record]; + // Construct is_root + let is_root = false; + // Construct the input types. let input_types = [ ValueType::from_str("amount.constant").unwrap(), @@ -195,8 +198,8 @@ mod test_helpers { // Compute the signed request. let request = - Request::sign(&private_key, program_id, function_name, inputs.into_iter(), &input_types, rng).unwrap(); - assert!(request.verify(&input_types)); + Request::sign(&private_key, program_id, function_name, inputs.into_iter(), &input_types, is_root, rng).unwrap(); + assert!(request.verify(&input_types, is_root)); request }) .collect() diff --git a/console/program/src/request/sign.rs b/console/program/src/request/sign.rs index c71c7fa56a..c8a395101a 100644 --- a/console/program/src/request/sign.rs +++ b/console/program/src/request/sign.rs @@ -24,6 +24,7 @@ impl Request { function_name: Identifier, inputs: impl ExactSizeIterator>>, input_types: &[ValueType], + is_root: bool, rng: &mut R, ) -> Result { // Ensure the number of inputs matches the number of input types. @@ -63,6 +64,8 @@ impl Request { let tvk = (*signer * r).to_x_coordinate(); // Compute the transition commitment `tcm` as `Hash(tvk)`. let tcm = N::hash_psd2(&[tvk])?; + // Compute the is_root field + let is_root = if is_root { Field::::one() } else { Field::::zero() }; // Compute the function ID as `Hash(network_id, program_id, function_name)`. let function_id = N::hash_bhp1024( @@ -72,7 +75,7 @@ impl Request { // Construct the hash input as `(r * G, pk_sig, pr_sig, signer, [tvk, tcm, function ID, input IDs])`. let mut message = Vec::with_capacity(9 + 2 * inputs.len()); message.extend([g_r, pk_sig, pr_sig, *signer].map(|point| point.to_x_coordinate())); - message.extend([tvk, tcm, function_id]); + message.extend([tvk, tcm, function_id, is_root]); // Initialize a vector to store the prepared inputs. let mut prepared_inputs = Vec::with_capacity(inputs.len()); diff --git a/console/program/src/request/verify.rs b/console/program/src/request/verify.rs index c1004818c4..4b420fdef2 100644 --- a/console/program/src/request/verify.rs +++ b/console/program/src/request/verify.rs @@ -19,7 +19,7 @@ impl Request { /// /// Verifies (challenge == challenge') && (address == address') && (serial_numbers == serial_numbers') where: /// challenge' := HashToScalar(r * G, pk_sig, pr_sig, signer, \[tvk, tcm, function ID, input IDs\]) - pub fn verify(&self, input_types: &[ValueType]) -> bool { + pub fn verify(&self, input_types: &[ValueType], is_root: bool) -> bool { // Verify the transition public key, transition view key, and transition commitment are well-formed. { // Compute the transition commitment `tcm` as `Hash(tvk)`. @@ -55,11 +55,15 @@ impl Request { } }; + // Compute the is_root field + let is_root = if is_root { Field::::one() } else { Field::::zero() }; + // Construct the signature message as `[tvk, tcm, function ID, input IDs]`. let mut message = Vec::with_capacity(3 + self.input_ids.len()); message.push(self.tvk); message.push(self.tcm); message.push(function_id); + message.push(is_root); if let Err(error) = self.input_ids.iter().zip_eq(&self.inputs).zip_eq(input_types).enumerate().try_for_each( |(index, ((input_id, input), input_type))| { @@ -251,10 +255,13 @@ mod tests { ValueType::from_str("token.aleo/token.record").unwrap(), ]; + let is_root = Uniform::rand(rng); + // Compute the signed request. let request = - Request::sign(&private_key, program_id, function_name, inputs.into_iter(), &input_types, rng).unwrap(); - assert!(request.verify(&input_types)); + Request::sign(&private_key, program_id, function_name, inputs.into_iter(), &input_types, is_root, rng) + .unwrap(); + assert!(request.verify(&input_types, is_root)); } } } diff --git a/synthesizer/process/src/stack/authorize.rs b/synthesizer/process/src/stack/authorize.rs index 5cc289c185..ffb835d429 100644 --- a/synthesizer/process/src/stack/authorize.rs +++ b/synthesizer/process/src/stack/authorize.rs @@ -33,9 +33,11 @@ impl Stack { // Retrieve the input types. let input_types = self.get_function(&function_name)?.input_types(); lap!(timer, "Retrieve the input types"); + // Set is_root to true. + let is_root = true; // Compute the request. - let request = Request::sign(private_key, program_id, function_name, inputs, &input_types, rng)?; + let request = Request::sign(private_key, program_id, function_name, inputs, &input_types, is_root, rng)?; lap!(timer, "Compute the request"); // Initialize the authorization. let authorization = Authorization::new(request.clone()); diff --git a/synthesizer/process/src/stack/call/mod.rs b/synthesizer/process/src/stack/call/mod.rs index 5d6578ab73..6a4fe22524 100644 --- a/synthesizer/process/src/stack/call/mod.rs +++ b/synthesizer/process/src/stack/call/mod.rs @@ -203,6 +203,9 @@ impl CallTrait for Call { // Retrieve the number of public variables in the circuit. let num_public = A::num_public(); + // Indicate that external calls are never a root request. + let is_root = false; + use circuit::Eject; // Eject the existing circuit. let r1cs = A::eject_r1cs_and_reset(); @@ -224,6 +227,7 @@ impl CallTrait for Call { *function.name(), inputs.iter(), &function.input_types(), + is_root, rng, )?; @@ -249,6 +253,7 @@ impl CallTrait for Call { *function.name(), inputs.iter(), &function.input_types(), + is_root, rng, )?; diff --git a/synthesizer/process/src/stack/deploy.rs b/synthesizer/process/src/stack/deploy.rs index 39b46f2f6f..a67014247e 100644 --- a/synthesizer/process/src/stack/deploy.rs +++ b/synthesizer/process/src/stack/deploy.rs @@ -98,6 +98,8 @@ impl Stack { }) .collect::>>()?; lap!(timer, "Sample the inputs"); + // Sample is_root + let is_root = true; // Compute the request, with a burner private key. let request = Request::sign( @@ -106,6 +108,7 @@ impl Stack { *function.name(), inputs.into_iter(), &input_types, + is_root, rng, )?; lap!(timer, "Compute the request for {}", function.name()); diff --git a/synthesizer/process/src/stack/evaluate.rs b/synthesizer/process/src/stack/evaluate.rs index 9dda9b6db2..d00aaa8a11 100644 --- a/synthesizer/process/src/stack/evaluate.rs +++ b/synthesizer/process/src/stack/evaluate.rs @@ -132,11 +132,11 @@ impl StackEvaluate for Stack { let function = self.get_function(request.function_name())?; let inputs = request.inputs(); let signer = *request.signer(); - let caller = match caller { + let (is_root, caller) = match caller { // If a caller is provided, then this is an evaluation of a child function. - Some(caller) => caller.to_address()?, + Some(caller) => (false, caller.to_address()?), // If no caller is provided, then this is an evaluation of a top-level function. - None => signer, + None => (true, signer), }; let tvk = *request.tvk(); @@ -163,7 +163,7 @@ impl StackEvaluate for Stack { lap!(timer, "Initialize the registers"); // Ensure the request is well-formed. - ensure!(request.verify(&function.input_types()), "Request is invalid"); + ensure!(request.verify(&function.input_types(), is_root), "Request is invalid"); lap!(timer, "Verify the request"); // Store the inputs. diff --git a/synthesizer/process/src/stack/execute.rs b/synthesizer/process/src/stack/execute.rs index 20758e5e84..9b3b5c73d4 100644 --- a/synthesizer/process/src/stack/execute.rs +++ b/synthesizer/process/src/stack/execute.rs @@ -188,7 +188,7 @@ impl StackExecute for Stack { lap!(timer, "Verify the input types"); // Ensure the request is well-formed. - ensure!(console_request.verify(&input_types), "Request is invalid"); + ensure!(console_request.verify(&input_types, console_is_root), "Request is invalid"); lap!(timer, "Verify the console request"); // Initialize the registers. @@ -209,7 +209,7 @@ impl StackExecute for Stack { let caller = Ternary::ternary(&is_root, request.signer(), &parent); // Ensure the request has a valid signature, inputs, and transition view key. - A::assert(request.verify(&input_types, &tpk)); + A::assert(request.verify(&input_types, &tpk, is_root)); lap!(timer, "Verify the circuit request"); // Set the transition signer. diff --git a/synthesizer/process/src/stack/helpers/synthesize.rs b/synthesizer/process/src/stack/helpers/synthesize.rs index c3530d0071..093d2f19a8 100644 --- a/synthesizer/process/src/stack/helpers/synthesize.rs +++ b/synthesizer/process/src/stack/helpers/synthesize.rs @@ -49,10 +49,19 @@ impl Stack { _ => self.sample_value(&burner_address, input_type, rng), }) .collect::>>()?; + // Sample is_root + let is_root = true; // Compute the request, with a burner private key. - let request = - Request::sign(&burner_private_key, *program_id, *function_name, inputs.into_iter(), &input_types, rng)?; + let request = Request::sign( + &burner_private_key, + *program_id, + *function_name, + inputs.into_iter(), + &input_types, + is_root, + rng, + )?; // Initialize the authorization. let authorization = Authorization::new(request.clone()); // Initialize the call stack. diff --git a/synthesizer/process/src/tests/test_credits.rs b/synthesizer/process/src/tests/test_credits.rs index aefae59a3c..546415c00d 100644 --- a/synthesizer/process/src/tests/test_credits.rs +++ b/synthesizer/process/src/tests/test_credits.rs @@ -1520,8 +1520,11 @@ mod sanity_checks { let program_id = *program.id(); // Retrieve the input types. let input_types = program.get_function(&function_name).unwrap().input_types(); + // Sample is_root. + let is_root = true; // Compute the request. - let request = Request::sign(private_key, program_id, function_name, inputs.iter(), &input_types, rng).unwrap(); + let request = + Request::sign(private_key, program_id, function_name, inputs.iter(), &input_types, is_root, rng).unwrap(); // Initialize the assignments. let assignments = Assignments::::default(); // Initialize the call stack. @@ -1563,7 +1566,7 @@ mod sanity_checks { assert_eq!(15, assignment.num_public()); assert_eq!(50681, assignment.num_private()); assert_eq!(50729, assignment.num_constraints()); - assert_eq!((98547, 109769, 77341), assignment.num_nonzeros()); + assert_eq!((98548, 109771, 77341), assignment.num_nonzeros()); } #[test] @@ -1591,7 +1594,7 @@ mod sanity_checks { assert_eq!(10, assignment.num_public()); assert_eq!(12043, assignment.num_private()); assert_eq!(12052, assignment.num_constraints()); - assert_eq!((27250, 36303, 16407), assignment.num_nonzeros()); + assert_eq!((27251, 36305, 16407), assignment.num_nonzeros()); } #[test] @@ -1625,7 +1628,7 @@ mod sanity_checks { assert_eq!(14, assignment.num_public()); assert_eq!(37840, assignment.num_private()); assert_eq!(37878, assignment.num_constraints()); - assert_eq!((72163, 80588, 56623), assignment.num_nonzeros()); + assert_eq!((72164, 80590, 56623), assignment.num_nonzeros()); } #[test] @@ -1653,6 +1656,6 @@ mod sanity_checks { assert_eq!(11, assignment.num_public()); assert_eq!(12645, assignment.num_private()); assert_eq!(12657, assignment.num_constraints()); - assert_eq!((29594, 39585, 16941), assignment.num_nonzeros()); + assert_eq!((29595, 39587, 16941), assignment.num_nonzeros()); } } From 26ee8fa5e432b1d2affa5ce641e4927c0aafd4f9 Mon Sep 17 00:00:00 2001 From: ljedrz Date: Thu, 4 Jan 2024 16:45:34 +0100 Subject: [PATCH 075/298] build: feature-gate the test constraint system Signed-off-by: ljedrz --- algorithms/src/r1cs/mod.rs | 6 ++++++ circuit/environment/Cargo.toml | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/algorithms/src/r1cs/mod.rs b/algorithms/src/r1cs/mod.rs index 11fc8042d5..b83941a556 100644 --- a/algorithms/src/r1cs/mod.rs +++ b/algorithms/src/r1cs/mod.rs @@ -33,13 +33,19 @@ pub use linear_combination::*; mod namespace; pub use namespace::*; +#[cfg(feature = "test")] mod optional_vec; +#[cfg(feature = "test")] pub use optional_vec::*; +#[cfg(feature = "test")] mod test_constraint_system; +#[cfg(feature = "test")] pub use test_constraint_system::{Fr, TestConstraintSystem}; +#[cfg(feature = "test")] mod test_constraint_checker; +#[cfg(feature = "test")] pub use test_constraint_checker::TestConstraintChecker; use snarkvm_utilities::serialize::*; diff --git a/circuit/environment/Cargo.toml b/circuit/environment/Cargo.toml index eda3378021..fe2e26042f 100644 --- a/circuit/environment/Cargo.toml +++ b/circuit/environment/Cargo.toml @@ -59,7 +59,7 @@ version = "1.18.0" [dev-dependencies.snarkvm-algorithms] path = "../../algorithms" -features = [ "polycommit_full", "snark" ] +features = [ "polycommit_full", "snark", "test" ] [dev-dependencies.snarkvm-circuit] path = "../../circuit" From 1728a22df07acefed690b18710361fab29aa84df Mon Sep 17 00:00:00 2001 From: Victor Sint Nicolaas Date: Thu, 4 Jan 2024 21:40:38 +0100 Subject: [PATCH 076/298] Check that we don't silently drop proving or verifying keys --- synthesizer/process/src/trace/mod.rs | 4 ++-- synthesizer/snark/src/proving_key/mod.rs | 2 ++ synthesizer/snark/src/verifying_key/mod.rs | 17 +++++++++++++---- 3 files changed, 17 insertions(+), 6 deletions(-) diff --git a/synthesizer/process/src/trace/mod.rs b/synthesizer/process/src/trace/mod.rs index 988be7ad29..99380fe866 100644 --- a/synthesizer/process/src/trace/mod.rs +++ b/synthesizer/process/src/trace/mod.rs @@ -315,8 +315,8 @@ impl Trace { } // Verify the proof. match VerifyingKey::verify_batch(locator, verifier_inputs, proof) { - true => Ok(()), - false => bail!("Failed to verify proof"), + Ok(()) => Ok(()), + Err(_) => bail!("Failed to verify proof"), } } } diff --git a/synthesizer/snark/src/proving_key/mod.rs b/synthesizer/snark/src/proving_key/mod.rs index 07b3cd9d8e..e07cc06e7a 100644 --- a/synthesizer/snark/src/proving_key/mod.rs +++ b/synthesizer/snark/src/proving_key/mod.rs @@ -65,10 +65,12 @@ impl ProvingKey { let timer = std::time::Instant::now(); // Prepare the instances. + let num_expected_instances = assignments.len(); let instances: BTreeMap<_, _> = assignments .iter() .map(|(proving_key, assignments)| (proving_key.deref(), assignments.as_slice())) .collect(); + ensure!(instances.len() == num_expected_instances, "duplicate proving keys found"); // Retrieve the proving parameters. let universal_prover = N::varuna_universal_prover(); diff --git a/synthesizer/snark/src/verifying_key/mod.rs b/synthesizer/snark/src/verifying_key/mod.rs index 700d791080..93d6084101 100644 --- a/synthesizer/snark/src/verifying_key/mod.rs +++ b/synthesizer/snark/src/verifying_key/mod.rs @@ -61,13 +61,19 @@ impl VerifyingKey { /// Returns `true` if the batch proof is valid for the given public inputs. #[allow(clippy::type_complexity)] - pub fn verify_batch(locator: &str, inputs: Vec<(VerifyingKey, Vec>)>, proof: &Proof) -> bool { + pub fn verify_batch( + locator: &str, + inputs: Vec<(VerifyingKey, Vec>)>, + proof: &Proof, + ) -> Result<()> { #[cfg(feature = "aleo-cli")] let timer = std::time::Instant::now(); // Convert the instances. + let num_expected_keys = inputs.len(); let keys_to_inputs: BTreeMap<_, _> = inputs.iter().map(|(verifying_key, inputs)| (verifying_key.deref(), inputs.as_slice())).collect(); + ensure!(keys_to_inputs.len() == num_expected_keys, "invalid number of keys for batch proof"); // Retrieve the verification parameters. let universal_verifier = N::varuna_universal_verifier(); @@ -77,13 +83,16 @@ impl VerifyingKey { match Varuna::::verify_batch(universal_verifier, fiat_shamir, &keys_to_inputs, proof) { Ok(is_valid) => { #[cfg(feature = "aleo-cli")] - println!("{}", format!(" • Verified '{locator}' (in {} ms)", timer.elapsed().as_millis()).dimmed()); - is_valid + println!( + "{}", + format!(" • Verified '{locator}': {is_valid} (in {} ms)", timer.elapsed().as_millis()).dimmed() + ); + if is_valid { Ok(()) } else { bail!("batch proof is invalid") } } Err(error) => { #[cfg(feature = "aleo-cli")] println!("{}", format!(" • Verifier failed: {error}").dimmed()); - false + bail!(error) } } } From 17a0ad197e77b2964c77c10ae879d39eb67179f4 Mon Sep 17 00:00:00 2001 From: bishopcheckmate Date: Thu, 4 Jan 2024 21:41:03 +0100 Subject: [PATCH 077/298] perf: fail fast in console's group from_x_coordinate Since the 'greatest' parameter is just a matter of trying 'y' and '-y' at the end and doesn't affect the fallabality of computation, we can be sure that if it has failed to compute for 'y', it will also fail for '-y', thus we can fail the group computation early. --- console/types/group/src/from_x_coordinate.rs | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/console/types/group/src/from_x_coordinate.rs b/console/types/group/src/from_x_coordinate.rs index 62a075b42a..e05786c663 100644 --- a/console/types/group/src/from_x_coordinate.rs +++ b/console/types/group/src/from_x_coordinate.rs @@ -18,14 +18,15 @@ impl Group { /// Attempts to recover an affine group element from a given x-coordinate field element. /// For safety, the resulting point is always enforced to be on the curve and in the correct subgroup. pub fn from_x_coordinate(x_coordinate: Field) -> Result { - if let Some(point) = E::Affine::from_x_coordinate(*x_coordinate, true) { - if point.is_in_correct_subgroup_assuming_on_curve() { - return Ok(Self::new(point)); + if let Some(p1) = E::Affine::from_x_coordinate(*x_coordinate, true) { + if p1.is_in_correct_subgroup_assuming_on_curve() { + return Ok(Self::new(p1)); } - } - if let Some(point) = E::Affine::from_x_coordinate(*x_coordinate, false) { - if point.is_in_correct_subgroup_assuming_on_curve() { - return Ok(Self::new(point)); + // We can unwrap when checking the lexicgraphically smallest + // point as it's not a factor for the fallability of computation. + let p2 = E::Affine::from_x_coordinate(*x_coordinate, false).unwrap(); + if p2.is_in_correct_subgroup_assuming_on_curve() { + return Ok(Self::new(p2)); } } bail!("Failed to recover an affine group from an x-coordinate of {x_coordinate}") From 0abc67baf4a711d6dffc7a427427dcad842e5e86 Mon Sep 17 00:00:00 2001 From: Michael Turner Date: Thu, 4 Jan 2024 22:46:05 -0500 Subject: [PATCH 078/298] Add alternate cost structure for finalize --- ledger/committee/src/lib.rs | 1 + synthesizer/src/vm/helpers/cost.rs | 126 ++++++++++++++--------------- 2 files changed, 64 insertions(+), 63 deletions(-) diff --git a/ledger/committee/src/lib.rs b/ledger/committee/src/lib.rs index 830cd68302..c43616e690 100644 --- a/ledger/committee/src/lib.rs +++ b/ledger/committee/src/lib.rs @@ -296,6 +296,7 @@ pub mod test_helpers { while members.len() < num_members as usize - 1 { let stake = MIN_VALIDATOR_STAKE as f64; let is_open = rng.gen(); + #[allow(clippy::cast_possible_truncation)] members.insert(Address::::new(rng.gen()), (stake as u64, is_open)); } // Return the committee. diff --git a/synthesizer/src/vm/helpers/cost.rs b/synthesizer/src/vm/helpers/cost.rs index f31bfc471d..857d87ba68 100644 --- a/synthesizer/src/vm/helpers/cost.rs +++ b/synthesizer/src/vm/helpers/cost.rs @@ -26,6 +26,11 @@ use synthesizer_program::{Command, Finalize, Instruction, Operand, StackProgram} use std::collections::HashMap; +const HASH_BHP_BYTE_COST: u64 = 10000; +const HASH_PSD_BYTE_COST: u64 = 3000; +const SET_COMMAND_BYTE_COST: u64 = 1000; +const HASH_BASE_BYTE_COST: u64 = 300; + /// Returns the *minimum* cost in microcredits to publish the given deployment (total cost, (storage cost, namespace cost)). pub fn deployment_cost(deployment: &Deployment) -> Result<(u64, (u64, u64))> { // Determine the number of bytes in the deployment. @@ -105,19 +110,21 @@ pub fn cost_in_microcredits(stack: &Stack, finalize: &Finalize // Retrieve the finalize types. let finalize_types = stack.get_finalize_types(finalize.name())?; + fn literal_size_in_bytes(literal_type: &LiteralType) -> Result { + // Retrieve the literal size in bits. + let literal_size_in_bits = literal_type.size_in_bits::() as u64; + + // Compute the size in bytes. + let literal_size_in_bytes = literal_size_in_bits.saturating_add(7).saturating_div(8); + + // Return the size of the literal. + Ok(literal_size_in_bytes) + } + // Helper function to get the plaintext type in bytes fn plaintext_size_in_bytes(stack: &Stack, plaintext_type: &PlaintextType) -> Result { match plaintext_type { - PlaintextType::Literal(literal_type) => { - // Retrieve the literal size in bits. - let literal_size_in_bits = literal_type.size_in_bits::() as u64; - - // Compute the size in bytes. - let literal_size_in_bytes = literal_size_in_bits.saturating_add(7).saturating_div(8); - - // Return the size of the literal. - Ok(literal_size_in_bytes) - } + PlaintextType::Literal(literal_type) => literal_size_in_bytes::(literal_type), PlaintextType::Struct(struct_identifier) => { // Retrieve the struct from the stack. let plaintext_struct = stack.program().get_struct(struct_identifier)?; @@ -160,6 +167,11 @@ pub fn cost_in_microcredits(stack: &Stack, finalize: &Finalize plaintext_size_in_bytes(stack, &plaintext_type) }; + let size_cost = |operands: &[Operand], multiplier: u64| { + let operand_size = operands.iter().map(operand_size_in_bytes).sum::>()?; + Ok(operand_size.saturating_mul(multiplier)) + }; + // Defines the cost of each command. let cost = |command: &Command| match command { Command::Instruction(Instruction::Abs(_)) => Ok(2_000), @@ -173,44 +185,32 @@ pub fn cost_in_microcredits(stack: &Stack, finalize: &Finalize Command::Instruction(Instruction::Call(_)) => bail!("`call` is not supported in finalize."), Command::Instruction(Instruction::Cast(_)) => Ok(2_000), Command::Instruction(Instruction::CastLossy(_)) => Ok(2_000), - Command::Instruction(Instruction::CommitBHP256(_)) => Ok(200_000), - Command::Instruction(Instruction::CommitBHP512(_)) => Ok(200_000), - Command::Instruction(Instruction::CommitBHP768(_)) => Ok(200_000), - Command::Instruction(Instruction::CommitBHP1024(_)) => Ok(200_000), - Command::Instruction(Instruction::CommitPED64(_)) => Ok(100_000), - Command::Instruction(Instruction::CommitPED128(_)) => Ok(100_000), + Command::Instruction(Instruction::CommitBHP256(commit)) => size_cost(commit.operands(), HASH_BHP_BYTE_COST), + Command::Instruction(Instruction::CommitBHP512(commit)) => size_cost(commit.operands(), HASH_BHP_BYTE_COST), + Command::Instruction(Instruction::CommitBHP768(commit)) => size_cost(commit.operands(), HASH_BHP_BYTE_COST), + Command::Instruction(Instruction::CommitBHP1024(commit)) => size_cost(commit.operands(), HASH_BHP_BYTE_COST), + Command::Instruction(Instruction::CommitPED64(commit)) => size_cost(commit.operands(), HASH_BASE_BYTE_COST), + Command::Instruction(Instruction::CommitPED128(commit)) => size_cost(commit.operands(), HASH_BASE_BYTE_COST), Command::Instruction(Instruction::Div(_)) => Ok(10_000), Command::Instruction(Instruction::DivWrapped(_)) => Ok(2_000), Command::Instruction(Instruction::Double(_)) => Ok(2_000), Command::Instruction(Instruction::GreaterThan(_)) => Ok(2_000), Command::Instruction(Instruction::GreaterThanOrEqual(_)) => Ok(2_000), - Command::Instruction(Instruction::HashBHP256(_)) => Ok(100_000), - Command::Instruction(Instruction::HashBHP512(_)) => Ok(100_000), - Command::Instruction(Instruction::HashBHP768(_)) => Ok(100_000), - Command::Instruction(Instruction::HashBHP1024(_)) => Ok(100_000), - Command::Instruction(Instruction::HashKeccak256(_)) => Ok(100_000), - Command::Instruction(Instruction::HashKeccak384(_)) => Ok(100_000), - Command::Instruction(Instruction::HashKeccak512(_)) => Ok(100_000), - Command::Instruction(Instruction::HashPED64(_)) => Ok(20_000), - Command::Instruction(Instruction::HashPED128(_)) => Ok(30_000), - Command::Instruction(Instruction::HashPSD2(hash)) => match hash.destination_type() { - PlaintextType::Literal(LiteralType::Address) | PlaintextType::Literal(LiteralType::Group) => Ok(600_000), - PlaintextType::Literal(..) => Ok(60_000), - plaintext_type => bail!("`hash.psd2` is not supported for plaintext type '{plaintext_type}'"), - }, - Command::Instruction(Instruction::HashPSD4(hash)) => match hash.destination_type() { - PlaintextType::Literal(LiteralType::Address) | PlaintextType::Literal(LiteralType::Group) => Ok(700_000), - PlaintextType::Literal(..) => Ok(100_000), - plaintext_type => bail!("`hash.psd4` is not supported for plaintext type '{plaintext_type}'"), - }, - Command::Instruction(Instruction::HashPSD8(hash)) => match hash.destination_type() { - PlaintextType::Literal(LiteralType::Address) | PlaintextType::Literal(LiteralType::Group) => Ok(800_000), - PlaintextType::Literal(..) => Ok(200_000), - plaintext_type => bail!("`hash.psd8` is not supported for plaintext type '{plaintext_type}'"), - }, - Command::Instruction(Instruction::HashSha3_256(_)) => Ok(100_000), - Command::Instruction(Instruction::HashSha3_384(_)) => Ok(100_000), - Command::Instruction(Instruction::HashSha3_512(_)) => Ok(100_000), + Command::Instruction(Instruction::HashBHP256(hash)) => size_cost(hash.operands(), HASH_BHP_BYTE_COST), + Command::Instruction(Instruction::HashBHP512(hash)) => size_cost(hash.operands(), HASH_BHP_BYTE_COST), + Command::Instruction(Instruction::HashBHP768(hash)) => size_cost(hash.operands(), HASH_BHP_BYTE_COST), + Command::Instruction(Instruction::HashBHP1024(hash)) => size_cost(hash.operands(), HASH_BHP_BYTE_COST), + Command::Instruction(Instruction::HashKeccak256(hash)) => size_cost(hash.operands(), HASH_BASE_BYTE_COST), + Command::Instruction(Instruction::HashKeccak384(hash)) => size_cost(hash.operands(), HASH_BASE_BYTE_COST), + Command::Instruction(Instruction::HashKeccak512(hash)) => size_cost(hash.operands(), HASH_BASE_BYTE_COST), + Command::Instruction(Instruction::HashPED64(hash)) => size_cost(hash.operands(), HASH_BASE_BYTE_COST), + Command::Instruction(Instruction::HashPED128(hash)) => size_cost(hash.operands(), HASH_BASE_BYTE_COST), + Command::Instruction(Instruction::HashPSD2(hash)) => size_cost(hash.operands(), HASH_PSD_BYTE_COST), + Command::Instruction(Instruction::HashPSD4(hash)) => size_cost(hash.operands(), HASH_PSD_BYTE_COST), + Command::Instruction(Instruction::HashPSD8(hash)) => size_cost(hash.operands(), HASH_PSD_BYTE_COST), + Command::Instruction(Instruction::HashSha3_256(hash)) => size_cost(hash.operands(), HASH_BASE_BYTE_COST), + Command::Instruction(Instruction::HashSha3_384(hash)) => size_cost(hash.operands(), HASH_BASE_BYTE_COST), + Command::Instruction(Instruction::HashSha3_512(hash)) => size_cost(hash.operands(), HASH_BASE_BYTE_COST), Command::Instruction(Instruction::HashManyPSD2(_)) => { bail!("`hash_many.psd2` is not supported in finalize.") } @@ -226,7 +226,19 @@ pub fn cost_in_microcredits(stack: &Stack, finalize: &Finalize Command::Instruction(Instruction::LessThan(_)) => Ok(2_000), Command::Instruction(Instruction::LessThanOrEqual(_)) => Ok(2_000), Command::Instruction(Instruction::Modulo(_)) => Ok(2_000), - Command::Instruction(Instruction::Mul(_)) => Ok(150_000), + Command::Instruction(Instruction::Mul(mul)) => mul.operands().iter().try_fold(0u64, |acc, operand| { + let finalize_type = finalize_types.get_type_from_operand(stack, operand)?; + let cost = match finalize_type { + FinalizeType::Plaintext(plaintext) => match plaintext { + PlaintextType::Literal(LiteralType::Group) => acc + 50000, + PlaintextType::Literal(LiteralType::Scalar) => acc + 50000, + PlaintextType::Literal(_) => acc + 2000, + _ => bail!("multiplication of structs or arrays is not supported."), + }, + _ => bail!("multiplication of non-plaintext finalize types is not supported."), + }; + Ok(cost) + }), Command::Instruction(Instruction::MulWrapped(_)) => Ok(2_000), Command::Instruction(Instruction::Nand(_)) => Ok(2_000), Command::Instruction(Instruction::Neg(_)) => Ok(2_000), @@ -243,7 +255,7 @@ pub fn cost_in_microcredits(stack: &Stack, finalize: &Finalize Command::Instruction(Instruction::Shr(_)) => Ok(2_000), Command::Instruction(Instruction::ShrWrapped(_)) => Ok(2_000), Command::Instruction(Instruction::Square(_)) => Ok(2_000), - Command::Instruction(Instruction::SquareRoot(_)) => Ok(120_000), + Command::Instruction(Instruction::SquareRoot(_)) => Ok(50_000), Command::Instruction(Instruction::Sub(_)) => Ok(10_000), Command::Instruction(Instruction::SubWrapped(_)) => Ok(2_000), Command::Instruction(Instruction::Ternary(_)) => Ok(2_000), @@ -251,26 +263,14 @@ pub fn cost_in_microcredits(stack: &Stack, finalize: &Finalize // TODO: The following 'finalize' commands are currently priced higher than expected. // Expect these numbers to change as their usage is stabilized. Command::Await(_) => Ok(2_000), - Command::Contains(_) => Ok(12_500), - Command::Get(_) => Ok(25_000), - Command::GetOrUse(_) => Ok(25_000), + Command::Contains(_) => Ok(15_000), + Command::Get(_) => Ok(15_000), + Command::GetOrUse(_) => Ok(15_000), Command::RandChaCha(_) => Ok(25_000), Command::Remove(_) => Ok(10_000), - Command::Set(set) => { - // TODO (raychu86): Adjust this multiplier. - // The cost in microcredits per byte of storage used by the `set` command. - const SET_COMMAND_BYTE_MULTIPLIER: u64 = 1000; - - // Get the size in bytes of the key and value types. - let key_size_in_bytes = operand_size_in_bytes(set.key())?; - let value_size_in_bytes = operand_size_in_bytes(set.value())?; - - // Calculate the size in bytes of the key and value. - let stored_size_in_bytes = key_size_in_bytes.saturating_add(value_size_in_bytes); - - // Calculate the cost. - Ok(stored_size_in_bytes.saturating_mul(SET_COMMAND_BYTE_MULTIPLIER)) - } + Command::Set(set) => Ok(operand_size_in_bytes(set.key())? + .saturating_add(operand_size_in_bytes(set.value())?) + .saturating_mul(SET_COMMAND_BYTE_COST)), Command::BranchEq(_) | Command::BranchNeq(_) => Ok(5_000), Command::Position(_) => Ok(1_000), }; From ce4ea932be410e803a996d3663fe36cd214a15eb Mon Sep 17 00:00:00 2001 From: Victor Sint Nicolaas Date: Tue, 10 Oct 2023 16:28:32 +0200 Subject: [PATCH 079/298] Enforce the use of the same signer in a given call graph. Use root tvk to make scm hiding. --- circuit/program/src/request/mod.rs | 13 ++++ circuit/program/src/request/verify.rs | 34 ++++++++-- circuit/types/address/src/lib.rs | 6 ++ console/program/src/request/bytes.rs | 22 ++++++- console/program/src/request/mod.rs | 18 +++++- console/program/src/request/serialize.rs | 5 +- console/program/src/request/sign.rs | 5 ++ console/program/src/request/verify.rs | 6 +- ledger/block/src/transition/bytes.rs | 8 ++- ledger/block/src/transition/mod.rs | 14 ++++- ledger/block/src/transition/serialize.rs | 3 + ledger/block/src/verify.rs | 1 + ledger/narwhal/batch-certificate/src/lib.rs | 2 +- ledger/store/src/helpers/memory/transition.rs | 18 ++++++ .../store/src/helpers/rocksdb/internal/id.rs | 4 ++ ledger/store/src/helpers/rocksdb/program.rs | 2 +- .../store/src/helpers/rocksdb/transition.rs | 18 ++++++ ledger/store/src/program/finalize.rs | 2 +- ledger/store/src/transition/mod.rs | 62 ++++++++++++++++++- synthesizer/benches/kary_merkle_tree.rs | 8 +-- synthesizer/process/src/execute.rs | 6 +- .../process/src/stack/authorization/mod.rs | 7 +++ synthesizer/process/src/stack/authorize.rs | 8 ++- synthesizer/process/src/stack/call/mod.rs | 13 +++- synthesizer/process/src/stack/deploy.rs | 9 ++- synthesizer/process/src/stack/execute.rs | 19 +++++- .../process/src/stack/helpers/synthesize.rs | 19 +++++- .../process/src/stack/registers/caller.rs | 24 +++++++ .../process/src/stack/registers/mod.rs | 6 ++ synthesizer/process/src/tests/test_credits.rs | 8 ++- synthesizer/process/src/tests/test_execute.rs | 2 +- synthesizer/process/src/traits/mod.rs | 1 + synthesizer/process/src/verify_execution.rs | 10 ++- synthesizer/process/src/verify_fee.rs | 4 +- synthesizer/program/src/closure/mod.rs | 4 +- synthesizer/program/src/finalize/mod.rs | 2 +- synthesizer/program/src/function/mod.rs | 4 +- .../program/src/traits/stack_and_registers.rs | 12 ++++ synthesizer/src/vm/execute.rs | 20 +++--- vm/package/run.rs | 2 +- 40 files changed, 369 insertions(+), 62 deletions(-) diff --git a/circuit/program/src/request/mod.rs b/circuit/program/src/request/mod.rs index 0a7424667a..b060ea8cc6 100644 --- a/circuit/program/src/request/mod.rs +++ b/circuit/program/src/request/mod.rs @@ -136,6 +136,8 @@ pub struct Request { tvk: Field, /// The transition commitment. tcm: Field, + /// The signer commitment. + scm: Field, } #[cfg(console)] @@ -147,6 +149,9 @@ impl Inject for Request { // Inject the transition commitment `tcm` as `Mode::Public`. let tcm = Field::new(Mode::Public, *request.tcm()); + // Inject the signer commitment `scm` as `Mode::Public`. + let scm = Field::new(Mode::Public, *request.scm()); + // Inject the inputs. let inputs = match request .input_ids() @@ -218,6 +223,7 @@ impl Inject for Request { sk_tag: Field::new(mode, *request.sk_tag()), tvk: Field::new(mode, *request.tvk()), tcm, + scm, } } } @@ -272,6 +278,11 @@ impl Request { pub const fn tcm(&self) -> &Field { &self.tcm } + + /// Returns the signer commitment. + pub const fn scm(&self) -> &Field { + &self.scm + } } #[cfg(console)] @@ -290,6 +301,7 @@ impl Eject for Request { self.sk_tag.eject_mode(), self.tvk.eject_mode(), self.tcm.eject_mode(), + self.scm.eject_mode(), ]) } @@ -306,6 +318,7 @@ impl Eject for Request { self.sk_tag.eject_value(), self.tvk.eject_value(), self.tcm.eject_value(), + self.scm.eject_value(), )) } } diff --git a/circuit/program/src/request/verify.rs b/circuit/program/src/request/verify.rs index 86dd773a28..41a2560cdb 100644 --- a/circuit/program/src/request/verify.rs +++ b/circuit/program/src/request/verify.rs @@ -16,11 +16,16 @@ use super::*; impl Request { /// Returns `true` if the input IDs are derived correctly, the input records all belong to the signer, - /// and the signature is valid. tpk is passed separately so it can have a Mode different from Self. + /// and the signature is valid. /// /// Verifies (challenge == challenge') && (address == address') && (serial_numbers == serial_numbers') where: /// challenge' := HashToScalar(r * G, pk_sig, pr_sig, signer, \[tvk, tcm, function ID, input IDs\]) - pub fn verify(&self, input_types: &[console::ValueType], tpk: &Group) -> Boolean { + pub fn verify( + &self, + input_types: &[console::ValueType], + tpk: &Group, + root_tvk: Option>, + ) -> Boolean { // Compute the function ID as `Hash(network_id, program_id, function_name)`. let function_id = A::hash_bhp1024( &(&self.network_id, self.program_id.name(), self.program_id.network(), &self.function_name).to_bits_le(), @@ -52,15 +57,21 @@ impl Request { None => A::halt("Missing input elements in request verification"), } - // Verify the transition public key and commitment are well-formed. + let root_tvk = root_tvk.unwrap_or(Field::::new(Mode::Private, self.tvk.eject_value())); + + // Verify the transition public key and commitments are well-formed. let tpk_checks = { // Compute the transition commitment as `Hash(tvk)`. let tcm = A::hash_psd2(&[self.tvk.clone()]); + // Compute the signer commitment as `Hash(signer || root_tvk)`. + let scm = A::hash_psd2(&[self.signer.to_x_coordinate(), root_tvk]); // Ensure the transition public key matches with the saved one from the signature. tpk.is_equal(&self.to_tpk()) // Ensure the computed transition commitment matches. & tcm.is_equal(&self.tcm) + // Ensure the computed signer commitment matches. + & scm.is_equal(&self.scm) }; // Verify the signature. @@ -350,9 +361,19 @@ mod tests { console::ValueType::from_str("token.aleo/token.record").unwrap(), ]; + // Sample root_tvk. + let root_tvk = None; + // Compute the signed request. - let request = - console::Request::sign(&private_key, program_id, function_name, inputs.iter(), &input_types, rng)?; + let request = console::Request::sign( + &private_key, + program_id, + function_name, + inputs.iter(), + &input_types, + root_tvk, + rng, + )?; assert!(request.verify(&input_types)); // Inject the request into a circuit. @@ -360,7 +381,8 @@ mod tests { let request = Request::::new(mode, request); Circuit::scope(format!("Request {i}"), || { - let candidate = request.verify(&input_types, &tpk); + let root_tvk = None; + let candidate = request.verify(&input_types, &tpk, root_tvk); assert!(candidate.eject_value()); match mode.is_constant() { true => assert_scope!(<=num_constants, <=num_public, <=num_private, <=num_constraints), diff --git a/circuit/types/address/src/lib.rs b/circuit/types/address/src/lib.rs index 0e4dec4b5d..983ffc30e6 100644 --- a/circuit/types/address/src/lib.rs +++ b/circuit/types/address/src/lib.rs @@ -45,6 +45,12 @@ impl Address { pub fn zero() -> Self { Self(Group::zero()) } + + /// Outputs the x coordinate of the address + #[inline] + pub fn to_x_coordinate(&self) -> Field { + self.0.to_x_coordinate() + } } #[cfg(console)] diff --git a/console/program/src/request/bytes.rs b/console/program/src/request/bytes.rs index ec664b9c48..84cb5ea1dd 100644 --- a/console/program/src/request/bytes.rs +++ b/console/program/src/request/bytes.rs @@ -48,8 +48,22 @@ impl FromBytes for Request { let tvk = FromBytes::read_le(&mut reader)?; // Read the transition commitment. let tcm = FromBytes::read_le(&mut reader)?; - - Ok(Self::from((signer, network_id, program_id, function_name, input_ids, inputs, signature, sk_tag, tvk, tcm))) + // Read the signer commitment. + let scm = FromBytes::read_le(&mut reader)?; + + Ok(Self::from(( + signer, + network_id, + program_id, + function_name, + input_ids, + inputs, + signature, + sk_tag, + tvk, + tcm, + scm, + ))) } } @@ -93,7 +107,9 @@ impl ToBytes for Request { // Write the transition view key. self.tvk.write_le(&mut writer)?; // Write the transition commitment. - self.tcm.write_le(&mut writer) + self.tcm.write_le(&mut writer)?; + // Write the signer commitment. + self.scm.write_le(&mut writer) } } diff --git a/console/program/src/request/mod.rs b/console/program/src/request/mod.rs index 9fa69a0d95..10e7ebb30c 100644 --- a/console/program/src/request/mod.rs +++ b/console/program/src/request/mod.rs @@ -48,6 +48,8 @@ pub struct Request { tvk: Field, /// The transition commitment. tcm: Field, + /// The signer commitment. + scm: Field, } impl @@ -62,11 +64,12 @@ impl Field, Field, Field, + Field, )> for Request { /// Note: See `Request::sign` to create the request. This method is used to eject from a circuit. fn from( - (signer, network_id, program_id, function_name, input_ids, inputs, signature, sk_tag, tvk, tcm): ( + (signer, network_id, program_id, function_name, input_ids, inputs, signature, sk_tag, tvk, tcm, scm): ( Address, U16, ProgramID, @@ -77,13 +80,14 @@ impl Field, Field, Field, + Field, ), ) -> Self { // Ensure the network ID is correct. if *network_id != N::ID { N::halt(format!("Invalid network ID. Expected {}, found {}", N::ID, *network_id)) } else { - Self { signer, network_id, program_id, function_name, input_ids, inputs, signature, sk_tag, tvk, tcm } + Self { signer, network_id, program_id, function_name, input_ids, inputs, signature, sk_tag, tvk, tcm, scm } } } } @@ -150,6 +154,11 @@ impl Request { pub const fn tcm(&self) -> &Field { &self.tcm } + + /// Returns the signer commitment `scm`. + pub const fn scm(&self) -> &Field { + &self.scm + } } #[cfg(test)] @@ -193,9 +202,12 @@ mod test_helpers { ValueType::from_str("token.aleo/token.record").unwrap(), ]; + // Sample root_tvk. + let root_tvk = None; + // Compute the signed request. let request = - Request::sign(&private_key, program_id, function_name, inputs.into_iter(), &input_types, rng).unwrap(); + Request::sign(&private_key, program_id, function_name, inputs.into_iter(), &input_types, root_tvk, rng).unwrap(); assert!(request.verify(&input_types)); request }) diff --git a/console/program/src/request/serialize.rs b/console/program/src/request/serialize.rs index 905b67d991..34c8f73ace 100644 --- a/console/program/src/request/serialize.rs +++ b/console/program/src/request/serialize.rs @@ -21,7 +21,7 @@ impl Serialize for Request { fn serialize(&self, serializer: S) -> Result { match serializer.is_human_readable() { true => { - let mut transition = serializer.serialize_struct("Request", 10)?; + let mut transition = serializer.serialize_struct("Request", 11)?; transition.serialize_field("signer", &self.signer)?; transition.serialize_field("network", &self.network_id)?; transition.serialize_field("program", &self.program_id)?; @@ -32,6 +32,7 @@ impl Serialize for Request { transition.serialize_field("sk_tag", &self.sk_tag)?; transition.serialize_field("tvk", &self.tvk)?; transition.serialize_field("tcm", &self.tcm)?; + transition.serialize_field("scm", &self.scm)?; transition.end() } false => ToBytesSerializer::serialize_with_size_encoding(self, serializer), @@ -68,6 +69,8 @@ impl<'de, N: Network> Deserialize<'de> for Request { DeserializeExt::take_from_value::(&mut request, "tvk")?, // Retrieve the `tcm`. DeserializeExt::take_from_value::(&mut request, "tcm")?, + // Retrieve the `scm`. + DeserializeExt::take_from_value::(&mut request, "scm")?, ))) } false => FromBytesDeserializer::::deserialize_with_size_encoding(deserializer, "request"), diff --git a/console/program/src/request/sign.rs b/console/program/src/request/sign.rs index c71c7fa56a..721ed42450 100644 --- a/console/program/src/request/sign.rs +++ b/console/program/src/request/sign.rs @@ -24,6 +24,7 @@ impl Request { function_name: Identifier, inputs: impl ExactSizeIterator>>, input_types: &[ValueType], + root_tvk: Option>, rng: &mut R, ) -> Result { // Ensure the number of inputs matches the number of input types. @@ -63,6 +64,9 @@ impl Request { let tvk = (*signer * r).to_x_coordinate(); // Compute the transition commitment `tcm` as `Hash(tvk)`. let tcm = N::hash_psd2(&[tvk])?; + // Compute the signer commitment `scm` as `Hash(signer || root_tvk)`. + let root_tvk = root_tvk.unwrap_or(tvk); + let scm = N::hash_psd2(&[signer.deref().to_x_coordinate(), root_tvk])?; // Compute the function ID as `Hash(network_id, program_id, function_name)`. let function_id = N::hash_bhp1024( @@ -231,6 +235,7 @@ impl Request { sk_tag, tvk, tcm, + scm, }) } } diff --git a/console/program/src/request/verify.rs b/console/program/src/request/verify.rs index c1004818c4..d57c642dab 100644 --- a/console/program/src/request/verify.rs +++ b/console/program/src/request/verify.rs @@ -251,9 +251,13 @@ mod tests { ValueType::from_str("token.aleo/token.record").unwrap(), ]; + // Sample root_tvk + let root_tvk = None; + // Compute the signed request. let request = - Request::sign(&private_key, program_id, function_name, inputs.into_iter(), &input_types, rng).unwrap(); + Request::sign(&private_key, program_id, function_name, inputs.into_iter(), &input_types, root_tvk, rng) + .unwrap(); assert!(request.verify(&input_types)); } } diff --git a/ledger/block/src/transition/bytes.rs b/ledger/block/src/transition/bytes.rs index dacc875df8..3654b7de17 100644 --- a/ledger/block/src/transition/bytes.rs +++ b/ledger/block/src/transition/bytes.rs @@ -53,10 +53,12 @@ impl FromBytes for Transition { let tpk = FromBytes::read_le(&mut reader)?; // Read the transition commitment. let tcm = FromBytes::read_le(&mut reader)?; + // Read the signer commitment. + let scm = FromBytes::read_le(&mut reader)?; // Construct the candidate transition. let transition = - Self::new(program_id, function_name, inputs, outputs, tpk, tcm).map_err(|e| error(e.to_string()))?; + Self::new(program_id, function_name, inputs, outputs, tpk, tcm, scm).map_err(|e| error(e.to_string()))?; // Ensure the transition ID matches the expected ID. match transition_id == *transition.id() { true => Ok(transition), @@ -91,7 +93,9 @@ impl ToBytes for Transition { // Write the transition public key. self.tpk.write_le(&mut writer)?; // Write the transition commitment. - self.tcm.write_le(&mut writer) + self.tcm.write_le(&mut writer)?; + // Write the signer commitment. + self.scm.write_le(&mut writer) } } diff --git a/ledger/block/src/transition/mod.rs b/ledger/block/src/transition/mod.rs index 26ee80ac41..de5926afd6 100644 --- a/ledger/block/src/transition/mod.rs +++ b/ledger/block/src/transition/mod.rs @@ -61,6 +61,8 @@ pub struct Transition { tpk: Group, /// The transition commitment. tcm: Field, + /// The transition signer commitment. + scm: Field, } impl Transition { @@ -73,12 +75,13 @@ impl Transition { outputs: Vec>, tpk: Group, tcm: Field, + scm: Field, ) -> Result { // Compute the transition ID. let function_tree = Self::function_tree(&inputs, &outputs)?; let id = N::hash_bhp512(&(*function_tree.root(), tcm).to_bits_le())?; // Return the transition. - Ok(Self { id: id.into(), program_id, function_name, inputs, outputs, tpk, tcm }) + Ok(Self { id: id.into(), program_id, function_name, inputs, outputs, tpk, tcm, scm }) } /// Initializes a new transition from a request and response. @@ -255,8 +258,10 @@ impl Transition { let tpk = request.to_tpk(); // Retrieve the `tcm`. let tcm = *request.tcm(); + // Retrieve the `scm`. + let scm = *request.scm(); // Return the transition. - Self::new(program_id, function_name, inputs, outputs, tpk, tcm) + Self::new(program_id, function_name, inputs, outputs, tpk, tcm, scm) } } @@ -295,6 +300,11 @@ impl Transition { pub const fn tcm(&self) -> &Field { &self.tcm } + + /// Returns the signer commitment. + pub const fn scm(&self) -> &Field { + &self.scm + } } impl Transition { diff --git a/ledger/block/src/transition/serialize.rs b/ledger/block/src/transition/serialize.rs index 47e5e4b4f4..a9c1c31dae 100644 --- a/ledger/block/src/transition/serialize.rs +++ b/ledger/block/src/transition/serialize.rs @@ -27,6 +27,7 @@ impl Serialize for Transition { transition.serialize_field("outputs", &self.outputs)?; transition.serialize_field("tpk", &self.tpk)?; transition.serialize_field("tcm", &self.tcm)?; + transition.serialize_field("scm", &self.scm)?; transition.end() } false => ToBytesSerializer::serialize_with_size_encoding(self, serializer), @@ -58,6 +59,8 @@ impl<'de, N: Network> Deserialize<'de> for Transition { DeserializeExt::take_from_value::(&mut transition, "tpk")?, // Retrieve the `tcm`. DeserializeExt::take_from_value::(&mut transition, "tcm")?, + // Retrieve the `scm`. + DeserializeExt::take_from_value::(&mut transition, "scm")?, ) .map_err(de::Error::custom)?; diff --git a/ledger/block/src/verify.rs b/ledger/block/src/verify.rs index 22931ef5e0..ca9b6c8c5a 100644 --- a/ledger/block/src/verify.rs +++ b/ledger/block/src/verify.rs @@ -458,6 +458,7 @@ impl Block { if has_duplicates(self.transition_commitments()) { bail!("Found a duplicate transition commitment in block {height}"); } + Ok(()) } } diff --git a/ledger/narwhal/batch-certificate/src/lib.rs b/ledger/narwhal/batch-certificate/src/lib.rs index c053433e5c..206732f1b2 100644 --- a/ledger/narwhal/batch-certificate/src/lib.rs +++ b/ledger/narwhal/batch-certificate/src/lib.rs @@ -297,7 +297,7 @@ pub mod test_helpers { // Sample the leader certificate. let certificate = sample_batch_certificate_for_round_with_previous_certificate_ids( current_round, - previous_certificate_ids.clone(), + previous_certificate_ids, rng, ); diff --git a/ledger/store/src/helpers/memory/transition.rs b/ledger/store/src/helpers/memory/transition.rs index 651181fd34..e3e5ef33ba 100644 --- a/ledger/store/src/helpers/memory/transition.rs +++ b/ledger/store/src/helpers/memory/transition.rs @@ -36,6 +36,10 @@ pub struct TransitionMemory { tcm_map: MemoryMap>, /// The reverse `tcm` map. reverse_tcm_map: MemoryMap, N::TransitionID>, + /// The signer commitments. + scm_map: MemoryMap>, + /// The reverse `scm` map. + reverse_scm_map: MemoryMap, N::TransitionID>, } #[rustfmt::skip] @@ -47,6 +51,8 @@ impl TransitionStorage for TransitionMemory { type ReverseTPKMap = MemoryMap, N::TransitionID>; type TCMMap = MemoryMap>; type ReverseTCMMap = MemoryMap, N::TransitionID>; + type SCMMap = MemoryMap>; + type ReverseSCMMap = MemoryMap, N::TransitionID>; /// Initializes the transition storage. fn open(dev: Option) -> Result { @@ -58,6 +64,8 @@ impl TransitionStorage for TransitionMemory { reverse_tpk_map: MemoryMap::default(), tcm_map: MemoryMap::default(), reverse_tcm_map: MemoryMap::default(), + scm_map: MemoryMap::default(), + reverse_scm_map: MemoryMap::default(), }) } @@ -95,6 +103,16 @@ impl TransitionStorage for TransitionMemory { fn reverse_tcm_map(&self) -> &Self::ReverseTCMMap { &self.reverse_tcm_map } + + /// Returns the signer commitments. + fn scm_map(&self) -> &Self::TCMMap { + &self.scm_map + } + + /// Returns the reverse `scm` map. + fn reverse_scm_map(&self) -> &Self::ReverseTCMMap { + &self.reverse_scm_map + } } /// An in-memory transition input storage. diff --git a/ledger/store/src/helpers/rocksdb/internal/id.rs b/ledger/store/src/helpers/rocksdb/internal/id.rs index 4a8dd7d3ad..7857e3fe55 100644 --- a/ledger/store/src/helpers/rocksdb/internal/id.rs +++ b/ledger/store/src/helpers/rocksdb/internal/id.rs @@ -184,6 +184,8 @@ pub enum TransitionMap { ReverseTPK = DataID::TransitionReverseTPKMap as u16, TCM = DataID::TransitionTCMMap as u16, ReverseTCM = DataID::TransitionReverseTCMMap as u16, + SCM = DataID::TransitionSCMMap as u16, + ReverseSCM = DataID::TransitionReverseSCMMap as u16, } /// The RocksDB map prefix for program-related entries. @@ -278,6 +280,8 @@ enum DataID { TransitionReverseTPKMap, TransitionTCMMap, TransitionReverseTCMMap, + TransitionSCMMap, + TransitionReverseSCMMap, // Program ProgramIDMap, KeyValueMap, diff --git a/ledger/store/src/helpers/rocksdb/program.rs b/ledger/store/src/helpers/rocksdb/program.rs index f020d2b35b..4cf377fd17 100644 --- a/ledger/store/src/helpers/rocksdb/program.rs +++ b/ledger/store/src/helpers/rocksdb/program.rs @@ -69,7 +69,7 @@ impl FinalizeStorage for FinalizeDB { Ok(Self { committee_store, program_id_map: rocksdb::RocksDB::open_map_testing(temp_dir.clone(), dev, MapID::Program(ProgramMap::ProgramID))?, - key_value_map: rocksdb::RocksDB::open_nested_map_testing(temp_dir.clone(), dev, MapID::Program(ProgramMap::KeyValueID))?, + key_value_map: rocksdb::RocksDB::open_nested_map_testing(temp_dir, dev, MapID::Program(ProgramMap::KeyValueID))?, dev, }) } diff --git a/ledger/store/src/helpers/rocksdb/transition.rs b/ledger/store/src/helpers/rocksdb/transition.rs index b6af3398d5..dd28fd063f 100644 --- a/ledger/store/src/helpers/rocksdb/transition.rs +++ b/ledger/store/src/helpers/rocksdb/transition.rs @@ -43,6 +43,10 @@ pub struct TransitionDB { tcm_map: DataMap>, /// The reverse `tcm` map. reverse_tcm_map: DataMap, N::TransitionID>, + /// The signer commitments. + scm_map: DataMap>, + /// The reverse `scm` map. + reverse_scm_map: DataMap, N::TransitionID>, } #[rustfmt::skip] @@ -54,6 +58,8 @@ impl TransitionStorage for TransitionDB { type ReverseTPKMap = DataMap, N::TransitionID>; type TCMMap = DataMap>; type ReverseTCMMap = DataMap, N::TransitionID>; + type SCMMap = DataMap>; + type ReverseSCMMap = DataMap, N::TransitionID>; /// Initializes the transition storage. fn open(dev: Option) -> Result { @@ -65,6 +71,8 @@ impl TransitionStorage for TransitionDB { reverse_tpk_map: rocksdb::RocksDB::open_map(N::ID, dev, MapID::Transition(TransitionMap::ReverseTPK))?, tcm_map: rocksdb::RocksDB::open_map(N::ID, dev, MapID::Transition(TransitionMap::TCM))?, reverse_tcm_map: rocksdb::RocksDB::open_map(N::ID, dev, MapID::Transition(TransitionMap::ReverseTCM))?, + scm_map: rocksdb::RocksDB::open_map(N::ID, dev, MapID::Transition(TransitionMap::SCM))?, + reverse_scm_map: rocksdb::RocksDB::open_map(N::ID, dev, MapID::Transition(TransitionMap::ReverseSCM))?, }) } @@ -102,6 +110,16 @@ impl TransitionStorage for TransitionDB { fn reverse_tcm_map(&self) -> &Self::ReverseTCMMap { &self.reverse_tcm_map } + + /// Returns the signer commitments. + fn scm_map(&self) -> &Self::SCMMap { + &self.scm_map + } + + /// Returns the reverse `scm` map. + fn reverse_scm_map(&self) -> &Self::ReverseSCMMap { + &self.reverse_scm_map + } } /// An database transition input storage. diff --git a/ledger/store/src/program/finalize.rs b/ledger/store/src/program/finalize.rs index 7e4d45bb99..98626be5b1 100644 --- a/ledger/store/src/program/finalize.rs +++ b/ledger/store/src/program/finalize.rs @@ -1313,7 +1313,7 @@ mod tests { // Insert the key and value. let timer = std::time::Instant::now(); - finalize_store.insert_key_value(program_id, mapping_name, key.clone(), value.clone()).unwrap(); + finalize_store.insert_key_value(program_id, mapping_name, key.clone(), value).unwrap(); println!("FinalizeStore::insert_key_value - {} μs", timer.elapsed().as_micros()); // Insert the list of keys and values. diff --git a/ledger/store/src/transition/mod.rs b/ledger/store/src/transition/mod.rs index 734cf186e4..4484c0b0d7 100644 --- a/ledger/store/src/transition/mod.rs +++ b/ledger/store/src/transition/mod.rs @@ -50,6 +50,10 @@ pub trait TransitionStorage: Clone + Send + Sync { type TCMMap: for<'a> Map<'a, N::TransitionID, Field>; /// The mapping of `transition commitment` to `transition ID`. type ReverseTCMMap: for<'a> Map<'a, Field, N::TransitionID>; + /// The signer commitments. + type SCMMap: for<'a> Map<'a, N::TransitionID, Field>; + /// The mapping of `signer commitment` to `transition ID`. + type ReverseSCMMap: for<'a> Map<'a, Field, N::TransitionID>; /// Initializes the transition storage. fn open(dev: Option) -> Result; @@ -68,6 +72,10 @@ pub trait TransitionStorage: Clone + Send + Sync { fn tcm_map(&self) -> &Self::TCMMap; /// Returns the reverse `tcm` map. fn reverse_tcm_map(&self) -> &Self::ReverseTCMMap; + /// Returns the signer commitments map. + fn scm_map(&self) -> &Self::SCMMap; + /// Returns the reverse `scm` map. + fn reverse_scm_map(&self) -> &Self::ReverseSCMMap; /// Returns the optional development ID. fn dev(&self) -> Option { @@ -84,6 +92,8 @@ pub trait TransitionStorage: Clone + Send + Sync { self.reverse_tpk_map().start_atomic(); self.tcm_map().start_atomic(); self.reverse_tcm_map().start_atomic(); + self.scm_map().start_atomic(); + self.reverse_scm_map().start_atomic(); } /// Checks if an atomic batch is in progress. @@ -95,6 +105,8 @@ pub trait TransitionStorage: Clone + Send + Sync { || self.reverse_tpk_map().is_atomic_in_progress() || self.tcm_map().is_atomic_in_progress() || self.reverse_tcm_map().is_atomic_in_progress() + || self.scm_map().is_atomic_in_progress() + || self.reverse_scm_map().is_atomic_in_progress() } /// Checkpoints the atomic batch. @@ -106,6 +118,8 @@ pub trait TransitionStorage: Clone + Send + Sync { self.reverse_tpk_map().atomic_checkpoint(); self.tcm_map().atomic_checkpoint(); self.reverse_tcm_map().atomic_checkpoint(); + self.scm_map().atomic_checkpoint(); + self.reverse_scm_map().atomic_checkpoint(); } /// Clears the latest atomic batch checkpoint. @@ -117,6 +131,8 @@ pub trait TransitionStorage: Clone + Send + Sync { self.reverse_tpk_map().clear_latest_checkpoint(); self.tcm_map().clear_latest_checkpoint(); self.reverse_tcm_map().clear_latest_checkpoint(); + self.scm_map().clear_latest_checkpoint(); + self.reverse_scm_map().clear_latest_checkpoint(); } /// Rewinds the atomic batch to the previous checkpoint. @@ -128,6 +144,8 @@ pub trait TransitionStorage: Clone + Send + Sync { self.reverse_tpk_map().atomic_rewind(); self.tcm_map().atomic_rewind(); self.reverse_tcm_map().atomic_rewind(); + self.scm_map().atomic_rewind(); + self.reverse_scm_map().atomic_rewind(); } /// Aborts an atomic batch write operation. @@ -139,6 +157,8 @@ pub trait TransitionStorage: Clone + Send + Sync { self.reverse_tpk_map().abort_atomic(); self.tcm_map().abort_atomic(); self.reverse_tcm_map().abort_atomic(); + self.scm_map().abort_atomic(); + self.reverse_scm_map().abort_atomic(); } /// Finishes an atomic batch write operation. @@ -149,7 +169,9 @@ pub trait TransitionStorage: Clone + Send + Sync { self.tpk_map().finish_atomic()?; self.reverse_tpk_map().finish_atomic()?; self.tcm_map().finish_atomic()?; - self.reverse_tcm_map().finish_atomic() + self.reverse_tcm_map().finish_atomic()?; + self.scm_map().finish_atomic()?; + self.reverse_scm_map().finish_atomic() } /// Stores the given `transition` into storage. @@ -171,6 +193,10 @@ pub trait TransitionStorage: Clone + Send + Sync { self.tcm_map().insert(transition_id, *transition.tcm())?; // Store the reverse `tcm` entry. self.reverse_tcm_map().insert(*transition.tcm(), transition_id)?; + // Store `scm`. + self.scm_map().insert(transition_id, *transition.scm())?; + // Store the reverse `scm` entry. + self.reverse_scm_map().insert(*transition.scm(), transition_id)?; Ok(()) }) @@ -188,6 +214,11 @@ pub trait TransitionStorage: Clone + Send + Sync { Some(tcm) => cow_to_copied!(tcm), None => return Ok(()), }; + // Retrieve the `scm`. + let scm = match self.scm_map().get_confirmed(transition_id)? { + Some(scm) => cow_to_copied!(scm), + None => return Ok(()), + }; atomic_batch_scope!(self, { // Remove the program ID and function name. @@ -204,6 +235,10 @@ pub trait TransitionStorage: Clone + Send + Sync { self.tcm_map().remove(transition_id)?; // Remove the reverse `tcm` entry. self.reverse_tcm_map().remove(&tcm)?; + // Remove `scm`. + self.scm_map().remove(transition_id)?; + // Remove the reverse `scm` entry. + self.reverse_scm_map().remove(&scm)?; Ok(()) }) @@ -224,9 +259,11 @@ pub trait TransitionStorage: Clone + Send + Sync { let tpk = self.tpk_map().get_confirmed(transition_id)?; // Retrieve `tcm`. let tcm = self.tcm_map().get_confirmed(transition_id)?; + // Retrieve `scm`. + let scm = self.scm_map().get_confirmed(transition_id)?; - match (tpk, tcm) { - (Some(tpk), Some(tcm)) => { + match (tpk, tcm, scm) { + (Some(tpk), Some(tcm), Some(scm)) => { // Construct the transition. let transition = Transition::new( program_id, @@ -235,6 +272,7 @@ pub trait TransitionStorage: Clone + Send + Sync { outputs, cow_to_cloned!(tpk), cow_to_cloned!(tcm), + cow_to_cloned!(scm), )?; // Ensure the transition ID matches. match transition.id() == transition_id { @@ -264,6 +302,10 @@ pub struct TransitionStore> { tcm: T::TCMMap, /// The reverse `tcm` map. reverse_tcm: T::ReverseTCMMap, + /// The map of signer commitments. + scm: T::SCMMap, + /// The reverse `scm` map. + reverse_scm: T::ReverseSCMMap, /// The transition storage. storage: T, } @@ -282,6 +324,8 @@ impl> TransitionStore { reverse_tpk: storage.reverse_tpk_map().clone(), tcm: storage.tcm_map().clone(), reverse_tcm: storage.reverse_tcm_map().clone(), + scm: storage.scm_map().clone(), + reverse_scm: storage.reverse_scm_map().clone(), storage, }) } @@ -296,6 +340,8 @@ impl> TransitionStore { reverse_tpk: storage.reverse_tpk_map().clone(), tcm: storage.tcm_map().clone(), reverse_tcm: storage.reverse_tcm_map().clone(), + scm: storage.scm_map().clone(), + reverse_scm: storage.reverse_scm_map().clone(), storage, } } @@ -475,6 +521,11 @@ impl> TransitionStore { pub fn contains_tcm(&self, tcm: &Field) -> Result { self.reverse_tcm.contains_key_confirmed(tcm) } + + /// Returns `true` if the given signer commitment exists. + pub fn contains_scm(&self, scm: &Field) -> Result { + self.reverse_scm.contains_key_confirmed(scm) + } } impl> TransitionStore { @@ -614,6 +665,11 @@ impl> TransitionStore { pub fn tcms(&self) -> impl '_ + Iterator>> { self.tcm.values_confirmed() } + + /// Returns an iterator over the signer commitments, for all transitions. + pub fn scms(&self) -> impl '_ + Iterator>> { + self.scm.values_confirmed() + } } #[cfg(test)] diff --git a/synthesizer/benches/kary_merkle_tree.rs b/synthesizer/benches/kary_merkle_tree.rs index 17e7f8eebc..8a79e27201 100644 --- a/synthesizer/benches/kary_merkle_tree.rs +++ b/synthesizer/benches/kary_merkle_tree.rs @@ -74,14 +74,12 @@ fn batch_prove(c: &mut Criterion) { CurrentAleo::reset(); // Initialize the Merkle path circuit. - let path = KaryMerklePath::, DEPTH, ARITY>::new( - Mode::Private, - merkle_path.clone(), - ); + let path = + KaryMerklePath::, DEPTH, ARITY>::new(Mode::Private, merkle_path); // Initialize the Merkle root. let root = >::Hash::new(Mode::Private, *merkle_tree.root()); // Initialize the Merkle leaf. - let leaf: Vec<_> = Inject::new(Mode::Private, merkle_leaf.clone()); + let leaf: Vec<_> = Inject::new(Mode::Private, merkle_leaf); // Verify the merkle path. let candidate = path.verify(&circuit_leaf_hasher, &circuit_path_hasher, &root, &leaf); diff --git a/synthesizer/process/src/execute.rs b/synthesizer/process/src/execute.rs index 7311f018be..46b3db0363 100644 --- a/synthesizer/process/src/execute.rs +++ b/synthesizer/process/src/execute.rs @@ -32,6 +32,10 @@ impl Process { #[cfg(feature = "aleo-cli")] println!("{}", format!(" • Executing '{locator}'...",).dimmed()); + // This is the root request and does not have a caller. + let caller = None; + // This is the root request and we do not have a root_tvk to pass on. + let root_tvk = None; // Initialize the trace. let trace = Arc::new(RwLock::new(Trace::new())); // Initialize the call stack. @@ -41,7 +45,7 @@ impl Process { // Retrieve the stack. let stack = self.get_stack(request.program_id())?; // Execute the circuit. - let response = stack.execute_function::(call_stack, None, rng)?; + let response = stack.execute_function::(call_stack, caller, root_tvk, rng)?; lap!(timer, "Execute the function"); // Extract the trace. diff --git a/synthesizer/process/src/stack/authorization/mod.rs b/synthesizer/process/src/stack/authorization/mod.rs index ec1df28e24..6a510f3814 100644 --- a/synthesizer/process/src/stack/authorization/mod.rs +++ b/synthesizer/process/src/stack/authorization/mod.rs @@ -238,6 +238,13 @@ fn ensure_request_and_transition_matches( request.tcm(), transition.tcm(), ); + // Ensure the request and transition have the same 'scm'. + ensure!( + request.scm() == transition.scm(), + "The request ({}) and transition ({}) at index {index} must have the same 'scm' in the authorization.", + request.scm(), + transition.scm(), + ); Ok(()) } diff --git a/synthesizer/process/src/stack/authorize.rs b/synthesizer/process/src/stack/authorize.rs index 5cc289c185..d3f098e163 100644 --- a/synthesizer/process/src/stack/authorize.rs +++ b/synthesizer/process/src/stack/authorize.rs @@ -34,15 +34,19 @@ impl Stack { let input_types = self.get_function(&function_name)?.input_types(); lap!(timer, "Retrieve the input types"); + // This is the root request and does not have a caller. + let caller = None; + // This is the root request and we do not have a root_tvk to pass on. + let root_tvk = None; // Compute the request. - let request = Request::sign(private_key, program_id, function_name, inputs, &input_types, rng)?; + let request = Request::sign(private_key, program_id, function_name, inputs, &input_types, root_tvk, rng)?; lap!(timer, "Compute the request"); // Initialize the authorization. let authorization = Authorization::new(request.clone()); // Construct the call stack. let call_stack = CallStack::Authorize(vec![request], *private_key, authorization.clone()); // Construct the authorization from the function. - let _response = self.execute_function::(call_stack, None, rng)?; + let _response = self.execute_function::(call_stack, caller, root_tvk, rng)?; finish!(timer, "Construct the authorization from the function"); // Return the authorization. diff --git a/synthesizer/process/src/stack/call/mod.rs b/synthesizer/process/src/stack/call/mod.rs index 5d6578ab73..de66420359 100644 --- a/synthesizer/process/src/stack/call/mod.rs +++ b/synthesizer/process/src/stack/call/mod.rs @@ -42,6 +42,7 @@ pub trait CallTrait { stack: &(impl StackEvaluate + StackExecute + StackMatches + StackProgram), registers: &mut ( impl RegistersCall + + RegistersSigner + RegistersSignerCircuit + RegistersLoadCircuit + RegistersStoreCircuit @@ -135,6 +136,7 @@ impl CallTrait for Call { stack: &(impl StackEvaluate + StackExecute + StackMatches + StackProgram), registers: &mut ( impl RegistersCall + + RegistersSigner + RegistersSignerCircuit + RegistersLoadCircuit + RegistersStoreCircuit @@ -177,6 +179,9 @@ impl CallTrait for Call { }; lap!(timer, "Retrieve the substack and resource"); + // If we are not handling the root request, retrieve the root request's tvk + let root_tvk = registers.root_tvk().ok(); + // If the operator is a closure, retrieve the closure and compute the output. let outputs = if let Ok(closure) = substack.program().get_closure(resource) { lap!(timer, "Execute the closure"); @@ -224,6 +229,7 @@ impl CallTrait for Call { *function.name(), inputs.iter(), &function.input_types(), + root_tvk, rng, )?; @@ -236,7 +242,7 @@ impl CallTrait for Call { authorization.push(request.clone()); // Execute the request. - let response = substack.execute_function::(call_stack, console_caller, rng)?; + let response = substack.execute_function::(call_stack, console_caller, root_tvk, rng)?; // Return the request and response. (request, response) @@ -249,6 +255,7 @@ impl CallTrait for Call { *function.name(), inputs.iter(), &function.input_types(), + root_tvk, rng, )?; @@ -258,7 +265,7 @@ impl CallTrait for Call { call_stack.push(request.clone())?; // Execute the request. - let response = substack.execute_function::(call_stack, console_caller, rng)?; + let response = substack.execute_function::(call_stack, console_caller, root_tvk, rng)?; // Return the request and response. (request, response) } @@ -281,7 +288,7 @@ impl CallTrait for Call { substack.evaluate_function::(registers.call_stack().replicate(), console_caller)?; // Execute the request. let response = - substack.execute_function::(registers.call_stack(), console_caller, rng)?; + substack.execute_function::(registers.call_stack(), console_caller, root_tvk, rng)?; // Ensure the values are equal. if console_response.outputs() != response.outputs() { #[cfg(debug_assertions)] diff --git a/synthesizer/process/src/stack/deploy.rs b/synthesizer/process/src/stack/deploy.rs index 39b46f2f6f..5337774781 100644 --- a/synthesizer/process/src/stack/deploy.rs +++ b/synthesizer/process/src/stack/deploy.rs @@ -76,6 +76,12 @@ impl Stack { // Construct the call stacks and assignments used to verify the certificates. let mut call_stacks = Vec::with_capacity(deployment.verifying_keys().len()); + // No root_tvk when verifying deployment of an individual circuit. + let root_tvk = None; + + // No caller when verifying deployment of an individual circuit. + let caller = None; + // Iterate through the program functions and construct the callstacks and corresponding assignments. for function in deployment.program().functions().values() { // Initialize a burner private key. @@ -106,6 +112,7 @@ impl Stack { *function.name(), inputs.into_iter(), &input_types, + root_tvk, rng, )?; lap!(timer, "Compute the request for {}", function.name()); @@ -122,7 +129,7 @@ impl Stack { cfg_iter!(call_stacks).zip_eq(deployment.verifying_keys()).zip_eq(rngs).try_for_each( |(((function_name, call_stack, assignments), (_, (verifying_key, certificate))), mut rng)| { // Synthesize the circuit. - if let Err(err) = self.execute_function::(call_stack.clone(), None, &mut rng) { + if let Err(err) = self.execute_function::(call_stack.clone(), caller, root_tvk, &mut rng) { bail!("Failed to synthesize the circuit for '{function_name}': {err}") } // Check the certificate. diff --git a/synthesizer/process/src/stack/execute.rs b/synthesizer/process/src/stack/execute.rs index 20758e5e84..52662be704 100644 --- a/synthesizer/process/src/stack/execute.rs +++ b/synthesizer/process/src/stack/execute.rs @@ -135,6 +135,7 @@ impl StackExecute for Stack { &self, mut call_stack: CallStack, console_caller: Option>, + root_tvk: Option>, rng: &mut R, ) -> Result> { let timer = timer!("Stack::execute_function"); @@ -153,6 +154,8 @@ impl StackExecute for Stack { console_request.network_id() ); + // We can only have a root_tvk if this request was called by another request + ensure!(console_caller.is_some() == root_tvk.is_some()); // Determine if this is the top-level caller. let console_is_root = console_caller.is_none(); @@ -194,6 +197,20 @@ impl StackExecute for Stack { // Initialize the registers. let mut registers = Registers::new(call_stack, self.get_register_types(function.name())?.clone()); + // Set the root tvk, from a parent request or the current request. + // inject the `root_tvk` as `Mode::Private`. + if let Some(root_tvk) = root_tvk { + registers.set_root_tvk(root_tvk); + let root_tvk_circuit = circuit::Field::::new(circuit::Mode::Private, root_tvk); + registers.set_root_tvk_circuit(root_tvk_circuit); + } else { + registers.set_root_tvk(*console_request.tvk()); + let root_tvk_circuit = circuit::Field::::new(circuit::Mode::Private, *console_request.tvk()); + registers.set_root_tvk_circuit(root_tvk_circuit); + } + + let root_tvk = Some(registers.root_tvk_circuit()?); + use circuit::{Eject, Inject}; // Inject the transition public key `tpk` as `Mode::Public`. @@ -209,7 +226,7 @@ impl StackExecute for Stack { let caller = Ternary::ternary(&is_root, request.signer(), &parent); // Ensure the request has a valid signature, inputs, and transition view key. - A::assert(request.verify(&input_types, &tpk)); + A::assert(request.verify(&input_types, &tpk, root_tvk)); lap!(timer, "Verify the circuit request"); // Set the transition signer. diff --git a/synthesizer/process/src/stack/helpers/synthesize.rs b/synthesizer/process/src/stack/helpers/synthesize.rs index c3530d0071..cca0077a62 100644 --- a/synthesizer/process/src/stack/helpers/synthesize.rs +++ b/synthesizer/process/src/stack/helpers/synthesize.rs @@ -50,15 +50,28 @@ impl Stack { }) .collect::>>()?; + // No root_tvk when deploying an individual circuit. + let root_tvk = None; + + // No caller when deploying an individual circuit. + let caller = None; + // Compute the request, with a burner private key. - let request = - Request::sign(&burner_private_key, *program_id, *function_name, inputs.into_iter(), &input_types, rng)?; + let request = Request::sign( + &burner_private_key, + *program_id, + *function_name, + inputs.into_iter(), + &input_types, + root_tvk, + rng, + )?; // Initialize the authorization. let authorization = Authorization::new(request.clone()); // Initialize the call stack. let call_stack = CallStack::Synthesize(vec![request], burner_private_key, authorization); // Synthesize the circuit. - let _response = self.execute_function::(call_stack, None, rng)?; + let _response = self.execute_function::(call_stack, caller, root_tvk, rng)?; // Ensure the proving key exists. ensure!(self.contains_proving_key(function_name), "Function '{function_name}' is missing a proving key."); diff --git a/synthesizer/process/src/stack/registers/caller.rs b/synthesizer/process/src/stack/registers/caller.rs index ddea05cdec..10d0426ff7 100644 --- a/synthesizer/process/src/stack/registers/caller.rs +++ b/synthesizer/process/src/stack/registers/caller.rs @@ -27,6 +27,18 @@ impl> RegistersSigner for Registers self.signer = Some(signer); } + /// Returns the root transition viewkey. + #[inline] + fn root_tvk(&self) -> Result> { + self.root_tvk.ok_or_else(|| anyhow!("root tvk (console) is not set in the registers.")) + } + + /// Sets the root transition viewkey. + #[inline] + fn set_root_tvk(&mut self, root_tvk: Field) { + self.root_tvk = Some(root_tvk); + } + /// Returns the transition caller. #[inline] fn caller(&self) -> Result> { @@ -65,6 +77,18 @@ impl> RegistersSignerCircuit for self.signer_circuit = Some(signer_circuit); } + /// Returns the root transition viewkey, as a circuit. + #[inline] + fn root_tvk_circuit(&self) -> Result> { + self.root_tvk_circuit.clone().ok_or_else(|| anyhow!("Root tvk (circuit) is not set in the registers.")) + } + + /// Sets the root transition viewkey, as a circuit. + #[inline] + fn set_root_tvk_circuit(&mut self, root_tvk_circuit: circuit::Field) { + self.root_tvk_circuit = Some(root_tvk_circuit); + } + /// Returns the transition caller, as a circuit. #[inline] fn caller_circuit(&self) -> Result> { diff --git a/synthesizer/process/src/stack/registers/mod.rs b/synthesizer/process/src/stack/registers/mod.rs index 3e6af26bbc..a2ba0e2388 100644 --- a/synthesizer/process/src/stack/registers/mod.rs +++ b/synthesizer/process/src/stack/registers/mod.rs @@ -51,6 +51,10 @@ pub struct Registers> { signer: Option>, /// The transition signer, as a circuit. signer_circuit: Option>, + /// The root transition viewkey. + root_tvk: Option>, + /// The root transition viewkey, as a circuit. + root_tvk_circuit: Option>, /// The transition caller. caller: Option>, /// The transition caller, as a circuit. @@ -72,6 +76,8 @@ impl> Registers { circuit_registers: IndexMap::new(), signer: None, signer_circuit: None, + root_tvk: None, + root_tvk_circuit: None, caller: None, caller_circuit: None, tvk: None, diff --git a/synthesizer/process/src/tests/test_credits.rs b/synthesizer/process/src/tests/test_credits.rs index aefae59a3c..027b8f1bfc 100644 --- a/synthesizer/process/src/tests/test_credits.rs +++ b/synthesizer/process/src/tests/test_credits.rs @@ -1520,14 +1520,18 @@ mod sanity_checks { let program_id = *program.id(); // Retrieve the input types. let input_types = program.get_function(&function_name).unwrap().input_types(); + + // Sample root_tvk. + let root_tvk = None; // Compute the request. - let request = Request::sign(private_key, program_id, function_name, inputs.iter(), &input_types, rng).unwrap(); + let request = + Request::sign(private_key, program_id, function_name, inputs.iter(), &input_types, root_tvk, rng).unwrap(); // Initialize the assignments. let assignments = Assignments::::default(); // Initialize the call stack. let call_stack = CallStack::CheckDeployment(vec![request], *private_key, assignments.clone()); // Synthesize the circuit. - let _response = stack.execute_function::(call_stack, None, rng).unwrap(); + let _response = stack.execute_function::(call_stack, None, None, rng).unwrap(); // Retrieve the assignment. let assignment = assignments.read().last().unwrap().0.clone(); assignment diff --git a/synthesizer/process/src/tests/test_execute.rs b/synthesizer/process/src/tests/test_execute.rs index 1837b54967..1d182315e3 100644 --- a/synthesizer/process/src/tests/test_execute.rs +++ b/synthesizer/process/src/tests/test_execute.rs @@ -395,7 +395,7 @@ output r4 as field.private;", // Re-run to ensure state continues to work. let trace = Arc::new(RwLock::new(Trace::new())); let call_stack = CallStack::execute(authorization, trace).unwrap(); - let response = stack.execute_function::(call_stack, None, rng).unwrap(); + let response = stack.execute_function::(call_stack, None, None, rng).unwrap(); let candidate = response.outputs(); assert_eq!(3, candidate.len()); assert_eq!(r2, candidate[0]); diff --git a/synthesizer/process/src/traits/mod.rs b/synthesizer/process/src/traits/mod.rs index c82b4ffd59..d0b6856a8f 100644 --- a/synthesizer/process/src/traits/mod.rs +++ b/synthesizer/process/src/traits/mod.rs @@ -72,6 +72,7 @@ pub trait StackExecute { &self, call_stack: CallStack, console_caller: Option>, + root_tvk: Option>, rng: &mut R, ) -> Result>; } diff --git a/synthesizer/process/src/verify_execution.rs b/synthesizer/process/src/verify_execution.rs index f4c57cf744..ca021ba710 100644 --- a/synthesizer/process/src/verify_execution.rs +++ b/synthesizer/process/src/verify_execution.rs @@ -137,6 +137,14 @@ impl Process { let num_instances = verifier_inputs.values().map(|(_, inputs)| inputs.len()).sum::(); // Ensure the number of instances matches the number of transitions. ensure!(num_instances == execution.transitions().len(), "The number of verifier instances is incorrect"); + // Ensure the same signer is used for all transitions. + if let Some(first_transition) = execution.transitions().next() { + let signer_commitment = first_transition.scm(); + ensure!( + execution.transitions().all(|t| t.scm() == signer_commitment), + "The transitions did not use the same signer" + ); + } // Construct the list of verifier inputs. let verifier_inputs: Vec<_> = verifier_inputs.values().cloned().collect(); @@ -173,7 +181,7 @@ impl Process { let (parent_x, parent_y) = parent.to_address()?.to_xy_coordinates(); // [Inputs] Construct the verifier inputs to verify the proof. - let mut inputs = vec![N::Field::one(), *tpk_x, *tpk_y, **transition.tcm()]; + let mut inputs = vec![N::Field::one(), *tpk_x, *tpk_y, **transition.tcm(), **transition.scm()]; // [Inputs] Extend the verifier inputs with the input IDs. inputs.extend(transition.inputs().iter().flat_map(|input| input.verifier_inputs())); // [Inputs] Extend the verifier inputs with the public inputs for 'self.caller'. diff --git a/synthesizer/process/src/verify_fee.rs b/synthesizer/process/src/verify_fee.rs index 5d7a9455c4..be2eed795c 100644 --- a/synthesizer/process/src/verify_fee.rs +++ b/synthesizer/process/src/verify_fee.rs @@ -120,7 +120,7 @@ impl Process { let (parent_x, parent_y) = fee.program_id().to_address()?.to_xy_coordinates(); // Construct the public inputs to verify the proof. - let mut inputs = vec![N::Field::one(), *tpk_x, *tpk_y, **fee.tcm()]; + let mut inputs = vec![N::Field::one(), *tpk_x, *tpk_y, **fee.tcm(), **fee.transition().scm()]; // Extend the inputs with the input IDs. inputs.extend(fee.inputs().iter().flat_map(|input| input.verifier_inputs())); // Extend the verifier inputs with the public inputs for 'self.caller'. @@ -190,7 +190,7 @@ impl Process { let (parent_x, parent_y) = fee.program_id().to_address()?.to_xy_coordinates(); // Construct the public inputs to verify the proof. - let mut inputs = vec![N::Field::one(), *tpk_x, *tpk_y, **fee.tcm()]; + let mut inputs = vec![N::Field::one(), *tpk_x, *tpk_y, **fee.tcm(), **fee.transition().scm()]; // Extend the inputs with the input IDs. inputs.extend(fee.inputs().iter().flat_map(|input| input.verifier_inputs())); // Extend the verifier inputs with the public inputs for 'self.caller' diff --git a/synthesizer/program/src/closure/mod.rs b/synthesizer/program/src/closure/mod.rs index aad825d1ea..0cd26c267f 100644 --- a/synthesizer/program/src/closure/mod.rs +++ b/synthesizer/program/src/closure/mod.rs @@ -188,7 +188,7 @@ mod tests { // Ensure that an instruction can be added. let instruction = Instruction::::from_str("add r0 r1 into r2;").unwrap(); - assert!(closure.add_instruction(instruction.clone()).is_ok()); + assert!(closure.add_instruction(instruction).is_ok()); // Ensure that adding more than the maximum number of instructions will fail. for i in 3..CurrentNetwork::MAX_INSTRUCTIONS * 2 { @@ -209,7 +209,7 @@ mod tests { // Ensure that an output can be added. let output = Output::::from_str("output r0 as field;").unwrap(); - assert!(closure.add_output(output.clone()).is_ok()); + assert!(closure.add_output(output).is_ok()); // Ensure that adding more than the maximum number of outputs will fail. for i in 1..CurrentNetwork::MAX_OUTPUTS * 2 { diff --git a/synthesizer/program/src/finalize/mod.rs b/synthesizer/program/src/finalize/mod.rs index 2a6f575109..b5e5ec1d17 100644 --- a/synthesizer/program/src/finalize/mod.rs +++ b/synthesizer/program/src/finalize/mod.rs @@ -202,7 +202,7 @@ mod tests { // Ensure that a command can be added. let command = Command::::from_str("add r0 r1 into r2;").unwrap(); - assert!(finalize.add_command(command.clone()).is_ok()); + assert!(finalize.add_command(command).is_ok()); // Ensure that adding more than the maximum number of commands will fail. for i in 3..CurrentNetwork::MAX_COMMANDS * 2 { diff --git a/synthesizer/program/src/function/mod.rs b/synthesizer/program/src/function/mod.rs index 9f03a3c4a9..28e5aa9cd2 100644 --- a/synthesizer/program/src/function/mod.rs +++ b/synthesizer/program/src/function/mod.rs @@ -242,7 +242,7 @@ mod tests { // Ensure that an instruction can be added. let instruction = Instruction::::from_str("add r0 r1 into r2;").unwrap(); - assert!(function.add_instruction(instruction.clone()).is_ok()); + assert!(function.add_instruction(instruction).is_ok()); // Ensure that adding more than the maximum number of instructions will fail. for i in 3..CurrentNetwork::MAX_INSTRUCTIONS * 2 { @@ -263,7 +263,7 @@ mod tests { // Ensure that an output can be added. let output = Output::::from_str("output r0 as field.private;").unwrap(); - assert!(function.add_output(output.clone()).is_ok()); + assert!(function.add_output(output).is_ok()); // Ensure that adding more than the maximum number of outputs will fail. for i in 1..CurrentNetwork::MAX_OUTPUTS * 2 { diff --git a/synthesizer/program/src/traits/stack_and_registers.rs b/synthesizer/program/src/traits/stack_and_registers.rs index 50418e894f..4cc45b6c63 100644 --- a/synthesizer/program/src/traits/stack_and_registers.rs +++ b/synthesizer/program/src/traits/stack_and_registers.rs @@ -103,6 +103,12 @@ pub trait RegistersSigner { /// Sets the transition signer. fn set_signer(&mut self, signer: Address); + /// Returns the root transition viewkey. + fn root_tvk(&self) -> Result>; + + /// Sets the root transition viewkey. + fn set_root_tvk(&mut self, root_tvk: Field); + /// Returns the transition caller. fn caller(&self) -> Result>; @@ -123,6 +129,12 @@ pub trait RegistersSignerCircuit> { /// Sets the transition signer, as a circuit. fn set_signer_circuit(&mut self, signer_circuit: circuit::Address); + /// Returns the root transition viewkey, as a circuit. + fn root_tvk_circuit(&self) -> Result>; + + /// Sets the root transition viewkey, as a circuit. + fn set_root_tvk_circuit(&mut self, root_tvk_circuit: circuit::Field); + /// Returns the transition caller, as a circuit. fn caller_circuit(&self) -> Result>; diff --git a/synthesizer/src/vm/execute.rs b/synthesizer/src/vm/execute.rs index 31a2111188..7d9231ade8 100644 --- a/synthesizer/src/vm/execute.rs +++ b/synthesizer/src/vm/execute.rs @@ -271,13 +271,13 @@ mod tests { // Assert the size of the transaction. let transaction_size_in_bytes = transaction.to_bytes_le().unwrap().len(); - assert_eq!(3629, transaction_size_in_bytes, "Update me if serialization has changed"); + assert_eq!(3693, transaction_size_in_bytes, "Update me if serialization has changed"); // Assert the size of the execution. assert!(matches!(transaction, Transaction::Execute(_, _, _))); if let Transaction::Execute(_, execution, _) = &transaction { let execution_size_in_bytes = execution.to_bytes_le().unwrap().len(); - assert_eq!(2210, execution_size_in_bytes, "Update me if serialization has changed"); + assert_eq!(2242, execution_size_in_bytes, "Update me if serialization has changed"); } } @@ -305,13 +305,13 @@ mod tests { // Assert the size of the transaction. let transaction_size_in_bytes = transaction.to_bytes_le().unwrap().len(); - assert_eq!(2807, transaction_size_in_bytes, "Update me if serialization has changed"); + assert_eq!(2871, transaction_size_in_bytes, "Update me if serialization has changed"); // Assert the size of the execution. assert!(matches!(transaction, Transaction::Execute(_, _, _))); if let Transaction::Execute(_, execution, _) = &transaction { let execution_size_in_bytes = execution.to_bytes_le().unwrap().len(); - assert_eq!(1388, execution_size_in_bytes, "Update me if serialization has changed"); + assert_eq!(1420, execution_size_in_bytes, "Update me if serialization has changed"); } } @@ -340,13 +340,13 @@ mod tests { // Assert the size of the transaction. let transaction_size_in_bytes = transaction.to_bytes_le().unwrap().len(); - assert_eq!(3474, transaction_size_in_bytes, "Update me if serialization has changed"); + assert_eq!(3538, transaction_size_in_bytes, "Update me if serialization has changed"); // Assert the size of the execution. assert!(matches!(transaction, Transaction::Execute(_, _, _))); if let Transaction::Execute(_, execution, _) = &transaction { let execution_size_in_bytes = execution.to_bytes_le().unwrap().len(); - assert_eq!(2055, execution_size_in_bytes, "Update me if serialization has changed"); + assert_eq!(2087, execution_size_in_bytes, "Update me if serialization has changed"); } } @@ -374,13 +374,13 @@ mod tests { // Assert the size of the transaction. let transaction_size_in_bytes = transaction.to_bytes_le().unwrap().len(); - assert_eq!(2134, transaction_size_in_bytes, "Update me if serialization has changed"); + assert_eq!(2166, transaction_size_in_bytes, "Update me if serialization has changed"); // Assert the size of the execution. assert!(matches!(transaction, Transaction::Execute(_, _, _))); if let Transaction::Execute(_, execution, _) = &transaction { let execution_size_in_bytes = execution.to_bytes_le().unwrap().len(); - assert_eq!(2099, execution_size_in_bytes, "Update me if serialization has changed"); + assert_eq!(2131, execution_size_in_bytes, "Update me if serialization has changed"); } } @@ -397,7 +397,7 @@ mod tests { }; // Assert the size of the transition. let fee_size_in_bytes = fee.to_bytes_le().unwrap().len(); - assert_eq!(2011, fee_size_in_bytes, "Update me if serialization has changed"); + assert_eq!(2043, fee_size_in_bytes, "Update me if serialization has changed"); } #[test] @@ -413,6 +413,6 @@ mod tests { }; // Assert the size of the transition. let fee_size_in_bytes = fee.to_bytes_le().unwrap().len(); - assert_eq!(1384, fee_size_in_bytes, "Update me if serialization has changed"); + assert_eq!(1416, fee_size_in_bytes, "Update me if serialization has changed"); } } diff --git a/vm/package/run.rs b/vm/package/run.rs index 54b1520ead..59ace04ac4 100644 --- a/vm/package/run.rs +++ b/vm/package/run.rs @@ -53,7 +53,7 @@ impl Package { // Initialize the call stack. let call_stack = CallStack::PackageRun(vec![request], *private_key, assignments.clone()); // Synthesize the circuit. - let response = stack.execute_function::(call_stack, None, rng)?; + let response = stack.execute_function::(call_stack, None, None, rng)?; // Retrieve the call metrics. let call_metrics = assignments.read().iter().map(|(_, metrics)| *metrics).collect::>(); // Return the response and call metrics. From b5d6d082ee047489d8ae38e1ad65155abcafa5b5 Mon Sep 17 00:00:00 2001 From: Victor Sint Nicolaas Date: Fri, 5 Jan 2024 12:49:20 +0100 Subject: [PATCH 080/298] Increase test counts: - request::verify::tests::test_sign_and_verify_* - tests::test_credits::sanity_checks::test_sanity_check_* --- circuit/program/src/request/verify.rs | 6 ++-- synthesizer/process/src/tests/test_credits.rs | 32 +++++++++---------- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/circuit/program/src/request/verify.rs b/circuit/program/src/request/verify.rs index 41a2560cdb..86578f0741 100644 --- a/circuit/program/src/request/verify.rs +++ b/circuit/program/src/request/verify.rs @@ -416,16 +416,16 @@ mod tests { // Note: This is correct. At this (high) level of a program, we override the default mode in the `Record` case, // based on the user-defined visibility in the record type. Thus, we have nonzero private and constraint values. // These bounds are determined experimentally. - check_verify(Mode::Constant, 42520, 0, 17494, 17518) + check_verify(Mode::Constant, 42518, 0, 17763, 17786) } #[test] fn test_sign_and_verify_public() -> Result<()> { - check_verify(Mode::Public, 40018, 0, 26401, 26429) + check_verify(Mode::Public, 40019, 0, 26675, 26702) } #[test] fn test_sign_and_verify_private() -> Result<()> { - check_verify(Mode::Private, 40018, 0, 26401, 26429) + check_verify(Mode::Private, 40019, 0, 26675, 26702) } } diff --git a/synthesizer/process/src/tests/test_credits.rs b/synthesizer/process/src/tests/test_credits.rs index 027b8f1bfc..061f916867 100644 --- a/synthesizer/process/src/tests/test_credits.rs +++ b/synthesizer/process/src/tests/test_credits.rs @@ -1564,10 +1564,10 @@ mod sanity_checks { // Compute the assignment. let assignment = get_assignment::<_, CurrentAleo>(stack, &private_key, function_name, &[r0, r1, r2], rng); - assert_eq!(15, assignment.num_public()); - assert_eq!(50681, assignment.num_private()); - assert_eq!(50729, assignment.num_constraints()); - assert_eq!((98547, 109769, 77341), assignment.num_nonzeros()); + assert_eq!(16, assignment.num_public()); + assert_eq!(50956, assignment.num_private()); + assert_eq!(51002, assignment.num_constraints()); + assert_eq!((99539, 111470, 77613), assignment.num_nonzeros()); } #[test] @@ -1592,10 +1592,10 @@ mod sanity_checks { // Compute the assignment. let assignment = get_assignment::<_, CurrentAleo>(stack, &private_key, function_name, &[r0, r1], rng); - assert_eq!(10, assignment.num_public()); - assert_eq!(12043, assignment.num_private()); - assert_eq!(12052, assignment.num_constraints()); - assert_eq!((27250, 36303, 16407), assignment.num_nonzeros()); + assert_eq!(11, assignment.num_public()); + assert_eq!(12318, assignment.num_private()); + assert_eq!(12325, assignment.num_constraints()); + assert_eq!((28242, 38004, 16679), assignment.num_nonzeros()); } #[test] @@ -1626,10 +1626,10 @@ mod sanity_checks { // Compute the assignment. let assignment = get_assignment::<_, CurrentAleo>(stack, &private_key, function_name, &[r0, r1, r2, r3], rng); - assert_eq!(14, assignment.num_public()); - assert_eq!(37840, assignment.num_private()); - assert_eq!(37878, assignment.num_constraints()); - assert_eq!((72163, 80588, 56623), assignment.num_nonzeros()); + assert_eq!(15, assignment.num_public()); + assert_eq!(38115, assignment.num_private()); + assert_eq!(38151, assignment.num_constraints()); + assert_eq!((73155, 82289, 56895), assignment.num_nonzeros()); } #[test] @@ -1654,9 +1654,9 @@ mod sanity_checks { // Compute the assignment. let assignment = get_assignment::<_, CurrentAleo>(stack, &private_key, function_name, &[r0, r1, r2], rng); - assert_eq!(11, assignment.num_public()); - assert_eq!(12645, assignment.num_private()); - assert_eq!(12657, assignment.num_constraints()); - assert_eq!((29594, 39585, 16941), assignment.num_nonzeros()); + assert_eq!(12, assignment.num_public()); + assert_eq!(12920, assignment.num_private()); + assert_eq!(12930, assignment.num_constraints()); + assert_eq!((30586, 41286, 17213), assignment.num_nonzeros()); } } From 29d25885556c622593a94f0d84177f45ae876397 Mon Sep 17 00:00:00 2001 From: bishopcheckmate Date: Fri, 5 Jan 2024 15:22:22 +0100 Subject: [PATCH 081/298] perf: add method to compute both affine points from x coord --- console/types/group/src/from_x_coordinate.rs | 14 +++++--------- .../templates/short_weierstrass_jacobian/affine.rs | 11 +++++++++++ .../templates/twisted_edwards_extended/affine.rs | 12 ++++++++++++ curves/src/traits/group.rs | 9 +++++++++ 4 files changed, 37 insertions(+), 9 deletions(-) diff --git a/console/types/group/src/from_x_coordinate.rs b/console/types/group/src/from_x_coordinate.rs index e05786c663..f8be208f71 100644 --- a/console/types/group/src/from_x_coordinate.rs +++ b/console/types/group/src/from_x_coordinate.rs @@ -18,15 +18,11 @@ impl Group { /// Attempts to recover an affine group element from a given x-coordinate field element. /// For safety, the resulting point is always enforced to be on the curve and in the correct subgroup. pub fn from_x_coordinate(x_coordinate: Field) -> Result { - if let Some(p1) = E::Affine::from_x_coordinate(*x_coordinate, true) { - if p1.is_in_correct_subgroup_assuming_on_curve() { - return Ok(Self::new(p1)); - } - // We can unwrap when checking the lexicgraphically smallest - // point as it's not a factor for the fallability of computation. - let p2 = E::Affine::from_x_coordinate(*x_coordinate, false).unwrap(); - if p2.is_in_correct_subgroup_assuming_on_curve() { - return Ok(Self::new(p2)); + if let Some((p1, p2)) = E::Affine::pair_from_x_coordinate(*x_coordinate) { + for point in [p2, p1] { + if point.is_in_correct_subgroup_assuming_on_curve() { + return Ok(Self::new(point)); + } } } bail!("Failed to recover an affine group from an x-coordinate of {x_coordinate}") diff --git a/curves/src/templates/short_weierstrass_jacobian/affine.rs b/curves/src/templates/short_weierstrass_jacobian/affine.rs index 49799cb7ea..d07a53a024 100644 --- a/curves/src/templates/short_weierstrass_jacobian/affine.rs +++ b/curves/src/templates/short_weierstrass_jacobian/affine.rs @@ -148,6 +148,17 @@ impl AffineCurve for Affine

{ }) } + /// Attempts to construct both possible affine points given an x-coordinate. + /// Points are not guaranteed to be in the prime order subgroup. + /// + /// The affine points returned should be in lexicographically growing order. + /// + /// Calling this should be equivalent (but likely more performant) to + /// `(AffineCurve::from_x_coordinate(x, false), AffineCurve::from_x_coordinate(x, true))`. + fn pair_from_x_coordinate(x: Self::BaseField) -> Option<(Self, Self)> { + Self::from_x_coordinate(x, false).map(|p1| (p1, Self::new(p1.x, -p1.y, false))) + } + /// Attempts to construct an affine point given a y-coordinate. The /// point is not guaranteed to be in the prime order subgroup. /// diff --git a/curves/src/templates/twisted_edwards_extended/affine.rs b/curves/src/templates/twisted_edwards_extended/affine.rs index 1be2c48122..dc8cf8d41f 100644 --- a/curves/src/templates/twisted_edwards_extended/affine.rs +++ b/curves/src/templates/twisted_edwards_extended/affine.rs @@ -148,6 +148,18 @@ impl AffineCurve for Affine

{ }) } + /// Attempts to construct both possible affine points given an x-coordinate. + /// Points are not guaranteed to be in the prime order subgroup. + /// + /// The affine points returned should be in lexicographically growing order. + /// + /// Calling this should be equivalent (but likely more performant) to + /// `(AffineCurve::from_x_coordinate(x, false), AffineCurve::from_x_coordinate(x, true))`. + #[inline] + fn pair_from_x_coordinate(x: Self::BaseField) -> Option<(Self, Self)> { + Self::from_x_coordinate(x, false).map(|p1| (p1, Self::new(p1.x, -p1.y, -p1.t))) + } + /// Attempts to construct an affine point given a y-coordinate. The /// point is not guaranteed to be in the prime order subgroup. /// diff --git a/curves/src/traits/group.rs b/curves/src/traits/group.rs index a913134f6b..47f8bdcc69 100644 --- a/curves/src/traits/group.rs +++ b/curves/src/traits/group.rs @@ -164,6 +164,15 @@ pub trait AffineCurve: /// largest y-coordinate be selected. fn from_x_coordinate(x: Self::BaseField, greatest: bool) -> Option; + /// Attempts to construct both possible affine points given an x-coordinate. + /// Points are not guaranteed to be in the prime order subgroup. + /// + /// The affine points returned should be in lexicographically growing order. + /// + /// Calling this should be equivalent (but likely more performant) to + /// `(AffineCurve::from_x_coordinate(x, false), AffineCurve::from_x_coordinate(x, true))`. + fn pair_from_x_coordinate(x: Self::BaseField) -> Option<(Self, Self)>; + /// Attempts to construct an affine point given a y-coordinate. The /// point is not guaranteed to be in the prime order subgroup. /// From 47c24c3ef84017d1a6581f845368c9f76e8454bf Mon Sep 17 00:00:00 2001 From: Victor Sint Nicolaas Date: Fri, 5 Jan 2024 15:30:26 +0100 Subject: [PATCH 082/298] Update test_vm_execute_and_finalize expectations: fees increased --- .../vm/execute_and_finalize/arrays_in_finalize.out | 2 +- .../vm/execute_and_finalize/child_and_parent.out | 4 ++-- .../vm/execute_and_finalize/complex_finalization.out | 2 +- .../vm/execute_and_finalize/count_usages.out | 2 +- .../expectations/vm/execute_and_finalize/hello.out | 8 ++++---- .../vm/execute_and_finalize/mapping_operations.out | 8 ++++---- .../vm/execute_and_finalize/mint_and_split.out | 2 +- .../vm/execute_and_finalize/program_callable.out | 2 +- .../vm/execute_and_finalize/public_wallet.out | 2 +- .../execute_and_finalize/read_external_mapping.out | 12 ++++++------ .../vm/execute_and_finalize/test_branch.out | 6 +++--- .../vm/execute_and_finalize/test_rand.out | 10 +++++----- .../vm/execute_and_finalize/timelock.out | 4 ++-- .../vm/execute_and_finalize/unused_position.out | 2 +- .../vm/execute_and_finalize/user_callable.out | 2 +- 15 files changed, 34 insertions(+), 34 deletions(-) diff --git a/synthesizer/tests/expectations/vm/execute_and_finalize/arrays_in_finalize.out b/synthesizer/tests/expectations/vm/execute_and_finalize/arrays_in_finalize.out index 2f99747752..992cd2be75 100644 --- a/synthesizer/tests/expectations/vm/execute_and_finalize/arrays_in_finalize.out +++ b/synthesizer/tests/expectations/vm/execute_and_finalize/arrays_in_finalize.out @@ -15,4 +15,4 @@ additional: - child_outputs: credits.aleo/fee_public: outputs: - - '{"type":"future","id":"611935698929626281656171069026748974326705967123466685855354594539166326131field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1y9t0y4lvhm43qdzlfjmfzh8985vfnx9ms368p07x5lsemet5ey8qt0ssjn,\n 21758u64\n ]\n}"}' + - '{"type":"future","id":"4458696660544920217455172977826863411858383631019975598279383086574098978687field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1y9t0y4lvhm43qdzlfjmfzh8985vfnx9ms368p07x5lsemet5ey8qt0ssjn,\n 21790u64\n ]\n}"}' diff --git a/synthesizer/tests/expectations/vm/execute_and_finalize/child_and_parent.out b/synthesizer/tests/expectations/vm/execute_and_finalize/child_and_parent.out index cf83c9d485..9dfeaf4031 100644 --- a/synthesizer/tests/expectations/vm/execute_and_finalize/child_and_parent.out +++ b/synthesizer/tests/expectations/vm/execute_and_finalize/child_and_parent.out @@ -22,7 +22,7 @@ additional: - child_outputs: credits.aleo/fee_public: outputs: - - '{"type":"future","id":"5245767978479482276373144091068362056657622227760198296183689243703275814117field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1qr2ha4pfs5l28aze88yn6fhleeythklkczrule2v838uwj65n5gqxt9djx,\n 1244u64\n ]\n}"}' + - '{"type":"future","id":"83041879108137922886601212431409060421400113751592313519100907875082819233field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1qr2ha4pfs5l28aze88yn6fhleeythklkczrule2v838uwj65n5gqxt9djx,\n 1276u64\n ]\n}"}' - child_outputs: child.aleo/foo: outputs: @@ -30,4 +30,4 @@ additional: - '{"type":"public","id":"4227271453559074580761782898043117548320729393319599555165417123780466734088field","value":"aleo1qr2ha4pfs5l28aze88yn6fhleeythklkczrule2v838uwj65n5gqxt9djx"}' credits.aleo/fee_public: outputs: - - '{"type":"future","id":"8216972065644000579816790328783540313220942313753411501386970051803831099199field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1qr2ha4pfs5l28aze88yn6fhleeythklkczrule2v838uwj65n5gqxt9djx,\n 2123u64\n ]\n}"}' + - '{"type":"future","id":"412441666409011288113655662630340813437595399242942920189489802166356135field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1qr2ha4pfs5l28aze88yn6fhleeythklkczrule2v838uwj65n5gqxt9djx,\n 2187u64\n ]\n}"}' diff --git a/synthesizer/tests/expectations/vm/execute_and_finalize/complex_finalization.out b/synthesizer/tests/expectations/vm/execute_and_finalize/complex_finalization.out index d413523f61..52c907414d 100644 --- a/synthesizer/tests/expectations/vm/execute_and_finalize/complex_finalization.out +++ b/synthesizer/tests/expectations/vm/execute_and_finalize/complex_finalization.out @@ -23,4 +23,4 @@ additional: - '{"type":"future","id":"6324349534667114127832388996854882573236888808429320919855235417654165379333field","value":"{\n program_id: three_program.aleo,\n function_name: e,\n arguments: [\n {\n program_id: two_program.aleo,\n function_name: b,\n arguments: [\n {\n program_id: zero_program.aleo,\n function_name: c,\n arguments: [\n aleo1kw4knandael9qcpxs6g36rr6h7dwvjz6q25ueah6zz9v57zjlvxsx5llq8\n ]\n },\n {\n program_id: one_program.aleo,\n function_name: d,\n arguments: [\n aleo1kw4knandael9qcpxs6g36rr6h7dwvjz6q25ueah6zz9v57zjlvxsx5llq8\n ]\n },\n aleo1kw4knandael9qcpxs6g36rr6h7dwvjz6q25ueah6zz9v57zjlvxsx5llq8\n ]\n },\n {\n program_id: one_program.aleo,\n function_name: d,\n arguments: [\n aleo1kw4knandael9qcpxs6g36rr6h7dwvjz6q25ueah6zz9v57zjlvxsx5llq8\n ]\n },\n {\n program_id: zero_program.aleo,\n function_name: c,\n arguments: [\n aleo1kw4knandael9qcpxs6g36rr6h7dwvjz6q25ueah6zz9v57zjlvxsx5llq8\n ]\n },\n aleo1kw4knandael9qcpxs6g36rr6h7dwvjz6q25ueah6zz9v57zjlvxsx5llq8\n ]\n}"}' credits.aleo/fee_public: outputs: - - '{"type":"future","id":"2642525527921148655203140665689909230400981948693155278410222306693462629362field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1kw4knandael9qcpxs6g36rr6h7dwvjz6q25ueah6zz9v57zjlvxsx5llq8,\n 1312883u64\n ]\n}"}' + - '{"type":"future","id":"2066942916258922049456901530186878621080263344694093988722783268970464499529field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1kw4knandael9qcpxs6g36rr6h7dwvjz6q25ueah6zz9v57zjlvxsx5llq8,\n 1313203u64\n ]\n}"}' diff --git a/synthesizer/tests/expectations/vm/execute_and_finalize/count_usages.out b/synthesizer/tests/expectations/vm/execute_and_finalize/count_usages.out index bc0c5af71d..03dc8ba25b 100644 --- a/synthesizer/tests/expectations/vm/execute_and_finalize/count_usages.out +++ b/synthesizer/tests/expectations/vm/execute_and_finalize/count_usages.out @@ -20,4 +20,4 @@ additional: - '{"type":"future","id":"4663027849889985446453275863200868545411574358675486387787337708909316167962field","value":"{\n program_id: basic_math.aleo,\n function_name: sub_and_count,\n arguments: [\n aleo1mrughg5ssadd9fc2uwve7l6u24xn76kyz24zsjtzta03vgkq4vpqggl6fg\n ]\n}"}' credits.aleo/fee_public: outputs: - - '{"type":"future","id":"3084534457419184182612834880575828543753579447019853593724174249884664876235field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1kw4knandael9qcpxs6g36rr6h7dwvjz6q25ueah6zz9v57zjlvxsx5llq8,\n 263392u64\n ]\n}"}' + - '{"type":"future","id":"7720789680844212679913578604282906951547243007999834835177670183113270850570field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1kw4knandael9qcpxs6g36rr6h7dwvjz6q25ueah6zz9v57zjlvxsx5llq8,\n 263488u64\n ]\n}"}' diff --git a/synthesizer/tests/expectations/vm/execute_and_finalize/hello.out b/synthesizer/tests/expectations/vm/execute_and_finalize/hello.out index 4ee4b5c467..a53a0f4e34 100644 --- a/synthesizer/tests/expectations/vm/execute_and_finalize/hello.out +++ b/synthesizer/tests/expectations/vm/execute_and_finalize/hello.out @@ -34,16 +34,16 @@ additional: - child_outputs: credits.aleo/fee_public: outputs: - - '{"type":"future","id":"5633762070565015506869877991983247311752566772551740661334199093127666173285field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo10knkelvnd55fsaarm25wch7p9suf2tqlgwy5k4nxwms6d262xyfqm2tccr,\n 1285u64\n ]\n}"}' + - '{"type":"future","id":"4692895488784721028031784954317701794229331017594979328293647738378642872266field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo10knkelvnd55fsaarm25wch7p9suf2tqlgwy5k4nxwms6d262xyfqm2tccr,\n 1317u64\n ]\n}"}' - child_outputs: credits.aleo/fee_public: outputs: - - '{"type":"future","id":"4168535226825329132770722118865464284070271653060849404506023921600553004505field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo10knkelvnd55fsaarm25wch7p9suf2tqlgwy5k4nxwms6d262xyfqm2tccr,\n 1285u64\n ]\n}"}' + - '{"type":"future","id":"6079487736131462252229102287249428958134826826751534566845592252395373778361field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo10knkelvnd55fsaarm25wch7p9suf2tqlgwy5k4nxwms6d262xyfqm2tccr,\n 1317u64\n ]\n}"}' - child_outputs: credits.aleo/fee_public: outputs: - - '{"type":"future","id":"7264507997475302694771209211625280132862970630053323876707987175500028146955field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo10knkelvnd55fsaarm25wch7p9suf2tqlgwy5k4nxwms6d262xyfqm2tccr,\n 5334u64\n ]\n}"}' + - '{"type":"future","id":"7191933655204754384586628177292876847657449469389574287782617948871977377363field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo10knkelvnd55fsaarm25wch7p9suf2tqlgwy5k4nxwms6d262xyfqm2tccr,\n 5366u64\n ]\n}"}' - child_outputs: credits.aleo/fee_public: outputs: - - '{"type":"future","id":"2296589459402270097535149680764663519350069575816165257148428557434644368237field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo10knkelvnd55fsaarm25wch7p9suf2tqlgwy5k4nxwms6d262xyfqm2tccr,\n 5334u64\n ]\n}"}' + - '{"type":"future","id":"145354066709739728561542701925305528364716740312575558473803110554800888551field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo10knkelvnd55fsaarm25wch7p9suf2tqlgwy5k4nxwms6d262xyfqm2tccr,\n 5366u64\n ]\n}"}' diff --git a/synthesizer/tests/expectations/vm/execute_and_finalize/mapping_operations.out b/synthesizer/tests/expectations/vm/execute_and_finalize/mapping_operations.out index 6b2773e6cf..fa087b794e 100644 --- a/synthesizer/tests/expectations/vm/execute_and_finalize/mapping_operations.out +++ b/synthesizer/tests/expectations/vm/execute_and_finalize/mapping_operations.out @@ -32,16 +32,16 @@ additional: - child_outputs: credits.aleo/fee_public: outputs: - - '{"type":"future","id":"3701652920213282423281084685169254121653756184853703028504071363673532942725field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1eakarna6a70pg9r0l9qal20faejwctgur5xt7lnc2a42wj2yssfqc89rk8,\n 11245u64\n ]\n}"}' + - '{"type":"future","id":"7997714737558041108597332913213683668659452996602813916278331309977371838659field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1eakarna6a70pg9r0l9qal20faejwctgur5xt7lnc2a42wj2yssfqc89rk8,\n 11277u64\n ]\n}"}' - child_outputs: credits.aleo/fee_public: outputs: - - '{"type":"future","id":"767852843394263062723803642109980847781175859546892255347263461730875281315field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1eakarna6a70pg9r0l9qal20faejwctgur5xt7lnc2a42wj2yssfqc89rk8,\n 154810u64\n ]\n}"}' + - '{"type":"future","id":"4497408677502717251593746930823420290236599001147227462821650001426482114032field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1eakarna6a70pg9r0l9qal20faejwctgur5xt7lnc2a42wj2yssfqc89rk8,\n 154842u64\n ]\n}"}' - child_outputs: credits.aleo/fee_public: outputs: - - '{"type":"future","id":"5831877738131393412656336446760308055442933218729238434398743654782252530700field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1eakarna6a70pg9r0l9qal20faejwctgur5xt7lnc2a42wj2yssfqc89rk8,\n 154810u64\n ]\n}"}' + - '{"type":"future","id":"3077536931982894200930631327710347215516883669516660582918377539259401272748field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1eakarna6a70pg9r0l9qal20faejwctgur5xt7lnc2a42wj2yssfqc89rk8,\n 154842u64\n ]\n}"}' - child_outputs: credits.aleo/fee_public: outputs: - - '{"type":"future","id":"3924911723698610328779426182874581891939297874519691347932588542992608923909field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1eakarna6a70pg9r0l9qal20faejwctgur5xt7lnc2a42wj2yssfqc89rk8,\n 154810u64\n ]\n}"}' + - '{"type":"future","id":"4333666472885519611201433821723549353236105964020348709669046438368123454126field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1eakarna6a70pg9r0l9qal20faejwctgur5xt7lnc2a42wj2yssfqc89rk8,\n 154842u64\n ]\n}"}' diff --git a/synthesizer/tests/expectations/vm/execute_and_finalize/mint_and_split.out b/synthesizer/tests/expectations/vm/execute_and_finalize/mint_and_split.out index bd63f8cfca..1f71a42435 100644 --- a/synthesizer/tests/expectations/vm/execute_and_finalize/mint_and_split.out +++ b/synthesizer/tests/expectations/vm/execute_and_finalize/mint_and_split.out @@ -13,6 +13,6 @@ additional: - child_outputs: credits.aleo/fee_public: outputs: - - '{"type":"future","id":"2224596965693604846363254284152512550549945382876106932610187515185636813504field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo19e6k5ferx3k8a9k79xtj4uuaztt2jl4eza7k43pygsu977yazypqqwdmw6,\n 1414u64\n ]\n}"}' + - '{"type":"future","id":"1702549659069617433522869632025887956486922883906248501573564785757420410307field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo19e6k5ferx3k8a9k79xtj4uuaztt2jl4eza7k43pygsu977yazypqqwdmw6,\n 1446u64\n ]\n}"}' - {} - {} diff --git a/synthesizer/tests/expectations/vm/execute_and_finalize/program_callable.out b/synthesizer/tests/expectations/vm/execute_and_finalize/program_callable.out index 8bb0637e68..6caaea145d 100644 --- a/synthesizer/tests/expectations/vm/execute_and_finalize/program_callable.out +++ b/synthesizer/tests/expectations/vm/execute_and_finalize/program_callable.out @@ -20,4 +20,4 @@ additional: - '{"type":"public","id":"7032360703707892728582573080419248600535906704593225990910797295396231122684field","value":"aleo1qr2ha4pfs5l28aze88yn6fhleeythklkczrule2v838uwj65n5gqxt9djx"}' credits.aleo/fee_public: outputs: - - '{"type":"future","id":"3173434315503739455207432985984041544966817001490874630397863189982314711932field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1qr2ha4pfs5l28aze88yn6fhleeythklkczrule2v838uwj65n5gqxt9djx,\n 2123u64\n ]\n}"}' + - '{"type":"future","id":"2383370824998449805302152387505758882335121087392440654704611104597959078609field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1qr2ha4pfs5l28aze88yn6fhleeythklkczrule2v838uwj65n5gqxt9djx,\n 2187u64\n ]\n}"}' diff --git a/synthesizer/tests/expectations/vm/execute_and_finalize/public_wallet.out b/synthesizer/tests/expectations/vm/execute_and_finalize/public_wallet.out index cbb7f2d77c..1e9594b343 100644 --- a/synthesizer/tests/expectations/vm/execute_and_finalize/public_wallet.out +++ b/synthesizer/tests/expectations/vm/execute_and_finalize/public_wallet.out @@ -14,4 +14,4 @@ additional: - '{"type":"future","id":"2095235103073153862497986952383880687050623273703041876358116424903602929020field","value":"{\n program_id: token.aleo,\n function_name: mint_public,\n arguments: [\n aleo1sry3pke49ykrf0aeshf889tr98r4c86p5f4ms766795ssdwfdyqq9jdg0j,\n 10u64\n ]\n}"}' credits.aleo/fee_public: outputs: - - '{"type":"future","id":"4373249435479943424484888940718424132561120812144078253060284512525421799293field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1d3e2je2m2hsxwdsvntvf4jnnlj459ywfry6ch2qwrpy6l6r6yvpq8e88h5,\n 131201u64\n ]\n}"}' + - '{"type":"future","id":"3915217986926257864389601618212435120703604627473164299376404290548778752774field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1d3e2je2m2hsxwdsvntvf4jnnlj459ywfry6ch2qwrpy6l6r6yvpq8e88h5,\n 131265u64\n ]\n}"}' diff --git a/synthesizer/tests/expectations/vm/execute_and_finalize/read_external_mapping.out b/synthesizer/tests/expectations/vm/execute_and_finalize/read_external_mapping.out index a729b3163e..0b297db555 100644 --- a/synthesizer/tests/expectations/vm/execute_and_finalize/read_external_mapping.out +++ b/synthesizer/tests/expectations/vm/execute_and_finalize/read_external_mapping.out @@ -50,24 +50,24 @@ additional: - child_outputs: credits.aleo/fee_public: outputs: - - '{"type":"future","id":"2373837014611692049497129045871775574464197133932453792739782919776486496194field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1xe2fps8f9xpdas2q0fqy22uraenk84tvvzetrsyxgnwy6445h59s6wv78x,\n 28479u64\n ]\n}"}' + - '{"type":"future","id":"7080417129626648212193377319902606549225718400616394510138023000342421908505field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1xe2fps8f9xpdas2q0fqy22uraenk84tvvzetrsyxgnwy6445h59s6wv78x,\n 28511u64\n ]\n}"}' - child_outputs: credits.aleo/fee_public: outputs: - - '{"type":"future","id":"6963949699870804211203514659901328830518734684604845622658837353595728006898field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1xe2fps8f9xpdas2q0fqy22uraenk84tvvzetrsyxgnwy6445h59s6wv78x,\n 28507u64\n ]\n}"}' + - '{"type":"future","id":"7826117214975966255234906673590211348830390725401995752220767337117274721366field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1xe2fps8f9xpdas2q0fqy22uraenk84tvvzetrsyxgnwy6445h59s6wv78x,\n 28539u64\n ]\n}"}' - child_outputs: credits.aleo/fee_public: outputs: - - '{"type":"future","id":"786151097471386478439918490898626420968604200995134718973623517242949574field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1f6eg623knp66cwx0926w3plgdgzcmfpgyrzgnjz90mucgs3z7s9qls4upm,\n 101210u64\n ]\n}"}' + - '{"type":"future","id":"4529680667655060903934067898053606126783180409263310166888491099852859520609field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1f6eg623knp66cwx0926w3plgdgzcmfpgyrzgnjz90mucgs3z7s9qls4upm,\n 101242u64\n ]\n}"}' - child_outputs: credits.aleo/fee_public: outputs: - - '{"type":"future","id":"7962216909726487379370954492051267200961073450060603523391007597642835489177field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1xe2fps8f9xpdas2q0fqy22uraenk84tvvzetrsyxgnwy6445h59s6wv78x,\n 28479u64\n ]\n}"}' + - '{"type":"future","id":"1078761966858823730327078573769851393115281594137951537091165360512978623911field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1xe2fps8f9xpdas2q0fqy22uraenk84tvvzetrsyxgnwy6445h59s6wv78x,\n 28511u64\n ]\n}"}' - child_outputs: credits.aleo/fee_public: outputs: - - '{"type":"future","id":"5340444358291789813118792762028331134214990505407681376089964565359528622453field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1f6eg623knp66cwx0926w3plgdgzcmfpgyrzgnjz90mucgs3z7s9qls4upm,\n 101214u64\n ]\n}"}' + - '{"type":"future","id":"7426585345682455564332095217719152237395114665299216025402144613591007627838field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1f6eg623knp66cwx0926w3plgdgzcmfpgyrzgnjz90mucgs3z7s9qls4upm,\n 101246u64\n ]\n}"}' - child_outputs: credits.aleo/fee_public: outputs: - - '{"type":"future","id":"7708776674386621879381619680665250794376507748822342974632850445134733330595field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1xe2fps8f9xpdas2q0fqy22uraenk84tvvzetrsyxgnwy6445h59s6wv78x,\n 28479u64\n ]\n}"}' + - '{"type":"future","id":"3132498498780886337545137302428520879471962008980039066433358424441428968764field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1xe2fps8f9xpdas2q0fqy22uraenk84tvvzetrsyxgnwy6445h59s6wv78x,\n 28511u64\n ]\n}"}' diff --git a/synthesizer/tests/expectations/vm/execute_and_finalize/test_branch.out b/synthesizer/tests/expectations/vm/execute_and_finalize/test_branch.out index 7c414c0ce3..b33ff70bb3 100644 --- a/synthesizer/tests/expectations/vm/execute_and_finalize/test_branch.out +++ b/synthesizer/tests/expectations/vm/execute_and_finalize/test_branch.out @@ -25,12 +25,12 @@ additional: - child_outputs: credits.aleo/fee_public: outputs: - - '{"type":"future","id":"8176559465483810586872674176090912007328770812617215482809916166686904238834field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1x3r205zqql5ywy0cqqt74k0r0htuusn0d037ycxe8ftt9ep8hyzsmqz4dh,\n 17268u64\n ]\n}"}' + - '{"type":"future","id":"8106219036946205921442068845477966962714931688375339320257090626666079907957field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1x3r205zqql5ywy0cqqt74k0r0htuusn0d037ycxe8ftt9ep8hyzsmqz4dh,\n 17300u64\n ]\n}"}' - child_outputs: credits.aleo/fee_public: outputs: - - '{"type":"future","id":"885516194992930770292437059317184478627651975125735363573325083543887608918field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1x3r205zqql5ywy0cqqt74k0r0htuusn0d037ycxe8ftt9ep8hyzsmqz4dh,\n 17268u64\n ]\n}"}' + - '{"type":"future","id":"5602966067027612121492901613016034313966775151616010753607230057896796926470field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1x3r205zqql5ywy0cqqt74k0r0htuusn0d037ycxe8ftt9ep8hyzsmqz4dh,\n 17300u64\n ]\n}"}' - child_outputs: credits.aleo/fee_public: outputs: - - '{"type":"future","id":"6884773732489674095657820682011451719106395760464004244662697484163781295818field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1x3r205zqql5ywy0cqqt74k0r0htuusn0d037ycxe8ftt9ep8hyzsmqz4dh,\n 17268u64\n ]\n}"}' + - '{"type":"future","id":"3081830149730885290865681463726996721360143620446043924372966467049892522151field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1x3r205zqql5ywy0cqqt74k0r0htuusn0d037ycxe8ftt9ep8hyzsmqz4dh,\n 17300u64\n ]\n}"}' diff --git a/synthesizer/tests/expectations/vm/execute_and_finalize/test_rand.out b/synthesizer/tests/expectations/vm/execute_and_finalize/test_rand.out index d753dcf2b4..4d42497482 100644 --- a/synthesizer/tests/expectations/vm/execute_and_finalize/test_rand.out +++ b/synthesizer/tests/expectations/vm/execute_and_finalize/test_rand.out @@ -26,22 +26,22 @@ outputs: test_rand.aleo/rand_chacha_check: outputs: - '{"type":"future","id":"887371549615679800380522845098080464570119184210350810479392117984911457950field","value":"{\n program_id: test_rand.aleo,\n function_name: rand_chacha_check,\n arguments: [\n 1field,\n true\n ]\n}"}' - speculate: the execution was rejected + speculate: the execution was accepted add_next_block: succeeded. additional: - child_outputs: credits.aleo/fee_public: outputs: - - '{"type":"future","id":"6314628133780265670801554258125814886017405269745792760682853845340140460175field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1uchf7kruskpp8thlnfeya9qeklcjss27j6rtu74zz7ch559neqystgslsp,\n 601806u64\n ]\n}"}' + - '{"type":"future","id":"1954843605707011569017691242015592701231393776423411070382102764848115526152field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1uchf7kruskpp8thlnfeya9qeklcjss27j6rtu74zz7ch559neqystgslsp,\n 601838u64\n ]\n}"}' - child_outputs: credits.aleo/fee_public: outputs: - - '{"type":"future","id":"3725939744341267737290273038160661629630343114766507174134842826652488781816field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1uchf7kruskpp8thlnfeya9qeklcjss27j6rtu74zz7ch559neqystgslsp,\n 26679u64\n ]\n}"}' + - '{"type":"future","id":"4799245045416841637940810256002032218338392565356779467663006058698098663885field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1uchf7kruskpp8thlnfeya9qeklcjss27j6rtu74zz7ch559neqystgslsp,\n 26711u64\n ]\n}"}' - child_outputs: credits.aleo/fee_public: outputs: - - '{"type":"future","id":"5227003534986816857285932061757797688706802206018964764622184983760566708322field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1uchf7kruskpp8thlnfeya9qeklcjss27j6rtu74zz7ch559neqystgslsp,\n 28344u64\n ]\n}"}' + - '{"type":"future","id":"5360111180004884910093371282698488853787898366475495124180689014576183764029field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1uchf7kruskpp8thlnfeya9qeklcjss27j6rtu74zz7ch559neqystgslsp,\n 28376u64\n ]\n}"}' - child_outputs: credits.aleo/fee_public: outputs: - - '{"type":"future","id":"5806769723479332130567002952494928256138310337461654699762319212831997850826field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1uchf7kruskpp8thlnfeya9qeklcjss27j6rtu74zz7ch559neqystgslsp,\n 28344u64\n ]\n}"}' + - '{"type":"future","id":"1078590685270970490102244419844834983260895123752968771025227902560801728744field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1uchf7kruskpp8thlnfeya9qeklcjss27j6rtu74zz7ch559neqystgslsp,\n 28376u64\n ]\n}"}' diff --git a/synthesizer/tests/expectations/vm/execute_and_finalize/timelock.out b/synthesizer/tests/expectations/vm/execute_and_finalize/timelock.out index 425f80af2e..e402210479 100644 --- a/synthesizer/tests/expectations/vm/execute_and_finalize/timelock.out +++ b/synthesizer/tests/expectations/vm/execute_and_finalize/timelock.out @@ -18,8 +18,8 @@ additional: - child_outputs: credits.aleo/fee_public: outputs: - - '{"type":"future","id":"2868527388214006275127069563021857572887489216649877337285946162120321568912field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo12tksdptp7hvxly8tkm3um08fvf53qpehsgdgqfvy9pe3sewcq5ysjg5myy,\n 5164u64\n ]\n}"}' + - '{"type":"future","id":"249410411838825478865739830874779169561439868902427431760878024837259091913field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo12tksdptp7hvxly8tkm3um08fvf53qpehsgdgqfvy9pe3sewcq5ysjg5myy,\n 5196u64\n ]\n}"}' - child_outputs: credits.aleo/fee_public: outputs: - - '{"type":"future","id":"3666380379303443004933801395245329857516145915761366182794264005536589963556field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo12tksdptp7hvxly8tkm3um08fvf53qpehsgdgqfvy9pe3sewcq5ysjg5myy,\n 5164u64\n ]\n}"}' + - '{"type":"future","id":"305364658614416349499875323189105951052490457303130942584649083751622511633field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo12tksdptp7hvxly8tkm3um08fvf53qpehsgdgqfvy9pe3sewcq5ysjg5myy,\n 5196u64\n ]\n}"}' diff --git a/synthesizer/tests/expectations/vm/execute_and_finalize/unused_position.out b/synthesizer/tests/expectations/vm/execute_and_finalize/unused_position.out index c5e300b026..14e01bd31f 100644 --- a/synthesizer/tests/expectations/vm/execute_and_finalize/unused_position.out +++ b/synthesizer/tests/expectations/vm/execute_and_finalize/unused_position.out @@ -11,4 +11,4 @@ additional: - child_outputs: credits.aleo/fee_public: outputs: - - '{"type":"future","id":"5889749875317192883762347751185109427367185401929794748301981981444845203330field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo12tksdptp7hvxly8tkm3um08fvf53qpehsgdgqfvy9pe3sewcq5ysjg5myy,\n 2176u64\n ]\n}"}' + - '{"type":"future","id":"1702068047615200738768599002880139094417950875749429367474118222212956440257field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo12tksdptp7hvxly8tkm3um08fvf53qpehsgdgqfvy9pe3sewcq5ysjg5myy,\n 2208u64\n ]\n}"}' diff --git a/synthesizer/tests/expectations/vm/execute_and_finalize/user_callable.out b/synthesizer/tests/expectations/vm/execute_and_finalize/user_callable.out index 85f3df23fb..227475889d 100644 --- a/synthesizer/tests/expectations/vm/execute_and_finalize/user_callable.out +++ b/synthesizer/tests/expectations/vm/execute_and_finalize/user_callable.out @@ -13,5 +13,5 @@ additional: - child_outputs: credits.aleo/fee_public: outputs: - - '{"type":"future","id":"5245767978479482276373144091068362056657622227760198296183689243703275814117field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1qr2ha4pfs5l28aze88yn6fhleeythklkczrule2v838uwj65n5gqxt9djx,\n 1244u64\n ]\n}"}' + - '{"type":"future","id":"83041879108137922886601212431409060421400113751592313519100907875082819233field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1qr2ha4pfs5l28aze88yn6fhleeythklkczrule2v838uwj65n5gqxt9djx,\n 1276u64\n ]\n}"}' - {} From 363b31d8b871a18d27b1375ea2c7ddf70048c3c4 Mon Sep 17 00:00:00 2001 From: bishopcheckmate Date: Fri, 5 Jan 2024 19:52:12 +0100 Subject: [PATCH 083/298] perf: inline affine pair from x-coord in weierstrass curve --- curves/src/templates/short_weierstrass_jacobian/affine.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/curves/src/templates/short_weierstrass_jacobian/affine.rs b/curves/src/templates/short_weierstrass_jacobian/affine.rs index d07a53a024..d5cbe730f5 100644 --- a/curves/src/templates/short_weierstrass_jacobian/affine.rs +++ b/curves/src/templates/short_weierstrass_jacobian/affine.rs @@ -155,6 +155,7 @@ impl AffineCurve for Affine

{ /// /// Calling this should be equivalent (but likely more performant) to /// `(AffineCurve::from_x_coordinate(x, false), AffineCurve::from_x_coordinate(x, true))`. + #[inline] fn pair_from_x_coordinate(x: Self::BaseField) -> Option<(Self, Self)> { Self::from_x_coordinate(x, false).map(|p1| (p1, Self::new(p1.x, -p1.y, false))) } From 0990ccd18ee09cfe2a166a19dedd124019fc54ae Mon Sep 17 00:00:00 2001 From: d0cd <23022326+d0cd@users.noreply.github.com> Date: Sat, 6 Jan 2024 11:21:25 +0800 Subject: [PATCH 084/298] Update circuit/types/group/src/helpers/from_x_coordinate.rs Co-authored-by: Alessandro Coglio Signed-off-by: d0cd <23022326+d0cd@users.noreply.github.com> --- circuit/types/group/src/helpers/from_x_coordinate.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/circuit/types/group/src/helpers/from_x_coordinate.rs b/circuit/types/group/src/helpers/from_x_coordinate.rs index d23f182af4..c313c9b155 100644 --- a/circuit/types/group/src/helpers/from_x_coordinate.rs +++ b/circuit/types/group/src/helpers/from_x_coordinate.rs @@ -49,7 +49,7 @@ impl Group { E::enforce(|| (&yy, &d_xx_minus_1, &a_xx_minus_1)); // Compute both square roots of y^2, with a flag indicating whether y^2 is a square or not. - // Note that there is **no** ordering on the square roots. + // Note that there is **no** ordering on the square roots in the circuit computation. // Note that if the x-coordinate line does not intersect the elliptic curve, this returns (0, 0, false). let (y1, y2, yy_is_not_square) = yy.square_roots_flagged_nondeterministic(); From 7667c682c0cb666d285f059bf07b4a3f05ed47c8 Mon Sep 17 00:00:00 2001 From: d0cd <23022326+d0cd@users.noreply.github.com> Date: Sat, 6 Jan 2024 11:21:40 +0800 Subject: [PATCH 085/298] Update circuit/types/group/src/helpers/from_x_coordinate.rs Co-authored-by: Alessandro Coglio Signed-off-by: d0cd <23022326+d0cd@users.noreply.github.com> --- circuit/types/group/src/helpers/from_x_coordinate.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/circuit/types/group/src/helpers/from_x_coordinate.rs b/circuit/types/group/src/helpers/from_x_coordinate.rs index c313c9b155..e5e4ac3419 100644 --- a/circuit/types/group/src/helpers/from_x_coordinate.rs +++ b/circuit/types/group/src/helpers/from_x_coordinate.rs @@ -50,7 +50,7 @@ impl Group { // Compute both square roots of y^2, with a flag indicating whether y^2 is a square or not. // Note that there is **no** ordering on the square roots in the circuit computation. - // Note that if the x-coordinate line does not intersect the elliptic curve, this returns (0, 0, false). + // Note that if the x-coordinate line does not intersect the elliptic curve, this returns (0, 0, true). let (y1, y2, yy_is_not_square) = yy.square_roots_flagged_nondeterministic(); // Construct the two points. From c8966f6740475bbeae43ab79cbc30dc8d947a60b Mon Sep 17 00:00:00 2001 From: Pranav Gaddamadugu <23022326+d0cd@users.noreply.github.com> Date: Sat, 6 Jan 2024 11:41:23 +0800 Subject: [PATCH 086/298] Address some feedback --- circuit/types/field/src/square_root.rs | 5 +++-- circuit/types/group/src/helpers/from_x_coordinate.rs | 3 ++- circuit/types/group/src/lib.rs | 3 +++ 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/circuit/types/field/src/square_root.rs b/circuit/types/field/src/square_root.rs index 6c2180947f..a4df62748c 100644 --- a/circuit/types/field/src/square_root.rs +++ b/circuit/types/field/src/square_root.rs @@ -79,7 +79,7 @@ impl Field { /// - both field results are 0 /// - the flag is 1 /// - /// Note that there is no ordering on the two roots returned by this function. + /// Note that the constraints do **not** impose an ordering on the two roots returned by this function. pub fn square_roots_flagged_nondeterministic(&self) -> (Self, Self, Boolean) { // Obtain (p-1)/2, as a constant field element. let modulus_minus_one_div_two = match E::BaseField::from_bigint(E::BaseField::modulus_minus_one_div_two()) { @@ -92,13 +92,14 @@ impl Field { let is_nonzero_square = euler.is_one(); // Calculate the witness for the first square result. - // Note that the function `square_root` returns the square root closer to 0. + // Note that the **console** function `square_root` returns the square root closer to 0. let root_witness = match self.eject_value().square_root() { Ok(root) => root, Err(_) => console::Field::zero(), }; // Initialize the square element, which is either `self` or 0, depending on whether `self` is a square. + // This is done to ensure that the below constraint is satisfied even if `self` is not a square. let square = Self::ternary(&is_nonzero_square, self, &Field::zero()); // Initialize a new variable for the first root. diff --git a/circuit/types/group/src/helpers/from_x_coordinate.rs b/circuit/types/group/src/helpers/from_x_coordinate.rs index e5e4ac3419..5dd2191060 100644 --- a/circuit/types/group/src/helpers/from_x_coordinate.rs +++ b/circuit/types/group/src/helpers/from_x_coordinate.rs @@ -28,7 +28,8 @@ impl Group { } /// Initializes an affine group element from a given x-coordinate field element. - /// Returns an error flag, indicating if there is a group element with the given x-coordinate; + /// Additionally, returns an error flag. + /// If the error flag is set, there is **no** group element with the given x-coordinate. /// If the error flag is set, the returned point is `(0, 0)`. pub fn from_x_coordinate_flagged(x: Field) -> (Self, Boolean) { // Obtain the A and D coefficients of the elliptic curve. diff --git a/circuit/types/group/src/lib.rs b/circuit/types/group/src/lib.rs index 9a294e7f37..cb4339f2da 100644 --- a/circuit/types/group/src/lib.rs +++ b/circuit/types/group/src/lib.rs @@ -132,13 +132,16 @@ impl Group { /// Returns a `Boolean` indicating if `self` is in the largest prime-order subgroup. pub fn is_in_group(&self) -> Boolean { + // Initialize the order of the subgroup as a bits. let order = E::ScalarField::modulus(); let order_bits_be = order.to_bits_be(); let mut order_bits_be_constants = Vec::with_capacity(order_bits_be.len()); for bit in order_bits_be.iter() { order_bits_be_constants.push(Boolean::constant(*bit)); } + // Multiply `self` by the order of the subgroup. let self_times_order = order_bits_be_constants.mul(self); + // Check if the result is zero. self_times_order.is_zero() } } From d68d0354b56f947bdc0b0c6e840c9367abe7e338 Mon Sep 17 00:00:00 2001 From: d0cd <23022326+d0cd@users.noreply.github.com> Date: Sat, 6 Jan 2024 18:01:53 +0800 Subject: [PATCH 087/298] Update circuit/types/group/src/lib.rs Co-authored-by: Alessandro Coglio <2409151+acoglio@users.noreply.github.com> Signed-off-by: d0cd <23022326+d0cd@users.noreply.github.com> --- circuit/types/group/src/lib.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/circuit/types/group/src/lib.rs b/circuit/types/group/src/lib.rs index cb4339f2da..0983de04df 100644 --- a/circuit/types/group/src/lib.rs +++ b/circuit/types/group/src/lib.rs @@ -130,7 +130,8 @@ impl Group { double_point.enforce_double(self); } - /// Returns a `Boolean` indicating if `self` is in the largest prime-order subgroup. + /// Returns a `Boolean` indicating if `self` is in the largest prime-order subgroup, + /// assuming that `self` is on the curve. pub fn is_in_group(&self) -> Boolean { // Initialize the order of the subgroup as a bits. let order = E::ScalarField::modulus(); From 8088d621b5536a41b04e1191ad0c2cec46e36282 Mon Sep 17 00:00:00 2001 From: d0cd <23022326+d0cd@users.noreply.github.com> Date: Sat, 6 Jan 2024 18:02:46 +0800 Subject: [PATCH 088/298] Update circuit/types/field/src/square_root.rs Co-authored-by: Alessandro Coglio <2409151+acoglio@users.noreply.github.com> Signed-off-by: d0cd <23022326+d0cd@users.noreply.github.com> --- circuit/types/field/src/square_root.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/circuit/types/field/src/square_root.rs b/circuit/types/field/src/square_root.rs index a4df62748c..be7d350f71 100644 --- a/circuit/types/field/src/square_root.rs +++ b/circuit/types/field/src/square_root.rs @@ -79,7 +79,8 @@ impl Field { /// - both field results are 0 /// - the flag is 1 /// - /// Note that the constraints do **not** impose an ordering on the two roots returned by this function. + /// Note that the constraints do **not** impose an ordering on the two roots returned by this function; + /// this is what the `nondeterministic` part of this function name refers to. pub fn square_roots_flagged_nondeterministic(&self) -> (Self, Self, Boolean) { // Obtain (p-1)/2, as a constant field element. let modulus_minus_one_div_two = match E::BaseField::from_bigint(E::BaseField::modulus_minus_one_div_two()) { From 603a8f721d41dc505d7688c5ba65c0b0a642c6bc Mon Sep 17 00:00:00 2001 From: bishopcheckmate Date: Sat, 6 Jan 2024 16:03:17 +0100 Subject: [PATCH 089/298] test: add test for weierstrass from x coord --- .../short_weierstrass_jacobian/tests.rs | 21 +++++++++++++++++++ .../twisted_edwards_extended/tests.rs | 5 +++++ 2 files changed, 26 insertions(+) diff --git a/curves/src/templates/short_weierstrass_jacobian/tests.rs b/curves/src/templates/short_weierstrass_jacobian/tests.rs index 623d7fc026..b8f94bbd23 100644 --- a/curves/src/templates/short_weierstrass_jacobian/tests.rs +++ b/curves/src/templates/short_weierstrass_jacobian/tests.rs @@ -29,6 +29,7 @@ pub const ITERATIONS: usize = 10; pub fn sw_tests(rng: &mut TestRng) { sw_curve_serialization_test::

(rng); sw_from_random_bytes::

(rng); + sw_from_x_coordinate::

(rng); } pub fn sw_curve_serialization_test(rng: &mut TestRng) { @@ -138,3 +139,23 @@ pub fn sw_from_random_bytes(rng: &mut TestRng) { } } } + +pub fn sw_from_x_coordinate(rng: &mut TestRng) { + for _ in 0..ITERATIONS { + let a = Projective::

::rand(rng); + let a = a.to_affine(); + { + let x = a.x; + + let a1 = Affine::

::from_x_coordinate(x, true).unwrap(); + let a2 = Affine::

::from_x_coordinate(x, false).unwrap(); + + assert!(a == a1 || a == a2); + + let (b2, b1) = Affine::

::pair_from_x_coordinate(x).unwrap(); + + assert_eq!(a1, b1); + assert_eq!(a2, b2); + } + } +} diff --git a/curves/src/templates/twisted_edwards_extended/tests.rs b/curves/src/templates/twisted_edwards_extended/tests.rs index f8cee43f9d..e1ccbded0d 100644 --- a/curves/src/templates/twisted_edwards_extended/tests.rs +++ b/curves/src/templates/twisted_edwards_extended/tests.rs @@ -201,6 +201,11 @@ where let a2 = Affine::

::from_x_coordinate(x, false).unwrap(); assert!(a == a1 || a == a2); + + let (b2, b1) = Affine::

::pair_from_x_coordinate(x).unwrap(); + + assert_eq!(a1, b1); + assert_eq!(a2, b2); } { let y = a.y; From 22b06f32b377bb85e8d4eaa3a7675cdb3ef83f3b Mon Sep 17 00:00:00 2001 From: bishopcheckmate Date: Sat, 6 Jan 2024 20:29:03 +0100 Subject: [PATCH 090/298] chore: add benchmarks for Group::from_field --- Cargo.lock | 2 + console/types/Cargo.toml | 12 +++++ console/types/benches/group.rs | 84 ++++++++++++++++++++++++++++++++++ 3 files changed, 98 insertions(+) create mode 100644 console/types/benches/group.rs diff --git a/Cargo.lock b/Cargo.lock index d5dfef8577..ad73cc7fb6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2978,6 +2978,8 @@ dependencies = [ name = "snarkvm-console-types" version = "0.16.15" dependencies = [ + "criterion", + "snarkvm-console-network", "snarkvm-console-network-environment", "snarkvm-console-types-address", "snarkvm-console-types-boolean", diff --git a/console/types/Cargo.toml b/console/types/Cargo.toml index 17dc90de05..4b0311278f 100644 --- a/console/types/Cargo.toml +++ b/console/types/Cargo.toml @@ -6,6 +6,11 @@ description = "Console types for a decentralized virtual machine" license = "Apache-2.0" edition = "2021" +[[bench]] +name = "group" +path = "benches/group.rs" +harness = false + [dependencies.snarkvm-console-network-environment] path = "../network/environment" version = "=0.16.15" @@ -45,6 +50,13 @@ path = "./string" version = "=0.16.15" optional = true +[dev-dependencies.criterion] +version = "0.5.1" + +[dev-dependencies.snarkvm-console-network] +path = "../network" +version = "=0.16.15" + [features] default = [ "address", diff --git a/console/types/benches/group.rs b/console/types/benches/group.rs new file mode 100644 index 0000000000..97782f3881 --- /dev/null +++ b/console/types/benches/group.rs @@ -0,0 +1,84 @@ +// Copyright (C) 2019-2023 Aleo Systems Inc. +// This file is part of the snarkVM library. + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at: +// http://www.apache.org/licenses/LICENSE-2.0 + +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#[macro_use] +extern crate criterion; + +use criterion::Criterion; +use snarkvm_console_network::{environment::prelude::*, Testnet3}; +use snarkvm_console_types::{Field, Group}; + +type CurrentNetwork = Testnet3; + +fn group_from_field(c: &mut Criterion) { + let rng = &mut TestRng::default(); + + c.bench_function("group_from_field", move |b| { + let fields: Vec> = (0..1000).map(|_| rng.gen()).collect(); + + b.iter(|| { + for field in &fields { + let group = Group::from_field(field); + let _ = std::hint::black_box(group); + } + }) + }); +} + +fn group_from_field_on_curve(c: &mut Criterion) { + let rng = &mut TestRng::default(); + + c.bench_function("group_from_field_on_curve", move |b| { + type Projective = ::Projective; + + let fields: Vec> = + (0..1000).map(|_| rng.gen::().to_affine().to_x_coordinate()).map(Field::new).collect(); + + b.iter(|| { + for field in &fields { + let group = Group::from_field(field); + let _ = std::hint::black_box(group); + } + }) + }); +} + +fn group_from_field_off_curve(c: &mut Criterion) { + let rng = &mut TestRng::default(); + + c.bench_function("group_from_field_off_curve", move |b| { + type Affine = ::Affine; + + let fields: Vec<_> = std::iter::repeat(()) + .map(|_| rng.gen::>()) + .filter(|&field| Affine::from_x_coordinate(*field, true).is_none()) + .take(1000) + .collect(); + + b.iter(|| { + for field in &fields { + let group = Group::from_field(field); + let _ = std::hint::black_box(group); + } + }) + }); +} + +criterion_group! { + name = group; + config = Criterion::default().sample_size(20); + targets = group_from_field, group_from_field_on_curve, group_from_field_off_curve +} + +criterion_main!(group); From 360daafd76426c59380c6fd3092f15b5f3c5b2b6 Mon Sep 17 00:00:00 2001 From: bishopcheckmate Date: Sat, 6 Jan 2024 20:55:58 +0100 Subject: [PATCH 091/298] chore: include console-types benchmarks on CI --- .github/workflows/benchmarks.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/benchmarks.yml b/.github/workflows/benchmarks.yml index bd6e7ad390..32054890db 100644 --- a/.github/workflows/benchmarks.yml +++ b/.github/workflows/benchmarks.yml @@ -62,6 +62,12 @@ jobs: cargo bench --bench merkle_tree -- --output-format bencher | tee -a ../../output.txt cd ../.. + - name: Benchmark console/types + run: | + cd console/types + cargo bench --bench group -- --output-format bencher | tee -a ../../output.txt + cd ../.. + - name: Benchmark curves run: | cd curves From 90affaf4a494bd144c0685a2bc76ad68bdd83efb Mon Sep 17 00:00:00 2001 From: bishopcheckmate Date: Sun, 7 Jan 2024 22:13:06 +0100 Subject: [PATCH 092/298] perf: optimize console field and scalar from_bits_le --- console/types/field/src/from_bits.rs | 10 ++++++---- console/types/scalar/src/from_bits.rs | 10 ++++++---- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/console/types/field/src/from_bits.rs b/console/types/field/src/from_bits.rs index 18e1ea02a5..ec58df6f19 100644 --- a/console/types/field/src/from_bits.rs +++ b/console/types/field/src/from_bits.rs @@ -45,12 +45,14 @@ impl FromBits for Field { // Return the field. Ok(Field { field: E::Field::from_bigint(field).ok_or_else(|| anyhow!("Invalid field from bits"))? }) } else { - // Construct the sanitized list of bits, resizing up if necessary. - let mut bits_le = bits_le.iter().take(size_in_bits).cloned().collect::>(); - bits_le.resize(size_in_bits, false); + // Construct the sanitized list of bits padded with `false` + let mut sanitized_bits = vec![false; size_in_bits]; + // this is safe, because we just checked that the length of bits isn't bigger + // than `size_in_data_bits` which is equal to `size_in_bits - 1`. + sanitized_bits[..num_bits].copy_from_slice(bits_le); // Recover the native field. - let field = E::Field::from_bigint(E::BigInteger::from_bits_le(&bits_le)?) + let field = E::Field::from_bigint(E::BigInteger::from_bits_le(&sanitized_bits)?) .ok_or_else(|| anyhow!("Invalid field from bits"))?; // Return the field. diff --git a/console/types/scalar/src/from_bits.rs b/console/types/scalar/src/from_bits.rs index 25b98715b7..e53acc12fc 100644 --- a/console/types/scalar/src/from_bits.rs +++ b/console/types/scalar/src/from_bits.rs @@ -48,12 +48,14 @@ impl FromBits for Scalar { // Return the scalar. Ok(Scalar { scalar: E::Scalar::from_bigint(scalar).ok_or_else(|| anyhow!("Invalid scalar from bits"))? }) } else { - // Construct the sanitized list of bits, resizing up if necessary. - let mut bits_le = bits_le.iter().take(size_in_bits).cloned().collect::>(); - bits_le.resize(size_in_bits, false); + // Construct the sanitized list of bits padded with `false` + let mut sanitized_bits = vec![false; size_in_bits]; + // this is safe, because we just checked that the length of bits isn't bigger + // than `size_in_data_bits` which is equal to `size_in_bits - 1`. + sanitized_bits[..num_bits].copy_from_slice(bits_le); // Recover the native scalar. - let scalar = E::Scalar::from_bigint(E::BigInteger::from_bits_le(&bits_le)?) + let scalar = E::Scalar::from_bigint(E::BigInteger::from_bits_le(&sanitized_bits)?) .ok_or_else(|| anyhow!("Invalid scalar from bits"))?; // Return the scalar. From 57ce45a0755d6d5d83f410ae49969418d184839b Mon Sep 17 00:00:00 2001 From: Michael Turner Date: Mon, 8 Jan 2024 09:54:06 -0500 Subject: [PATCH 093/298] Refine cost structure for finalize --- console/program/src/data/literal/mod.rs | 2 +- .../data/literal/{size_in_bits.rs => size.rs} | 4 + .../src/data_types/literal_type/mod.rs | 2 +- .../literal_type/{size_in_bits.rs => size.rs} | 17 +- synthesizer/src/vm/helpers/cost.rs | 476 +++++++++++++----- 5 files changed, 355 insertions(+), 146 deletions(-) rename console/program/src/data/literal/{size_in_bits.rs => size.rs} (94%) rename console/program/src/data_types/literal_type/{size_in_bits.rs => size.rs} (71%) diff --git a/console/program/src/data/literal/mod.rs b/console/program/src/data/literal/mod.rs index 5b904165ca..df74c18763 100644 --- a/console/program/src/data/literal/mod.rs +++ b/console/program/src/data/literal/mod.rs @@ -23,7 +23,7 @@ mod from_bits; mod parse; mod sample; mod serialize; -mod size_in_bits; +mod size; mod to_bits; mod to_type; mod variant; diff --git a/console/program/src/data/literal/size_in_bits.rs b/console/program/src/data/literal/size.rs similarity index 94% rename from console/program/src/data/literal/size_in_bits.rs rename to console/program/src/data/literal/size.rs index b07ac4083e..33ca614212 100644 --- a/console/program/src/data/literal/size_in_bits.rs +++ b/console/program/src/data/literal/size.rs @@ -41,4 +41,8 @@ impl Literal { }; u16::try_from(size).or_halt_with::("Literal exceeds u16::MAX bits.") } + + pub fn size_in_bytes(&self) -> u16 { + self.size_in_bits().saturating_add(7).saturating_div(8) + } } diff --git a/console/program/src/data_types/literal_type/mod.rs b/console/program/src/data_types/literal_type/mod.rs index 868942afbf..5032fd7e91 100644 --- a/console/program/src/data_types/literal_type/mod.rs +++ b/console/program/src/data_types/literal_type/mod.rs @@ -15,7 +15,7 @@ mod bytes; mod parse; mod serialize; -mod size_in_bits; +mod size; use snarkvm_console_account::Signature; use snarkvm_console_network::prelude::*; diff --git a/console/program/src/data_types/literal_type/size_in_bits.rs b/console/program/src/data_types/literal_type/size.rs similarity index 71% rename from console/program/src/data_types/literal_type/size_in_bits.rs rename to console/program/src/data_types/literal_type/size.rs index 4e6fd24b56..bdb137095a 100644 --- a/console/program/src/data_types/literal_type/size_in_bits.rs +++ b/console/program/src/data_types/literal_type/size.rs @@ -15,9 +15,10 @@ use super::*; impl LiteralType { - /// Returns the number of bits of this literal. - pub fn size_in_bits(&self) -> usize { - match self { + /// Returns the number of bits of this literal. In the case of a string literal this will return + /// the maximum number of bits that can be stored in a string. + pub fn size_in_bits(&self) -> u16 { + let size = match self { Self::Address => Address::::size_in_bits(), Self::Boolean => Boolean::::size_in_bits(), Self::Field => Field::::size_in_bits(), @@ -34,8 +35,14 @@ impl LiteralType { Self::U128 => U128::::size_in_bits(), Self::Scalar => Scalar::::size_in_bits(), Self::Signature => Signature::::size_in_bits(), - // TODO (raychu86): This uses the maximum size of a string, but it should be the size of the string literal. Self::String => N::MAX_STRING_BYTES.saturating_mul(8) as usize, - } + }; + u16::try_from(size).or_halt_with::("Literal exceeds u16::MAX bits.") + } + + /// Returns the number of bytes of this literal. In the case of a string literal this will return + /// the maximum number of bytes that can be stored in a string. + pub fn size_in_bytes(&self) -> u16 { + self.size_in_bits::().saturating_add(7).saturating_div(8) } } diff --git a/synthesizer/src/vm/helpers/cost.rs b/synthesizer/src/vm/helpers/cost.rs index 857d87ba68..5e35188c92 100644 --- a/synthesizer/src/vm/helpers/cost.rs +++ b/synthesizer/src/vm/helpers/cost.rs @@ -26,10 +26,19 @@ use synthesizer_program::{Command, Finalize, Instruction, Operand, StackProgram} use std::collections::HashMap; -const HASH_BHP_BYTE_COST: u64 = 10000; -const HASH_PSD_BYTE_COST: u64 = 3000; -const SET_COMMAND_BYTE_COST: u64 = 1000; -const HASH_BASE_BYTE_COST: u64 = 300; +// Base finalize costs for compute heavy operations. +const HASH_BHP_BASE_COST: u64 = 50_000; +const HASH_PSD_BASE_COST: u64 = 40_000; +const HASH_BASE_COST: u64 = 10_000; +const SET_COMMAND_BASE_COST: u64 = 10_000; +const GET_COMMAND_BASE_COST: u64 = 10_000; + +// Finalize cost per byte for compute heavy operations. +const HASH_BHP_PER_BYTE_COST: u64 = 300; +const HASH_PSD_PER_BYTE_COST: u64 = 75; +const SET_COMMAND_PER_BYTE_COST: u64 = 100; +const GET_COMMAND_PER_BYTE_COST: u64 = 10; +const HASH_PER_BYTE_COST: u64 = 30; /// Returns the *minimum* cost in microcredits to publish the given deployment (total cost, (storage cost, namespace cost)). pub fn deployment_cost(deployment: &Deployment) -> Result<(u64, (u64, u64))> { @@ -110,48 +119,6 @@ pub fn cost_in_microcredits(stack: &Stack, finalize: &Finalize // Retrieve the finalize types. let finalize_types = stack.get_finalize_types(finalize.name())?; - fn literal_size_in_bytes(literal_type: &LiteralType) -> Result { - // Retrieve the literal size in bits. - let literal_size_in_bits = literal_type.size_in_bits::() as u64; - - // Compute the size in bytes. - let literal_size_in_bytes = literal_size_in_bits.saturating_add(7).saturating_div(8); - - // Return the size of the literal. - Ok(literal_size_in_bytes) - } - - // Helper function to get the plaintext type in bytes - fn plaintext_size_in_bytes(stack: &Stack, plaintext_type: &PlaintextType) -> Result { - match plaintext_type { - PlaintextType::Literal(literal_type) => literal_size_in_bytes::(literal_type), - PlaintextType::Struct(struct_identifier) => { - // Retrieve the struct from the stack. - let plaintext_struct = stack.program().get_struct(struct_identifier)?; - - // Retrieve the size of the struct identifier. - let identifier_size = plaintext_struct.name().to_bytes_le()?.len() as u64; - - // Retrieve the size of all the members of the struct. - let size_of_members = plaintext_struct - .members() - .iter() - .map(|(_, member_type)| plaintext_size_in_bytes(stack, member_type)) - .sum::>()?; - - // Return the size of the struct. - Ok(identifier_size.saturating_add(size_of_members)) - } - PlaintextType::Array(array_type) => { - // Retrieve the number of elements in the array - let num_array_elements = **array_type.length() as u64; - - // Retrieve the size of the internal array types. - Ok(num_array_elements.saturating_mul(plaintext_size_in_bytes(stack, array_type.next_element_type())?)) - } - } - } - // Helper function to get the size of the operand type. let operand_size_in_bytes = |operand: &Operand| { // Get the finalize type from the operand. @@ -167,50 +134,92 @@ pub fn cost_in_microcredits(stack: &Stack, finalize: &Finalize plaintext_size_in_bytes(stack, &plaintext_type) }; - let size_cost = |operands: &[Operand], multiplier: u64| { + let size_cost = |operands: &[Operand], byte_multiplier: u64, base_cost: u64| { let operand_size = operands.iter().map(operand_size_in_bytes).sum::>()?; - Ok(operand_size.saturating_mul(multiplier)) + Ok(base_cost.saturating_add(operand_size.saturating_mul(byte_multiplier))) }; // Defines the cost of each command. let cost = |command: &Command| match command { - Command::Instruction(Instruction::Abs(_)) => Ok(2_000), - Command::Instruction(Instruction::AbsWrapped(_)) => Ok(2_000), - Command::Instruction(Instruction::Add(_)) => Ok(2_000), - Command::Instruction(Instruction::AddWrapped(_)) => Ok(2_000), - Command::Instruction(Instruction::And(_)) => Ok(2_000), - Command::Instruction(Instruction::AssertEq(_)) => Ok(2_000), - Command::Instruction(Instruction::AssertNeq(_)) => Ok(2_000), + Command::Instruction(Instruction::Abs(_)) => Ok(500), + Command::Instruction(Instruction::AbsWrapped(_)) => Ok(500), + Command::Instruction(Instruction::Add(_)) => Ok(500), + Command::Instruction(Instruction::AddWrapped(_)) => Ok(500), + Command::Instruction(Instruction::And(_)) => Ok(500), + Command::Instruction(Instruction::AssertEq(_)) => Ok(500), + Command::Instruction(Instruction::AssertNeq(_)) => Ok(500), Command::Instruction(Instruction::Async(_)) => bail!("`async` is not supported in finalize."), Command::Instruction(Instruction::Call(_)) => bail!("`call` is not supported in finalize."), - Command::Instruction(Instruction::Cast(_)) => Ok(2_000), - Command::Instruction(Instruction::CastLossy(_)) => Ok(2_000), - Command::Instruction(Instruction::CommitBHP256(commit)) => size_cost(commit.operands(), HASH_BHP_BYTE_COST), - Command::Instruction(Instruction::CommitBHP512(commit)) => size_cost(commit.operands(), HASH_BHP_BYTE_COST), - Command::Instruction(Instruction::CommitBHP768(commit)) => size_cost(commit.operands(), HASH_BHP_BYTE_COST), - Command::Instruction(Instruction::CommitBHP1024(commit)) => size_cost(commit.operands(), HASH_BHP_BYTE_COST), - Command::Instruction(Instruction::CommitPED64(commit)) => size_cost(commit.operands(), HASH_BASE_BYTE_COST), - Command::Instruction(Instruction::CommitPED128(commit)) => size_cost(commit.operands(), HASH_BASE_BYTE_COST), - Command::Instruction(Instruction::Div(_)) => Ok(10_000), - Command::Instruction(Instruction::DivWrapped(_)) => Ok(2_000), - Command::Instruction(Instruction::Double(_)) => Ok(2_000), - Command::Instruction(Instruction::GreaterThan(_)) => Ok(2_000), - Command::Instruction(Instruction::GreaterThanOrEqual(_)) => Ok(2_000), - Command::Instruction(Instruction::HashBHP256(hash)) => size_cost(hash.operands(), HASH_BHP_BYTE_COST), - Command::Instruction(Instruction::HashBHP512(hash)) => size_cost(hash.operands(), HASH_BHP_BYTE_COST), - Command::Instruction(Instruction::HashBHP768(hash)) => size_cost(hash.operands(), HASH_BHP_BYTE_COST), - Command::Instruction(Instruction::HashBHP1024(hash)) => size_cost(hash.operands(), HASH_BHP_BYTE_COST), - Command::Instruction(Instruction::HashKeccak256(hash)) => size_cost(hash.operands(), HASH_BASE_BYTE_COST), - Command::Instruction(Instruction::HashKeccak384(hash)) => size_cost(hash.operands(), HASH_BASE_BYTE_COST), - Command::Instruction(Instruction::HashKeccak512(hash)) => size_cost(hash.operands(), HASH_BASE_BYTE_COST), - Command::Instruction(Instruction::HashPED64(hash)) => size_cost(hash.operands(), HASH_BASE_BYTE_COST), - Command::Instruction(Instruction::HashPED128(hash)) => size_cost(hash.operands(), HASH_BASE_BYTE_COST), - Command::Instruction(Instruction::HashPSD2(hash)) => size_cost(hash.operands(), HASH_PSD_BYTE_COST), - Command::Instruction(Instruction::HashPSD4(hash)) => size_cost(hash.operands(), HASH_PSD_BYTE_COST), - Command::Instruction(Instruction::HashPSD8(hash)) => size_cost(hash.operands(), HASH_PSD_BYTE_COST), - Command::Instruction(Instruction::HashSha3_256(hash)) => size_cost(hash.operands(), HASH_BASE_BYTE_COST), - Command::Instruction(Instruction::HashSha3_384(hash)) => size_cost(hash.operands(), HASH_BASE_BYTE_COST), - Command::Instruction(Instruction::HashSha3_512(hash)) => size_cost(hash.operands(), HASH_BASE_BYTE_COST), + Command::Instruction(Instruction::Cast(_)) => Ok(500), + Command::Instruction(Instruction::CastLossy(_)) => Ok(500), + Command::Instruction(Instruction::CommitBHP256(commit)) => { + size_cost(commit.operands(), HASH_BHP_PER_BYTE_COST, HASH_BHP_BASE_COST) + } + Command::Instruction(Instruction::CommitBHP512(commit)) => { + size_cost(commit.operands(), HASH_BHP_PER_BYTE_COST, HASH_BHP_BASE_COST) + } + Command::Instruction(Instruction::CommitBHP768(commit)) => { + size_cost(commit.operands(), HASH_BHP_PER_BYTE_COST, HASH_BHP_BASE_COST) + } + Command::Instruction(Instruction::CommitBHP1024(commit)) => { + size_cost(commit.operands(), HASH_BHP_PER_BYTE_COST, HASH_BHP_BASE_COST) + } + Command::Instruction(Instruction::CommitPED64(commit)) => { + size_cost(commit.operands(), HASH_PER_BYTE_COST, HASH_BHP_PER_BYTE_COST) + } + Command::Instruction(Instruction::CommitPED128(commit)) => { + size_cost(commit.operands(), HASH_PER_BYTE_COST, HASH_BHP_BASE_COST) + } + Command::Instruction(Instruction::Div(_)) => Ok(1_000), + Command::Instruction(Instruction::DivWrapped(_)) => Ok(500), + Command::Instruction(Instruction::Double(_)) => Ok(500), + Command::Instruction(Instruction::GreaterThan(_)) => Ok(500), + Command::Instruction(Instruction::GreaterThanOrEqual(_)) => Ok(500), + Command::Instruction(Instruction::HashBHP256(hash)) => { + size_cost(hash.operands(), HASH_BHP_PER_BYTE_COST, HASH_BHP_BASE_COST) + } + Command::Instruction(Instruction::HashBHP512(hash)) => { + size_cost(hash.operands(), HASH_BHP_PER_BYTE_COST, HASH_BHP_BASE_COST) + } + Command::Instruction(Instruction::HashBHP768(hash)) => { + size_cost(hash.operands(), HASH_BHP_PER_BYTE_COST, HASH_BHP_BASE_COST) + } + Command::Instruction(Instruction::HashBHP1024(hash)) => { + size_cost(hash.operands(), HASH_BHP_PER_BYTE_COST, HASH_BHP_BASE_COST) + } + Command::Instruction(Instruction::HashKeccak256(hash)) => { + size_cost(hash.operands(), HASH_PER_BYTE_COST, HASH_BASE_COST) + } + Command::Instruction(Instruction::HashKeccak384(hash)) => { + size_cost(hash.operands(), HASH_PER_BYTE_COST, HASH_BASE_COST) + } + Command::Instruction(Instruction::HashKeccak512(hash)) => { + size_cost(hash.operands(), HASH_PER_BYTE_COST, HASH_BASE_COST) + } + Command::Instruction(Instruction::HashPED64(hash)) => { + size_cost(hash.operands(), HASH_PER_BYTE_COST, HASH_PER_BYTE_COST) + } + Command::Instruction(Instruction::HashPED128(hash)) => { + size_cost(hash.operands(), HASH_PER_BYTE_COST, HASH_BASE_COST) + } + Command::Instruction(Instruction::HashPSD2(hash)) => { + size_cost(hash.operands(), HASH_PSD_PER_BYTE_COST, HASH_PSD_BASE_COST) + } + Command::Instruction(Instruction::HashPSD4(hash)) => { + size_cost(hash.operands(), HASH_PSD_PER_BYTE_COST, HASH_PSD_BASE_COST) + } + Command::Instruction(Instruction::HashPSD8(hash)) => { + size_cost(hash.operands(), HASH_PSD_PER_BYTE_COST, HASH_PSD_BASE_COST) + } + Command::Instruction(Instruction::HashSha3_256(hash)) => { + size_cost(hash.operands(), HASH_PER_BYTE_COST, HASH_BASE_COST) + } + Command::Instruction(Instruction::HashSha3_384(hash)) => { + size_cost(hash.operands(), HASH_PER_BYTE_COST, HASH_BASE_COST) + } + Command::Instruction(Instruction::HashSha3_512(hash)) => { + size_cost(hash.operands(), HASH_PER_BYTE_COST, HASH_BASE_COST) + } Command::Instruction(Instruction::HashManyPSD2(_)) => { bail!("`hash_many.psd2` is not supported in finalize.") } @@ -220,59 +229,64 @@ pub fn cost_in_microcredits(stack: &Stack, finalize: &Finalize Command::Instruction(Instruction::HashManyPSD8(_)) => { bail!("`hash_many.psd8` is not supported in finalize.") } - Command::Instruction(Instruction::Inv(_)) => Ok(10_000), - Command::Instruction(Instruction::IsEq(_)) => Ok(2_000), - Command::Instruction(Instruction::IsNeq(_)) => Ok(2_000), - Command::Instruction(Instruction::LessThan(_)) => Ok(2_000), - Command::Instruction(Instruction::LessThanOrEqual(_)) => Ok(2_000), - Command::Instruction(Instruction::Modulo(_)) => Ok(2_000), - Command::Instruction(Instruction::Mul(mul)) => mul.operands().iter().try_fold(0u64, |acc, operand| { + Command::Instruction(Instruction::Inv(_)) => Ok(1000), + Command::Instruction(Instruction::IsEq(_)) => Ok(500), + Command::Instruction(Instruction::IsNeq(_)) => Ok(500), + Command::Instruction(Instruction::LessThan(_)) => Ok(500), + Command::Instruction(Instruction::LessThanOrEqual(_)) => Ok(500), + Command::Instruction(Instruction::Modulo(_)) => Ok(500), + Command::Instruction(Instruction::Mul(mul)) => mul.operands().iter().try_fold(500, |acc, operand| { let finalize_type = finalize_types.get_type_from_operand(stack, operand)?; let cost = match finalize_type { FinalizeType::Plaintext(plaintext) => match plaintext { - PlaintextType::Literal(LiteralType::Group) => acc + 50000, - PlaintextType::Literal(LiteralType::Scalar) => acc + 50000, - PlaintextType::Literal(_) => acc + 2000, + PlaintextType::Literal(LiteralType::Group) => acc + 5_000, + PlaintextType::Literal(LiteralType::Scalar) => acc + 5_000, + PlaintextType::Literal(_) => acc, _ => bail!("multiplication of structs or arrays is not supported."), }, _ => bail!("multiplication of non-plaintext finalize types is not supported."), }; Ok(cost) }), - Command::Instruction(Instruction::MulWrapped(_)) => Ok(2_000), - Command::Instruction(Instruction::Nand(_)) => Ok(2_000), - Command::Instruction(Instruction::Neg(_)) => Ok(2_000), - Command::Instruction(Instruction::Nor(_)) => Ok(2_000), - Command::Instruction(Instruction::Not(_)) => Ok(2_000), - Command::Instruction(Instruction::Or(_)) => Ok(2_000), - Command::Instruction(Instruction::Pow(_)) => Ok(20_000), - Command::Instruction(Instruction::PowWrapped(_)) => Ok(2_000), - Command::Instruction(Instruction::Rem(_)) => Ok(2_000), - Command::Instruction(Instruction::RemWrapped(_)) => Ok(2_000), - Command::Instruction(Instruction::SignVerify(_)) => Ok(250_000), - Command::Instruction(Instruction::Shl(_)) => Ok(2_000), - Command::Instruction(Instruction::ShlWrapped(_)) => Ok(2_000), - Command::Instruction(Instruction::Shr(_)) => Ok(2_000), - Command::Instruction(Instruction::ShrWrapped(_)) => Ok(2_000), - Command::Instruction(Instruction::Square(_)) => Ok(2_000), - Command::Instruction(Instruction::SquareRoot(_)) => Ok(50_000), - Command::Instruction(Instruction::Sub(_)) => Ok(10_000), - Command::Instruction(Instruction::SubWrapped(_)) => Ok(2_000), - Command::Instruction(Instruction::Ternary(_)) => Ok(2_000), - Command::Instruction(Instruction::Xor(_)) => Ok(2_000), - // TODO: The following 'finalize' commands are currently priced higher than expected. - // Expect these numbers to change as their usage is stabilized. - Command::Await(_) => Ok(2_000), - Command::Contains(_) => Ok(15_000), - Command::Get(_) => Ok(15_000), - Command::GetOrUse(_) => Ok(15_000), + Command::Instruction(Instruction::MulWrapped(_)) => Ok(500), + Command::Instruction(Instruction::Nand(_)) => Ok(500), + Command::Instruction(Instruction::Neg(_)) => Ok(500), + Command::Instruction(Instruction::Nor(_)) => Ok(500), + Command::Instruction(Instruction::Not(_)) => Ok(500), + Command::Instruction(Instruction::Or(_)) => Ok(500), + Command::Instruction(Instruction::Pow(_)) => Ok(1_000), + Command::Instruction(Instruction::PowWrapped(_)) => Ok(500), + Command::Instruction(Instruction::Rem(_)) => Ok(500), + Command::Instruction(Instruction::RemWrapped(_)) => Ok(500), + Command::Instruction(Instruction::SignVerify(_)) => Ok(2_500), + Command::Instruction(Instruction::Shl(_)) => Ok(500), + Command::Instruction(Instruction::ShlWrapped(_)) => Ok(500), + Command::Instruction(Instruction::Shr(_)) => Ok(500), + Command::Instruction(Instruction::ShrWrapped(_)) => Ok(500), + Command::Instruction(Instruction::Square(_)) => Ok(500), + Command::Instruction(Instruction::SquareRoot(_)) => Ok(2_500), + Command::Instruction(Instruction::Sub(_)) => Ok(500), + Command::Instruction(Instruction::SubWrapped(_)) => Ok(500), + Command::Instruction(Instruction::Ternary(_)) => Ok(500), + Command::Instruction(Instruction::Xor(_)) => Ok(500), + Command::Await(_) => Ok(500), + Command::Contains(contains) => Ok(operand_size_in_bytes(contains.key())? + .saturating_mul(GET_COMMAND_PER_BYTE_COST) + .saturating_add(GET_COMMAND_BASE_COST)), + Command::Get(get) => Ok(operand_size_in_bytes(get.key())? + .saturating_mul(GET_COMMAND_PER_BYTE_COST) + .saturating_add(GET_COMMAND_BASE_COST)), + Command::GetOrUse(get) => Ok(operand_size_in_bytes(get.key())? + .saturating_mul(SET_COMMAND_PER_BYTE_COST) + .saturating_add(SET_COMMAND_BASE_COST)), Command::RandChaCha(_) => Ok(25_000), - Command::Remove(_) => Ok(10_000), + Command::Remove(_) => Ok(GET_COMMAND_BASE_COST), Command::Set(set) => Ok(operand_size_in_bytes(set.key())? .saturating_add(operand_size_in_bytes(set.value())?) - .saturating_mul(SET_COMMAND_BYTE_COST)), - Command::BranchEq(_) | Command::BranchNeq(_) => Ok(5_000), - Command::Position(_) => Ok(1_000), + .saturating_mul(SET_COMMAND_PER_BYTE_COST) + .saturating_add(SET_COMMAND_BASE_COST)), + Command::BranchEq(_) | Command::BranchNeq(_) => Ok(500), + Command::Position(_) => Ok(100), }; finalize .commands() @@ -281,12 +295,185 @@ pub fn cost_in_microcredits(stack: &Stack, finalize: &Finalize .try_fold(0u64, |acc, res| res.and_then(|x| acc.checked_add(x).ok_or(anyhow!("Finalize cost overflowed")))) } +// Helper function to get the plaintext type in bytes +fn plaintext_size_in_bytes(stack: &Stack, plaintext_type: &PlaintextType) -> Result { + match plaintext_type { + PlaintextType::Literal(literal_type) => Ok(literal_type.size_in_bytes::() as u64), + PlaintextType::Struct(struct_identifier) => { + // Retrieve the struct from the stack. + let plaintext_struct = stack.program().get_struct(struct_identifier)?; + + // Retrieve the size of the struct identifier. + let identifier_size = plaintext_struct.name().to_bytes_le()?.len() as u64; + + // Retrieve the size of all the members of the struct. + let size_of_members = plaintext_struct + .members() + .iter() + .map(|(_, member_type)| plaintext_size_in_bytes(stack, member_type)) + .sum::>()?; + + // Return the size of the struct. + Ok(identifier_size.saturating_add(size_of_members)) + } + PlaintextType::Array(array_type) => { + // Retrieve the number of elements in the array + let num_array_elements = **array_type.length() as u64; + + // Retrieve the size of the internal array types. + Ok(num_array_elements.saturating_mul(plaintext_size_in_bytes(stack, array_type.next_element_type())?)) + } + } +} + +#[macro_export] +macro_rules! estimate_literal_size { + ($($variant:expr),*) => {{ + let mut literal_sizes = vec![]; + $( + let type_and_cost = ($variant.type_name(), $variant.size_in_bytes::()); + literal_sizes.push(type_and_cost); + )* + let mut file = std::fs::File::create("literal_sizes.txt").unwrap(); + for (text, size) in literal_sizes { + writeln!(file, "{},{}", text, size).unwrap(); + } + }}; +} + #[cfg(test)] mod tests { use super::*; use crate::{vm::test_helpers::CurrentNetwork, Process, Program}; use circuit::network::AleoV0; - use console::program::Identifier; + use console::program::{Identifier, ProgramID}; + + #[test] + fn byte_combinations() { + use itertools::Itertools; + use std::{ + fs::File, + io::{BufWriter, Write}, + }; + let csv_data = " + address, Address,32 + boolean, Boolean,1 + field, Field,32 + group, Group,32 + i8, I8,1 + i16, I16,2 + i32, I32,4 + i64, I64,8 + i128, I128,16 + scalar, Scalar,32 + u8, U8,1 + u16, U16,2 + u32, U32,4 + u64, U64,8 + u128, U128,16"; + + let mut types = Vec::new(); + + for line in csv_data.trim().lines() { + let parts: Vec<&str> = line.split(',').map(|s| s.trim()).collect(); + if parts.len() == 3 { + if let Ok(size) = parts[2].parse::() { + types.push((parts[0], parts[1], size)); + } + } + } + + let file = File::create("primitive_combos.txt").unwrap(); + let mut writer = BufWriter::new(file); + + let binary_combinations = types.iter().combinations(2); + let ternary_combinations = types.iter().combinations(3); + + for comb in binary_combinations.chain(ternary_combinations) { + let codes: Vec<&str> = comb.iter().map(|&(code, _, _)| *code).collect(); + let names: Vec<&str> = comb.iter().map(|&(_, name, _)| *name).collect(); + let total_size: i32 = comb.iter().map(|&(_, _, size)| size).sum(); + + writeln!(writer, "{}, {}, {}", codes.join("_"), names.join("_"), total_size).unwrap(); + } + } + + #[test] + fn bytes_per_op() { + estimate_literal_size!( + LiteralType::Address, + LiteralType::Boolean, + LiteralType::Field, + LiteralType::Group, + LiteralType::I8, + LiteralType::I16, + LiteralType::I32, + LiteralType::I64, + LiteralType::I128, + LiteralType::Scalar, + LiteralType::Signature, + LiteralType::U8, + LiteralType::U16, + LiteralType::U32, + LiteralType::U64, + LiteralType::U128 + ); + let process = Process::::load().unwrap(); + let stack = process.get_stack("credits.aleo").unwrap(); + let stack = (*stack.clone()).clone(); + + let primitive_types = [ + "u8", + "u16", + "u32", + "u64", + "u128", + "i8", + "i16", + "i32", + "i64", + "i128", + "scalar", + "field", + "group", + "signature", + "address", + "boolean", + ]; + let lengths = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]; + let depths = [0usize, 1usize, 2usize, 3usize]; + + fn create_array(base_type: &str, length: usize, depth: usize) -> (String, String) { + let array = match depth { + 0 => format!("{}", base_type), + 1 => format!("[{}; {}u32]", base_type, length), + 2 => format!("[[{}; {}u32]; {}u32]", base_type, length, length), + 3 => format!("[[[{}; {}u32]; {}u32]; {}u32]", base_type, length, length, length), + _ => panic!("Unsupported depth"), + }; + (array, format!("Array_{}_length_{}_depth_{}", base_type, length, depth)) + } + + let mut complex_type_sizes = vec![]; + for primitive in primitive_types { + for depth in depths.into_iter() { + for length in lengths { + let (complex_type, type_name) = create_array(primitive, length, depth); + let plaintext_type = PlaintextType::from_str(&complex_type).unwrap(); + let type_and_cost = ( + complex_type, + type_name, + plaintext_size_in_bytes::(&stack, &plaintext_type).unwrap(), + ); + complex_type_sizes.push(type_and_cost); + } + } + } + let mut file = std::fs::File::create("revised_complex_type_sizes.txt").unwrap(); + for (complex_type, type_name, size) in complex_type_sizes { + writeln!(file, "{},{},{}", complex_type, type_name, size).unwrap(); + } + } #[test] fn test_credits_finalize_costs() { @@ -302,63 +489,74 @@ mod tests { // Function: `bond_public` let function = program.get_function(&Identifier::from_str("bond_public").unwrap()).unwrap(); let finalize_cost = cost_in_microcredits(stack, function.finalize_logic().unwrap()).unwrap(); - assert_eq!(602500, finalize_cost); + println!("bond_public cost: {}", finalize_cost); + // assert_eq!(545000, finalize_cost); // Function: `unbond_public` let function = program.get_function(&Identifier::from_str("unbond_public").unwrap()).unwrap(); let finalize_cost = cost_in_microcredits(stack, function.finalize_logic().unwrap()).unwrap(); - assert_eq!(897500, finalize_cost); + println!("unbond_public cost: {}", finalize_cost); + // assert_eq!(840000, finalize_cost); // Function: `unbond_delegator_as_validator` let function = program.get_function(&Identifier::from_str("unbond_delegator_as_validator").unwrap()).unwrap(); let finalize_cost = cost_in_microcredits(stack, function.finalize_logic().unwrap()).unwrap(); - assert_eq!(237500, finalize_cost); + println!("unbond_delegator_as_validator cost: {}", finalize_cost); + // assert_eq!(237500, finalize_cost); // Function `claim_unbond_public` let function = program.get_function(&Identifier::from_str("claim_unbond_public").unwrap()).unwrap(); let finalize_cost = cost_in_microcredits(stack, function.finalize_logic().unwrap()).unwrap(); - assert_eq!(106000, finalize_cost); + println!("claim_unbond_public cost: {}", finalize_cost); + // assert_eq!(106000, finalize_cost); // Function `set_validator_state` let function = program.get_function(&Identifier::from_str("set_validator_state").unwrap()).unwrap(); let finalize_cost = cost_in_microcredits(stack, function.finalize_logic().unwrap()).unwrap(); - assert_eq!(84000, finalize_cost); + println!("set_validator_state cost: {}", finalize_cost); + // assert_eq!(84000, finalize_cost); // Function: `transfer_public` let function = program.get_function(&Identifier::from_str("transfer_public").unwrap()).unwrap(); let finalize_cost = cost_in_microcredits(stack, function.finalize_logic().unwrap()).unwrap(); - assert_eq!(142000, finalize_cost); + println!("transfer_public cost: {}", finalize_cost); + // assert_eq!(142000, finalize_cost); // Function: `transfer_private` let function = program.get_function(&Identifier::from_str("transfer_private").unwrap()).unwrap(); - assert!(function.finalize_logic().is_none()); + // let finalize_cost = cost_in_microcredits(stack, function.finalize_logic().unwrap()).unwrap(); + // assert!(function.finalize_logic().is_none()); // Function: `transfer_private_to_public` let function = program.get_function(&Identifier::from_str("transfer_private_to_public").unwrap()).unwrap(); let finalize_cost = cost_in_microcredits(stack, function.finalize_logic().unwrap()).unwrap(); - assert_eq!(67000, finalize_cost); + println!("transfer_private_to_public cost: {}", finalize_cost); + // assert_eq!(67000, finalize_cost); // Function: `transfer_public_to_private` let function = program.get_function(&Identifier::from_str("transfer_public_to_private").unwrap()).unwrap(); let finalize_cost = cost_in_microcredits(stack, function.finalize_logic().unwrap()).unwrap(); - assert_eq!(75000, finalize_cost); + println!("transfer_public_to_private cost: {}", finalize_cost); + // assert_eq!(75000, finalize_cost); // Function: `join` let function = program.get_function(&Identifier::from_str("join").unwrap()).unwrap(); - assert!(function.finalize_logic().is_none()); + // println!("join cost: {}", cost_in_microcredits(stack, function.finalize_logic().unwrap()).unwrap()); + // assert!(function.finalize_logic().is_none()); // Function: `split` let function = program.get_function(&Identifier::from_str("split").unwrap()).unwrap(); - assert!(function.finalize_logic().is_none()); + // assert!(function.finalize_logic().is_none()); // Function: `fee_private` - let function = program.get_function(&Identifier::from_str("fee_private").unwrap()).unwrap(); - assert!(function.finalize_logic().is_none()); + // let function = program.get_function(&Identifier::from_str("fee_private").unwrap()).unwrap(); + // assert!(function.finalize_logic().is_none()); // Function: `fee_public` let function = program.get_function(&Identifier::from_str("fee_public").unwrap()).unwrap(); let finalize_cost = cost_in_microcredits(stack, function.finalize_logic().unwrap()).unwrap(); - assert_eq!(75000, finalize_cost); + println!("fee_public cost: {}", finalize_cost); + // assert_eq!(75000, finalize_cost); } #[test] From 44aa6856a0a2b8c9c35250faeba1983efc6bc1dc Mon Sep 17 00:00:00 2001 From: Michael Turner Date: Mon, 8 Jan 2024 13:05:47 -0500 Subject: [PATCH 094/298] Add account for costs for Field & Scalar inputs for specific opcodes --- synthesizer/src/vm/helpers/cost.rs | 370 +++++++++++++---------------- 1 file changed, 167 insertions(+), 203 deletions(-) diff --git a/synthesizer/src/vm/helpers/cost.rs b/synthesizer/src/vm/helpers/cost.rs index 5e35188c92..d12690dd5d 100644 --- a/synthesizer/src/vm/helpers/cost.rs +++ b/synthesizer/src/vm/helpers/cost.rs @@ -22,23 +22,25 @@ use console::{ }; use ledger_block::{Deployment, Execution}; use ledger_store::ConsensusStorage; -use synthesizer_program::{Command, Finalize, Instruction, Operand, StackProgram}; +use synthesizer_program::{CastType, Command, Finalize, Instruction, Operand, StackProgram}; use std::collections::HashMap; // Base finalize costs for compute heavy operations. +const CAST_COMMAND_BASE_COST: u64 = 500; +const GET_COMMAND_BASE_COST: u64 = 10_000; +const HASH_BASE_COST: u64 = 10_000; const HASH_BHP_BASE_COST: u64 = 50_000; const HASH_PSD_BASE_COST: u64 = 40_000; -const HASH_BASE_COST: u64 = 10_000; const SET_COMMAND_BASE_COST: u64 = 10_000; -const GET_COMMAND_BASE_COST: u64 = 10_000; // Finalize cost per byte for compute heavy operations. +const CAST_PER_BYTE_COST: u64 = 30; +const GET_COMMAND_PER_BYTE_COST: u64 = 10; const HASH_BHP_PER_BYTE_COST: u64 = 300; +const HASH_PER_BYTE_COST: u64 = 30; const HASH_PSD_PER_BYTE_COST: u64 = 75; const SET_COMMAND_PER_BYTE_COST: u64 = 100; -const GET_COMMAND_PER_BYTE_COST: u64 = 10; -const HASH_PER_BYTE_COST: u64 = 30; /// Returns the *minimum* cost in microcredits to publish the given deployment (total cost, (storage cost, namespace cost)). pub fn deployment_cost(deployment: &Deployment) -> Result<(u64, (u64, u64))> { @@ -150,8 +152,26 @@ pub fn cost_in_microcredits(stack: &Stack, finalize: &Finalize Command::Instruction(Instruction::AssertNeq(_)) => Ok(500), Command::Instruction(Instruction::Async(_)) => bail!("`async` is not supported in finalize."), Command::Instruction(Instruction::Call(_)) => bail!("`call` is not supported in finalize."), - Command::Instruction(Instruction::Cast(_)) => Ok(500), - Command::Instruction(Instruction::CastLossy(_)) => Ok(500), + Command::Instruction(Instruction::Cast(cast)) => { + let cast_type = cast.cast_type(); + match cast_type { + CastType::Plaintext(PlaintextType::Literal(_)) => Ok(500), + CastType::Plaintext(plaintext_type) => Ok(plaintext_size_in_bytes(stack, plaintext_type)? + .saturating_mul(CAST_PER_BYTE_COST) + .saturating_add(CAST_COMMAND_BASE_COST)), + _ => Ok(500), + } + } + Command::Instruction(Instruction::CastLossy(cast_lossy)) => { + let cast_type = cast_lossy.cast_type(); + match cast_type { + CastType::Plaintext(PlaintextType::Literal(_)) => Ok(500), + CastType::Plaintext(plaintext_type) => Ok(plaintext_size_in_bytes(stack, plaintext_type)? + .saturating_mul(CAST_PER_BYTE_COST) + .saturating_add(CAST_COMMAND_BASE_COST)), + _ => Ok(500), + } + } Command::Instruction(Instruction::CommitBHP256(commit)) => { size_cost(commit.operands(), HASH_BHP_PER_BYTE_COST, HASH_BHP_BASE_COST) } @@ -170,7 +190,21 @@ pub fn cost_in_microcredits(stack: &Stack, finalize: &Finalize Command::Instruction(Instruction::CommitPED128(commit)) => { size_cost(commit.operands(), HASH_PER_BYTE_COST, HASH_BHP_BASE_COST) } - Command::Instruction(Instruction::Div(_)) => Ok(1_000), + Command::Instruction(Instruction::Div(div)) => { + let operands = div.operands(); + if operands.len() == 2 { + let operand_type = finalize_types.get_type_from_operand(stack, &operands[0])?; + match operand_type { + FinalizeType::Plaintext(PlaintextType::Literal(LiteralType::Field)) => Ok(1_500), + FinalizeType::Plaintext(PlaintextType::Literal(_)) => Ok(500), + FinalizeType::Plaintext(PlaintextType::Array(_)) => bail!("div opcode does not support arrays."), + FinalizeType::Plaintext(PlaintextType::Struct(_)) => bail!("div opcode does not support structs."), + _ => bail!("div opcode does not support futures."), + } + } else { + bail!("div opcode must have exactly two operands."); + } + } Command::Instruction(Instruction::DivWrapped(_)) => Ok(500), Command::Instruction(Instruction::Double(_)) => Ok(500), Command::Instruction(Instruction::GreaterThan(_)) => Ok(500), @@ -229,36 +263,53 @@ pub fn cost_in_microcredits(stack: &Stack, finalize: &Finalize Command::Instruction(Instruction::HashManyPSD8(_)) => { bail!("`hash_many.psd8` is not supported in finalize.") } - Command::Instruction(Instruction::Inv(_)) => Ok(1000), + Command::Instruction(Instruction::Inv(_)) => Ok(1_000), Command::Instruction(Instruction::IsEq(_)) => Ok(500), Command::Instruction(Instruction::IsNeq(_)) => Ok(500), Command::Instruction(Instruction::LessThan(_)) => Ok(500), Command::Instruction(Instruction::LessThanOrEqual(_)) => Ok(500), Command::Instruction(Instruction::Modulo(_)) => Ok(500), - Command::Instruction(Instruction::Mul(mul)) => mul.operands().iter().try_fold(500, |acc, operand| { - let finalize_type = finalize_types.get_type_from_operand(stack, operand)?; - let cost = match finalize_type { - FinalizeType::Plaintext(plaintext) => match plaintext { - PlaintextType::Literal(LiteralType::Group) => acc + 5_000, - PlaintextType::Literal(LiteralType::Scalar) => acc + 5_000, - PlaintextType::Literal(_) => acc, - _ => bail!("multiplication of structs or arrays is not supported."), - }, - _ => bail!("multiplication of non-plaintext finalize types is not supported."), - }; - Ok(cost) - }), + Command::Instruction(Instruction::Mul(mul)) => { + let operands = mul.operands(); + if operands.len() == 2 { + let operand_type = finalize_types.get_type_from_operand(stack, &operands[0])?; + match operand_type { + FinalizeType::Plaintext(PlaintextType::Literal(LiteralType::Group)) => Ok(10_000), + FinalizeType::Plaintext(PlaintextType::Literal(LiteralType::Scalar)) => Ok(10_000), + FinalizeType::Plaintext(PlaintextType::Literal(_)) => Ok(500), + FinalizeType::Plaintext(PlaintextType::Array(_)) => bail!("mul opcode does not support arrays."), + FinalizeType::Plaintext(PlaintextType::Struct(_)) => bail!("mul opcode does not support structs."), + _ => bail!("mul opcode does not support futures."), + } + } else { + bail!("pow opcode must have at exactly 2 operands."); + } + } Command::Instruction(Instruction::MulWrapped(_)) => Ok(500), Command::Instruction(Instruction::Nand(_)) => Ok(500), Command::Instruction(Instruction::Neg(_)) => Ok(500), Command::Instruction(Instruction::Nor(_)) => Ok(500), Command::Instruction(Instruction::Not(_)) => Ok(500), Command::Instruction(Instruction::Or(_)) => Ok(500), - Command::Instruction(Instruction::Pow(_)) => Ok(1_000), + Command::Instruction(Instruction::Pow(pow)) => { + let operands = pow.operands(); + if operands.is_empty() { + bail!("pow opcode must have at least one operand."); + } else { + let operand_type = finalize_types.get_type_from_operand(stack, &operands[0])?; + match operand_type { + FinalizeType::Plaintext(PlaintextType::Literal(LiteralType::Field)) => Ok(1_500), + FinalizeType::Plaintext(PlaintextType::Literal(_)) => Ok(500), + FinalizeType::Plaintext(PlaintextType::Array(_)) => bail!("pow opcode does not support arrays."), + FinalizeType::Plaintext(PlaintextType::Struct(_)) => bail!("pow opcode does not support structs."), + _ => bail!("pow opcode does not support futures."), + } + } + } Command::Instruction(Instruction::PowWrapped(_)) => Ok(500), Command::Instruction(Instruction::Rem(_)) => Ok(500), Command::Instruction(Instruction::RemWrapped(_)) => Ok(500), - Command::Instruction(Instruction::SignVerify(_)) => Ok(2_500), + Command::Instruction(Instruction::SignVerify(_)) => Ok(HASH_PSD_BASE_COST), Command::Instruction(Instruction::Shl(_)) => Ok(500), Command::Instruction(Instruction::ShlWrapped(_)) => Ok(500), Command::Instruction(Instruction::Shr(_)) => Ok(500), @@ -326,157 +377,15 @@ fn plaintext_size_in_bytes(stack: &Stack, plaintext_type: &Plaint } } -#[macro_export] -macro_rules! estimate_literal_size { - ($($variant:expr),*) => {{ - let mut literal_sizes = vec![]; - $( - let type_and_cost = ($variant.type_name(), $variant.size_in_bytes::()); - literal_sizes.push(type_and_cost); - )* - let mut file = std::fs::File::create("literal_sizes.txt").unwrap(); - for (text, size) in literal_sizes { - writeln!(file, "{},{}", text, size).unwrap(); - } - }}; -} - #[cfg(test)] mod tests { use super::*; use crate::{vm::test_helpers::CurrentNetwork, Process, Program}; use circuit::network::AleoV0; - use console::program::{Identifier, ProgramID}; - - #[test] - fn byte_combinations() { - use itertools::Itertools; - use std::{ - fs::File, - io::{BufWriter, Write}, - }; - let csv_data = " - address, Address,32 - boolean, Boolean,1 - field, Field,32 - group, Group,32 - i8, I8,1 - i16, I16,2 - i32, I32,4 - i64, I64,8 - i128, I128,16 - scalar, Scalar,32 - u8, U8,1 - u16, U16,2 - u32, U32,4 - u64, U64,8 - u128, U128,16"; - - let mut types = Vec::new(); - - for line in csv_data.trim().lines() { - let parts: Vec<&str> = line.split(',').map(|s| s.trim()).collect(); - if parts.len() == 3 { - if let Ok(size) = parts[2].parse::() { - types.push((parts[0], parts[1], size)); - } - } - } - - let file = File::create("primitive_combos.txt").unwrap(); - let mut writer = BufWriter::new(file); - - let binary_combinations = types.iter().combinations(2); - let ternary_combinations = types.iter().combinations(3); - - for comb in binary_combinations.chain(ternary_combinations) { - let codes: Vec<&str> = comb.iter().map(|&(code, _, _)| *code).collect(); - let names: Vec<&str> = comb.iter().map(|&(_, name, _)| *name).collect(); - let total_size: i32 = comb.iter().map(|&(_, _, size)| size).sum(); - - writeln!(writer, "{}, {}, {}", codes.join("_"), names.join("_"), total_size).unwrap(); - } - } + use console::program::Identifier; #[test] - fn bytes_per_op() { - estimate_literal_size!( - LiteralType::Address, - LiteralType::Boolean, - LiteralType::Field, - LiteralType::Group, - LiteralType::I8, - LiteralType::I16, - LiteralType::I32, - LiteralType::I64, - LiteralType::I128, - LiteralType::Scalar, - LiteralType::Signature, - LiteralType::U8, - LiteralType::U16, - LiteralType::U32, - LiteralType::U64, - LiteralType::U128 - ); - let process = Process::::load().unwrap(); - let stack = process.get_stack("credits.aleo").unwrap(); - let stack = (*stack.clone()).clone(); - - let primitive_types = [ - "u8", - "u16", - "u32", - "u64", - "u128", - "i8", - "i16", - "i32", - "i64", - "i128", - "scalar", - "field", - "group", - "signature", - "address", - "boolean", - ]; - let lengths = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]; - let depths = [0usize, 1usize, 2usize, 3usize]; - - fn create_array(base_type: &str, length: usize, depth: usize) -> (String, String) { - let array = match depth { - 0 => format!("{}", base_type), - 1 => format!("[{}; {}u32]", base_type, length), - 2 => format!("[[{}; {}u32]; {}u32]", base_type, length, length), - 3 => format!("[[[{}; {}u32]; {}u32]; {}u32]", base_type, length, length, length), - _ => panic!("Unsupported depth"), - }; - (array, format!("Array_{}_length_{}_depth_{}", base_type, length, depth)) - } - - let mut complex_type_sizes = vec![]; - for primitive in primitive_types { - for depth in depths.into_iter() { - for length in lengths { - let (complex_type, type_name) = create_array(primitive, length, depth); - let plaintext_type = PlaintextType::from_str(&complex_type).unwrap(); - let type_and_cost = ( - complex_type, - type_name, - plaintext_size_in_bytes::(&stack, &plaintext_type).unwrap(), - ); - complex_type_sizes.push(type_and_cost); - } - } - } - let mut file = std::fs::File::create("revised_complex_type_sizes.txt").unwrap(); - for (complex_type, type_name, size) in complex_type_sizes { - writeln!(file, "{},{},{}", complex_type, type_name, size).unwrap(); - } - } - - #[test] - fn test_credits_finalize_costs() { + fn test_finalize_costs_credits() { // Get the credits.aleo program. let program = Program::::credits().unwrap(); @@ -489,74 +398,72 @@ mod tests { // Function: `bond_public` let function = program.get_function(&Identifier::from_str("bond_public").unwrap()).unwrap(); let finalize_cost = cost_in_microcredits(stack, function.finalize_logic().unwrap()).unwrap(); - println!("bond_public cost: {}", finalize_cost); - // assert_eq!(545000, finalize_cost); + println!("bond_public finalize cost: {}", finalize_cost); + assert_eq!(198550, finalize_cost); // Function: `unbond_public` let function = program.get_function(&Identifier::from_str("unbond_public").unwrap()).unwrap(); let finalize_cost = cost_in_microcredits(stack, function.finalize_logic().unwrap()).unwrap(); - println!("unbond_public cost: {}", finalize_cost); - // assert_eq!(840000, finalize_cost); + println!("unbond_public finalize cost: {}", finalize_cost); + assert_eq!(277880, finalize_cost); // Function: `unbond_delegator_as_validator` let function = program.get_function(&Identifier::from_str("unbond_delegator_as_validator").unwrap()).unwrap(); let finalize_cost = cost_in_microcredits(stack, function.finalize_logic().unwrap()).unwrap(); - println!("unbond_delegator_as_validator cost: {}", finalize_cost); - // assert_eq!(237500, finalize_cost); + println!("unbond_delegator_as_validator finalize cost: {}", finalize_cost); + assert_eq!(92310, finalize_cost); // Function `claim_unbond_public` let function = program.get_function(&Identifier::from_str("claim_unbond_public").unwrap()).unwrap(); let finalize_cost = cost_in_microcredits(stack, function.finalize_logic().unwrap()).unwrap(); - println!("claim_unbond_public cost: {}", finalize_cost); - // assert_eq!(106000, finalize_cost); + println!("claim_unbond_public finalize cost: {}", finalize_cost); + assert_eq!(49020, finalize_cost); // Function `set_validator_state` let function = program.get_function(&Identifier::from_str("set_validator_state").unwrap()).unwrap(); let finalize_cost = cost_in_microcredits(stack, function.finalize_logic().unwrap()).unwrap(); - println!("set_validator_state cost: {}", finalize_cost); - // assert_eq!(84000, finalize_cost); + println!("set_validator_state finalize cost: {}", finalize_cost); + assert_eq!(27270, finalize_cost); // Function: `transfer_public` let function = program.get_function(&Identifier::from_str("transfer_public").unwrap()).unwrap(); let finalize_cost = cost_in_microcredits(stack, function.finalize_logic().unwrap()).unwrap(); - println!("transfer_public cost: {}", finalize_cost); - // assert_eq!(142000, finalize_cost); + println!("transfer_public finalize cost: {}", finalize_cost); + assert_eq!(52520, finalize_cost); // Function: `transfer_private` let function = program.get_function(&Identifier::from_str("transfer_private").unwrap()).unwrap(); - // let finalize_cost = cost_in_microcredits(stack, function.finalize_logic().unwrap()).unwrap(); - // assert!(function.finalize_logic().is_none()); + assert!(function.finalize_logic().is_none()); // Function: `transfer_private_to_public` let function = program.get_function(&Identifier::from_str("transfer_private_to_public").unwrap()).unwrap(); let finalize_cost = cost_in_microcredits(stack, function.finalize_logic().unwrap()).unwrap(); - println!("transfer_private_to_public cost: {}", finalize_cost); - // assert_eq!(67000, finalize_cost); + println!("transfer_private_to_public finalize cost: {}", finalize_cost); + assert_eq!(27700, finalize_cost); // Function: `transfer_public_to_private` let function = program.get_function(&Identifier::from_str("transfer_public_to_private").unwrap()).unwrap(); let finalize_cost = cost_in_microcredits(stack, function.finalize_logic().unwrap()).unwrap(); - println!("transfer_public_to_private cost: {}", finalize_cost); - // assert_eq!(75000, finalize_cost); + println!("transfer_public_to_private finalize cost: {}", finalize_cost); + assert_eq!(24820, finalize_cost); // Function: `join` let function = program.get_function(&Identifier::from_str("join").unwrap()).unwrap(); - // println!("join cost: {}", cost_in_microcredits(stack, function.finalize_logic().unwrap()).unwrap()); - // assert!(function.finalize_logic().is_none()); + assert!(function.finalize_logic().is_none()); // Function: `split` let function = program.get_function(&Identifier::from_str("split").unwrap()).unwrap(); - // assert!(function.finalize_logic().is_none()); + assert!(function.finalize_logic().is_none()); // Function: `fee_private` - // let function = program.get_function(&Identifier::from_str("fee_private").unwrap()).unwrap(); - // assert!(function.finalize_logic().is_none()); + let function = program.get_function(&Identifier::from_str("fee_private").unwrap()).unwrap(); + assert!(function.finalize_logic().is_none()); // Function: `fee_public` let function = program.get_function(&Identifier::from_str("fee_public").unwrap()).unwrap(); let finalize_cost = cost_in_microcredits(stack, function.finalize_logic().unwrap()).unwrap(); - println!("fee_public cost: {}", finalize_cost); - // assert_eq!(75000, finalize_cost); + println!("fee_public finalize cost: {}", finalize_cost); + assert_eq!(24820, finalize_cost); } #[test] @@ -650,22 +557,26 @@ finalize store_xlarge: // Function: `store_small` let function = program.get_function(&Identifier::from_str("store_small").unwrap()).unwrap(); let finalize_cost = cost_in_microcredits(stack, function.finalize_logic().unwrap()).unwrap(); - assert_eq!(38000, finalize_cost); + println!("store_small struct finalize cost: {}", finalize_cost); + assert_eq!(13800, finalize_cost); // Function: `store_medium` let function = program.get_function(&Identifier::from_str("store_medium").unwrap()).unwrap(); let finalize_cost = cost_in_microcredits(stack, function.finalize_logic().unwrap()).unwrap(); - assert_eq!(105000, finalize_cost); + println!("store_medium struct finalize cost: {}", finalize_cost); + assert_eq!(20500, finalize_cost); // Function: `store_large` let function = program.get_function(&Identifier::from_str("store_large").unwrap()).unwrap(); let finalize_cost = cost_in_microcredits(stack, function.finalize_logic().unwrap()).unwrap(); - assert_eq!(305000, finalize_cost); + println!("store_large struct finalize cost: {}", finalize_cost); + assert_eq!(40500, finalize_cost); // Function: `store_xlarge` let function = program.get_function(&Identifier::from_str("store_xlarge").unwrap()).unwrap(); let finalize_cost = cost_in_microcredits(stack, function.finalize_logic().unwrap()).unwrap(); - assert_eq!(906000, finalize_cost); + println!("store_xlarge struct finalize cost: {}", finalize_cost); + assert_eq!(100600, finalize_cost); } #[test] @@ -743,26 +654,30 @@ finalize store_xlarge: // Function: `store_small` let function = program.get_function(&Identifier::from_str("store_small").unwrap()).unwrap(); let finalize_cost = cost_in_microcredits(stack, function.finalize_logic().unwrap()).unwrap(); - assert_eq!(16000, finalize_cost); + println!("store_small array finalize cost: {}", finalize_cost); + assert_eq!(11600, finalize_cost); // Function: `store_medium` let function = program.get_function(&Identifier::from_str("store_medium").unwrap()).unwrap(); let finalize_cost = cost_in_microcredits(stack, function.finalize_logic().unwrap()).unwrap(); - assert_eq!(72000, finalize_cost); + println!("store_medium array finalize cost: {}", finalize_cost); + assert_eq!(17200, finalize_cost); // Function: `store_large` let function = program.get_function(&Identifier::from_str("store_large").unwrap()).unwrap(); let finalize_cost = cost_in_microcredits(stack, function.finalize_logic().unwrap()).unwrap(); - assert_eq!(520000, finalize_cost); + println!("store_large array finalize cost: {}", finalize_cost); + assert_eq!(62000, finalize_cost); // Function: `store_xlarge` let function = program.get_function(&Identifier::from_str("store_xlarge").unwrap()).unwrap(); let finalize_cost = cost_in_microcredits(stack, function.finalize_logic().unwrap()).unwrap(); - assert_eq!(4104000, finalize_cost); + println!("store_xlarge array finalize cost: {}", finalize_cost); + assert_eq!(420400, finalize_cost); } #[test] - fn test_finalize_costs_big_finalize() { + fn test_finalize_costs_heavy_set_usage() { let rng = &mut TestRng::default(); // Define a program @@ -829,6 +744,55 @@ finalize big_finalize: // Test the price of `big_finalize`. let function = program.get_function(&Identifier::from_str("big_finalize").unwrap()).unwrap(); let finalize_cost = cost_in_microcredits(stack, function.finalize_logic().unwrap()).unwrap(); - assert_eq!(524_607_000, finalize_cost); + println!("big_finalize cost: {}", finalize_cost); + assert_eq!(53_663_620, finalize_cost); + } + + #[test] + fn test_finalize_costs_bhp_hash() { + let rng = &mut TestRng::default(); + + // Define a program + let program_str = r" +program test_program.aleo; +function big_hash_finalize: + async big_hash_finalize into r0; + output r0 as test_program.aleo/big_hash_finalize.future; +finalize big_hash_finalize: + rand.chacha into r0 as u128; + cast 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 into r1 as [u8; 32u32]; + cast r1 r1 r1 r1 r1 r1 r1 r1 r1 r1 r1 r1 r1 r1 r1 r1 r1 r1 r1 r1 r1 r1 r1 r1 r1 r1 r1 r1 r1 r1 r1 r1 into r2 as [[u8; 32u32]; 32u32]; + cast r2 r2 r2 r2 r2 r2 r2 r2 into r3 as [[[u8; 32u32]; 32u32]; 8u32]; + hash.bhp256 r3 into r4 as field; + hash.bhp256 r3 into r5 as field; + hash.bhp256 r3 into r6 as field; + hash.bhp256 r3 into r7 as field; + hash.bhp256 r3 into r8 as field; + hash.bhp256 r3 into r9 as field; + hash.bhp256 r3 into r10 as field; + hash.bhp256 r3 into r11 as field; + hash.bhp256 r3 into r12 as field; + hash.bhp256 r3 into r13 as field; + hash.bhp256 r3 into r14 as field; + "; + + // Compile the program. + let program = Program::::from_str(program_str).unwrap(); + + // Load the process. + let mut process = Process::::load().unwrap(); + + // Deploy and load the program. + let deployment = process.deploy::(&program, rng).unwrap(); + process.load_deployment(&deployment).unwrap(); + + // Get the stack. + let stack = process.get_stack(program.id()).unwrap(); + + // Test the price of `big_hash_finalize`. + let function = program.get_function(&Identifier::from_str("big_hash_finalize").unwrap()).unwrap(); + let finalize_cost = cost_in_microcredits(stack, function.finalize_logic().unwrap()).unwrap(); + println!("big_hash_finalize cost: {}", finalize_cost); + assert_eq!(27_887_540, finalize_cost); } } From c4301737ac4e6ce74ebc49eee9eb92babb11536c Mon Sep 17 00:00:00 2001 From: Michael Turner Date: Mon, 8 Jan 2024 14:11:36 -0500 Subject: [PATCH 095/298] Remove old branch artifacts --- .../src/state_path/configuration/mod.rs | 6 +-- .../block/src/transactions/confirmed/mod.rs | 12 +---- ledger/block/src/transactions/merkle.rs | 30 ++++--------- ledger/block/src/transactions/mod.rs | 3 +- ledger/block/src/verify.rs | 1 - ledger/committee/src/lib.rs | 42 +----------------- ledger/narwhal/batch-header/src/lib.rs | 2 +- .../src/testnet3/resources/block.genesis | Bin 13728 -> 13728 bytes .../complex_finalization.out | 2 +- .../vm/execute_and_finalize/count_usages.out | 2 +- .../mapping_operations.out | 6 +-- .../vm/execute_and_finalize/public_wallet.out | 2 +- .../read_external_mapping.out | 4 +- .../vm/execute_and_finalize/test_rand.out | 2 +- 14 files changed, 22 insertions(+), 92 deletions(-) diff --git a/console/program/src/state_path/configuration/mod.rs b/console/program/src/state_path/configuration/mod.rs index 17cb02942d..b8ddef30cf 100644 --- a/console/program/src/state_path/configuration/mod.rs +++ b/console/program/src/state_path/configuration/mod.rs @@ -19,17 +19,13 @@ use snarkvm_console_network::BHPMerkleTree; pub const BLOCKS_DEPTH: u8 = 32; /// The depth of the Merkle tree for the block header. pub const HEADER_DEPTH: u8 = 3; -/// The depth of the Merkle tree for finalize operations in a transaction. -pub const FINALIZE_ID_DEPTH: u8 = TRANSACTION_DEPTH + 4; // '+ 4' is to support 16 finalize operations per transition. /// The depth of the Merkle tree for finalize operations in a block. -pub const FINALIZE_OPERATIONS_DEPTH: u8 = TRANSACTIONS_DEPTH; +pub const FINALIZE_OPERATIONS_DEPTH: u8 = 20; /// The depth of the Merkle tree for the ratifications in a block. pub const RATIFICATIONS_DEPTH: u8 = 16; /// The depth the Merkle tree for the subdag certificates in a block. pub const SUBDAG_CERTIFICATES_DEPTH: u8 = 16; /// The depth of the Merkle tree for transactions in a block. -/// Note: The technical limit is 2^16 - 1 transactions, to allow compatibility with the -/// finalize operations tree, which requires 1 leaf for the ratified finalize ID. pub const TRANSACTIONS_DEPTH: u8 = 16; /// The depth of the Merkle tree for the transaction. pub const TRANSACTION_DEPTH: u8 = 5; diff --git a/ledger/block/src/transactions/confirmed/mod.rs b/ledger/block/src/transactions/confirmed/mod.rs index c617c1b3f4..9d16b7915d 100644 --- a/ledger/block/src/transactions/confirmed/mod.rs +++ b/ledger/block/src/transactions/confirmed/mod.rs @@ -17,7 +17,7 @@ mod serialize; mod string; use crate::{rejected::Rejected, Transaction}; -use console::{network::prelude::*, program::FINALIZE_ID_DEPTH, types::Field}; +use console::{network::prelude::*, types::Field}; use synthesizer_program::FinalizeOperation; pub type NumFinalizeSize = u16; @@ -261,16 +261,6 @@ impl ConfirmedTransaction { } } - /// Returns the finalize ID, by computing the root of a (small) Merkle tree comprised of - /// the ordered finalize operations for the transaction. - pub fn to_finalize_id(&self) -> Result> { - // Prepare the leaves. - let leaves = self.finalize_operations().iter().map(ToBits::to_bits_le).collect::>(); - // Compute the finalize ID. - // Note: This call will ensure the number of finalize operations is within the size of the Merkle tree. - Ok(*N::merkle_tree_bhp::(&leaves)?.root()) - } - /// Returns the rejected ID, if the confirmed transaction is rejected. pub fn to_rejected_id(&self) -> Result>> { match self { diff --git a/ledger/block/src/transactions/merkle.rs b/ledger/block/src/transactions/merkle.rs index 7f666f4ff5..4efc914ba5 100644 --- a/ledger/block/src/transactions/merkle.rs +++ b/ledger/block/src/transactions/merkle.rs @@ -17,23 +17,13 @@ use super::*; impl Transactions { /// Returns the finalize root of the transactions. pub fn to_finalize_root(&self, ratified_finalize_operations: Vec>) -> Result> { - // Prepare the ratified finalize ID - a Merkle tree composed of the ratified finalize operations. - let ratified_finalize_id = *N::merkle_tree_bhp::( - &ratified_finalize_operations.iter().map(ToBits::to_bits_le).collect::>(), - )? - .root(); - - // Prepare the leaves, composed of: - // | transaction_0 finalize ID, ..., transaction_n finalize ID | ratified finalize ID | - let leaves = self - .iter() - .map(|tx| tx.to_finalize_id().map(|id| id.to_bits_le())) - .chain(std::iter::once(Ok(ratified_finalize_id.to_bits_le()))) - .collect::>>()?; - - // Compute the finalize root. - // Note: This call will ensure the number of finalize operations is within the size of the Merkle tree. - Ok(*N::merkle_tree_bhp::(&leaves)?.root()) + // Prepare the leaves. + let leaves = self.finalize_operations().chain(&ratified_finalize_operations).map(ToBits::to_bits_le); + // Compute the finalize tree. + // Note: This call will check the number of finalize operations is within the size of the Merkle tree. + let tree = N::merkle_tree_bhp::(&leaves.collect::>())?; + // Return the finalize root. + Ok(*tree.root()) } } @@ -84,10 +74,6 @@ mod tests { #[test] fn test_transactions_depth() { // Ensure the log2 relationship between depth and the maximum number of transactions. - // Note: This test uses 'checked_sub' to ensure the depth is not zero. - assert_eq!( - 2usize.pow(TRANSACTIONS_DEPTH as u32).checked_sub(1).expect("Invalid depth"), - Transactions::::MAX_TRANSACTIONS - ); + assert_eq!(2usize.pow(TRANSACTIONS_DEPTH as u32), Transactions::::MAX_TRANSACTIONS); } } diff --git a/ledger/block/src/transactions/mod.rs b/ledger/block/src/transactions/mod.rs index 6d10a510f1..2eb3a31372 100644 --- a/ledger/block/src/transactions/mod.rs +++ b/ledger/block/src/transactions/mod.rs @@ -32,7 +32,6 @@ use console::{ Record, TransactionsPath, TransactionsTree, - FINALIZE_ID_DEPTH, FINALIZE_OPERATIONS_DEPTH, TRANSACTIONS_DEPTH, }, @@ -168,7 +167,7 @@ impl Transactions { impl Transactions { /// The maximum number of transactions allowed in a block. - pub const MAX_TRANSACTIONS: usize = usize::pow(2, TRANSACTIONS_DEPTH as u32).saturating_sub(1); + pub const MAX_TRANSACTIONS: usize = usize::pow(2, TRANSACTIONS_DEPTH as u32); /// Returns an iterator over all transactions, for all transactions in `self`. pub fn iter(&self) -> impl '_ + ExactSizeIterator> { diff --git a/ledger/block/src/verify.rs b/ledger/block/src/verify.rs index 22931ef5e0..6a278897b9 100644 --- a/ledger/block/src/verify.rs +++ b/ledger/block/src/verify.rs @@ -137,7 +137,6 @@ impl Block { previous_height: u32, current_committee: &Committee, ) -> Result<(u64, u32, i64)> { - // Note: Do not remove this. This ensures that all blocks after genesis are quorum blocks. #[cfg(not(any(test, feature = "test")))] ensure!(self.authority.is_quorum(), "The next block must be a quorum block"); diff --git a/ledger/committee/src/lib.rs b/ledger/committee/src/lib.rs index c43616e690..9ba7843dcd 100644 --- a/ledger/committee/src/lib.rs +++ b/ledger/committee/src/lib.rs @@ -201,8 +201,7 @@ impl Committee { /// Note: This ensures the method returns a deterministic result that is SNARK-friendly. fn sorted_members(&self) -> indexmap::map::IntoIter, (u64, bool)> { let members = self.members.clone(); - // Note: The use of 'sorted_unstable_by' is safe here because the addresses are guaranteed to be unique. - members.sorted_unstable_by(|address1, (stake1, _), address2, (stake2, _)| { + members.sorted_unstable_by(|address1, stake1, address2, stake2| { // Sort by stake in decreasing order. let cmp = stake2.cmp(stake1); // If the stakes are equal, sort by x-coordinate in decreasing order. @@ -286,23 +285,6 @@ pub mod test_helpers { Committee::::new(round, committee_members).unwrap() } - /// Samples a committee where all validators have the same stake. - pub fn sample_committee_equal_stake_committee(num_members: u16, rng: &mut TestRng) -> Committee { - assert!(num_members >= 4); - // Sample the members. - let mut members = IndexMap::new(); - // Add in the minimum and maximum staked nodes. - members.insert(Address::::new(rng.gen()), (MIN_VALIDATOR_STAKE, false)); - while members.len() < num_members as usize - 1 { - let stake = MIN_VALIDATOR_STAKE as f64; - let is_open = rng.gen(); - #[allow(clippy::cast_possible_truncation)] - members.insert(Address::::new(rng.gen()), (stake as u64, is_open)); - } - // Return the committee. - Committee::::new(1, members).unwrap() - } - /// Samples a random committee. #[allow(clippy::cast_possible_truncation)] pub fn sample_committee_custom(num_members: u16, rng: &mut TestRng) -> Committee { @@ -428,28 +410,6 @@ mod tests { } } - #[test] - fn test_sorted_members_with_equal_stake() { - // Initialize the RNG. - let rng = &mut TestRng::default(); - // Sample a committee. - let committee = crate::test_helpers::sample_committee_equal_stake_committee(200, rng); - // Start a timer. - let timer = std::time::Instant::now(); - // Sort the members. - let sorted_members = committee.sorted_members().collect::>(); - println!("sorted_members: {}ms", timer.elapsed().as_millis()); - // Check that the members are sorted based on our sorting criteria. - for i in 0..sorted_members.len() - 1 { - let (address1, (stake1, _)) = sorted_members[i]; - let (address2, (stake2, _)) = sorted_members[i + 1]; - assert!(stake1 >= stake2); - if stake1 == stake2 { - assert!(address1.to_x_coordinate() > address2.to_x_coordinate()); - } - } - } - #[test] fn test_maximum_committee_size() { assert_eq!( diff --git a/ledger/narwhal/batch-header/src/lib.rs b/ledger/narwhal/batch-header/src/lib.rs index dd04e6c3ad..64f4bc7b30 100644 --- a/ledger/narwhal/batch-header/src/lib.rs +++ b/ledger/narwhal/batch-header/src/lib.rs @@ -60,7 +60,7 @@ impl BatchHeader { /// The maximum number of solutions in a batch. pub const MAX_SOLUTIONS: usize = N::MAX_SOLUTIONS; /// The maximum number of transactions in a batch. - pub const MAX_TRANSACTIONS: usize = usize::pow(2, console::program::TRANSACTIONS_DEPTH as u32).saturating_sub(1); + pub const MAX_TRANSACTIONS: usize = usize::pow(2, console::program::TRANSACTIONS_DEPTH as u32); /// The maximum number of transmissions in a batch. pub const MAX_TRANSMISSIONS: usize = Self::MAX_SOLUTIONS + Self::MAX_TRANSACTIONS; } diff --git a/parameters/src/testnet3/resources/block.genesis b/parameters/src/testnet3/resources/block.genesis index 86ecc70d467e739bf7694ff790f69ccbac41569a..c33b0398b64573fa23e04bacd903dfb75872c709 100644 GIT binary patch delta 11338 zcmY+~WmFv7x~So9+@W!IcMb0D8X&m4yLUry_uv*hNN{%x1eajJ2`<4MZdUf$=iF7l zYmBNnf4t+VuV#ULfjtEfaD|i8iu$%^^gNM03(+IL)|`%qH_7HhCKWE6QZa=}q7WCO zaP^y_ucdN_mHf>Zu!3z!6Tt+W*;)IM;93~SOHv9W{Qj9mN=f{9h2y=qA9^OcrP3J&7Jt`;}NP zP|*}eANEVhzqUTFDnZL~8qF#9vsK_H{?iM$JD){$4;i4fweQ6Y<70Xe*NPt!$Mg&@OGcsYrMvnYx||yh z;tv03>42%6ZDLZ*6e0~e`JeL&Qx-$7S-lDq&5|L8hr^W>&Hx~aqpi7{vw4a<2-&PY z5@Ac?+UNj2{iojeBl&BhkYBL^(yw(L^&hs}Ls>A&_cy@o*#-Wf6I>w_A*k0W#F2L= zda34imtt46g|Miwcn(gU+WV9427H|a1`9Xzv3yAs!I;3EF`(d>rR6mU_-CsbQZ_)` zVmhSI!KU_SVm7|>0?)UdDpn>fg7=jSjnJEG6cnx50B%C;S8dV5+qIY*)fM5=iI*$7 zAhTJxf}Bhjhmi9~xRhWfPB4iYPvm?|v+_f_eXWZZ{8%m7o_r%yyenb?zZu>=HSD-? z;K-EEg_^$Tl7@H!JrEdg-)};8RPd!`&GiD4Or3pU&KJxI3y7OM?-X)L9)jBR7LZ>oBatDXB)Efk)i#{a+OMdL<>B;3M+bmhbYxg|dYR(#UYJUr&DDbga>qy?snRpz7(`ig zHQobQnJAD`ud_ycNuvcX4(jYfWU6a$>(kTt?0C+VHKLURNK}bNTWTmv4>vY~g1I2U zL!M8rG2hlZ>sV5eulV3_>g=G71NdY+VF zbxr!Gfg4>EQlf;fZ>r9)c-fV!V3a*g!osl#%n~`EA->q;8FP7 z<-j}e>o$3=V5`G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?Ra@53SV;#6c=WJjyrZr?6K-AJ(W1=p}K-|9+5?7VZdf4ExeZiv)X{SmJIpS7Whh zap;iD1=jps+LSpdm1#63gc&M$#q1vf>{(IfEvG>`dO82Z1w zJAxFT(H)XM$GNTWjT(%=(v&)|rjXOb@eLPt)vS96InKnZHkfeh48C>*F=Ee?0ReUq zS!F+>y3{1>#_8`6wl_rV!OfyKi`-uC0AbtsG<$v_@~l3zvR2+y-?l>>K~NxUu0xtanD3=YL@put+o{ri(^6@h!5O)b*yh>ime5Ar|k`hWZf Bn+N~^ diff --git a/synthesizer/tests/expectations/vm/execute_and_finalize/complex_finalization.out b/synthesizer/tests/expectations/vm/execute_and_finalize/complex_finalization.out index 3d334c70e9..d413523f61 100644 --- a/synthesizer/tests/expectations/vm/execute_and_finalize/complex_finalization.out +++ b/synthesizer/tests/expectations/vm/execute_and_finalize/complex_finalization.out @@ -23,4 +23,4 @@ additional: - '{"type":"future","id":"6324349534667114127832388996854882573236888808429320919855235417654165379333field","value":"{\n program_id: three_program.aleo,\n function_name: e,\n arguments: [\n {\n program_id: two_program.aleo,\n function_name: b,\n arguments: [\n {\n program_id: zero_program.aleo,\n function_name: c,\n arguments: [\n aleo1kw4knandael9qcpxs6g36rr6h7dwvjz6q25ueah6zz9v57zjlvxsx5llq8\n ]\n },\n {\n program_id: one_program.aleo,\n function_name: d,\n arguments: [\n aleo1kw4knandael9qcpxs6g36rr6h7dwvjz6q25ueah6zz9v57zjlvxsx5llq8\n ]\n },\n aleo1kw4knandael9qcpxs6g36rr6h7dwvjz6q25ueah6zz9v57zjlvxsx5llq8\n ]\n },\n {\n program_id: one_program.aleo,\n function_name: d,\n arguments: [\n aleo1kw4knandael9qcpxs6g36rr6h7dwvjz6q25ueah6zz9v57zjlvxsx5llq8\n ]\n },\n {\n program_id: zero_program.aleo,\n function_name: c,\n arguments: [\n aleo1kw4knandael9qcpxs6g36rr6h7dwvjz6q25ueah6zz9v57zjlvxsx5llq8\n ]\n },\n aleo1kw4knandael9qcpxs6g36rr6h7dwvjz6q25ueah6zz9v57zjlvxsx5llq8\n ]\n}"}' credits.aleo/fee_public: outputs: - - '{"type":"future","id":"1003216346885695376870169458907160355062312400269389091484793100175598845653field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1kw4knandael9qcpxs6g36rr6h7dwvjz6q25ueah6zz9v57zjlvxsx5llq8,\n 712883u64\n ]\n}"}' + - '{"type":"future","id":"2642525527921148655203140665689909230400981948693155278410222306693462629362field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1kw4knandael9qcpxs6g36rr6h7dwvjz6q25ueah6zz9v57zjlvxsx5llq8,\n 1312883u64\n ]\n}"}' diff --git a/synthesizer/tests/expectations/vm/execute_and_finalize/count_usages.out b/synthesizer/tests/expectations/vm/execute_and_finalize/count_usages.out index 812dccf919..bc0c5af71d 100644 --- a/synthesizer/tests/expectations/vm/execute_and_finalize/count_usages.out +++ b/synthesizer/tests/expectations/vm/execute_and_finalize/count_usages.out @@ -20,4 +20,4 @@ additional: - '{"type":"future","id":"4663027849889985446453275863200868545411574358675486387787337708909316167962field","value":"{\n program_id: basic_math.aleo,\n function_name: sub_and_count,\n arguments: [\n aleo1mrughg5ssadd9fc2uwve7l6u24xn76kyz24zsjtzta03vgkq4vpqggl6fg\n ]\n}"}' credits.aleo/fee_public: outputs: - - '{"type":"future","id":"6985362900212603644551686892600867999486376242303585232041632704681627259499field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1kw4knandael9qcpxs6g36rr6h7dwvjz6q25ueah6zz9v57zjlvxsx5llq8,\n 143392u64\n ]\n}"}' + - '{"type":"future","id":"3084534457419184182612834880575828543753579447019853593724174249884664876235field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1kw4knandael9qcpxs6g36rr6h7dwvjz6q25ueah6zz9v57zjlvxsx5llq8,\n 263392u64\n ]\n}"}' diff --git a/synthesizer/tests/expectations/vm/execute_and_finalize/mapping_operations.out b/synthesizer/tests/expectations/vm/execute_and_finalize/mapping_operations.out index 0fed322828..6b2773e6cf 100644 --- a/synthesizer/tests/expectations/vm/execute_and_finalize/mapping_operations.out +++ b/synthesizer/tests/expectations/vm/execute_and_finalize/mapping_operations.out @@ -36,12 +36,12 @@ additional: - child_outputs: credits.aleo/fee_public: outputs: - - '{"type":"future","id":"5492905059437618366315175771112666246009652456224371187043657574203689511771field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1eakarna6a70pg9r0l9qal20faejwctgur5xt7lnc2a42wj2yssfqc89rk8,\n 56810u64\n ]\n}"}' + - '{"type":"future","id":"767852843394263062723803642109980847781175859546892255347263461730875281315field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1eakarna6a70pg9r0l9qal20faejwctgur5xt7lnc2a42wj2yssfqc89rk8,\n 154810u64\n ]\n}"}' - child_outputs: credits.aleo/fee_public: outputs: - - '{"type":"future","id":"1619381297841458647844879660108283659411957164827472701126495305911845966515field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1eakarna6a70pg9r0l9qal20faejwctgur5xt7lnc2a42wj2yssfqc89rk8,\n 56810u64\n ]\n}"}' + - '{"type":"future","id":"5831877738131393412656336446760308055442933218729238434398743654782252530700field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1eakarna6a70pg9r0l9qal20faejwctgur5xt7lnc2a42wj2yssfqc89rk8,\n 154810u64\n ]\n}"}' - child_outputs: credits.aleo/fee_public: outputs: - - '{"type":"future","id":"7570456544657971579817904744342961494960811049540321970948562312143091998181field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1eakarna6a70pg9r0l9qal20faejwctgur5xt7lnc2a42wj2yssfqc89rk8,\n 56810u64\n ]\n}"}' + - '{"type":"future","id":"3924911723698610328779426182874581891939297874519691347932588542992608923909field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1eakarna6a70pg9r0l9qal20faejwctgur5xt7lnc2a42wj2yssfqc89rk8,\n 154810u64\n ]\n}"}' diff --git a/synthesizer/tests/expectations/vm/execute_and_finalize/public_wallet.out b/synthesizer/tests/expectations/vm/execute_and_finalize/public_wallet.out index 2f27505a44..cbb7f2d77c 100644 --- a/synthesizer/tests/expectations/vm/execute_and_finalize/public_wallet.out +++ b/synthesizer/tests/expectations/vm/execute_and_finalize/public_wallet.out @@ -14,4 +14,4 @@ additional: - '{"type":"future","id":"2095235103073153862497986952383880687050623273703041876358116424903602929020field","value":"{\n program_id: token.aleo,\n function_name: mint_public,\n arguments: [\n aleo1sry3pke49ykrf0aeshf889tr98r4c86p5f4ms766795ssdwfdyqq9jdg0j,\n 10u64\n ]\n}"}' credits.aleo/fee_public: outputs: - - '{"type":"future","id":"752603519355388488344541941006084587989070851840045134266360370597355180437field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1d3e2je2m2hsxwdsvntvf4jnnlj459ywfry6ch2qwrpy6l6r6yvpq8e88h5,\n 71201u64\n ]\n}"}' + - '{"type":"future","id":"4373249435479943424484888940718424132561120812144078253060284512525421799293field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1d3e2je2m2hsxwdsvntvf4jnnlj459ywfry6ch2qwrpy6l6r6yvpq8e88h5,\n 131201u64\n ]\n}"}' diff --git a/synthesizer/tests/expectations/vm/execute_and_finalize/read_external_mapping.out b/synthesizer/tests/expectations/vm/execute_and_finalize/read_external_mapping.out index 83f288f724..a729b3163e 100644 --- a/synthesizer/tests/expectations/vm/execute_and_finalize/read_external_mapping.out +++ b/synthesizer/tests/expectations/vm/execute_and_finalize/read_external_mapping.out @@ -58,7 +58,7 @@ additional: - child_outputs: credits.aleo/fee_public: outputs: - - '{"type":"future","id":"4798782098680099470248294668059347661300087988012655978338556209977486754623field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1f6eg623knp66cwx0926w3plgdgzcmfpgyrzgnjz90mucgs3z7s9qls4upm,\n 34210u64\n ]\n}"}' + - '{"type":"future","id":"786151097471386478439918490898626420968604200995134718973623517242949574field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1f6eg623knp66cwx0926w3plgdgzcmfpgyrzgnjz90mucgs3z7s9qls4upm,\n 101210u64\n ]\n}"}' - child_outputs: credits.aleo/fee_public: outputs: @@ -66,7 +66,7 @@ additional: - child_outputs: credits.aleo/fee_public: outputs: - - '{"type":"future","id":"2726390131420083267342010856698473010970750552488908118155270428634427391060field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1f6eg623knp66cwx0926w3plgdgzcmfpgyrzgnjz90mucgs3z7s9qls4upm,\n 34214u64\n ]\n}"}' + - '{"type":"future","id":"5340444358291789813118792762028331134214990505407681376089964565359528622453field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1f6eg623knp66cwx0926w3plgdgzcmfpgyrzgnjz90mucgs3z7s9qls4upm,\n 101214u64\n ]\n}"}' - child_outputs: credits.aleo/fee_public: outputs: diff --git a/synthesizer/tests/expectations/vm/execute_and_finalize/test_rand.out b/synthesizer/tests/expectations/vm/execute_and_finalize/test_rand.out index b632f5d939..4fefc62cfd 100644 --- a/synthesizer/tests/expectations/vm/execute_and_finalize/test_rand.out +++ b/synthesizer/tests/expectations/vm/execute_and_finalize/test_rand.out @@ -19,7 +19,7 @@ outputs: test_rand.aleo/rand_chacha_check: outputs: - '{"type":"future","id":"3721325135151760660773959530505944451747681933722462808964783147996869797702field","value":"{\n program_id: test_rand.aleo,\n function_name: rand_chacha_check,\n arguments: [\n 0field,\n false\n ]\n}"}' - speculate: the execution was rejected + speculate: the execution was accepted add_next_block: succeeded. - verified: true execute: From de7f28b31c0f212120ef699e68ea6458e5173386 Mon Sep 17 00:00:00 2001 From: Eric McCarthy Date: Mon, 8 Jan 2024 11:46:33 -0800 Subject: [PATCH 096/298] [test] add tests for subgroup membership/nonmembership of small order curve points --- circuit/types/group/src/lib.rs | 50 ++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/circuit/types/group/src/lib.rs b/circuit/types/group/src/lib.rs index 0983de04df..f9dc155079 100644 --- a/circuit/types/group/src/lib.rs +++ b/circuit/types/group/src/lib.rs @@ -401,6 +401,56 @@ mod tests { #[test] fn test_is_in_group() { + type PrimitiveField = console::Field<::Network>; + + // First test the points that have low order. + + // The two halves of (0,1) in group arithmetic are (0,1) and (0,-1). + let minus1_string = "8444461749428370424248824938781546531375899335154063827935233455917409239040field"; + // The two halves of (0,-1) in group arithmetic are (q1x,0) and (q2x,0), + // where q1x = sqrt(-1) mod F_q and q2x = -sqrt(-1) mod F_q. + let q1x_string = "880904806456922042258150504921383618666682042621506879489field"; + let q2x_string = "8444461749428370423367920132324624489117748830232680209268551413295902359552field"; + + // (0,1) is in the large prime subgroup. + let y1: Field = Field::new(Mode::Public, PrimitiveField::from_str("1field").unwrap()); + let group0 = Group::::from_xy_coordinates_unchecked(Field::zero(),y1); + Circuit::scope("group0", || { + let group0_is_in_group = group0.is_in_group(); + assert!(group0_is_in_group.eject_value()); + assert_scope!(750, 0, 2253, 2253); + }); + Circuit::reset(); + + // The other three low order points are on the curve but not in the large prime subgroup. + // Make sure is_in_group returns false for these. + let minus1: Field = Field::new(Mode::Public, PrimitiveField::from_str(minus1_string).unwrap()); + let half0 = Group::::from_xy_coordinates_unchecked(Field::zero(),minus1); + Circuit::scope("half0", || { + let half0_is_not_in_group = !half0.is_in_group(); + assert!(half0_is_not_in_group.eject_value()); + assert_scope!(750, 0, 2253, 2253); + }); + Circuit::reset(); + + let q1x: Field = Field::new(Mode::Public, PrimitiveField::from_str(q1x_string).unwrap()); + let quarter1 = Group::::from_xy_coordinates_unchecked(q1x, Field::zero()); + Circuit::scope("quarter1", || { + let quarter1_is_not_in_group = !quarter1.is_in_group(); + assert!(quarter1_is_not_in_group.eject_value()); + assert_scope!(750, 0, 2253, 2253); + }); + Circuit::reset(); + + let q2x: Field = Field::new(Mode::Public, PrimitiveField::from_str(q2x_string).unwrap()); + let quarter2 = Group::::from_xy_coordinates_unchecked(q2x, Field::zero()); + Circuit::scope("quarter2", || { + let quarter2_is_not_in_group = !quarter2.is_in_group(); + assert!(quarter2_is_not_in_group.eject_value()); + assert_scope!(750, 0, 2253, 2253); + }); + Circuit::reset(); + fn check_is_in_group(mode: Mode, num_constants: u64, num_public: u64, num_private: u64, num_constraints: u64) { let mut rng = TestRng::default(); From 859528f43b1e16d33ce07cf93c0f54c78e54626e Mon Sep 17 00:00:00 2001 From: Eric McCarthy Date: Mon, 8 Jan 2024 12:01:16 -0800 Subject: [PATCH 097/298] [test] fmt fixups --- circuit/types/group/src/lib.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/circuit/types/group/src/lib.rs b/circuit/types/group/src/lib.rs index f9dc155079..a0f636b435 100644 --- a/circuit/types/group/src/lib.rs +++ b/circuit/types/group/src/lib.rs @@ -414,7 +414,7 @@ mod tests { // (0,1) is in the large prime subgroup. let y1: Field = Field::new(Mode::Public, PrimitiveField::from_str("1field").unwrap()); - let group0 = Group::::from_xy_coordinates_unchecked(Field::zero(),y1); + let group0 = Group::::from_xy_coordinates_unchecked(Field::zero(), y1); Circuit::scope("group0", || { let group0_is_in_group = group0.is_in_group(); assert!(group0_is_in_group.eject_value()); @@ -425,7 +425,7 @@ mod tests { // The other three low order points are on the curve but not in the large prime subgroup. // Make sure is_in_group returns false for these. let minus1: Field = Field::new(Mode::Public, PrimitiveField::from_str(minus1_string).unwrap()); - let half0 = Group::::from_xy_coordinates_unchecked(Field::zero(),minus1); + let half0 = Group::::from_xy_coordinates_unchecked(Field::zero(), minus1); Circuit::scope("half0", || { let half0_is_not_in_group = !half0.is_in_group(); assert!(half0_is_not_in_group.eject_value()); From d89116f17ecf4f2b4ab6ccab5ac14558e915d545 Mon Sep 17 00:00:00 2001 From: Howard Wu <9260812+howardwu@users.noreply.github.com> Date: Mon, 8 Jan 2024 19:32:46 -0800 Subject: [PATCH 098/298] Update console/types/scalar/src/from_bits.rs Signed-off-by: Howard Wu <9260812+howardwu@users.noreply.github.com> --- console/types/scalar/src/from_bits.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/console/types/scalar/src/from_bits.rs b/console/types/scalar/src/from_bits.rs index e53acc12fc..fbe3e4a3b9 100644 --- a/console/types/scalar/src/from_bits.rs +++ b/console/types/scalar/src/from_bits.rs @@ -50,7 +50,7 @@ impl FromBits for Scalar { } else { // Construct the sanitized list of bits padded with `false` let mut sanitized_bits = vec![false; size_in_bits]; - // this is safe, because we just checked that the length of bits isn't bigger + // Note: This is safe, because we just checked that the length of bits isn't bigger // than `size_in_data_bits` which is equal to `size_in_bits - 1`. sanitized_bits[..num_bits].copy_from_slice(bits_le); From 68cb0bf1af95ebd1c10765a669def8052e00a379 Mon Sep 17 00:00:00 2001 From: Howard Wu <9260812+howardwu@users.noreply.github.com> Date: Mon, 8 Jan 2024 19:33:20 -0800 Subject: [PATCH 099/298] Update console/types/field/src/from_bits.rs Signed-off-by: Howard Wu <9260812+howardwu@users.noreply.github.com> --- console/types/field/src/from_bits.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/console/types/field/src/from_bits.rs b/console/types/field/src/from_bits.rs index ec58df6f19..2b283272f7 100644 --- a/console/types/field/src/from_bits.rs +++ b/console/types/field/src/from_bits.rs @@ -47,7 +47,7 @@ impl FromBits for Field { } else { // Construct the sanitized list of bits padded with `false` let mut sanitized_bits = vec![false; size_in_bits]; - // this is safe, because we just checked that the length of bits isn't bigger + // Note: This is safe, because we just checked that the length of bits isn't bigger // than `size_in_data_bits` which is equal to `size_in_bits - 1`. sanitized_bits[..num_bits].copy_from_slice(bits_le); From 2932d6eca395ec9b5577328b0ffa9b0c8a3c8754 Mon Sep 17 00:00:00 2001 From: raychu86 <14917648+raychu86@users.noreply.github.com> Date: Mon, 8 Jan 2024 20:02:56 -0800 Subject: [PATCH 100/298] Add Maps for tracking aborted solution ids in BlockStorage --- ledger/store/src/block/mod.rs | 65 ++++++++++++++++++++++++++++++++++- 1 file changed, 64 insertions(+), 1 deletion(-) diff --git a/ledger/store/src/block/mod.rs b/ledger/store/src/block/mod.rs index 4ffb292fec..8bc4cf1621 100644 --- a/ledger/store/src/block/mod.rs +++ b/ledger/store/src/block/mod.rs @@ -189,6 +189,10 @@ pub trait BlockStorage: 'static + Clone + Send + Sync { type SolutionsMap: for<'a> Map<'a, N::BlockHash, Option>>; /// The mapping of `puzzle commitment` to `block height`. type PuzzleCommitmentsMap: for<'a> Map<'a, PuzzleCommitment, u32>; + /// The mapping of `block hash` to `[aborted solution ID]`. + type AbortedSolutionIDsMap: for<'a> Map<'a, N::BlockHash, Vec>>; + /// The mapping of aborted `puzzle commitment` to `block height`. + type AbortedPuzzleCommitmentsMap: for<'a> Map<'a, PuzzleCommitment, u32>; /// The mapping of `block hash` to `[transaction ID]`. type TransactionsMap: for<'a> Map<'a, N::BlockHash, Vec>; /// The mapping of `block hash` to `[aborted transaction ID]`. @@ -229,6 +233,10 @@ pub trait BlockStorage: 'static + Clone + Send + Sync { fn solutions_map(&self) -> &Self::SolutionsMap; /// Returns the puzzle commitments map. fn puzzle_commitments_map(&self) -> &Self::PuzzleCommitmentsMap; + /// Returns the aborted solution IDs map. + fn aborted_solution_ids_map(&self) -> &Self::AbortedSolutionIDsMap; + /// Returns the aborted puzzle commitments map. + fn aborted_puzzle_commitments_map(&self) -> &Self::AbortedPuzzleCommitmentsMap; /// Returns the accepted transactions map. fn transactions_map(&self) -> &Self::TransactionsMap; /// Returns the aborted transaction IDs map. @@ -264,6 +272,8 @@ pub trait BlockStorage: 'static + Clone + Send + Sync { self.ratifications_map().start_atomic(); self.solutions_map().start_atomic(); self.puzzle_commitments_map().start_atomic(); + self.aborted_solution_ids_map().start_atomic(); + self.aborted_puzzle_commitments_map().start_atomic(); self.transactions_map().start_atomic(); self.aborted_transaction_ids_map().start_atomic(); self.rejected_or_aborted_transaction_id_map().start_atomic(); @@ -284,6 +294,8 @@ pub trait BlockStorage: 'static + Clone + Send + Sync { || self.ratifications_map().is_atomic_in_progress() || self.solutions_map().is_atomic_in_progress() || self.puzzle_commitments_map().is_atomic_in_progress() + || self.aborted_solution_ids_map().is_atomic_in_progress() + || self.aborted_puzzle_commitments_map().is_atomic_in_progress() || self.transactions_map().is_atomic_in_progress() || self.aborted_transaction_ids_map().is_atomic_in_progress() || self.rejected_or_aborted_transaction_id_map().is_atomic_in_progress() @@ -304,6 +316,8 @@ pub trait BlockStorage: 'static + Clone + Send + Sync { self.ratifications_map().atomic_checkpoint(); self.solutions_map().atomic_checkpoint(); self.puzzle_commitments_map().atomic_checkpoint(); + self.aborted_solution_ids_map().atomic_checkpoint(); + self.aborted_puzzle_commitments_map().atomic_checkpoint(); self.transactions_map().atomic_checkpoint(); self.aborted_transaction_ids_map().atomic_checkpoint(); self.rejected_or_aborted_transaction_id_map().atomic_checkpoint(); @@ -324,6 +338,8 @@ pub trait BlockStorage: 'static + Clone + Send + Sync { self.ratifications_map().clear_latest_checkpoint(); self.solutions_map().clear_latest_checkpoint(); self.puzzle_commitments_map().clear_latest_checkpoint(); + self.aborted_solution_ids_map().clear_latest_checkpoint(); + self.aborted_puzzle_commitments_map().clear_latest_checkpoint(); self.transactions_map().clear_latest_checkpoint(); self.aborted_transaction_ids_map().clear_latest_checkpoint(); self.rejected_or_aborted_transaction_id_map().clear_latest_checkpoint(); @@ -344,6 +360,8 @@ pub trait BlockStorage: 'static + Clone + Send + Sync { self.ratifications_map().atomic_rewind(); self.solutions_map().atomic_rewind(); self.puzzle_commitments_map().atomic_rewind(); + self.aborted_solution_ids_map().atomic_rewind(); + self.aborted_puzzle_commitments_map().atomic_rewind(); self.transactions_map().atomic_rewind(); self.aborted_transaction_ids_map().atomic_rewind(); self.rejected_or_aborted_transaction_id_map().atomic_rewind(); @@ -364,6 +382,8 @@ pub trait BlockStorage: 'static + Clone + Send + Sync { self.ratifications_map().abort_atomic(); self.solutions_map().abort_atomic(); self.puzzle_commitments_map().abort_atomic(); + self.aborted_solution_ids_map().abort_atomic(); + self.aborted_puzzle_commitments_map().abort_atomic(); self.transactions_map().abort_atomic(); self.aborted_transaction_ids_map().abort_atomic(); self.rejected_or_aborted_transaction_id_map().abort_atomic(); @@ -384,6 +404,8 @@ pub trait BlockStorage: 'static + Clone + Send + Sync { self.ratifications_map().finish_atomic()?; self.solutions_map().finish_atomic()?; self.puzzle_commitments_map().finish_atomic()?; + self.aborted_solution_ids_map().finish_atomic()?; + self.aborted_puzzle_commitments_map().finish_atomic()?; self.transactions_map().finish_atomic()?; self.aborted_transaction_ids_map().finish_atomic()?; self.rejected_or_aborted_transaction_id_map().finish_atomic()?; @@ -452,6 +474,14 @@ pub trait BlockStorage: 'static + Clone + Send + Sync { } } + // Store the aborted solution IDs. + self.aborted_solution_ids_map().insert(block.hash(), block.aborted_solution_ids().clone())?; + + // Store the block aborted puzzle commitments. + for puzzle_commitment in block.aborted_solution_ids() { + self.aborted_puzzle_commitments_map().insert(*puzzle_commitment, block.height())?; + } + // Store the transaction IDs. self.transactions_map().insert(block.hash(), block.transaction_ids().copied().collect())?; @@ -507,6 +537,12 @@ pub trait BlockStorage: 'static + Clone + Send + Sync { } }; + // Retrieve the aborted solution IDs. + let aborted_solution_ids = match self.get_block_aborted_solution_ids(block_hash)? { + Some(solution_ids) => solution_ids, + None => Vec::new(), + }; + // Retrieve the aborted transaction IDs. let aborted_transaction_ids = match self.get_block_aborted_transaction_ids(block_hash)? { Some(transaction_ids) => transaction_ids, @@ -568,6 +604,14 @@ pub trait BlockStorage: 'static + Clone + Send + Sync { } } + // Remove the aborted solution IDs. + self.aborted_solution_ids_map().remove(block_hash)?; + + // Remove the aborted puzzle commitments. + for puzzle_commitment in aborted_solution_ids { + self.aborted_puzzle_commitments_map().remove(&puzzle_commitment)?; + } + // Remove the transaction IDs. self.transactions_map().remove(block_hash)?; @@ -858,6 +902,14 @@ pub trait BlockStorage: 'static + Clone + Send + Sync { } } + /// Returns the block aborted solution IDs for the given `block hash`. + fn get_block_aborted_solution_ids(&self, block_hash: &N::BlockHash) -> Result>>> { + match self.aborted_solution_ids_map().get_confirmed(block_hash)? { + Some(aborted_solution_ids) => Ok(Some(cow_to_cloned!(aborted_solution_ids))), + None => Ok(None), + } + } + /// Returns the block transactions for the given `block hash`. fn get_block_transactions(&self, block_hash: &N::BlockHash) -> Result>> { // Retrieve the transaction IDs. @@ -971,6 +1023,10 @@ pub trait BlockStorage: 'static + Clone + Send + Sync { let Ok(solutions) = self.get_block_solutions(block_hash) else { bail!("Missing solutions for block {height} ('{block_hash}')"); }; + // Retrieve the block aborted solution IDs. + let Some(aborted_solution_ids) = self.get_block_aborted_solution_ids(block_hash)? else { + bail!("Missing aborted solutions IDs for block {height} ('{block_hash}')"); + }; // Retrieve the block transactions. let Some(transactions) = self.get_block_transactions(block_hash)? else { bail!("Missing transactions for block {height} ('{block_hash}')"); @@ -987,6 +1043,7 @@ pub trait BlockStorage: 'static + Clone + Send + Sync { authority, ratifications, solutions, + aborted_solution_ids, transactions, aborted_transaction_ids, )?)) @@ -1310,7 +1367,13 @@ impl> BlockStore { /// Returns `true` if the given puzzle commitment exists. pub fn contains_puzzle_commitment(&self, puzzle_commitment: &PuzzleCommitment) -> Result { - self.storage.puzzle_commitments_map().contains_key_confirmed(puzzle_commitment) + Ok(self.storage.puzzle_commitments_map().contains_key_confirmed(puzzle_commitment)? + || self.contains_aborted_puzzle_commitment(puzzle_commitment)?) + } + + /// Returns `true` if the given rejected transaction ID or aborted transaction ID exists. + fn contains_aborted_puzzle_commitment(&self, puzzle_commitment: &PuzzleCommitment) -> Result { + self.storage.aborted_puzzle_commitments_map().contains_key_confirmed(puzzle_commitment) } } From 9c63fee418003adef6a630d6e2d76316a656be0f Mon Sep 17 00:00:00 2001 From: raychu86 <14917648+raychu86@users.noreply.github.com> Date: Mon, 8 Jan 2024 20:03:30 -0800 Subject: [PATCH 101/298] Add aborted solution maps to BlockMemory --- ledger/store/src/helpers/memory/block.rs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/ledger/store/src/helpers/memory/block.rs b/ledger/store/src/helpers/memory/block.rs index c09fa09f2e..a71bc936f3 100644 --- a/ledger/store/src/helpers/memory/block.rs +++ b/ledger/store/src/helpers/memory/block.rs @@ -47,6 +47,10 @@ pub struct BlockMemory { solutions_map: MemoryMap>>, /// The puzzle commitments map. puzzle_commitments_map: MemoryMap, u32>, + /// The aborted solution IDs map. + aborted_solution_ids_map: MemoryMap>>, + /// The aborted puzzle commitments map. + aborted_puzzle_commitments_map: MemoryMap, u32>, /// The transactions map. transactions_map: MemoryMap>, /// The aborted transaction IDs map. @@ -73,6 +77,8 @@ impl BlockStorage for BlockMemory { type RatificationsMap = MemoryMap>; type SolutionsMap = MemoryMap>>; type PuzzleCommitmentsMap = MemoryMap, u32>; + type AbortedSolutionIDsMap = MemoryMap>>; + type AbortedPuzzleCommitmentsMap = MemoryMap, u32>; type TransactionsMap = MemoryMap>; type AbortedTransactionIDsMap = MemoryMap>; type RejectedOrAbortedTransactionIDMap = MemoryMap; @@ -99,6 +105,8 @@ impl BlockStorage for BlockMemory { ratifications_map: MemoryMap::default(), solutions_map: MemoryMap::default(), puzzle_commitments_map: MemoryMap::default(), + aborted_solution_ids_map: MemoryMap::default(), + aborted_puzzle_commitments_map: MemoryMap::default(), transactions_map: MemoryMap::default(), aborted_transaction_ids_map: MemoryMap::default(), rejected_or_aborted_transaction_id_map: MemoryMap::default(), @@ -158,6 +166,16 @@ impl BlockStorage for BlockMemory { &self.puzzle_commitments_map } + /// Returns the aborted solution IDs map. + fn aborted_solution_ids_map(&self) -> &Self::AbortedSolutionIDsMap { + &self.aborted_solution_ids_map + } + + /// Returns the puzzle commitments map. + fn aborted_puzzle_commitments_map(&self) -> &Self::AbortedPuzzleCommitmentsMap { + &self.aborted_puzzle_commitments_map + } + /// Returns the transactions map. fn transactions_map(&self) -> &Self::TransactionsMap { &self.transactions_map From a1e9d64d02dc757a7abd0f310dacca77c1850a39 Mon Sep 17 00:00:00 2001 From: raychu86 <14917648+raychu86@users.noreply.github.com> Date: Mon, 8 Jan 2024 20:03:44 -0800 Subject: [PATCH 102/298] Add aborted solution maps to BlockDB --- ledger/store/src/helpers/rocksdb/block.rs | 18 ++++++++++++++++++ .../store/src/helpers/rocksdb/internal/id.rs | 4 ++++ 2 files changed, 22 insertions(+) diff --git a/ledger/store/src/helpers/rocksdb/block.rs b/ledger/store/src/helpers/rocksdb/block.rs index 121ae2a994..ba684efb73 100644 --- a/ledger/store/src/helpers/rocksdb/block.rs +++ b/ledger/store/src/helpers/rocksdb/block.rs @@ -53,6 +53,10 @@ pub struct BlockDB { solutions_map: DataMap>>, /// The puzzle commitments map. puzzle_commitments_map: DataMap, u32>, + /// The aborted solution IDs map. + aborted_solution_ids_map: DataMap>>, + /// The aborted puzzle commitments map. + aborted_puzzle_commitments_map: DataMap, u32>, /// The transactions map. transactions_map: DataMap>, /// The aborted transaction IDs map. @@ -79,6 +83,8 @@ impl BlockStorage for BlockDB { type RatificationsMap = DataMap>; type SolutionsMap = DataMap>>; type PuzzleCommitmentsMap = DataMap, u32>; + type AbortedSolutionIDsMap = DataMap>>; + type AbortedPuzzleCommitmentsMap = DataMap, u32>; type TransactionsMap = DataMap>; type AbortedTransactionIDsMap = DataMap>; type RejectedOrAbortedTransactionIDMap = DataMap; @@ -105,6 +111,8 @@ impl BlockStorage for BlockDB { ratifications_map: internal::RocksDB::open_map(N::ID, dev, MapID::Block(BlockMap::Ratifications))?, solutions_map: internal::RocksDB::open_map(N::ID, dev, MapID::Block(BlockMap::Solutions))?, puzzle_commitments_map: internal::RocksDB::open_map(N::ID, dev, MapID::Block(BlockMap::PuzzleCommitments))?, + aborted_solution_ids_map: internal::RocksDB::open_map(N::ID, dev, MapID::Block(BlockMap::AbortedSolutionIDs))?, + aborted_puzzle_commitments_map: internal::RocksDB::open_map(N::ID, dev, MapID::Block(BlockMap::AbortedPuzzleCommitments))?, transactions_map: internal::RocksDB::open_map(N::ID, dev, MapID::Block(BlockMap::Transactions))?, aborted_transaction_ids_map: internal::RocksDB::open_map(N::ID, dev, MapID::Block(BlockMap::AbortedTransactionIDs))?, rejected_or_aborted_transaction_id_map: internal::RocksDB::open_map(N::ID, dev, MapID::Block(BlockMap::RejectedOrAbortedTransactionID))?, @@ -164,6 +172,16 @@ impl BlockStorage for BlockDB { &self.puzzle_commitments_map } + /// Returns the aborted solution IDs map. + fn aborted_solution_ids_map(&self) -> &Self::AbortedSolutionIDsMap { + &self.aborted_solution_ids_map + } + + /// Returns the puzzle commitments map. + fn aborted_puzzle_commitments_map(&self) -> &Self::AbortedPuzzleCommitmentsMap { + &self.aborted_puzzle_commitments_map + } + /// Returns the transactions map. fn transactions_map(&self) -> &Self::TransactionsMap { &self.transactions_map diff --git a/ledger/store/src/helpers/rocksdb/internal/id.rs b/ledger/store/src/helpers/rocksdb/internal/id.rs index 4a8dd7d3ad..85f6323253 100644 --- a/ledger/store/src/helpers/rocksdb/internal/id.rs +++ b/ledger/store/src/helpers/rocksdb/internal/id.rs @@ -77,6 +77,8 @@ pub enum BlockMap { Ratifications = DataID::BlockRatificationsMap as u16, Solutions = DataID::BlockSolutionsMap as u16, PuzzleCommitments = DataID::BlockPuzzleCommitmentsMap as u16, + AbortedSolutionIDs = DataID::BlockAbortedSolutionIDsMap as u16, + AbortedPuzzleCommitments = DataID::BlockAbortedPuzzleCommitmentsMap as u16, Transactions = DataID::BlockTransactionsMap as u16, AbortedTransactionIDs = DataID::BlockAbortedTransactionIDsMap as u16, RejectedOrAbortedTransactionID = DataID::BlockRejectedOrAbortedTransactionIDMap as u16, @@ -228,6 +230,8 @@ enum DataID { BlockRatificationsMap, BlockSolutionsMap, BlockPuzzleCommitmentsMap, + BlockAbortedSolutionIDsMap, + BlockAbortedPuzzleCommitmentsMap, BlockTransactionsMap, BlockAbortedTransactionIDsMap, BlockRejectedOrAbortedTransactionIDMap, From 672bf2326530a1ce9616a4301d69628c852585dc Mon Sep 17 00:00:00 2001 From: raychu86 <14917648+raychu86@users.noreply.github.com> Date: Mon, 8 Jan 2024 20:04:07 -0800 Subject: [PATCH 103/298] Add aborted_solution_ids field to Blocks --- ledger/block/src/bytes.rs | 25 ++++++++++++--- ledger/block/src/lib.rs | 60 +++++++++++++++++++++++++++++++---- ledger/block/src/serialize.rs | 4 ++- ledger/block/src/verify.rs | 30 ++++++++++++++++-- 4 files changed, 105 insertions(+), 14 deletions(-) diff --git a/ledger/block/src/bytes.rs b/ledger/block/src/bytes.rs index 448c24cc3d..62e446425a 100644 --- a/ledger/block/src/bytes.rs +++ b/ledger/block/src/bytes.rs @@ -46,18 +46,30 @@ impl FromBytes for Block { _ => return Err(error("Invalid solutions variant in the block")), }; + // Read the number of aborted solution IDs. + let num_aborted_solutions = u32::read_le(&mut reader)?; + // Ensure the number of aborted solutions IDs is within bounds (this is an early safety check). + if num_aborted_solutions as usize > N::MAX_SOLUTIONS { + return Err(error("Invalid number of aborted solutions IDs in the block")); + } + // Read the aborted solution IDs. + let mut aborted_solution_ids = Vec::with_capacity(num_aborted_solutions as usize); + for _ in 0..num_aborted_solutions { + aborted_solution_ids.push(FromBytes::read_le(&mut reader)?); + } + // Read the transactions. let transactions = FromBytes::read_le(&mut reader)?; // Read the number of aborted transaction IDs. - let num_aborted = u32::read_le(&mut reader)?; + let num_aborted_transactions = u32::read_le(&mut reader)?; // Ensure the number of aborted transaction IDs is within bounds (this is an early safety check). - if num_aborted as usize > Transactions::::MAX_TRANSACTIONS { + if num_aborted_transactions as usize > Transactions::::MAX_TRANSACTIONS { return Err(error("Invalid number of aborted transaction IDs in the block")); } // Read the aborted transaction IDs. - let mut aborted_transaction_ids = Vec::with_capacity(num_aborted as usize); - for _ in 0..num_aborted { + let mut aborted_transaction_ids = Vec::with_capacity(num_aborted_transactions as usize); + for _ in 0..num_aborted_transactions { aborted_transaction_ids.push(FromBytes::read_le(&mut reader)?); } @@ -68,6 +80,7 @@ impl FromBytes for Block { authority, ratifications, solutions, + aborted_solution_ids, transactions, aborted_transaction_ids, ) @@ -110,6 +123,10 @@ impl ToBytes for Block { } } + // Write the aborted solution IDs. + (u32::try_from(self.aborted_solution_ids.len()).map_err(error))?.write_le(&mut writer)?; + self.aborted_solution_ids.write_le(&mut writer)?; + // Write the transactions. self.transactions.write_le(&mut writer)?; diff --git a/ledger/block/src/lib.rs b/ledger/block/src/lib.rs index ff495b2ade..1dea45c6b3 100644 --- a/ledger/block/src/lib.rs +++ b/ledger/block/src/lib.rs @@ -70,6 +70,8 @@ pub struct Block { ratifications: Ratifications, /// The solutions in the block. solutions: Option>, + /// The aborted solution IDs in this block. + aborted_solution_ids: Vec>, /// The transactions in this block. transactions: Transactions, /// The aborted transaction IDs in this block. @@ -85,6 +87,7 @@ impl Block { header: Header, ratifications: Ratifications, solutions: Option>, + aborted_solution_ids: Vec>, transactions: Transactions, aborted_transaction_ids: Vec, rng: &mut R, @@ -94,7 +97,16 @@ impl Block { // Construct the beacon authority. let authority = Authority::new_beacon(private_key, block_hash, rng)?; // Construct the block. - Self::from(previous_hash, header, authority, ratifications, solutions, transactions, aborted_transaction_ids) + Self::from( + previous_hash, + header, + authority, + ratifications, + solutions, + aborted_solution_ids, + transactions, + aborted_transaction_ids, + ) } /// Initializes a new quorum block from the given previous block hash, block header, @@ -105,13 +117,23 @@ impl Block { subdag: Subdag, ratifications: Ratifications, solutions: Option>, + aborted_solution_ids: Vec>, transactions: Transactions, aborted_transaction_ids: Vec, ) -> Result { // Construct the beacon authority. let authority = Authority::new_quorum(subdag); // Construct the block. - Self::from(previous_hash, header, authority, ratifications, solutions, transactions, aborted_transaction_ids) + Self::from( + previous_hash, + header, + authority, + ratifications, + solutions, + aborted_solution_ids, + transactions, + aborted_transaction_ids, + ) } /// Initializes a new block from the given previous block hash, block header, @@ -122,6 +144,7 @@ impl Block { authority: Authority, ratifications: Ratifications, solutions: Option>, + aborted_solution_ids: Vec>, transactions: Transactions, aborted_transaction_ids: Vec, ) -> Result { @@ -157,7 +180,13 @@ impl Block { } Authority::Quorum(subdag) => { // Ensure the transmission IDs from the subdag correspond to the block. - Self::check_subdag_transmissions(subdag, &solutions, &transactions, &aborted_transaction_ids)?; + Self::check_subdag_transmissions( + subdag, + &solutions, + &aborted_solution_ids, + &transactions, + &aborted_transaction_ids, + )?; } } @@ -187,6 +216,7 @@ impl Block { authority, ratifications, solutions, + aborted_solution_ids, transactions, aborted_transaction_ids, ) @@ -201,6 +231,7 @@ impl Block { authority: Authority, ratifications: Ratifications, solutions: Option>, + aborted_solution_ids: Vec>, transactions: Transactions, aborted_transaction_ids: Vec, ) -> Result { @@ -210,9 +241,10 @@ impl Block { previous_hash, header, authority, - transactions, ratifications, solutions, + aborted_solution_ids, + transactions, aborted_transaction_ids, }) } @@ -244,6 +276,11 @@ impl Block { self.solutions.as_ref() } + /// Returns the aborted solution IDs in this block. + pub const fn aborted_solution_ids(&self) -> &Vec> { + &self.aborted_solution_ids + } + /// Returns the transactions in this block. pub const fn transactions(&self) -> &Transactions { &self.transactions @@ -647,9 +684,18 @@ pub mod test_helpers { let previous_hash = ::BlockHash::default(); // Construct the block. - let block = - Block::new_beacon(&private_key, previous_hash, header, ratifications, None, transactions, vec![], rng) - .unwrap(); + let block = Block::new_beacon( + &private_key, + previous_hash, + header, + ratifications, + None, + vec![], + transactions, + vec![], + rng, + ) + .unwrap(); assert!(block.header().is_genesis(), "Failed to initialize a genesis block"); // Return the block, transaction, and private key. (block, transaction, private_key) diff --git a/ledger/block/src/serialize.rs b/ledger/block/src/serialize.rs index 24edfa8687..5b92707fc3 100644 --- a/ledger/block/src/serialize.rs +++ b/ledger/block/src/serialize.rs @@ -19,7 +19,7 @@ impl Serialize for Block { fn serialize(&self, serializer: S) -> Result { match serializer.is_human_readable() { true => { - let mut block = serializer.serialize_struct("Block", 7 + self.solutions.is_some() as usize)?; + let mut block = serializer.serialize_struct("Block", 8 + self.solutions.is_some() as usize)?; block.serialize_field("block_hash", &self.block_hash)?; block.serialize_field("previous_hash", &self.previous_hash)?; block.serialize_field("header", &self.header)?; @@ -29,6 +29,7 @@ impl Serialize for Block { if let Some(solutions) = &self.solutions { block.serialize_field("solutions", solutions)?; } + block.serialize_field("aborted_transaction_ids", &self.aborted_solution_ids)?; block.serialize_field("transactions", &self.transactions)?; block.serialize_field("aborted_transaction_ids", &self.aborted_transaction_ids)?; @@ -57,6 +58,7 @@ impl<'de, N: Network> Deserialize<'de> for Block { DeserializeExt::take_from_value::(&mut block, "authority")?, DeserializeExt::take_from_value::(&mut block, "ratifications")?, serde_json::from_value(solutions).map_err(de::Error::custom)?, + DeserializeExt::take_from_value::(&mut block, "aborted_solution_ids")?, DeserializeExt::take_from_value::(&mut block, "transactions")?, DeserializeExt::take_from_value::(&mut block, "aborted_transaction_ids")?, ) diff --git a/ledger/block/src/verify.rs b/ledger/block/src/verify.rs index 22931ef5e0..b3b2fee8b8 100644 --- a/ledger/block/src/verify.rs +++ b/ledger/block/src/verify.rs @@ -199,6 +199,7 @@ impl Block { Self::check_subdag_transmissions( subdag, &self.solutions, + &self.aborted_solution_ids, &self.transactions, &self.aborted_transaction_ids, )?; @@ -261,6 +262,23 @@ impl Block { let height = self.height(); let timestamp = self.timestamp(); + // Ensure the number of aborted solution IDs is within the allowed range. + if self.aborted_solution_ids.len() > N::MAX_SOLUTIONS { + bail!("Cannot validate a block with more than {} aborted solution IDs", N::MAX_SOLUTIONS); + } + + // Ensure there are no duplicate solution IDs. + if has_duplicates( + self.solutions + .as_ref() + .map(|solution| solution.puzzle_commitments()) + .into_iter() + .flatten() + .chain(self.aborted_solution_ids().iter()), + ) { + bail!("Found a duplicate solution in block {height}"); + } + let (combined_proof_target, expected_cumulative_proof_target, is_coinbase_target_reached) = match &self .solutions { @@ -506,6 +524,7 @@ impl Block { pub(super) fn check_subdag_transmissions( subdag: &Subdag, solutions: &Option>, + aborted_solution_ids: &[PuzzleCommitment], transactions: &Transactions, aborted_transaction_ids: &[N::TransactionID], ) -> Result<()> { @@ -566,8 +585,15 @@ impl Block { ensure!(unconfirmed_transaction_ids.next().is_none(), "There exists more transactions than expected."); // TODO: Move this check to be outside of this method, and check against the ledger for existence. - // Ensure there are no aborted or existing solution IDs. - // ensure!(aborted_or_existing_solution_ids.is_empty(), "Block contains aborted or already-existing solutions."); + // Ensure the aborted solution IDs match. + for aborted_solution_id in aborted_solution_ids { + // If the aborted transaction ID is not found, throw an error. + if !aborted_or_existing_solution_ids.contains(&aborted_solution_id) { + bail!( + "Block contains an aborted solution ID that is not found in the subdag (found '{aborted_solution_id}')" + ); + } + } // Ensure the aborted transaction IDs match. for aborted_transaction_id in aborted_transaction_ids { // If the aborted transaction ID is not found, throw an error. From 372f2c5dfc4e56e554b9540eff904a591493db12 Mon Sep 17 00:00:00 2001 From: raychu86 <14917648+raychu86@users.noreply.github.com> Date: Mon, 8 Jan 2024 20:04:27 -0800 Subject: [PATCH 104/298] Add checks against aborted solution ids --- ledger/src/advance.rs | 48 ++++++++++++++++++++++++++++--------------- 1 file changed, 31 insertions(+), 17 deletions(-) diff --git a/ledger/src/advance.rs b/ledger/src/advance.rs index 30d7576b70..f2ab2e6c0a 100644 --- a/ledger/src/advance.rs +++ b/ledger/src/advance.rs @@ -29,7 +29,7 @@ impl> Ledger { // Currently, we do not support ratifications from the memory pool. ensure!(ratifications.is_empty(), "Ratifications are currently unsupported from the memory pool"); // Construct the block template. - let (header, ratifications, solutions, transactions, aborted_transaction_ids) = + let (header, ratifications, solutions, aborted_solution_ids, transactions, aborted_transaction_ids) = self.construct_block_template(&previous_block, Some(&subdag), ratifications, solutions, transactions)?; // Construct the new quorum block. @@ -39,6 +39,7 @@ impl> Ledger { subdag, ratifications, solutions, + aborted_solution_ids, transactions, aborted_transaction_ids, ) @@ -60,13 +61,14 @@ impl> Ledger { let previous_block = self.latest_block(); // Construct the block template. - let (header, ratifications, solutions, transactions, aborted_transaction_ids) = self.construct_block_template( - &previous_block, - None, - candidate_ratifications, - candidate_solutions, - candidate_transactions, - )?; + let (header, ratifications, solutions, aborted_solution_ids, transactions, aborted_transaction_ids) = self + .construct_block_template( + &previous_block, + None, + candidate_ratifications, + candidate_solutions, + candidate_transactions, + )?; // Construct the new beacon block. Block::new_beacon( @@ -75,6 +77,7 @@ impl> Ledger { header, ratifications, solutions, + aborted_solution_ids, transactions, aborted_transaction_ids, rng, @@ -172,19 +175,25 @@ impl> Ledger { candidate_ratifications: Vec>, candidate_solutions: Vec>, candidate_transactions: Vec>, - ) -> Result<(Header, Ratifications, Option>, Transactions, Vec)> - { + ) -> Result<( + Header, + Ratifications, + Option>, + Vec>, + Transactions, + Vec, + )> { // Construct the solutions. - let (solutions, solutions_root, combined_proof_target) = match candidate_solutions.is_empty() { - true => (None, Field::::zero(), 0u128), + let (solutions, aborted_solutions, solutions_root, combined_proof_target) = match candidate_solutions.is_empty() + { + true => (None, vec![], Field::::zero(), 0u128), false => { // Retrieve the coinbase verifying key. let coinbase_verifying_key = self.coinbase_puzzle.coinbase_verifying_key(); // Retrieve the latest epoch challenge. let latest_epoch_challenge = self.latest_epoch_challenge()?; - // TODO: For mainnet - Add `aborted_solution_ids` to the block. // Separate the candidate solutions into valid and aborted solutions. - let (valid_candidate_solutions, _aborted_candidate_solutions) = + let (valid_candidate_solutions, aborted_candidate_solutions) = split_candidate_solutions(candidate_solutions, N::MAX_SOLUTIONS, |solution| { solution .verify(coinbase_verifying_key, &latest_epoch_challenge, self.latest_proof_target()) @@ -193,7 +202,7 @@ impl> Ledger { // Check if there are any valid solutions. match valid_candidate_solutions.is_empty() { - true => (None, Field::::zero(), 0u128), + true => (None, aborted_candidate_solutions, Field::::zero(), 0u128), false => { // Construct the solutions. let solutions = CoinbaseSolution::new(valid_candidate_solutions)?; @@ -202,12 +211,17 @@ impl> Ledger { // Compute the combined proof target. let combined_proof_target = solutions.to_combined_proof_target()?; // Output the solutions, solutions root, and combined proof target. - (Some(solutions), solutions_root, combined_proof_target) + (Some(solutions), aborted_candidate_solutions, solutions_root, combined_proof_target) } } } }; + // TODO (raychu86): Add bound checks for the number of aborted solution ids. This may need to be done in a higher level call. + // Construct the aborted solution IDs. + let aborted_solution_ids = + aborted_solutions.into_iter().map(|solution| solution.commitment()).collect::>(); + // Retrieve the latest state root. let latest_state_root = self.latest_state_root(); // Retrieve the latest cumulative proof target. @@ -319,6 +333,6 @@ impl> Ledger { )?; // Return the block template. - Ok((header, ratifications, solutions, transactions, aborted_transaction_ids)) + Ok((header, ratifications, solutions, aborted_solution_ids, transactions, aborted_transaction_ids)) } } From b5e7c2afc66487f8d7802d245f0ec2d3a05fbc77 Mon Sep 17 00:00:00 2001 From: raychu86 <14917648+raychu86@users.noreply.github.com> Date: Mon, 8 Jan 2024 20:04:58 -0800 Subject: [PATCH 105/298] Add new field to block construction in tests --- ledger/test-helpers/src/lib.rs | 3 ++- synthesizer/src/vm/finalize.rs | 1 + synthesizer/src/vm/mod.rs | 4 ++++ synthesizer/src/vm/verify.rs | 1 + synthesizer/tests/test_vm_execute_and_finalize.rs | 1 + 5 files changed, 9 insertions(+), 1 deletion(-) diff --git a/ledger/test-helpers/src/lib.rs b/ledger/test-helpers/src/lib.rs index 813fb8cb0b..25f6a01775 100644 --- a/ledger/test-helpers/src/lib.rs +++ b/ledger/test-helpers/src/lib.rs @@ -425,7 +425,8 @@ fn sample_genesis_block_and_components_raw( // Construct the block. let block = - Block::new_beacon(&private_key, previous_hash, header, ratifications, None, transactions, vec![], rng).unwrap(); + Block::new_beacon(&private_key, previous_hash, header, ratifications, None, vec![], transactions, vec![], rng) + .unwrap(); assert!(block.header().is_genesis(), "Failed to initialize a genesis block"); // Return the block, transaction, and private key. (block, transaction, private_key) diff --git a/synthesizer/src/vm/finalize.rs b/synthesizer/src/vm/finalize.rs index 8c9422d153..4901a487c2 100644 --- a/synthesizer/src/vm/finalize.rs +++ b/synthesizer/src/vm/finalize.rs @@ -1024,6 +1024,7 @@ finalize transfer_public: header, ratifications, None, + vec![], transactions, aborted_transaction_ids, rng, diff --git a/synthesizer/src/vm/mod.rs b/synthesizer/src/vm/mod.rs index a9e29d1594..bc06118c76 100644 --- a/synthesizer/src/vm/mod.rs +++ b/synthesizer/src/vm/mod.rs @@ -278,6 +278,8 @@ impl> VM { let ratifications = vec![Ratify::Genesis(committee, public_balances)]; // Prepare the solutions. let solutions = None; // The genesis block does not require solutions. + // Prepare teh aborted solution ids. + let aborted_solution_ids = vec![]; // Prepare the transactions. let transactions = (0..Block::::NUM_GENESIS_TRANSACTIONS) .map(|_| self.execute(private_key, locator, inputs.iter(), None, 0, None, rng)) @@ -305,6 +307,7 @@ impl> VM { header, ratifications, solutions, + aborted_solution_ids, transactions, aborted_transaction_ids, rng, @@ -683,6 +686,7 @@ function compute: header, ratifications, None, + vec![], transactions, aborted_transaction_ids, rng, diff --git a/synthesizer/src/vm/verify.rs b/synthesizer/src/vm/verify.rs index fe036b7e3a..457b3de75b 100644 --- a/synthesizer/src/vm/verify.rs +++ b/synthesizer/src/vm/verify.rs @@ -507,6 +507,7 @@ mod tests { deployment_header, ratifications, None, + vec![], transactions, aborted_transaction_ids, rng, diff --git a/synthesizer/tests/test_vm_execute_and_finalize.rs b/synthesizer/tests/test_vm_execute_and_finalize.rs index 21a5b4e234..e0fb039eed 100644 --- a/synthesizer/tests/test_vm_execute_and_finalize.rs +++ b/synthesizer/tests/test_vm_execute_and_finalize.rs @@ -469,6 +469,7 @@ fn construct_next_block, R: Rng + CryptoRng> header, ratifications, None, + vec![], transactions, aborted_transaction_ids, rng, From 91f7233371dfa49c454cc3f1e226387902ae9c68 Mon Sep 17 00:00:00 2001 From: Howard Wu <9260812+howardwu@users.noreply.github.com> Date: Mon, 8 Jan 2024 20:11:56 -0800 Subject: [PATCH 106/298] Update synthesizer/process/src/verify_execution.rs Signed-off-by: Howard Wu <9260812+howardwu@users.noreply.github.com> --- synthesizer/process/src/verify_execution.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/synthesizer/process/src/verify_execution.rs b/synthesizer/process/src/verify_execution.rs index 13e04e9c13..27c4a1caad 100644 --- a/synthesizer/process/src/verify_execution.rs +++ b/synthesizer/process/src/verify_execution.rs @@ -73,7 +73,7 @@ impl Process { // Ensure the number of outputs is within the allowed range. ensure!(transition.outputs().len() <= N::MAX_OUTPUTS, "Transition exceeded maximum number of outputs"); - // Get the network id + // Retrieve the network ID. let network_id = U16::new(N::ID); // Compute the function ID. let function_id = compute_function_id(&network_id, transition.program_id(), transition.function_name())?; From 63d5b217040040305999ae456ef4952f750416e5 Mon Sep 17 00:00:00 2001 From: Howard Wu <9260812+howardwu@users.noreply.github.com> Date: Mon, 8 Jan 2024 20:12:17 -0800 Subject: [PATCH 107/298] Update circuit/program/src/request/verify.rs Signed-off-by: Howard Wu <9260812+howardwu@users.noreply.github.com> --- circuit/program/src/request/verify.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/circuit/program/src/request/verify.rs b/circuit/program/src/request/verify.rs index 3869ac86e5..d77a07a54c 100644 --- a/circuit/program/src/request/verify.rs +++ b/circuit/program/src/request/verify.rs @@ -21,7 +21,7 @@ impl Request { /// Verifies (challenge == challenge') && (address == address') && (serial_numbers == serial_numbers') where: /// challenge' := HashToScalar(r * G, pk_sig, pr_sig, signer, \[tvk, tcm, function ID, input IDs\]) pub fn verify(&self, input_types: &[console::ValueType], tpk: &Group) -> Boolean { - // Compute the function ID + // Compute the function ID. let function_id = compute_function_id(&self.network_id, &self.program_id, &self.function_name); // Construct the signature message as `[tvk, tcm, function ID, input IDs]`. From 8dfac76ee8ff49a957f4b927951ae6f73c0d5586 Mon Sep 17 00:00:00 2001 From: Howard Wu <9260812+howardwu@users.noreply.github.com> Date: Mon, 8 Jan 2024 20:12:50 -0800 Subject: [PATCH 108/298] Update console/program/src/request/sign.rs Signed-off-by: Howard Wu <9260812+howardwu@users.noreply.github.com> --- console/program/src/request/sign.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/console/program/src/request/sign.rs b/console/program/src/request/sign.rs index 00e8a4f171..5adb5f0614 100644 --- a/console/program/src/request/sign.rs +++ b/console/program/src/request/sign.rs @@ -64,9 +64,9 @@ impl Request { // Compute the transition commitment `tcm` as `Hash(tvk)`. let tcm = N::hash_psd2(&[tvk])?; - // Get the network id + // Retrieve the network ID. let network_id = U16::new(N::ID); - // Compute the function id + // Compute the function ID. let function_id = compute_function_id(&network_id, &program_id, &function_name)?; // Construct the hash input as `(r * G, pk_sig, pr_sig, signer, [tvk, tcm, function ID, input IDs])`. From 2107679c03668f0766c2eba389822aaa65205a8f Mon Sep 17 00:00:00 2001 From: Howard Wu <9260812+howardwu@users.noreply.github.com> Date: Mon, 8 Jan 2024 20:13:12 -0800 Subject: [PATCH 109/298] Update synthesizer/process/src/verify_fee.rs Signed-off-by: Howard Wu <9260812+howardwu@users.noreply.github.com> --- synthesizer/process/src/verify_fee.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/synthesizer/process/src/verify_fee.rs b/synthesizer/process/src/verify_fee.rs index 5d36866d3d..12b64434b5 100644 --- a/synthesizer/process/src/verify_fee.rs +++ b/synthesizer/process/src/verify_fee.rs @@ -76,7 +76,7 @@ impl Process { fn verify_fee_private(&self, fee: &&Fee) -> Result<()> { let timer = timer!("Process::verify_fee_private"); - // Get the network id + // Retrieve the network ID. let network_id = U16::new(N::ID); // Compute the function ID. let function_id = compute_function_id(&network_id, fee.program_id(), fee.function_name())?; From b2dfefce773ce392fe6b1c7de71bd16fbd45aa52 Mon Sep 17 00:00:00 2001 From: Howard Wu <9260812+howardwu@users.noreply.github.com> Date: Mon, 8 Jan 2024 20:13:28 -0800 Subject: [PATCH 110/298] Update synthesizer/process/src/verify_fee.rs Signed-off-by: Howard Wu <9260812+howardwu@users.noreply.github.com> --- synthesizer/process/src/verify_fee.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/synthesizer/process/src/verify_fee.rs b/synthesizer/process/src/verify_fee.rs index 12b64434b5..73460123bd 100644 --- a/synthesizer/process/src/verify_fee.rs +++ b/synthesizer/process/src/verify_fee.rs @@ -145,7 +145,7 @@ impl Process { fn verify_fee_public(&self, fee: &&Fee) -> Result<()> { let timer = timer!("Process::verify_fee_public"); - // Get the network id + // Retrieve the network ID. let network_id = U16::new(N::ID); // Compute the function ID. let function_id = compute_function_id(&network_id, fee.program_id(), fee.function_name())?; From 2973b230d3bf5400bb140c046e14315ab28345eb Mon Sep 17 00:00:00 2001 From: raychu86 <14917648+raychu86@users.noreply.github.com> Date: Mon, 8 Jan 2024 20:14:48 -0800 Subject: [PATCH 111/298] Add todo --- ledger/block/src/bytes.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ledger/block/src/bytes.rs b/ledger/block/src/bytes.rs index 62e446425a..2648b7c38e 100644 --- a/ledger/block/src/bytes.rs +++ b/ledger/block/src/bytes.rs @@ -48,6 +48,8 @@ impl FromBytes for Block { // Read the number of aborted solution IDs. let num_aborted_solutions = u32::read_le(&mut reader)?; + // TODO (raychu86): Evaluate if this check is correct. It may be a valid case where there are more than + // N::MAX_SOLUTIONS number of aborted solutions. // Ensure the number of aborted solutions IDs is within bounds (this is an early safety check). if num_aborted_solutions as usize > N::MAX_SOLUTIONS { return Err(error("Invalid number of aborted solutions IDs in the block")); From f6e262fba5b9687396a0a250010c29e96031906b Mon Sep 17 00:00:00 2001 From: Victor Sint Nicolaas Date: Tue, 9 Jan 2024 08:38:57 +0100 Subject: [PATCH 112/298] Use execute_function for nested calls in CallStack::PackageRun --- synthesizer/process/src/stack/call/mod.rs | 2 +- synthesizer/process/src/stack/evaluate.rs | 8 +------- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/synthesizer/process/src/stack/call/mod.rs b/synthesizer/process/src/stack/call/mod.rs index d34e31d91f..024ca0a9af 100644 --- a/synthesizer/process/src/stack/call/mod.rs +++ b/synthesizer/process/src/stack/call/mod.rs @@ -259,7 +259,7 @@ impl CallTrait for Call { call_stack.push(request.clone())?; // Evaluate the request. - let response = substack.evaluate_function::(call_stack, console_caller)?; + let response = substack.execute_function::(call_stack, console_caller, rng)?; // Return the request and response. (request, response) diff --git a/synthesizer/process/src/stack/evaluate.rs b/synthesizer/process/src/stack/evaluate.rs index 6d6b6f5761..9dda9b6db2 100644 --- a/synthesizer/process/src/stack/evaluate.rs +++ b/synthesizer/process/src/stack/evaluate.rs @@ -106,10 +106,6 @@ impl StackEvaluate for Stack { // Retrieve the next request, based on the call stack mode. let (request, call_stack) = match &call_stack { CallStack::Evaluate(authorization) => (authorization.next()?, call_stack), - CallStack::PackageRun(requests, _, _) => { - let last_request = requests.last().ok_or(anyhow!("CallStack does not contain request"))?.clone(); - (last_request, call_stack) - } // If the evaluation is performed in the `Execute` mode, create a new `Evaluate` mode. // This is done to ensure that evaluation during execution is performed consistently. CallStack::Execute(authorization, _) => { @@ -120,9 +116,7 @@ impl StackEvaluate for Stack { let call_stack = CallStack::Evaluate(authorization); (request, call_stack) } - _ => bail!( - "Illegal operation: call stack must be `PackageRun`, `Evaluate` or `Execute` in `evaluate_function`." - ), + _ => bail!("Illegal operation: call stack must be `Evaluate` or `Execute` in `evaluate_function`."), }; lap!(timer, "Retrieve the next request"); From 3fe4a9c474be5b105c0efe9a26a5b80c7871bef7 Mon Sep 17 00:00:00 2001 From: ljedrz Date: Tue, 9 Jan 2024 09:56:37 +0100 Subject: [PATCH 113/298] cleanup: remove ConstraintVariable Signed-off-by: ljedrz --- algorithms/src/r1cs/constraint_variable.rs | 309 --------------------- algorithms/src/r1cs/mod.rs | 3 - 2 files changed, 312 deletions(-) delete mode 100644 algorithms/src/r1cs/constraint_variable.rs diff --git a/algorithms/src/r1cs/constraint_variable.rs b/algorithms/src/r1cs/constraint_variable.rs deleted file mode 100644 index 9aa613cb91..0000000000 --- a/algorithms/src/r1cs/constraint_variable.rs +++ /dev/null @@ -1,309 +0,0 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. -// This file is part of the snarkVM library. - -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at: -// http://www.apache.org/licenses/LICENSE-2.0 - -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -use crate::r1cs::{LinearCombination, Variable}; -use snarkvm_fields::Field; - -use std::ops::{Add, AddAssign, Mul, MulAssign, Neg, Sub}; - -/// Either a `Variable` or a `LinearCombination`. -#[derive(Clone, Debug)] -pub enum ConstraintVariable { - /// A wrapper around a `LinearCombination`. - LC(LinearCombination), - /// A wrapper around a `Variable`. - Var(Variable), -} - -impl From for ConstraintVariable { - #[inline] - fn from(var: Variable) -> Self { - ConstraintVariable::Var(var) - } -} - -impl From<(F, Variable)> for ConstraintVariable { - #[inline] - fn from(coeff_var: (F, Variable)) -> Self { - ConstraintVariable::LC(coeff_var.into()) - } -} - -impl From> for ConstraintVariable { - #[inline] - fn from(lc: LinearCombination) -> Self { - ConstraintVariable::LC(lc) - } -} - -impl From<(F, LinearCombination)> for ConstraintVariable { - #[inline] - fn from((coeff, mut lc): (F, LinearCombination)) -> Self { - lc *= coeff; - ConstraintVariable::LC(lc) - } -} - -impl From<(F, ConstraintVariable)> for ConstraintVariable { - #[inline] - fn from((coeff, var): (F, ConstraintVariable)) -> Self { - match var { - ConstraintVariable::LC(lc) => (coeff, lc).into(), - ConstraintVariable::Var(var) => (coeff, var).into(), - } - } -} - -impl ConstraintVariable { - /// Returns an empty linear combination. - #[inline] - pub fn zero() -> Self { - ConstraintVariable::LC(LinearCombination::zero()) - } - - /// Negate the coefficients of all variables in `self`. - pub fn negate_in_place(&mut self) { - match self { - ConstraintVariable::LC(ref mut lc) => lc.negate_in_place(), - ConstraintVariable::Var(var) => *self = (-F::one(), *var).into(), - } - } - - /// Double the coefficients of all variables in `self`. - pub fn double_in_place(&mut self) { - match self { - ConstraintVariable::LC(lc) => lc.double_in_place(), - ConstraintVariable::Var(var) => *self = (F::one().double(), *var).into(), - } - } -} - -impl Add> for ConstraintVariable { - type Output = LinearCombination; - - #[inline] - fn add(self, other_lc: LinearCombination) -> LinearCombination { - match self { - ConstraintVariable::LC(lc) => other_lc + lc, - ConstraintVariable::Var(var) => other_lc + var, - } - } -} - -impl Sub> for ConstraintVariable { - type Output = LinearCombination; - - #[inline] - fn sub(self, other_lc: LinearCombination) -> LinearCombination { - let result = match self { - ConstraintVariable::LC(lc) => other_lc - lc, - ConstraintVariable::Var(var) => other_lc - var, - }; - -result - } -} - -impl Add> for &ConstraintVariable { - type Output = LinearCombination; - - #[inline] - fn add(self, other_lc: LinearCombination) -> LinearCombination { - match self { - ConstraintVariable::LC(lc) => other_lc + lc, - ConstraintVariable::Var(var) => other_lc + *var, - } - } -} - -impl Sub> for &ConstraintVariable { - type Output = LinearCombination; - - #[inline] - fn sub(self, other_lc: LinearCombination) -> LinearCombination { - let result = match self { - ConstraintVariable::LC(lc) => other_lc - lc, - ConstraintVariable::Var(var) => other_lc - *var, - }; - -result - } -} - -impl Add<(F, Variable)> for ConstraintVariable { - type Output = Self; - - #[inline] - fn add(self, var: (F, Variable)) -> Self { - let lc = match self { - ConstraintVariable::LC(lc) => lc + var, - ConstraintVariable::Var(var2) => LinearCombination::from(var2) + var, - }; - ConstraintVariable::LC(lc) - } -} - -impl AddAssign<(F, Variable)> for ConstraintVariable { - #[inline] - fn add_assign(&mut self, var: (F, Variable)) { - match self { - ConstraintVariable::LC(ref mut lc) => *lc += var, - ConstraintVariable::Var(var2) => *self = ConstraintVariable::LC(LinearCombination::from(*var2) + var), - }; - } -} - -impl Neg for ConstraintVariable { - type Output = Self; - - #[inline] - fn neg(mut self) -> Self { - self.negate_in_place(); - self - } -} - -impl Mul for ConstraintVariable { - type Output = Self; - - #[inline] - fn mul(self, scalar: F) -> Self { - match self { - ConstraintVariable::LC(lc) => ConstraintVariable::LC(lc * scalar), - ConstraintVariable::Var(var) => (scalar, var).into(), - } - } -} - -impl MulAssign for ConstraintVariable { - #[inline] - fn mul_assign(&mut self, scalar: F) { - match self { - ConstraintVariable::LC(lc) => *lc *= scalar, - ConstraintVariable::Var(var) => *self = (scalar, *var).into(), - } - } -} - -impl Sub<(F, Variable)> for ConstraintVariable { - type Output = Self; - - #[inline] - fn sub(self, (coeff, var): (F, Variable)) -> Self { - self + (-coeff, var) - } -} - -impl Add for ConstraintVariable { - type Output = Self; - - fn add(self, other: Variable) -> Self { - self + (F::one(), other) - } -} - -impl Sub for ConstraintVariable { - type Output = Self; - - #[inline] - fn sub(self, other: Variable) -> Self { - self - (F::one(), other) - } -} - -impl<'a, F: Field> Add<&'a Self> for ConstraintVariable { - type Output = Self; - - #[inline] - fn add(self, other: &'a Self) -> Self { - let lc = match self { - ConstraintVariable::LC(lc2) => lc2, - ConstraintVariable::Var(var) => var.into(), - }; - let lc2 = match other { - ConstraintVariable::LC(lc2) => lc + lc2, - ConstraintVariable::Var(var) => lc + *var, - }; - ConstraintVariable::LC(lc2) - } -} - -impl<'a, F: Field> Sub<&'a Self> for ConstraintVariable { - type Output = Self; - - #[inline] - fn sub(self, other: &'a Self) -> Self { - let lc = match self { - ConstraintVariable::LC(lc2) => lc2, - ConstraintVariable::Var(var) => var.into(), - }; - let lc2 = match other { - ConstraintVariable::LC(lc2) => lc - lc2, - ConstraintVariable::Var(var) => lc - *var, - }; - ConstraintVariable::LC(lc2) - } -} - -impl Add<&ConstraintVariable> for &ConstraintVariable { - type Output = ConstraintVariable; - - #[inline] - fn add(self, other: &ConstraintVariable) -> Self::Output { - (ConstraintVariable::zero() + self) + other - } -} - -impl Sub<&ConstraintVariable> for &ConstraintVariable { - type Output = ConstraintVariable; - - #[inline] - fn sub(self, other: &ConstraintVariable) -> Self::Output { - (ConstraintVariable::zero() + self) - other - } -} - -impl<'a, F: Field> Add<(F, &'a Self)> for ConstraintVariable { - type Output = Self; - - #[inline] - fn add(self, (coeff, other): (F, &'a Self)) -> Self { - let mut lc = match self { - ConstraintVariable::LC(lc2) => lc2, - ConstraintVariable::Var(var) => LinearCombination::zero() + var, - }; - - lc = match other { - ConstraintVariable::LC(lc2) => lc + (coeff, lc2), - ConstraintVariable::Var(var) => lc + (coeff, *var), - }; - ConstraintVariable::LC(lc) - } -} - -impl<'a, F: Field> Sub<(F, &'a Self)> for ConstraintVariable { - type Output = Self; - - #[inline] - #[allow(clippy::suspicious_arithmetic_impl)] - fn sub(self, (coeff, other): (F, &'a Self)) -> Self { - let mut lc = match self { - ConstraintVariable::LC(lc2) => lc2, - ConstraintVariable::Var(var) => LinearCombination::zero() + var, - }; - lc = match other { - ConstraintVariable::LC(lc2) => lc - (coeff, lc2), - ConstraintVariable::Var(var) => lc - (coeff, *var), - }; - ConstraintVariable::LC(lc) - } -} diff --git a/algorithms/src/r1cs/mod.rs b/algorithms/src/r1cs/mod.rs index b83941a556..4dd40feaa0 100644 --- a/algorithms/src/r1cs/mod.rs +++ b/algorithms/src/r1cs/mod.rs @@ -21,9 +21,6 @@ pub use constraint_counter::*; mod constraint_system; pub use constraint_system::{ConstraintSynthesizer, ConstraintSystem}; -mod constraint_variable; -pub use constraint_variable::*; - pub mod errors; pub use errors::*; From 3364340945d434c651cbe5ddc5b758e8b1c11053 Mon Sep 17 00:00:00 2001 From: raychu86 <14917648+raychu86@users.noreply.github.com> Date: Tue, 9 Jan 2024 11:24:48 -0800 Subject: [PATCH 114/298] Regenerate parameters --- .../src/testnet3/resources/bond_public.metadata | 4 ++-- .../src/testnet3/resources/bond_public.verifier | Bin 665 -> 665 bytes .../resources/claim_unbond_public.metadata | 4 ++-- .../resources/claim_unbond_public.verifier | Bin 665 -> 665 bytes .../src/testnet3/resources/fee_private.metadata | 4 ++-- .../src/testnet3/resources/fee_private.verifier | Bin 665 -> 665 bytes .../src/testnet3/resources/fee_public.metadata | 4 ++-- .../src/testnet3/resources/fee_public.verifier | Bin 665 -> 665 bytes parameters/src/testnet3/resources/join.metadata | 4 ++-- parameters/src/testnet3/resources/join.verifier | Bin 665 -> 665 bytes .../resources/set_validator_state.metadata | 4 ++-- .../resources/set_validator_state.verifier | Bin 665 -> 665 bytes .../src/testnet3/resources/split.metadata | 4 ++-- .../src/testnet3/resources/split.verifier | Bin 665 -> 665 bytes .../resources/transfer_private.metadata | 4 ++-- .../resources/transfer_private.verifier | Bin 665 -> 665 bytes .../transfer_private_to_public.metadata | 4 ++-- .../transfer_private_to_public.verifier | Bin 665 -> 665 bytes .../testnet3/resources/transfer_public.metadata | 4 ++-- .../testnet3/resources/transfer_public.verifier | Bin 665 -> 665 bytes .../transfer_public_to_private.metadata | 4 ++-- .../transfer_public_to_private.verifier | Bin 665 -> 665 bytes .../unbond_delegator_as_validator.metadata | 4 ++-- .../unbond_delegator_as_validator.verifier | Bin 665 -> 665 bytes .../testnet3/resources/unbond_public.metadata | 4 ++-- .../testnet3/resources/unbond_public.verifier | Bin 665 -> 665 bytes 26 files changed, 26 insertions(+), 26 deletions(-) diff --git a/parameters/src/testnet3/resources/bond_public.metadata b/parameters/src/testnet3/resources/bond_public.metadata index 09c21d773d..864ac4ca57 100644 --- a/parameters/src/testnet3/resources/bond_public.metadata +++ b/parameters/src/testnet3/resources/bond_public.metadata @@ -1,6 +1,6 @@ { - "prover_checksum": "9c3547df0e580953f75e42f30e97c5f1eea7ca40d244aeb8054ff6b25a65bd53", + "prover_checksum": "4e9c91cc4bab0efd5cc59af6f12375217655cc8918db9efde720dc9b2b53fdf6", "prover_size": 28802978, - "verifier_checksum": "10315aeb75b3e933292d6493629634eda93bfc85e8d16caf86127015c56734fd", + "verifier_checksum": "c1f5877d3efae1ce38318bbbd2b89379bf486678158698e7db296107bb855b62", "verifier_size": 665 } \ No newline at end of file diff --git a/parameters/src/testnet3/resources/bond_public.verifier b/parameters/src/testnet3/resources/bond_public.verifier index ec9e26dd7076d212450d19cce576bc451f87949e..9b6b92dae6378b8078318562d30f001667572359 100644 GIT binary patch delta 140 zcmV;70CWGD1(^k~=>cDUbU^OeFR?RH#BU&MYmS5qyrJet)WkFecD0mJin-tO0GzL7n8eR=(LO%MUV?zh67WtZPabu|F4{-|?;30@fyv@Ndh26H^UkqF((pR~~Y4yN-XN_3y*@tIas;P5<_ usy>fVREm>G0x=-iKx8_7J^^&3pC05-KjB$lj!O#izkR^cE|u^MD4V+%^+JXK diff --git a/parameters/src/testnet3/resources/claim_unbond_public.metadata b/parameters/src/testnet3/resources/claim_unbond_public.metadata index 22c1a5cf42..444bc5f02f 100644 --- a/parameters/src/testnet3/resources/claim_unbond_public.metadata +++ b/parameters/src/testnet3/resources/claim_unbond_public.metadata @@ -1,6 +1,6 @@ { - "prover_checksum": "f8b64aa87fe94f44c566a3e1ab7fb0b6be4b3da0ac1b1038ba26bff6363ada5e", + "prover_checksum": "cd839659f3d728d784095b85ae2c122dfe8eb78dec5579f5d482b5577c6b9fb6", "prover_size": 16734260, - "verifier_checksum": "8fd74456a2c8714d70b575ccdbcc180d3a882eb14bd2cbea944265f53c9a7ab4", + "verifier_checksum": "1a7b978aeca71f642c6e7da0d58f7cbcb4129ad2404fec17953077d7eaa45f0f", "verifier_size": 665 } \ No newline at end of file diff --git a/parameters/src/testnet3/resources/claim_unbond_public.verifier b/parameters/src/testnet3/resources/claim_unbond_public.verifier index c50f7dd3a4324d485c34bbf34a8c0bf99df20f22..88055d8da639bea54a6e9a94254d99fb93b73bf4 100644 GIT binary patch delta 140 zcmV;70CWGD1(^k~=>cCb9eG*oJysBP#n;D7wU=`hMQRu~O#Ai)G#ix<)d_=@`0(6O zc9iwK#SFMF`Wk?^S_W}5+sH=Wb3+Kh0UDg?N~ApGX?24fkG1#*lnwPP*@M)JQrKyc u&Fj*C-9(c}0x=-Wf}cJpNxRx-qOy5yrh1gd=o_(^2==7r3PuXVVlnV1$wW;6 delta 140 zcmV;70CWGD1(^k~=>cEmQh;{DDYAWli0i}B%B@_siQ%2ZqZhv2L_7QVvv`fS-#j(q z+?v05@uL!JLV^HV<>ehWxl@olXt5TKpwEyBF{i|F_a0MgAsG+FUp>Oi`lG3ctt1hy u7$cE{H*$%?a1og!KbCDwNq>u53^&W3j`#Fa26ti6<^*As@EPK! zRI~^dOKmnE3+(`^P=cYdtI|XtK6&?L?(Il#M(o#ms#>)+PBR#9MD|`7wnQ^#vqium v4RwSA^csMZNdhn+cF{_aATcFNsy@JHvsNFgG_z2dW!`&j5k*=}2;2VjQzlSzFOGeVJ)12N z25Yc^`=L8;xeWluFDYddHU0cFL(h&S{VU=TuJl9tvY{$YQaqy1~+u| zfY(c+#?w0YC-DG>oxgG4K#e0znertuupUt;hQq^-gTI%DTio)8*kGl2`h!}3@2ubZMjDW&eBqcs6wvNQ0=s3tDGo)W diff --git a/parameters/src/testnet3/resources/join.metadata b/parameters/src/testnet3/resources/join.metadata index f8a1f72945..a38cb47534 100644 --- a/parameters/src/testnet3/resources/join.metadata +++ b/parameters/src/testnet3/resources/join.metadata @@ -1,6 +1,6 @@ { - "prover_checksum": "1a76fe88fe132b46af0e3053cf4509cc02346705ecf592483a3775cd465eee40", + "prover_checksum": "256f69ed4c93a8ca4c8db40185ca8d56fd8f629f20846e069a1b90cccdd5a420", "prover_size": 74596892, - "verifier_checksum": "4f1701b27513a630ba70d9a83bf4b611cfe3c566e7c339ea7151923a6728f240", + "verifier_checksum": "96f05ba47ef211d860e8a14aee7e03c5a79111378a5d318e023d988fe656cfc2", "verifier_size": 665 } \ No newline at end of file diff --git a/parameters/src/testnet3/resources/join.verifier b/parameters/src/testnet3/resources/join.verifier index 4a483fca1ba61ba1cd3ce67f8aa828943b919512..f5af7a5c7b297c11a60771f6324b80ec3dc4c117 100644 GIT binary patch delta 140 zcmV;70CWGD1(^k~=>cEBoV|(^)sMPQ^Or1c{l{N@Gs3hCgU+Q6q~T-!c#|~znqH6! zMb=Ix(Q--a?}&g17s;{`#1c$F7E0*D@|jDdog!Xp{QC=T3zYW-@K08~T#PTBesIAN uFW#_yW?hp=0x=*tuXb*TR?L#~O delta 140 zcmV;70CWGD1(^k~=>cEXi@N;$b7byNd{M>}gP5H`NH)Rp$Y97@^q_#btU3cNBF@|X zM~0S?Itpf>%zOayX#k3*iVUK}D&@t4CH~VaWynY>GIKR{m457~>8+)G;w7D%A`Gy? u=3`X~wD^-q0x=-t$jl^ZBMiJb*vKRhTiNS*g2)IOndcHCgvxiW%FXG%oTrvqX`;f(?7f-AU~HTXGJCwV63tuBYVj0* zj4h4(ttC2T^tgcV?}WTYmDkj{!2AR6`HL9N#)g-%W!R-;zty2Y*w54=4Zj&L?PK{&{-U1d~xqyt>F delta 141 zcmV;80CNAC1(^k~=>cF70tlC49Bn{~ohy%&tCz>gpIBv^2iq#nHIO*T-z65wENT`D zObWv*6O`4OWkK&jAxF vrFec+%u;}pNdhn+#^@#bfsJyJMh~`<16bDCsN+rNxDG&=Ufv^Sp(&f6qkTS6 diff --git a/parameters/src/testnet3/resources/split.metadata b/parameters/src/testnet3/resources/split.metadata index d57ce0a226..8b1cb65d99 100644 --- a/parameters/src/testnet3/resources/split.metadata +++ b/parameters/src/testnet3/resources/split.metadata @@ -1,6 +1,6 @@ { - "prover_checksum": "e6d12b9f6578fcae9a805296a6e1f7d282b352457ccf34baceba29e618c79ca2", + "prover_checksum": "75a90c6b83e296f3c8553c52b076694a02d4863ec9f8df17e46e2526ecce45c2", "prover_size": 75036196, - "verifier_checksum": "2f9733dbd5a671499a8c8e97a0e043a74b97ed1fecf7834f49d0cd39c9ed171c", + "verifier_checksum": "61d4ded3eed0b0669f4e36c588dd4561cee5e54ee579c69b1d28bd3be35cbccd", "verifier_size": 665 } \ No newline at end of file diff --git a/parameters/src/testnet3/resources/split.verifier b/parameters/src/testnet3/resources/split.verifier index c1bf758ed59fe9b7551101527f632ab43ea7fd87..32c741095059ef9d5eed244e1b29bb40c590ccfb 100644 GIT binary patch delta 140 zcmV;70CWGD1(^k~>H%NTUG~jT*|>YSC(B=?v#NOR*nf~8jk3MH@MiJh%5gV8X`>n;&Ryb_`$6ph delta 140 zcmV;70CWGD1(^k~>H%NqLVMGQJ1+E^%h3ZLt9^ui`EOy%NLCuZnYSlQ>#K}GwsRdT zBWy2mIT$BSb%EUtNLLCDQrjw%DdOA9{jr%B;jUXOGAs36{OLK%CDR0eb+yK?oIrU1 diff --git a/parameters/src/testnet3/resources/transfer_private.metadata b/parameters/src/testnet3/resources/transfer_private.metadata index 594bef3696..4a97792899 100644 --- a/parameters/src/testnet3/resources/transfer_private.metadata +++ b/parameters/src/testnet3/resources/transfer_private.metadata @@ -1,6 +1,6 @@ { - "prover_checksum": "2b487c0b05c5997a7405bbdcd9583cba17da8adf192d6b314dfa95fd70db18ea", + "prover_checksum": "985522347142d78f4a36fdc7c991973656f63d58ac54077cb61e82f95b14c2e2", "prover_size": 75823940, - "verifier_checksum": "3a3cbba0e1e038eb15acba228157885b63a779e5c5cb061466948f408fab8439", + "verifier_checksum": "76f639730ee1e6c8facbe3314fa466bef71cc7ceaf592e07a516a3b04e961f9f", "verifier_size": 665 } \ No newline at end of file diff --git a/parameters/src/testnet3/resources/transfer_private.verifier b/parameters/src/testnet3/resources/transfer_private.verifier index d351e3219cf0bb6409a06cc6925d15176f7db4b9..ea672d7cdc7c9773018d1a657e9897a2df2f30dc 100644 GIT binary patch delta 140 zcmV;70CWGD1(^k~=>cDAOV-X)aHkW-+$D-25TJYp<%cz8njf!=8J%rm4}5`-q}T^w zy3f+fni1zeC4~Vgh}`75ry`oQr&2&t#P}cz563$+PCJU755r42scvixYq?uW;dg?X uN)AqH=82O?0x=-ntU3q)n^mjB+ye(Vaae}8fRG(MlVL>)-J)9bZ!q>oHa;K# delta 140 zcmV;70CWGD1(^k~=>cEBo;?=ru{d*6d4+SCsrPBmqaQB0x=--HQeyTWN^SL*nC!9c8ZIP()5ns44%{-4eFdUqd~ckc|rI9 diff --git a/parameters/src/testnet3/resources/transfer_private_to_public.metadata b/parameters/src/testnet3/resources/transfer_private_to_public.metadata index de95819682..3de80c3181 100644 --- a/parameters/src/testnet3/resources/transfer_private_to_public.metadata +++ b/parameters/src/testnet3/resources/transfer_private_to_public.metadata @@ -1,6 +1,6 @@ { - "prover_checksum": "1ff64cb9cefbbed3416bfb67a0477327446ab5eccc9f725b27df195b948e956f", + "prover_checksum": "911cea8f06004bd3aacee622a71d0f28d63c56fdd5898705941a33beeef31f00", "prover_size": 66174244, - "verifier_checksum": "d5b60dec01f95a92b305d914578657d35e1d390ae63e86f0665324b05f0f742d", + "verifier_checksum": "11cd753e6a7db0f40a0286aff21198bce64a441d3146a8eab875fff60b7df6dc", "verifier_size": 665 } \ No newline at end of file diff --git a/parameters/src/testnet3/resources/transfer_private_to_public.verifier b/parameters/src/testnet3/resources/transfer_private_to_public.verifier index 23a4ad33eb44b682f4db9152b6c382efe45f1e1b..159bfe63d129ba18d5ddac3e2242ee42c3521694 100644 GIT binary patch delta 141 zcmV;80CNAC1(^k~=>cFVD;la9(cDcQTNV8n6Mc=0K60K>)Yrs>huY-Sq)(2Zx{>&K zFu_MXyE8#>HT!@a&_UewSb=cfdtF}a{Y0tryvbJq3Q=8Hg~`lEPSoje8}1UF8JE@h v;-VyYnK=QINdhn+0a&{o4zN}2jZwn!jQpypQZ(S(Jzl$smJ(api3~Oa4ar2N delta 141 zcmV;80CNAC1(^k~=>cHC7CbTnZMxUjQ@B}d<(|wk+bM{JC=P*b3aW~d*80Q-49Hll z>hntwYo=4(xv>BuEO(6^rNne;^cFa!#!k4v=+LI&Ab?y=r^b~V+=BBh5VQdwvNZr!%{k!gj7}f zy$H@K3ri7i7aReHhFrBfYP<&(19kECe1*vaACRK^F*s(X+0;jxIUscvT`rd)v97yD vBbI6pj|u^kNdhn+9hg;zLqT%mccG5bfQ&HsE-SQp>2Uyai^7}omh|atw{ai60;&kr3eB1!(Z$Z=jImZ(m%aoJ`uO?YDUi1M v;E}>656l3QNdhn+sIFASp;}p3y?_rpMvssf2his8s{#!l_PC(1H0Xq;Un)qz diff --git a/parameters/src/testnet3/resources/transfer_public_to_private.metadata b/parameters/src/testnet3/resources/transfer_public_to_private.metadata index 999ada83f5..d5308b3bfc 100644 --- a/parameters/src/testnet3/resources/transfer_public_to_private.metadata +++ b/parameters/src/testnet3/resources/transfer_public_to_private.metadata @@ -1,6 +1,6 @@ { - "prover_checksum": "1bcddf96204302f7a5eb371c3b482f3a8cc102ff222d8bb85328121d927322e1", + "prover_checksum": "557aaecd81eeffea50c039c12f71c7f11de28feffc34a3d61ca2bc0fa978ddd3", "prover_size": 38288044, - "verifier_checksum": "b094554656f1716b5212a98e9c55e544f87f69575fdcc4a8783b5cb4ed6de54b", + "verifier_checksum": "a1be7dc4e48fb3aee537118addc7dfb13d77a8f608348c56be15c0a750703628", "verifier_size": 665 } \ No newline at end of file diff --git a/parameters/src/testnet3/resources/transfer_public_to_private.verifier b/parameters/src/testnet3/resources/transfer_public_to_private.verifier index 9937585a097970d21293101f08feb4a52e2e2f99..c182f36506755a937f0611509c49f2c2e2c24870 100644 GIT binary patch delta 141 zcmV;80CNAC1(^k~=>cF7uH%~sxjN#}NS>VB^(W`uG}E}dDiJ<^*WDeY4Yk1bV)+O9LCJElX` delta 141 zcmV;80CNAC1(^k~=>cE@3LpMm7x~T4A^4IF48QXLGTeI@ucwF9_fqRrWwHm8QlkBq z3WsCiE|kiFN2LJ7HFnt4Tm{Yn*o*%XW6`TWuQyIX?{jTG?rwYr8&ec`%&{HXNDGcl vZ<$o+vljuANdhn+u?lT>9}CBCJNN))=a{r*{tOzw*X8l(lYTBjOT~M^Nz+0~ diff --git a/parameters/src/testnet3/resources/unbond_delegator_as_validator.metadata b/parameters/src/testnet3/resources/unbond_delegator_as_validator.metadata index 26d1165177..4916716dc5 100644 --- a/parameters/src/testnet3/resources/unbond_delegator_as_validator.metadata +++ b/parameters/src/testnet3/resources/unbond_delegator_as_validator.metadata @@ -1,6 +1,6 @@ { - "prover_checksum": "115a86bcc00299fed1f64277fb9688160c425981ce0f62a79cf52515931d9098", + "prover_checksum": "2112ca035da2c9d2be297b40629089b13f67805d24a91b1a750409c94310832f", "prover_size": 17159372, - "verifier_checksum": "9585609c87768bf6ebd87cf6b43a4ddfa921a24773feae45e5688685abe36df5", + "verifier_checksum": "e9f3a486107342e7b54a2fc56335c062db5f75f202329f1847d1d92daf599135", "verifier_size": 665 } \ No newline at end of file diff --git a/parameters/src/testnet3/resources/unbond_delegator_as_validator.verifier b/parameters/src/testnet3/resources/unbond_delegator_as_validator.verifier index 8506f2216bd0a8e497c8e0cbe06f76734a88dd3e..a132b0cb862452fe2f5b66ca1f21a24e73e08a17 100644 GIT binary patch delta 140 zcmV;70CWGD1(^k~=>cEjt9#8c*%?SWI-rI0)wo39yKs9mFV3P>7=2C9f7L;A!s`FC zG=lk2P>eCJ@qmH8U@-LORw%+gM+Izz*nGd&W^y8-%yCBCTs=v?34Gc}TKg#&W&*Qj uq{z+d-B^=I0x=+WE7>n~G~k~K?z6Z#tqbkqt3-OYALpv`(L95|$PikH`A01P delta 140 zcmV;70CWGD1(^k~=>cETJ8~~r=&iRBB+~@0!e2`9Mpbu1Y84{DJh;H7ldUljMb8D0 z44cMF>4ZkCRPq3dYN@PuOa2ZHep8F{5&w#MuYlmv=`5w6&|cg*n(%96m%V>(vwO2m u;N4Y3w~muY0x=+o7vAUD`ag63X(a|qR8y3f;->I+&0|2!{8jXKcYJ@A&_=xg diff --git a/parameters/src/testnet3/resources/unbond_public.metadata b/parameters/src/testnet3/resources/unbond_public.metadata index 458b639921..a8d9f5dd3c 100644 --- a/parameters/src/testnet3/resources/unbond_public.metadata +++ b/parameters/src/testnet3/resources/unbond_public.metadata @@ -1,6 +1,6 @@ { - "prover_checksum": "9547c05b4fad4bb957c1b50b5fa15407cc7996b358fc6154240078a5547d4497", + "prover_checksum": "065ee688c6d42a53911125f8cde1070aec2969be2145020634e7416612bf92ae", "prover_size": 17014428, - "verifier_checksum": "09873cdd4edccecc576ed77501a6af9276e4952a3c02e20cded951b27105266a", + "verifier_checksum": "9a050d1db7d3a028fac42de785eff53a2bbee56f4307a0f6fd41c343e05b22b5", "verifier_size": 665 } \ No newline at end of file diff --git a/parameters/src/testnet3/resources/unbond_public.verifier b/parameters/src/testnet3/resources/unbond_public.verifier index aaf88c581cc7ed895798cebf07843067a6e5352d..fefe146561cab762da1c554e5434599c756c6b8d 100644 GIT binary patch delta 141 zcmV;80CNAC1(^k~=>cG8--1`ig6Oyjvf&=-o(^m`#)k4-3fd=uwow3rE~l#_mA`5C zcEXDG?oH>L3U-0xoSXPq%KJ4o!>B*2W%Pd#yM>OdBX*Mofij4h2Grwe@T9->%1oQ} vwZSTidy@c@Ndhn+*Oqz-CuIsRQB50tp{4~T*`m7l!nn5x(Md7N)1Aah9iT_i delta 141 zcmV;80CNAC1(^k~=>cHTR>`}Hp^gHIB8+&oYjW2pjUhpxn-Tama@BcOuZqZLK4QX( zPzP6Iohvpm%s7F^Kt+%PQ4fYuk#Ji{y-1?7ap)?|TJ;v@>+vrls#Fap=Z%eHkr>5J vATtv>;E;inNdhn+NSP4{{2+2#&>Q{hRxG^gPTs%YZ}%68(~q;q>s^(h&$~iv From 76bf41295f045d2590f61ad211bbb811afd5d90e Mon Sep 17 00:00:00 2001 From: raychu86 <14917648+raychu86@users.noreply.github.com> Date: Tue, 9 Jan 2024 11:26:35 -0800 Subject: [PATCH 115/298] Resample genesis block --- .../src/testnet3/resources/block.genesis | Bin 13728 -> 13728 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/parameters/src/testnet3/resources/block.genesis b/parameters/src/testnet3/resources/block.genesis index c33b0398b64573fa23e04bacd903dfb75872c709..ea3e74fa76c174c7a33ffbb5e84234ae054e317c 100644 GIT binary patch delta 11330 zcmZA7RahKrw4mYchQ{54ySuvthXBDfI0Scx(2WImcXxMpcMT8-?gR}Gf&?ZzXZD$A zPhHnVRb70~`>$Ggwt2P`z&5@K`f$C6jtO>&+tDY-Xd4wXy!E0*yr*#Lmu>A{_;?Bl zanYfR-N)S+frlqL6`^IJS-adghST9iSRR+Bl|W2on244yA%1|CI&YX_sd3Fl`My&+ z+3UX9mB^d)XOI^rD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1Z!j$fE1rK(nkKL&B!*~u^LGm5fCY&_xmS2X z`e$hxW%z}1PeOsmfl0mcA$WAMSZAebfY-no@7vmA-Hk$dAmtrI4=F0&r430mM5Q-w zefNunIYLr??Gs;8&~9>8))7V&MAXQciwdre_zA*-P7V*Cgp?fMGBK z>A6bfKE=^V(X{Sw(zz=Jb8_+^aMebk{ko^|RpnU(`1q70UFK3B`v6w02%w^6_%?f8 zzRK`WOR+cVXt}S^!{E?zd#{Blng|#$b&XpGbFZ;H3CQP$9)H37Y+a?)vQX^$NXgd2 zM$gPy|8(vp!DWk(OZb##%BzPl2cAf4gS;eV3X=rJ8C1&`O!Cm(28Imr2@fJ+cWPsE z-N0_07s(Ag-cVwWuBVrL(`XZR0*2Zi$TgIdD~Z3aesXva%^kQko-74Eg+rJW#i};d zfM~^Z7wr(2yDR7ZBxr9xp(nr;%c@bKEq^!R0|#zoW{W1O&z%FM^2qxQS$NFy$lzig z-&s!R+nzoa?)8{xIO^mg#;pFQOFTK$FQ77yASrQFqt{OHg^Ou});`?zxX=3q26u+R zsgV}Vg_s$wN6sqI*!%B8!53_s1Zk*?@%E(dy;qvBMQ}!fkY|Lu>yzamy`rJ-Xs+%D zm^nC=+J%>N+6A4QfrhwPsqARMSrb)So*9KA^4@6#&#=ZQH0)zmxLL|!J)w%hNZFW? zEqi_q)rR}H{0?8|%_>3F&_xpVNv`XUW9pan?OyQz>0K^3es^MTJ0k{v+gHKBGXnN9 zo4Dj>9>;H}{s&mUMt(GJyEp=icumye)R2@1l&E09X-+hePV(oQQU*6Bh#QUv7csxv z*5bt>?Ou#NwNuXr5{KD@s_A Date: Tue, 9 Jan 2024 11:45:18 -0800 Subject: [PATCH 116/298] Regenerate test expectations --- .../vm/execute_and_finalize/child_and_parent.out | 4 ++-- .../vm/execute_and_finalize/complex_finalization.out | 8 ++++---- .../expectations/vm/execute_and_finalize/count_usages.out | 8 ++++---- .../vm/execute_and_finalize/program_callable.out | 4 ++-- .../vm/execute_and_finalize/public_wallet.out | 2 +- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/synthesizer/tests/expectations/vm/execute_and_finalize/child_and_parent.out b/synthesizer/tests/expectations/vm/execute_and_finalize/child_and_parent.out index 2d9421d6ac..c68ee8a664 100644 --- a/synthesizer/tests/expectations/vm/execute_and_finalize/child_and_parent.out +++ b/synthesizer/tests/expectations/vm/execute_and_finalize/child_and_parent.out @@ -26,8 +26,8 @@ additional: - child_outputs: child.aleo/foo: outputs: - - '{"type":"public","id":"200002908579085284998521086275289275746160962451836392081488485911047931043field","value":"aleo16w8t56s7v6ud7vu33fr388ph0dq0c7yhp597cyjt88rr3nultcyqcyk9yy"}' - - '{"type":"public","id":"7350968487086023676016513382715106449866153082012832343288974503948378937589field","value":"aleo1qr2ha4pfs5l28aze88yn6fhleeythklkczrule2v838uwj65n5gqxt9djx"}' + - '{"type":"public","id":"3053083281228202643695820041055556325241888430585018657624441866648037140198field","value":"aleo16w8t56s7v6ud7vu33fr388ph0dq0c7yhp597cyjt88rr3nultcyqcyk9yy"}' + - '{"type":"public","id":"841099900136593325021934910310372898993677204958254134855500940046454660402field","value":"aleo1qr2ha4pfs5l28aze88yn6fhleeythklkczrule2v838uwj65n5gqxt9djx"}' credits.aleo/fee_public: outputs: - '{"type":"future","id":"2385771550748706618588353711817373130237795779368565655313787366409876227847field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1qr2ha4pfs5l28aze88yn6fhleeythklkczrule2v838uwj65n5gqxt9djx,\n 2123u64\n ]\n}"}' diff --git a/synthesizer/tests/expectations/vm/execute_and_finalize/complex_finalization.out b/synthesizer/tests/expectations/vm/execute_and_finalize/complex_finalization.out index 1d25fe3e01..dd1a5af935 100644 --- a/synthesizer/tests/expectations/vm/execute_and_finalize/complex_finalization.out +++ b/synthesizer/tests/expectations/vm/execute_and_finalize/complex_finalization.out @@ -11,16 +11,16 @@ additional: - child_outputs: zero_program.aleo/c: outputs: - - '{"type":"future","id":"6023713305098041369267397706416191328025594696092005758834659886286613475748field","value":"{\n program_id: zero_program.aleo,\n function_name: c,\n arguments: [\n aleo1kw4knandael9qcpxs6g36rr6h7dwvjz6q25ueah6zz9v57zjlvxsx5llq8\n ]\n}"}' + - '{"type":"future","id":"8398811300098542959672515796868001801744775834504124358078338408092745276506field","value":"{\n program_id: zero_program.aleo,\n function_name: c,\n arguments: [\n aleo1kw4knandael9qcpxs6g36rr6h7dwvjz6q25ueah6zz9v57zjlvxsx5llq8\n ]\n}"}' one_program.aleo/d: outputs: - - '{"type":"future","id":"6562004736027208776543041380361518509926930856889216555330996078767924219181field","value":"{\n program_id: one_program.aleo,\n function_name: d,\n arguments: [\n aleo1kw4knandael9qcpxs6g36rr6h7dwvjz6q25ueah6zz9v57zjlvxsx5llq8\n ]\n}"}' + - '{"type":"future","id":"8085842254656101850362298075740310431811872671856075738656325241792412491124field","value":"{\n program_id: one_program.aleo,\n function_name: d,\n arguments: [\n aleo1kw4knandael9qcpxs6g36rr6h7dwvjz6q25ueah6zz9v57zjlvxsx5llq8\n ]\n}"}' two_program.aleo/b: outputs: - - '{"type":"future","id":"668645730802382062346901896989661985007590566040463370470872766825827822177field","value":"{\n program_id: two_program.aleo,\n function_name: b,\n arguments: [\n {\n program_id: zero_program.aleo,\n function_name: c,\n arguments: [\n aleo1kw4knandael9qcpxs6g36rr6h7dwvjz6q25ueah6zz9v57zjlvxsx5llq8\n ]\n },\n {\n program_id: one_program.aleo,\n function_name: d,\n arguments: [\n aleo1kw4knandael9qcpxs6g36rr6h7dwvjz6q25ueah6zz9v57zjlvxsx5llq8\n ]\n },\n aleo1kw4knandael9qcpxs6g36rr6h7dwvjz6q25ueah6zz9v57zjlvxsx5llq8\n ]\n}"}' + - '{"type":"future","id":"3949961117435748184445791067244522322131810102931597139661403531836230997571field","value":"{\n program_id: two_program.aleo,\n function_name: b,\n arguments: [\n {\n program_id: zero_program.aleo,\n function_name: c,\n arguments: [\n aleo1kw4knandael9qcpxs6g36rr6h7dwvjz6q25ueah6zz9v57zjlvxsx5llq8\n ]\n },\n {\n program_id: one_program.aleo,\n function_name: d,\n arguments: [\n aleo1kw4knandael9qcpxs6g36rr6h7dwvjz6q25ueah6zz9v57zjlvxsx5llq8\n ]\n },\n aleo1kw4knandael9qcpxs6g36rr6h7dwvjz6q25ueah6zz9v57zjlvxsx5llq8\n ]\n}"}' three_program.aleo/e: outputs: - - '{"type":"future","id":"1350294781374667373450127305160654687819360174207149219930198334406776418824field","value":"{\n program_id: three_program.aleo,\n function_name: e,\n arguments: [\n {\n program_id: two_program.aleo,\n function_name: b,\n arguments: [\n {\n program_id: zero_program.aleo,\n function_name: c,\n arguments: [\n aleo1kw4knandael9qcpxs6g36rr6h7dwvjz6q25ueah6zz9v57zjlvxsx5llq8\n ]\n },\n {\n program_id: one_program.aleo,\n function_name: d,\n arguments: [\n aleo1kw4knandael9qcpxs6g36rr6h7dwvjz6q25ueah6zz9v57zjlvxsx5llq8\n ]\n },\n aleo1kw4knandael9qcpxs6g36rr6h7dwvjz6q25ueah6zz9v57zjlvxsx5llq8\n ]\n },\n {\n program_id: one_program.aleo,\n function_name: d,\n arguments: [\n aleo1kw4knandael9qcpxs6g36rr6h7dwvjz6q25ueah6zz9v57zjlvxsx5llq8\n ]\n },\n {\n program_id: zero_program.aleo,\n function_name: c,\n arguments: [\n aleo1kw4knandael9qcpxs6g36rr6h7dwvjz6q25ueah6zz9v57zjlvxsx5llq8\n ]\n },\n aleo1kw4knandael9qcpxs6g36rr6h7dwvjz6q25ueah6zz9v57zjlvxsx5llq8\n ]\n}"}' + - '{"type":"future","id":"2899742450080784925824199719327281178674517876611661569345730158159437558882field","value":"{\n program_id: three_program.aleo,\n function_name: e,\n arguments: [\n {\n program_id: two_program.aleo,\n function_name: b,\n arguments: [\n {\n program_id: zero_program.aleo,\n function_name: c,\n arguments: [\n aleo1kw4knandael9qcpxs6g36rr6h7dwvjz6q25ueah6zz9v57zjlvxsx5llq8\n ]\n },\n {\n program_id: one_program.aleo,\n function_name: d,\n arguments: [\n aleo1kw4knandael9qcpxs6g36rr6h7dwvjz6q25ueah6zz9v57zjlvxsx5llq8\n ]\n },\n aleo1kw4knandael9qcpxs6g36rr6h7dwvjz6q25ueah6zz9v57zjlvxsx5llq8\n ]\n },\n {\n program_id: one_program.aleo,\n function_name: d,\n arguments: [\n aleo1kw4knandael9qcpxs6g36rr6h7dwvjz6q25ueah6zz9v57zjlvxsx5llq8\n ]\n },\n {\n program_id: zero_program.aleo,\n function_name: c,\n arguments: [\n aleo1kw4knandael9qcpxs6g36rr6h7dwvjz6q25ueah6zz9v57zjlvxsx5llq8\n ]\n },\n aleo1kw4knandael9qcpxs6g36rr6h7dwvjz6q25ueah6zz9v57zjlvxsx5llq8\n ]\n}"}' credits.aleo/fee_public: outputs: - '{"type":"future","id":"6301101036530348220774048833800673255589427955562002044410042853343083209551field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1kw4knandael9qcpxs6g36rr6h7dwvjz6q25ueah6zz9v57zjlvxsx5llq8,\n 1312883u64\n ]\n}"}' diff --git a/synthesizer/tests/expectations/vm/execute_and_finalize/count_usages.out b/synthesizer/tests/expectations/vm/execute_and_finalize/count_usages.out index ec576d813c..879da8f342 100644 --- a/synthesizer/tests/expectations/vm/execute_and_finalize/count_usages.out +++ b/synthesizer/tests/expectations/vm/execute_and_finalize/count_usages.out @@ -12,12 +12,12 @@ additional: - child_outputs: basic_math.aleo/add_and_count: outputs: - - '{"type":"private","id":"3562582071813318695601339206379553874880317250955926920878856239987857090099field","value":"ciphertext1qyqvwzwh7vwxxxn32ra57g7fukrpq428ng9segyha7qsu6z3ynzwkpcsmpvm4"}' - - '{"type":"future","id":"2644372658124242589810135509629749775455722126762863704192983367572616340676field","value":"{\n program_id: basic_math.aleo,\n function_name: add_and_count,\n arguments: [\n aleo1mrughg5ssadd9fc2uwve7l6u24xn76kyz24zsjtzta03vgkq4vpqggl6fg\n ]\n}"}' + - '{"type":"private","id":"3335953842011364012666526114033492842189135567862718968975315190794576944836field","value":"ciphertext1qyqqqqfffwtnlr3v9zdhvfzly2amdlaxxlegwe4a2k0lscqtw0gxxygmgetpq"}' + - '{"type":"future","id":"7585537673411942169622199657257982996871123624936233538990114870847611674336field","value":"{\n program_id: basic_math.aleo,\n function_name: add_and_count,\n arguments: [\n aleo1mrughg5ssadd9fc2uwve7l6u24xn76kyz24zsjtzta03vgkq4vpqggl6fg\n ]\n}"}' basic_math.aleo/sub_and_count: outputs: - - '{"type":"private","id":"8158447991679565922495513079548529697115407945439289249853999408064177634278field","value":"ciphertext1qyq2zz9lhxnjmlxnsuqhmmfjv7ww6gz72ftenallydt3wqnq9qyvgygepnsuc"}' - - '{"type":"future","id":"4766970023193296466180554436491060950590195351430280244328867821742777104427field","value":"{\n program_id: basic_math.aleo,\n function_name: sub_and_count,\n arguments: [\n aleo1mrughg5ssadd9fc2uwve7l6u24xn76kyz24zsjtzta03vgkq4vpqggl6fg\n ]\n}"}' + - '{"type":"private","id":"4757970763079582890235221216937341597957192614493957749103998836023101442009field","value":"ciphertext1qyqyrz5ltaasrx96fwlvt75c0v852l584rzps5rljnskxazq4ze2wpc79697s"}' + - '{"type":"future","id":"5371526823344032604721611430165214743139119888543408659649777130462024628706field","value":"{\n program_id: basic_math.aleo,\n function_name: sub_and_count,\n arguments: [\n aleo1mrughg5ssadd9fc2uwve7l6u24xn76kyz24zsjtzta03vgkq4vpqggl6fg\n ]\n}"}' credits.aleo/fee_public: outputs: - '{"type":"future","id":"1235679768483539988482826629865991343820249330910597217240061174279706292035field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1kw4knandael9qcpxs6g36rr6h7dwvjz6q25ueah6zz9v57zjlvxsx5llq8,\n 263392u64\n ]\n}"}' diff --git a/synthesizer/tests/expectations/vm/execute_and_finalize/program_callable.out b/synthesizer/tests/expectations/vm/execute_and_finalize/program_callable.out index 284a02cf4c..cfe19276bb 100644 --- a/synthesizer/tests/expectations/vm/execute_and_finalize/program_callable.out +++ b/synthesizer/tests/expectations/vm/execute_and_finalize/program_callable.out @@ -16,8 +16,8 @@ additional: - child_outputs: child.aleo/foo: outputs: - - '{"type":"public","id":"1097693885727802075210095734699286799830893447062213874449124538610566843509field","value":"aleo16w8t56s7v6ud7vu33fr388ph0dq0c7yhp597cyjt88rr3nultcyqcyk9yy"}' - - '{"type":"public","id":"1361684151990533064498798090536285369593274539262537088973935658855702638606field","value":"aleo1qr2ha4pfs5l28aze88yn6fhleeythklkczrule2v838uwj65n5gqxt9djx"}' + - '{"type":"public","id":"4868721665864264325936496341048001744286749024989285333643604721920380255715field","value":"aleo16w8t56s7v6ud7vu33fr388ph0dq0c7yhp597cyjt88rr3nultcyqcyk9yy"}' + - '{"type":"public","id":"3525177701596468290328849149936712458502828518051227125511453575799774964436field","value":"aleo1qr2ha4pfs5l28aze88yn6fhleeythklkczrule2v838uwj65n5gqxt9djx"}' credits.aleo/fee_public: outputs: - '{"type":"future","id":"1654089975904775845803610306576708885251110717047795439165401945844221766915field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1qr2ha4pfs5l28aze88yn6fhleeythklkczrule2v838uwj65n5gqxt9djx,\n 2123u64\n ]\n}"}' diff --git a/synthesizer/tests/expectations/vm/execute_and_finalize/public_wallet.out b/synthesizer/tests/expectations/vm/execute_and_finalize/public_wallet.out index 1f679a7d99..14951adcae 100644 --- a/synthesizer/tests/expectations/vm/execute_and_finalize/public_wallet.out +++ b/synthesizer/tests/expectations/vm/execute_and_finalize/public_wallet.out @@ -11,7 +11,7 @@ additional: - child_outputs: token.aleo/mint_public: outputs: - - '{"type":"future","id":"6098437191130915695667989920256721987374768522520468547273384697927217987040field","value":"{\n program_id: token.aleo,\n function_name: mint_public,\n arguments: [\n aleo1sry3pke49ykrf0aeshf889tr98r4c86p5f4ms766795ssdwfdyqq9jdg0j,\n 10u64\n ]\n}"}' + - '{"type":"future","id":"3144630535556594876885989978302155162609598664092705837857984939791609253843field","value":"{\n program_id: token.aleo,\n function_name: mint_public,\n arguments: [\n aleo1sry3pke49ykrf0aeshf889tr98r4c86p5f4ms766795ssdwfdyqq9jdg0j,\n 10u64\n ]\n}"}' credits.aleo/fee_public: outputs: - '{"type":"future","id":"546462310004815308785340027890541933050085460472488305954420334597248699563field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1d3e2je2m2hsxwdsvntvf4jnnlj459ywfry6ch2qwrpy6l6r6yvpq8e88h5,\n 131201u64\n ]\n}"}' From 109bb737314bf9b69fcdc8242e66cc6e38057121 Mon Sep 17 00:00:00 2001 From: raychu86 <14917648+raychu86@users.noreply.github.com> Date: Tue, 9 Jan 2024 12:12:17 -0800 Subject: [PATCH 117/298] Resample genesis block --- .../src/testnet3/resources/block.genesis | Bin 13728 -> 13728 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/parameters/src/testnet3/resources/block.genesis b/parameters/src/testnet3/resources/block.genesis index ea3e74fa76c174c7a33ffbb5e84234ae054e317c..2751faa0802b96c1e871e195b859d0c91384d460 100644 GIT binary patch delta 11042 zcmY+~Ra9Kd+Nj}f+}+(hIKkcB3GVK}Ep#{T?jg8a(BK~2-QAr4AwZCmmGket$C}sk zrfSUbj;HFIc@B9FltAxtmUY+C9Xg_qf&Ol5#N!yh`X2H(wz`PQ(h`vkMxYWY#l^%% zHPwQ92&J)1u8|txYhsvA%3()XM%YsqMBlt-yaDPy$`y&4I9e2lES&Kn9G%QUYNeGQ zJ|v}UnL%uYm|+tOTEvWMV7~0k49BkJRphXdNf4IKD)!hJ!3arPoCU)B7(;XAUVMm0 z&P0^>B3~-VbUcMONB{f_XTPPfq_ZVu_zBpM1*`^2o*XR83PDMYy4E_K@4|*}kKi?U zl=KX|_UdvyHJr#I0fE4mr^xsFdFj~s%~wI<^|t0Ry}LShn}A`GmIbpDpD>tYN(?3t zGmbSPMn+I)#JWqTKler#tpQ~uAyfefOA(Qel#3Gq2n7gSp)Vo`>YqSkbXt5gB7X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Jt2kI@~$S1=cX&p=w$ zZGvK|SSvGS{sfQ|hT^e2Cz6D|MrVA=Upu%6d2RJ-?=w7{{it(7na~n>mZ!&O-DHD; z#P2_P^pQqj2_W`o)e^x;Y0+2svl=)w^_VfKJ zj$vVg1W-0j&vnZ*yb@N<^@$y_18(``dWAo!g--X~4A+PK>GYuj;ed~{DuPcMb>JDq3yy`!T4+|)Nnt(i!Qpb;(KUGoh}6vM~wD^g&JE2%_waK*~TEw#Vb zAEGoW`?zruGZr}f<>{}vUo$V5aZXD;J%7rfVZOzUV)WK^yIPF>V2?|H#6ses9fDkB ziTZ&@3`$jWZGolpmL-x6Is~a3~&ZsuIsu`*k-2AG7oQveygEScMVoZHWKvo)O91 z?-dLu)C*Bp;@ zNqRRqKl*WsxuWi_(<_Y6AUYb98j{0hIr^GSu)J~a4MFrLE^N+ni7@Sr)IjvQl-1T5 zjiC?O-?(O8{5|ZqZ0M`PtGEg!7+^`RQ6mkAKINK^6_m`v9&*o-cqio4m0%oui#Wxq zawGn?b*Yd|ZtOkA8195v= zVkm%Ot3DD%<~z59OZsVI Date: Tue, 9 Jan 2024 12:49:03 -0800 Subject: [PATCH 118/298] Regenerate test expectations --- .../execute_and_finalize/child_and_parent.out | 20 +++++++++---------- .../complex_finalization.out | 12 +++++------ .../vm/execute_and_finalize/count_usages.out | 10 +++++----- .../execute_and_finalize/program_callable.out | 14 ++++++------- .../vm/execute_and_finalize/public_wallet.out | 2 +- .../vm/execute_and_finalize/test_rand.out | 6 +++--- .../vm/execute_and_finalize/user_callable.out | 6 +++--- 7 files changed, 35 insertions(+), 35 deletions(-) diff --git a/synthesizer/tests/expectations/vm/execute_and_finalize/child_and_parent.out b/synthesizer/tests/expectations/vm/execute_and_finalize/child_and_parent.out index cf83c9d485..4613f0078b 100644 --- a/synthesizer/tests/expectations/vm/execute_and_finalize/child_and_parent.out +++ b/synthesizer/tests/expectations/vm/execute_and_finalize/child_and_parent.out @@ -4,30 +4,30 @@ outputs: execute: child.aleo/foo: outputs: - - '{"type":"public","id":"3583507900097573902692207210661581535840809808651900827750728854102720512424field","value":"aleo1qr2ha4pfs5l28aze88yn6fhleeythklkczrule2v838uwj65n5gqxt9djx"}' - - '{"type":"public","id":"476166291720572191849579987891810720100233870490756615272004665719966045283field","value":"aleo1qr2ha4pfs5l28aze88yn6fhleeythklkczrule2v838uwj65n5gqxt9djx"}' + - '{"type":"public","id":"8257993261519343122023101166480151323931323787055034156941189634399210202459field","value":"aleo1qr2ha4pfs5l28aze88yn6fhleeythklkczrule2v838uwj65n5gqxt9djx"}' + - '{"type":"public","id":"188190518969019844021095872841035661635298121101628545721182533596213107162field","value":"aleo1qr2ha4pfs5l28aze88yn6fhleeythklkczrule2v838uwj65n5gqxt9djx"}' speculate: the execution was accepted add_next_block: succeeded. - verified: true execute: parent.aleo/foo: outputs: - - '{"type":"public","id":"3761717515751581670491990458123447761370813910339791821189914541241041772398field","value":"aleo16w8t56s7v6ud7vu33fr388ph0dq0c7yhp597cyjt88rr3nultcyqcyk9yy"}' - - '{"type":"public","id":"7311055836597830429601351369404551037507421904626326632284143897137420180918field","value":"aleo1qr2ha4pfs5l28aze88yn6fhleeythklkczrule2v838uwj65n5gqxt9djx"}' - - '{"type":"public","id":"681818897459164396968079033669192296282137044899275115497211144004195398694field","value":"aleo1qr2ha4pfs5l28aze88yn6fhleeythklkczrule2v838uwj65n5gqxt9djx"}' - - '{"type":"public","id":"3417320637392048962499244658848814085037481834432707606558978225870881469204field","value":"aleo1qr2ha4pfs5l28aze88yn6fhleeythklkczrule2v838uwj65n5gqxt9djx"}' + - '{"type":"public","id":"5659858974486313466575226260845503816979591587276786620624467407599116914038field","value":"aleo16w8t56s7v6ud7vu33fr388ph0dq0c7yhp597cyjt88rr3nultcyqcyk9yy"}' + - '{"type":"public","id":"2284865988687012438785552090811369628576124923682194722522318003600012047529field","value":"aleo1qr2ha4pfs5l28aze88yn6fhleeythklkczrule2v838uwj65n5gqxt9djx"}' + - '{"type":"public","id":"8179726172313399939265670838540366852175382310921990612683156165949485580171field","value":"aleo1qr2ha4pfs5l28aze88yn6fhleeythklkczrule2v838uwj65n5gqxt9djx"}' + - '{"type":"public","id":"6136647598927890396739645454509256562231663381292425428013956117563111804111field","value":"aleo1qr2ha4pfs5l28aze88yn6fhleeythklkczrule2v838uwj65n5gqxt9djx"}' speculate: the execution was accepted add_next_block: succeeded. additional: - child_outputs: credits.aleo/fee_public: outputs: - - '{"type":"future","id":"5245767978479482276373144091068362056657622227760198296183689243703275814117field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1qr2ha4pfs5l28aze88yn6fhleeythklkczrule2v838uwj65n5gqxt9djx,\n 1244u64\n ]\n}"}' + - '{"type":"future","id":"8038303756319041464205585758890772107103094147833742185831015274112242397170field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1qr2ha4pfs5l28aze88yn6fhleeythklkczrule2v838uwj65n5gqxt9djx,\n 1244u64\n ]\n}"}' - child_outputs: child.aleo/foo: outputs: - - '{"type":"public","id":"7812033131660295289207078830719348736788767283997224928167372421466500300696field","value":"aleo16w8t56s7v6ud7vu33fr388ph0dq0c7yhp597cyjt88rr3nultcyqcyk9yy"}' - - '{"type":"public","id":"4227271453559074580761782898043117548320729393319599555165417123780466734088field","value":"aleo1qr2ha4pfs5l28aze88yn6fhleeythklkczrule2v838uwj65n5gqxt9djx"}' + - '{"type":"public","id":"8198940315425398645135948347803651217596158581421876066209083610850686200351field","value":"aleo16w8t56s7v6ud7vu33fr388ph0dq0c7yhp597cyjt88rr3nultcyqcyk9yy"}' + - '{"type":"public","id":"3917485763512771512439229660054620197118945473924338831496641922296791545909field","value":"aleo1qr2ha4pfs5l28aze88yn6fhleeythklkczrule2v838uwj65n5gqxt9djx"}' credits.aleo/fee_public: outputs: - - '{"type":"future","id":"8216972065644000579816790328783540313220942313753411501386970051803831099199field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1qr2ha4pfs5l28aze88yn6fhleeythklkczrule2v838uwj65n5gqxt9djx,\n 2123u64\n ]\n}"}' + - '{"type":"future","id":"7679903120497926643469426574546065855464063047315663279655785799119197818907field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1qr2ha4pfs5l28aze88yn6fhleeythklkczrule2v838uwj65n5gqxt9djx,\n 2123u64\n ]\n}"}' diff --git a/synthesizer/tests/expectations/vm/execute_and_finalize/complex_finalization.out b/synthesizer/tests/expectations/vm/execute_and_finalize/complex_finalization.out index d413523f61..da90b48b75 100644 --- a/synthesizer/tests/expectations/vm/execute_and_finalize/complex_finalization.out +++ b/synthesizer/tests/expectations/vm/execute_and_finalize/complex_finalization.out @@ -4,23 +4,23 @@ outputs: execute: four_program.aleo/a: outputs: - - '{"type":"future","id":"665183472055988178271814702289264025474680637838536582821282925188065775088field","value":"{\n program_id: four_program.aleo,\n function_name: a,\n arguments: [\n {\n program_id: two_program.aleo,\n function_name: b,\n arguments: [\n {\n program_id: zero_program.aleo,\n function_name: c,\n arguments: [\n aleo1kw4knandael9qcpxs6g36rr6h7dwvjz6q25ueah6zz9v57zjlvxsx5llq8\n ]\n },\n {\n program_id: one_program.aleo,\n function_name: d,\n arguments: [\n aleo1kw4knandael9qcpxs6g36rr6h7dwvjz6q25ueah6zz9v57zjlvxsx5llq8\n ]\n },\n aleo1kw4knandael9qcpxs6g36rr6h7dwvjz6q25ueah6zz9v57zjlvxsx5llq8\n ]\n },\n {\n program_id: three_program.aleo,\n function_name: e,\n arguments: [\n {\n program_id: two_program.aleo,\n function_name: b,\n arguments: [\n {\n program_id: zero_program.aleo,\n function_name: c,\n arguments: [\n aleo1kw4knandael9qcpxs6g36rr6h7dwvjz6q25ueah6zz9v57zjlvxsx5llq8\n ]\n },\n {\n program_id: one_program.aleo,\n function_name: d,\n arguments: [\n aleo1kw4knandael9qcpxs6g36rr6h7dwvjz6q25ueah6zz9v57zjlvxsx5llq8\n ]\n },\n aleo1kw4knandael9qcpxs6g36rr6h7dwvjz6q25ueah6zz9v57zjlvxsx5llq8\n ]\n },\n {\n program_id: one_program.aleo,\n function_name: d,\n arguments: [\n aleo1kw4knandael9qcpxs6g36rr6h7dwvjz6q25ueah6zz9v57zjlvxsx5llq8\n ]\n },\n {\n program_id: zero_program.aleo,\n function_name: c,\n arguments: [\n aleo1kw4knandael9qcpxs6g36rr6h7dwvjz6q25ueah6zz9v57zjlvxsx5llq8\n ]\n },\n aleo1kw4knandael9qcpxs6g36rr6h7dwvjz6q25ueah6zz9v57zjlvxsx5llq8\n ]\n },\n aleo1kw4knandael9qcpxs6g36rr6h7dwvjz6q25ueah6zz9v57zjlvxsx5llq8\n ]\n}"}' + - '{"type":"future","id":"6998380252357500798386967612861409092158524423455257610860233087309437860154field","value":"{\n program_id: four_program.aleo,\n function_name: a,\n arguments: [\n {\n program_id: two_program.aleo,\n function_name: b,\n arguments: [\n {\n program_id: zero_program.aleo,\n function_name: c,\n arguments: [\n aleo1kw4knandael9qcpxs6g36rr6h7dwvjz6q25ueah6zz9v57zjlvxsx5llq8\n ]\n },\n {\n program_id: one_program.aleo,\n function_name: d,\n arguments: [\n aleo1kw4knandael9qcpxs6g36rr6h7dwvjz6q25ueah6zz9v57zjlvxsx5llq8\n ]\n },\n aleo1kw4knandael9qcpxs6g36rr6h7dwvjz6q25ueah6zz9v57zjlvxsx5llq8\n ]\n },\n {\n program_id: three_program.aleo,\n function_name: e,\n arguments: [\n {\n program_id: two_program.aleo,\n function_name: b,\n arguments: [\n {\n program_id: zero_program.aleo,\n function_name: c,\n arguments: [\n aleo1kw4knandael9qcpxs6g36rr6h7dwvjz6q25ueah6zz9v57zjlvxsx5llq8\n ]\n },\n {\n program_id: one_program.aleo,\n function_name: d,\n arguments: [\n aleo1kw4knandael9qcpxs6g36rr6h7dwvjz6q25ueah6zz9v57zjlvxsx5llq8\n ]\n },\n aleo1kw4knandael9qcpxs6g36rr6h7dwvjz6q25ueah6zz9v57zjlvxsx5llq8\n ]\n },\n {\n program_id: one_program.aleo,\n function_name: d,\n arguments: [\n aleo1kw4knandael9qcpxs6g36rr6h7dwvjz6q25ueah6zz9v57zjlvxsx5llq8\n ]\n },\n {\n program_id: zero_program.aleo,\n function_name: c,\n arguments: [\n aleo1kw4knandael9qcpxs6g36rr6h7dwvjz6q25ueah6zz9v57zjlvxsx5llq8\n ]\n },\n aleo1kw4knandael9qcpxs6g36rr6h7dwvjz6q25ueah6zz9v57zjlvxsx5llq8\n ]\n },\n aleo1kw4knandael9qcpxs6g36rr6h7dwvjz6q25ueah6zz9v57zjlvxsx5llq8\n ]\n}"}' speculate: the execution was accepted add_next_block: succeeded. additional: - child_outputs: zero_program.aleo/c: outputs: - - '{"type":"future","id":"1480766593085211098189114488792207994373740214001639330000129810788271883137field","value":"{\n program_id: zero_program.aleo,\n function_name: c,\n arguments: [\n aleo1kw4knandael9qcpxs6g36rr6h7dwvjz6q25ueah6zz9v57zjlvxsx5llq8\n ]\n}"}' + - '{"type":"future","id":"6474810957906539673522536973574444941819182578686500986059184970228567776990field","value":"{\n program_id: zero_program.aleo,\n function_name: c,\n arguments: [\n aleo1kw4knandael9qcpxs6g36rr6h7dwvjz6q25ueah6zz9v57zjlvxsx5llq8\n ]\n}"}' one_program.aleo/d: outputs: - - '{"type":"future","id":"6874436412573820073608038525233877999669336342335693667065896409420053741810field","value":"{\n program_id: one_program.aleo,\n function_name: d,\n arguments: [\n aleo1kw4knandael9qcpxs6g36rr6h7dwvjz6q25ueah6zz9v57zjlvxsx5llq8\n ]\n}"}' + - '{"type":"future","id":"2284370192295255845302224777470466828981075133309722155924689750590667987972field","value":"{\n program_id: one_program.aleo,\n function_name: d,\n arguments: [\n aleo1kw4knandael9qcpxs6g36rr6h7dwvjz6q25ueah6zz9v57zjlvxsx5llq8\n ]\n}"}' two_program.aleo/b: outputs: - - '{"type":"future","id":"439911297771864655257183196286454333195715414280549536084302592849654672842field","value":"{\n program_id: two_program.aleo,\n function_name: b,\n arguments: [\n {\n program_id: zero_program.aleo,\n function_name: c,\n arguments: [\n aleo1kw4knandael9qcpxs6g36rr6h7dwvjz6q25ueah6zz9v57zjlvxsx5llq8\n ]\n },\n {\n program_id: one_program.aleo,\n function_name: d,\n arguments: [\n aleo1kw4knandael9qcpxs6g36rr6h7dwvjz6q25ueah6zz9v57zjlvxsx5llq8\n ]\n },\n aleo1kw4knandael9qcpxs6g36rr6h7dwvjz6q25ueah6zz9v57zjlvxsx5llq8\n ]\n}"}' + - '{"type":"future","id":"7683124799914168846002043533287386527848546597477854511743024652449265994214field","value":"{\n program_id: two_program.aleo,\n function_name: b,\n arguments: [\n {\n program_id: zero_program.aleo,\n function_name: c,\n arguments: [\n aleo1kw4knandael9qcpxs6g36rr6h7dwvjz6q25ueah6zz9v57zjlvxsx5llq8\n ]\n },\n {\n program_id: one_program.aleo,\n function_name: d,\n arguments: [\n aleo1kw4knandael9qcpxs6g36rr6h7dwvjz6q25ueah6zz9v57zjlvxsx5llq8\n ]\n },\n aleo1kw4knandael9qcpxs6g36rr6h7dwvjz6q25ueah6zz9v57zjlvxsx5llq8\n ]\n}"}' three_program.aleo/e: outputs: - - '{"type":"future","id":"6324349534667114127832388996854882573236888808429320919855235417654165379333field","value":"{\n program_id: three_program.aleo,\n function_name: e,\n arguments: [\n {\n program_id: two_program.aleo,\n function_name: b,\n arguments: [\n {\n program_id: zero_program.aleo,\n function_name: c,\n arguments: [\n aleo1kw4knandael9qcpxs6g36rr6h7dwvjz6q25ueah6zz9v57zjlvxsx5llq8\n ]\n },\n {\n program_id: one_program.aleo,\n function_name: d,\n arguments: [\n aleo1kw4knandael9qcpxs6g36rr6h7dwvjz6q25ueah6zz9v57zjlvxsx5llq8\n ]\n },\n aleo1kw4knandael9qcpxs6g36rr6h7dwvjz6q25ueah6zz9v57zjlvxsx5llq8\n ]\n },\n {\n program_id: one_program.aleo,\n function_name: d,\n arguments: [\n aleo1kw4knandael9qcpxs6g36rr6h7dwvjz6q25ueah6zz9v57zjlvxsx5llq8\n ]\n },\n {\n program_id: zero_program.aleo,\n function_name: c,\n arguments: [\n aleo1kw4knandael9qcpxs6g36rr6h7dwvjz6q25ueah6zz9v57zjlvxsx5llq8\n ]\n },\n aleo1kw4knandael9qcpxs6g36rr6h7dwvjz6q25ueah6zz9v57zjlvxsx5llq8\n ]\n}"}' + - '{"type":"future","id":"1924141467746445803895332427121150983883397442046587101238781615037989484141field","value":"{\n program_id: three_program.aleo,\n function_name: e,\n arguments: [\n {\n program_id: two_program.aleo,\n function_name: b,\n arguments: [\n {\n program_id: zero_program.aleo,\n function_name: c,\n arguments: [\n aleo1kw4knandael9qcpxs6g36rr6h7dwvjz6q25ueah6zz9v57zjlvxsx5llq8\n ]\n },\n {\n program_id: one_program.aleo,\n function_name: d,\n arguments: [\n aleo1kw4knandael9qcpxs6g36rr6h7dwvjz6q25ueah6zz9v57zjlvxsx5llq8\n ]\n },\n aleo1kw4knandael9qcpxs6g36rr6h7dwvjz6q25ueah6zz9v57zjlvxsx5llq8\n ]\n },\n {\n program_id: one_program.aleo,\n function_name: d,\n arguments: [\n aleo1kw4knandael9qcpxs6g36rr6h7dwvjz6q25ueah6zz9v57zjlvxsx5llq8\n ]\n },\n {\n program_id: zero_program.aleo,\n function_name: c,\n arguments: [\n aleo1kw4knandael9qcpxs6g36rr6h7dwvjz6q25ueah6zz9v57zjlvxsx5llq8\n ]\n },\n aleo1kw4knandael9qcpxs6g36rr6h7dwvjz6q25ueah6zz9v57zjlvxsx5llq8\n ]\n}"}' credits.aleo/fee_public: outputs: - - '{"type":"future","id":"2642525527921148655203140665689909230400981948693155278410222306693462629362field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1kw4knandael9qcpxs6g36rr6h7dwvjz6q25ueah6zz9v57zjlvxsx5llq8,\n 1312883u64\n ]\n}"}' + - '{"type":"future","id":"4126822102724917981256079566828474499468063069398209683935093613913514021138field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1kw4knandael9qcpxs6g36rr6h7dwvjz6q25ueah6zz9v57zjlvxsx5llq8,\n 1312883u64\n ]\n}"}' diff --git a/synthesizer/tests/expectations/vm/execute_and_finalize/count_usages.out b/synthesizer/tests/expectations/vm/execute_and_finalize/count_usages.out index 57446ec1dc..a3e6bfa438 100644 --- a/synthesizer/tests/expectations/vm/execute_and_finalize/count_usages.out +++ b/synthesizer/tests/expectations/vm/execute_and_finalize/count_usages.out @@ -12,12 +12,12 @@ additional: - child_outputs: basic_math.aleo/add_and_count: outputs: - - '{"type":"private","id":"8146495595200999887858412726015174541046002665643175756153664146614367276693field","value":"ciphertext1qyqgrgmhxyfjr3cvy50sy2hg8y56suw5wgvytygzms53mp4ms3v26rg226k3t"}' - - '{"type":"future","id":"4731072368922094762332855593966999173744758108005904730949638980529645559135field","value":"{\n program_id: basic_math.aleo,\n function_name: add_and_count,\n arguments: [\n aleo1mrughg5ssadd9fc2uwve7l6u24xn76kyz24zsjtzta03vgkq4vpqggl6fg\n ]\n}"}' + - '{"type":"private","id":"2931416906152139217500676601684895559278058810555470402379383863215944694889field","value":"ciphertext1qyqvksr0mn8etdpt5ud8esh45ux7kwpkt3xe4c6wslz2egz38kdcvyg8lsc2w"}' + - '{"type":"future","id":"5218930982418005953215765906617041537918799720819403880991199101629363614321field","value":"{\n program_id: basic_math.aleo,\n function_name: add_and_count,\n arguments: [\n aleo1mrughg5ssadd9fc2uwve7l6u24xn76kyz24zsjtzta03vgkq4vpqggl6fg\n ]\n}"}' basic_math.aleo/sub_and_count: outputs: - - '{"type":"private","id":"961409263208860904485872221121989324413563522578995015597420037381610399703field","value":"ciphertext1qyqv6unr5dg8tj228pl0vgv32p92mcyxxyf9368salhtfqh0hd4scqc89y5m4"}' - - '{"type":"future","id":"4663027849889985446453275863200868545411574358675486387787337708909316167962field","value":"{\n program_id: basic_math.aleo,\n function_name: sub_and_count,\n arguments: [\n aleo1mrughg5ssadd9fc2uwve7l6u24xn76kyz24zsjtzta03vgkq4vpqggl6fg\n ]\n}"}' + - '{"type":"private","id":"3488605564553623263445079384158588906615626998185976594325667750922281211548field","value":"ciphertext1qyqdgjwlgtweqah8dzgelyhzpk0jsxckr28n2tdtwfzmnzjj7d2zwzqms26nn"}' + - '{"type":"future","id":"8376420147018709384724335862198143063714524641135069419096866845262064600524field","value":"{\n program_id: basic_math.aleo,\n function_name: sub_and_count,\n arguments: [\n aleo1mrughg5ssadd9fc2uwve7l6u24xn76kyz24zsjtzta03vgkq4vpqggl6fg\n ]\n}"}' credits.aleo/fee_public: outputs: - - '{"type":"future","id":"3084534457419184182612834880575828543753579447019853593724174249884664876235field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1kw4knandael9qcpxs6g36rr6h7dwvjz6q25ueah6zz9v57zjlvxsx5llq8,\n 263392u64\n ]\n}"}' + - '{"type":"future","id":"6260909541720264746621909645500014575705106994088979439219462960066635095228field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1kw4knandael9qcpxs6g36rr6h7dwvjz6q25ueah6zz9v57zjlvxsx5llq8,\n 263392u64\n ]\n}"}' diff --git a/synthesizer/tests/expectations/vm/execute_and_finalize/program_callable.out b/synthesizer/tests/expectations/vm/execute_and_finalize/program_callable.out index ee99f813ce..f1d3608f54 100644 --- a/synthesizer/tests/expectations/vm/execute_and_finalize/program_callable.out +++ b/synthesizer/tests/expectations/vm/execute_and_finalize/program_callable.out @@ -5,10 +5,10 @@ outputs: execute: parent.aleo/foo: outputs: - - '{"type":"public","id":"7957417389566842019333476383015223465797041221984916169491225413765492389707field","value":"aleo16w8t56s7v6ud7vu33fr388ph0dq0c7yhp597cyjt88rr3nultcyqcyk9yy"}' - - '{"type":"public","id":"5660332966063165816193998255057769236492104556419359071777110117631685203432field","value":"aleo1qr2ha4pfs5l28aze88yn6fhleeythklkczrule2v838uwj65n5gqxt9djx"}' - - '{"type":"public","id":"119590126009840588550727571915536854356547100414781210870229193044716803923field","value":"aleo1qr2ha4pfs5l28aze88yn6fhleeythklkczrule2v838uwj65n5gqxt9djx"}' - - '{"type":"public","id":"3955648008862663886784245642019540732803638576128766893102159939289033551109field","value":"aleo1qr2ha4pfs5l28aze88yn6fhleeythklkczrule2v838uwj65n5gqxt9djx"}' + - '{"type":"public","id":"2829372819390311696617873264162840896896355516010956180339946389772514775851field","value":"aleo16w8t56s7v6ud7vu33fr388ph0dq0c7yhp597cyjt88rr3nultcyqcyk9yy"}' + - '{"type":"public","id":"1736075082696400606624473443797902938087287553141844508580140047297945071102field","value":"aleo1qr2ha4pfs5l28aze88yn6fhleeythklkczrule2v838uwj65n5gqxt9djx"}' + - '{"type":"public","id":"7619233453435555778275297717545549202007972760925283159360438287135601699719field","value":"aleo1qr2ha4pfs5l28aze88yn6fhleeythklkczrule2v838uwj65n5gqxt9djx"}' + - '{"type":"public","id":"2597622858524047689013532072932839576642557752380297062291865581619628741782field","value":"aleo1qr2ha4pfs5l28aze88yn6fhleeythklkczrule2v838uwj65n5gqxt9djx"}' speculate: the execution was accepted add_next_block: succeeded. additional: @@ -16,8 +16,8 @@ additional: - child_outputs: child.aleo/foo: outputs: - - '{"type":"public","id":"4868721665864264325936496341048001744286749024989285333643604721920380255715field","value":"aleo16w8t56s7v6ud7vu33fr388ph0dq0c7yhp597cyjt88rr3nultcyqcyk9yy"}' - - '{"type":"public","id":"3525177701596468290328849149936712458502828518051227125511453575799774964436field","value":"aleo1qr2ha4pfs5l28aze88yn6fhleeythklkczrule2v838uwj65n5gqxt9djx"}' + - '{"type":"public","id":"1555680711885329781325907130562266430447024930714573248890624102518741752917field","value":"aleo16w8t56s7v6ud7vu33fr388ph0dq0c7yhp597cyjt88rr3nultcyqcyk9yy"}' + - '{"type":"public","id":"1098600096063596467886239395047240422541419832572815880494064602469155799505field","value":"aleo1qr2ha4pfs5l28aze88yn6fhleeythklkczrule2v838uwj65n5gqxt9djx"}' credits.aleo/fee_public: outputs: - - '{"type":"future","id":"1654089975904775845803610306576708885251110717047795439165401945844221766915field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1qr2ha4pfs5l28aze88yn6fhleeythklkczrule2v838uwj65n5gqxt9djx,\n 2123u64\n ]\n}"}' + - '{"type":"future","id":"1893339967665850940775218212916106697902425076268110566466167393920804071573field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1qr2ha4pfs5l28aze88yn6fhleeythklkczrule2v838uwj65n5gqxt9djx,\n 2123u64\n ]\n}"}' diff --git a/synthesizer/tests/expectations/vm/execute_and_finalize/public_wallet.out b/synthesizer/tests/expectations/vm/execute_and_finalize/public_wallet.out index 56505c7242..86b208adf4 100644 --- a/synthesizer/tests/expectations/vm/execute_and_finalize/public_wallet.out +++ b/synthesizer/tests/expectations/vm/execute_and_finalize/public_wallet.out @@ -11,7 +11,7 @@ additional: - child_outputs: token.aleo/mint_public: outputs: - - '{"type":"future","id":"2095235103073153862497986952383880687050623273703041876358116424903602929020field","value":"{\n program_id: token.aleo,\n function_name: mint_public,\n arguments: [\n aleo1sry3pke49ykrf0aeshf889tr98r4c86p5f4ms766795ssdwfdyqq9jdg0j,\n 10u64\n ]\n}"}' + - '{"type":"future","id":"6870476253411913047431672168259118946802015453568356666196082705096404310887field","value":"{\n program_id: token.aleo,\n function_name: mint_public,\n arguments: [\n aleo1sry3pke49ykrf0aeshf889tr98r4c86p5f4ms766795ssdwfdyqq9jdg0j,\n 10u64\n ]\n}"}' credits.aleo/fee_public: outputs: - '{"type":"future","id":"546462310004815308785340027890541933050085460472488305954420334597248699563field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1d3e2je2m2hsxwdsvntvf4jnnlj459ywfry6ch2qwrpy6l6r6yvpq8e88h5,\n 131201u64\n ]\n}"}' diff --git a/synthesizer/tests/expectations/vm/execute_and_finalize/test_rand.out b/synthesizer/tests/expectations/vm/execute_and_finalize/test_rand.out index 43b98a1838..0f83b86e59 100644 --- a/synthesizer/tests/expectations/vm/execute_and_finalize/test_rand.out +++ b/synthesizer/tests/expectations/vm/execute_and_finalize/test_rand.out @@ -18,15 +18,15 @@ outputs: execute: test_rand.aleo/rand_chacha_check: outputs: - - '{"type":"future","id":"3721325135151760660773959530505944451747681933722462808964783147996869797702field","value":"{\n program_id: test_rand.aleo,\n function_name: rand_chacha_check,\n arguments: [\n 0field,\n false\n ]\n}"}' + - '{"type":"future","id":"488590592441422127997725386233571306457829570948543232762424611162021835080field","value":"{\n program_id: test_rand.aleo,\n function_name: rand_chacha_check,\n arguments: [\n 0field,\n false\n ]\n}"}' speculate: the execution was rejected add_next_block: succeeded. - verified: true execute: test_rand.aleo/rand_chacha_check: outputs: - - '{"type":"future","id":"887371549615679800380522845098080464570119184210350810479392117984911457950field","value":"{\n program_id: test_rand.aleo,\n function_name: rand_chacha_check,\n arguments: [\n 1field,\n true\n ]\n}"}' - speculate: the execution was rejected + - '{"type":"future","id":"884323248557348741020456011434839803868309861690594536593949575748229817915field","value":"{\n program_id: test_rand.aleo,\n function_name: rand_chacha_check,\n arguments: [\n 1field,\n true\n ]\n}"}' + speculate: the execution was accepted add_next_block: succeeded. additional: - child_outputs: diff --git a/synthesizer/tests/expectations/vm/execute_and_finalize/user_callable.out b/synthesizer/tests/expectations/vm/execute_and_finalize/user_callable.out index 85f3df23fb..41ce5f1617 100644 --- a/synthesizer/tests/expectations/vm/execute_and_finalize/user_callable.out +++ b/synthesizer/tests/expectations/vm/execute_and_finalize/user_callable.out @@ -4,8 +4,8 @@ outputs: execute: child.aleo/foo: outputs: - - '{"type":"public","id":"3583507900097573902692207210661581535840809808651900827750728854102720512424field","value":"aleo1qr2ha4pfs5l28aze88yn6fhleeythklkczrule2v838uwj65n5gqxt9djx"}' - - '{"type":"public","id":"476166291720572191849579987891810720100233870490756615272004665719966045283field","value":"aleo1qr2ha4pfs5l28aze88yn6fhleeythklkczrule2v838uwj65n5gqxt9djx"}' + - '{"type":"public","id":"8257993261519343122023101166480151323931323787055034156941189634399210202459field","value":"aleo1qr2ha4pfs5l28aze88yn6fhleeythklkczrule2v838uwj65n5gqxt9djx"}' + - '{"type":"public","id":"188190518969019844021095872841035661635298121101628545721182533596213107162field","value":"aleo1qr2ha4pfs5l28aze88yn6fhleeythklkczrule2v838uwj65n5gqxt9djx"}' speculate: the execution was accepted add_next_block: succeeded. - execute: 'Failed to evaluate instruction (call child.aleo/foo into r0 r1;): Failed to evaluate instruction (assert.eq self.caller self.signer ;): ''assert.eq'' failed: ''aleo16w8t56s7v6ud7vu33fr388ph0dq0c7yhp597cyjt88rr3nultcyqcyk9yy'' is not equal to ''aleo1qr2ha4pfs5l28aze88yn6fhleeythklkczrule2v838uwj65n5gqxt9djx'' (should be equal)' @@ -13,5 +13,5 @@ additional: - child_outputs: credits.aleo/fee_public: outputs: - - '{"type":"future","id":"5245767978479482276373144091068362056657622227760198296183689243703275814117field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1qr2ha4pfs5l28aze88yn6fhleeythklkczrule2v838uwj65n5gqxt9djx,\n 1244u64\n ]\n}"}' + - '{"type":"future","id":"8038303756319041464205585758890772107103094147833742185831015274112242397170field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1qr2ha4pfs5l28aze88yn6fhleeythklkczrule2v838uwj65n5gqxt9djx,\n 1244u64\n ]\n}"}' - {} From 6a217b95c75e5d8b3ba2a7ca77f2014f106f2466 Mon Sep 17 00:00:00 2001 From: raychu86 <14917648+raychu86@users.noreply.github.com> Date: Tue, 9 Jan 2024 13:26:04 -0800 Subject: [PATCH 119/298] Fix ordering in test --- synthesizer/src/vm/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/synthesizer/src/vm/mod.rs b/synthesizer/src/vm/mod.rs index d428ed2955..b5cb41db75 100644 --- a/synthesizer/src/vm/mod.rs +++ b/synthesizer/src/vm/mod.rs @@ -946,7 +946,7 @@ function a: // Note: `deployment_transaction_ids` is sorted lexicographically by transaction id, so the order may change if we update internal methods. assert_eq!( deployment_transaction_ids, - vec![deployment_1.id(), deployment_2.id(), deployment_3.id(), deployment_4.id()], + vec![deployment_4.id(), deployment_1.id(), deployment_2.id(), deployment_3.id()], "Update me if serialization has changed" ); } From ee9c26ef462d55b79febf993526c86026ac09a70 Mon Sep 17 00:00:00 2001 From: xuchen <17367073440@163.com> Date: Wed, 10 Jan 2024 20:44:25 +0800 Subject: [PATCH 120/298] add varuna ahp fifth round timer --- .../src/snark/varuna/ahp/prover/round_functions/fifth.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/algorithms/src/snark/varuna/ahp/prover/round_functions/fifth.rs b/algorithms/src/snark/varuna/ahp/prover/round_functions/fifth.rs index c8e0b71e19..e393d8ed28 100644 --- a/algorithms/src/snark/varuna/ahp/prover/round_functions/fifth.rs +++ b/algorithms/src/snark/varuna/ahp/prover/round_functions/fifth.rs @@ -44,6 +44,8 @@ impl AHPForR1CS { state: prover::State<'_, F, SM>, _r: &mut R, ) -> Result, AHPError> { + let round_time = start_timer!(|| "AHP::Prover::FifthRound"); + let lhs_sum: DensePolynomial = cfg_reduce!( cfg_par_bridge!(verifier_message.into_iter().zip_eq(state.lhs_polys_into_iter())).map( |(delta, mut lhs)| { @@ -62,6 +64,8 @@ impl AHPForR1CS { let h_2 = LabeledPolynomial::new("h_2", lhs_sum, None, None); let oracles = prover::FifthOracles { h_2 }; assert!(oracles.matches_info(&Self::fifth_round_polynomial_info())); + + end_timer!(round_time); Ok(oracles) } From d872a4231e428823440b2d52f0a13d7bf692bb8e Mon Sep 17 00:00:00 2001 From: Victor Sint Nicolaas Date: Wed, 10 Jan 2024 17:10:14 +0100 Subject: [PATCH 121/298] Actually limit at max_constraints --- circuit/environment/src/circuit.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/circuit/environment/src/circuit.rs b/circuit/environment/src/circuit.rs index 5f7fc42821..8c94971752 100644 --- a/circuit/environment/src/circuit.rs +++ b/circuit/environment/src/circuit.rs @@ -149,7 +149,7 @@ impl Environment for Circuit { CIRCUIT.with(|circuit| { // Ensure we do not surpass maximum allowed number of constraints MAX_NUM_CONSTRAINTS.with(|max_constraints| { - if circuit.borrow().num_constraints() > max_constraints.get() { + if circuit.borrow().num_constraints() >= max_constraints.get() { Self::halt("Surpassing maximum allowed number of constraints") } }); From 0be9950400419f3de502c242d4771d44a3bc9054 Mon Sep 17 00:00:00 2001 From: Victor Sint Nicolaas Date: Wed, 10 Jan 2024 17:12:31 +0100 Subject: [PATCH 122/298] Use Self::set_constraint_maximum --- circuit/environment/src/circuit.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/circuit/environment/src/circuit.rs b/circuit/environment/src/circuit.rs index 8c94971752..5055788ed5 100644 --- a/circuit/environment/src/circuit.rs +++ b/circuit/environment/src/circuit.rs @@ -284,7 +284,7 @@ impl Environment for Circuit { // Reset the witness mode. IN_WITNESS.with(|in_witness| in_witness.replace(false)); // Reset the max num constraints. - MAX_NUM_CONSTRAINTS.with(|max_num_constraints| max_num_constraints.replace(u64::MAX)); + Self::set_constraint_maximum(u64::MAX); // Eject the R1CS instance. let r1cs = circuit.replace(R1CS::<::BaseField>::new()); // Ensure the circuit is now empty. @@ -305,7 +305,7 @@ impl Environment for Circuit { // Reset the witness mode. IN_WITNESS.with(|in_witness| in_witness.replace(false)); // Reset the num constraints. - MAX_NUM_CONSTRAINTS.with(|max_num_constraints| max_num_constraints.replace(u64::MAX)); + Self::set_constraint_maximum(u64::MAX); // Eject the R1CS instance. let r1cs = circuit.replace(R1CS::<::BaseField>::new()); assert_eq!(0, circuit.borrow().num_constants()); @@ -328,7 +328,7 @@ impl Environment for Circuit { // Reset the witness mode. IN_WITNESS.with(|in_witness| in_witness.replace(false)); // Reset the max num constraints. - MAX_NUM_CONSTRAINTS.with(|max_num_constraints| max_num_constraints.replace(u64::MAX)); + Self::set_constraint_maximum(u64::MAX); *circuit.borrow_mut() = R1CS::<::BaseField>::new(); assert_eq!(0, circuit.borrow().num_constants()); assert_eq!(1, circuit.borrow().num_public()); From 06ab667560e62ae06facacb110953f7d9a9345b2 Mon Sep 17 00:00:00 2001 From: Victor Sint Nicolaas Date: Wed, 10 Jan 2024 17:13:02 +0100 Subject: [PATCH 123/298] Comment nit --- circuit/environment/src/circuit.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/circuit/environment/src/circuit.rs b/circuit/environment/src/circuit.rs index 5055788ed5..505e33f16a 100644 --- a/circuit/environment/src/circuit.rs +++ b/circuit/environment/src/circuit.rs @@ -317,7 +317,7 @@ impl Environment for Circuit { }) } - /// Sets a maximum amount of allowed constraints + /// Sets a maximum number of allowed constraints. fn set_constraint_maximum(new_max_num_constraints: u64) { MAX_NUM_CONSTRAINTS.with(|max_num_constraints| max_num_constraints.replace(new_max_num_constraints)); } From 6b6fc407ace68b53be636f07ebea5a97350538a7 Mon Sep 17 00:00:00 2001 From: Victor Sint Nicolaas Date: Wed, 10 Jan 2024 17:14:08 +0100 Subject: [PATCH 124/298] Convert type early --- ledger/block/src/transaction/deployment/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ledger/block/src/transaction/deployment/mod.rs b/ledger/block/src/transaction/deployment/mod.rs index ddb4790c2d..c253c66ec2 100644 --- a/ledger/block/src/transaction/deployment/mod.rs +++ b/ledger/block/src/transaction/deployment/mod.rs @@ -126,7 +126,7 @@ impl Deployment { /// Returns the total number of constraints. pub fn num_constraints(&self) -> u64 { - self.verifying_keys.iter().map(|(_, (vk, _))| vk.circuit_info.num_constraints).sum::() as u64 + self.verifying_keys.iter().map(|(_, (vk, _))| vk.circuit_info.num_constraints as u64).sum::() } /// Returns the deployment ID. From 726a614d761c2d0eb7353f370623e83b627b2551 Mon Sep 17 00:00:00 2001 From: Victor Sint Nicolaas Date: Wed, 10 Jan 2024 17:15:53 +0100 Subject: [PATCH 125/298] Check that the number of functions matches the number of verifying keys --- synthesizer/process/src/stack/deploy.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/synthesizer/process/src/stack/deploy.rs b/synthesizer/process/src/stack/deploy.rs index 08e158adac..5217c3b709 100644 --- a/synthesizer/process/src/stack/deploy.rs +++ b/synthesizer/process/src/stack/deploy.rs @@ -80,6 +80,11 @@ impl Stack { // Construct the call stacks and assignments used to verify the certificates. let mut call_stacks = Vec::with_capacity(deployment.verifying_keys().len()); + // Check that the number of functions matches the number of verifying keys. + ensure!( + deployment.program().functions().len() == deployment.verifying_keys().len(), + "The number of functions in the program does not match the number of verifying keys" + ); // Iterate through the program functions and construct the callstacks and corresponding assignments. for (function, (_, (verifying_key, _))) in deployment.program().functions().values().zip_eq(deployment.verifying_keys()) From 457334845b922b29d8509f7aa468b99d99100134 Mon Sep 17 00:00:00 2001 From: Victor Sint Nicolaas Date: Wed, 10 Jan 2024 17:18:20 +0100 Subject: [PATCH 126/298] Clean up deployment_cost function --- synthesizer/src/vm/deploy.rs | 2 +- synthesizer/src/vm/helpers/cost.rs | 9 ++++----- synthesizer/src/vm/verify.rs | 2 +- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/synthesizer/src/vm/deploy.rs b/synthesizer/src/vm/deploy.rs index f9e260793c..f548607d52 100644 --- a/synthesizer/src/vm/deploy.rs +++ b/synthesizer/src/vm/deploy.rs @@ -40,7 +40,7 @@ impl> VM { let owner = ProgramOwner::new(private_key, deployment_id, rng)?; // Compute the minimum deployment cost. - let (minimum_deployment_cost, _) = deployment_cost(&deployment)?; + let minimum_deployment_cost = deployment_cost(&deployment)?; // Authorize the fee. let fee_authorization = match fee_record { Some(record) => self.authorize_fee_private( diff --git a/synthesizer/src/vm/helpers/cost.rs b/synthesizer/src/vm/helpers/cost.rs index 7e90b98ad7..4b69e5cd83 100644 --- a/synthesizer/src/vm/helpers/cost.rs +++ b/synthesizer/src/vm/helpers/cost.rs @@ -23,8 +23,8 @@ use synthesizer_program::{Command, Finalize, Instruction}; use std::collections::HashMap; -/// Returns the *minimum* cost in microcredits to publish the given deployment (total cost, (storage cost, namespace cost, synthesis cost)). -pub fn deployment_cost(deployment: &Deployment) -> Result<(u64, (u64, u64, u64))> { +/// Returns the *minimum* cost in microcredits to publish the given deployment total cost. +pub fn deployment_cost(deployment: &Deployment) -> Result { // Determine the number of bytes in the deployment. let size_in_bytes = deployment.size_in_bytes()?; // Retrieve the program ID. @@ -51,11 +51,10 @@ pub fn deployment_cost(deployment: &Deployment) -> Result<(u64, ( // Compute the total cost in microcredits. let total_cost = storage_cost .checked_add(namespace_cost) - .ok_or(anyhow!("The total cost computation overflowed for a deployment"))? - .checked_add(synthesis_cost) + .and_then(|x| x.checked_add(synthesis_cost)) .ok_or(anyhow!("The total cost computation overflowed for a deployment"))?; - Ok((total_cost, (storage_cost, namespace_cost, synthesis_cost))) + Ok(total_cost) } /// Returns the *minimum* cost in microcredits to publish the given execution (total cost, (storage cost, namespace cost)). diff --git a/synthesizer/src/vm/verify.rs b/synthesizer/src/vm/verify.rs index fe036b7e3a..fc4da0243c 100644 --- a/synthesizer/src/vm/verify.rs +++ b/synthesizer/src/vm/verify.rs @@ -146,7 +146,7 @@ impl> VM { bail!("Failed to compute the Merkle root for deployment transaction '{id}'") }; // Compute the deployment cost. - let (cost, _) = deployment_cost(deployment)?; + let cost = deployment_cost(deployment)?; // Ensure the fee is sufficient to cover the cost. if *fee.base_amount()? < cost { bail!("Transaction '{id}' has an insufficient base fee (deployment) - requires {cost} microcredits") From 5d3c2b7c244a225b24f9dd7fb42c8da73020033e Mon Sep 17 00:00:00 2001 From: Victor Sint Nicolaas Date: Wed, 10 Jan 2024 17:20:11 +0100 Subject: [PATCH 127/298] Nit: fix comment --- synthesizer/src/vm/helpers/cost.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/synthesizer/src/vm/helpers/cost.rs b/synthesizer/src/vm/helpers/cost.rs index 4b69e5cd83..554eaeb4ae 100644 --- a/synthesizer/src/vm/helpers/cost.rs +++ b/synthesizer/src/vm/helpers/cost.rs @@ -45,7 +45,7 @@ pub fn deployment_cost(deployment: &Deployment) -> Result { .ok_or(anyhow!("The namespace cost computation overflowed for a deployment"))? .saturating_mul(1_000_000); // 1 microcredit = 1e-6 credits. - // Compute the synthesis cost in credits + // Compute the synthesis cost in microcredits. let synthesis_cost = num_constraints * N::SYNTH_FEE_MULTIPLIER; // Compute the total cost in microcredits. From 896972898a7fb79231352902514d4a8d5056cb86 Mon Sep 17 00:00:00 2001 From: Michael Turner Date: Wed, 10 Jan 2024 12:14:32 -0600 Subject: [PATCH 128/298] Update test expectations --- console/program/src/data/literal/size.rs | 1 + synthesizer/src/vm/helpers/cost.rs | 526 ++---------------- .../arrays_in_finalize.out | 2 +- .../complex_finalization.out | 2 +- .../vm/execute_and_finalize/count_usages.out | 2 +- .../vm/execute_and_finalize/hello.out | 4 +- .../mapping_operations.out | 6 +- .../vm/execute_and_finalize/public_wallet.out | 2 +- .../read_external_mapping.out | 12 +- .../vm/execute_and_finalize/test_branch.out | 6 +- .../vm/execute_and_finalize/test_rand.out | 8 +- .../vm/execute_and_finalize/timelock.out | 4 +- .../execute_and_finalize/unused_position.out | 2 +- 13 files changed, 82 insertions(+), 495 deletions(-) diff --git a/console/program/src/data/literal/size.rs b/console/program/src/data/literal/size.rs index 33ca614212..4f3c97d833 100644 --- a/console/program/src/data/literal/size.rs +++ b/console/program/src/data/literal/size.rs @@ -42,6 +42,7 @@ impl Literal { u16::try_from(size).or_halt_with::("Literal exceeds u16::MAX bits.") } + /// Return the size in bytes of this literal. pub fn size_in_bytes(&self) -> u16 { self.size_in_bits().saturating_add(7).saturating_div(8) } diff --git a/synthesizer/src/vm/helpers/cost.rs b/synthesizer/src/vm/helpers/cost.rs index d12690dd5d..8a2286d16a 100644 --- a/synthesizer/src/vm/helpers/cost.rs +++ b/synthesizer/src/vm/helpers/cost.rs @@ -26,20 +26,23 @@ use synthesizer_program::{CastType, Command, Finalize, Instruction, Operand, Sta use std::collections::HashMap; -// Base finalize costs for compute heavy operations. +// Finalize Costs for compute heavy operations. Used as BASE_COST + PER_BYTE_COST * SIZE_IN_BYTES. const CAST_COMMAND_BASE_COST: u64 = 500; +const CAST_PER_BYTE_COST: u64 = 30; + const GET_COMMAND_BASE_COST: u64 = 10_000; +const GET_COMMAND_PER_BYTE_COST: u64 = 10; + const HASH_BASE_COST: u64 = 10_000; -const HASH_BHP_BASE_COST: u64 = 50_000; -const HASH_PSD_BASE_COST: u64 = 40_000; -const SET_COMMAND_BASE_COST: u64 = 10_000; +const HASH_PER_BYTE_COST: u64 = 30; -// Finalize cost per byte for compute heavy operations. -const CAST_PER_BYTE_COST: u64 = 30; -const GET_COMMAND_PER_BYTE_COST: u64 = 10; +const HASH_BHP_BASE_COST: u64 = 50_000; const HASH_BHP_PER_BYTE_COST: u64 = 300; -const HASH_PER_BYTE_COST: u64 = 30; + +const HASH_PSD_BASE_COST: u64 = 40_000; const HASH_PSD_PER_BYTE_COST: u64 = 75; + +const SET_COMMAND_BASE_COST: u64 = 10_000; const SET_COMMAND_PER_BYTE_COST: u64 = 100; /// Returns the *minimum* cost in microcredits to publish the given deployment (total cost, (storage cost, namespace cost)). @@ -141,7 +144,7 @@ pub fn cost_in_microcredits(stack: &Stack, finalize: &Finalize Ok(base_cost.saturating_add(operand_size.saturating_mul(byte_multiplier))) }; - // Defines the cost of each command. + // Measure the cost of each command. let cost = |command: &Command| match command { Command::Instruction(Instruction::Abs(_)) => Ok(500), Command::Instruction(Instruction::AbsWrapped(_)) => Ok(500), @@ -154,6 +157,8 @@ pub fn cost_in_microcredits(stack: &Stack, finalize: &Finalize Command::Instruction(Instruction::Call(_)) => bail!("`call` is not supported in finalize."), Command::Instruction(Instruction::Cast(cast)) => { let cast_type = cast.cast_type(); + + // Get the price by operand type. match cast_type { CastType::Plaintext(PlaintextType::Literal(_)) => Ok(500), CastType::Plaintext(plaintext_type) => Ok(plaintext_size_in_bytes(stack, plaintext_type)? @@ -164,6 +169,8 @@ pub fn cost_in_microcredits(stack: &Stack, finalize: &Finalize } Command::Instruction(Instruction::CastLossy(cast_lossy)) => { let cast_type = cast_lossy.cast_type(); + + // Get the price by operand type. match cast_type { CastType::Plaintext(PlaintextType::Literal(_)) => Ok(500), CastType::Plaintext(plaintext_type) => Ok(plaintext_size_in_bytes(stack, plaintext_type)? @@ -185,24 +192,23 @@ pub fn cost_in_microcredits(stack: &Stack, finalize: &Finalize size_cost(commit.operands(), HASH_BHP_PER_BYTE_COST, HASH_BHP_BASE_COST) } Command::Instruction(Instruction::CommitPED64(commit)) => { - size_cost(commit.operands(), HASH_PER_BYTE_COST, HASH_BHP_PER_BYTE_COST) + size_cost(commit.operands(), HASH_PER_BYTE_COST, HASH_BASE_COST) } Command::Instruction(Instruction::CommitPED128(commit)) => { - size_cost(commit.operands(), HASH_PER_BYTE_COST, HASH_BHP_BASE_COST) + size_cost(commit.operands(), HASH_PER_BYTE_COST, HASH_BASE_COST) } Command::Instruction(Instruction::Div(div)) => { let operands = div.operands(); - if operands.len() == 2 { - let operand_type = finalize_types.get_type_from_operand(stack, &operands[0])?; - match operand_type { - FinalizeType::Plaintext(PlaintextType::Literal(LiteralType::Field)) => Ok(1_500), - FinalizeType::Plaintext(PlaintextType::Literal(_)) => Ok(500), - FinalizeType::Plaintext(PlaintextType::Array(_)) => bail!("div opcode does not support arrays."), - FinalizeType::Plaintext(PlaintextType::Struct(_)) => bail!("div opcode does not support structs."), - _ => bail!("div opcode does not support futures."), - } - } else { - bail!("div opcode must have exactly two operands."); + ensure!(operands.len() == 2, "div opcode must have exactly two operands."); + + // Get the price by operand type. + let operand_type = finalize_types.get_type_from_operand(stack, &operands[0])?; + match operand_type { + FinalizeType::Plaintext(PlaintextType::Literal(LiteralType::Field)) => Ok(1_500), + FinalizeType::Plaintext(PlaintextType::Literal(_)) => Ok(500), + FinalizeType::Plaintext(PlaintextType::Array(_)) => bail!("div opcode does not support arrays."), + FinalizeType::Plaintext(PlaintextType::Struct(_)) => bail!("div opcode does not support structs."), + _ => bail!("div opcode does not support futures."), } } Command::Instruction(Instruction::DivWrapped(_)) => Ok(500), @@ -231,7 +237,7 @@ pub fn cost_in_microcredits(stack: &Stack, finalize: &Finalize size_cost(hash.operands(), HASH_PER_BYTE_COST, HASH_BASE_COST) } Command::Instruction(Instruction::HashPED64(hash)) => { - size_cost(hash.operands(), HASH_PER_BYTE_COST, HASH_PER_BYTE_COST) + size_cost(hash.operands(), HASH_PER_BYTE_COST, HASH_BASE_COST) } Command::Instruction(Instruction::HashPED128(hash)) => { size_cost(hash.operands(), HASH_PER_BYTE_COST, HASH_BASE_COST) @@ -271,18 +277,17 @@ pub fn cost_in_microcredits(stack: &Stack, finalize: &Finalize Command::Instruction(Instruction::Modulo(_)) => Ok(500), Command::Instruction(Instruction::Mul(mul)) => { let operands = mul.operands(); - if operands.len() == 2 { - let operand_type = finalize_types.get_type_from_operand(stack, &operands[0])?; - match operand_type { - FinalizeType::Plaintext(PlaintextType::Literal(LiteralType::Group)) => Ok(10_000), - FinalizeType::Plaintext(PlaintextType::Literal(LiteralType::Scalar)) => Ok(10_000), - FinalizeType::Plaintext(PlaintextType::Literal(_)) => Ok(500), - FinalizeType::Plaintext(PlaintextType::Array(_)) => bail!("mul opcode does not support arrays."), - FinalizeType::Plaintext(PlaintextType::Struct(_)) => bail!("mul opcode does not support structs."), - _ => bail!("mul opcode does not support futures."), - } - } else { - bail!("pow opcode must have at exactly 2 operands."); + ensure!(operands.len() == 2, "mul opcode must have exactly two operands."); + + // Get the price by operand type. + let operand_type = finalize_types.get_type_from_operand(stack, &operands[0])?; + match operand_type { + FinalizeType::Plaintext(PlaintextType::Literal(LiteralType::Group)) => Ok(10_000), + FinalizeType::Plaintext(PlaintextType::Literal(LiteralType::Scalar)) => Ok(10_000), + FinalizeType::Plaintext(PlaintextType::Literal(_)) => Ok(500), + FinalizeType::Plaintext(PlaintextType::Array(_)) => bail!("mul opcode does not support arrays."), + FinalizeType::Plaintext(PlaintextType::Struct(_)) => bail!("mul opcode does not support structs."), + _ => bail!("mul opcode does not support futures."), } } Command::Instruction(Instruction::MulWrapped(_)) => Ok(500), @@ -293,17 +298,16 @@ pub fn cost_in_microcredits(stack: &Stack, finalize: &Finalize Command::Instruction(Instruction::Or(_)) => Ok(500), Command::Instruction(Instruction::Pow(pow)) => { let operands = pow.operands(); - if operands.is_empty() { - bail!("pow opcode must have at least one operand."); - } else { - let operand_type = finalize_types.get_type_from_operand(stack, &operands[0])?; - match operand_type { - FinalizeType::Plaintext(PlaintextType::Literal(LiteralType::Field)) => Ok(1_500), - FinalizeType::Plaintext(PlaintextType::Literal(_)) => Ok(500), - FinalizeType::Plaintext(PlaintextType::Array(_)) => bail!("pow opcode does not support arrays."), - FinalizeType::Plaintext(PlaintextType::Struct(_)) => bail!("pow opcode does not support structs."), - _ => bail!("pow opcode does not support futures."), - } + ensure!(!operands.is_empty(), "pow opcode must have at least one operand."); + + // Get the price by operand type. + let operand_type = finalize_types.get_type_from_operand(stack, &operands[0])?; + match operand_type { + FinalizeType::Plaintext(PlaintextType::Literal(LiteralType::Field)) => Ok(1_500), + FinalizeType::Plaintext(PlaintextType::Literal(_)) => Ok(500), + FinalizeType::Plaintext(PlaintextType::Array(_)) => bail!("pow opcode does not support arrays."), + FinalizeType::Plaintext(PlaintextType::Struct(_)) => bail!("pow opcode does not support structs."), + _ => bail!("pow opcode does not support futures."), } } Command::Instruction(Instruction::PowWrapped(_)) => Ok(500), @@ -328,8 +332,8 @@ pub fn cost_in_microcredits(stack: &Stack, finalize: &Finalize .saturating_mul(GET_COMMAND_PER_BYTE_COST) .saturating_add(GET_COMMAND_BASE_COST)), Command::GetOrUse(get) => Ok(operand_size_in_bytes(get.key())? - .saturating_mul(SET_COMMAND_PER_BYTE_COST) - .saturating_add(SET_COMMAND_BASE_COST)), + .saturating_mul(GET_COMMAND_PER_BYTE_COST) + .saturating_add(GET_COMMAND_BASE_COST)), Command::RandChaCha(_) => Ok(25_000), Command::Remove(_) => Ok(GET_COMMAND_BASE_COST), Command::Set(set) => Ok(operand_size_in_bytes(set.key())? @@ -339,6 +343,8 @@ pub fn cost_in_microcredits(stack: &Stack, finalize: &Finalize Command::BranchEq(_) | Command::BranchNeq(_) => Ok(500), Command::Position(_) => Ok(100), }; + + // Aggregate the cost of all commands in the program. finalize .commands() .iter() @@ -346,7 +352,7 @@ pub fn cost_in_microcredits(stack: &Stack, finalize: &Finalize .try_fold(0u64, |acc, res| res.and_then(|x| acc.checked_add(x).ok_or(anyhow!("Finalize cost overflowed")))) } -// Helper function to get the plaintext type in bytes +// Helper function to get the plaintext type in bytes. fn plaintext_size_in_bytes(stack: &Stack, plaintext_type: &PlaintextType) -> Result { match plaintext_type { PlaintextType::Literal(literal_type) => Ok(literal_type.size_in_bytes::() as u64), @@ -368,7 +374,7 @@ fn plaintext_size_in_bytes(stack: &Stack, plaintext_type: &Plaint Ok(identifier_size.saturating_add(size_of_members)) } PlaintextType::Array(array_type) => { - // Retrieve the number of elements in the array + // Retrieve the number of elements in the array. let num_array_elements = **array_type.length() as u64; // Retrieve the size of the internal array types. @@ -376,423 +382,3 @@ fn plaintext_size_in_bytes(stack: &Stack, plaintext_type: &Plaint } } } - -#[cfg(test)] -mod tests { - use super::*; - use crate::{vm::test_helpers::CurrentNetwork, Process, Program}; - use circuit::network::AleoV0; - use console::program::Identifier; - - #[test] - fn test_finalize_costs_credits() { - // Get the credits.aleo program. - let program = Program::::credits().unwrap(); - - // Load the process. - let process = Process::::load().unwrap(); - - // Get the stack. - let stack = process.get_stack(program.id()).unwrap(); - - // Function: `bond_public` - let function = program.get_function(&Identifier::from_str("bond_public").unwrap()).unwrap(); - let finalize_cost = cost_in_microcredits(stack, function.finalize_logic().unwrap()).unwrap(); - println!("bond_public finalize cost: {}", finalize_cost); - assert_eq!(198550, finalize_cost); - - // Function: `unbond_public` - let function = program.get_function(&Identifier::from_str("unbond_public").unwrap()).unwrap(); - let finalize_cost = cost_in_microcredits(stack, function.finalize_logic().unwrap()).unwrap(); - println!("unbond_public finalize cost: {}", finalize_cost); - assert_eq!(277880, finalize_cost); - - // Function: `unbond_delegator_as_validator` - let function = program.get_function(&Identifier::from_str("unbond_delegator_as_validator").unwrap()).unwrap(); - let finalize_cost = cost_in_microcredits(stack, function.finalize_logic().unwrap()).unwrap(); - println!("unbond_delegator_as_validator finalize cost: {}", finalize_cost); - assert_eq!(92310, finalize_cost); - - // Function `claim_unbond_public` - let function = program.get_function(&Identifier::from_str("claim_unbond_public").unwrap()).unwrap(); - let finalize_cost = cost_in_microcredits(stack, function.finalize_logic().unwrap()).unwrap(); - println!("claim_unbond_public finalize cost: {}", finalize_cost); - assert_eq!(49020, finalize_cost); - - // Function `set_validator_state` - let function = program.get_function(&Identifier::from_str("set_validator_state").unwrap()).unwrap(); - let finalize_cost = cost_in_microcredits(stack, function.finalize_logic().unwrap()).unwrap(); - println!("set_validator_state finalize cost: {}", finalize_cost); - assert_eq!(27270, finalize_cost); - - // Function: `transfer_public` - let function = program.get_function(&Identifier::from_str("transfer_public").unwrap()).unwrap(); - let finalize_cost = cost_in_microcredits(stack, function.finalize_logic().unwrap()).unwrap(); - println!("transfer_public finalize cost: {}", finalize_cost); - assert_eq!(52520, finalize_cost); - - // Function: `transfer_private` - let function = program.get_function(&Identifier::from_str("transfer_private").unwrap()).unwrap(); - assert!(function.finalize_logic().is_none()); - - // Function: `transfer_private_to_public` - let function = program.get_function(&Identifier::from_str("transfer_private_to_public").unwrap()).unwrap(); - let finalize_cost = cost_in_microcredits(stack, function.finalize_logic().unwrap()).unwrap(); - println!("transfer_private_to_public finalize cost: {}", finalize_cost); - assert_eq!(27700, finalize_cost); - - // Function: `transfer_public_to_private` - let function = program.get_function(&Identifier::from_str("transfer_public_to_private").unwrap()).unwrap(); - let finalize_cost = cost_in_microcredits(stack, function.finalize_logic().unwrap()).unwrap(); - println!("transfer_public_to_private finalize cost: {}", finalize_cost); - assert_eq!(24820, finalize_cost); - - // Function: `join` - let function = program.get_function(&Identifier::from_str("join").unwrap()).unwrap(); - assert!(function.finalize_logic().is_none()); - - // Function: `split` - let function = program.get_function(&Identifier::from_str("split").unwrap()).unwrap(); - assert!(function.finalize_logic().is_none()); - - // Function: `fee_private` - let function = program.get_function(&Identifier::from_str("fee_private").unwrap()).unwrap(); - assert!(function.finalize_logic().is_none()); - - // Function: `fee_public` - let function = program.get_function(&Identifier::from_str("fee_public").unwrap()).unwrap(); - let finalize_cost = cost_in_microcredits(stack, function.finalize_logic().unwrap()).unwrap(); - println!("fee_public finalize cost: {}", finalize_cost); - assert_eq!(24820, finalize_cost); - } - - #[test] - fn test_finalize_costs_structs() { - let rng = &mut TestRng::default(); - - // Define a program - let program_str = r" -program test_program.aleo; -struct small: - a as u64; - b as u64; - c as u64; -struct medium: - a as small; - b as small; - c as small; -struct large: - a as medium; - b as medium; - c as medium; -struct xlarge: - a as large; - b as large; - c as large; -mapping storage_small: - key as u64.public; - value as small.public; -mapping storage_medium: - key as u64.public; - value as medium.public; -mapping storage_large: - key as u64.public; - value as large.public; -mapping storage_xlarge: - key as u64.public; - value as xlarge.public; -function store_small: - input r0 as u64.public; - input r1 as small.public; - async store_small r0 r1 into r2; - output r2 as test_program.aleo/store_small.future; -finalize store_small: - input r0 as u64.public; - input r1 as small.public; - set r1 into storage_small[r0]; -function store_medium: - input r0 as u64.public; - input r1 as medium.public; - async store_medium r0 r1 into r2; - output r2 as test_program.aleo/store_medium.future; -finalize store_medium: - input r0 as u64.public; - input r1 as medium.public; - set r1 into storage_medium[r0]; -function store_large: - input r0 as u64.public; - input r1 as large.public; - async store_large r0 r1 into r2; - output r2 as test_program.aleo/store_large.future; -finalize store_large: - input r0 as u64.public; - input r1 as large.public; - set r1 into storage_large[r0]; -function store_xlarge: - input r0 as u64.public; - input r1 as xlarge.public; - async store_xlarge r0 r1 into r2; - output r2 as test_program.aleo/store_xlarge.future; -finalize store_xlarge: - input r0 as u64.public; - input r1 as xlarge.public; - set r1 into storage_xlarge[r0]; - "; - - // Compile the program. - let program = Program::::from_str(program_str).unwrap(); - - // Load the process. - let mut process = Process::::load().unwrap(); - - // Deploy and load the program. - let deployment = process.deploy::(&program, rng).unwrap(); - process.load_deployment(&deployment).unwrap(); - - // Get the stack. - let stack = process.get_stack(program.id()).unwrap(); - - // Test the price of each execution. - - // Function: `store_small` - let function = program.get_function(&Identifier::from_str("store_small").unwrap()).unwrap(); - let finalize_cost = cost_in_microcredits(stack, function.finalize_logic().unwrap()).unwrap(); - println!("store_small struct finalize cost: {}", finalize_cost); - assert_eq!(13800, finalize_cost); - - // Function: `store_medium` - let function = program.get_function(&Identifier::from_str("store_medium").unwrap()).unwrap(); - let finalize_cost = cost_in_microcredits(stack, function.finalize_logic().unwrap()).unwrap(); - println!("store_medium struct finalize cost: {}", finalize_cost); - assert_eq!(20500, finalize_cost); - - // Function: `store_large` - let function = program.get_function(&Identifier::from_str("store_large").unwrap()).unwrap(); - let finalize_cost = cost_in_microcredits(stack, function.finalize_logic().unwrap()).unwrap(); - println!("store_large struct finalize cost: {}", finalize_cost); - assert_eq!(40500, finalize_cost); - - // Function: `store_xlarge` - let function = program.get_function(&Identifier::from_str("store_xlarge").unwrap()).unwrap(); - let finalize_cost = cost_in_microcredits(stack, function.finalize_logic().unwrap()).unwrap(); - println!("store_xlarge struct finalize cost: {}", finalize_cost); - assert_eq!(100600, finalize_cost); - } - - #[test] - fn test_finalize_costs_arrays() { - let rng = &mut TestRng::default(); - - // Define a program - let program_str = r" -program test_program.aleo; -mapping storage_small: - key as u64.public; - value as [boolean; 8u32].public; -mapping storage_medium: - key as u64.public; - value as [[boolean; 8u32]; 8u32].public; -mapping storage_large: - key as u64.public; - value as [[[boolean; 8u32]; 8u32]; 8u32].public; -mapping storage_xlarge: - key as u64.public; - value as [[[[boolean; 8u32]; 8u32]; 8u32]; 8u32].public; -function store_small: - input r0 as u64.public; - input r1 as [boolean; 8u32].public; - async store_small r0 r1 into r2; - output r2 as test_program.aleo/store_small.future; -finalize store_small: - input r0 as u64.public; - input r1 as [boolean; 8u32].public; - set r1 into storage_small[r0]; -function store_medium: - input r0 as u64.public; - input r1 as [[boolean; 8u32]; 8u32].public; - async store_medium r0 r1 into r2; - output r2 as test_program.aleo/store_medium.future; -finalize store_medium: - input r0 as u64.public; - input r1 as [[boolean; 8u32]; 8u32].public; - set r1 into storage_medium[r0]; -function store_large: - input r0 as u64.public; - input r1 as [[[boolean; 8u32]; 8u32]; 8u32].public; - async store_large r0 r1 into r2; - output r2 as test_program.aleo/store_large.future; -finalize store_large: - input r0 as u64.public; - input r1 as [[[boolean; 8u32]; 8u32]; 8u32].public; - set r1 into storage_large[r0]; -function store_xlarge: - input r0 as u64.public; - input r1 as [[[[boolean; 8u32]; 8u32]; 8u32]; 8u32].public; - async store_xlarge r0 r1 into r2; - output r2 as test_program.aleo/store_xlarge.future; -finalize store_xlarge: - input r0 as u64.public; - input r1 as [[[[boolean; 8u32]; 8u32]; 8u32]; 8u32].public; - set r1 into storage_xlarge[r0]; - "; - - // Compile the program. - let program = Program::::from_str(program_str).unwrap(); - - // Load the process. - let mut process = Process::::load().unwrap(); - - // Deploy and load the program. - let deployment = process.deploy::(&program, rng).unwrap(); - process.load_deployment(&deployment).unwrap(); - - // Get the stack. - let stack = process.get_stack(program.id()).unwrap(); - - // Test the price of each execution. - - // Function: `store_small` - let function = program.get_function(&Identifier::from_str("store_small").unwrap()).unwrap(); - let finalize_cost = cost_in_microcredits(stack, function.finalize_logic().unwrap()).unwrap(); - println!("store_small array finalize cost: {}", finalize_cost); - assert_eq!(11600, finalize_cost); - - // Function: `store_medium` - let function = program.get_function(&Identifier::from_str("store_medium").unwrap()).unwrap(); - let finalize_cost = cost_in_microcredits(stack, function.finalize_logic().unwrap()).unwrap(); - println!("store_medium array finalize cost: {}", finalize_cost); - assert_eq!(17200, finalize_cost); - - // Function: `store_large` - let function = program.get_function(&Identifier::from_str("store_large").unwrap()).unwrap(); - let finalize_cost = cost_in_microcredits(stack, function.finalize_logic().unwrap()).unwrap(); - println!("store_large array finalize cost: {}", finalize_cost); - assert_eq!(62000, finalize_cost); - - // Function: `store_xlarge` - let function = program.get_function(&Identifier::from_str("store_xlarge").unwrap()).unwrap(); - let finalize_cost = cost_in_microcredits(stack, function.finalize_logic().unwrap()).unwrap(); - println!("store_xlarge array finalize cost: {}", finalize_cost); - assert_eq!(420400, finalize_cost); - } - - #[test] - fn test_finalize_costs_heavy_set_usage() { - let rng = &mut TestRng::default(); - - // Define a program - let program_str = r" -program test_program.aleo; -mapping big_map: - key as u128.public; - value as [[[u8; 32u32]; 32u32]; 32u32].public; -function big_finalize: - async big_finalize into r0; - output r0 as test_program.aleo/big_finalize.future; -finalize big_finalize: - rand.chacha into r0 as u128; - cast 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 into r1 as [u8; 32u32]; - cast r1 r1 r1 r1 r1 r1 r1 r1 r1 r1 r1 r1 r1 r1 r1 r1 r1 r1 r1 r1 r1 r1 r1 r1 r1 r1 r1 r1 r1 r1 r1 r1 into r2 as [[u8; 32u32]; 32u32]; - cast r2 r2 r2 r2 r2 r2 r2 r2 r2 r2 r2 r2 r2 r2 r2 r2 r2 r2 r2 r2 r2 r2 r2 r2 r2 r2 r2 r2 r2 r2 r2 r2 into r3 as [[[u8; 32u32]; 32u32]; 32u32]; - add.w r0 0u128 into r4; - set r3 into big_map[r4]; - add.w r0 1u128 into r5; - set r3 into big_map[r5]; - add.w r0 2u128 into r6; - set r3 into big_map[r6]; - add.w r0 3u128 into r7; - set r3 into big_map[r7]; - add.w r0 4u128 into r8; - set r3 into big_map[r8]; - add.w r0 5u128 into r9; - set r3 into big_map[r9]; - add.w r0 6u128 into r10; - set r3 into big_map[r10]; - add.w r0 7u128 into r11; - set r3 into big_map[r11]; - add.w r0 8u128 into r12; - set r3 into big_map[r12]; - add.w r0 9u128 into r13; - set r3 into big_map[r13]; - add.w r0 10u128 into r14; - set r3 into big_map[r14]; - add.w r0 11u128 into r15; - set r3 into big_map[r15]; - add.w r0 12u128 into r16; - set r3 into big_map[r16]; - add.w r0 13u128 into r17; - set r3 into big_map[r17]; - add.w r0 14u128 into r18; - set r3 into big_map[r18]; - add.w r0 15u128 into r19; - set r3 into big_map[r19]; - "; - - // Compile the program. - let program = Program::::from_str(program_str).unwrap(); - - // Load the process. - let mut process = Process::::load().unwrap(); - - // Deploy and load the program. - let deployment = process.deploy::(&program, rng).unwrap(); - process.load_deployment(&deployment).unwrap(); - - // Get the stack. - let stack = process.get_stack(program.id()).unwrap(); - - // Test the price of `big_finalize`. - let function = program.get_function(&Identifier::from_str("big_finalize").unwrap()).unwrap(); - let finalize_cost = cost_in_microcredits(stack, function.finalize_logic().unwrap()).unwrap(); - println!("big_finalize cost: {}", finalize_cost); - assert_eq!(53_663_620, finalize_cost); - } - - #[test] - fn test_finalize_costs_bhp_hash() { - let rng = &mut TestRng::default(); - - // Define a program - let program_str = r" -program test_program.aleo; -function big_hash_finalize: - async big_hash_finalize into r0; - output r0 as test_program.aleo/big_hash_finalize.future; -finalize big_hash_finalize: - rand.chacha into r0 as u128; - cast 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 0u8 into r1 as [u8; 32u32]; - cast r1 r1 r1 r1 r1 r1 r1 r1 r1 r1 r1 r1 r1 r1 r1 r1 r1 r1 r1 r1 r1 r1 r1 r1 r1 r1 r1 r1 r1 r1 r1 r1 into r2 as [[u8; 32u32]; 32u32]; - cast r2 r2 r2 r2 r2 r2 r2 r2 into r3 as [[[u8; 32u32]; 32u32]; 8u32]; - hash.bhp256 r3 into r4 as field; - hash.bhp256 r3 into r5 as field; - hash.bhp256 r3 into r6 as field; - hash.bhp256 r3 into r7 as field; - hash.bhp256 r3 into r8 as field; - hash.bhp256 r3 into r9 as field; - hash.bhp256 r3 into r10 as field; - hash.bhp256 r3 into r11 as field; - hash.bhp256 r3 into r12 as field; - hash.bhp256 r3 into r13 as field; - hash.bhp256 r3 into r14 as field; - "; - - // Compile the program. - let program = Program::::from_str(program_str).unwrap(); - - // Load the process. - let mut process = Process::::load().unwrap(); - - // Deploy and load the program. - let deployment = process.deploy::(&program, rng).unwrap(); - process.load_deployment(&deployment).unwrap(); - - // Get the stack. - let stack = process.get_stack(program.id()).unwrap(); - - // Test the price of `big_hash_finalize`. - let function = program.get_function(&Identifier::from_str("big_hash_finalize").unwrap()).unwrap(); - let finalize_cost = cost_in_microcredits(stack, function.finalize_logic().unwrap()).unwrap(); - println!("big_hash_finalize cost: {}", finalize_cost); - assert_eq!(27_887_540, finalize_cost); - } -} diff --git a/synthesizer/tests/expectations/vm/execute_and_finalize/arrays_in_finalize.out b/synthesizer/tests/expectations/vm/execute_and_finalize/arrays_in_finalize.out index 2f99747752..298de42589 100644 --- a/synthesizer/tests/expectations/vm/execute_and_finalize/arrays_in_finalize.out +++ b/synthesizer/tests/expectations/vm/execute_and_finalize/arrays_in_finalize.out @@ -15,4 +15,4 @@ additional: - child_outputs: credits.aleo/fee_public: outputs: - - '{"type":"future","id":"611935698929626281656171069026748974326705967123466685855354594539166326131field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1y9t0y4lvhm43qdzlfjmfzh8985vfnx9ms368p07x5lsemet5ey8qt0ssjn,\n 21758u64\n ]\n}"}' + - '{"type":"future","id":"556322987248660656181874631130498225249351480130664735786071929543340364972field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1y9t0y4lvhm43qdzlfjmfzh8985vfnx9ms368p07x5lsemet5ey8qt0ssjn,\n 6998u64\n ]\n}"}' diff --git a/synthesizer/tests/expectations/vm/execute_and_finalize/complex_finalization.out b/synthesizer/tests/expectations/vm/execute_and_finalize/complex_finalization.out index d413523f61..69d75417bb 100644 --- a/synthesizer/tests/expectations/vm/execute_and_finalize/complex_finalization.out +++ b/synthesizer/tests/expectations/vm/execute_and_finalize/complex_finalization.out @@ -23,4 +23,4 @@ additional: - '{"type":"future","id":"6324349534667114127832388996854882573236888808429320919855235417654165379333field","value":"{\n program_id: three_program.aleo,\n function_name: e,\n arguments: [\n {\n program_id: two_program.aleo,\n function_name: b,\n arguments: [\n {\n program_id: zero_program.aleo,\n function_name: c,\n arguments: [\n aleo1kw4knandael9qcpxs6g36rr6h7dwvjz6q25ueah6zz9v57zjlvxsx5llq8\n ]\n },\n {\n program_id: one_program.aleo,\n function_name: d,\n arguments: [\n aleo1kw4knandael9qcpxs6g36rr6h7dwvjz6q25ueah6zz9v57zjlvxsx5llq8\n ]\n },\n aleo1kw4knandael9qcpxs6g36rr6h7dwvjz6q25ueah6zz9v57zjlvxsx5llq8\n ]\n },\n {\n program_id: one_program.aleo,\n function_name: d,\n arguments: [\n aleo1kw4knandael9qcpxs6g36rr6h7dwvjz6q25ueah6zz9v57zjlvxsx5llq8\n ]\n },\n {\n program_id: zero_program.aleo,\n function_name: c,\n arguments: [\n aleo1kw4knandael9qcpxs6g36rr6h7dwvjz6q25ueah6zz9v57zjlvxsx5llq8\n ]\n },\n aleo1kw4knandael9qcpxs6g36rr6h7dwvjz6q25ueah6zz9v57zjlvxsx5llq8\n ]\n}"}' credits.aleo/fee_public: outputs: - - '{"type":"future","id":"2642525527921148655203140665689909230400981948693155278410222306693462629362field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1kw4knandael9qcpxs6g36rr6h7dwvjz6q25ueah6zz9v57zjlvxsx5llq8,\n 1312883u64\n ]\n}"}' + - '{"type":"future","id":"5358114436174047912418431092567237141714616554863693970941642035836686431176field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1kw4knandael9qcpxs6g36rr6h7dwvjz6q25ueah6zz9v57zjlvxsx5llq8,\n 264083u64\n ]\n}"}' diff --git a/synthesizer/tests/expectations/vm/execute_and_finalize/count_usages.out b/synthesizer/tests/expectations/vm/execute_and_finalize/count_usages.out index bc0c5af71d..f032924437 100644 --- a/synthesizer/tests/expectations/vm/execute_and_finalize/count_usages.out +++ b/synthesizer/tests/expectations/vm/execute_and_finalize/count_usages.out @@ -20,4 +20,4 @@ additional: - '{"type":"future","id":"4663027849889985446453275863200868545411574358675486387787337708909316167962field","value":"{\n program_id: basic_math.aleo,\n function_name: sub_and_count,\n arguments: [\n aleo1mrughg5ssadd9fc2uwve7l6u24xn76kyz24zsjtzta03vgkq4vpqggl6fg\n ]\n}"}' credits.aleo/fee_public: outputs: - - '{"type":"future","id":"3084534457419184182612834880575828543753579447019853593724174249884664876235field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1kw4knandael9qcpxs6g36rr6h7dwvjz6q25ueah6zz9v57zjlvxsx5llq8,\n 263392u64\n ]\n}"}' + - '{"type":"future","id":"2741745286815710932199673511076059175519310408821981191485651262352099775520field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1kw4knandael9qcpxs6g36rr6h7dwvjz6q25ueah6zz9v57zjlvxsx5llq8,\n 54532u64\n ]\n}"}' diff --git a/synthesizer/tests/expectations/vm/execute_and_finalize/hello.out b/synthesizer/tests/expectations/vm/execute_and_finalize/hello.out index 4ee4b5c467..516c60540e 100644 --- a/synthesizer/tests/expectations/vm/execute_and_finalize/hello.out +++ b/synthesizer/tests/expectations/vm/execute_and_finalize/hello.out @@ -42,8 +42,8 @@ additional: - child_outputs: credits.aleo/fee_public: outputs: - - '{"type":"future","id":"7264507997475302694771209211625280132862970630053323876707987175500028146955field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo10knkelvnd55fsaarm25wch7p9suf2tqlgwy5k4nxwms6d262xyfqm2tccr,\n 5334u64\n ]\n}"}' + - '{"type":"future","id":"8369211508565315020341851737059770155248242826353501428813006153839579490270field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo10knkelvnd55fsaarm25wch7p9suf2tqlgwy5k4nxwms6d262xyfqm2tccr,\n 2334u64\n ]\n}"}' - child_outputs: credits.aleo/fee_public: outputs: - - '{"type":"future","id":"2296589459402270097535149680764663519350069575816165257148428557434644368237field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo10knkelvnd55fsaarm25wch7p9suf2tqlgwy5k4nxwms6d262xyfqm2tccr,\n 5334u64\n ]\n}"}' + - '{"type":"future","id":"1877419676580380048815387112735428358958976123626274808548576558485409142726field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo10knkelvnd55fsaarm25wch7p9suf2tqlgwy5k4nxwms6d262xyfqm2tccr,\n 2334u64\n ]\n}"}' diff --git a/synthesizer/tests/expectations/vm/execute_and_finalize/mapping_operations.out b/synthesizer/tests/expectations/vm/execute_and_finalize/mapping_operations.out index 6b2773e6cf..e3fbf28781 100644 --- a/synthesizer/tests/expectations/vm/execute_and_finalize/mapping_operations.out +++ b/synthesizer/tests/expectations/vm/execute_and_finalize/mapping_operations.out @@ -36,12 +36,12 @@ additional: - child_outputs: credits.aleo/fee_public: outputs: - - '{"type":"future","id":"767852843394263062723803642109980847781175859546892255347263461730875281315field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1eakarna6a70pg9r0l9qal20faejwctgur5xt7lnc2a42wj2yssfqc89rk8,\n 154810u64\n ]\n}"}' + - '{"type":"future","id":"4957917081916426466807932571479215847884653825711490609630360535910149135547field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1eakarna6a70pg9r0l9qal20faejwctgur5xt7lnc2a42wj2yssfqc89rk8,\n 53040u64\n ]\n}"}' - child_outputs: credits.aleo/fee_public: outputs: - - '{"type":"future","id":"5831877738131393412656336446760308055442933218729238434398743654782252530700field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1eakarna6a70pg9r0l9qal20faejwctgur5xt7lnc2a42wj2yssfqc89rk8,\n 154810u64\n ]\n}"}' + - '{"type":"future","id":"1278469186485830285322645835771369427156092634741492136079115154846290610118field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1eakarna6a70pg9r0l9qal20faejwctgur5xt7lnc2a42wj2yssfqc89rk8,\n 53040u64\n ]\n}"}' - child_outputs: credits.aleo/fee_public: outputs: - - '{"type":"future","id":"3924911723698610328779426182874581891939297874519691347932588542992608923909field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1eakarna6a70pg9r0l9qal20faejwctgur5xt7lnc2a42wj2yssfqc89rk8,\n 154810u64\n ]\n}"}' + - '{"type":"future","id":"2506755926518984335206091935851722748517759597724948267044791747967597199713field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1eakarna6a70pg9r0l9qal20faejwctgur5xt7lnc2a42wj2yssfqc89rk8,\n 53040u64\n ]\n}"}' diff --git a/synthesizer/tests/expectations/vm/execute_and_finalize/public_wallet.out b/synthesizer/tests/expectations/vm/execute_and_finalize/public_wallet.out index cbb7f2d77c..35bbfdb4d9 100644 --- a/synthesizer/tests/expectations/vm/execute_and_finalize/public_wallet.out +++ b/synthesizer/tests/expectations/vm/execute_and_finalize/public_wallet.out @@ -14,4 +14,4 @@ additional: - '{"type":"future","id":"2095235103073153862497986952383880687050623273703041876358116424903602929020field","value":"{\n program_id: token.aleo,\n function_name: mint_public,\n arguments: [\n aleo1sry3pke49ykrf0aeshf889tr98r4c86p5f4ms766795ssdwfdyqq9jdg0j,\n 10u64\n ]\n}"}' credits.aleo/fee_public: outputs: - - '{"type":"future","id":"4373249435479943424484888940718424132561120812144078253060284512525421799293field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1d3e2je2m2hsxwdsvntvf4jnnlj459ywfry6ch2qwrpy6l6r6yvpq8e88h5,\n 131201u64\n ]\n}"}' + - '{"type":"future","id":"6943732983905631051438802895354686733220383491857205992254143066333267120361field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1d3e2je2m2hsxwdsvntvf4jnnlj459ywfry6ch2qwrpy6l6r6yvpq8e88h5,\n 27521u64\n ]\n}"}' diff --git a/synthesizer/tests/expectations/vm/execute_and_finalize/read_external_mapping.out b/synthesizer/tests/expectations/vm/execute_and_finalize/read_external_mapping.out index a729b3163e..7cdb1d062e 100644 --- a/synthesizer/tests/expectations/vm/execute_and_finalize/read_external_mapping.out +++ b/synthesizer/tests/expectations/vm/execute_and_finalize/read_external_mapping.out @@ -50,24 +50,24 @@ additional: - child_outputs: credits.aleo/fee_public: outputs: - - '{"type":"future","id":"2373837014611692049497129045871775574464197133932453792739782919776486496194field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1xe2fps8f9xpdas2q0fqy22uraenk84tvvzetrsyxgnwy6445h59s6wv78x,\n 28479u64\n ]\n}"}' + - '{"type":"future","id":"1034866905111222518346328492904414567007364910520580400889955138247432217394field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1xe2fps8f9xpdas2q0fqy22uraenk84tvvzetrsyxgnwy6445h59s6wv78x,\n 12299u64\n ]\n}"}' - child_outputs: credits.aleo/fee_public: outputs: - - '{"type":"future","id":"6963949699870804211203514659901328830518734684604845622658837353595728006898field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1xe2fps8f9xpdas2q0fqy22uraenk84tvvzetrsyxgnwy6445h59s6wv78x,\n 28507u64\n ]\n}"}' + - '{"type":"future","id":"1265051547903959975725673189753618343650720671872947419646574445177182686822field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1xe2fps8f9xpdas2q0fqy22uraenk84tvvzetrsyxgnwy6445h59s6wv78x,\n 12327u64\n ]\n}"}' - child_outputs: credits.aleo/fee_public: outputs: - - '{"type":"future","id":"786151097471386478439918490898626420968604200995134718973623517242949574field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1f6eg623knp66cwx0926w3plgdgzcmfpgyrzgnjz90mucgs3z7s9qls4upm,\n 101210u64\n ]\n}"}' + - '{"type":"future","id":"3571494518225450761893325088159778767525620096574197716418422259635581023606field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1f6eg623knp66cwx0926w3plgdgzcmfpgyrzgnjz90mucgs3z7s9qls4upm,\n 14510u64\n ]\n}"}' - child_outputs: credits.aleo/fee_public: outputs: - - '{"type":"future","id":"7962216909726487379370954492051267200961073450060603523391007597642835489177field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1xe2fps8f9xpdas2q0fqy22uraenk84tvvzetrsyxgnwy6445h59s6wv78x,\n 28479u64\n ]\n}"}' + - '{"type":"future","id":"767268630185344089709361684217243984491360733569453427158278214110086759993field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1xe2fps8f9xpdas2q0fqy22uraenk84tvvzetrsyxgnwy6445h59s6wv78x,\n 12299u64\n ]\n}"}' - child_outputs: credits.aleo/fee_public: outputs: - - '{"type":"future","id":"5340444358291789813118792762028331134214990505407681376089964565359528622453field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1f6eg623knp66cwx0926w3plgdgzcmfpgyrzgnjz90mucgs3z7s9qls4upm,\n 101214u64\n ]\n}"}' + - '{"type":"future","id":"515470792034495668297376756891257205872005100503641125119930903809958436871field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1f6eg623knp66cwx0926w3plgdgzcmfpgyrzgnjz90mucgs3z7s9qls4upm,\n 14514u64\n ]\n}"}' - child_outputs: credits.aleo/fee_public: outputs: - - '{"type":"future","id":"7708776674386621879381619680665250794376507748822342974632850445134733330595field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1xe2fps8f9xpdas2q0fqy22uraenk84tvvzetrsyxgnwy6445h59s6wv78x,\n 28479u64\n ]\n}"}' + - '{"type":"future","id":"2039458085688196480364689033298422539367303174095350701061438385798309924475field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1xe2fps8f9xpdas2q0fqy22uraenk84tvvzetrsyxgnwy6445h59s6wv78x,\n 12299u64\n ]\n}"}' diff --git a/synthesizer/tests/expectations/vm/execute_and_finalize/test_branch.out b/synthesizer/tests/expectations/vm/execute_and_finalize/test_branch.out index 7c414c0ce3..51a0e505bb 100644 --- a/synthesizer/tests/expectations/vm/execute_and_finalize/test_branch.out +++ b/synthesizer/tests/expectations/vm/execute_and_finalize/test_branch.out @@ -25,12 +25,12 @@ additional: - child_outputs: credits.aleo/fee_public: outputs: - - '{"type":"future","id":"8176559465483810586872674176090912007328770812617215482809916166686904238834field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1x3r205zqql5ywy0cqqt74k0r0htuusn0d037ycxe8ftt9ep8hyzsmqz4dh,\n 17268u64\n ]\n}"}' + - '{"type":"future","id":"1043329015023463545868338366452732825980144361477311505744042678709756043232field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1x3r205zqql5ywy0cqqt74k0r0htuusn0d037ycxe8ftt9ep8hyzsmqz4dh,\n 3468u64\n ]\n}"}' - child_outputs: credits.aleo/fee_public: outputs: - - '{"type":"future","id":"885516194992930770292437059317184478627651975125735363573325083543887608918field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1x3r205zqql5ywy0cqqt74k0r0htuusn0d037ycxe8ftt9ep8hyzsmqz4dh,\n 17268u64\n ]\n}"}' + - '{"type":"future","id":"7339449875924263514097068843833332549470263046214924765277199991765434854021field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1x3r205zqql5ywy0cqqt74k0r0htuusn0d037ycxe8ftt9ep8hyzsmqz4dh,\n 3468u64\n ]\n}"}' - child_outputs: credits.aleo/fee_public: outputs: - - '{"type":"future","id":"6884773732489674095657820682011451719106395760464004244662697484163781295818field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1x3r205zqql5ywy0cqqt74k0r0htuusn0d037ycxe8ftt9ep8hyzsmqz4dh,\n 17268u64\n ]\n}"}' + - '{"type":"future","id":"2189532779997306064203973624134810839619576771948859919638987913359586696293field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1x3r205zqql5ywy0cqqt74k0r0htuusn0d037ycxe8ftt9ep8hyzsmqz4dh,\n 3468u64\n ]\n}"}' diff --git a/synthesizer/tests/expectations/vm/execute_and_finalize/test_rand.out b/synthesizer/tests/expectations/vm/execute_and_finalize/test_rand.out index 4fefc62cfd..b844cd993a 100644 --- a/synthesizer/tests/expectations/vm/execute_and_finalize/test_rand.out +++ b/synthesizer/tests/expectations/vm/execute_and_finalize/test_rand.out @@ -19,14 +19,14 @@ outputs: test_rand.aleo/rand_chacha_check: outputs: - '{"type":"future","id":"3721325135151760660773959530505944451747681933722462808964783147996869797702field","value":"{\n program_id: test_rand.aleo,\n function_name: rand_chacha_check,\n arguments: [\n 0field,\n false\n ]\n}"}' - speculate: the execution was accepted + speculate: the execution was rejected add_next_block: succeeded. - verified: true execute: test_rand.aleo/rand_chacha_check: outputs: - '{"type":"future","id":"887371549615679800380522845098080464570119184210350810479392117984911457950field","value":"{\n program_id: test_rand.aleo,\n function_name: rand_chacha_check,\n arguments: [\n 1field,\n true\n ]\n}"}' - speculate: the execution was accepted + speculate: the execution was rejected add_next_block: succeeded. additional: - child_outputs: @@ -40,8 +40,8 @@ additional: - child_outputs: credits.aleo/fee_public: outputs: - - '{"type":"future","id":"5227003534986816857285932061757797688706802206018964764622184983760566708322field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1uchf7kruskpp8thlnfeya9qeklcjss27j6rtu74zz7ch559neqystgslsp,\n 28344u64\n ]\n}"}' + - '{"type":"future","id":"2235519363312249894331374626734089246462248133844940703883141454592352970142field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1uchf7kruskpp8thlnfeya9qeklcjss27j6rtu74zz7ch559neqystgslsp,\n 26844u64\n ]\n}"}' - child_outputs: credits.aleo/fee_public: outputs: - - '{"type":"future","id":"5806769723479332130567002952494928256138310337461654699762319212831997850826field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1uchf7kruskpp8thlnfeya9qeklcjss27j6rtu74zz7ch559neqystgslsp,\n 28344u64\n ]\n}"}' + - '{"type":"future","id":"3872787062422346550021545689265326329549098790422331609154195765908934720518field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1uchf7kruskpp8thlnfeya9qeklcjss27j6rtu74zz7ch559neqystgslsp,\n 26844u64\n ]\n}"}' diff --git a/synthesizer/tests/expectations/vm/execute_and_finalize/timelock.out b/synthesizer/tests/expectations/vm/execute_and_finalize/timelock.out index 425f80af2e..b0c0295563 100644 --- a/synthesizer/tests/expectations/vm/execute_and_finalize/timelock.out +++ b/synthesizer/tests/expectations/vm/execute_and_finalize/timelock.out @@ -18,8 +18,8 @@ additional: - child_outputs: credits.aleo/fee_public: outputs: - - '{"type":"future","id":"2868527388214006275127069563021857572887489216649877337285946162120321568912field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo12tksdptp7hvxly8tkm3um08fvf53qpehsgdgqfvy9pe3sewcq5ysjg5myy,\n 5164u64\n ]\n}"}' + - '{"type":"future","id":"1579302527319401268891511728549021293412982928569029694828814128539871728674field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo12tksdptp7hvxly8tkm3um08fvf53qpehsgdgqfvy9pe3sewcq5ysjg5myy,\n 2164u64\n ]\n}"}' - child_outputs: credits.aleo/fee_public: outputs: - - '{"type":"future","id":"3666380379303443004933801395245329857516145915761366182794264005536589963556field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo12tksdptp7hvxly8tkm3um08fvf53qpehsgdgqfvy9pe3sewcq5ysjg5myy,\n 5164u64\n ]\n}"}' + - '{"type":"future","id":"3640013315585167642099072152033016478172512922218043555020880293943767200521field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo12tksdptp7hvxly8tkm3um08fvf53qpehsgdgqfvy9pe3sewcq5ysjg5myy,\n 2164u64\n ]\n}"}' diff --git a/synthesizer/tests/expectations/vm/execute_and_finalize/unused_position.out b/synthesizer/tests/expectations/vm/execute_and_finalize/unused_position.out index c5e300b026..c2c32bb055 100644 --- a/synthesizer/tests/expectations/vm/execute_and_finalize/unused_position.out +++ b/synthesizer/tests/expectations/vm/execute_and_finalize/unused_position.out @@ -11,4 +11,4 @@ additional: - child_outputs: credits.aleo/fee_public: outputs: - - '{"type":"future","id":"5889749875317192883762347751185109427367185401929794748301981981444845203330field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo12tksdptp7hvxly8tkm3um08fvf53qpehsgdgqfvy9pe3sewcq5ysjg5myy,\n 2176u64\n ]\n}"}' + - '{"type":"future","id":"5765710012732865202158420681023672143187750047446838880498023753307398349592field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo12tksdptp7hvxly8tkm3um08fvf53qpehsgdgqfvy9pe3sewcq5ysjg5myy,\n 1276u64\n ]\n}"}' From 25480b9cef2518c23c08af7e77c75fb4d5b464db Mon Sep 17 00:00:00 2001 From: bishopcheckmate Date: Wed, 10 Jan 2024 19:46:58 +0100 Subject: [PATCH 129/298] perf: remove unnecessary allocation in check_next_block --- ledger/block/src/transactions/mod.rs | 2 +- ledger/src/check_next_block.rs | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/ledger/block/src/transactions/mod.rs b/ledger/block/src/transactions/mod.rs index 2eb3a31372..e49dc6a9d1 100644 --- a/ledger/block/src/transactions/mod.rs +++ b/ledger/block/src/transactions/mod.rs @@ -176,7 +176,7 @@ impl Transactions { /// Returns a parallel iterator over all transactions, for all transactions in `self`. #[cfg(not(feature = "serial"))] - pub fn par_iter(&self) -> impl '_ + ParallelIterator> { + pub fn par_iter(&self) -> impl '_ + IndexedParallelIterator> { self.transactions.par_values() } diff --git a/ledger/src/check_next_block.rs b/ledger/src/check_next_block.rs index 18a1ee2544..f46ee3ac69 100644 --- a/ledger/src/check_next_block.rs +++ b/ledger/src/check_next_block.rs @@ -41,11 +41,10 @@ impl> Ledger { } // Ensure each transaction is well-formed and unique. - // TODO: this intermediate allocation shouldn't be necessary; this is most likely https://github.com/rust-lang/rust/issues/89418. - let transactions = block.transactions().iter().collect::>(); + let transactions = block.transactions(); let rngs = (0..transactions.len()).map(|_| StdRng::from_seed(rng.gen())).collect::>(); cfg_iter!(transactions).zip(rngs).try_for_each(|(transaction, mut rng)| { - self.check_transaction_basic(*transaction, transaction.to_rejected_id()?, &mut rng) + self.check_transaction_basic(transaction, transaction.to_rejected_id()?, &mut rng) .map_err(|e| anyhow!("Invalid transaction found in the transactions list: {e}")) })?; From 6fa0b3b9aadd2ebcf9b4b7b33d00992ca8ef35a1 Mon Sep 17 00:00:00 2001 From: raychu86 <14917648+raychu86@users.noreply.github.com> Date: Wed, 10 Jan 2024 15:17:07 -0800 Subject: [PATCH 130/298] Avoid possible truncation --- ledger/narwhal/subdag/src/lib.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ledger/narwhal/subdag/src/lib.rs b/ledger/narwhal/subdag/src/lib.rs index dc3f5995c1..5f039015d5 100644 --- a/ledger/narwhal/subdag/src/lib.rs +++ b/ledger/narwhal/subdag/src/lib.rs @@ -100,7 +100,7 @@ fn weighted_median(timestamps_and_stake: Vec<(i64, u64)>) -> i64 { for (timestamp, stake) in timestamps_and_stake.iter() { accumulated_stake = accumulated_stake.saturating_add(*stake); current_timestamp = *timestamp; - if accumulated_stake >= total_stake.saturating_div(2) { + if accumulated_stake.saturating_mul(2) >= total_stake { break; } } @@ -328,6 +328,10 @@ mod tests { // Test a case with a empty set. assert_eq!(weighted_median(vec![]), 0); + // Test a case where there is possible truncation. + let data = vec![(1, 1), (2, 1), (3, 1), (4, 1), (5, 1)]; + assert_eq!(weighted_median(data), 3); + // Test a case where weights of 0 do not affect the median. let data = vec![(1, 10), (2, 0), (3, 0), (4, 0), (5, 20), (6, 0), (7, 10)]; assert_eq!(weighted_median(data), 5); From 5989793cc66dd5fe869b9cf29948ad9809592092 Mon Sep 17 00:00:00 2001 From: raychu86 <14917648+raychu86@users.noreply.github.com> Date: Wed, 10 Jan 2024 15:18:54 -0800 Subject: [PATCH 131/298] clippy --- ledger/committee/src/lib.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ledger/committee/src/lib.rs b/ledger/committee/src/lib.rs index dca9462ee9..042ca103af 100644 --- a/ledger/committee/src/lib.rs +++ b/ledger/committee/src/lib.rs @@ -295,9 +295,9 @@ pub mod test_helpers { // Add in the minimum and maximum staked nodes. members.insert(Address::::new(rng.gen()), (MIN_VALIDATOR_STAKE, false)); while members.len() < num_members as usize - 1 { - let stake = MIN_VALIDATOR_STAKE as f64; + let stake = MIN_VALIDATOR_STAKE; let is_open = rng.gen(); - members.insert(Address::::new(rng.gen()), (stake as u64, is_open)); + members.insert(Address::::new(rng.gen()), (stake, is_open)); } // Return the committee. Committee::::new(1, members).unwrap() From 52e6ee02a893111281e90b53e00a341d1f617ef6 Mon Sep 17 00:00:00 2001 From: Howard Wu <9260812+howardwu@users.noreply.github.com> Date: Wed, 10 Jan 2024 16:30:29 -0800 Subject: [PATCH 132/298] Update synthesizer/snark/src/verifying_key/mod.rs Signed-off-by: Howard Wu <9260812+howardwu@users.noreply.github.com> --- synthesizer/snark/src/verifying_key/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/synthesizer/snark/src/verifying_key/mod.rs b/synthesizer/snark/src/verifying_key/mod.rs index 93d6084101..4ce1a39efe 100644 --- a/synthesizer/snark/src/verifying_key/mod.rs +++ b/synthesizer/snark/src/verifying_key/mod.rs @@ -73,7 +73,7 @@ impl VerifyingKey { let num_expected_keys = inputs.len(); let keys_to_inputs: BTreeMap<_, _> = inputs.iter().map(|(verifying_key, inputs)| (verifying_key.deref(), inputs.as_slice())).collect(); - ensure!(keys_to_inputs.len() == num_expected_keys, "invalid number of keys for batch proof"); + ensure!(keys_to_inputs.len() == num_expected_keys, "Incorrect number of verifying keys for batch proof"); // Retrieve the verification parameters. let universal_verifier = N::varuna_universal_verifier(); From 761cd20919a04da1a12b6a652e068718f48aad5d Mon Sep 17 00:00:00 2001 From: Howard Wu <9260812+howardwu@users.noreply.github.com> Date: Wed, 10 Jan 2024 16:30:48 -0800 Subject: [PATCH 133/298] Update synthesizer/snark/src/proving_key/mod.rs Signed-off-by: Howard Wu <9260812+howardwu@users.noreply.github.com> --- synthesizer/snark/src/proving_key/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/synthesizer/snark/src/proving_key/mod.rs b/synthesizer/snark/src/proving_key/mod.rs index e07cc06e7a..5fa51ee2a1 100644 --- a/synthesizer/snark/src/proving_key/mod.rs +++ b/synthesizer/snark/src/proving_key/mod.rs @@ -70,7 +70,7 @@ impl ProvingKey { .iter() .map(|(proving_key, assignments)| (proving_key.deref(), assignments.as_slice())) .collect(); - ensure!(instances.len() == num_expected_instances, "duplicate proving keys found"); + ensure!(instances.len() == num_expected_instances, "Found duplicate proving keys"); // Retrieve the proving parameters. let universal_prover = N::varuna_universal_prover(); From 7017d5e6be1c774b642fad63f206010baee4a2d0 Mon Sep 17 00:00:00 2001 From: raychu86 <14917648+raychu86@users.noreply.github.com> Date: Wed, 10 Jan 2024 16:33:19 -0800 Subject: [PATCH 134/298] Add uniqueness checks for BatchCertificate signature authors --- ledger/narwhal/batch-certificate/src/lib.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/ledger/narwhal/batch-certificate/src/lib.rs b/ledger/narwhal/batch-certificate/src/lib.rs index 3e9fede619..f07b57af5e 100644 --- a/ledger/narwhal/batch-certificate/src/lib.rs +++ b/ledger/narwhal/batch-certificate/src/lib.rs @@ -105,6 +105,14 @@ impl BatchCertificate { // Ensure that the number of signatures is within bounds. ensure!(signatures.len() <= Self::MAX_SIGNATURES, "Invalid number of signatures"); + // Ensure that the signature is from a unique signer and not from the author. + let signature_authors = signatures.iter().map(|signature| signature.to_address()).collect::>(); + ensure!( + !signature_authors.contains(&batch_header.author()), + "The author's signature was included in the signers" + ); + ensure!(!has_duplicates(signature_authors), "A duplicate author was found in the set of signatures"); + // Verify the signatures are valid. cfg_iter!(signatures).try_for_each(|signature| { if !signature.verify(&signature.to_address(), &[batch_header.batch_id()]) { From 37916d728fc3cf6ab4e6da069aaaadd4afb1e631 Mon Sep 17 00:00:00 2001 From: Howard Wu <9260812+howardwu@users.noreply.github.com> Date: Wed, 10 Jan 2024 16:34:49 -0800 Subject: [PATCH 135/298] Update synthesizer/snark/src/verifying_key/mod.rs Signed-off-by: Howard Wu <9260812+howardwu@users.noreply.github.com> --- synthesizer/snark/src/verifying_key/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/synthesizer/snark/src/verifying_key/mod.rs b/synthesizer/snark/src/verifying_key/mod.rs index 4ce1a39efe..a9494acf79 100644 --- a/synthesizer/snark/src/verifying_key/mod.rs +++ b/synthesizer/snark/src/verifying_key/mod.rs @@ -87,7 +87,7 @@ impl VerifyingKey { "{}", format!(" • Verified '{locator}': {is_valid} (in {} ms)", timer.elapsed().as_millis()).dimmed() ); - if is_valid { Ok(()) } else { bail!("batch proof is invalid") } + if is_valid { Ok(()) } else { bail!("'verify_batch' failed") } } Err(error) => { #[cfg(feature = "aleo-cli")] From c1d0898b59ed23313a0cfad2c7e4e0707f3e990c Mon Sep 17 00:00:00 2001 From: Howard Wu <9260812+howardwu@users.noreply.github.com> Date: Wed, 10 Jan 2024 16:35:04 -0800 Subject: [PATCH 136/298] Pass through error --- synthesizer/process/src/trace/mod.rs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/synthesizer/process/src/trace/mod.rs b/synthesizer/process/src/trace/mod.rs index 99380fe866..69789b89f2 100644 --- a/synthesizer/process/src/trace/mod.rs +++ b/synthesizer/process/src/trace/mod.rs @@ -314,9 +314,6 @@ impl Trace { verifier_inputs.push((verifying_key, batch_inclusion_inputs)); } // Verify the proof. - match VerifyingKey::verify_batch(locator, verifier_inputs, proof) { - Ok(()) => Ok(()), - Err(_) => bail!("Failed to verify proof"), - } + VerifyingKey::verify_batch(locator, verifier_inputs, proof).map_err(|e| anyhow!("Failed to verify proof - {e}")) } } From 84c8992a60b9d53fc4ed59f796ef8f36ce6e44e7 Mon Sep 17 00:00:00 2001 From: Howard Wu <9260812+howardwu@users.noreply.github.com> Date: Wed, 10 Jan 2024 16:39:10 -0800 Subject: [PATCH 137/298] Update synthesizer/snark/src/proving_key/mod.rs Signed-off-by: Howard Wu <9260812+howardwu@users.noreply.github.com> --- synthesizer/snark/src/proving_key/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/synthesizer/snark/src/proving_key/mod.rs b/synthesizer/snark/src/proving_key/mod.rs index 5fa51ee2a1..5f13807c33 100644 --- a/synthesizer/snark/src/proving_key/mod.rs +++ b/synthesizer/snark/src/proving_key/mod.rs @@ -70,7 +70,7 @@ impl ProvingKey { .iter() .map(|(proving_key, assignments)| (proving_key.deref(), assignments.as_slice())) .collect(); - ensure!(instances.len() == num_expected_instances, "Found duplicate proving keys"); + ensure!(instances.len() == num_expected_instances, "Incorrect number of proving keys for batch proof"); // Retrieve the proving parameters. let universal_prover = N::varuna_universal_prover(); From dae7e1de20c067ffb11f339424243a8601033aca Mon Sep 17 00:00:00 2001 From: raychu86 <14917648+raychu86@users.noreply.github.com> Date: Wed, 10 Jan 2024 16:41:44 -0800 Subject: [PATCH 138/298] Use an indexset for the checks --- ledger/narwhal/batch-certificate/src/lib.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ledger/narwhal/batch-certificate/src/lib.rs b/ledger/narwhal/batch-certificate/src/lib.rs index f07b57af5e..40043e76a6 100644 --- a/ledger/narwhal/batch-certificate/src/lib.rs +++ b/ledger/narwhal/batch-certificate/src/lib.rs @@ -106,12 +106,12 @@ impl BatchCertificate { ensure!(signatures.len() <= Self::MAX_SIGNATURES, "Invalid number of signatures"); // Ensure that the signature is from a unique signer and not from the author. - let signature_authors = signatures.iter().map(|signature| signature.to_address()).collect::>(); + let signature_authors = signatures.iter().map(|signature| signature.to_address()).collect::>(); ensure!( !signature_authors.contains(&batch_header.author()), "The author's signature was included in the signers" ); - ensure!(!has_duplicates(signature_authors), "A duplicate author was found in the set of signatures"); + ensure!(signature_authors.len() == signatures.len(), "A duplicate author was found in the set of signatures"); // Verify the signatures are valid. cfg_iter!(signatures).try_for_each(|signature| { From 72f65fd8c0b840889e9548ecac7271d90ed714eb Mon Sep 17 00:00:00 2001 From: raychu86 <14917648+raychu86@users.noreply.github.com> Date: Wed, 10 Jan 2024 16:46:31 -0800 Subject: [PATCH 139/298] Use hashset --- ledger/narwhal/batch-certificate/src/lib.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ledger/narwhal/batch-certificate/src/lib.rs b/ledger/narwhal/batch-certificate/src/lib.rs index 40043e76a6..64ddc93470 100644 --- a/ledger/narwhal/batch-certificate/src/lib.rs +++ b/ledger/narwhal/batch-certificate/src/lib.rs @@ -29,6 +29,7 @@ use narwhal_transmission_id::TransmissionID; use core::hash::{Hash, Hasher}; use indexmap::{IndexMap, IndexSet}; +use std::collections::HashSet; #[cfg(not(feature = "serial"))] use rayon::prelude::*; @@ -106,7 +107,7 @@ impl BatchCertificate { ensure!(signatures.len() <= Self::MAX_SIGNATURES, "Invalid number of signatures"); // Ensure that the signature is from a unique signer and not from the author. - let signature_authors = signatures.iter().map(|signature| signature.to_address()).collect::>(); + let signature_authors = signatures.iter().map(|signature| signature.to_address()).collect::>(); ensure!( !signature_authors.contains(&batch_header.author()), "The author's signature was included in the signers" From 50886d5578ebfeab7817d60f33fe810658ac15e0 Mon Sep 17 00:00:00 2001 From: ljedrz Date: Thu, 11 Jan 2024 15:12:23 +0100 Subject: [PATCH 140/298] fix: avoid an overflow when summing batch sizes Signed-off-by: ljedrz --- algorithms/src/snark/varuna/data_structures/proof.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/algorithms/src/snark/varuna/data_structures/proof.rs b/algorithms/src/snark/varuna/data_structures/proof.rs index 1fc4962215..7ebc495714 100644 --- a/algorithms/src/snark/varuna/data_structures/proof.rs +++ b/algorithms/src/snark/varuna/data_structures/proof.rs @@ -88,7 +88,7 @@ impl Commitments { compress: Compress, validate: Validate, ) -> Result { - let mut w = Vec::with_capacity(batch_sizes.iter().sum()); + let mut w = Vec::new(); for batch_size in batch_sizes { w.extend(deserialize_vec_without_len(&mut reader, compress, validate, *batch_size)?); } @@ -261,7 +261,11 @@ impl Proof { /// Check that the number of messages is consistent with our batch size pub fn check_batch_sizes(&self) -> Result<(), SNARKError> { - let total_instances = self.batch_sizes.iter().sum::(); + let total_instances = self + .batch_sizes + .iter() + .try_fold(0usize, |acc, &size| acc.checked_add(size)) + .ok_or(SNARKError::BatchSizeMismatch)?; if self.commitments.witness_commitments.len() != total_instances { return Err(SNARKError::BatchSizeMismatch); } From 3a9be5990b09451d936ad88a9de9beb94a23977b Mon Sep 17 00:00:00 2001 From: raychu86 <14917648+raychu86@users.noreply.github.com> Date: Thu, 11 Jan 2024 15:06:11 -0800 Subject: [PATCH 141/298] Regenerate genesis block --- .../src/testnet3/resources/block.genesis | Bin 13728 -> 13732 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/parameters/src/testnet3/resources/block.genesis b/parameters/src/testnet3/resources/block.genesis index 2751faa0802b96c1e871e195b859d0c91384d460..abe285614b768d80cb0b6692a792cee0b681954b 100644 GIT binary patch delta 11045 zcmY+}Wl$VjyRhLI26qqc?(XjHPLKq5cNqqEcXx;25ZpBof_nl4ch|s|cb{|K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Y5Bmo3)u1*drHR;7yNP6KSti_T{0oGVNNkt-aqW6u2cuB{aZ*1$VtK341cjYkU)P z0U!GKKfJ}eQ(-^aX``Z05Jhz8K3-N|72JdzW;k^NMMo3?K&E>l!U?ThsTv!NT;^~4 z)s|Rq(ID+)Z&F<4vS3+G2$r&^1yo|H6-k_8+iL(t2-&F{XHm^Y{F)8T?s-Nq;U`b7 Y+L(Y)FpX8DV={~7{(pFi&lCIq0D=uV0ssI2 From 7a80f874a7e0fc6192b604a508e9abfeb770c498 Mon Sep 17 00:00:00 2001 From: raychu86 <14917648+raychu86@users.noreply.github.com> Date: Thu, 11 Jan 2024 15:13:20 -0800 Subject: [PATCH 142/298] Fix serialization --- ledger/block/src/serialize.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ledger/block/src/serialize.rs b/ledger/block/src/serialize.rs index 5b92707fc3..653afade40 100644 --- a/ledger/block/src/serialize.rs +++ b/ledger/block/src/serialize.rs @@ -29,7 +29,7 @@ impl Serialize for Block { if let Some(solutions) = &self.solutions { block.serialize_field("solutions", solutions)?; } - block.serialize_field("aborted_transaction_ids", &self.aborted_solution_ids)?; + block.serialize_field("aborted_solution_ids", &self.aborted_solution_ids)?; block.serialize_field("transactions", &self.transactions)?; block.serialize_field("aborted_transaction_ids", &self.aborted_transaction_ids)?; From 71c49cf9e834dcc199f9c8671579b236dd8c53a1 Mon Sep 17 00:00:00 2001 From: raychu86 <14917648+raychu86@users.noreply.github.com> Date: Thu, 11 Jan 2024 15:21:45 -0800 Subject: [PATCH 143/298] Regenerate genesis block --- parameters/src/testnet3/genesis.rs | 2 +- .../src/testnet3/resources/block.genesis | Bin 13732 -> 13732 bytes 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/parameters/src/testnet3/genesis.rs b/parameters/src/testnet3/genesis.rs index 344db0d17e..9c62cb2f4e 100644 --- a/parameters/src/testnet3/genesis.rs +++ b/parameters/src/testnet3/genesis.rs @@ -27,6 +27,6 @@ mod tests { #[test] fn test_genesis_block() { let bytes = GenesisBytes::load_bytes(); - assert_eq!(13728, bytes.len() as u64, "Update me if serialization has changed"); + assert_eq!(13732, bytes.len() as u64, "Update me if serialization has changed"); } } diff --git a/parameters/src/testnet3/resources/block.genesis b/parameters/src/testnet3/resources/block.genesis index abe285614b768d80cb0b6692a792cee0b681954b..cb6e34fabb06875332af76d3fd3c15a35097b491 100644 GIT binary patch delta 11021 zcmZwNRaBJk;`Z^Gfnn(GMx-00K^mk(q&uXMkQQc0=@_~jq`N`7rKP(Cq#FVM{@m~0 z>)mVZ=Xeh0o`dgv)^$Gxb_I4cz;EXSAN(t5)1MHpNLR;w;?0U6R?Oaw`DGk#)I2pe zSaCEG)Ds46Poq=C4USaf4Vuza@+bobcon%ATb&HFV}XUo=y3rH;uamRZHj|ypHOPS zUf(#<5y}(?)m->$H*E14Z6c0eBOrOKiDoVUMB@-01%n;?*(L(Qr-emy^u)bn>Ii1h{Nmz85 z?nOgtmqsNR2m(;tnsuBx0)KHz-o}k*kQH`JdDTXC9YFEAo?C8{$q_8`;vx?HX)pp1 zqm^6OqxN8MolV8!bGBvIV42F)8Z_WNyEEbT{Nb6u!_jGBbNTW*n(+X#I7MPf6;!F% zPR0}r1fT-|*oEJJ0000G0$hm|N$kFP9mla=FlfAT`MUEg)6$21Z2vg5Qt65vxpwAr zUeDqy^=Gamjt>WvGq?%*waNDW+}^`2g>)B|SbxqAU@_}`J*&Ndv8_LP|JGn$;tM0J zDlyze^*X)UQ1F{G4iMeJ#@ywDgSm^Ph0RA-S^x+L*aU^m3pA9B2q%0;jn%4Rhxae; zInCaF6yi@|^Ni0JT#&ao+*%MM^HvUjO*!2R;W_eiQ`r^wl7~C&^y2nZM z{AeX3ZE1CTc8KgWdqOt-=uQWB-4{8hL5^3WG!j3(QIHB%GQ?xZ+g9{LM(@x%&aTob z?C{0Jvd2A3lR{gXpLJtc1G!gDzP7rn)ImUP2hg!v>Ie-v4i92A>;dDuz}!%Xs^;{h zY<#tb_CR6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M8M5mgDSO%+n&N)Xvqed|81Q1D2o~ea}YdIj4Dqr<9 zHf3Je@1TjcTbC^wQtqCBZhjH?Qr@jj=w_^x3vzzIhX8-LAjq~V<_NXEXD~*}xfA%L z_?|2PSz5>8m^e|BNt-v*!gfYwGecua;(oBoJsy0JM={3j(RE!C*;Z!PZHhJLMUJCSGr=H54sr1-L z1Ktx(if-5LEF=uSE0}y@&?dWoCW(hQ4kz$kN7n4tIxAgVdkHHv=FN#UOr(a9U@I~) zS$tfGbG;t^sEdnDk(-C=L$U#O(7Z@0;?5Xmu7%Q$q{xjwmZeq3MAU|Zra)`gO&g>a zYsn8-*adTY*?wyVS+9nIB}}#V`f-=Me|(=nhony!s~r;aw=>Unj$fD1jQ3g9+7-|S zAgozM1`*jQLx(B@eBezsU%)W}D8?5vtDQYEre) zYPd%|AA&}!%9;6a^CRS@ds*y7>1I+e%m{o(QH#4Eza~{ciruiOac0_aQ%9TJzlJua zz0h1D(2TSm{KO43bTOYeDOv3puyoJq(OTO#qoj`e z&NTF$$hD4xTpPOXdG&~Uosf}HA(Hul*n^_S6v$h;*Oq9W{;<&M8E<~tNDss^y8Z9Q z70=Lr^K~7g=poDAF4ME01m6Y0N4ML^xCq+YLH!I&%Kf$I5_B%%eh5{8yAGdJi*52i!jJ0gt=Rt3)aglqC$6R}bak{E3jX*%K7Gd> F`#)3oRGa_+ From f2c6818bca4eaf2718f86ef8677ee7556f468a12 Mon Sep 17 00:00:00 2001 From: raychu86 <14917648+raychu86@users.noreply.github.com> Date: Thu, 11 Jan 2024 17:25:25 -0800 Subject: [PATCH 144/298] Abort transactions that attempt to create already existing outputs --- synthesizer/src/vm/finalize.rs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/synthesizer/src/vm/finalize.rs b/synthesizer/src/vm/finalize.rs index 8c9422d153..f209d2be8f 100644 --- a/synthesizer/src/vm/finalize.rs +++ b/synthesizer/src/vm/finalize.rs @@ -223,6 +223,8 @@ impl> VM { let mut counter = 0u32; // Initialize a list of spent input IDs. let mut input_ids: IndexSet> = IndexSet::new(); + // Initialize a list of spent output IDs. + let mut output_ids: IndexSet> = IndexSet::new(); // Finalize the transactions. 'outer: for transaction in transactions { @@ -248,6 +250,19 @@ impl> VM { } } + // Ensure that the transaction is not producing a duplicate output. + for output_id in transaction.output_ids() { + // If the output ID is already spent in this block or previous blocks, abort the transaction. + if output_ids.contains(output_id) + || self.transition_store().contains_output_id(output_id).unwrap_or(true) + { + // Store the aborted transaction. + aborted.push((transaction.clone(), format!("Duplicate output {output_id}"))); + // Continue to the next transaction. + continue 'outer; + } + } + // Process the transaction in an isolated atomic batch. // - If the transaction succeeds, the finalize operations are stored. // - If the transaction fails, the atomic batch is aborted and no finalize operations are stored. @@ -363,6 +378,8 @@ impl> VM { Ok(confirmed_transaction) => { // Add the input IDs to the set of spent input IDs. input_ids.extend(confirmed_transaction.transaction().input_ids()); + // Add the output IDs to the set of spent output IDs. + output_ids.extend(confirmed_transaction.transaction().output_ids()); // Store the confirmed transaction. confirmed.push(confirmed_transaction); // Increment the transaction index counter. From 11f69bac85c80657676cf6e668c6bb5f291888da Mon Sep 17 00:00:00 2001 From: Victor Sint Nicolaas Date: Fri, 12 Jan 2024 20:44:46 +0100 Subject: [PATCH 145/298] Avoid panic in reindex_by_subdomain --- algorithms/src/fft/domain.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/algorithms/src/fft/domain.rs b/algorithms/src/fft/domain.rs index c121e9bfe2..bbac0f4c1d 100644 --- a/algorithms/src/fft/domain.rs +++ b/algorithms/src/fft/domain.rs @@ -319,7 +319,7 @@ impl EvaluationDomain { /// Given an index in the `other` subdomain, return an index into this domain `self` /// This assumes the `other`'s elements are also `self`'s first elements pub fn reindex_by_subdomain(&self, other: &Self, index: usize) -> Result { - ensure!(self.size() >= other.size(), "other.size() must be smaller than self.size()"); + ensure!(self.size() > other.size(), "other.size() must be smaller than self.size()"); // Let this subgroup be G, and the subgroup we're re-indexing by be S. // Since its a subgroup, the 0th element of S is at index 0 in G, the first element of S is at From 452399046b80039c2a3b949956b7879ad0eb884f Mon Sep 17 00:00:00 2001 From: raychu86 <14917648+raychu86@users.noreply.github.com> Date: Fri, 12 Jan 2024 16:44:27 -0800 Subject: [PATCH 146/298] Add test for duplicate output ids --- ledger/src/tests.rs | 136 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 136 insertions(+) diff --git a/ledger/src/tests.rs b/ledger/src/tests.rs index 997a3a875e..3c5777aadd 100644 --- a/ledger/src/tests.rs +++ b/ledger/src/tests.rs @@ -759,6 +759,142 @@ fn test_execute_duplicate_input_ids() { assert_eq!(block.aborted_transaction_ids(), &vec![transfer_4_id]); } +#[test] +fn test_execute_duplicate_output_ids() { + let rng = &mut TestRng::default(); + + // Initialize the test environment. + let crate::test_helpers::TestEnv { ledger, private_key, address, .. } = crate::test_helpers::sample_test_env(rng); + + // Deploy a test program to the ledger. + let program = Program::::from_str( + " +program dummy_program.aleo; + +record dummy_program: + owner as address.private; + rand_var as u64.private; + +function create_duplicate_record: + input r0 as u64.private; + cast self.caller 1u64 into r1 as dummy_program.record; + output r1 as dummy_program.record;", + ) + .unwrap(); + + // Deploy. + let deployment_transaction = ledger.vm.deploy(&private_key, &program, None, 0, None, rng).unwrap(); + // Verify. + ledger.vm().check_transaction(&deployment_transaction, None, rng).unwrap(); + + // Construct the next block. + let block = ledger + .prepare_advance_to_next_beacon_block(&private_key, vec![], vec![], vec![deployment_transaction], rng) + .unwrap(); + + // Check that the next block is valid. + ledger.check_next_block(&block, rng).unwrap(); + // Add the block to the ledger. + ledger.advance_to_next_block(&block).unwrap(); + + // Create a transaction with different transition ids, but with a fixed output record (output ID). + let mut create_transaction_with_duplicate_output_id = |x: u64| -> Transaction { + // Use a fixed seed RNG. + let fixed_rng = &mut TestRng::from_seed(1); + + // Create a transaction with a fixed rng. + let inputs = [Value::from_str(&format!("{x}u64")).unwrap()]; + let transaction = ledger + .vm + .execute( + &private_key, + ("dummy_program.aleo", "create_duplicate_record"), + inputs.into_iter(), + None, + 0, + None, + fixed_rng, + ) + .unwrap(); + // Extract the execution. + let execution = transaction.execution().unwrap().clone(); + + // Create a new fee for the execution. + let fee_authorization = ledger + .vm + .authorize_fee_public( + &private_key, + *transaction.fee_amount().unwrap(), + 0, + execution.to_execution_id().unwrap(), + rng, + ) + .unwrap(); + let fee = ledger.vm.execute_fee_authorization(fee_authorization, None, rng).unwrap(); + + Transaction::from_execution(execution, Some(fee)).unwrap() + }; + + // Create the first transfer. + let transfer_1 = create_transaction_with_duplicate_output_id(1); + let transfer_1_id = transfer_1.id(); + + // Create a second transfer with the same output id. + let transfer_2 = create_transaction_with_duplicate_output_id(2); + let transfer_2_id = transfer_2.id(); + + // Create a third transfer with the same output id. + let transfer_3 = create_transaction_with_duplicate_output_id(3); + let transfer_3_id = transfer_3.id(); + + // Ensure that each transaction has a duplicate output id. + let tx_1_output_id = transfer_1.output_ids().next().unwrap(); + let tx_2_output_id = transfer_2.output_ids().next().unwrap(); + let tx_3_output_id = transfer_3.output_ids().next().unwrap(); + assert_eq!(tx_1_output_id, tx_2_output_id); + assert_eq!(tx_1_output_id, tx_3_output_id); + + // Create a block. + let block = ledger + .prepare_advance_to_next_beacon_block(&private_key, vec![], vec![], vec![transfer_1, transfer_2], rng) + .unwrap(); + + // Check that the next block is valid. + ledger.check_next_block(&block, rng).unwrap(); + + // Add the block to the ledger. + ledger.advance_to_next_block(&block).unwrap(); + + // Enforce that the block transactions were correct. + assert_eq!(block.transactions().num_accepted(), 1); + assert_eq!(block.transactions().transaction_ids().collect::>(), vec![&transfer_1_id]); + assert_eq!(block.aborted_transaction_ids(), &vec![transfer_2_id]); + + // Prepare a transfer that will succeed for the subsequent block. + let inputs = [Value::from_str(&format!("{address}")).unwrap(), Value::from_str("1000u64").unwrap()]; + let transfer_4 = ledger + .vm + .execute(&private_key, ("credits.aleo", "transfer_public"), inputs.into_iter(), None, 0, None, rng) + .unwrap(); + let transfer_4_id = transfer_4.id(); + + // Create a block. + let block = ledger + .prepare_advance_to_next_beacon_block(&private_key, vec![], vec![], vec![transfer_3, transfer_4], rng) + .unwrap(); + + // Check that the next block is valid. + ledger.check_next_block(&block, rng).unwrap(); + + // Add the block to the ledger. + ledger.advance_to_next_block(&block).unwrap(); + + // Enforce that the block transactions were correct. + assert_eq!(block.transactions().num_accepted(), 1); + assert_eq!(block.transactions().transaction_ids().collect::>(), vec![&transfer_4_id]); + assert_eq!(block.aborted_transaction_ids(), &vec![transfer_3_id]); +} + #[test] fn test_deployment_duplicate_program_id() { let rng = &mut TestRng::default(); From 91c2679f72f4a8f6bca417d6968bbcb89320ebe7 Mon Sep 17 00:00:00 2001 From: xuchen <17367073440@163.com> Date: Mon, 15 Jan 2024 17:54:53 +0800 Subject: [PATCH 147/298] fix varuna select annotation --- algorithms/src/snark/varuna/ahp/selectors.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/algorithms/src/snark/varuna/ahp/selectors.rs b/algorithms/src/snark/varuna/ahp/selectors.rs index b6831e5423..6bf9744ae2 100644 --- a/algorithms/src/snark/varuna/ahp/selectors.rs +++ b/algorithms/src/snark/varuna/ahp/selectors.rs @@ -85,7 +85,7 @@ pub(crate) fn apply_randomized_selector( // This removes a mul and div by v_H operation over each circuit's (target_domain - src_domain) // We have two scenario's: either we return a remainder witness or there is none. if !remainder_witness { - // Substituting in s_i, we get that poly_i * s_i / v_H = poly_i / v_H * (H_i.size() / H.size()); + // Substituting in s_i, we get that poly_i * s_i / v_H = poly_i / v_H_i * (H_i.size() / H.size()); let selector_time = start_timer!(|| "Compute selector without remainder witness"); let (mut h_i, remainder) = poly.divide_by_vanishing_poly(*src_domain)?; From 6579ca49ddf7693a7482b26d99adbf79bf112a41 Mon Sep 17 00:00:00 2001 From: Howard Wu <9260812+howardwu@users.noreply.github.com> Date: Mon, 15 Jan 2024 15:31:24 -0800 Subject: [PATCH 148/298] chore(snarkvm): bump version for new release --- .cargo/release-version | 2 +- Cargo.lock | 120 ++++++++++---------- Cargo.toml | 24 ++-- algorithms/Cargo.toml | 12 +- algorithms/cuda/Cargo.toml | 2 +- circuit/Cargo.toml | 16 +-- circuit/account/Cargo.toml | 10 +- circuit/algorithms/Cargo.toml | 8 +- circuit/collections/Cargo.toml | 8 +- circuit/environment/Cargo.toml | 14 +-- circuit/environment/witness/Cargo.toml | 2 +- circuit/network/Cargo.toml | 10 +- circuit/program/Cargo.toml | 16 +-- circuit/types/Cargo.toml | 18 +-- circuit/types/address/Cargo.toml | 14 +-- circuit/types/boolean/Cargo.toml | 6 +- circuit/types/field/Cargo.toml | 8 +- circuit/types/group/Cargo.toml | 12 +- circuit/types/integers/Cargo.toml | 12 +- circuit/types/scalar/Cargo.toml | 10 +- circuit/types/string/Cargo.toml | 12 +- console/Cargo.toml | 14 +-- console/account/Cargo.toml | 6 +- console/algorithms/Cargo.toml | 8 +- console/collections/Cargo.toml | 6 +- console/network/Cargo.toml | 20 ++-- console/network/environment/Cargo.toml | 8 +- console/program/Cargo.toml | 14 +-- console/types/Cargo.toml | 18 +-- console/types/address/Cargo.toml | 10 +- console/types/boolean/Cargo.toml | 4 +- console/types/field/Cargo.toml | 6 +- console/types/group/Cargo.toml | 10 +- console/types/integers/Cargo.toml | 10 +- console/types/scalar/Cargo.toml | 8 +- console/types/string/Cargo.toml | 10 +- curves/Cargo.toml | 6 +- fields/Cargo.toml | 4 +- ledger/Cargo.toml | 22 ++-- ledger/authority/Cargo.toml | 6 +- ledger/block/Cargo.toml | 18 +-- ledger/coinbase/Cargo.toml | 14 +-- ledger/committee/Cargo.toml | 6 +- ledger/narwhal/Cargo.toml | 14 +-- ledger/narwhal/batch-certificate/Cargo.toml | 8 +- ledger/narwhal/batch-header/Cargo.toml | 6 +- ledger/narwhal/data/Cargo.toml | 4 +- ledger/narwhal/subdag/Cargo.toml | 10 +- ledger/narwhal/transmission-id/Cargo.toml | 6 +- ledger/narwhal/transmission/Cargo.toml | 10 +- ledger/query/Cargo.toml | 8 +- ledger/store/Cargo.toml | 18 +-- ledger/test-helpers/Cargo.toml | 16 +-- metrics/Cargo.toml | 2 +- parameters/Cargo.toml | 6 +- synthesizer/Cargo.toml | 24 ++-- synthesizer/process/Cargo.toml | 18 +-- synthesizer/program/Cargo.toml | 6 +- synthesizer/snark/Cargo.toml | 8 +- utilities/Cargo.toml | 4 +- utilities/derives/Cargo.toml | 2 +- wasm/Cargo.toml | 20 ++-- 62 files changed, 377 insertions(+), 377 deletions(-) diff --git a/.cargo/release-version b/.cargo/release-version index ef9b3919c6..0b2cdf0eeb 100644 --- a/.cargo/release-version +++ b/.cargo/release-version @@ -1 +1 @@ -v0.16.15 \ No newline at end of file +v0.16.16 \ No newline at end of file diff --git a/Cargo.lock b/Cargo.lock index d5dfef8577..c03b491735 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2577,7 +2577,7 @@ dependencies = [ [[package]] name = "snarkvm" -version = "0.16.15" +version = "0.16.16" dependencies = [ "anstyle", "anyhow", @@ -2613,7 +2613,7 @@ dependencies = [ [[package]] name = "snarkvm-algorithms" -version = "0.16.15" +version = "0.16.16" dependencies = [ "aleo-std", "anyhow", @@ -2652,7 +2652,7 @@ dependencies = [ [[package]] name = "snarkvm-algorithms-cuda" -version = "0.16.15" +version = "0.16.16" dependencies = [ "blst", "cc", @@ -2662,7 +2662,7 @@ dependencies = [ [[package]] name = "snarkvm-circuit" -version = "0.16.15" +version = "0.16.16" dependencies = [ "snarkvm-circuit-account", "snarkvm-circuit-algorithms", @@ -2675,7 +2675,7 @@ dependencies = [ [[package]] name = "snarkvm-circuit-account" -version = "0.16.15" +version = "0.16.16" dependencies = [ "anyhow", "snarkvm-circuit-algorithms", @@ -2687,7 +2687,7 @@ dependencies = [ [[package]] name = "snarkvm-circuit-algorithms" -version = "0.16.15" +version = "0.16.16" dependencies = [ "anyhow", "snarkvm-circuit-types", @@ -2699,7 +2699,7 @@ dependencies = [ [[package]] name = "snarkvm-circuit-collections" -version = "0.16.15" +version = "0.16.16" dependencies = [ "anyhow", "snarkvm-circuit-algorithms", @@ -2713,7 +2713,7 @@ dependencies = [ [[package]] name = "snarkvm-circuit-environment" -version = "0.16.15" +version = "0.16.16" dependencies = [ "criterion", "indexmap 2.0.2", @@ -2734,11 +2734,11 @@ dependencies = [ [[package]] name = "snarkvm-circuit-environment-witness" -version = "0.16.15" +version = "0.16.16" [[package]] name = "snarkvm-circuit-network" -version = "0.16.15" +version = "0.16.16" dependencies = [ "snarkvm-circuit-algorithms", "snarkvm-circuit-collections", @@ -2749,7 +2749,7 @@ dependencies = [ [[package]] name = "snarkvm-circuit-program" -version = "0.16.15" +version = "0.16.16" dependencies = [ "anyhow", "paste", @@ -2767,7 +2767,7 @@ dependencies = [ [[package]] name = "snarkvm-circuit-types" -version = "0.16.15" +version = "0.16.16" dependencies = [ "snarkvm-circuit-environment", "snarkvm-circuit-types-address", @@ -2782,7 +2782,7 @@ dependencies = [ [[package]] name = "snarkvm-circuit-types-address" -version = "0.16.15" +version = "0.16.16" dependencies = [ "snarkvm-circuit-environment", "snarkvm-circuit-types-boolean", @@ -2794,7 +2794,7 @@ dependencies = [ [[package]] name = "snarkvm-circuit-types-boolean" -version = "0.16.15" +version = "0.16.16" dependencies = [ "criterion", "snarkvm-circuit-environment", @@ -2803,7 +2803,7 @@ dependencies = [ [[package]] name = "snarkvm-circuit-types-field" -version = "0.16.15" +version = "0.16.16" dependencies = [ "snarkvm-circuit-environment", "snarkvm-circuit-types-boolean", @@ -2812,7 +2812,7 @@ dependencies = [ [[package]] name = "snarkvm-circuit-types-group" -version = "0.16.15" +version = "0.16.16" dependencies = [ "snarkvm-circuit-environment", "snarkvm-circuit-types-boolean", @@ -2824,7 +2824,7 @@ dependencies = [ [[package]] name = "snarkvm-circuit-types-integers" -version = "0.16.15" +version = "0.16.16" dependencies = [ "paste", "snarkvm-circuit-environment", @@ -2837,7 +2837,7 @@ dependencies = [ [[package]] name = "snarkvm-circuit-types-scalar" -version = "0.16.15" +version = "0.16.16" dependencies = [ "snarkvm-circuit-environment", "snarkvm-circuit-types-boolean", @@ -2847,7 +2847,7 @@ dependencies = [ [[package]] name = "snarkvm-circuit-types-string" -version = "0.16.15" +version = "0.16.16" dependencies = [ "rand", "snarkvm-circuit-environment", @@ -2860,7 +2860,7 @@ dependencies = [ [[package]] name = "snarkvm-console" -version = "0.16.15" +version = "0.16.16" dependencies = [ "snarkvm-console-account", "snarkvm-console-algorithms", @@ -2872,7 +2872,7 @@ dependencies = [ [[package]] name = "snarkvm-console-account" -version = "0.16.15" +version = "0.16.16" dependencies = [ "bincode", "bs58", @@ -2885,7 +2885,7 @@ dependencies = [ [[package]] name = "snarkvm-console-algorithms" -version = "0.16.15" +version = "0.16.16" dependencies = [ "blake2s_simd", "criterion", @@ -2903,7 +2903,7 @@ dependencies = [ [[package]] name = "snarkvm-console-collections" -version = "0.16.15" +version = "0.16.16" dependencies = [ "aleo-std", "criterion", @@ -2916,7 +2916,7 @@ dependencies = [ [[package]] name = "snarkvm-console-network" -version = "0.16.15" +version = "0.16.16" dependencies = [ "anyhow", "indexmap 2.0.2", @@ -2938,7 +2938,7 @@ dependencies = [ [[package]] name = "snarkvm-console-network-environment" -version = "0.16.15" +version = "0.16.16" dependencies = [ "anyhow", "bech32", @@ -2955,7 +2955,7 @@ dependencies = [ [[package]] name = "snarkvm-console-program" -version = "0.16.15" +version = "0.16.16" dependencies = [ "bincode", "enum_index", @@ -2976,7 +2976,7 @@ dependencies = [ [[package]] name = "snarkvm-console-types" -version = "0.16.15" +version = "0.16.16" dependencies = [ "snarkvm-console-network-environment", "snarkvm-console-types-address", @@ -2990,7 +2990,7 @@ dependencies = [ [[package]] name = "snarkvm-console-types-address" -version = "0.16.15" +version = "0.16.16" dependencies = [ "bincode", "serde_json", @@ -3002,7 +3002,7 @@ dependencies = [ [[package]] name = "snarkvm-console-types-boolean" -version = "0.16.15" +version = "0.16.16" dependencies = [ "bincode", "serde_json", @@ -3011,7 +3011,7 @@ dependencies = [ [[package]] name = "snarkvm-console-types-field" -version = "0.16.15" +version = "0.16.16" dependencies = [ "bincode", "serde_json", @@ -3022,7 +3022,7 @@ dependencies = [ [[package]] name = "snarkvm-console-types-group" -version = "0.16.15" +version = "0.16.16" dependencies = [ "bincode", "serde_json", @@ -3034,7 +3034,7 @@ dependencies = [ [[package]] name = "snarkvm-console-types-integers" -version = "0.16.15" +version = "0.16.16" dependencies = [ "bincode", "serde_json", @@ -3046,7 +3046,7 @@ dependencies = [ [[package]] name = "snarkvm-console-types-scalar" -version = "0.16.15" +version = "0.16.16" dependencies = [ "bincode", "serde_json", @@ -3058,7 +3058,7 @@ dependencies = [ [[package]] name = "snarkvm-console-types-string" -version = "0.16.15" +version = "0.16.16" dependencies = [ "bincode", "serde_json", @@ -3070,7 +3070,7 @@ dependencies = [ [[package]] name = "snarkvm-curves" -version = "0.16.15" +version = "0.16.16" dependencies = [ "bincode", "criterion", @@ -3085,7 +3085,7 @@ dependencies = [ [[package]] name = "snarkvm-fields" -version = "0.16.15" +version = "0.16.16" dependencies = [ "aleo-std", "anyhow", @@ -3102,7 +3102,7 @@ dependencies = [ [[package]] name = "snarkvm-ledger" -version = "0.16.15" +version = "0.16.16" dependencies = [ "aleo-std", "anyhow", @@ -3129,7 +3129,7 @@ dependencies = [ [[package]] name = "snarkvm-ledger-authority" -version = "0.16.15" +version = "0.16.16" dependencies = [ "anyhow", "bincode", @@ -3142,7 +3142,7 @@ dependencies = [ [[package]] name = "snarkvm-ledger-block" -version = "0.16.15" +version = "0.16.16" dependencies = [ "bincode", "indexmap 2.0.2", @@ -3166,7 +3166,7 @@ dependencies = [ [[package]] name = "snarkvm-ledger-coinbase" -version = "0.16.15" +version = "0.16.16" dependencies = [ "aleo-std", "anyhow", @@ -3187,7 +3187,7 @@ dependencies = [ [[package]] name = "snarkvm-ledger-committee" -version = "0.16.15" +version = "0.16.16" dependencies = [ "anyhow", "bincode", @@ -3208,7 +3208,7 @@ dependencies = [ [[package]] name = "snarkvm-ledger-narwhal" -version = "0.16.15" +version = "0.16.16" dependencies = [ "snarkvm-ledger-narwhal", "snarkvm-ledger-narwhal-batch-certificate", @@ -3221,7 +3221,7 @@ dependencies = [ [[package]] name = "snarkvm-ledger-narwhal-batch-certificate" -version = "0.16.15" +version = "0.16.16" dependencies = [ "bincode", "indexmap 2.0.2", @@ -3235,7 +3235,7 @@ dependencies = [ [[package]] name = "snarkvm-ledger-narwhal-batch-header" -version = "0.16.15" +version = "0.16.16" dependencies = [ "bincode", "indexmap 2.0.2", @@ -3248,7 +3248,7 @@ dependencies = [ [[package]] name = "snarkvm-ledger-narwhal-data" -version = "0.16.15" +version = "0.16.16" dependencies = [ "bytes", "serde_json", @@ -3258,7 +3258,7 @@ dependencies = [ [[package]] name = "snarkvm-ledger-narwhal-subdag" -version = "0.16.15" +version = "0.16.16" dependencies = [ "bincode", "indexmap 2.0.2", @@ -3273,7 +3273,7 @@ dependencies = [ [[package]] name = "snarkvm-ledger-narwhal-transmission" -version = "0.16.15" +version = "0.16.16" dependencies = [ "bincode", "bytes", @@ -3286,7 +3286,7 @@ dependencies = [ [[package]] name = "snarkvm-ledger-narwhal-transmission-id" -version = "0.16.15" +version = "0.16.16" dependencies = [ "bincode", "serde_json", @@ -3296,7 +3296,7 @@ dependencies = [ [[package]] name = "snarkvm-ledger-query" -version = "0.16.15" +version = "0.16.16" dependencies = [ "async-trait", "reqwest", @@ -3308,7 +3308,7 @@ dependencies = [ [[package]] name = "snarkvm-ledger-store" -version = "0.16.15" +version = "0.16.16" dependencies = [ "aleo-std", "anyhow", @@ -3336,7 +3336,7 @@ dependencies = [ [[package]] name = "snarkvm-ledger-test-helpers" -version = "0.16.15" +version = "0.16.16" dependencies = [ "once_cell", "snarkvm-circuit", @@ -3350,7 +3350,7 @@ dependencies = [ [[package]] name = "snarkvm-metrics" -version = "0.16.15" +version = "0.16.16" dependencies = [ "metrics", "metrics-exporter-prometheus", @@ -3358,7 +3358,7 @@ dependencies = [ [[package]] name = "snarkvm-parameters" -version = "0.16.15" +version = "0.16.16" dependencies = [ "aleo-std", "anyhow", @@ -3391,7 +3391,7 @@ dependencies = [ [[package]] name = "snarkvm-synthesizer" -version = "0.16.15" +version = "0.16.16" dependencies = [ "aleo-std", "anyhow", @@ -3422,7 +3422,7 @@ dependencies = [ [[package]] name = "snarkvm-synthesizer-process" -version = "0.16.15" +version = "0.16.16" dependencies = [ "aleo-std", "bincode", @@ -3448,7 +3448,7 @@ dependencies = [ [[package]] name = "snarkvm-synthesizer-program" -version = "0.16.15" +version = "0.16.16" dependencies = [ "bincode", "criterion", @@ -3464,7 +3464,7 @@ dependencies = [ [[package]] name = "snarkvm-synthesizer-snark" -version = "0.16.15" +version = "0.16.16" dependencies = [ "bincode", "colored", @@ -3477,7 +3477,7 @@ dependencies = [ [[package]] name = "snarkvm-utilities" -version = "0.16.15" +version = "0.16.16" dependencies = [ "aleo-std", "anyhow", @@ -3497,7 +3497,7 @@ dependencies = [ [[package]] name = "snarkvm-utilities-derives" -version = "0.16.15" +version = "0.16.16" dependencies = [ "proc-macro2", "quote 1.0.33", @@ -3506,7 +3506,7 @@ dependencies = [ [[package]] name = "snarkvm-wasm" -version = "0.16.15" +version = "0.16.16" dependencies = [ "getrandom", "snarkvm-circuit-network", diff --git a/Cargo.toml b/Cargo.toml index 2932649638..650a738747 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm" -version = "0.16.15" +version = "0.16.16" authors = [ "The Aleo Team " ] description = "A decentralized virtual machine" homepage = "https://aleo.org" @@ -150,58 +150,58 @@ wasm = [ "snarkvm-wasm" ] [dependencies.snarkvm-algorithms] path = "./algorithms" -version = "=0.16.15" +version = "=0.16.16" optional = true [dependencies.snarkvm-circuit] path = "./circuit" -version = "=0.16.15" +version = "=0.16.16" optional = true [dependencies.snarkvm-console] path = "./console" -version = "=0.16.15" +version = "=0.16.16" optional = true [dependencies.snarkvm-curves] path = "./curves" -version = "=0.16.15" +version = "=0.16.16" optional = true [dependencies.snarkvm-fields] path = "./fields" -version = "=0.16.15" +version = "=0.16.16" optional = true [dependencies.snarkvm-ledger] path = "./ledger" -version = "=0.16.15" +version = "=0.16.16" optional = true [dependencies.snarkvm-metrics] path = "./metrics" -version = "=0.16.15" +version = "=0.16.16" optional = true [dependencies.snarkvm-parameters] path = "./parameters" -version = "=0.16.15" +version = "=0.16.16" optional = true [dependencies.snarkvm-synthesizer] path = "./synthesizer" -version = "=0.16.15" +version = "=0.16.16" default-features = false optional = true [dependencies.snarkvm-utilities] path = "./utilities" -version = "=0.16.15" +version = "=0.16.16" optional = true [dependencies.snarkvm-wasm] path = "./wasm" -version = "=0.16.15" +version = "=0.16.16" optional = true [dependencies.anstyle] diff --git a/algorithms/Cargo.toml b/algorithms/Cargo.toml index af5a76e19b..7ce622dcce 100644 --- a/algorithms/Cargo.toml +++ b/algorithms/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-algorithms" -version = "0.16.15" +version = "0.16.16" authors = [ "The Aleo Team " ] description = "Algorithms for a decentralized virtual machine" homepage = "https://aleo.org" @@ -47,27 +47,27 @@ required-features = [ "test" ] [dependencies.snarkvm-curves] path = "../curves" -version = "=0.16.15" +version = "=0.16.16" default-features = false [dependencies.snarkvm-fields] path = "../fields" -version = "=0.16.15" +version = "=0.16.16" default-features = false [dependencies.snarkvm-parameters] path = "../parameters" -version = "=0.16.15" +version = "=0.16.16" optional = true [dependencies.snarkvm-utilities] path = "../utilities" -version = "=0.16.15" +version = "=0.16.16" default-features = false [dependencies.snarkvm-algorithms-cuda] path = "./cuda" -version = "=0.16.15" +version = "=0.16.16" optional = true [dependencies.aleo-std] diff --git a/algorithms/cuda/Cargo.toml b/algorithms/cuda/Cargo.toml index f57066d0f1..448ea08b6d 100644 --- a/algorithms/cuda/Cargo.toml +++ b/algorithms/cuda/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-algorithms-cuda" -version = "0.16.15" +version = "0.16.16" authors = [ "The Aleo Team " ] description = "Cuda optimizations for a decentralized virtual machine" homepage = "https://aleo.org" diff --git a/circuit/Cargo.toml b/circuit/Cargo.toml index 801a7d7160..648e3f5865 100644 --- a/circuit/Cargo.toml +++ b/circuit/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-circuit" -version = "0.16.15" +version = "0.16.16" authors = [ "The Aleo Team " ] description = "Circuits for a decentralized virtual machine" homepage = "https://aleo.org" @@ -25,28 +25,28 @@ edition = "2021" [dependencies.snarkvm-circuit-account] path = "./account" -version = "=0.16.15" +version = "=0.16.16" [dependencies.snarkvm-circuit-algorithms] path = "./algorithms" -version = "=0.16.15" +version = "=0.16.16" [dependencies.snarkvm-circuit-collections] path = "./collections" -version = "=0.16.15" +version = "=0.16.16" [dependencies.snarkvm-circuit-environment] path = "./environment" -version = "=0.16.15" +version = "=0.16.16" [dependencies.snarkvm-circuit-network] path = "./network" -version = "=0.16.15" +version = "=0.16.16" [dependencies.snarkvm-circuit-program] path = "./program" -version = "=0.16.15" +version = "=0.16.16" [dependencies.snarkvm-circuit-types] path = "./types" -version = "=0.16.15" +version = "=0.16.16" diff --git a/circuit/account/Cargo.toml b/circuit/account/Cargo.toml index 99ab62b6c4..eb990601a3 100644 --- a/circuit/account/Cargo.toml +++ b/circuit/account/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-circuit-account" -version = "0.16.15" +version = "0.16.16" authors = [ "The Aleo Team " ] description = "Account circuit library for a decentralized virtual machine" license = "Apache-2.0" @@ -9,20 +9,20 @@ edition = "2021" [dependencies.console] package = "snarkvm-console-account" path = "../../console/account" -version = "=0.16.15" +version = "=0.16.16" optional = true [dependencies.snarkvm-circuit-algorithms] path = "../algorithms" -version = "=0.16.15" +version = "=0.16.16" [dependencies.snarkvm-circuit-network] path = "../network" -version = "=0.16.15" +version = "=0.16.16" [dependencies.snarkvm-circuit-types] path = "../types" -version = "=0.16.15" +version = "=0.16.16" [dev-dependencies.snarkvm-utilities] path = "../../utilities" diff --git a/circuit/algorithms/Cargo.toml b/circuit/algorithms/Cargo.toml index 918caade59..68bd4c03a1 100644 --- a/circuit/algorithms/Cargo.toml +++ b/circuit/algorithms/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-circuit-algorithms" -version = "0.16.15" +version = "0.16.16" authors = [ "The Aleo Team " ] description = "Algorithm circuit library for a decentralized virtual machine" license = "Apache-2.0" @@ -9,16 +9,16 @@ edition = "2021" [dependencies.console] package = "snarkvm-console-algorithms" path = "../../console/algorithms" -version = "=0.16.15" +version = "=0.16.16" optional = true [dependencies.snarkvm-circuit-types] path = "../types" -version = "=0.16.15" +version = "=0.16.16" [dependencies.snarkvm-fields] path = "../../fields" -version = "=0.16.15" +version = "=0.16.16" default-features = false [dev-dependencies.anyhow] diff --git a/circuit/collections/Cargo.toml b/circuit/collections/Cargo.toml index 7a24023f22..ad5a5cb235 100644 --- a/circuit/collections/Cargo.toml +++ b/circuit/collections/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-circuit-collections" -version = "0.16.15" +version = "0.16.16" authors = [ "The Aleo Team " ] description = "Collections circuit library for a decentralized virtual machine" license = "Apache-2.0" @@ -9,16 +9,16 @@ edition = "2021" [dependencies.console] package = "snarkvm-console-collections" path = "../../console/collections" -version = "=0.16.15" +version = "=0.16.16" optional = true [dependencies.snarkvm-circuit-algorithms] path = "../algorithms" -version = "=0.16.15" +version = "=0.16.16" [dependencies.snarkvm-circuit-types] path = "../types" -version = "=0.16.15" +version = "=0.16.16" [dev-dependencies.snarkvm-circuit-network] path = "../network" diff --git a/circuit/environment/Cargo.toml b/circuit/environment/Cargo.toml index fe2e26042f..98d7e16af6 100644 --- a/circuit/environment/Cargo.toml +++ b/circuit/environment/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-circuit-environment" -version = "0.16.15" +version = "0.16.16" authors = [ "The Aleo Team " ] description = "Circuit environment for a decentralized virtual machine" license = "Apache-2.0" @@ -14,32 +14,32 @@ harness = false [dependencies.console] package = "snarkvm-console-network" path = "../../console/network" -version = "=0.16.15" +version = "=0.16.16" [dependencies.snarkvm-algorithms] path = "../../algorithms" -version = "=0.16.15" +version = "=0.16.16" default-features = false features = [ "r1cs" ] [dependencies.snarkvm-circuit-environment-witness] path = "./witness" -version = "=0.16.15" +version = "=0.16.16" default-features = false [dependencies.snarkvm-curves] path = "../../curves" -version = "=0.16.15" +version = "=0.16.16" default-features = false [dependencies.snarkvm-fields] path = "../../fields" -version = "=0.16.15" +version = "=0.16.16" default-features = false [dependencies.snarkvm-utilities] path = "../../utilities" -version = "=0.16.15" +version = "=0.16.16" default-features = false [dependencies.indexmap] diff --git a/circuit/environment/witness/Cargo.toml b/circuit/environment/witness/Cargo.toml index 64c87aca08..4323564618 100644 --- a/circuit/environment/witness/Cargo.toml +++ b/circuit/environment/witness/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-circuit-environment-witness" -version = "0.16.15" +version = "0.16.16" authors = [ "The Aleo Team " ] description = "A procedural macro to construct a witness in an environment" license = "Apache-2.0" diff --git a/circuit/network/Cargo.toml b/circuit/network/Cargo.toml index 6d9e086b43..ec39c2518d 100644 --- a/circuit/network/Cargo.toml +++ b/circuit/network/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-circuit-network" -version = "0.16.15" +version = "0.16.16" authors = [ "The Aleo Team " ] description = "Network circuit library for a decentralized virtual machine" license = "Apache-2.0" @@ -9,20 +9,20 @@ edition = "2021" [dependencies.console] package = "snarkvm-console-network" path = "../../console/network" -version = "=0.16.15" +version = "=0.16.16" optional = true [dependencies.snarkvm-circuit-algorithms] path = "../algorithms" -version = "=0.16.15" +version = "=0.16.16" [dependencies.snarkvm-circuit-collections] path = "../collections" -version = "=0.16.15" +version = "=0.16.16" [dependencies.snarkvm-circuit-types] path = "../types" -version = "=0.16.15" +version = "=0.16.16" [dev-dependencies.snarkvm-console-types] path = "../../console/types" diff --git a/circuit/program/Cargo.toml b/circuit/program/Cargo.toml index 7b0e18ce2c..597ac2366f 100644 --- a/circuit/program/Cargo.toml +++ b/circuit/program/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-circuit-program" -version = "0.16.15" +version = "0.16.16" authors = [ "The Aleo Team " ] description = "Program circuit library for a decentralized virtual machine" license = "Apache-2.0" @@ -9,32 +9,32 @@ edition = "2021" [dependencies.console] package = "snarkvm-console-program" path = "../../console/program" -version = "=0.16.15" +version = "=0.16.16" optional = true [dependencies.snarkvm-circuit-account] path = "../account" -version = "=0.16.15" +version = "=0.16.16" [dependencies.snarkvm-circuit-algorithms] path = "../algorithms" -version = "=0.16.15" +version = "=0.16.16" [dependencies.snarkvm-circuit-collections] path = "../collections" -version = "=0.16.15" +version = "=0.16.16" [dependencies.snarkvm-circuit-network] path = "../network" -version = "=0.16.15" +version = "=0.16.16" [dependencies.snarkvm-circuit-types] path = "../types" -version = "=0.16.15" +version = "=0.16.16" [dependencies.snarkvm-utilities] path = "../../utilities" -version = "=0.16.15" +version = "=0.16.16" [dependencies.paste] version = "1.0" diff --git a/circuit/types/Cargo.toml b/circuit/types/Cargo.toml index 8650ccc513..98e23156c1 100644 --- a/circuit/types/Cargo.toml +++ b/circuit/types/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-circuit-types" -version = "0.16.15" +version = "0.16.16" authors = [ "The Aleo Team " ] description = "Primitive circuit for a decentralized virtual machine" license = "Apache-2.0" @@ -8,35 +8,35 @@ edition = "2021" [dependencies.snarkvm-circuit-environment] path = "../environment" -version = "=0.16.15" +version = "=0.16.16" [dependencies.snarkvm-circuit-types-address] path = "./address" -version = "=0.16.15" +version = "=0.16.16" [dependencies.snarkvm-circuit-types-boolean] path = "./boolean" -version = "=0.16.15" +version = "=0.16.16" [dependencies.snarkvm-circuit-types-field] path = "./field" -version = "=0.16.15" +version = "=0.16.16" [dependencies.snarkvm-circuit-types-group] path = "./group" -version = "=0.16.15" +version = "=0.16.16" [dependencies.snarkvm-circuit-types-integers] path = "./integers" -version = "=0.16.15" +version = "=0.16.16" [dependencies.snarkvm-circuit-types-scalar] path = "./scalar" -version = "=0.16.15" +version = "=0.16.16" [dependencies.snarkvm-circuit-types-string] path = "./string" -version = "=0.16.15" +version = "=0.16.16" [dev-dependencies.console] package = "snarkvm-console" diff --git a/circuit/types/address/Cargo.toml b/circuit/types/address/Cargo.toml index 50e4b7c70b..88c993fd45 100644 --- a/circuit/types/address/Cargo.toml +++ b/circuit/types/address/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-circuit-types-address" -version = "0.16.15" +version = "0.16.16" authors = [ "The Aleo Team " ] description = "Address circuit for a decentralized virtual machine" license = "Apache-2.0" @@ -9,28 +9,28 @@ edition = "2021" [dependencies.console] package = "snarkvm-console-types-address" path = "../../../console/types/address" -version = "=0.16.15" +version = "=0.16.16" optional = true [dependencies.snarkvm-circuit-environment] path = "../../environment" -version = "=0.16.15" +version = "=0.16.16" [dependencies.snarkvm-circuit-types-boolean] path = "../boolean" -version = "=0.16.15" +version = "=0.16.16" [dependencies.snarkvm-circuit-types-field] path = "../field" -version = "=0.16.15" +version = "=0.16.16" [dependencies.snarkvm-circuit-types-group] path = "../group" -version = "=0.16.15" +version = "=0.16.16" [dependencies.snarkvm-circuit-types-scalar] path = "../scalar" -version = "=0.16.15" +version = "=0.16.16" [features] default = [ "enable_console" ] diff --git a/circuit/types/boolean/Cargo.toml b/circuit/types/boolean/Cargo.toml index d357cf45b0..2e65ee5c25 100644 --- a/circuit/types/boolean/Cargo.toml +++ b/circuit/types/boolean/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-circuit-types-boolean" -version = "0.16.15" +version = "0.16.16" authors = [ "The Aleo Team " ] description = "Boolean circuit for a decentralized virtual machine" license = "Apache-2.0" @@ -14,12 +14,12 @@ harness = false [dependencies.console] package = "snarkvm-console-types-boolean" path = "../../../console/types/boolean" -version = "=0.16.15" +version = "=0.16.16" optional = true [dependencies.snarkvm-circuit-environment] path = "../../environment" -version = "=0.16.15" +version = "=0.16.16" [dev-dependencies.criterion] version = "0.5" diff --git a/circuit/types/field/Cargo.toml b/circuit/types/field/Cargo.toml index 9f26acc523..12fb777813 100644 --- a/circuit/types/field/Cargo.toml +++ b/circuit/types/field/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-circuit-types-field" -version = "0.16.15" +version = "0.16.16" authors = [ "The Aleo Team " ] description = "Field circuit for a decentralized virtual machine" license = "Apache-2.0" @@ -9,16 +9,16 @@ edition = "2021" [dependencies.console] package = "snarkvm-console-types-field" path = "../../../console/types/field" -version = "=0.16.15" +version = "=0.16.16" optional = true [dependencies.snarkvm-circuit-environment] path = "../../environment" -version = "=0.16.15" +version = "=0.16.16" [dependencies.snarkvm-circuit-types-boolean] path = "../boolean" -version = "=0.16.15" +version = "=0.16.16" [features] default = [ "enable_console" ] diff --git a/circuit/types/group/Cargo.toml b/circuit/types/group/Cargo.toml index 7138c5c1b9..ac9769c3e0 100644 --- a/circuit/types/group/Cargo.toml +++ b/circuit/types/group/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-circuit-types-group" -version = "0.16.15" +version = "0.16.16" authors = [ "The Aleo Team " ] description = "Group circuit for a decentralized virtual machine" license = "Apache-2.0" @@ -9,24 +9,24 @@ edition = "2021" [dependencies.console] package = "snarkvm-console-types-group" path = "../../../console/types/group" -version = "=0.16.15" +version = "=0.16.16" optional = true [dependencies.snarkvm-circuit-environment] path = "../../environment" -version = "=0.16.15" +version = "=0.16.16" [dependencies.snarkvm-circuit-types-boolean] path = "../boolean" -version = "=0.16.15" +version = "=0.16.16" [dependencies.snarkvm-circuit-types-field] path = "../field" -version = "=0.16.15" +version = "=0.16.16" [dependencies.snarkvm-circuit-types-scalar] path = "../scalar" -version = "=0.16.15" +version = "=0.16.16" [dev-dependencies.snarkvm-utilities] path = "../../../utilities" diff --git a/circuit/types/integers/Cargo.toml b/circuit/types/integers/Cargo.toml index de9557a845..77a40bb1d3 100644 --- a/circuit/types/integers/Cargo.toml +++ b/circuit/types/integers/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-circuit-types-integers" -version = "0.16.15" +version = "0.16.16" authors = [ "The Aleo Team " ] description = "Integer circuit for a decentralized virtual machine" license = "Apache-2.0" @@ -9,24 +9,24 @@ edition = "2021" [dependencies.console] package = "snarkvm-console-types-integers" path = "../../../console/types/integers" -version = "=0.16.15" +version = "=0.16.16" optional = true [dependencies.snarkvm-circuit-environment] path = "../../environment" -version = "=0.16.15" +version = "=0.16.16" [dependencies.snarkvm-circuit-types-boolean] path = "../boolean" -version = "=0.16.15" +version = "=0.16.16" [dependencies.snarkvm-circuit-types-field] path = "../field" -version = "=0.16.15" +version = "=0.16.16" [dependencies.snarkvm-circuit-types-scalar] path = "../scalar" -version = "=0.16.15" +version = "=0.16.16" [dev-dependencies.snarkvm-utilities] path = "../../../utilities" diff --git a/circuit/types/scalar/Cargo.toml b/circuit/types/scalar/Cargo.toml index a9e64ddb22..86235bfb8b 100644 --- a/circuit/types/scalar/Cargo.toml +++ b/circuit/types/scalar/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-circuit-types-scalar" -version = "0.16.15" +version = "0.16.16" authors = [ "The Aleo Team " ] description = "Scalar circuit for a decentralized virtual machine" license = "Apache-2.0" @@ -9,20 +9,20 @@ edition = "2021" [dependencies.console] package = "snarkvm-console-types-scalar" path = "../../../console/types/scalar" -version = "=0.16.15" +version = "=0.16.16" optional = true [dependencies.snarkvm-circuit-environment] path = "../../environment" -version = "=0.16.15" +version = "=0.16.16" [dependencies.snarkvm-circuit-types-boolean] path = "../boolean" -version = "=0.16.15" +version = "=0.16.16" [dependencies.snarkvm-circuit-types-field] path = "../field" -version = "=0.16.15" +version = "=0.16.16" [features] default = [ "enable_console" ] diff --git a/circuit/types/string/Cargo.toml b/circuit/types/string/Cargo.toml index 1cebb5b626..85d1db4e9d 100644 --- a/circuit/types/string/Cargo.toml +++ b/circuit/types/string/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-circuit-types-string" -version = "0.16.15" +version = "0.16.16" authors = [ "The Aleo Team " ] description = "String circuit for a decentralized virtual machine" license = "Apache-2.0" @@ -9,24 +9,24 @@ edition = "2021" [dependencies.console] package = "snarkvm-console-types-string" path = "../../../console/types/string" -version = "=0.16.15" +version = "=0.16.16" optional = true [dependencies.snarkvm-circuit-environment] path = "../../environment" -version = "=0.16.15" +version = "=0.16.16" [dependencies.snarkvm-circuit-types-boolean] path = "../boolean" -version = "=0.16.15" +version = "=0.16.16" [dependencies.snarkvm-circuit-types-field] path = "../field" -version = "=0.16.15" +version = "=0.16.16" [dependencies.snarkvm-circuit-types-integers] path = "../integers" -version = "=0.16.15" +version = "=0.16.16" [dev-dependencies.snarkvm-utilities] path = "../../../utilities" diff --git a/console/Cargo.toml b/console/Cargo.toml index a33a64fb29..319e9ded59 100644 --- a/console/Cargo.toml +++ b/console/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-console" -version = "0.16.15" +version = "0.16.16" authors = [ "The Aleo Team " ] description = "Console environment for a decentralized virtual machine" license = "Apache-2.0" @@ -8,32 +8,32 @@ edition = "2021" [dependencies.snarkvm-console-account] path = "./account" -version = "=0.16.15" +version = "=0.16.16" optional = true [dependencies.snarkvm-console-algorithms] path = "./algorithms" -version = "=0.16.15" +version = "=0.16.16" optional = true [dependencies.snarkvm-console-collections] path = "./collections" -version = "=0.16.15" +version = "=0.16.16" optional = true [dependencies.snarkvm-console-network] path = "./network" -version = "=0.16.15" +version = "=0.16.16" optional = true [dependencies.snarkvm-console-program] path = "./program" -version = "=0.16.15" +version = "=0.16.16" optional = true [dependencies.snarkvm-console-types] path = "./types" -version = "=0.16.15" +version = "=0.16.16" optional = true [features] diff --git a/console/account/Cargo.toml b/console/account/Cargo.toml index bb41a00122..ccdf01ea89 100644 --- a/console/account/Cargo.toml +++ b/console/account/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-console-account" -version = "0.16.15" +version = "0.16.16" authors = [ "The Aleo Team " ] description = "Account operations for a decentralized virtual machine" license = "Apache-2.0" @@ -13,11 +13,11 @@ harness = false [dependencies.snarkvm-console-network] path = "../network" -version = "=0.16.15" +version = "=0.16.16" [dependencies.snarkvm-console-types] path = "../types" -version = "=0.16.15" +version = "=0.16.16" default-features = false features = [ "address", "boolean", "field", "group", "scalar" ] diff --git a/console/algorithms/Cargo.toml b/console/algorithms/Cargo.toml index 99291b7d20..a742a14837 100644 --- a/console/algorithms/Cargo.toml +++ b/console/algorithms/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-console-algorithms" -version = "0.16.15" +version = "0.16.16" authors = [ "The Aleo Team " ] description = "Console algorithms for a decentralized virtual machine" license = "Apache-2.0" @@ -23,18 +23,18 @@ harness = false [dependencies.snarkvm-console-types] path = "../types" -version = "=0.16.15" +version = "=0.16.16" default-features = false features = [ "field", "group", "integers", "scalar" ] [dependencies.snarkvm-fields] path = "../../fields" -version = "=0.16.15" +version = "=0.16.16" default-features = false [dependencies.snarkvm-utilities] path = "../../utilities" -version = "=0.16.15" +version = "=0.16.16" [dependencies.blake2s_simd] version = "1.0" diff --git a/console/collections/Cargo.toml b/console/collections/Cargo.toml index 2566972c39..a6fb2ba3c9 100644 --- a/console/collections/Cargo.toml +++ b/console/collections/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-console-collections" -version = "0.16.15" +version = "0.16.16" authors = [ "The Aleo Team " ] description = "Collections for a decentralized virtual machine" license = "Apache-2.0" @@ -18,11 +18,11 @@ harness = false [dependencies.snarkvm-console-algorithms] path = "../algorithms" -version = "=0.16.15" +version = "=0.16.16" [dependencies.snarkvm-console-types] path = "../types" -version = "=0.16.15" +version = "=0.16.16" default-features = false features = [ "field", "integers" ] diff --git a/console/network/Cargo.toml b/console/network/Cargo.toml index c86f68cca3..e731ca2c5e 100644 --- a/console/network/Cargo.toml +++ b/console/network/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-console-network" -version = "0.16.15" +version = "0.16.16" authors = [ "The Aleo Team " ] description = "Network console library for a decentralized virtual machine" license = "Apache-2.0" @@ -15,45 +15,45 @@ wasm = [ [dependencies.snarkvm-algorithms] path = "../../algorithms" -version = "=0.16.15" +version = "=0.16.16" default-features = false features = [ "snark" ] [dependencies.snarkvm-console-algorithms] path = "../algorithms" -version = "=0.16.15" +version = "=0.16.16" [dependencies.snarkvm-console-collections] path = "../collections" -version = "=0.16.15" +version = "=0.16.16" [dependencies.snarkvm-console-network-environment] path = "./environment" -version = "=0.16.15" +version = "=0.16.16" [dependencies.snarkvm-console-types] path = "../types" -version = "=0.16.15" +version = "=0.16.16" default-features = false features = [ "field", "group", "scalar" ] [dependencies.snarkvm-curves] path = "../../curves" -version = "=0.16.15" +version = "=0.16.16" default-features = false [dependencies.snarkvm-fields] path = "../../fields" -version = "=0.16.15" +version = "=0.16.16" default-features = false [dependencies.snarkvm-parameters] path = "../../parameters" -version = "=0.16.15" +version = "=0.16.16" [dependencies.snarkvm-utilities] path = "../../utilities" -version = "=0.16.15" +version = "=0.16.16" [dependencies.anyhow] version = "1.0.73" diff --git a/console/network/environment/Cargo.toml b/console/network/environment/Cargo.toml index 279581b885..deca5312f2 100644 --- a/console/network/environment/Cargo.toml +++ b/console/network/environment/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-console-network-environment" -version = "0.16.15" +version = "0.16.16" authors = [ "The Aleo Team " ] description = "Environment console library for a decentralized virtual machine" license = "Apache-2.0" @@ -8,17 +8,17 @@ edition = "2021" [dependencies.snarkvm-curves] path = "../../../curves" -version = "=0.16.15" +version = "=0.16.16" default-features = false [dependencies.snarkvm-fields] path = "../../../fields" -version = "=0.16.15" +version = "=0.16.16" default-features = false [dependencies.snarkvm-utilities] path = "../../../utilities" -version = "=0.16.15" +version = "=0.16.16" [dependencies.anyhow] version = "1.0.73" diff --git a/console/program/Cargo.toml b/console/program/Cargo.toml index ba81988fc7..9ebcb0cdb9 100644 --- a/console/program/Cargo.toml +++ b/console/program/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-console-program" -version = "0.16.15" +version = "0.16.16" authors = [ "The Aleo Team " ] description = "Program operations for a decentralized virtual machine" license = "Apache-2.0" @@ -12,27 +12,27 @@ test = [ ] [dependencies.snarkvm-console-account] path = "../account" -version = "=0.16.15" +version = "=0.16.16" [dependencies.snarkvm-console-algorithms] path = "../algorithms" -version = "=0.16.15" +version = "=0.16.16" [dependencies.snarkvm-console-collections] path = "../collections" -version = "=0.16.15" +version = "=0.16.16" [dependencies.snarkvm-console-network] path = "../network" -version = "=0.16.15" +version = "=0.16.16" [dependencies.snarkvm-console-types] path = "../types" -version = "=0.16.15" +version = "=0.16.16" [dependencies.snarkvm-utilities] path = "../../utilities" -version = "=0.16.15" +version = "=0.16.16" [dependencies.enum_index] version = "0.2" diff --git a/console/types/Cargo.toml b/console/types/Cargo.toml index 17dc90de05..3a0dafaf8f 100644 --- a/console/types/Cargo.toml +++ b/console/types/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-console-types" -version = "0.16.15" +version = "0.16.16" authors = [ "The Aleo Team " ] description = "Console types for a decentralized virtual machine" license = "Apache-2.0" @@ -8,41 +8,41 @@ edition = "2021" [dependencies.snarkvm-console-network-environment] path = "../network/environment" -version = "=0.16.15" +version = "=0.16.16" [dependencies.snarkvm-console-types-address] path = "./address" -version = "=0.16.15" +version = "=0.16.16" optional = true [dependencies.snarkvm-console-types-boolean] path = "./boolean" -version = "=0.16.15" +version = "=0.16.16" optional = true [dependencies.snarkvm-console-types-field] path = "./field" -version = "=0.16.15" +version = "=0.16.16" optional = true [dependencies.snarkvm-console-types-group] path = "./group" -version = "=0.16.15" +version = "=0.16.16" optional = true [dependencies.snarkvm-console-types-integers] path = "./integers" -version = "=0.16.15" +version = "=0.16.16" optional = true [dependencies.snarkvm-console-types-scalar] path = "./scalar" -version = "=0.16.15" +version = "=0.16.16" optional = true [dependencies.snarkvm-console-types-string] path = "./string" -version = "=0.16.15" +version = "=0.16.16" optional = true [features] diff --git a/console/types/address/Cargo.toml b/console/types/address/Cargo.toml index 2c17e364a5..fdaf4624b0 100644 --- a/console/types/address/Cargo.toml +++ b/console/types/address/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-console-types-address" -version = "0.16.15" +version = "0.16.16" authors = [ "The Aleo Team " ] description = "Type operations for a decentralized virtual machine" license = "Apache-2.0" @@ -8,19 +8,19 @@ edition = "2021" [dependencies.snarkvm-console-network-environment] path = "../../network/environment" -version = "=0.16.15" +version = "=0.16.16" [dependencies.snarkvm-console-types-boolean] path = "../boolean" -version = "=0.16.15" +version = "=0.16.16" [dependencies.snarkvm-console-types-field] path = "../field" -version = "=0.16.15" +version = "=0.16.16" [dependencies.snarkvm-console-types-group] path = "../group" -version = "=0.16.15" +version = "=0.16.16" [dev-dependencies.bincode] version = "1.3" diff --git a/console/types/boolean/Cargo.toml b/console/types/boolean/Cargo.toml index be2c33dbee..86c908bffe 100644 --- a/console/types/boolean/Cargo.toml +++ b/console/types/boolean/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-console-types-boolean" -version = "0.16.15" +version = "0.16.16" authors = [ "The Aleo Team " ] description = "Type operations for a decentralized virtual machine" license = "Apache-2.0" @@ -8,7 +8,7 @@ edition = "2021" [dependencies.snarkvm-console-network-environment] path = "../../network/environment" -version = "=0.16.15" +version = "=0.16.16" [dev-dependencies.bincode] version = "1.3" diff --git a/console/types/field/Cargo.toml b/console/types/field/Cargo.toml index bc29ee8fde..526b401384 100644 --- a/console/types/field/Cargo.toml +++ b/console/types/field/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-console-types-field" -version = "0.16.15" +version = "0.16.16" authors = [ "The Aleo Team " ] description = "Type operations for a decentralized virtual machine" license = "Apache-2.0" @@ -8,11 +8,11 @@ edition = "2021" [dependencies.snarkvm-console-network-environment] path = "../../network/environment" -version = "=0.16.15" +version = "=0.16.16" [dependencies.snarkvm-console-types-boolean] path = "../boolean" -version = "=0.16.15" +version = "=0.16.16" [dependencies.zeroize] version = "1" diff --git a/console/types/group/Cargo.toml b/console/types/group/Cargo.toml index 4fc8365c8f..b250eb1315 100644 --- a/console/types/group/Cargo.toml +++ b/console/types/group/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-console-types-group" -version = "0.16.15" +version = "0.16.16" authors = [ "The Aleo Team " ] description = "Type operations for a decentralized virtual machine" license = "Apache-2.0" @@ -8,19 +8,19 @@ edition = "2021" [dependencies.snarkvm-console-network-environment] path = "../../network/environment" -version = "=0.16.15" +version = "=0.16.16" [dependencies.snarkvm-console-types-boolean] path = "../boolean" -version = "=0.16.15" +version = "=0.16.16" [dependencies.snarkvm-console-types-field] path = "../field" -version = "=0.16.15" +version = "=0.16.16" [dependencies.snarkvm-console-types-scalar] path = "../scalar" -version = "=0.16.15" +version = "=0.16.16" [dev-dependencies.bincode] version = "1.3" diff --git a/console/types/integers/Cargo.toml b/console/types/integers/Cargo.toml index 0b35f6f1a8..693f52ed40 100644 --- a/console/types/integers/Cargo.toml +++ b/console/types/integers/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-console-types-integers" -version = "0.16.15" +version = "0.16.16" authors = [ "The Aleo Team " ] description = "Type operations for a decentralized virtual machine" license = "Apache-2.0" @@ -8,19 +8,19 @@ edition = "2021" [dependencies.snarkvm-console-network-environment] path = "../../network/environment" -version = "=0.16.15" +version = "=0.16.16" [dependencies.snarkvm-console-types-boolean] path = "../boolean" -version = "=0.16.15" +version = "=0.16.16" [dependencies.snarkvm-console-types-field] path = "../field" -version = "=0.16.15" +version = "=0.16.16" [dependencies.snarkvm-console-types-scalar] path = "../scalar" -version = "=0.16.15" +version = "=0.16.16" [dev-dependencies.bincode] version = "1.3" diff --git a/console/types/scalar/Cargo.toml b/console/types/scalar/Cargo.toml index 03db6c53ec..149d40e3cc 100644 --- a/console/types/scalar/Cargo.toml +++ b/console/types/scalar/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-console-types-scalar" -version = "0.16.15" +version = "0.16.16" authors = [ "The Aleo Team " ] description = "Type operations for a decentralized virtual machine" license = "Apache-2.0" @@ -8,15 +8,15 @@ edition = "2021" [dependencies.snarkvm-console-network-environment] path = "../../network/environment" -version = "=0.16.15" +version = "=0.16.16" [dependencies.snarkvm-console-types-boolean] path = "../boolean" -version = "=0.16.15" +version = "=0.16.16" [dependencies.snarkvm-console-types-field] path = "../field" -version = "=0.16.15" +version = "=0.16.16" [dependencies.zeroize] version = "1" diff --git a/console/types/string/Cargo.toml b/console/types/string/Cargo.toml index 4e98ffd9e0..480a3338f9 100644 --- a/console/types/string/Cargo.toml +++ b/console/types/string/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-console-types-string" -version = "0.16.15" +version = "0.16.16" authors = [ "The Aleo Team " ] description = "Type operations for a decentralized virtual machine" license = "Apache-2.0" @@ -8,19 +8,19 @@ edition = "2021" [dependencies.snarkvm-console-network-environment] path = "../../network/environment" -version = "=0.16.15" +version = "=0.16.16" [dependencies.snarkvm-console-types-boolean] path = "../boolean" -version = "=0.16.15" +version = "=0.16.16" [dependencies.snarkvm-console-types-field] path = "../field" -version = "=0.16.15" +version = "=0.16.16" [dependencies.snarkvm-console-types-integers] path = "../integers" -version = "=0.16.15" +version = "=0.16.16" [dev-dependencies.bincode] version = "1.3" diff --git a/curves/Cargo.toml b/curves/Cargo.toml index 369622d10e..e2fa5b6f21 100644 --- a/curves/Cargo.toml +++ b/curves/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-curves" -version = "0.16.15" +version = "0.16.16" authors = [ "The Aleo Team " ] description = "Curves for a decentralized virtual machine" homepage = "https://aleo.org" @@ -36,12 +36,12 @@ harness = false [dependencies.snarkvm-fields] path = "../fields" -version = "=0.16.15" +version = "=0.16.16" default-features = false [dependencies.snarkvm-utilities] path = "../utilities" -version = "=0.16.15" +version = "=0.16.16" default-features = false [dependencies.rand] diff --git a/fields/Cargo.toml b/fields/Cargo.toml index 9f15b2f15c..036a436cb1 100644 --- a/fields/Cargo.toml +++ b/fields/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-fields" -version = "0.16.15" +version = "0.16.16" authors = [ "The Aleo Team " ] description = "Fields for a decentralized virtual machine" homepage = "https://aleo.org" @@ -25,7 +25,7 @@ edition = "2021" [dependencies.snarkvm-utilities] path = "../utilities" -version = "=0.16.15" +version = "=0.16.16" default-features = false [dependencies.aleo-std] diff --git a/ledger/Cargo.toml b/ledger/Cargo.toml index 8258be5fc0..1a72bd5500 100644 --- a/ledger/Cargo.toml +++ b/ledger/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-ledger" -version = "0.16.15" +version = "0.16.16" authors = [ "The Aleo Team " ] description = "A node ledger for a decentralized virtual machine" homepage = "https://aleo.org" @@ -57,54 +57,54 @@ timer = [ "aleo-std/timer" ] [dependencies.console] package = "snarkvm-console" path = "../console" -version = "=0.16.15" +version = "=0.16.16" [dependencies.ledger-authority] package = "snarkvm-ledger-authority" path = "./authority" -version = "=0.16.15" +version = "=0.16.16" [dependencies.ledger-block] package = "snarkvm-ledger-block" path = "./block" -version = "=0.16.15" +version = "=0.16.16" [dependencies.ledger-coinbase] package = "snarkvm-ledger-coinbase" path = "./coinbase" -version = "=0.16.15" +version = "=0.16.16" [dependencies.ledger-committee] package = "snarkvm-ledger-committee" path = "./committee" -version = "=0.16.15" +version = "=0.16.16" [dependencies.ledger-narwhal] package = "snarkvm-ledger-narwhal" path = "./narwhal" -version = "=0.16.15" +version = "=0.16.16" [dependencies.ledger-query] package = "snarkvm-ledger-query" path = "./query" -version = "=0.16.15" +version = "=0.16.16" features = [ "query" ] [dependencies.ledger-store] package = "snarkvm-ledger-store" path = "./store" -version = "=0.16.15" +version = "=0.16.16" [dependencies.ledger-test-helpers] package = "snarkvm-ledger-test-helpers" path = "./test-helpers" -version = "=0.16.15" +version = "=0.16.16" optional = true [dependencies.synthesizer] package = "snarkvm-synthesizer" path = "../synthesizer" -version = "=0.16.15" +version = "=0.16.16" [dependencies.aleo-std] version = "0.1.18" diff --git a/ledger/authority/Cargo.toml b/ledger/authority/Cargo.toml index 2be5317994..f83ce83470 100644 --- a/ledger/authority/Cargo.toml +++ b/ledger/authority/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-ledger-authority" -version = "0.16.15" +version = "0.16.16" authors = [ "The Aleo Team " ] description = "Data structures for a block authority in a decentralized virtual machine" homepage = "https://aleo.org" @@ -32,12 +32,12 @@ test-helpers = [ "narwhal-subdag/test-helpers" ] [dependencies.console] package = "snarkvm-console" path = "../../console" -version = "=0.16.15" +version = "=0.16.16" [dependencies.narwhal-subdag] package = "snarkvm-ledger-narwhal-subdag" path = "../narwhal/subdag" -version = "=0.16.15" +version = "=0.16.16" [dependencies.anyhow] version = "1" diff --git a/ledger/block/Cargo.toml b/ledger/block/Cargo.toml index c3dff51f0e..fc47672c92 100644 --- a/ledger/block/Cargo.toml +++ b/ledger/block/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-ledger-block" -version = "0.16.15" +version = "0.16.16" authors = [ "The Aleo Team " ] description = "A block for a decentralized virtual machine" homepage = "https://aleo.org" @@ -39,42 +39,42 @@ test = [ ] [dependencies.console] package = "snarkvm-console" path = "../../console" -version = "=0.16.15" +version = "=0.16.16" [dependencies.ledger-authority] package = "snarkvm-ledger-authority" path = "../authority" -version = "=0.16.15" +version = "=0.16.16" [dependencies.ledger-coinbase] package = "snarkvm-ledger-coinbase" path = "../../ledger/coinbase" -version = "=0.16.15" +version = "=0.16.16" [dependencies.ledger-committee] package = "snarkvm-ledger-committee" path = "../../ledger/committee" -version = "=0.16.15" +version = "=0.16.16" [dependencies.ledger-narwhal-subdag] package = "snarkvm-ledger-narwhal-subdag" path = "../narwhal/subdag" -version = "=0.16.15" +version = "=0.16.16" [dependencies.ledger-narwhal-transmission-id] package = "snarkvm-ledger-narwhal-transmission-id" path = "../narwhal/transmission-id" -version = "=0.16.15" +version = "=0.16.16" [dependencies.synthesizer-program] package = "snarkvm-synthesizer-program" path = "../../synthesizer/program" -version = "=0.16.15" +version = "=0.16.16" [dependencies.synthesizer-snark] package = "snarkvm-synthesizer-snark" path = "../../synthesizer/snark" -version = "=0.16.15" +version = "=0.16.16" [dependencies.indexmap] version = "2.0" diff --git a/ledger/coinbase/Cargo.toml b/ledger/coinbase/Cargo.toml index 4af319fcec..2d1d5ad41a 100644 --- a/ledger/coinbase/Cargo.toml +++ b/ledger/coinbase/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-ledger-coinbase" -version = "0.16.15" +version = "0.16.16" authors = [ "The Aleo Team " ] description = "Coinbase puzzle for a decentralized virtual machine" homepage = "https://aleo.org" @@ -50,27 +50,27 @@ wasm = [ [dependencies.console] package = "snarkvm-console" path = "../../console" -version = "=0.16.15" +version = "=0.16.16" [dependencies.snarkvm-algorithms] path = "../../algorithms" -version = "=0.16.15" +version = "=0.16.16" [dependencies.snarkvm-curves] path = "../../curves" -version = "=0.16.15" +version = "=0.16.16" [dependencies.snarkvm-fields] path = "../../fields" -version = "=0.16.15" +version = "=0.16.16" [dependencies.snarkvm-synthesizer-snark] path = "../../synthesizer/snark" -version = "=0.16.15" +version = "=0.16.16" [dependencies.snarkvm-utilities] path = "../../utilities" -version = "=0.16.15" +version = "=0.16.16" default-features = false [dependencies.aleo-std] diff --git a/ledger/committee/Cargo.toml b/ledger/committee/Cargo.toml index 2bfae2c3f0..e95eeb5c99 100644 --- a/ledger/committee/Cargo.toml +++ b/ledger/committee/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-ledger-committee" -version = "0.16.15" +version = "0.16.16" authors = [ "The Aleo Team " ] description = "A committee for a decentralized virtual machine" homepage = "https://aleo.org" @@ -34,7 +34,7 @@ test-helpers = [ "prop-tests", "rand_distr" ] [dependencies.console] package = "snarkvm-console" path = "../../console" -version = "=0.16.15" +version = "=0.16.16" [dependencies.indexmap] version = "2.0" @@ -43,7 +43,7 @@ features = [ "serde", "rayon" ] [dependencies.metrics] package = "snarkvm-metrics" path = "../../metrics" -version = "=0.16.15" +version = "=0.16.16" optional = true [dependencies.serde_json] diff --git a/ledger/narwhal/Cargo.toml b/ledger/narwhal/Cargo.toml index 014a7a0599..2a20f76116 100644 --- a/ledger/narwhal/Cargo.toml +++ b/ledger/narwhal/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-ledger-narwhal" -version = "0.16.15" +version = "0.16.16" authors = [ "The Aleo Team " ] description = "Data structures for a Narwhal-style memory pool in a decentralized virtual machine" homepage = "https://aleo.org" @@ -64,37 +64,37 @@ transmission-id = [ "narwhal-transmission-id" ] [dependencies.narwhal-batch-certificate] package = "snarkvm-ledger-narwhal-batch-certificate" path = "./batch-certificate" -version = "=0.16.15" +version = "=0.16.16" optional = true [dependencies.narwhal-batch-header] package = "snarkvm-ledger-narwhal-batch-header" path = "./batch-header" -version = "=0.16.15" +version = "=0.16.16" optional = true [dependencies.narwhal-data] package = "snarkvm-ledger-narwhal-data" path = "./data" -version = "=0.16.15" +version = "=0.16.16" optional = true [dependencies.narwhal-subdag] package = "snarkvm-ledger-narwhal-subdag" path = "./subdag" -version = "=0.16.15" +version = "=0.16.16" optional = true [dependencies.narwhal-transmission] package = "snarkvm-ledger-narwhal-transmission" path = "./transmission" -version = "=0.16.15" +version = "=0.16.16" optional = true [dependencies.narwhal-transmission-id] package = "snarkvm-ledger-narwhal-transmission-id" path = "./transmission-id" -version = "=0.16.15" +version = "=0.16.16" optional = true [dev-dependencies.snarkvm-ledger-narwhal] diff --git a/ledger/narwhal/batch-certificate/Cargo.toml b/ledger/narwhal/batch-certificate/Cargo.toml index 0e91b4f2e5..e37c115fe1 100644 --- a/ledger/narwhal/batch-certificate/Cargo.toml +++ b/ledger/narwhal/batch-certificate/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-ledger-narwhal-batch-certificate" -version = "0.16.15" +version = "0.16.16" authors = [ "The Aleo Team " ] description = "A batch certificate for a Narwhal-style memory pool in a decentralized virtual machine" homepage = "https://aleo.org" @@ -32,17 +32,17 @@ test-helpers = [ "narwhal-batch-header/test-helpers" ] [dependencies.console] package = "snarkvm-console" path = "../../../console" -version = "=0.16.15" +version = "=0.16.16" [dependencies.narwhal-batch-header] package = "snarkvm-ledger-narwhal-batch-header" path = "../batch-header" -version = "=0.16.15" +version = "=0.16.16" [dependencies.narwhal-transmission-id] package = "snarkvm-ledger-narwhal-transmission-id" path = "../transmission-id" -version = "=0.16.15" +version = "=0.16.16" [dependencies.indexmap] version = "2.0" diff --git a/ledger/narwhal/batch-header/Cargo.toml b/ledger/narwhal/batch-header/Cargo.toml index 2469093f4f..a17cea25f2 100644 --- a/ledger/narwhal/batch-header/Cargo.toml +++ b/ledger/narwhal/batch-header/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-ledger-narwhal-batch-header" -version = "0.16.15" +version = "0.16.16" authors = [ "The Aleo Team " ] description = "A batch header for a Narwhal-style memory pool in a decentralized virtual machine" homepage = "https://aleo.org" @@ -32,12 +32,12 @@ test-helpers = [ "narwhal-transmission-id/test-helpers", "time" ] [dependencies.console] package = "snarkvm-console" path = "../../../console" -version = "=0.16.15" +version = "=0.16.16" [dependencies.narwhal-transmission-id] package = "snarkvm-ledger-narwhal-transmission-id" path = "../transmission-id" -version = "=0.16.15" +version = "=0.16.16" [dependencies.indexmap] version = "2.0" diff --git a/ledger/narwhal/data/Cargo.toml b/ledger/narwhal/data/Cargo.toml index 0605db8cd8..017942e977 100644 --- a/ledger/narwhal/data/Cargo.toml +++ b/ledger/narwhal/data/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-ledger-narwhal-data" -version = "0.16.15" +version = "0.16.16" authors = [ "The Aleo Team " ] description = "A batch certificate for a Narwhal-style memory pool in a decentralized virtual machine" homepage = "https://aleo.org" @@ -29,7 +29,7 @@ async = [ "tokio" ] [dependencies.console] package = "snarkvm-console" path = "../../../console" -version = "=0.16.15" +version = "=0.16.16" [dependencies.bytes] version = "1" diff --git a/ledger/narwhal/subdag/Cargo.toml b/ledger/narwhal/subdag/Cargo.toml index 34c72d5888..0d9d74d88f 100644 --- a/ledger/narwhal/subdag/Cargo.toml +++ b/ledger/narwhal/subdag/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-ledger-narwhal-subdag" -version = "0.16.15" +version = "0.16.16" authors = [ "The Aleo Team " ] description = "A subdag for a Narwhal-style memory pool in a decentralized virtual machine" homepage = "https://aleo.org" @@ -32,22 +32,22 @@ test-helpers = [ "narwhal-batch-certificate/test-helpers" ] [dependencies.console] package = "snarkvm-console" path = "../../../console" -version = "=0.16.15" +version = "=0.16.16" [dependencies.narwhal-batch-certificate] package = "snarkvm-ledger-narwhal-batch-certificate" path = "../batch-certificate" -version = "=0.16.15" +version = "=0.16.16" [dependencies.narwhal-batch-header] package = "snarkvm-ledger-narwhal-batch-header" path = "../batch-header" -version = "=0.16.15" +version = "=0.16.16" [dependencies.narwhal-transmission-id] package = "snarkvm-ledger-narwhal-transmission-id" path = "../transmission-id" -version = "=0.16.15" +version = "=0.16.16" [dependencies.indexmap] version = "2.0" diff --git a/ledger/narwhal/transmission-id/Cargo.toml b/ledger/narwhal/transmission-id/Cargo.toml index 337d55df0a..627f9cd371 100644 --- a/ledger/narwhal/transmission-id/Cargo.toml +++ b/ledger/narwhal/transmission-id/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-ledger-narwhal-transmission-id" -version = "0.16.15" +version = "0.16.16" authors = [ "The Aleo Team " ] description = "A transmission ID for a Narwhal-style memory pool in a decentralized virtual machine" homepage = "https://aleo.org" @@ -32,12 +32,12 @@ test-helpers = [ ] [dependencies.console] package = "snarkvm-console" path = "../../../console" -version = "=0.16.15" +version = "=0.16.16" [dependencies.ledger-coinbase] package = "snarkvm-ledger-coinbase" path = "../../coinbase" -version = "=0.16.15" +version = "=0.16.16" [dev-dependencies.bincode] version = "1.3" diff --git a/ledger/narwhal/transmission/Cargo.toml b/ledger/narwhal/transmission/Cargo.toml index e50f7952c5..192a5b0b8e 100644 --- a/ledger/narwhal/transmission/Cargo.toml +++ b/ledger/narwhal/transmission/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-ledger-narwhal-transmission" -version = "0.16.15" +version = "0.16.16" authors = [ "The Aleo Team " ] description = "A transmission for a Narwhal-style memory pool in a decentralized virtual machine" homepage = "https://aleo.org" @@ -32,22 +32,22 @@ test-helpers = [ ] [dependencies.console] package = "snarkvm-console" path = "../../../console" -version = "=0.16.15" +version = "=0.16.16" [dependencies.ledger-block] package = "snarkvm-ledger-block" path = "../../block" -version = "=0.16.15" +version = "=0.16.16" [dependencies.ledger-coinbase] package = "snarkvm-ledger-coinbase" path = "../../coinbase" -version = "=0.16.15" +version = "=0.16.16" [dependencies.ledger-narwhal-data] package = "snarkvm-ledger-narwhal-data" path = "../data" -version = "=0.16.15" +version = "=0.16.16" [dependencies.bytes] version = "1" diff --git a/ledger/query/Cargo.toml b/ledger/query/Cargo.toml index 5feb1fba04..0bdfaa087c 100644 --- a/ledger/query/Cargo.toml +++ b/ledger/query/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-ledger-query" -version = "0.16.15" +version = "0.16.16" authors = [ "The Aleo Team " ] description = "A query for a decentralized virtual machine" homepage = "https://aleo.org" @@ -34,18 +34,18 @@ query = [ "ledger-store", "synthesizer-program", "ureq" ] [dependencies.console] package = "snarkvm-console" path = "../../console" -version = "=0.16.15" +version = "=0.16.16" [dependencies.ledger-store] package = "snarkvm-ledger-store" path = "../store" -version = "=0.16.15" +version = "=0.16.16" optional = true [dependencies.synthesizer-program] package = "snarkvm-synthesizer-program" path = "../../synthesizer/program" -version = "=0.16.15" +version = "=0.16.16" optional = true [dependencies.async-trait] diff --git a/ledger/store/Cargo.toml b/ledger/store/Cargo.toml index e17fa0900f..1de3f3d700 100644 --- a/ledger/store/Cargo.toml +++ b/ledger/store/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-ledger-store" -version = "0.16.15" +version = "0.16.16" authors = [ "The Aleo Team " ] description = "A data store for a decentralized virtual machine" homepage = "https://aleo.org" @@ -42,42 +42,42 @@ test = [ ] [dependencies.console] package = "snarkvm-console" path = "../../console" -version = "=0.16.15" +version = "=0.16.16" [dependencies.ledger-authority] package = "snarkvm-ledger-authority" path = "../authority" -version = "=0.16.15" +version = "=0.16.16" [dependencies.ledger-block] package = "snarkvm-ledger-block" path = "../block" -version = "=0.16.15" +version = "=0.16.16" [dependencies.ledger-coinbase] package = "snarkvm-ledger-coinbase" path = "../coinbase" -version = "=0.16.15" +version = "=0.16.16" [dependencies.ledger-committee] package = "snarkvm-ledger-committee" path = "../committee" -version = "=0.16.15" +version = "=0.16.16" [dependencies.ledger-narwhal-batch-certificate] package = "snarkvm-ledger-narwhal-batch-certificate" path = "../narwhal/batch-certificate" -version = "=0.16.15" +version = "=0.16.16" [dependencies.synthesizer-program] package = "snarkvm-synthesizer-program" path = "../../synthesizer/program" -version = "=0.16.15" +version = "=0.16.16" [dependencies.synthesizer-snark] package = "snarkvm-synthesizer-snark" path = "../../synthesizer/snark" -version = "=0.16.15" +version = "=0.16.16" [dependencies.aleo-std] version = "0.1.18" diff --git a/ledger/test-helpers/Cargo.toml b/ledger/test-helpers/Cargo.toml index a9889f8940..039ce0a5a1 100644 --- a/ledger/test-helpers/Cargo.toml +++ b/ledger/test-helpers/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-ledger-test-helpers" -version = "0.16.15" +version = "0.16.16" authors = [ "The Aleo Team " ] description = "Test helpers for a decentralized virtual machine" homepage = "https://aleo.org" @@ -19,39 +19,39 @@ edition = "2021" [dependencies.console] package = "snarkvm-console" path = "../../console" -version = "=0.16.15" +version = "=0.16.16" [dependencies.circuit] package = "snarkvm-circuit" path = "../../circuit" -version = "=0.16.15" +version = "=0.16.16" [dependencies.ledger-block] package = "snarkvm-ledger-block" path = "../block" -version = "=0.16.15" +version = "=0.16.16" [dependencies.ledger-query] package = "snarkvm-ledger-query" path = "../query" -version = "=0.16.15" +version = "=0.16.16" default-features = false features = [ "query" ] [dependencies.ledger-store] package = "snarkvm-ledger-store" path = "../store" -version = "=0.16.15" +version = "=0.16.16" [dependencies.synthesizer-program] package = "snarkvm-synthesizer-program" path = "../../synthesizer/program" -version = "=0.16.15" +version = "=0.16.16" [dependencies.synthesizer-process] package = "snarkvm-synthesizer-process" path = "../../synthesizer/process" -version = "=0.16.15" +version = "=0.16.16" [dependencies.once_cell] version = "1.18" diff --git a/metrics/Cargo.toml b/metrics/Cargo.toml index 04dc3a620d..8d6f27c843 100644 --- a/metrics/Cargo.toml +++ b/metrics/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-metrics" -version = "0.16.15" +version = "0.16.16" authors = [ "The Aleo Team " ] description = "Metrics for a decentralized virtual machine" homepage = "https://aleo.org" diff --git a/parameters/Cargo.toml b/parameters/Cargo.toml index 932f9ba0e2..7ee14c4f66 100644 --- a/parameters/Cargo.toml +++ b/parameters/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-parameters" -version = "0.16.15" +version = "0.16.16" authors = [ "The Aleo Team " ] description = "Parameters for a decentralized virtual machine" homepage = "https://aleo.org" @@ -31,12 +31,12 @@ wasm = [ "encoding", "js-sys", "web-sys" ] [dependencies.snarkvm-curves] path = "../curves" -version = "=0.16.15" +version = "=0.16.16" default-features = false [dependencies.snarkvm-utilities] path = "../utilities" -version = "=0.16.15" +version = "=0.16.16" [dependencies.aleo-std] version = "0.1.18" diff --git a/synthesizer/Cargo.toml b/synthesizer/Cargo.toml index 9afbf50875..b020f197ef 100644 --- a/synthesizer/Cargo.toml +++ b/synthesizer/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-synthesizer" -version = "0.16.15" +version = "0.16.16" authors = [ "The Aleo Team " ] description = "Synthesizer for a decentralized virtual machine" homepage = "https://aleo.org" @@ -69,61 +69,61 @@ harness = false [dependencies.algorithms] package = "snarkvm-algorithms" path = "../algorithms" -version = "=0.16.15" +version = "=0.16.16" [dependencies.circuit] package = "snarkvm-circuit" path = "../circuit" -version = "=0.16.15" +version = "=0.16.16" [dependencies.console] package = "snarkvm-console" path = "../console" -version = "=0.16.15" +version = "=0.16.16" [dependencies.ledger-block] package = "snarkvm-ledger-block" path = "../ledger/block" -version = "=0.16.15" +version = "=0.16.16" [dependencies.ledger-coinbase] package = "snarkvm-ledger-coinbase" path = "../ledger/coinbase" -version = "=0.16.15" +version = "=0.16.16" [dependencies.ledger-committee] package = "snarkvm-ledger-committee" path = "../ledger/committee" -version = "=0.16.15" +version = "=0.16.16" [dependencies.ledger-query] package = "snarkvm-ledger-query" path = "../ledger/query" -version = "=0.16.15" +version = "=0.16.16" default-features = false features = [ "query" ] [dependencies.ledger-store] package = "snarkvm-ledger-store" path = "../ledger/store" -version = "=0.16.15" +version = "=0.16.16" [dependencies.synthesizer-process] package = "snarkvm-synthesizer-process" path = "./process" -version = "=0.16.15" +version = "=0.16.16" optional = true [dependencies.synthesizer-program] package = "snarkvm-synthesizer-program" path = "./program" -version = "=0.16.15" +version = "=0.16.16" optional = true [dependencies.synthesizer-snark] package = "snarkvm-synthesizer-snark" path = "./snark" -version = "=0.16.15" +version = "=0.16.16" optional = true [dependencies.aleo-std] diff --git a/synthesizer/process/Cargo.toml b/synthesizer/process/Cargo.toml index 8b3ec8171d..6ed039bcf3 100644 --- a/synthesizer/process/Cargo.toml +++ b/synthesizer/process/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-synthesizer-process" -version = "0.16.15" +version = "0.16.16" authors = [ "The Aleo Team " ] description = "A process for a decentralized virtual machine" homepage = "https://aleo.org" @@ -48,45 +48,45 @@ timer = [ "aleo-std/timer" ] [dependencies.console] package = "snarkvm-console" path = "../../console" -version = "=0.16.15" +version = "=0.16.16" default-features = false features = [ "network", "program", "types" ] [dependencies.circuit] package = "snarkvm-circuit" path = "../../circuit" -version = "=0.16.15" +version = "=0.16.16" [dependencies.ledger-block] package = "snarkvm-ledger-block" path = "../../ledger/block" -version = "=0.16.15" +version = "=0.16.16" [dependencies.ledger-query] package = "snarkvm-ledger-query" path = "../../ledger/query" -version = "=0.16.15" +version = "=0.16.16" default-features = false [dependencies.ledger-store] package = "snarkvm-ledger-store" path = "../../ledger/store" -version = "=0.16.15" +version = "=0.16.16" [dependencies.synthesizer-program] package = "snarkvm-synthesizer-program" path = "../../synthesizer/program" -version = "=0.16.15" +version = "=0.16.16" [dependencies.synthesizer-snark] package = "snarkvm-synthesizer-snark" path = "../../synthesizer/snark" -version = "=0.16.15" +version = "=0.16.16" [dependencies.utilities] package = "snarkvm-utilities" path = "../../utilities" -version = "=0.16.15" +version = "=0.16.16" [dependencies.aleo-std] version = "0.1.18" diff --git a/synthesizer/program/Cargo.toml b/synthesizer/program/Cargo.toml index ae2ad7a9ba..337f422845 100644 --- a/synthesizer/program/Cargo.toml +++ b/synthesizer/program/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-synthesizer-program" -version = "0.16.15" +version = "0.16.16" authors = [ "The Aleo Team " ] description = "Program for a decentralized virtual machine" homepage = "https://aleo.org" @@ -31,12 +31,12 @@ wasm = [ "console/wasm" ] [dependencies.circuit] package = "snarkvm-circuit" path = "../../circuit" -version = "=0.16.15" +version = "=0.16.16" [dependencies.console] package = "snarkvm-console" path = "../../console" -version = "=0.16.15" +version = "=0.16.16" default-features = false features = [ "account", "network", "program", "types" ] diff --git a/synthesizer/snark/Cargo.toml b/synthesizer/snark/Cargo.toml index 100ce851b9..9e1b4db620 100644 --- a/synthesizer/snark/Cargo.toml +++ b/synthesizer/snark/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-synthesizer-snark" -version = "0.16.15" +version = "0.16.16" authors = [ "The Aleo Team " ] description = "SNARK wrappers for a decentralized virtual machine" homepage = "https://aleo.org" @@ -33,18 +33,18 @@ wasm = [ "console/wasm", "snarkvm-algorithms/wasm" ] [dependencies.circuit] package = "snarkvm-circuit" path = "../../circuit" -version = "=0.16.15" +version = "=0.16.16" [dependencies.console] package = "snarkvm-console" path = "../../console" -version = "=0.16.15" +version = "=0.16.16" default-features = false features = [ "network" ] [dependencies.snarkvm-algorithms] path = "../../algorithms" -version = "=0.16.15" +version = "=0.16.16" [dependencies.bincode] version = "1" diff --git a/utilities/Cargo.toml b/utilities/Cargo.toml index bbced72fca..99583002e7 100644 --- a/utilities/Cargo.toml +++ b/utilities/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-utilities" -version = "0.16.15" +version = "0.16.16" authors = [ "The Aleo Team " ] description = "Utilities for a decentralized virtual machine" homepage = "https://aleo.org" @@ -25,7 +25,7 @@ edition = "2021" [dependencies.snarkvm-utilities-derives] path = "./derives" -version = "=0.16.15" +version = "=0.16.16" optional = true [dependencies.aleo-std] diff --git a/utilities/derives/Cargo.toml b/utilities/derives/Cargo.toml index 29d966060b..dba4c9ea07 100644 --- a/utilities/derives/Cargo.toml +++ b/utilities/derives/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-utilities-derives" -version = "0.16.15" +version = "0.16.16" authors = [ "The Aleo Team " ] description = "Canonical serialization for a decentralized virtual machine" homepage = "https://aleo.org" diff --git a/wasm/Cargo.toml b/wasm/Cargo.toml index 0ab51f4d5a..65bafca14b 100644 --- a/wasm/Cargo.toml +++ b/wasm/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-wasm" -version = "0.16.15" +version = "0.16.16" authors = [ "The Aleo Team " ] description = "WASM for a decentralized virtual machine" homepage = "https://aleo.org" @@ -51,54 +51,54 @@ utilities = [ "snarkvm-utilities" ] [dependencies.snarkvm-circuit-network] path = "../circuit/network" -version = "=0.16.15" +version = "=0.16.16" features = [ "wasm" ] optional = true [dependencies.snarkvm-console] path = "../console" -version = "=0.16.15" +version = "=0.16.16" features = [ "wasm" ] optional = true [dependencies.snarkvm-curves] path = "../curves" -version = "=0.16.15" +version = "=0.16.16" optional = true [dependencies.snarkvm-fields] path = "../fields" -version = "=0.16.15" +version = "=0.16.16" optional = true [dependencies.snarkvm-ledger-block] path = "../ledger/block" -version = "=0.16.15" +version = "=0.16.16" features = [ "wasm" ] optional = true [dependencies.snarkvm-ledger-query] path = "../ledger/query" -version = "=0.16.15" +version = "=0.16.16" features = [ "async", "wasm" ] optional = true [dependencies.snarkvm-ledger-store] path = "../ledger/store" -version = "=0.16.15" +version = "=0.16.16" features = [ "wasm" ] optional = true [dependencies.snarkvm-synthesizer] path = "../synthesizer" -version = "=0.16.15" +version = "=0.16.16" default-features = false features = [ "async", "wasm" ] optional = true [dependencies.snarkvm-utilities] path = "../utilities" -version = "=0.16.15" +version = "=0.16.16" features = [ "wasm" ] optional = true From 408d266201cf9e037872f975697e0f23887defd9 Mon Sep 17 00:00:00 2001 From: Vehorny <153144728+vehorny@users.noreply.github.com> Date: Tue, 16 Jan 2024 19:21:36 +0100 Subject: [PATCH 149/298] Update README.md Signed-off-by: Vehorny <153144728+vehorny@users.noreply.github.com> --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index f496a6c566..2837fc4497 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@

- +

From 70a11e5c686008aea9f81f5daf8e5e48f72a2f20 Mon Sep 17 00:00:00 2001 From: Vehorny <153144728+vehorny@users.noreply.github.com> Date: Tue, 16 Jan 2024 19:22:10 +0100 Subject: [PATCH 150/298] Update config.yml Signed-off-by: Vehorny <153144728+vehorny@users.noreply.github.com> --- .github/ISSUE_TEMPLATE/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml index 0fe536b67d..ae0e2f01e8 100644 --- a/.github/ISSUE_TEMPLATE/config.yml +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -1,5 +1,5 @@ blank_issues_enabled: true contact_links: - name: ❓ Q&A Technical Support Channel - url: https://aleo.org/discord + url: https://discord.com/invite/aleo about: For quick questions or technical troubleshooting, please ask them on our dedicated Discord channel. From 271354b4b9fe01a600a63c3141994510440ed065 Mon Sep 17 00:00:00 2001 From: bishopcheckmate Date: Tue, 16 Jan 2024 22:42:38 +0100 Subject: [PATCH 151/298] chore(console/types): update console/network dev-dependency --- console/types/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/console/types/Cargo.toml b/console/types/Cargo.toml index a3b3dc8d72..b6c58870ad 100644 --- a/console/types/Cargo.toml +++ b/console/types/Cargo.toml @@ -55,7 +55,7 @@ version = "0.5.1" [dev-dependencies.snarkvm-console-network] path = "../network" -version = "=0.16.15" +version = "=0.16.16" [features] default = [ From 5cbb9e04e743250c010627d6c7b027328467bc70 Mon Sep 17 00:00:00 2001 From: Vehorny <153144728+vehorny@users.noreply.github.com> Date: Wed, 17 Jan 2024 01:54:16 +0100 Subject: [PATCH 152/298] Update README.md Signed-off-by: Vehorny <153144728+vehorny@users.noreply.github.com> --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 2837fc4497..81bf265b44 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@

- +

From 05fa8bf2d9ce24f5f9f0f1837b81840c877b8d50 Mon Sep 17 00:00:00 2001 From: Vehorny <153144728+vehorny@users.noreply.github.com> Date: Wed, 17 Jan 2024 01:54:29 +0100 Subject: [PATCH 153/298] Update config.yml Signed-off-by: Vehorny <153144728+vehorny@users.noreply.github.com> --- .github/ISSUE_TEMPLATE/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml index ae0e2f01e8..17610f64a1 100644 --- a/.github/ISSUE_TEMPLATE/config.yml +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -1,5 +1,5 @@ blank_issues_enabled: true contact_links: - name: ❓ Q&A Technical Support Channel - url: https://discord.com/invite/aleo + url: https://discord.gg/aleo about: For quick questions or technical troubleshooting, please ask them on our dedicated Discord channel. From 07e34984af3de0c28bca90335d98243d0fe1c1de Mon Sep 17 00:00:00 2001 From: Jos Dehaes Date: Wed, 17 Jan 2024 11:41:46 +0100 Subject: [PATCH 154/298] fix: bump metrics crates + API changes --- metrics/Cargo.toml | 4 ++-- metrics/src/lib.rs | 24 +++++++++++++++--------- 2 files changed, 17 insertions(+), 11 deletions(-) diff --git a/metrics/Cargo.toml b/metrics/Cargo.toml index 8d6f27c843..3609d0567b 100644 --- a/metrics/Cargo.toml +++ b/metrics/Cargo.toml @@ -24,7 +24,7 @@ license = "Apache-2.0" edition = "2021" [dependencies.metrics] -version = "0.21" +version = "0.22" [dependencies.metrics-exporter-prometheus] -version = "0.12" +version = "0.13" diff --git a/metrics/src/lib.rs b/metrics/src/lib.rs index 4108fb9a86..81cfa46bbd 100644 --- a/metrics/src/lib.rs +++ b/metrics/src/lib.rs @@ -31,7 +31,7 @@ pub fn register_metrics() { /// Registers a counter with the given name. pub fn register_counter(name: &'static str) { - ::metrics::register_counter!(name); + let _counter = ::metrics::counter!(name); } /// Updates a counter with the given name to the given value. @@ -39,7 +39,8 @@ pub fn register_counter(name: &'static str) { /// Counters represent a single monotonic value, which means the value can only be incremented, /// not decremented, and always starts out with an initial value of zero. pub fn counter>(name: &'static str, value: V) { - ::metrics::counter!(name, value.into()); + let counter = ::metrics::counter!(name); + counter.absolute(value.into()); } /// Increments a counter with the given name by one. @@ -47,14 +48,15 @@ pub fn counter>(name: &'static str, value: V) { /// Counters represent a single monotonic value, which means the value can only be incremented, /// not decremented, and always starts out with an initial value of zero. pub fn increment_counter(name: &'static str) { - ::metrics::increment_counter!(name); + let counter = ::metrics::counter!(name); + counter.increment(1); } /******** Gauge ********/ /// Registers a gauge with the given name. pub fn register_gauge(name: &'static str) { - ::metrics::register_gauge!(name); + let _gauge = ::metrics::gauge!(name); } /// Updates a gauge with the given name to the given value. @@ -62,7 +64,8 @@ pub fn register_gauge(name: &'static str) { /// Gauges represent a single value that can go up or down over time, /// and always starts out with an initial value of zero. pub fn gauge>(name: &'static str, value: V) { - ::metrics::gauge!(name, value.into()); + let gauge = ::metrics::gauge!(name); + gauge.set(value.into()); } /// Increments a gauge with the given name by the given value. @@ -70,7 +73,8 @@ pub fn gauge>(name: &'static str, value: V) { /// Gauges represent a single value that can go up or down over time, /// and always starts out with an initial value of zero. pub fn increment_gauge>(name: &'static str, value: V) { - ::metrics::increment_gauge!(name, value.into()); + let gauge = ::metrics::gauge!(name); + gauge.increment(value.into()); } /// Decrements a gauge with the given name by the given value. @@ -78,17 +82,19 @@ pub fn increment_gauge>(name: &'static str, value: V) { /// Gauges represent a single value that can go up or down over time, /// and always starts out with an initial value of zero. pub fn decrement_gauge>(name: &'static str, value: V) { - ::metrics::decrement_gauge!(name, value.into()); + let gauge = ::metrics::gauge!(name); + gauge.decrement(value.into()); } /******** Histogram ********/ /// Registers a histogram with the given name. pub fn register_histogram(name: &'static str) { - ::metrics::register_histogram!(name); + let _histogram = ::metrics::histogram!(name); } /// Updates a histogram with the given name to the given value. pub fn histogram>(name: &'static str, value: V) { - ::metrics::histogram!(name, value.into()); + let histogram = ::metrics::histogram!(name); + histogram.record(value.into()); } From e2a21827effb00b583346e92da34520dbbf4369e Mon Sep 17 00:00:00 2001 From: Jos Dehaes Date: Wed, 17 Jan 2024 11:42:48 +0100 Subject: [PATCH 155/298] chore: update lock file --- Cargo.lock | 45 ++++++++++++--------------------------------- 1 file changed, 12 insertions(+), 33 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index c03b491735..5f69077ca1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1486,15 +1486,6 @@ dependencies = [ "libc", ] -[[package]] -name = "mach2" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d0d1830bcd151a6fc4aea1369af235b36c1528fe976b8ff678683c9995eade8" -dependencies = [ - "libc", -] - [[package]] name = "matchers" version = "0.1.0" @@ -1521,23 +1512,23 @@ dependencies = [ [[package]] name = "metrics" -version = "0.21.1" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fde3af1a009ed76a778cb84fdef9e7dbbdf5775ae3e4cc1f434a6a307f6f76c5" +checksum = "77b9e10a211c839210fd7f99954bda26e5f8e26ec686ad68da6a32df7c80e782" dependencies = [ "ahash", - "metrics-macros", "portable-atomic", ] [[package]] name = "metrics-exporter-prometheus" -version = "0.12.1" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a4964177ddfdab1e3a2b37aec7cf320e14169abb0ed73999f558136409178d5" +checksum = "83a4c4718a371ddfb7806378f23617876eea8b82e5ff1324516bcd283249d9ea" dependencies = [ "base64", "hyper", + "hyper-tls", "indexmap 1.9.3", "ipnet", "metrics", @@ -1548,22 +1539,11 @@ dependencies = [ "tracing", ] -[[package]] -name = "metrics-macros" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ddece26afd34c31585c74a4db0630c376df271c285d682d1e55012197830b6df" -dependencies = [ - "proc-macro2", - "quote 1.0.33", - "syn 2.0.38", -] - [[package]] name = "metrics-util" -version = "0.15.1" +version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4de2ed6e491ed114b40b732e4d1659a9d53992ebd87490c44a6ffe23739d973e" +checksum = "2670b8badcc285d486261e2e9f1615b506baff91427b61bd336a472b65bbf5ed" dependencies = [ "crossbeam-epoch", "crossbeam-utils", @@ -1954,13 +1934,12 @@ dependencies = [ [[package]] name = "quanta" -version = "0.11.1" +version = "0.12.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a17e662a7a8291a865152364c20c7abc5e60486ab2001e8ec10b24862de0b9ab" +checksum = "9ca0b7bac0b97248c40bb77288fc52029cf1459c0461ea1b05ee32ccf011de2c" dependencies = [ "crossbeam-utils", "libc", - "mach2", "once_cell", "raw-cpuid", "wasi", @@ -2049,11 +2028,11 @@ dependencies = [ [[package]] name = "raw-cpuid" -version = "10.7.0" +version = "11.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c297679cb867470fa8c9f67dbba74a78d78e3e98d7cf2b08d6d71540f797332" +checksum = "9d86a7c4638d42c44551f4791a20e687dbb4c3de1f33c43dd71e355cd429def1" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.4.0", ] [[package]] From c22922378001dcc6e561d8db193c8e43e7b18a90 Mon Sep 17 00:00:00 2001 From: evan-schott <53463459+evan-schott@users.noreply.github.com> Date: Thu, 18 Jan 2024 11:46:35 -0800 Subject: [PATCH 156/298] Increase aborted transactions limit --- console/network/src/lib.rs | 2 ++ ledger/block/src/transactions/mod.rs | 5 +++++ ledger/block/src/verify.rs | 4 ++-- synthesizer/src/vm/finalize.rs | 4 ++-- 4 files changed, 11 insertions(+), 4 deletions(-) diff --git a/console/network/src/lib.rs b/console/network/src/lib.rs index 717946cba2..c33d4dc0cf 100644 --- a/console/network/src/lib.rs +++ b/console/network/src/lib.rs @@ -111,6 +111,8 @@ pub trait Network: const COINBASE_PUZZLE_DEGREE: u32 = (1 << 13) - 1; // 8,191 /// The maximum number of solutions that can be included per block. const MAX_SOLUTIONS: usize = 1 << 8; // 256 solutions + /// The maximum number of transactions and solutions that can be included per block per round per validator. + const MAX_TRANSMISSIONS_PER_BATCH: usize = 250; /// The number of blocks per epoch. const NUM_BLOCKS_PER_EPOCH: u32 = 3600 / Self::BLOCK_TIME as u32; // 360 blocks == ~1 hour diff --git a/ledger/block/src/transactions/mod.rs b/ledger/block/src/transactions/mod.rs index e49dc6a9d1..6d1a2cc8c1 100644 --- a/ledger/block/src/transactions/mod.rs +++ b/ledger/block/src/transactions/mod.rs @@ -41,6 +41,8 @@ use synthesizer_program::FinalizeOperation; use indexmap::IndexMap; +use ledger_committee::Committee; +use ledger_narwhal_subdag::Subdag; #[cfg(not(feature = "serial"))] use rayon::prelude::*; @@ -166,6 +168,9 @@ impl Transactions { } impl Transactions { + /// The maximum number of aborted transactions allowed in a block. + pub const MAX_ABORTED_TRANSACTIONS: usize = + Subdag::::MAX_ROUNDS * Committee::::MAX_COMMITTEE_SIZE as usize * N::MAX_TRANSMISSIONS_PER_BATCH; /// The maximum number of transactions allowed in a block. pub const MAX_TRANSACTIONS: usize = usize::pow(2, TRANSACTIONS_DEPTH as u32); diff --git a/ledger/block/src/verify.rs b/ledger/block/src/verify.rs index 6a278897b9..95c824a666 100644 --- a/ledger/block/src/verify.rs +++ b/ledger/block/src/verify.rs @@ -393,10 +393,10 @@ impl Block { } // Ensure the number of aborted transaction IDs is within the allowed range. - if self.aborted_transaction_ids.len() > Transactions::::MAX_TRANSACTIONS { + if self.aborted_transaction_ids.len() > Transactions::::MAX_ABORTED_TRANSACTIONS { bail!( "Cannot validate a block with more than {} aborted transaction IDs", - Transactions::::MAX_TRANSACTIONS + Transactions::::MAX_ABORTED_TRANSACTIONS ); } diff --git a/synthesizer/src/vm/finalize.rs b/synthesizer/src/vm/finalize.rs index f209d2be8f..700a95dbec 100644 --- a/synthesizer/src/vm/finalize.rs +++ b/synthesizer/src/vm/finalize.rs @@ -172,11 +172,11 @@ impl> VM { // Perform the finalize operation on the preset finalize mode. atomic_finalize!(self.finalize_store(), FinalizeMode::DryRun, { // Ensure the number of transactions does not exceed the maximum. - if num_transactions > 2 * Transactions::::MAX_TRANSACTIONS { + if num_transactions > Transactions::::MAX_ABORTED_TRANSACTIONS { // Note: This will abort the entire atomic batch. return Err(format!( "Too many transactions in the block - {num_transactions} (max: {})", - 2 * Transactions::::MAX_TRANSACTIONS + Transactions::::MAX_ABORTED_TRANSACTIONS )); } From d5699f6d7141feb6ac12b8811858bc4c9e6a29e6 Mon Sep 17 00:00:00 2001 From: evan-schott <53463459+evan-schott@users.noreply.github.com> Date: Thu, 18 Jan 2024 14:42:10 -0800 Subject: [PATCH 157/298] Fixing additional limit checks --- ledger/block/src/bytes.rs | 2 +- ledger/block/src/lib.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ledger/block/src/bytes.rs b/ledger/block/src/bytes.rs index 448c24cc3d..598731a696 100644 --- a/ledger/block/src/bytes.rs +++ b/ledger/block/src/bytes.rs @@ -52,7 +52,7 @@ impl FromBytes for Block { // Read the number of aborted transaction IDs. let num_aborted = u32::read_le(&mut reader)?; // Ensure the number of aborted transaction IDs is within bounds (this is an early safety check). - if num_aborted as usize > Transactions::::MAX_TRANSACTIONS { + if num_aborted as usize > Transactions::::MAX_ABORTED_TRANSACTIONS { return Err(error("Invalid number of aborted transaction IDs in the block")); } // Read the aborted transaction IDs. diff --git a/ledger/block/src/lib.rs b/ledger/block/src/lib.rs index ff495b2ade..eccf37af50 100644 --- a/ledger/block/src/lib.rs +++ b/ledger/block/src/lib.rs @@ -137,10 +137,10 @@ impl Block { } // Ensure the number of aborted transaction IDs is within the allowed range. - if aborted_transaction_ids.len() > Transactions::::MAX_TRANSACTIONS { + if aborted_transaction_ids.len() > Transactions::::MAX_ABORTED_TRANSACTIONS { bail!( "Cannot initialize a block with more than {} aborted transaction IDs", - Transactions::::MAX_TRANSACTIONS + Transactions::::MAX_ABORTED_TRANSACTIONS ); } From acbe309fe960390b7edb2b606928566d5cbd712f Mon Sep 17 00:00:00 2001 From: raychu86 <14917648+raychu86@users.noreply.github.com> Date: Thu, 18 Jan 2024 14:59:16 -0800 Subject: [PATCH 158/298] Add test for aborted solution --- ledger/src/tests.rs | 47 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/ledger/src/tests.rs b/ledger/src/tests.rs index 997a3a875e..61a7a4fc65 100644 --- a/ledger/src/tests.rs +++ b/ledger/src/tests.rs @@ -638,6 +638,53 @@ fn test_aborted_transaction_indexing() { ledger.advance_to_next_block(&block).unwrap(); } +#[test] +fn test_aborted_solution_ids() { + let rng = &mut TestRng::default(); + + // Initialize the test environment. + let crate::test_helpers::TestEnv { ledger, private_key, address, .. } = crate::test_helpers::sample_test_env(rng); + + // Retrieve the coinbase puzzle parameters. + let coinbase_puzzle = ledger.coinbase_puzzle(); + let epoch_challenge = ledger.latest_epoch_challenge().unwrap(); + let minimum_proof_target = ledger.latest_proof_target(); + + // Create a solution that is less than the minimum proof target. + let mut invalid_solution = coinbase_puzzle.prove(&epoch_challenge, address, rng.gen(), None).unwrap(); + while invalid_solution.to_target().unwrap() >= minimum_proof_target { + invalid_solution = coinbase_puzzle.prove(&epoch_challenge, address, rng.gen(), None).unwrap(); + } + + // Create a valid transaction for the block. + let inputs = [Value::from_str(&format!("{address}")).unwrap(), Value::from_str("10u64").unwrap()]; + let transfer_transaction = ledger + .vm + .execute(&private_key, ("credits.aleo", "transfer_public"), inputs.iter(), None, 0, None, rng) + .unwrap(); + + // Create a block. + let block = ledger + .prepare_advance_to_next_beacon_block( + &private_key, + vec![], + vec![invalid_solution], + vec![transfer_transaction], + rng, + ) + .unwrap(); + + // Check that the next block is valid. + ledger.check_next_block(&block, rng).unwrap(); + + // Add the deployment block to the ledger. + ledger.advance_to_next_block(&block).unwrap(); + + // Enforce that the block solution was aborted properly. + assert!(block.solutions().is_none()); + assert_eq!(block.aborted_solution_ids(), &vec![invalid_solution.commitment()]); +} + #[test] fn test_execute_duplicate_input_ids() { let rng = &mut TestRng::default(); From cdf74d6a4cf17a8e5b46ecdbef95362a908b2ed3 Mon Sep 17 00:00:00 2001 From: Howard Wu <9260812+howardwu@users.noreply.github.com> Date: Thu, 18 Jan 2024 15:43:28 -0800 Subject: [PATCH 159/298] Update ledger/narwhal/subdag/src/lib.rs Signed-off-by: Howard Wu <9260812+howardwu@users.noreply.github.com> --- ledger/narwhal/subdag/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ledger/narwhal/subdag/src/lib.rs b/ledger/narwhal/subdag/src/lib.rs index 6c406368dc..6f78a9be98 100644 --- a/ledger/narwhal/subdag/src/lib.rs +++ b/ledger/narwhal/subdag/src/lib.rs @@ -208,7 +208,7 @@ impl Subdag { .map(|certificate| (certificate.timestamp(), committee.get_stake(certificate.author()))) .collect::>(); - // Return the weighted median timestamp + // Return the weighted median timestamp. weighted_median(timestamps_and_stakes) } } From 3c1c40b036fc25ecb01df677191459a126aa68d8 Mon Sep 17 00:00:00 2001 From: raychu86 <14917648+raychu86@users.noreply.github.com> Date: Thu, 18 Jan 2024 15:58:41 -0800 Subject: [PATCH 160/298] Use the anchor_round - 1 for median timestamps --- ledger/narwhal/subdag/src/lib.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ledger/narwhal/subdag/src/lib.rs b/ledger/narwhal/subdag/src/lib.rs index 6f78a9be98..622d5d2911 100644 --- a/ledger/narwhal/subdag/src/lib.rs +++ b/ledger/narwhal/subdag/src/lib.rs @@ -201,10 +201,13 @@ impl Subdag { match self.leader_certificate() { BatchCertificate::V1 { .. } => self.leader_certificate().timestamp(), BatchCertificate::V2 { .. } => { - // Retrieve the timestamps and stakes of the certificates. + // Retrieve the anchor round. + let anchor_round = self.anchor_round(); + // Retrieve the timestamps and stakes of the certificates for `anchor_round` - 1. let timestamps_and_stakes = self .values() .flatten() + .filter(|certificate| certificate.round() == anchor_round.saturating_sub(1)) .map(|certificate| (certificate.timestamp(), committee.get_stake(certificate.author()))) .collect::>(); From af66310ab6ebf0a9ad1038fdf42a45cbd7fa310e Mon Sep 17 00:00:00 2001 From: vicsn Date: Thu, 18 Jan 2024 17:31:38 -0800 Subject: [PATCH 161/298] Update synthesizer/process/src/stack/helpers/synthesize.rs Co-authored-by: Howard Wu <9260812+howardwu@users.noreply.github.com> Signed-off-by: vicsn --- synthesizer/process/src/stack/helpers/synthesize.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/synthesizer/process/src/stack/helpers/synthesize.rs b/synthesizer/process/src/stack/helpers/synthesize.rs index 093d2f19a8..212fc01cdb 100644 --- a/synthesizer/process/src/stack/helpers/synthesize.rs +++ b/synthesizer/process/src/stack/helpers/synthesize.rs @@ -49,7 +49,7 @@ impl Stack { _ => self.sample_value(&burner_address, input_type, rng), }) .collect::>>()?; - // Sample is_root + // Sample 'is_root'. let is_root = true; // Compute the request, with a burner private key. From 4032691a0b8351d4b634b7bcc2b137ac324a9e22 Mon Sep 17 00:00:00 2001 From: vicsn Date: Thu, 18 Jan 2024 17:31:45 -0800 Subject: [PATCH 162/298] Update synthesizer/process/src/stack/deploy.rs Co-authored-by: Howard Wu <9260812+howardwu@users.noreply.github.com> Signed-off-by: vicsn --- synthesizer/process/src/stack/deploy.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/synthesizer/process/src/stack/deploy.rs b/synthesizer/process/src/stack/deploy.rs index a67014247e..bb7339abd6 100644 --- a/synthesizer/process/src/stack/deploy.rs +++ b/synthesizer/process/src/stack/deploy.rs @@ -98,7 +98,7 @@ impl Stack { }) .collect::>>()?; lap!(timer, "Sample the inputs"); - // Sample is_root + // Sample 'is_root'. let is_root = true; // Compute the request, with a burner private key. From 56294581df55fd7bf5c6e4b77d8734e1fe6af0c4 Mon Sep 17 00:00:00 2001 From: vicsn Date: Thu, 18 Jan 2024 17:31:51 -0800 Subject: [PATCH 163/298] Update console/program/src/request/verify.rs Co-authored-by: Howard Wu <9260812+howardwu@users.noreply.github.com> Signed-off-by: vicsn --- console/program/src/request/verify.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/console/program/src/request/verify.rs b/console/program/src/request/verify.rs index a36b9ee6ce..8b7bb51684 100644 --- a/console/program/src/request/verify.rs +++ b/console/program/src/request/verify.rs @@ -52,7 +52,7 @@ impl Request { } }; - // Compute the is_root field + // Compute the 'is_root' field. let is_root = if is_root { Field::::one() } else { Field::::zero() }; // Construct the signature message as `[tvk, tcm, function ID, input IDs]`. From 0e841a3e0ef56cffefc09500db20eed6137fa808 Mon Sep 17 00:00:00 2001 From: vicsn Date: Thu, 18 Jan 2024 17:31:57 -0800 Subject: [PATCH 164/298] Update synthesizer/process/src/tests/test_credits.rs Co-authored-by: Howard Wu <9260812+howardwu@users.noreply.github.com> Signed-off-by: vicsn --- synthesizer/process/src/tests/test_credits.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/synthesizer/process/src/tests/test_credits.rs b/synthesizer/process/src/tests/test_credits.rs index 546415c00d..bf9a4672bf 100644 --- a/synthesizer/process/src/tests/test_credits.rs +++ b/synthesizer/process/src/tests/test_credits.rs @@ -1520,7 +1520,7 @@ mod sanity_checks { let program_id = *program.id(); // Retrieve the input types. let input_types = program.get_function(&function_name).unwrap().input_types(); - // Sample is_root. + // Sample 'is_root'. let is_root = true; // Compute the request. let request = From 50131e8b7b4bce08b225aebb37b2da7f07faadda Mon Sep 17 00:00:00 2001 From: vicsn Date: Thu, 18 Jan 2024 17:32:15 -0800 Subject: [PATCH 165/298] Update console/program/src/request/sign.rs Co-authored-by: Howard Wu <9260812+howardwu@users.noreply.github.com> Signed-off-by: vicsn --- console/program/src/request/sign.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/console/program/src/request/sign.rs b/console/program/src/request/sign.rs index a9a617c6af..362059fed7 100644 --- a/console/program/src/request/sign.rs +++ b/console/program/src/request/sign.rs @@ -64,7 +64,7 @@ impl Request { let tvk = (*signer * r).to_x_coordinate(); // Compute the transition commitment `tcm` as `Hash(tvk)`. let tcm = N::hash_psd2(&[tvk])?; - // Compute the is_root field + // Compute 'is_root' as a field element. let is_root = if is_root { Field::::one() } else { Field::::zero() }; // Retrieve the network ID. From d31d280b461728141abf773586f5a289868caa2b Mon Sep 17 00:00:00 2001 From: vicsn Date: Thu, 18 Jan 2024 17:32:22 -0800 Subject: [PATCH 166/298] Update console/program/src/request/mod.rs Co-authored-by: Howard Wu <9260812+howardwu@users.noreply.github.com> Signed-off-by: vicsn --- console/program/src/request/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/console/program/src/request/mod.rs b/console/program/src/request/mod.rs index 40c91f6be3..c45b4220a7 100644 --- a/console/program/src/request/mod.rs +++ b/console/program/src/request/mod.rs @@ -184,7 +184,7 @@ mod test_helpers { let input_external_record = Value::from_str(&record_string).unwrap(); let inputs = vec![input_constant, input_public, input_private, input_record, input_external_record]; - // Construct is_root + // Construct 'is_root'. let is_root = false; // Construct the input types. From 1713869f76d298d5c72ca28408d88834ad692fee Mon Sep 17 00:00:00 2001 From: vicsn Date: Thu, 18 Jan 2024 17:32:26 -0800 Subject: [PATCH 167/298] Update circuit/program/src/request/verify.rs Co-authored-by: Howard Wu <9260812+howardwu@users.noreply.github.com> Signed-off-by: vicsn --- circuit/program/src/request/verify.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/circuit/program/src/request/verify.rs b/circuit/program/src/request/verify.rs index 99f5d1c50d..1ccbbd3608 100644 --- a/circuit/program/src/request/verify.rs +++ b/circuit/program/src/request/verify.rs @@ -356,7 +356,7 @@ mod tests { console::ValueType::from_str("token.aleo/token.record").unwrap(), ]; - // Sample is_root. + // Sample 'is_root'. let is_root = true; // Compute the signed request. From 7d1dfe64184a09c5522ee69807e3479bfa56cd34 Mon Sep 17 00:00:00 2001 From: vicsn Date: Thu, 18 Jan 2024 17:32:31 -0800 Subject: [PATCH 168/298] Update circuit/program/src/request/verify.rs Co-authored-by: Howard Wu <9260812+howardwu@users.noreply.github.com> Signed-off-by: vicsn --- circuit/program/src/request/verify.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/circuit/program/src/request/verify.rs b/circuit/program/src/request/verify.rs index 1ccbbd3608..8bff32e3cc 100644 --- a/circuit/program/src/request/verify.rs +++ b/circuit/program/src/request/verify.rs @@ -29,7 +29,7 @@ impl Request { // Compute the function ID. let function_id = compute_function_id(&self.network_id, &self.program_id, &self.function_name); - // Compute the is_root field + // Compute 'is_root' as a field element. let is_root = Ternary::ternary(&is_root, &Field::::one(), &Field::::zero()); // Construct the signature message as `[tvk, tcm, function ID, input IDs]`. From 833bb2eb5b1761d003f9e238fef2046fb6e3c8e6 Mon Sep 17 00:00:00 2001 From: raychu86 <14917648+raychu86@users.noreply.github.com> Date: Thu, 18 Jan 2024 17:33:59 -0800 Subject: [PATCH 169/298] Fix compilation --- synthesizer/process/src/stack/call/mod.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/synthesizer/process/src/stack/call/mod.rs b/synthesizer/process/src/stack/call/mod.rs index 73a818cd77..da3910da95 100644 --- a/synthesizer/process/src/stack/call/mod.rs +++ b/synthesizer/process/src/stack/call/mod.rs @@ -277,6 +277,7 @@ impl CallTrait for Call { *function.name(), inputs.iter(), &function.input_types(), + is_root, rng, )?; From f9cd6559a48b80d38e1000bec023c8326e9e2a65 Mon Sep 17 00:00:00 2001 From: raychu86 <14917648+raychu86@users.noreply.github.com> Date: Thu, 18 Jan 2024 17:36:39 -0800 Subject: [PATCH 170/298] Resample genesis block and parameters --- .../src/testnet3/resources/block.genesis | Bin 13728 -> 13728 bytes .../testnet3/resources/bond_public.metadata | 6 +++--- .../testnet3/resources/bond_public.verifier | Bin 665 -> 665 bytes .../resources/claim_unbond_public.metadata | 6 +++--- .../resources/claim_unbond_public.verifier | Bin 665 -> 665 bytes .../testnet3/resources/fee_private.metadata | 6 +++--- .../testnet3/resources/fee_private.verifier | Bin 665 -> 665 bytes .../testnet3/resources/fee_public.metadata | 6 +++--- .../testnet3/resources/fee_public.verifier | Bin 665 -> 665 bytes .../src/testnet3/resources/join.metadata | 6 +++--- .../src/testnet3/resources/join.verifier | Bin 665 -> 665 bytes .../resources/set_validator_state.metadata | 6 +++--- .../resources/set_validator_state.verifier | Bin 665 -> 665 bytes .../src/testnet3/resources/split.metadata | 6 +++--- .../src/testnet3/resources/split.verifier | Bin 665 -> 665 bytes .../resources/transfer_private.metadata | 6 +++--- .../resources/transfer_private.verifier | Bin 665 -> 665 bytes .../transfer_private_to_public.metadata | 6 +++--- .../transfer_private_to_public.verifier | Bin 665 -> 665 bytes .../resources/transfer_public.metadata | 6 +++--- .../resources/transfer_public.verifier | Bin 665 -> 665 bytes .../transfer_public_to_private.metadata | 6 +++--- .../transfer_public_to_private.verifier | Bin 665 -> 665 bytes .../unbond_delegator_as_validator.metadata | 6 +++--- .../unbond_delegator_as_validator.verifier | Bin 665 -> 665 bytes .../testnet3/resources/unbond_public.metadata | 6 +++--- .../testnet3/resources/unbond_public.verifier | Bin 665 -> 665 bytes 27 files changed, 39 insertions(+), 39 deletions(-) diff --git a/parameters/src/testnet3/resources/block.genesis b/parameters/src/testnet3/resources/block.genesis index 2751faa0802b96c1e871e195b859d0c91384d460..f9d68ce00c0ee9155f71366d5bc83cdf51ce9ce8 100644 GIT binary patch delta 11033 zcmZA6RahM97O3HF8h3Yh*WeJ`A-G$B;I6^DaRR~J9fEtX;2PW^xVr>*IGNdd_BnIv z`hV)_s*A7QUMtr&*Omgf60b-m4c`F#ELhy>)geSUpEq_<^O&_%bVewPEm#2?MeY@jN;|cG%MuWCb{0kne)YqwD4^0{bUZow$g)DKp+4a z06;IAJpcdzP@u!RI!L(K+w;k37?Bvh9}Wp8&2VkD5Y-rvc*d`42JD1yaZ`VvHtwP1xp|9h`hx`^VxJf_~_& zV}5eX{@a0-+CG}_z(22=Az>Zko#+5rn{B<}XP=D9A8*>+y@Yt_#wz*c5KSG90#*4n z9=I+Kwt&-WrDlSK95rn4ob$Jx{(I*O%RcL_^EKCKfB1v|CQdM36H#~rRwPPR^8Kw! z4}{a3vaw9u4~2cUx_lVE%H~dXiL~i4ZI_72CxzoQGz@NpRat>V9q) zx?73^oy^1^Z9goJLyf3DzB_POAa(5p7-g%>GsoOa$K!6qAR``?bGg+@LLJsWZWbo> zJLlDKXwFu`%o^86JY9WgjNmEA;G?~B2C) ztW>621rvWy0450=eXJ`%YFc^mSSWeA2op3j?47jN2l?vCu_Lco>+9qHyhTjjUU5jS z)kzz!2Jn)aubGPV(-j8r`1vu&HjSZkl4dJk^RUB{|9*PvLSVYzS{LzLUNwMcC`8D| zfJ!r{`3k7z9ftueJyy&tK~sgqPyYB=kai&@1or8veVW+dywuvts<$$7%RlY{7a(C_ z0y|-w))QfE6e_4;zTfY;DJ3X@;t5@>K?p$7LlC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~Ihh_n88x#t%aRC95nJ{4YTT(e>m%>G2 z#AJtm#G?FJJ*~J$4SoePz!m`rWs;d8;e#YSr9*?LVYYh#zG?t`I-3r&w(TsKFvuXp z)YW3fQF3GfwJ8^zHpAeJMhJ4wk~+}FB->bEwch(6ea`@sDFHBGMFxuOUrwoiha{c^ z2Q>q3Y;SHeujS37A~6IHT&~>41ohn~=!wASVx`_;*eExEcrw+P*0}9JT9=Oc*L9JK zMNar0AD_aFs=TVTAeQe#|7^Cf>4qkEe+zg@Zr|zvleqyfUm>bKz-O~oAFDL8P?=@k zdu>*4g%vV z;YnKlSl$FAUx+cM?+Pl4DjMx+tGy$whtMe QaXAg262##B;XCEQ&%E{01poj5 diff --git a/parameters/src/testnet3/resources/join.metadata b/parameters/src/testnet3/resources/join.metadata index a38cb47534..bd373df5d6 100644 --- a/parameters/src/testnet3/resources/join.metadata +++ b/parameters/src/testnet3/resources/join.metadata @@ -1,6 +1,6 @@ { - "prover_checksum": "256f69ed4c93a8ca4c8db40185ca8d56fd8f629f20846e069a1b90cccdd5a420", - "prover_size": 74596892, - "verifier_checksum": "96f05ba47ef211d860e8a14aee7e03c5a79111378a5d318e023d988fe656cfc2", + "prover_checksum": "5c161ba7406234a89634ed5928aef9c922cf6c9c438ae8c763d5c3a4bfe1ece0", + "prover_size": 74597012, + "verifier_checksum": "91bff5c9aa47cd846f9ab9095a6c31819de9ce6a70f4ef5f15b0564b4924e357", "verifier_size": 665 } \ No newline at end of file diff --git a/parameters/src/testnet3/resources/join.verifier b/parameters/src/testnet3/resources/join.verifier index f5af7a5c7b297c11a60771f6324b80ec3dc4c117..5ed90804e4c9df912a8fe24d84ef31eb96eedfd0 100644 GIT binary patch delta 475 zcmV<10VMvJ1(^kq8Gpu90RR91006aV0RR91001~A0RR91000aC00000004IhOc;Nk zwg}@oqlFeYg@nP4?kh-Kv&oDW)GqIl0!tz97doAonm6Q03nwHnF@Z`)jdRuoB4qLM zaLo;v_bn3OTO$$QCG*Kvy2~4fjZR{z9n07$=_oit{RL{ES^ismohcK0Kk6t3EF4_cI5mfs;uBFd*ImJg_yn6FO<;T&i73b8y+0 RNd)}6QEpHKfgLQkhACF~#i9TJ delta 475 zcmV<10VMvJ1(^kq8Gpr80RR91006UT0RR91001~A0RR91000aC00000000qc(*%>h zcqD$pZ5(^XiPi{m4C2PlgWdVPa=uBI8GF2CH)G^7Gw%-iY2APEH~^9AV&Zuo=#Jv= zn36}z3`oiLeY8q)bZRrZs0pJ-95g}vL&X%L(8KMb!kU)ihxhna+>M#p|N2LyPNJ`tsIPXdI^k>#~Z8rZy2NjleqyfV8EQciWJq4x=-_$EN=bB zUwt#ev}vOQfA5 zUTXaN3vLUP_XY4zR=r$|FP(mH!4WUsuzhA-0Fy}qFd#YPtpZp+y_N{$)37ud!46bG RE2DuKlGoIkoe%M74|vg**4_XB diff --git a/parameters/src/testnet3/resources/set_validator_state.metadata b/parameters/src/testnet3/resources/set_validator_state.metadata index 804e56d29f..fdc397f6c6 100644 --- a/parameters/src/testnet3/resources/set_validator_state.metadata +++ b/parameters/src/testnet3/resources/set_validator_state.metadata @@ -1,6 +1,6 @@ { - "prover_checksum": "10682b2b36ee2eb5de72693ae27669eb2f5f114dccf26149739d867bb959b602", - "prover_size": 16990236, - "verifier_checksum": "68b67943bc5aad2694763a493dfac553c7b81194c49a2b97ff73724353fda119", + "prover_checksum": "c09158aa79148091bd6e11d6d759ff5162c3a0291559960734490d0ff1f6edad", + "prover_size": 17265036, + "verifier_checksum": "c38e202543a3fffb44d38887d4765a9ea7e09c439e74107c02783da7a002a675", "verifier_size": 665 } \ No newline at end of file diff --git a/parameters/src/testnet3/resources/set_validator_state.verifier b/parameters/src/testnet3/resources/set_validator_state.verifier index afcb24ff59041a17d6bbad542c0cd5030866be80..8eabeab1efdbfbe4a824935bc79d2dd27c8202c9 100644 GIT binary patch literal 665 zcmZP+V1R(vS`hjnls*v+6)%U-wbl@t2SPDCZ*t~&Vt*m!wYTTIglGL<_RqLfARc)vyQUf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{*bH>LzNE@M!3QM{RcAyOu_rtp2-+UNO&GDkC00neE%-v9sr diff --git a/parameters/src/testnet3/resources/split.metadata b/parameters/src/testnet3/resources/split.metadata index 8b1cb65d99..aefae3c6b1 100644 --- a/parameters/src/testnet3/resources/split.metadata +++ b/parameters/src/testnet3/resources/split.metadata @@ -1,6 +1,6 @@ { - "prover_checksum": "75a90c6b83e296f3c8553c52b076694a02d4863ec9f8df17e46e2526ecce45c2", - "prover_size": 75036196, - "verifier_checksum": "61d4ded3eed0b0669f4e36c588dd4561cee5e54ee579c69b1d28bd3be35cbccd", + "prover_checksum": "fa9a6761b79c3f7ed4b913c43e86d236df266936df3adf59462be240b88e60dc", + "prover_size": 75036316, + "verifier_checksum": "fd5cfda7ce0e2b96e13bac4a88f07846bec8f8ff85a618833d0e4dcda9afc4cb", "verifier_size": 665 } \ No newline at end of file diff --git a/parameters/src/testnet3/resources/split.verifier b/parameters/src/testnet3/resources/split.verifier index 32c741095059ef9d5eed244e1b29bb40c590ccfb..4da63b8ff9cc81c7b644b8c4672b9f975a717158 100644 GIT binary patch delta 472 zcmV;}0Vn>M1(^kq8Glk}0RR91000t%0RR91005;X0RR91000aC00000002*q;c5D5 zn?0-2XE6+KsJ6x7A+XUl-j}*Uf<^WlwPR#m>!H*sTcZqpSJY#8Nq~xI#7p$_-1O0r zvQb4wUeeS3`XYm+OIzlj(#gZWQJTwumUkr@t}`g>vf@Vwo{^X_V5Erv7X^c`ahw#2 zZsvV9v6{PMq?K9EM0tWu!wB;vtIhsHq7i^$>D-{-G9e6x0HWIR`C$Kx=bqiu`|&DX zV$fQ#7h1Z!!=4UKA?9*j6V3WC<(2Si)B(rKY7e%#VnGtp4aQ&Jc+41trm0We=v z0loMqMLqaxq9V(#;3TYUD|rIS=!&Nh=s0x=+6M!e`b_J6<2@r~7Mb%}aYKg=1~ OCI;#-Lk5QMYai6o^xWhC delta 472 zcmV;}0Vn>M1(^kq8Glh|0RR91000n#0RR91005;X0RR91000aC00000002o{x9g_Z z#>_eMaDFGGKW6*n9d#+E#Om+4nq&7?scV&*ZDtIdla_I^?MQgy)Brwx0LCzq$SOn! zEssU72v!-^vz=~u3L15~Ew*kTkzL2QAP6Y2af)cRFcH zmBR*nf~8jk3MH@MiJh O%5gV8X`>n;&RybK8PnAO diff --git a/parameters/src/testnet3/resources/transfer_private.metadata b/parameters/src/testnet3/resources/transfer_private.metadata index 4a97792899..1bb5a82e68 100644 --- a/parameters/src/testnet3/resources/transfer_private.metadata +++ b/parameters/src/testnet3/resources/transfer_private.metadata @@ -1,6 +1,6 @@ { - "prover_checksum": "985522347142d78f4a36fdc7c991973656f63d58ac54077cb61e82f95b14c2e2", - "prover_size": 75823940, - "verifier_checksum": "76f639730ee1e6c8facbe3314fa466bef71cc7ceaf592e07a516a3b04e961f9f", + "prover_checksum": "f54ee74775e7ca163990a2499483f1c4c099fc479ef030e64a7e426d6017fda2", + "prover_size": 75824060, + "verifier_checksum": "f9b8045919c925a37944f509676b4e203465d0a240625e31ad7807849767a751", "verifier_size": 665 } \ No newline at end of file diff --git a/parameters/src/testnet3/resources/transfer_private.verifier b/parameters/src/testnet3/resources/transfer_private.verifier index ea672d7cdc7c9773018d1a657e9897a2df2f30dc..625d9ad28137d480d877a3209e019ca875a4e2fb 100644 GIT binary patch delta 470 zcmV;{0V)2O1(^kq8GrSF0RR91007La0RR910015?0RR91000aC00000001Zjoi?(9 zM^%rB3<&fZ**Z~t!@{AQ?PI=1eXYhv72g&gXwp?{Q#fKkj?+OxlSJ>Xq?DhncCjl~FZF1~U&MPuuON`O`F#t;U zXcSkHLul&&Xr_~7wg;73@W`(vtj`Aop0y2tN?}m|%&QdySz4f63NbqE+^*)#cy#0{ zvRkIshvrQy-W(LNTj2ew8CeOS4s{wHb=U)wxB)R>hhe%#^p0v4SJ3fwJ{P<(_k%SF z7*oscs;9<^4rd%ZA_8>Vh;q6jMh{>BV!yJ0WC$dB0|`_8rSOdD@^xp6>6{~W*K^2> zj}Y$2SGj_)PrfuN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Om?SSBePOlkZvh3*8nnDRQR+2txZfd=i~Q~dV@@reD;ii zX)BL@Rh}e*hXsc#A5JT`XvxabC+`tyU8arLp55GlleqyfU@0pasu|JTO&(hn{TLH{ zjf_5Wo>A1-#Ds_12MqF5}g^B)%oJ0BzT!Q0h37rFdzX~yB!X&Rqc&Y!tsp!s;N>m R;M+Z3yNQ+(TiJ;WHUqPE+1CI7 diff --git a/parameters/src/testnet3/resources/transfer_public.metadata b/parameters/src/testnet3/resources/transfer_public.metadata index ad78fc1c18..6efeb2eb2f 100644 --- a/parameters/src/testnet3/resources/transfer_public.metadata +++ b/parameters/src/testnet3/resources/transfer_public.metadata @@ -1,6 +1,6 @@ { - "prover_checksum": "415a047235f092f758b81d3fce9e0599424eef4acf5a7f832f383632957295d2", - "prover_size": 28788210, - "verifier_checksum": "3cda8e41481075c0639d1451c9deff0407fee25420f8698c3683522ff8411885", + "prover_checksum": "0d058154b74c23dd1c0c26b36c0482c4640f0ddf8adf1c4431bc2730975d00a9", + "prover_size": 28788330, + "verifier_checksum": "02592ab999146db1e48624f3e9a32e2041a3a37ae626be092dd7ab12907c7116", "verifier_size": 665 } \ No newline at end of file diff --git a/parameters/src/testnet3/resources/transfer_public.verifier b/parameters/src/testnet3/resources/transfer_public.verifier index 0d51230913bb8c66419f95150539455afbbd93c0..f7d886f3b185f9d19a44628d03e4307725d789e3 100644 GIT binary patch delta 473 zcmV;~0Ve*L1(^kq8Gm$Y00000007dB00000000<300000000aC00000005vm`*;VW zEYYpoJL?Csz(J99Ue{v*FwTjV?kD~@(;d!UK7qaM{DX@C6g;O$R)OyHq*=pAM%W5S zaVh)5x{p+oC{unbL#STue6^}-u>^P~8B5en>^Tw%PauMCcafMeVAqtBxiI^O{^AHp z{y|KU^v#}LUqHZ)fF{P;h}{zpS0!E??8g;f>iY0?MG~SPfs-P-?UXkTN(26~6e+EU zlG3aeHy+~Z3rABoXz3G=!oph|I?$0fRiZ!FkniLMKUQ=<`0|SBB9G} zqljAEc}^J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testnet3/resources/unbond_delegator_as_validator.metadata index 4916716dc5..c6e124e69e 100644 --- a/parameters/src/testnet3/resources/unbond_delegator_as_validator.metadata +++ b/parameters/src/testnet3/resources/unbond_delegator_as_validator.metadata @@ -1,6 +1,6 @@ { - "prover_checksum": "2112ca035da2c9d2be297b40629089b13f67805d24a91b1a750409c94310832f", - "prover_size": 17159372, - "verifier_checksum": "e9f3a486107342e7b54a2fc56335c062db5f75f202329f1847d1d92daf599135", + "prover_checksum": "7d6c4cd7051eeed35ce37275ee5fd163e0558a5664df022ccf48eefd7ff0758f", + "prover_size": 17434172, + "verifier_checksum": "a88f535a244e2607964b3ad9f0e36c7334204e40d3b99bd514b3300b47602893", "verifier_size": 665 } \ No newline at end of file diff --git a/parameters/src/testnet3/resources/unbond_delegator_as_validator.verifier b/parameters/src/testnet3/resources/unbond_delegator_as_validator.verifier index a132b0cb862452fe2f5b66ca1f21a24e73e08a17..31073cc803e8d8363192d9625bace684287507f1 100644 GIT binary patch literal 665 zcmV;K0%rXI5C8xG00000`z!ze00000@+<%V00000g<${y00000ynX-x00000Ha-9V z000003;+NC00000s0=!yYv{8YjPvuY<}pX-y@9!YdhC#w*-h51K?a+ze-(f-w*a^9 zzt`gku-!WW-4!3r!>48YuZ$oH%O?Y59b_Tv?q@4 zla&zx+KE7nDox`S)v+oKDPo`Z$_D&B)8VREeX?yW5Kq|9XS(1r7lvqQ0^u>-Btvn5 zy`ZSqq^2!&+cA0<5U1d15oG-{6n*0u{ssm!Ol%RYjKX!5p^eh&OHn<4y34=-xSj_b z*`qW+4Ep(wwn|6NHT$s#ke-4*&RLcB!TRSKQ3GTYjPF7NX$E7oRX2|S&^XWi8k|=m z(EQ6dfBRmoSHU(Ftv0pj9s!2?!%^2sGK5ZI#z1U_^8WLk1J){mCkKA->w@(t-l)^J zE}jtBdRV}x5(tBw4sb-?Gq~&5Ynqa<;MH8{Jc?KWd4ru}XPL~ya0MXJT?AY3 zDR*hYe2HRgxzTW9-vw+z-3zi%k}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CN znJTL<>4H0l50l@0lBz4I;Pmnz-*FKKDH-iUQe>8=k853g6;fA0dT xigZ~Q=V$Si5o(NQ7KYAB*WeaNJy(_>ma&FkG|#km>GT_Bt4>L&b1x8|1pxnwEPen0 literal 665 zcmV;K0%rXI5C8xG00000Cn*2`000009Vq|+00000IaB}u000006KVhe00000dN}|9 z000003;+NC0000067ty{H1pmWmTz5t(SL-jyQ|JQWv;>Ye|`^$+kw(Vfy)~yFJC5) zlH`k4CT}+Y7}BcQ+u0};{3IuoI&`YBj((F9F?gQ5ph%@NI%Cxz99svjsO zun|H+#>@yD8{b)nJOSx|D__VA2z!EbZ_Mw^u;^c?%L!vk4=nk+w-q0O{pN!B@nelsZ0G`Qj3U%v5dN*em+6XunM7EX3H^zqYTngGJ zfwoZqf-a}4BbC2t_jbaH_U=vRn+kS;7_gqB)*Oqz-CuIsRQB50tp{4~T*`m7l!nn5x(Md7N)1AahHzz$? From 1271ded8f772aef9decf31cc2ac5be153bb7a6cf Mon Sep 17 00:00:00 2001 From: raychu86 <14917648+raychu86@users.noreply.github.com> Date: Thu, 18 Jan 2024 18:15:35 -0800 Subject: [PATCH 171/298] Resample genesis block and parameters --- .../src/testnet3/resources/block.genesis | Bin 13728 -> 13728 bytes .../testnet3/resources/bond_public.metadata | 4 ++-- .../testnet3/resources/bond_public.verifier | Bin 665 -> 665 bytes .../resources/claim_unbond_public.metadata | 4 ++-- .../resources/claim_unbond_public.verifier | Bin 665 -> 665 bytes .../testnet3/resources/fee_private.metadata | 6 +++--- .../testnet3/resources/fee_private.verifier | Bin 665 -> 665 bytes .../testnet3/resources/fee_public.metadata | 4 ++-- .../testnet3/resources/fee_public.verifier | Bin 665 -> 665 bytes .../src/testnet3/resources/inclusion.metadata | 4 ++-- .../src/testnet3/resources/inclusion.verifier | Bin 665 -> 665 bytes .../src/testnet3/resources/join.metadata | 4 ++-- .../src/testnet3/resources/join.verifier | Bin 665 -> 665 bytes .../resources/set_validator_state.metadata | 4 ++-- .../resources/set_validator_state.verifier | Bin 665 -> 665 bytes .../src/testnet3/resources/split.metadata | 6 +++--- .../src/testnet3/resources/split.verifier | Bin 665 -> 665 bytes .../resources/transfer_private.metadata | 6 +++--- .../resources/transfer_private.verifier | Bin 665 -> 665 bytes .../transfer_private_to_public.metadata | 6 +++--- .../transfer_private_to_public.verifier | Bin 665 -> 665 bytes .../resources/transfer_public.metadata | 4 ++-- .../resources/transfer_public.verifier | Bin 665 -> 665 bytes .../transfer_public_to_private.metadata | 4 ++-- .../transfer_public_to_private.verifier | Bin 665 -> 665 bytes .../unbond_delegator_as_validator.metadata | 4 ++-- .../unbond_delegator_as_validator.verifier | Bin 665 -> 665 bytes .../testnet3/resources/unbond_public.metadata | 4 ++-- .../testnet3/resources/unbond_public.verifier | Bin 665 -> 665 bytes 29 files changed, 32 insertions(+), 32 deletions(-) diff --git a/parameters/src/testnet3/resources/block.genesis b/parameters/src/testnet3/resources/block.genesis index f9d68ce00c0ee9155f71366d5bc83cdf51ce9ce8..a35515db31b30411e7b9e8497f4afc3c052694cc 100644 GIT binary patch delta 11016 zcmZA6V|1Kr!0z#x*k)s^v6IHO)!0_!G|5ctG`1UCjh)7}ZM$)Ex_jPz-nGy3b)GMC zuQmVmo9oWC&9x;1)*Z;&9!rv}#6lRA9?TZUu}SA{w3z^$bUBnWwzd?I;>biu;XeyO zC99W@4|vq;D1DOWxA<6ojFAtifNVlPc%LYV6c?~0)Tpbb^BDyymPBsQWFy{Yi&(sV zH`&nAV2A$lWt|od@K{laD~NxgD}K*W5z%N&L=brUo?+E5;I}-cDncDnU1gJtbN%neD1sApn8EDeF_jan7&n)eZts{1nE4#f$nI z&^8!t{FliCj;L5e0Ef_i{~A|?p`EVYy5`sDkVI}eByZ529^=+-0qG9Fq@w@O@8s9zm6>Tz&9$Pdi2H%s3=KDiZDYu5s*A zcTSpwJ9~hnc%JpEeoM#?PT_+5^VI=_ZBYq8Cvv-vx+GL`0)CfIDLA`ZI}#{)UPOrv zj38JblD)O*7e~_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Ch&nO= diff --git a/parameters/src/testnet3/resources/bond_public.metadata b/parameters/src/testnet3/resources/bond_public.metadata index fa60a67d54..b54260a7c1 100644 --- a/parameters/src/testnet3/resources/bond_public.metadata +++ b/parameters/src/testnet3/resources/bond_public.metadata @@ -1,6 +1,6 @@ { - "prover_checksum": "79722c49dfac290a0e08a16e5c6afd84e14dbc2b650898a615cbd2b92e3c90e8", + "prover_checksum": "ad7d1557c71a301d6d49370b8bbcc402330c7759e68ee44d2be50addd3cf74ce", "prover_size": 28803098, - "verifier_checksum": "fe70aa3a1f28cb10f060693131eecda431ba87b37e9deb0ba509d284841b1268", + "verifier_checksum": "ffe2bc8fd23fbc5d0d77c855f90847d9f592e1e3e0aba1064f893f6f4c017e93", "verifier_size": 665 } \ No newline at end of file diff --git a/parameters/src/testnet3/resources/bond_public.verifier b/parameters/src/testnet3/resources/bond_public.verifier index d951c82f7fdff6a8a0147c34ef8bcd9936a36a71..8549bb552b1688eaaf3c136031901ffd686cbc36 100644 GIT binary patch delta 478 zcmV<40U`dG1(^kqIe!g|Z+WZf!_oS53~Q*S&^6TEe6(~|<;Okk$h&a>!BJ4sH58$? z%tsAw17G|(sets}5t=pEL8_5@ERMiC;PH!}A>t5_W3g@!U1V38CtWUD9vufDWBl z*RTMQ$&i1rz3k=U`sw?9`2-2w%V+~&FVynK+Uw5t_bEHXq7wmE$Q8twa$zey;4ob$ zEn)zGKHJA!33A2K^bFNwV-169D@5K_dv1lhLjbvK1@zotq?hpAHpvp<W6%x zH!4E*OI${fCxVCu!yt7o#rkI#>DYRXeX(cUsGXz)xod-j0Bo;wISER1fY?`OsrwQQ Ub>ANK)KL_$-b)r+k!B-PW66~CH2?qr delta 478 zcmV<40U`dG1(^kqIe&>t-|SlrgLbx5m?eeIn?SO&D}wn?7k}&S;@~RQ$_82AoBU|@ ziw`Ux#a|L0hJd;P2h6W{%(^;Jn6940G^uMckIOF>|4gE9{vW_1% zdSd|s6s4o&zi|7g)`AIG2#(-aOhQZBz)aTV)119IUJ@#YkyuYpTG7W9NXc zm;gr1YZS(5{|RWnCA6ur?5%FCLmx z?xo8hmf*=p)tZ{Ii;4Jj9Utl!-2m7Fc07@4WmB*eSN8pMzlo=S+&*tIm)J*;4WyMX zr)5I+YO3oU={x~i^4ED=?%9otDIf& U>oS^JT7fqqGiJ;zt`-FIU?VB$1^@s6 diff --git a/parameters/src/testnet3/resources/claim_unbond_public.metadata b/parameters/src/testnet3/resources/claim_unbond_public.metadata index b30d2c24a7..b630d86e22 100644 --- a/parameters/src/testnet3/resources/claim_unbond_public.metadata +++ b/parameters/src/testnet3/resources/claim_unbond_public.metadata @@ -1,6 +1,6 @@ { - "prover_checksum": "b0752415daefab892cfac577019a37d08eeb0c5966095194312c243e2f11dc3c", + "prover_checksum": "0b8e147fdab6e80d944c813771e8494cc2c489d503dfb8aaea7a12ca85e45181", "prover_size": 16736180, - "verifier_checksum": "467f41bf663c6a9f1d47bf084fdb5919fc97187c3e217b307628b5918780107e", + "verifier_checksum": "5709fecdad3de57cdf39870e52b3b02b5e21abc7bb0ffec873f2fa17c0cb4e46", "verifier_size": 665 } \ No newline at end of file diff --git a/parameters/src/testnet3/resources/claim_unbond_public.verifier b/parameters/src/testnet3/resources/claim_unbond_public.verifier index 70b9e9ecb49af5227a3a206f70bc7d2a33fe07a5..1497d420644a37612eaa9c5082bc984656b29866 100644 GIT binary patch delta 491 zcmV!(EP&6W#`sH>`*tWeO+NA_i?zDm zV%6FGIh2F?^o~dnwBee7cv&Zyo0!_=RBwXFA%NP+UQ8G}R1<{xB#6heHH5QnM04<61*^C8b-TuXkB$u2-jsf`h8S4Y-EGov#!e-r6{MY_E<>ac=dV>j! zl|{Xl0a{7lCzvTpcrah<8dA-X6ESaxvh?2jsq(@S-ljn26ykhKUU`ROthr{lU_NKBJP&0s@q&k& z`5f*EjTAZBEB3_sinD8^E_Sm@oaBH|?1U@Nf^618%g&-HoL_yOGw%DbHud3@Q9fkB zNYdcNoOT*)-laAKjmK7z2!jDWa-R>AXNIbNnuRl6QSNeHqkazJEi`&!=Y1<-Ry+~< zH_&(JxU3k46}8d>upJwKk;#yMBI6o>^kDUGjFABz0u8dC&FGxG#GY1DXlbp^ob3Z- zxJp=rlc8G_q@fkk>ti~Awj>yXXv`JSrfM!;ZH;Zi?8!#(gZ_4inI31p^8_9@h2dZl z{xrnPnTKR5Is|@zI!6k>N~&^t^s)b~D1R#iERI4^ccU2W%T01y-%#?T5C78R_dGzXhXdsd{T7>rf3nkaO>rVgx diff --git a/parameters/src/testnet3/resources/fee_private.metadata b/parameters/src/testnet3/resources/fee_private.metadata index 038cea9520..f2e5742768 100644 --- a/parameters/src/testnet3/resources/fee_private.metadata +++ b/parameters/src/testnet3/resources/fee_private.metadata @@ -1,6 +1,6 @@ { - "prover_checksum": "012d1e7e0f6933c073d55101ca310a7a86eef08f9d8df2defb4aaef263a01293", - "prover_size": 66172860, - "verifier_checksum": "5701f07c1dd25f0a8f444cc6a6c24bbd698375015ae9819adc67bf2c73cf2643", + "prover_checksum": "714ff002b32d9795bb5b5f6baddffd9c37ce0fffb4d85dd0aed72b07607b91d8", + "prover_size": 66172820, + "verifier_checksum": "59a6c8941333f41709a27ba831b5662973c21cc97ee544574c3d4c01b5ffc4fa", "verifier_size": 665 } \ No newline at end of file diff --git a/parameters/src/testnet3/resources/fee_private.verifier b/parameters/src/testnet3/resources/fee_private.verifier index 35a25bf7858df1b890118de6f576af1e91fd62c8..44fc090d9f0e057265c0f75cfa5ff8e8651c2db4 100644 GIT binary patch delta 530 zcmV+t0`2{o1(^kq83E*x8Xtdg@p40pO;-7Sh; zP-Mz}nj-phOgI2LqQpWm5uF_bD>eO&ELh2M_XW@N)B+|PHtsG?1gJn=mZ`X?J8Z8L zKHnY-CYeY8^_WBiRV(ZnQy;>YA`_Q@(21AvpcWC~?!HvHa4t-Vnx6W)e^P%FmQ)kv zh=rPw_+fuiI3f0e8_cC+KwIb~qbu3m{SbY$?>Ai$bq>{+i8j(4`(1k{u)+YAE8+w! zY>WV@PCr-AV;RA6#U5P!Z(d)PTRLoP<_l3j5@-%;W*rp?6|^yF;jth=RD2Y!)uI5w zsgr-1vM#3$Z@$VG653z~Gtw9F22#F(2y{pRnt^{3T3iiGyQcQMybEc~*=gl~1HBD~ zpWS_+&6l}GPYEYjX)-R&{d$gp`#|ch5`V$}Qu?>5;pcv9T{%P-bV0Fz&ypAgut%H4 zBKRPy`Ud|jiN$D!k~iQQ(ZOGWDQ&I0&_jZ{P>^e)(!C4Z*7Sve`nm-Z47<8QqESf= zrG7%=Td!-2lejuCP82V7jRn-s)ihH09wE~?5-q~dMe{EsqiN7TY z&0|99jcDECvA#4`(?0++7*=|&f8wyYr;B%1xxmg}h#~3|<1FngFL6mx2WU|s7NL|( z-XG5`WE2!1hPMC?XU#0$IQM(hJ4kLT{2&{y2Rse)W}v!6deorWDZW6NMIrOS!}3|4 zUyX`3lA2HeP-9kX&On-vjOP?ii$m##e&LYk6#6kB&Cxp($UFxcT<9z}>im&SGU)B% zaae+p_+fveY1gd`V@YaPO3s!mP>jE{A~MmbY3LQMG($AuV_`!MVVbr}EkX)0i&5NA z#j*gr>2eUmY1fHE+ieN=&%#x5F`)%P<9yYmNm}il#}KnPDt?b$3E({4VN;~G-9-WA zVIQbMjU%kCZfB?jO-?`QebpKS%HBX_>xWh3z0ZHfvWU|f`CjSRGR%k%6e?u_bo5Xf znz!3xfq5(3P|@@m-El9KF8tSM(JH~WYaIU$RmCggwk2P?={k^%_GLb@w}uIybaBngPecImCC z51v9k*XSpYvD%+SBh=*1e U+5w9*_r-|2|AGb|*o@~ diff --git a/parameters/src/testnet3/resources/fee_public.metadata b/parameters/src/testnet3/resources/fee_public.metadata index e0d03c3bc1..f065204c55 100644 --- a/parameters/src/testnet3/resources/fee_public.metadata +++ b/parameters/src/testnet3/resources/fee_public.metadata @@ -1,6 +1,6 @@ { - "prover_checksum": "3309e9507d0fe2af686f2e6224dec1054061945c4786bb50d27545f1f7bfa63e", + "prover_checksum": "d7b309465c0871463a49d4fdfda5aed50be8ddbddd2c7dacc57f129697f62b93", "prover_size": 29049250, - "verifier_checksum": "fbb46e30e35a597b02ea2f21ac9c60f42f5a496cf579a28cab523b943dd14ef2", + "verifier_checksum": "e6f6701c1635dfd11405a8e01a32380f3fa1abdddceed8459ecabae1d48d2ce9", "verifier_size": 665 } \ No newline at end of file diff --git a/parameters/src/testnet3/resources/fee_public.verifier b/parameters/src/testnet3/resources/fee_public.verifier index c43884dab20b1337f20f6440e3e97f1c90af5f43..ee76bd058135e7fc1d9d4f95db6203d6bf16923c 100644 GIT binary patch delta 477 zcmV<30V4jH1(^kqIe$k5m)gxK;&GVk4TXbE7opOlHe8ylpMP4@^nJe}4YNf>kosiL z8yWGx*gG~tBLO6I<>G&ZpWHya^<^zlnF`Adi3i(kLb> zBY};4?zAaCxgFWC;A6&^c98F$v~sQpTaCWAr6OTSFS;{;WbGRA4(Y6RQ|*CEU4W3F z;+200KC^g_-X7iyQ^n}U;rjZ&>i~mmC4ab1=YNE7HJEKlD4RDVwV`VaA18noXC@({ zeQ19yqIJmpW^G~nrm%K!lMi@jH*Ya6)xWpa7V)wOAa!AYwh?HQP_mlhnnsd2|FVYqKqN|M3v#7Kj* zVR`gQY1WZ)A^=ONcnjYdm>d||@^}n}UXuQL4WVFZexb?zYUV{U_&#t9obBMTYh`WV z(|T_O{D9E>NVpIM30=f!4sWF@wSyKK66q#v3PEyLEbYx1FWYWOpP@5Hf)P2qG6f*&bM-JD1!DVI_Z2K7Lb8c8jE}h>IKtu@Azknua zIx9%G3K&2C>Tc|Ry5+SQFb2(~WNQBQDe2Zfj(>aLDEBhIkBN8LzK1t^?p}b)7cfyS ztBy+kY-WC;V+L&0(=^W?+C6#hn7NIQy7u5jeM(qinKlRHrIqDUG(>%X TQ)EwS_&9AykT8z?wZE0Y8lURQ diff --git a/parameters/src/testnet3/resources/inclusion.metadata b/parameters/src/testnet3/resources/inclusion.metadata index 48d10aca82..76f795f99c 100644 --- a/parameters/src/testnet3/resources/inclusion.metadata +++ b/parameters/src/testnet3/resources/inclusion.metadata @@ -1,6 +1,6 @@ { - "prover_checksum": "2ccd040f31b1ee3a1e8ed64b046b5f6a81403d434439e40d35a62c734365c7e7", + "prover_checksum": "8faa4d3aaaa5e786d20b61f825e50901f9dcf470455d1d2994e091eefcc66a4e", "prover_size": 233812212, - "verifier_checksum": "cc0dbd07fea975bb869db792e62647d3a17cd3e75228a34e860665f8394424fd", + "verifier_checksum": "2b6fdf5a869db365620a44fc3991e3f807a4e670bb976277ad327f3179866553", "verifier_size": 665 } \ No newline at end of file diff --git a/parameters/src/testnet3/resources/inclusion.verifier b/parameters/src/testnet3/resources/inclusion.verifier index cd3fd0726caace0621aa07a56b763d35a7a12b88..f317f07efae1ca78a888a6fd73f19072aa283716 100644 GIT binary patch delta 489 zcmVT`k*qqhf&p^WVkl6wRH~;S>dGEuJ_(xXiZ*K;1M3e5XgJZ; z??w*@0yM6&ByGB1sG*G|Vt{+R^`1F^WAg3}fzm`74HY_hi#RJ&`9Ey%lj(DjDG>Kx z$LqP+=xJGfB5Op`t~`;*k$-G!MfMoyK}KYtEb-{~p*|xP^&<&=Z|WIqsA66v`YknD zb?8CNbuN&G{)!|%H-Q`RguL7E)SGng;yAhbe+6_HWJzwN;Yd6IVTL)tS~*z{*xp0J%61RpQ_r8F+|gt z@*S|C&I^Gt3K`a*Ns7Il|3xD5)`mcQ9hU7go=-Mh#e^rBlX#$q0x~n^QqUuqL9(`< zUSI%!#|fB48UioWdoW|wO)-0Y>WJ1AG5SX3d#(&wY5M<8x$F_R7d>b@O@aX?{AYgR~kunwmY9mxh fJS2}LIwzcCY2+wqv_rPC#;y1@=qf?+dWY%y**@nT delta 489 zcmVyaY;mV^u0Or!^#~EU$h}TsZ5|Q z%yr|vWrpK-A*exlo;=Xu8Guq?qA~)d%o;A(njnPuUl#^9K#5t->H@|k<$L52f0`AD z<_5f);=Y^|E8<8dj{x_-)qP!5wlqk;ab$=%;W~PLWAhj390;J-o#q#<&si9x11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ources/set_validator_state.metadata index fdc397f6c6..09cfd03693 100644 --- a/parameters/src/testnet3/resources/set_validator_state.metadata +++ b/parameters/src/testnet3/resources/set_validator_state.metadata @@ -1,6 +1,6 @@ { - "prover_checksum": "c09158aa79148091bd6e11d6d759ff5162c3a0291559960734490d0ff1f6edad", + "prover_checksum": "502ca9fbae0c0fa45e754a133e31ae2416c130d70a6a76c7a94fd866c0b63c69", "prover_size": 17265036, - "verifier_checksum": "c38e202543a3fffb44d38887d4765a9ea7e09c439e74107c02783da7a002a675", + "verifier_checksum": "dedb9b25c7a5cfcfb1b3ac584c40a8bb3c9a8e7518d4ae9387773cdc0ed59c81", "verifier_size": 665 } \ No newline at end of file diff --git a/parameters/src/testnet3/resources/set_validator_state.verifier b/parameters/src/testnet3/resources/set_validator_state.verifier index 8eabeab1efdbfbe4a824935bc79d2dd27c8202c9..3f9c72a2d1144c228ea08330aab224e0aed3ab24 100644 GIT binary patch delta 477 zcmV<30V4jH1(^kqIe%zY6`bCuCV|z<&pG?>6FnFX6o;B#5IbERYgGXb@>y(RHu+E4vz>-CCuGVJOAyZ_G5hURV|SMxA2_;E z#gCE5k$=2vjP9z84HjE+`&c|u+O%;i zJpqbjVuc!wo`yAQ(k)W(g$52%1Lw|7DSH#`bdJxGs~}X1UsE6*lH(js)GOLcya48z zqZUu*#Vfe!b~|mp3tu&V=?R4p&30hvUFW>}o_{{TL>XPMcd9o};O)>Yr~v`^D4s^` zJ+~N0WAKhdaHUdF=6SFmj(X7)=lgHJto^H3w}tQjL~3WJBOJL6+lK%XhZfcF7#);G zcN?)sYY~1DFI}hD7xf_`?+flMfUA(@6Wc{4)LXL%)mnA~?u3BX3vINET;t`@#82eZ zl0qtfX58N`s6A`izri#%?09D69q*Pfp_79NZddtj$>u76fOVRnhw8=xR2+;8>298T T-65ecHd8r;la&-lf+EkInXc#J delta 477 zcmV<30V4jH1(^kqIe+JZLk#3U&}8dNNuFTlkMzHo(sE0=t=HS~T{XzG&$~>EkP#^a z@{b>_C=#7PoB%Jd@3bM_j*&)8nsCNh+x_5WUVB7M-diG^#$1_YHrNjDR!G>Gx`V1+ zgQ@TOtN_CLj!2MnY;>7^o`V!Pnba zNaK;nk$)hAU-MH}vA<5?WrwHgFL~`1+oBdXFMn!RM+apzx~oJH+DMp6`J#Q&u9Nz! zm;o?dI(H%nlZxYV_N^t~4*}BGd>Hmdia?9$6Pk_c- zBvn|^!oj`rj=DXro=l;@K(&XFYCx1spIe*-5gqStc|0!E+->-o42ovzs z_XDJQaZ$!DUfmJV_8j)<>5l%czA2x=q$EaU+7r=!4Rc^Od##mfV-kUh(9G~^ZGP>a ze%g;_Z9yM2q&LJ#%rA%?4J;o{c=zl$U~J7Mmdw+qc4fqo_27Un>aZQV>-&6t+`u2u z-$F4zR#Pbo!FvF$*tl2>PI%}O&;@1p@aHunmC9>H-wap*^ON|}8`=-x_$Q2de(~jb Tp7vGi$n%xIB@J6qq_Z)CUAFiT diff --git a/parameters/src/testnet3/resources/split.metadata b/parameters/src/testnet3/resources/split.metadata index aefae3c6b1..a0318c3e9b 100644 --- a/parameters/src/testnet3/resources/split.metadata +++ b/parameters/src/testnet3/resources/split.metadata @@ -1,6 +1,6 @@ { - "prover_checksum": "fa9a6761b79c3f7ed4b913c43e86d236df266936df3adf59462be240b88e60dc", - "prover_size": 75036316, - "verifier_checksum": "fd5cfda7ce0e2b96e13bac4a88f07846bec8f8ff85a618833d0e4dcda9afc4cb", + "prover_checksum": "0dee4c54612a0e6a78430c8cc58076858dba57b500ede33fcf80134ae571490d", + "prover_size": 75036276, + "verifier_checksum": "1614a11249671d1f8c0b7036d3eeff3e8fa5f42d7b6368b1fcd09a73ea200077", "verifier_size": 665 } \ No newline at end of file diff --git a/parameters/src/testnet3/resources/split.verifier b/parameters/src/testnet3/resources/split.verifier index 4da63b8ff9cc81c7b644b8c4672b9f975a717158..3865279aaec40884ed1fba37b3cfbaa246855796 100644 GIT binary patch delta 531 zcmV+u0_^>n1(^kq839p|8Xtcso(P|(yr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tCEr{_0ex4y8bQiQUF|OAP_`{`>R9ntA03h`fYOgo!R{%RC za??;k?lXm$Y|2wKqHFNHnHO+pjK8;U)c^w6*Dl!Y?4j~VeSuv@yy!Xhf4|G|jn!*) ViF#8%%o*7x2I??F28Qr!AJndC23!CD diff --git a/parameters/src/testnet3/resources/transfer_private.metadata b/parameters/src/testnet3/resources/transfer_private.metadata index 1bb5a82e68..47010da02f 100644 --- a/parameters/src/testnet3/resources/transfer_private.metadata +++ b/parameters/src/testnet3/resources/transfer_private.metadata @@ -1,6 +1,6 @@ { - "prover_checksum": "f54ee74775e7ca163990a2499483f1c4c099fc479ef030e64a7e426d6017fda2", - "prover_size": 75824060, - "verifier_checksum": "f9b8045919c925a37944f509676b4e203465d0a240625e31ad7807849767a751", + "prover_checksum": "e34b8992d3023e30d76bd877a75d234f8ab6bbe41c5378017d35c81be62e45b9", + "prover_size": 75824020, + "verifier_checksum": "75d0acae871833bedd7ce978cfd97cb51a616358509bff975802c4875841053a", "verifier_size": 665 } \ No newline at end of file diff --git a/parameters/src/testnet3/resources/transfer_private.verifier b/parameters/src/testnet3/resources/transfer_private.verifier index 625d9ad28137d480d877a3209e019ca875a4e2fb..889d6eacde8228e251ce27988c442391d517abff 100644 GIT binary patch delta 530 zcmV+t0`2{o1(^kq83FW>8XtecYB*#wH?pfJEvb2?kFzk&-czF@*@XN;DoI>e#8EDx z$@KGWysS@Q!UsS?Y$Sn>osR@2#B&bT5sak-Ht~jk6)DpghI=t97lTE%nj_!|^saPz zs(7jjk*uo{t5*PujzK808m+;;IsU9v9`V&msjf;8JLMt{VOP6(o@_vb=-}w+3e!P= z&mgbZxj&TwZlr$=uB763AI~B`r6eo`CkaRZOpP;0 z#cT{Uxt2~bEbPqAh9>qCiY92dE_!MZ>07zjZJ3DnK{_4X0v3N}dnH!@p22u!kTW+0 zWbUW&*=GN7Bx|;};N928Dkqy#q@lA9g7*jI%B+5@%2GABzYDMc-p2*;FdicVNMD}X z^Ibx4s6^7Drn@ja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`I+6f1XJHRRz8w2H=;$VtnE6t%9{;ZtQGG16OObH8J;Onk6_Ofg6T`zU z1!C;2m=>IX#u_fv^x4ai_xq`5{uRPhrL=PH3WBRv+mX49)+QhWY=%JCqmjsS$cER-!!30nLuRE&p8 zgf#g8b&J;Mhh3F=($Cu;&@TU%t{L|SBQ<`zteT_>vYxo2Ixh@@et!LB?3@h$K>Hh@Q4c`BY`29E3y<_bG2z?&OmBk80u_0UB4rykcXQ zfdq!%px3)=RNy8h(;YWJp^(>@TWWic=;ITOGs4fH;i|jlC?A;(f%WV~>px(F5r##Z zPf}SzW%!XOLDQ)YSl6VDJx)dj_U)cyuM{#os1KI^59!)sfq?FxtQ7x0;6O~y+f%g{ Vutza$L?#M?^5Z9qZv7&x8Q06-2Xp`c diff --git a/parameters/src/testnet3/resources/transfer_public.metadata b/parameters/src/testnet3/resources/transfer_public.metadata index 6efeb2eb2f..d3bd87aa7b 100644 --- a/parameters/src/testnet3/resources/transfer_public.metadata +++ b/parameters/src/testnet3/resources/transfer_public.metadata @@ -1,6 +1,6 @@ { - "prover_checksum": "0d058154b74c23dd1c0c26b36c0482c4640f0ddf8adf1c4431bc2730975d00a9", + "prover_checksum": "63a3f042e52763818a04a488281bba39c9c1d5a522fb3a568e41ef220dfb75f9", "prover_size": 28788330, - "verifier_checksum": "02592ab999146db1e48624f3e9a32e2041a3a37ae626be092dd7ab12907c7116", + "verifier_checksum": "9885663674dd5cb3c185edbbcb6a6dd19062fa025bc75abbf688571eb410ef63", "verifier_size": 665 } \ No newline at end of file diff --git a/parameters/src/testnet3/resources/transfer_public.verifier b/parameters/src/testnet3/resources/transfer_public.verifier index f7d886f3b185f9d19a44628d03e4307725d789e3..ed2098b34a00d7df7b51ac2cfa7a19a075ceeb5a 100644 GIT binary patch delta 478 zcmV<40U`dG1(^kqIe!dSz@E7-c3$=UZ^aP+`LU|w?DL(+0e>W|;BK*E&-*OM-j3QA z{b4dR|HQ>4puCcmLRP#0kqi5IlHT(0 z1AhQf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:16 -0800 Subject: [PATCH 172/298] Rewrite expectations --- .../expectations/vm/execute_and_finalize/test_rand.out | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/synthesizer/tests/expectations/vm/execute_and_finalize/test_rand.out b/synthesizer/tests/expectations/vm/execute_and_finalize/test_rand.out index b75f8b9875..01142551fb 100644 --- a/synthesizer/tests/expectations/vm/execute_and_finalize/test_rand.out +++ b/synthesizer/tests/expectations/vm/execute_and_finalize/test_rand.out @@ -18,20 +18,15 @@ outputs: execute: test_rand.aleo/rand_chacha_check: outputs: - - '{"type":"future","id":"3721325135151760660773959530505944451747681933722462808964783147996869797702field","value":"{\n program_id: test_rand.aleo,\n function_name: rand_chacha_check,\n arguments: [\n 0field,\n false\n ]\n}"}' - speculate: the execution was rejected + - '{"type":"future","id":"488590592441422127997725386233571306457829570948543232762424611162021835080field","value":"{\n program_id: test_rand.aleo,\n function_name: rand_chacha_check,\n arguments: [\n 0field,\n false\n ]\n}"}' + speculate: the execution was accepted add_next_block: succeeded. - verified: true execute: test_rand.aleo/rand_chacha_check: outputs: -<<<<<<< HEAD - - '{"type":"future","id":"887371549615679800380522845098080464570119184210350810479392117984911457950field","value":"{\n program_id: test_rand.aleo,\n function_name: rand_chacha_check,\n arguments: [\n 1field,\n true\n ]\n}"}' - speculate: the execution was rejected -======= - '{"type":"future","id":"884323248557348741020456011434839803868309861690594536593949575748229817915field","value":"{\n program_id: test_rand.aleo,\n function_name: rand_chacha_check,\n arguments: [\n 1field,\n true\n ]\n}"}' speculate: the execution was accepted ->>>>>>> 6133fced4e3330b78e8eeda61050b8e815657f36 add_next_block: succeeded. additional: - child_outputs: From f11f2a379e7b47ee00cc5e1a85c65769cdd0c419 Mon Sep 17 00:00:00 2001 From: Eric McCarthy Date: Fri, 19 Jan 2024 21:37:55 -0800 Subject: [PATCH 173/298] bump rust-toolchain; fixes issue#2274 --- rust-toolchain | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rust-toolchain b/rust-toolchain index 883bde3070..7c7053aa23 100644 --- a/rust-toolchain +++ b/rust-toolchain @@ -1 +1 @@ -1.71.1 \ No newline at end of file +1.75.0 From b8373f5101e482c784f45b1e9549cb2769692820 Mon Sep 17 00:00:00 2001 From: Howard Wu <9260812+howardwu@users.noreply.github.com> Date: Fri, 19 Jan 2024 21:50:02 -0800 Subject: [PATCH 174/298] Update the location for max transmissions per batch --- console/network/src/lib.rs | 2 -- ledger/block/Cargo.toml | 5 +++++ ledger/block/src/transactions/mod.rs | 10 ++++++---- ledger/narwhal/batch-header/src/lib.rs | 5 +++++ 4 files changed, 16 insertions(+), 6 deletions(-) diff --git a/console/network/src/lib.rs b/console/network/src/lib.rs index c33d4dc0cf..717946cba2 100644 --- a/console/network/src/lib.rs +++ b/console/network/src/lib.rs @@ -111,8 +111,6 @@ pub trait Network: const COINBASE_PUZZLE_DEGREE: u32 = (1 << 13) - 1; // 8,191 /// The maximum number of solutions that can be included per block. const MAX_SOLUTIONS: usize = 1 << 8; // 256 solutions - /// The maximum number of transactions and solutions that can be included per block per round per validator. - const MAX_TRANSMISSIONS_PER_BATCH: usize = 250; /// The number of blocks per epoch. const NUM_BLOCKS_PER_EPOCH: u32 = 3600 / Self::BLOCK_TIME as u32; // 360 blocks == ~1 hour diff --git a/ledger/block/Cargo.toml b/ledger/block/Cargo.toml index fc47672c92..4065a13605 100644 --- a/ledger/block/Cargo.toml +++ b/ledger/block/Cargo.toml @@ -56,6 +56,11 @@ package = "snarkvm-ledger-committee" path = "../../ledger/committee" version = "=0.16.16" +[dependencies.ledger-narwhal-batch-header] +package = "snarkvm-ledger-narwhal-batch-header" +path = "../narwhal/batch-header" +version = "=0.16.16" + [dependencies.ledger-narwhal-subdag] package = "snarkvm-ledger-narwhal-subdag" path = "../narwhal/subdag" diff --git a/ledger/block/src/transactions/mod.rs b/ledger/block/src/transactions/mod.rs index 6d1a2cc8c1..794b65cab7 100644 --- a/ledger/block/src/transactions/mod.rs +++ b/ledger/block/src/transactions/mod.rs @@ -37,12 +37,13 @@ use console::{ }, types::{Field, Group, U64}, }; +use ledger_committee::Committee; +use ledger_narwhal_batch_header::BatchHeader; +use ledger_narwhal_subdag::Subdag; use synthesizer_program::FinalizeOperation; use indexmap::IndexMap; -use ledger_committee::Committee; -use ledger_narwhal_subdag::Subdag; #[cfg(not(feature = "serial"))] use rayon::prelude::*; @@ -169,8 +170,9 @@ impl Transactions { impl Transactions { /// The maximum number of aborted transactions allowed in a block. - pub const MAX_ABORTED_TRANSACTIONS: usize = - Subdag::::MAX_ROUNDS * Committee::::MAX_COMMITTEE_SIZE as usize * N::MAX_TRANSMISSIONS_PER_BATCH; + pub const MAX_ABORTED_TRANSACTIONS: usize = Subdag::::MAX_ROUNDS + * Committee::::MAX_COMMITTEE_SIZE as usize + * BatchHeader::::MAX_TRANSMISSIONS_PER_BATCH; /// The maximum number of transactions allowed in a block. pub const MAX_TRANSACTIONS: usize = usize::pow(2, TRANSACTIONS_DEPTH as u32); diff --git a/ledger/narwhal/batch-header/src/lib.rs b/ledger/narwhal/batch-header/src/lib.rs index 64f4bc7b30..473641b003 100644 --- a/ledger/narwhal/batch-header/src/lib.rs +++ b/ledger/narwhal/batch-header/src/lib.rs @@ -63,6 +63,11 @@ impl BatchHeader { pub const MAX_TRANSACTIONS: usize = usize::pow(2, console::program::TRANSACTIONS_DEPTH as u32); /// The maximum number of transmissions in a batch. pub const MAX_TRANSMISSIONS: usize = Self::MAX_SOLUTIONS + Self::MAX_TRANSACTIONS; + /// The maximum number of transmissions in a batch. + /// Note: This limit is set to 50 as part of safety measures to prevent DoS attacks. + /// This limit can be increased in the future as performance improves. Alternatively, + /// the rate of block production can be sped up to compensate for the limit set here. + pub const MAX_TRANSMISSIONS_PER_BATCH: usize = 50; } impl BatchHeader { From 080fcbe4f0b1b756a8cde058b06ee87f699f0915 Mon Sep 17 00:00:00 2001 From: Howard Wu <9260812+howardwu@users.noreply.github.com> Date: Fri, 19 Jan 2024 22:28:16 -0800 Subject: [PATCH 175/298] Rename aborted puzzle commitments to aborted solution heights --- Cargo.lock | 1 + ledger/store/src/block/mod.rs | 40 +++++++++---------- ledger/store/src/helpers/memory/block.rs | 14 +++---- ledger/store/src/helpers/rocksdb/block.rs | 14 +++---- .../store/src/helpers/rocksdb/internal/id.rs | 4 +- synthesizer/src/vm/mod.rs | 2 +- 6 files changed, 38 insertions(+), 37 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index c045f4081e..0c5240f89b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3155,6 +3155,7 @@ dependencies = [ "snarkvm-ledger-coinbase", "snarkvm-ledger-committee", "snarkvm-ledger-narwhal-batch-header", + "snarkvm-ledger-narwhal-subdag", "snarkvm-ledger-narwhal-transmission-id", "snarkvm-ledger-query", "snarkvm-ledger-store", diff --git a/ledger/store/src/block/mod.rs b/ledger/store/src/block/mod.rs index 8bc4cf1621..9d093d855d 100644 --- a/ledger/store/src/block/mod.rs +++ b/ledger/store/src/block/mod.rs @@ -191,8 +191,8 @@ pub trait BlockStorage: 'static + Clone + Send + Sync { type PuzzleCommitmentsMap: for<'a> Map<'a, PuzzleCommitment, u32>; /// The mapping of `block hash` to `[aborted solution ID]`. type AbortedSolutionIDsMap: for<'a> Map<'a, N::BlockHash, Vec>>; - /// The mapping of aborted `puzzle commitment` to `block height`. - type AbortedPuzzleCommitmentsMap: for<'a> Map<'a, PuzzleCommitment, u32>; + /// The mapping of aborted `solution ID` to `block height`. + type AbortedSolutionHeightsMap: for<'a> Map<'a, PuzzleCommitment, u32>; /// The mapping of `block hash` to `[transaction ID]`. type TransactionsMap: for<'a> Map<'a, N::BlockHash, Vec>; /// The mapping of `block hash` to `[aborted transaction ID]`. @@ -235,8 +235,8 @@ pub trait BlockStorage: 'static + Clone + Send + Sync { fn puzzle_commitments_map(&self) -> &Self::PuzzleCommitmentsMap; /// Returns the aborted solution IDs map. fn aborted_solution_ids_map(&self) -> &Self::AbortedSolutionIDsMap; - /// Returns the aborted puzzle commitments map. - fn aborted_puzzle_commitments_map(&self) -> &Self::AbortedPuzzleCommitmentsMap; + /// Returns the aborted solution heights map. + fn aborted_solution_heights_map(&self) -> &Self::AbortedSolutionHeightsMap; /// Returns the accepted transactions map. fn transactions_map(&self) -> &Self::TransactionsMap; /// Returns the aborted transaction IDs map. @@ -273,7 +273,7 @@ pub trait BlockStorage: 'static + Clone + Send + Sync { self.solutions_map().start_atomic(); self.puzzle_commitments_map().start_atomic(); self.aborted_solution_ids_map().start_atomic(); - self.aborted_puzzle_commitments_map().start_atomic(); + self.aborted_solution_heights_map().start_atomic(); self.transactions_map().start_atomic(); self.aborted_transaction_ids_map().start_atomic(); self.rejected_or_aborted_transaction_id_map().start_atomic(); @@ -295,7 +295,7 @@ pub trait BlockStorage: 'static + Clone + Send + Sync { || self.solutions_map().is_atomic_in_progress() || self.puzzle_commitments_map().is_atomic_in_progress() || self.aborted_solution_ids_map().is_atomic_in_progress() - || self.aborted_puzzle_commitments_map().is_atomic_in_progress() + || self.aborted_solution_heights_map().is_atomic_in_progress() || self.transactions_map().is_atomic_in_progress() || self.aborted_transaction_ids_map().is_atomic_in_progress() || self.rejected_or_aborted_transaction_id_map().is_atomic_in_progress() @@ -317,7 +317,7 @@ pub trait BlockStorage: 'static + Clone + Send + Sync { self.solutions_map().atomic_checkpoint(); self.puzzle_commitments_map().atomic_checkpoint(); self.aborted_solution_ids_map().atomic_checkpoint(); - self.aborted_puzzle_commitments_map().atomic_checkpoint(); + self.aborted_solution_heights_map().atomic_checkpoint(); self.transactions_map().atomic_checkpoint(); self.aborted_transaction_ids_map().atomic_checkpoint(); self.rejected_or_aborted_transaction_id_map().atomic_checkpoint(); @@ -339,7 +339,7 @@ pub trait BlockStorage: 'static + Clone + Send + Sync { self.solutions_map().clear_latest_checkpoint(); self.puzzle_commitments_map().clear_latest_checkpoint(); self.aborted_solution_ids_map().clear_latest_checkpoint(); - self.aborted_puzzle_commitments_map().clear_latest_checkpoint(); + self.aborted_solution_heights_map().clear_latest_checkpoint(); self.transactions_map().clear_latest_checkpoint(); self.aborted_transaction_ids_map().clear_latest_checkpoint(); self.rejected_or_aborted_transaction_id_map().clear_latest_checkpoint(); @@ -361,7 +361,7 @@ pub trait BlockStorage: 'static + Clone + Send + Sync { self.solutions_map().atomic_rewind(); self.puzzle_commitments_map().atomic_rewind(); self.aborted_solution_ids_map().atomic_rewind(); - self.aborted_puzzle_commitments_map().atomic_rewind(); + self.aborted_solution_heights_map().atomic_rewind(); self.transactions_map().atomic_rewind(); self.aborted_transaction_ids_map().atomic_rewind(); self.rejected_or_aborted_transaction_id_map().atomic_rewind(); @@ -383,7 +383,7 @@ pub trait BlockStorage: 'static + Clone + Send + Sync { self.solutions_map().abort_atomic(); self.puzzle_commitments_map().abort_atomic(); self.aborted_solution_ids_map().abort_atomic(); - self.aborted_puzzle_commitments_map().abort_atomic(); + self.aborted_solution_heights_map().abort_atomic(); self.transactions_map().abort_atomic(); self.aborted_transaction_ids_map().abort_atomic(); self.rejected_or_aborted_transaction_id_map().abort_atomic(); @@ -405,7 +405,7 @@ pub trait BlockStorage: 'static + Clone + Send + Sync { self.solutions_map().finish_atomic()?; self.puzzle_commitments_map().finish_atomic()?; self.aborted_solution_ids_map().finish_atomic()?; - self.aborted_puzzle_commitments_map().finish_atomic()?; + self.aborted_solution_heights_map().finish_atomic()?; self.transactions_map().finish_atomic()?; self.aborted_transaction_ids_map().finish_atomic()?; self.rejected_or_aborted_transaction_id_map().finish_atomic()?; @@ -477,9 +477,9 @@ pub trait BlockStorage: 'static + Clone + Send + Sync { // Store the aborted solution IDs. self.aborted_solution_ids_map().insert(block.hash(), block.aborted_solution_ids().clone())?; - // Store the block aborted puzzle commitments. - for puzzle_commitment in block.aborted_solution_ids() { - self.aborted_puzzle_commitments_map().insert(*puzzle_commitment, block.height())?; + // Store the block aborted solution heights. + for solution_id in block.aborted_solution_ids() { + self.aborted_solution_heights_map().insert(*solution_id, block.height())?; } // Store the transaction IDs. @@ -607,9 +607,9 @@ pub trait BlockStorage: 'static + Clone + Send + Sync { // Remove the aborted solution IDs. self.aborted_solution_ids_map().remove(block_hash)?; - // Remove the aborted puzzle commitments. - for puzzle_commitment in aborted_solution_ids { - self.aborted_puzzle_commitments_map().remove(&puzzle_commitment)?; + // Remove the aborted solution heights. + for solution_id in aborted_solution_ids { + self.aborted_solution_heights_map().remove(&solution_id)?; } // Remove the transaction IDs. @@ -1371,9 +1371,9 @@ impl> BlockStore { || self.contains_aborted_puzzle_commitment(puzzle_commitment)?) } - /// Returns `true` if the given rejected transaction ID or aborted transaction ID exists. - fn contains_aborted_puzzle_commitment(&self, puzzle_commitment: &PuzzleCommitment) -> Result { - self.storage.aborted_puzzle_commitments_map().contains_key_confirmed(puzzle_commitment) + /// Returns `true` if the given aborted solution ID exists. + fn contains_aborted_puzzle_commitment(&self, solution_id: &PuzzleCommitment) -> Result { + self.storage.aborted_solution_heights_map().contains_key_confirmed(solution_id) } } diff --git a/ledger/store/src/helpers/memory/block.rs b/ledger/store/src/helpers/memory/block.rs index a71bc936f3..029d225852 100644 --- a/ledger/store/src/helpers/memory/block.rs +++ b/ledger/store/src/helpers/memory/block.rs @@ -49,8 +49,8 @@ pub struct BlockMemory { puzzle_commitments_map: MemoryMap, u32>, /// The aborted solution IDs map. aborted_solution_ids_map: MemoryMap>>, - /// The aborted puzzle commitments map. - aborted_puzzle_commitments_map: MemoryMap, u32>, + /// The aborted solution heights map. + aborted_solution_heights_map: MemoryMap, u32>, /// The transactions map. transactions_map: MemoryMap>, /// The aborted transaction IDs map. @@ -78,7 +78,7 @@ impl BlockStorage for BlockMemory { type SolutionsMap = MemoryMap>>; type PuzzleCommitmentsMap = MemoryMap, u32>; type AbortedSolutionIDsMap = MemoryMap>>; - type AbortedPuzzleCommitmentsMap = MemoryMap, u32>; + type AbortedSolutionHeightsMap = MemoryMap, u32>; type TransactionsMap = MemoryMap>; type AbortedTransactionIDsMap = MemoryMap>; type RejectedOrAbortedTransactionIDMap = MemoryMap; @@ -106,7 +106,7 @@ impl BlockStorage for BlockMemory { solutions_map: MemoryMap::default(), puzzle_commitments_map: MemoryMap::default(), aborted_solution_ids_map: MemoryMap::default(), - aborted_puzzle_commitments_map: MemoryMap::default(), + aborted_solution_heights_map: MemoryMap::default(), transactions_map: MemoryMap::default(), aborted_transaction_ids_map: MemoryMap::default(), rejected_or_aborted_transaction_id_map: MemoryMap::default(), @@ -171,9 +171,9 @@ impl BlockStorage for BlockMemory { &self.aborted_solution_ids_map } - /// Returns the puzzle commitments map. - fn aborted_puzzle_commitments_map(&self) -> &Self::AbortedPuzzleCommitmentsMap { - &self.aborted_puzzle_commitments_map + /// Returns the aborted solution heights map. + fn aborted_solution_heights_map(&self) -> &Self::AbortedSolutionHeightsMap { + &self.aborted_solution_heights_map } /// Returns the transactions map. diff --git a/ledger/store/src/helpers/rocksdb/block.rs b/ledger/store/src/helpers/rocksdb/block.rs index ba684efb73..1870172335 100644 --- a/ledger/store/src/helpers/rocksdb/block.rs +++ b/ledger/store/src/helpers/rocksdb/block.rs @@ -55,8 +55,8 @@ pub struct BlockDB { puzzle_commitments_map: DataMap, u32>, /// The aborted solution IDs map. aborted_solution_ids_map: DataMap>>, - /// The aborted puzzle commitments map. - aborted_puzzle_commitments_map: DataMap, u32>, + /// The aborted solution heights map. + aborted_solution_heights_map: DataMap, u32>, /// The transactions map. transactions_map: DataMap>, /// The aborted transaction IDs map. @@ -84,7 +84,7 @@ impl BlockStorage for BlockDB { type SolutionsMap = DataMap>>; type PuzzleCommitmentsMap = DataMap, u32>; type AbortedSolutionIDsMap = DataMap>>; - type AbortedPuzzleCommitmentsMap = DataMap, u32>; + type AbortedSolutionHeightsMap = DataMap, u32>; type TransactionsMap = DataMap>; type AbortedTransactionIDsMap = DataMap>; type RejectedOrAbortedTransactionIDMap = DataMap; @@ -112,7 +112,7 @@ impl BlockStorage for BlockDB { solutions_map: internal::RocksDB::open_map(N::ID, dev, MapID::Block(BlockMap::Solutions))?, puzzle_commitments_map: internal::RocksDB::open_map(N::ID, dev, MapID::Block(BlockMap::PuzzleCommitments))?, aborted_solution_ids_map: internal::RocksDB::open_map(N::ID, dev, MapID::Block(BlockMap::AbortedSolutionIDs))?, - aborted_puzzle_commitments_map: internal::RocksDB::open_map(N::ID, dev, MapID::Block(BlockMap::AbortedPuzzleCommitments))?, + aborted_solution_heights_map: internal::RocksDB::open_map(N::ID, dev, MapID::Block(BlockMap::AbortedSolutionHeights))?, transactions_map: internal::RocksDB::open_map(N::ID, dev, MapID::Block(BlockMap::Transactions))?, aborted_transaction_ids_map: internal::RocksDB::open_map(N::ID, dev, MapID::Block(BlockMap::AbortedTransactionIDs))?, rejected_or_aborted_transaction_id_map: internal::RocksDB::open_map(N::ID, dev, MapID::Block(BlockMap::RejectedOrAbortedTransactionID))?, @@ -177,9 +177,9 @@ impl BlockStorage for BlockDB { &self.aborted_solution_ids_map } - /// Returns the puzzle commitments map. - fn aborted_puzzle_commitments_map(&self) -> &Self::AbortedPuzzleCommitmentsMap { - &self.aborted_puzzle_commitments_map + /// Returns the aborted solution heights map. + fn aborted_solution_heights_map(&self) -> &Self::AbortedSolutionHeightsMap { + &self.aborted_solution_heights_map } /// Returns the transactions map. diff --git a/ledger/store/src/helpers/rocksdb/internal/id.rs b/ledger/store/src/helpers/rocksdb/internal/id.rs index 85f6323253..5d42efc845 100644 --- a/ledger/store/src/helpers/rocksdb/internal/id.rs +++ b/ledger/store/src/helpers/rocksdb/internal/id.rs @@ -78,7 +78,7 @@ pub enum BlockMap { Solutions = DataID::BlockSolutionsMap as u16, PuzzleCommitments = DataID::BlockPuzzleCommitmentsMap as u16, AbortedSolutionIDs = DataID::BlockAbortedSolutionIDsMap as u16, - AbortedPuzzleCommitments = DataID::BlockAbortedPuzzleCommitmentsMap as u16, + AbortedSolutionHeights = DataID::BlockAbortedSolutionHeightsMap as u16, Transactions = DataID::BlockTransactionsMap as u16, AbortedTransactionIDs = DataID::BlockAbortedTransactionIDsMap as u16, RejectedOrAbortedTransactionID = DataID::BlockRejectedOrAbortedTransactionIDMap as u16, @@ -231,7 +231,7 @@ enum DataID { BlockSolutionsMap, BlockPuzzleCommitmentsMap, BlockAbortedSolutionIDsMap, - BlockAbortedPuzzleCommitmentsMap, + BlockAbortedSolutionHeightsMap, BlockTransactionsMap, BlockAbortedTransactionIDsMap, BlockRejectedOrAbortedTransactionIDMap, diff --git a/synthesizer/src/vm/mod.rs b/synthesizer/src/vm/mod.rs index fde5866e4b..e084ab16a4 100644 --- a/synthesizer/src/vm/mod.rs +++ b/synthesizer/src/vm/mod.rs @@ -278,7 +278,7 @@ impl> VM { let ratifications = vec![Ratify::Genesis(committee, public_balances)]; // Prepare the solutions. let solutions = None; // The genesis block does not require solutions. - // Prepare teh aborted solution ids. + // Prepare the aborted solution IDs. let aborted_solution_ids = vec![]; // Prepare the transactions. let transactions = (0..Block::::NUM_GENESIS_TRANSACTIONS) From 01720b0fe9fa71240cbc14fd93bbcb5a8c36d3bf Mon Sep 17 00:00:00 2001 From: Howard Wu <9260812+howardwu@users.noreply.github.com> Date: Fri, 19 Jan 2024 22:41:30 -0800 Subject: [PATCH 176/298] Adds missing search for aborted solution ID --- ledger/src/check_next_block.rs | 6 +++--- ledger/src/contains.rs | 6 +++--- ledger/src/iterators.rs | 6 +++--- ledger/store/src/block/mod.rs | 37 +++++++++++++++++----------------- 4 files changed, 28 insertions(+), 27 deletions(-) diff --git a/ledger/src/check_next_block.rs b/ledger/src/check_next_block.rs index f46ee3ac69..bb5cd7c5e2 100644 --- a/ledger/src/check_next_block.rs +++ b/ledger/src/check_next_block.rs @@ -33,9 +33,9 @@ impl> Ledger { // Ensure the solutions do not already exist. if let Some(solutions) = block.solutions() { - for puzzle_commitment in solutions.puzzle_commitments() { - if self.contains_puzzle_commitment(puzzle_commitment)? { - bail!("Puzzle commitment {puzzle_commitment} already exists in the ledger"); + for solution_id in solutions.puzzle_commitments() { + if self.contains_puzzle_commitment(solution_id)? { + bail!("Solution ID {solution_id} already exists in the ledger"); } } } diff --git a/ledger/src/contains.rs b/ledger/src/contains.rs index 64a52bbda5..7b5500f434 100644 --- a/ledger/src/contains.rs +++ b/ledger/src/contains.rs @@ -44,14 +44,14 @@ impl> Ledger { pub fn contains_transmission(&self, transmission_id: &TransmissionID) -> Result { match transmission_id { TransmissionID::Ratification => Ok(false), - TransmissionID::Solution(puzzle_commitment) => self.contains_puzzle_commitment(puzzle_commitment), + TransmissionID::Solution(solution_id) => self.contains_puzzle_commitment(solution_id), TransmissionID::Transaction(transaction_id) => self.contains_transaction_id(transaction_id), } } /// Returns `true` if the given puzzle commitment exists. - pub fn contains_puzzle_commitment(&self, puzzle_commitment: &PuzzleCommitment) -> Result { - self.vm.block_store().contains_puzzle_commitment(puzzle_commitment) + pub fn contains_puzzle_commitment(&self, solution_id: &PuzzleCommitment) -> Result { + self.vm.block_store().contains_puzzle_commitment(solution_id) } /* Transaction */ diff --git a/ledger/src/iterators.rs b/ledger/src/iterators.rs index 976de7393a..1c6880e56c 100644 --- a/ledger/src/iterators.rs +++ b/ledger/src/iterators.rs @@ -20,9 +20,9 @@ impl> Ledger { self.vm.block_store().state_roots() } - /// Returns an iterator over the puzzle commitments, for all blocks in `self`. - pub fn puzzle_commitments(&self) -> impl '_ + Iterator>> { - self.vm.block_store().puzzle_commitments() + /// Returns an iterator over the solution IDs, for all blocks in `self`. + pub fn solution_ids(&self) -> impl '_ + Iterator>> { + self.vm.block_store().solution_ids() } /* Transaction */ diff --git a/ledger/store/src/block/mod.rs b/ledger/store/src/block/mod.rs index 9d093d855d..3627196bf6 100644 --- a/ledger/store/src/block/mod.rs +++ b/ledger/store/src/block/mod.rs @@ -681,10 +681,13 @@ pub trait BlockStorage: 'static + Clone + Send + Sync { } /// Returns the block height that contains the given `puzzle commitment`. - fn find_block_height_from_puzzle_commitment(&self, puzzle_commitment: &PuzzleCommitment) -> Result> { - match self.puzzle_commitments_map().get_confirmed(puzzle_commitment)? { + fn find_block_height_from_puzzle_commitment(&self, solution_id: &PuzzleCommitment) -> Result> { + match self.puzzle_commitments_map().get_confirmed(solution_id)? { Some(block_height) => Ok(Some(cow_to_copied!(block_height))), - None => Ok(None), + None => match self.aborted_solution_heights_map().get_confirmed(solution_id)? { + Some(block_height) => Ok(Some(cow_to_copied!(block_height))), + None => Ok(None), + }, } } @@ -876,10 +879,10 @@ pub trait BlockStorage: 'static + Clone + Send + Sync { } /// Returns the prover solution for the given solution ID. - fn get_solution(&self, puzzle_commitment: &PuzzleCommitment) -> Result> { - // Retrieve the block height for the puzzle commitment. - let Some(block_height) = self.find_block_height_from_puzzle_commitment(puzzle_commitment)? else { - bail!("The block height for puzzle commitment '{puzzle_commitment}' is missing in block storage") + fn get_solution(&self, solution_id: &PuzzleCommitment) -> Result> { + // Retrieve the block height for the solution ID. + let Some(block_height) = self.find_block_height_from_puzzle_commitment(solution_id)? else { + bail!("The block height for solution ID '{solution_id}' is missing in block storage") }; // Retrieve the block hash. let Some(block_hash) = self.get_block_hash(block_height)? else { @@ -892,13 +895,11 @@ pub trait BlockStorage: 'static + Clone + Send + Sync { // Retrieve the prover solution. match solutions { Cow::Owned(Some(ref solutions)) | Cow::Borrowed(Some(ref solutions)) => { - solutions.get(puzzle_commitment).cloned().ok_or_else(|| { - anyhow!( - "The prover solution for puzzle commitment '{puzzle_commitment}' is missing in block storage" - ) + solutions.get(solution_id).cloned().ok_or_else(|| { + anyhow!("The prover solution for solution ID '{solution_id}' is missing in block storage") }) } - _ => bail!("The prover solution for puzzle commitment '{puzzle_commitment}' is missing in block storage"), + _ => bail!("The prover solution for solution ID '{solution_id}' is missing in block storage"), } } @@ -1365,10 +1366,10 @@ impl> BlockStore { self.storage.certificate_map().contains_key_confirmed(certificate_id) } - /// Returns `true` if the given puzzle commitment exists. - pub fn contains_puzzle_commitment(&self, puzzle_commitment: &PuzzleCommitment) -> Result { - Ok(self.storage.puzzle_commitments_map().contains_key_confirmed(puzzle_commitment)? - || self.contains_aborted_puzzle_commitment(puzzle_commitment)?) + /// Returns `true` if the given solution ID exists. + pub fn contains_puzzle_commitment(&self, solution_id: &PuzzleCommitment) -> Result { + Ok(self.storage.puzzle_commitments_map().contains_key_confirmed(solution_id)? + || self.contains_aborted_puzzle_commitment(solution_id)?) } /// Returns `true` if the given aborted solution ID exists. @@ -1393,8 +1394,8 @@ impl> BlockStore { self.storage.reverse_id_map().keys_confirmed() } - /// Returns an iterator over the puzzle commitments, for all blocks in `self`. - pub fn puzzle_commitments(&self) -> impl '_ + Iterator>> { + /// Returns an iterator over the solution IDs, for all blocks in `self`. + pub fn solution_ids(&self) -> impl '_ + Iterator>> { self.storage.puzzle_commitments_map().keys_confirmed() } } From 59be76e549027ea7d313dc47e77f9772ebd8efcd Mon Sep 17 00:00:00 2001 From: Howard Wu <9260812+howardwu@users.noreply.github.com> Date: Fri, 19 Jan 2024 23:21:08 -0800 Subject: [PATCH 177/298] Adds an initial wrapper for Solutions --- ledger/block/src/lib.rs | 3 + ledger/block/src/solutions/bytes.rs | 84 ++++++++++++++++++ ledger/block/src/solutions/mod.rs | 43 +++++++++ ledger/block/src/solutions/serialize.rs | 110 ++++++++++++++++++++++++ ledger/block/src/solutions/string.rs | 57 ++++++++++++ 5 files changed, 297 insertions(+) create mode 100644 ledger/block/src/solutions/bytes.rs create mode 100644 ledger/block/src/solutions/mod.rs create mode 100644 ledger/block/src/solutions/serialize.rs create mode 100644 ledger/block/src/solutions/string.rs diff --git a/ledger/block/src/lib.rs b/ledger/block/src/lib.rs index 272dff10d4..bf633e8c82 100644 --- a/ledger/block/src/lib.rs +++ b/ledger/block/src/lib.rs @@ -29,6 +29,9 @@ pub use ratifications::*; pub mod ratify; pub use ratify::*; +pub mod solutions; +pub use solutions::*; + pub mod transaction; pub use transaction::*; diff --git a/ledger/block/src/solutions/bytes.rs b/ledger/block/src/solutions/bytes.rs new file mode 100644 index 0000000000..d68e29f9f0 --- /dev/null +++ b/ledger/block/src/solutions/bytes.rs @@ -0,0 +1,84 @@ +// Copyright (C) 2019-2023 Aleo Systems Inc. +// This file is part of the snarkVM library. + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at: +// http://www.apache.org/licenses/LICENSE-2.0 + +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +use super::*; + +impl FromBytes for Solutions { + /// Reads the solutions from the buffer. + fn read_le(mut reader: R) -> IoResult { + // Read the version. + let version: u8 = FromBytes::read_le(&mut reader)?; + // Ensure the version is valid. + if version != 1 { + return Err(error("Invalid solutions version")); + } + + // Read the variant. + let variant: u8 = FromBytes::read_le(&mut reader)?; + // Parse the variant. + match variant { + 0 => { + // Return the solutions. + Ok(Self { solutions: None }) + } + 1 => { + // Read the solutions. + let solutions: CoinbaseSolution = FromBytes::read_le(&mut reader)?; + // Return the solutions. + Self::new(solutions).map_err(error) + } + _ => Err(error("Invalid solutions variant")), + } + } +} + +impl ToBytes for Solutions { + /// Writes the solutions to the buffer. + fn write_le(&self, mut writer: W) -> IoResult<()> { + // Write the version. + 0u8.write_le(&mut writer)?; + + match &self.solutions { + None => { + // Write the variant. + 0u8.write_le(&mut writer)?; + } + Some(solutions) => { + // Write the variant. + 1u8.write_le(&mut writer)?; + // Write the solutions. + solutions.write_le(&mut writer)?; + } + } + Ok(()) + } +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn test_bytes() -> Result<()> { + let mut rng = TestRng::default(); + + // Sample random solutions. + let expected = crate::solutions::serialize::tests::sample_solutions(&mut rng); + + // Check the byte representation. + let expected_bytes = expected.to_bytes_le()?; + assert_eq!(expected, Solutions::read_le(&expected_bytes[..])?); + Ok(()) + } +} diff --git a/ledger/block/src/solutions/mod.rs b/ledger/block/src/solutions/mod.rs new file mode 100644 index 0000000000..186bf7cd5e --- /dev/null +++ b/ledger/block/src/solutions/mod.rs @@ -0,0 +1,43 @@ +// Copyright (C) 2019-2023 Aleo Systems Inc. +// This file is part of the snarkVM library. + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at: +// http://www.apache.org/licenses/LICENSE-2.0 + +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +mod bytes; +mod serialize; +mod string; + +use console::network::prelude::*; +use ledger_coinbase::CoinbaseSolution; +use ledger_committee::Committee; +use ledger_narwhal_batch_header::BatchHeader; + +#[derive(Clone, Eq, PartialEq)] +pub struct Solutions { + /// The prover solutions for the coinbase puzzle. + solutions: Option>, +} + +impl Solutions { + /// The maximum number of aborted solutions allowed in a block. + pub const MAX_ABORTED_SOLUTIONS: usize = BatchHeader::::MAX_TRANSMISSIONS_PER_BATCH + * BatchHeader::::MAX_GC_ROUNDS + * Committee::::MAX_COMMITTEE_SIZE as usize; +} + +impl Solutions { + /// Initializes a new instance of the solutions. + pub fn new(solutions: CoinbaseSolution) -> Result { + // Return the solutions. + Ok(Self { solutions: Some(solutions) }) + } +} diff --git a/ledger/block/src/solutions/serialize.rs b/ledger/block/src/solutions/serialize.rs new file mode 100644 index 0000000000..21ceceafc9 --- /dev/null +++ b/ledger/block/src/solutions/serialize.rs @@ -0,0 +1,110 @@ +// Copyright (C) 2019-2023 Aleo Systems Inc. +// This file is part of the snarkVM library. + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at: +// http://www.apache.org/licenses/LICENSE-2.0 + +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +use super::*; + +impl Serialize for Solutions { + /// Serializes the solutions to a JSON-string or buffer. + fn serialize(&self, serializer: S) -> Result { + match serializer.is_human_readable() { + true => { + let mut solutions = serializer.serialize_struct("Solutions", self.solutions.is_some() as usize)?; + if let Some(s) = &self.solutions { + solutions.serialize_field("solutions", s)?; + } + solutions.end() + } + false => ToBytesSerializer::serialize_with_size_encoding(self, serializer), + } + } +} + +impl<'de, N: Network> Deserialize<'de> for Solutions { + /// Deserializes the solutions from a JSON-string or buffer. + fn deserialize>(deserializer: D) -> Result { + match deserializer.is_human_readable() { + true => { + // Retrieve the solutions. + let mut solutions = serde_json::Value::deserialize(deserializer)?; + let solutions = solutions.get_mut("solutions").unwrap_or(&mut serde_json::Value::Null).take(); + serde_json::from_value(solutions).map_err(de::Error::custom) + } + false => FromBytesDeserializer::::deserialize_with_size_encoding(deserializer, "solutions"), + } + } +} + +#[cfg(test)] +pub(super) mod tests { + use super::*; + use console::account::{Address, PrivateKey}; + use ledger_coinbase::{PartialSolution, ProverSolution, PuzzleCommitment, PuzzleProof}; + + type CurrentNetwork = console::network::Testnet3; + + pub(crate) fn sample_solutions(rng: &mut TestRng) -> Solutions { + // Sample a new solutions. + let mut prover_solutions = vec![]; + for _ in 0..rng.gen_range(1..10) { + let private_key = PrivateKey::::new(rng).unwrap(); + let address = Address::try_from(private_key).unwrap(); + + let partial_solution = + PartialSolution::new(address, u64::rand(rng), PuzzleCommitment::from_g1_affine(rng.gen())); + prover_solutions.push(ProverSolution::new(partial_solution, PuzzleProof:: { + w: rng.gen(), + random_v: None, + })); + } + Solutions::new(CoinbaseSolution::new(prover_solutions).unwrap()).unwrap() + } + + #[test] + fn test_serde_json() -> Result<()> { + let rng = &mut TestRng::default(); + + // Sample a new solutions. + let expected = sample_solutions(rng); + + // Serialize + let expected_string = &expected.to_string(); + let candidate_string = serde_json::to_string(&expected)?; + assert_eq!(expected, serde_json::from_str(&candidate_string)?); + + // Deserialize + assert_eq!(expected, Solutions::from_str(expected_string)?); + assert_eq!(expected, serde_json::from_str(&candidate_string)?); + + Ok(()) + } + + #[test] + fn test_bincode() -> Result<()> { + let rng = &mut TestRng::default(); + + // Sample a new solutions. + let expected = sample_solutions(rng); + + // Serialize + let expected_bytes = expected.to_bytes_le()?; + let expected_bytes_with_size_encoding = bincode::serialize(&expected)?; + assert_eq!(&expected_bytes[..], &expected_bytes_with_size_encoding[8..]); + + // Deserialize + assert_eq!(expected, Solutions::read_le(&expected_bytes[..])?); + assert_eq!(expected, bincode::deserialize(&expected_bytes_with_size_encoding[..])?); + + Ok(()) + } +} diff --git a/ledger/block/src/solutions/string.rs b/ledger/block/src/solutions/string.rs new file mode 100644 index 0000000000..b4dfe9b954 --- /dev/null +++ b/ledger/block/src/solutions/string.rs @@ -0,0 +1,57 @@ +// Copyright (C) 2019-2023 Aleo Systems Inc. +// This file is part of the snarkVM library. + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at: +// http://www.apache.org/licenses/LICENSE-2.0 + +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +use super::*; + +impl FromStr for Solutions { + type Err = Error; + + /// Initializes the solutions from a JSON-string. + fn from_str(solutions: &str) -> Result { + Ok(serde_json::from_str(solutions)?) + } +} + +impl Debug for Solutions { + /// Prints the solutions as a JSON-string. + fn fmt(&self, f: &mut Formatter) -> fmt::Result { + Display::fmt(self, f) + } +} + +impl Display for Solutions { + /// Displays the solutions as a JSON-string. + fn fmt(&self, f: &mut Formatter) -> fmt::Result { + write!(f, "{}", serde_json::to_string(self).map_err::(ser::Error::custom)?) + } +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn test_string() -> Result<()> { + let mut rng = TestRng::default(); + + // Sample random solutions. + let expected = crate::solutions::serialize::tests::sample_solutions(&mut rng); + + // Check the string representation. + let candidate = format!("{expected}"); + assert_eq!(expected, Solutions::from_str(&candidate)?); + + Ok(()) + } +} From d36b95c1d20d3894a6ce0bb3e02dfeb4b9351ba1 Mon Sep 17 00:00:00 2001 From: Howard Wu <9260812+howardwu@users.noreply.github.com> Date: Fri, 19 Jan 2024 23:45:23 -0800 Subject: [PATCH 178/298] Update solutions serialization --- ledger/block/src/bytes.rs | 4 +--- ledger/block/src/lib.rs | 8 +++++++ ledger/block/src/solutions/bytes.rs | 6 ++--- ledger/block/src/solutions/serialize.rs | 32 +++++++++++++++++-------- ledger/block/src/verify.rs | 7 ++++-- synthesizer/src/vm/finalize.rs | 12 ++++++++++ synthesizer/src/vm/mod.rs | 1 + 7 files changed, 52 insertions(+), 18 deletions(-) diff --git a/ledger/block/src/bytes.rs b/ledger/block/src/bytes.rs index bf0b2bc493..544f104c7f 100644 --- a/ledger/block/src/bytes.rs +++ b/ledger/block/src/bytes.rs @@ -48,10 +48,8 @@ impl FromBytes for Block { // Read the number of aborted solution IDs. let num_aborted_solutions = u32::read_le(&mut reader)?; - // TODO (raychu86): Evaluate if this check is correct. It may be a valid case where there are more than - // N::MAX_SOLUTIONS number of aborted solutions. // Ensure the number of aborted solutions IDs is within bounds (this is an early safety check). - if num_aborted_solutions as usize > N::MAX_SOLUTIONS { + if num_aborted_solutions as usize > Solutions::::MAX_ABORTED_SOLUTIONS { return Err(error("Invalid number of aborted solutions IDs in the block")); } // Read the aborted solution IDs. diff --git a/ledger/block/src/lib.rs b/ledger/block/src/lib.rs index bf633e8c82..ad005d953c 100644 --- a/ledger/block/src/lib.rs +++ b/ledger/block/src/lib.rs @@ -151,6 +151,14 @@ impl Block { transactions: Transactions, aborted_transaction_ids: Vec, ) -> Result { + // Ensure the number of aborted solutions IDs is within the allowed range. + if aborted_solution_ids.len() > Solutions::::MAX_ABORTED_SOLUTIONS { + bail!( + "Cannot initialize a block with more than {} aborted solutions IDs", + Solutions::::MAX_ABORTED_SOLUTIONS + ); + } + // Ensure the block contains transactions. ensure!(!transactions.is_empty(), "Cannot create a block with zero transactions"); diff --git a/ledger/block/src/solutions/bytes.rs b/ledger/block/src/solutions/bytes.rs index d68e29f9f0..aa92c63114 100644 --- a/ledger/block/src/solutions/bytes.rs +++ b/ledger/block/src/solutions/bytes.rs @@ -21,7 +21,7 @@ impl FromBytes for Solutions { let version: u8 = FromBytes::read_le(&mut reader)?; // Ensure the version is valid. if version != 1 { - return Err(error("Invalid solutions version")); + return Err(error(format!("Invalid solutions version ({version})"))); } // Read the variant. @@ -38,7 +38,7 @@ impl FromBytes for Solutions { // Return the solutions. Self::new(solutions).map_err(error) } - _ => Err(error("Invalid solutions variant")), + _ => Err(error(format!("Invalid solutions variant ({variant})"))), } } } @@ -47,7 +47,7 @@ impl ToBytes for Solutions { /// Writes the solutions to the buffer. fn write_le(&self, mut writer: W) -> IoResult<()> { // Write the version. - 0u8.write_le(&mut writer)?; + 1u8.write_le(&mut writer)?; match &self.solutions { None => { diff --git a/ledger/block/src/solutions/serialize.rs b/ledger/block/src/solutions/serialize.rs index 21ceceafc9..a682e1f99d 100644 --- a/ledger/block/src/solutions/serialize.rs +++ b/ledger/block/src/solutions/serialize.rs @@ -19,7 +19,8 @@ impl Serialize for Solutions { fn serialize(&self, serializer: S) -> Result { match serializer.is_human_readable() { true => { - let mut solutions = serializer.serialize_struct("Solutions", self.solutions.is_some() as usize)?; + let mut solutions = serializer.serialize_struct("Solutions", 1 + self.solutions.is_some() as usize)?; + solutions.serialize_field("version", &1u8)?; if let Some(s) = &self.solutions { solutions.serialize_field("solutions", s)?; } @@ -35,10 +36,23 @@ impl<'de, N: Network> Deserialize<'de> for Solutions { fn deserialize>(deserializer: D) -> Result { match deserializer.is_human_readable() { true => { - // Retrieve the solutions. + // Deserialize the solutions into a JSON value. let mut solutions = serde_json::Value::deserialize(deserializer)?; - let solutions = solutions.get_mut("solutions").unwrap_or(&mut serde_json::Value::Null).take(); - serde_json::from_value(solutions).map_err(de::Error::custom) + + // Retrieve the version. + let version: u8 = DeserializeExt::take_from_value::(&mut solutions, "version")?; + // Ensure the version is valid. + if version != 1 { + return Err(de::Error::custom(format!("Invalid solutions version ({version})"))); + } + + // Retrieve the solutions, if it exists. + Ok(Self { + solutions: serde_json::from_value( + solutions.get_mut("solutions").unwrap_or(&mut serde_json::Value::Null).take(), + ) + .map_err(de::Error::custom)?, + }) } false => FromBytesDeserializer::::deserialize_with_size_encoding(deserializer, "solutions"), } @@ -60,12 +74,10 @@ pub(super) mod tests { let private_key = PrivateKey::::new(rng).unwrap(); let address = Address::try_from(private_key).unwrap(); - let partial_solution = - PartialSolution::new(address, u64::rand(rng), PuzzleCommitment::from_g1_affine(rng.gen())); - prover_solutions.push(ProverSolution::new(partial_solution, PuzzleProof:: { - w: rng.gen(), - random_v: None, - })); + let commitment = PuzzleCommitment::from_g1_affine(rng.gen()); + let partial_solution = PartialSolution::new(address, u64::rand(rng), commitment); + let proof = PuzzleProof:: { w: rng.gen(), random_v: None }; + prover_solutions.push(ProverSolution::new(partial_solution, proof)); } Solutions::new(CoinbaseSolution::new(prover_solutions).unwrap()).unwrap() } diff --git a/ledger/block/src/verify.rs b/ledger/block/src/verify.rs index bb30e18318..81374c79ba 100644 --- a/ledger/block/src/verify.rs +++ b/ledger/block/src/verify.rs @@ -263,8 +263,11 @@ impl Block { let timestamp = self.timestamp(); // Ensure the number of aborted solution IDs is within the allowed range. - if self.aborted_solution_ids.len() > N::MAX_SOLUTIONS { - bail!("Cannot validate a block with more than {} aborted solution IDs", N::MAX_SOLUTIONS); + if self.aborted_solution_ids.len() > Solutions::::MAX_ABORTED_SOLUTIONS { + bail!( + "Cannot validate a block with more than {} aborted solution IDs", + Solutions::::MAX_ABORTED_SOLUTIONS + ); } // Ensure there are no duplicate solution IDs. diff --git a/synthesizer/src/vm/finalize.rs b/synthesizer/src/vm/finalize.rs index e7a971e472..368f5a4b04 100644 --- a/synthesizer/src/vm/finalize.rs +++ b/synthesizer/src/vm/finalize.rs @@ -171,6 +171,18 @@ impl> VM { // Perform the finalize operation on the preset finalize mode. atomic_finalize!(self.finalize_store(), FinalizeMode::DryRun, { + // Ensure the number of solutions does not exceed the maximum. + if let Some(solutions) = solutions { + if solutions.len() > Solutions::::MAX_ABORTED_SOLUTIONS { + // Note: This will abort the entire atomic batch. + return Err(format!( + "Too many solutions in the block - {} (max: {})", + solutions.len(), + Solutions::::MAX_ABORTED_SOLUTIONS + )); + } + } + // Ensure the number of transactions does not exceed the maximum. if num_transactions > Transactions::::MAX_ABORTED_TRANSACTIONS { // Note: This will abort the entire atomic batch. diff --git a/synthesizer/src/vm/mod.rs b/synthesizer/src/vm/mod.rs index e084ab16a4..2cc1beaba0 100644 --- a/synthesizer/src/vm/mod.rs +++ b/synthesizer/src/vm/mod.rs @@ -38,6 +38,7 @@ use ledger_block::{ Ratifications, Ratify, Rejected, + Solutions, Transaction, Transactions, }; From 83bb938e8d7883869f6fed062835fcc121db19c0 Mon Sep 17 00:00:00 2001 From: Howard Wu <9260812+howardwu@users.noreply.github.com> Date: Sat, 20 Jan 2024 00:57:45 -0800 Subject: [PATCH 179/298] Update usage and abstraction of Solutions --- ledger/block/src/bytes.rs | 15 +----- ledger/block/src/genesis.rs | 2 +- ledger/block/src/lib.rs | 20 ++++---- ledger/block/src/serialize.rs | 11 +---- ledger/block/src/solutions/merkle.rs | 25 ++++++++++ ledger/block/src/solutions/mod.rs | 43 +++++++++++++++++- ledger/block/src/verify.rs | 33 +++++++------- ledger/src/advance.rs | 2 +- ledger/src/check_next_block.rs | 8 ++-- ledger/src/get.rs | 4 +- ledger/src/tests.rs | 2 +- ledger/store/src/block/mod.rs | 37 +++++++-------- ledger/store/src/helpers/memory/block.rs | 8 ++-- ledger/store/src/helpers/rocksdb/block.rs | 8 ++-- parameters/src/testnet3/genesis.rs | 2 +- .../src/testnet3/resources/block.genesis | Bin 13732 -> 13733 bytes synthesizer/src/vm/finalize.rs | 35 +++++++------- synthesizer/src/vm/mod.rs | 4 +- synthesizer/src/vm/verify.rs | 2 +- .../tests/test_vm_execute_and_finalize.rs | 14 +++--- 20 files changed, 158 insertions(+), 117 deletions(-) create mode 100644 ledger/block/src/solutions/merkle.rs diff --git a/ledger/block/src/bytes.rs b/ledger/block/src/bytes.rs index 544f104c7f..6a2ced7743 100644 --- a/ledger/block/src/bytes.rs +++ b/ledger/block/src/bytes.rs @@ -39,12 +39,7 @@ impl FromBytes for Block { let ratifications = Ratifications::read_le(&mut reader)?; // Read the solutions. - let solutions_variant = u8::read_le(&mut reader)?; - let solutions = match solutions_variant { - 0 => None, - 1 => Some(FromBytes::read_le(&mut reader)?), - _ => return Err(error("Invalid solutions variant in the block")), - }; + let solutions: Solutions = FromBytes::read_le(&mut reader)?; // Read the number of aborted solution IDs. let num_aborted_solutions = u32::read_le(&mut reader)?; @@ -115,13 +110,7 @@ impl ToBytes for Block { self.ratifications.write_le(&mut writer)?; // Write the solutions. - match self.solutions { - None => 0u8.write_le(&mut writer)?, - Some(ref solutions) => { - 1u8.write_le(&mut writer)?; - solutions.write_le(&mut writer)?; - } - } + self.solutions.write_le(&mut writer)?; // Write the aborted solution IDs. (u32::try_from(self.aborted_solution_ids.len()).map_err(error))?.write_le(&mut writer)?; diff --git a/ledger/block/src/genesis.rs b/ledger/block/src/genesis.rs index 061c8ec370..b14156fd43 100644 --- a/ledger/block/src/genesis.rs +++ b/ledger/block/src/genesis.rs @@ -29,7 +29,7 @@ impl Block { // Ensure there is the correct number of ratification operations in the genesis block. && self.ratifications.len() == 1 // Ensure there are no solutions in the genesis block. - && self.solutions.is_none() + && self.solutions.is_empty() // Ensure there is the correct number of accepted transaction in the genesis block. && self.transactions.num_accepted() == Self::NUM_GENESIS_TRANSACTIONS // Ensure there is the correct number of rejected transaction in the genesis block. diff --git a/ledger/block/src/lib.rs b/ledger/block/src/lib.rs index ad005d953c..74cab62d00 100644 --- a/ledger/block/src/lib.rs +++ b/ledger/block/src/lib.rs @@ -72,7 +72,7 @@ pub struct Block { /// The ratifications in this block. ratifications: Ratifications, /// The solutions in the block. - solutions: Option>, + solutions: Solutions, /// The aborted solution IDs in this block. aborted_solution_ids: Vec>, /// The transactions in this block. @@ -99,6 +99,8 @@ impl Block { let block_hash = N::hash_bhp1024(&to_bits_le![previous_hash, header.to_root()?])?; // Construct the beacon authority. let authority = Authority::new_beacon(private_key, block_hash, rng)?; + // Prepare the solutions. + let solutions = Solutions::::from(solutions); // Construct the block. Self::from( previous_hash, @@ -126,6 +128,8 @@ impl Block { ) -> Result { // Construct the beacon authority. let authority = Authority::new_quorum(subdag); + // Prepare the solutions. + let solutions = Solutions::::from(solutions); // Construct the block. Self::from( previous_hash, @@ -146,7 +150,7 @@ impl Block { header: Header, authority: Authority, ratifications: Ratifications, - solutions: Option>, + solutions: Solutions, aborted_solution_ids: Vec>, transactions: Transactions, aborted_transaction_ids: Vec, @@ -202,11 +206,7 @@ impl Block { } // Ensure that coinbase accumulator matches the solutions. - let solutions_root = match &solutions { - Some(coinbase_solution) => coinbase_solution.to_accumulator_point()?, - None => Field::::zero(), - }; - if header.solutions_root() != solutions_root { + if header.solutions_root() != solutions.to_solutions_root()? { bail!("The solutions root in the block does not correspond to the solutions"); } @@ -241,7 +241,7 @@ impl Block { header: Header, authority: Authority, ratifications: Ratifications, - solutions: Option>, + solutions: Solutions, aborted_solution_ids: Vec>, transactions: Transactions, aborted_transaction_ids: Vec, @@ -283,8 +283,8 @@ impl Block { } /// Returns the solutions in the block. - pub const fn solutions(&self) -> Option<&CoinbaseSolution> { - self.solutions.as_ref() + pub const fn solutions(&self) -> &Solutions { + &self.solutions } /// Returns the aborted solution IDs in this block. diff --git a/ledger/block/src/serialize.rs b/ledger/block/src/serialize.rs index 653afade40..fa5ebbdc85 100644 --- a/ledger/block/src/serialize.rs +++ b/ledger/block/src/serialize.rs @@ -25,12 +25,8 @@ impl Serialize for Block { block.serialize_field("header", &self.header)?; block.serialize_field("authority", &self.authority)?; block.serialize_field("ratifications", &self.ratifications)?; - - if let Some(solutions) = &self.solutions { - block.serialize_field("solutions", solutions)?; - } + block.serialize_field("solutions", &self.solutions)?; block.serialize_field("aborted_solution_ids", &self.aborted_solution_ids)?; - block.serialize_field("transactions", &self.transactions)?; block.serialize_field("aborted_transaction_ids", &self.aborted_transaction_ids)?; block.end() @@ -48,16 +44,13 @@ impl<'de, N: Network> Deserialize<'de> for Block { let mut block = serde_json::Value::deserialize(deserializer)?; let block_hash: N::BlockHash = DeserializeExt::take_from_value::(&mut block, "block_hash")?; - // Retrieve the solutions. - let solutions = block.get_mut("solutions").unwrap_or(&mut serde_json::Value::Null).take(); - // Recover the block. let block = Self::from( DeserializeExt::take_from_value::(&mut block, "previous_hash")?, DeserializeExt::take_from_value::(&mut block, "header")?, DeserializeExt::take_from_value::(&mut block, "authority")?, DeserializeExt::take_from_value::(&mut block, "ratifications")?, - serde_json::from_value(solutions).map_err(de::Error::custom)?, + DeserializeExt::take_from_value::(&mut block, "solutions")?, DeserializeExt::take_from_value::(&mut block, "aborted_solution_ids")?, DeserializeExt::take_from_value::(&mut block, "transactions")?, DeserializeExt::take_from_value::(&mut block, "aborted_transaction_ids")?, diff --git a/ledger/block/src/solutions/merkle.rs b/ledger/block/src/solutions/merkle.rs new file mode 100644 index 0000000000..7b655dd759 --- /dev/null +++ b/ledger/block/src/solutions/merkle.rs @@ -0,0 +1,25 @@ +// Copyright (C) 2019-2023 Aleo Systems Inc. +// This file is part of the snarkVM library. + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at: +// http://www.apache.org/licenses/LICENSE-2.0 + +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +use super::*; + +impl Solutions { + /// Returns the solutions root. + pub fn to_solutions_root(&self) -> Result> { + match &self.solutions { + Some(solutions) => solutions.to_accumulator_point(), + None => Ok(Field::::zero()), + } + } +} diff --git a/ledger/block/src/solutions/mod.rs b/ledger/block/src/solutions/mod.rs index 186bf7cd5e..87778fdc25 100644 --- a/ledger/block/src/solutions/mod.rs +++ b/ledger/block/src/solutions/mod.rs @@ -13,11 +13,12 @@ // limitations under the License. mod bytes; +mod merkle; mod serialize; mod string; -use console::network::prelude::*; -use ledger_coinbase::CoinbaseSolution; +use console::{network::prelude::*, types::Field}; +use ledger_coinbase::{CoinbaseSolution, PuzzleCommitment}; use ledger_committee::Committee; use ledger_narwhal_batch_header::BatchHeader; @@ -34,10 +35,48 @@ impl Solutions { * Committee::::MAX_COMMITTEE_SIZE as usize; } +impl From>> for Solutions { + /// Initializes a new instance of the solutions. + fn from(solutions: Option>) -> Self { + // Return the solutions. + Self { solutions } + } +} + impl Solutions { /// Initializes a new instance of the solutions. pub fn new(solutions: CoinbaseSolution) -> Result { // Return the solutions. Ok(Self { solutions: Some(solutions) }) } + + /// Returns `true` if the solutions are empty. + pub fn is_empty(&self) -> bool { + self.solutions.is_none() + } + + /// Returns the number of solutions. + pub fn len(&self) -> usize { + match &self.solutions { + Some(solutions) => solutions.len(), + None => 0, + } + } + + /// Returns an iterator over the solution IDs. + pub fn solution_ids<'a>(&'a self) -> Box> + 'a> { + match &self.solutions { + Some(solutions) => Box::new(solutions.keys()), + None => Box::new(std::iter::empty::<&PuzzleCommitment>()), + } + } +} + +impl Deref for Solutions { + type Target = Option>; + + /// Returns the solutions. + fn deref(&self) -> &Self::Target { + &self.solutions + } } diff --git a/ledger/block/src/verify.rs b/ledger/block/src/verify.rs index 81374c79ba..b76825d40d 100644 --- a/ledger/block/src/verify.rs +++ b/ledger/block/src/verify.rs @@ -282,22 +282,24 @@ impl Block { bail!("Found a duplicate solution in block {height}"); } - let (combined_proof_target, expected_cumulative_proof_target, is_coinbase_target_reached) = match &self + // Ensure the number of solutions is within the allowed range. + ensure!( + self.solutions.len() <= N::MAX_SOLUTIONS, + "Block {height} contains too many prover solutions (found '{}', expected '{}')", + self.solutions.len(), + N::MAX_SOLUTIONS + ); + + // Ensure the solutions are not accepted after the block height at year 10. + if !self.solutions.is_empty() && height > block_height_at_year(N::BLOCK_TIME, 10) { + bail!("Solutions are no longer accepted after the block height at year 10."); + } + + let (combined_proof_target, expected_cumulative_proof_target, is_coinbase_target_reached) = match self .solutions + .deref() { Some(coinbase) => { - // Ensure the number of solutions is within the allowed range. - ensure!( - coinbase.len() <= N::MAX_SOLUTIONS, - "Block {height} contains too many prover solutions (found '{}', expected '{}')", - coinbase.len(), - N::MAX_SOLUTIONS - ); - // Ensure the solutions are not accepted after the block height at year 10. - if height > block_height_at_year(N::BLOCK_TIME, 10) { - bail!("Solutions are no longer accepted after the block height at year 10."); - } - // Ensure the puzzle proof is valid. if let Err(e) = current_puzzle.check_solutions(coinbase, current_epoch_challenge, previous_block.proof_target()) @@ -509,10 +511,7 @@ impl Block { /// Computes the solutions root for the block. fn compute_solutions_root(&self) -> Result> { - match self.solutions { - Some(ref coinbase) => coinbase.to_accumulator_point(), - None => Ok(Field::zero()), - } + self.solutions.to_solutions_root() } /// Computes the subdag root for the block. diff --git a/ledger/src/advance.rs b/ledger/src/advance.rs index 5f59c6f116..3b9693ff7d 100644 --- a/ledger/src/advance.rs +++ b/ledger/src/advance.rs @@ -294,7 +294,7 @@ impl> Ledger { state, Some(coinbase_reward), candidate_ratifications, - solutions.as_ref(), + &solutions, candidate_transactions.iter(), )?; diff --git a/ledger/src/check_next_block.rs b/ledger/src/check_next_block.rs index bb5cd7c5e2..40cfe6b863 100644 --- a/ledger/src/check_next_block.rs +++ b/ledger/src/check_next_block.rs @@ -32,11 +32,9 @@ impl> Ledger { } // Ensure the solutions do not already exist. - if let Some(solutions) = block.solutions() { - for solution_id in solutions.puzzle_commitments() { - if self.contains_puzzle_commitment(solution_id)? { - bail!("Solution ID {solution_id} already exists in the ledger"); - } + for solution_id in block.solutions().solution_ids() { + if self.contains_puzzle_commitment(solution_id)? { + bail!("Solution ID {solution_id} already exists in the ledger"); } } diff --git a/ledger/src/get.rs b/ledger/src/get.rs index 9058f89d4b..059627826c 100644 --- a/ledger/src/get.rs +++ b/ledger/src/get.rs @@ -200,10 +200,10 @@ impl> Ledger { } /// Returns the block solutions for the given block height. - pub fn get_solutions(&self, height: u32) -> Result>> { + pub fn get_solutions(&self, height: u32) -> Result> { // If the height is 0, return the genesis block solutions. if height == 0 { - return Ok(self.genesis_block.solutions().cloned()); + return Ok(self.genesis_block.solutions().clone()); } // Retrieve the block hash. let block_hash = match self.vm.block_store().get_block_hash(height)? { diff --git a/ledger/src/tests.rs b/ledger/src/tests.rs index cc50e18cd7..5283d5b6dd 100644 --- a/ledger/src/tests.rs +++ b/ledger/src/tests.rs @@ -681,7 +681,7 @@ fn test_aborted_solution_ids() { ledger.advance_to_next_block(&block).unwrap(); // Enforce that the block solution was aborted properly. - assert!(block.solutions().is_none()); + assert!(block.solutions().is_empty()); assert_eq!(block.aborted_solution_ids(), &vec![invalid_solution.commitment()]); } diff --git a/ledger/store/src/block/mod.rs b/ledger/store/src/block/mod.rs index 3627196bf6..b1f2335b94 100644 --- a/ledger/store/src/block/mod.rs +++ b/ledger/store/src/block/mod.rs @@ -35,10 +35,11 @@ use ledger_block::{ NumFinalizeSize, Ratifications, Rejected, + Solutions, Transaction, Transactions, }; -use ledger_coinbase::{CoinbaseSolution, ProverSolution, PuzzleCommitment}; +use ledger_coinbase::{ProverSolution, PuzzleCommitment}; use ledger_narwhal_batch_certificate::BatchCertificate; use synthesizer_program::Program; @@ -186,7 +187,7 @@ pub trait BlockStorage: 'static + Clone + Send + Sync { /// The mapping of `block hash` to `block ratifications`. type RatificationsMap: for<'a> Map<'a, N::BlockHash, Ratifications>; /// The mapping of `block hash` to `block solutions`. - type SolutionsMap: for<'a> Map<'a, N::BlockHash, Option>>; + type SolutionsMap: for<'a> Map<'a, N::BlockHash, Solutions>; /// The mapping of `puzzle commitment` to `block height`. type PuzzleCommitmentsMap: for<'a> Map<'a, PuzzleCommitment, u32>; /// The mapping of `block hash` to `[aborted solution ID]`. @@ -465,13 +466,11 @@ pub trait BlockStorage: 'static + Clone + Send + Sync { self.ratifications_map().insert(block.hash(), block.ratifications().clone())?; // Store the block solutions. - self.solutions_map().insert(block.hash(), block.solutions().cloned())?; + self.solutions_map().insert(block.hash(), block.solutions().clone())?; - // Store the block puzzle commitments. - if let Some(solutions) = block.solutions() { - for puzzle_commitment in solutions.keys() { - self.puzzle_commitments_map().insert(*puzzle_commitment, block.height())?; - } + // Store the block solution IDs. + for solution_id in block.solutions().solution_ids() { + self.puzzle_commitments_map().insert(*solution_id, block.height())?; } // Store the aborted solution IDs. @@ -597,11 +596,9 @@ pub trait BlockStorage: 'static + Clone + Send + Sync { // Remove the block solutions. self.solutions_map().remove(block_hash)?; - // Remove the block puzzle commitments. - if let Some(solutions) = solutions { - for puzzle_commitment in solutions.keys() { - self.puzzle_commitments_map().remove(puzzle_commitment)?; - } + // Remove the block solution IDs. + for solution_id in solutions.solution_ids() { + self.puzzle_commitments_map().remove(solution_id)?; } // Remove the aborted solution IDs. @@ -871,7 +868,7 @@ pub trait BlockStorage: 'static + Clone + Send + Sync { } /// Returns the block solutions for the given `block hash`. - fn get_block_solutions(&self, block_hash: &N::BlockHash) -> Result>> { + fn get_block_solutions(&self, block_hash: &N::BlockHash) -> Result> { match self.solutions_map().get_confirmed(block_hash)? { Some(solutions) => Ok(cow_to_cloned!(solutions)), None => bail!("Missing solutions for block ('{block_hash}')"), @@ -893,12 +890,10 @@ pub trait BlockStorage: 'static + Clone + Send + Sync { bail!("The solutions for block '{block_height}' are missing in block storage") }; // Retrieve the prover solution. - match solutions { - Cow::Owned(Some(ref solutions)) | Cow::Borrowed(Some(ref solutions)) => { - solutions.get(solution_id).cloned().ok_or_else(|| { - anyhow!("The prover solution for solution ID '{solution_id}' is missing in block storage") - }) - } + match solutions.deref().deref() { + Some(ref solutions) => solutions.get(solution_id).cloned().ok_or_else(|| { + anyhow!("The prover solution for solution ID '{solution_id}' is missing in block storage") + }), _ => bail!("The prover solution for solution ID '{solution_id}' is missing in block storage"), } } @@ -1274,7 +1269,7 @@ impl> BlockStore { } /// Returns the block solutions for the given `block hash`. - pub fn get_block_solutions(&self, block_hash: &N::BlockHash) -> Result>> { + pub fn get_block_solutions(&self, block_hash: &N::BlockHash) -> Result> { self.storage.get_block_solutions(block_hash) } diff --git a/ledger/store/src/helpers/memory/block.rs b/ledger/store/src/helpers/memory/block.rs index 029d225852..5a1b8af70f 100644 --- a/ledger/store/src/helpers/memory/block.rs +++ b/ledger/store/src/helpers/memory/block.rs @@ -21,8 +21,8 @@ use crate::{ }; use console::{prelude::*, types::Field}; use ledger_authority::Authority; -use ledger_block::{Header, Ratifications, Rejected}; -use ledger_coinbase::{CoinbaseSolution, PuzzleCommitment}; +use ledger_block::{Header, Ratifications, Rejected, Solutions}; +use ledger_coinbase::PuzzleCommitment; /// An in-memory block storage. #[derive(Clone)] @@ -44,7 +44,7 @@ pub struct BlockMemory { /// The ratifications map. ratifications_map: MemoryMap>, /// The solutions map. - solutions_map: MemoryMap>>, + solutions_map: MemoryMap>, /// The puzzle commitments map. puzzle_commitments_map: MemoryMap, u32>, /// The aborted solution IDs map. @@ -75,7 +75,7 @@ impl BlockStorage for BlockMemory { type AuthorityMap = MemoryMap>; type CertificateMap = MemoryMap, (u32, u64)>; type RatificationsMap = MemoryMap>; - type SolutionsMap = MemoryMap>>; + type SolutionsMap = MemoryMap>; type PuzzleCommitmentsMap = MemoryMap, u32>; type AbortedSolutionIDsMap = MemoryMap>>; type AbortedSolutionHeightsMap = MemoryMap, u32>; diff --git a/ledger/store/src/helpers/rocksdb/block.rs b/ledger/store/src/helpers/rocksdb/block.rs index 1870172335..838fc09c1f 100644 --- a/ledger/store/src/helpers/rocksdb/block.rs +++ b/ledger/store/src/helpers/rocksdb/block.rs @@ -27,8 +27,8 @@ use crate::{ }; use console::{prelude::*, types::Field}; use ledger_authority::Authority; -use ledger_block::{Header, Ratifications, Rejected}; -use ledger_coinbase::{CoinbaseSolution, PuzzleCommitment}; +use ledger_block::{Header, Ratifications, Rejected, Solutions}; +use ledger_coinbase::PuzzleCommitment; /// A RocksDB block storage. #[derive(Clone)] @@ -50,7 +50,7 @@ pub struct BlockDB { /// The ratifications map. ratifications_map: DataMap>, /// The solutions map. - solutions_map: DataMap>>, + solutions_map: DataMap>, /// The puzzle commitments map. puzzle_commitments_map: DataMap, u32>, /// The aborted solution IDs map. @@ -81,7 +81,7 @@ impl BlockStorage for BlockDB { type AuthorityMap = DataMap>; type CertificateMap = DataMap, (u32, u64)>; type RatificationsMap = DataMap>; - type SolutionsMap = DataMap>>; + type SolutionsMap = DataMap>; type PuzzleCommitmentsMap = DataMap, u32>; type AbortedSolutionIDsMap = DataMap>>; type AbortedSolutionHeightsMap = DataMap, u32>; diff --git a/parameters/src/testnet3/genesis.rs b/parameters/src/testnet3/genesis.rs index 9c62cb2f4e..4e7c77511f 100644 --- a/parameters/src/testnet3/genesis.rs +++ b/parameters/src/testnet3/genesis.rs @@ -27,6 +27,6 @@ mod tests { #[test] fn test_genesis_block() { let bytes = GenesisBytes::load_bytes(); - assert_eq!(13732, bytes.len() as u64, "Update me if serialization has changed"); + assert_eq!(13733, bytes.len() as u64, "Update me if serialization has changed"); } } diff --git a/parameters/src/testnet3/resources/block.genesis b/parameters/src/testnet3/resources/block.genesis index 2ed6e562dfce58299d598ce3f6baa90ab1f3d43f..921aa57cd58622d35cc06f1a904aad1eb400d818 100644 GIT binary patch delta 11038 zcmZwNRZtw?zOdmL+#Q0uySqCixCD21cbFM0xCD2H;4Z;k10h&&4elD8FaPYb_jh*H zSr=V>)m5u6-hS%0y4b$No&xBsS%>+KdzO??Pml$g<`eT&rHYb0aBo(Fq+?lq={;&9 zg#THPN z^b?N)vOU$KJXNkqUO+t2vo~P7yfe={<;k%ikFbyXJ#Hq}7169$PY`>C8{01u>k630 zOkh4x3kdjU0b%~R{JjGr*Y|bZ9;_E6tck}(e3pWQDe&oE^|O92O8L3qwpIxM0)bn@ zLKeyv$z(6l9~xg>5vHN--47@|5B%3rO^@o(@6eLeNEtv-Fh&)3SxOr+B@r;0_y|9` zwhJG_zF;60+6UR+E}ref0-*qLFbiPV(1x&TD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FaVH>1Dt4fvS{ReB2K(3z*`g8 z$%yjNVl}TVV8O*VQtCr7PYe>GXj9_)7Z+6(%RRnVNkD6u%jmSs(?@vkEMzMLR%p0W znFmY2IF}g@4ddIh-zQRmoRzjmyTZCU!CVXvRixuWavHJ6&v6$t&vJy>c+Z-_abY{L zWaX}(^GI@^3sEB|T=g@o=N$*G!67y@PT7JF!vGl#;78Hkl45^DSsPGsSW?mIXI!5S zpE`s{dQ*?y&lJG&5~>Jcv>d)~KkT6#9vVn@xWjvZgXdiY?|i z!?rLQo3T1`DBT;*KP$Fa4i(@+TRDW+c}In+*Z+Ly@0?i2u!8DvM0`@F;P`IhU(+~;C^ z!@@W9^V4iJDSW~*Mr4_M$&U!LtxB+=e8SBl{{~e6@O>RVoj~NFGJiRR4|iW?#(FRB z7ffpPROwkUMCk?ge4x<+{HNK}dt779;3#|O>KAgR^_Yeir?uXf5?Fl^+rtNSNp)S& W!G+l{rE9}4U}6@bVj>=Q^#22%)>?1? diff --git a/synthesizer/src/vm/finalize.rs b/synthesizer/src/vm/finalize.rs index 368f5a4b04..46554e1d96 100644 --- a/synthesizer/src/vm/finalize.rs +++ b/synthesizer/src/vm/finalize.rs @@ -31,7 +31,7 @@ impl> VM { state: FinalizeGlobalState, coinbase_reward: Option, candidate_ratifications: Vec>, - candidate_solutions: Option<&CoinbaseSolution>, + candidate_solutions: &Option>, candidate_transactions: impl ExactSizeIterator>, ) -> Result<(Ratifications, Transactions, Vec, Vec>)> { let timer = timer!("VM::speculate"); @@ -72,7 +72,7 @@ impl> VM { &self, state: FinalizeGlobalState, ratifications: &Ratifications, - solutions: Option<&CoinbaseSolution>, + solutions: &Option>, transactions: &Transactions, ) -> Result>> { let timer = timer!("VM::check_speculate"); @@ -114,7 +114,7 @@ impl> VM { &self, state: FinalizeGlobalState, ratifications: &Ratifications, - solutions: Option<&CoinbaseSolution>, + solutions: &Option>, transactions: &Transactions, ) -> Result>> { let timer = timer!("VM::finalize"); @@ -151,7 +151,7 @@ impl> VM { state: FinalizeGlobalState, coinbase_reward: Option, ratifications: Vec>, - solutions: Option<&CoinbaseSolution>, + solutions: &Option>, transactions: impl ExactSizeIterator>, ) -> Result<( Ratifications, @@ -479,7 +479,7 @@ impl> VM { &self, state: FinalizeGlobalState, ratifications: &Ratifications, - solutions: Option<&CoinbaseSolution>, + solutions: &Option>, transactions: &Transactions, ) -> Result>> { // Acquire the atomic lock, which is needed to ensure this function is not called concurrently @@ -817,7 +817,7 @@ impl> VM { store: &FinalizeStore, state: FinalizeGlobalState, post_ratifications: impl Iterator>, - solutions: Option<&CoinbaseSolution>, + solutions: &Option>, ) -> Result>> { // Construct the program ID. let program_id = ProgramID::from_str("credits.aleo")?; @@ -1020,7 +1020,7 @@ finalize transfer_public: ) -> Result> { // Speculate on the candidate ratifications, solutions, and transactions. let (ratifications, transactions, aborted_transaction_ids, ratified_finalize_operations) = - vm.speculate(sample_finalize_state(1), None, vec![], None, transactions.iter())?; + vm.speculate(sample_finalize_state(1), None, vec![], &None, transactions.iter())?; // Construct the metadata associated with the block. let metadata = Metadata::new( @@ -1205,7 +1205,7 @@ finalize transfer_public: // Prepare the confirmed transactions. let (ratifications, confirmed_transactions, aborted_transaction_ids, _) = vm - .speculate(sample_finalize_state(1), None, vec![], None, [deployment_transaction.clone()].iter()) + .speculate(sample_finalize_state(1), None, vec![], &None, [deployment_transaction.clone()].iter()) .unwrap(); assert_eq!(confirmed_transactions.len(), 1); assert!(aborted_transaction_ids.is_empty()); @@ -1214,20 +1214,21 @@ finalize transfer_public: assert!(!vm.contains_program(&program_id)); // Finalize the transaction. - assert!(vm.finalize(sample_finalize_state(1), &ratifications, None, &confirmed_transactions).is_ok()); + assert!(vm.finalize(sample_finalize_state(1), &ratifications, &None, &confirmed_transactions).is_ok()); // Ensure the VM contains this program. assert!(vm.contains_program(&program_id)); // Ensure the VM can't redeploy the same transaction. - assert!(vm.finalize(sample_finalize_state(1), &ratifications, None, &confirmed_transactions).is_err()); + assert!(vm.finalize(sample_finalize_state(1), &ratifications, &None, &confirmed_transactions).is_err()); // Ensure the VM contains this program. assert!(vm.contains_program(&program_id)); // Ensure the dry run of the redeployment will cause a reject transaction to be created. - let (_, candidate_transactions, aborted_transaction_ids, _) = - vm.atomic_speculate(sample_finalize_state(1), None, vec![], None, [deployment_transaction].iter()).unwrap(); + let (_, candidate_transactions, aborted_transaction_ids, _) = vm + .atomic_speculate(sample_finalize_state(1), None, vec![], &None, [deployment_transaction].iter()) + .unwrap(); assert_eq!(candidate_transactions.len(), 1); assert!(matches!(candidate_transactions[0], ConfirmedTransaction::RejectedDeploy(..))); assert!(aborted_transaction_ids.is_empty()); @@ -1329,7 +1330,7 @@ finalize transfer_public: { let transactions = [mint_10.clone(), transfer_10.clone(), transfer_20.clone()]; let (_, confirmed_transactions, aborted_transaction_ids, _) = - vm.atomic_speculate(sample_finalize_state(1), None, vec![], None, transactions.iter()).unwrap(); + vm.atomic_speculate(sample_finalize_state(1), None, vec![], &None, transactions.iter()).unwrap(); // Assert that all the transactions are accepted. assert_eq!(confirmed_transactions.len(), 3); @@ -1349,7 +1350,7 @@ finalize transfer_public: { let transactions = [transfer_20.clone(), mint_10.clone(), mint_20.clone(), transfer_30.clone()]; let (_, confirmed_transactions, aborted_transaction_ids, _) = - vm.atomic_speculate(sample_finalize_state(1), None, vec![], None, transactions.iter()).unwrap(); + vm.atomic_speculate(sample_finalize_state(1), None, vec![], &None, transactions.iter()).unwrap(); // Assert that all the transactions are accepted. assert_eq!(confirmed_transactions.len(), 4); @@ -1369,7 +1370,7 @@ finalize transfer_public: { let transactions = [transfer_20.clone(), transfer_10.clone()]; let (_, confirmed_transactions, aborted_transaction_ids, _) = - vm.atomic_speculate(sample_finalize_state(1), None, vec![], None, transactions.iter()).unwrap(); + vm.atomic_speculate(sample_finalize_state(1), None, vec![], &None, transactions.iter()).unwrap(); // Assert that the accepted and rejected transactions are correct. assert_eq!(confirmed_transactions.len(), 2); @@ -1393,7 +1394,7 @@ finalize transfer_public: { let transactions = [mint_20.clone(), transfer_30.clone(), transfer_20.clone(), transfer_10.clone()]; let (_, confirmed_transactions, aborted_transaction_ids, _) = - vm.atomic_speculate(sample_finalize_state(1), None, vec![], None, transactions.iter()).unwrap(); + vm.atomic_speculate(sample_finalize_state(1), None, vec![], &None, transactions.iter()).unwrap(); // Assert that the accepted and rejected transactions are correct. assert_eq!(confirmed_transactions.len(), 4); @@ -1492,7 +1493,7 @@ function ped_hash: // Speculatively execute the transaction. Ensure that this call does not panic and returns a rejected transaction. let (_, confirmed_transactions, aborted_transaction_ids, _) = - vm.speculate(sample_finalize_state(1), None, vec![], None, [transaction.clone()].iter()).unwrap(); + vm.speculate(sample_finalize_state(1), None, vec![], &None, [transaction.clone()].iter()).unwrap(); assert!(aborted_transaction_ids.is_empty()); // Ensure that the transaction is rejected. diff --git a/synthesizer/src/vm/mod.rs b/synthesizer/src/vm/mod.rs index 2cc1beaba0..63e4a700fd 100644 --- a/synthesizer/src/vm/mod.rs +++ b/synthesizer/src/vm/mod.rs @@ -290,7 +290,7 @@ impl> VM { let state = FinalizeGlobalState::new_genesis::()?; // Speculate on the ratifications, solutions, and transactions. let (ratifications, transactions, aborted_transaction_ids, ratified_finalize_operations) = - self.speculate(state, None, ratifications, solutions.as_ref(), transactions.iter())?; + self.speculate(state, None, ratifications, &solutions, transactions.iter())?; ensure!( aborted_transaction_ids.is_empty(), "Failed to initialize a genesis block - found aborted transaction IDs" @@ -653,7 +653,7 @@ function compute: // Construct the new block header. let (ratifications, transactions, aborted_transaction_ids, ratified_finalize_operations) = - vm.speculate(sample_finalize_state(1), None, vec![], None, transactions.iter())?; + vm.speculate(sample_finalize_state(1), None, vec![], &None, transactions.iter())?; assert!(aborted_transaction_ids.is_empty()); // Construct the metadata associated with the block. diff --git a/synthesizer/src/vm/verify.rs b/synthesizer/src/vm/verify.rs index 457b3de75b..c40b3ab6cc 100644 --- a/synthesizer/src/vm/verify.rs +++ b/synthesizer/src/vm/verify.rs @@ -471,7 +471,7 @@ mod tests { // Construct the new block header. let (ratifications, transactions, aborted_transaction_ids, ratified_finalize_operations) = - vm.speculate(sample_finalize_state(1), Some(0u64), vec![], None, [deployment_transaction].iter()).unwrap(); + vm.speculate(sample_finalize_state(1), Some(0u64), vec![], &None, [deployment_transaction].iter()).unwrap(); assert!(aborted_transaction_ids.is_empty()); // Construct the metadata associated with the block. diff --git a/synthesizer/tests/test_vm_execute_and_finalize.rs b/synthesizer/tests/test_vm_execute_and_finalize.rs index e0fb039eed..3ace559bd3 100644 --- a/synthesizer/tests/test_vm_execute_and_finalize.rs +++ b/synthesizer/tests/test_vm_execute_and_finalize.rs @@ -90,8 +90,9 @@ fn run_test(test: &ProgramTest) -> serde_yaml::Mapping { rng, ) .unwrap(); - let (ratifications, transactions, aborted_transaction_ids, ratified_finalize_operations) = - vm.speculate(construct_finalize_global_state(&vm), Some(0u64), vec![], None, [transaction].iter()).unwrap(); + let (ratifications, transactions, aborted_transaction_ids, ratified_finalize_operations) = vm + .speculate(construct_finalize_global_state(&vm), Some(0u64), vec![], &None, [transaction].iter()) + .unwrap(); assert!(aborted_transaction_ids.is_empty()); let block = construct_next_block( @@ -126,8 +127,9 @@ fn run_test(test: &ProgramTest) -> serde_yaml::Mapping { } }; - let (ratifications, transactions, aborted_transaction_ids, ratified_finalize_operations) = - vm.speculate(construct_finalize_global_state(&vm), Some(0u64), vec![], None, [transaction].iter()).unwrap(); + let (ratifications, transactions, aborted_transaction_ids, ratified_finalize_operations) = vm + .speculate(construct_finalize_global_state(&vm), Some(0u64), vec![], &None, [transaction].iter()) + .unwrap(); assert!(aborted_transaction_ids.is_empty()); let block = construct_next_block( @@ -265,7 +267,7 @@ fn run_test(test: &ProgramTest) -> serde_yaml::Mapping { // Speculate on the ratifications, solutions, and transaction. let (ratifications, transactions, aborted_transaction_ids, ratified_finalize_operations) = match vm - .speculate(construct_finalize_global_state(&vm), Some(0u64), vec![], None, [transaction].iter()) + .speculate(construct_finalize_global_state(&vm), Some(0u64), vec![], &None, [transaction].iter()) { Ok((ratifications, transactions, aborted_transaction_ids, ratified_finalize_operations)) => { result.insert( @@ -401,7 +403,7 @@ fn construct_fee_records, R: Rng + CryptoRng } let (ratifications, transactions, aborted_transaction_ids, ratified_finalize_operations) = - vm.speculate(construct_finalize_global_state(vm), Some(0u64), vec![], None, transactions.iter()).unwrap(); + vm.speculate(construct_finalize_global_state(vm), Some(0u64), vec![], &None, transactions.iter()).unwrap(); assert!(aborted_transaction_ids.is_empty()); // Create a block for the fee transactions and add them to the VM. From a3290712987d71d50be9740be420918a9da9ccc7 Mon Sep 17 00:00:00 2001 From: Howard Wu <9260812+howardwu@users.noreply.github.com> Date: Sat, 20 Jan 2024 11:10:42 -0800 Subject: [PATCH 180/298] Add abstraction to call combined proof target --- ledger/block/src/solutions/mod.rs | 12 ++++++++++++ ledger/block/src/verify.rs | 17 ++++++----------- ledger/src/advance.rs | 1 - 3 files changed, 18 insertions(+), 12 deletions(-) diff --git a/ledger/block/src/solutions/mod.rs b/ledger/block/src/solutions/mod.rs index 87778fdc25..7cdbd1d8a8 100644 --- a/ledger/block/src/solutions/mod.rs +++ b/ledger/block/src/solutions/mod.rs @@ -62,7 +62,9 @@ impl Solutions { None => 0, } } +} +impl Solutions { /// Returns an iterator over the solution IDs. pub fn solution_ids<'a>(&'a self) -> Box> + 'a> { match &self.solutions { @@ -72,6 +74,16 @@ impl Solutions { } } +impl Solutions { + /// Returns the combined sum of the prover solutions. + pub fn to_combined_proof_target(&self) -> Result { + match &self.solutions { + Some(solutions) => solutions.to_combined_proof_target(), + None => Ok(0), + } + } +} + impl Deref for Solutions { type Target = Option>; diff --git a/ledger/block/src/verify.rs b/ledger/block/src/verify.rs index b76825d40d..bc02032f23 100644 --- a/ledger/block/src/verify.rs +++ b/ledger/block/src/verify.rs @@ -295,10 +295,10 @@ impl Block { bail!("Solutions are no longer accepted after the block height at year 10."); } - let (combined_proof_target, expected_cumulative_proof_target, is_coinbase_target_reached) = match self - .solutions - .deref() - { + // Compute the combined proof target. + let combined_proof_target = self.solutions.to_combined_proof_target()?; + + let (expected_cumulative_proof_target, is_coinbase_target_reached) = match self.solutions.deref() { Some(coinbase) => { // Ensure the puzzle proof is valid. if let Err(e) = @@ -307,9 +307,6 @@ impl Block { bail!("Block {height} contains an invalid puzzle proof - {e}"); } - // Compute the combined proof target. - let combined_proof_target = coinbase.to_combined_proof_target()?; - // Ensure that the block cumulative proof target is less than the previous block's coinbase target. // Note: This is a sanity check, as the cumulative proof target resets to 0 if the // coinbase target was reached in this block. @@ -330,15 +327,13 @@ impl Block { false => cumulative_proof_target, }; - (combined_proof_target, expected_cumulative_proof_target, is_coinbase_target_reached) + (expected_cumulative_proof_target, is_coinbase_target_reached) } None => { - // Set the combined proof target. - let combined_proof_target = 0; // Determine the cumulative proof target. let expected_cumulative_proof_target = previous_block.cumulative_proof_target(); - (combined_proof_target, expected_cumulative_proof_target, false) + (expected_cumulative_proof_target, false) } }; diff --git a/ledger/src/advance.rs b/ledger/src/advance.rs index 3b9693ff7d..7417e7fd62 100644 --- a/ledger/src/advance.rs +++ b/ledger/src/advance.rs @@ -217,7 +217,6 @@ impl> Ledger { } }; - // TODO (raychu86): Add bound checks for the number of aborted solution ids. This may need to be done in a higher level call. // Construct the aborted solution IDs. let aborted_solution_ids = aborted_solutions.into_iter().map(|solution| solution.commitment()).collect::>(); From e7aeba30ef55f4c70668c4fcc2d420e10d9d4bd0 Mon Sep 17 00:00:00 2001 From: Howard Wu <9260812+howardwu@users.noreply.github.com> Date: Sat, 20 Jan 2024 11:20:08 -0800 Subject: [PATCH 181/298] Fix the number of serialized elements in the block --- ledger/block/src/serialize.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ledger/block/src/serialize.rs b/ledger/block/src/serialize.rs index fa5ebbdc85..595a218a78 100644 --- a/ledger/block/src/serialize.rs +++ b/ledger/block/src/serialize.rs @@ -19,7 +19,7 @@ impl Serialize for Block { fn serialize(&self, serializer: S) -> Result { match serializer.is_human_readable() { true => { - let mut block = serializer.serialize_struct("Block", 8 + self.solutions.is_some() as usize)?; + let mut block = serializer.serialize_struct("Block", 9)?; block.serialize_field("block_hash", &self.block_hash)?; block.serialize_field("previous_hash", &self.previous_hash)?; block.serialize_field("header", &self.header)?; From d5325de83b68f11dadaf5d115cc4e02f9359f53e Mon Sep 17 00:00:00 2001 From: Howard Wu <9260812+howardwu@users.noreply.github.com> Date: Sat, 20 Jan 2024 11:25:47 -0800 Subject: [PATCH 182/298] nit on length checks for solution ids --- ledger/block/src/verify.rs | 41 +++++++++++++++++++------------------- 1 file changed, 20 insertions(+), 21 deletions(-) diff --git a/ledger/block/src/verify.rs b/ledger/block/src/verify.rs index bc02032f23..915dd37f7f 100644 --- a/ledger/block/src/verify.rs +++ b/ledger/block/src/verify.rs @@ -262,24 +262,9 @@ impl Block { let height = self.height(); let timestamp = self.timestamp(); - // Ensure the number of aborted solution IDs is within the allowed range. - if self.aborted_solution_ids.len() > Solutions::::MAX_ABORTED_SOLUTIONS { - bail!( - "Cannot validate a block with more than {} aborted solution IDs", - Solutions::::MAX_ABORTED_SOLUTIONS - ); - } - - // Ensure there are no duplicate solution IDs. - if has_duplicates( - self.solutions - .as_ref() - .map(|solution| solution.puzzle_commitments()) - .into_iter() - .flatten() - .chain(self.aborted_solution_ids().iter()), - ) { - bail!("Found a duplicate solution in block {height}"); + // Ensure the solutions are not accepted after the block height at year 10. + if !self.solutions.is_empty() && height > block_height_at_year(N::BLOCK_TIME, 10) { + bail!("Solutions are no longer accepted after the block height at year 10."); } // Ensure the number of solutions is within the allowed range. @@ -289,10 +274,24 @@ impl Block { self.solutions.len(), N::MAX_SOLUTIONS ); + // Ensure the number of aborted solution IDs is within the allowed range. + ensure!( + self.aborted_solution_ids.len() <= Solutions::::MAX_ABORTED_SOLUTIONS, + "Block {height} contains too many aborted solution IDs (found '{}', expected '{}')", + self.aborted_solution_ids.len(), + Solutions::::MAX_ABORTED_SOLUTIONS + ); - // Ensure the solutions are not accepted after the block height at year 10. - if !self.solutions.is_empty() && height > block_height_at_year(N::BLOCK_TIME, 10) { - bail!("Solutions are no longer accepted after the block height at year 10."); + // Ensure there are no duplicate solution IDs. + if has_duplicates( + self.solutions + .as_ref() + .map(CoinbaseSolution::puzzle_commitments) + .into_iter() + .flatten() + .chain(self.aborted_solution_ids()), + ) { + bail!("Found a duplicate solution in block {height}"); } // Compute the combined proof target. From 8b85200ac59b2b26af543ff1c6eb0e5cfba6a843 Mon Sep 17 00:00:00 2001 From: Howard Wu <9260812+howardwu@users.noreply.github.com> Date: Sat, 20 Jan 2024 11:33:18 -0800 Subject: [PATCH 183/298] Switch to HashSet for faster check --- ledger/block/src/verify.rs | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/ledger/block/src/verify.rs b/ledger/block/src/verify.rs index 915dd37f7f..4d14946dda 100644 --- a/ledger/block/src/verify.rs +++ b/ledger/block/src/verify.rs @@ -532,13 +532,13 @@ impl Block { .collect::>>()?; let mut unconfirmed_transaction_ids = unconfirmed_transaction_ids.iter().peekable(); - // Initialize a list of already seen transmission IDs. + // Initialize a set of already seen transmission IDs. let mut seen_transmission_ids = HashSet::new(); - // Initialize a list of aborted or already-existing solution IDs. - let mut aborted_or_existing_solution_ids = Vec::new(); - // Initialize a list of aborted or already-existing transaction IDs. - let mut aborted_or_existing_transaction_ids = Vec::new(); + // Initialize a set of aborted or already-existing solution IDs. + let mut aborted_or_existing_solution_ids = HashSet::new(); + // Initialize a set of aborted or already-existing transaction IDs. + let mut aborted_or_existing_transaction_ids = HashSet::new(); // Iterate over the transmission IDs. for transmission_id in subdag.transmission_ids() { @@ -550,15 +550,19 @@ impl Block { // Process the transmission ID. match transmission_id { TransmissionID::Ratification => {} - TransmissionID::Solution(commitment) => { + TransmissionID::Solution(solution_id) => { match solutions.peek() { - // Check the next solution matches the expected commitment. - Some((_, solution)) if solution.commitment() == *commitment => { + // Check the next solution matches the expected solution ID. + Some((_, solution)) if solution.commitment() == *solution_id => { // Increment the solution iterator. solutions.next(); } // Otherwise, add the solution ID to the aborted or existing list. - _ => aborted_or_existing_solution_ids.push(commitment), + _ => { + if !aborted_or_existing_solution_ids.insert(solution_id) { + bail!("Block contains a duplicate aborted solution ID (found '{solution_id}')"); + } + } } } TransmissionID::Transaction(transaction_id) => { @@ -569,7 +573,11 @@ impl Block { unconfirmed_transaction_ids.next(); } // Otherwise, add the transaction ID to the aborted or existing list. - _ => aborted_or_existing_transaction_ids.push(*transaction_id), + _ => { + if !aborted_or_existing_transaction_ids.insert(*transaction_id) { + bail!("Block contains a duplicate aborted transaction ID (found '{transaction_id}')"); + } + } } } } From 81ec825e50ad7ecc2ad14037e442d43b6079d990 Mon Sep 17 00:00:00 2001 From: Howard Wu <9260812+howardwu@users.noreply.github.com> Date: Sat, 20 Jan 2024 11:53:43 -0800 Subject: [PATCH 184/298] Use Solutions abstraction throughout --- ledger/block/src/lib.rs | 10 +--- ledger/src/advance.rs | 4 +- ledger/test-helpers/src/lib.rs | 15 ++++- synthesizer/src/vm/finalize.rs | 55 +++++++++---------- synthesizer/src/vm/mod.rs | 6 +- synthesizer/src/vm/verify.rs | 7 ++- .../tests/test_vm_execute_and_finalize.rs | 13 +++-- 7 files changed, 59 insertions(+), 51 deletions(-) diff --git a/ledger/block/src/lib.rs b/ledger/block/src/lib.rs index 74cab62d00..d6467eb37f 100644 --- a/ledger/block/src/lib.rs +++ b/ledger/block/src/lib.rs @@ -89,7 +89,7 @@ impl Block { previous_hash: N::BlockHash, header: Header, ratifications: Ratifications, - solutions: Option>, + solutions: Solutions, aborted_solution_ids: Vec>, transactions: Transactions, aborted_transaction_ids: Vec, @@ -99,8 +99,6 @@ impl Block { let block_hash = N::hash_bhp1024(&to_bits_le![previous_hash, header.to_root()?])?; // Construct the beacon authority. let authority = Authority::new_beacon(private_key, block_hash, rng)?; - // Prepare the solutions. - let solutions = Solutions::::from(solutions); // Construct the block. Self::from( previous_hash, @@ -121,15 +119,13 @@ impl Block { header: Header, subdag: Subdag, ratifications: Ratifications, - solutions: Option>, + solutions: Solutions, aborted_solution_ids: Vec>, transactions: Transactions, aborted_transaction_ids: Vec, ) -> Result { // Construct the beacon authority. let authority = Authority::new_quorum(subdag); - // Prepare the solutions. - let solutions = Solutions::::from(solutions); // Construct the block. Self::from( previous_hash, @@ -700,7 +696,7 @@ pub mod test_helpers { previous_hash, header, ratifications, - None, + None.into(), vec![], transactions, vec![], diff --git a/ledger/src/advance.rs b/ledger/src/advance.rs index 7417e7fd62..ba8de721ff 100644 --- a/ledger/src/advance.rs +++ b/ledger/src/advance.rs @@ -178,7 +178,7 @@ impl> Ledger { ) -> Result<( Header, Ratifications, - Option>, + Solutions, Vec>, Transactions, Vec, @@ -216,6 +216,8 @@ impl> Ledger { } } }; + // Prepare the solutions. + let solutions = Solutions::from(solutions); // Construct the aborted solution IDs. let aborted_solution_ids = diff --git a/ledger/test-helpers/src/lib.rs b/ledger/test-helpers/src/lib.rs index 25f6a01775..f7fa4e5226 100644 --- a/ledger/test-helpers/src/lib.rs +++ b/ledger/test-helpers/src/lib.rs @@ -424,9 +424,18 @@ fn sample_genesis_block_and_components_raw( let previous_hash = ::BlockHash::default(); // Construct the block. - let block = - Block::new_beacon(&private_key, previous_hash, header, ratifications, None, vec![], transactions, vec![], rng) - .unwrap(); + let block = Block::new_beacon( + &private_key, + previous_hash, + header, + ratifications, + None.into(), + vec![], + transactions, + vec![], + rng, + ) + .unwrap(); assert!(block.header().is_genesis(), "Failed to initialize a genesis block"); // Return the block, transaction, and private key. (block, transaction, private_key) diff --git a/synthesizer/src/vm/finalize.rs b/synthesizer/src/vm/finalize.rs index 46554e1d96..c1c4b12bd3 100644 --- a/synthesizer/src/vm/finalize.rs +++ b/synthesizer/src/vm/finalize.rs @@ -31,7 +31,7 @@ impl> VM { state: FinalizeGlobalState, coinbase_reward: Option, candidate_ratifications: Vec>, - candidate_solutions: &Option>, + candidate_solutions: &Solutions, candidate_transactions: impl ExactSizeIterator>, ) -> Result<(Ratifications, Transactions, Vec, Vec>)> { let timer = timer!("VM::speculate"); @@ -72,7 +72,7 @@ impl> VM { &self, state: FinalizeGlobalState, ratifications: &Ratifications, - solutions: &Option>, + solutions: &Solutions, transactions: &Transactions, ) -> Result>> { let timer = timer!("VM::check_speculate"); @@ -114,7 +114,7 @@ impl> VM { &self, state: FinalizeGlobalState, ratifications: &Ratifications, - solutions: &Option>, + solutions: &Solutions, transactions: &Transactions, ) -> Result>> { let timer = timer!("VM::finalize"); @@ -151,7 +151,7 @@ impl> VM { state: FinalizeGlobalState, coinbase_reward: Option, ratifications: Vec>, - solutions: &Option>, + solutions: &Solutions, transactions: impl ExactSizeIterator>, ) -> Result<( Ratifications, @@ -172,15 +172,13 @@ impl> VM { // Perform the finalize operation on the preset finalize mode. atomic_finalize!(self.finalize_store(), FinalizeMode::DryRun, { // Ensure the number of solutions does not exceed the maximum. - if let Some(solutions) = solutions { - if solutions.len() > Solutions::::MAX_ABORTED_SOLUTIONS { - // Note: This will abort the entire atomic batch. - return Err(format!( - "Too many solutions in the block - {} (max: {})", - solutions.len(), - Solutions::::MAX_ABORTED_SOLUTIONS - )); - } + if solutions.len() > Solutions::::MAX_ABORTED_SOLUTIONS { + // Note: This will abort the entire atomic batch. + return Err(format!( + "Too many solutions in the block - {} (max: {})", + solutions.len(), + Solutions::::MAX_ABORTED_SOLUTIONS + )); } // Ensure the number of transactions does not exceed the maximum. @@ -479,7 +477,7 @@ impl> VM { &self, state: FinalizeGlobalState, ratifications: &Ratifications, - solutions: &Option>, + solutions: &Solutions, transactions: &Transactions, ) -> Result>> { // Acquire the atomic lock, which is needed to ensure this function is not called concurrently @@ -817,7 +815,7 @@ impl> VM { store: &FinalizeStore, state: FinalizeGlobalState, post_ratifications: impl Iterator>, - solutions: &Option>, + solutions: &Solutions, ) -> Result>> { // Construct the program ID. let program_id = ProgramID::from_str("credits.aleo")?; @@ -886,7 +884,7 @@ impl> VM { continue; } // Retrieve the solutions. - let Some(solutions) = solutions else { + let Some(solutions) = solutions.deref() else { continue; }; // Compute the proof targets, with the corresponding addresses. @@ -1020,7 +1018,7 @@ finalize transfer_public: ) -> Result> { // Speculate on the candidate ratifications, solutions, and transactions. let (ratifications, transactions, aborted_transaction_ids, ratified_finalize_operations) = - vm.speculate(sample_finalize_state(1), None, vec![], &None, transactions.iter())?; + vm.speculate(sample_finalize_state(1), None, vec![], &None.into(), transactions.iter())?; // Construct the metadata associated with the block. let metadata = Metadata::new( @@ -1052,7 +1050,7 @@ finalize transfer_public: previous_block.hash(), header, ratifications, - None, + None.into(), vec![], transactions, aborted_transaction_ids, @@ -1205,7 +1203,7 @@ finalize transfer_public: // Prepare the confirmed transactions. let (ratifications, confirmed_transactions, aborted_transaction_ids, _) = vm - .speculate(sample_finalize_state(1), None, vec![], &None, [deployment_transaction.clone()].iter()) + .speculate(sample_finalize_state(1), None, vec![], &None.into(), [deployment_transaction.clone()].iter()) .unwrap(); assert_eq!(confirmed_transactions.len(), 1); assert!(aborted_transaction_ids.is_empty()); @@ -1214,20 +1212,20 @@ finalize transfer_public: assert!(!vm.contains_program(&program_id)); // Finalize the transaction. - assert!(vm.finalize(sample_finalize_state(1), &ratifications, &None, &confirmed_transactions).is_ok()); + assert!(vm.finalize(sample_finalize_state(1), &ratifications, &None.into(), &confirmed_transactions).is_ok()); // Ensure the VM contains this program. assert!(vm.contains_program(&program_id)); // Ensure the VM can't redeploy the same transaction. - assert!(vm.finalize(sample_finalize_state(1), &ratifications, &None, &confirmed_transactions).is_err()); + assert!(vm.finalize(sample_finalize_state(1), &ratifications, &None.into(), &confirmed_transactions).is_err()); // Ensure the VM contains this program. assert!(vm.contains_program(&program_id)); // Ensure the dry run of the redeployment will cause a reject transaction to be created. let (_, candidate_transactions, aborted_transaction_ids, _) = vm - .atomic_speculate(sample_finalize_state(1), None, vec![], &None, [deployment_transaction].iter()) + .atomic_speculate(sample_finalize_state(1), None, vec![], &None.into(), [deployment_transaction].iter()) .unwrap(); assert_eq!(candidate_transactions.len(), 1); assert!(matches!(candidate_transactions[0], ConfirmedTransaction::RejectedDeploy(..))); @@ -1330,7 +1328,7 @@ finalize transfer_public: { let transactions = [mint_10.clone(), transfer_10.clone(), transfer_20.clone()]; let (_, confirmed_transactions, aborted_transaction_ids, _) = - vm.atomic_speculate(sample_finalize_state(1), None, vec![], &None, transactions.iter()).unwrap(); + vm.atomic_speculate(sample_finalize_state(1), None, vec![], &None.into(), transactions.iter()).unwrap(); // Assert that all the transactions are accepted. assert_eq!(confirmed_transactions.len(), 3); @@ -1350,7 +1348,7 @@ finalize transfer_public: { let transactions = [transfer_20.clone(), mint_10.clone(), mint_20.clone(), transfer_30.clone()]; let (_, confirmed_transactions, aborted_transaction_ids, _) = - vm.atomic_speculate(sample_finalize_state(1), None, vec![], &None, transactions.iter()).unwrap(); + vm.atomic_speculate(sample_finalize_state(1), None, vec![], &None.into(), transactions.iter()).unwrap(); // Assert that all the transactions are accepted. assert_eq!(confirmed_transactions.len(), 4); @@ -1370,7 +1368,7 @@ finalize transfer_public: { let transactions = [transfer_20.clone(), transfer_10.clone()]; let (_, confirmed_transactions, aborted_transaction_ids, _) = - vm.atomic_speculate(sample_finalize_state(1), None, vec![], &None, transactions.iter()).unwrap(); + vm.atomic_speculate(sample_finalize_state(1), None, vec![], &None.into(), transactions.iter()).unwrap(); // Assert that the accepted and rejected transactions are correct. assert_eq!(confirmed_transactions.len(), 2); @@ -1394,7 +1392,7 @@ finalize transfer_public: { let transactions = [mint_20.clone(), transfer_30.clone(), transfer_20.clone(), transfer_10.clone()]; let (_, confirmed_transactions, aborted_transaction_ids, _) = - vm.atomic_speculate(sample_finalize_state(1), None, vec![], &None, transactions.iter()).unwrap(); + vm.atomic_speculate(sample_finalize_state(1), None, vec![], &None.into(), transactions.iter()).unwrap(); // Assert that the accepted and rejected transactions are correct. assert_eq!(confirmed_transactions.len(), 4); @@ -1492,8 +1490,9 @@ function ped_hash: create_execution(&vm, caller_private_key, program_id, "ped_hash", inputs, &mut unspent_records, rng); // Speculatively execute the transaction. Ensure that this call does not panic and returns a rejected transaction. - let (_, confirmed_transactions, aborted_transaction_ids, _) = - vm.speculate(sample_finalize_state(1), None, vec![], &None, [transaction.clone()].iter()).unwrap(); + let (_, confirmed_transactions, aborted_transaction_ids, _) = vm + .speculate(sample_finalize_state(1), None, vec![], &None.into(), [transaction.clone()].iter()) + .unwrap(); assert!(aborted_transaction_ids.is_empty()); // Ensure that the transaction is rejected. diff --git a/synthesizer/src/vm/mod.rs b/synthesizer/src/vm/mod.rs index 63e4a700fd..1f18981c48 100644 --- a/synthesizer/src/vm/mod.rs +++ b/synthesizer/src/vm/mod.rs @@ -278,7 +278,7 @@ impl> VM { // Prepare the ratifications. let ratifications = vec![Ratify::Genesis(committee, public_balances)]; // Prepare the solutions. - let solutions = None; // The genesis block does not require solutions. + let solutions = Solutions::::from(None); // The genesis block does not require solutions. // Prepare the aborted solution IDs. let aborted_solution_ids = vec![]; // Prepare the transactions. @@ -653,7 +653,7 @@ function compute: // Construct the new block header. let (ratifications, transactions, aborted_transaction_ids, ratified_finalize_operations) = - vm.speculate(sample_finalize_state(1), None, vec![], &None, transactions.iter())?; + vm.speculate(sample_finalize_state(1), None, vec![], &None.into(), transactions.iter())?; assert!(aborted_transaction_ids.is_empty()); // Construct the metadata associated with the block. @@ -686,7 +686,7 @@ function compute: previous_block.hash(), header, ratifications, - None, + None.into(), vec![], transactions, aborted_transaction_ids, diff --git a/synthesizer/src/vm/verify.rs b/synthesizer/src/vm/verify.rs index c40b3ab6cc..e1a7c05330 100644 --- a/synthesizer/src/vm/verify.rs +++ b/synthesizer/src/vm/verify.rs @@ -470,8 +470,9 @@ mod tests { let deployment_transaction = vm.deploy(&caller_private_key, &program, Some(credits), 10, None, rng).unwrap(); // Construct the new block header. - let (ratifications, transactions, aborted_transaction_ids, ratified_finalize_operations) = - vm.speculate(sample_finalize_state(1), Some(0u64), vec![], &None, [deployment_transaction].iter()).unwrap(); + let (ratifications, transactions, aborted_transaction_ids, ratified_finalize_operations) = vm + .speculate(sample_finalize_state(1), Some(0u64), vec![], &None.into(), [deployment_transaction].iter()) + .unwrap(); assert!(aborted_transaction_ids.is_empty()); // Construct the metadata associated with the block. @@ -506,7 +507,7 @@ mod tests { genesis.hash(), deployment_header, ratifications, - None, + None.into(), vec![], transactions, aborted_transaction_ids, diff --git a/synthesizer/tests/test_vm_execute_and_finalize.rs b/synthesizer/tests/test_vm_execute_and_finalize.rs index 3ace559bd3..d887ba43f4 100644 --- a/synthesizer/tests/test_vm_execute_and_finalize.rs +++ b/synthesizer/tests/test_vm_execute_and_finalize.rs @@ -91,7 +91,7 @@ fn run_test(test: &ProgramTest) -> serde_yaml::Mapping { ) .unwrap(); let (ratifications, transactions, aborted_transaction_ids, ratified_finalize_operations) = vm - .speculate(construct_finalize_global_state(&vm), Some(0u64), vec![], &None, [transaction].iter()) + .speculate(construct_finalize_global_state(&vm), Some(0u64), vec![], &None.into(), [transaction].iter()) .unwrap(); assert!(aborted_transaction_ids.is_empty()); @@ -128,7 +128,7 @@ fn run_test(test: &ProgramTest) -> serde_yaml::Mapping { }; let (ratifications, transactions, aborted_transaction_ids, ratified_finalize_operations) = vm - .speculate(construct_finalize_global_state(&vm), Some(0u64), vec![], &None, [transaction].iter()) + .speculate(construct_finalize_global_state(&vm), Some(0u64), vec![], &None.into(), [transaction].iter()) .unwrap(); assert!(aborted_transaction_ids.is_empty()); @@ -267,7 +267,7 @@ fn run_test(test: &ProgramTest) -> serde_yaml::Mapping { // Speculate on the ratifications, solutions, and transaction. let (ratifications, transactions, aborted_transaction_ids, ratified_finalize_operations) = match vm - .speculate(construct_finalize_global_state(&vm), Some(0u64), vec![], &None, [transaction].iter()) + .speculate(construct_finalize_global_state(&vm), Some(0u64), vec![], &None.into(), [transaction].iter()) { Ok((ratifications, transactions, aborted_transaction_ids, ratified_finalize_operations)) => { result.insert( @@ -402,8 +402,9 @@ fn construct_fee_records, R: Rng + CryptoRng } } - let (ratifications, transactions, aborted_transaction_ids, ratified_finalize_operations) = - vm.speculate(construct_finalize_global_state(vm), Some(0u64), vec![], &None, transactions.iter()).unwrap(); + let (ratifications, transactions, aborted_transaction_ids, ratified_finalize_operations) = vm + .speculate(construct_finalize_global_state(vm), Some(0u64), vec![], &None.into(), transactions.iter()) + .unwrap(); assert!(aborted_transaction_ids.is_empty()); // Create a block for the fee transactions and add them to the VM. @@ -470,7 +471,7 @@ fn construct_next_block, R: Rng + CryptoRng> previous_block.hash(), header, ratifications, - None, + None.into(), vec![], transactions, aborted_transaction_ids, From b41e156148838d04e514c56481c511ace6e5843a Mon Sep 17 00:00:00 2001 From: Howard Wu <9260812+howardwu@users.noreply.github.com> Date: Sat, 20 Jan 2024 11:58:31 -0800 Subject: [PATCH 185/298] Remove ledger_coinbase from synthesizer --- Cargo.lock | 1 - synthesizer/Cargo.toml | 7 ------- synthesizer/src/vm/finalize.rs | 7 ++++--- synthesizer/src/vm/mod.rs | 1 - 4 files changed, 4 insertions(+), 12 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 0c5240f89b..af5055976e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3409,7 +3409,6 @@ dependencies = [ "snarkvm-circuit", "snarkvm-console", "snarkvm-ledger-block", - "snarkvm-ledger-coinbase", "snarkvm-ledger-committee", "snarkvm-ledger-query", "snarkvm-ledger-store", diff --git a/synthesizer/Cargo.toml b/synthesizer/Cargo.toml index b020f197ef..275d2ae2ab 100644 --- a/synthesizer/Cargo.toml +++ b/synthesizer/Cargo.toml @@ -34,7 +34,6 @@ cuda = [ "algorithms/cuda" ] serial = [ "console/serial", "ledger-block/serial", - "ledger-coinbase/serial", "ledger-committee/serial", "ledger-query/serial", "ledger-store/serial", @@ -52,7 +51,6 @@ wasm = [ "snark", "console/wasm", "ledger-block/wasm", - "ledger-coinbase/wasm", "ledger-committee/wasm", "ledger-query/wasm", "ledger-store/wasm", @@ -86,11 +84,6 @@ package = "snarkvm-ledger-block" path = "../ledger/block" version = "=0.16.16" -[dependencies.ledger-coinbase] -package = "snarkvm-ledger-coinbase" -path = "../ledger/coinbase" -version = "=0.16.16" - [dependencies.ledger-committee] package = "snarkvm-ledger-committee" path = "../ledger/committee" diff --git a/synthesizer/src/vm/finalize.rs b/synthesizer/src/vm/finalize.rs index c1c4b12bd3..cc69d100a0 100644 --- a/synthesizer/src/vm/finalize.rs +++ b/synthesizer/src/vm/finalize.rs @@ -166,17 +166,18 @@ impl> VM { let timer = timer!("VM::atomic_speculate"); + // Retrieve the number of solutions. + let num_solutions = solutions.len(); // Retrieve the number of transactions. let num_transactions = transactions.len(); // Perform the finalize operation on the preset finalize mode. atomic_finalize!(self.finalize_store(), FinalizeMode::DryRun, { // Ensure the number of solutions does not exceed the maximum. - if solutions.len() > Solutions::::MAX_ABORTED_SOLUTIONS { + if num_solutions > Solutions::::MAX_ABORTED_SOLUTIONS { // Note: This will abort the entire atomic batch. return Err(format!( - "Too many solutions in the block - {} (max: {})", - solutions.len(), + "Too many solutions in the block - {num_solutions} (max: {})", Solutions::::MAX_ABORTED_SOLUTIONS )); } diff --git a/synthesizer/src/vm/mod.rs b/synthesizer/src/vm/mod.rs index 1f18981c48..227ecf5f17 100644 --- a/synthesizer/src/vm/mod.rs +++ b/synthesizer/src/vm/mod.rs @@ -42,7 +42,6 @@ use ledger_block::{ Transaction, Transactions, }; -use ledger_coinbase::CoinbaseSolution; use ledger_committee::Committee; use ledger_query::Query; use ledger_store::{ From 4a473c5d3fb0a4a441dafecb851bb84be944faa5 Mon Sep 17 00:00:00 2001 From: raychu86 <14917648+raychu86@users.noreply.github.com> Date: Sat, 20 Jan 2024 11:59:09 -0800 Subject: [PATCH 186/298] Abort transactions that attempt to create a duplicate transition_id --- synthesizer/src/vm/finalize.rs | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/synthesizer/src/vm/finalize.rs b/synthesizer/src/vm/finalize.rs index 700a95dbec..212b1a4fb6 100644 --- a/synthesizer/src/vm/finalize.rs +++ b/synthesizer/src/vm/finalize.rs @@ -223,8 +223,10 @@ impl> VM { let mut counter = 0u32; // Initialize a list of spent input IDs. let mut input_ids: IndexSet> = IndexSet::new(); - // Initialize a list of spent output IDs. + // Initialize a list of created output IDs. let mut output_ids: IndexSet> = IndexSet::new(); + // Initialize a list of created transition IDs. + let mut transition_ids: IndexSet = IndexSet::new(); // Finalize the transactions. 'outer: for transaction in transactions { @@ -252,7 +254,7 @@ impl> VM { // Ensure that the transaction is not producing a duplicate output. for output_id in transaction.output_ids() { - // If the output ID is already spent in this block or previous blocks, abort the transaction. + // If the output ID is already produced in this block or previous blocks, abort the transaction. if output_ids.contains(output_id) || self.transition_store().contains_output_id(output_id).unwrap_or(true) { @@ -263,6 +265,19 @@ impl> VM { } } + // Ensure that the transaction is not producing a duplicate transition. + for transition_id in transaction.transition_ids() { + // If the transition ID is already produced in this block or previous blocks, abort the transaction. + if transition_ids.contains(transition_id) + || self.transition_store().contains_transition_id(transition_id).unwrap_or(true) + { + // Store the aborted transaction. + aborted.push((transaction.clone(), format!("Duplicate transition {transition_id}"))); + // Continue to the next transaction. + continue 'outer; + } + } + // Process the transaction in an isolated atomic batch. // - If the transaction succeeds, the finalize operations are stored. // - If the transaction fails, the atomic batch is aborted and no finalize operations are stored. @@ -378,8 +393,10 @@ impl> VM { Ok(confirmed_transaction) => { // Add the input IDs to the set of spent input IDs. input_ids.extend(confirmed_transaction.transaction().input_ids()); - // Add the output IDs to the set of spent output IDs. + // Add the output IDs to the set of produced output IDs. output_ids.extend(confirmed_transaction.transaction().output_ids()); + // Add the transition IDs to the set of produced transition IDs. + transition_ids.extend(confirmed_transaction.transaction().transition_ids()); // Store the confirmed transaction. confirmed.push(confirmed_transaction); // Increment the transaction index counter. From 10dfb7261f800ab0a1105d7a041766f72eff147f Mon Sep 17 00:00:00 2001 From: raychu86 <14917648+raychu86@users.noreply.github.com> Date: Sat, 20 Jan 2024 12:00:06 -0800 Subject: [PATCH 187/298] Add test for duplicate transition ids --- ledger/src/tests.rs | 136 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 136 insertions(+) diff --git a/ledger/src/tests.rs b/ledger/src/tests.rs index 3c5777aadd..b8ff45e39e 100644 --- a/ledger/src/tests.rs +++ b/ledger/src/tests.rs @@ -895,6 +895,142 @@ function create_duplicate_record: assert_eq!(block.aborted_transaction_ids(), &vec![transfer_3_id]); } +#[test] +fn test_execute_duplicate_transition_ids() { + let rng = &mut TestRng::default(); + + // Initialize the test environment. + let crate::test_helpers::TestEnv { ledger, private_key, address, .. } = crate::test_helpers::sample_test_env(rng); + + // Deploy a test program to the ledger. + let program = Program::::from_str( + " +program dummy_program.aleo; + +function empty_function: + ", + ) + .unwrap(); + + // Deploy. + let deployment_transaction = ledger.vm.deploy(&private_key, &program, None, 0, None, rng).unwrap(); + // Verify. + ledger.vm().check_transaction(&deployment_transaction, None, rng).unwrap(); + + // Construct the next block. + let block = ledger + .prepare_advance_to_next_beacon_block(&private_key, vec![], vec![], vec![deployment_transaction], rng) + .unwrap(); + + // Check that the next block is valid. + ledger.check_next_block(&block, rng).unwrap(); + // Add the block to the ledger. + ledger.advance_to_next_block(&block).unwrap(); + + // Create a transaction with different transaction ids, but with a fixed transition id. + let mut create_transaction_with_duplicate_transition_id = || -> Transaction { + // Use a fixed seed RNG. + let fixed_rng = &mut TestRng::from_seed(1); + + // Create a transaction with a fixed rng. + let inputs: [Value<_>; 0] = []; + let transaction = ledger + .vm + .execute( + &private_key, + ("dummy_program.aleo", "empty_function"), + inputs.into_iter(), + None, + 0, + None, + fixed_rng, + ) + .unwrap(); + // Extract the execution. + let execution = transaction.execution().unwrap().clone(); + + // Create a new fee for the execution. + let fee_authorization = ledger + .vm + .authorize_fee_public( + &private_key, + *transaction.fee_amount().unwrap(), + 0, + execution.to_execution_id().unwrap(), + rng, + ) + .unwrap(); + let fee = ledger.vm.execute_fee_authorization(fee_authorization, None, rng).unwrap(); + + Transaction::from_execution(execution, Some(fee)).unwrap() + }; + + // Create the first transaction. + let transaction_1 = create_transaction_with_duplicate_transition_id(); + let transaction_1_id = transaction_1.id(); + + // Create a second transaction with the same transition id. + let transaction_2 = create_transaction_with_duplicate_transition_id(); + let transaction_2_id = transaction_2.id(); + + // Create a third transaction with the same transition_id + let transaction_3 = create_transaction_with_duplicate_transition_id(); + let transaction_3_id = transaction_3.id(); + + // Ensure that each transaction has a duplicate transition id. + let tx_1_transition_id = transaction_1.transition_ids().next().unwrap(); + let tx_2_transition_id = transaction_2.transition_ids().next().unwrap(); + let tx_3_transition_id = transaction_3.transition_ids().next().unwrap(); + assert_eq!(tx_1_transition_id, tx_2_transition_id); + assert_eq!(tx_1_transition_id, tx_3_transition_id); + + // Create a block. + let block = ledger + .prepare_advance_to_next_beacon_block(&private_key, vec![], vec![], vec![transaction_1, transaction_2], rng) + .unwrap(); + + // Check that the next block is valid. + ledger.check_next_block(&block, rng).unwrap(); + + // Add the block to the ledger. + ledger.advance_to_next_block(&block).unwrap(); + + // Enforce that the block transactions were correct. + assert_eq!(block.transactions().num_accepted(), 1); + assert_eq!(block.transactions().transaction_ids().collect::>(), vec![&transaction_1_id]); + assert_eq!(block.aborted_transaction_ids(), &vec![transaction_2_id]); + + // Prepare a transfer that will succeed for the subsequent block. + let inputs = [Value::from_str(&format!("{address}")).unwrap(), Value::from_str("1000u64").unwrap()]; + let transfer_transaction = ledger + .vm + .execute(&private_key, ("credits.aleo", "transfer_public"), inputs.into_iter(), None, 0, None, rng) + .unwrap(); + let transfer_transaction_id = transfer_transaction.id(); + + // Create a block. + let block = ledger + .prepare_advance_to_next_beacon_block( + &private_key, + vec![], + vec![], + vec![transaction_3, transfer_transaction], + rng, + ) + .unwrap(); + + // Check that the next block is valid. + ledger.check_next_block(&block, rng).unwrap(); + + // Add the block to the ledger. + ledger.advance_to_next_block(&block).unwrap(); + + // Enforce that the block transactions were correct. + assert_eq!(block.transactions().num_accepted(), 1); + assert_eq!(block.transactions().transaction_ids().collect::>(), vec![&transfer_transaction_id]); + assert_eq!(block.aborted_transaction_ids(), &vec![transaction_3_id]); +} + #[test] fn test_deployment_duplicate_program_id() { let rng = &mut TestRng::default(); From abc20538a560a6d164930c2879550305ab8cdc93 Mon Sep 17 00:00:00 2001 From: raychu86 <14917648+raychu86@users.noreply.github.com> Date: Sat, 20 Jan 2024 12:08:19 -0800 Subject: [PATCH 188/298] Reorder checks --- synthesizer/src/vm/finalize.rs | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/synthesizer/src/vm/finalize.rs b/synthesizer/src/vm/finalize.rs index 212b1a4fb6..152ceceb5d 100644 --- a/synthesizer/src/vm/finalize.rs +++ b/synthesizer/src/vm/finalize.rs @@ -221,12 +221,12 @@ impl> VM { let mut deployments = IndexSet::new(); // Initialize a counter for the confirmed transaction index. let mut counter = 0u32; + // Initialize a list of created transition IDs. + let mut transition_ids: IndexSet = IndexSet::new(); // Initialize a list of spent input IDs. let mut input_ids: IndexSet> = IndexSet::new(); // Initialize a list of created output IDs. let mut output_ids: IndexSet> = IndexSet::new(); - // Initialize a list of created transition IDs. - let mut transition_ids: IndexSet = IndexSet::new(); // Finalize the transactions. 'outer: for transaction in transactions { @@ -239,6 +239,19 @@ impl> VM { continue 'outer; } + // Ensure that the transaction is not producing a duplicate transition. + for transition_id in transaction.transition_ids() { + // If the transition ID is already produced in this block or previous blocks, abort the transaction. + if transition_ids.contains(transition_id) + || self.transition_store().contains_transition_id(transition_id).unwrap_or(true) + { + // Store the aborted transaction. + aborted.push((transaction.clone(), format!("Duplicate transition {transition_id}"))); + // Continue to the next transaction. + continue 'outer; + } + } + // Ensure that the transaction is not double-spending an input. for input_id in transaction.input_ids() { // If the input ID is already spent in this block or previous blocks, abort the transaction. @@ -265,19 +278,6 @@ impl> VM { } } - // Ensure that the transaction is not producing a duplicate transition. - for transition_id in transaction.transition_ids() { - // If the transition ID is already produced in this block or previous blocks, abort the transaction. - if transition_ids.contains(transition_id) - || self.transition_store().contains_transition_id(transition_id).unwrap_or(true) - { - // Store the aborted transaction. - aborted.push((transaction.clone(), format!("Duplicate transition {transition_id}"))); - // Continue to the next transaction. - continue 'outer; - } - } - // Process the transaction in an isolated atomic batch. // - If the transaction succeeds, the finalize operations are stored. // - If the transaction fails, the atomic batch is aborted and no finalize operations are stored. @@ -391,12 +391,12 @@ impl> VM { match outcome { // If the transaction succeeded, store it and continue to the next transaction. Ok(confirmed_transaction) => { + // Add the transition IDs to the set of produced transition IDs. + transition_ids.extend(confirmed_transaction.transaction().transition_ids()); // Add the input IDs to the set of spent input IDs. input_ids.extend(confirmed_transaction.transaction().input_ids()); // Add the output IDs to the set of produced output IDs. output_ids.extend(confirmed_transaction.transaction().output_ids()); - // Add the transition IDs to the set of produced transition IDs. - transition_ids.extend(confirmed_transaction.transaction().transition_ids()); // Store the confirmed transaction. confirmed.push(confirmed_transaction); // Increment the transaction index counter. From 463f8a81162e453da8214580e7f69a751eb68d37 Mon Sep 17 00:00:00 2001 From: Howard Wu <9260812+howardwu@users.noreply.github.com> Date: Sat, 20 Jan 2024 12:50:31 -0800 Subject: [PATCH 189/298] Bump MSRV to 1.72; fix clippy --- .circleci/config.yml | 140 +++++++++--------- Cargo.toml | 2 +- circuit/types/field/src/helpers/from_bits.rs | 4 +- .../types/integers/src/helpers/from_bits.rs | 4 +- circuit/types/scalar/src/helpers/from_bits.rs | 4 +- console/account/src/compute_key/from_bits.rs | 4 +- console/account/src/signature/from_bits.rs | 4 +- console/program/src/data/plaintext/parse.rs | 2 +- .../program/src/data/record/entry/parse.rs | 2 +- .../src/data/record/parse_plaintext.rs | 2 +- .../src/data_types/record_type/parse.rs | 2 +- .../src/data_types/struct_type/parse.rs | 2 +- console/program/src/state_path/mod.rs | 2 +- console/types/address/src/from_bits.rs | 2 +- console/types/boolean/src/from_bits.rs | 2 +- console/types/field/src/from_bits.rs | 2 +- console/types/group/src/from_bits.rs | 2 +- console/types/integers/src/from_bits.rs | 2 +- console/types/scalar/src/from_bits.rs | 2 +- curves/src/bls12_377/fq.rs | 1 + curves/src/bls12_377/fq12.rs | 2 +- curves/src/bls12_377/fq2.rs | 2 +- curves/src/bls12_377/fq6.rs | 2 +- curves/src/bls12_377/fr.rs | 1 + curves/src/edwards_bls12/fr.rs | 1 + curves/src/traits/tests_projective.rs | 2 +- fields/src/fp12_2over3over2.rs | 4 +- fields/src/fp2.rs | 6 +- fields/src/fp6_3over2.rs | 6 +- fields/src/fp_256.rs | 13 +- fields/src/fp_384.rs | 4 +- fields/src/traits/field_parameters.rs | 2 +- ledger/block/src/lib.rs | 2 +- .../store/src/helpers/memory/internal/map.rs | 4 +- .../store/src/helpers/rocksdb/internal/map.rs | 4 +- ledger/test-helpers/src/lib.rs | 2 +- rust-toolchain | 2 +- 37 files changed, 117 insertions(+), 129 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 2402f7faa9..7bfbb08b68 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -134,7 +134,7 @@ commands: jobs: snarkvm: docker: - - image: cimg/rust:1.71.1 + - image: cimg/rust:1.72 resource_class: 2xlarge steps: - checkout @@ -144,7 +144,7 @@ jobs: algorithms: docker: - - image: cimg/rust:1.71.1 + - image: cimg/rust:1.72 resource_class: 2xlarge steps: - run_serial: @@ -153,7 +153,7 @@ jobs: algorithms-profiler: docker: - - image: cimg/rust:1.71.1 + - image: cimg/rust:1.72 resource_class: xlarge steps: - run_serial: # This runs a single test with profiler enabled @@ -163,7 +163,7 @@ jobs: circuit: docker: - - image: cimg/rust:1.71.1 + - image: cimg/rust:1.72 resource_class: xlarge steps: - run_serial: @@ -172,7 +172,7 @@ jobs: circuit-account: docker: - - image: cimg/rust:1.71.1 + - image: cimg/rust:1.72 resource_class: xlarge steps: - run_serial: @@ -182,7 +182,7 @@ jobs: # This checks that no `console` structs are used in core circuit logic. circuit-account-noconsole: docker: - - image: cimg/rust:1.71.1 + - image: cimg/rust:1.72 resource_class: xlarge steps: - run_serial: @@ -192,7 +192,7 @@ jobs: circuit-algorithms: docker: - - image: cimg/rust:1.71.1 + - image: cimg/rust:1.72 resource_class: xlarge steps: - run_serial: @@ -201,7 +201,7 @@ jobs: circuit-collections: docker: - - image: cimg/rust:1.71.1 + - image: cimg/rust:1.72 resource_class: xlarge steps: - run_serial: @@ -211,7 +211,7 @@ jobs: # This checks that no `console` structs are used in core circuit logic. circuit-collections-noconsole: docker: - - image: cimg/rust:1.71.1 + - image: cimg/rust:1.72 resource_class: xlarge steps: - run_serial: @@ -221,7 +221,7 @@ jobs: circuit-environment: docker: - - image: cimg/rust:1.71.1 + - image: cimg/rust:1.72 resource_class: xlarge steps: - run_serial: @@ -230,7 +230,7 @@ jobs: circuit-network: docker: - - image: cimg/rust:1.71.1 + - image: cimg/rust:1.72 resource_class: xlarge steps: - run_serial: @@ -239,7 +239,7 @@ jobs: circuit-program: docker: - - image: cimg/rust:1.71.1 + - image: cimg/rust:1.72 resource_class: xlarge steps: - run_serial: @@ -248,7 +248,7 @@ jobs: circuit-types: docker: - - image: cimg/rust:1.71.1 + - image: cimg/rust:1.72 resource_class: xlarge steps: - run_serial: @@ -257,7 +257,7 @@ jobs: circuit-types-address: docker: - - image: cimg/rust:1.71.1 + - image: cimg/rust:1.72 resource_class: xlarge steps: - run_serial: @@ -266,7 +266,7 @@ jobs: circuit-types-boolean: docker: - - image: cimg/rust:1.71.1 + - image: cimg/rust:1.72 resource_class: xlarge steps: - run_serial: @@ -275,7 +275,7 @@ jobs: circuit-types-field: docker: - - image: cimg/rust:1.71.1 + - image: cimg/rust:1.72 resource_class: xlarge steps: - run_serial: @@ -284,7 +284,7 @@ jobs: circuit-types-group: docker: - - image: cimg/rust:1.71.1 + - image: cimg/rust:1.72 resource_class: xlarge steps: - run_serial: @@ -293,7 +293,7 @@ jobs: circuit-types-integers: docker: - - image: cimg/rust:1.71.1 + - image: cimg/rust:1.72 resource_class: 2xlarge steps: - run_serial: @@ -303,7 +303,7 @@ jobs: circuit-types-scalar: docker: - - image: cimg/rust:1.71.1 + - image: cimg/rust:1.72 resource_class: xlarge steps: - run_serial: @@ -312,7 +312,7 @@ jobs: circuit-types-string: docker: - - image: cimg/rust:1.71.1 + - image: cimg/rust:1.72 resource_class: xlarge steps: - run_serial: @@ -320,7 +320,7 @@ jobs: cache_key: snarkvm-circuit-types-string-cache console: docker: - - image: cimg/rust:1.71.1 + - image: cimg/rust:1.72 resource_class: xlarge steps: - run_serial: @@ -329,7 +329,7 @@ jobs: console-account: docker: - - image: cimg/rust:1.71.1 + - image: cimg/rust:1.72 resource_class: xlarge steps: - run_serial: @@ -338,7 +338,7 @@ jobs: console-algorithms: docker: - - image: cimg/rust:1.71.1 + - image: cimg/rust:1.72 resource_class: xlarge steps: - run_serial: @@ -347,7 +347,7 @@ jobs: console-collections: docker: - - image: cimg/rust:1.71.1 + - image: cimg/rust:1.72 resource_class: xlarge steps: - run_serial: @@ -356,7 +356,7 @@ jobs: console-network: docker: - - image: cimg/rust:1.71.1 + - image: cimg/rust:1.72 resource_class: xlarge steps: - run_serial: @@ -365,7 +365,7 @@ jobs: console-network-environment: docker: - - image: cimg/rust:1.71.1 + - image: cimg/rust:1.72 resource_class: xlarge steps: - run_serial: @@ -374,7 +374,7 @@ jobs: console-program: docker: - - image: cimg/rust:1.71.1 + - image: cimg/rust:1.72 resource_class: xlarge steps: - run_serial: @@ -383,7 +383,7 @@ jobs: console-types: docker: - - image: cimg/rust:1.71.1 + - image: cimg/rust:1.72 resource_class: xlarge steps: - run_serial: @@ -392,7 +392,7 @@ jobs: console-types-address: docker: - - image: cimg/rust:1.71.1 + - image: cimg/rust:1.72 resource_class: xlarge steps: - run_serial: @@ -401,7 +401,7 @@ jobs: console-types-boolean: docker: - - image: cimg/rust:1.71.1 + - image: cimg/rust:1.72 resource_class: xlarge steps: - run_serial: @@ -410,7 +410,7 @@ jobs: console-types-field: docker: - - image: cimg/rust:1.71.1 + - image: cimg/rust:1.72 resource_class: xlarge steps: - run_serial: @@ -419,7 +419,7 @@ jobs: console-types-group: docker: - - image: cimg/rust:1.71.1 + - image: cimg/rust:1.72 resource_class: xlarge steps: - run_serial: @@ -428,7 +428,7 @@ jobs: console-types-integers: docker: - - image: cimg/rust:1.71.1 + - image: cimg/rust:1.72 resource_class: xlarge steps: - run_serial: @@ -437,7 +437,7 @@ jobs: console-types-scalar: docker: - - image: cimg/rust:1.71.1 + - image: cimg/rust:1.72 resource_class: xlarge steps: - run_serial: @@ -446,7 +446,7 @@ jobs: console-types-string: docker: - - image: cimg/rust:1.71.1 + - image: cimg/rust:1.72 resource_class: xlarge steps: - run_serial: @@ -455,7 +455,7 @@ jobs: curves: docker: - - image: cimg/rust:1.71.1 + - image: cimg/rust:1.72 resource_class: xlarge steps: - run_serial: @@ -464,7 +464,7 @@ jobs: fields: docker: - - image: cimg/rust:1.71.1 + - image: cimg/rust:1.72 resource_class: xlarge steps: - run_serial: @@ -473,7 +473,7 @@ jobs: ledger: docker: - - image: cimg/rust:1.71.1 + - image: cimg/rust:1.72 resource_class: 2xlarge steps: - run_serial: @@ -482,7 +482,7 @@ jobs: ledger-with-rocksdb: docker: - - image: cimg/rust:1.71.1 + - image: cimg/rust:1.72 resource_class: 2xlarge steps: - run_serial: @@ -492,7 +492,7 @@ jobs: ledger-authority: docker: - - image: cimg/rust:1.71.1 + - image: cimg/rust:1.72 resource_class: 2xlarge steps: - run_serial: @@ -501,7 +501,7 @@ jobs: ledger-block: docker: - - image: cimg/rust:1.71.1 + - image: cimg/rust:1.72 resource_class: 2xlarge steps: - run_serial: @@ -510,7 +510,7 @@ jobs: ledger-coinbase: docker: - - image: cimg/rust:1.71.1 + - image: cimg/rust:1.72 resource_class: 2xlarge steps: - run_serial: @@ -519,7 +519,7 @@ jobs: ledger-committee: docker: - - image: cimg/rust:1.71.1 + - image: cimg/rust:1.72 resource_class: xlarge steps: - run_serial: @@ -528,7 +528,7 @@ jobs: ledger-narwhal: docker: - - image: cimg/rust:1.71.1 + - image: cimg/rust:1.72 resource_class: 2xlarge steps: - run_serial: @@ -537,7 +537,7 @@ jobs: ledger-narwhal-batch-certificate: docker: - - image: cimg/rust:1.71.1 + - image: cimg/rust:1.72 resource_class: 2xlarge steps: - run_serial: @@ -546,7 +546,7 @@ jobs: ledger-narwhal-batch-header: docker: - - image: cimg/rust:1.71.1 + - image: cimg/rust:1.72 resource_class: 2xlarge steps: - run_serial: @@ -555,7 +555,7 @@ jobs: ledger-narwhal-data: docker: - - image: cimg/rust:1.71.1 + - image: cimg/rust:1.72 resource_class: 2xlarge steps: - run_serial: @@ -564,7 +564,7 @@ jobs: ledger-narwhal-subdag: docker: - - image: cimg/rust:1.71.1 + - image: cimg/rust:1.72 resource_class: 2xlarge steps: - run_serial: @@ -573,7 +573,7 @@ jobs: ledger-narwhal-transmission: docker: - - image: cimg/rust:1.71.1 + - image: cimg/rust:1.72 resource_class: 2xlarge steps: - run_serial: @@ -582,7 +582,7 @@ jobs: ledger-narwhal-transmission-id: docker: - - image: cimg/rust:1.71.1 + - image: cimg/rust:1.72 resource_class: 2xlarge steps: - run_serial: @@ -591,7 +591,7 @@ jobs: ledger-query: docker: - - image: cimg/rust:1.71.1 + - image: cimg/rust:1.72 resource_class: 2xlarge steps: - run_serial: @@ -600,7 +600,7 @@ jobs: ledger-store: docker: - - image: cimg/rust:1.71.1 + - image: cimg/rust:1.72 resource_class: 2xlarge steps: - run_serial: @@ -610,7 +610,7 @@ jobs: ledger-test-helpers: docker: - - image: cimg/rust:1.71.1 + - image: cimg/rust:1.72 resource_class: 2xlarge steps: - run_serial: @@ -619,7 +619,7 @@ jobs: parameters: docker: - - image: cimg/rust:1.71.1 + - image: cimg/rust:1.72 resource_class: xlarge steps: - run_serial: @@ -628,7 +628,7 @@ jobs: synthesizer: docker: - - image: cimg/rust:1.71.1 + - image: cimg/rust:1.72 resource_class: 2xlarge steps: - run_serial: @@ -638,7 +638,7 @@ jobs: synthesizer-integration: docker: - - image: cimg/rust:1.71.1 + - image: cimg/rust:1.72 resource_class: 2xlarge steps: - run_serial: @@ -648,7 +648,7 @@ jobs: synthesizer-process: docker: - - image: cimg/rust:1.71.1 + - image: cimg/rust:1.72 resource_class: 2xlarge steps: - run_serial: @@ -657,7 +657,7 @@ jobs: synthesizer-process-with-rocksdb: docker: - - image: cimg/rust:1.71.1 + - image: cimg/rust:1.72 resource_class: 2xlarge steps: - run_serial: @@ -667,7 +667,7 @@ jobs: synthesizer-program: docker: - - image: cimg/rust:1.71.1 + - image: cimg/rust:1.72 resource_class: 2xlarge steps: - run_serial: @@ -677,7 +677,7 @@ jobs: synthesizer-program-integration-keccak: docker: - - image: cimg/rust:1.71.1 + - image: cimg/rust:1.72 resource_class: 2xlarge steps: - run_serial: @@ -687,7 +687,7 @@ jobs: synthesizer-program-integration-psd: docker: - - image: cimg/rust:1.71.1 + - image: cimg/rust:1.72 resource_class: 2xlarge steps: - run_serial: @@ -697,7 +697,7 @@ jobs: synthesizer-program-integration-sha: docker: - - image: cimg/rust:1.71.1 + - image: cimg/rust:1.72 resource_class: 2xlarge steps: - run_serial: @@ -707,7 +707,7 @@ jobs: synthesizer-program-integration-rest: docker: - - image: cimg/rust:1.71.1 + - image: cimg/rust:1.72 resource_class: 2xlarge steps: - run_serial: @@ -717,7 +717,7 @@ jobs: synthesizer-snark: docker: - - image: cimg/rust:1.71.1 + - image: cimg/rust:1.72 resource_class: 2xlarge steps: - run_serial: @@ -726,7 +726,7 @@ jobs: utilities: docker: - - image: cimg/rust:1.71.1 + - image: cimg/rust:1.72 resource_class: xlarge steps: - run_serial: @@ -735,7 +735,7 @@ jobs: utilities-derives: docker: - - image: cimg/rust:1.71.1 + - image: cimg/rust:1.72 resource_class: xlarge steps: - run_serial: @@ -744,7 +744,7 @@ jobs: wasm: docker: - - image: cimg/rust:1.71.1 + - image: cimg/rust:1.72 resource_class: 2xlarge steps: - checkout @@ -762,7 +762,7 @@ jobs: check-fmt: docker: - - image: cimg/rust:1.71.1 + - image: cimg/rust:1.72 resource_class: xlarge steps: - checkout @@ -778,7 +778,7 @@ jobs: check-clippy: docker: - - image: cimg/rust:1.71.1 + - image: cimg/rust:1.72 resource_class: 2xlarge steps: - checkout @@ -795,7 +795,7 @@ jobs: check-all-targets: docker: - - image: cimg/rust:1.71.1 + - image: cimg/rust:1.72 resource_class: xlarge steps: - checkout diff --git a/Cargo.toml b/Cargo.toml index 650a738747..050c10f65b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -22,7 +22,7 @@ categories = [ include = [ "Cargo.toml", "vm", "README.md", "LICENSE.md" ] license = "Apache-2.0" edition = "2021" -rust-version = "1.70" +rust-version = "1.72" [workspace] members = [ diff --git a/circuit/types/field/src/helpers/from_bits.rs b/circuit/types/field/src/helpers/from_bits.rs index d1f7abfda2..3376cfa199 100644 --- a/circuit/types/field/src/helpers/from_bits.rs +++ b/circuit/types/field/src/helpers/from_bits.rs @@ -126,7 +126,7 @@ mod tests { }); // Add excess zero bits. - let candidate = vec![given_bits, vec![Boolean::new(mode, false); i as usize]].concat(); + let candidate = [given_bits, vec![Boolean::new(mode, false); i as usize]].concat(); Circuit::scope(&format!("Excess {mode} {i}"), || { let candidate = Field::::from_bits_le(&candidate); @@ -171,7 +171,7 @@ mod tests { }); // Add excess zero bits. - let candidate = vec![vec![Boolean::new(mode, false); i as usize], given_bits].concat(); + let candidate = [vec![Boolean::new(mode, false); i as usize], given_bits].concat(); Circuit::scope(&format!("Excess {mode} {i}"), || { let candidate = Field::::from_bits_be(&candidate); diff --git a/circuit/types/integers/src/helpers/from_bits.rs b/circuit/types/integers/src/helpers/from_bits.rs index ffcdb0ff89..8919575dd8 100644 --- a/circuit/types/integers/src/helpers/from_bits.rs +++ b/circuit/types/integers/src/helpers/from_bits.rs @@ -74,7 +74,7 @@ mod tests { }); // Add excess zero bits. - let candidate = vec![given_bits, vec![Boolean::new(mode, false); i as usize]].concat(); + let candidate = [given_bits, vec![Boolean::new(mode, false); i as usize]].concat(); Circuit::scope(&format!("Excess {mode} {i}"), || { let candidate = Integer::::from_bits_le(&candidate); @@ -114,7 +114,7 @@ mod tests { }); // Add excess zero bits. - let candidate = vec![vec![Boolean::new(mode, false); i as usize], given_bits].concat(); + let candidate = [vec![Boolean::new(mode, false); i as usize], given_bits].concat(); Circuit::scope(&format!("Excess {mode} {i}"), || { let candidate = Integer::::from_bits_be(&candidate); diff --git a/circuit/types/scalar/src/helpers/from_bits.rs b/circuit/types/scalar/src/helpers/from_bits.rs index 2b0522c70b..2422607938 100644 --- a/circuit/types/scalar/src/helpers/from_bits.rs +++ b/circuit/types/scalar/src/helpers/from_bits.rs @@ -116,7 +116,7 @@ mod tests { }); // Add excess zero bits. - let candidate = vec![given_bits, vec![Boolean::new(mode, false); i as usize]].concat(); + let candidate = [given_bits, vec![Boolean::new(mode, false); i as usize]].concat(); Circuit::scope(&format!("Excess {mode} {i}"), || { let candidate = Scalar::::from_bits_le(&candidate); @@ -157,7 +157,7 @@ mod tests { }); // Add excess zero bits. - let candidate = vec![vec![Boolean::new(mode, false); i as usize], given_bits].concat(); + let candidate = [vec![Boolean::new(mode, false); i as usize], given_bits].concat(); Circuit::scope(&format!("Excess {mode} {i}"), || { let candidate = Scalar::::from_bits_be(&candidate); diff --git a/console/account/src/compute_key/from_bits.rs b/console/account/src/compute_key/from_bits.rs index b26d7e0ddb..fa1f73e576 100644 --- a/console/account/src/compute_key/from_bits.rs +++ b/console/account/src/compute_key/from_bits.rs @@ -73,7 +73,7 @@ mod tests { assert_eq!(expected, candidate); // Add excess zero bits. - let candidate = vec![given_bits, vec![false; i]].concat(); + let candidate = [given_bits, vec![false; i]].concat(); let candidate = ComputeKey::::from_bits_le(&candidate)?; assert_eq!(expected, candidate); @@ -96,7 +96,7 @@ mod tests { assert_eq!(expected, candidate); // Add excess zero bits. - let candidate = vec![given_bits, vec![false; i]].concat(); + let candidate = [given_bits, vec![false; i]].concat(); let candidate = ComputeKey::::from_bits_be(&candidate)?; assert_eq!(expected, candidate); diff --git a/console/account/src/signature/from_bits.rs b/console/account/src/signature/from_bits.rs index 95c30b02be..5892bbfc7c 100644 --- a/console/account/src/signature/from_bits.rs +++ b/console/account/src/signature/from_bits.rs @@ -91,7 +91,7 @@ mod tests { assert_eq!(expected, candidate); // Add excess zero bits. - let candidate = vec![given_bits, vec![false; i]].concat(); + let candidate = [given_bits, vec![false; i]].concat(); let candidate = Signature::::from_bits_le(&candidate)?; assert_eq!(expected, candidate); @@ -114,7 +114,7 @@ mod tests { assert_eq!(expected, candidate); // Add excess zero bits. - let candidate = vec![given_bits, vec![false; i]].concat(); + let candidate = [given_bits, vec![false; i]].concat(); let candidate = Signature::::from_bits_be(&candidate)?; assert_eq!(expected, candidate); diff --git a/console/program/src/data/plaintext/parse.rs b/console/program/src/data/plaintext/parse.rs index 01fb453595..7a395f4291 100644 --- a/console/program/src/data/plaintext/parse.rs +++ b/console/program/src/data/plaintext/parse.rs @@ -59,7 +59,7 @@ impl Parser for Plaintext { // Parse the '}' from the string. let (string, _) = tag("}")(string)?; // Output the plaintext. - Ok((string, Plaintext::Struct(IndexMap::from_iter(members.into_iter()), Default::default()))) + Ok((string, Plaintext::Struct(IndexMap::from_iter(members), Default::default()))) } /// Parses a plaintext as an array: `[plaintext_0, ..., plaintext_n]`. diff --git a/console/program/src/data/record/entry/parse.rs b/console/program/src/data/record/entry/parse.rs index af5c9491db..ec7a125da3 100644 --- a/console/program/src/data/record/entry/parse.rs +++ b/console/program/src/data/record/entry/parse.rs @@ -95,7 +95,7 @@ impl Parser for Entry> { // Parse the '}' from the string. let (string, _) = tag("}")(string)?; // Output the plaintext and visibility. - Ok((string, (Plaintext::Struct(IndexMap::from_iter(members.into_iter()), Default::default()), mode))) + Ok((string, (Plaintext::Struct(IndexMap::from_iter(members), Default::default()), mode))) } /// Parses an entry as an array: `[plaintext_0.visibility, ..., plaintext_n.visibility]`. diff --git a/console/program/src/data/record/parse_plaintext.rs b/console/program/src/data/record/parse_plaintext.rs index c04a190d85..0dfcdc4aa1 100644 --- a/console/program/src/data/record/parse_plaintext.rs +++ b/console/program/src/data/record/parse_plaintext.rs @@ -102,7 +102,7 @@ impl Parser for Record> { // Parse the '}' from the string. let (string, _) = tag("}")(string)?; // Output the record. - Ok((string, Record { owner, data: IndexMap::from_iter(entries.into_iter()), nonce })) + Ok((string, Record { owner, data: IndexMap::from_iter(entries), nonce })) } } diff --git a/console/program/src/data_types/record_type/parse.rs b/console/program/src/data_types/record_type/parse.rs index d6e78933ff..b6c6aa561c 100644 --- a/console/program/src/data_types/record_type/parse.rs +++ b/console/program/src/data_types/record_type/parse.rs @@ -94,7 +94,7 @@ impl Parser for RecordType { })(string)?; // Return the record type. - Ok((string, Self { name, owner, entries: IndexMap::from_iter(entries.into_iter()) })) + Ok((string, Self { name, owner, entries: IndexMap::from_iter(entries) })) } } diff --git a/console/program/src/data_types/struct_type/parse.rs b/console/program/src/data_types/struct_type/parse.rs index 648203697f..a19d81400f 100644 --- a/console/program/src/data_types/struct_type/parse.rs +++ b/console/program/src/data_types/struct_type/parse.rs @@ -70,7 +70,7 @@ impl Parser for StructType { Ok(members) })(string)?; // Return the struct. - Ok((string, Self { name, members: IndexMap::from_iter(members.into_iter()) })) + Ok((string, Self { name, members: IndexMap::from_iter(members) })) } } diff --git a/console/program/src/state_path/mod.rs b/console/program/src/state_path/mod.rs index 2ff02b04b4..ce3b719d88 100644 --- a/console/program/src/state_path/mod.rs +++ b/console/program/src/state_path/mod.rs @@ -280,7 +280,7 @@ pub mod test_helpers { let header_path = header_tree.prove(1, &header_leaf.to_bits_le())?; let previous_block_hash: N::BlockHash = Field::::rand(rng).into(); - let preimage = (*previous_block_hash).to_bits_le().into_iter().chain(header_root.to_bits_le().into_iter()); + let preimage = (*previous_block_hash).to_bits_le().into_iter().chain(header_root.to_bits_le()); let block_hash = N::hash_bhp1024(&preimage.collect::>())?; // Construct the global state root and block path. diff --git a/console/types/address/src/from_bits.rs b/console/types/address/src/from_bits.rs index 6b7df16c23..27c97c1145 100644 --- a/console/types/address/src/from_bits.rs +++ b/console/types/address/src/from_bits.rs @@ -49,7 +49,7 @@ mod tests { assert_eq!(expected, candidate); // Add excess zero bits. - let candidate = vec![given_bits, vec![false; i]].concat(); + let candidate = [given_bits, vec![false; i]].concat(); let candidate = Address::::from_bits_le(&candidate)?; assert_eq!(expected, candidate); diff --git a/console/types/boolean/src/from_bits.rs b/console/types/boolean/src/from_bits.rs index 3cf131b005..4871da2ab3 100644 --- a/console/types/boolean/src/from_bits.rs +++ b/console/types/boolean/src/from_bits.rs @@ -54,7 +54,7 @@ mod tests { assert_eq!(expected, candidate); // Add excess zero bits. - let candidate = vec![given_bits, vec![false; i]].concat(); + let candidate = [given_bits, vec![false; i]].concat(); assert!(Boolean::::from_bits_le(&candidate).is_err()); } Ok(()) diff --git a/console/types/field/src/from_bits.rs b/console/types/field/src/from_bits.rs index 2b283272f7..9356d0ab32 100644 --- a/console/types/field/src/from_bits.rs +++ b/console/types/field/src/from_bits.rs @@ -93,7 +93,7 @@ mod tests { assert_eq!(expected, candidate); // Add excess zero bits. - let candidate = vec![given_bits, vec![false; i]].concat(); + let candidate = [given_bits, vec![false; i]].concat(); let candidate = Field::::from_bits_le(&candidate)?; assert_eq!(expected, candidate); diff --git a/console/types/group/src/from_bits.rs b/console/types/group/src/from_bits.rs index c8eafc873a..8a7682b144 100644 --- a/console/types/group/src/from_bits.rs +++ b/console/types/group/src/from_bits.rs @@ -48,7 +48,7 @@ mod tests { assert_eq!(expected, candidate); // Add excess zero bits. - let candidate = vec![given_bits, vec![false; i]].concat(); + let candidate = [given_bits, vec![false; i]].concat(); let candidate = Group::::from_bits_le(&candidate)?; assert_eq!(expected, candidate); diff --git a/console/types/integers/src/from_bits.rs b/console/types/integers/src/from_bits.rs index 98381be72b..2820a5d8dc 100644 --- a/console/types/integers/src/from_bits.rs +++ b/console/types/integers/src/from_bits.rs @@ -48,7 +48,7 @@ mod tests { assert_eq!(expected, candidate); // Add excess zero bits. - let candidate = vec![given_bits, vec![false; i]].concat(); + let candidate = [given_bits, vec![false; i]].concat(); let candidate = Integer::::from_bits_le(&candidate)?; assert_eq!(expected, candidate); diff --git a/console/types/scalar/src/from_bits.rs b/console/types/scalar/src/from_bits.rs index fbe3e4a3b9..a45fdf406f 100644 --- a/console/types/scalar/src/from_bits.rs +++ b/console/types/scalar/src/from_bits.rs @@ -96,7 +96,7 @@ mod tests { assert_eq!(expected, candidate); // Add excess zero bits. - let candidate = vec![given_bits, vec![false; i]].concat(); + let candidate = [given_bits, vec![false; i]].concat(); let candidate = Scalar::::from_bits_le(&candidate)?; assert_eq!(expected, candidate); diff --git a/curves/src/bls12_377/fq.rs b/curves/src/bls12_377/fq.rs index fa333b8217..88e09e09f9 100644 --- a/curves/src/bls12_377/fq.rs +++ b/curves/src/bls12_377/fq.rs @@ -24,6 +24,7 @@ use snarkvm_utilities::biginteger::BigInteger384 as BigInteger; pub type Fq = Fp384; +#[derive(Copy, Clone)] pub struct FqParameters; impl Fp384Parameters for FqParameters {} diff --git a/curves/src/bls12_377/fq12.rs b/curves/src/bls12_377/fq12.rs index a94da8470f..8c4418e015 100644 --- a/curves/src/bls12_377/fq12.rs +++ b/curves/src/bls12_377/fq12.rs @@ -19,7 +19,7 @@ use crate::bls12_377::{Fq, Fq2, Fq6Parameters}; pub type Fq12 = Fp12; -#[derive(Clone, Copy)] +#[derive(Copy, Clone)] pub struct Fq12Parameters; impl Fp12Parameters for Fq12Parameters { diff --git a/curves/src/bls12_377/fq2.rs b/curves/src/bls12_377/fq2.rs index 649cf6d33b..ca5152f5c4 100644 --- a/curves/src/bls12_377/fq2.rs +++ b/curves/src/bls12_377/fq2.rs @@ -21,7 +21,7 @@ use crate::bls12_377::Fq; pub type Fq2 = Fp2; -#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)] +#[derive(Copy, Clone, Debug, PartialEq, Eq, Serialize, Deserialize)] pub struct Fq2Parameters; impl Fp2Parameters for Fq2Parameters { diff --git a/curves/src/bls12_377/fq6.rs b/curves/src/bls12_377/fq6.rs index 35a420d298..15a58bba0b 100644 --- a/curves/src/bls12_377/fq6.rs +++ b/curves/src/bls12_377/fq6.rs @@ -23,7 +23,7 @@ use crate::bls12_377::{Fq, Fq2, Fq2Parameters}; pub type Fq6 = Fp6; -#[derive(Clone, Copy)] +#[derive(Copy, Clone)] pub struct Fq6Parameters; impl Fp6Parameters for Fq6Parameters { diff --git a/curves/src/bls12_377/fr.rs b/curves/src/bls12_377/fr.rs index 9756f51950..d78471c704 100644 --- a/curves/src/bls12_377/fr.rs +++ b/curves/src/bls12_377/fr.rs @@ -47,6 +47,7 @@ use snarkvm_utilities::biginteger::BigInteger256 as BigInteger; /// ``` pub type Fr = Fp256; +#[derive(Copy, Clone)] pub struct FrParameters; impl Fp256Parameters for FrParameters {} diff --git a/curves/src/edwards_bls12/fr.rs b/curves/src/edwards_bls12/fr.rs index 1e8f9c1b85..d092c73f87 100644 --- a/curves/src/edwards_bls12/fr.rs +++ b/curves/src/edwards_bls12/fr.rs @@ -24,6 +24,7 @@ use snarkvm_utilities::biginteger::BigInteger256 as BigInteger; pub type Fr = Fp256; +#[derive(Copy, Clone)] pub struct FrParameters; impl Fp256Parameters for FrParameters {} diff --git a/curves/src/traits/tests_projective.rs b/curves/src/traits/tests_projective.rs index 6b8da06408..b48d55d9a3 100644 --- a/curves/src/traits/tests_projective.rs +++ b/curves/src/traits/tests_projective.rs @@ -44,7 +44,7 @@ fn random_addition_test(rng: &mut TestRng) { assert_eq!(aplusa, aplusamixed); } - let mut tmp = vec![G::zero(); 6]; + let mut tmp = [G::zero(); 6]; // (a + b) + c tmp[0] = (a + b) + c; diff --git a/fields/src/fp12_2over3over2.rs b/fields/src/fp12_2over3over2.rs index 7659c781a1..69700a878b 100644 --- a/fields/src/fp12_2over3over2.rs +++ b/fields/src/fp12_2over3over2.rs @@ -34,12 +34,10 @@ pub trait Fp12Parameters: 'static + Send + Sync + Copy { } /// An element of Fp12, represented by c0 + c1 * v -#[derive(Derivative, Serialize, Deserialize)] +#[derive(Derivative, Copy, Clone, Serialize, Deserialize)] #[derivative( Default(bound = "P: Fp12Parameters"), Hash(bound = "P: Fp12Parameters"), - Clone(bound = "P: Fp12Parameters"), - Copy(bound = "P: Fp12Parameters"), Debug(bound = "P: Fp12Parameters"), PartialEq(bound = "P: Fp12Parameters"), Eq(bound = "P: Fp12Parameters") diff --git a/fields/src/fp2.rs b/fields/src/fp2.rs index 19841a359e..63ba3d9077 100644 --- a/fields/src/fp2.rs +++ b/fields/src/fp2.rs @@ -32,7 +32,7 @@ use std::{ ops::{Add, AddAssign, Div, DivAssign, Mul, MulAssign, Neg, Sub, SubAssign}, }; -pub trait Fp2Parameters: 'static + Send + Sync + Serialize + for<'a> Deserialize<'a> { +pub trait Fp2Parameters: 'static + Copy + Clone + Serialize + for<'a> Deserialize<'a> + Send + Sync { type Fp: PrimeField; /// Coefficients for the Frobenius automorphism. @@ -48,12 +48,10 @@ pub trait Fp2Parameters: 'static + Send + Sync + Serialize + for<'a> Deserialize } } -#[derive(Derivative, Serialize, Deserialize)] +#[derive(Derivative, Copy, Clone, Serialize, Deserialize)] #[derivative( Default(bound = "P: Fp2Parameters"), Hash(bound = "P: Fp2Parameters"), - Clone(bound = "P: Fp2Parameters"), - Copy(bound = "P: Fp2Parameters"), Debug(bound = "P: Fp2Parameters"), PartialEq(bound = "P: Fp2Parameters"), Eq(bound = "P: Fp2Parameters") diff --git a/fields/src/fp6_3over2.rs b/fields/src/fp6_3over2.rs index 859e5a6613..9431a562ad 100644 --- a/fields/src/fp6_3over2.rs +++ b/fields/src/fp6_3over2.rs @@ -32,7 +32,7 @@ use std::{ ops::{Add, AddAssign, Div, DivAssign, Mul, MulAssign, Neg, Sub, SubAssign}, }; -pub trait Fp6Parameters: 'static + Send + Sync + Copy { +pub trait Fp6Parameters: 'static + Copy + Clone + Send + Sync { type Fp2Params: Fp2Parameters; /// Coefficients for the Frobenius automorphism. @@ -48,12 +48,10 @@ pub trait Fp6Parameters: 'static + Send + Sync + Copy { } /// An element of Fp6, represented by c0 + c1 * v + c2 * v^(2). -#[derive(Derivative, Serialize, Deserialize)] +#[derive(Derivative, Copy, Clone, Serialize, Deserialize)] #[derivative( Default(bound = "P: Fp6Parameters"), Hash(bound = "P: Fp6Parameters"), - Clone(bound = "P: Fp6Parameters"), - Copy(bound = "P: Fp6Parameters"), Debug(bound = "P: Fp6Parameters"), PartialEq(bound = "P: Fp6Parameters"), Eq(bound = "P: Fp6Parameters") diff --git a/fields/src/fp_256.rs b/fields/src/fp_256.rs index 15af78a1e1..2b94c0af30 100644 --- a/fields/src/fp_256.rs +++ b/fields/src/fp_256.rs @@ -47,16 +47,9 @@ use zeroize::Zeroize; pub trait Fp256Parameters: FieldParameters {} -#[derive(Derivative, Zeroize)] -#[derivative( - Default(bound = ""), - Hash(bound = ""), - Clone(bound = ""), - Copy(bound = ""), - PartialEq(bound = ""), - Eq(bound = "") -)] -pub struct Fp256

( +#[derive(Derivative, Copy, Clone, Zeroize)] +#[derivative(Default(bound = ""), Hash(bound = ""), PartialEq(bound = ""), Eq(bound = ""))] +pub struct Fp256( pub BigInteger, #[derivative(Debug = "ignore")] #[doc(hidden)] diff --git a/fields/src/fp_384.rs b/fields/src/fp_384.rs index 596ef055c2..e665b88a99 100644 --- a/fields/src/fp_384.rs +++ b/fields/src/fp_384.rs @@ -47,12 +47,10 @@ use zeroize::Zeroize; pub trait Fp384Parameters: FieldParameters {} -#[derive(Derivative, Zeroize)] +#[derive(Derivative, Copy, Clone, Zeroize)] #[derivative( Default(bound = "P: Fp384Parameters"), Hash(bound = "P: Fp384Parameters"), - Clone(bound = "P: Fp384Parameters"), - Copy(bound = "P: Fp384Parameters"), PartialEq(bound = "P: Fp384Parameters"), Eq(bound = "P: Fp384Parameters") )] diff --git a/fields/src/traits/field_parameters.rs b/fields/src/traits/field_parameters.rs index 280b72f124..ea329e36b3 100644 --- a/fields/src/traits/field_parameters.rs +++ b/fields/src/traits/field_parameters.rs @@ -15,7 +15,7 @@ use crate::traits::{FftParameters, PoseidonDefaultParameters}; /// A trait that defines parameters for a prime field. -pub trait FieldParameters: 'static + FftParameters + PoseidonDefaultParameters { +pub trait FieldParameters: 'static + Copy + FftParameters + PoseidonDefaultParameters { /// The modulus of the field. const MODULUS: Self::BigInteger; diff --git a/ledger/block/src/lib.rs b/ledger/block/src/lib.rs index ff495b2ade..3ed988a423 100644 --- a/ledger/block/src/lib.rs +++ b/ledger/block/src/lib.rs @@ -636,7 +636,7 @@ pub mod test_helpers { // Prepare the confirmed transaction. let confirmed = ConfirmedTransaction::accepted_execute(0, transaction.clone(), vec![]).unwrap(); // Prepare the transactions. - let transactions = Transactions::from_iter([confirmed].into_iter()); + let transactions = Transactions::from_iter([confirmed]); // Construct the ratifications. let ratifications = Ratifications::try_from(vec![]).unwrap(); diff --git a/ledger/store/src/helpers/memory/internal/map.rs b/ledger/store/src/helpers/memory/internal/map.rs index 6c0e838db0..211d7e11a1 100644 --- a/ledger/store/src/helpers/memory/internal/map.rs +++ b/ledger/store/src/helpers/memory/internal/map.rs @@ -194,7 +194,7 @@ impl< let operations = core::mem::take(&mut *self.atomic_batch.lock()); // Insert the operations into an index map to remove any operations that would have been overwritten anyways. - let operations: IndexMap<_, _> = IndexMap::from_iter(operations.into_iter()); + let operations: IndexMap<_, _> = IndexMap::from_iter(operations); if !operations.is_empty() { // Acquire a write lock on the map. @@ -321,7 +321,7 @@ impl< /// Returns an iterator visiting each key-value pair in the atomic batch. /// fn iter_pending(&'a self) -> Self::PendingIterator { - let filtered_atomic_batch: IndexMap<_, _> = IndexMap::from_iter(self.atomic_batch.lock().clone().into_iter()); + let filtered_atomic_batch: IndexMap<_, _> = IndexMap::from_iter(self.atomic_batch.lock().clone()); filtered_atomic_batch.into_iter().map(|(k, v)| (Cow::Owned(k), v.map(|v| Cow::Owned(v)))) } diff --git a/ledger/store/src/helpers/rocksdb/internal/map.rs b/ledger/store/src/helpers/rocksdb/internal/map.rs index 2dc677ad07..105d220121 100644 --- a/ledger/store/src/helpers/rocksdb/internal/map.rs +++ b/ledger/store/src/helpers/rocksdb/internal/map.rs @@ -177,7 +177,7 @@ impl< if !operations.is_empty() { // Insert the operations into an index map to remove any operations that would have been overwritten anyways. - let operations: IndexMap<_, _> = IndexMap::from_iter(operations.into_iter()); + let operations: IndexMap<_, _> = IndexMap::from_iter(operations); // Prepare the key and value for each queued operation. // @@ -346,7 +346,7 @@ impl< /// Returns an iterator visiting each key-value pair in the atomic batch. /// fn iter_pending(&'a self) -> Self::PendingIterator { - let filtered_atomic_batch: IndexMap<_, _> = IndexMap::from_iter(self.atomic_batch.lock().clone().into_iter()); + let filtered_atomic_batch: IndexMap<_, _> = IndexMap::from_iter(self.atomic_batch.lock().clone()); filtered_atomic_batch.into_iter().map(|(k, v)| (Cow::Owned(k), v.map(|v| Cow::Owned(v)))) } diff --git a/ledger/test-helpers/src/lib.rs b/ledger/test-helpers/src/lib.rs index 813fb8cb0b..eac0196063 100644 --- a/ledger/test-helpers/src/lib.rs +++ b/ledger/test-helpers/src/lib.rs @@ -413,7 +413,7 @@ fn sample_genesis_block_and_components_raw( // Prepare the confirmed transaction. let confirmed = ConfirmedTransaction::accepted_execute(0, transaction.clone(), vec![]).unwrap(); // Prepare the transactions. - let transactions = Transactions::from_iter([confirmed].into_iter()); + let transactions = Transactions::from_iter([confirmed]); // Construct the ratifications. let ratifications = Ratifications::try_from(vec![]).unwrap(); diff --git a/rust-toolchain b/rust-toolchain index 7c7053aa23..0834888f55 100644 --- a/rust-toolchain +++ b/rust-toolchain @@ -1 +1 @@ -1.75.0 +1.72.0 From 894417cd75ddf8bf0c805ff2bdbf5ac196223af4 Mon Sep 17 00:00:00 2001 From: Howard Wu <9260812+howardwu@users.noreply.github.com> Date: Sat, 20 Jan 2024 12:58:44 -0800 Subject: [PATCH 190/298] clippy into_iter removals --- algorithms/src/fft/polynomial/sparse.rs | 2 +- .../src/snark/varuna/ahp/prover/oracles.rs | 2 +- circuit/program/src/data/plaintext/mod.rs | 329 ++++++++---------- console/program/src/data/plaintext/mod.rs | 140 ++++---- console/program/src/data/record/decrypt.rs | 11 +- console/program/src/data/record/is_owner.rs | 11 +- console/types/address/src/from_bits.rs | 2 +- console/types/boolean/src/from_bits.rs | 2 +- console/types/field/src/from_bits.rs | 2 +- console/types/group/src/from_bits.rs | 2 +- console/types/integers/src/from_bits.rs | 2 +- console/types/scalar/src/from_bits.rs | 2 +- ledger/block/src/ratifications/mod.rs | 2 +- ledger/src/tests.rs | 6 +- ledger/store/src/helpers/mod.rs | 1 + 15 files changed, 226 insertions(+), 290 deletions(-) diff --git a/algorithms/src/fft/polynomial/sparse.rs b/algorithms/src/fft/polynomial/sparse.rs index f38967f99f..16e397e357 100644 --- a/algorithms/src/fft/polynomial/sparse.rs +++ b/algorithms/src/fft/polynomial/sparse.rs @@ -105,7 +105,7 @@ impl SparsePolynomial { *cur_coeff += *self_coeff * other_coeff; } } - SparsePolynomial::from_coefficients(result.into_iter()) + SparsePolynomial::from_coefficients(result) } } } diff --git a/algorithms/src/snark/varuna/ahp/prover/oracles.rs b/algorithms/src/snark/varuna/ahp/prover/oracles.rs index 725b6a291d..37b1c94728 100644 --- a/algorithms/src/snark/varuna/ahp/prover/oracles.rs +++ b/algorithms/src/snark/varuna/ahp/prover/oracles.rs @@ -37,7 +37,7 @@ impl FirstOracles { /// Iterate over the polynomials output by the prover in the first round. pub fn into_iter(self) -> impl Iterator> { - self.batches.into_values().flat_map(|b| b.into_iter()).map(|b| b.0).chain(self.mask_poly.into_iter()) + self.batches.into_values().flat_map(|b| b.into_iter()).map(|b| b.0).chain(self.mask_poly) } pub fn matches_info(&self, info: &BTreeMap) -> bool { diff --git a/circuit/program/src/data/plaintext/mod.rs b/circuit/program/src/data/plaintext/mod.rs index efe8c8eaca..8f717c34ea 100644 --- a/circuit/program/src/data/plaintext/mod.rs +++ b/circuit/program/src/data/plaintext/mod.rs @@ -132,144 +132,117 @@ mod tests { // Test a random struct with literal members. run_test(Plaintext::::Struct( - IndexMap::from_iter( - vec![ - ( - Identifier::new(Mode::Private, "a".try_into()?), - Plaintext::::Literal( - Literal::Boolean(Boolean::new(Mode::Private, true)), - OnceCell::new(), - ), - ), - ( - Identifier::new(Mode::Private, "b".try_into()?), - Plaintext::::Literal( - Literal::Field(Field::new(Mode::Private, Uniform::rand(&mut rng))), - OnceCell::new(), - ), + IndexMap::from_iter(vec![ + ( + Identifier::new(Mode::Private, "a".try_into()?), + Plaintext::::Literal(Literal::Boolean(Boolean::new(Mode::Private, true)), OnceCell::new()), + ), + ( + Identifier::new(Mode::Private, "b".try_into()?), + Plaintext::::Literal( + Literal::Field(Field::new(Mode::Private, Uniform::rand(&mut rng))), + OnceCell::new(), ), - ] - .into_iter(), - ), + ), + ]), OnceCell::new(), )); // Test a random struct with array members. run_test(Plaintext::::Struct( - IndexMap::from_iter( - vec![ - ( - Identifier::new(Mode::Private, "a".try_into()?), - Plaintext::::Literal( - Literal::Boolean(Boolean::new(Mode::Private, true)), - OnceCell::new(), - ), + IndexMap::from_iter(vec![ + ( + Identifier::new(Mode::Private, "a".try_into()?), + Plaintext::::Literal(Literal::Boolean(Boolean::new(Mode::Private, true)), OnceCell::new()), + ), + ( + Identifier::new(Mode::Private, "b".try_into()?), + Plaintext::::Array( + vec![ + Plaintext::::Literal( + Literal::Boolean(Boolean::new(Mode::Private, true)), + OnceCell::new(), + ), + Plaintext::::Literal( + Literal::Boolean(Boolean::new(Mode::Private, false)), + OnceCell::new(), + ), + ], + OnceCell::new(), ), - ( - Identifier::new(Mode::Private, "b".try_into()?), - Plaintext::::Array( - vec![ + ), + ]), + OnceCell::new(), + )); + + // Test random deeply-nested struct. + run_test(Plaintext::::Struct( + IndexMap::from_iter(vec![ + ( + Identifier::new(Mode::Private, "a".try_into()?), + Plaintext::::Literal(Literal::Boolean(Boolean::new(Mode::Private, true)), OnceCell::new()), + ), + ( + Identifier::new(Mode::Private, "b".try_into()?), + Plaintext::::Struct( + IndexMap::from_iter(vec![ + ( + Identifier::new(Mode::Private, "c".try_into()?), Plaintext::::Literal( Literal::Boolean(Boolean::new(Mode::Private, true)), OnceCell::new(), ), - Plaintext::::Literal( - Literal::Boolean(Boolean::new(Mode::Private, false)), + ), + ( + Identifier::new(Mode::Private, "d".try_into()?), + Plaintext::::Struct( + IndexMap::from_iter(vec![ + ( + Identifier::new(Mode::Private, "e".try_into()?), + Plaintext::::Literal( + Literal::Boolean(Boolean::new(Mode::Private, true)), + OnceCell::new(), + ), + ), + ( + Identifier::new(Mode::Private, "f".try_into()?), + Plaintext::::Literal( + Literal::Field(Field::new(Mode::Private, Uniform::rand(&mut rng))), + OnceCell::new(), + ), + ), + ]), OnceCell::new(), ), - ], - OnceCell::new(), - ), - ), - ] - .into_iter(), - ), - OnceCell::new(), - )); - - // Test random deeply-nested struct. - run_test(Plaintext::::Struct( - IndexMap::from_iter( - vec![ - ( - Identifier::new(Mode::Private, "a".try_into()?), - Plaintext::::Literal( - Literal::Boolean(Boolean::new(Mode::Private, true)), - OnceCell::new(), - ), - ), - ( - Identifier::new(Mode::Private, "b".try_into()?), - Plaintext::::Struct( - IndexMap::from_iter( - vec![ - ( - Identifier::new(Mode::Private, "c".try_into()?), + ), + ( + Identifier::new(Mode::Private, "g".try_into()?), + Plaintext::::Array( + vec![ Plaintext::::Literal( Literal::Boolean(Boolean::new(Mode::Private, true)), OnceCell::new(), ), - ), - ( - Identifier::new(Mode::Private, "d".try_into()?), - Plaintext::::Struct( - IndexMap::from_iter( - vec![ - ( - Identifier::new(Mode::Private, "e".try_into()?), - Plaintext::::Literal( - Literal::Boolean(Boolean::new(Mode::Private, true)), - OnceCell::new(), - ), - ), - ( - Identifier::new(Mode::Private, "f".try_into()?), - Plaintext::::Literal( - Literal::Field(Field::new( - Mode::Private, - Uniform::rand(&mut rng), - )), - OnceCell::new(), - ), - ), - ] - .into_iter(), - ), - OnceCell::new(), - ), - ), - ( - Identifier::new(Mode::Private, "g".try_into()?), - Plaintext::::Array( - vec![ - Plaintext::::Literal( - Literal::Boolean(Boolean::new(Mode::Private, true)), - OnceCell::new(), - ), - Plaintext::::Literal( - Literal::Boolean(Boolean::new(Mode::Private, false)), - OnceCell::new(), - ), - ], + Plaintext::::Literal( + Literal::Boolean(Boolean::new(Mode::Private, false)), OnceCell::new(), ), - ), - ] - .into_iter(), + ], + OnceCell::new(), + ), ), - OnceCell::new(), - ), + ]), + OnceCell::new(), ), - ( - Identifier::new(Mode::Private, "h".try_into()?), - Plaintext::::Literal( - Literal::Field(Field::new(Mode::Private, Uniform::rand(&mut rng))), - OnceCell::new(), - ), + ), + ( + Identifier::new(Mode::Private, "h".try_into()?), + Plaintext::::Literal( + Literal::Field(Field::new(Mode::Private, Uniform::rand(&mut rng))), + OnceCell::new(), ), - ] - .into_iter(), - ), + ), + ]), OnceCell::new(), )); @@ -304,69 +277,60 @@ mod tests { run_test(Plaintext::::Array( vec![ Plaintext::::Struct( - IndexMap::from_iter( - vec![ - ( - Identifier::new(Mode::Private, "x".try_into()?), - Plaintext::::Literal( - Literal::Field(Field::new(Mode::Private, Uniform::rand(&mut rng))), - OnceCell::new(), - ), + IndexMap::from_iter(vec![ + ( + Identifier::new(Mode::Private, "x".try_into()?), + Plaintext::::Literal( + Literal::Field(Field::new(Mode::Private, Uniform::rand(&mut rng))), + OnceCell::new(), ), - ( - Identifier::new(Mode::Private, "y".try_into()?), - Plaintext::::Literal( - Literal::Field(Field::new(Mode::Private, Uniform::rand(&mut rng))), - OnceCell::new(), - ), + ), + ( + Identifier::new(Mode::Private, "y".try_into()?), + Plaintext::::Literal( + Literal::Field(Field::new(Mode::Private, Uniform::rand(&mut rng))), + OnceCell::new(), ), - ] - .into_iter(), - ), + ), + ]), OnceCell::new(), ), Plaintext::::Struct( - IndexMap::from_iter( - vec![ - ( - Identifier::new(Mode::Private, "x".try_into()?), - Plaintext::::Literal( - Literal::Field(Field::new(Mode::Private, Uniform::rand(&mut rng))), - OnceCell::new(), - ), + IndexMap::from_iter(vec![ + ( + Identifier::new(Mode::Private, "x".try_into()?), + Plaintext::::Literal( + Literal::Field(Field::new(Mode::Private, Uniform::rand(&mut rng))), + OnceCell::new(), ), - ( - Identifier::new(Mode::Private, "y".try_into()?), - Plaintext::::Literal( - Literal::Field(Field::new(Mode::Private, Uniform::rand(&mut rng))), - OnceCell::new(), - ), + ), + ( + Identifier::new(Mode::Private, "y".try_into()?), + Plaintext::::Literal( + Literal::Field(Field::new(Mode::Private, Uniform::rand(&mut rng))), + OnceCell::new(), ), - ] - .into_iter(), - ), + ), + ]), OnceCell::new(), ), Plaintext::::Struct( - IndexMap::from_iter( - vec![ - ( - Identifier::new(Mode::Private, "x".try_into()?), - Plaintext::::Literal( - Literal::Field(Field::new(Mode::Private, Uniform::rand(&mut rng))), - OnceCell::new(), - ), + IndexMap::from_iter(vec![ + ( + Identifier::new(Mode::Private, "x".try_into()?), + Plaintext::::Literal( + Literal::Field(Field::new(Mode::Private, Uniform::rand(&mut rng))), + OnceCell::new(), ), - ( - Identifier::new(Mode::Private, "y".try_into()?), - Plaintext::::Literal( - Literal::Field(Field::new(Mode::Private, Uniform::rand(&mut rng))), - OnceCell::new(), - ), + ), + ( + Identifier::new(Mode::Private, "y".try_into()?), + Plaintext::::Literal( + Literal::Field(Field::new(Mode::Private, Uniform::rand(&mut rng))), + OnceCell::new(), ), - ] - .into_iter(), - ), + ), + ]), OnceCell::new(), ), ], @@ -382,25 +346,22 @@ mod tests { OnceCell::new(), ), Plaintext::::Struct( - IndexMap::from_iter( - vec![ - ( - Identifier::new(Mode::Private, "x".try_into()?), - Plaintext::::Literal( - Literal::Field(Field::new(Mode::Private, Uniform::rand(&mut rng))), - OnceCell::new(), - ), + IndexMap::from_iter(vec![ + ( + Identifier::new(Mode::Private, "x".try_into()?), + Plaintext::::Literal( + Literal::Field(Field::new(Mode::Private, Uniform::rand(&mut rng))), + OnceCell::new(), ), - ( - Identifier::new(Mode::Private, "y".try_into()?), - Plaintext::::Literal( - Literal::Field(Field::new(Mode::Private, Uniform::rand(&mut rng))), - OnceCell::new(), - ), + ), + ( + Identifier::new(Mode::Private, "y".try_into()?), + Plaintext::::Literal( + Literal::Field(Field::new(Mode::Private, Uniform::rand(&mut rng))), + OnceCell::new(), ), - ] - .into_iter(), - ), + ), + ]), OnceCell::new(), ), ], diff --git a/console/program/src/data/plaintext/mod.rs b/console/program/src/data/plaintext/mod.rs index be300e0a8c..aea42f16b9 100644 --- a/console/program/src/data/plaintext/mod.rs +++ b/console/program/src/data/plaintext/mod.rs @@ -93,102 +93,84 @@ mod tests { // Test a random struct with literal members. run_test(Plaintext::::Struct( - IndexMap::from_iter( - vec![ - (Identifier::from_str("a")?, Plaintext::::from_str("true")?), - ( - Identifier::from_str("b")?, - Plaintext::::Literal( - Literal::Field(Field::new(Uniform::rand(&mut rng))), - OnceCell::new(), - ), + IndexMap::from_iter(vec![ + (Identifier::from_str("a")?, Plaintext::::from_str("true")?), + ( + Identifier::from_str("b")?, + Plaintext::::Literal( + Literal::Field(Field::new(Uniform::rand(&mut rng))), + OnceCell::new(), ), - ] - .into_iter(), - ), + ), + ]), OnceCell::new(), )); // Test a random struct with array members. run_test(Plaintext::::Struct( - IndexMap::from_iter( - vec![ - (Identifier::from_str("a")?, Plaintext::::from_str("true")?), - ( - Identifier::from_str("b")?, - Plaintext::::Array( - vec![ - Plaintext::::from_str("true")?, - Plaintext::::from_str("false")?, - ], - OnceCell::new(), - ), + IndexMap::from_iter(vec![ + (Identifier::from_str("a")?, Plaintext::::from_str("true")?), + ( + Identifier::from_str("b")?, + Plaintext::::Array( + vec![ + Plaintext::::from_str("true")?, + Plaintext::::from_str("false")?, + ], + OnceCell::new(), ), - ] - .into_iter(), - ), + ), + ]), OnceCell::new(), )); // Test random deeply-nested struct. run_test(Plaintext::::Struct( - IndexMap::from_iter( - vec![ - (Identifier::from_str("a")?, Plaintext::::from_str("true")?), - ( - Identifier::from_str("b")?, - Plaintext::::Struct( - IndexMap::from_iter( - vec![ - (Identifier::from_str("c")?, Plaintext::::from_str("true")?), - ( - Identifier::from_str("d")?, - Plaintext::::Struct( - IndexMap::from_iter( - vec![ - ( - Identifier::from_str("e")?, - Plaintext::::from_str("true")?, - ), - ( - Identifier::from_str("f")?, - Plaintext::::Literal( - Literal::Field(Field::new(Uniform::rand(&mut rng))), - OnceCell::new(), - ), - ), - ] - .into_iter(), + IndexMap::from_iter(vec![ + (Identifier::from_str("a")?, Plaintext::::from_str("true")?), + ( + Identifier::from_str("b")?, + Plaintext::::Struct( + IndexMap::from_iter(vec![ + (Identifier::from_str("c")?, Plaintext::::from_str("true")?), + ( + Identifier::from_str("d")?, + Plaintext::::Struct( + IndexMap::from_iter(vec![ + (Identifier::from_str("e")?, Plaintext::::from_str("true")?), + ( + Identifier::from_str("f")?, + Plaintext::::Literal( + Literal::Field(Field::new(Uniform::rand(&mut rng))), + OnceCell::new(), ), - OnceCell::new(), ), - ), - ( - Identifier::from_str("g")?, - Plaintext::Array( - vec![ - Plaintext::::from_str("true")?, - Plaintext::::from_str("false")?, - ], - OnceCell::new(), - ), - ), - ] - .into_iter(), + ]), + OnceCell::new(), + ), + ), + ( + Identifier::from_str("g")?, + Plaintext::Array( + vec![ + Plaintext::::from_str("true")?, + Plaintext::::from_str("false")?, + ], + OnceCell::new(), + ), ), - OnceCell::new(), - ), + ]), + OnceCell::new(), ), - ( - Identifier::from_str("h")?, - Plaintext::::Literal( - Literal::Field(Field::new(Uniform::rand(&mut rng))), - OnceCell::new(), - ), + ), + ( + Identifier::from_str("h")?, + Plaintext::::Literal( + Literal::Field(Field::new(Uniform::rand(&mut rng))), + OnceCell::new(), ), - ] - .into_iter(), - ), + ), + ]), OnceCell::new(), )); diff --git a/console/program/src/data/record/decrypt.rs b/console/program/src/data/record/decrypt.rs index 4e9d5d15b2..31fb963db2 100644 --- a/console/program/src/data/record/decrypt.rs +++ b/console/program/src/data/record/decrypt.rs @@ -112,13 +112,10 @@ mod tests { let randomizer = Scalar::rand(rng); let record = Record { owner, - data: IndexMap::from_iter( - vec![ - (Identifier::from_str("a")?, Entry::Private(Plaintext::from(Literal::Field(Field::rand(rng))))), - (Identifier::from_str("b")?, Entry::Private(Plaintext::from(Literal::Scalar(Scalar::rand(rng))))), - ] - .into_iter(), - ), + data: IndexMap::from_iter(vec![ + (Identifier::from_str("a")?, Entry::Private(Plaintext::from(Literal::Field(Field::rand(rng))))), + (Identifier::from_str("b")?, Entry::Private(Plaintext::from(Literal::Scalar(Scalar::rand(rng))))), + ]), nonce: N::g_scalar_multiply(&randomizer), }; // Encrypt the record. diff --git a/console/program/src/data/record/is_owner.rs b/console/program/src/data/record/is_owner.rs index 6ef8ef6dd2..54df9c6958 100644 --- a/console/program/src/data/record/is_owner.rs +++ b/console/program/src/data/record/is_owner.rs @@ -78,13 +78,10 @@ mod tests { let randomizer = Scalar::rand(rng); let record = Record { owner, - data: IndexMap::from_iter( - vec![ - (Identifier::from_str("a")?, Entry::Private(Plaintext::from(Literal::Field(Field::rand(rng))))), - (Identifier::from_str("b")?, Entry::Private(Plaintext::from(Literal::Scalar(Scalar::rand(rng))))), - ] - .into_iter(), - ), + data: IndexMap::from_iter(vec![ + (Identifier::from_str("a")?, Entry::Private(Plaintext::from(Literal::Field(Field::rand(rng))))), + (Identifier::from_str("b")?, Entry::Private(Plaintext::from(Literal::Scalar(Scalar::rand(rng))))), + ]), nonce: N::g_scalar_multiply(&randomizer), }; diff --git a/console/types/address/src/from_bits.rs b/console/types/address/src/from_bits.rs index 27c97c1145..f344d1252c 100644 --- a/console/types/address/src/from_bits.rs +++ b/console/types/address/src/from_bits.rs @@ -72,7 +72,7 @@ mod tests { assert_eq!(expected, candidate); // Add excess zero bits. - let candidate = vec![vec![false; i], given_bits].concat(); + let candidate = [vec![false; i], given_bits].concat(); let candidate = Address::::from_bits_be(&candidate)?; assert_eq!(expected, candidate); diff --git a/console/types/boolean/src/from_bits.rs b/console/types/boolean/src/from_bits.rs index 4871da2ab3..173572f188 100644 --- a/console/types/boolean/src/from_bits.rs +++ b/console/types/boolean/src/from_bits.rs @@ -73,7 +73,7 @@ mod tests { assert_eq!(expected, candidate); // Add excess zero bits. - let candidate = vec![vec![false; i], given_bits].concat(); + let candidate = [vec![false; i], given_bits].concat(); assert!(Boolean::::from_bits_be(&candidate).is_err()); } Ok(()) diff --git a/console/types/field/src/from_bits.rs b/console/types/field/src/from_bits.rs index 9356d0ab32..ad79a3685e 100644 --- a/console/types/field/src/from_bits.rs +++ b/console/types/field/src/from_bits.rs @@ -115,7 +115,7 @@ mod tests { assert_eq!(expected, candidate); // Add excess zero bits. - let candidate = vec![vec![false; i], given_bits].concat(); + let candidate = [vec![false; i], given_bits].concat(); let candidate = Field::::from_bits_be(&candidate)?; assert_eq!(expected, candidate); diff --git a/console/types/group/src/from_bits.rs b/console/types/group/src/from_bits.rs index 8a7682b144..d5c9188d54 100644 --- a/console/types/group/src/from_bits.rs +++ b/console/types/group/src/from_bits.rs @@ -70,7 +70,7 @@ mod tests { assert_eq!(expected, candidate); // Add excess zero bits. - let candidate = vec![vec![false; i], given_bits].concat(); + let candidate = [vec![false; i], given_bits].concat(); let candidate = Group::::from_bits_be(&candidate)?; assert_eq!(expected, candidate); diff --git a/console/types/integers/src/from_bits.rs b/console/types/integers/src/from_bits.rs index 2820a5d8dc..87290176de 100644 --- a/console/types/integers/src/from_bits.rs +++ b/console/types/integers/src/from_bits.rs @@ -70,7 +70,7 @@ mod tests { assert_eq!(expected, candidate); // Add excess zero bits. - let candidate = vec![vec![false; i], given_bits].concat(); + let candidate = [vec![false; i], given_bits].concat(); let candidate = Integer::::from_bits_be(&candidate)?; assert_eq!(expected, candidate); diff --git a/console/types/scalar/src/from_bits.rs b/console/types/scalar/src/from_bits.rs index a45fdf406f..4f9a123bfb 100644 --- a/console/types/scalar/src/from_bits.rs +++ b/console/types/scalar/src/from_bits.rs @@ -118,7 +118,7 @@ mod tests { assert_eq!(expected, candidate); // Add excess zero bits. - let candidate = vec![vec![false; i], given_bits].concat(); + let candidate = [vec![false; i], given_bits].concat(); let candidate = Scalar::::from_bits_be(&candidate)?; assert_eq!(expected, candidate); diff --git a/ledger/block/src/ratifications/mod.rs b/ledger/block/src/ratifications/mod.rs index 884c09d6f6..bb11fe0951 100644 --- a/ledger/block/src/ratifications/mod.rs +++ b/ledger/block/src/ratifications/mod.rs @@ -51,7 +51,7 @@ impl TryFrom>> for Ratifications { /// Initializes from a given ratifications list. fn try_from(ratifications: Vec>) -> Result { - Self::try_from_iter(ratifications.into_iter()) + Self::try_from_iter(ratifications) } } diff --git a/ledger/src/tests.rs b/ledger/src/tests.rs index 3c5777aadd..bab028b9fd 100644 --- a/ledger/src/tests.rs +++ b/ledger/src/tests.rs @@ -111,8 +111,7 @@ fn test_insufficient_private_fees() { { // Prepare a `split` execution without a fee. let inputs = [Value::Record(record_1.clone()), Value::from_str("100u64").unwrap()]; - let authorization = - ledger.vm.authorize(&private_key, "credits.aleo", "split", inputs.into_iter(), rng).unwrap(); + let authorization = ledger.vm.authorize(&private_key, "credits.aleo", "split", inputs, rng).unwrap(); let split_transaction_without_fee = ledger.vm.execute_authorization(authorization, None, None, rng).unwrap(); assert!(ledger.check_transaction_basic(&split_transaction_without_fee, None, rng).is_ok()); } @@ -125,8 +124,7 @@ fn test_insufficient_private_fees() { Value::from_str(&format!("{address}")).unwrap(), Value::from_str("100u64").unwrap(), ]; - let authorization = - ledger.vm.authorize(&private_key, "credits.aleo", "transfer_private", inputs.into_iter(), rng).unwrap(); + let authorization = ledger.vm.authorize(&private_key, "credits.aleo", "transfer_private", inputs, rng).unwrap(); let transaction_without_fee = ledger.vm.execute_authorization(authorization, None, None, rng).unwrap(); let execution = transaction_without_fee.execution().unwrap(); diff --git a/ledger/store/src/helpers/mod.rs b/ledger/store/src/helpers/mod.rs index 994fe0638f..deb8926700 100644 --- a/ledger/store/src/helpers/mod.rs +++ b/ledger/store/src/helpers/mod.rs @@ -85,6 +85,7 @@ macro_rules! atomic_finalize { // // Wrap the operations that should be batched in a closure to be able to abort the entire // write batch if any of them fails. + #[allow(clippy::redundant_closure_call)] match ($finalize_mode, || -> Result<_, String> { $ops }()) { // If this is a successful real run, commit the atomic batch. (FinalizeMode::RealRun, Ok(result)) => { From 705fa3f34dce94fa5b0b4920b8d3364e884caf77 Mon Sep 17 00:00:00 2001 From: Howard Wu <9260812+howardwu@users.noreply.github.com> Date: Sat, 20 Jan 2024 13:07:54 -0800 Subject: [PATCH 191/298] clippy into_iter removals --- algorithms/src/polycommit/test_templates.rs | 4 +-- .../src/snark/varuna/ahp/verifier/messages.rs | 6 +---- algorithms/src/snark/varuna/varuna.rs | 2 +- circuit/program/src/data/record/decrypt.rs | 26 +++++++------------ .../src/data_types/record_type/parse.rs | 7 ++--- .../src/data_types/struct_type/parse.rs | 11 +++----- ledger/narwhal/batch-certificate/src/lib.rs | 3 +-- 7 files changed, 23 insertions(+), 36 deletions(-) diff --git a/algorithms/src/polycommit/test_templates.rs b/algorithms/src/polycommit/test_templates.rs index 5664111254..60f73f027f 100644 --- a/algorithms/src/polycommit/test_templates.rs +++ b/algorithms/src/polycommit/test_templates.rs @@ -263,7 +263,7 @@ where let max_degree = max_degree.unwrap_or_else(|| distributions::Uniform::from(8..=64).sample(rng)); let pp = SonicKZG10::::load_srs(max_degree)?; let universal_prover = &pp.to_universal_prover().unwrap(); - let supported_degree_bounds = vec![1 << 10, 1 << 15, 1 << 20, 1 << 25, 1 << 30]; + let supported_degree_bounds = [1 << 10, 1 << 15, 1 << 20, 1 << 25, 1 << 30]; for _ in 0..num_iters { let supported_degree = @@ -391,7 +391,7 @@ fn equation_test_template>( let max_degree = max_degree.unwrap_or_else(|| distributions::Uniform::from(8..=64).sample(rng)); let pp = SonicKZG10::::load_srs(max_degree)?; let universal_prover = &pp.to_universal_prover().unwrap(); - let supported_degree_bounds = vec![1 << 10, 1 << 15, 1 << 20, 1 << 25, 1 << 30]; + let supported_degree_bounds = [1 << 10, 1 << 15, 1 << 20, 1 << 25, 1 << 30]; for _ in 0..num_iters { let supported_degree = diff --git a/algorithms/src/snark/varuna/ahp/verifier/messages.rs b/algorithms/src/snark/varuna/ahp/verifier/messages.rs index b939a86c74..1abd254d6d 100644 --- a/algorithms/src/snark/varuna/ahp/verifier/messages.rs +++ b/algorithms/src/snark/varuna/ahp/verifier/messages.rs @@ -62,11 +62,7 @@ pub struct FourthMessage { impl FourthMessage { pub fn into_iter(self) -> impl Iterator { - self.delta_a - .into_iter() - .zip_eq(self.delta_b.into_iter()) - .zip_eq(self.delta_c.into_iter()) - .flat_map(|((r_a, r_b), r_c)| [r_a, r_b, r_c]) + self.delta_a.into_iter().zip_eq(self.delta_b).zip_eq(self.delta_c).flat_map(|((r_a, r_b), r_c)| [r_a, r_b, r_c]) } } diff --git a/algorithms/src/snark/varuna/varuna.rs b/algorithms/src/snark/varuna/varuna.rs index df01ee4425..b4fb57a534 100644 --- a/algorithms/src/snark/varuna/varuna.rs +++ b/algorithms/src/snark/varuna/varuna.rs @@ -302,7 +302,7 @@ where // (since the first coeff is 1), and so we squeeze out `num_polynomials` points. let mut challenges = sponge.squeeze_nonnative_field_elements(verifying_key.circuit_commitments.len()); let point = challenges.pop().ok_or(anyhow!("Failed to squeeze random element"))?; - let combiners = core::iter::once(E::Fr::one()).chain(challenges.into_iter()); + let combiners = core::iter::once(E::Fr::one()).chain(challenges); // We will construct a linear combination and provide a proof of evaluation of the lc at `point`. let (lc, evaluation) = diff --git a/circuit/program/src/data/record/decrypt.rs b/circuit/program/src/data/record/decrypt.rs index 4be3944a2f..b7f9d1a0bd 100644 --- a/circuit/program/src/data/record/decrypt.rs +++ b/circuit/program/src/data/record/decrypt.rs @@ -102,22 +102,16 @@ mod tests { let randomizer = Scalar::new(Mode::Private, Uniform::rand(rng)); let record = Record { owner, - data: IndexMap::from_iter( - vec![ - ( - Identifier::from_str("a")?, - Entry::Private(Plaintext::from(Literal::Field(Field::new(Mode::Private, Uniform::rand(rng))))), - ), - ( - Identifier::from_str("b")?, - Entry::Private(Plaintext::from(Literal::Scalar(Scalar::new( - Mode::Private, - Uniform::rand(rng), - )))), - ), - ] - .into_iter(), - ), + data: IndexMap::from_iter(vec![ + ( + Identifier::from_str("a")?, + Entry::Private(Plaintext::from(Literal::Field(Field::new(Mode::Private, Uniform::rand(rng))))), + ), + ( + Identifier::from_str("b")?, + Entry::Private(Plaintext::from(Literal::Scalar(Scalar::new(Mode::Private, Uniform::rand(rng))))), + ), + ]), nonce: A::g_scalar_multiply(&randomizer), }; diff --git a/console/program/src/data_types/record_type/parse.rs b/console/program/src/data_types/record_type/parse.rs index b6c6aa561c..fae51218c2 100644 --- a/console/program/src/data_types/record_type/parse.rs +++ b/console/program/src/data_types/record_type/parse.rs @@ -143,9 +143,10 @@ mod tests { let expected = RecordType:: { name: Identifier::from_str("message")?, owner: PublicOrPrivate::Private, - entries: IndexMap::from_iter( - vec![(Identifier::from_str("first")?, EntryType::from_str("field.constant")?)].into_iter(), - ), + entries: IndexMap::from_iter(vec![( + Identifier::from_str("first")?, + EntryType::from_str("field.constant")?, + )]), }; let (remainder, candidate) = RecordType::::parse( diff --git a/console/program/src/data_types/struct_type/parse.rs b/console/program/src/data_types/struct_type/parse.rs index a19d81400f..1b606a749f 100644 --- a/console/program/src/data_types/struct_type/parse.rs +++ b/console/program/src/data_types/struct_type/parse.rs @@ -122,13 +122,10 @@ mod tests { fn test_parse() -> Result<()> { let expected = StructType:: { name: Identifier::from_str("message")?, - members: IndexMap::from_iter( - vec![ - (Identifier::from_str("sender")?, PlaintextType::from_str("address")?), - (Identifier::from_str("amount")?, PlaintextType::from_str("u64")?), - ] - .into_iter(), - ), + members: IndexMap::from_iter(vec![ + (Identifier::from_str("sender")?, PlaintextType::from_str("address")?), + (Identifier::from_str("amount")?, PlaintextType::from_str("u64")?), + ]), }; let (remainder, candidate) = StructType::::parse( diff --git a/ledger/narwhal/batch-certificate/src/lib.rs b/ledger/narwhal/batch-certificate/src/lib.rs index 64ddc93470..9356b7dcf6 100644 --- a/ledger/narwhal/batch-certificate/src/lib.rs +++ b/ledger/narwhal/batch-certificate/src/lib.rs @@ -206,8 +206,7 @@ impl BatchCertificate { match self { Self::V1 { batch_header, signatures, .. } => { // Return the median timestamp. - let mut timestamps = - signatures.values().copied().chain([batch_header.timestamp()].into_iter()).collect::>(); + let mut timestamps = signatures.values().copied().chain([batch_header.timestamp()]).collect::>(); timestamps.sort_unstable(); timestamps[timestamps.len() / 2] } From 30e90523c206dee66dba2e0b655ced8103dcc89b Mon Sep 17 00:00:00 2001 From: Howard Wu <9260812+howardwu@users.noreply.github.com> Date: Sat, 20 Jan 2024 13:26:56 -0800 Subject: [PATCH 192/298] clippy shadow modules --- .rusty-hook.toml | 2 +- algorithms/src/snark/varuna/ahp/prover/mod.rs | 2 +- console/network/environment/src/lib.rs | 32 ++++++++++++++++++- console/network/environment/src/traits/mod.rs | 4 +-- console/types/integers/src/lib.rs | 2 +- 5 files changed, 36 insertions(+), 6 deletions(-) diff --git a/.rusty-hook.toml b/.rusty-hook.toml index c8bbf1f690..210316b294 100644 --- a/.rusty-hook.toml +++ b/.rusty-hook.toml @@ -1,5 +1,5 @@ [hooks] -pre-commit = "cargo clippy --workspace --all-targets --all-features && cargo +nightly fmt --all -- --check" +pre-commit = "cargo +nightly fmt --all -- --check && cargo clippy --workspace --all-targets --all-features" [logging] verbose = true diff --git a/algorithms/src/snark/varuna/ahp/prover/mod.rs b/algorithms/src/snark/varuna/ahp/prover/mod.rs index 9cb0f042bb..68adb3038c 100644 --- a/algorithms/src/snark/varuna/ahp/prover/mod.rs +++ b/algorithms/src/snark/varuna/ahp/prover/mod.rs @@ -26,4 +26,4 @@ pub(crate) use oracles::*; mod round_functions; mod state; -pub(self) use state::*; +use state::*; diff --git a/console/network/environment/src/lib.rs b/console/network/environment/src/lib.rs index bfd495d509..c7c54316ac 100644 --- a/console/network/environment/src/lib.rs +++ b/console/network/environment/src/lib.rs @@ -25,7 +25,37 @@ pub mod traits; pub use traits::*; pub mod prelude { - pub use crate::{environment::*, helpers::*, traits::*}; + pub use crate::{ + environment::*, + helpers::*, + traits::{ + algorithms::*, + arithmetic::*, + bitwise::*, + from_bits::*, + from_field::*, + parse::*, + parse_string::*, + to_bits_le, + to_field::*, + type_name::*, + types::{ + integer_magnitude::Magnitude, + integer_type::{ + CheckedPow, + CheckedShl, + IntegerProperties, + IntegerType, + WrappingDiv, + WrappingPow, + WrappingRem, + }, + *, + }, + visibility::*, + ToBits, + }, + }; pub use snarkvm_curves::{AffineCurve, MontgomeryParameters, ProjectiveCurve, TwistedEdwardsParameters}; pub use snarkvm_fields::{Field as _, PrimeField as _, SquareRootField as _, Zero as _}; diff --git a/console/network/environment/src/traits/mod.rs b/console/network/environment/src/traits/mod.rs index 7e03615c0d..aaeb41611f 100644 --- a/console/network/environment/src/traits/mod.rs +++ b/console/network/environment/src/traits/mod.rs @@ -12,6 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. +pub use snarkvm_utilities::{to_bits_le, ToBits}; + pub mod algorithms; pub use algorithms::*; @@ -33,8 +35,6 @@ pub use parse::*; pub mod parse_string; pub use parse_string::string_parser; -pub use snarkvm_utilities::{to_bits_le, ToBits}; - pub mod to_field; pub use to_field::*; diff --git a/console/types/integers/src/lib.rs b/console/types/integers/src/lib.rs index 2142ae50de..49e095d262 100644 --- a/console/types/integers/src/lib.rs +++ b/console/types/integers/src/lib.rs @@ -39,7 +39,7 @@ pub use snarkvm_console_network_environment::prelude::*; pub use snarkvm_console_types_boolean::Boolean; pub use snarkvm_console_types_field::Field; -use snarkvm_console_network_environment::traits::types::{integer_magnitude::Magnitude, integer_type::IntegerType}; +use snarkvm_console_network_environment::traits::{IntegerType, Magnitude}; use snarkvm_console_types_scalar::Scalar; use core::marker::PhantomData; From 3e54912e0c4dfd860db0109dbc0bdf56e1d989b4 Mon Sep 17 00:00:00 2001 From: Howard Wu <9260812+howardwu@users.noreply.github.com> Date: Sat, 20 Jan 2024 13:31:44 -0800 Subject: [PATCH 193/298] clippy shadow modules --- console/types/integers/src/lib.rs | 4 +--- ledger/src/lib.rs | 1 - 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/console/types/integers/src/lib.rs b/console/types/integers/src/lib.rs index 49e095d262..bfc0d0b2b7 100644 --- a/console/types/integers/src/lib.rs +++ b/console/types/integers/src/lib.rs @@ -38,9 +38,7 @@ mod zero; pub use snarkvm_console_network_environment::prelude::*; pub use snarkvm_console_types_boolean::Boolean; pub use snarkvm_console_types_field::Field; - -use snarkvm_console_network_environment::traits::{IntegerType, Magnitude}; -use snarkvm_console_types_scalar::Scalar; +pub use snarkvm_console_types_scalar::Scalar; use core::marker::PhantomData; diff --git a/ledger/src/lib.rs b/ledger/src/lib.rs index ecb5c9c59d..175151bb46 100644 --- a/ledger/src/lib.rs +++ b/ledger/src/lib.rs @@ -52,7 +52,6 @@ use console::{ types::{Field, Group}, }; use ledger_authority::Authority; -use ledger_block::{Block, ConfirmedTransaction, Header, Metadata, Ratify, Transaction, Transactions}; use ledger_coinbase::{CoinbasePuzzle, CoinbaseSolution, EpochChallenge, ProverSolution, PuzzleCommitment}; use ledger_committee::Committee; use ledger_narwhal::{BatchCertificate, Subdag, Transmission, TransmissionID}; From a95fb041e57c03daba827ef2a4b360aa2ae21592 Mon Sep 17 00:00:00 2001 From: Howard Wu <9260812+howardwu@users.noreply.github.com> Date: Sat, 20 Jan 2024 13:50:19 -0800 Subject: [PATCH 194/298] Bump to 1.72.1; remove Derivative crate --- .circleci/config.yml | 140 +++++++++++++------------- Cargo.lock | 12 --- Cargo.toml | 2 +- curves/src/bls12_377/fq.rs | 2 +- curves/src/bls12_377/fq12.rs | 2 +- curves/src/bls12_377/fq2.rs | 2 +- curves/src/bls12_377/fq6.rs | 2 +- curves/src/bls12_377/fr.rs | 2 +- curves/src/edwards_bls12/fr.rs | 2 +- fields/Cargo.toml | 3 - fields/src/fp12_2over3over2.rs | 43 ++++---- fields/src/fp2.rs | 20 ++-- fields/src/fp6_3over2.rs | 16 ++- fields/src/fp_256.rs | 10 +- fields/src/fp_384.rs | 15 +-- fields/src/lib.rs | 3 - fields/src/traits/field_parameters.rs | 6 +- rust-toolchain | 2 +- 18 files changed, 123 insertions(+), 161 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 7bfbb08b68..0c7567f0d6 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -134,7 +134,7 @@ commands: jobs: snarkvm: docker: - - image: cimg/rust:1.72 + - image: cimg/rust:1.72.1 resource_class: 2xlarge steps: - checkout @@ -144,7 +144,7 @@ jobs: algorithms: docker: - - image: cimg/rust:1.72 + - image: cimg/rust:1.72.1 resource_class: 2xlarge steps: - run_serial: @@ -153,7 +153,7 @@ jobs: algorithms-profiler: docker: - - image: cimg/rust:1.72 + - image: cimg/rust:1.72.1 resource_class: xlarge steps: - run_serial: # This runs a single test with profiler enabled @@ -163,7 +163,7 @@ jobs: circuit: docker: - - image: cimg/rust:1.72 + - image: cimg/rust:1.72.1 resource_class: xlarge steps: - run_serial: @@ -172,7 +172,7 @@ jobs: circuit-account: docker: - - image: cimg/rust:1.72 + - image: cimg/rust:1.72.1 resource_class: xlarge steps: - run_serial: @@ -182,7 +182,7 @@ jobs: # This checks that no `console` structs are used in core circuit logic. circuit-account-noconsole: docker: - - image: cimg/rust:1.72 + - image: cimg/rust:1.72.1 resource_class: xlarge steps: - run_serial: @@ -192,7 +192,7 @@ jobs: circuit-algorithms: docker: - - image: cimg/rust:1.72 + - image: cimg/rust:1.72.1 resource_class: xlarge steps: - run_serial: @@ -201,7 +201,7 @@ jobs: circuit-collections: docker: - - image: cimg/rust:1.72 + - image: cimg/rust:1.72.1 resource_class: xlarge steps: - run_serial: @@ -211,7 +211,7 @@ jobs: # This checks that no `console` structs are used in core circuit logic. circuit-collections-noconsole: docker: - - image: cimg/rust:1.72 + - image: cimg/rust:1.72.1 resource_class: xlarge steps: - run_serial: @@ -221,7 +221,7 @@ jobs: circuit-environment: docker: - - image: cimg/rust:1.72 + - image: cimg/rust:1.72.1 resource_class: xlarge steps: - run_serial: @@ -230,7 +230,7 @@ jobs: circuit-network: docker: - - image: cimg/rust:1.72 + - image: cimg/rust:1.72.1 resource_class: xlarge steps: - run_serial: @@ -239,7 +239,7 @@ jobs: circuit-program: docker: - - image: cimg/rust:1.72 + - image: cimg/rust:1.72.1 resource_class: xlarge steps: - run_serial: @@ -248,7 +248,7 @@ jobs: circuit-types: docker: - - image: cimg/rust:1.72 + - image: cimg/rust:1.72.1 resource_class: xlarge steps: - run_serial: @@ -257,7 +257,7 @@ jobs: circuit-types-address: docker: - - image: cimg/rust:1.72 + - image: cimg/rust:1.72.1 resource_class: xlarge steps: - run_serial: @@ -266,7 +266,7 @@ jobs: circuit-types-boolean: docker: - - image: cimg/rust:1.72 + - image: cimg/rust:1.72.1 resource_class: xlarge steps: - run_serial: @@ -275,7 +275,7 @@ jobs: circuit-types-field: docker: - - image: cimg/rust:1.72 + - image: cimg/rust:1.72.1 resource_class: xlarge steps: - run_serial: @@ -284,7 +284,7 @@ jobs: circuit-types-group: docker: - - image: cimg/rust:1.72 + - image: cimg/rust:1.72.1 resource_class: xlarge steps: - run_serial: @@ -293,7 +293,7 @@ jobs: circuit-types-integers: docker: - - image: cimg/rust:1.72 + - image: cimg/rust:1.72.1 resource_class: 2xlarge steps: - run_serial: @@ -303,7 +303,7 @@ jobs: circuit-types-scalar: docker: - - image: cimg/rust:1.72 + - image: cimg/rust:1.72.1 resource_class: xlarge steps: - run_serial: @@ -312,7 +312,7 @@ jobs: circuit-types-string: docker: - - image: cimg/rust:1.72 + - image: cimg/rust:1.72.1 resource_class: xlarge steps: - run_serial: @@ -320,7 +320,7 @@ jobs: cache_key: snarkvm-circuit-types-string-cache console: docker: - - image: cimg/rust:1.72 + - image: cimg/rust:1.72.1 resource_class: xlarge steps: - run_serial: @@ -329,7 +329,7 @@ jobs: console-account: docker: - - image: cimg/rust:1.72 + - image: cimg/rust:1.72.1 resource_class: xlarge steps: - run_serial: @@ -338,7 +338,7 @@ jobs: console-algorithms: docker: - - image: cimg/rust:1.72 + - image: cimg/rust:1.72.1 resource_class: xlarge steps: - run_serial: @@ -347,7 +347,7 @@ jobs: console-collections: docker: - - image: cimg/rust:1.72 + - image: cimg/rust:1.72.1 resource_class: xlarge steps: - run_serial: @@ -356,7 +356,7 @@ jobs: console-network: docker: - - image: cimg/rust:1.72 + - image: cimg/rust:1.72.1 resource_class: xlarge steps: - run_serial: @@ -365,7 +365,7 @@ jobs: console-network-environment: docker: - - image: cimg/rust:1.72 + - image: cimg/rust:1.72.1 resource_class: xlarge steps: - run_serial: @@ -374,7 +374,7 @@ jobs: console-program: docker: - - image: cimg/rust:1.72 + - image: cimg/rust:1.72.1 resource_class: xlarge steps: - run_serial: @@ -383,7 +383,7 @@ jobs: console-types: docker: - - image: cimg/rust:1.72 + - image: cimg/rust:1.72.1 resource_class: xlarge steps: - run_serial: @@ -392,7 +392,7 @@ jobs: console-types-address: docker: - - image: cimg/rust:1.72 + - image: cimg/rust:1.72.1 resource_class: xlarge steps: - run_serial: @@ -401,7 +401,7 @@ jobs: console-types-boolean: docker: - - image: cimg/rust:1.72 + - image: cimg/rust:1.72.1 resource_class: xlarge steps: - run_serial: @@ -410,7 +410,7 @@ jobs: console-types-field: docker: - - image: cimg/rust:1.72 + - image: cimg/rust:1.72.1 resource_class: xlarge steps: - run_serial: @@ -419,7 +419,7 @@ jobs: console-types-group: docker: - - image: cimg/rust:1.72 + - image: cimg/rust:1.72.1 resource_class: xlarge steps: - run_serial: @@ -428,7 +428,7 @@ jobs: console-types-integers: docker: - - image: cimg/rust:1.72 + - image: cimg/rust:1.72.1 resource_class: xlarge steps: - run_serial: @@ -437,7 +437,7 @@ jobs: console-types-scalar: docker: - - image: cimg/rust:1.72 + - image: cimg/rust:1.72.1 resource_class: xlarge steps: - run_serial: @@ -446,7 +446,7 @@ jobs: console-types-string: docker: - - image: cimg/rust:1.72 + - image: cimg/rust:1.72.1 resource_class: xlarge steps: - run_serial: @@ -455,7 +455,7 @@ jobs: curves: docker: - - image: cimg/rust:1.72 + - image: cimg/rust:1.72.1 resource_class: xlarge steps: - run_serial: @@ -464,7 +464,7 @@ jobs: fields: docker: - - image: cimg/rust:1.72 + - image: cimg/rust:1.72.1 resource_class: xlarge steps: - run_serial: @@ -473,7 +473,7 @@ jobs: ledger: docker: - - image: cimg/rust:1.72 + - image: cimg/rust:1.72.1 resource_class: 2xlarge steps: - run_serial: @@ -482,7 +482,7 @@ jobs: ledger-with-rocksdb: docker: - - image: cimg/rust:1.72 + - image: cimg/rust:1.72.1 resource_class: 2xlarge steps: - run_serial: @@ -492,7 +492,7 @@ jobs: ledger-authority: docker: - - image: cimg/rust:1.72 + - image: cimg/rust:1.72.1 resource_class: 2xlarge steps: - run_serial: @@ -501,7 +501,7 @@ jobs: ledger-block: docker: - - image: cimg/rust:1.72 + - image: cimg/rust:1.72.1 resource_class: 2xlarge steps: - run_serial: @@ -510,7 +510,7 @@ jobs: ledger-coinbase: docker: - - image: cimg/rust:1.72 + - image: cimg/rust:1.72.1 resource_class: 2xlarge steps: - run_serial: @@ -519,7 +519,7 @@ jobs: ledger-committee: docker: - - image: cimg/rust:1.72 + - image: cimg/rust:1.72.1 resource_class: xlarge steps: - run_serial: @@ -528,7 +528,7 @@ jobs: ledger-narwhal: docker: - - image: cimg/rust:1.72 + - image: cimg/rust:1.72.1 resource_class: 2xlarge steps: - run_serial: @@ -537,7 +537,7 @@ jobs: ledger-narwhal-batch-certificate: docker: - - image: cimg/rust:1.72 + - image: cimg/rust:1.72.1 resource_class: 2xlarge steps: - run_serial: @@ -546,7 +546,7 @@ jobs: ledger-narwhal-batch-header: docker: - - image: cimg/rust:1.72 + - image: cimg/rust:1.72.1 resource_class: 2xlarge steps: - run_serial: @@ -555,7 +555,7 @@ jobs: ledger-narwhal-data: docker: - - image: cimg/rust:1.72 + - image: cimg/rust:1.72.1 resource_class: 2xlarge steps: - run_serial: @@ -564,7 +564,7 @@ jobs: ledger-narwhal-subdag: docker: - - image: cimg/rust:1.72 + - image: cimg/rust:1.72.1 resource_class: 2xlarge steps: - run_serial: @@ -573,7 +573,7 @@ jobs: ledger-narwhal-transmission: docker: - - image: cimg/rust:1.72 + - image: cimg/rust:1.72.1 resource_class: 2xlarge steps: - run_serial: @@ -582,7 +582,7 @@ jobs: ledger-narwhal-transmission-id: docker: - - image: cimg/rust:1.72 + - image: cimg/rust:1.72.1 resource_class: 2xlarge steps: - run_serial: @@ -591,7 +591,7 @@ jobs: ledger-query: docker: - - image: cimg/rust:1.72 + - image: cimg/rust:1.72.1 resource_class: 2xlarge steps: - run_serial: @@ -600,7 +600,7 @@ jobs: ledger-store: docker: - - image: cimg/rust:1.72 + - image: cimg/rust:1.72.1 resource_class: 2xlarge steps: - run_serial: @@ -610,7 +610,7 @@ jobs: ledger-test-helpers: docker: - - image: cimg/rust:1.72 + - image: cimg/rust:1.72.1 resource_class: 2xlarge steps: - run_serial: @@ -619,7 +619,7 @@ jobs: parameters: docker: - - image: cimg/rust:1.72 + - image: cimg/rust:1.72.1 resource_class: xlarge steps: - run_serial: @@ -628,7 +628,7 @@ jobs: synthesizer: docker: - - image: cimg/rust:1.72 + - image: cimg/rust:1.72.1 resource_class: 2xlarge steps: - run_serial: @@ -638,7 +638,7 @@ jobs: synthesizer-integration: docker: - - image: cimg/rust:1.72 + - image: cimg/rust:1.72.1 resource_class: 2xlarge steps: - run_serial: @@ -648,7 +648,7 @@ jobs: synthesizer-process: docker: - - image: cimg/rust:1.72 + - image: cimg/rust:1.72.1 resource_class: 2xlarge steps: - run_serial: @@ -657,7 +657,7 @@ jobs: synthesizer-process-with-rocksdb: docker: - - image: cimg/rust:1.72 + - image: cimg/rust:1.72.1 resource_class: 2xlarge steps: - run_serial: @@ -667,7 +667,7 @@ jobs: synthesizer-program: docker: - - image: cimg/rust:1.72 + - image: cimg/rust:1.72.1 resource_class: 2xlarge steps: - run_serial: @@ -677,7 +677,7 @@ jobs: synthesizer-program-integration-keccak: docker: - - image: cimg/rust:1.72 + - image: cimg/rust:1.72.1 resource_class: 2xlarge steps: - run_serial: @@ -687,7 +687,7 @@ jobs: synthesizer-program-integration-psd: docker: - - image: cimg/rust:1.72 + - image: cimg/rust:1.72.1 resource_class: 2xlarge steps: - run_serial: @@ -697,7 +697,7 @@ jobs: synthesizer-program-integration-sha: docker: - - image: cimg/rust:1.72 + - image: cimg/rust:1.72.1 resource_class: 2xlarge steps: - run_serial: @@ -707,7 +707,7 @@ jobs: synthesizer-program-integration-rest: docker: - - image: cimg/rust:1.72 + - image: cimg/rust:1.72.1 resource_class: 2xlarge steps: - run_serial: @@ -717,7 +717,7 @@ jobs: synthesizer-snark: docker: - - image: cimg/rust:1.72 + - image: cimg/rust:1.72.1 resource_class: 2xlarge steps: - run_serial: @@ -726,7 +726,7 @@ jobs: utilities: docker: - - image: cimg/rust:1.72 + - image: cimg/rust:1.72.1 resource_class: xlarge steps: - run_serial: @@ -735,7 +735,7 @@ jobs: utilities-derives: docker: - - image: cimg/rust:1.72 + - image: cimg/rust:1.72.1 resource_class: xlarge steps: - run_serial: @@ -744,7 +744,7 @@ jobs: wasm: docker: - - image: cimg/rust:1.72 + - image: cimg/rust:1.72.1 resource_class: 2xlarge steps: - checkout @@ -762,7 +762,7 @@ jobs: check-fmt: docker: - - image: cimg/rust:1.72 + - image: cimg/rust:1.72.1 resource_class: xlarge steps: - checkout @@ -778,7 +778,7 @@ jobs: check-clippy: docker: - - image: cimg/rust:1.72 + - image: cimg/rust:1.72.1 resource_class: 2xlarge steps: - checkout @@ -795,7 +795,7 @@ jobs: check-all-targets: docker: - - image: cimg/rust:1.72 + - image: cimg/rust:1.72.1 resource_class: xlarge steps: - checkout diff --git a/Cargo.lock b/Cargo.lock index c03b491735..ab54eae84d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -738,17 +738,6 @@ dependencies = [ "powerfmt", ] -[[package]] -name = "derivative" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" -dependencies = [ - "proc-macro2", - "quote 1.0.33", - "syn 1.0.109", -] - [[package]] name = "digest" version = "0.10.7" @@ -3089,7 +3078,6 @@ version = "0.16.16" dependencies = [ "aleo-std", "anyhow", - "derivative", "itertools 0.11.0", "num-traits", "rand", diff --git a/Cargo.toml b/Cargo.toml index 050c10f65b..ea85c06b0d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -22,7 +22,7 @@ categories = [ include = [ "Cargo.toml", "vm", "README.md", "LICENSE.md" ] license = "Apache-2.0" edition = "2021" -rust-version = "1.72" +rust-version = "1.72.1" [workspace] members = [ diff --git a/curves/src/bls12_377/fq.rs b/curves/src/bls12_377/fq.rs index 88e09e09f9..1bcd522597 100644 --- a/curves/src/bls12_377/fq.rs +++ b/curves/src/bls12_377/fq.rs @@ -24,7 +24,7 @@ use snarkvm_utilities::biginteger::BigInteger384 as BigInteger; pub type Fq = Fp384; -#[derive(Copy, Clone)] +#[derive(Copy, Clone, Debug, Default, PartialEq, Eq, Hash)] pub struct FqParameters; impl Fp384Parameters for FqParameters {} diff --git a/curves/src/bls12_377/fq12.rs b/curves/src/bls12_377/fq12.rs index 8c4418e015..165599a37f 100644 --- a/curves/src/bls12_377/fq12.rs +++ b/curves/src/bls12_377/fq12.rs @@ -19,7 +19,7 @@ use crate::bls12_377::{Fq, Fq2, Fq6Parameters}; pub type Fq12 = Fp12; -#[derive(Copy, Clone)] +#[derive(Copy, Clone, Debug, Default, PartialEq, Eq, Hash)] pub struct Fq12Parameters; impl Fp12Parameters for Fq12Parameters { diff --git a/curves/src/bls12_377/fq2.rs b/curves/src/bls12_377/fq2.rs index ca5152f5c4..fbaffb2c7e 100644 --- a/curves/src/bls12_377/fq2.rs +++ b/curves/src/bls12_377/fq2.rs @@ -21,7 +21,7 @@ use crate::bls12_377::Fq; pub type Fq2 = Fp2; -#[derive(Copy, Clone, Debug, PartialEq, Eq, Serialize, Deserialize)] +#[derive(Copy, Clone, Debug, Default, PartialEq, Eq, Hash, Serialize, Deserialize)] pub struct Fq2Parameters; impl Fp2Parameters for Fq2Parameters { diff --git a/curves/src/bls12_377/fq6.rs b/curves/src/bls12_377/fq6.rs index 15a58bba0b..841c81dabc 100644 --- a/curves/src/bls12_377/fq6.rs +++ b/curves/src/bls12_377/fq6.rs @@ -23,7 +23,7 @@ use crate::bls12_377::{Fq, Fq2, Fq2Parameters}; pub type Fq6 = Fp6; -#[derive(Copy, Clone)] +#[derive(Copy, Clone, Debug, Default, PartialEq, Eq, Hash)] pub struct Fq6Parameters; impl Fp6Parameters for Fq6Parameters { diff --git a/curves/src/bls12_377/fr.rs b/curves/src/bls12_377/fr.rs index d78471c704..67de1ab1ad 100644 --- a/curves/src/bls12_377/fr.rs +++ b/curves/src/bls12_377/fr.rs @@ -47,7 +47,7 @@ use snarkvm_utilities::biginteger::BigInteger256 as BigInteger; /// ``` pub type Fr = Fp256; -#[derive(Copy, Clone)] +#[derive(Copy, Clone, Debug, Default, PartialEq, Eq, Hash)] pub struct FrParameters; impl Fp256Parameters for FrParameters {} diff --git a/curves/src/edwards_bls12/fr.rs b/curves/src/edwards_bls12/fr.rs index d092c73f87..0ed9d8e233 100644 --- a/curves/src/edwards_bls12/fr.rs +++ b/curves/src/edwards_bls12/fr.rs @@ -24,7 +24,7 @@ use snarkvm_utilities::biginteger::BigInteger256 as BigInteger; pub type Fr = Fp256; -#[derive(Copy, Clone)] +#[derive(Copy, Clone, Debug, Default, PartialEq, Eq, Hash)] pub struct FrParameters; impl Fp256Parameters for FrParameters {} diff --git a/fields/Cargo.toml b/fields/Cargo.toml index 036a436cb1..d610be066d 100644 --- a/fields/Cargo.toml +++ b/fields/Cargo.toml @@ -35,9 +35,6 @@ default-features = false [dependencies.anyhow] version = "1.0" -[dependencies.derivative] -version = "2" - [dependencies.itertools] version = "0.11.0" diff --git a/fields/src/fp12_2over3over2.rs b/fields/src/fp12_2over3over2.rs index 69700a878b..e7da3be7cd 100644 --- a/fields/src/fp12_2over3over2.rs +++ b/fields/src/fp12_2over3over2.rs @@ -22,46 +22,38 @@ use rand::{ use serde::{Deserialize, Serialize}; use std::{ cmp::Ordering, + fmt::Debug, + hash::Hash, io::{Read, Result as IoResult, Write}, ops::{Add, AddAssign, Div, DivAssign, Mul, MulAssign, Neg, Sub, SubAssign}, }; -pub trait Fp12Parameters: 'static + Send + Sync + Copy { +pub trait Fp12Parameters: 'static + Copy + Clone + Debug + Default + PartialEq + Eq + Hash + Send + Sync { type Fp6Params: Fp6Parameters; /// Coefficients for the Frobenius automorphism. const FROBENIUS_COEFF_FP12_C1: [Fp2>; 12]; } +type Fp2Params

= <

::Fp6Params as Fp6Parameters>::Fp2Params; + /// An element of Fp12, represented by c0 + c1 * v -#[derive(Derivative, Copy, Clone, Serialize, Deserialize)] -#[derivative( - Default(bound = "P: Fp12Parameters"), - Hash(bound = "P: Fp12Parameters"), - Debug(bound = "P: Fp12Parameters"), - PartialEq(bound = "P: Fp12Parameters"), - Eq(bound = "P: Fp12Parameters") -)] -#[must_use] +#[derive(Copy, Clone, Debug, Default, PartialEq, Eq, Hash, Serialize, Deserialize)] pub struct Fp12 { pub c0: Fp6, pub c1: Fp6, } -type Fp2Params

= <

::Fp6Params as Fp6Parameters>::Fp2Params; - impl Fp12

{ - /// Multiply by quadratic nonresidue v. - #[inline(always)] - pub(crate) fn mul_fp6_by_nonresidue(fe: &Fp6) -> Fp6 { - let new_c0 = P::Fp6Params::mul_fp2_by_nonresidue(&fe.c2); - let new_c1 = fe.c0; - let new_c2 = fe.c1; - Fp6::new(new_c0, new_c1, new_c2) + /// Initializes an element of `Fp12` from two `Fp6` elements. + pub const fn new(c0: Fp6, c1: Fp6) -> Self { + Self { c0, c1 } } +} - pub fn new(c0: Fp6, c1: Fp6) -> Self { - Self { c0, c1 } +impl Fp12

{ + pub fn conjugate(&mut self) { + self.c1 = self.c1.neg(); } pub fn mul_by_fp(&mut self, element: &<::Fp2Params as Fp2Parameters>::Fp) { @@ -69,8 +61,13 @@ impl Fp12

{ self.c1.mul_by_fp(element); } - pub fn conjugate(&mut self) { - self.c1 = self.c1.neg(); + /// Multiply by quadratic nonresidue v. + #[inline(always)] + pub(crate) fn mul_fp6_by_nonresidue(fe: &Fp6) -> Fp6 { + let new_c0 = P::Fp6Params::mul_fp2_by_nonresidue(&fe.c2); + let new_c1 = fe.c0; + let new_c2 = fe.c1; + Fp6::new(new_c0, new_c1, new_c2) } pub fn mul_by_034(&mut self, c0: &Fp2>, c3: &Fp2>, c4: &Fp2>) { diff --git a/fields/src/fp2.rs b/fields/src/fp2.rs index 63ba3d9077..528e5c3be7 100644 --- a/fields/src/fp2.rs +++ b/fields/src/fp2.rs @@ -28,11 +28,15 @@ use rand::{ use serde::{Deserialize, Serialize}; use std::{ cmp::{Ord, Ordering, PartialOrd}, + fmt::Debug, + hash::Hash, io::{Read, Result as IoResult, Write}, ops::{Add, AddAssign, Div, DivAssign, Mul, MulAssign, Neg, Sub, SubAssign}, }; -pub trait Fp2Parameters: 'static + Copy + Clone + Serialize + for<'a> Deserialize<'a> + Send + Sync { +pub trait Fp2Parameters: + 'static + Copy + Clone + Default + Debug + PartialEq + Eq + Hash + Serialize + for<'a> Deserialize<'a> + Send + Sync +{ type Fp: PrimeField; /// Coefficients for the Frobenius automorphism. @@ -48,24 +52,20 @@ pub trait Fp2Parameters: 'static + Copy + Clone + Serialize + for<'a> Deserializ } } -#[derive(Derivative, Copy, Clone, Serialize, Deserialize)] -#[derivative( - Default(bound = "P: Fp2Parameters"), - Hash(bound = "P: Fp2Parameters"), - Debug(bound = "P: Fp2Parameters"), - PartialEq(bound = "P: Fp2Parameters"), - Eq(bound = "P: Fp2Parameters") -)] +#[derive(Copy, Clone, Debug, Default, PartialEq, Eq, Hash, Serialize, Deserialize)] pub struct Fp2 { pub c0: P::Fp, pub c1: P::Fp, } impl Fp2

{ - pub fn new(c0: P::Fp, c1: P::Fp) -> Self { + /// Initializes a `Fp2` element from two `Fp` elements. + pub const fn new(c0: P::Fp, c1: P::Fp) -> Self { Fp2 { c0, c1 } } +} +impl Fp2

{ /// Norm of Fp2 over Fp: Norm(a) = a.x^2 - beta * a.y^2 pub fn norm(&self) -> P::Fp { let t0 = self.c0.square(); diff --git a/fields/src/fp6_3over2.rs b/fields/src/fp6_3over2.rs index 9431a562ad..5699630195 100644 --- a/fields/src/fp6_3over2.rs +++ b/fields/src/fp6_3over2.rs @@ -28,11 +28,13 @@ use rand::{ use serde::{Deserialize, Serialize}; use std::{ cmp::Ordering, + fmt::Debug, + hash::Hash, io::{Read, Result as IoResult, Write}, ops::{Add, AddAssign, Div, DivAssign, Mul, MulAssign, Neg, Sub, SubAssign}, }; -pub trait Fp6Parameters: 'static + Copy + Clone + Send + Sync { +pub trait Fp6Parameters: 'static + Copy + Clone + Default + Debug + PartialEq + Eq + Hash + Send + Sync { type Fp2Params: Fp2Parameters; /// Coefficients for the Frobenius automorphism. @@ -48,14 +50,7 @@ pub trait Fp6Parameters: 'static + Copy + Clone + Send + Sync { } /// An element of Fp6, represented by c0 + c1 * v + c2 * v^(2). -#[derive(Derivative, Copy, Clone, Serialize, Deserialize)] -#[derivative( - Default(bound = "P: Fp6Parameters"), - Hash(bound = "P: Fp6Parameters"), - Debug(bound = "P: Fp6Parameters"), - PartialEq(bound = "P: Fp6Parameters"), - Eq(bound = "P: Fp6Parameters") -)] +#[derive(Copy, Clone, Debug, Default, PartialEq, Eq, Hash, Serialize, Deserialize)] pub struct Fp6 { pub c0: Fp2, pub c1: Fp2, @@ -63,7 +58,8 @@ pub struct Fp6 { } impl Fp6

{ - pub fn new(c0: Fp2, c1: Fp2, c2: Fp2) -> Self { + /// Initializes an element of `Fp6` from 3 `Fp2` elements. + pub const fn new(c0: Fp2, c1: Fp2, c2: Fp2) -> Self { Self { c0, c1, c2 } } diff --git a/fields/src/fp_256.rs b/fields/src/fp_256.rs index 2b94c0af30..641a5d0f20 100644 --- a/fields/src/fp_256.rs +++ b/fields/src/fp_256.rs @@ -47,14 +47,8 @@ use zeroize::Zeroize; pub trait Fp256Parameters: FieldParameters {} -#[derive(Derivative, Copy, Clone, Zeroize)] -#[derivative(Default(bound = ""), Hash(bound = ""), PartialEq(bound = ""), Eq(bound = ""))] -pub struct Fp256( - pub BigInteger, - #[derivative(Debug = "ignore")] - #[doc(hidden)] - pub PhantomData

, -); +#[derive(Copy, Clone, Default, PartialEq, Eq, Hash, Zeroize)] +pub struct Fp256(pub BigInteger, #[doc(hidden)] pub PhantomData

); impl Fp256

{ #[inline] diff --git a/fields/src/fp_384.rs b/fields/src/fp_384.rs index e665b88a99..9c74c0e336 100644 --- a/fields/src/fp_384.rs +++ b/fields/src/fp_384.rs @@ -47,19 +47,8 @@ use zeroize::Zeroize; pub trait Fp384Parameters: FieldParameters {} -#[derive(Derivative, Copy, Clone, Zeroize)] -#[derivative( - Default(bound = "P: Fp384Parameters"), - Hash(bound = "P: Fp384Parameters"), - PartialEq(bound = "P: Fp384Parameters"), - Eq(bound = "P: Fp384Parameters") -)] -pub struct Fp384( - pub BigInteger, - #[derivative(Debug = "ignore")] - #[doc(hidden)] - pub PhantomData

, -); +#[derive(Copy, Clone, Default, PartialEq, Eq, Hash, Zeroize)] +pub struct Fp384(pub BigInteger, #[doc(hidden)] pub PhantomData

); impl Fp384

{ #[inline] diff --git a/fields/src/lib.rs b/fields/src/lib.rs index 1a5e5be332..f2037076c9 100644 --- a/fields/src/lib.rs +++ b/fields/src/lib.rs @@ -15,9 +15,6 @@ #![allow(clippy::module_inception)] #![forbid(unsafe_code)] -#[macro_use] -extern crate derivative; - #[macro_use] extern crate thiserror; diff --git a/fields/src/traits/field_parameters.rs b/fields/src/traits/field_parameters.rs index ea329e36b3..ba0c4a186a 100644 --- a/fields/src/traits/field_parameters.rs +++ b/fields/src/traits/field_parameters.rs @@ -14,8 +14,12 @@ use crate::traits::{FftParameters, PoseidonDefaultParameters}; +use core::{fmt::Debug, hash::Hash}; + /// A trait that defines parameters for a prime field. -pub trait FieldParameters: 'static + Copy + FftParameters + PoseidonDefaultParameters { +pub trait FieldParameters: + 'static + FftParameters + PoseidonDefaultParameters + Copy + Clone + Debug + Default + PartialEq + Eq + Hash +{ /// The modulus of the field. const MODULUS: Self::BigInteger; diff --git a/rust-toolchain b/rust-toolchain index 0834888f55..22d6771a47 100644 --- a/rust-toolchain +++ b/rust-toolchain @@ -1 +1 @@ -1.72.0 +1.72.1 From 290f77d5a5d265c4aebabcde10cbb23e926e3b86 Mon Sep 17 00:00:00 2001 From: Howard Wu <9260812+howardwu@users.noreply.github.com> Date: Sat, 20 Jan 2024 14:35:21 -0800 Subject: [PATCH 195/298] chore(snarkvm): bump version for new release --- .cargo/release-version | 2 +- Cargo.lock | 120 ++++++++++---------- Cargo.toml | 24 ++-- algorithms/Cargo.toml | 12 +- algorithms/cuda/Cargo.toml | 2 +- circuit/Cargo.toml | 16 +-- circuit/account/Cargo.toml | 10 +- circuit/algorithms/Cargo.toml | 8 +- circuit/collections/Cargo.toml | 8 +- circuit/environment/Cargo.toml | 14 +-- circuit/environment/witness/Cargo.toml | 2 +- circuit/network/Cargo.toml | 10 +- circuit/program/Cargo.toml | 16 +-- circuit/types/Cargo.toml | 18 +-- circuit/types/address/Cargo.toml | 14 +-- circuit/types/boolean/Cargo.toml | 6 +- circuit/types/field/Cargo.toml | 8 +- circuit/types/group/Cargo.toml | 12 +- circuit/types/integers/Cargo.toml | 12 +- circuit/types/scalar/Cargo.toml | 10 +- circuit/types/string/Cargo.toml | 12 +- console/Cargo.toml | 14 +-- console/account/Cargo.toml | 6 +- console/algorithms/Cargo.toml | 8 +- console/collections/Cargo.toml | 6 +- console/network/Cargo.toml | 20 ++-- console/network/environment/Cargo.toml | 8 +- console/program/Cargo.toml | 14 +-- console/types/Cargo.toml | 19 ++-- console/types/address/Cargo.toml | 10 +- console/types/boolean/Cargo.toml | 4 +- console/types/field/Cargo.toml | 6 +- console/types/group/Cargo.toml | 10 +- console/types/integers/Cargo.toml | 10 +- console/types/scalar/Cargo.toml | 8 +- console/types/string/Cargo.toml | 10 +- curves/Cargo.toml | 6 +- fields/Cargo.toml | 4 +- ledger/Cargo.toml | 22 ++-- ledger/authority/Cargo.toml | 6 +- ledger/block/Cargo.toml | 20 ++-- ledger/coinbase/Cargo.toml | 14 +-- ledger/committee/Cargo.toml | 6 +- ledger/narwhal/Cargo.toml | 14 +-- ledger/narwhal/batch-certificate/Cargo.toml | 8 +- ledger/narwhal/batch-header/Cargo.toml | 6 +- ledger/narwhal/data/Cargo.toml | 4 +- ledger/narwhal/subdag/Cargo.toml | 10 +- ledger/narwhal/transmission-id/Cargo.toml | 6 +- ledger/narwhal/transmission/Cargo.toml | 10 +- ledger/query/Cargo.toml | 8 +- ledger/store/Cargo.toml | 18 +-- ledger/test-helpers/Cargo.toml | 16 +-- metrics/Cargo.toml | 2 +- parameters/Cargo.toml | 6 +- synthesizer/Cargo.toml | 24 ++-- synthesizer/process/Cargo.toml | 18 +-- synthesizer/program/Cargo.toml | 6 +- synthesizer/snark/Cargo.toml | 8 +- utilities/Cargo.toml | 4 +- utilities/derives/Cargo.toml | 2 +- wasm/Cargo.toml | 20 ++-- 62 files changed, 378 insertions(+), 379 deletions(-) diff --git a/.cargo/release-version b/.cargo/release-version index 0b2cdf0eeb..4ca4fe646a 100644 --- a/.cargo/release-version +++ b/.cargo/release-version @@ -1 +1 @@ -v0.16.16 \ No newline at end of file +v0.16.17 \ No newline at end of file diff --git a/Cargo.lock b/Cargo.lock index eca390ffe3..eb058326d6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2545,7 +2545,7 @@ dependencies = [ [[package]] name = "snarkvm" -version = "0.16.16" +version = "0.16.17" dependencies = [ "anstyle", "anyhow", @@ -2581,7 +2581,7 @@ dependencies = [ [[package]] name = "snarkvm-algorithms" -version = "0.16.16" +version = "0.16.17" dependencies = [ "aleo-std", "anyhow", @@ -2620,7 +2620,7 @@ dependencies = [ [[package]] name = "snarkvm-algorithms-cuda" -version = "0.16.16" +version = "0.16.17" dependencies = [ "blst", "cc", @@ -2630,7 +2630,7 @@ dependencies = [ [[package]] name = "snarkvm-circuit" -version = "0.16.16" +version = "0.16.17" dependencies = [ "snarkvm-circuit-account", "snarkvm-circuit-algorithms", @@ -2643,7 +2643,7 @@ dependencies = [ [[package]] name = "snarkvm-circuit-account" -version = "0.16.16" +version = "0.16.17" dependencies = [ "anyhow", "snarkvm-circuit-algorithms", @@ -2655,7 +2655,7 @@ dependencies = [ [[package]] name = "snarkvm-circuit-algorithms" -version = "0.16.16" +version = "0.16.17" dependencies = [ "anyhow", "snarkvm-circuit-types", @@ -2667,7 +2667,7 @@ dependencies = [ [[package]] name = "snarkvm-circuit-collections" -version = "0.16.16" +version = "0.16.17" dependencies = [ "anyhow", "snarkvm-circuit-algorithms", @@ -2681,7 +2681,7 @@ dependencies = [ [[package]] name = "snarkvm-circuit-environment" -version = "0.16.16" +version = "0.16.17" dependencies = [ "criterion", "indexmap 2.0.2", @@ -2702,11 +2702,11 @@ dependencies = [ [[package]] name = "snarkvm-circuit-environment-witness" -version = "0.16.16" +version = "0.16.17" [[package]] name = "snarkvm-circuit-network" -version = "0.16.16" +version = "0.16.17" dependencies = [ "snarkvm-circuit-algorithms", "snarkvm-circuit-collections", @@ -2717,7 +2717,7 @@ dependencies = [ [[package]] name = "snarkvm-circuit-program" -version = "0.16.16" +version = "0.16.17" dependencies = [ "anyhow", "paste", @@ -2735,7 +2735,7 @@ dependencies = [ [[package]] name = "snarkvm-circuit-types" -version = "0.16.16" +version = "0.16.17" dependencies = [ "snarkvm-circuit-environment", "snarkvm-circuit-types-address", @@ -2750,7 +2750,7 @@ dependencies = [ [[package]] name = "snarkvm-circuit-types-address" -version = "0.16.16" +version = "0.16.17" dependencies = [ "snarkvm-circuit-environment", "snarkvm-circuit-types-boolean", @@ -2762,7 +2762,7 @@ dependencies = [ [[package]] name = "snarkvm-circuit-types-boolean" -version = "0.16.16" +version = "0.16.17" dependencies = [ "criterion", "snarkvm-circuit-environment", @@ -2771,7 +2771,7 @@ dependencies = [ [[package]] name = "snarkvm-circuit-types-field" -version = "0.16.16" +version = "0.16.17" dependencies = [ "snarkvm-circuit-environment", "snarkvm-circuit-types-boolean", @@ -2780,7 +2780,7 @@ dependencies = [ [[package]] name = "snarkvm-circuit-types-group" -version = "0.16.16" +version = "0.16.17" dependencies = [ "snarkvm-circuit-environment", "snarkvm-circuit-types-boolean", @@ -2792,7 +2792,7 @@ dependencies = [ [[package]] name = "snarkvm-circuit-types-integers" -version = "0.16.16" +version = "0.16.17" dependencies = [ "paste", "snarkvm-circuit-environment", @@ -2805,7 +2805,7 @@ dependencies = [ [[package]] name = "snarkvm-circuit-types-scalar" -version = "0.16.16" +version = "0.16.17" dependencies = [ "snarkvm-circuit-environment", "snarkvm-circuit-types-boolean", @@ -2815,7 +2815,7 @@ dependencies = [ [[package]] name = "snarkvm-circuit-types-string" -version = "0.16.16" +version = "0.16.17" dependencies = [ "rand", "snarkvm-circuit-environment", @@ -2828,7 +2828,7 @@ dependencies = [ [[package]] name = "snarkvm-console" -version = "0.16.16" +version = "0.16.17" dependencies = [ "snarkvm-console-account", "snarkvm-console-algorithms", @@ -2840,7 +2840,7 @@ dependencies = [ [[package]] name = "snarkvm-console-account" -version = "0.16.16" +version = "0.16.17" dependencies = [ "bincode", "bs58", @@ -2853,7 +2853,7 @@ dependencies = [ [[package]] name = "snarkvm-console-algorithms" -version = "0.16.16" +version = "0.16.17" dependencies = [ "blake2s_simd", "criterion", @@ -2871,7 +2871,7 @@ dependencies = [ [[package]] name = "snarkvm-console-collections" -version = "0.16.16" +version = "0.16.17" dependencies = [ "aleo-std", "criterion", @@ -2884,7 +2884,7 @@ dependencies = [ [[package]] name = "snarkvm-console-network" -version = "0.16.16" +version = "0.16.17" dependencies = [ "anyhow", "indexmap 2.0.2", @@ -2906,7 +2906,7 @@ dependencies = [ [[package]] name = "snarkvm-console-network-environment" -version = "0.16.16" +version = "0.16.17" dependencies = [ "anyhow", "bech32", @@ -2923,7 +2923,7 @@ dependencies = [ [[package]] name = "snarkvm-console-program" -version = "0.16.16" +version = "0.16.17" dependencies = [ "bincode", "enum_index", @@ -2944,7 +2944,7 @@ dependencies = [ [[package]] name = "snarkvm-console-types" -version = "0.16.16" +version = "0.16.17" dependencies = [ "criterion", "snarkvm-console-network", @@ -2960,7 +2960,7 @@ dependencies = [ [[package]] name = "snarkvm-console-types-address" -version = "0.16.16" +version = "0.16.17" dependencies = [ "bincode", "serde_json", @@ -2972,7 +2972,7 @@ dependencies = [ [[package]] name = "snarkvm-console-types-boolean" -version = "0.16.16" +version = "0.16.17" dependencies = [ "bincode", "serde_json", @@ -2981,7 +2981,7 @@ dependencies = [ [[package]] name = "snarkvm-console-types-field" -version = "0.16.16" +version = "0.16.17" dependencies = [ "bincode", "serde_json", @@ -2992,7 +2992,7 @@ dependencies = [ [[package]] name = "snarkvm-console-types-group" -version = "0.16.16" +version = "0.16.17" dependencies = [ "bincode", "serde_json", @@ -3004,7 +3004,7 @@ dependencies = [ [[package]] name = "snarkvm-console-types-integers" -version = "0.16.16" +version = "0.16.17" dependencies = [ "bincode", "serde_json", @@ -3016,7 +3016,7 @@ dependencies = [ [[package]] name = "snarkvm-console-types-scalar" -version = "0.16.16" +version = "0.16.17" dependencies = [ "bincode", "serde_json", @@ -3028,7 +3028,7 @@ dependencies = [ [[package]] name = "snarkvm-console-types-string" -version = "0.16.16" +version = "0.16.17" dependencies = [ "bincode", "serde_json", @@ -3040,7 +3040,7 @@ dependencies = [ [[package]] name = "snarkvm-curves" -version = "0.16.16" +version = "0.16.17" dependencies = [ "bincode", "criterion", @@ -3055,7 +3055,7 @@ dependencies = [ [[package]] name = "snarkvm-fields" -version = "0.16.16" +version = "0.16.17" dependencies = [ "aleo-std", "anyhow", @@ -3071,7 +3071,7 @@ dependencies = [ [[package]] name = "snarkvm-ledger" -version = "0.16.16" +version = "0.16.17" dependencies = [ "aleo-std", "anyhow", @@ -3098,7 +3098,7 @@ dependencies = [ [[package]] name = "snarkvm-ledger-authority" -version = "0.16.16" +version = "0.16.17" dependencies = [ "anyhow", "bincode", @@ -3111,7 +3111,7 @@ dependencies = [ [[package]] name = "snarkvm-ledger-block" -version = "0.16.16" +version = "0.16.17" dependencies = [ "bincode", "indexmap 2.0.2", @@ -3135,7 +3135,7 @@ dependencies = [ [[package]] name = "snarkvm-ledger-coinbase" -version = "0.16.16" +version = "0.16.17" dependencies = [ "aleo-std", "anyhow", @@ -3156,7 +3156,7 @@ dependencies = [ [[package]] name = "snarkvm-ledger-committee" -version = "0.16.16" +version = "0.16.17" dependencies = [ "anyhow", "bincode", @@ -3177,7 +3177,7 @@ dependencies = [ [[package]] name = "snarkvm-ledger-narwhal" -version = "0.16.16" +version = "0.16.17" dependencies = [ "snarkvm-ledger-narwhal", "snarkvm-ledger-narwhal-batch-certificate", @@ -3190,7 +3190,7 @@ dependencies = [ [[package]] name = "snarkvm-ledger-narwhal-batch-certificate" -version = "0.16.16" +version = "0.16.17" dependencies = [ "bincode", "indexmap 2.0.2", @@ -3204,7 +3204,7 @@ dependencies = [ [[package]] name = "snarkvm-ledger-narwhal-batch-header" -version = "0.16.16" +version = "0.16.17" dependencies = [ "bincode", "indexmap 2.0.2", @@ -3217,7 +3217,7 @@ dependencies = [ [[package]] name = "snarkvm-ledger-narwhal-data" -version = "0.16.16" +version = "0.16.17" dependencies = [ "bytes", "serde_json", @@ -3227,7 +3227,7 @@ dependencies = [ [[package]] name = "snarkvm-ledger-narwhal-subdag" -version = "0.16.16" +version = "0.16.17" dependencies = [ "bincode", "indexmap 2.0.2", @@ -3242,7 +3242,7 @@ dependencies = [ [[package]] name = "snarkvm-ledger-narwhal-transmission" -version = "0.16.16" +version = "0.16.17" dependencies = [ "bincode", "bytes", @@ -3255,7 +3255,7 @@ dependencies = [ [[package]] name = "snarkvm-ledger-narwhal-transmission-id" -version = "0.16.16" +version = "0.16.17" dependencies = [ "bincode", "serde_json", @@ -3265,7 +3265,7 @@ dependencies = [ [[package]] name = "snarkvm-ledger-query" -version = "0.16.16" +version = "0.16.17" dependencies = [ "async-trait", "reqwest", @@ -3277,7 +3277,7 @@ dependencies = [ [[package]] name = "snarkvm-ledger-store" -version = "0.16.16" +version = "0.16.17" dependencies = [ "aleo-std", "anyhow", @@ -3305,7 +3305,7 @@ dependencies = [ [[package]] name = "snarkvm-ledger-test-helpers" -version = "0.16.16" +version = "0.16.17" dependencies = [ "once_cell", "snarkvm-circuit", @@ -3319,7 +3319,7 @@ dependencies = [ [[package]] name = "snarkvm-metrics" -version = "0.16.16" +version = "0.16.17" dependencies = [ "metrics", "metrics-exporter-prometheus", @@ -3327,7 +3327,7 @@ dependencies = [ [[package]] name = "snarkvm-parameters" -version = "0.16.16" +version = "0.16.17" dependencies = [ "aleo-std", "anyhow", @@ -3360,7 +3360,7 @@ dependencies = [ [[package]] name = "snarkvm-synthesizer" -version = "0.16.16" +version = "0.16.17" dependencies = [ "aleo-std", "anyhow", @@ -3391,7 +3391,7 @@ dependencies = [ [[package]] name = "snarkvm-synthesizer-process" -version = "0.16.16" +version = "0.16.17" dependencies = [ "aleo-std", "bincode", @@ -3417,7 +3417,7 @@ dependencies = [ [[package]] name = "snarkvm-synthesizer-program" -version = "0.16.16" +version = "0.16.17" dependencies = [ "bincode", "criterion", @@ -3433,7 +3433,7 @@ dependencies = [ [[package]] name = "snarkvm-synthesizer-snark" -version = "0.16.16" +version = "0.16.17" dependencies = [ "bincode", "colored", @@ -3446,7 +3446,7 @@ dependencies = [ [[package]] name = "snarkvm-utilities" -version = "0.16.16" +version = "0.16.17" dependencies = [ "aleo-std", "anyhow", @@ -3466,7 +3466,7 @@ dependencies = [ [[package]] name = "snarkvm-utilities-derives" -version = "0.16.16" +version = "0.16.17" dependencies = [ "proc-macro2", "quote 1.0.33", @@ -3475,7 +3475,7 @@ dependencies = [ [[package]] name = "snarkvm-wasm" -version = "0.16.16" +version = "0.16.17" dependencies = [ "getrandom", "snarkvm-circuit-network", diff --git a/Cargo.toml b/Cargo.toml index ea85c06b0d..a1af5efd32 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm" -version = "0.16.16" +version = "0.16.17" authors = [ "The Aleo Team " ] description = "A decentralized virtual machine" homepage = "https://aleo.org" @@ -150,58 +150,58 @@ wasm = [ "snarkvm-wasm" ] [dependencies.snarkvm-algorithms] path = "./algorithms" -version = "=0.16.16" +version = "=0.16.17" optional = true [dependencies.snarkvm-circuit] path = "./circuit" -version = "=0.16.16" +version = "=0.16.17" optional = true [dependencies.snarkvm-console] path = "./console" -version = "=0.16.16" +version = "=0.16.17" optional = true [dependencies.snarkvm-curves] path = "./curves" -version = "=0.16.16" +version = "=0.16.17" optional = true [dependencies.snarkvm-fields] path = "./fields" -version = "=0.16.16" +version = "=0.16.17" optional = true [dependencies.snarkvm-ledger] path = "./ledger" -version = "=0.16.16" +version = "=0.16.17" optional = true [dependencies.snarkvm-metrics] path = "./metrics" -version = "=0.16.16" +version = "=0.16.17" optional = true [dependencies.snarkvm-parameters] path = "./parameters" -version = "=0.16.16" +version = "=0.16.17" optional = true [dependencies.snarkvm-synthesizer] path = "./synthesizer" -version = "=0.16.16" +version = "=0.16.17" default-features = false optional = true [dependencies.snarkvm-utilities] path = "./utilities" -version = "=0.16.16" +version = "=0.16.17" optional = true [dependencies.snarkvm-wasm] path = "./wasm" -version = "=0.16.16" +version = "=0.16.17" optional = true [dependencies.anstyle] diff --git a/algorithms/Cargo.toml b/algorithms/Cargo.toml index 7ce622dcce..bf75ffe3f9 100644 --- a/algorithms/Cargo.toml +++ b/algorithms/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-algorithms" -version = "0.16.16" +version = "0.16.17" authors = [ "The Aleo Team " ] description = "Algorithms for a decentralized virtual machine" homepage = "https://aleo.org" @@ -47,27 +47,27 @@ required-features = [ "test" ] [dependencies.snarkvm-curves] path = "../curves" -version = "=0.16.16" +version = "=0.16.17" default-features = false [dependencies.snarkvm-fields] path = "../fields" -version = "=0.16.16" +version = "=0.16.17" default-features = false [dependencies.snarkvm-parameters] path = "../parameters" -version = "=0.16.16" +version = "=0.16.17" optional = true [dependencies.snarkvm-utilities] path = "../utilities" -version = "=0.16.16" +version = "=0.16.17" default-features = false [dependencies.snarkvm-algorithms-cuda] path = "./cuda" -version = "=0.16.16" +version = "=0.16.17" optional = true [dependencies.aleo-std] diff --git a/algorithms/cuda/Cargo.toml b/algorithms/cuda/Cargo.toml index 448ea08b6d..c5cd0c5303 100644 --- a/algorithms/cuda/Cargo.toml +++ b/algorithms/cuda/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-algorithms-cuda" -version = "0.16.16" +version = "0.16.17" authors = [ "The Aleo Team " ] description = "Cuda optimizations for a decentralized virtual machine" homepage = "https://aleo.org" diff --git a/circuit/Cargo.toml b/circuit/Cargo.toml index 648e3f5865..6934583c6d 100644 --- a/circuit/Cargo.toml +++ b/circuit/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-circuit" -version = "0.16.16" +version = "0.16.17" authors = [ "The Aleo Team " ] description = "Circuits for a decentralized virtual machine" homepage = "https://aleo.org" @@ -25,28 +25,28 @@ edition = "2021" [dependencies.snarkvm-circuit-account] path = "./account" -version = "=0.16.16" +version = "=0.16.17" [dependencies.snarkvm-circuit-algorithms] path = "./algorithms" -version = "=0.16.16" +version = "=0.16.17" [dependencies.snarkvm-circuit-collections] path = "./collections" -version = "=0.16.16" +version = "=0.16.17" [dependencies.snarkvm-circuit-environment] path = "./environment" -version = "=0.16.16" +version = "=0.16.17" [dependencies.snarkvm-circuit-network] path = "./network" -version = "=0.16.16" +version = "=0.16.17" [dependencies.snarkvm-circuit-program] path = "./program" -version = "=0.16.16" +version = "=0.16.17" [dependencies.snarkvm-circuit-types] path = "./types" -version = "=0.16.16" +version = "=0.16.17" diff --git a/circuit/account/Cargo.toml b/circuit/account/Cargo.toml index eb990601a3..2ac433a415 100644 --- a/circuit/account/Cargo.toml +++ b/circuit/account/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-circuit-account" -version = "0.16.16" +version = "0.16.17" authors = [ "The Aleo Team " ] description = "Account circuit library for a decentralized virtual machine" license = "Apache-2.0" @@ -9,20 +9,20 @@ edition = "2021" [dependencies.console] package = "snarkvm-console-account" path = "../../console/account" -version = "=0.16.16" +version = "=0.16.17" optional = true [dependencies.snarkvm-circuit-algorithms] path = "../algorithms" -version = "=0.16.16" +version = "=0.16.17" [dependencies.snarkvm-circuit-network] path = "../network" -version = "=0.16.16" +version = "=0.16.17" [dependencies.snarkvm-circuit-types] path = "../types" -version = "=0.16.16" +version = "=0.16.17" [dev-dependencies.snarkvm-utilities] path = "../../utilities" diff --git a/circuit/algorithms/Cargo.toml b/circuit/algorithms/Cargo.toml index 68bd4c03a1..5e3c4474cd 100644 --- a/circuit/algorithms/Cargo.toml +++ b/circuit/algorithms/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-circuit-algorithms" -version = "0.16.16" +version = "0.16.17" authors = [ "The Aleo Team " ] description = "Algorithm circuit library for a decentralized virtual machine" license = "Apache-2.0" @@ -9,16 +9,16 @@ edition = "2021" [dependencies.console] package = "snarkvm-console-algorithms" path = "../../console/algorithms" -version = "=0.16.16" +version = "=0.16.17" optional = true [dependencies.snarkvm-circuit-types] path = "../types" -version = "=0.16.16" +version = "=0.16.17" [dependencies.snarkvm-fields] path = "../../fields" -version = "=0.16.16" +version = "=0.16.17" default-features = false [dev-dependencies.anyhow] diff --git a/circuit/collections/Cargo.toml b/circuit/collections/Cargo.toml index ad5a5cb235..679e04012b 100644 --- a/circuit/collections/Cargo.toml +++ b/circuit/collections/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-circuit-collections" -version = "0.16.16" +version = "0.16.17" authors = [ "The Aleo Team " ] description = "Collections circuit library for a decentralized virtual machine" license = "Apache-2.0" @@ -9,16 +9,16 @@ edition = "2021" [dependencies.console] package = "snarkvm-console-collections" path = "../../console/collections" -version = "=0.16.16" +version = "=0.16.17" optional = true [dependencies.snarkvm-circuit-algorithms] path = "../algorithms" -version = "=0.16.16" +version = "=0.16.17" [dependencies.snarkvm-circuit-types] path = "../types" -version = "=0.16.16" +version = "=0.16.17" [dev-dependencies.snarkvm-circuit-network] path = "../network" diff --git a/circuit/environment/Cargo.toml b/circuit/environment/Cargo.toml index 98d7e16af6..909ce9858e 100644 --- a/circuit/environment/Cargo.toml +++ b/circuit/environment/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-circuit-environment" -version = "0.16.16" +version = "0.16.17" authors = [ "The Aleo Team " ] description = "Circuit environment for a decentralized virtual machine" license = "Apache-2.0" @@ -14,32 +14,32 @@ harness = false [dependencies.console] package = "snarkvm-console-network" path = "../../console/network" -version = "=0.16.16" +version = "=0.16.17" [dependencies.snarkvm-algorithms] path = "../../algorithms" -version = "=0.16.16" +version = "=0.16.17" default-features = false features = [ "r1cs" ] [dependencies.snarkvm-circuit-environment-witness] path = "./witness" -version = "=0.16.16" +version = "=0.16.17" default-features = false [dependencies.snarkvm-curves] path = "../../curves" -version = "=0.16.16" +version = "=0.16.17" default-features = false [dependencies.snarkvm-fields] path = "../../fields" -version = "=0.16.16" +version = "=0.16.17" default-features = false [dependencies.snarkvm-utilities] path = "../../utilities" -version = "=0.16.16" +version = "=0.16.17" default-features = false [dependencies.indexmap] diff --git a/circuit/environment/witness/Cargo.toml b/circuit/environment/witness/Cargo.toml index 4323564618..591a64c1e9 100644 --- a/circuit/environment/witness/Cargo.toml +++ b/circuit/environment/witness/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-circuit-environment-witness" -version = "0.16.16" +version = "0.16.17" authors = [ "The Aleo Team " ] description = "A procedural macro to construct a witness in an environment" license = "Apache-2.0" diff --git a/circuit/network/Cargo.toml b/circuit/network/Cargo.toml index ec39c2518d..fb11937d6d 100644 --- a/circuit/network/Cargo.toml +++ b/circuit/network/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-circuit-network" -version = "0.16.16" +version = "0.16.17" authors = [ "The Aleo Team " ] description = "Network circuit library for a decentralized virtual machine" license = "Apache-2.0" @@ -9,20 +9,20 @@ edition = "2021" [dependencies.console] package = "snarkvm-console-network" path = "../../console/network" -version = "=0.16.16" +version = "=0.16.17" optional = true [dependencies.snarkvm-circuit-algorithms] path = "../algorithms" -version = "=0.16.16" +version = "=0.16.17" [dependencies.snarkvm-circuit-collections] path = "../collections" -version = "=0.16.16" +version = "=0.16.17" [dependencies.snarkvm-circuit-types] path = "../types" -version = "=0.16.16" +version = "=0.16.17" [dev-dependencies.snarkvm-console-types] path = "../../console/types" diff --git a/circuit/program/Cargo.toml b/circuit/program/Cargo.toml index 597ac2366f..2d845c2d35 100644 --- a/circuit/program/Cargo.toml +++ b/circuit/program/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-circuit-program" -version = "0.16.16" +version = "0.16.17" authors = [ "The Aleo Team " ] description = "Program circuit library for a decentralized virtual machine" license = "Apache-2.0" @@ -9,32 +9,32 @@ edition = "2021" [dependencies.console] package = "snarkvm-console-program" path = "../../console/program" -version = "=0.16.16" +version = "=0.16.17" optional = true [dependencies.snarkvm-circuit-account] path = "../account" -version = "=0.16.16" +version = "=0.16.17" [dependencies.snarkvm-circuit-algorithms] path = "../algorithms" -version = "=0.16.16" +version = "=0.16.17" [dependencies.snarkvm-circuit-collections] path = "../collections" -version = "=0.16.16" +version = "=0.16.17" [dependencies.snarkvm-circuit-network] path = "../network" -version = "=0.16.16" +version = "=0.16.17" [dependencies.snarkvm-circuit-types] path = "../types" -version = "=0.16.16" +version = "=0.16.17" [dependencies.snarkvm-utilities] path = "../../utilities" -version = "=0.16.16" +version = "=0.16.17" [dependencies.paste] version = "1.0" diff --git a/circuit/types/Cargo.toml b/circuit/types/Cargo.toml index 98e23156c1..d99a58b384 100644 --- a/circuit/types/Cargo.toml +++ b/circuit/types/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-circuit-types" -version = "0.16.16" +version = "0.16.17" authors = [ "The Aleo Team " ] description = "Primitive circuit for a decentralized virtual machine" license = "Apache-2.0" @@ -8,35 +8,35 @@ edition = "2021" [dependencies.snarkvm-circuit-environment] path = "../environment" -version = "=0.16.16" +version = "=0.16.17" [dependencies.snarkvm-circuit-types-address] path = "./address" -version = "=0.16.16" +version = "=0.16.17" [dependencies.snarkvm-circuit-types-boolean] path = "./boolean" -version = "=0.16.16" +version = "=0.16.17" [dependencies.snarkvm-circuit-types-field] path = "./field" -version = "=0.16.16" +version = "=0.16.17" [dependencies.snarkvm-circuit-types-group] path = "./group" -version = "=0.16.16" +version = "=0.16.17" [dependencies.snarkvm-circuit-types-integers] path = "./integers" -version = "=0.16.16" +version = "=0.16.17" [dependencies.snarkvm-circuit-types-scalar] path = "./scalar" -version = "=0.16.16" +version = "=0.16.17" [dependencies.snarkvm-circuit-types-string] path = "./string" -version = "=0.16.16" +version = "=0.16.17" [dev-dependencies.console] package = "snarkvm-console" diff --git a/circuit/types/address/Cargo.toml b/circuit/types/address/Cargo.toml index 88c993fd45..b21010f853 100644 --- a/circuit/types/address/Cargo.toml +++ b/circuit/types/address/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-circuit-types-address" -version = "0.16.16" +version = "0.16.17" authors = [ "The Aleo Team " ] description = "Address circuit for a decentralized virtual machine" license = "Apache-2.0" @@ -9,28 +9,28 @@ edition = "2021" [dependencies.console] package = "snarkvm-console-types-address" path = "../../../console/types/address" -version = "=0.16.16" +version = "=0.16.17" optional = true [dependencies.snarkvm-circuit-environment] path = "../../environment" -version = "=0.16.16" +version = "=0.16.17" [dependencies.snarkvm-circuit-types-boolean] path = "../boolean" -version = "=0.16.16" +version = "=0.16.17" [dependencies.snarkvm-circuit-types-field] path = "../field" -version = "=0.16.16" +version = "=0.16.17" [dependencies.snarkvm-circuit-types-group] path = "../group" -version = "=0.16.16" +version = "=0.16.17" [dependencies.snarkvm-circuit-types-scalar] path = "../scalar" -version = "=0.16.16" +version = "=0.16.17" [features] default = [ "enable_console" ] diff --git a/circuit/types/boolean/Cargo.toml b/circuit/types/boolean/Cargo.toml index 2e65ee5c25..93a84f69f2 100644 --- a/circuit/types/boolean/Cargo.toml +++ b/circuit/types/boolean/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-circuit-types-boolean" -version = "0.16.16" +version = "0.16.17" authors = [ "The Aleo Team " ] description = "Boolean circuit for a decentralized virtual machine" license = "Apache-2.0" @@ -14,12 +14,12 @@ harness = false [dependencies.console] package = "snarkvm-console-types-boolean" path = "../../../console/types/boolean" -version = "=0.16.16" +version = "=0.16.17" optional = true [dependencies.snarkvm-circuit-environment] path = "../../environment" -version = "=0.16.16" +version = "=0.16.17" [dev-dependencies.criterion] version = "0.5" diff --git a/circuit/types/field/Cargo.toml b/circuit/types/field/Cargo.toml index 12fb777813..5207ef0679 100644 --- a/circuit/types/field/Cargo.toml +++ b/circuit/types/field/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-circuit-types-field" -version = "0.16.16" +version = "0.16.17" authors = [ "The Aleo Team " ] description = "Field circuit for a decentralized virtual machine" license = "Apache-2.0" @@ -9,16 +9,16 @@ edition = "2021" [dependencies.console] package = "snarkvm-console-types-field" path = "../../../console/types/field" -version = "=0.16.16" +version = "=0.16.17" optional = true [dependencies.snarkvm-circuit-environment] path = "../../environment" -version = "=0.16.16" +version = "=0.16.17" [dependencies.snarkvm-circuit-types-boolean] path = "../boolean" -version = "=0.16.16" +version = "=0.16.17" [features] default = [ "enable_console" ] diff --git a/circuit/types/group/Cargo.toml b/circuit/types/group/Cargo.toml index ac9769c3e0..6c4446e1ff 100644 --- a/circuit/types/group/Cargo.toml +++ b/circuit/types/group/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-circuit-types-group" -version = "0.16.16" +version = "0.16.17" authors = [ "The Aleo Team " ] description = "Group circuit for a decentralized virtual machine" license = "Apache-2.0" @@ -9,24 +9,24 @@ edition = "2021" [dependencies.console] package = "snarkvm-console-types-group" path = "../../../console/types/group" -version = "=0.16.16" +version = "=0.16.17" optional = true [dependencies.snarkvm-circuit-environment] path = "../../environment" -version = "=0.16.16" +version = "=0.16.17" [dependencies.snarkvm-circuit-types-boolean] path = "../boolean" -version = "=0.16.16" +version = "=0.16.17" [dependencies.snarkvm-circuit-types-field] path = "../field" -version = "=0.16.16" +version = "=0.16.17" [dependencies.snarkvm-circuit-types-scalar] path = "../scalar" -version = "=0.16.16" +version = "=0.16.17" [dev-dependencies.snarkvm-utilities] path = "../../../utilities" diff --git a/circuit/types/integers/Cargo.toml b/circuit/types/integers/Cargo.toml index 77a40bb1d3..e92db6bbf3 100644 --- a/circuit/types/integers/Cargo.toml +++ b/circuit/types/integers/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-circuit-types-integers" -version = "0.16.16" +version = "0.16.17" authors = [ "The Aleo Team " ] description = "Integer circuit for a decentralized virtual machine" license = "Apache-2.0" @@ -9,24 +9,24 @@ edition = "2021" [dependencies.console] package = "snarkvm-console-types-integers" path = "../../../console/types/integers" -version = "=0.16.16" +version = "=0.16.17" optional = true [dependencies.snarkvm-circuit-environment] path = "../../environment" -version = "=0.16.16" +version = "=0.16.17" [dependencies.snarkvm-circuit-types-boolean] path = "../boolean" -version = "=0.16.16" +version = "=0.16.17" [dependencies.snarkvm-circuit-types-field] path = "../field" -version = "=0.16.16" +version = "=0.16.17" [dependencies.snarkvm-circuit-types-scalar] path = "../scalar" -version = "=0.16.16" +version = "=0.16.17" [dev-dependencies.snarkvm-utilities] path = "../../../utilities" diff --git a/circuit/types/scalar/Cargo.toml b/circuit/types/scalar/Cargo.toml index 86235bfb8b..e9f3116827 100644 --- a/circuit/types/scalar/Cargo.toml +++ b/circuit/types/scalar/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-circuit-types-scalar" -version = "0.16.16" +version = "0.16.17" authors = [ "The Aleo Team " ] description = "Scalar circuit for a decentralized virtual machine" license = "Apache-2.0" @@ -9,20 +9,20 @@ edition = "2021" [dependencies.console] package = "snarkvm-console-types-scalar" path = "../../../console/types/scalar" -version = "=0.16.16" +version = "=0.16.17" optional = true [dependencies.snarkvm-circuit-environment] path = "../../environment" -version = "=0.16.16" +version = "=0.16.17" [dependencies.snarkvm-circuit-types-boolean] path = "../boolean" -version = "=0.16.16" +version = "=0.16.17" [dependencies.snarkvm-circuit-types-field] path = "../field" -version = "=0.16.16" +version = "=0.16.17" [features] default = [ "enable_console" ] diff --git a/circuit/types/string/Cargo.toml b/circuit/types/string/Cargo.toml index 85d1db4e9d..4fde7c5569 100644 --- a/circuit/types/string/Cargo.toml +++ b/circuit/types/string/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-circuit-types-string" -version = "0.16.16" +version = "0.16.17" authors = [ "The Aleo Team " ] description = "String circuit for a decentralized virtual machine" license = "Apache-2.0" @@ -9,24 +9,24 @@ edition = "2021" [dependencies.console] package = "snarkvm-console-types-string" path = "../../../console/types/string" -version = "=0.16.16" +version = "=0.16.17" optional = true [dependencies.snarkvm-circuit-environment] path = "../../environment" -version = "=0.16.16" +version = "=0.16.17" [dependencies.snarkvm-circuit-types-boolean] path = "../boolean" -version = "=0.16.16" +version = "=0.16.17" [dependencies.snarkvm-circuit-types-field] path = "../field" -version = "=0.16.16" +version = "=0.16.17" [dependencies.snarkvm-circuit-types-integers] path = "../integers" -version = "=0.16.16" +version = "=0.16.17" [dev-dependencies.snarkvm-utilities] path = "../../../utilities" diff --git a/console/Cargo.toml b/console/Cargo.toml index 319e9ded59..2272d38ffe 100644 --- a/console/Cargo.toml +++ b/console/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-console" -version = "0.16.16" +version = "0.16.17" authors = [ "The Aleo Team " ] description = "Console environment for a decentralized virtual machine" license = "Apache-2.0" @@ -8,32 +8,32 @@ edition = "2021" [dependencies.snarkvm-console-account] path = "./account" -version = "=0.16.16" +version = "=0.16.17" optional = true [dependencies.snarkvm-console-algorithms] path = "./algorithms" -version = "=0.16.16" +version = "=0.16.17" optional = true [dependencies.snarkvm-console-collections] path = "./collections" -version = "=0.16.16" +version = "=0.16.17" optional = true [dependencies.snarkvm-console-network] path = "./network" -version = "=0.16.16" +version = "=0.16.17" optional = true [dependencies.snarkvm-console-program] path = "./program" -version = "=0.16.16" +version = "=0.16.17" optional = true [dependencies.snarkvm-console-types] path = "./types" -version = "=0.16.16" +version = "=0.16.17" optional = true [features] diff --git a/console/account/Cargo.toml b/console/account/Cargo.toml index ccdf01ea89..1985cb6d6e 100644 --- a/console/account/Cargo.toml +++ b/console/account/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-console-account" -version = "0.16.16" +version = "0.16.17" authors = [ "The Aleo Team " ] description = "Account operations for a decentralized virtual machine" license = "Apache-2.0" @@ -13,11 +13,11 @@ harness = false [dependencies.snarkvm-console-network] path = "../network" -version = "=0.16.16" +version = "=0.16.17" [dependencies.snarkvm-console-types] path = "../types" -version = "=0.16.16" +version = "=0.16.17" default-features = false features = [ "address", "boolean", "field", "group", "scalar" ] diff --git a/console/algorithms/Cargo.toml b/console/algorithms/Cargo.toml index a742a14837..652fcd458a 100644 --- a/console/algorithms/Cargo.toml +++ b/console/algorithms/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-console-algorithms" -version = "0.16.16" +version = "0.16.17" authors = [ "The Aleo Team " ] description = "Console algorithms for a decentralized virtual machine" license = "Apache-2.0" @@ -23,18 +23,18 @@ harness = false [dependencies.snarkvm-console-types] path = "../types" -version = "=0.16.16" +version = "=0.16.17" default-features = false features = [ "field", "group", "integers", "scalar" ] [dependencies.snarkvm-fields] path = "../../fields" -version = "=0.16.16" +version = "=0.16.17" default-features = false [dependencies.snarkvm-utilities] path = "../../utilities" -version = "=0.16.16" +version = "=0.16.17" [dependencies.blake2s_simd] version = "1.0" diff --git a/console/collections/Cargo.toml b/console/collections/Cargo.toml index a6fb2ba3c9..d283a40013 100644 --- a/console/collections/Cargo.toml +++ b/console/collections/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-console-collections" -version = "0.16.16" +version = "0.16.17" authors = [ "The Aleo Team " ] description = "Collections for a decentralized virtual machine" license = "Apache-2.0" @@ -18,11 +18,11 @@ harness = false [dependencies.snarkvm-console-algorithms] path = "../algorithms" -version = "=0.16.16" +version = "=0.16.17" [dependencies.snarkvm-console-types] path = "../types" -version = "=0.16.16" +version = "=0.16.17" default-features = false features = [ "field", "integers" ] diff --git a/console/network/Cargo.toml b/console/network/Cargo.toml index e731ca2c5e..1c7c906f31 100644 --- a/console/network/Cargo.toml +++ b/console/network/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-console-network" -version = "0.16.16" +version = "0.16.17" authors = [ "The Aleo Team " ] description = "Network console library for a decentralized virtual machine" license = "Apache-2.0" @@ -15,45 +15,45 @@ wasm = [ [dependencies.snarkvm-algorithms] path = "../../algorithms" -version = "=0.16.16" +version = "=0.16.17" default-features = false features = [ "snark" ] [dependencies.snarkvm-console-algorithms] path = "../algorithms" -version = "=0.16.16" +version = "=0.16.17" [dependencies.snarkvm-console-collections] path = "../collections" -version = "=0.16.16" +version = "=0.16.17" [dependencies.snarkvm-console-network-environment] path = "./environment" -version = "=0.16.16" +version = "=0.16.17" [dependencies.snarkvm-console-types] path = "../types" -version = "=0.16.16" +version = "=0.16.17" default-features = false features = [ "field", "group", "scalar" ] [dependencies.snarkvm-curves] path = "../../curves" -version = "=0.16.16" +version = "=0.16.17" default-features = false [dependencies.snarkvm-fields] path = "../../fields" -version = "=0.16.16" +version = "=0.16.17" default-features = false [dependencies.snarkvm-parameters] path = "../../parameters" -version = "=0.16.16" +version = "=0.16.17" [dependencies.snarkvm-utilities] path = "../../utilities" -version = "=0.16.16" +version = "=0.16.17" [dependencies.anyhow] version = "1.0.73" diff --git a/console/network/environment/Cargo.toml b/console/network/environment/Cargo.toml index deca5312f2..b91ccbd0d1 100644 --- a/console/network/environment/Cargo.toml +++ b/console/network/environment/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-console-network-environment" -version = "0.16.16" +version = "0.16.17" authors = [ "The Aleo Team " ] description = "Environment console library for a decentralized virtual machine" license = "Apache-2.0" @@ -8,17 +8,17 @@ edition = "2021" [dependencies.snarkvm-curves] path = "../../../curves" -version = "=0.16.16" +version = "=0.16.17" default-features = false [dependencies.snarkvm-fields] path = "../../../fields" -version = "=0.16.16" +version = "=0.16.17" default-features = false [dependencies.snarkvm-utilities] path = "../../../utilities" -version = "=0.16.16" +version = "=0.16.17" [dependencies.anyhow] version = "1.0.73" diff --git a/console/program/Cargo.toml b/console/program/Cargo.toml index 9ebcb0cdb9..9476219c2f 100644 --- a/console/program/Cargo.toml +++ b/console/program/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-console-program" -version = "0.16.16" +version = "0.16.17" authors = [ "The Aleo Team " ] description = "Program operations for a decentralized virtual machine" license = "Apache-2.0" @@ -12,27 +12,27 @@ test = [ ] [dependencies.snarkvm-console-account] path = "../account" -version = "=0.16.16" +version = "=0.16.17" [dependencies.snarkvm-console-algorithms] path = "../algorithms" -version = "=0.16.16" +version = "=0.16.17" [dependencies.snarkvm-console-collections] path = "../collections" -version = "=0.16.16" +version = "=0.16.17" [dependencies.snarkvm-console-network] path = "../network" -version = "=0.16.16" +version = "=0.16.17" [dependencies.snarkvm-console-types] path = "../types" -version = "=0.16.16" +version = "=0.16.17" [dependencies.snarkvm-utilities] path = "../../utilities" -version = "=0.16.16" +version = "=0.16.17" [dependencies.enum_index] version = "0.2" diff --git a/console/types/Cargo.toml b/console/types/Cargo.toml index b6c58870ad..852b456d88 100644 --- a/console/types/Cargo.toml +++ b/console/types/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-console-types" -version = "0.16.16" +version = "0.16.17" authors = [ "The Aleo Team " ] description = "Console types for a decentralized virtual machine" license = "Apache-2.0" @@ -13,41 +13,41 @@ harness = false [dependencies.snarkvm-console-network-environment] path = "../network/environment" -version = "=0.16.16" +version = "=0.16.17" [dependencies.snarkvm-console-types-address] path = "./address" -version = "=0.16.16" +version = "=0.16.17" optional = true [dependencies.snarkvm-console-types-boolean] path = "./boolean" -version = "=0.16.16" +version = "=0.16.17" optional = true [dependencies.snarkvm-console-types-field] path = "./field" -version = "=0.16.16" +version = "=0.16.17" optional = true [dependencies.snarkvm-console-types-group] path = "./group" -version = "=0.16.16" +version = "=0.16.17" optional = true [dependencies.snarkvm-console-types-integers] path = "./integers" -version = "=0.16.16" +version = "=0.16.17" optional = true [dependencies.snarkvm-console-types-scalar] path = "./scalar" -version = "=0.16.16" +version = "=0.16.17" optional = true [dependencies.snarkvm-console-types-string] path = "./string" -version = "=0.16.16" +version = "=0.16.17" optional = true [dev-dependencies.criterion] @@ -55,7 +55,6 @@ version = "0.5.1" [dev-dependencies.snarkvm-console-network] path = "../network" -version = "=0.16.16" [features] default = [ diff --git a/console/types/address/Cargo.toml b/console/types/address/Cargo.toml index fdaf4624b0..076f26702c 100644 --- a/console/types/address/Cargo.toml +++ b/console/types/address/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-console-types-address" -version = "0.16.16" +version = "0.16.17" authors = [ "The Aleo Team " ] description = "Type operations for a decentralized virtual machine" license = "Apache-2.0" @@ -8,19 +8,19 @@ edition = "2021" [dependencies.snarkvm-console-network-environment] path = "../../network/environment" -version = "=0.16.16" +version = "=0.16.17" [dependencies.snarkvm-console-types-boolean] path = "../boolean" -version = "=0.16.16" +version = "=0.16.17" [dependencies.snarkvm-console-types-field] path = "../field" -version = "=0.16.16" +version = "=0.16.17" [dependencies.snarkvm-console-types-group] path = "../group" -version = "=0.16.16" +version = "=0.16.17" [dev-dependencies.bincode] version = "1.3" diff --git a/console/types/boolean/Cargo.toml b/console/types/boolean/Cargo.toml index 86c908bffe..44882ba270 100644 --- a/console/types/boolean/Cargo.toml +++ b/console/types/boolean/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-console-types-boolean" -version = "0.16.16" +version = "0.16.17" authors = [ "The Aleo Team " ] description = "Type operations for a decentralized virtual machine" license = "Apache-2.0" @@ -8,7 +8,7 @@ edition = "2021" [dependencies.snarkvm-console-network-environment] path = "../../network/environment" -version = "=0.16.16" +version = "=0.16.17" [dev-dependencies.bincode] version = "1.3" diff --git a/console/types/field/Cargo.toml b/console/types/field/Cargo.toml index 526b401384..94ae1d9f7b 100644 --- a/console/types/field/Cargo.toml +++ b/console/types/field/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-console-types-field" -version = "0.16.16" +version = "0.16.17" authors = [ "The Aleo Team " ] description = "Type operations for a decentralized virtual machine" license = "Apache-2.0" @@ -8,11 +8,11 @@ edition = "2021" [dependencies.snarkvm-console-network-environment] path = "../../network/environment" -version = "=0.16.16" +version = "=0.16.17" [dependencies.snarkvm-console-types-boolean] path = "../boolean" -version = "=0.16.16" +version = "=0.16.17" [dependencies.zeroize] version = "1" diff --git a/console/types/group/Cargo.toml b/console/types/group/Cargo.toml index b250eb1315..e518874ba1 100644 --- a/console/types/group/Cargo.toml +++ b/console/types/group/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-console-types-group" -version = "0.16.16" +version = "0.16.17" authors = [ "The Aleo Team " ] description = "Type operations for a decentralized virtual machine" license = "Apache-2.0" @@ -8,19 +8,19 @@ edition = "2021" [dependencies.snarkvm-console-network-environment] path = "../../network/environment" -version = "=0.16.16" +version = "=0.16.17" [dependencies.snarkvm-console-types-boolean] path = "../boolean" -version = "=0.16.16" +version = "=0.16.17" [dependencies.snarkvm-console-types-field] path = "../field" -version = "=0.16.16" +version = "=0.16.17" [dependencies.snarkvm-console-types-scalar] path = "../scalar" -version = "=0.16.16" +version = "=0.16.17" [dev-dependencies.bincode] version = "1.3" diff --git a/console/types/integers/Cargo.toml b/console/types/integers/Cargo.toml index 693f52ed40..6fff38d551 100644 --- a/console/types/integers/Cargo.toml +++ b/console/types/integers/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-console-types-integers" -version = "0.16.16" +version = "0.16.17" authors = [ "The Aleo Team " ] description = "Type operations for a decentralized virtual machine" license = "Apache-2.0" @@ -8,19 +8,19 @@ edition = "2021" [dependencies.snarkvm-console-network-environment] path = "../../network/environment" -version = "=0.16.16" +version = "=0.16.17" [dependencies.snarkvm-console-types-boolean] path = "../boolean" -version = "=0.16.16" +version = "=0.16.17" [dependencies.snarkvm-console-types-field] path = "../field" -version = "=0.16.16" +version = "=0.16.17" [dependencies.snarkvm-console-types-scalar] path = "../scalar" -version = "=0.16.16" +version = "=0.16.17" [dev-dependencies.bincode] version = "1.3" diff --git a/console/types/scalar/Cargo.toml b/console/types/scalar/Cargo.toml index 149d40e3cc..39f56b2ad0 100644 --- a/console/types/scalar/Cargo.toml +++ b/console/types/scalar/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-console-types-scalar" -version = "0.16.16" +version = "0.16.17" authors = [ "The Aleo Team " ] description = "Type operations for a decentralized virtual machine" license = "Apache-2.0" @@ -8,15 +8,15 @@ edition = "2021" [dependencies.snarkvm-console-network-environment] path = "../../network/environment" -version = "=0.16.16" +version = "=0.16.17" [dependencies.snarkvm-console-types-boolean] path = "../boolean" -version = "=0.16.16" +version = "=0.16.17" [dependencies.snarkvm-console-types-field] path = "../field" -version = "=0.16.16" +version = "=0.16.17" [dependencies.zeroize] version = "1" diff --git a/console/types/string/Cargo.toml b/console/types/string/Cargo.toml index 480a3338f9..4607049f07 100644 --- a/console/types/string/Cargo.toml +++ b/console/types/string/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-console-types-string" -version = "0.16.16" +version = "0.16.17" authors = [ "The Aleo Team " ] description = "Type operations for a decentralized virtual machine" license = "Apache-2.0" @@ -8,19 +8,19 @@ edition = "2021" [dependencies.snarkvm-console-network-environment] path = "../../network/environment" -version = "=0.16.16" +version = "=0.16.17" [dependencies.snarkvm-console-types-boolean] path = "../boolean" -version = "=0.16.16" +version = "=0.16.17" [dependencies.snarkvm-console-types-field] path = "../field" -version = "=0.16.16" +version = "=0.16.17" [dependencies.snarkvm-console-types-integers] path = "../integers" -version = "=0.16.16" +version = "=0.16.17" [dev-dependencies.bincode] version = "1.3" diff --git a/curves/Cargo.toml b/curves/Cargo.toml index e2fa5b6f21..f4c6544f1c 100644 --- a/curves/Cargo.toml +++ b/curves/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-curves" -version = "0.16.16" +version = "0.16.17" authors = [ "The Aleo Team " ] description = "Curves for a decentralized virtual machine" homepage = "https://aleo.org" @@ -36,12 +36,12 @@ harness = false [dependencies.snarkvm-fields] path = "../fields" -version = "=0.16.16" +version = "=0.16.17" default-features = false [dependencies.snarkvm-utilities] path = "../utilities" -version = "=0.16.16" +version = "=0.16.17" default-features = false [dependencies.rand] diff --git a/fields/Cargo.toml b/fields/Cargo.toml index d610be066d..04b417867a 100644 --- a/fields/Cargo.toml +++ b/fields/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-fields" -version = "0.16.16" +version = "0.16.17" authors = [ "The Aleo Team " ] description = "Fields for a decentralized virtual machine" homepage = "https://aleo.org" @@ -25,7 +25,7 @@ edition = "2021" [dependencies.snarkvm-utilities] path = "../utilities" -version = "=0.16.16" +version = "=0.16.17" default-features = false [dependencies.aleo-std] diff --git a/ledger/Cargo.toml b/ledger/Cargo.toml index 1a72bd5500..8eda3911c2 100644 --- a/ledger/Cargo.toml +++ b/ledger/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-ledger" -version = "0.16.16" +version = "0.16.17" authors = [ "The Aleo Team " ] description = "A node ledger for a decentralized virtual machine" homepage = "https://aleo.org" @@ -57,54 +57,54 @@ timer = [ "aleo-std/timer" ] [dependencies.console] package = "snarkvm-console" path = "../console" -version = "=0.16.16" +version = "=0.16.17" [dependencies.ledger-authority] package = "snarkvm-ledger-authority" path = "./authority" -version = "=0.16.16" +version = "=0.16.17" [dependencies.ledger-block] package = "snarkvm-ledger-block" path = "./block" -version = "=0.16.16" +version = "=0.16.17" [dependencies.ledger-coinbase] package = "snarkvm-ledger-coinbase" path = "./coinbase" -version = "=0.16.16" +version = "=0.16.17" [dependencies.ledger-committee] package = "snarkvm-ledger-committee" path = "./committee" -version = "=0.16.16" +version = "=0.16.17" [dependencies.ledger-narwhal] package = "snarkvm-ledger-narwhal" path = "./narwhal" -version = "=0.16.16" +version = "=0.16.17" [dependencies.ledger-query] package = "snarkvm-ledger-query" path = "./query" -version = "=0.16.16" +version = "=0.16.17" features = [ "query" ] [dependencies.ledger-store] package = "snarkvm-ledger-store" path = "./store" -version = "=0.16.16" +version = "=0.16.17" [dependencies.ledger-test-helpers] package = "snarkvm-ledger-test-helpers" path = "./test-helpers" -version = "=0.16.16" +version = "=0.16.17" optional = true [dependencies.synthesizer] package = "snarkvm-synthesizer" path = "../synthesizer" -version = "=0.16.16" +version = "=0.16.17" [dependencies.aleo-std] version = "0.1.18" diff --git a/ledger/authority/Cargo.toml b/ledger/authority/Cargo.toml index f83ce83470..d64629f014 100644 --- a/ledger/authority/Cargo.toml +++ b/ledger/authority/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-ledger-authority" -version = "0.16.16" +version = "0.16.17" authors = [ "The Aleo Team " ] description = "Data structures for a block authority in a decentralized virtual machine" homepage = "https://aleo.org" @@ -32,12 +32,12 @@ test-helpers = [ "narwhal-subdag/test-helpers" ] [dependencies.console] package = "snarkvm-console" path = "../../console" -version = "=0.16.16" +version = "=0.16.17" [dependencies.narwhal-subdag] package = "snarkvm-ledger-narwhal-subdag" path = "../narwhal/subdag" -version = "=0.16.16" +version = "=0.16.17" [dependencies.anyhow] version = "1" diff --git a/ledger/block/Cargo.toml b/ledger/block/Cargo.toml index 4065a13605..bd70df400f 100644 --- a/ledger/block/Cargo.toml +++ b/ledger/block/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-ledger-block" -version = "0.16.16" +version = "0.16.17" authors = [ "The Aleo Team " ] description = "A block for a decentralized virtual machine" homepage = "https://aleo.org" @@ -39,47 +39,47 @@ test = [ ] [dependencies.console] package = "snarkvm-console" path = "../../console" -version = "=0.16.16" +version = "=0.16.17" [dependencies.ledger-authority] package = "snarkvm-ledger-authority" path = "../authority" -version = "=0.16.16" +version = "=0.16.17" [dependencies.ledger-coinbase] package = "snarkvm-ledger-coinbase" path = "../../ledger/coinbase" -version = "=0.16.16" +version = "=0.16.17" [dependencies.ledger-committee] package = "snarkvm-ledger-committee" path = "../../ledger/committee" -version = "=0.16.16" +version = "=0.16.17" [dependencies.ledger-narwhal-batch-header] package = "snarkvm-ledger-narwhal-batch-header" path = "../narwhal/batch-header" -version = "=0.16.16" +version = "=0.16.17" [dependencies.ledger-narwhal-subdag] package = "snarkvm-ledger-narwhal-subdag" path = "../narwhal/subdag" -version = "=0.16.16" +version = "=0.16.17" [dependencies.ledger-narwhal-transmission-id] package = "snarkvm-ledger-narwhal-transmission-id" path = "../narwhal/transmission-id" -version = "=0.16.16" +version = "=0.16.17" [dependencies.synthesizer-program] package = "snarkvm-synthesizer-program" path = "../../synthesizer/program" -version = "=0.16.16" +version = "=0.16.17" [dependencies.synthesizer-snark] package = "snarkvm-synthesizer-snark" path = "../../synthesizer/snark" -version = "=0.16.16" +version = "=0.16.17" [dependencies.indexmap] version = "2.0" diff --git a/ledger/coinbase/Cargo.toml b/ledger/coinbase/Cargo.toml index 2d1d5ad41a..13af04ed03 100644 --- a/ledger/coinbase/Cargo.toml +++ b/ledger/coinbase/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-ledger-coinbase" -version = "0.16.16" +version = "0.16.17" authors = [ "The Aleo Team " ] description = "Coinbase puzzle for a decentralized virtual machine" homepage = "https://aleo.org" @@ -50,27 +50,27 @@ wasm = [ [dependencies.console] package = "snarkvm-console" path = "../../console" -version = "=0.16.16" +version = "=0.16.17" [dependencies.snarkvm-algorithms] path = "../../algorithms" -version = "=0.16.16" +version = "=0.16.17" [dependencies.snarkvm-curves] path = "../../curves" -version = "=0.16.16" +version = "=0.16.17" [dependencies.snarkvm-fields] path = "../../fields" -version = "=0.16.16" +version = "=0.16.17" [dependencies.snarkvm-synthesizer-snark] path = "../../synthesizer/snark" -version = "=0.16.16" +version = "=0.16.17" [dependencies.snarkvm-utilities] path = "../../utilities" -version = "=0.16.16" +version = "=0.16.17" default-features = false [dependencies.aleo-std] diff --git a/ledger/committee/Cargo.toml b/ledger/committee/Cargo.toml index e95eeb5c99..bcd07550ea 100644 --- a/ledger/committee/Cargo.toml +++ b/ledger/committee/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-ledger-committee" -version = "0.16.16" +version = "0.16.17" authors = [ "The Aleo Team " ] description = "A committee for a decentralized virtual machine" homepage = "https://aleo.org" @@ -34,7 +34,7 @@ test-helpers = [ "prop-tests", "rand_distr" ] [dependencies.console] package = "snarkvm-console" path = "../../console" -version = "=0.16.16" +version = "=0.16.17" [dependencies.indexmap] version = "2.0" @@ -43,7 +43,7 @@ features = [ "serde", "rayon" ] [dependencies.metrics] package = "snarkvm-metrics" path = "../../metrics" -version = "=0.16.16" +version = "=0.16.17" optional = true [dependencies.serde_json] diff --git a/ledger/narwhal/Cargo.toml b/ledger/narwhal/Cargo.toml index 2a20f76116..a149a660dc 100644 --- a/ledger/narwhal/Cargo.toml +++ b/ledger/narwhal/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-ledger-narwhal" -version = "0.16.16" +version = "0.16.17" authors = [ "The Aleo Team " ] description = "Data structures for a Narwhal-style memory pool in a decentralized virtual machine" homepage = "https://aleo.org" @@ -64,37 +64,37 @@ transmission-id = [ "narwhal-transmission-id" ] [dependencies.narwhal-batch-certificate] package = "snarkvm-ledger-narwhal-batch-certificate" path = "./batch-certificate" -version = "=0.16.16" +version = "=0.16.17" optional = true [dependencies.narwhal-batch-header] package = "snarkvm-ledger-narwhal-batch-header" path = "./batch-header" -version = "=0.16.16" +version = "=0.16.17" optional = true [dependencies.narwhal-data] package = "snarkvm-ledger-narwhal-data" path = "./data" -version = "=0.16.16" +version = "=0.16.17" optional = true [dependencies.narwhal-subdag] package = "snarkvm-ledger-narwhal-subdag" path = "./subdag" -version = "=0.16.16" +version = "=0.16.17" optional = true [dependencies.narwhal-transmission] package = "snarkvm-ledger-narwhal-transmission" path = "./transmission" -version = "=0.16.16" +version = "=0.16.17" optional = true [dependencies.narwhal-transmission-id] package = "snarkvm-ledger-narwhal-transmission-id" path = "./transmission-id" -version = "=0.16.16" +version = "=0.16.17" optional = true [dev-dependencies.snarkvm-ledger-narwhal] diff --git a/ledger/narwhal/batch-certificate/Cargo.toml b/ledger/narwhal/batch-certificate/Cargo.toml index e37c115fe1..8393b9b6bb 100644 --- a/ledger/narwhal/batch-certificate/Cargo.toml +++ b/ledger/narwhal/batch-certificate/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-ledger-narwhal-batch-certificate" -version = "0.16.16" +version = "0.16.17" authors = [ "The Aleo Team " ] description = "A batch certificate for a Narwhal-style memory pool in a decentralized virtual machine" homepage = "https://aleo.org" @@ -32,17 +32,17 @@ test-helpers = [ "narwhal-batch-header/test-helpers" ] [dependencies.console] package = "snarkvm-console" path = "../../../console" -version = "=0.16.16" +version = "=0.16.17" [dependencies.narwhal-batch-header] package = "snarkvm-ledger-narwhal-batch-header" path = "../batch-header" -version = "=0.16.16" +version = "=0.16.17" [dependencies.narwhal-transmission-id] package = "snarkvm-ledger-narwhal-transmission-id" path = "../transmission-id" -version = "=0.16.16" +version = "=0.16.17" [dependencies.indexmap] version = "2.0" diff --git a/ledger/narwhal/batch-header/Cargo.toml b/ledger/narwhal/batch-header/Cargo.toml index a17cea25f2..aa6d75ce06 100644 --- a/ledger/narwhal/batch-header/Cargo.toml +++ b/ledger/narwhal/batch-header/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-ledger-narwhal-batch-header" -version = "0.16.16" +version = "0.16.17" authors = [ "The Aleo Team " ] description = "A batch header for a Narwhal-style memory pool in a decentralized virtual machine" homepage = "https://aleo.org" @@ -32,12 +32,12 @@ test-helpers = [ "narwhal-transmission-id/test-helpers", "time" ] [dependencies.console] package = "snarkvm-console" path = "../../../console" -version = "=0.16.16" +version = "=0.16.17" [dependencies.narwhal-transmission-id] package = "snarkvm-ledger-narwhal-transmission-id" path = "../transmission-id" -version = "=0.16.16" +version = "=0.16.17" [dependencies.indexmap] version = "2.0" diff --git a/ledger/narwhal/data/Cargo.toml b/ledger/narwhal/data/Cargo.toml index 017942e977..a47b1ab8f6 100644 --- a/ledger/narwhal/data/Cargo.toml +++ b/ledger/narwhal/data/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-ledger-narwhal-data" -version = "0.16.16" +version = "0.16.17" authors = [ "The Aleo Team " ] description = "A batch certificate for a Narwhal-style memory pool in a decentralized virtual machine" homepage = "https://aleo.org" @@ -29,7 +29,7 @@ async = [ "tokio" ] [dependencies.console] package = "snarkvm-console" path = "../../../console" -version = "=0.16.16" +version = "=0.16.17" [dependencies.bytes] version = "1" diff --git a/ledger/narwhal/subdag/Cargo.toml b/ledger/narwhal/subdag/Cargo.toml index 0d9d74d88f..9f7eebc578 100644 --- a/ledger/narwhal/subdag/Cargo.toml +++ b/ledger/narwhal/subdag/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-ledger-narwhal-subdag" -version = "0.16.16" +version = "0.16.17" authors = [ "The Aleo Team " ] description = "A subdag for a Narwhal-style memory pool in a decentralized virtual machine" homepage = "https://aleo.org" @@ -32,22 +32,22 @@ test-helpers = [ "narwhal-batch-certificate/test-helpers" ] [dependencies.console] package = "snarkvm-console" path = "../../../console" -version = "=0.16.16" +version = "=0.16.17" [dependencies.narwhal-batch-certificate] package = "snarkvm-ledger-narwhal-batch-certificate" path = "../batch-certificate" -version = "=0.16.16" +version = "=0.16.17" [dependencies.narwhal-batch-header] package = "snarkvm-ledger-narwhal-batch-header" path = "../batch-header" -version = "=0.16.16" +version = "=0.16.17" [dependencies.narwhal-transmission-id] package = "snarkvm-ledger-narwhal-transmission-id" path = "../transmission-id" -version = "=0.16.16" +version = "=0.16.17" [dependencies.indexmap] version = "2.0" diff --git a/ledger/narwhal/transmission-id/Cargo.toml b/ledger/narwhal/transmission-id/Cargo.toml index 627f9cd371..a4011b8a7d 100644 --- a/ledger/narwhal/transmission-id/Cargo.toml +++ b/ledger/narwhal/transmission-id/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-ledger-narwhal-transmission-id" -version = "0.16.16" +version = "0.16.17" authors = [ "The Aleo Team " ] description = "A transmission ID for a Narwhal-style memory pool in a decentralized virtual machine" homepage = "https://aleo.org" @@ -32,12 +32,12 @@ test-helpers = [ ] [dependencies.console] package = "snarkvm-console" path = "../../../console" -version = "=0.16.16" +version = "=0.16.17" [dependencies.ledger-coinbase] package = "snarkvm-ledger-coinbase" path = "../../coinbase" -version = "=0.16.16" +version = "=0.16.17" [dev-dependencies.bincode] version = "1.3" diff --git a/ledger/narwhal/transmission/Cargo.toml b/ledger/narwhal/transmission/Cargo.toml index 192a5b0b8e..d370f98cba 100644 --- a/ledger/narwhal/transmission/Cargo.toml +++ b/ledger/narwhal/transmission/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-ledger-narwhal-transmission" -version = "0.16.16" +version = "0.16.17" authors = [ "The Aleo Team " ] description = "A transmission for a Narwhal-style memory pool in a decentralized virtual machine" homepage = "https://aleo.org" @@ -32,22 +32,22 @@ test-helpers = [ ] [dependencies.console] package = "snarkvm-console" path = "../../../console" -version = "=0.16.16" +version = "=0.16.17" [dependencies.ledger-block] package = "snarkvm-ledger-block" path = "../../block" -version = "=0.16.16" +version = "=0.16.17" [dependencies.ledger-coinbase] package = "snarkvm-ledger-coinbase" path = "../../coinbase" -version = "=0.16.16" +version = "=0.16.17" [dependencies.ledger-narwhal-data] package = "snarkvm-ledger-narwhal-data" path = "../data" -version = "=0.16.16" +version = "=0.16.17" [dependencies.bytes] version = "1" diff --git a/ledger/query/Cargo.toml b/ledger/query/Cargo.toml index 0bdfaa087c..7bea768120 100644 --- a/ledger/query/Cargo.toml +++ b/ledger/query/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-ledger-query" -version = "0.16.16" +version = "0.16.17" authors = [ "The Aleo Team " ] description = "A query for a decentralized virtual machine" homepage = "https://aleo.org" @@ -34,18 +34,18 @@ query = [ "ledger-store", "synthesizer-program", "ureq" ] [dependencies.console] package = "snarkvm-console" path = "../../console" -version = "=0.16.16" +version = "=0.16.17" [dependencies.ledger-store] package = "snarkvm-ledger-store" path = "../store" -version = "=0.16.16" +version = "=0.16.17" optional = true [dependencies.synthesizer-program] package = "snarkvm-synthesizer-program" path = "../../synthesizer/program" -version = "=0.16.16" +version = "=0.16.17" optional = true [dependencies.async-trait] diff --git a/ledger/store/Cargo.toml b/ledger/store/Cargo.toml index 1de3f3d700..0200f831ff 100644 --- a/ledger/store/Cargo.toml +++ b/ledger/store/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-ledger-store" -version = "0.16.16" +version = "0.16.17" authors = [ "The Aleo Team " ] description = "A data store for a decentralized virtual machine" homepage = "https://aleo.org" @@ -42,42 +42,42 @@ test = [ ] [dependencies.console] package = "snarkvm-console" path = "../../console" -version = "=0.16.16" +version = "=0.16.17" [dependencies.ledger-authority] package = "snarkvm-ledger-authority" path = "../authority" -version = "=0.16.16" +version = "=0.16.17" [dependencies.ledger-block] package = "snarkvm-ledger-block" path = "../block" -version = "=0.16.16" +version = "=0.16.17" [dependencies.ledger-coinbase] package = "snarkvm-ledger-coinbase" path = "../coinbase" -version = "=0.16.16" +version = "=0.16.17" [dependencies.ledger-committee] package = "snarkvm-ledger-committee" path = "../committee" -version = "=0.16.16" +version = "=0.16.17" [dependencies.ledger-narwhal-batch-certificate] package = "snarkvm-ledger-narwhal-batch-certificate" path = "../narwhal/batch-certificate" -version = "=0.16.16" +version = "=0.16.17" [dependencies.synthesizer-program] package = "snarkvm-synthesizer-program" path = "../../synthesizer/program" -version = "=0.16.16" +version = "=0.16.17" [dependencies.synthesizer-snark] package = "snarkvm-synthesizer-snark" path = "../../synthesizer/snark" -version = "=0.16.16" +version = "=0.16.17" [dependencies.aleo-std] version = "0.1.18" diff --git a/ledger/test-helpers/Cargo.toml b/ledger/test-helpers/Cargo.toml index 039ce0a5a1..8590b29ca3 100644 --- a/ledger/test-helpers/Cargo.toml +++ b/ledger/test-helpers/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-ledger-test-helpers" -version = "0.16.16" +version = "0.16.17" authors = [ "The Aleo Team " ] description = "Test helpers for a decentralized virtual machine" homepage = "https://aleo.org" @@ -19,39 +19,39 @@ edition = "2021" [dependencies.console] package = "snarkvm-console" path = "../../console" -version = "=0.16.16" +version = "=0.16.17" [dependencies.circuit] package = "snarkvm-circuit" path = "../../circuit" -version = "=0.16.16" +version = "=0.16.17" [dependencies.ledger-block] package = "snarkvm-ledger-block" path = "../block" -version = "=0.16.16" +version = "=0.16.17" [dependencies.ledger-query] package = "snarkvm-ledger-query" path = "../query" -version = "=0.16.16" +version = "=0.16.17" default-features = false features = [ "query" ] [dependencies.ledger-store] package = "snarkvm-ledger-store" path = "../store" -version = "=0.16.16" +version = "=0.16.17" [dependencies.synthesizer-program] package = "snarkvm-synthesizer-program" path = "../../synthesizer/program" -version = "=0.16.16" +version = "=0.16.17" [dependencies.synthesizer-process] package = "snarkvm-synthesizer-process" path = "../../synthesizer/process" -version = "=0.16.16" +version = "=0.16.17" [dependencies.once_cell] version = "1.18" diff --git a/metrics/Cargo.toml b/metrics/Cargo.toml index 3609d0567b..05440115c0 100644 --- a/metrics/Cargo.toml +++ b/metrics/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-metrics" -version = "0.16.16" +version = "0.16.17" authors = [ "The Aleo Team " ] description = "Metrics for a decentralized virtual machine" homepage = "https://aleo.org" diff --git a/parameters/Cargo.toml b/parameters/Cargo.toml index 7ee14c4f66..1e59969d3e 100644 --- a/parameters/Cargo.toml +++ b/parameters/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-parameters" -version = "0.16.16" +version = "0.16.17" authors = [ "The Aleo Team " ] description = "Parameters for a decentralized virtual machine" homepage = "https://aleo.org" @@ -31,12 +31,12 @@ wasm = [ "encoding", "js-sys", "web-sys" ] [dependencies.snarkvm-curves] path = "../curves" -version = "=0.16.16" +version = "=0.16.17" default-features = false [dependencies.snarkvm-utilities] path = "../utilities" -version = "=0.16.16" +version = "=0.16.17" [dependencies.aleo-std] version = "0.1.18" diff --git a/synthesizer/Cargo.toml b/synthesizer/Cargo.toml index b020f197ef..80f46b734c 100644 --- a/synthesizer/Cargo.toml +++ b/synthesizer/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-synthesizer" -version = "0.16.16" +version = "0.16.17" authors = [ "The Aleo Team " ] description = "Synthesizer for a decentralized virtual machine" homepage = "https://aleo.org" @@ -69,61 +69,61 @@ harness = false [dependencies.algorithms] package = "snarkvm-algorithms" path = "../algorithms" -version = "=0.16.16" +version = "=0.16.17" [dependencies.circuit] package = "snarkvm-circuit" path = "../circuit" -version = "=0.16.16" +version = "=0.16.17" [dependencies.console] package = "snarkvm-console" path = "../console" -version = "=0.16.16" +version = "=0.16.17" [dependencies.ledger-block] package = "snarkvm-ledger-block" path = "../ledger/block" -version = "=0.16.16" +version = "=0.16.17" [dependencies.ledger-coinbase] package = "snarkvm-ledger-coinbase" path = "../ledger/coinbase" -version = "=0.16.16" +version = "=0.16.17" [dependencies.ledger-committee] package = "snarkvm-ledger-committee" path = "../ledger/committee" -version = "=0.16.16" +version = "=0.16.17" [dependencies.ledger-query] package = "snarkvm-ledger-query" path = "../ledger/query" -version = "=0.16.16" +version = "=0.16.17" default-features = false features = [ "query" ] [dependencies.ledger-store] package = "snarkvm-ledger-store" path = "../ledger/store" -version = "=0.16.16" +version = "=0.16.17" [dependencies.synthesizer-process] package = "snarkvm-synthesizer-process" path = "./process" -version = "=0.16.16" +version = "=0.16.17" optional = true [dependencies.synthesizer-program] package = "snarkvm-synthesizer-program" path = "./program" -version = "=0.16.16" +version = "=0.16.17" optional = true [dependencies.synthesizer-snark] package = "snarkvm-synthesizer-snark" path = "./snark" -version = "=0.16.16" +version = "=0.16.17" optional = true [dependencies.aleo-std] diff --git a/synthesizer/process/Cargo.toml b/synthesizer/process/Cargo.toml index 6ed039bcf3..c350fd71be 100644 --- a/synthesizer/process/Cargo.toml +++ b/synthesizer/process/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-synthesizer-process" -version = "0.16.16" +version = "0.16.17" authors = [ "The Aleo Team " ] description = "A process for a decentralized virtual machine" homepage = "https://aleo.org" @@ -48,45 +48,45 @@ timer = [ "aleo-std/timer" ] [dependencies.console] package = "snarkvm-console" path = "../../console" -version = "=0.16.16" +version = "=0.16.17" default-features = false features = [ "network", "program", "types" ] [dependencies.circuit] package = "snarkvm-circuit" path = "../../circuit" -version = "=0.16.16" +version = "=0.16.17" [dependencies.ledger-block] package = "snarkvm-ledger-block" path = "../../ledger/block" -version = "=0.16.16" +version = "=0.16.17" [dependencies.ledger-query] package = "snarkvm-ledger-query" path = "../../ledger/query" -version = "=0.16.16" +version = "=0.16.17" default-features = false [dependencies.ledger-store] package = "snarkvm-ledger-store" path = "../../ledger/store" -version = "=0.16.16" +version = "=0.16.17" [dependencies.synthesizer-program] package = "snarkvm-synthesizer-program" path = "../../synthesizer/program" -version = "=0.16.16" +version = "=0.16.17" [dependencies.synthesizer-snark] package = "snarkvm-synthesizer-snark" path = "../../synthesizer/snark" -version = "=0.16.16" +version = "=0.16.17" [dependencies.utilities] package = "snarkvm-utilities" path = "../../utilities" -version = "=0.16.16" +version = "=0.16.17" [dependencies.aleo-std] version = "0.1.18" diff --git a/synthesizer/program/Cargo.toml b/synthesizer/program/Cargo.toml index 337f422845..96da3fb6e7 100644 --- a/synthesizer/program/Cargo.toml +++ b/synthesizer/program/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-synthesizer-program" -version = "0.16.16" +version = "0.16.17" authors = [ "The Aleo Team " ] description = "Program for a decentralized virtual machine" homepage = "https://aleo.org" @@ -31,12 +31,12 @@ wasm = [ "console/wasm" ] [dependencies.circuit] package = "snarkvm-circuit" path = "../../circuit" -version = "=0.16.16" +version = "=0.16.17" [dependencies.console] package = "snarkvm-console" path = "../../console" -version = "=0.16.16" +version = "=0.16.17" default-features = false features = [ "account", "network", "program", "types" ] diff --git a/synthesizer/snark/Cargo.toml b/synthesizer/snark/Cargo.toml index 9e1b4db620..ce56d1e5b3 100644 --- a/synthesizer/snark/Cargo.toml +++ b/synthesizer/snark/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-synthesizer-snark" -version = "0.16.16" +version = "0.16.17" authors = [ "The Aleo Team " ] description = "SNARK wrappers for a decentralized virtual machine" homepage = "https://aleo.org" @@ -33,18 +33,18 @@ wasm = [ "console/wasm", "snarkvm-algorithms/wasm" ] [dependencies.circuit] package = "snarkvm-circuit" path = "../../circuit" -version = "=0.16.16" +version = "=0.16.17" [dependencies.console] package = "snarkvm-console" path = "../../console" -version = "=0.16.16" +version = "=0.16.17" default-features = false features = [ "network" ] [dependencies.snarkvm-algorithms] path = "../../algorithms" -version = "=0.16.16" +version = "=0.16.17" [dependencies.bincode] version = "1" diff --git a/utilities/Cargo.toml b/utilities/Cargo.toml index 99583002e7..1887909cef 100644 --- a/utilities/Cargo.toml +++ b/utilities/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-utilities" -version = "0.16.16" +version = "0.16.17" authors = [ "The Aleo Team " ] description = "Utilities for a decentralized virtual machine" homepage = "https://aleo.org" @@ -25,7 +25,7 @@ edition = "2021" [dependencies.snarkvm-utilities-derives] path = "./derives" -version = "=0.16.16" +version = "=0.16.17" optional = true [dependencies.aleo-std] diff --git a/utilities/derives/Cargo.toml b/utilities/derives/Cargo.toml index dba4c9ea07..cb87818787 100644 --- a/utilities/derives/Cargo.toml +++ b/utilities/derives/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-utilities-derives" -version = "0.16.16" +version = "0.16.17" authors = [ "The Aleo Team " ] description = "Canonical serialization for a decentralized virtual machine" homepage = "https://aleo.org" diff --git a/wasm/Cargo.toml b/wasm/Cargo.toml index 65bafca14b..f95a4ff469 100644 --- a/wasm/Cargo.toml +++ b/wasm/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-wasm" -version = "0.16.16" +version = "0.16.17" authors = [ "The Aleo Team " ] description = "WASM for a decentralized virtual machine" homepage = "https://aleo.org" @@ -51,54 +51,54 @@ utilities = [ "snarkvm-utilities" ] [dependencies.snarkvm-circuit-network] path = "../circuit/network" -version = "=0.16.16" +version = "=0.16.17" features = [ "wasm" ] optional = true [dependencies.snarkvm-console] path = "../console" -version = "=0.16.16" +version = "=0.16.17" features = [ "wasm" ] optional = true [dependencies.snarkvm-curves] path = "../curves" -version = "=0.16.16" +version = "=0.16.17" optional = true [dependencies.snarkvm-fields] path = "../fields" -version = "=0.16.16" +version = "=0.16.17" optional = true [dependencies.snarkvm-ledger-block] path = "../ledger/block" -version = "=0.16.16" +version = "=0.16.17" features = [ "wasm" ] optional = true [dependencies.snarkvm-ledger-query] path = "../ledger/query" -version = "=0.16.16" +version = "=0.16.17" features = [ "async", "wasm" ] optional = true [dependencies.snarkvm-ledger-store] path = "../ledger/store" -version = "=0.16.16" +version = "=0.16.17" features = [ "wasm" ] optional = true [dependencies.snarkvm-synthesizer] path = "../synthesizer" -version = "=0.16.16" +version = "=0.16.17" default-features = false features = [ "async", "wasm" ] optional = true [dependencies.snarkvm-utilities] path = "../utilities" -version = "=0.16.16" +version = "=0.16.17" features = [ "wasm" ] optional = true From 6909e62c441adf334d18472bded6f4540ebd50f6 Mon Sep 17 00:00:00 2001 From: raychu86 <14917648+raychu86@users.noreply.github.com> Date: Sat, 20 Jan 2024 15:11:19 -0800 Subject: [PATCH 196/298] Check solution ids that should exist in the ledger --- ledger/block/src/verify.rs | 45 ++++++++++++++++++++++------------ ledger/src/check_next_block.rs | 9 ++++++- 2 files changed, 38 insertions(+), 16 deletions(-) diff --git a/ledger/block/src/verify.rs b/ledger/block/src/verify.rs index 2d9ab54a5f..c5a7ff95da 100644 --- a/ledger/block/src/verify.rs +++ b/ledger/block/src/verify.rs @@ -35,13 +35,18 @@ impl Block { current_epoch_challenge: &EpochChallenge, current_timestamp: i64, ratified_finalize_operations: Vec>, - ) -> Result> { + ) -> Result<(Vec>, Vec)> { // Ensure the block hash is correct. self.verify_hash(previous_block.height(), previous_block.hash())?; // Ensure the block authority is correct. - let (expected_round, expected_height, expected_timestamp, expected_existing_transaction_ids) = - self.verify_authority(previous_block.round(), previous_block.height(), current_committee)?; + let ( + expected_round, + expected_height, + expected_timestamp, + expected_existing_solution_ids, + expected_existing_transaction_ids, + ) = self.verify_authority(previous_block.round(), previous_block.height(), current_committee)?; // Ensure the block solutions are correct. let ( @@ -94,8 +99,8 @@ impl Block { current_timestamp, )?; - // Return the expected existing transaction ids. - Ok(expected_existing_transaction_ids) + // Return the expected existing transaction id and solution ids. + Ok((expected_existing_solution_ids, expected_existing_transaction_ids)) } } @@ -139,7 +144,7 @@ impl Block { previous_round: u64, previous_height: u32, current_committee: &Committee, - ) -> Result<(u64, u32, i64, Vec)> { + ) -> Result<(u64, u32, i64, Vec>, Vec)> { // Note: Do not remove this. This ensures that all blocks after genesis are quorum blocks. #[cfg(not(any(test, feature = "test")))] ensure!(self.authority.is_quorum(), "The next block must be a quorum block"); @@ -174,8 +179,8 @@ impl Block { ); // Ensure the block authority is correct. - // Determine the transaction IDs expected to be in previous blocks. - let expected_existing_transaction_ids = match &self.authority { + // Determine the transaction ID and solution IDs expected to be in previous blocks. + let (expected_existing_solution_ids, expected_existing_transaction_ids) = match &self.authority { Authority::Beacon(signature) => { // Retrieve the signer. let signer = signature.to_address(); @@ -190,7 +195,7 @@ impl Block { "Signature is invalid in block {expected_height}" ); - vec![] + (vec![], vec![]) } Authority::Quorum(subdag) => { // Compute the expected leader. @@ -221,7 +226,13 @@ impl Block { }; // Return success. - Ok((expected_round, expected_height, expected_timestamp, expected_existing_transaction_ids)) + Ok(( + expected_round, + expected_height, + expected_timestamp, + expected_existing_solution_ids, + expected_existing_transaction_ids, + )) } /// Ensures the block ratifications are correct. @@ -523,13 +534,14 @@ impl Block { } /// Checks that the transmission IDs in the given subdag matches the solutions and transactions in the block. + /// Returns the IDs of the transactions and solutions that should already exist in the ledger. pub(super) fn check_subdag_transmissions( subdag: &Subdag, solutions: &Option>, aborted_solution_ids: &[PuzzleCommitment], transactions: &Transactions, aborted_transaction_ids: &[N::TransactionID], - ) -> Result> { + ) -> Result<(Vec>, Vec)> { // Prepare an iterator over the solution IDs. let mut solutions = solutions.as_ref().map(|s| s.deref()).into_iter().flatten().peekable(); // Prepare an iterator over the unconfirmed transaction IDs. @@ -565,7 +577,7 @@ impl Block { } // Otherwise, add the solution ID to the aborted or existing list. _ => { - if !aborted_or_existing_solution_ids.insert(solution_id) { + if !aborted_or_existing_solution_ids.insert(*solution_id) { bail!("Block contains a duplicate aborted solution ID (found '{solution_id}')"); } } @@ -594,11 +606,10 @@ impl Block { // Ensure there are no more transactions in the block. ensure!(unconfirmed_transaction_ids.next().is_none(), "There exists more transactions than expected."); - // TODO: Move this check to be outside of this method, and check against the ledger for existence. // Ensure the aborted solution IDs match. for aborted_solution_id in aborted_solution_ids { // If the aborted transaction ID is not found, throw an error. - if !aborted_or_existing_solution_ids.contains(&aborted_solution_id) { + if !aborted_or_existing_solution_ids.contains(aborted_solution_id) { bail!( "Block contains an aborted solution ID that is not found in the subdag (found '{aborted_solution_id}')" ); @@ -614,6 +625,10 @@ impl Block { } } + // Retrieve the solution ids that should already exist in the ledger. + let existing_solution_ids: Vec<_> = + aborted_or_existing_solution_ids.iter().filter(|id| !aborted_solution_ids.contains(id)).copied().collect(); + // Retrieve the transaction ids that should already exist in the ledger. let existing_transaction_ids: Vec<_> = aborted_or_existing_transaction_ids .iter() @@ -621,6 +636,6 @@ impl Block { .copied() .collect(); - Ok(existing_transaction_ids) + Ok((existing_solution_ids, existing_transaction_ids)) } } diff --git a/ledger/src/check_next_block.rs b/ledger/src/check_next_block.rs index b99b3c8fff..e10425cba5 100644 --- a/ledger/src/check_next_block.rs +++ b/ledger/src/check_next_block.rs @@ -83,7 +83,7 @@ impl> Ledger { self.vm.check_speculate(state, block.ratifications(), block.solutions(), block.transactions())?; // Ensure the block is correct. - let expected_existing_transaction_ids = block.verify( + let (expected_existing_solution_ids, expected_existing_transaction_ids) = block.verify( &self.latest_block(), self.latest_state_root(), &self.latest_committee()?, @@ -93,6 +93,13 @@ impl> Ledger { ratified_finalize_operations, )?; + // Ensure that each existing solution id from the block exists in the ledger. + for existing_solution_id in expected_existing_solution_ids { + if !self.contains_puzzle_commitment(&existing_solution_id)? { + bail!("Solution ID '{existing_solution_id}' does not exist in the ledger"); + } + } + // Ensure that each existing transaction id from the block exists in the ledger. for existing_transaction_id in expected_existing_transaction_ids { if !self.contains_transaction_id(&existing_transaction_id)? { From 31a0c4f5391dd6239d9e67c1ac9fa2f15a87b36c Mon Sep 17 00:00:00 2001 From: raychu86 <14917648+raychu86@users.noreply.github.com> Date: Sat, 20 Jan 2024 15:19:41 -0800 Subject: [PATCH 197/298] Optimize --- ledger/block/src/verify.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/ledger/block/src/verify.rs b/ledger/block/src/verify.rs index c5a7ff95da..eb6b579d2d 100644 --- a/ledger/block/src/verify.rs +++ b/ledger/block/src/verify.rs @@ -626,13 +626,13 @@ impl Block { } // Retrieve the solution ids that should already exist in the ledger. - let existing_solution_ids: Vec<_> = - aborted_or_existing_solution_ids.iter().filter(|id| !aborted_solution_ids.contains(id)).copied().collect(); - + let existing_solution_ids: Vec<_> = aborted_or_existing_solution_ids + .difference(&aborted_solution_ids.iter().copied().collect()) + .copied() + .collect(); // Retrieve the transaction ids that should already exist in the ledger. let existing_transaction_ids: Vec<_> = aborted_or_existing_transaction_ids - .iter() - .filter(|id| !aborted_transaction_ids.contains(id)) + .difference(&aborted_transaction_ids.iter().copied().collect()) .copied() .collect(); From 14965a21511fb9b23143f632154634b3c61f7773 Mon Sep 17 00:00:00 2001 From: Howard Wu <9260812+howardwu@users.noreply.github.com> Date: Sat, 20 Jan 2024 17:10:18 -0800 Subject: [PATCH 198/298] Integrate StorageMode into ledger-store --- Cargo.lock | 836 +++++++++--------- algorithms/Cargo.toml | 2 +- console/collections/Cargo.toml | 2 +- fields/Cargo.toml | 2 +- ledger/Cargo.toml | 2 +- ledger/coinbase/Cargo.toml | 2 +- ledger/store/Cargo.toml | 5 +- ledger/store/src/block/mod.rs | 7 +- ledger/store/src/consensus/mod.rs | 7 +- ledger/store/src/helpers/memory/block.rs | 6 +- ledger/store/src/helpers/memory/consensus.rs | 8 +- ledger/store/src/helpers/memory/program.rs | 12 +- ledger/store/src/helpers/memory/transition.rs | 18 +- ledger/store/src/helpers/rocksdb/block.rs | 36 +- ledger/store/src/helpers/rocksdb/consensus.rs | 8 +- .../store/src/helpers/rocksdb/internal/mod.rs | 38 +- ledger/store/src/helpers/rocksdb/program.rs | 22 +- .../store/src/helpers/rocksdb/transition.rs | 62 +- ledger/store/src/program/committee.rs | 7 +- ledger/store/src/program/finalize.rs | 7 +- ledger/store/src/transition/input.rs | 7 +- ledger/store/src/transition/mod.rs | 7 +- ledger/store/src/transition/output.rs | 7 +- parameters/Cargo.toml | 2 +- synthesizer/Cargo.toml | 2 +- synthesizer/process/Cargo.toml | 2 +- utilities/Cargo.toml | 2 +- 27 files changed, 587 insertions(+), 531 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index eb058326d6..316c685f64 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -19,13 +19,14 @@ checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" [[package]] name = "ahash" -version = "0.8.3" +version = "0.8.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c99f64d1e06488f620f932677e24bc6e2897582980441ae90a671415bd7ec2f" +checksum = "77c3a9648d43b9cd48db467b3f87fdd6e146bcc88ab0180006cef2179fe11d01" dependencies = [ "cfg-if", "once_cell", "version_check", + "zerocopy", ] [[package]] @@ -39,9 +40,9 @@ dependencies = [ [[package]] name = "aleo-std" -version = "0.1.18" +version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3aa6ad1a3bb96698e7e8d8e42a6f2fda3b8611a43aab4d5effb921f18798833" +checksum = "a3ec648bb4d936c62d63cb85983059c7fecd92175912c145470da3b03010c7c6" dependencies = [ "aleo-std-cpu", "aleo-std-profiler", @@ -68,9 +69,9 @@ dependencies = [ [[package]] name = "aleo-std-storage" -version = "0.1.3" +version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "503e2538d5158b869bc9c30c9754f9a23f4210987008014a9f118db99f22c217" +checksum = "453100af40d56582265853ecb2ef660d1bc1ba6920bff020a77ceba1122c8eb5" dependencies = [ "dirs", ] @@ -82,7 +83,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "72f2a841f04c2eaeb5a95312e5201a9e4b7c95b64ca99870d6bd2e2376df540a" dependencies = [ "proc-macro2", - "quote 1.0.33", + "quote 1.0.35", "syn 1.0.109", ] @@ -93,7 +94,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6118baab6285accf088b31d5ea5029c37bbf9d98e62b4d8720a0a5a66bc2e427" dependencies = [ "proc-macro2", - "quote 1.0.33", + "quote 1.0.35", "syn 1.0.109", ] @@ -120,9 +121,9 @@ checksum = "4b46cbb362ab8752921c97e041f5e366ee6297bd428a31275b9fcf1e380f7299" [[package]] name = "anstream" -version = "0.6.4" +version = "0.6.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ab91ebe16eb252986481c5b62f6098f3b698a45e34b5b98200cf20dd2484a44" +checksum = "6e2e1ebcb11de5c03c67de28a7df593d32191b44939c482e97702baaaa6ab6a5" dependencies = [ "anstyle", "anstyle-parse", @@ -140,37 +141,37 @@ checksum = "7079075b41f533b8c61d2a4d073c4676e1f8b249ff94a393b0595db304e0dd87" [[package]] name = "anstyle-parse" -version = "0.2.2" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "317b9a89c1868f5ea6ff1d9539a69f45dffc21ce321ac1fd1160dfa48c8e2140" +checksum = "c75ac65da39e5fe5ab759307499ddad880d724eed2f6ce5b5e8a26f4f387928c" dependencies = [ "utf8parse", ] [[package]] name = "anstyle-query" -version = "1.0.0" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ca11d4be1bab0c8bc8734a9aa7bf4ee8316d462a08c6ac5052f888fef5b494b" +checksum = "e28923312444cdd728e4738b3f9c9cac739500909bb3d3c94b43551b16517648" dependencies = [ - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] name = "anstyle-wincon" -version = "3.0.1" +version = "3.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0699d10d2f4d628a98ee7b57b289abbc98ff3bad977cb3152709d4bf2330628" +checksum = "1cd54b81ec8d6180e24654d0b371ad22fc3dd083b6ff8ba325b72e00c87660a7" dependencies = [ "anstyle", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] name = "anyhow" -version = "1.0.75" +version = "1.0.79" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4668cab20f66d8d020e1fbc0ebe47217433c1b6c8f2040faf858554e394ace6" +checksum = "080e9890a082662b09c1ad45f567faeeb47f22b5fb23895fbe1e651e718e25ca" [[package]] name = "arrayref" @@ -186,13 +187,13 @@ checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" [[package]] name = "async-trait" -version = "0.1.73" +version = "0.1.77" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc00ceb34980c03614e35a3a4e218276a0a824e911d07651cd0d858a51e8c0f0" +checksum = "c980ee35e870bd1a4d2c8294d4c04d0499e67bca1e4b5cefcc693c2fa00caea9" dependencies = [ "proc-macro2", - "quote 1.0.33", - "syn 2.0.38", + "quote 1.0.35", + "syn 2.0.48", ] [[package]] @@ -218,9 +219,9 @@ dependencies = [ [[package]] name = "base64" -version = "0.21.4" +version = "0.21.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ba43ea6f343b788c8764558649e08df62f86c6ef251fdaeb1ffd010a9ae50a2" +checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" [[package]] name = "bech32" @@ -251,11 +252,11 @@ dependencies = [ "peeking_take_while", "prettyplease", "proc-macro2", - "quote 1.0.33", + "quote 1.0.35", "regex", "rustc-hash", "shlex", - "syn 2.0.38", + "syn 2.0.48", ] [[package]] @@ -281,9 +282,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.4.0" +version = "2.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4682ae6287fcf752ecaabbfcc7b6f9b72aa33933dc23a554d853aea8eea8635" +checksum = "ed570934406eb16438a4e976b1b4500774099c13b8cb96eec99f620f05090ddf" [[package]] name = "blake2" @@ -433,9 +434,9 @@ dependencies = [ [[package]] name = "cl3" -version = "0.9.2" +version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "215a3aa32ab5d7928c539c4289d1cf144257c3cb05e05a4b7e61d5a6bb6583a5" +checksum = "b823f24e72fa0c68aa14a250ae1c0848e68d4ae188b71c3972343e45b46f8644" dependencies = [ "libc", "opencl-sys", @@ -444,9 +445,9 @@ dependencies = [ [[package]] name = "clang-sys" -version = "1.6.1" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c688fc74432808e3eb684cae8830a86be1d66a2bd58e1f248ed0960a590baf6f" +checksum = "67523a3b4be3ce1989d607a828d036249522dd9c1c8de7f4dd2dae43a37369d1" dependencies = [ "glob", "libc", @@ -455,9 +456,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.4.6" +version = "4.4.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d04704f56c2cde07f43e8e2c154b43f216dc5c92fc98ada720177362f953b956" +checksum = "1e578d6ec4194633722ccf9544794b71b1385c3c027efe0c55db226fc880865c" dependencies = [ "clap_builder", "clap_derive", @@ -465,9 +466,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.4.6" +version = "4.4.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e231faeaca65ebd1ea3c737966bf858971cd38c3849107aa3ea7de90a804e45" +checksum = "4df4df40ec50c46000231c914968278b1eb05098cf8f1b3a518a95030e71d1c7" dependencies = [ "anstream", "anstyle", @@ -477,21 +478,21 @@ dependencies = [ [[package]] name = "clap_derive" -version = "4.4.2" +version = "4.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0862016ff20d69b84ef8247369fabf5c008a7417002411897d40ee1f4532b873" +checksum = "cf9804afaaf59a91e75b022a30fb7229a7901f60c755489cc61c9b423b836442" dependencies = [ "heck", "proc-macro2", - "quote 1.0.33", - "syn 2.0.38", + "quote 1.0.35", + "syn 2.0.48", ] [[package]] name = "clap_lex" -version = "0.5.1" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd7cc57abe963c6d3b9d8be5b06ba7c8957a930305ca90304f24ef040aa6f961" +checksum = "702fc72eb24e5a1e48ce58027a675bc24edd52096d5397d4aea7c6dd9eca0bd1" [[package]] name = "colorchoice" @@ -501,26 +502,25 @@ checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" [[package]] name = "colored" -version = "2.0.4" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2674ec482fbc38012cf31e6c42ba0177b431a0cb6f15fe40efa5aab1bda516f6" +checksum = "cbf2150cce219b664a8a70df7a1f933836724b503f8a413af9365b4dcc4d90b8" dependencies = [ - "is-terminal", "lazy_static", "windows-sys 0.48.0", ] [[package]] name = "console" -version = "0.15.7" +version = "0.15.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c926e00cc70edefdc64d3a5ff31cc65bb97a3460097762bd23afb4d8145fccf8" +checksum = "0e1f83fc076bd6dd27517eacdf25fef6c4dfe5f1d7448bafaaf3a26f13b5e4eb" dependencies = [ "encode_unicode", "lazy_static", "libc", "unicode-width", - "windows-sys 0.45.0", + "windows-sys 0.52.0", ] [[package]] @@ -541,9 +541,9 @@ checksum = "f7144d30dcf0fafbce74250a3963025d8d52177934239851c917d29f1df280c2" [[package]] name = "core-foundation" -version = "0.9.3" +version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "194a7a9e6de53fa55116934067c844d9d749312f75c6f6d0980e8c252f8c2146" +checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" dependencies = [ "core-foundation-sys", "libc", @@ -551,15 +551,15 @@ dependencies = [ [[package]] name = "core-foundation-sys" -version = "0.8.4" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e496a50fda8aacccc86d7529e2c1e0892dbd0f898a6b5645b5561b89c3210efa" +checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" [[package]] name = "cpufeatures" -version = "0.2.9" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a17b76ff3a4162b0b27f354a0c87015ddad39d35f9c0c36607a3bdd175dde1f1" +checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504" dependencies = [ "libc", ] @@ -611,46 +611,37 @@ dependencies = [ [[package]] name = "crossbeam-channel" -version = "0.5.8" +version = "0.5.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a33c2bf77f2df06183c3aa30d1e96c0695a313d4f9c453cc3762a6db39f99200" +checksum = "176dc175b78f56c0f321911d9c8eb2b77a78a4860b9c19db83835fea1a46649b" dependencies = [ - "cfg-if", "crossbeam-utils", ] [[package]] name = "crossbeam-deque" -version = "0.8.3" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce6fd6f855243022dcecf8702fef0c297d4338e226845fe067f6341ad9fa0cef" +checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d" dependencies = [ - "cfg-if", "crossbeam-epoch", "crossbeam-utils", ] [[package]] name = "crossbeam-epoch" -version = "0.9.15" +version = "0.9.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae211234986c545741a7dc064309f67ee1e5ad243d0e48335adc0484d960bcc7" +checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" dependencies = [ - "autocfg", - "cfg-if", "crossbeam-utils", - "memoffset", - "scopeguard", ] [[package]] name = "crossbeam-utils" -version = "0.8.16" +version = "0.8.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a22b2d63d4d1dc0b7f1b6b2747dd0088008a9be28b6ddf0b1e7d335e3037294" -dependencies = [ - "cfg-if", -] +checksum = "248e3bacc7dc6baa3b21e405ee045c3047101a49145e7e9eca583ab4c2ca5345" [[package]] name = "crunchy" @@ -697,15 +688,15 @@ dependencies = [ "openssl-probe", "openssl-sys", "schannel", - "socket2 0.4.9", + "socket2 0.4.10", "winapi", ] [[package]] name = "curl-sys" -version = "0.4.68+curl-8.4.0" +version = "0.4.70+curl-8.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4a0d18d88360e374b16b2273c832b5e57258ffc1d4aa4f96b108e0738d5752f" +checksum = "3c0333d8849afe78a4c8102a429a446bfdd055832af071945520e835ae2d841e" dependencies = [ "cc", "libc", @@ -723,7 +714,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "978747c1d849a7d2ee5e8adc0159961c48fb7e5db2f06af6723b80123bb53856" dependencies = [ "cfg-if", - "hashbrown 0.14.1", + "hashbrown 0.14.3", "lock_api", "once_cell", "parking_lot_core", @@ -731,9 +722,9 @@ dependencies = [ [[package]] name = "deranged" -version = "0.3.9" +version = "0.3.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f32d04922c60427da6f9fef14d042d9edddef64cb9d4ce0d64d0685fbeb1fd3" +checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4" dependencies = [ "powerfmt", ] @@ -900,12 +891,12 @@ checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[package]] name = "errno" -version = "0.3.5" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3e13f66a2f95e32a39eaa81f6b95d42878ca0e1db0c7543723dfe12557e860" +checksum = "a258e46cdc063eb8519c00b9fc845fc47bcfca4130e2f08e88665ceda8474245" dependencies = [ "libc", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] @@ -978,9 +969,9 @@ checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" [[package]] name = "form_urlencoded" -version = "1.2.0" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a62bc1cf6f830c2ec14a513a9fb124d0a213a629668a4186f329db21fe045652" +checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" dependencies = [ "percent-encoding", ] @@ -993,9 +984,9 @@ checksum = "c1fd087255f739f4f1aeea69f11b72f8080e9c2e7645cd06955dad4a178a49e3" [[package]] name = "futures" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23342abe12aba583913b2e62f22225ff9c950774065e4bfb61a19cd9770fec40" +checksum = "645c6916888f6cb6350d2550b80fb63e734897a8498abe35cfb732b6487804b0" dependencies = [ "futures-channel", "futures-core", @@ -1008,9 +999,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "955518d47e09b25bbebc7a18df10b81f0c766eaf4c4f1cccef2fca5f2a4fb5f2" +checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78" dependencies = [ "futures-core", "futures-sink", @@ -1018,15 +1009,15 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4bca583b7e26f571124fe5b7561d49cb2868d79116cfa0eefce955557c6fee8c" +checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" [[package]] name = "futures-executor" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ccecee823288125bd88b4d7f565c9e58e41858e47ab72e8ea2d64e93624386e0" +checksum = "a576fc72ae164fca6b9db127eaa9a9dda0d61316034f33a0a0d4eda41f02b01d" dependencies = [ "futures-core", "futures-task", @@ -1035,27 +1026,27 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fff74096e71ed47f8e023204cfd0aa1289cd54ae5430a9523be060cdb849964" +checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" [[package]] name = "futures-sink" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f43be4fe21a13b9781a69afa4985b0f6ee0e1afab2c6f454a8cf30e2b2237b6e" +checksum = "9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5" [[package]] name = "futures-task" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76d3d132be6c0e6aa1534069c705a74a5997a356c0dc2f86a47765e5617c5b65" +checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" [[package]] name = "futures-util" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26b01e40b772d54cf6c6d721c1d1abd0647a0106a12ecaa1c186273392a69533" +checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" dependencies = [ "futures-channel", "futures-core", @@ -1098,9 +1089,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.10" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be4136b2a15dd319360be1c07d9933517ccf0be8f16bf62a3bee4f0d618df427" +checksum = "190092ea657667030ac6a35e305e62fc4dd69fd98ac98631e5d3a2b1575a12b5" dependencies = [ "cfg-if", "js-sys", @@ -1111,9 +1102,9 @@ dependencies = [ [[package]] name = "gimli" -version = "0.28.0" +version = "0.28.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fb8d784f27acf97159b40fc4db5ecd8aa23b9ad5ef69cdd136d3bc80665f0c0" +checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" [[package]] name = "glob" @@ -1123,9 +1114,9 @@ checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" [[package]] name = "h2" -version = "0.3.21" +version = "0.3.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91fc23aa11be92976ef4729127f1a74adf36d8436f7816b185d18df956790833" +checksum = "bb2c4422095b67ee78da96fbb51a4cc413b3b25883c7717ff7ca1ab31022c9c9" dependencies = [ "bytes", "fnv", @@ -1133,7 +1124,7 @@ dependencies = [ "futures-sink", "futures-util", "http", - "indexmap 1.9.3", + "indexmap 2.1.0", "slab", "tokio", "tokio-util", @@ -1163,9 +1154,9 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.14.1" +version = "0.14.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7dfda62a12f55daeae5015f81b0baea145391cb4520f86c248fc615d72640d12" +checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" dependencies = [ "ahash", "allocator-api2", @@ -1179,9 +1170,9 @@ checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" [[package]] name = "hermit-abi" -version = "0.3.3" +version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d77f7ec81a6d05a3abb01ab6eb7590f6083d08449fe5a1c8b1e620283546ccb7" +checksum = "5d3d0e0f38255e7fa3cf31335b3a56f05febd18025f4db5ef7a0cfb4f8da651f" [[package]] name = "hex" @@ -1191,18 +1182,18 @@ checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" [[package]] name = "home" -version = "0.5.5" +version = "0.5.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5444c27eef6923071f7ebcc33e3444508466a76f7a2b93da00ed6e19f30c1ddb" +checksum = "e3d1354bf6b7235cb4a0576c2619fd4ed18183f689b12b006a0ee7329eeff9a5" dependencies = [ - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] name = "http" -version = "0.2.9" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd6effc99afb63425aff9b05836f029929e345a6148a14b7ecd5ab67af944482" +checksum = "8947b1a6fad4393052c7ba1f4cd97bed3e953a95c79c92ad9b051a04611d9fbb" dependencies = [ "bytes", "fnv", @@ -1211,9 +1202,9 @@ dependencies = [ [[package]] name = "http-body" -version = "0.4.5" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5f38f16d184e36f2408a55281cd658ecbd3ca05cce6d6510a176eca393e26d1" +checksum = "7ceab25649e9960c0311ea418d17bee82c0dcec1bd053b5f9a66e265a693bed2" dependencies = [ "bytes", "http", @@ -1234,9 +1225,9 @@ checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" [[package]] name = "hyper" -version = "0.14.27" +version = "0.14.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffb1cfd654a8219eaef89881fdb3bb3b1cdc5fa75ded05d6933b2b382e395468" +checksum = "bf96e135eb83a2a8ddf766e426a841d8ddd7449d5f00d34ea02b41d2f19eef80" dependencies = [ "bytes", "futures-channel", @@ -1249,7 +1240,7 @@ dependencies = [ "httpdate", "itoa", "pin-project-lite", - "socket2 0.4.9", + "socket2 0.5.5", "tokio", "tower-service", "tracing", @@ -1271,9 +1262,9 @@ dependencies = [ [[package]] name = "idna" -version = "0.4.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d20d6b07bfbc108882d88ed8e37d39636dcc260e15e30c45e6ba089610b917c" +checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" dependencies = [ "unicode-bidi", "unicode-normalization", @@ -1291,12 +1282,12 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.0.2" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8adf3ddd720272c6ea8bf59463c04e0f93d0bbf7c5439b691bca2987e0270897" +checksum = "d530e1a18b1cb4c484e6e34556a0d948706958449fca0cab753d649f2bce3d1f" dependencies = [ "equivalent", - "hashbrown 0.14.1", + "hashbrown 0.14.3", "rayon", "serde", ] @@ -1325,19 +1316,19 @@ dependencies = [ [[package]] name = "ipnet" -version = "2.8.0" +version = "2.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28b29a3cd74f0f4598934efe3aeba42bae0eb4680554128851ebbecb02af14e6" +checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" [[package]] name = "is-terminal" -version = "0.4.9" +version = "0.4.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb0889898416213fab133e1d33a0e5858a48177452750691bde3666d0fdbaf8b" +checksum = "0bad00257d07be169d870ab665980b06cdb366d792ad690bf2e76876dc503455" dependencies = [ "hermit-abi", "rustix", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] @@ -1360,9 +1351,9 @@ dependencies = [ [[package]] name = "itoa" -version = "1.0.9" +version = "1.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38" +checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" [[package]] name = "jobserver" @@ -1375,9 +1366,9 @@ dependencies = [ [[package]] name = "js-sys" -version = "0.3.64" +version = "0.3.67" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5f195fe497f702db0f318b07fdd68edb16955aed830df8363d837542f8f935a" +checksum = "9a1d36f1235bc969acba30b7f5990b864423a6068a10f7c90ae8f0112e3a59d1" dependencies = [ "wasm-bindgen", ] @@ -1396,18 +1387,18 @@ checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" [[package]] name = "libc" -version = "0.2.149" +version = "0.2.152" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a08173bc88b7955d1b3145aa561539096c421ac8debde8cbc3612ec635fee29b" +checksum = "13e3bf6590cbc649f4d1a3eefc9d5d6eb746f5200ffb04e5e142700b8faa56e7" [[package]] name = "libloading" -version = "0.7.4" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b67380fd3b2fbe7527a606e18729d21c6f3951633d0500574c4dc22d2d638b9f" +checksum = "c571b676ddfc9a8c12f1f3d3085a7b163966a8fd8098a90640953ce5f6170161" dependencies = [ "cfg-if", - "winapi", + "windows-sys 0.48.0", ] [[package]] @@ -1416,6 +1407,17 @@ version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4ec2a862134d2a7d32d7983ddcdd1c4923530833c9f2ea1a44fc5fa473989058" +[[package]] +name = "libredox" +version = "0.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85c833ca1e66078851dba29046874e38f08b2c883700aa29a03ddd3b23814ee8" +dependencies = [ + "bitflags 2.4.2", + "libc", + "redox_syscall", +] + [[package]] name = "librocksdb-sys" version = "0.11.0+8.1.1" @@ -1433,9 +1435,9 @@ dependencies = [ [[package]] name = "libz-sys" -version = "1.1.12" +version = "1.1.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d97137b25e321a73eef1418d1d5d2eda4d77e12813f8e6dead84bc52c5870a7b" +checksum = "295c17e837573c8c821dbaeb3cceb3d745ad082f7572191409e69cbc1b3fd050" dependencies = [ "cc", "libc", @@ -1445,15 +1447,15 @@ dependencies = [ [[package]] name = "linux-raw-sys" -version = "0.4.10" +version = "0.4.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da2479e8c062e40bf0066ffa0bc823de0a9368974af99c9f6df941d2c231e03f" +checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c" [[package]] name = "lock_api" -version = "0.4.10" +version = "0.4.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1cc9717a20b1bb222f333e6a92fd32f7d8a18ddc5a3191a11af45dcbf4dcd16" +checksum = "3c168f8615b12bc01f9c17e2eb0cc07dcae1940121185446edc3744920e8ef45" dependencies = [ "autocfg", "scopeguard", @@ -1486,18 +1488,9 @@ dependencies = [ [[package]] name = "memchr" -version = "2.6.4" +version = "2.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f665ee40bc4a3c5590afb1e9677db74a508659dfd71e126420da8274909a0167" - -[[package]] -name = "memoffset" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a634b1c61a95585bd15607c6ab0c4e5b226e695ff2800ba0cdccddf208c406c" -dependencies = [ - "autocfg", -] +checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149" [[package]] name = "metrics" @@ -1566,9 +1559,9 @@ dependencies = [ [[package]] name = "mio" -version = "0.8.8" +version = "0.8.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "927a765cd3fc26206e66b296465fa9d3e5ab003e651c1b3c060e7956d96b19d2" +checksum = "8f3d0b296e374a4e6f3c7b0a1f5a51d748a0d34c85e7dc48fc3fa9a87657fe09" dependencies = [ "libc", "wasi", @@ -1637,8 +1630,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cfb77679af88f8b125209d354a202862602672222e7f2313fdd6dc349bad4712" dependencies = [ "proc-macro2", - "quote 1.0.33", - "syn 2.0.38", + "quote 1.0.35", + "syn 2.0.48", ] [[package]] @@ -1689,18 +1682,18 @@ checksum = "830b246a0e5f20af87141b25c173cd1b609bd7779a4617d6ec582abaf90870f3" [[package]] name = "object" -version = "0.32.1" +version = "0.32.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9cf5f9dd3933bd50a9e1f149ec995f39ae2c496d31fd772c1fd45ebc27e902b0" +checksum = "a6a622008b6e321afc04970976f62ee297fdbaa6f95318ca343e3eebb9648441" dependencies = [ "memchr", ] [[package]] name = "once_cell" -version = "1.18.0" +version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" [[package]] name = "oorandom" @@ -1710,18 +1703,18 @@ checksum = "0ab1bc2a289d34bd04a330323ac98a1b4bc82c9d9fcb1e66b63caa84da26b575" [[package]] name = "opencl-sys" -version = "0.2.4" +version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e75919008b8ed7ce9620e2b3580c648db40c7f564a368f271b2647145046d8ba" +checksum = "3c18b75202f7354563065f0202ae77ec903261370bf7a0bb9a0c3fd11b5a39a2" dependencies = [ "libc", ] [[package]] name = "opencl3" -version = "0.9.3" +version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c247ee0c98af8a67ab9c836ed2ea663ac19a17d8bae71325b509835e536c18ad" +checksum = "26ab4a90cb496f787d3934deb0c54fa9d65e7bed710c10071234aab0196fba04" dependencies = [ "cl3", "libc", @@ -1729,11 +1722,11 @@ dependencies = [ [[package]] name = "openssl" -version = "0.10.57" +version = "0.10.63" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bac25ee399abb46215765b1cb35bc0212377e58a061560d8b29b024fd0430e7c" +checksum = "15c9d69dd87a29568d4d017cfe8ec518706046a05184e5aea92d0af890b803c8" dependencies = [ - "bitflags 2.4.0", + "bitflags 2.4.2", "cfg-if", "foreign-types", "libc", @@ -1749,8 +1742,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", - "quote 1.0.33", - "syn 2.0.38", + "quote 1.0.35", + "syn 2.0.48", ] [[package]] @@ -1761,9 +1754,9 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] name = "openssl-sys" -version = "0.9.93" +version = "0.9.99" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db4d56a4c0478783083cfafcc42493dd4a981d41669da64b4572a2a089b51b1d" +checksum = "22e1bf214306098e4832460f797824c05d25aacdf896f64a985fb0fd992454ae" dependencies = [ "cc", "libc", @@ -1789,13 +1782,13 @@ dependencies = [ [[package]] name = "parking_lot_core" -version = "0.9.8" +version = "0.9.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93f00c865fe7cabf650081affecd3871070f26767e7b2070a3ffae14c654b447" +checksum = "4c42a9226546d68acdd9c0a280d17ce19bfe27a46bf68784e4066115788d008e" dependencies = [ "cfg-if", "libc", - "redox_syscall 0.3.5", + "redox_syscall", "smallvec", "windows-targets 0.48.5", ] @@ -1814,9 +1807,9 @@ checksum = "19b17cddbe7ec3f8bc800887bab5e717348c95ea2ca0b1bf0837fb964dc67099" [[package]] name = "percent-encoding" -version = "2.3.0" +version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94" +checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "pin-project-lite" @@ -1832,9 +1825,9 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] name = "pkg-config" -version = "0.3.27" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26072860ba924cbfa98ea39c8c19b4dd6a4a25423dbdf219c1eca91aa0cf6964" +checksum = "2900ede94e305130c13ddd391e0ab7cbaeb783945ae07a279c268cb05109c6cb" [[package]] name = "plotters" @@ -1866,9 +1859,9 @@ dependencies = [ [[package]] name = "portable-atomic" -version = "1.4.3" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31114a898e107c51bb1609ffaf55a0e011cf6a4d7f1170d0015a165082c0338b" +checksum = "7170ef9988bc169ba16dd36a7fa041e5c4cbeb6a35b76d4c03daded371eae7c0" [[package]] name = "powerfmt" @@ -1884,38 +1877,38 @@ checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" [[package]] name = "prettyplease" -version = "0.2.15" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae005bd773ab59b4725093fd7df83fd7892f7d8eafb48dbd7de6e024e4215f9d" +checksum = "a41cf62165e97c7f814d2221421dbb9afcbcdb0a88068e5ea206e19951c2cbb5" dependencies = [ "proc-macro2", - "syn 2.0.38", + "syn 2.0.48", ] [[package]] name = "proc-macro2" -version = "1.0.69" +version = "1.0.76" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "134c189feb4956b20f6f547d2cf727d4c0fe06722b20a0eec87ed445a97f92da" +checksum = "95fc56cda0b5c3325f5fbbd7ff9fda9e02bb00bb3dac51252d2f1bfa1cb8cc8c" dependencies = [ "unicode-ident", ] [[package]] name = "proptest" -version = "1.3.1" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c003ac8c77cb07bb74f5f198bce836a689bcd5a42574612bf14d17bfd08c20e" +checksum = "31b476131c3c86cb68032fdc5cb6d5a1045e3e42d96b69fa599fd77701e1f5bf" dependencies = [ "bit-set", "bit-vec", - "bitflags 2.4.0", + "bitflags 2.4.2", "lazy_static", "num-traits", "rand", "rand_chacha", "rand_xorshift", - "regex-syntax 0.7.5", + "regex-syntax 0.8.2", "rusty-fork", "tempfile", "unarray", @@ -1959,9 +1952,9 @@ checksum = "7a6e920b65c65f10b2ae65c831a81a073a89edd28c7cce89475bff467ab4167a" [[package]] name = "quote" -version = "1.0.33" +version = "1.0.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" +checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" dependencies = [ "proc-macro2", ] @@ -2021,14 +2014,14 @@ version = "11.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9d86a7c4638d42c44551f4791a20e687dbb4c3de1f33c43dd71e355cd429def1" dependencies = [ - "bitflags 2.4.0", + "bitflags 2.4.2", ] [[package]] name = "rayon" -version = "1.8.0" +version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c27db03db7734835b3f53954b534c91069375ce6ccaa2e065441e07d9b6cdb1" +checksum = "fa7237101a77a10773db45d62004a272517633fbcc3df19d96455ede1122e051" dependencies = [ "either", "rayon-core", @@ -2036,9 +2029,9 @@ dependencies = [ [[package]] name = "rayon-core" -version = "1.12.0" +version = "1.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ce3fb6ad83f861aac485e76e1985cd109d9a3713802152be56c3b1f0e0658ed" +checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2" dependencies = [ "crossbeam-deque", "crossbeam-utils", @@ -2046,43 +2039,34 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.2.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" -dependencies = [ - "bitflags 1.3.2", -] - -[[package]] -name = "redox_syscall" -version = "0.3.5" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "567664f262709473930a4bf9e51bf2ebf3348f2e748ccc50dea20646858f8f29" +checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" dependencies = [ "bitflags 1.3.2", ] [[package]] name = "redox_users" -version = "0.4.3" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b033d837a7cf162d7993aded9304e30a83213c648b6e389db233191f891e5c2b" +checksum = "a18479200779601e498ada4e8c1e1f50e3ee19deb0259c25825a98b5603b2cb4" dependencies = [ "getrandom", - "redox_syscall 0.2.16", + "libredox", "thiserror", ] [[package]] name = "regex" -version = "1.10.0" +version = "1.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d119d7c7ca818f8a53c300863d4f87566aac09943aef5b355bb83969dae75d87" +checksum = "380b951a9c5e80ddfd6136919eef32310721aa4aacd4889a8d39124b026ab343" dependencies = [ "aho-corasick", "memchr", - "regex-automata 0.4.1", - "regex-syntax 0.8.1", + "regex-automata 0.4.3", + "regex-syntax 0.8.2", ] [[package]] @@ -2096,13 +2080,13 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.1" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "465c6fc0621e4abc4187a2bda0937bfd4f722c2730b29562e19689ea796c9a4b" +checksum = "5f804c7828047e88b2d32e2d7fe5a105da8ee3264f01902f796c8e067dc2483f" dependencies = [ "aho-corasick", "memchr", - "regex-syntax 0.8.1", + "regex-syntax 0.8.2", ] [[package]] @@ -2113,21 +2097,15 @@ checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" [[package]] name = "regex-syntax" -version = "0.7.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbb5fb1acd8a1a18b3dd5be62d25485eb770e05afb408a9627d14d451bae12da" - -[[package]] -name = "regex-syntax" -version = "0.8.1" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56d84fdd47036b038fc80dd333d10b6aab10d5d31f4a366e20014def75328d33" +checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" [[package]] name = "reqwest" -version = "0.11.22" +version = "0.11.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "046cd98826c46c2ac8ddecae268eb5c2e58628688a5fc7a2643704a73faba95b" +checksum = "37b1ae8d9ac08420c66222fb9096fc5de435c3c48542bc5336c51892cffafb41" dependencies = [ "base64", "bytes", @@ -2163,17 +2141,16 @@ dependencies = [ [[package]] name = "ring" -version = "0.16.20" +version = "0.17.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3053cf52e236a3ed746dfc745aa9cacf1b791d846bdaf412f60a8d7d6e17c8fc" +checksum = "688c63d65483050968b2a8937f7995f443e27041a0f7700aa59b0822aedebb74" dependencies = [ "cc", + "getrandom", "libc", - "once_cell", "spin", "untrusted", - "web-sys", - "winapi", + "windows-sys 0.48.0", ] [[package]] @@ -2216,7 +2193,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "43ce8670a1a1d0fc2514a3b846dacdb65646f9bd494b6674cfacbb4ce430bd7e" dependencies = [ "proc-macro2", - "quote 1.0.33", + "quote 1.0.35", "syn 1.0.109", ] @@ -2243,22 +2220,22 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.19" +version = "0.38.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "745ecfa778e66b2b63c88a61cb36e0eea109e803b0b86bf9879fbc77c70e86ed" +checksum = "322394588aaf33c24007e8bb3238ee3e4c5c09c084ab32bc73890b99ff326bca" dependencies = [ - "bitflags 2.4.0", + "bitflags 2.4.2", "errno", "libc", "linux-raw-sys", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] name = "rustls" -version = "0.21.7" +version = "0.21.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd8d6c9f025a446bc4d18ad9632e69aec8f287aa84499ee335599fabd20c3fd8" +checksum = "f9d5a6813c0759e4609cd494e8e725babae6a2ca7b62a5536a13daaec6fcb7ba" dependencies = [ "log", "ring", @@ -2268,9 +2245,9 @@ dependencies = [ [[package]] name = "rustls-webpki" -version = "0.101.6" +version = "0.101.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c7d5dece342910d9ba34d259310cae3e0154b873b35408b787b59bce53d34fe" +checksum = "8b6275d1ee7a1cd780b64aca7726599a1dbc893b1e64144529e55c3c2f745765" dependencies = [ "ring", "untrusted", @@ -2302,9 +2279,9 @@ dependencies = [ [[package]] name = "ryu" -version = "1.0.15" +version = "1.0.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741" +checksum = "f98d2aa92eebf49b69786be48e4477826b256916e84a57ff2a4f21923b48eb4c" [[package]] name = "same-file" @@ -2317,11 +2294,11 @@ dependencies = [ [[package]] name = "schannel" -version = "0.1.22" +version = "0.1.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c3733bf4cf7ea0880754e19cb5a462007c4a8c1914bff372ccc95b464f1df88" +checksum = "fbc91545643bcf3a0bbb6569265615222618bdf33ce4ffbbd13c4bbd4c093534" dependencies = [ - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] @@ -2338,9 +2315,9 @@ checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" [[package]] name = "sct" -version = "0.7.0" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d53dcdb7c9f8158937a7981b48accfd39a43af418591a5d008c7b22b5e1b7ca4" +checksum = "da046153aa2352493d6cb7da4b6e5c0c057d8a1d0a9aa8560baffdd945acd414" dependencies = [ "ring", "untrusted", @@ -2401,37 +2378,37 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.20" +version = "1.0.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "836fa6a3e1e547f9a2c4040802ec865b5d85f4014efe00555d7090a3dcaa1090" +checksum = "b97ed7a9823b74f99c7742f5336af7be5ecd3eeafcb1507d1fa93347b1d589b0" [[package]] name = "serde" -version = "1.0.189" +version = "1.0.195" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e422a44e74ad4001bdc8eede9a4570ab52f71190e9c076d14369f38b9200537" +checksum = "63261df402c67811e9ac6def069e4786148c4563f4b50fd4bf30aa370d626b02" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.189" +version = "1.0.195" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e48d1f918009ce3145511378cf68d613e3b3d9137d67272562080d68a2b32d5" +checksum = "46fe8f8603d81ba86327b23a2e9cdf49e1255fb94a4c5f297f6ee0547178ea2c" dependencies = [ "proc-macro2", - "quote 1.0.33", - "syn 2.0.38", + "quote 1.0.35", + "syn 2.0.48", ] [[package]] name = "serde_json" -version = "1.0.107" +version = "1.0.111" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b420ce6e3d8bd882e9b243c6eed35dbc9a6110c9769e74b584e0d68d1f20c65" +checksum = "176e46fa42316f18edd598015a5166857fc835ec732f5215eac6b7bdbf0a84f4" dependencies = [ - "indexmap 2.0.2", + "indexmap 2.1.0", "itoa", "ryu", "serde", @@ -2451,11 +2428,11 @@ dependencies = [ [[package]] name = "serde_yaml" -version = "0.9.25" +version = "0.9.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a49e178e4452f45cb61d0cd8cebc1b0fafd3e41929e996cef79aa3aca91f574" +checksum = "b1bf28c79a99f70ee1f1d83d10c875d2e70618417fda01ad1785e027579d9d38" dependencies = [ - "indexmap 2.0.2", + "indexmap 2.1.0", "itoa", "ryu", "serde", @@ -2483,8 +2460,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "91d129178576168c589c9ec973feedf7d3126c01ac2bf08795109aa35b69fb8f" dependencies = [ "proc-macro2", - "quote 1.0.33", - "syn 2.0.38", + "quote 1.0.35", + "syn 2.0.48", ] [[package]] @@ -2530,15 +2507,15 @@ dependencies = [ [[package]] name = "smallvec" -version = "1.11.1" +version = "1.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "942b4a808e05215192e39f4ab80813e599068285906cc91aa64f923db842bd5a" +checksum = "e6ecd384b10a64542d77071bd64bd7b231f4ed5940fba55e98c3de13824cf3d7" [[package]] name = "smol_str" -version = "0.2.0" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74212e6bbe9a4352329b2f68ba3130c15a3f26fe88ff22dbdc6cdd58fa85e99c" +checksum = "e6845563ada680337a52d43bb0b29f396f2d911616f6573012645b9e3d048a49" dependencies = [ "serde", ] @@ -2553,7 +2530,7 @@ dependencies = [ "clap", "colored", "dotenvy", - "indexmap 2.0.2", + "indexmap 2.1.0", "num-format", "once_cell", "parking_lot", @@ -2592,9 +2569,9 @@ dependencies = [ "crossbeam-channel", "expect-test", "fxhash", - "hashbrown 0.14.1", + "hashbrown 0.14.3", "hex", - "indexmap 2.0.2", + "indexmap 2.1.0", "itertools 0.11.0", "lazy_static", "num-traits", @@ -2684,7 +2661,7 @@ name = "snarkvm-circuit-environment" version = "0.16.17" dependencies = [ "criterion", - "indexmap 2.0.2", + "indexmap 2.1.0", "itertools 0.11.0", "nom", "num-traits", @@ -2875,7 +2852,7 @@ version = "0.16.17" dependencies = [ "aleo-std", "criterion", - "indexmap 2.0.2", + "indexmap 2.1.0", "rayon", "snarkvm-console-algorithms", "snarkvm-console-network", @@ -2887,7 +2864,7 @@ name = "snarkvm-console-network" version = "0.16.17" dependencies = [ "anyhow", - "indexmap 2.0.2", + "indexmap 2.1.0", "itertools 0.11.0", "lazy_static", "once_cell", @@ -2928,7 +2905,7 @@ dependencies = [ "bincode", "enum_index", "enum_index_derive", - "indexmap 2.0.2", + "indexmap 2.1.0", "num-derive", "num-traits", "once_cell", @@ -3077,7 +3054,7 @@ dependencies = [ "anyhow", "bincode", "criterion", - "indexmap 2.0.2", + "indexmap 2.1.0", "parking_lot", "rand", "rayon", @@ -3114,7 +3091,7 @@ name = "snarkvm-ledger-block" version = "0.16.17" dependencies = [ "bincode", - "indexmap 2.0.2", + "indexmap 2.1.0", "once_cell", "rayon", "serde_json", @@ -3142,7 +3119,7 @@ dependencies = [ "bincode", "blake2", "criterion", - "indexmap 2.0.2", + "indexmap 2.1.0", "rand", "rayon", "serde_json", @@ -3160,7 +3137,7 @@ version = "0.16.17" dependencies = [ "anyhow", "bincode", - "indexmap 2.0.2", + "indexmap 2.1.0", "parking_lot", "proptest", "rand", @@ -3193,7 +3170,7 @@ name = "snarkvm-ledger-narwhal-batch-certificate" version = "0.16.17" dependencies = [ "bincode", - "indexmap 2.0.2", + "indexmap 2.1.0", "rayon", "serde_json", "snarkvm-console", @@ -3207,7 +3184,7 @@ name = "snarkvm-ledger-narwhal-batch-header" version = "0.16.17" dependencies = [ "bincode", - "indexmap 2.0.2", + "indexmap 2.1.0", "serde_json", "snarkvm-console", "snarkvm-ledger-narwhal-batch-header", @@ -3230,7 +3207,7 @@ name = "snarkvm-ledger-narwhal-subdag" version = "0.16.17" dependencies = [ "bincode", - "indexmap 2.0.2", + "indexmap 2.1.0", "rayon", "serde_json", "snarkvm-console", @@ -3282,7 +3259,7 @@ dependencies = [ "aleo-std", "anyhow", "bincode", - "indexmap 2.0.2", + "indexmap 2.1.0", "once_cell", "parking_lot", "rayon", @@ -3337,7 +3314,7 @@ dependencies = [ "curl", "encoding", "hex", - "indexmap 2.0.2", + "indexmap 2.1.0", "itertools 0.11.0", "js-sys", "lazy_static", @@ -3365,7 +3342,7 @@ dependencies = [ "aleo-std", "anyhow", "criterion", - "indexmap 2.0.2", + "indexmap 2.1.0", "itertools 0.11.0", "once_cell", "parking_lot", @@ -3396,7 +3373,7 @@ dependencies = [ "aleo-std", "bincode", "colored", - "indexmap 2.0.2", + "indexmap 2.1.0", "once_cell", "parking_lot", "rand", @@ -3421,7 +3398,7 @@ version = "0.16.17" dependencies = [ "bincode", "criterion", - "indexmap 2.0.2", + "indexmap 2.1.0", "paste", "rand", "rand_chacha", @@ -3469,8 +3446,8 @@ name = "snarkvm-utilities-derives" version = "0.16.17" dependencies = [ "proc-macro2", - "quote 1.0.33", - "syn 2.0.38", + "quote 1.0.35", + "syn 2.0.48", ] [[package]] @@ -3492,9 +3469,9 @@ dependencies = [ [[package]] name = "socket2" -version = "0.4.9" +version = "0.4.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64a4a911eed85daf18834cfaa86a79b7d266ff93ff5ba14005426219480ed662" +checksum = "9f7916fc008ca5542385b89a3d3ce689953c143e9304a9bf8beec1de48994c0d" dependencies = [ "libc", "winapi", @@ -3502,9 +3479,9 @@ dependencies = [ [[package]] name = "socket2" -version = "0.5.4" +version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4031e820eb552adee9295814c0ced9e5cf38ddf1e8b7d566d6de8e2538ea989e" +checksum = "7b5fac59a5cb5dd637972e5fca70daf0523c9067fcdc4842f053dae04a18f8e9" dependencies = [ "libc", "windows-sys 0.48.0", @@ -3512,9 +3489,9 @@ dependencies = [ [[package]] name = "spin" -version = "0.5.2" +version = "0.9.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" +checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" [[package]] name = "sppark" @@ -3539,9 +3516,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "78ad9e09554f0456d67a69c1584c9798ba733a5b50349a6c0d0948710523922d" dependencies = [ "proc-macro2", - "quote 1.0.33", + "quote 1.0.35", "structmeta-derive", - "syn 2.0.38", + "syn 2.0.48", ] [[package]] @@ -3551,8 +3528,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a60bcaff7397072dca0017d1db428e30d5002e00b6847703e2e42005c95fbe00" dependencies = [ "proc-macro2", - "quote 1.0.33", - "syn 2.0.38", + "quote 1.0.35", + "syn 2.0.48", ] [[package]] @@ -3579,18 +3556,18 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" dependencies = [ "proc-macro2", - "quote 1.0.33", + "quote 1.0.35", "unicode-ident", ] [[package]] name = "syn" -version = "2.0.38" +version = "2.0.48" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e96b79aaa137db8f61e26363a0c9b47d8b4ec75da28b7d1d614c2303e232408b" +checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f" dependencies = [ "proc-macro2", - "quote 1.0.33", + "quote 1.0.35", "unicode-ident", ] @@ -3635,15 +3612,15 @@ dependencies = [ [[package]] name = "tempfile" -version = "3.8.0" +version = "3.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb94d2f3cc536af71caac6b6fcebf65860b347e7ce0cc9ebe8f70d3e521054ef" +checksum = "01ce4141aa927a6d1bd34a041795abd0db1cccba5d5f24b009f694bdf3a1f3fa" dependencies = [ "cfg-if", "fastrand 2.0.1", - "redox_syscall 0.3.5", + "redox_syscall", "rustix", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] @@ -3653,29 +3630,29 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b8361c808554228ad09bfed70f5c823caf8a3450b6881cc3a38eb57e8c08c1d9" dependencies = [ "proc-macro2", - "quote 1.0.33", + "quote 1.0.35", "structmeta", - "syn 2.0.38", + "syn 2.0.48", ] [[package]] name = "thiserror" -version = "1.0.49" +version = "1.0.56" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1177e8c6d7ede7afde3585fd2513e611227efd6481bd78d2e82ba1ce16557ed4" +checksum = "d54378c645627613241d077a3a79db965db602882668f9136ac42af9ecb730ad" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.49" +version = "1.0.56" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10712f02019e9288794769fba95cd6847df9874d49d871d062172f9dd41bc4cc" +checksum = "fa0faa943b50f3db30a20aa7e265dbc66076993efed8463e8de414e5d06d3471" dependencies = [ "proc-macro2", - "quote 1.0.33", - "syn 2.0.38", + "quote 1.0.35", + "syn 2.0.48", ] [[package]] @@ -3699,9 +3676,9 @@ dependencies = [ [[package]] name = "time" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4a34ab300f2dee6e562c10a046fc05e358b29f9bf92277f30c3c8d82275f6f5" +checksum = "f657ba42c3f86e7680e53c8cd3af8abbe56b5491790b46e22e19c0d57463583e" dependencies = [ "deranged", "powerfmt", @@ -3751,9 +3728,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.33.0" +version = "1.35.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f38200e3ef7995e5ef13baec2f432a6da0aa9ac495b2c0e8f3b7eec2c92d653" +checksum = "c89b4efa943be685f629b149f53829423f8f5531ea21249408e8e2f8671ec104" dependencies = [ "backtrace", "bytes", @@ -3761,7 +3738,7 @@ dependencies = [ "mio", "num_cpus", "pin-project-lite", - "socket2 0.5.4", + "socket2 0.5.5", "windows-sys 0.48.0", ] @@ -3777,9 +3754,9 @@ dependencies = [ [[package]] name = "tokio-util" -version = "0.7.9" +version = "0.7.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d68074620f57a0b21594d9735eb2e98ab38b17f80d3fcb189fca266771ca60d" +checksum = "5419f34732d9eb6ee4c3578b7989078579b7f039cbbb9ca2c4da015749371e15" dependencies = [ "bytes", "futures-core", @@ -3806,9 +3783,9 @@ checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" [[package]] name = "tracing" -version = "0.1.39" +version = "0.1.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee2ef2af84856a50c1d430afce2fdded0a4ec7eda868db86409b4543df0797f9" +checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" dependencies = [ "pin-project-lite", "tracing-attributes", @@ -3822,8 +3799,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", - "quote 1.0.33", - "syn 2.0.38", + "quote 1.0.35", + "syn 2.0.48", ] [[package]] @@ -3838,20 +3815,20 @@ dependencies = [ [[package]] name = "tracing-log" -version = "0.1.3" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78ddad33d2d10b1ed7eb9d1f518a5674713876e97e5bb9b7345a7984fbb4f922" +checksum = "ee855f1f400bd0e5c02d150ae5de3840039a3f54b025156404e34c23c03f47c3" dependencies = [ - "lazy_static", "log", + "once_cell", "tracing-core", ] [[package]] name = "tracing-subscriber" -version = "0.3.17" +version = "0.3.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30a651bc37f915e81f087d86e62a18eec5f79550c7faff886f7090b4ea757c77" +checksum = "ad0f048c97dbd9faa9b7df56362b8ebcaa52adb06b498c050d2f4e32f90a7a8b" dependencies = [ "matchers", "nu-ansi-term", @@ -3884,15 +3861,15 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "258bc1c4f8e2e73a977812ab339d503e6feeb92700f6d07a6de4d321522d5c08" dependencies = [ "lazy_static", - "quote 1.0.33", + "quote 1.0.35", "syn 1.0.109", ] [[package]] name = "try-lock" -version = "0.2.4" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3528ecfd12c466c6f163363caf2d02a71161dd5e1cc6ae7b34207ea2d42d81ed" +checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" [[package]] name = "typenum" @@ -3908,9 +3885,9 @@ checksum = "eaea85b334db583fe3274d12b4cd1880032beab409c0d774be044d4480ab9a94" [[package]] name = "unicode-bidi" -version = "0.3.13" +version = "0.3.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" +checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" [[package]] name = "unicode-ident" @@ -3941,21 +3918,21 @@ checksum = "8c1f860d7d29cf02cb2f3f359fd35991af3d30bac52c57d265a3c461074cb4dc" [[package]] name = "unsafe-libyaml" -version = "0.2.9" +version = "0.2.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f28467d3e1d3c6586d8f25fa243f544f5800fec42d97032474e17222c2b75cfa" +checksum = "ab4c90930b95a82d00dc9e9ac071b4991924390d46cbd0dfe566148667605e4b" [[package]] name = "untrusted" -version = "0.7.1" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" +checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" [[package]] name = "ureq" -version = "2.8.0" +version = "2.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f5ccd538d4a604753ebc2f17cd9946e89b77bf87f6a8e2309667c6f2e87855e3" +checksum = "f8cdd25c339e200129fe4de81451814e5228c9b771d57378817d6117cc2b3f97" dependencies = [ "base64", "flate2", @@ -3971,9 +3948,9 @@ dependencies = [ [[package]] name = "url" -version = "2.4.1" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "143b538f18257fac9cad154828a57c6bf5157e1aa604d4816b5995bf6de87ae5" +checksum = "31e6302e3bb753d46e83516cae55ae196fc0c309407cf11ab35cc51a4c2a4633" dependencies = [ "form_urlencoded", "idna", @@ -4046,9 +4023,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.87" +version = "0.2.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7706a72ab36d8cb1f80ffbf0e071533974a60d0a308d01a5d0375bf60499a342" +checksum = "b1223296a201415c7fad14792dbefaace9bd52b62d33453ade1c5b5f07555406" dependencies = [ "cfg-if", "wasm-bindgen-macro", @@ -4056,24 +4033,24 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.87" +version = "0.2.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ef2b6d3c510e9625e5fe6f509ab07d66a760f0885d858736483c32ed7809abd" +checksum = "fcdc935b63408d58a32f8cc9738a0bffd8f05cc7c002086c6ef20b7312ad9dcd" dependencies = [ "bumpalo", "log", "once_cell", "proc-macro2", - "quote 1.0.33", - "syn 2.0.38", + "quote 1.0.35", + "syn 2.0.48", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" -version = "0.4.37" +version = "0.4.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c02dbc21516f9f1f04f187958890d7e6026df8d16540b7ad9492bc34a67cea03" +checksum = "bde2032aeb86bdfaecc8b261eef3cba735cc426c1f3a3416d1e0791be95fc461" dependencies = [ "cfg-if", "js-sys", @@ -4083,38 +4060,38 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.87" +version = "0.2.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dee495e55982a3bd48105a7b947fd2a9b4a8ae3010041b9e0faab3f9cd028f1d" +checksum = "3e4c238561b2d428924c49815533a8b9121c664599558a5d9ec51f8a1740a999" dependencies = [ - "quote 1.0.33", + "quote 1.0.35", "wasm-bindgen-macro-support", ] [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.87" +version = "0.2.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" +checksum = "bae1abb6806dc1ad9e560ed242107c0f6c84335f1749dd4e8ddb012ebd5e25a7" dependencies = [ "proc-macro2", - "quote 1.0.33", - "syn 2.0.38", + "quote 1.0.35", + "syn 2.0.48", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.87" +version = "0.2.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca6ad05a4870b2bf5fe995117d3728437bd27d7cd5f06f13c17443ef369775a1" +checksum = "4d91413b1c31d7539ba5ef2451af3f0b833a005eb27a631cec32bc0635a8602b" [[package]] name = "wasm-bindgen-test" -version = "0.3.37" +version = "0.3.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e6e302a7ea94f83a6d09e78e7dc7d9ca7b186bc2829c24a22d0753efd680671" +checksum = "139bd73305d50e1c1c4333210c0db43d989395b64a237bd35c10ef3832a7f70c" dependencies = [ "console_error_panic_hook", "js-sys", @@ -4126,19 +4103,20 @@ dependencies = [ [[package]] name = "wasm-bindgen-test-macro" -version = "0.3.37" +version = "0.3.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ecb993dd8c836930ed130e020e77d9b2e65dd0fbab1b67c790b0f5d80b11a575" +checksum = "70072aebfe5da66d2716002c729a14e4aec4da0e23cc2ea66323dac541c93928" dependencies = [ "proc-macro2", - "quote 1.0.33", + "quote 1.0.35", + "syn 2.0.48", ] [[package]] name = "web-sys" -version = "0.3.64" +version = "0.3.67" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b85cbef8c220a6abc02aefd892dfc0fc23afb1c6a426316ec33253a3877249b" +checksum = "58cd2333b6e0be7a39605f0e255892fd7418a682d8da8fe042fe25128794d2ed" dependencies = [ "js-sys", "wasm-bindgen", @@ -4146,9 +4124,9 @@ dependencies = [ [[package]] name = "webpki-roots" -version = "0.25.2" +version = "0.25.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14247bb57be4f377dfb94c72830b8ce8fc6beac03cf4bf7b9732eadd414123fc" +checksum = "1778a42e8b3b90bff8d0f5032bf22250792889a5cdc752aa0020c84abe3aaf10" [[package]] name = "which" @@ -4193,15 +4171,6 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" -[[package]] -name = "windows-sys" -version = "0.45.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" -dependencies = [ - "windows-targets 0.42.2", -] - [[package]] name = "windows-sys" version = "0.48.0" @@ -4212,18 +4181,12 @@ dependencies = [ ] [[package]] -name = "windows-targets" -version = "0.42.2" +name = "windows-sys" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ - "windows_aarch64_gnullvm 0.42.2", - "windows_aarch64_msvc 0.42.2", - "windows_i686_gnu 0.42.2", - "windows_i686_msvc 0.42.2", - "windows_x86_64_gnu 0.42.2", - "windows_x86_64_gnullvm 0.42.2", - "windows_x86_64_msvc 0.42.2", + "windows-targets 0.52.0", ] [[package]] @@ -4242,10 +4205,19 @@ dependencies = [ ] [[package]] -name = "windows_aarch64_gnullvm" -version = "0.42.2" +name = "windows-targets" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" +checksum = "8a18201040b24831fbb9e4eb208f8892e1f50a37feb53cc7ff887feb8f50e7cd" +dependencies = [ + "windows_aarch64_gnullvm 0.52.0", + "windows_aarch64_msvc 0.52.0", + "windows_i686_gnu 0.52.0", + "windows_i686_msvc 0.52.0", + "windows_x86_64_gnu 0.52.0", + "windows_x86_64_gnullvm 0.52.0", + "windows_x86_64_msvc 0.52.0", +] [[package]] name = "windows_aarch64_gnullvm" @@ -4254,10 +4226,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" [[package]] -name = "windows_aarch64_msvc" -version = "0.42.2" +name = "windows_aarch64_gnullvm" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" +checksum = "cb7764e35d4db8a7921e09562a0304bf2f93e0a51bfccee0bd0bb0b666b015ea" [[package]] name = "windows_aarch64_msvc" @@ -4266,10 +4238,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] -name = "windows_i686_gnu" -version = "0.42.2" +name = "windows_aarch64_msvc" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" +checksum = "bbaa0368d4f1d2aaefc55b6fcfee13f41544ddf36801e793edbbfd7d7df075ef" [[package]] name = "windows_i686_gnu" @@ -4278,10 +4250,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] -name = "windows_i686_msvc" -version = "0.42.2" +name = "windows_i686_gnu" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" +checksum = "a28637cb1fa3560a16915793afb20081aba2c92ee8af57b4d5f28e4b3e7df313" [[package]] name = "windows_i686_msvc" @@ -4290,10 +4262,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] -name = "windows_x86_64_gnu" -version = "0.42.2" +name = "windows_i686_msvc" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" +checksum = "ffe5e8e31046ce6230cc7215707b816e339ff4d4d67c65dffa206fd0f7aa7b9a" [[package]] name = "windows_x86_64_gnu" @@ -4302,10 +4274,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] -name = "windows_x86_64_gnullvm" -version = "0.42.2" +name = "windows_x86_64_gnu" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" +checksum = "3d6fa32db2bc4a2f5abeacf2b69f7992cd09dca97498da74a151a3132c26befd" [[package]] name = "windows_x86_64_gnullvm" @@ -4314,10 +4286,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] -name = "windows_x86_64_msvc" -version = "0.42.2" +name = "windows_x86_64_gnullvm" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" +checksum = "1a657e1e9d3f514745a572a6846d3c7aa7dbe1658c056ed9c3344c4109a6949e" [[package]] name = "windows_x86_64_msvc" @@ -4325,6 +4297,12 @@ version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" + [[package]] name = "winreg" version = "0.50.0" @@ -4335,11 +4313,31 @@ dependencies = [ "windows-sys 0.48.0", ] +[[package]] +name = "zerocopy" +version = "0.7.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74d4d3961e53fa4c9a25a8637fc2bfaf2595b3d3ae34875568a5cf64787716be" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.7.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" +dependencies = [ + "proc-macro2", + "quote 1.0.35", + "syn 2.0.48", +] + [[package]] name = "zeroize" -version = "1.6.0" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a0956f1ba7c7909bfb66c2e9e4124ab6f6482560f6628b5aaeba39207c9aad9" +checksum = "525b4ec142c6b68a2d10f01f7bbf6755599ca3f81ea53b8431b7dd348f5fdb2d" dependencies = [ "zeroize_derive", ] @@ -4351,6 +4349,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", - "quote 1.0.33", - "syn 2.0.38", + "quote 1.0.35", + "syn 2.0.48", ] diff --git a/algorithms/Cargo.toml b/algorithms/Cargo.toml index bf75ffe3f9..e1297369b7 100644 --- a/algorithms/Cargo.toml +++ b/algorithms/Cargo.toml @@ -71,7 +71,7 @@ version = "=0.16.17" optional = true [dependencies.aleo-std] -version = "0.1.18" +version = "0.1.24" default-features = false [dependencies.anyhow] diff --git a/console/collections/Cargo.toml b/console/collections/Cargo.toml index d283a40013..44aa529199 100644 --- a/console/collections/Cargo.toml +++ b/console/collections/Cargo.toml @@ -27,7 +27,7 @@ default-features = false features = [ "field", "integers" ] [dependencies.aleo-std] -version = "0.1.18" +version = "0.1.24" default-features = false [dependencies.rayon] diff --git a/fields/Cargo.toml b/fields/Cargo.toml index 04b417867a..eec87a569b 100644 --- a/fields/Cargo.toml +++ b/fields/Cargo.toml @@ -29,7 +29,7 @@ version = "=0.16.17" default-features = false [dependencies.aleo-std] -version = "0.1.18" +version = "0.1.24" default-features = false [dependencies.anyhow] diff --git a/ledger/Cargo.toml b/ledger/Cargo.toml index 8eda3911c2..d651593bca 100644 --- a/ledger/Cargo.toml +++ b/ledger/Cargo.toml @@ -107,7 +107,7 @@ path = "../synthesizer" version = "=0.16.17" [dependencies.aleo-std] -version = "0.1.18" +version = "0.1.24" default-features = false [dependencies.anyhow] diff --git a/ledger/coinbase/Cargo.toml b/ledger/coinbase/Cargo.toml index 13af04ed03..3da45ecd4d 100644 --- a/ledger/coinbase/Cargo.toml +++ b/ledger/coinbase/Cargo.toml @@ -74,7 +74,7 @@ version = "=0.16.17" default-features = false [dependencies.aleo-std] -version = "0.1.18" +version = "0.1.24" default-features = false [dependencies.anyhow] diff --git a/ledger/store/Cargo.toml b/ledger/store/Cargo.toml index 0200f831ff..684469c89b 100644 --- a/ledger/store/Cargo.toml +++ b/ledger/store/Cargo.toml @@ -18,7 +18,7 @@ edition = "2021" [features] default = [ "indexmap/rayon", "rayon" ] -rocks = [ "aleo-std", "once_cell", "rocksdb", "tracing" ] +rocks = [ "once_cell", "rocksdb", "tracing" ] serial = [ "console/serial", "ledger-block/serial", @@ -80,9 +80,8 @@ path = "../../synthesizer/snark" version = "=0.16.17" [dependencies.aleo-std] -version = "0.1.18" +version = "0.1.24" default-features = false -optional = true [dependencies.anyhow] version = "1.0.73" diff --git a/ledger/store/src/block/mod.rs b/ledger/store/src/block/mod.rs index 4ffb292fec..88a91342b1 100644 --- a/ledger/store/src/block/mod.rs +++ b/ledger/store/src/block/mod.rs @@ -42,6 +42,7 @@ use ledger_coinbase::{CoinbaseSolution, ProverSolution, PuzzleCommitment}; use ledger_narwhal_batch_certificate::BatchCertificate; use synthesizer_program::Program; +use aleo_std::StorageMode; use anyhow::Result; use parking_lot::RwLock; use std::{borrow::Cow, io::Cursor, sync::Arc}; @@ -207,7 +208,7 @@ pub trait BlockStorage: 'static + Clone + Send + Sync { type TransitionStorage: TransitionStorage; /// Initializes the block storage. - fn open(dev: Option) -> Result; + fn open>(storage: S) -> Result; /// Returns the state root map. fn state_root_map(&self) -> &Self::StateRootMap; @@ -1004,9 +1005,9 @@ pub struct BlockStore> { impl> BlockStore { /// Initializes the block store. - pub fn open(dev: Option) -> Result { + pub fn open>(storage: S) -> Result { // Initialize the block storage. - let storage = B::open(dev)?; + let storage = B::open(storage)?; // Compute the block tree. let tree = { diff --git a/ledger/store/src/consensus/mod.rs b/ledger/store/src/consensus/mod.rs index c8524bcee7..76d63df307 100644 --- a/ledger/store/src/consensus/mod.rs +++ b/ledger/store/src/consensus/mod.rs @@ -24,6 +24,7 @@ use crate::{ }; use console::network::prelude::*; +use aleo_std::StorageMode; use anyhow::Result; use core::marker::PhantomData; @@ -39,7 +40,7 @@ pub trait ConsensusStorage: 'static + Clone + Send + Sync { type TransitionStorage: TransitionStorage; /// Initializes the consensus storage. - fn open(dev: Option) -> Result; + fn open>(storage: S) -> Result; /// Returns the finalize storage. fn finalize_store(&self) -> &FinalizeStore; @@ -113,9 +114,9 @@ pub struct ConsensusStore> { impl> ConsensusStore { /// Initializes the consensus store. - pub fn open(dev: Option) -> Result { + pub fn open>(storage: S) -> Result { // Initialize the consensus storage. - let storage = C::open(dev)?; + let storage = C::open(storage.clone())?; // Return the consensus store. Ok(Self { storage, _phantom: PhantomData }) } diff --git a/ledger/store/src/helpers/memory/block.rs b/ledger/store/src/helpers/memory/block.rs index c09fa09f2e..9de58966a0 100644 --- a/ledger/store/src/helpers/memory/block.rs +++ b/ledger/store/src/helpers/memory/block.rs @@ -24,6 +24,8 @@ use ledger_authority::Authority; use ledger_block::{Header, Ratifications, Rejected}; use ledger_coinbase::{CoinbaseSolution, PuzzleCommitment}; +use aleo_std::StorageMode; + /// An in-memory block storage. #[derive(Clone)] pub struct BlockMemory { @@ -82,9 +84,9 @@ impl BlockStorage for BlockMemory { type TransitionStorage = TransitionMemory; /// Initializes the block storage. - fn open(dev: Option) -> Result { + fn open>(storage: S) -> Result { // Initialize the transition store. - let transition_store = TransitionStore::>::open(dev)?; + let transition_store = TransitionStore::>::open(storage)?; // Initialize the transaction store. let transaction_store = TransactionStore::>::open(transition_store)?; // Return the block storage. diff --git a/ledger/store/src/helpers/memory/consensus.rs b/ledger/store/src/helpers/memory/consensus.rs index 2160160ef6..c826e9f4a0 100644 --- a/ledger/store/src/helpers/memory/consensus.rs +++ b/ledger/store/src/helpers/memory/consensus.rs @@ -20,6 +20,8 @@ use crate::{ }; use console::prelude::*; +use aleo_std::StorageMode; + /// An in-memory consensus storage. #[derive(Clone)] pub struct ConsensusMemory { @@ -37,11 +39,11 @@ impl ConsensusStorage for ConsensusMemory { type TransitionStorage = TransitionMemory; /// Initializes the consensus storage. - fn open(dev: Option) -> Result { + fn open>(storage: S) -> Result { // Initialize the finalize store. - let finalize_store = FinalizeStore::>::open(dev)?; + let finalize_store = FinalizeStore::>::open(storage.clone())?; // Initialize the block store. - let block_store = BlockStore::>::open(dev)?; + let block_store = BlockStore::>::open(storage)?; // Return the consensus storage. Ok(Self { finalize_store, diff --git a/ledger/store/src/helpers/memory/program.rs b/ledger/store/src/helpers/memory/program.rs index 85a5ac5d3e..61e49f2d2d 100644 --- a/ledger/store/src/helpers/memory/program.rs +++ b/ledger/store/src/helpers/memory/program.rs @@ -26,6 +26,7 @@ use console::{ }; use ledger_committee::Committee; +use aleo_std::StorageMode; use indexmap::IndexSet; /// An in-memory finalize storage. @@ -48,9 +49,11 @@ impl FinalizeStorage for FinalizeMemory { type KeyValueMap = NestedMemoryMap<(ProgramID, Identifier), Plaintext, Value>; /// Initializes the finalize storage. - fn open(dev: Option) -> Result { + fn open>(storage: S) -> Result { + // Retrieve the development ID. + let dev = storage.clone().into().dev(); // Initialize the committee store. - let committee_store = CommitteeStore::>::open(dev)?; + let committee_store = CommitteeStore::>::open(storage)?; // Return the finalize store. Ok(Self { committee_store, @@ -107,7 +110,10 @@ impl CommitteeStorage for CommitteeMemory { type CommitteeMap = MemoryMap>; /// Initializes the committee storage. - fn open(dev: Option) -> Result { + fn open>(storage: S) -> Result { + // Retrieve the development ID. + let dev = storage.into().dev(); + Ok(Self { current_round_map: MemoryMap::default(), round_to_height_map: MemoryMap::default(), diff --git a/ledger/store/src/helpers/memory/transition.rs b/ledger/store/src/helpers/memory/transition.rs index 651181fd34..3822b69815 100644 --- a/ledger/store/src/helpers/memory/transition.rs +++ b/ledger/store/src/helpers/memory/transition.rs @@ -19,6 +19,8 @@ use console::{ types::{Field, Group}, }; +use aleo_std::StorageMode; + /// An in-memory transition storage. #[derive(Clone)] pub struct TransitionMemory { @@ -49,11 +51,11 @@ impl TransitionStorage for TransitionMemory { type ReverseTCMMap = MemoryMap, N::TransitionID>; /// Initializes the transition storage. - fn open(dev: Option) -> Result { + fn open>(storage: S) -> Result { Ok(Self { locator_map: MemoryMap::default(), - input_store: InputStore::open(dev)?, - output_store: OutputStore::open(dev)?, + input_store: InputStore::open(storage.clone())?, + output_store: OutputStore::open(storage)?, tpk_map: MemoryMap::default(), reverse_tpk_map: MemoryMap::default(), tcm_map: MemoryMap::default(), @@ -132,7 +134,10 @@ impl InputStorage for InputMemory { type ExternalRecordMap = MemoryMap, ()>; /// Initializes the transition input storage. - fn open(dev: Option) -> Result { + fn open>(storage: S) -> Result { + // Retrieve the development ID. + let dev = storage.into().dev(); + Ok(Self { id_map: MemoryMap::default(), reverse_id_map: MemoryMap::default(), @@ -231,7 +236,10 @@ impl OutputStorage for OutputMemory { type FutureMap = MemoryMap, Option>>; /// Initializes the transition output storage. - fn open(dev: Option) -> Result { + fn open>(storage: S) -> Result { + // Retrieve the development ID. + let dev = storage.into().dev(); + Ok(Self { id_map: Default::default(), reverse_id_map: Default::default(), diff --git a/ledger/store/src/helpers/rocksdb/block.rs b/ledger/store/src/helpers/rocksdb/block.rs index 121ae2a994..e0479819dd 100644 --- a/ledger/store/src/helpers/rocksdb/block.rs +++ b/ledger/store/src/helpers/rocksdb/block.rs @@ -30,6 +30,8 @@ use ledger_authority::Authority; use ledger_block::{Header, Ratifications, Rejected}; use ledger_coinbase::{CoinbaseSolution, PuzzleCommitment}; +use aleo_std::StorageMode; + /// A RocksDB block storage. #[derive(Clone)] pub struct BlockDB { @@ -88,28 +90,28 @@ impl BlockStorage for BlockDB { type TransitionStorage = TransitionDB; /// Initializes the block storage. - fn open(dev: Option) -> Result { + fn open>(storage: S) -> Result { // Initialize the transition store. - let transition_store = TransitionStore::>::open(dev)?; + let transition_store = TransitionStore::>::open(storage.clone())?; // Initialize the transaction store. let transaction_store = TransactionStore::>::open(transition_store)?; // Return the block storage. Ok(Self { - state_root_map: internal::RocksDB::open_map(N::ID, dev, MapID::Block(BlockMap::StateRoot))?, - reverse_state_root_map: internal::RocksDB::open_map(N::ID, dev, MapID::Block(BlockMap::ReverseStateRoot))?, - id_map: internal::RocksDB::open_map(N::ID, dev, MapID::Block(BlockMap::ID))?, - reverse_id_map: internal::RocksDB::open_map(N::ID, dev, MapID::Block(BlockMap::ReverseID))?, - header_map: internal::RocksDB::open_map(N::ID, dev, MapID::Block(BlockMap::Header))?, - authority_map: internal::RocksDB::open_map(N::ID, dev, MapID::Block(BlockMap::Authority))?, - certificate_map: internal::RocksDB::open_map(N::ID, dev, MapID::Block(BlockMap::Certificate))?, - ratifications_map: internal::RocksDB::open_map(N::ID, dev, MapID::Block(BlockMap::Ratifications))?, - solutions_map: internal::RocksDB::open_map(N::ID, dev, MapID::Block(BlockMap::Solutions))?, - puzzle_commitments_map: internal::RocksDB::open_map(N::ID, dev, MapID::Block(BlockMap::PuzzleCommitments))?, - transactions_map: internal::RocksDB::open_map(N::ID, dev, MapID::Block(BlockMap::Transactions))?, - aborted_transaction_ids_map: internal::RocksDB::open_map(N::ID, dev, MapID::Block(BlockMap::AbortedTransactionIDs))?, - rejected_or_aborted_transaction_id_map: internal::RocksDB::open_map(N::ID, dev, MapID::Block(BlockMap::RejectedOrAbortedTransactionID))?, - confirmed_transactions_map: internal::RocksDB::open_map(N::ID, dev, MapID::Block(BlockMap::ConfirmedTransactions))?, - rejected_deployment_or_execution_map: internal::RocksDB::open_map(N::ID, dev, MapID::Block(BlockMap::RejectedDeploymentOrExecution))?, + state_root_map: internal::RocksDB::open_map(N::ID, storage.clone(), MapID::Block(BlockMap::StateRoot))?, + reverse_state_root_map: internal::RocksDB::open_map(N::ID, storage.clone(), MapID::Block(BlockMap::ReverseStateRoot))?, + id_map: internal::RocksDB::open_map(N::ID, storage.clone(), MapID::Block(BlockMap::ID))?, + reverse_id_map: internal::RocksDB::open_map(N::ID, storage.clone(), MapID::Block(BlockMap::ReverseID))?, + header_map: internal::RocksDB::open_map(N::ID, storage.clone(), MapID::Block(BlockMap::Header))?, + authority_map: internal::RocksDB::open_map(N::ID, storage.clone(), MapID::Block(BlockMap::Authority))?, + certificate_map: internal::RocksDB::open_map(N::ID, storage.clone(), MapID::Block(BlockMap::Certificate))?, + ratifications_map: internal::RocksDB::open_map(N::ID, storage.clone(), MapID::Block(BlockMap::Ratifications))?, + solutions_map: internal::RocksDB::open_map(N::ID, storage.clone(), MapID::Block(BlockMap::Solutions))?, + puzzle_commitments_map: internal::RocksDB::open_map(N::ID, storage.clone(), MapID::Block(BlockMap::PuzzleCommitments))?, + transactions_map: internal::RocksDB::open_map(N::ID, storage.clone(), MapID::Block(BlockMap::Transactions))?, + aborted_transaction_ids_map: internal::RocksDB::open_map(N::ID, storage.clone(), MapID::Block(BlockMap::AbortedTransactionIDs))?, + rejected_or_aborted_transaction_id_map: internal::RocksDB::open_map(N::ID, storage.clone(), MapID::Block(BlockMap::RejectedOrAbortedTransactionID))?, + confirmed_transactions_map: internal::RocksDB::open_map(N::ID, storage.clone(), MapID::Block(BlockMap::ConfirmedTransactions))?, + rejected_deployment_or_execution_map: internal::RocksDB::open_map(N::ID, storage, MapID::Block(BlockMap::RejectedDeploymentOrExecution))?, transaction_store, }) } diff --git a/ledger/store/src/helpers/rocksdb/consensus.rs b/ledger/store/src/helpers/rocksdb/consensus.rs index 346b97058b..78c9c89e56 100644 --- a/ledger/store/src/helpers/rocksdb/consensus.rs +++ b/ledger/store/src/helpers/rocksdb/consensus.rs @@ -20,6 +20,8 @@ use crate::{ }; use console::prelude::*; +use aleo_std::StorageMode; + /// An RocksDB consensus storage. #[derive(Clone)] pub struct ConsensusDB { @@ -37,11 +39,11 @@ impl ConsensusStorage for ConsensusDB { type TransitionStorage = TransitionDB; /// Initializes the consensus storage. - fn open(dev: Option) -> Result { + fn open>(storage: S) -> Result { // Initialize the finalize store. - let finalize_store = FinalizeStore::>::open(dev)?; + let finalize_store = FinalizeStore::>::open(storage.clone())?; // Initialize the block store. - let block_store = BlockStore::>::open(dev)?; + let block_store = BlockStore::>::open(storage)?; // Return the consensus storage. Ok(Self { finalize_store, diff --git a/ledger/store/src/helpers/rocksdb/internal/mod.rs b/ledger/store/src/helpers/rocksdb/internal/mod.rs index 80dcfdec06..868ab46dd4 100644 --- a/ledger/store/src/helpers/rocksdb/internal/mod.rs +++ b/ledger/store/src/helpers/rocksdb/internal/mod.rs @@ -24,6 +24,7 @@ pub use nested_map::*; #[cfg(test)] mod tests; +use aleo_std::StorageMode; use anyhow::{bail, Result}; use once_cell::sync::OnceCell; use parking_lot::Mutex; @@ -42,26 +43,32 @@ pub const PREFIX_LEN: usize = 4; // N::ID (u16) + DataID (u16) pub trait Database { /// Opens the database. - fn open(network_id: u16, dev: Option) -> Result + fn open>(network_id: u16, storage: S) -> Result where Self: Sized; /// Opens the map with the given `network_id`, `(optional) development ID`, and `map_id` from storage. - fn open_map>( + fn open_map< + S: Clone + Into, + K: Serialize + DeserializeOwned, + V: Serialize + DeserializeOwned, + T: Into, + >( network_id: u16, - dev: Option, + storage: S, map_id: T, ) -> Result>; /// Opens the nested map with the given `network_id`, `(optional) development ID`, and `map_id` from storage. fn open_nested_map< + S: Clone + Into, M: Serialize + DeserializeOwned, K: Serialize + DeserializeOwned, V: Serialize + DeserializeOwned, T: Into, >( network_id: u16, - dev: Option, + storage: S, map_id: T, ) -> Result>; } @@ -96,9 +103,12 @@ impl Database for RocksDB { /// /// In production mode, the database opens directory `~/.aleo/storage/ledger-{network}`. /// In development mode, the database opens directory `/path/to/repo/.ledger-{network}-{id}`. - fn open(network_id: u16, dev: Option) -> Result { + fn open>(network_id: u16, storage: S) -> Result { static DB: OnceCell = OnceCell::new(); + // Retrieve the development ID. + let dev = storage.clone().into().dev(); + // Retrieve the database. let database = DB .get_or_try_init(|| { @@ -110,7 +120,7 @@ impl Database for RocksDB { let prefix_extractor = rocksdb::SliceTransform::create_fixed_prefix(PREFIX_LEN); options.set_prefix_extractor(prefix_extractor); - let primary = aleo_std::aleo_ledger_dir(network_id, dev); + let primary = aleo_std::aleo_ledger_dir(network_id, storage.into()); let rocksdb = { options.increase_parallelism(2); options.set_max_background_jobs(4); @@ -137,13 +147,18 @@ impl Database for RocksDB { } /// Opens the map with the given `network_id`, `(optional) development ID`, and `map_id` from storage. - fn open_map>( + fn open_map< + S: Clone + Into, + K: Serialize + DeserializeOwned, + V: Serialize + DeserializeOwned, + T: Into, + >( network_id: u16, - dev: Option, + storage: S, map_id: T, ) -> Result> { // Open the RocksDB database. - let database = Self::open(network_id, dev)?; + let database = Self::open(network_id, storage)?; // Combine contexts to create a new scope. let mut context = database.network_id.to_le_bytes().to_vec(); @@ -161,17 +176,18 @@ impl Database for RocksDB { /// Opens the nested map with the given `network_id`, `(optional) development ID`, and `map_id` from storage. fn open_nested_map< + S: Clone + Into, M: Serialize + DeserializeOwned, K: Serialize + DeserializeOwned, V: Serialize + DeserializeOwned, T: Into, >( network_id: u16, - dev: Option, + storage: S, map_id: T, ) -> Result> { // Open the RocksDB database. - let database = Self::open(network_id, dev)?; + let database = Self::open(network_id, storage)?; // Combine contexts to create a new scope. let mut context = database.network_id.to_le_bytes().to_vec(); diff --git a/ledger/store/src/helpers/rocksdb/program.rs b/ledger/store/src/helpers/rocksdb/program.rs index f020d2b35b..2b2a33bc23 100644 --- a/ledger/store/src/helpers/rocksdb/program.rs +++ b/ledger/store/src/helpers/rocksdb/program.rs @@ -26,6 +26,7 @@ use console::{ }; use ledger_committee::Committee; +use aleo_std::StorageMode; use indexmap::IndexSet; /// A RocksDB finalize storage. @@ -48,14 +49,16 @@ impl FinalizeStorage for FinalizeDB { type KeyValueMap = NestedDataMap<(ProgramID, Identifier), Plaintext, Value>; /// Initializes the finalize storage. - fn open(dev: Option) -> Result { + fn open>(storage: S) -> Result { + // Retrieve the development ID. + let dev = storage.clone().into().dev(); // Initialize the committee store. - let committee_store = CommitteeStore::>::open(dev)?; + let committee_store = CommitteeStore::>::open(storage.clone())?; // Return the finalize storage. Ok(Self { committee_store, - program_id_map: rocksdb::RocksDB::open_map(N::ID, dev, MapID::Program(ProgramMap::ProgramID))?, - key_value_map: rocksdb::RocksDB::open_nested_map(N::ID, dev, MapID::Program(ProgramMap::KeyValueID))?, + program_id_map: rocksdb::RocksDB::open_map(N::ID, storage.clone(), MapID::Program(ProgramMap::ProgramID))?, + key_value_map: rocksdb::RocksDB::open_nested_map(N::ID, storage, MapID::Program(ProgramMap::KeyValueID))?, dev, }) } @@ -115,11 +118,14 @@ impl CommitteeStorage for CommitteeDB { type CommitteeMap = DataMap>; /// Initializes the committee storage. - fn open(dev: Option) -> Result { + fn open>(storage: S) -> Result { + // Retrieve the development ID. + let dev = storage.clone().into().dev(); + Ok(Self { - current_round_map: rocksdb::RocksDB::open_map(N::ID, dev, MapID::Committee(CommitteeMap::CurrentRound))?, - round_to_height_map: rocksdb::RocksDB::open_map(N::ID, dev, MapID::Committee(CommitteeMap::RoundToHeight))?, - committee_map: rocksdb::RocksDB::open_map(N::ID, dev, MapID::Committee(CommitteeMap::Committee))?, + current_round_map: rocksdb::RocksDB::open_map(N::ID, storage.clone(), MapID::Committee(CommitteeMap::CurrentRound))?, + round_to_height_map: rocksdb::RocksDB::open_map(N::ID, storage.clone(), MapID::Committee(CommitteeMap::RoundToHeight))?, + committee_map: rocksdb::RocksDB::open_map(N::ID, storage, MapID::Committee(CommitteeMap::Committee))?, dev, }) } diff --git a/ledger/store/src/helpers/rocksdb/transition.rs b/ledger/store/src/helpers/rocksdb/transition.rs index b6af3398d5..d63b647bac 100644 --- a/ledger/store/src/helpers/rocksdb/transition.rs +++ b/ledger/store/src/helpers/rocksdb/transition.rs @@ -26,6 +26,8 @@ use console::{ types::{Field, Group}, }; +use aleo_std::StorageMode; + /// A database transition storage. #[derive(Clone)] pub struct TransitionDB { @@ -56,15 +58,15 @@ impl TransitionStorage for TransitionDB { type ReverseTCMMap = DataMap, N::TransitionID>; /// Initializes the transition storage. - fn open(dev: Option) -> Result { + fn open>(storage: S) -> Result { Ok(Self { - locator_map: rocksdb::RocksDB::open_map(N::ID, dev, MapID::Transition(TransitionMap::Locator))?, - input_store: InputStore::open(dev)?, - output_store: OutputStore::open(dev)?, - tpk_map: rocksdb::RocksDB::open_map(N::ID, dev, MapID::Transition(TransitionMap::TPK))?, - reverse_tpk_map: rocksdb::RocksDB::open_map(N::ID, dev, MapID::Transition(TransitionMap::ReverseTPK))?, - tcm_map: rocksdb::RocksDB::open_map(N::ID, dev, MapID::Transition(TransitionMap::TCM))?, - reverse_tcm_map: rocksdb::RocksDB::open_map(N::ID, dev, MapID::Transition(TransitionMap::ReverseTCM))?, + locator_map: rocksdb::RocksDB::open_map(N::ID, storage.clone(), MapID::Transition(TransitionMap::Locator))?, + input_store: InputStore::open(storage.clone())?, + output_store: OutputStore::open(storage.clone())?, + tpk_map: rocksdb::RocksDB::open_map(N::ID, storage.clone(), MapID::Transition(TransitionMap::TPK))?, + reverse_tpk_map: rocksdb::RocksDB::open_map(N::ID, storage.clone(), MapID::Transition(TransitionMap::ReverseTPK))?, + tcm_map: rocksdb::RocksDB::open_map(N::ID, storage.clone(), MapID::Transition(TransitionMap::TCM))?, + reverse_tcm_map: rocksdb::RocksDB::open_map(N::ID, storage, MapID::Transition(TransitionMap::ReverseTCM))?, }) } @@ -139,16 +141,19 @@ impl InputStorage for InputDB { type ExternalRecordMap = DataMap, ()>; /// Initializes the transition input storage. - fn open(dev: Option) -> Result { + fn open>(storage: S) -> Result { + // Retrieve the development ID. + let dev = storage.clone().into().dev(); + Ok(Self { - id_map: rocksdb::RocksDB::open_map(N::ID, dev, MapID::TransitionInput(TransitionInputMap::ID))?, - reverse_id_map: rocksdb::RocksDB::open_map(N::ID, dev, MapID::TransitionInput(TransitionInputMap::ReverseID))?, - constant: rocksdb::RocksDB::open_map(N::ID, dev, MapID::TransitionInput(TransitionInputMap::Constant))?, - public: rocksdb::RocksDB::open_map(N::ID, dev, MapID::TransitionInput(TransitionInputMap::Public))?, - private: rocksdb::RocksDB::open_map(N::ID, dev, MapID::TransitionInput(TransitionInputMap::Private))?, - record: rocksdb::RocksDB::open_map(N::ID, dev, MapID::TransitionInput(TransitionInputMap::Record))?, - record_tag: rocksdb::RocksDB::open_map(N::ID, dev, MapID::TransitionInput(TransitionInputMap::RecordTag))?, - external_record: rocksdb::RocksDB::open_map(N::ID, dev, MapID::TransitionInput(TransitionInputMap::ExternalRecord))?, + id_map: rocksdb::RocksDB::open_map(N::ID, storage.clone(), MapID::TransitionInput(TransitionInputMap::ID))?, + reverse_id_map: rocksdb::RocksDB::open_map(N::ID, storage.clone(), MapID::TransitionInput(TransitionInputMap::ReverseID))?, + constant: rocksdb::RocksDB::open_map(N::ID, storage.clone(), MapID::TransitionInput(TransitionInputMap::Constant))?, + public: rocksdb::RocksDB::open_map(N::ID, storage.clone(), MapID::TransitionInput(TransitionInputMap::Public))?, + private: rocksdb::RocksDB::open_map(N::ID, storage.clone(), MapID::TransitionInput(TransitionInputMap::Private))?, + record: rocksdb::RocksDB::open_map(N::ID, storage.clone(), MapID::TransitionInput(TransitionInputMap::Record))?, + record_tag: rocksdb::RocksDB::open_map(N::ID, storage.clone(), MapID::TransitionInput(TransitionInputMap::RecordTag))?, + external_record: rocksdb::RocksDB::open_map(N::ID, storage, MapID::TransitionInput(TransitionInputMap::ExternalRecord))?, dev, }) } @@ -238,17 +243,20 @@ impl OutputStorage for OutputDB { type FutureMap = DataMap, Option>>; /// Initializes the transition output storage. - fn open(dev: Option) -> Result { + fn open>(storage: S) -> Result { + // Retrieve the development ID. + let dev = storage.clone().into().dev(); + Ok(Self { - id_map: rocksdb::RocksDB::open_map(N::ID, dev, MapID::TransitionOutput(TransitionOutputMap::ID))?, - reverse_id_map: rocksdb::RocksDB::open_map(N::ID, dev, MapID::TransitionOutput(TransitionOutputMap::ReverseID))?, - constant: rocksdb::RocksDB::open_map(N::ID, dev, MapID::TransitionOutput(TransitionOutputMap::Constant))?, - public: rocksdb::RocksDB::open_map(N::ID, dev, MapID::TransitionOutput(TransitionOutputMap::Public))?, - private: rocksdb::RocksDB::open_map(N::ID, dev, MapID::TransitionOutput(TransitionOutputMap::Private))?, - record: rocksdb::RocksDB::open_map(N::ID, dev, MapID::TransitionOutput(TransitionOutputMap::Record))?, - record_nonce: rocksdb::RocksDB::open_map(N::ID, dev, MapID::TransitionOutput(TransitionOutputMap::RecordNonce))?, - external_record: rocksdb::RocksDB::open_map(N::ID, dev, MapID::TransitionOutput(TransitionOutputMap::ExternalRecord))?, - future: rocksdb::RocksDB::open_map(N::ID, dev, MapID::TransitionOutput(TransitionOutputMap::Future))?, + id_map: rocksdb::RocksDB::open_map(N::ID, storage.clone(), MapID::TransitionOutput(TransitionOutputMap::ID))?, + reverse_id_map: rocksdb::RocksDB::open_map(N::ID, storage.clone(), MapID::TransitionOutput(TransitionOutputMap::ReverseID))?, + constant: rocksdb::RocksDB::open_map(N::ID, storage.clone(), MapID::TransitionOutput(TransitionOutputMap::Constant))?, + public: rocksdb::RocksDB::open_map(N::ID, storage.clone(), MapID::TransitionOutput(TransitionOutputMap::Public))?, + private: rocksdb::RocksDB::open_map(N::ID, storage.clone(), MapID::TransitionOutput(TransitionOutputMap::Private))?, + record: rocksdb::RocksDB::open_map(N::ID, storage.clone(), MapID::TransitionOutput(TransitionOutputMap::Record))?, + record_nonce: rocksdb::RocksDB::open_map(N::ID, storage.clone(), MapID::TransitionOutput(TransitionOutputMap::RecordNonce))?, + external_record: rocksdb::RocksDB::open_map(N::ID, storage.clone(), MapID::TransitionOutput(TransitionOutputMap::ExternalRecord))?, + future: rocksdb::RocksDB::open_map(N::ID, storage, MapID::TransitionOutput(TransitionOutputMap::Future))?, dev, }) } diff --git a/ledger/store/src/program/committee.rs b/ledger/store/src/program/committee.rs index 62cd6e0bbb..1f8f8db502 100644 --- a/ledger/store/src/program/committee.rs +++ b/ledger/store/src/program/committee.rs @@ -21,6 +21,7 @@ use crate::{ use console::network::prelude::*; use ledger_committee::Committee; +use aleo_std::StorageMode; use anyhow::Result; use core::marker::PhantomData; @@ -36,7 +37,7 @@ pub trait CommitteeStorage: 'static + Clone + Send + Sync { type CommitteeMap: for<'a> Map<'a, u32, Committee>; /// Initializes the committee storage. - fn open(dev: Option) -> Result; + fn open>(storage: S) -> Result; /// Initializes the test-variant of the storage. #[cfg(any(test, feature = "test"))] @@ -299,9 +300,9 @@ pub struct CommitteeStore> { impl> CommitteeStore { /// Initializes the committee store. - pub fn open(dev: Option) -> Result { + pub fn open>(storage: S) -> Result { // Initialize the committee storage. - let storage = C::open(dev)?; + let storage = C::open(storage.clone())?; // Return the committee store. Ok(Self { storage, _phantom: PhantomData }) } diff --git a/ledger/store/src/program/finalize.rs b/ledger/store/src/program/finalize.rs index 7e4d45bb99..19b83a070e 100644 --- a/ledger/store/src/program/finalize.rs +++ b/ledger/store/src/program/finalize.rs @@ -26,6 +26,7 @@ use console::{ }; use synthesizer_program::{FinalizeOperation, FinalizeStoreTrait}; +use aleo_std::StorageMode; use anyhow::Result; use core::marker::PhantomData; use indexmap::IndexSet; @@ -78,7 +79,7 @@ pub trait FinalizeStorage: 'static + Clone + Send + Sync { type KeyValueMap: for<'a> NestedMap<'a, (ProgramID, Identifier), Plaintext, Value>; /// Initializes the program state storage. - fn open(dev: Option) -> Result; + fn open>(storage: S) -> Result; /// Initializes the test-variant of the storage. #[cfg(any(test, feature = "test"))] @@ -530,8 +531,8 @@ pub struct FinalizeStore> { impl> FinalizeStore { /// Initializes the finalize store. - pub fn open(dev: Option) -> Result { - Self::from(P::open(dev)?) + pub fn open>(storage: S) -> Result { + Self::from(P::open(storage)?) } /// Initializes the test-variant of the storage. diff --git a/ledger/store/src/transition/input.rs b/ledger/store/src/transition/input.rs index 53c12f5147..7b46f8ef4d 100644 --- a/ledger/store/src/transition/input.rs +++ b/ledger/store/src/transition/input.rs @@ -23,6 +23,7 @@ use console::{ }; use ledger_block::Input; +use aleo_std::StorageMode; use anyhow::Result; use std::borrow::Cow; @@ -46,7 +47,7 @@ pub trait InputStorage: Clone + Send + Sync { type ExternalRecordMap: for<'a> Map<'a, Field, ()>; /// Initializes the transition input storage. - fn open(dev: Option) -> Result; + fn open>(storage: S) -> Result; /// Returns the ID map. fn id_map(&self) -> &Self::IDMap; @@ -305,9 +306,9 @@ pub struct InputStore> { impl> InputStore { /// Initializes the transition input store. - pub fn open(dev: Option) -> Result { + pub fn open>(storage: S) -> Result { // Initialize a new transition input storage. - let storage = I::open(dev)?; + let storage = I::open(storage)?; // Return the transition input store. Ok(Self { constant: storage.constant_map().clone(), diff --git a/ledger/store/src/transition/mod.rs b/ledger/store/src/transition/mod.rs index 734cf186e4..2eeb724b22 100644 --- a/ledger/store/src/transition/mod.rs +++ b/ledger/store/src/transition/mod.rs @@ -31,6 +31,7 @@ use console::{ }; use ledger_block::{Input, Output, Transition}; +use aleo_std::StorageMode; use anyhow::Result; use std::borrow::Cow; @@ -52,7 +53,7 @@ pub trait TransitionStorage: Clone + Send + Sync { type ReverseTCMMap: for<'a> Map<'a, Field, N::TransitionID>; /// Initializes the transition storage. - fn open(dev: Option) -> Result; + fn open>(storage: S) -> Result; /// Returns the transition program IDs and function names. fn locator_map(&self) -> &Self::LocatorMap; @@ -270,9 +271,9 @@ pub struct TransitionStore> { impl> TransitionStore { /// Initializes the transition store. - pub fn open(dev: Option) -> Result { + pub fn open>(storage: S) -> Result { // Initialize the transition storage. - let storage = T::open(dev)?; + let storage = T::open(storage)?; // Return the transition store. Ok(Self { locator: storage.locator_map().clone(), diff --git a/ledger/store/src/transition/output.rs b/ledger/store/src/transition/output.rs index 2c9a82c0ef..6612eb468b 100644 --- a/ledger/store/src/transition/output.rs +++ b/ledger/store/src/transition/output.rs @@ -23,6 +23,7 @@ use console::{ }; use ledger_block::Output; +use aleo_std::StorageMode; use anyhow::Result; use std::borrow::Cow; @@ -48,7 +49,7 @@ pub trait OutputStorage: Clone + Send + Sync { type FutureMap: for<'a> Map<'a, Field, Option>>; /// Initializes the transition output storage. - fn open(dev: Option) -> Result; + fn open>(storage: S) -> Result; /// Returns the ID map. fn id_map(&self) -> &Self::IDMap; @@ -326,9 +327,9 @@ pub struct OutputStore> { impl> OutputStore { /// Initializes the transition output store. - pub fn open(dev: Option) -> Result { + pub fn open>(storage: S) -> Result { // Initialize a new transition output storage. - let storage = O::open(dev)?; + let storage = O::open(storage)?; // Return the transition output store. Ok(Self { constant: storage.constant_map().clone(), diff --git a/parameters/Cargo.toml b/parameters/Cargo.toml index 1e59969d3e..b4ed86b72d 100644 --- a/parameters/Cargo.toml +++ b/parameters/Cargo.toml @@ -39,7 +39,7 @@ path = "../utilities" version = "=0.16.17" [dependencies.aleo-std] -version = "0.1.18" +version = "0.1.24" default-features = false features = [ "storage" ] diff --git a/synthesizer/Cargo.toml b/synthesizer/Cargo.toml index 80f46b734c..6265b3f9ec 100644 --- a/synthesizer/Cargo.toml +++ b/synthesizer/Cargo.toml @@ -127,7 +127,7 @@ version = "=0.16.17" optional = true [dependencies.aleo-std] -version = "0.1.18" +version = "0.1.24" default-features = false [dependencies.anyhow] diff --git a/synthesizer/process/Cargo.toml b/synthesizer/process/Cargo.toml index c350fd71be..5402fa95f1 100644 --- a/synthesizer/process/Cargo.toml +++ b/synthesizer/process/Cargo.toml @@ -89,7 +89,7 @@ path = "../../utilities" version = "=0.16.17" [dependencies.aleo-std] -version = "0.1.18" +version = "0.1.24" default-features = false [dependencies.colored] diff --git a/utilities/Cargo.toml b/utilities/Cargo.toml index 1887909cef..977bc93fb9 100644 --- a/utilities/Cargo.toml +++ b/utilities/Cargo.toml @@ -29,7 +29,7 @@ version = "=0.16.17" optional = true [dependencies.aleo-std] -version = "0.1.18" +version = "0.1.24" optional = true default-features = false From 9fe55ede103c832f5a6fa4777bbf2ae1440a2f96 Mon Sep 17 00:00:00 2001 From: Howard Wu <9260812+howardwu@users.noreply.github.com> Date: Sat, 20 Jan 2024 17:19:03 -0800 Subject: [PATCH 199/298] Update docs --- ledger/store/src/helpers/rocksdb/internal/mod.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ledger/store/src/helpers/rocksdb/internal/mod.rs b/ledger/store/src/helpers/rocksdb/internal/mod.rs index 868ab46dd4..13314d0c46 100644 --- a/ledger/store/src/helpers/rocksdb/internal/mod.rs +++ b/ledger/store/src/helpers/rocksdb/internal/mod.rs @@ -47,7 +47,7 @@ pub trait Database { where Self: Sized; - /// Opens the map with the given `network_id`, `(optional) development ID`, and `map_id` from storage. + /// Opens the map with the given `network_id`, `storage mode`, and `map_id` from storage. fn open_map< S: Clone + Into, K: Serialize + DeserializeOwned, @@ -59,7 +59,7 @@ pub trait Database { map_id: T, ) -> Result>; - /// Opens the nested map with the given `network_id`, `(optional) development ID`, and `map_id` from storage. + /// Opens the nested map with the given `network_id`, `storage mode`, and `map_id` from storage. fn open_nested_map< S: Clone + Into, M: Serialize + DeserializeOwned, @@ -146,7 +146,7 @@ impl Database for RocksDB { } } - /// Opens the map with the given `network_id`, `(optional) development ID`, and `map_id` from storage. + /// Opens the map with the given `network_id`, `storage mode`, and `map_id` from storage. fn open_map< S: Clone + Into, K: Serialize + DeserializeOwned, @@ -174,7 +174,7 @@ impl Database for RocksDB { }))) } - /// Opens the nested map with the given `network_id`, `(optional) development ID`, and `map_id` from storage. + /// Opens the nested map with the given `network_id`, `storage mode`, and `map_id` from storage. fn open_nested_map< S: Clone + Into, M: Serialize + DeserializeOwned, From 06bd41f593e8d44992fb2e9ff86bae936bbdbd0a Mon Sep 17 00:00:00 2001 From: Howard Wu <9260812+howardwu@users.noreply.github.com> Date: Sat, 20 Jan 2024 17:51:00 -0800 Subject: [PATCH 200/298] Switch from dev to storage_mode --- ledger/store/Cargo.toml | 4 +- ledger/store/src/block/mod.rs | 16 +++---- ledger/store/src/consensus/mod.rs | 18 +++---- ledger/store/src/helpers/memory/block.rs | 2 +- ledger/store/src/helpers/memory/consensus.rs | 2 +- ledger/store/src/helpers/memory/program.rs | 33 ++++++------- ledger/store/src/helpers/memory/transition.rs | 32 +++++-------- ledger/store/src/helpers/rocksdb/block.rs | 2 +- ledger/store/src/helpers/rocksdb/consensus.rs | 2 +- .../store/src/helpers/rocksdb/internal/mod.rs | 48 +++++++++---------- ledger/store/src/helpers/rocksdb/program.rs | 39 +++++++-------- .../store/src/helpers/rocksdb/transaction.rs | 38 +++++++-------- .../store/src/helpers/rocksdb/transition.rs | 36 ++++++-------- ledger/store/src/program/committee.rs | 12 ++--- ledger/store/src/program/finalize.rs | 12 ++--- ledger/store/src/transaction/deployment.rs | 13 ++--- ledger/store/src/transaction/execution.rs | 13 ++--- ledger/store/src/transaction/fee.rs | 13 ++--- ledger/store/src/transaction/mod.rs | 17 +++---- ledger/store/src/transition/input.rs | 12 ++--- ledger/store/src/transition/mod.rs | 16 +++---- ledger/store/src/transition/output.rs | 12 ++--- 22 files changed, 187 insertions(+), 205 deletions(-) diff --git a/ledger/store/Cargo.toml b/ledger/store/Cargo.toml index 684469c89b..6684dce041 100644 --- a/ledger/store/Cargo.toml +++ b/ledger/store/Cargo.toml @@ -79,8 +79,8 @@ package = "snarkvm-synthesizer-snark" path = "../../synthesizer/snark" version = "=0.16.17" -[dependencies.aleo-std] -version = "0.1.24" +[dependencies.aleo-std-storage] +version = "0.1.7" default-features = false [dependencies.anyhow] diff --git a/ledger/store/src/block/mod.rs b/ledger/store/src/block/mod.rs index 88a91342b1..fdeac2ceb3 100644 --- a/ledger/store/src/block/mod.rs +++ b/ledger/store/src/block/mod.rs @@ -42,7 +42,7 @@ use ledger_coinbase::{CoinbaseSolution, ProverSolution, PuzzleCommitment}; use ledger_narwhal_batch_certificate::BatchCertificate; use synthesizer_program::Program; -use aleo_std::StorageMode; +use aleo_std_storage::StorageMode; use anyhow::Result; use parking_lot::RwLock; use std::{borrow::Cow, io::Cursor, sync::Arc}; @@ -247,10 +247,10 @@ pub trait BlockStorage: 'static + Clone + Send + Sync { fn transition_store(&self) -> &TransitionStore { self.transaction_store().transition_store() } - /// Returns the optional development ID. - fn dev(&self) -> Option { - debug_assert!(self.transaction_store().dev() == self.transition_store().dev()); - self.transition_store().dev() + /// Returns the storage mode. + fn storage_mode(&self) -> &StorageMode { + debug_assert!(self.transaction_store().storage_mode() == self.transition_store().storage_mode()); + self.transition_store().storage_mode() } /// Starts an atomic batch write operation. @@ -1144,9 +1144,9 @@ impl> BlockStore { self.storage.finish_atomic() } - /// Returns the optional development ID. - pub fn dev(&self) -> Option { - self.storage.dev() + /// Returns the storage mode. + pub fn storage_mode(&self) -> &StorageMode { + self.storage.storage_mode() } } diff --git a/ledger/store/src/consensus/mod.rs b/ledger/store/src/consensus/mod.rs index 76d63df307..d4672f7414 100644 --- a/ledger/store/src/consensus/mod.rs +++ b/ledger/store/src/consensus/mod.rs @@ -24,7 +24,7 @@ use crate::{ }; use console::network::prelude::*; -use aleo_std::StorageMode; +use aleo_std_storage::StorageMode; use anyhow::Result; use core::marker::PhantomData; @@ -54,11 +54,11 @@ pub trait ConsensusStorage: 'static + Clone + Send + Sync { fn transition_store(&self) -> &TransitionStore { self.block_store().transition_store() } - /// Returns the optional development ID. - fn dev(&self) -> Option { - debug_assert!(self.block_store().dev() == self.transaction_store().dev()); - debug_assert!(self.transaction_store().dev() == self.transition_store().dev()); - self.transition_store().dev() + /// Returns the storage mode. + fn storage_mode(&self) -> &StorageMode { + debug_assert!(self.block_store().storage_mode() == self.transaction_store().storage_mode()); + debug_assert!(self.transaction_store().storage_mode() == self.transition_store().storage_mode()); + self.transition_store().storage_mode() } /// Starts an atomic batch write operation. @@ -181,8 +181,8 @@ impl> ConsensusStore { self.storage.finish_atomic() } - /// Returns the optional development ID. - pub fn dev(&self) -> Option { - self.storage.dev() + /// Returns the storage mode. + pub fn storage_mode(&self) -> &StorageMode { + self.storage.storage_mode() } } diff --git a/ledger/store/src/helpers/memory/block.rs b/ledger/store/src/helpers/memory/block.rs index 9de58966a0..11663eacc7 100644 --- a/ledger/store/src/helpers/memory/block.rs +++ b/ledger/store/src/helpers/memory/block.rs @@ -24,7 +24,7 @@ use ledger_authority::Authority; use ledger_block::{Header, Ratifications, Rejected}; use ledger_coinbase::{CoinbaseSolution, PuzzleCommitment}; -use aleo_std::StorageMode; +use aleo_std_storage::StorageMode; /// An in-memory block storage. #[derive(Clone)] diff --git a/ledger/store/src/helpers/memory/consensus.rs b/ledger/store/src/helpers/memory/consensus.rs index c826e9f4a0..d5adf20141 100644 --- a/ledger/store/src/helpers/memory/consensus.rs +++ b/ledger/store/src/helpers/memory/consensus.rs @@ -20,7 +20,7 @@ use crate::{ }; use console::prelude::*; -use aleo_std::StorageMode; +use aleo_std_storage::StorageMode; /// An in-memory consensus storage. #[derive(Clone)] diff --git a/ledger/store/src/helpers/memory/program.rs b/ledger/store/src/helpers/memory/program.rs index 61e49f2d2d..04675cff7d 100644 --- a/ledger/store/src/helpers/memory/program.rs +++ b/ledger/store/src/helpers/memory/program.rs @@ -26,7 +26,7 @@ use console::{ }; use ledger_committee::Committee; -use aleo_std::StorageMode; +use aleo_std_storage::StorageMode; use indexmap::IndexSet; /// An in-memory finalize storage. @@ -38,8 +38,8 @@ pub struct FinalizeMemory { program_id_map: MemoryMap, IndexSet>>, /// The key-value map. key_value_map: NestedMemoryMap<(ProgramID, Identifier), Plaintext, Value>, - /// The optional development ID. - dev: Option, + /// The storage mode. + storage_mode: StorageMode, } #[rustfmt::skip] @@ -50,16 +50,14 @@ impl FinalizeStorage for FinalizeMemory { /// Initializes the finalize storage. fn open>(storage: S) -> Result { - // Retrieve the development ID. - let dev = storage.clone().into().dev(); // Initialize the committee store. - let committee_store = CommitteeStore::>::open(storage)?; + let committee_store = CommitteeStore::>::open(storage.clone())?; // Return the finalize store. Ok(Self { committee_store, program_id_map: MemoryMap::default(), key_value_map: NestedMemoryMap::default(), - dev, + storage_mode: storage.into(), }) } @@ -84,9 +82,9 @@ impl FinalizeStorage for FinalizeMemory { &self.key_value_map } - /// Returns the optional development ID. - fn dev(&self) -> Option { - self.dev + /// Returns the storage mode. + fn storage_mode(&self) -> &StorageMode { + &self.storage_mode } } @@ -99,8 +97,8 @@ pub struct CommitteeMemory { round_to_height_map: MemoryMap, /// The committee map. committee_map: MemoryMap>, - /// The optional development ID. - dev: Option, + /// The storage mode. + storage_mode: StorageMode, } #[rustfmt::skip] @@ -111,14 +109,11 @@ impl CommitteeStorage for CommitteeMemory { /// Initializes the committee storage. fn open>(storage: S) -> Result { - // Retrieve the development ID. - let dev = storage.into().dev(); - Ok(Self { current_round_map: MemoryMap::default(), round_to_height_map: MemoryMap::default(), committee_map: MemoryMap::default(), - dev, + storage_mode: storage.into(), }) } @@ -143,8 +138,8 @@ impl CommitteeStorage for CommitteeMemory { &self.committee_map } - /// Returns the optional development ID. - fn dev(&self) -> Option { - self.dev + /// Returns the storage mode. + fn storage_mode(&self) -> &StorageMode { + &self.storage_mode } } diff --git a/ledger/store/src/helpers/memory/transition.rs b/ledger/store/src/helpers/memory/transition.rs index 3822b69815..b72b6fa4b6 100644 --- a/ledger/store/src/helpers/memory/transition.rs +++ b/ledger/store/src/helpers/memory/transition.rs @@ -19,7 +19,7 @@ use console::{ types::{Field, Group}, }; -use aleo_std::StorageMode; +use aleo_std_storage::StorageMode; /// An in-memory transition storage. #[derive(Clone)] @@ -118,8 +118,8 @@ pub struct InputMemory { record_tag: MemoryMap, Field>, /// The mapping of `external hash` to `()`. Note: This is **not** the record commitment. external_record: MemoryMap, ()>, - /// The optional development ID. - dev: Option, + /// The storage mode. + storage_mode: StorageMode, } #[rustfmt::skip] @@ -135,9 +135,6 @@ impl InputStorage for InputMemory { /// Initializes the transition input storage. fn open>(storage: S) -> Result { - // Retrieve the development ID. - let dev = storage.into().dev(); - Ok(Self { id_map: MemoryMap::default(), reverse_id_map: MemoryMap::default(), @@ -147,7 +144,7 @@ impl InputStorage for InputMemory { record: MemoryMap::default(), record_tag: MemoryMap::default(), external_record: MemoryMap::default(), - dev, + storage_mode: storage.into(), }) } @@ -191,9 +188,9 @@ impl InputStorage for InputMemory { &self.external_record } - /// Returns the optional development ID. - fn dev(&self) -> Option { - self.dev + /// Returns the storage mode. + fn storage_mode(&self) -> &StorageMode { + &self.storage_mode } } @@ -219,8 +216,8 @@ pub struct OutputMemory { external_record: MemoryMap, ()>, /// The mapping of `future hash` to `(optional) future`. future: MemoryMap, Option>>, - /// The optional development ID. - dev: Option, + /// The storage mode. + storage_mode: StorageMode, } #[rustfmt::skip] @@ -237,9 +234,6 @@ impl OutputStorage for OutputMemory { /// Initializes the transition output storage. fn open>(storage: S) -> Result { - // Retrieve the development ID. - let dev = storage.into().dev(); - Ok(Self { id_map: Default::default(), reverse_id_map: Default::default(), @@ -250,7 +244,7 @@ impl OutputStorage for OutputMemory { record_nonce: Default::default(), external_record: Default::default(), future: Default::default(), - dev, + storage_mode: storage.into(), }) } @@ -299,8 +293,8 @@ impl OutputStorage for OutputMemory { &self.future } - /// Returns the optional development ID. - fn dev(&self) -> Option { - self.dev + /// Returns the storage mode. + fn storage_mode(&self) -> &StorageMode { + &self.storage_mode } } diff --git a/ledger/store/src/helpers/rocksdb/block.rs b/ledger/store/src/helpers/rocksdb/block.rs index e0479819dd..eed26472b0 100644 --- a/ledger/store/src/helpers/rocksdb/block.rs +++ b/ledger/store/src/helpers/rocksdb/block.rs @@ -30,7 +30,7 @@ use ledger_authority::Authority; use ledger_block::{Header, Ratifications, Rejected}; use ledger_coinbase::{CoinbaseSolution, PuzzleCommitment}; -use aleo_std::StorageMode; +use aleo_std_storage::StorageMode; /// A RocksDB block storage. #[derive(Clone)] diff --git a/ledger/store/src/helpers/rocksdb/consensus.rs b/ledger/store/src/helpers/rocksdb/consensus.rs index 78c9c89e56..3735a31e67 100644 --- a/ledger/store/src/helpers/rocksdb/consensus.rs +++ b/ledger/store/src/helpers/rocksdb/consensus.rs @@ -20,7 +20,7 @@ use crate::{ }; use console::prelude::*; -use aleo_std::StorageMode; +use aleo_std_storage::StorageMode; /// An RocksDB consensus storage. #[derive(Clone)] diff --git a/ledger/store/src/helpers/rocksdb/internal/mod.rs b/ledger/store/src/helpers/rocksdb/internal/mod.rs index 13314d0c46..a6411f6bd3 100644 --- a/ledger/store/src/helpers/rocksdb/internal/mod.rs +++ b/ledger/store/src/helpers/rocksdb/internal/mod.rs @@ -24,7 +24,7 @@ pub use nested_map::*; #[cfg(test)] mod tests; -use aleo_std::StorageMode; +use aleo_std_storage::StorageMode; use anyhow::{bail, Result}; use once_cell::sync::OnceCell; use parking_lot::Mutex; @@ -80,8 +80,8 @@ pub struct RocksDB { rocksdb: Arc, /// The network ID. network_id: u16, - /// The optional development ID. - dev: Option, + /// The storage mode. + storage_mode: StorageMode, /// The low-level database transaction that gets executed atomically at the end /// of a real-run `atomic_finalize` or the outermost `atomic_batch_scope`. pub(super) atomic_batch: Arc>, @@ -106,9 +106,6 @@ impl Database for RocksDB { fn open>(network_id: u16, storage: S) -> Result { static DB: OnceCell = OnceCell::new(); - // Retrieve the development ID. - let dev = storage.clone().into().dev(); - // Retrieve the database. let database = DB .get_or_try_init(|| { @@ -120,7 +117,7 @@ impl Database for RocksDB { let prefix_extractor = rocksdb::SliceTransform::create_fixed_prefix(PREFIX_LEN); options.set_prefix_extractor(prefix_extractor); - let primary = aleo_std::aleo_ledger_dir(network_id, storage.into()); + let primary = aleo_std_storage::aleo_ledger_dir(network_id, storage.clone().into()); let rocksdb = { options.increase_parallelism(2); options.set_max_background_jobs(4); @@ -132,17 +129,17 @@ impl Database for RocksDB { Ok::<_, anyhow::Error>(RocksDB { rocksdb, network_id, - dev, + storage_mode: storage.clone().into(), atomic_batch: Default::default(), atomic_depth: Default::default(), }) })? .clone(); - // Ensure the database network ID and development ID match. - match database.network_id == network_id && database.dev == dev { + // Ensure the database network ID and storage mode match. + match database.network_id == network_id && database.storage_mode == storage.into() { true => Ok(database), - false => bail!("Mismatching network ID or development ID in the database"), + false => bail!("Mismatching network ID or storage mode in the database"), } } @@ -210,6 +207,18 @@ impl RocksDB { pub fn open_testing(temp_dir: std::path::PathBuf, dev: Option) -> Result { use console::prelude::{Rng, TestRng}; + // Ensure the `temp_dir` is unique. + let temp_dir = temp_dir.join(Rng::gen::(&mut TestRng::default()).to_string()); + + // Construct the directory for the test database. + let primary = match dev { + Some(dev) => temp_dir.join(dev.to_string()), + None => temp_dir, + }; + + // Prepare the storage mode. + let storage_mode = StorageMode::from(primary.clone()); + let database = { // Customize database options. let mut options = rocksdb::Options::default(); @@ -219,15 +228,6 @@ impl RocksDB { let prefix_extractor = rocksdb::SliceTransform::create_fixed_prefix(PREFIX_LEN); options.set_prefix_extractor(prefix_extractor); - // Ensure the `temp_dir` is unique. - let temp_dir = temp_dir.join(Rng::gen::(&mut TestRng::default()).to_string()); - - // Construct the directory for the test database. - let primary = match dev { - Some(dev) => temp_dir.join(dev.to_string()), - None => temp_dir, - }; - let rocksdb = { options.increase_parallelism(2); options.set_max_background_jobs(4); @@ -251,16 +251,16 @@ impl RocksDB { Ok::<_, anyhow::Error>(RocksDB { rocksdb, network_id: u16::MAX, - dev, + storage_mode: storage_mode.clone(), atomic_batch: Default::default(), atomic_depth: Default::default(), }) }?; - // Ensure the database development ID match. - match database.dev == dev { + // Ensure the database storage mode match. + match database.storage_mode == storage_mode { true => Ok(database), - false => bail!("Mismatching development ID in the test database"), + false => bail!("Mismatching storage mode in the test database"), } } diff --git a/ledger/store/src/helpers/rocksdb/program.rs b/ledger/store/src/helpers/rocksdb/program.rs index 2b2a33bc23..9e11bda792 100644 --- a/ledger/store/src/helpers/rocksdb/program.rs +++ b/ledger/store/src/helpers/rocksdb/program.rs @@ -26,7 +26,7 @@ use console::{ }; use ledger_committee::Committee; -use aleo_std::StorageMode; +use aleo_std_storage::StorageMode; use indexmap::IndexSet; /// A RocksDB finalize storage. @@ -38,8 +38,8 @@ pub struct FinalizeDB { program_id_map: DataMap, IndexSet>>, /// The key-value map. key_value_map: NestedDataMap<(ProgramID, Identifier), Plaintext, Value>, - /// The optional development ID. - dev: Option, + /// The storage mode. + storage_mode: StorageMode, } #[rustfmt::skip] @@ -50,16 +50,14 @@ impl FinalizeStorage for FinalizeDB { /// Initializes the finalize storage. fn open>(storage: S) -> Result { - // Retrieve the development ID. - let dev = storage.clone().into().dev(); // Initialize the committee store. let committee_store = CommitteeStore::>::open(storage.clone())?; // Return the finalize storage. Ok(Self { committee_store, program_id_map: rocksdb::RocksDB::open_map(N::ID, storage.clone(), MapID::Program(ProgramMap::ProgramID))?, - key_value_map: rocksdb::RocksDB::open_nested_map(N::ID, storage, MapID::Program(ProgramMap::KeyValueID))?, - dev, + key_value_map: rocksdb::RocksDB::open_nested_map(N::ID, storage.clone(), MapID::Program(ProgramMap::KeyValueID))?, + storage_mode: storage.into(), }) } @@ -73,7 +71,7 @@ impl FinalizeStorage for FinalizeDB { committee_store, program_id_map: rocksdb::RocksDB::open_map_testing(temp_dir.clone(), dev, MapID::Program(ProgramMap::ProgramID))?, key_value_map: rocksdb::RocksDB::open_nested_map_testing(temp_dir.clone(), dev, MapID::Program(ProgramMap::KeyValueID))?, - dev, + storage_mode: dev.into(), }) } @@ -92,9 +90,9 @@ impl FinalizeStorage for FinalizeDB { &self.key_value_map } - /// Returns the optional development ID. - fn dev(&self) -> Option { - self.dev + /// Returns the storage mode. + fn storage_mode(&self) -> &StorageMode { + &self.storage_mode } } @@ -107,8 +105,8 @@ pub struct CommitteeDB { round_to_height_map: DataMap, /// The committee map. committee_map: DataMap>, - /// The optional development ID. - dev: Option, + /// The storage mode. + storage_mode: StorageMode, } #[rustfmt::skip] @@ -119,14 +117,11 @@ impl CommitteeStorage for CommitteeDB { /// Initializes the committee storage. fn open>(storage: S) -> Result { - // Retrieve the development ID. - let dev = storage.clone().into().dev(); - Ok(Self { current_round_map: rocksdb::RocksDB::open_map(N::ID, storage.clone(), MapID::Committee(CommitteeMap::CurrentRound))?, round_to_height_map: rocksdb::RocksDB::open_map(N::ID, storage.clone(), MapID::Committee(CommitteeMap::RoundToHeight))?, - committee_map: rocksdb::RocksDB::open_map(N::ID, storage, MapID::Committee(CommitteeMap::Committee))?, - dev, + committee_map: rocksdb::RocksDB::open_map(N::ID, storage.clone(), MapID::Committee(CommitteeMap::Committee))?, + storage_mode: storage.into(), }) } @@ -137,7 +132,7 @@ impl CommitteeStorage for CommitteeDB { current_round_map: rocksdb::RocksDB::open_map_testing(temp_dir.clone(), dev, MapID::Committee(CommitteeMap::CurrentRound))?, round_to_height_map: rocksdb::RocksDB::open_map_testing(temp_dir.clone(), dev, MapID::Committee(CommitteeMap::RoundToHeight))?, committee_map: rocksdb::RocksDB::open_map_testing(temp_dir, dev, MapID::Committee(CommitteeMap::Committee))?, - dev, + storage_mode: dev.into(), }) } @@ -156,8 +151,8 @@ impl CommitteeStorage for CommitteeDB { &self.committee_map } - /// Returns the optional development ID. - fn dev(&self) -> Option { - self.dev + /// Returns the storage mode. + fn storage_mode(&self) -> &StorageMode { + &self.storage_mode } } diff --git a/ledger/store/src/helpers/rocksdb/transaction.rs b/ledger/store/src/helpers/rocksdb/transaction.rs index bef3c1fe73..2cac1c9c2c 100644 --- a/ledger/store/src/helpers/rocksdb/transaction.rs +++ b/ledger/store/src/helpers/rocksdb/transaction.rs @@ -71,7 +71,7 @@ impl TransactionStorage for TransactionDB { // Initialize the execution store. let execution_store = ExecutionStore::>::open(fee_store.clone())?; // Return the transaction storage. - Ok(Self { id_map: rocksdb::RocksDB::open_map(N::ID, execution_store.dev(), MapID::Transaction(TransactionMap::ID))?, deployment_store, execution_store, fee_store }) + Ok(Self { id_map: rocksdb::RocksDB::open_map(N::ID, execution_store.storage_mode().clone(), MapID::Transaction(TransactionMap::ID))?, deployment_store, execution_store, fee_store }) } /// Returns the ID map. @@ -130,16 +130,16 @@ impl DeploymentStorage for DeploymentDB { /// Initializes the deployment storage. fn open(fee_store: FeeStore) -> Result { - // Retrieve the optional development ID. - let dev = fee_store.dev(); + // Retrieve the storage mode. + let storage_mode = fee_store.storage_mode(); Ok(Self { - id_map: rocksdb::RocksDB::open_map(N::ID, dev, MapID::Deployment(DeploymentMap::ID))?, - edition_map: rocksdb::RocksDB::open_map(N::ID, dev, MapID::Deployment(DeploymentMap::Edition))?, - reverse_id_map: rocksdb::RocksDB::open_map(N::ID, dev, MapID::Deployment(DeploymentMap::ReverseID))?, - owner_map: rocksdb::RocksDB::open_map(N::ID, dev, MapID::Deployment(DeploymentMap::Owner))?, - program_map: rocksdb::RocksDB::open_map(N::ID, dev, MapID::Deployment(DeploymentMap::Program))?, - verifying_key_map: rocksdb::RocksDB::open_map(N::ID, dev, MapID::Deployment(DeploymentMap::VerifyingKey))?, - certificate_map: rocksdb::RocksDB::open_map(N::ID, dev, MapID::Deployment(DeploymentMap::Certificate))?, + id_map: rocksdb::RocksDB::open_map(N::ID, storage_mode.clone(), MapID::Deployment(DeploymentMap::ID))?, + edition_map: rocksdb::RocksDB::open_map(N::ID, storage_mode.clone(), MapID::Deployment(DeploymentMap::Edition))?, + reverse_id_map: rocksdb::RocksDB::open_map(N::ID, storage_mode.clone(), MapID::Deployment(DeploymentMap::ReverseID))?, + owner_map: rocksdb::RocksDB::open_map(N::ID, storage_mode.clone(), MapID::Deployment(DeploymentMap::Owner))?, + program_map: rocksdb::RocksDB::open_map(N::ID, storage_mode.clone(), MapID::Deployment(DeploymentMap::Program))?, + verifying_key_map: rocksdb::RocksDB::open_map(N::ID, storage_mode.clone(), MapID::Deployment(DeploymentMap::VerifyingKey))?, + certificate_map: rocksdb::RocksDB::open_map(N::ID, storage_mode.clone(), MapID::Deployment(DeploymentMap::Certificate))?, fee_store, }) } @@ -208,12 +208,12 @@ impl ExecutionStorage for ExecutionDB { /// Initializes the execution storage. fn open(fee_store: FeeStore) -> Result { - // Retrieve the optional development ID. - let dev = fee_store.dev(); + // Retrieve the storage mode. + let storage_mode = fee_store.storage_mode(); Ok(Self { - id_map: rocksdb::RocksDB::open_map(N::ID, dev, MapID::Execution(ExecutionMap::ID))?, - reverse_id_map: rocksdb::RocksDB::open_map(N::ID, dev, MapID::Execution(ExecutionMap::ReverseID))?, - inclusion_map: rocksdb::RocksDB::open_map(N::ID, dev, MapID::Execution(ExecutionMap::Inclusion))?, + id_map: rocksdb::RocksDB::open_map(N::ID, storage_mode.clone(), MapID::Execution(ExecutionMap::ID))?, + reverse_id_map: rocksdb::RocksDB::open_map(N::ID, storage_mode.clone(), MapID::Execution(ExecutionMap::ReverseID))?, + inclusion_map: rocksdb::RocksDB::open_map(N::ID, storage_mode.clone(), MapID::Execution(ExecutionMap::Inclusion))?, fee_store, }) } @@ -259,11 +259,11 @@ impl FeeStorage for FeeDB { /// Initializes the fee storage. fn open(transition_store: TransitionStore) -> Result { - // Retrieve the optional development ID. - let dev = transition_store.dev(); + // Retrieve the storage mode. + let storage_mode = transition_store.storage_mode(); Ok(Self { - fee_map: rocksdb::RocksDB::open_map(N::ID, dev, MapID::Fee(FeeMap::Fee))?, - reverse_fee_map: rocksdb::RocksDB::open_map(N::ID, dev, MapID::Fee(FeeMap::ReverseFee))?, + fee_map: rocksdb::RocksDB::open_map(N::ID, storage_mode.clone(), MapID::Fee(FeeMap::Fee))?, + reverse_fee_map: rocksdb::RocksDB::open_map(N::ID, storage_mode.clone(), MapID::Fee(FeeMap::ReverseFee))?, transition_store, }) } diff --git a/ledger/store/src/helpers/rocksdb/transition.rs b/ledger/store/src/helpers/rocksdb/transition.rs index d63b647bac..8c636a10ec 100644 --- a/ledger/store/src/helpers/rocksdb/transition.rs +++ b/ledger/store/src/helpers/rocksdb/transition.rs @@ -26,7 +26,7 @@ use console::{ types::{Field, Group}, }; -use aleo_std::StorageMode; +use aleo_std_storage::StorageMode; /// A database transition storage. #[derive(Clone)] @@ -125,8 +125,8 @@ pub struct InputDB { record_tag: DataMap, Field>, /// The mapping of `external commitment` to `()`. Note: This is **not** the record commitment. external_record: DataMap, ()>, - /// The optional development ID. - dev: Option, + /// The storage mode. + storage_mode: StorageMode, } #[rustfmt::skip] @@ -142,9 +142,6 @@ impl InputStorage for InputDB { /// Initializes the transition input storage. fn open>(storage: S) -> Result { - // Retrieve the development ID. - let dev = storage.clone().into().dev(); - Ok(Self { id_map: rocksdb::RocksDB::open_map(N::ID, storage.clone(), MapID::TransitionInput(TransitionInputMap::ID))?, reverse_id_map: rocksdb::RocksDB::open_map(N::ID, storage.clone(), MapID::TransitionInput(TransitionInputMap::ReverseID))?, @@ -153,8 +150,8 @@ impl InputStorage for InputDB { private: rocksdb::RocksDB::open_map(N::ID, storage.clone(), MapID::TransitionInput(TransitionInputMap::Private))?, record: rocksdb::RocksDB::open_map(N::ID, storage.clone(), MapID::TransitionInput(TransitionInputMap::Record))?, record_tag: rocksdb::RocksDB::open_map(N::ID, storage.clone(), MapID::TransitionInput(TransitionInputMap::RecordTag))?, - external_record: rocksdb::RocksDB::open_map(N::ID, storage, MapID::TransitionInput(TransitionInputMap::ExternalRecord))?, - dev, + external_record: rocksdb::RocksDB::open_map(N::ID, storage.clone(), MapID::TransitionInput(TransitionInputMap::ExternalRecord))?, + storage_mode: storage.into(), }) } @@ -198,9 +195,9 @@ impl InputStorage for InputDB { &self.external_record } - /// Returns the optional development ID. - fn dev(&self) -> Option { - self.dev + /// Returns the storage mode. + fn storage_mode(&self) -> &StorageMode { + &self.storage_mode } } @@ -226,8 +223,8 @@ pub struct OutputDB { external_record: DataMap, ()>, /// The mapping of `future hash` to `(optional) future`. future: DataMap, Option>>, - /// The optional development ID. - dev: Option, + /// The storage mode. + storage_mode: StorageMode, } #[rustfmt::skip] @@ -244,9 +241,6 @@ impl OutputStorage for OutputDB { /// Initializes the transition output storage. fn open>(storage: S) -> Result { - // Retrieve the development ID. - let dev = storage.clone().into().dev(); - Ok(Self { id_map: rocksdb::RocksDB::open_map(N::ID, storage.clone(), MapID::TransitionOutput(TransitionOutputMap::ID))?, reverse_id_map: rocksdb::RocksDB::open_map(N::ID, storage.clone(), MapID::TransitionOutput(TransitionOutputMap::ReverseID))?, @@ -256,8 +250,8 @@ impl OutputStorage for OutputDB { record: rocksdb::RocksDB::open_map(N::ID, storage.clone(), MapID::TransitionOutput(TransitionOutputMap::Record))?, record_nonce: rocksdb::RocksDB::open_map(N::ID, storage.clone(), MapID::TransitionOutput(TransitionOutputMap::RecordNonce))?, external_record: rocksdb::RocksDB::open_map(N::ID, storage.clone(), MapID::TransitionOutput(TransitionOutputMap::ExternalRecord))?, - future: rocksdb::RocksDB::open_map(N::ID, storage, MapID::TransitionOutput(TransitionOutputMap::Future))?, - dev, + future: rocksdb::RocksDB::open_map(N::ID, storage.clone(), MapID::TransitionOutput(TransitionOutputMap::Future))?, + storage_mode: storage.into(), }) } @@ -306,8 +300,8 @@ impl OutputStorage for OutputDB { &self.future } - /// Returns the optional development ID. - fn dev(&self) -> Option { - self.dev + /// Returns the storage mode. + fn storage_mode(&self) -> &StorageMode { + &self.storage_mode } } diff --git a/ledger/store/src/program/committee.rs b/ledger/store/src/program/committee.rs index 1f8f8db502..aad82c6c34 100644 --- a/ledger/store/src/program/committee.rs +++ b/ledger/store/src/program/committee.rs @@ -21,7 +21,7 @@ use crate::{ use console::network::prelude::*; use ledger_committee::Committee; -use aleo_std::StorageMode; +use aleo_std_storage::StorageMode; use anyhow::Result; use core::marker::PhantomData; @@ -50,8 +50,8 @@ pub trait CommitteeStorage: 'static + Clone + Send + Sync { /// Returns the committee map. fn committee_map(&self) -> &Self::CommitteeMap; - /// Returns the optional development ID. - fn dev(&self) -> Option; + /// Returns the storage mode. + fn storage_mode(&self) -> &StorageMode; /// Starts an atomic batch write operation. fn start_atomic(&self) { @@ -356,9 +356,9 @@ impl> CommitteeStore { self.storage.finish_atomic() } - /// Returns the optional development ID. - pub fn dev(&self) -> Option { - self.storage.dev() + /// Returns the storage mode. + pub fn storage_mode(&self) -> &StorageMode { + self.storage.storage_mode() } } diff --git a/ledger/store/src/program/finalize.rs b/ledger/store/src/program/finalize.rs index 19b83a070e..972ed57397 100644 --- a/ledger/store/src/program/finalize.rs +++ b/ledger/store/src/program/finalize.rs @@ -26,7 +26,7 @@ use console::{ }; use synthesizer_program::{FinalizeOperation, FinalizeStoreTrait}; -use aleo_std::StorageMode; +use aleo_std_storage::StorageMode; use anyhow::Result; use core::marker::PhantomData; use indexmap::IndexSet; @@ -92,8 +92,8 @@ pub trait FinalizeStorage: 'static + Clone + Send + Sync { /// Returns the key-value map. fn key_value_map(&self) -> &Self::KeyValueMap; - /// Returns the optional development ID. - fn dev(&self) -> Option; + /// Returns the storage mode. + fn storage_mode(&self) -> &StorageMode; /// Starts an atomic batch write operation. fn start_atomic(&self) { @@ -582,9 +582,9 @@ impl> FinalizeStore { self.storage.finish_atomic() } - /// Returns the optional development ID. - pub fn dev(&self) -> Option { - self.storage.dev() + /// Returns the storage mode. + pub fn storage_mode(&self) -> &StorageMode { + self.storage.storage_mode() } } diff --git a/ledger/store/src/transaction/deployment.rs b/ledger/store/src/transaction/deployment.rs index 476e85f293..bdc7d95b46 100644 --- a/ledger/store/src/transaction/deployment.rs +++ b/ledger/store/src/transaction/deployment.rs @@ -28,6 +28,7 @@ use ledger_block::{Deployment, Fee, Transaction}; use synthesizer_program::Program; use synthesizer_snark::{Certificate, VerifyingKey}; +use aleo_std_storage::StorageMode; use anyhow::Result; use core::marker::PhantomData; use std::borrow::Cow; @@ -71,9 +72,9 @@ pub trait DeploymentStorage: Clone + Send + Sync { /// Returns the fee storage. fn fee_store(&self) -> &FeeStore; - /// Returns the optional development ID. - fn dev(&self) -> Option { - self.fee_store().dev() + /// Returns the storage mode. + fn storage_mode(&self) -> &StorageMode { + self.fee_store().storage_mode() } /// Starts an atomic batch write operation. @@ -547,9 +548,9 @@ impl> DeploymentStore { self.storage.finish_atomic() } - /// Returns the optional development ID. - pub fn dev(&self) -> Option { - self.storage.dev() + /// Returns the storage mode. + pub fn storage_mode(&self) -> &StorageMode { + self.storage.storage_mode() } } diff --git a/ledger/store/src/transaction/execution.rs b/ledger/store/src/transaction/execution.rs index cb3811813a..39c11f4c79 100644 --- a/ledger/store/src/transaction/execution.rs +++ b/ledger/store/src/transaction/execution.rs @@ -25,6 +25,7 @@ use console::network::prelude::*; use ledger_block::{Execution, Transaction, Transition}; use synthesizer_snark::Proof; +use aleo_std_storage::StorageMode; use anyhow::Result; use core::marker::PhantomData; use std::borrow::Cow; @@ -56,9 +57,9 @@ pub trait ExecutionStorage: Clone + Send + Sync { self.fee_store().transition_store() } - /// Returns the optional development ID. - fn dev(&self) -> Option { - self.transition_store().dev() + /// Returns the storage mode. + fn storage_mode(&self) -> &StorageMode { + self.transition_store().storage_mode() } /// Starts an atomic batch write operation. @@ -353,9 +354,9 @@ impl> ExecutionStore { self.storage.finish_atomic() } - /// Returns the optional development ID. - pub fn dev(&self) -> Option { - self.storage.dev() + /// Returns the storage mode. + pub fn storage_mode(&self) -> &StorageMode { + self.storage.storage_mode() } } diff --git a/ledger/store/src/transaction/fee.rs b/ledger/store/src/transaction/fee.rs index 5f7dbadd7b..f821afaea8 100644 --- a/ledger/store/src/transaction/fee.rs +++ b/ledger/store/src/transaction/fee.rs @@ -24,6 +24,7 @@ use console::network::prelude::*; use ledger_block::Fee; use synthesizer_snark::Proof; +use aleo_std_storage::StorageMode; use anyhow::Result; use core::marker::PhantomData; @@ -47,9 +48,9 @@ pub trait FeeStorage: Clone + Send + Sync { /// Returns the transition storage. fn transition_store(&self) -> &TransitionStore; - /// Returns the optional development ID. - fn dev(&self) -> Option { - self.transition_store().dev() + /// Returns the storage mode. + fn storage_mode(&self) -> &StorageMode { + self.transition_store().storage_mode() } /// Starts an atomic batch write operation. @@ -235,9 +236,9 @@ impl> FeeStore { self.storage.finish_atomic() } - /// Returns the optional development ID. - pub fn dev(&self) -> Option { - self.storage.dev() + /// Returns the storage mode. + pub fn storage_mode(&self) -> &StorageMode { + self.storage.storage_mode() } } diff --git a/ledger/store/src/transaction/mod.rs b/ledger/store/src/transaction/mod.rs index b3f56bec8d..7d62c529b1 100644 --- a/ledger/store/src/transaction/mod.rs +++ b/ledger/store/src/transaction/mod.rs @@ -36,6 +36,7 @@ use ledger_block::{Deployment, Execution, Transaction}; use synthesizer_program::Program; use synthesizer_snark::{Certificate, VerifyingKey}; +use aleo_std_storage::StorageMode; use anyhow::Result; use serde::{Deserialize, Serialize}; use std::borrow::Cow; @@ -76,14 +77,14 @@ pub trait TransactionStorage: Clone + Send + Sync { fn fee_store(&self) -> &FeeStore; /// Returns the transition store. fn transition_store(&self) -> &TransitionStore { - debug_assert!(self.deployment_store().dev() == self.execution_store().dev()); - debug_assert!(self.execution_store().dev() == self.fee_store().dev()); + debug_assert!(self.deployment_store().storage_mode() == self.execution_store().storage_mode()); + debug_assert!(self.execution_store().storage_mode() == self.fee_store().storage_mode()); self.fee_store().transition_store() } - /// Returns the optional development ID. - fn dev(&self) -> Option { - self.transition_store().dev() + /// Returns the storage mode. + fn storage_mode(&self) -> &StorageMode { + self.transition_store().storage_mode() } /// Starts an atomic batch write operation. @@ -306,9 +307,9 @@ impl> TransactionStore { self.storage.finish_atomic() } - /// Returns the optional development ID. - pub fn dev(&self) -> Option { - self.storage.dev() + /// Returns the storage mode. + pub fn storage_mode(&self) -> &StorageMode { + self.storage.storage_mode() } } diff --git a/ledger/store/src/transition/input.rs b/ledger/store/src/transition/input.rs index 7b46f8ef4d..33ba49dc71 100644 --- a/ledger/store/src/transition/input.rs +++ b/ledger/store/src/transition/input.rs @@ -23,7 +23,7 @@ use console::{ }; use ledger_block::Input; -use aleo_std::StorageMode; +use aleo_std_storage::StorageMode; use anyhow::Result; use std::borrow::Cow; @@ -66,8 +66,8 @@ pub trait InputStorage: Clone + Send + Sync { /// Returns the external record map. fn external_record_map(&self) -> &Self::ExternalRecordMap; - /// Returns the optional development ID. - fn dev(&self) -> Option; + /// Returns the storage mode. + fn storage_mode(&self) -> &StorageMode; /// Starts an atomic batch write operation. fn start_atomic(&self) { @@ -379,9 +379,9 @@ impl> InputStore { self.storage.finish_atomic() } - /// Returns the optional development ID. - pub fn dev(&self) -> Option { - self.storage.dev() + /// Returns the storage mode. + pub fn storage_mode(&self) -> &StorageMode { + self.storage.storage_mode() } } diff --git a/ledger/store/src/transition/mod.rs b/ledger/store/src/transition/mod.rs index 2eeb724b22..074c4756be 100644 --- a/ledger/store/src/transition/mod.rs +++ b/ledger/store/src/transition/mod.rs @@ -31,7 +31,7 @@ use console::{ }; use ledger_block::{Input, Output, Transition}; -use aleo_std::StorageMode; +use aleo_std_storage::StorageMode; use anyhow::Result; use std::borrow::Cow; @@ -70,10 +70,10 @@ pub trait TransitionStorage: Clone + Send + Sync { /// Returns the reverse `tcm` map. fn reverse_tcm_map(&self) -> &Self::ReverseTCMMap; - /// Returns the optional development ID. - fn dev(&self) -> Option { - debug_assert!(self.input_store().dev() == self.output_store().dev()); - self.input_store().dev() + /// Returns the storage mode. + fn storage_mode(&self) -> &StorageMode { + debug_assert!(self.input_store().storage_mode() == self.output_store().storage_mode()); + self.input_store().storage_mode() } /// Starts an atomic batch write operation. @@ -346,9 +346,9 @@ impl> TransitionStore { self.storage.finish_atomic() } - /// Returns the optional development ID. - pub fn dev(&self) -> Option { - self.storage.dev() + /// Returns the storage mode. + pub fn storage_mode(&self) -> &StorageMode { + self.storage.storage_mode() } } diff --git a/ledger/store/src/transition/output.rs b/ledger/store/src/transition/output.rs index 6612eb468b..01acfa41cb 100644 --- a/ledger/store/src/transition/output.rs +++ b/ledger/store/src/transition/output.rs @@ -23,7 +23,7 @@ use console::{ }; use ledger_block::Output; -use aleo_std::StorageMode; +use aleo_std_storage::StorageMode; use anyhow::Result; use std::borrow::Cow; @@ -70,8 +70,8 @@ pub trait OutputStorage: Clone + Send + Sync { /// Returns the future map. fn future_map(&self) -> &Self::FutureMap; - /// Returns the optional development ID. - fn dev(&self) -> Option; + /// Returns the storage mode. + fn storage_mode(&self) -> &StorageMode; /// Starts an atomic batch write operation. fn start_atomic(&self) { @@ -402,9 +402,9 @@ impl> OutputStore { self.storage.finish_atomic() } - /// Returns the optional development ID. - pub fn dev(&self) -> Option { - self.storage.dev() + /// Returns the storage mode. + pub fn storage_mode(&self) -> &StorageMode { + self.storage.storage_mode() } } From 647143f0a917e99203609099522ebd2e38bc14af Mon Sep 17 00:00:00 2001 From: Howard Wu <9260812+howardwu@users.noreply.github.com> Date: Sat, 20 Jan 2024 18:16:06 -0800 Subject: [PATCH 201/298] Add no default features --- Cargo.lock | 2 +- ledger/query/Cargo.toml | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Cargo.lock b/Cargo.lock index 316c685f64..82b1e251f0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3256,7 +3256,7 @@ dependencies = [ name = "snarkvm-ledger-store" version = "0.16.17" dependencies = [ - "aleo-std", + "aleo-std-storage", "anyhow", "bincode", "indexmap 2.1.0", diff --git a/ledger/query/Cargo.toml b/ledger/query/Cargo.toml index 7bea768120..106b61e3a5 100644 --- a/ledger/query/Cargo.toml +++ b/ledger/query/Cargo.toml @@ -59,4 +59,5 @@ optional = true [dependencies.ureq] version = "2.7.1" features = [ "json" ] +default-features = false optional = true From fba3a26a4bbe5ae04da5e898eb23c39c5cf252e7 Mon Sep 17 00:00:00 2001 From: Victor Sint Nicolaas Date: Sat, 20 Jan 2024 19:54:54 -0800 Subject: [PATCH 202/298] Update expectations --- circuit/program/src/request/verify.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/circuit/program/src/request/verify.rs b/circuit/program/src/request/verify.rs index c2de47f7a5..7e128c521f 100644 --- a/circuit/program/src/request/verify.rs +++ b/circuit/program/src/request/verify.rs @@ -423,16 +423,16 @@ mod tests { // Note: This is correct. At this (high) level of a program, we override the default mode in the `Record` case, // based on the user-defined visibility in the record type. Thus, we have nonzero private and constraint values. // These bounds are determined experimentally. - check_verify(Mode::Constant, 42518, 0, 17763, 17786) + check_verify(Mode::Constant, 43000, 0, 18000, 18000) } #[test] fn test_sign_and_verify_public() -> Result<()> { - check_verify(Mode::Public, 40019, 0, 26675, 26702) + check_verify(Mode::Public, 40131, 0, 26675, 26702) } #[test] fn test_sign_and_verify_private() -> Result<()> { - check_verify(Mode::Private, 40019, 0, 26675, 26702) + check_verify(Mode::Private, 40131, 0, 26675, 26702) } } From 05057958f1132b95947a9350deb455d76558f61d Mon Sep 17 00:00:00 2001 From: Howard Wu <9260812+howardwu@users.noreply.github.com> Date: Sat, 20 Jan 2024 20:54:58 -0800 Subject: [PATCH 203/298] nit: fix ID capitalization --- ledger/block/src/verify.rs | 6 +++--- ledger/src/check_next_block.rs | 4 ++-- ledger/src/tests.rs | 2 +- synthesizer/src/vm/finalize.rs | 2 +- synthesizer/src/vm/mod.rs | 8 ++++---- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/ledger/block/src/verify.rs b/ledger/block/src/verify.rs index eb6b579d2d..0a004478f7 100644 --- a/ledger/block/src/verify.rs +++ b/ledger/block/src/verify.rs @@ -99,7 +99,7 @@ impl Block { current_timestamp, )?; - // Return the expected existing transaction id and solution ids. + // Return the expected existing solution IDs and transaction IDs. Ok((expected_existing_solution_ids, expected_existing_transaction_ids)) } } @@ -625,12 +625,12 @@ impl Block { } } - // Retrieve the solution ids that should already exist in the ledger. + // Retrieve the solution IDs that should already exist in the ledger. let existing_solution_ids: Vec<_> = aborted_or_existing_solution_ids .difference(&aborted_solution_ids.iter().copied().collect()) .copied() .collect(); - // Retrieve the transaction ids that should already exist in the ledger. + // Retrieve the transaction IDs that should already exist in the ledger. let existing_transaction_ids: Vec<_> = aborted_or_existing_transaction_ids .difference(&aborted_transaction_ids.iter().copied().collect()) .copied() diff --git a/ledger/src/check_next_block.rs b/ledger/src/check_next_block.rs index e10425cba5..8203ccdaa1 100644 --- a/ledger/src/check_next_block.rs +++ b/ledger/src/check_next_block.rs @@ -93,14 +93,14 @@ impl> Ledger { ratified_finalize_operations, )?; - // Ensure that each existing solution id from the block exists in the ledger. + // Ensure that each existing solution ID from the block exists in the ledger. for existing_solution_id in expected_existing_solution_ids { if !self.contains_puzzle_commitment(&existing_solution_id)? { bail!("Solution ID '{existing_solution_id}' does not exist in the ledger"); } } - // Ensure that each existing transaction id from the block exists in the ledger. + // Ensure that each existing transaction ID from the block exists in the ledger. for existing_transaction_id in expected_existing_transaction_ids { if !self.contains_transaction_id(&existing_transaction_id)? { bail!("Transaction ID '{existing_transaction_id}' does not exist in the ledger"); diff --git a/ledger/src/tests.rs b/ledger/src/tests.rs index 57acfb21f7..7eaf4d2f82 100644 --- a/ledger/src/tests.rs +++ b/ledger/src/tests.rs @@ -972,7 +972,7 @@ function empty_function: // Add the block to the ledger. ledger.advance_to_next_block(&block).unwrap(); - // Create a transaction with different transaction ids, but with a fixed transition id. + // Create a transaction with different transaction IDs, but with a fixed transition ID. let mut create_transaction_with_duplicate_transition_id = || -> Transaction { // Use a fixed seed RNG. let fixed_rng = &mut TestRng::from_seed(1); diff --git a/synthesizer/src/vm/finalize.rs b/synthesizer/src/vm/finalize.rs index 8fb6767335..14ff599462 100644 --- a/synthesizer/src/vm/finalize.rs +++ b/synthesizer/src/vm/finalize.rs @@ -1249,7 +1249,7 @@ finalize transfer_public: assert!(matches!(candidate_transactions[0], ConfirmedTransaction::RejectedDeploy(..))); assert!(aborted_transaction_ids.is_empty()); - // Check that the unconfirmed transaction id of the rejected deployment is correct. + // Check that the unconfirmed transaction ID of the rejected deployment is correct. assert_eq!(candidate_transactions[0].to_unconfirmed_transaction_id().unwrap(), deployment_transaction_id); } diff --git a/synthesizer/src/vm/mod.rs b/synthesizer/src/vm/mod.rs index 227ecf5f17..d1f80e603d 100644 --- a/synthesizer/src/vm/mod.rs +++ b/synthesizer/src/vm/mod.rs @@ -101,7 +101,7 @@ impl> VM { transaction_store: &TransactionStore, transaction_id: N::TransactionID, ) -> Result, Deployment)>> { - // Retrieve the deployment from the transaction id. + // Retrieve the deployment from the transaction ID. let deployment = match transaction_store.get_deployment(&transaction_id)? { Some(deployment) => deployment, None => bail!("Deployment transaction '{transaction_id}' is not found in storage."), @@ -123,11 +123,11 @@ impl> VM { for import_program_id in program.imports().keys() { // Add the imports to the process if does not exist yet. if !process.contains_program(import_program_id) { - // Fetch the deployment transaction id. + // Fetch the deployment transaction ID. let Some(transaction_id) = transaction_store.deployment_store().find_transaction_id_from_program_id(import_program_id)? else { - bail!("Transaction id for '{program_id}' is not found in storage."); + bail!("Transaction ID for '{program_id}' is not found in storage."); }; // Add the deployment and its imports found recursively. @@ -947,7 +947,7 @@ function a: let deployment_transaction_ids = vm.transaction_store().deployment_transaction_ids().map(|id| *id).collect::>(); // This assert check is here to ensure that we are properly loading imports even though any order will work for `VM::from`. - // Note: `deployment_transaction_ids` is sorted lexicographically by transaction id, so the order may change if we update internal methods. + // Note: `deployment_transaction_ids` is sorted lexicographically by transaction ID, so the order may change if we update internal methods. assert_eq!( deployment_transaction_ids, vec![deployment_4.id(), deployment_1.id(), deployment_2.id(), deployment_3.id()], From 620969344cc23565ed30826b00f5d9edd69ba0ee Mon Sep 17 00:00:00 2001 From: Howard Wu <9260812+howardwu@users.noreply.github.com> Date: Sat, 20 Jan 2024 20:56:06 -0800 Subject: [PATCH 204/298] nit: fix ID capitalization --- ledger/narwhal/batch-header/src/lib.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ledger/narwhal/batch-header/src/lib.rs b/ledger/narwhal/batch-header/src/lib.rs index f52e4d787d..e7a8de8c7a 100644 --- a/ledger/narwhal/batch-header/src/lib.rs +++ b/ledger/narwhal/batch-header/src/lib.rs @@ -96,7 +96,7 @@ impl BatchHeader { // Ensure that the number of transmissions is within bounds. ensure!( transmission_ids.len() <= Self::MAX_TRANSMISSIONS_PER_BATCH, - "Invalid number of transmission ids ({})", + "Invalid number of transmission IDs ({})", transmission_ids.len() ); // Ensure that the number of previous certificate IDs is within bounds. @@ -165,7 +165,7 @@ impl BatchHeader { // Ensure that the number of transmissions is within bounds. ensure!( transmission_ids.len() <= Self::MAX_TRANSMISSIONS_PER_BATCH, - "Invalid number of transmission ids ({})", + "Invalid number of transmission IDs ({})", transmission_ids.len() ); // Ensure that the number of previous certificate IDs is within bounds. From 2b1abf03dd395c7bcdeb14d4b2c80633a01d4de7 Mon Sep 17 00:00:00 2001 From: Howard Wu <9260812+howardwu@users.noreply.github.com> Date: Sat, 20 Jan 2024 20:58:07 -0800 Subject: [PATCH 205/298] Nit comment --- ledger/block/src/verify.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ledger/block/src/verify.rs b/ledger/block/src/verify.rs index 0a004478f7..87144f0329 100644 --- a/ledger/block/src/verify.rs +++ b/ledger/block/src/verify.rs @@ -179,7 +179,7 @@ impl Block { ); // Ensure the block authority is correct. - // Determine the transaction ID and solution IDs expected to be in previous blocks. + // Determine the solution IDs and transaction IDs that are expected to be in previous blocks. let (expected_existing_solution_ids, expected_existing_transaction_ids) = match &self.authority { Authority::Beacon(signature) => { // Retrieve the signer. From 93020db9c4d6a6daa6c35691ea0889cc95788bf8 Mon Sep 17 00:00:00 2001 From: Howard Wu <9260812+howardwu@users.noreply.github.com> Date: Sat, 20 Jan 2024 21:27:29 -0800 Subject: [PATCH 206/298] nit: simplify call --- synthesizer/process/src/verify_fee.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/synthesizer/process/src/verify_fee.rs b/synthesizer/process/src/verify_fee.rs index faafbbb1b7..dc3a18bf74 100644 --- a/synthesizer/process/src/verify_fee.rs +++ b/synthesizer/process/src/verify_fee.rs @@ -119,7 +119,7 @@ impl Process { let (parent_x, parent_y) = fee.program_id().to_address()?.to_xy_coordinates(); // Construct the public inputs to verify the proof. - let mut inputs = vec![N::Field::one(), *tpk_x, *tpk_y, **fee.tcm(), **fee.transition().scm()]; + let mut inputs = vec![N::Field::one(), *tpk_x, *tpk_y, **fee.tcm(), **fee.scm()]; // Extend the inputs with the input IDs. inputs.extend(fee.inputs().iter().flat_map(|input| input.verifier_inputs())); // Extend the verifier inputs with the public inputs for 'self.caller'. @@ -188,7 +188,7 @@ impl Process { let (parent_x, parent_y) = fee.program_id().to_address()?.to_xy_coordinates(); // Construct the public inputs to verify the proof. - let mut inputs = vec![N::Field::one(), *tpk_x, *tpk_y, **fee.tcm(), **fee.transition().scm()]; + let mut inputs = vec![N::Field::one(), *tpk_x, *tpk_y, **fee.tcm(), **fee.scm()]; // Extend the inputs with the input IDs. inputs.extend(fee.inputs().iter().flat_map(|input| input.verifier_inputs())); // Extend the verifier inputs with the public inputs for 'self.caller' From 6230cab2338d04bfe3c2e1c2c889e67983065765 Mon Sep 17 00:00:00 2001 From: Victor Sint Nicolaas Date: Sat, 20 Jan 2024 21:57:11 -0800 Subject: [PATCH 207/298] Use existing Address::to_field --- circuit/program/src/request/verify.rs | 2 +- circuit/types/address/src/lib.rs | 6 ------ 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/circuit/program/src/request/verify.rs b/circuit/program/src/request/verify.rs index 7e128c521f..30b3e3d5ae 100644 --- a/circuit/program/src/request/verify.rs +++ b/circuit/program/src/request/verify.rs @@ -67,7 +67,7 @@ impl Request { // Compute the transition commitment as `Hash(tvk)`. let tcm = A::hash_psd2(&[self.tvk.clone()]); // Compute the signer commitment as `Hash(signer || root_tvk)`. - let scm = A::hash_psd2(&[self.signer.to_x_coordinate(), root_tvk]); + let scm = A::hash_psd2(&[self.signer.to_field(), root_tvk]); // Ensure the transition public key matches with the saved one from the signature. tpk.is_equal(&self.to_tpk()) diff --git a/circuit/types/address/src/lib.rs b/circuit/types/address/src/lib.rs index 983ffc30e6..0e4dec4b5d 100644 --- a/circuit/types/address/src/lib.rs +++ b/circuit/types/address/src/lib.rs @@ -45,12 +45,6 @@ impl Address { pub fn zero() -> Self { Self(Group::zero()) } - - /// Outputs the x coordinate of the address - #[inline] - pub fn to_x_coordinate(&self) -> Field { - self.0.to_x_coordinate() - } } #[cfg(console)] From 2438be00d82ed4c5f473e55d88473c12459fa808 Mon Sep 17 00:00:00 2001 From: Victor Sint Nicolaas Date: Sat, 20 Jan 2024 22:01:17 -0800 Subject: [PATCH 208/298] Remove unused reverse_scm map and correct scm retrieval --- ledger/store/src/helpers/memory/transition.rs | 11 +------ .../store/src/helpers/rocksdb/internal/id.rs | 2 -- .../store/src/helpers/rocksdb/transition.rs | 9 ------ ledger/store/src/transition/mod.rs | 31 +------------------ 4 files changed, 2 insertions(+), 51 deletions(-) diff --git a/ledger/store/src/helpers/memory/transition.rs b/ledger/store/src/helpers/memory/transition.rs index 2f15ffd6dc..ee5e90b1c4 100644 --- a/ledger/store/src/helpers/memory/transition.rs +++ b/ledger/store/src/helpers/memory/transition.rs @@ -40,8 +40,6 @@ pub struct TransitionMemory { reverse_tcm_map: MemoryMap, N::TransitionID>, /// The signer commitments. scm_map: MemoryMap>, - /// The reverse `scm` map. - reverse_scm_map: MemoryMap, N::TransitionID>, } #[rustfmt::skip] @@ -54,7 +52,6 @@ impl TransitionStorage for TransitionMemory { type TCMMap = MemoryMap>; type ReverseTCMMap = MemoryMap, N::TransitionID>; type SCMMap = MemoryMap>; - type ReverseSCMMap = MemoryMap, N::TransitionID>; /// Initializes the transition storage. fn open>(storage: S) -> Result { @@ -67,7 +64,6 @@ impl TransitionStorage for TransitionMemory { tcm_map: MemoryMap::default(), reverse_tcm_map: MemoryMap::default(), scm_map: MemoryMap::default(), - reverse_scm_map: MemoryMap::default(), }) } @@ -107,14 +103,9 @@ impl TransitionStorage for TransitionMemory { } /// Returns the signer commitments. - fn scm_map(&self) -> &Self::TCMMap { + fn scm_map(&self) -> &Self::SCMMap { &self.scm_map } - - /// Returns the reverse `scm` map. - fn reverse_scm_map(&self) -> &Self::ReverseTCMMap { - &self.reverse_scm_map - } } /// An in-memory transition input storage. diff --git a/ledger/store/src/helpers/rocksdb/internal/id.rs b/ledger/store/src/helpers/rocksdb/internal/id.rs index 6528511e2a..3fad6aceec 100644 --- a/ledger/store/src/helpers/rocksdb/internal/id.rs +++ b/ledger/store/src/helpers/rocksdb/internal/id.rs @@ -187,7 +187,6 @@ pub enum TransitionMap { TCM = DataID::TransitionTCMMap as u16, ReverseTCM = DataID::TransitionReverseTCMMap as u16, SCM = DataID::TransitionSCMMap as u16, - ReverseSCM = DataID::TransitionReverseSCMMap as u16, } /// The RocksDB map prefix for program-related entries. @@ -285,7 +284,6 @@ enum DataID { TransitionTCMMap, TransitionReverseTCMMap, TransitionSCMMap, - TransitionReverseSCMMap, // Program ProgramIDMap, KeyValueMap, diff --git a/ledger/store/src/helpers/rocksdb/transition.rs b/ledger/store/src/helpers/rocksdb/transition.rs index 692de369bf..44ee06c33e 100644 --- a/ledger/store/src/helpers/rocksdb/transition.rs +++ b/ledger/store/src/helpers/rocksdb/transition.rs @@ -47,8 +47,6 @@ pub struct TransitionDB { reverse_tcm_map: DataMap, N::TransitionID>, /// The signer commitments. scm_map: DataMap>, - /// The reverse `scm` map. - reverse_scm_map: DataMap, N::TransitionID>, } #[rustfmt::skip] @@ -61,7 +59,6 @@ impl TransitionStorage for TransitionDB { type TCMMap = DataMap>; type ReverseTCMMap = DataMap, N::TransitionID>; type SCMMap = DataMap>; - type ReverseSCMMap = DataMap, N::TransitionID>; /// Initializes the transition storage. fn open>(storage: S) -> Result { @@ -74,7 +71,6 @@ impl TransitionStorage for TransitionDB { tcm_map: rocksdb::RocksDB::open_map(N::ID, storage.clone(), MapID::Transition(TransitionMap::TCM))?, reverse_tcm_map: rocksdb::RocksDB::open_map(N::ID, storage.clone(), MapID::Transition(TransitionMap::ReverseTCM))?, scm_map: rocksdb::RocksDB::open_map(N::ID, storage.clone(), MapID::Transition(TransitionMap::SCM))?, - reverse_scm_map: rocksdb::RocksDB::open_map(N::ID, storage, MapID::Transition(TransitionMap::ReverseSCM))?, }) } @@ -117,11 +113,6 @@ impl TransitionStorage for TransitionDB { fn scm_map(&self) -> &Self::SCMMap { &self.scm_map } - - /// Returns the reverse `scm` map. - fn reverse_scm_map(&self) -> &Self::ReverseSCMMap { - &self.reverse_scm_map - } } /// An database transition input storage. diff --git a/ledger/store/src/transition/mod.rs b/ledger/store/src/transition/mod.rs index 5c0860c4b0..e813caa01b 100644 --- a/ledger/store/src/transition/mod.rs +++ b/ledger/store/src/transition/mod.rs @@ -53,8 +53,6 @@ pub trait TransitionStorage: Clone + Send + Sync { type ReverseTCMMap: for<'a> Map<'a, Field, N::TransitionID>; /// The signer commitments. type SCMMap: for<'a> Map<'a, N::TransitionID, Field>; - /// The mapping of `signer commitment` to `transition ID`. - type ReverseSCMMap: for<'a> Map<'a, Field, N::TransitionID>; /// Initializes the transition storage. fn open>(storage: S) -> Result; @@ -75,8 +73,6 @@ pub trait TransitionStorage: Clone + Send + Sync { fn reverse_tcm_map(&self) -> &Self::ReverseTCMMap; /// Returns the signer commitments map. fn scm_map(&self) -> &Self::SCMMap; - /// Returns the reverse `scm` map. - fn reverse_scm_map(&self) -> &Self::ReverseSCMMap; /// Returns the storage mode. fn storage_mode(&self) -> &StorageMode { @@ -94,7 +90,6 @@ pub trait TransitionStorage: Clone + Send + Sync { self.tcm_map().start_atomic(); self.reverse_tcm_map().start_atomic(); self.scm_map().start_atomic(); - self.reverse_scm_map().start_atomic(); } /// Checks if an atomic batch is in progress. @@ -107,7 +102,6 @@ pub trait TransitionStorage: Clone + Send + Sync { || self.tcm_map().is_atomic_in_progress() || self.reverse_tcm_map().is_atomic_in_progress() || self.scm_map().is_atomic_in_progress() - || self.reverse_scm_map().is_atomic_in_progress() } /// Checkpoints the atomic batch. @@ -120,7 +114,6 @@ pub trait TransitionStorage: Clone + Send + Sync { self.tcm_map().atomic_checkpoint(); self.reverse_tcm_map().atomic_checkpoint(); self.scm_map().atomic_checkpoint(); - self.reverse_scm_map().atomic_checkpoint(); } /// Clears the latest atomic batch checkpoint. @@ -133,7 +126,6 @@ pub trait TransitionStorage: Clone + Send + Sync { self.tcm_map().clear_latest_checkpoint(); self.reverse_tcm_map().clear_latest_checkpoint(); self.scm_map().clear_latest_checkpoint(); - self.reverse_scm_map().clear_latest_checkpoint(); } /// Rewinds the atomic batch to the previous checkpoint. @@ -146,7 +138,6 @@ pub trait TransitionStorage: Clone + Send + Sync { self.tcm_map().atomic_rewind(); self.reverse_tcm_map().atomic_rewind(); self.scm_map().atomic_rewind(); - self.reverse_scm_map().atomic_rewind(); } /// Aborts an atomic batch write operation. @@ -159,7 +150,6 @@ pub trait TransitionStorage: Clone + Send + Sync { self.tcm_map().abort_atomic(); self.reverse_tcm_map().abort_atomic(); self.scm_map().abort_atomic(); - self.reverse_scm_map().abort_atomic(); } /// Finishes an atomic batch write operation. @@ -171,8 +161,7 @@ pub trait TransitionStorage: Clone + Send + Sync { self.reverse_tpk_map().finish_atomic()?; self.tcm_map().finish_atomic()?; self.reverse_tcm_map().finish_atomic()?; - self.scm_map().finish_atomic()?; - self.reverse_scm_map().finish_atomic() + self.scm_map().finish_atomic() } /// Stores the given `transition` into storage. @@ -196,8 +185,6 @@ pub trait TransitionStorage: Clone + Send + Sync { self.reverse_tcm_map().insert(*transition.tcm(), transition_id)?; // Store `scm`. self.scm_map().insert(transition_id, *transition.scm())?; - // Store the reverse `scm` entry. - self.reverse_scm_map().insert(*transition.scm(), transition_id)?; Ok(()) }) @@ -215,11 +202,6 @@ pub trait TransitionStorage: Clone + Send + Sync { Some(tcm) => cow_to_copied!(tcm), None => return Ok(()), }; - // Retrieve the `scm`. - let scm = match self.scm_map().get_confirmed(transition_id)? { - Some(scm) => cow_to_copied!(scm), - None => return Ok(()), - }; atomic_batch_scope!(self, { // Remove the program ID and function name. @@ -238,8 +220,6 @@ pub trait TransitionStorage: Clone + Send + Sync { self.reverse_tcm_map().remove(&tcm)?; // Remove `scm`. self.scm_map().remove(transition_id)?; - // Remove the reverse `scm` entry. - self.reverse_scm_map().remove(&scm)?; Ok(()) }) @@ -305,8 +285,6 @@ pub struct TransitionStore> { reverse_tcm: T::ReverseTCMMap, /// The map of signer commitments. scm: T::SCMMap, - /// The reverse `scm` map. - reverse_scm: T::ReverseSCMMap, /// The transition storage. storage: T, } @@ -326,7 +304,6 @@ impl> TransitionStore { tcm: storage.tcm_map().clone(), reverse_tcm: storage.reverse_tcm_map().clone(), scm: storage.scm_map().clone(), - reverse_scm: storage.reverse_scm_map().clone(), storage, }) } @@ -342,7 +319,6 @@ impl> TransitionStore { tcm: storage.tcm_map().clone(), reverse_tcm: storage.reverse_tcm_map().clone(), scm: storage.scm_map().clone(), - reverse_scm: storage.reverse_scm_map().clone(), storage, } } @@ -522,11 +498,6 @@ impl> TransitionStore { pub fn contains_tcm(&self, tcm: &Field) -> Result { self.reverse_tcm.contains_key_confirmed(tcm) } - - /// Returns `true` if the given signer commitment exists. - pub fn contains_scm(&self, scm: &Field) -> Result { - self.reverse_scm.contains_key_confirmed(scm) - } } impl> TransitionStore { From eca98a6e8273f25f447a3d567cba25a36ebcd43f Mon Sep 17 00:00:00 2001 From: Victor Sint Nicolaas Date: Sat, 20 Jan 2024 22:05:49 -0800 Subject: [PATCH 209/298] Nittiest of nits --- ledger/block/src/verify.rs | 1 - synthesizer/process/src/stack/deploy.rs | 4 ++-- synthesizer/process/src/stack/helpers/synthesize.rs | 4 ++-- synthesizer/process/src/stack/registers/caller.rs | 10 +++++----- synthesizer/process/src/stack/registers/mod.rs | 4 ++-- synthesizer/program/src/traits/stack_and_registers.rs | 8 ++++---- 6 files changed, 15 insertions(+), 16 deletions(-) diff --git a/ledger/block/src/verify.rs b/ledger/block/src/verify.rs index 774205317f..87144f0329 100644 --- a/ledger/block/src/verify.rs +++ b/ledger/block/src/verify.rs @@ -492,7 +492,6 @@ impl Block { if has_duplicates(self.transition_commitments()) { bail!("Found a duplicate transition commitment in block {height}"); } - Ok(()) } } diff --git a/synthesizer/process/src/stack/deploy.rs b/synthesizer/process/src/stack/deploy.rs index eed3e658ef..79803d91b9 100644 --- a/synthesizer/process/src/stack/deploy.rs +++ b/synthesizer/process/src/stack/deploy.rs @@ -76,10 +76,10 @@ impl Stack { // Construct the call stacks and assignments used to verify the certificates. let mut call_stacks = Vec::with_capacity(deployment.verifying_keys().len()); - // No root_tvk when verifying deployment of an individual circuit. + // The `root_tvk` is `None` when verifying the deployment of an individual circuit. let root_tvk = None; - // No caller when verifying deployment of an individual circuit. + // The `caller` is `None` when verifying the deployment of an individual circuit. let caller = None; // Iterate through the program functions and construct the callstacks and corresponding assignments. diff --git a/synthesizer/process/src/stack/helpers/synthesize.rs b/synthesizer/process/src/stack/helpers/synthesize.rs index 97cdd09b5d..72d7d7bc24 100644 --- a/synthesizer/process/src/stack/helpers/synthesize.rs +++ b/synthesizer/process/src/stack/helpers/synthesize.rs @@ -52,10 +52,10 @@ impl Stack { // Sample 'is_root'. let is_root = true; - // No root_tvk when deploying an individual circuit. + // The `root_tvk` is `None` when deploying an individual circuit. let root_tvk = None; - // No caller when deploying an individual circuit. + // The caller is `None` when deploying an individual circuit. let caller = None; // Compute the request, with a burner private key. diff --git a/synthesizer/process/src/stack/registers/caller.rs b/synthesizer/process/src/stack/registers/caller.rs index 10d0426ff7..3839138afe 100644 --- a/synthesizer/process/src/stack/registers/caller.rs +++ b/synthesizer/process/src/stack/registers/caller.rs @@ -27,13 +27,13 @@ impl> RegistersSigner for Registers self.signer = Some(signer); } - /// Returns the root transition viewkey. + /// Returns the root transition view key. #[inline] fn root_tvk(&self) -> Result> { - self.root_tvk.ok_or_else(|| anyhow!("root tvk (console) is not set in the registers.")) + self.root_tvk.ok_or_else(|| anyhow!("Root tvk (console) is not set in the registers.")) } - /// Sets the root transition viewkey. + /// Sets the root transition view key. #[inline] fn set_root_tvk(&mut self, root_tvk: Field) { self.root_tvk = Some(root_tvk); @@ -77,13 +77,13 @@ impl> RegistersSignerCircuit for self.signer_circuit = Some(signer_circuit); } - /// Returns the root transition viewkey, as a circuit. + /// Returns the root transition view key, as a circuit. #[inline] fn root_tvk_circuit(&self) -> Result> { self.root_tvk_circuit.clone().ok_or_else(|| anyhow!("Root tvk (circuit) is not set in the registers.")) } - /// Sets the root transition viewkey, as a circuit. + /// Sets the root transition view key, as a circuit. #[inline] fn set_root_tvk_circuit(&mut self, root_tvk_circuit: circuit::Field) { self.root_tvk_circuit = Some(root_tvk_circuit); diff --git a/synthesizer/process/src/stack/registers/mod.rs b/synthesizer/process/src/stack/registers/mod.rs index a2ba0e2388..225a194d31 100644 --- a/synthesizer/process/src/stack/registers/mod.rs +++ b/synthesizer/process/src/stack/registers/mod.rs @@ -51,9 +51,9 @@ pub struct Registers> { signer: Option>, /// The transition signer, as a circuit. signer_circuit: Option>, - /// The root transition viewkey. + /// The root transition view key. root_tvk: Option>, - /// The root transition viewkey, as a circuit. + /// The root transition view key, as a circuit. root_tvk_circuit: Option>, /// The transition caller. caller: Option>, diff --git a/synthesizer/program/src/traits/stack_and_registers.rs b/synthesizer/program/src/traits/stack_and_registers.rs index 56602758ba..4c98b58b1f 100644 --- a/synthesizer/program/src/traits/stack_and_registers.rs +++ b/synthesizer/program/src/traits/stack_and_registers.rs @@ -112,10 +112,10 @@ pub trait RegistersSigner { /// Sets the transition signer. fn set_signer(&mut self, signer: Address); - /// Returns the root transition viewkey. + /// Returns the root transition view key. fn root_tvk(&self) -> Result>; - /// Sets the root transition viewkey. + /// Sets the root transition view key. fn set_root_tvk(&mut self, root_tvk: Field); /// Returns the transition caller. @@ -138,10 +138,10 @@ pub trait RegistersSignerCircuit> { /// Sets the transition signer, as a circuit. fn set_signer_circuit(&mut self, signer_circuit: circuit::Address); - /// Returns the root transition viewkey, as a circuit. + /// Returns the root transition view key, as a circuit. fn root_tvk_circuit(&self) -> Result>; - /// Sets the root transition viewkey, as a circuit. + /// Sets the root transition view key, as a circuit. fn set_root_tvk_circuit(&mut self, root_tvk_circuit: circuit::Field); /// Returns the transition caller, as a circuit. From 3f0e2d0c9a09f3814e14636a33134567d53fb778 Mon Sep 17 00:00:00 2001 From: Victor Sint Nicolaas Date: Sat, 20 Jan 2024 22:26:12 -0800 Subject: [PATCH 210/298] Clean up setting root tvk --- synthesizer/process/src/stack/execute.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/synthesizer/process/src/stack/execute.rs b/synthesizer/process/src/stack/execute.rs index 066da54bbb..7e165a9fb6 100644 --- a/synthesizer/process/src/stack/execute.rs +++ b/synthesizer/process/src/stack/execute.rs @@ -201,12 +201,10 @@ impl StackExecute for Stack { // inject the `root_tvk` as `Mode::Private`. if let Some(root_tvk) = root_tvk { registers.set_root_tvk(root_tvk); - let root_tvk_circuit = circuit::Field::::new(circuit::Mode::Private, root_tvk); - registers.set_root_tvk_circuit(root_tvk_circuit); + registers.set_root_tvk_circuit(circuit::Field::::new(circuit::Mode::Private, root_tvk)); } else { registers.set_root_tvk(*console_request.tvk()); - let root_tvk_circuit = circuit::Field::::new(circuit::Mode::Private, *console_request.tvk()); - registers.set_root_tvk_circuit(root_tvk_circuit); + registers.set_root_tvk_circuit(circuit::Field::::new(circuit::Mode::Private, *console_request.tvk())); } let root_tvk = Some(registers.root_tvk_circuit()?); From 7ec8642b51e5fd91fbeb7d5d4296dc1e2262fc49 Mon Sep 17 00:00:00 2001 From: Victor Sint Nicolaas Date: Sat, 20 Jan 2024 22:38:51 -0800 Subject: [PATCH 211/298] Use try_fold to check scm equality --- synthesizer/process/src/verify_execution.rs | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/synthesizer/process/src/verify_execution.rs b/synthesizer/process/src/verify_execution.rs index d5bef7ee20..7684a5099f 100644 --- a/synthesizer/process/src/verify_execution.rs +++ b/synthesizer/process/src/verify_execution.rs @@ -132,13 +132,15 @@ impl Process { // Ensure the number of instances matches the number of transitions. ensure!(num_instances == execution.transitions().len(), "The number of verifier instances is incorrect"); // Ensure the same signer is used for all transitions. - if let Some(first_transition) = execution.transitions().next() { - let signer_commitment = first_transition.scm(); - ensure!( - execution.transitions().all(|t| t.scm() == signer_commitment), - "The transitions did not use the same signer" - ); - } + execution.transitions().try_fold(None, |signer, transition| { + Ok(match signer { + None => Some(transition.scm()), + Some(signer) => { + ensure!(signer == transition.scm(), "The transitions did not use the same signer"); + Some(signer) + } + }) + })?; // Construct the list of verifier inputs. let verifier_inputs: Vec<_> = verifier_inputs.values().cloned().collect(); From 2d67be39e5491d10a204b304e047c5db4dc525a7 Mon Sep 17 00:00:00 2001 From: raychu86 <14917648+raychu86@users.noreply.github.com> Date: Sun, 21 Jan 2024 11:22:49 -0800 Subject: [PATCH 212/298] Resample genesis block and parameters --- parameters/src/testnet3/genesis.rs | 2 +- .../src/testnet3/resources/block.genesis | Bin 13733 -> 13989 bytes .../testnet3/resources/bond_public.metadata | 6 +++--- .../testnet3/resources/bond_public.verifier | Bin 665 -> 665 bytes .../resources/claim_unbond_public.metadata | 6 +++--- .../resources/claim_unbond_public.verifier | Bin 665 -> 665 bytes .../testnet3/resources/fee_private.metadata | 6 +++--- .../testnet3/resources/fee_private.verifier | Bin 665 -> 665 bytes .../testnet3/resources/fee_public.metadata | 6 +++--- .../testnet3/resources/fee_public.verifier | Bin 665 -> 665 bytes .../src/testnet3/resources/join.metadata | 6 +++--- .../src/testnet3/resources/join.verifier | Bin 665 -> 665 bytes .../resources/set_validator_state.metadata | 6 +++--- .../resources/set_validator_state.verifier | Bin 665 -> 665 bytes .../src/testnet3/resources/split.metadata | 6 +++--- .../src/testnet3/resources/split.verifier | Bin 665 -> 665 bytes .../resources/transfer_private.metadata | 6 +++--- .../resources/transfer_private.verifier | Bin 665 -> 665 bytes .../transfer_private_to_public.metadata | 6 +++--- .../transfer_private_to_public.verifier | Bin 665 -> 665 bytes .../resources/transfer_public.metadata | 6 +++--- .../resources/transfer_public.verifier | Bin 665 -> 665 bytes .../transfer_public_to_private.metadata | 6 +++--- .../transfer_public_to_private.verifier | Bin 665 -> 665 bytes .../unbond_delegator_as_validator.metadata | 6 +++--- .../unbond_delegator_as_validator.verifier | Bin 665 -> 665 bytes .../testnet3/resources/unbond_public.metadata | 6 +++--- .../testnet3/resources/unbond_public.verifier | Bin 665 -> 665 bytes 28 files changed, 40 insertions(+), 40 deletions(-) diff --git a/parameters/src/testnet3/genesis.rs b/parameters/src/testnet3/genesis.rs index 4e7c77511f..45196d18d3 100644 --- a/parameters/src/testnet3/genesis.rs +++ b/parameters/src/testnet3/genesis.rs @@ -27,6 +27,6 @@ mod tests { #[test] fn test_genesis_block() { let bytes = GenesisBytes::load_bytes(); - assert_eq!(13733, bytes.len() as u64, "Update me if serialization has changed"); + assert_eq!(13989, bytes.len() as u64, "Update me if serialization has changed"); } } diff --git a/parameters/src/testnet3/resources/block.genesis b/parameters/src/testnet3/resources/block.genesis index 921aa57cd58622d35cc06f1a904aad1eb400d818..fa73cde84a187328aa3aa4e2547d6cad8fc0b63f 100644 GIT binary patch delta 11593 zcmZwNWl&pPzp(KnxVw9yP^7rKySqCScPO4<#jQ}FXrZ{fLvfel?(Vb@T;AS&&VA;6 zX3qYcnZ2`Sa;;zfYZurTI8p(%AG*=sWe$D?6iS4qoOvJ_n?XkXlBPGJW*rRWh3t?M zsl-HcPhMl5-AA{-6`39vzGBqNAqC<=a69r{TmASl@rhA>DE%5@dXrjQFW9XL!Ji6z zK=~Z8b)MYnS599}?*_$4%xe~P+e)OZFRU{3aBY^j7L^b32}b7gaDz7cg$m=S-@<|v z&s_<^JNSVhtit$4Ok~-j=BIYzW@%THQ_2?J>MUSgI&8LBLoFDoVE z7i!jUfL!<2;q#YlvX)F^0)fCLINx-K5()blt|v+2nyDl{J&J`-24A%aelM1L>)XR6 z#ltXwYh}SJc*e*Zu08$C-cO10?NUTvjSa9K%VE8LzU+v=0YQLFW4&PKWl&U$>{L-~ z>E&7zS#>^};raLn13bNT>K-(hI;Ls{x{3_7N)EL8d&}yFq`;jb#-|+ryMPI0WoInl zbSJyCLA*Xhv7yN0=de-y#2CVo#S>N4q74p+CE!`#_rzVAKgnr7PP8u5UUoOrYU^w`aW z#q(w!^yixc0VRX7axs}TYNu;O3iNj7r32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5FT>#yeh5vvCvBItF+zIKl<5r&xp=Z*76W(SvW?S@Tp z*>(F?OX%ckL*SeK_5aIVVfc8V1-dOL`Ev9XB_re6ycvs7FK>Zp%J1(ywuC2OMtXf8zCj0K6~Z@c;k- diff --git a/parameters/src/testnet3/resources/bond_public.metadata b/parameters/src/testnet3/resources/bond_public.metadata index b54260a7c1..66d68b2599 100644 --- a/parameters/src/testnet3/resources/bond_public.metadata +++ b/parameters/src/testnet3/resources/bond_public.metadata @@ -1,6 +1,6 @@ { - "prover_checksum": "ad7d1557c71a301d6d49370b8bbcc402330c7759e68ee44d2be50addd3cf74ce", - "prover_size": 28803098, - "verifier_checksum": "ffe2bc8fd23fbc5d0d77c855f90847d9f592e1e3e0aba1064f893f6f4c017e93", + "prover_checksum": "65098917d1ab18982d0dd2eb1cc84d90e9a454d9e19a2b0997221303996b8e95", + "prover_size": 28928250, + "verifier_checksum": "7b2d0c51c6405e485335315f1290817b9d65a847b9262f303f8cb277328761c3", "verifier_size": 665 } \ No newline at end of file diff --git a/parameters/src/testnet3/resources/bond_public.verifier b/parameters/src/testnet3/resources/bond_public.verifier index 8549bb552b1688eaaf3c136031901ffd686cbc36..38ec524663b803e82707d6d768a412f4178ded07 100644 GIT binary patch literal 665 zcmZP+V1R%k0|=c7r6uwq{9RKZbe1E8=7CTQH%%NhwikS1tlzz^FgE|gmnrX_7#uw$ z(0b^XR29#`XPYLheY7aUCjpfj*xurdTbX zdWx-3&v4GHpX**v{$E&o`d-2;<9YeM3_14_UliTYPCk@nhIW(UuOuCB`r<}3!gu6jv^oV_)vsy~(jJ8bhS>7mAv0u0B)rb82i!KVx zGmc+)CY!c`B~N7MGCid}hG3UFe~R48GQT+#bRPFFSR3->pVS|p)y@^_@e975-ud%P zoZiESukTJ~**smq7!~F zsf+w>G>|U7)$~%3mtmLB%ISV#PrsJz6klxh`R==)#|lsKu+@LgF_|p(k+;Y5?)yi7 z7=AAMJSFpD+Maog4Zou@3)Q~g{TJvQ7*n=Z7yU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m)iY`yqjHJC;Un|FD?0T{|#$1CuK&JlBbXATj$?#*z+}2H*mJn3zj>&zdN`5 z+~N(bbNuS(A5Gypt-^3xYvR$56+ZEMmgPI{HaePDeQ&{xnUd0v9Y3}H z6kV&Mf9sxeW~J|cJuAVys|EI^jPYD78D6^VDzhB<&M|Bhj9*o${$7gTZ~Hzena`(Xp0p-!yLxG1#JS6Brv+X# zjNwiysyp>kp}+pmB@Hz#<;LEccUv^=cgo(}@F4lvjIs&u=WQuk#}VDTZ~IcEL=XL4 z#tkWNr9Sb!TvHbOw$VGbVZwq(Q|meGHdplDle@5N=YjoIcZTNh^Y$g4MqrK>3}s?Dg^SyX!BPg-u`?`0dx3MTVcq?_j(>RsKxUng<9 z*fw#)n&w|Sl9D&MGuB;zFyAq-kBG1-;+4Me#p&AHq!3^0IIewNdN!< diff --git a/parameters/src/testnet3/resources/join.metadata b/parameters/src/testnet3/resources/join.metadata index 20ef363a56..7befb12d5f 100644 --- a/parameters/src/testnet3/resources/join.metadata +++ b/parameters/src/testnet3/resources/join.metadata @@ -1,6 +1,6 @@ { - "prover_checksum": "ab0a98affcbeac1e8aa0ff208b9dd16f092ee37efaae9f7a1c9e14128f11e670", - "prover_size": 74597012, - "verifier_checksum": "a2cf95112b109855718a641a6f784b90fbd49e77296a161f19ff3c265e8598bc", + "prover_checksum": "defafd0c17ecb8fb181a6de1a3961ed1c491b34b59e4f92846633f08230b0149", + "prover_size": 74722164, + "verifier_checksum": "2e120fd6761a542e326655f8559838b9cf808625f722e9221e56f3bab58684b5", "verifier_size": 665 } \ No newline at end of file diff --git a/parameters/src/testnet3/resources/join.verifier b/parameters/src/testnet3/resources/join.verifier index a55f72a336ecfcbb1b3730dce0d0072782f13d40..02d055f149ee02a4834fd6024916db105280aa38 100644 GIT binary patch literal 665 zcmZP+V1R(wBM`a*N-v9G1PeqJKxhvQ2+adke4V8zteY$&g>&?7mKX=ishUaU-1M(OdUW*(S;ke}`+r#mBv3RiM@4D2iiDhe& z-!9w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AJbBw9kgWOX8xw{>`zav zsata@$aKek?hOq0jFN&c?u)yw`OQ{Hw>=TIDDusMn$>FzPJ7#Zv-yw+06=mmvH$=8 diff --git a/parameters/src/testnet3/resources/transfer_private_to_public.metadata b/parameters/src/testnet3/resources/transfer_private_to_public.metadata index a39b63aa8f..5b45c362e5 100644 --- a/parameters/src/testnet3/resources/transfer_private_to_public.metadata +++ b/parameters/src/testnet3/resources/transfer_private_to_public.metadata @@ -1,6 +1,6 @@ { - "prover_checksum": "88c1e8c772ddf391bb0da11f29815f15f7540364ee1fc0c5b68fbf5803be773d", - "prover_size": 66174324, - "verifier_checksum": "b73f200123f8a9fb3f0cd9da71ac8e6a9d54f262a12eb871d4caa6384b47c30c", + "prover_checksum": "a7b14687479d6b7bd46de7787f622b94c3e8cf581750384ed88ec1afdf1be7f1", + "prover_size": 66299476, + "verifier_checksum": "17570750a8b64b839b77b07ed95a963f0d57b7a322945833e0b45b6593f2942a", "verifier_size": 665 } \ No newline at end of file diff --git a/parameters/src/testnet3/resources/transfer_private_to_public.verifier b/parameters/src/testnet3/resources/transfer_private_to_public.verifier index 67c60b2e86ca1f0e9eda57898f8531423bfceedb..607ec3cc1e9fe90ed1d1ac5249848338046b42af 100644 GIT binary patch literal 665 zcmV;K0%rXI5C8xG00000fs_CM00000k(2-c00000!yEws000003PS+^000007~TK? z000003;+NC000000aLp;E`RjlMO6siabd=)7F_fi#8R#{*-RHqC(5^6N=VBV_+-6* zMfBf!_IVrti6`Z0xocIL;5Y12yAfV0a{B|&e~F%2gR9Kz3ar9u+mAYP(t)nAmk05E zJ~s4#U0x6LefS&-;M5@>$6FXu8lx%y`c{61LmR@XSgNbr?2Pwa`;iHjN{2nn0T?EM zTghSB+yQY4XZ@F8`!L!FZG5pqJiAwFm9N?Su2pfG+|_zF+Ec*(@YxC}hC}B7!Zp}) z^tt(8sfcYVjOGcLkcv#?uT_8YAL|**9kMt*@A6jZ5ex&!mCJ>APNE_K*2;Ss%LDi% z36&OdR)>+V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ouje@a`F?R!ZhU6Di#?awn=y>{sBHML*rIG7AI*egGq0}Z-d-ej z@e_kY%MUS`a~Y4FUa)X1to+>I;dDzV>6y1<8%ugt;4u$HCrN{&9p9L;tV*Uu#PIk` z*=b(arl}fqUCCgJ3y;pG2JLl>DVl93pUv9U;LIl7^){e=Z);F~zG4e{d|me05?PM@9{kEm$O2`T(y*j;@rMHT?pY-lN__pnS^sFP(Yt|R$m4tpWl6JDN v={Ty=TcE2kd diff --git a/parameters/src/testnet3/resources/unbond_delegator_as_validator.metadata b/parameters/src/testnet3/resources/unbond_delegator_as_validator.metadata index ceb942fb5b..54e91fdd4f 100644 --- a/parameters/src/testnet3/resources/unbond_delegator_as_validator.metadata +++ b/parameters/src/testnet3/resources/unbond_delegator_as_validator.metadata @@ -1,6 +1,6 @@ { - "prover_checksum": "c60446568af061a5910204f6ff97066e0d7962b660c33ba5adbff75cbf083830", - "prover_size": 17434172, - "verifier_checksum": "949a46341c3d7f99ab3a508a31b1f25e6f8b40bc56b0a6f992e6170ec7c45d9d", + "prover_checksum": "17aeeb53b8d1eb53ce30662a83ae9889a86fbbc8af09015f0f0af972c9041720", + "prover_size": 27062250, + "verifier_checksum": "cdea9c3350d6f9059769782e3c3d41ca651633a9a0cd874195a298f4d20fa684", "verifier_size": 665 } \ No newline at end of file diff --git a/parameters/src/testnet3/resources/unbond_delegator_as_validator.verifier b/parameters/src/testnet3/resources/unbond_delegator_as_validator.verifier index 046c8ecbab8e7632ee9033e8226df5c932a6cfb7..4be3dc30102d8e35f5c204934cbdccab71b269ec 100644 GIT binary patch literal 665 zcmZP+V1NKVJqXPVrBhQO{KQrW?Pd?5c_0+S=Up$F-8f@+tlQ~cdwywEpI+X)=N=uo zQp;v(*IcaTo}PEh?0Yeb$h*ZWY|iZt>1Q-uRL|3`SGkjKU9!y!(WRyTEfsi{O3wV# z>!q>Bzoz8v)5kmbEwcG$Oi5PFck%ntaKrFc{?=NLgS#}IJN)?0*dee@$;8g%iAf6Q z3ZZ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&d9-M;W%N=Bn0RYxBHWUB= diff --git a/parameters/src/testnet3/resources/unbond_public.metadata b/parameters/src/testnet3/resources/unbond_public.metadata index adb90f7dbf..1f1800bcd7 100644 --- a/parameters/src/testnet3/resources/unbond_public.metadata +++ b/parameters/src/testnet3/resources/unbond_public.metadata @@ -1,6 +1,6 @@ { - "prover_checksum": "77ffd6babbb31296a83d9948af241ef63bf1489d8907b49fecb7abea47070d94", - "prover_size": 17289228, - "verifier_checksum": "260f64e799a516665d2c47eb02dbb3b8edfe8fa1cfb0a0ced5c97bd8b7199fbd", + "prover_checksum": "b814018b94e6dfa2f0d84c01c14c1ba4769a5b3b1c0be37892c29108a283d47a", + "prover_size": 17414380, + "verifier_checksum": "10b1178f84756e3f76cafa126e787695544cbea5b45b1df8c3b5790424238043", "verifier_size": 665 } \ No newline at end of file diff --git a/parameters/src/testnet3/resources/unbond_public.verifier b/parameters/src/testnet3/resources/unbond_public.verifier index 22292c87b45e75db1c56d58023f53a082e93a6c6..007750373225743dd844be6f4fc76091a264ab1e 100644 GIT binary patch literal 665 zcmZP+V1NKy9SCg*rI#c?_^0b3bgvDB=7CTQZIjjq7)H-J$;YuOcacR;ewt&x!JCQO zZ+Tk%x_)+s_KN+BOn1*+U#xR1IA>G6i$}u-*(ZF5>jb_3-%@_J*!g1h?@K&vW^N{j zS!Z@>d$lC2ejI&cLXCjkFNdNS_UFvp4OMLVTua#}$~qrND)}c}+~s(Uf$7%97V*aq zU;XzgJ=Y-_nWcelv?h|JDHSACm0 z*T;4z?|hd~<~x;sBdzkJu@2*(yg-)+U)cIyDBt@cx8SL(vq<4g{g7{8-{njGtG?>3 zd;7TkQ9XNg>-HToe{zkr8+dFkH`kboRLrm}+PU3QQ`yn@aDAZ2?j3BRYI6jCEzLi; z>HfWsOEX^-I`<1ayW-XOVS;kO%5Cm)GXmD|zBpPCxp+@>=BCn35-w3f0o&T2hMvhd zx;o*A<^nnKHGZp`H5#wV8`YZBB(b$bo_O82t*1{TeC`9K|9T57nG}~k-Bi1GmYAf% zPVTebG8(%qN|!uk@NfDzlkLmw^^+za=W>+ui?Nz>Twd=Ech;NjFJ<2@SMshrDzL%9 z_D9InH7~OEOl@XdalQ8Q8T-k9@7ga(>fZE6;m5Y@|8g_lP7J*p#B%V2&D`DB{zM-B xRCS}N_Ij+l%rS<;e$TZ1n!nn8%`v?syVxsf2E!`_G zc`_%ZeB~Ma1G7F=8q93A%Q?TwT6uNj?&5x*T^r(jeohxS8p++hF=Njphd$3UI@6C& zX4$-GLXMGuTE*&s_nAw}6#17PoXf!esib30Sw%P37O$4w2dr1D7K`2UZAoyTj`z!- zDN!5Q+Ty=CA5inUIf3QDlx$BMhT0~zZ&_(aRByI>B_+oNCzqMV)b2kVHtj0c21g~y zoA0XbJGpeP*tX=Jwx+YH!}^B(J{HPa#-G?-b|@HJ*DYL|{WhRZqrpn{XzOm?t4WHP zU3PQN_`01n@CguJz_3iCf%i~-HS_5V?{hn+`H25KyRzi!c0CiGO^v#*lJ>lkt?Ufw z+xGL%#_P8q6fc&LdLY-B+`99L>+gk0F*|TH_`ojZ<^}_qBkF0RL zl6d=@VdljnI=|O1WE52JxL16@@pD+y<-q56y8q?AxUufUr^&y6OV0Yw?Y-(v-@V*R zd$v~kwlKyocCj#Gc=+Oa+p&{3X7I!o#O&j4-sjDFUGCLZB@wQ0QK^U@SI_UhX=yIj x9BDGaY9eREuhR`;yw7eWYI<+h+G~^cN{2(t;57ThEfzr+((jwJbXxx|006ukFM0p~ From 722b6d0623125d41feb40cdb73ebe7bffa837b24 Mon Sep 17 00:00:00 2001 From: Howard Wu <9260812+howardwu@users.noreply.github.com> Date: Sun, 21 Jan 2024 13:09:30 -0800 Subject: [PATCH 213/298] Fix terminology, fix vulnerability --- circuit/environment/src/circuit.rs | 41 +++++++++---------- circuit/environment/src/environment.rs | 6 +-- circuit/network/src/v0.rs | 10 ++--- .../block/src/transaction/deployment/mod.rs | 18 ++++++-- synthesizer/process/src/stack/call/mod.rs | 2 +- synthesizer/process/src/stack/deploy.rs | 2 +- synthesizer/process/src/stack/execute.rs | 2 +- synthesizer/src/vm/helpers/cost.rs | 2 +- 8 files changed, 46 insertions(+), 37 deletions(-) diff --git a/circuit/environment/src/circuit.rs b/circuit/environment/src/circuit.rs index 505e33f16a..3fb5cc10ee 100644 --- a/circuit/environment/src/circuit.rs +++ b/circuit/environment/src/circuit.rs @@ -22,9 +22,9 @@ use core::{ type Field = ::Field; thread_local! { + pub(super) static CONSTRAINT_LIMIT: Cell> = Cell::new(None); pub(super) static CIRCUIT: RefCell> = RefCell::new(R1CS::new()); pub(super) static IN_WITNESS: Cell = Cell::new(false); - pub(super) static MAX_NUM_CONSTRAINTS: Cell = Cell::new(u64::MAX); pub(super) static ZERO: LinearCombination = LinearCombination::zero(); pub(super) static ONE: LinearCombination = LinearCombination::one(); } @@ -147,10 +147,12 @@ impl Environment for Circuit { // Ensure we are not in witness mode. if !in_witness.get() { CIRCUIT.with(|circuit| { - // Ensure we do not surpass maximum allowed number of constraints - MAX_NUM_CONSTRAINTS.with(|max_constraints| { - if circuit.borrow().num_constraints() >= max_constraints.get() { - Self::halt("Surpassing maximum allowed number of constraints") + // Ensure that we do not surpass the constraint limit for the circuit. + CONSTRAINT_LIMIT.with(|constraint_limit| { + if let Some(limit) = constraint_limit.get() { + if circuit.borrow().num_constraints() >= limit { + Self::halt(format!("Surpassed the constraint limit ({limit})")) + } } }); @@ -256,8 +258,11 @@ impl Environment for Circuit { panic!("{}", &error) } - /// TODO (howardwu): Abstraction - Refactor this into an appropriate design. - /// Circuits should not have easy access to this during synthesis. + /// Sets the constraint limit for the circuit. + fn set_constraint_limit(limit: Option) { + CONSTRAINT_LIMIT.with(|current_limit| current_limit.replace(limit)); + } + /// Returns the R1CS circuit, resetting the circuit. fn inject_r1cs(r1cs: R1CS) { CIRCUIT.with(|circuit| { @@ -276,15 +281,13 @@ impl Environment for Circuit { }) } - /// TODO (howardwu): Abstraction - Refactor this into an appropriate design. - /// Circuits should not have easy access to this during synthesis. /// Returns the R1CS circuit, resetting the circuit. fn eject_r1cs_and_reset() -> R1CS { CIRCUIT.with(|circuit| { // Reset the witness mode. IN_WITNESS.with(|in_witness| in_witness.replace(false)); - // Reset the max num constraints. - Self::set_constraint_maximum(u64::MAX); + // Reset the constraint limit. + Self::set_constraint_limit(None); // Eject the R1CS instance. let r1cs = circuit.replace(R1CS::<::BaseField>::new()); // Ensure the circuit is now empty. @@ -297,15 +300,13 @@ impl Environment for Circuit { }) } - /// TODO (howardwu): Abstraction - Refactor this into an appropriate design. - /// Circuits should not have easy access to this during synthesis. /// Returns the R1CS assignment of the circuit, resetting the circuit. fn eject_assignment_and_reset() -> Assignment<::Field> { CIRCUIT.with(|circuit| { // Reset the witness mode. IN_WITNESS.with(|in_witness| in_witness.replace(false)); - // Reset the num constraints. - Self::set_constraint_maximum(u64::MAX); + // Reset the constraint limit. + Self::set_constraint_limit(None); // Eject the R1CS instance. let r1cs = circuit.replace(R1CS::<::BaseField>::new()); assert_eq!(0, circuit.borrow().num_constants()); @@ -317,18 +318,14 @@ impl Environment for Circuit { }) } - /// Sets a maximum number of allowed constraints. - fn set_constraint_maximum(new_max_num_constraints: u64) { - MAX_NUM_CONSTRAINTS.with(|max_num_constraints| max_num_constraints.replace(new_max_num_constraints)); - } - /// Clears the circuit and initializes an empty environment. fn reset() { CIRCUIT.with(|circuit| { // Reset the witness mode. IN_WITNESS.with(|in_witness| in_witness.replace(false)); - // Reset the max num constraints. - Self::set_constraint_maximum(u64::MAX); + // Reset the constraint limit. + Self::set_constraint_limit(None); + // Reset the circuit. *circuit.borrow_mut() = R1CS::<::BaseField>::new(); assert_eq!(0, circuit.borrow().num_constants()); assert_eq!(1, circuit.borrow().num_public()); diff --git a/circuit/environment/src/environment.rs b/circuit/environment/src/environment.rs index 789cfd61a2..f621611cde 100644 --- a/circuit/environment/src/environment.rs +++ b/circuit/environment/src/environment.rs @@ -160,6 +160,9 @@ pub trait Environment: 'static + Copy + Clone + fmt::Debug + fmt::Display + Eq + ::halt(message) } + /// Sets the constraint limit for the circuit. + fn set_constraint_limit(limit: Option); + /// Returns the R1CS circuit, resetting the circuit. fn inject_r1cs(r1cs: R1CS); @@ -169,9 +172,6 @@ pub trait Environment: 'static + Copy + Clone + fmt::Debug + fmt::Display + Eq + /// Returns the R1CS assignment of the circuit, resetting the circuit. fn eject_assignment_and_reset() -> Assignment<::Field>; - /// Sets a maximum amount of allowed constraints - fn set_constraint_maximum(new_max_num_constraints: u64); - /// Clears and initializes an empty environment. fn reset(); } diff --git a/circuit/network/src/v0.rs b/circuit/network/src/v0.rs index 7f76af350e..9fd219d090 100644 --- a/circuit/network/src/v0.rs +++ b/circuit/network/src/v0.rs @@ -466,6 +466,11 @@ impl Environment for AleoV0 { E::halt(message) } + /// Sets the constraint limit for the circuit. + fn set_constraint_limit(limit: Option) { + E::set_constraint_limit(limit) + } + /// Returns the R1CS circuit, resetting the circuit. fn inject_r1cs(r1cs: R1CS) { E::inject_r1cs(r1cs) @@ -481,11 +486,6 @@ impl Environment for AleoV0 { E::eject_assignment_and_reset() } - /// Sets a maximum amount of allowed constraints - fn set_constraint_maximum(new_max_num_constraints: u64) { - E::set_constraint_maximum(new_max_num_constraints) - } - /// Clears the circuit and initializes an empty environment. fn reset() { E::reset() diff --git a/ledger/block/src/transaction/deployment/mod.rs b/ledger/block/src/transaction/deployment/mod.rs index c253c66ec2..fbea825444 100644 --- a/ledger/block/src/transaction/deployment/mod.rs +++ b/ledger/block/src/transaction/deployment/mod.rs @@ -124,9 +124,21 @@ impl Deployment { &self.verifying_keys } - /// Returns the total number of constraints. - pub fn num_constraints(&self) -> u64 { - self.verifying_keys.iter().map(|(_, (vk, _))| vk.circuit_info.num_constraints as u64).sum::() + /// Returns the sum of the constraint counts for all functions in this deployment. + pub fn num_combined_constraints(&self) -> Result { + // Initialize the accumulator. + let mut num_combined_constraints = 0u64; + // Iterate over the functions. + for (_, (vk, _)) in &self.verifying_keys { + // Add the number of constraints. + // Note: This method must be *checked* because the claimed constraint count + // is from the user, not the synthesizer. + num_combined_constraints = num_combined_constraints + .checked_add(vk.circuit_info.num_constraints as u64) + .ok_or_else(|| anyhow!("Overflow when counting constraints for '{}'", self.program_id()))?; + } + // Return the number of combined constraints. + Ok(num_combined_constraints) } /// Returns the deployment ID. diff --git a/synthesizer/process/src/stack/call/mod.rs b/synthesizer/process/src/stack/call/mod.rs index 610942eccc..56a0689c8e 100644 --- a/synthesizer/process/src/stack/call/mod.rs +++ b/synthesizer/process/src/stack/call/mod.rs @@ -353,7 +353,7 @@ impl CallTrait for Call { // If the circuit is in CheckDeployment mode, set a constraint maximum. if let CallStack::CheckDeployment(_, _, _, num_constraints) = ®isters.call_stack() { - A::set_constraint_maximum(*num_constraints); + A::set_constraint_limit(Some(*num_constraints)); } use circuit::Inject; diff --git a/synthesizer/process/src/stack/deploy.rs b/synthesizer/process/src/stack/deploy.rs index 261e282cd4..d3d6e1321e 100644 --- a/synthesizer/process/src/stack/deploy.rs +++ b/synthesizer/process/src/stack/deploy.rs @@ -74,7 +74,7 @@ impl Stack { let program_id = self.program.id(); // Check that the deployment does not require too many constraints - let total_num_constraints = deployment.num_constraints(); + let total_num_constraints = deployment.num_combined_constraints()?; ensure!(total_num_constraints <= N::MAX_DEPLOYMENT_CONSTRAINTS); // Construct the call stacks and assignments used to verify the certificates. diff --git a/synthesizer/process/src/stack/execute.rs b/synthesizer/process/src/stack/execute.rs index f54dd5611c..48546443db 100644 --- a/synthesizer/process/src/stack/execute.rs +++ b/synthesizer/process/src/stack/execute.rs @@ -144,7 +144,7 @@ impl StackExecute for Stack { // If the circuit is in CheckDeployment mode, set a constraint maximum. if let CallStack::CheckDeployment(_, _, _, num_constraints) = &call_stack { - A::set_constraint_maximum(*num_constraints); + A::set_constraint_limit(Some(*num_constraints)); } // Retrieve the next request. diff --git a/synthesizer/src/vm/helpers/cost.rs b/synthesizer/src/vm/helpers/cost.rs index 554eaeb4ae..7a1ab03b4c 100644 --- a/synthesizer/src/vm/helpers/cost.rs +++ b/synthesizer/src/vm/helpers/cost.rs @@ -32,7 +32,7 @@ pub fn deployment_cost(deployment: &Deployment) -> Result { // Determine the number of characters in the program ID. let num_characters = u32::try_from(program_id.name().to_string().len())?; // Determine the number of constraints in the program - let num_constraints = deployment.num_constraints(); + let num_constraints = deployment.num_combined_constraints()?; // Compute the storage cost in microcredits. let storage_cost = size_in_bytes From a22ab6da66ba111732476c20fe451abddbb32386 Mon Sep 17 00:00:00 2001 From: Howard Wu <9260812+howardwu@users.noreply.github.com> Date: Sun, 21 Jan 2024 13:13:58 -0800 Subject: [PATCH 214/298] Fix the deployment limit usage --- synthesizer/process/src/stack/call/mod.rs | 2 +- synthesizer/process/src/stack/deploy.rs | 4 +--- synthesizer/process/src/stack/execute.rs | 2 +- synthesizer/process/src/stack/mod.rs | 2 +- synthesizer/process/src/tests/test_credits.rs | 5 +---- 5 files changed, 5 insertions(+), 10 deletions(-) diff --git a/synthesizer/process/src/stack/call/mod.rs b/synthesizer/process/src/stack/call/mod.rs index 56a0689c8e..87f514e180 100644 --- a/synthesizer/process/src/stack/call/mod.rs +++ b/synthesizer/process/src/stack/call/mod.rs @@ -353,7 +353,7 @@ impl CallTrait for Call { // If the circuit is in CheckDeployment mode, set a constraint maximum. if let CallStack::CheckDeployment(_, _, _, num_constraints) = ®isters.call_stack() { - A::set_constraint_limit(Some(*num_constraints)); + A::set_constraint_limit(*num_constraints); } use circuit::Inject; diff --git a/synthesizer/process/src/stack/deploy.rs b/synthesizer/process/src/stack/deploy.rs index d3d6e1321e..6ca8bb3c94 100644 --- a/synthesizer/process/src/stack/deploy.rs +++ b/synthesizer/process/src/stack/deploy.rs @@ -123,8 +123,6 @@ impl Stack { rng, )?; lap!(timer, "Compute the request for {}", function.name()); - // Get the expected number of constraints - let expected_num_constraints = verifying_key.circuit_info.num_constraints as u64; // Initialize the assignments. let assignments = Assignments::::default(); // Initialize the call stack. @@ -132,7 +130,7 @@ impl Stack { vec![request], burner_private_key, assignments.clone(), - expected_num_constraints, + Some(verifying_key.circuit_info.num_constraints as u64), ); // Append the function name, callstack, and assignments. call_stacks.push((function.name(), call_stack, assignments)); diff --git a/synthesizer/process/src/stack/execute.rs b/synthesizer/process/src/stack/execute.rs index 48546443db..e3a2b31f02 100644 --- a/synthesizer/process/src/stack/execute.rs +++ b/synthesizer/process/src/stack/execute.rs @@ -144,7 +144,7 @@ impl StackExecute for Stack { // If the circuit is in CheckDeployment mode, set a constraint maximum. if let CallStack::CheckDeployment(_, _, _, num_constraints) = &call_stack { - A::set_constraint_limit(Some(*num_constraints)); + A::set_constraint_limit(*num_constraints); } // Retrieve the next request. diff --git a/synthesizer/process/src/stack/mod.rs b/synthesizer/process/src/stack/mod.rs index 33e608865b..e0edca4922 100644 --- a/synthesizer/process/src/stack/mod.rs +++ b/synthesizer/process/src/stack/mod.rs @@ -81,7 +81,7 @@ pub type Assignments = Arc pub enum CallStack { Authorize(Vec>, PrivateKey, Authorization), Synthesize(Vec>, PrivateKey, Authorization), - CheckDeployment(Vec>, PrivateKey, Assignments, u64), + CheckDeployment(Vec>, PrivateKey, Assignments, Option), Evaluate(Authorization), Execute(Authorization, Arc>>), PackageRun(Vec>, PrivateKey, Assignments), diff --git a/synthesizer/process/src/tests/test_credits.rs b/synthesizer/process/src/tests/test_credits.rs index c7464e46e4..f7b0671081 100644 --- a/synthesizer/process/src/tests/test_credits.rs +++ b/synthesizer/process/src/tests/test_credits.rs @@ -1527,11 +1527,8 @@ mod sanity_checks { Request::sign(private_key, program_id, function_name, inputs.iter(), &input_types, is_root, rng).unwrap(); // Initialize the assignments. let assignments = Assignments::::default(); - // Set max num constraints - let max_num_constraints = u64::MAX; // Initialize the call stack. - let call_stack = - CallStack::CheckDeployment(vec![request], *private_key, assignments.clone(), max_num_constraints); + let call_stack = CallStack::CheckDeployment(vec![request], *private_key, assignments.clone(), None); // Synthesize the circuit. let _response = stack.execute_function::(call_stack, None, rng).unwrap(); // Retrieve the assignment. From dc8fb722eed89b20e3f23e9dcc864b7d61e3a8f6 Mon Sep 17 00:00:00 2001 From: Howard Wu <9260812+howardwu@users.noreply.github.com> Date: Sun, 21 Jan 2024 13:17:01 -0800 Subject: [PATCH 215/298] Write like an adult --- synthesizer/src/vm/deploy.rs | 2 +- synthesizer/src/vm/helpers/cost.rs | 6 +++--- synthesizer/src/vm/mod.rs | 4 ++-- synthesizer/src/vm/verify.rs | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/synthesizer/src/vm/deploy.rs b/synthesizer/src/vm/deploy.rs index f548607d52..e080ba54d9 100644 --- a/synthesizer/src/vm/deploy.rs +++ b/synthesizer/src/vm/deploy.rs @@ -40,7 +40,7 @@ impl> VM { let owner = ProgramOwner::new(private_key, deployment_id, rng)?; // Compute the minimum deployment cost. - let minimum_deployment_cost = deployment_cost(&deployment)?; + let (minimum_deployment_cost, (_, _)) = deployment_cost(&deployment)?; // Authorize the fee. let fee_authorization = match fee_record { Some(record) => self.authorize_fee_private( diff --git a/synthesizer/src/vm/helpers/cost.rs b/synthesizer/src/vm/helpers/cost.rs index 7a1ab03b4c..1c3625814d 100644 --- a/synthesizer/src/vm/helpers/cost.rs +++ b/synthesizer/src/vm/helpers/cost.rs @@ -23,8 +23,8 @@ use synthesizer_program::{Command, Finalize, Instruction}; use std::collections::HashMap; -/// Returns the *minimum* cost in microcredits to publish the given deployment total cost. -pub fn deployment_cost(deployment: &Deployment) -> Result { +/// Returns the *minimum* cost in microcredits to publish the given deployment (total cost, (storage cost, namespace cost)). +pub fn deployment_cost(deployment: &Deployment) -> Result<(u64, (u64, u64))> { // Determine the number of bytes in the deployment. let size_in_bytes = deployment.size_in_bytes()?; // Retrieve the program ID. @@ -54,7 +54,7 @@ pub fn deployment_cost(deployment: &Deployment) -> Result { .and_then(|x| x.checked_add(synthesis_cost)) .ok_or(anyhow!("The total cost computation overflowed for a deployment"))?; - Ok(total_cost) + Ok((total_cost, (storage_cost, namespace_cost))) } /// Returns the *minimum* cost in microcredits to publish the given execution (total cost, (storage cost, namespace cost)). diff --git a/synthesizer/src/vm/mod.rs b/synthesizer/src/vm/mod.rs index 57ee90e152..70469befc1 100644 --- a/synthesizer/src/vm/mod.rs +++ b/synthesizer/src/vm/mod.rs @@ -1109,10 +1109,10 @@ function do: ) .unwrap(); - // Create the Deployment Transaction + // Create the deployment transaction. let deployment = vm.deploy(&private_key, &program, None, 0, None, rng).unwrap(); - // Verify the Deployment Transaction. It should fail because there are too many constraints. + // Verify the deployment transaction. It should fail because there are too many constraints. assert!(vm.check_transaction(&deployment, None, rng).is_err()); } diff --git a/synthesizer/src/vm/verify.rs b/synthesizer/src/vm/verify.rs index e39717d8be..e1a7c05330 100644 --- a/synthesizer/src/vm/verify.rs +++ b/synthesizer/src/vm/verify.rs @@ -146,7 +146,7 @@ impl> VM { bail!("Failed to compute the Merkle root for deployment transaction '{id}'") }; // Compute the deployment cost. - let cost = deployment_cost(deployment)?; + let (cost, _) = deployment_cost(deployment)?; // Ensure the fee is sufficient to cover the cost. if *fee.base_amount()? < cost { bail!("Transaction '{id}' has an insufficient base fee (deployment) - requires {cost} microcredits") From e919f7b655819938710ee1aae0833c1dcf340a27 Mon Sep 17 00:00:00 2001 From: Howard Wu <9260812+howardwu@users.noreply.github.com> Date: Sun, 21 Jan 2024 13:20:24 -0800 Subject: [PATCH 216/298] nit: comments --- synthesizer/process/src/stack/call/mod.rs | 6 +++--- synthesizer/process/src/stack/execute.rs | 6 +++--- synthesizer/process/src/stack/mod.rs | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/synthesizer/process/src/stack/call/mod.rs b/synthesizer/process/src/stack/call/mod.rs index 87f514e180..f0e9b18797 100644 --- a/synthesizer/process/src/stack/call/mod.rs +++ b/synthesizer/process/src/stack/call/mod.rs @@ -351,9 +351,9 @@ impl CallTrait for Call { // Inject the existing circuit. A::inject_r1cs(r1cs); - // If the circuit is in CheckDeployment mode, set a constraint maximum. - if let CallStack::CheckDeployment(_, _, _, num_constraints) = ®isters.call_stack() { - A::set_constraint_limit(*num_constraints); + // If in 'CheckDeployment' mode, set the expected constraint limit. + if let CallStack::CheckDeployment(_, _, _, constraint_limit) = ®isters.call_stack() { + A::set_constraint_limit(*constraint_limit); } use circuit::Inject; diff --git a/synthesizer/process/src/stack/execute.rs b/synthesizer/process/src/stack/execute.rs index e3a2b31f02..11954e54f0 100644 --- a/synthesizer/process/src/stack/execute.rs +++ b/synthesizer/process/src/stack/execute.rs @@ -142,9 +142,9 @@ impl StackExecute for Stack { // Ensure the circuit environment is clean. A::reset(); - // If the circuit is in CheckDeployment mode, set a constraint maximum. - if let CallStack::CheckDeployment(_, _, _, num_constraints) = &call_stack { - A::set_constraint_limit(*num_constraints); + // If in 'CheckDeployment' mode, set the constraint limit. + if let CallStack::CheckDeployment(_, _, _, constraint_limit) = &call_stack { + A::set_constraint_limit(*constraint_limit); } // Retrieve the next request. diff --git a/synthesizer/process/src/stack/mod.rs b/synthesizer/process/src/stack/mod.rs index e0edca4922..e354351093 100644 --- a/synthesizer/process/src/stack/mod.rs +++ b/synthesizer/process/src/stack/mod.rs @@ -109,12 +109,12 @@ impl CallStack { CallStack::Synthesize(requests, private_key, authorization) => { CallStack::Synthesize(requests.clone(), *private_key, authorization.replicate()) } - CallStack::CheckDeployment(requests, private_key, assignments, num_constraints) => { + CallStack::CheckDeployment(requests, private_key, assignments, constraint_limit) => { CallStack::CheckDeployment( requests.clone(), *private_key, Arc::new(RwLock::new(assignments.read().clone())), - *num_constraints, + *constraint_limit, ) } CallStack::Evaluate(authorization) => CallStack::Evaluate(authorization.replicate()), From d2e52b0188c4eb78a10b4e06546c68547971af6f Mon Sep 17 00:00:00 2001 From: Howard Wu <9260812+howardwu@users.noreply.github.com> Date: Sun, 21 Jan 2024 13:26:12 -0800 Subject: [PATCH 217/298] Update comments --- console/network/src/lib.rs | 2 +- synthesizer/process/src/stack/deploy.rs | 5 ++--- synthesizer/src/vm/helpers/cost.rs | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/console/network/src/lib.rs b/console/network/src/lib.rs index 69807dc6db..313c34e5f0 100644 --- a/console/network/src/lib.rs +++ b/console/network/src/lib.rs @@ -101,7 +101,7 @@ pub trait Network: /// The cost in microcredits per constraint for the deployment transaction. const SYNTH_FEE_MULTIPLIER: u64 = 25; // 25 microcredit per constraint to synthesize /// The maximum number of constraints in a deployment - const MAX_DEPLOYMENT_CONSTRAINTS: u64 = 1_000_000; + const MAX_DEPLOYMENT_LIMIT: u64 = 1_000_000; /// The maximum number of microcredits that can be spent as a fee. const MAX_FEE: u64 = 1_000_000_000_000_000; diff --git a/synthesizer/process/src/stack/deploy.rs b/synthesizer/process/src/stack/deploy.rs index 6ca8bb3c94..230c3e5eaf 100644 --- a/synthesizer/process/src/stack/deploy.rs +++ b/synthesizer/process/src/stack/deploy.rs @@ -73,9 +73,8 @@ impl Stack { let program_id = self.program.id(); - // Check that the deployment does not require too many constraints - let total_num_constraints = deployment.num_combined_constraints()?; - ensure!(total_num_constraints <= N::MAX_DEPLOYMENT_CONSTRAINTS); + // Check that the number of combined constraints does not exceed the deployment limit. + ensure!(deployment.num_combined_constraints()? <= N::MAX_DEPLOYMENT_LIMIT); // Construct the call stacks and assignments used to verify the certificates. let mut call_stacks = Vec::with_capacity(deployment.verifying_keys().len()); diff --git a/synthesizer/src/vm/helpers/cost.rs b/synthesizer/src/vm/helpers/cost.rs index 1c3625814d..895b6a8480 100644 --- a/synthesizer/src/vm/helpers/cost.rs +++ b/synthesizer/src/vm/helpers/cost.rs @@ -31,7 +31,7 @@ pub fn deployment_cost(deployment: &Deployment) -> Result<(u64, ( let program_id = deployment.program_id(); // Determine the number of characters in the program ID. let num_characters = u32::try_from(program_id.name().to_string().len())?; - // Determine the number of constraints in the program + // Compute the number of combined constraints in the program. let num_constraints = deployment.num_combined_constraints()?; // Compute the storage cost in microcredits. From 1568ce05eb72230569a3dce8e40a8e69886b8592 Mon Sep 17 00:00:00 2001 From: Howard Wu <9260812+howardwu@users.noreply.github.com> Date: Sun, 21 Jan 2024 13:27:45 -0800 Subject: [PATCH 218/298] Adds a getter for the constraint limit from the circuit --- circuit/environment/src/circuit.rs | 5 +++++ circuit/environment/src/environment.rs | 3 +++ circuit/network/src/v0.rs | 5 +++++ 3 files changed, 13 insertions(+) diff --git a/circuit/environment/src/circuit.rs b/circuit/environment/src/circuit.rs index 3fb5cc10ee..8e0788d01e 100644 --- a/circuit/environment/src/circuit.rs +++ b/circuit/environment/src/circuit.rs @@ -258,6 +258,11 @@ impl Environment for Circuit { panic!("{}", &error) } + /// Returns the constraint limit for the circuit, if one exists. + fn get_constraint_limit() -> Option { + CONSTRAINT_LIMIT.with(|current_limit| current_limit.get()) + } + /// Sets the constraint limit for the circuit. fn set_constraint_limit(limit: Option) { CONSTRAINT_LIMIT.with(|current_limit| current_limit.replace(limit)); diff --git a/circuit/environment/src/environment.rs b/circuit/environment/src/environment.rs index f621611cde..d8fdc5a181 100644 --- a/circuit/environment/src/environment.rs +++ b/circuit/environment/src/environment.rs @@ -160,6 +160,9 @@ pub trait Environment: 'static + Copy + Clone + fmt::Debug + fmt::Display + Eq + ::halt(message) } + /// Returns the constraint limit for the circuit, if one exists. + fn get_constraint_limit() -> Option; + /// Sets the constraint limit for the circuit. fn set_constraint_limit(limit: Option); diff --git a/circuit/network/src/v0.rs b/circuit/network/src/v0.rs index 9fd219d090..936e1e581c 100644 --- a/circuit/network/src/v0.rs +++ b/circuit/network/src/v0.rs @@ -466,6 +466,11 @@ impl Environment for AleoV0 { E::halt(message) } + /// Returns the constraint limit for the circuit, if one exists. + fn get_constraint_limit() -> Option { + E::get_constraint_limit() + } + /// Sets the constraint limit for the circuit. fn set_constraint_limit(limit: Option) { E::set_constraint_limit(limit) From e39f9d27e8e211d27e206e531fe496a117c6519d Mon Sep 17 00:00:00 2001 From: Howard Wu <9260812+howardwu@users.noreply.github.com> Date: Sun, 21 Jan 2024 13:29:34 -0800 Subject: [PATCH 219/298] Fix names, set limit to 1<<20 --- console/network/src/lib.rs | 4 ++-- synthesizer/src/vm/helpers/cost.rs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/console/network/src/lib.rs b/console/network/src/lib.rs index 313c34e5f0..80e53c627e 100644 --- a/console/network/src/lib.rs +++ b/console/network/src/lib.rs @@ -99,9 +99,9 @@ pub trait Network: /// The cost in microcredits per byte for the deployment transaction. const DEPLOYMENT_FEE_MULTIPLIER: u64 = 1_000; // 1 millicredit per byte /// The cost in microcredits per constraint for the deployment transaction. - const SYNTH_FEE_MULTIPLIER: u64 = 25; // 25 microcredit per constraint to synthesize + const SYNTHESIS_FEE_MULTIPLIER: u64 = 25; // 25 microcredits per constraint /// The maximum number of constraints in a deployment - const MAX_DEPLOYMENT_LIMIT: u64 = 1_000_000; + const MAX_DEPLOYMENT_LIMIT: u64 = 1 << 20; // 1,048,576 constraints /// The maximum number of microcredits that can be spent as a fee. const MAX_FEE: u64 = 1_000_000_000_000_000; diff --git a/synthesizer/src/vm/helpers/cost.rs b/synthesizer/src/vm/helpers/cost.rs index 895b6a8480..88218c9a86 100644 --- a/synthesizer/src/vm/helpers/cost.rs +++ b/synthesizer/src/vm/helpers/cost.rs @@ -46,7 +46,7 @@ pub fn deployment_cost(deployment: &Deployment) -> Result<(u64, ( .saturating_mul(1_000_000); // 1 microcredit = 1e-6 credits. // Compute the synthesis cost in microcredits. - let synthesis_cost = num_constraints * N::SYNTH_FEE_MULTIPLIER; + let synthesis_cost = num_constraints * N::SYNTHESIS_FEE_MULTIPLIER; // Compute the total cost in microcredits. let total_cost = storage_cost From 438351807ba2b9eda9cbd2b89b0de64e2cb56c87 Mon Sep 17 00:00:00 2001 From: Howard Wu <9260812+howardwu@users.noreply.github.com> Date: Sun, 21 Jan 2024 13:30:14 -0800 Subject: [PATCH 220/298] Missing period (.) --- console/network/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/console/network/src/lib.rs b/console/network/src/lib.rs index 80e53c627e..4995a5f577 100644 --- a/console/network/src/lib.rs +++ b/console/network/src/lib.rs @@ -100,7 +100,7 @@ pub trait Network: const DEPLOYMENT_FEE_MULTIPLIER: u64 = 1_000; // 1 millicredit per byte /// The cost in microcredits per constraint for the deployment transaction. const SYNTHESIS_FEE_MULTIPLIER: u64 = 25; // 25 microcredits per constraint - /// The maximum number of constraints in a deployment + /// The maximum number of constraints in a deployment. const MAX_DEPLOYMENT_LIMIT: u64 = 1 << 20; // 1,048,576 constraints /// The maximum number of microcredits that can be spent as a fee. const MAX_FEE: u64 = 1_000_000_000_000_000; From 3841a3e492b2f13123bd7a5ef0c7404fa39fd176 Mon Sep 17 00:00:00 2001 From: Howard Wu <9260812+howardwu@users.noreply.github.com> Date: Sun, 21 Jan 2024 13:37:59 -0800 Subject: [PATCH 221/298] Include the synthesis cost in the return for the deployment cost --- synthesizer/src/vm/deploy.rs | 2 +- synthesizer/src/vm/helpers/cost.rs | 20 ++++++++++---------- synthesizer/src/vm/verify.rs | 2 +- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/synthesizer/src/vm/deploy.rs b/synthesizer/src/vm/deploy.rs index e080ba54d9..f9e260793c 100644 --- a/synthesizer/src/vm/deploy.rs +++ b/synthesizer/src/vm/deploy.rs @@ -40,7 +40,7 @@ impl> VM { let owner = ProgramOwner::new(private_key, deployment_id, rng)?; // Compute the minimum deployment cost. - let (minimum_deployment_cost, (_, _)) = deployment_cost(&deployment)?; + let (minimum_deployment_cost, _) = deployment_cost(&deployment)?; // Authorize the fee. let fee_authorization = match fee_record { Some(record) => self.authorize_fee_private( diff --git a/synthesizer/src/vm/helpers/cost.rs b/synthesizer/src/vm/helpers/cost.rs index 88218c9a86..6f94607978 100644 --- a/synthesizer/src/vm/helpers/cost.rs +++ b/synthesizer/src/vm/helpers/cost.rs @@ -23,8 +23,8 @@ use synthesizer_program::{Command, Finalize, Instruction}; use std::collections::HashMap; -/// Returns the *minimum* cost in microcredits to publish the given deployment (total cost, (storage cost, namespace cost)). -pub fn deployment_cost(deployment: &Deployment) -> Result<(u64, (u64, u64))> { +/// Returns the *minimum* cost in microcredits to publish the given deployment (total cost, (storage cost, synthesis cost, namespace cost)). +pub fn deployment_cost(deployment: &Deployment) -> Result<(u64, (u64, u64, u64))> { // Determine the number of bytes in the deployment. let size_in_bytes = deployment.size_in_bytes()?; // Retrieve the program ID. @@ -32,32 +32,32 @@ pub fn deployment_cost(deployment: &Deployment) -> Result<(u64, ( // Determine the number of characters in the program ID. let num_characters = u32::try_from(program_id.name().to_string().len())?; // Compute the number of combined constraints in the program. - let num_constraints = deployment.num_combined_constraints()?; + let num_combined_constraints = deployment.num_combined_constraints()?; // Compute the storage cost in microcredits. let storage_cost = size_in_bytes .checked_mul(N::DEPLOYMENT_FEE_MULTIPLIER) .ok_or(anyhow!("The storage cost computation overflowed for a deployment"))?; + // Compute the synthesis cost in microcredits. + let synthesis_cost = num_combined_constraints * N::SYNTHESIS_FEE_MULTIPLIER; + // Compute the namespace cost in credits: 10^(10 - num_characters). let namespace_cost = 10u64 .checked_pow(10u32.saturating_sub(num_characters)) .ok_or(anyhow!("The namespace cost computation overflowed for a deployment"))? .saturating_mul(1_000_000); // 1 microcredit = 1e-6 credits. - // Compute the synthesis cost in microcredits. - let synthesis_cost = num_constraints * N::SYNTHESIS_FEE_MULTIPLIER; - // Compute the total cost in microcredits. let total_cost = storage_cost - .checked_add(namespace_cost) - .and_then(|x| x.checked_add(synthesis_cost)) + .checked_add(synthesis_cost) + .and_then(|x| x.checked_add(namespace_cost)) .ok_or(anyhow!("The total cost computation overflowed for a deployment"))?; - Ok((total_cost, (storage_cost, namespace_cost))) + Ok((total_cost, (storage_cost, synthesis_cost, namespace_cost))) } -/// Returns the *minimum* cost in microcredits to publish the given execution (total cost, (storage cost, namespace cost)). +/// Returns the *minimum* cost in microcredits to publish the given execution (total cost, (storage cost, finalize cost)). pub fn execution_cost>( vm: &VM, execution: &Execution, diff --git a/synthesizer/src/vm/verify.rs b/synthesizer/src/vm/verify.rs index e1a7c05330..6fc47523a5 100644 --- a/synthesizer/src/vm/verify.rs +++ b/synthesizer/src/vm/verify.rs @@ -145,7 +145,7 @@ impl> VM { let Ok(deployment_id) = deployment.to_deployment_id() else { bail!("Failed to compute the Merkle root for deployment transaction '{id}'") }; - // Compute the deployment cost. + // Compute the minimum deployment cost. let (cost, _) = deployment_cost(deployment)?; // Ensure the fee is sufficient to cover the cost. if *fee.base_amount()? < cost { From 5d0c2da4a54f98b01a912b3f37cfafa7b6512cf6 Mon Sep 17 00:00:00 2001 From: Howard Wu <9260812+howardwu@users.noreply.github.com> Date: Sun, 21 Jan 2024 13:41:38 -0800 Subject: [PATCH 222/298] Add enforcement that the number of synthesized constraints matches the declared count --- synthesizer/process/src/stack/execute.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/synthesizer/process/src/stack/execute.rs b/synthesizer/process/src/stack/execute.rs index 11954e54f0..b0c6a37a0d 100644 --- a/synthesizer/process/src/stack/execute.rs +++ b/synthesizer/process/src/stack/execute.rs @@ -421,7 +421,15 @@ impl StackExecute for Stack { lap!(timer, "Save the transition"); } // If the circuit is in `CheckDeployment` mode, then save the assignment. - else if let CallStack::CheckDeployment(_, _, ref assignments, _) = registers.call_stack() { + else if let CallStack::CheckDeployment(_, _, ref assignments, constraint_limit) = registers.call_stack() { + // Ensure the assignment matches the constraint limit. + if let Some(constraint_limit) = constraint_limit { + ensure!( + assignment.num_constraints() == constraint_limit, + "The synthesized number of constraints ({}) does not match the declared limit in the verifying key ({constraint_limit})", + assignment.num_constraints(), + ); + } // Construct the call metrics. let metrics = CallMetrics { program_id: *self.program_id(), From 53ab9f18100fb2a1633771cd56db246ec8d003c0 Mon Sep 17 00:00:00 2001 From: Howard Wu <9260812+howardwu@users.noreply.github.com> Date: Sun, 21 Jan 2024 13:50:26 -0800 Subject: [PATCH 223/298] Fix size_in_bytes computation --- console/program/src/data/literal/mod.rs | 3 ++- .../data/literal/{size.rs => size_in_bits.rs} | 5 ---- .../program/src/data/literal/size_in_bytes.rs | 26 +++++++++++++++++++ 3 files changed, 28 insertions(+), 6 deletions(-) rename console/program/src/data/literal/{size.rs => size_in_bits.rs} (92%) create mode 100644 console/program/src/data/literal/size_in_bytes.rs diff --git a/console/program/src/data/literal/mod.rs b/console/program/src/data/literal/mod.rs index df74c18763..62777da9d8 100644 --- a/console/program/src/data/literal/mod.rs +++ b/console/program/src/data/literal/mod.rs @@ -23,7 +23,8 @@ mod from_bits; mod parse; mod sample; mod serialize; -mod size; +mod size_in_bits; +mod size_in_bytes; mod to_bits; mod to_type; mod variant; diff --git a/console/program/src/data/literal/size.rs b/console/program/src/data/literal/size_in_bits.rs similarity index 92% rename from console/program/src/data/literal/size.rs rename to console/program/src/data/literal/size_in_bits.rs index 4f3c97d833..b07ac4083e 100644 --- a/console/program/src/data/literal/size.rs +++ b/console/program/src/data/literal/size_in_bits.rs @@ -41,9 +41,4 @@ impl Literal { }; u16::try_from(size).or_halt_with::("Literal exceeds u16::MAX bits.") } - - /// Return the size in bytes of this literal. - pub fn size_in_bytes(&self) -> u16 { - self.size_in_bits().saturating_add(7).saturating_div(8) - } } diff --git a/console/program/src/data/literal/size_in_bytes.rs b/console/program/src/data/literal/size_in_bytes.rs new file mode 100644 index 0000000000..cc3a434ec1 --- /dev/null +++ b/console/program/src/data/literal/size_in_bytes.rs @@ -0,0 +1,26 @@ +// Copyright (C) 2019-2023 Aleo Systems Inc. +// This file is part of the snarkVM library. + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at: +// http://www.apache.org/licenses/LICENSE-2.0 + +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +use super::*; + +impl Literal { + /// Returns the size in bytes of this literal. + #[allow(clippy::cast_possible_truncation)] + pub fn size_in_bytes(&self) -> u16 { + // Note: This upcast to u32 and downcast to u16 is safe because the size of a literal is + // always less than or equal to u16::MAX bits, and we are dividing by 8, so the result will + // always fit in a u16. + (((self.size_in_bits() as u32) + 7) / 8) as u16 + } +} From 40e29a7582dc50e1585dd1ba23878767558bbf04 Mon Sep 17 00:00:00 2001 From: Howard Wu <9260812+howardwu@users.noreply.github.com> Date: Sun, 21 Jan 2024 13:58:43 -0800 Subject: [PATCH 224/298] Fix size_in_bytes_computation 2 --- .../src/data_types/literal_type/mod.rs | 3 +- .../literal_type/{size.rs => size_in_bits.rs} | 11 ++------ .../data_types/literal_type/size_in_bytes.rs | 28 +++++++++++++++++++ 3 files changed, 33 insertions(+), 9 deletions(-) rename console/program/src/data_types/literal_type/{size.rs => size_in_bits.rs} (79%) create mode 100644 console/program/src/data_types/literal_type/size_in_bytes.rs diff --git a/console/program/src/data_types/literal_type/mod.rs b/console/program/src/data_types/literal_type/mod.rs index 5032fd7e91..d6ddf2f5a0 100644 --- a/console/program/src/data_types/literal_type/mod.rs +++ b/console/program/src/data_types/literal_type/mod.rs @@ -15,7 +15,8 @@ mod bytes; mod parse; mod serialize; -mod size; +mod size_in_bits; +mod size_in_bytes; use snarkvm_console_account::Signature; use snarkvm_console_network::prelude::*; diff --git a/console/program/src/data_types/literal_type/size.rs b/console/program/src/data_types/literal_type/size_in_bits.rs similarity index 79% rename from console/program/src/data_types/literal_type/size.rs rename to console/program/src/data_types/literal_type/size_in_bits.rs index bdb137095a..19db4593a7 100644 --- a/console/program/src/data_types/literal_type/size.rs +++ b/console/program/src/data_types/literal_type/size_in_bits.rs @@ -15,8 +15,9 @@ use super::*; impl LiteralType { - /// Returns the number of bits of this literal. In the case of a string literal this will return - /// the maximum number of bits that can be stored in a string. + /// Returns the number of bits of this literal type. + /// + /// For string literals, this method returns the maximum number of bits that can be stored in the string. pub fn size_in_bits(&self) -> u16 { let size = match self { Self::Address => Address::::size_in_bits(), @@ -39,10 +40,4 @@ impl LiteralType { }; u16::try_from(size).or_halt_with::("Literal exceeds u16::MAX bits.") } - - /// Returns the number of bytes of this literal. In the case of a string literal this will return - /// the maximum number of bytes that can be stored in a string. - pub fn size_in_bytes(&self) -> u16 { - self.size_in_bits::().saturating_add(7).saturating_div(8) - } } diff --git a/console/program/src/data_types/literal_type/size_in_bytes.rs b/console/program/src/data_types/literal_type/size_in_bytes.rs new file mode 100644 index 0000000000..2862b0f218 --- /dev/null +++ b/console/program/src/data_types/literal_type/size_in_bytes.rs @@ -0,0 +1,28 @@ +// Copyright (C) 2019-2023 Aleo Systems Inc. +// This file is part of the snarkVM library. + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at: +// http://www.apache.org/licenses/LICENSE-2.0 + +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +use super::*; + +impl LiteralType { + /// Returns the number of bytes of this literal. + /// + /// For string literals, this method returns the maximum number of bytes that can be stored in the string. + #[allow(clippy::cast_possible_truncation)] + pub fn size_in_bytes(&self) -> u16 { + // Note: This upcast to u32 and downcast to u16 is safe because the size of a literal is + // always less than or equal to u16::MAX bits, and we are dividing by 8, so the result will + // always fit in a u16. + (((self.size_in_bits::() as u32) + 7) / 8) as u16 + } +} From d848aa4b50bcbbf907dded029d5a8a71a4ec25c4 Mon Sep 17 00:00:00 2001 From: raychu86 <14917648+raychu86@users.noreply.github.com> Date: Sun, 21 Jan 2024 16:11:35 -0800 Subject: [PATCH 225/298] Abort transactions that attempt to create a duplicate tpk --- synthesizer/src/vm/finalize.rs | 16 ++++++++++++++++ synthesizer/src/vm/mod.rs | 2 +- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/synthesizer/src/vm/finalize.rs b/synthesizer/src/vm/finalize.rs index 152ceceb5d..018bc781dd 100644 --- a/synthesizer/src/vm/finalize.rs +++ b/synthesizer/src/vm/finalize.rs @@ -227,6 +227,8 @@ impl> VM { let mut input_ids: IndexSet> = IndexSet::new(); // Initialize a list of created output IDs. let mut output_ids: IndexSet> = IndexSet::new(); + // Initialize the list of created transition public keys. + let mut tpks: IndexSet> = IndexSet::new(); // Finalize the transactions. 'outer: for transaction in transactions { @@ -278,6 +280,18 @@ impl> VM { } } + // // Ensure that the transaction is not producing a duplicate transition public key. + // // Note that the tpk and tcm are corresponding, so a uniqueness check for just the tpk is sufficient. + for tpk in transaction.transition_public_keys() { + // If the transition public key is already produced in this block or previous blocks, abort the transaction. + if tpks.contains(tpk) || self.transition_store().contains_tpk(tpk).unwrap_or(true) { + // Store the aborted transaction. + aborted.push((transaction.clone(), format!("Duplicate transition public key {tpk}"))); + // Continue to the next transaction. + continue 'outer; + } + } + // Process the transaction in an isolated atomic batch. // - If the transaction succeeds, the finalize operations are stored. // - If the transaction fails, the atomic batch is aborted and no finalize operations are stored. @@ -397,6 +411,8 @@ impl> VM { input_ids.extend(confirmed_transaction.transaction().input_ids()); // Add the output IDs to the set of produced output IDs. output_ids.extend(confirmed_transaction.transaction().output_ids()); + // Add the transition public keys to the set of produced transition public keys. + tpks.extend(confirmed_transaction.transaction().transition_public_keys()); // Store the confirmed transaction. confirmed.push(confirmed_transaction); // Increment the transaction index counter. diff --git a/synthesizer/src/vm/mod.rs b/synthesizer/src/vm/mod.rs index a9e29d1594..ab8811708b 100644 --- a/synthesizer/src/vm/mod.rs +++ b/synthesizer/src/vm/mod.rs @@ -26,7 +26,7 @@ use console::{ account::{Address, PrivateKey}, network::prelude::*, program::{Identifier, Literal, Locator, Plaintext, ProgramID, ProgramOwner, Record, Value}, - types::{Field, U64}, + types::{Field, Group, U64}, }; use ledger_block::{ Block, From 9bee2ab82413c6f7d92a0deb2e60cee1a6fcc2fd Mon Sep 17 00:00:00 2001 From: raychu86 <14917648+raychu86@users.noreply.github.com> Date: Sun, 21 Jan 2024 16:11:52 -0800 Subject: [PATCH 226/298] Add test for duplicate tpk --- ledger/src/tests.rs | 137 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 137 insertions(+) diff --git a/ledger/src/tests.rs b/ledger/src/tests.rs index 8e2feda956..be9c3a9da7 100644 --- a/ledger/src/tests.rs +++ b/ledger/src/tests.rs @@ -1029,6 +1029,143 @@ function empty_function: assert_eq!(block.aborted_transaction_ids(), &vec![transaction_3_id]); } +#[test] +fn test_execute_duplicate_transition_public_keys() { + let rng = &mut TestRng::default(); + + // Initialize the test environment. + let crate::test_helpers::TestEnv { ledger, private_key, address, .. } = crate::test_helpers::sample_test_env(rng); + + // Deploy a test program to the ledger. + let program = Program::::from_str( + " +program dummy_program.aleo; + +function empty_function: + +function simple_output: + output 1u64 as u64.public; + ", + ) + .unwrap(); + + // Deploy. + let deployment_transaction = ledger.vm.deploy(&private_key, &program, None, 0, None, rng).unwrap(); + // Verify. + ledger.vm().check_transaction(&deployment_transaction, None, rng).unwrap(); + + // Construct the next block. + let block = ledger + .prepare_advance_to_next_beacon_block(&private_key, vec![], vec![], vec![deployment_transaction], rng) + .unwrap(); + + // Check that the next block is valid. + ledger.check_next_block(&block, rng).unwrap(); + // Add the block to the ledger. + ledger.advance_to_next_block(&block).unwrap(); + + // Create a transaction with different transaction ids, but with a TPK. + let mut create_transaction_with_duplicate_tpk = |function: &str| -> Transaction { + // Use a fixed seed RNG. + let fixed_rng = &mut TestRng::from_seed(1); + + // Create a transaction with a fixed rng. + let inputs: [Value<_>; 0] = []; + let transaction = ledger + .vm + .execute(&private_key, ("dummy_program.aleo", function), inputs.into_iter(), None, 0, None, fixed_rng) + .unwrap(); + // Extract the execution. + let execution = transaction.execution().unwrap().clone(); + + // Create a new fee for the execution. + let fee_authorization = ledger + .vm + .authorize_fee_public( + &private_key, + *transaction.fee_amount().unwrap(), + 0, + execution.to_execution_id().unwrap(), + rng, + ) + .unwrap(); + let fee = ledger.vm.execute_fee_authorization(fee_authorization, None, rng).unwrap(); + + Transaction::from_execution(execution, Some(fee)).unwrap() + }; + + // Create the first transaction. + let transaction_1 = create_transaction_with_duplicate_tpk("empty_function"); + let transaction_1_id = transaction_1.id(); + + // Create a second transaction with the same tpk and tcm. + let transaction_2 = create_transaction_with_duplicate_tpk("simple_output"); + let transaction_2_id = transaction_2.id(); + + // Create a third transaction with the same tpk and tcm. + let transaction_3 = create_transaction_with_duplicate_tpk("simple_output"); + let transaction_3_id = transaction_3.id(); + + // Ensure that each transaction has a duplicate tcm and tpk. + let tx_1_tpk = transaction_1.transitions().next().unwrap().tpk(); + let tx_2_tpk = transaction_2.transitions().next().unwrap().tpk(); + let tx_3_tpk = transaction_3.transitions().next().unwrap().tpk(); + assert_eq!(tx_1_tpk, tx_2_tpk); + assert_eq!(tx_1_tpk, tx_3_tpk); + + let tx_1_tcm = transaction_1.transitions().next().unwrap().tcm(); + let tx_2_tcm = transaction_2.transitions().next().unwrap().tcm(); + let tx_3_tcm = transaction_3.transitions().next().unwrap().tcm(); + assert_eq!(tx_1_tcm, tx_2_tcm); + assert_eq!(tx_1_tcm, tx_3_tcm); + + // Create a block. + let block = ledger + .prepare_advance_to_next_beacon_block(&private_key, vec![], vec![], vec![transaction_1, transaction_2], rng) + .unwrap(); + + // Check that the next block is valid. + ledger.check_next_block(&block, rng).unwrap(); + + // Add the block to the ledger. + ledger.advance_to_next_block(&block).unwrap(); + + // Enforce that the block transactions were correct. + assert_eq!(block.transactions().num_accepted(), 1); + assert_eq!(block.transactions().transaction_ids().collect::>(), vec![&transaction_1_id]); + assert_eq!(block.aborted_transaction_ids(), &vec![transaction_2_id]); + + // Prepare a transfer that will succeed for the subsequent block. + let inputs = [Value::from_str(&format!("{address}")).unwrap(), Value::from_str("1000u64").unwrap()]; + let transfer_transaction = ledger + .vm + .execute(&private_key, ("credits.aleo", "transfer_public"), inputs.into_iter(), None, 0, None, rng) + .unwrap(); + let transfer_transaction_id = transfer_transaction.id(); + + // Create a block. + let block = ledger + .prepare_advance_to_next_beacon_block( + &private_key, + vec![], + vec![], + vec![transaction_3, transfer_transaction], + rng, + ) + .unwrap(); + + // Check that the next block is valid. + ledger.check_next_block(&block, rng).unwrap(); + + // Add the block to the ledger. + ledger.advance_to_next_block(&block).unwrap(); + + // Enforce that the block transactions were correct. + assert_eq!(block.transactions().num_accepted(), 1); + assert_eq!(block.transactions().transaction_ids().collect::>(), vec![&transfer_transaction_id]); + assert_eq!(block.aborted_transaction_ids(), &vec![transaction_3_id]); +} + #[test] fn test_deployment_duplicate_program_id() { let rng = &mut TestRng::default(); From 01b95d213e97514364387f23981f2e9814ac7506 Mon Sep 17 00:00:00 2001 From: Victor Sint Nicolaas Date: Sun, 21 Jan 2024 17:35:42 -0800 Subject: [PATCH 227/298] WIP: scaffolding for testing vk manipulation --- synthesizer/src/vm/mod.rs | 126 +++++++++++++++++++++++++++++++++++++- 1 file changed, 125 insertions(+), 1 deletion(-) diff --git a/synthesizer/src/vm/mod.rs b/synthesizer/src/vm/mod.rs index 70469befc1..c4f8108981 100644 --- a/synthesizer/src/vm/mod.rs +++ b/synthesizer/src/vm/mod.rs @@ -374,6 +374,7 @@ pub(crate) mod test_helpers { use indexmap::IndexMap; use once_cell::sync::OnceCell; use std::borrow::Borrow; + use synthesizer_snark::VerifyingKey; pub(crate) type CurrentNetwork = Testnet3; @@ -1100,7 +1101,7 @@ function check: // Deploy the base program. let program = Program::from_str( r" -program program_layer_0.aleo; +program synthesis_overload.aleo; function do: input r0 as [[u128; 32u32]; 2u32].private; @@ -1116,6 +1117,129 @@ function do: assert!(vm.check_transaction(&deployment, None, rng).is_err()); } + #[test] + fn test_deployment_synthesis_overreport() { + let rng = &mut TestRng::default(); + + // Initialize a private key. + let private_key = sample_genesis_private_key(rng); + + // Initialize the genesis block. + let genesis = sample_genesis_block(rng); + + // Initialize the VM. + let vm = sample_vm(); + // Update the VM. + vm.add_next_block(&genesis).unwrap(); + + // Deploy the base program. + let program = Program::from_str( + r" +program synthesis_overreport.aleo; + +function do: + input r0 as u32.private; + add r0 r0 into r1; + output r1 as u32.public;", + ) + .unwrap(); + + // Create the deployment transaction. + let transaction = vm.deploy(&private_key, &program, None, 0, None, rng).unwrap(); + + // Destructure the deployment transaction. + let Transaction::Deploy(txid, program_owner, deployment, fee) = transaction else { + panic!("Expected a deployment transaction"); + }; + + // Increase the number of constraints in the verifying keys. + let mut vks_with_overreport = Vec::with_capacity(deployment.verifying_keys().len()); + for (id, (vk, cert)) in deployment.verifying_keys() { + let mut vk = vk.deref().clone(); + vk.circuit_info.num_constraints += 1; + let vk = VerifyingKey::new(Arc::new(vk)); + vks_with_overreport.push((*id, (vk, cert.clone()))); + } + + // Compute the required fee. + let required_fee = *fee.base_amount().unwrap() + 1000; // TODO: calculate exact + // Authorize a new fee. + let fee_authorization = vm + .authorize_fee_public(&private_key, required_fee, 0, deployment.as_ref().to_deployment_id().unwrap(), rng) + .unwrap(); + // Compute the fee. + let fee = vm.execute_fee_authorization(fee_authorization, None, rng).unwrap(); + + // Create a new deployment tranasction with the overreported verifying keys. + let adjusted_deployment = + Deployment::new(deployment.edition(), deployment.program().clone(), vks_with_overreport).unwrap(); + let adjusted_transaction = Transaction::Deploy(txid, program_owner, Box::new(adjusted_deployment), fee); + + // Verify the deployment transaction. It should fail because the num_constraints in the vk are not correct. + let res = vm.check_transaction(&adjusted_transaction, None, rng); + println!("Result of check transaction: {:?}", res); + assert!(vm.check_transaction(&adjusted_transaction, None, rng).is_err()); + + println!("Test if we reach this code"); + } + + #[test] + fn test_deployment_synthesis_underreport() { + let rng = &mut TestRng::default(); + + // Initialize a private key. + let private_key = sample_genesis_private_key(rng); + + // Initialize the genesis block. + let genesis = sample_genesis_block(rng); + + // Initialize the VM. + let vm = sample_vm(); + // Update the VM. + vm.add_next_block(&genesis).unwrap(); + + // Deploy the base program. + let program = Program::from_str( + r" +program synthesis_overreport.aleo; + +function do: + input r0 as u32.private; + add r0 r0 into r1; + output r1 as u32.public;", + ) + .unwrap(); + + // Create the deployment transaction. + let transaction = vm.deploy(&private_key, &program, None, 0, None, rng).unwrap(); + + // Destructure the deployment transaction. + let Transaction::Deploy(txid, program_owner, deployment, fee) = transaction else { + panic!("Expected a deployment transaction"); + }; + + // Decrease the number of constraints in the verifying keys. + let mut vks_with_underreport = Vec::with_capacity(deployment.verifying_keys().len()); + for (id, (vk, cert)) in deployment.verifying_keys() { + let mut vk = vk.deref().clone(); + vk.circuit_info.num_constraints -= 1; + let vk = VerifyingKey::new(Arc::new(vk)); + vks_with_underreport.push((*id, (vk, cert.clone()))); + } + + // Create a new deployment tranasction with the underreported verifying keys. + let adjusted_deployment = + Deployment::new(deployment.edition(), deployment.program().clone(), vks_with_underreport).unwrap(); + let adjusted_transaction = Transaction::Deploy(txid, program_owner, Box::new(adjusted_deployment), fee); + + // Verify the deployment transaction. It should fail because the num_constraints in the vk are not correct. + let res = vm.check_transaction(&adjusted_transaction, None, rng); + println!("Result of check transaction: {:?}", res); + assert!(vm.check_transaction(&adjusted_transaction, None, rng).is_err()); + + println!("Test if we reach this code"); + } + #[test] #[ignore] fn test_deployment_memory_overload() { From 8257ea3240d2b9eb90dbb0738af23c28c6549cb2 Mon Sep 17 00:00:00 2001 From: Pranav Gaddamadugu <23022326+d0cd@users.noreply.github.com> Date: Mon, 22 Jan 2024 16:25:57 -0800 Subject: [PATCH 228/298] Restrict identifiers from being LiteralTypes --- console/program/src/data/identifier/parse.rs | 6 ++++++ console/program/src/data_types/plaintext_type/parse.rs | 6 +++++- console/program/src/data_types/register_type/parse.rs | 4 ++++ console/program/src/data_types/value_type/parse.rs | 4 ++++ 4 files changed, 19 insertions(+), 1 deletion(-) diff --git a/console/program/src/data/identifier/parse.rs b/console/program/src/data/identifier/parse.rs index 94de468b24..4d2673dd1f 100644 --- a/console/program/src/data/identifier/parse.rs +++ b/console/program/src/data/identifier/parse.rs @@ -52,6 +52,12 @@ impl FromStr for Identifier { bail!("Identifier is too large. Identifiers must be <= {max_bytes} bytes long") } + // Ensure that the identifier is not a literal. + ensure!( + crate::LiteralType::from_str(identifier).is_err(), + "Identifier '{identifier}' is a reserved literal type" + ); + // Note: The string bytes themselves are **not** little-endian. Rather, they are order-preserving // for reconstructing the string when recovering the field element back into bytes. Ok(Self( diff --git a/console/program/src/data_types/plaintext_type/parse.rs b/console/program/src/data_types/plaintext_type/parse.rs index 21474fc5e6..d1a0634019 100644 --- a/console/program/src/data_types/plaintext_type/parse.rs +++ b/console/program/src/data_types/plaintext_type/parse.rs @@ -21,8 +21,8 @@ impl Parser for PlaintextType { // Parse to determine the plaintext type (order matters). alt(( map(ArrayType::parse, |type_| Self::Array(type_)), - map(LiteralType::parse, |type_| Self::Literal(type_)), map(Identifier::parse, |identifier| Self::Struct(identifier)), + map(LiteralType::parse, |type_| Self::Literal(type_)), ))(string) } } @@ -86,6 +86,10 @@ mod tests { PlaintextType::parse("foo"), Ok(("", PlaintextType::::Struct(Identifier::from_str("foo")?))) ); + assert_eq!( + PlaintextType::parse("u8jdsklaj"), + Ok(("", PlaintextType::::Struct(Identifier::from_str("u8jdsklaj")?))) + ); assert_eq!( PlaintextType::parse("[field; 1u32]"), Ok(("", PlaintextType::::Array(ArrayType::from_str("[field; 1u32]")?))) diff --git a/console/program/src/data_types/register_type/parse.rs b/console/program/src/data_types/register_type/parse.rs index ec4bbcef58..9b70a48ecf 100644 --- a/console/program/src/data_types/register_type/parse.rs +++ b/console/program/src/data_types/register_type/parse.rs @@ -88,6 +88,10 @@ mod tests { Ok(("", RegisterType::::Plaintext(PlaintextType::from_str("signature")?))), RegisterType::::parse("signature") ); + assert_eq!( + Ok(("", RegisterType::::Plaintext(PlaintextType::from_str("u8kldsafj")?))), + RegisterType::::parse("u8kldsafj") + ); // Record type. assert_eq!( diff --git a/console/program/src/data_types/value_type/parse.rs b/console/program/src/data_types/value_type/parse.rs index a9198179d4..6b98fd2b49 100644 --- a/console/program/src/data_types/value_type/parse.rs +++ b/console/program/src/data_types/value_type/parse.rs @@ -105,6 +105,10 @@ mod tests { Ok(("", ValueType::::from_str("signature.private")?)), ValueType::::parse("signature.private") ); + assert_eq!( + Ok(("", ValueType::::from_str("i8abc.constant")?)), + ValueType::::parse("i8abc.constant") + ); // Record type. assert_eq!( From be9e65361842aacfa9cd6cfb5e405aa47c349199 Mon Sep 17 00:00:00 2001 From: ljedrz Date: Mon, 22 Jan 2024 11:29:30 +0100 Subject: [PATCH 229/298] perf: inline an additional method Signed-off-by: ljedrz --- curves/src/templates/twisted_edwards_extended/affine.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/curves/src/templates/twisted_edwards_extended/affine.rs b/curves/src/templates/twisted_edwards_extended/affine.rs index dc8cf8d41f..d850729e4b 100644 --- a/curves/src/templates/twisted_edwards_extended/affine.rs +++ b/curves/src/templates/twisted_edwards_extended/affine.rs @@ -180,6 +180,7 @@ impl AffineCurve for Affine

{ }) } + #[inline] fn mul_bits(&self, bits: impl Iterator) -> Projective

{ let mut res = Projective::zero(); for i in bits { From 52fe2afae063b8a85577e3c11c283e9220f59ba2 Mon Sep 17 00:00:00 2001 From: ljedrz Date: Mon, 22 Jan 2024 11:54:51 +0100 Subject: [PATCH 230/298] perf: improve the deserialization of plain bytes Signed-off-by: ljedrz --- console/program/src/data/future/bytes.rs | 3 ++- console/program/src/data/plaintext/bytes.rs | 6 ++++-- console/program/src/data/record/bytes.rs | 3 ++- ledger/narwhal/data/src/lib.rs | 3 ++- 4 files changed, 10 insertions(+), 5 deletions(-) diff --git a/console/program/src/data/future/bytes.rs b/console/program/src/data/future/bytes.rs index 95878055f1..aa6122b4a4 100644 --- a/console/program/src/data/future/bytes.rs +++ b/console/program/src/data/future/bytes.rs @@ -32,7 +32,8 @@ impl FromBytes for Future { // Read the argument (in 2 steps to prevent infinite recursion). let num_bytes = u16::read_le(&mut reader)?; // Read the argument bytes. - let bytes = (0..num_bytes).map(|_| u8::read_le(&mut reader)).collect::, _>>()?; + let mut bytes = Vec::new(); + (&mut reader).take(num_bytes as u64).read_to_end(&mut bytes)?; // Recover the argument. let entry = Argument::read_le(&mut bytes.as_slice())?; // Add the argument. diff --git a/console/program/src/data/plaintext/bytes.rs b/console/program/src/data/plaintext/bytes.rs index 99cdd82ed4..8fa2f1dba1 100644 --- a/console/program/src/data/plaintext/bytes.rs +++ b/console/program/src/data/plaintext/bytes.rs @@ -33,7 +33,8 @@ impl FromBytes for Plaintext { // Read the plaintext value (in 2 steps to prevent infinite recursion). let num_bytes = u16::read_le(&mut reader)?; // Read the plaintext bytes. - let bytes = (0..num_bytes).map(|_| u8::read_le(&mut reader)).collect::, _>>()?; + let mut bytes = Vec::new(); + (&mut reader).take(num_bytes as u64).read_to_end(&mut bytes)?; // Recover the plaintext value. let plaintext = Plaintext::read_le(&mut bytes.as_slice())?; // Add the member. @@ -54,7 +55,8 @@ impl FromBytes for Plaintext { // Read the plaintext value (in 2 steps to prevent infinite recursion). let num_bytes = u16::read_le(&mut reader)?; // Read the plaintext bytes. - let bytes = (0..num_bytes).map(|_| u8::read_le(&mut reader)).collect::, _>>()?; + let mut bytes = Vec::new(); + (&mut reader).take(num_bytes as u64).read_to_end(&mut bytes)?; // Recover the plaintext value. let plaintext = Plaintext::read_le(&mut bytes.as_slice())?; // Add the element. diff --git a/console/program/src/data/record/bytes.rs b/console/program/src/data/record/bytes.rs index a787040499..6b4bcc0687 100644 --- a/console/program/src/data/record/bytes.rs +++ b/console/program/src/data/record/bytes.rs @@ -29,7 +29,8 @@ impl FromBytes for Record { // Read the entry value (in 2 steps to prevent infinite recursion). let num_bytes = u16::read_le(&mut reader)?; // Read the entry bytes. - let bytes = (0..num_bytes).map(|_| u8::read_le(&mut reader)).collect::, _>>()?; + let mut bytes = Vec::new(); + (&mut reader).take(num_bytes as u64).read_to_end(&mut bytes)?; // Recover the entry value. let entry = Entry::read_le(&mut bytes.as_slice())?; // Add the entry. diff --git a/ledger/narwhal/data/src/lib.rs b/ledger/narwhal/data/src/lib.rs index 76b7ccd1d5..352566e13f 100644 --- a/ledger/narwhal/data/src/lib.rs +++ b/ledger/narwhal/data/src/lib.rs @@ -119,7 +119,8 @@ impl FromBytes for Data { return Err(error(format!("Failed to deserialize data ({num_bytes} bytes)"))); } // Read the bytes. - let bytes = (0..num_bytes).map(|_| u8::read_le(&mut reader)).collect::>>()?; + let mut bytes = Vec::new(); + (&mut reader).take(num_bytes as u64).read_to_end(&mut bytes)?; // Return the data. Ok(Self::Buffer(Bytes::from(bytes))) } From f3d370bff33f80cd30c0ea3202521add07f80be7 Mon Sep 17 00:00:00 2001 From: ljedrz Date: Mon, 22 Jan 2024 12:17:55 +0100 Subject: [PATCH 231/298] perf: serialize Data objects in a more amortized fashion Signed-off-by: ljedrz --- ledger/narwhal/data/src/lib.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ledger/narwhal/data/src/lib.rs b/ledger/narwhal/data/src/lib.rs index 352566e13f..5067f44acc 100644 --- a/ledger/narwhal/data/src/lib.rs +++ b/ledger/narwhal/data/src/lib.rs @@ -135,9 +135,9 @@ impl ToBytes for Data { // Write the data. match self { Self::Object(object) => { - // FIXME(ljedrz): see if we can omit this intermediate allocation. - let mut buffer = Vec::new(); - object.write_le(&mut buffer)?; + // Serialize the object. + let buffer = + object.to_bytes_le().map_err(|err| error(format!("Failed to serialize a Data::Object: {err}")))?; // Write the object. u32::try_from(buffer.len()).map_err(error)?.write_le(&mut writer)?; // Write the object. From 8e728bf25387a3a8c7acdd8281c22724c254887a Mon Sep 17 00:00:00 2001 From: ljedrz Date: Mon, 22 Jan 2024 13:07:10 +0100 Subject: [PATCH 232/298] perf: reduce the allocations in sqrt_impl Signed-off-by: ljedrz --- fields/src/macros.rs | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/fields/src/macros.rs b/fields/src/macros.rs index 8084e7c218..493745348a 100644 --- a/fields/src/macros.rs +++ b/fields/src/macros.rs @@ -104,12 +104,12 @@ macro_rules! sqrt_impl { let l_minus_one_times_k = n - 1 - k_2; let l_minus_one = l_minus_one_times_k / k; let l = l_minus_one + 1; - let mut l_s: Vec = Vec::with_capacity(k as usize); - l_s.resize(l_s.len() + k_1 as usize, l_minus_one); - l_s.resize(l_s.len() + k_2 as usize, l); + + let l_s = + || std::iter::repeat(l_minus_one).take(k_1 as usize).chain(std::iter::repeat(l).take(k_2 as usize)); let mut l_sum = 0; - let x_s = l_s.iter().take((k as usize) - 1).map(|l| { + let x_s = l_s().take((k as usize) - 1).map(|l| { l_sum += l; x.pow(BigInteger::from(2u64.pow((n - 1 - l_sum) as u32))) }); @@ -140,20 +140,16 @@ macro_rules! sqrt_impl { s }; - let calculate_kappa = |i: usize, j: usize, l_s: &[u64]| -> u64 { - l_s.iter().take(j).sum::() + 1 + l_s.iter().skip(i + 1).sum::() - }; - let calculate_gamma = |i: usize, q_s: &[u64], last: bool| -> $Self { let mut gamma = $Self::one(); if i != 0 { - q_s.iter().zip(l_s.iter()).enumerate().for_each(|(j, (q, l))| { - let mut kappa = calculate_kappa(i, j, &l_s); + q_s.iter().zip(l_s()).enumerate().for_each(|(j, (q, l))| { + let mut kappa = l_s().take(j).sum::() + 1 + l_s().skip(i + 1).sum::(); if last { kappa -= 1; } let mut value = *q; - (0..*l as usize).for_each(|k| { + (0..l as usize).for_each(|k| { let bit = value & 1 == 1; if bit { gamma *= $Self($P::POWERS_OF_ROOTS_OF_UNITY[(kappa as usize) + k], PhantomData); From fe137ba017c34a16201fd4670839cd4928a3ff66 Mon Sep 17 00:00:00 2001 From: ljedrz Date: Mon, 22 Jan 2024 14:08:11 +0100 Subject: [PATCH 233/298] perf: use SmallVec::into_vec instead of ::to_vec in Poseidon::hash_many Signed-off-by: ljedrz --- console/algorithms/src/poseidon/hash_many.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/console/algorithms/src/poseidon/hash_many.rs b/console/algorithms/src/poseidon/hash_many.rs index d87a793348..fa789d900e 100644 --- a/console/algorithms/src/poseidon/hash_many.rs +++ b/console/algorithms/src/poseidon/hash_many.rs @@ -31,6 +31,6 @@ impl HashMany for Poseidon { let mut sponge = PoseidonSponge::::new(&self.parameters); sponge.absorb(&preimage); - sponge.squeeze(num_outputs).to_vec() + sponge.squeeze(num_outputs).into_vec() } } From 519af72e3ccdac72e0d28a3fad71d3768c48e052 Mon Sep 17 00:00:00 2001 From: Pranav Gaddamadugu <23022326+d0cd@users.noreply.github.com> Date: Tue, 23 Jan 2024 09:41:03 -0800 Subject: [PATCH 234/298] Add test --- synthesizer/src/vm/mod.rs | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/synthesizer/src/vm/mod.rs b/synthesizer/src/vm/mod.rs index a9e29d1594..0560186b54 100644 --- a/synthesizer/src/vm/mod.rs +++ b/synthesizer/src/vm/mod.rs @@ -1077,6 +1077,44 @@ function check: assert!(vm.contains_program(&ProgramID::from_str("parent_program.aleo").unwrap())); } + #[test] + fn test_deployment_with_external_records() { + let rng = &mut TestRng::default(); + + // Initialize a private key. + let private_key = sample_genesis_private_key(rng); + + // Initialize the genesis block. + let genesis = sample_genesis_block(rng); + + // Initialize the VM. + let vm = sample_vm(); + // Update the VM. + vm.add_next_block(&genesis).unwrap(); + + // Deploy the program. + let program = Program::from_str( + r" +import credits.aleo; +program test_program.aleo; + +function transfer: + input r0 as credits.aleo/credits.record; + input r1 as u64.private; + input r2 as u64.private; + input r3 as [address; 10u32].private; + call credits.aleo/transfer_private r0 r3[0u32] r1 into r4 r5; + call credits.aleo/transfer_private r5 r3[0u32] r2 into r6 r7; +").unwrap(); + + let deployment = vm.deploy(&private_key, &program, None, 0, None, rng).unwrap(); + assert!(vm.check_transaction(&deployment, None, rng).is_ok()); + vm.add_next_block(&sample_next_block(&vm, &private_key, &[deployment], rng).unwrap()).unwrap(); + + // Check that program is deployed. + assert!(vm.contains_program(&ProgramID::from_str("test_program.aleo").unwrap())); + } + #[test] #[ignore] fn test_deployment_memory_overload() { From ebe4a18bc7921366714dbc99526bf3592c163689 Mon Sep 17 00:00:00 2001 From: Pranav Gaddamadugu <23022326+d0cd@users.noreply.github.com> Date: Tue, 23 Jan 2024 09:58:13 -0800 Subject: [PATCH 235/298] Implement fix --- synthesizer/process/src/stack/call/mod.rs | 27 ++- synthesizer/process/src/stack/helpers/mod.rs | 1 - .../process/src/stack/helpers/sample.rs | 216 ------------------ synthesizer/process/src/stack/mod.rs | 202 +++++++++++++++- .../program/src/traits/stack_and_registers.rs | 10 + synthesizer/src/vm/mod.rs | 4 +- 6 files changed, 238 insertions(+), 222 deletions(-) delete mode 100644 synthesizer/process/src/stack/helpers/sample.rs diff --git a/synthesizer/process/src/stack/call/mod.rs b/synthesizer/process/src/stack/call/mod.rs index 024ca0a9af..b44231295f 100644 --- a/synthesizer/process/src/stack/call/mod.rs +++ b/synthesizer/process/src/stack/call/mod.rs @@ -14,7 +14,11 @@ use crate::{stack::Address, CallStack, Registers, RegistersCall, StackEvaluate, StackExecute}; use aleo_std::prelude::{finish, lap, timer}; -use console::{network::prelude::*, program::Request}; +use console::{ + account::Field, + network::prelude::*, + program::{Register, Request, Value, ValueType}, +}; use synthesizer_program::{ Call, CallOperator, @@ -281,7 +285,26 @@ impl CallTrait for Call { let outputs = function .outputs() .iter() - .map(|output| substack.sample_value(&address, output.value_type(), rng)) + .map(|output| match output.value_type() { + ValueType::Record(record_name) => { + // Get the register index containing the record. + let index = match output.operand() { + Operand::Register(Register::Locator(index)) => Field::from_u64(*index), + _ => bail!("Expected a `Register::Locator` operand for a record output."), + }; + // Compute the encryption randomizer as `HashToScalar(tvk || index)`. + let randomizer = N::hash_to_scalar_psd2(&[*request.tvk(), index])?; + // Construct the record nonce. + let record_nonce = N::g_scalar_multiply(&randomizer); + Ok(Value::Record(substack.sample_record( + &address, + record_name, + record_nonce, + rng, + )?)) + } + _ => substack.sample_value(&address, output.value_type(), rng), + }) .collect::>>()?; // Map the output operands to registers. let output_registers = function diff --git a/synthesizer/process/src/stack/helpers/mod.rs b/synthesizer/process/src/stack/helpers/mod.rs index 2b0884a4df..f7fba4741c 100644 --- a/synthesizer/process/src/stack/helpers/mod.rs +++ b/synthesizer/process/src/stack/helpers/mod.rs @@ -16,5 +16,4 @@ use super::*; mod initialize; mod matches; -mod sample; mod synthesize; diff --git a/synthesizer/process/src/stack/helpers/sample.rs b/synthesizer/process/src/stack/helpers/sample.rs deleted file mode 100644 index c6a2dfe556..0000000000 --- a/synthesizer/process/src/stack/helpers/sample.rs +++ /dev/null @@ -1,216 +0,0 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. -// This file is part of the snarkVM library. - -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at: -// http://www.apache.org/licenses/LICENSE-2.0 - -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -use super::*; - -impl Stack { - /// Returns a record for the given record name, with the given burner address. - pub fn sample_record( - &self, - burner_address: &Address, - record_name: &Identifier, - rng: &mut R, - ) -> Result>> { - // Sample a record. - let record = self.sample_record_internal(burner_address, record_name, 0, rng)?; - // Ensure the record matches the value type. - self.matches_record(&record, record_name)?; - // Return the record. - Ok(record) - } - - /// Samples a plaintext value according to the given plaintext type. - pub fn sample_plaintext( - &self, - plaintext_type: &PlaintextType, - rng: &mut R, - ) -> Result> { - // Sample a plaintext value. - let plaintext = self.sample_plaintext_internal(plaintext_type, 0, rng)?; - // Ensure the plaintext value matches the plaintext type. - self.matches_plaintext(&plaintext, plaintext_type)?; - // Return the plaintext value. - Ok(plaintext) - } - - /// Samples a future value according to the given future type. - pub fn sample_future(&self, locator: &Locator, rng: &mut R) -> Result> { - // Sample a future value. - let future = self.sample_future_internal(locator, 0, rng)?; - // Ensure the future value matches the future type. - self.matches_future(&future, locator)?; - // Return the future value. - Ok(future) - } -} - -impl Stack { - /// Returns a record for the given record name. - fn sample_record_internal( - &self, - burner_address: &Address, - record_name: &Identifier, - depth: usize, - rng: &mut R, - ) -> Result>> { - // If the depth exceeds the maximum depth, then the plaintext type is invalid. - ensure!(depth <= N::MAX_DATA_DEPTH, "Plaintext exceeded maximum depth of {}", N::MAX_DATA_DEPTH); - - // Retrieve the record type from the program. - let record_type = self.program.get_record(record_name)?; - - // Initialize the owner based on the visibility. - let owner = match record_type.owner().is_public() { - true => RecordOwner::Public(*burner_address), - false => RecordOwner::Private(Plaintext::Literal(Literal::Address(*burner_address), Default::default())), - }; - - // Initialize the record data according to the defined type. - let data = record_type - .entries() - .iter() - .map(|(entry_name, entry_type)| { - // Sample the entry value. - let entry = self.sample_entry_internal(entry_type, depth + 1, rng)?; - // Return the entry. - Ok((*entry_name, entry)) - }) - .collect::>>()?; - - // Initialize the nonce. - let nonce = Group::rand(rng); - - // Return the record. - Record::>::from_plaintext(owner, data, nonce) - } - - /// Samples an entry according to the given entry type. - fn sample_entry_internal( - &self, - entry_type: &EntryType, - depth: usize, - rng: &mut R, - ) -> Result>> { - // If the depth exceeds the maximum depth, then the entry type is invalid. - ensure!(depth <= N::MAX_DATA_DEPTH, "Entry exceeded maximum depth of {}", N::MAX_DATA_DEPTH); - - match entry_type { - EntryType::Constant(plaintext_type) - | EntryType::Public(plaintext_type) - | EntryType::Private(plaintext_type) => { - // Sample the plaintext value. - let plaintext = self.sample_plaintext_internal(plaintext_type, depth, rng)?; - // Return the entry. - match entry_type { - EntryType::Constant(..) => Ok(Entry::Constant(plaintext)), - EntryType::Public(..) => Ok(Entry::Public(plaintext)), - EntryType::Private(..) => Ok(Entry::Private(plaintext)), - } - } - } - } - - /// Samples a plaintext value according to the given plaintext type. - fn sample_plaintext_internal( - &self, - plaintext_type: &PlaintextType, - depth: usize, - rng: &mut R, - ) -> Result> { - // If the depth exceeds the maximum depth, then the plaintext type is invalid. - ensure!(depth <= N::MAX_DATA_DEPTH, "Plaintext exceeded maximum depth of {}", N::MAX_DATA_DEPTH); - - // Sample the plaintext value. - let plaintext = match plaintext_type { - // Sample a literal. - PlaintextType::Literal(literal_type) => { - Plaintext::Literal(Literal::sample(*literal_type, rng), Default::default()) - } - // Sample a struct. - PlaintextType::Struct(struct_name) => { - // Retrieve the struct. - let struct_ = self.program.get_struct(struct_name)?; - // Sample each member of the struct. - let members = struct_ - .members() - .iter() - .map(|(member_name, member_type)| { - // Sample the member value. - let member = self.sample_plaintext_internal(member_type, depth + 1, rng)?; - // Return the member. - Ok((*member_name, member)) - }) - .collect::>>()?; - - Plaintext::Struct(members, Default::default()) - } - // Sample an array. - PlaintextType::Array(array_type) => { - // Sample each element of the array. - let elements = (0..**array_type.length()) - .map(|_| { - // Sample the element value. - self.sample_plaintext_internal(array_type.next_element_type(), depth + 1, rng) - }) - .collect::>>()?; - - Plaintext::Array(elements, Default::default()) - } - }; - // Return the plaintext. - Ok(plaintext) - } - - /// Samples a future value according to the given locator. - fn sample_future_internal( - &self, - locator: &Locator, - depth: usize, - rng: &mut R, - ) -> Result> { - // Retrieve the associated function. - let function = match locator.program_id() == self.program_id() { - true => self.get_function_ref(locator.resource())?, - false => self.get_external_program(locator.program_id())?.get_function_ref(locator.resource())?, - }; - - // Retrieve the finalize inputs. - let inputs = match function.finalize_logic() { - Some(finalize_logic) => finalize_logic.inputs(), - None => bail!("Function '{locator}' does not have a finalize block"), - }; - - let arguments = inputs - .into_iter() - .map(|input| { - match input.finalize_type() { - FinalizeType::Plaintext(plaintext_type) => { - // Sample the plaintext value. - let plaintext = self.sample_plaintext_internal(plaintext_type, depth + 1, rng)?; - // Return the argument. - Ok(Argument::Plaintext(plaintext)) - } - FinalizeType::Future(locator) => { - // Sample the future value. - let future = self.sample_future_internal(locator, depth + 1, rng)?; - // Return the argument. - Ok(Argument::Future(future)) - } - } - }) - .collect::>>()?; - - Ok(Future::new(*locator.program_id(), *locator.resource(), arguments)) - } -} diff --git a/synthesizer/process/src/stack/mod.rs b/synthesizer/process/src/stack/mod.rs index c432938a82..756fbdbddb 100644 --- a/synthesizer/process/src/stack/mod.rs +++ b/synthesizer/process/src/stack/mod.rs @@ -307,17 +307,33 @@ impl StackProgram for Stack { | ValueType::Public(plaintext_type) | ValueType::Private(plaintext_type) => Ok(Value::Plaintext(self.sample_plaintext(plaintext_type, rng)?)), ValueType::Record(record_name) => { - Ok(Value::Record(self.sample_record(burner_address, record_name, rng)?)) + Ok(Value::Record(self.sample_record(burner_address, record_name, Group::rand(rng), rng)?)) } ValueType::ExternalRecord(locator) => { // Retrieve the external stack. let stack = self.get_external_stack(locator.program_id())?; // Sample the output. - Ok(Value::Record(stack.sample_record(burner_address, locator.resource(), rng)?)) + Ok(Value::Record(stack.sample_record(burner_address, locator.resource(), Group::rand(rng), rng)?)) } ValueType::Future(locator) => Ok(Value::Future(self.sample_future(locator, rng)?)), } } + + /// Returns a record for the given record name, with the given burner address. + fn sample_record( + &self, + burner_address: &Address, + record_name: &Identifier, + nonce: Group, + rng: &mut R, + ) -> Result>> { + // Sample a record. + let record = self.sample_record_internal(burner_address, record_name, nonce, 0, rng)?; + // Ensure the record matches the value type. + self.matches_record(&record, record_name)?; + // Return the record. + Ok(record) + } } impl StackProgramTypes for Stack { @@ -438,3 +454,185 @@ impl PartialEq for Stack { } impl Eq for Stack {} + +impl Stack { + /// Samples a plaintext value according to the given plaintext type. + pub fn sample_plaintext( + &self, + plaintext_type: &PlaintextType, + rng: &mut R, + ) -> Result> { + // Sample a plaintext value. + let plaintext = self.sample_plaintext_internal(plaintext_type, 0, rng)?; + // Ensure the plaintext value matches the plaintext type. + self.matches_plaintext(&plaintext, plaintext_type)?; + // Return the plaintext value. + Ok(plaintext) + } + + /// Samples a future value according to the given future type. + pub fn sample_future(&self, locator: &Locator, rng: &mut R) -> Result> { + // Sample a future value. + let future = self.sample_future_internal(locator, 0, rng)?; + // Ensure the future value matches the future type. + self.matches_future(&future, locator)?; + // Return the future value. + Ok(future) + } + + /// Returns a record for the given record name. + fn sample_record_internal( + &self, + burner_address: &Address, + record_name: &Identifier, + nonce: Group, + depth: usize, + rng: &mut R, + ) -> Result>> { + // If the depth exceeds the maximum depth, then the plaintext type is invalid. + ensure!(depth <= N::MAX_DATA_DEPTH, "Plaintext exceeded maximum depth of {}", N::MAX_DATA_DEPTH); + + // Retrieve the record type from the program. + let record_type = self.program.get_record(record_name)?; + + // Initialize the owner based on the visibility. + let owner = match record_type.owner().is_public() { + true => RecordOwner::Public(*burner_address), + false => RecordOwner::Private(Plaintext::Literal(Literal::Address(*burner_address), Default::default())), + }; + + // Initialize the record data according to the defined type. + let data = record_type + .entries() + .iter() + .map(|(entry_name, entry_type)| { + // Sample the entry value. + let entry = self.sample_entry_internal(entry_type, depth + 1, rng)?; + // Return the entry. + Ok((*entry_name, entry)) + }) + .collect::>>()?; + + // Return the record. + Record::>::from_plaintext(owner, data, nonce) + } + + /// Samples an entry according to the given entry type. + fn sample_entry_internal( + &self, + entry_type: &EntryType, + depth: usize, + rng: &mut R, + ) -> Result>> { + // If the depth exceeds the maximum depth, then the entry type is invalid. + ensure!(depth <= N::MAX_DATA_DEPTH, "Entry exceeded maximum depth of {}", N::MAX_DATA_DEPTH); + + match entry_type { + EntryType::Constant(plaintext_type) + | EntryType::Public(plaintext_type) + | EntryType::Private(plaintext_type) => { + // Sample the plaintext value. + let plaintext = self.sample_plaintext_internal(plaintext_type, depth, rng)?; + // Return the entry. + match entry_type { + EntryType::Constant(..) => Ok(Entry::Constant(plaintext)), + EntryType::Public(..) => Ok(Entry::Public(plaintext)), + EntryType::Private(..) => Ok(Entry::Private(plaintext)), + } + } + } + } + + /// Samples a plaintext value according to the given plaintext type. + fn sample_plaintext_internal( + &self, + plaintext_type: &PlaintextType, + depth: usize, + rng: &mut R, + ) -> Result> { + // If the depth exceeds the maximum depth, then the plaintext type is invalid. + ensure!(depth <= N::MAX_DATA_DEPTH, "Plaintext exceeded maximum depth of {}", N::MAX_DATA_DEPTH); + + // Sample the plaintext value. + let plaintext = match plaintext_type { + // Sample a literal. + PlaintextType::Literal(literal_type) => { + Plaintext::Literal(Literal::sample(*literal_type, rng), Default::default()) + } + // Sample a struct. + PlaintextType::Struct(struct_name) => { + // Retrieve the struct. + let struct_ = self.program.get_struct(struct_name)?; + // Sample each member of the struct. + let members = struct_ + .members() + .iter() + .map(|(member_name, member_type)| { + // Sample the member value. + let member = self.sample_plaintext_internal(member_type, depth + 1, rng)?; + // Return the member. + Ok((*member_name, member)) + }) + .collect::>>()?; + + Plaintext::Struct(members, Default::default()) + } + // Sample an array. + PlaintextType::Array(array_type) => { + // Sample each element of the array. + let elements = (0..**array_type.length()) + .map(|_| { + // Sample the element value. + self.sample_plaintext_internal(array_type.next_element_type(), depth + 1, rng) + }) + .collect::>>()?; + + Plaintext::Array(elements, Default::default()) + } + }; + // Return the plaintext. + Ok(plaintext) + } + + /// Samples a future value according to the given locator. + fn sample_future_internal( + &self, + locator: &Locator, + depth: usize, + rng: &mut R, + ) -> Result> { + // Retrieve the associated function. + let function = match locator.program_id() == self.program_id() { + true => self.get_function_ref(locator.resource())?, + false => self.get_external_program(locator.program_id())?.get_function_ref(locator.resource())?, + }; + + // Retrieve the finalize inputs. + let inputs = match function.finalize_logic() { + Some(finalize_logic) => finalize_logic.inputs(), + None => bail!("Function '{locator}' does not have a finalize block"), + }; + + let arguments = inputs + .into_iter() + .map(|input| { + match input.finalize_type() { + FinalizeType::Plaintext(plaintext_type) => { + // Sample the plaintext value. + let plaintext = self.sample_plaintext_internal(plaintext_type, depth + 1, rng)?; + // Return the argument. + Ok(Argument::Plaintext(plaintext)) + } + FinalizeType::Future(locator) => { + // Sample the future value. + let future = self.sample_future_internal(locator, depth + 1, rng)?; + // Return the argument. + Ok(Argument::Future(future)) + } + } + }) + .collect::>>()?; + + Ok(Future::new(*locator.program_id(), *locator.resource(), arguments)) + } +} diff --git a/synthesizer/program/src/traits/stack_and_registers.rs b/synthesizer/program/src/traits/stack_and_registers.rs index d3a5961141..aa6d15b206 100644 --- a/synthesizer/program/src/traits/stack_and_registers.rs +++ b/synthesizer/program/src/traits/stack_and_registers.rs @@ -16,6 +16,7 @@ use std::sync::Arc; use crate::{FinalizeGlobalState, Function, Operand, Program}; use console::{ + account::Group, network::Network, prelude::{bail, Result}, program::{ @@ -92,6 +93,15 @@ pub trait StackProgram { value_type: &ValueType, rng: &mut R, ) -> Result>; + + /// Returns a record for the given record name, with the given burner address. + fn sample_record( + &self, + burner_address: &Address, + record_name: &Identifier, + record_nonce: Group, + rng: &mut R, + ) -> Result>>; } pub trait FinalizeRegistersState { diff --git a/synthesizer/src/vm/mod.rs b/synthesizer/src/vm/mod.rs index 0560186b54..acf5966e68 100644 --- a/synthesizer/src/vm/mod.rs +++ b/synthesizer/src/vm/mod.rs @@ -1105,7 +1105,9 @@ function transfer: input r3 as [address; 10u32].private; call credits.aleo/transfer_private r0 r3[0u32] r1 into r4 r5; call credits.aleo/transfer_private r5 r3[0u32] r2 into r6 r7; -").unwrap(); +", + ) + .unwrap(); let deployment = vm.deploy(&private_key, &program, None, 0, None, rng).unwrap(); assert!(vm.check_transaction(&deployment, None, rng).is_ok()); From c734e946cb4dcbb4431d5e9a13a86a3a6b449699 Mon Sep 17 00:00:00 2001 From: ljedrz Date: Tue, 23 Jan 2024 18:55:02 +0100 Subject: [PATCH 236/298] perf: speed up get_map_confirmed Signed-off-by: ljedrz --- .../helpers/rocksdb/internal/nested_map.rs | 25 ++++++++++++------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/ledger/store/src/helpers/rocksdb/internal/nested_map.rs b/ledger/store/src/helpers/rocksdb/internal/nested_map.rs index 0634e95a7b..a86e64d97e 100644 --- a/ledger/store/src/helpers/rocksdb/internal/nested_map.rs +++ b/ledger/store/src/helpers/rocksdb/internal/nested_map.rs @@ -16,12 +16,15 @@ use super::*; use crate::helpers::{NestedMap, NestedMapRead}; -use console::prelude::{anyhow, FromBytes}; +use console::prelude::{anyhow, cfg_into_iter, FromBytes}; use core::{fmt, fmt::Debug, hash::Hash, mem}; use std::{borrow::Cow, sync::atomic::Ordering}; use tracing::error; +#[cfg(not(feature = "serial"))] +use rayon::iter::{IntoParallelIterator, ParallelIterator}; + #[derive(Clone)] pub struct NestedDataMap< M: Serialize + DeserializeOwned, @@ -441,12 +444,8 @@ impl< // If the 'entry_map' matches 'serialized_map', deserialize the key and value. if entry_map == serialized_map { - // Deserialize the key. - let key = bincode::deserialize(entry_key)?; - // Deserialize the value. - let value = bincode::deserialize(&value)?; // Push the key-value pair to the vector. - entries.push((key, value)); + entries.push((entry_key.to_owned(), value)); } else { // If the 'entry_map' no longer matches the 'serialized_map', // we've moved past the relevant keys and can break the loop. @@ -454,7 +453,15 @@ impl< } } - Ok(entries) + // Possibly deserialize the entries in parallel. + Ok(cfg_into_iter!(entries) + .map(|(k, v)| { + let k = bincode::deserialize::(&k); + let v = bincode::deserialize::(&v); + + k.and_then(|k| v.map(|v| (k, v))) + }) + .collect::>()?) } /// @@ -468,14 +475,14 @@ impl< let operations = self.atomic_batch.lock().clone(); if !operations.is_empty() { - // Perform all the queued operations. + // Traverse the queued operations. for (m, k, v) in operations { // If the map does not match the given map, then continue. if &m != map { continue; } - // Perform the operation. + // Update the confirmed pairs based on the pending operations. match (k, v) { // Insert or update the key-value pair for the key. (Some(k), Some(v)) => { From a0427413069d066126d5b62c35cc00783641bd42 Mon Sep 17 00:00:00 2001 From: Howard Wu <9260812+howardwu@users.noreply.github.com> Date: Sat, 27 Jan 2024 13:27:37 -0800 Subject: [PATCH 237/298] Revert missing sample file --- synthesizer/process/src/stack/helpers/mod.rs | 1 + .../process/src/stack/helpers/sample.rs | 197 ++++++++++++++++++ synthesizer/process/src/stack/mod.rs | 182 ---------------- 3 files changed, 198 insertions(+), 182 deletions(-) create mode 100644 synthesizer/process/src/stack/helpers/sample.rs diff --git a/synthesizer/process/src/stack/helpers/mod.rs b/synthesizer/process/src/stack/helpers/mod.rs index f7fba4741c..2b0884a4df 100644 --- a/synthesizer/process/src/stack/helpers/mod.rs +++ b/synthesizer/process/src/stack/helpers/mod.rs @@ -16,4 +16,5 @@ use super::*; mod initialize; mod matches; +mod sample; mod synthesize; diff --git a/synthesizer/process/src/stack/helpers/sample.rs b/synthesizer/process/src/stack/helpers/sample.rs new file mode 100644 index 0000000000..ed9eaaf9d0 --- /dev/null +++ b/synthesizer/process/src/stack/helpers/sample.rs @@ -0,0 +1,197 @@ +// Copyright (C) 2019-2023 Aleo Systems Inc. +// This file is part of the snarkVM library. + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at: +// http://www.apache.org/licenses/LICENSE-2.0 + +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +use super::*; + +impl Stack { + /// Samples a plaintext value according to the given plaintext type. + pub fn sample_plaintext( + &self, + plaintext_type: &PlaintextType, + rng: &mut R, + ) -> Result> { + // Sample a plaintext value. + let plaintext = self.sample_plaintext_internal(plaintext_type, 0, rng)?; + // Ensure the plaintext value matches the plaintext type. + self.matches_plaintext(&plaintext, plaintext_type)?; + // Return the plaintext value. + Ok(plaintext) + } + + /// Samples a future value according to the given future type. + pub fn sample_future(&self, locator: &Locator, rng: &mut R) -> Result> { + // Sample a future value. + let future = self.sample_future_internal(locator, 0, rng)?; + // Ensure the future value matches the future type. + self.matches_future(&future, locator)?; + // Return the future value. + Ok(future) + } + + /// Returns a record for the given record name. + pub(crate) fn sample_record_internal( + &self, + burner_address: &Address, + record_name: &Identifier, + nonce: Group, + depth: usize, + rng: &mut R, + ) -> Result>> { + // If the depth exceeds the maximum depth, then the plaintext type is invalid. + ensure!(depth <= N::MAX_DATA_DEPTH, "Plaintext exceeded maximum depth of {}", N::MAX_DATA_DEPTH); + + // Retrieve the record type from the program. + let record_type = self.program.get_record(record_name)?; + + // Initialize the owner based on the visibility. + let owner = match record_type.owner().is_public() { + true => RecordOwner::Public(*burner_address), + false => RecordOwner::Private(Plaintext::Literal(Literal::Address(*burner_address), Default::default())), + }; + + // Initialize the record data according to the defined type. + let data = record_type + .entries() + .iter() + .map(|(entry_name, entry_type)| { + // Sample the entry value. + let entry = self.sample_entry_internal(entry_type, depth + 1, rng)?; + // Return the entry. + Ok((*entry_name, entry)) + }) + .collect::>>()?; + + // Return the record. + Record::>::from_plaintext(owner, data, nonce) + } + + /// Samples an entry according to the given entry type. + fn sample_entry_internal( + &self, + entry_type: &EntryType, + depth: usize, + rng: &mut R, + ) -> Result>> { + // If the depth exceeds the maximum depth, then the entry type is invalid. + ensure!(depth <= N::MAX_DATA_DEPTH, "Entry exceeded maximum depth of {}", N::MAX_DATA_DEPTH); + + match entry_type { + EntryType::Constant(plaintext_type) + | EntryType::Public(plaintext_type) + | EntryType::Private(plaintext_type) => { + // Sample the plaintext value. + let plaintext = self.sample_plaintext_internal(plaintext_type, depth, rng)?; + // Return the entry. + match entry_type { + EntryType::Constant(..) => Ok(Entry::Constant(plaintext)), + EntryType::Public(..) => Ok(Entry::Public(plaintext)), + EntryType::Private(..) => Ok(Entry::Private(plaintext)), + } + } + } + } + + /// Samples a plaintext value according to the given plaintext type. + fn sample_plaintext_internal( + &self, + plaintext_type: &PlaintextType, + depth: usize, + rng: &mut R, + ) -> Result> { + // If the depth exceeds the maximum depth, then the plaintext type is invalid. + ensure!(depth <= N::MAX_DATA_DEPTH, "Plaintext exceeded maximum depth of {}", N::MAX_DATA_DEPTH); + + // Sample the plaintext value. + let plaintext = match plaintext_type { + // Sample a literal. + PlaintextType::Literal(literal_type) => { + Plaintext::Literal(Literal::sample(*literal_type, rng), Default::default()) + } + // Sample a struct. + PlaintextType::Struct(struct_name) => { + // Retrieve the struct. + let struct_ = self.program.get_struct(struct_name)?; + // Sample each member of the struct. + let members = struct_ + .members() + .iter() + .map(|(member_name, member_type)| { + // Sample the member value. + let member = self.sample_plaintext_internal(member_type, depth + 1, rng)?; + // Return the member. + Ok((*member_name, member)) + }) + .collect::>>()?; + + Plaintext::Struct(members, Default::default()) + } + // Sample an array. + PlaintextType::Array(array_type) => { + // Sample each element of the array. + let elements = (0..**array_type.length()) + .map(|_| { + // Sample the element value. + self.sample_plaintext_internal(array_type.next_element_type(), depth + 1, rng) + }) + .collect::>>()?; + + Plaintext::Array(elements, Default::default()) + } + }; + // Return the plaintext. + Ok(plaintext) + } + + /// Samples a future value according to the given locator. + fn sample_future_internal( + &self, + locator: &Locator, + depth: usize, + rng: &mut R, + ) -> Result> { + // Retrieve the associated function. + let function = match locator.program_id() == self.program_id() { + true => self.get_function_ref(locator.resource())?, + false => self.get_external_program(locator.program_id())?.get_function_ref(locator.resource())?, + }; + + // Retrieve the finalize inputs. + let inputs = match function.finalize_logic() { + Some(finalize_logic) => finalize_logic.inputs(), + None => bail!("Function '{locator}' does not have a finalize block"), + }; + + let arguments = inputs + .into_iter() + .map(|input| { + match input.finalize_type() { + FinalizeType::Plaintext(plaintext_type) => { + // Sample the plaintext value. + let plaintext = self.sample_plaintext_internal(plaintext_type, depth + 1, rng)?; + // Return the argument. + Ok(Argument::Plaintext(plaintext)) + } + FinalizeType::Future(locator) => { + // Sample the future value. + let future = self.sample_future_internal(locator, depth + 1, rng)?; + // Return the argument. + Ok(Argument::Future(future)) + } + } + }) + .collect::>>()?; + + Ok(Future::new(*locator.program_id(), *locator.resource(), arguments)) + } +} diff --git a/synthesizer/process/src/stack/mod.rs b/synthesizer/process/src/stack/mod.rs index 756fbdbddb..44cbe08dde 100644 --- a/synthesizer/process/src/stack/mod.rs +++ b/synthesizer/process/src/stack/mod.rs @@ -454,185 +454,3 @@ impl PartialEq for Stack { } impl Eq for Stack {} - -impl Stack { - /// Samples a plaintext value according to the given plaintext type. - pub fn sample_plaintext( - &self, - plaintext_type: &PlaintextType, - rng: &mut R, - ) -> Result> { - // Sample a plaintext value. - let plaintext = self.sample_plaintext_internal(plaintext_type, 0, rng)?; - // Ensure the plaintext value matches the plaintext type. - self.matches_plaintext(&plaintext, plaintext_type)?; - // Return the plaintext value. - Ok(plaintext) - } - - /// Samples a future value according to the given future type. - pub fn sample_future(&self, locator: &Locator, rng: &mut R) -> Result> { - // Sample a future value. - let future = self.sample_future_internal(locator, 0, rng)?; - // Ensure the future value matches the future type. - self.matches_future(&future, locator)?; - // Return the future value. - Ok(future) - } - - /// Returns a record for the given record name. - fn sample_record_internal( - &self, - burner_address: &Address, - record_name: &Identifier, - nonce: Group, - depth: usize, - rng: &mut R, - ) -> Result>> { - // If the depth exceeds the maximum depth, then the plaintext type is invalid. - ensure!(depth <= N::MAX_DATA_DEPTH, "Plaintext exceeded maximum depth of {}", N::MAX_DATA_DEPTH); - - // Retrieve the record type from the program. - let record_type = self.program.get_record(record_name)?; - - // Initialize the owner based on the visibility. - let owner = match record_type.owner().is_public() { - true => RecordOwner::Public(*burner_address), - false => RecordOwner::Private(Plaintext::Literal(Literal::Address(*burner_address), Default::default())), - }; - - // Initialize the record data according to the defined type. - let data = record_type - .entries() - .iter() - .map(|(entry_name, entry_type)| { - // Sample the entry value. - let entry = self.sample_entry_internal(entry_type, depth + 1, rng)?; - // Return the entry. - Ok((*entry_name, entry)) - }) - .collect::>>()?; - - // Return the record. - Record::>::from_plaintext(owner, data, nonce) - } - - /// Samples an entry according to the given entry type. - fn sample_entry_internal( - &self, - entry_type: &EntryType, - depth: usize, - rng: &mut R, - ) -> Result>> { - // If the depth exceeds the maximum depth, then the entry type is invalid. - ensure!(depth <= N::MAX_DATA_DEPTH, "Entry exceeded maximum depth of {}", N::MAX_DATA_DEPTH); - - match entry_type { - EntryType::Constant(plaintext_type) - | EntryType::Public(plaintext_type) - | EntryType::Private(plaintext_type) => { - // Sample the plaintext value. - let plaintext = self.sample_plaintext_internal(plaintext_type, depth, rng)?; - // Return the entry. - match entry_type { - EntryType::Constant(..) => Ok(Entry::Constant(plaintext)), - EntryType::Public(..) => Ok(Entry::Public(plaintext)), - EntryType::Private(..) => Ok(Entry::Private(plaintext)), - } - } - } - } - - /// Samples a plaintext value according to the given plaintext type. - fn sample_plaintext_internal( - &self, - plaintext_type: &PlaintextType, - depth: usize, - rng: &mut R, - ) -> Result> { - // If the depth exceeds the maximum depth, then the plaintext type is invalid. - ensure!(depth <= N::MAX_DATA_DEPTH, "Plaintext exceeded maximum depth of {}", N::MAX_DATA_DEPTH); - - // Sample the plaintext value. - let plaintext = match plaintext_type { - // Sample a literal. - PlaintextType::Literal(literal_type) => { - Plaintext::Literal(Literal::sample(*literal_type, rng), Default::default()) - } - // Sample a struct. - PlaintextType::Struct(struct_name) => { - // Retrieve the struct. - let struct_ = self.program.get_struct(struct_name)?; - // Sample each member of the struct. - let members = struct_ - .members() - .iter() - .map(|(member_name, member_type)| { - // Sample the member value. - let member = self.sample_plaintext_internal(member_type, depth + 1, rng)?; - // Return the member. - Ok((*member_name, member)) - }) - .collect::>>()?; - - Plaintext::Struct(members, Default::default()) - } - // Sample an array. - PlaintextType::Array(array_type) => { - // Sample each element of the array. - let elements = (0..**array_type.length()) - .map(|_| { - // Sample the element value. - self.sample_plaintext_internal(array_type.next_element_type(), depth + 1, rng) - }) - .collect::>>()?; - - Plaintext::Array(elements, Default::default()) - } - }; - // Return the plaintext. - Ok(plaintext) - } - - /// Samples a future value according to the given locator. - fn sample_future_internal( - &self, - locator: &Locator, - depth: usize, - rng: &mut R, - ) -> Result> { - // Retrieve the associated function. - let function = match locator.program_id() == self.program_id() { - true => self.get_function_ref(locator.resource())?, - false => self.get_external_program(locator.program_id())?.get_function_ref(locator.resource())?, - }; - - // Retrieve the finalize inputs. - let inputs = match function.finalize_logic() { - Some(finalize_logic) => finalize_logic.inputs(), - None => bail!("Function '{locator}' does not have a finalize block"), - }; - - let arguments = inputs - .into_iter() - .map(|input| { - match input.finalize_type() { - FinalizeType::Plaintext(plaintext_type) => { - // Sample the plaintext value. - let plaintext = self.sample_plaintext_internal(plaintext_type, depth + 1, rng)?; - // Return the argument. - Ok(Argument::Plaintext(plaintext)) - } - FinalizeType::Future(locator) => { - // Sample the future value. - let future = self.sample_future_internal(locator, depth + 1, rng)?; - // Return the argument. - Ok(Argument::Future(future)) - } - } - }) - .collect::>>()?; - - Ok(Future::new(*locator.program_id(), *locator.resource(), arguments)) - } -} From 13cde7a59238ee80d52a07fcf80de271dfe3c1ff Mon Sep 17 00:00:00 2001 From: Howard Wu <9260812+howardwu@users.noreply.github.com> Date: Sat, 27 Jan 2024 13:29:57 -0800 Subject: [PATCH 238/298] Update the comment --- synthesizer/process/src/stack/mod.rs | 2 +- synthesizer/program/src/traits/stack_and_registers.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/synthesizer/process/src/stack/mod.rs b/synthesizer/process/src/stack/mod.rs index 44cbe08dde..3c8ec34874 100644 --- a/synthesizer/process/src/stack/mod.rs +++ b/synthesizer/process/src/stack/mod.rs @@ -319,7 +319,7 @@ impl StackProgram for Stack { } } - /// Returns a record for the given record name, with the given burner address. + /// Returns a record for the given record name, with the given burner address and nonce. fn sample_record( &self, burner_address: &Address, diff --git a/synthesizer/program/src/traits/stack_and_registers.rs b/synthesizer/program/src/traits/stack_and_registers.rs index aa6d15b206..1decf4c9d7 100644 --- a/synthesizer/program/src/traits/stack_and_registers.rs +++ b/synthesizer/program/src/traits/stack_and_registers.rs @@ -94,7 +94,7 @@ pub trait StackProgram { rng: &mut R, ) -> Result>; - /// Returns a record for the given record name, with the given burner address. + /// Returns a record for the given record name, with the given burner address and nonce. fn sample_record( &self, burner_address: &Address, From 3c969cf830901521a298ad9286ff2ef121e46665 Mon Sep 17 00:00:00 2001 From: Howard Wu <9260812+howardwu@users.noreply.github.com> Date: Sat, 27 Jan 2024 13:39:59 -0800 Subject: [PATCH 239/298] Fix max_write error message --- synthesizer/program/src/finalize/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/synthesizer/program/src/finalize/mod.rs b/synthesizer/program/src/finalize/mod.rs index 2a6f575109..556022ad66 100644 --- a/synthesizer/program/src/finalize/mod.rs +++ b/synthesizer/program/src/finalize/mod.rs @@ -113,7 +113,7 @@ impl> FinalizeCore { // Ensure the maximum number of commands has not been exceeded. ensure!(self.commands.len() < N::MAX_COMMANDS, "Cannot add more than {} commands", N::MAX_COMMANDS); // Ensure the number of write commands has not been exceeded. - ensure!(self.num_writes < N::MAX_WRITES, "Cannot add more than {} 'set' commands", N::MAX_WRITES); + ensure!(self.num_writes < N::MAX_WRITES, "Cannot add more than {} 'set' & 'remove' commands", N::MAX_WRITES); // Ensure the command is not a call instruction. ensure!(!command.is_call(), "Forbidden operation: Finalize cannot invoke a 'call'"); From cd54589bc10c2d89985d643df4ee54701511bd9c Mon Sep 17 00:00:00 2001 From: Howard Wu <9260812+howardwu@users.noreply.github.com> Date: Sat, 27 Jan 2024 14:37:49 -0800 Subject: [PATCH 240/298] Fix merge conflict delta --- .../src/state_path/configuration/mod.rs | 4 ++- .../block/src/transactions/confirmed/mod.rs | 12 +++++++- ledger/block/src/transactions/merkle.rs | 30 ++++++++++++++----- ledger/block/src/transactions/mod.rs | 3 +- ledger/committee/src/lib.rs | 25 +++++++++++++++- 5 files changed, 62 insertions(+), 12 deletions(-) diff --git a/console/program/src/state_path/configuration/mod.rs b/console/program/src/state_path/configuration/mod.rs index 2e01551bb5..fac6225f8f 100644 --- a/console/program/src/state_path/configuration/mod.rs +++ b/console/program/src/state_path/configuration/mod.rs @@ -19,8 +19,10 @@ use snarkvm_console_network::BHPMerkleTree; pub const BLOCKS_DEPTH: u8 = 32; /// The depth of the Merkle tree for the block header. pub const HEADER_DEPTH: u8 = 3; +/// The depth of the Merkle tree for finalize operations in a transaction. +pub const FINALIZE_ID_DEPTH: u8 = TRANSACTION_DEPTH + 4; // '+ 4' is to support 16 finalize operations per transition. /// The depth of the Merkle tree for finalize operations in a block. -pub const FINALIZE_OPERATIONS_DEPTH: u8 = 20; +pub const FINALIZE_OPERATIONS_DEPTH: u8 = TRANSACTIONS_DEPTH; /// The depth of the Merkle tree for the ratifications in a block. pub const RATIFICATIONS_DEPTH: u8 = 16; /// The depth the Merkle tree for the subdag certificates in a block. diff --git a/ledger/block/src/transactions/confirmed/mod.rs b/ledger/block/src/transactions/confirmed/mod.rs index 9d16b7915d..c617c1b3f4 100644 --- a/ledger/block/src/transactions/confirmed/mod.rs +++ b/ledger/block/src/transactions/confirmed/mod.rs @@ -17,7 +17,7 @@ mod serialize; mod string; use crate::{rejected::Rejected, Transaction}; -use console::{network::prelude::*, types::Field}; +use console::{network::prelude::*, program::FINALIZE_ID_DEPTH, types::Field}; use synthesizer_program::FinalizeOperation; pub type NumFinalizeSize = u16; @@ -261,6 +261,16 @@ impl ConfirmedTransaction { } } + /// Returns the finalize ID, by computing the root of a (small) Merkle tree comprised of + /// the ordered finalize operations for the transaction. + pub fn to_finalize_id(&self) -> Result> { + // Prepare the leaves. + let leaves = self.finalize_operations().iter().map(ToBits::to_bits_le).collect::>(); + // Compute the finalize ID. + // Note: This call will ensure the number of finalize operations is within the size of the Merkle tree. + Ok(*N::merkle_tree_bhp::(&leaves)?.root()) + } + /// Returns the rejected ID, if the confirmed transaction is rejected. pub fn to_rejected_id(&self) -> Result>> { match self { diff --git a/ledger/block/src/transactions/merkle.rs b/ledger/block/src/transactions/merkle.rs index 4efc914ba5..7f666f4ff5 100644 --- a/ledger/block/src/transactions/merkle.rs +++ b/ledger/block/src/transactions/merkle.rs @@ -17,13 +17,23 @@ use super::*; impl Transactions { /// Returns the finalize root of the transactions. pub fn to_finalize_root(&self, ratified_finalize_operations: Vec>) -> Result> { - // Prepare the leaves. - let leaves = self.finalize_operations().chain(&ratified_finalize_operations).map(ToBits::to_bits_le); - // Compute the finalize tree. - // Note: This call will check the number of finalize operations is within the size of the Merkle tree. - let tree = N::merkle_tree_bhp::(&leaves.collect::>())?; - // Return the finalize root. - Ok(*tree.root()) + // Prepare the ratified finalize ID - a Merkle tree composed of the ratified finalize operations. + let ratified_finalize_id = *N::merkle_tree_bhp::( + &ratified_finalize_operations.iter().map(ToBits::to_bits_le).collect::>(), + )? + .root(); + + // Prepare the leaves, composed of: + // | transaction_0 finalize ID, ..., transaction_n finalize ID | ratified finalize ID | + let leaves = self + .iter() + .map(|tx| tx.to_finalize_id().map(|id| id.to_bits_le())) + .chain(std::iter::once(Ok(ratified_finalize_id.to_bits_le()))) + .collect::>>()?; + + // Compute the finalize root. + // Note: This call will ensure the number of finalize operations is within the size of the Merkle tree. + Ok(*N::merkle_tree_bhp::(&leaves)?.root()) } } @@ -74,6 +84,10 @@ mod tests { #[test] fn test_transactions_depth() { // Ensure the log2 relationship between depth and the maximum number of transactions. - assert_eq!(2usize.pow(TRANSACTIONS_DEPTH as u32), Transactions::::MAX_TRANSACTIONS); + // Note: This test uses 'checked_sub' to ensure the depth is not zero. + assert_eq!( + 2usize.pow(TRANSACTIONS_DEPTH as u32).checked_sub(1).expect("Invalid depth"), + Transactions::::MAX_TRANSACTIONS + ); } } diff --git a/ledger/block/src/transactions/mod.rs b/ledger/block/src/transactions/mod.rs index 2ab91eb0cb..ef2f3a60f5 100644 --- a/ledger/block/src/transactions/mod.rs +++ b/ledger/block/src/transactions/mod.rs @@ -32,6 +32,7 @@ use console::{ Record, TransactionsPath, TransactionsTree, + FINALIZE_ID_DEPTH, FINALIZE_OPERATIONS_DEPTH, TRANSACTIONS_DEPTH, }, @@ -173,7 +174,7 @@ impl Transactions { * BatchHeader::::MAX_GC_ROUNDS * Committee::::MAX_COMMITTEE_SIZE as usize; /// The maximum number of transactions allowed in a block. - pub const MAX_TRANSACTIONS: usize = usize::pow(2, TRANSACTIONS_DEPTH as u32); + pub const MAX_TRANSACTIONS: usize = usize::pow(2, TRANSACTIONS_DEPTH as u32).saturating_sub(1); /// Returns an iterator over all transactions, for all transactions in `self`. pub fn iter(&self) -> impl '_ + ExactSizeIterator> { diff --git a/ledger/committee/src/lib.rs b/ledger/committee/src/lib.rs index fdae32903b..fd67bf9983 100644 --- a/ledger/committee/src/lib.rs +++ b/ledger/committee/src/lib.rs @@ -202,7 +202,8 @@ impl Committee { /// Note: This ensures the method returns a deterministic result that is SNARK-friendly. fn sorted_members(&self) -> indexmap::map::IntoIter, (u64, bool)> { let members = self.members.clone(); - members.sorted_unstable_by(|address1, stake1, address2, stake2| { + // Note: The use of 'sorted_unstable_by' is safe here because the addresses are guaranteed to be unique. + members.sorted_unstable_by(|address1, (stake1, _), address2, (stake2, _)| { // Sort by stake in decreasing order. let cmp = stake2.cmp(stake1); // If the stakes are equal, sort by x-coordinate in decreasing order. @@ -427,6 +428,28 @@ mod tests { } } + #[test] + fn test_sorted_members_with_equal_stake() { + // Initialize the RNG. + let rng = &mut TestRng::default(); + // Sample a committee. + let committee = crate::test_helpers::sample_committee_equal_stake_committee(200, rng); + // Start a timer. + let timer = std::time::Instant::now(); + // Sort the members. + let sorted_members = committee.sorted_members().collect::>(); + println!("sorted_members: {}ms", timer.elapsed().as_millis()); + // Check that the members are sorted based on our sorting criteria. + for i in 0..sorted_members.len() - 1 { + let (address1, (stake1, _)) = sorted_members[i]; + let (address2, (stake2, _)) = sorted_members[i + 1]; + assert!(stake1 >= stake2); + if stake1 == stake2 { + assert!(address1.to_x_coordinate() > address2.to_x_coordinate()); + } + } + } + #[test] fn test_maximum_committee_size() { assert_eq!(Committee::::MAX_COMMITTEE_SIZE, BatchHeader::::MAX_CERTIFICATES); From 9fbe463762521055df7ff50faa53654fc7405ca5 Mon Sep 17 00:00:00 2001 From: Howard Wu <9260812+howardwu@users.noreply.github.com> Date: Sat, 27 Jan 2024 15:01:01 -0800 Subject: [PATCH 241/298] Reduce to one stack lookup --- synthesizer/program/src/lib.rs | 2 +- synthesizer/src/vm/helpers/cost.rs | 42 ++++++++++++------------------ 2 files changed, 18 insertions(+), 26 deletions(-) diff --git a/synthesizer/program/src/lib.rs b/synthesizer/program/src/lib.rs index 6e32c776f8..556d9ed922 100644 --- a/synthesizer/program/src/lib.rs +++ b/synthesizer/program/src/lib.rs @@ -271,7 +271,7 @@ impl, Command: CommandTrait> Pro /// Returns a reference to the function with the given name. pub fn get_function_ref(&self, name: &Identifier) -> Result<&FunctionCore> { // Attempt to retrieve the function. - let function = self.functions.get(name).ok_or_else(|| anyhow!("Function '{name}' is not defined."))?; + let function = self.functions.get(name).ok_or(anyhow!("Function '{}/{name}' is not defined.", self.id))?; // Ensure the function name matches. ensure!(function.name() == name, "Expected function '{name}', but found function '{}'", function.name()); // Ensure the number of inputs is within the allowed range. diff --git a/synthesizer/src/vm/helpers/cost.rs b/synthesizer/src/vm/helpers/cost.rs index 8a2286d16a..a47f9915d5 100644 --- a/synthesizer/src/vm/helpers/cost.rs +++ b/synthesizer/src/vm/helpers/cost.rs @@ -18,11 +18,11 @@ use crate::{ }; use console::{ prelude::*, - program::{FinalizeType, LiteralType, PlaintextType}, + program::{FinalizeType, Identifier, LiteralType, PlaintextType}, }; use ledger_block::{Deployment, Execution}; use ledger_store::ConsensusStorage; -use synthesizer_program::{CastType, Command, Finalize, Instruction, Operand, StackProgram}; +use synthesizer_program::{CastType, Command, Instruction, Operand, StackProgram}; use std::collections::HashMap; @@ -81,34 +81,20 @@ pub fn execution_cost>( // Compute the storage cost in microcredits. let storage_cost = execution.size_in_bytes()?; - // Prepare the program lookup. - let lookup = execution - .transitions() - .map(|transition| { - let program_id = transition.program_id(); - Ok((*program_id, vm.process().read().get_program(program_id)?.clone())) - }) - .collect::>>()?; - // Compute the finalize cost in microcredits. let mut finalize_cost = 0u64; // Iterate over the transitions to accumulate the finalize cost. for transition in execution.transitions() { - // Retrieve the program ID. - let program_id = transition.program_id(); - // Retrieve the function name. - let function_name = transition.function_name(); - // Retrieve the program. - let program = lookup.get(program_id).ok_or(anyhow!("Program '{program_id}' is missing"))?; + // Retrieve the program ID and function name. + let (program_id, function_name) = (transition.program_id(), transition.function_name()); // Retrieve the finalize cost. - let cost = match program.get_function(function_name)?.finalize_logic() { - Some(finalize) => cost_in_microcredits(vm.process().read().get_stack(program.id())?, finalize)?, - None => continue, - }; + let cost = cost_in_microcredits(vm.process().read().get_stack(program_id)?, function_name)?; // Accumulate the finalize cost. - finalize_cost = finalize_cost - .checked_add(cost) - .ok_or(anyhow!("The finalize cost computation overflowed for an execution"))?; + if cost > 0 { + finalize_cost = finalize_cost + .checked_add(cost) + .ok_or(anyhow!("The finalize cost computation overflowed on '{program_id}/{function_name}'"))?; + } } // Compute the total cost in microcredits. @@ -120,7 +106,13 @@ pub fn execution_cost>( } /// Returns the minimum number of microcredits required to run the finalize. -pub fn cost_in_microcredits(stack: &Stack, finalize: &Finalize) -> Result { +pub fn cost_in_microcredits(stack: &Stack, function_name: &Identifier) -> Result { + // Retrieve the finalize logic. + let Some(finalize) = stack.get_function_ref(function_name)?.finalize_logic() else { + // Return a finalize cost of 0, if the function does not have a finalize scope. + return Ok(0); + }; + // Retrieve the finalize types. let finalize_types = stack.get_finalize_types(finalize.name())?; From e0b6e9c2b23395b9f8a10c2a0d4e9c25989797aa Mon Sep 17 00:00:00 2001 From: Howard Wu <9260812+howardwu@users.noreply.github.com> Date: Sat, 27 Jan 2024 15:01:45 -0800 Subject: [PATCH 242/298] Clippy --- synthesizer/src/vm/helpers/cost.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/synthesizer/src/vm/helpers/cost.rs b/synthesizer/src/vm/helpers/cost.rs index a47f9915d5..e658725ba9 100644 --- a/synthesizer/src/vm/helpers/cost.rs +++ b/synthesizer/src/vm/helpers/cost.rs @@ -24,9 +24,8 @@ use ledger_block::{Deployment, Execution}; use ledger_store::ConsensusStorage; use synthesizer_program::{CastType, Command, Instruction, Operand, StackProgram}; -use std::collections::HashMap; +// Finalize costs for compute heavy operations. Used as BASE_COST + PER_BYTE_COST * SIZE_IN_BYTES. -// Finalize Costs for compute heavy operations. Used as BASE_COST + PER_BYTE_COST * SIZE_IN_BYTES. const CAST_COMMAND_BASE_COST: u64 = 500; const CAST_PER_BYTE_COST: u64 = 30; From 48ab38b7e0c7a0e80582517456dc6c84237e9462 Mon Sep 17 00:00:00 2001 From: Howard Wu <9260812+howardwu@users.noreply.github.com> Date: Sat, 27 Jan 2024 15:50:01 -0800 Subject: [PATCH 243/298] Improve cost safety, prevent overflows --- synthesizer/src/vm/helpers/cost.rs | 208 +++++++++++++++-------------- 1 file changed, 110 insertions(+), 98 deletions(-) diff --git a/synthesizer/src/vm/helpers/cost.rs b/synthesizer/src/vm/helpers/cost.rs index e658725ba9..ac3dc0f24f 100644 --- a/synthesizer/src/vm/helpers/cost.rs +++ b/synthesizer/src/vm/helpers/cost.rs @@ -22,15 +22,16 @@ use console::{ }; use ledger_block::{Deployment, Execution}; use ledger_store::ConsensusStorage; -use synthesizer_program::{CastType, Command, Instruction, Operand, StackProgram}; +use synthesizer_program::{CastType, Command, Finalize, Instruction, Operand, StackProgram}; -// Finalize costs for compute heavy operations. Used as BASE_COST + PER_BYTE_COST * SIZE_IN_BYTES. +// Finalize costs for compute heavy operations, derived as: +// `BASE_COST + (PER_BYTE_COST * SIZE_IN_BYTES)`. -const CAST_COMMAND_BASE_COST: u64 = 500; +const CAST_BASE_COST: u64 = 500; const CAST_PER_BYTE_COST: u64 = 30; -const GET_COMMAND_BASE_COST: u64 = 10_000; -const GET_COMMAND_PER_BYTE_COST: u64 = 10; +const MAPPING_BASE_COST: u64 = 10_000; +const MAPPING_PER_BYTE_COST: u64 = 10; const HASH_BASE_COST: u64 = 10_000; const HASH_PER_BYTE_COST: u64 = 30; @@ -41,8 +42,8 @@ const HASH_BHP_PER_BYTE_COST: u64 = 300; const HASH_PSD_BASE_COST: u64 = 40_000; const HASH_PSD_PER_BYTE_COST: u64 = 75; -const SET_COMMAND_BASE_COST: u64 = 10_000; -const SET_COMMAND_PER_BYTE_COST: u64 = 100; +const SET_BASE_COST: u64 = 10_000; +const SET_PER_BYTE_COST: u64 = 100; /// Returns the *minimum* cost in microcredits to publish the given deployment (total cost, (storage cost, namespace cost)). pub fn deployment_cost(deployment: &Deployment) -> Result<(u64, (u64, u64))> { @@ -106,35 +107,72 @@ pub fn execution_cost>( /// Returns the minimum number of microcredits required to run the finalize. pub fn cost_in_microcredits(stack: &Stack, function_name: &Identifier) -> Result { + /// A helper function to determine the plaintext type in bytes. + fn plaintext_size_in_bytes(stack: &Stack, plaintext_type: &PlaintextType) -> Result { + match plaintext_type { + PlaintextType::Literal(literal_type) => Ok(literal_type.size_in_bytes::() as u64), + PlaintextType::Struct(struct_name) => { + // Retrieve the struct from the stack. + let struct_ = stack.program().get_struct(struct_name)?; + // Retrieve the size of the struct name. + let size_of_name = struct_.name().to_bytes_le()?.len() as u64; + // Retrieve the size of all the members of the struct. + let size_of_members = struct_.members().iter().try_fold(0u64, |acc, (_, member_type)| { + acc.checked_add(plaintext_size_in_bytes(stack, member_type)?).ok_or(anyhow!( + "Overflowed while computing the size of the struct '{}/{struct_name}' - {member_type}", + stack.program_id() + )) + })?; + // Return the size of the struct. + Ok(size_of_name.saturating_add(size_of_members)) + } + PlaintextType::Array(array_type) => { + // Retrieve the number of elements in the array. + let num_elements = **array_type.length() as u64; + // Compute the size of an array element. + let size_of_element = plaintext_size_in_bytes(stack, array_type.next_element_type())?; + // Return the size of the array. + Ok(num_elements.saturating_mul(size_of_element)) + } + } + } + + /// A helper function to compute the following: base_cost + (byte_multiplier * size_of_operands). + fn cost_in_size<'a, N: Network>( + stack: &Stack, + finalize: &Finalize, + operands: impl IntoIterator>, + byte_multiplier: u64, + base_cost: u64, + ) -> Result { + // Retrieve the finalize types. + let finalize_types = stack.get_finalize_types(finalize.name())?; + // Compute the size of the operands. + let size_of_operands = operands.into_iter().try_fold(0u64, |acc, operand| { + // Determine the size of the operand. + let operand_size = match finalize_types.get_type_from_operand(stack, operand)? { + FinalizeType::Plaintext(plaintext_type) => plaintext_size_in_bytes(stack, &plaintext_type)?, + FinalizeType::Future(future) => { + bail!("Future '{future}' is not a valid operand in the finalize scope"); + } + }; + // Safely add the size to the accumulator. + acc.checked_add(operand_size).ok_or(anyhow!( + "Overflowed while computing the size of the operand '{operand}' in '{}/{}' (finalize)", + stack.program_id(), + finalize.name() + )) + })?; + // Return the cost. + Ok(base_cost.saturating_add(byte_multiplier.saturating_mul(size_of_operands))) + } + // Retrieve the finalize logic. let Some(finalize) = stack.get_function_ref(function_name)?.finalize_logic() else { // Return a finalize cost of 0, if the function does not have a finalize scope. return Ok(0); }; - // Retrieve the finalize types. - let finalize_types = stack.get_finalize_types(finalize.name())?; - - // Helper function to get the size of the operand type. - let operand_size_in_bytes = |operand: &Operand| { - // Get the finalize type from the operand. - let finalize_type = finalize_types.get_type_from_operand(stack, operand)?; - - // Get the plaintext type from the finalize type. - let plaintext_type = match finalize_type { - FinalizeType::Plaintext(plaintext_type) => plaintext_type, - FinalizeType::Future(_) => bail!("`Future` types are not supported in storage cost computation."), - }; - - // Get the size of the operand type. - plaintext_size_in_bytes(stack, &plaintext_type) - }; - - let size_cost = |operands: &[Operand], byte_multiplier: u64, base_cost: u64| { - let operand_size = operands.iter().map(operand_size_in_bytes).sum::>()?; - Ok(base_cost.saturating_add(operand_size.saturating_mul(byte_multiplier))) - }; - // Measure the cost of each command. let cost = |command: &Command| match command { Command::Instruction(Instruction::Abs(_)) => Ok(500), @@ -154,7 +192,7 @@ pub fn cost_in_microcredits(stack: &Stack, function_name: &Identi CastType::Plaintext(PlaintextType::Literal(_)) => Ok(500), CastType::Plaintext(plaintext_type) => Ok(plaintext_size_in_bytes(stack, plaintext_type)? .saturating_mul(CAST_PER_BYTE_COST) - .saturating_add(CAST_COMMAND_BASE_COST)), + .saturating_add(CAST_BASE_COST)), _ => Ok(500), } } @@ -166,32 +204,34 @@ pub fn cost_in_microcredits(stack: &Stack, function_name: &Identi CastType::Plaintext(PlaintextType::Literal(_)) => Ok(500), CastType::Plaintext(plaintext_type) => Ok(plaintext_size_in_bytes(stack, plaintext_type)? .saturating_mul(CAST_PER_BYTE_COST) - .saturating_add(CAST_COMMAND_BASE_COST)), + .saturating_add(CAST_BASE_COST)), _ => Ok(500), } } Command::Instruction(Instruction::CommitBHP256(commit)) => { - size_cost(commit.operands(), HASH_BHP_PER_BYTE_COST, HASH_BHP_BASE_COST) + cost_in_size(stack, finalize, commit.operands(), HASH_BHP_PER_BYTE_COST, HASH_BHP_BASE_COST) } Command::Instruction(Instruction::CommitBHP512(commit)) => { - size_cost(commit.operands(), HASH_BHP_PER_BYTE_COST, HASH_BHP_BASE_COST) + cost_in_size(stack, finalize, commit.operands(), HASH_BHP_PER_BYTE_COST, HASH_BHP_BASE_COST) } Command::Instruction(Instruction::CommitBHP768(commit)) => { - size_cost(commit.operands(), HASH_BHP_PER_BYTE_COST, HASH_BHP_BASE_COST) + cost_in_size(stack, finalize, commit.operands(), HASH_BHP_PER_BYTE_COST, HASH_BHP_BASE_COST) } Command::Instruction(Instruction::CommitBHP1024(commit)) => { - size_cost(commit.operands(), HASH_BHP_PER_BYTE_COST, HASH_BHP_BASE_COST) + cost_in_size(stack, finalize, commit.operands(), HASH_BHP_PER_BYTE_COST, HASH_BHP_BASE_COST) } Command::Instruction(Instruction::CommitPED64(commit)) => { - size_cost(commit.operands(), HASH_PER_BYTE_COST, HASH_BASE_COST) + cost_in_size(stack, finalize, commit.operands(), HASH_PER_BYTE_COST, HASH_BASE_COST) } Command::Instruction(Instruction::CommitPED128(commit)) => { - size_cost(commit.operands(), HASH_PER_BYTE_COST, HASH_BASE_COST) + cost_in_size(stack, finalize, commit.operands(), HASH_PER_BYTE_COST, HASH_BASE_COST) } Command::Instruction(Instruction::Div(div)) => { let operands = div.operands(); ensure!(operands.len() == 2, "div opcode must have exactly two operands."); + // Retrieve the finalize types. + let finalize_types = stack.get_finalize_types(finalize.name())?; // Get the price by operand type. let operand_type = finalize_types.get_type_from_operand(stack, &operands[0])?; match operand_type { @@ -207,49 +247,49 @@ pub fn cost_in_microcredits(stack: &Stack, function_name: &Identi Command::Instruction(Instruction::GreaterThan(_)) => Ok(500), Command::Instruction(Instruction::GreaterThanOrEqual(_)) => Ok(500), Command::Instruction(Instruction::HashBHP256(hash)) => { - size_cost(hash.operands(), HASH_BHP_PER_BYTE_COST, HASH_BHP_BASE_COST) + cost_in_size(stack, finalize, hash.operands(), HASH_BHP_PER_BYTE_COST, HASH_BHP_BASE_COST) } Command::Instruction(Instruction::HashBHP512(hash)) => { - size_cost(hash.operands(), HASH_BHP_PER_BYTE_COST, HASH_BHP_BASE_COST) + cost_in_size(stack, finalize, hash.operands(), HASH_BHP_PER_BYTE_COST, HASH_BHP_BASE_COST) } Command::Instruction(Instruction::HashBHP768(hash)) => { - size_cost(hash.operands(), HASH_BHP_PER_BYTE_COST, HASH_BHP_BASE_COST) + cost_in_size(stack, finalize, hash.operands(), HASH_BHP_PER_BYTE_COST, HASH_BHP_BASE_COST) } Command::Instruction(Instruction::HashBHP1024(hash)) => { - size_cost(hash.operands(), HASH_BHP_PER_BYTE_COST, HASH_BHP_BASE_COST) + cost_in_size(stack, finalize, hash.operands(), HASH_BHP_PER_BYTE_COST, HASH_BHP_BASE_COST) } Command::Instruction(Instruction::HashKeccak256(hash)) => { - size_cost(hash.operands(), HASH_PER_BYTE_COST, HASH_BASE_COST) + cost_in_size(stack, finalize, hash.operands(), HASH_PER_BYTE_COST, HASH_BASE_COST) } Command::Instruction(Instruction::HashKeccak384(hash)) => { - size_cost(hash.operands(), HASH_PER_BYTE_COST, HASH_BASE_COST) + cost_in_size(stack, finalize, hash.operands(), HASH_PER_BYTE_COST, HASH_BASE_COST) } Command::Instruction(Instruction::HashKeccak512(hash)) => { - size_cost(hash.operands(), HASH_PER_BYTE_COST, HASH_BASE_COST) + cost_in_size(stack, finalize, hash.operands(), HASH_PER_BYTE_COST, HASH_BASE_COST) } Command::Instruction(Instruction::HashPED64(hash)) => { - size_cost(hash.operands(), HASH_PER_BYTE_COST, HASH_BASE_COST) + cost_in_size(stack, finalize, hash.operands(), HASH_PER_BYTE_COST, HASH_BASE_COST) } Command::Instruction(Instruction::HashPED128(hash)) => { - size_cost(hash.operands(), HASH_PER_BYTE_COST, HASH_BASE_COST) + cost_in_size(stack, finalize, hash.operands(), HASH_PER_BYTE_COST, HASH_BASE_COST) } Command::Instruction(Instruction::HashPSD2(hash)) => { - size_cost(hash.operands(), HASH_PSD_PER_BYTE_COST, HASH_PSD_BASE_COST) + cost_in_size(stack, finalize, hash.operands(), HASH_PSD_PER_BYTE_COST, HASH_PSD_BASE_COST) } Command::Instruction(Instruction::HashPSD4(hash)) => { - size_cost(hash.operands(), HASH_PSD_PER_BYTE_COST, HASH_PSD_BASE_COST) + cost_in_size(stack, finalize, hash.operands(), HASH_PSD_PER_BYTE_COST, HASH_PSD_BASE_COST) } Command::Instruction(Instruction::HashPSD8(hash)) => { - size_cost(hash.operands(), HASH_PSD_PER_BYTE_COST, HASH_PSD_BASE_COST) + cost_in_size(stack, finalize, hash.operands(), HASH_PSD_PER_BYTE_COST, HASH_PSD_BASE_COST) } Command::Instruction(Instruction::HashSha3_256(hash)) => { - size_cost(hash.operands(), HASH_PER_BYTE_COST, HASH_BASE_COST) + cost_in_size(stack, finalize, hash.operands(), HASH_PER_BYTE_COST, HASH_BASE_COST) } Command::Instruction(Instruction::HashSha3_384(hash)) => { - size_cost(hash.operands(), HASH_PER_BYTE_COST, HASH_BASE_COST) + cost_in_size(stack, finalize, hash.operands(), HASH_PER_BYTE_COST, HASH_BASE_COST) } Command::Instruction(Instruction::HashSha3_512(hash)) => { - size_cost(hash.operands(), HASH_PER_BYTE_COST, HASH_BASE_COST) + cost_in_size(stack, finalize, hash.operands(), HASH_PER_BYTE_COST, HASH_BASE_COST) } Command::Instruction(Instruction::HashManyPSD2(_)) => { bail!("`hash_many.psd2` is not supported in finalize.") @@ -270,6 +310,8 @@ pub fn cost_in_microcredits(stack: &Stack, function_name: &Identi let operands = mul.operands(); ensure!(operands.len() == 2, "mul opcode must have exactly two operands."); + // Retrieve the finalize types. + let finalize_types = stack.get_finalize_types(finalize.name())?; // Get the price by operand type. let operand_type = finalize_types.get_type_from_operand(stack, &operands[0])?; match operand_type { @@ -291,6 +333,8 @@ pub fn cost_in_microcredits(stack: &Stack, function_name: &Identi let operands = pow.operands(); ensure!(!operands.is_empty(), "pow opcode must have at least one operand."); + // Retrieve the finalize types. + let finalize_types = stack.get_finalize_types(finalize.name())?; // Get the price by operand type. let operand_type = finalize_types.get_type_from_operand(stack, &operands[0])?; match operand_type { @@ -316,21 +360,20 @@ pub fn cost_in_microcredits(stack: &Stack, function_name: &Identi Command::Instruction(Instruction::Ternary(_)) => Ok(500), Command::Instruction(Instruction::Xor(_)) => Ok(500), Command::Await(_) => Ok(500), - Command::Contains(contains) => Ok(operand_size_in_bytes(contains.key())? - .saturating_mul(GET_COMMAND_PER_BYTE_COST) - .saturating_add(GET_COMMAND_BASE_COST)), - Command::Get(get) => Ok(operand_size_in_bytes(get.key())? - .saturating_mul(GET_COMMAND_PER_BYTE_COST) - .saturating_add(GET_COMMAND_BASE_COST)), - Command::GetOrUse(get) => Ok(operand_size_in_bytes(get.key())? - .saturating_mul(GET_COMMAND_PER_BYTE_COST) - .saturating_add(GET_COMMAND_BASE_COST)), + Command::Contains(command) => { + cost_in_size(stack, finalize, [command.key()], MAPPING_PER_BYTE_COST, MAPPING_BASE_COST) + } + Command::Get(command) => { + cost_in_size(stack, finalize, [command.key()], MAPPING_PER_BYTE_COST, MAPPING_BASE_COST) + } + Command::GetOrUse(command) => { + cost_in_size(stack, finalize, [command.key()], MAPPING_PER_BYTE_COST, MAPPING_BASE_COST) + } Command::RandChaCha(_) => Ok(25_000), - Command::Remove(_) => Ok(GET_COMMAND_BASE_COST), - Command::Set(set) => Ok(operand_size_in_bytes(set.key())? - .saturating_add(operand_size_in_bytes(set.value())?) - .saturating_mul(SET_COMMAND_PER_BYTE_COST) - .saturating_add(SET_COMMAND_BASE_COST)), + Command::Remove(_) => Ok(MAPPING_BASE_COST), + Command::Set(command) => { + cost_in_size(stack, finalize, [command.key(), command.value()], SET_PER_BYTE_COST, SET_BASE_COST) + } Command::BranchEq(_) | Command::BranchNeq(_) => Ok(500), Command::Position(_) => Ok(100), }; @@ -342,34 +385,3 @@ pub fn cost_in_microcredits(stack: &Stack, function_name: &Identi .map(cost) .try_fold(0u64, |acc, res| res.and_then(|x| acc.checked_add(x).ok_or(anyhow!("Finalize cost overflowed")))) } - -// Helper function to get the plaintext type in bytes. -fn plaintext_size_in_bytes(stack: &Stack, plaintext_type: &PlaintextType) -> Result { - match plaintext_type { - PlaintextType::Literal(literal_type) => Ok(literal_type.size_in_bytes::() as u64), - PlaintextType::Struct(struct_identifier) => { - // Retrieve the struct from the stack. - let plaintext_struct = stack.program().get_struct(struct_identifier)?; - - // Retrieve the size of the struct identifier. - let identifier_size = plaintext_struct.name().to_bytes_le()?.len() as u64; - - // Retrieve the size of all the members of the struct. - let size_of_members = plaintext_struct - .members() - .iter() - .map(|(_, member_type)| plaintext_size_in_bytes(stack, member_type)) - .sum::>()?; - - // Return the size of the struct. - Ok(identifier_size.saturating_add(size_of_members)) - } - PlaintextType::Array(array_type) => { - // Retrieve the number of elements in the array. - let num_array_elements = **array_type.length() as u64; - - // Retrieve the size of the internal array types. - Ok(num_array_elements.saturating_mul(plaintext_size_in_bytes(stack, array_type.next_element_type())?)) - } - } -} From 4c87fd07a2451b58f154dc2e11b33454bd755228 Mon Sep 17 00:00:00 2001 From: Howard Wu <9260812+howardwu@users.noreply.github.com> Date: Sat, 27 Jan 2024 15:59:23 -0800 Subject: [PATCH 244/298] Clean up cost logic and error messages --- synthesizer/src/vm/helpers/cost.rs | 96 +++++++++++++----------------- 1 file changed, 40 insertions(+), 56 deletions(-) diff --git a/synthesizer/src/vm/helpers/cost.rs b/synthesizer/src/vm/helpers/cost.rs index ac3dc0f24f..cf4e863be2 100644 --- a/synthesizer/src/vm/helpers/cost.rs +++ b/synthesizer/src/vm/helpers/cost.rs @@ -182,32 +182,22 @@ pub fn cost_in_microcredits(stack: &Stack, function_name: &Identi Command::Instruction(Instruction::And(_)) => Ok(500), Command::Instruction(Instruction::AssertEq(_)) => Ok(500), Command::Instruction(Instruction::AssertNeq(_)) => Ok(500), - Command::Instruction(Instruction::Async(_)) => bail!("`async` is not supported in finalize."), - Command::Instruction(Instruction::Call(_)) => bail!("`call` is not supported in finalize."), - Command::Instruction(Instruction::Cast(cast)) => { - let cast_type = cast.cast_type(); - - // Get the price by operand type. - match cast_type { - CastType::Plaintext(PlaintextType::Literal(_)) => Ok(500), - CastType::Plaintext(plaintext_type) => Ok(plaintext_size_in_bytes(stack, plaintext_type)? - .saturating_mul(CAST_PER_BYTE_COST) - .saturating_add(CAST_BASE_COST)), - _ => Ok(500), - } - } - Command::Instruction(Instruction::CastLossy(cast_lossy)) => { - let cast_type = cast_lossy.cast_type(); - - // Get the price by operand type. - match cast_type { - CastType::Plaintext(PlaintextType::Literal(_)) => Ok(500), - CastType::Plaintext(plaintext_type) => Ok(plaintext_size_in_bytes(stack, plaintext_type)? - .saturating_mul(CAST_PER_BYTE_COST) - .saturating_add(CAST_BASE_COST)), - _ => Ok(500), - } - } + Command::Instruction(Instruction::Async(_)) => bail!("'async' is not supported in finalize"), + Command::Instruction(Instruction::Call(_)) => bail!("'call' is not supported in finalize"), + Command::Instruction(Instruction::Cast(cast)) => match cast.cast_type() { + CastType::Plaintext(PlaintextType::Literal(_)) => Ok(500), + CastType::Plaintext(plaintext_type) => Ok(plaintext_size_in_bytes(stack, plaintext_type)? + .saturating_mul(CAST_PER_BYTE_COST) + .saturating_add(CAST_BASE_COST)), + _ => Ok(500), + }, + Command::Instruction(Instruction::CastLossy(cast_lossy)) => match cast_lossy.cast_type() { + CastType::Plaintext(PlaintextType::Literal(_)) => Ok(500), + CastType::Plaintext(plaintext_type) => Ok(plaintext_size_in_bytes(stack, plaintext_type)? + .saturating_mul(CAST_PER_BYTE_COST) + .saturating_add(CAST_BASE_COST)), + _ => Ok(500), + }, Command::Instruction(Instruction::CommitBHP256(commit)) => { cost_in_size(stack, finalize, commit.operands(), HASH_BHP_PER_BYTE_COST, HASH_BHP_BASE_COST) } @@ -227,19 +217,17 @@ pub fn cost_in_microcredits(stack: &Stack, function_name: &Identi cost_in_size(stack, finalize, commit.operands(), HASH_PER_BYTE_COST, HASH_BASE_COST) } Command::Instruction(Instruction::Div(div)) => { - let operands = div.operands(); - ensure!(operands.len() == 2, "div opcode must have exactly two operands."); - + // Ensure `div` has exactly two operands. + ensure!(div.operands().len() == 2, "'div' must contain exactly 2 operands"); // Retrieve the finalize types. let finalize_types = stack.get_finalize_types(finalize.name())?; - // Get the price by operand type. - let operand_type = finalize_types.get_type_from_operand(stack, &operands[0])?; - match operand_type { + // Retrieve the price by the operand type. + match finalize_types.get_type_from_operand(stack, &div.operands()[0])? { FinalizeType::Plaintext(PlaintextType::Literal(LiteralType::Field)) => Ok(1_500), FinalizeType::Plaintext(PlaintextType::Literal(_)) => Ok(500), - FinalizeType::Plaintext(PlaintextType::Array(_)) => bail!("div opcode does not support arrays."), - FinalizeType::Plaintext(PlaintextType::Struct(_)) => bail!("div opcode does not support structs."), - _ => bail!("div opcode does not support futures."), + FinalizeType::Plaintext(PlaintextType::Array(_)) => bail!("'div' does not support arrays"), + FinalizeType::Plaintext(PlaintextType::Struct(_)) => bail!("'div' does not support structs"), + FinalizeType::Future(_) => bail!("'div' does not support futures"), } } Command::Instruction(Instruction::DivWrapped(_)) => Ok(500), @@ -292,13 +280,13 @@ pub fn cost_in_microcredits(stack: &Stack, function_name: &Identi cost_in_size(stack, finalize, hash.operands(), HASH_PER_BYTE_COST, HASH_BASE_COST) } Command::Instruction(Instruction::HashManyPSD2(_)) => { - bail!("`hash_many.psd2` is not supported in finalize.") + bail!("`hash_many.psd2` is not supported in finalize") } Command::Instruction(Instruction::HashManyPSD4(_)) => { - bail!("`hash_many.psd4` is not supported in finalize.") + bail!("`hash_many.psd4` is not supported in finalize") } Command::Instruction(Instruction::HashManyPSD8(_)) => { - bail!("`hash_many.psd8` is not supported in finalize.") + bail!("`hash_many.psd8` is not supported in finalize") } Command::Instruction(Instruction::Inv(_)) => Ok(1_000), Command::Instruction(Instruction::IsEq(_)) => Ok(500), @@ -307,20 +295,18 @@ pub fn cost_in_microcredits(stack: &Stack, function_name: &Identi Command::Instruction(Instruction::LessThanOrEqual(_)) => Ok(500), Command::Instruction(Instruction::Modulo(_)) => Ok(500), Command::Instruction(Instruction::Mul(mul)) => { - let operands = mul.operands(); - ensure!(operands.len() == 2, "mul opcode must have exactly two operands."); - + // Ensure `mul` has exactly two operands. + ensure!(mul.operands().len() == 2, "'mul' must contain exactly 2 operands"); // Retrieve the finalize types. let finalize_types = stack.get_finalize_types(finalize.name())?; - // Get the price by operand type. - let operand_type = finalize_types.get_type_from_operand(stack, &operands[0])?; - match operand_type { + // Retrieve the price by operand type. + match finalize_types.get_type_from_operand(stack, &mul.operands()[0])? { FinalizeType::Plaintext(PlaintextType::Literal(LiteralType::Group)) => Ok(10_000), FinalizeType::Plaintext(PlaintextType::Literal(LiteralType::Scalar)) => Ok(10_000), FinalizeType::Plaintext(PlaintextType::Literal(_)) => Ok(500), - FinalizeType::Plaintext(PlaintextType::Array(_)) => bail!("mul opcode does not support arrays."), - FinalizeType::Plaintext(PlaintextType::Struct(_)) => bail!("mul opcode does not support structs."), - _ => bail!("mul opcode does not support futures."), + FinalizeType::Plaintext(PlaintextType::Array(_)) => bail!("'mul' does not support arrays"), + FinalizeType::Plaintext(PlaintextType::Struct(_)) => bail!("'mul' does not support structs"), + FinalizeType::Future(_) => bail!("'mul' does not support futures"), } } Command::Instruction(Instruction::MulWrapped(_)) => Ok(500), @@ -330,19 +316,17 @@ pub fn cost_in_microcredits(stack: &Stack, function_name: &Identi Command::Instruction(Instruction::Not(_)) => Ok(500), Command::Instruction(Instruction::Or(_)) => Ok(500), Command::Instruction(Instruction::Pow(pow)) => { - let operands = pow.operands(); - ensure!(!operands.is_empty(), "pow opcode must have at least one operand."); - + // Ensure `pow` has at least one operand. + ensure!(!pow.operands().is_empty(), "'pow' must contain at least 1 operand"); // Retrieve the finalize types. let finalize_types = stack.get_finalize_types(finalize.name())?; - // Get the price by operand type. - let operand_type = finalize_types.get_type_from_operand(stack, &operands[0])?; - match operand_type { + // Retrieve the price by operand type. + match finalize_types.get_type_from_operand(stack, &pow.operands()[0])? { FinalizeType::Plaintext(PlaintextType::Literal(LiteralType::Field)) => Ok(1_500), FinalizeType::Plaintext(PlaintextType::Literal(_)) => Ok(500), - FinalizeType::Plaintext(PlaintextType::Array(_)) => bail!("pow opcode does not support arrays."), - FinalizeType::Plaintext(PlaintextType::Struct(_)) => bail!("pow opcode does not support structs."), - _ => bail!("pow opcode does not support futures."), + FinalizeType::Plaintext(PlaintextType::Array(_)) => bail!("'pow' does not support arrays"), + FinalizeType::Plaintext(PlaintextType::Struct(_)) => bail!("'pow' does not support structs"), + FinalizeType::Future(_) => bail!("'pow' does not support futures"), } } Command::Instruction(Instruction::PowWrapped(_)) => Ok(500), From e4646dd9763129c4e3b10c2f331f66d210300593 Mon Sep 17 00:00:00 2001 From: Howard Wu <9260812+howardwu@users.noreply.github.com> Date: Sat, 27 Jan 2024 16:07:37 -0800 Subject: [PATCH 245/298] Update cost on Inv and SignVerify --- synthesizer/src/vm/helpers/cost.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/synthesizer/src/vm/helpers/cost.rs b/synthesizer/src/vm/helpers/cost.rs index cf4e863be2..6ced4c3244 100644 --- a/synthesizer/src/vm/helpers/cost.rs +++ b/synthesizer/src/vm/helpers/cost.rs @@ -288,7 +288,7 @@ pub fn cost_in_microcredits(stack: &Stack, function_name: &Identi Command::Instruction(Instruction::HashManyPSD8(_)) => { bail!("`hash_many.psd8` is not supported in finalize") } - Command::Instruction(Instruction::Inv(_)) => Ok(1_000), + Command::Instruction(Instruction::Inv(_)) => Ok(2_500), Command::Instruction(Instruction::IsEq(_)) => Ok(500), Command::Instruction(Instruction::IsNeq(_)) => Ok(500), Command::Instruction(Instruction::LessThan(_)) => Ok(500), @@ -332,7 +332,9 @@ pub fn cost_in_microcredits(stack: &Stack, function_name: &Identi Command::Instruction(Instruction::PowWrapped(_)) => Ok(500), Command::Instruction(Instruction::Rem(_)) => Ok(500), Command::Instruction(Instruction::RemWrapped(_)) => Ok(500), - Command::Instruction(Instruction::SignVerify(_)) => Ok(HASH_PSD_BASE_COST), + Command::Instruction(Instruction::SignVerify(sign)) => { + cost_in_size(stack, finalize, sign.operands(), HASH_PSD_PER_BYTE_COST, HASH_PSD_BASE_COST) + } Command::Instruction(Instruction::Shl(_)) => Ok(500), Command::Instruction(Instruction::ShlWrapped(_)) => Ok(500), Command::Instruction(Instruction::Shr(_)) => Ok(500), From 21c9ca15cdf68dfcc54651943c61279c6db15258 Mon Sep 17 00:00:00 2001 From: Howard Wu <9260812+howardwu@users.noreply.github.com> Date: Sat, 27 Jan 2024 16:12:52 -0800 Subject: [PATCH 246/298] Explicitly enumerate all match cases --- synthesizer/src/vm/helpers/cost.rs | 52 +++++++++++++++++------------- 1 file changed, 29 insertions(+), 23 deletions(-) diff --git a/synthesizer/src/vm/helpers/cost.rs b/synthesizer/src/vm/helpers/cost.rs index 6ced4c3244..e3a962b03a 100644 --- a/synthesizer/src/vm/helpers/cost.rs +++ b/synthesizer/src/vm/helpers/cost.rs @@ -24,27 +24,6 @@ use ledger_block::{Deployment, Execution}; use ledger_store::ConsensusStorage; use synthesizer_program::{CastType, Command, Finalize, Instruction, Operand, StackProgram}; -// Finalize costs for compute heavy operations, derived as: -// `BASE_COST + (PER_BYTE_COST * SIZE_IN_BYTES)`. - -const CAST_BASE_COST: u64 = 500; -const CAST_PER_BYTE_COST: u64 = 30; - -const MAPPING_BASE_COST: u64 = 10_000; -const MAPPING_PER_BYTE_COST: u64 = 10; - -const HASH_BASE_COST: u64 = 10_000; -const HASH_PER_BYTE_COST: u64 = 30; - -const HASH_BHP_BASE_COST: u64 = 50_000; -const HASH_BHP_PER_BYTE_COST: u64 = 300; - -const HASH_PSD_BASE_COST: u64 = 40_000; -const HASH_PSD_PER_BYTE_COST: u64 = 75; - -const SET_BASE_COST: u64 = 10_000; -const SET_PER_BYTE_COST: u64 = 100; - /// Returns the *minimum* cost in microcredits to publish the given deployment (total cost, (storage cost, namespace cost)). pub fn deployment_cost(deployment: &Deployment) -> Result<(u64, (u64, u64))> { // Determine the number of bytes in the deployment. @@ -167,6 +146,27 @@ pub fn cost_in_microcredits(stack: &Stack, function_name: &Identi Ok(base_cost.saturating_add(byte_multiplier.saturating_mul(size_of_operands))) } + // Finalize costs for compute heavy operations, derived as: + // `BASE_COST + (PER_BYTE_COST * SIZE_IN_BYTES)`. + + const CAST_BASE_COST: u64 = 500; + const CAST_PER_BYTE_COST: u64 = 30; + + const HASH_BASE_COST: u64 = 10_000; + const HASH_PER_BYTE_COST: u64 = 30; + + const HASH_BHP_BASE_COST: u64 = 50_000; + const HASH_BHP_PER_BYTE_COST: u64 = 300; + + const HASH_PSD_BASE_COST: u64 = 40_000; + const HASH_PSD_PER_BYTE_COST: u64 = 75; + + const MAPPING_BASE_COST: u64 = 10_000; + const MAPPING_PER_BYTE_COST: u64 = 10; + + const SET_BASE_COST: u64 = 10_000; + const SET_PER_BYTE_COST: u64 = 100; + // Retrieve the finalize logic. let Some(finalize) = stack.get_function_ref(function_name)?.finalize_logic() else { // Return a finalize cost of 0, if the function does not have a finalize scope. @@ -189,14 +189,20 @@ pub fn cost_in_microcredits(stack: &Stack, function_name: &Identi CastType::Plaintext(plaintext_type) => Ok(plaintext_size_in_bytes(stack, plaintext_type)? .saturating_mul(CAST_PER_BYTE_COST) .saturating_add(CAST_BASE_COST)), - _ => Ok(500), + CastType::GroupXCoordinate + | CastType::GroupYCoordinate + | CastType::Record(_) + | CastType::ExternalRecord(_) => Ok(500), }, Command::Instruction(Instruction::CastLossy(cast_lossy)) => match cast_lossy.cast_type() { CastType::Plaintext(PlaintextType::Literal(_)) => Ok(500), CastType::Plaintext(plaintext_type) => Ok(plaintext_size_in_bytes(stack, plaintext_type)? .saturating_mul(CAST_PER_BYTE_COST) .saturating_add(CAST_BASE_COST)), - _ => Ok(500), + CastType::GroupXCoordinate + | CastType::GroupYCoordinate + | CastType::Record(_) + | CastType::ExternalRecord(_) => Ok(500), }, Command::Instruction(Instruction::CommitBHP256(commit)) => { cost_in_size(stack, finalize, commit.operands(), HASH_BHP_PER_BYTE_COST, HASH_BHP_BASE_COST) From 2c3b775f9c869e8ba03d10e91b94d8bf8297d388 Mon Sep 17 00:00:00 2001 From: Howard Wu <9260812+howardwu@users.noreply.github.com> Date: Sat, 27 Jan 2024 17:08:52 -0800 Subject: [PATCH 247/298] Minor nit in error message --- ledger/narwhal/data/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ledger/narwhal/data/src/lib.rs b/ledger/narwhal/data/src/lib.rs index 5067f44acc..28508ecc54 100644 --- a/ledger/narwhal/data/src/lib.rs +++ b/ledger/narwhal/data/src/lib.rs @@ -137,7 +137,7 @@ impl ToBytes for Data { Self::Object(object) => { // Serialize the object. let buffer = - object.to_bytes_le().map_err(|err| error(format!("Failed to serialize a Data::Object: {err}")))?; + object.to_bytes_le().map_err(|e| error(format!("Failed to serialize 'Data::Object' - {e}")))?; // Write the object. u32::try_from(buffer.len()).map_err(error)?.write_le(&mut writer)?; // Write the object. From bffa8860ba679dde2eeed7114b515c1681efbd2d Mon Sep 17 00:00:00 2001 From: Howard Wu <9260812+howardwu@users.noreply.github.com> Date: Sun, 28 Jan 2024 14:16:13 -0800 Subject: [PATCH 248/298] chore(snarkvm): bump version for new release --- .cargo/release-version | 2 +- Cargo.lock | 120 ++++++++++---------- Cargo.toml | 24 ++-- algorithms/Cargo.toml | 12 +- algorithms/cuda/Cargo.toml | 2 +- circuit/Cargo.toml | 16 +-- circuit/account/Cargo.toml | 10 +- circuit/algorithms/Cargo.toml | 8 +- circuit/collections/Cargo.toml | 8 +- circuit/environment/Cargo.toml | 14 +-- circuit/environment/witness/Cargo.toml | 2 +- circuit/network/Cargo.toml | 10 +- circuit/program/Cargo.toml | 16 +-- circuit/types/Cargo.toml | 18 +-- circuit/types/address/Cargo.toml | 14 +-- circuit/types/boolean/Cargo.toml | 6 +- circuit/types/field/Cargo.toml | 8 +- circuit/types/group/Cargo.toml | 12 +- circuit/types/integers/Cargo.toml | 12 +- circuit/types/scalar/Cargo.toml | 10 +- circuit/types/string/Cargo.toml | 12 +- console/Cargo.toml | 14 +-- console/account/Cargo.toml | 6 +- console/algorithms/Cargo.toml | 8 +- console/collections/Cargo.toml | 6 +- console/network/Cargo.toml | 20 ++-- console/network/environment/Cargo.toml | 8 +- console/program/Cargo.toml | 14 +-- console/types/Cargo.toml | 18 +-- console/types/address/Cargo.toml | 10 +- console/types/boolean/Cargo.toml | 4 +- console/types/field/Cargo.toml | 6 +- console/types/group/Cargo.toml | 10 +- console/types/integers/Cargo.toml | 10 +- console/types/scalar/Cargo.toml | 8 +- console/types/string/Cargo.toml | 10 +- curves/Cargo.toml | 6 +- fields/Cargo.toml | 4 +- ledger/Cargo.toml | 22 ++-- ledger/authority/Cargo.toml | 6 +- ledger/block/Cargo.toml | 20 ++-- ledger/coinbase/Cargo.toml | 14 +-- ledger/committee/Cargo.toml | 6 +- ledger/narwhal/Cargo.toml | 14 +-- ledger/narwhal/batch-certificate/Cargo.toml | 8 +- ledger/narwhal/batch-header/Cargo.toml | 6 +- ledger/narwhal/data/Cargo.toml | 4 +- ledger/narwhal/subdag/Cargo.toml | 10 +- ledger/narwhal/transmission-id/Cargo.toml | 6 +- ledger/narwhal/transmission/Cargo.toml | 10 +- ledger/query/Cargo.toml | 8 +- ledger/store/Cargo.toml | 18 +-- ledger/test-helpers/Cargo.toml | 16 +-- metrics/Cargo.toml | 2 +- parameters/Cargo.toml | 6 +- synthesizer/Cargo.toml | 24 ++-- synthesizer/process/Cargo.toml | 18 +-- synthesizer/program/Cargo.toml | 6 +- synthesizer/snark/Cargo.toml | 8 +- utilities/Cargo.toml | 4 +- utilities/derives/Cargo.toml | 2 +- wasm/Cargo.toml | 20 ++-- 62 files changed, 378 insertions(+), 378 deletions(-) diff --git a/.cargo/release-version b/.cargo/release-version index 4ca4fe646a..d0b774899e 100644 --- a/.cargo/release-version +++ b/.cargo/release-version @@ -1 +1 @@ -v0.16.17 \ No newline at end of file +v0.16.18 \ No newline at end of file diff --git a/Cargo.lock b/Cargo.lock index 82b1e251f0..56251c9a48 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2522,7 +2522,7 @@ dependencies = [ [[package]] name = "snarkvm" -version = "0.16.17" +version = "0.16.18" dependencies = [ "anstyle", "anyhow", @@ -2558,7 +2558,7 @@ dependencies = [ [[package]] name = "snarkvm-algorithms" -version = "0.16.17" +version = "0.16.18" dependencies = [ "aleo-std", "anyhow", @@ -2597,7 +2597,7 @@ dependencies = [ [[package]] name = "snarkvm-algorithms-cuda" -version = "0.16.17" +version = "0.16.18" dependencies = [ "blst", "cc", @@ -2607,7 +2607,7 @@ dependencies = [ [[package]] name = "snarkvm-circuit" -version = "0.16.17" +version = "0.16.18" dependencies = [ "snarkvm-circuit-account", "snarkvm-circuit-algorithms", @@ -2620,7 +2620,7 @@ dependencies = [ [[package]] name = "snarkvm-circuit-account" -version = "0.16.17" +version = "0.16.18" dependencies = [ "anyhow", "snarkvm-circuit-algorithms", @@ -2632,7 +2632,7 @@ dependencies = [ [[package]] name = "snarkvm-circuit-algorithms" -version = "0.16.17" +version = "0.16.18" dependencies = [ "anyhow", "snarkvm-circuit-types", @@ -2644,7 +2644,7 @@ dependencies = [ [[package]] name = "snarkvm-circuit-collections" -version = "0.16.17" +version = "0.16.18" dependencies = [ "anyhow", "snarkvm-circuit-algorithms", @@ -2658,7 +2658,7 @@ dependencies = [ [[package]] name = "snarkvm-circuit-environment" -version = "0.16.17" +version = "0.16.18" dependencies = [ "criterion", "indexmap 2.1.0", @@ -2679,11 +2679,11 @@ dependencies = [ [[package]] name = "snarkvm-circuit-environment-witness" -version = "0.16.17" +version = "0.16.18" [[package]] name = "snarkvm-circuit-network" -version = "0.16.17" +version = "0.16.18" dependencies = [ "snarkvm-circuit-algorithms", "snarkvm-circuit-collections", @@ -2694,7 +2694,7 @@ dependencies = [ [[package]] name = "snarkvm-circuit-program" -version = "0.16.17" +version = "0.16.18" dependencies = [ "anyhow", "paste", @@ -2712,7 +2712,7 @@ dependencies = [ [[package]] name = "snarkvm-circuit-types" -version = "0.16.17" +version = "0.16.18" dependencies = [ "snarkvm-circuit-environment", "snarkvm-circuit-types-address", @@ -2727,7 +2727,7 @@ dependencies = [ [[package]] name = "snarkvm-circuit-types-address" -version = "0.16.17" +version = "0.16.18" dependencies = [ "snarkvm-circuit-environment", "snarkvm-circuit-types-boolean", @@ -2739,7 +2739,7 @@ dependencies = [ [[package]] name = "snarkvm-circuit-types-boolean" -version = "0.16.17" +version = "0.16.18" dependencies = [ "criterion", "snarkvm-circuit-environment", @@ -2748,7 +2748,7 @@ dependencies = [ [[package]] name = "snarkvm-circuit-types-field" -version = "0.16.17" +version = "0.16.18" dependencies = [ "snarkvm-circuit-environment", "snarkvm-circuit-types-boolean", @@ -2757,7 +2757,7 @@ dependencies = [ [[package]] name = "snarkvm-circuit-types-group" -version = "0.16.17" +version = "0.16.18" dependencies = [ "snarkvm-circuit-environment", "snarkvm-circuit-types-boolean", @@ -2769,7 +2769,7 @@ dependencies = [ [[package]] name = "snarkvm-circuit-types-integers" -version = "0.16.17" +version = "0.16.18" dependencies = [ "paste", "snarkvm-circuit-environment", @@ -2782,7 +2782,7 @@ dependencies = [ [[package]] name = "snarkvm-circuit-types-scalar" -version = "0.16.17" +version = "0.16.18" dependencies = [ "snarkvm-circuit-environment", "snarkvm-circuit-types-boolean", @@ -2792,7 +2792,7 @@ dependencies = [ [[package]] name = "snarkvm-circuit-types-string" -version = "0.16.17" +version = "0.16.18" dependencies = [ "rand", "snarkvm-circuit-environment", @@ -2805,7 +2805,7 @@ dependencies = [ [[package]] name = "snarkvm-console" -version = "0.16.17" +version = "0.16.18" dependencies = [ "snarkvm-console-account", "snarkvm-console-algorithms", @@ -2817,7 +2817,7 @@ dependencies = [ [[package]] name = "snarkvm-console-account" -version = "0.16.17" +version = "0.16.18" dependencies = [ "bincode", "bs58", @@ -2830,7 +2830,7 @@ dependencies = [ [[package]] name = "snarkvm-console-algorithms" -version = "0.16.17" +version = "0.16.18" dependencies = [ "blake2s_simd", "criterion", @@ -2848,7 +2848,7 @@ dependencies = [ [[package]] name = "snarkvm-console-collections" -version = "0.16.17" +version = "0.16.18" dependencies = [ "aleo-std", "criterion", @@ -2861,7 +2861,7 @@ dependencies = [ [[package]] name = "snarkvm-console-network" -version = "0.16.17" +version = "0.16.18" dependencies = [ "anyhow", "indexmap 2.1.0", @@ -2883,7 +2883,7 @@ dependencies = [ [[package]] name = "snarkvm-console-network-environment" -version = "0.16.17" +version = "0.16.18" dependencies = [ "anyhow", "bech32", @@ -2900,7 +2900,7 @@ dependencies = [ [[package]] name = "snarkvm-console-program" -version = "0.16.17" +version = "0.16.18" dependencies = [ "bincode", "enum_index", @@ -2921,7 +2921,7 @@ dependencies = [ [[package]] name = "snarkvm-console-types" -version = "0.16.17" +version = "0.16.18" dependencies = [ "criterion", "snarkvm-console-network", @@ -2937,7 +2937,7 @@ dependencies = [ [[package]] name = "snarkvm-console-types-address" -version = "0.16.17" +version = "0.16.18" dependencies = [ "bincode", "serde_json", @@ -2949,7 +2949,7 @@ dependencies = [ [[package]] name = "snarkvm-console-types-boolean" -version = "0.16.17" +version = "0.16.18" dependencies = [ "bincode", "serde_json", @@ -2958,7 +2958,7 @@ dependencies = [ [[package]] name = "snarkvm-console-types-field" -version = "0.16.17" +version = "0.16.18" dependencies = [ "bincode", "serde_json", @@ -2969,7 +2969,7 @@ dependencies = [ [[package]] name = "snarkvm-console-types-group" -version = "0.16.17" +version = "0.16.18" dependencies = [ "bincode", "serde_json", @@ -2981,7 +2981,7 @@ dependencies = [ [[package]] name = "snarkvm-console-types-integers" -version = "0.16.17" +version = "0.16.18" dependencies = [ "bincode", "serde_json", @@ -2993,7 +2993,7 @@ dependencies = [ [[package]] name = "snarkvm-console-types-scalar" -version = "0.16.17" +version = "0.16.18" dependencies = [ "bincode", "serde_json", @@ -3005,7 +3005,7 @@ dependencies = [ [[package]] name = "snarkvm-console-types-string" -version = "0.16.17" +version = "0.16.18" dependencies = [ "bincode", "serde_json", @@ -3017,7 +3017,7 @@ dependencies = [ [[package]] name = "snarkvm-curves" -version = "0.16.17" +version = "0.16.18" dependencies = [ "bincode", "criterion", @@ -3032,7 +3032,7 @@ dependencies = [ [[package]] name = "snarkvm-fields" -version = "0.16.17" +version = "0.16.18" dependencies = [ "aleo-std", "anyhow", @@ -3048,7 +3048,7 @@ dependencies = [ [[package]] name = "snarkvm-ledger" -version = "0.16.17" +version = "0.16.18" dependencies = [ "aleo-std", "anyhow", @@ -3075,7 +3075,7 @@ dependencies = [ [[package]] name = "snarkvm-ledger-authority" -version = "0.16.17" +version = "0.16.18" dependencies = [ "anyhow", "bincode", @@ -3088,7 +3088,7 @@ dependencies = [ [[package]] name = "snarkvm-ledger-block" -version = "0.16.17" +version = "0.16.18" dependencies = [ "bincode", "indexmap 2.1.0", @@ -3112,7 +3112,7 @@ dependencies = [ [[package]] name = "snarkvm-ledger-coinbase" -version = "0.16.17" +version = "0.16.18" dependencies = [ "aleo-std", "anyhow", @@ -3133,7 +3133,7 @@ dependencies = [ [[package]] name = "snarkvm-ledger-committee" -version = "0.16.17" +version = "0.16.18" dependencies = [ "anyhow", "bincode", @@ -3154,7 +3154,7 @@ dependencies = [ [[package]] name = "snarkvm-ledger-narwhal" -version = "0.16.17" +version = "0.16.18" dependencies = [ "snarkvm-ledger-narwhal", "snarkvm-ledger-narwhal-batch-certificate", @@ -3167,7 +3167,7 @@ dependencies = [ [[package]] name = "snarkvm-ledger-narwhal-batch-certificate" -version = "0.16.17" +version = "0.16.18" dependencies = [ "bincode", "indexmap 2.1.0", @@ -3181,7 +3181,7 @@ dependencies = [ [[package]] name = "snarkvm-ledger-narwhal-batch-header" -version = "0.16.17" +version = "0.16.18" dependencies = [ "bincode", "indexmap 2.1.0", @@ -3194,7 +3194,7 @@ dependencies = [ [[package]] name = "snarkvm-ledger-narwhal-data" -version = "0.16.17" +version = "0.16.18" dependencies = [ "bytes", "serde_json", @@ -3204,7 +3204,7 @@ dependencies = [ [[package]] name = "snarkvm-ledger-narwhal-subdag" -version = "0.16.17" +version = "0.16.18" dependencies = [ "bincode", "indexmap 2.1.0", @@ -3219,7 +3219,7 @@ dependencies = [ [[package]] name = "snarkvm-ledger-narwhal-transmission" -version = "0.16.17" +version = "0.16.18" dependencies = [ "bincode", "bytes", @@ -3232,7 +3232,7 @@ dependencies = [ [[package]] name = "snarkvm-ledger-narwhal-transmission-id" -version = "0.16.17" +version = "0.16.18" dependencies = [ "bincode", "serde_json", @@ -3242,7 +3242,7 @@ dependencies = [ [[package]] name = "snarkvm-ledger-query" -version = "0.16.17" +version = "0.16.18" dependencies = [ "async-trait", "reqwest", @@ -3254,7 +3254,7 @@ dependencies = [ [[package]] name = "snarkvm-ledger-store" -version = "0.16.17" +version = "0.16.18" dependencies = [ "aleo-std-storage", "anyhow", @@ -3282,7 +3282,7 @@ dependencies = [ [[package]] name = "snarkvm-ledger-test-helpers" -version = "0.16.17" +version = "0.16.18" dependencies = [ "once_cell", "snarkvm-circuit", @@ -3296,7 +3296,7 @@ dependencies = [ [[package]] name = "snarkvm-metrics" -version = "0.16.17" +version = "0.16.18" dependencies = [ "metrics", "metrics-exporter-prometheus", @@ -3304,7 +3304,7 @@ dependencies = [ [[package]] name = "snarkvm-parameters" -version = "0.16.17" +version = "0.16.18" dependencies = [ "aleo-std", "anyhow", @@ -3337,7 +3337,7 @@ dependencies = [ [[package]] name = "snarkvm-synthesizer" -version = "0.16.17" +version = "0.16.18" dependencies = [ "aleo-std", "anyhow", @@ -3368,7 +3368,7 @@ dependencies = [ [[package]] name = "snarkvm-synthesizer-process" -version = "0.16.17" +version = "0.16.18" dependencies = [ "aleo-std", "bincode", @@ -3394,7 +3394,7 @@ dependencies = [ [[package]] name = "snarkvm-synthesizer-program" -version = "0.16.17" +version = "0.16.18" dependencies = [ "bincode", "criterion", @@ -3410,7 +3410,7 @@ dependencies = [ [[package]] name = "snarkvm-synthesizer-snark" -version = "0.16.17" +version = "0.16.18" dependencies = [ "bincode", "colored", @@ -3423,7 +3423,7 @@ dependencies = [ [[package]] name = "snarkvm-utilities" -version = "0.16.17" +version = "0.16.18" dependencies = [ "aleo-std", "anyhow", @@ -3443,7 +3443,7 @@ dependencies = [ [[package]] name = "snarkvm-utilities-derives" -version = "0.16.17" +version = "0.16.18" dependencies = [ "proc-macro2", "quote 1.0.35", @@ -3452,7 +3452,7 @@ dependencies = [ [[package]] name = "snarkvm-wasm" -version = "0.16.17" +version = "0.16.18" dependencies = [ "getrandom", "snarkvm-circuit-network", diff --git a/Cargo.toml b/Cargo.toml index a1af5efd32..669e053a09 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm" -version = "0.16.17" +version = "0.16.18" authors = [ "The Aleo Team " ] description = "A decentralized virtual machine" homepage = "https://aleo.org" @@ -150,58 +150,58 @@ wasm = [ "snarkvm-wasm" ] [dependencies.snarkvm-algorithms] path = "./algorithms" -version = "=0.16.17" +version = "=0.16.18" optional = true [dependencies.snarkvm-circuit] path = "./circuit" -version = "=0.16.17" +version = "=0.16.18" optional = true [dependencies.snarkvm-console] path = "./console" -version = "=0.16.17" +version = "=0.16.18" optional = true [dependencies.snarkvm-curves] path = "./curves" -version = "=0.16.17" +version = "=0.16.18" optional = true [dependencies.snarkvm-fields] path = "./fields" -version = "=0.16.17" +version = "=0.16.18" optional = true [dependencies.snarkvm-ledger] path = "./ledger" -version = "=0.16.17" +version = "=0.16.18" optional = true [dependencies.snarkvm-metrics] path = "./metrics" -version = "=0.16.17" +version = "=0.16.18" optional = true [dependencies.snarkvm-parameters] path = "./parameters" -version = "=0.16.17" +version = "=0.16.18" optional = true [dependencies.snarkvm-synthesizer] path = "./synthesizer" -version = "=0.16.17" +version = "=0.16.18" default-features = false optional = true [dependencies.snarkvm-utilities] path = "./utilities" -version = "=0.16.17" +version = "=0.16.18" optional = true [dependencies.snarkvm-wasm] path = "./wasm" -version = "=0.16.17" +version = "=0.16.18" optional = true [dependencies.anstyle] diff --git a/algorithms/Cargo.toml b/algorithms/Cargo.toml index e1297369b7..d1a54ff9dc 100644 --- a/algorithms/Cargo.toml +++ b/algorithms/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-algorithms" -version = "0.16.17" +version = "0.16.18" authors = [ "The Aleo Team " ] description = "Algorithms for a decentralized virtual machine" homepage = "https://aleo.org" @@ -47,27 +47,27 @@ required-features = [ "test" ] [dependencies.snarkvm-curves] path = "../curves" -version = "=0.16.17" +version = "=0.16.18" default-features = false [dependencies.snarkvm-fields] path = "../fields" -version = "=0.16.17" +version = "=0.16.18" default-features = false [dependencies.snarkvm-parameters] path = "../parameters" -version = "=0.16.17" +version = "=0.16.18" optional = true [dependencies.snarkvm-utilities] path = "../utilities" -version = "=0.16.17" +version = "=0.16.18" default-features = false [dependencies.snarkvm-algorithms-cuda] path = "./cuda" -version = "=0.16.17" +version = "=0.16.18" optional = true [dependencies.aleo-std] diff --git a/algorithms/cuda/Cargo.toml b/algorithms/cuda/Cargo.toml index c5cd0c5303..43fafe8a32 100644 --- a/algorithms/cuda/Cargo.toml +++ b/algorithms/cuda/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-algorithms-cuda" -version = "0.16.17" +version = "0.16.18" authors = [ "The Aleo Team " ] description = "Cuda optimizations for a decentralized virtual machine" homepage = "https://aleo.org" diff --git a/circuit/Cargo.toml b/circuit/Cargo.toml index 6934583c6d..92171e3130 100644 --- a/circuit/Cargo.toml +++ b/circuit/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-circuit" -version = "0.16.17" +version = "0.16.18" authors = [ "The Aleo Team " ] description = "Circuits for a decentralized virtual machine" homepage = "https://aleo.org" @@ -25,28 +25,28 @@ edition = "2021" [dependencies.snarkvm-circuit-account] path = "./account" -version = "=0.16.17" +version = "=0.16.18" [dependencies.snarkvm-circuit-algorithms] path = "./algorithms" -version = "=0.16.17" +version = "=0.16.18" [dependencies.snarkvm-circuit-collections] path = "./collections" -version = "=0.16.17" +version = "=0.16.18" [dependencies.snarkvm-circuit-environment] path = "./environment" -version = "=0.16.17" +version = "=0.16.18" [dependencies.snarkvm-circuit-network] path = "./network" -version = "=0.16.17" +version = "=0.16.18" [dependencies.snarkvm-circuit-program] path = "./program" -version = "=0.16.17" +version = "=0.16.18" [dependencies.snarkvm-circuit-types] path = "./types" -version = "=0.16.17" +version = "=0.16.18" diff --git a/circuit/account/Cargo.toml b/circuit/account/Cargo.toml index 2ac433a415..27e9813102 100644 --- a/circuit/account/Cargo.toml +++ b/circuit/account/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-circuit-account" -version = "0.16.17" +version = "0.16.18" authors = [ "The Aleo Team " ] description = "Account circuit library for a decentralized virtual machine" license = "Apache-2.0" @@ -9,20 +9,20 @@ edition = "2021" [dependencies.console] package = "snarkvm-console-account" path = "../../console/account" -version = "=0.16.17" +version = "=0.16.18" optional = true [dependencies.snarkvm-circuit-algorithms] path = "../algorithms" -version = "=0.16.17" +version = "=0.16.18" [dependencies.snarkvm-circuit-network] path = "../network" -version = "=0.16.17" +version = "=0.16.18" [dependencies.snarkvm-circuit-types] path = "../types" -version = "=0.16.17" +version = "=0.16.18" [dev-dependencies.snarkvm-utilities] path = "../../utilities" diff --git a/circuit/algorithms/Cargo.toml b/circuit/algorithms/Cargo.toml index 5e3c4474cd..1b082bbf65 100644 --- a/circuit/algorithms/Cargo.toml +++ b/circuit/algorithms/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-circuit-algorithms" -version = "0.16.17" +version = "0.16.18" authors = [ "The Aleo Team " ] description = "Algorithm circuit library for a decentralized virtual machine" license = "Apache-2.0" @@ -9,16 +9,16 @@ edition = "2021" [dependencies.console] package = "snarkvm-console-algorithms" path = "../../console/algorithms" -version = "=0.16.17" +version = "=0.16.18" optional = true [dependencies.snarkvm-circuit-types] path = "../types" -version = "=0.16.17" +version = "=0.16.18" [dependencies.snarkvm-fields] path = "../../fields" -version = "=0.16.17" +version = "=0.16.18" default-features = false [dev-dependencies.anyhow] diff --git a/circuit/collections/Cargo.toml b/circuit/collections/Cargo.toml index 679e04012b..c53db38a92 100644 --- a/circuit/collections/Cargo.toml +++ b/circuit/collections/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-circuit-collections" -version = "0.16.17" +version = "0.16.18" authors = [ "The Aleo Team " ] description = "Collections circuit library for a decentralized virtual machine" license = "Apache-2.0" @@ -9,16 +9,16 @@ edition = "2021" [dependencies.console] package = "snarkvm-console-collections" path = "../../console/collections" -version = "=0.16.17" +version = "=0.16.18" optional = true [dependencies.snarkvm-circuit-algorithms] path = "../algorithms" -version = "=0.16.17" +version = "=0.16.18" [dependencies.snarkvm-circuit-types] path = "../types" -version = "=0.16.17" +version = "=0.16.18" [dev-dependencies.snarkvm-circuit-network] path = "../network" diff --git a/circuit/environment/Cargo.toml b/circuit/environment/Cargo.toml index 909ce9858e..5fb3694fa1 100644 --- a/circuit/environment/Cargo.toml +++ b/circuit/environment/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-circuit-environment" -version = "0.16.17" +version = "0.16.18" authors = [ "The Aleo Team " ] description = "Circuit environment for a decentralized virtual machine" license = "Apache-2.0" @@ -14,32 +14,32 @@ harness = false [dependencies.console] package = "snarkvm-console-network" path = "../../console/network" -version = "=0.16.17" +version = "=0.16.18" [dependencies.snarkvm-algorithms] path = "../../algorithms" -version = "=0.16.17" +version = "=0.16.18" default-features = false features = [ "r1cs" ] [dependencies.snarkvm-circuit-environment-witness] path = "./witness" -version = "=0.16.17" +version = "=0.16.18" default-features = false [dependencies.snarkvm-curves] path = "../../curves" -version = "=0.16.17" +version = "=0.16.18" default-features = false [dependencies.snarkvm-fields] path = "../../fields" -version = "=0.16.17" +version = "=0.16.18" default-features = false [dependencies.snarkvm-utilities] path = "../../utilities" -version = "=0.16.17" +version = "=0.16.18" default-features = false [dependencies.indexmap] diff --git a/circuit/environment/witness/Cargo.toml b/circuit/environment/witness/Cargo.toml index 591a64c1e9..5665c4402f 100644 --- a/circuit/environment/witness/Cargo.toml +++ b/circuit/environment/witness/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-circuit-environment-witness" -version = "0.16.17" +version = "0.16.18" authors = [ "The Aleo Team " ] description = "A procedural macro to construct a witness in an environment" license = "Apache-2.0" diff --git a/circuit/network/Cargo.toml b/circuit/network/Cargo.toml index fb11937d6d..e16e4e3b44 100644 --- a/circuit/network/Cargo.toml +++ b/circuit/network/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-circuit-network" -version = "0.16.17" +version = "0.16.18" authors = [ "The Aleo Team " ] description = "Network circuit library for a decentralized virtual machine" license = "Apache-2.0" @@ -9,20 +9,20 @@ edition = "2021" [dependencies.console] package = "snarkvm-console-network" path = "../../console/network" -version = "=0.16.17" +version = "=0.16.18" optional = true [dependencies.snarkvm-circuit-algorithms] path = "../algorithms" -version = "=0.16.17" +version = "=0.16.18" [dependencies.snarkvm-circuit-collections] path = "../collections" -version = "=0.16.17" +version = "=0.16.18" [dependencies.snarkvm-circuit-types] path = "../types" -version = "=0.16.17" +version = "=0.16.18" [dev-dependencies.snarkvm-console-types] path = "../../console/types" diff --git a/circuit/program/Cargo.toml b/circuit/program/Cargo.toml index 2d845c2d35..968dea03e2 100644 --- a/circuit/program/Cargo.toml +++ b/circuit/program/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-circuit-program" -version = "0.16.17" +version = "0.16.18" authors = [ "The Aleo Team " ] description = "Program circuit library for a decentralized virtual machine" license = "Apache-2.0" @@ -9,32 +9,32 @@ edition = "2021" [dependencies.console] package = "snarkvm-console-program" path = "../../console/program" -version = "=0.16.17" +version = "=0.16.18" optional = true [dependencies.snarkvm-circuit-account] path = "../account" -version = "=0.16.17" +version = "=0.16.18" [dependencies.snarkvm-circuit-algorithms] path = "../algorithms" -version = "=0.16.17" +version = "=0.16.18" [dependencies.snarkvm-circuit-collections] path = "../collections" -version = "=0.16.17" +version = "=0.16.18" [dependencies.snarkvm-circuit-network] path = "../network" -version = "=0.16.17" +version = "=0.16.18" [dependencies.snarkvm-circuit-types] path = "../types" -version = "=0.16.17" +version = "=0.16.18" [dependencies.snarkvm-utilities] path = "../../utilities" -version = "=0.16.17" +version = "=0.16.18" [dependencies.paste] version = "1.0" diff --git a/circuit/types/Cargo.toml b/circuit/types/Cargo.toml index d99a58b384..b673f8c3d2 100644 --- a/circuit/types/Cargo.toml +++ b/circuit/types/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-circuit-types" -version = "0.16.17" +version = "0.16.18" authors = [ "The Aleo Team " ] description = "Primitive circuit for a decentralized virtual machine" license = "Apache-2.0" @@ -8,35 +8,35 @@ edition = "2021" [dependencies.snarkvm-circuit-environment] path = "../environment" -version = "=0.16.17" +version = "=0.16.18" [dependencies.snarkvm-circuit-types-address] path = "./address" -version = "=0.16.17" +version = "=0.16.18" [dependencies.snarkvm-circuit-types-boolean] path = "./boolean" -version = "=0.16.17" +version = "=0.16.18" [dependencies.snarkvm-circuit-types-field] path = "./field" -version = "=0.16.17" +version = "=0.16.18" [dependencies.snarkvm-circuit-types-group] path = "./group" -version = "=0.16.17" +version = "=0.16.18" [dependencies.snarkvm-circuit-types-integers] path = "./integers" -version = "=0.16.17" +version = "=0.16.18" [dependencies.snarkvm-circuit-types-scalar] path = "./scalar" -version = "=0.16.17" +version = "=0.16.18" [dependencies.snarkvm-circuit-types-string] path = "./string" -version = "=0.16.17" +version = "=0.16.18" [dev-dependencies.console] package = "snarkvm-console" diff --git a/circuit/types/address/Cargo.toml b/circuit/types/address/Cargo.toml index b21010f853..3e2f9400d8 100644 --- a/circuit/types/address/Cargo.toml +++ b/circuit/types/address/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-circuit-types-address" -version = "0.16.17" +version = "0.16.18" authors = [ "The Aleo Team " ] description = "Address circuit for a decentralized virtual machine" license = "Apache-2.0" @@ -9,28 +9,28 @@ edition = "2021" [dependencies.console] package = "snarkvm-console-types-address" path = "../../../console/types/address" -version = "=0.16.17" +version = "=0.16.18" optional = true [dependencies.snarkvm-circuit-environment] path = "../../environment" -version = "=0.16.17" +version = "=0.16.18" [dependencies.snarkvm-circuit-types-boolean] path = "../boolean" -version = "=0.16.17" +version = "=0.16.18" [dependencies.snarkvm-circuit-types-field] path = "../field" -version = "=0.16.17" +version = "=0.16.18" [dependencies.snarkvm-circuit-types-group] path = "../group" -version = "=0.16.17" +version = "=0.16.18" [dependencies.snarkvm-circuit-types-scalar] path = "../scalar" -version = "=0.16.17" +version = "=0.16.18" [features] default = [ "enable_console" ] diff --git a/circuit/types/boolean/Cargo.toml b/circuit/types/boolean/Cargo.toml index 93a84f69f2..323adca84c 100644 --- a/circuit/types/boolean/Cargo.toml +++ b/circuit/types/boolean/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-circuit-types-boolean" -version = "0.16.17" +version = "0.16.18" authors = [ "The Aleo Team " ] description = "Boolean circuit for a decentralized virtual machine" license = "Apache-2.0" @@ -14,12 +14,12 @@ harness = false [dependencies.console] package = "snarkvm-console-types-boolean" path = "../../../console/types/boolean" -version = "=0.16.17" +version = "=0.16.18" optional = true [dependencies.snarkvm-circuit-environment] path = "../../environment" -version = "=0.16.17" +version = "=0.16.18" [dev-dependencies.criterion] version = "0.5" diff --git a/circuit/types/field/Cargo.toml b/circuit/types/field/Cargo.toml index 5207ef0679..c1a9df1876 100644 --- a/circuit/types/field/Cargo.toml +++ b/circuit/types/field/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-circuit-types-field" -version = "0.16.17" +version = "0.16.18" authors = [ "The Aleo Team " ] description = "Field circuit for a decentralized virtual machine" license = "Apache-2.0" @@ -9,16 +9,16 @@ edition = "2021" [dependencies.console] package = "snarkvm-console-types-field" path = "../../../console/types/field" -version = "=0.16.17" +version = "=0.16.18" optional = true [dependencies.snarkvm-circuit-environment] path = "../../environment" -version = "=0.16.17" +version = "=0.16.18" [dependencies.snarkvm-circuit-types-boolean] path = "../boolean" -version = "=0.16.17" +version = "=0.16.18" [features] default = [ "enable_console" ] diff --git a/circuit/types/group/Cargo.toml b/circuit/types/group/Cargo.toml index 6c4446e1ff..bf234c27b3 100644 --- a/circuit/types/group/Cargo.toml +++ b/circuit/types/group/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-circuit-types-group" -version = "0.16.17" +version = "0.16.18" authors = [ "The Aleo Team " ] description = "Group circuit for a decentralized virtual machine" license = "Apache-2.0" @@ -9,24 +9,24 @@ edition = "2021" [dependencies.console] package = "snarkvm-console-types-group" path = "../../../console/types/group" -version = "=0.16.17" +version = "=0.16.18" optional = true [dependencies.snarkvm-circuit-environment] path = "../../environment" -version = "=0.16.17" +version = "=0.16.18" [dependencies.snarkvm-circuit-types-boolean] path = "../boolean" -version = "=0.16.17" +version = "=0.16.18" [dependencies.snarkvm-circuit-types-field] path = "../field" -version = "=0.16.17" +version = "=0.16.18" [dependencies.snarkvm-circuit-types-scalar] path = "../scalar" -version = "=0.16.17" +version = "=0.16.18" [dev-dependencies.snarkvm-utilities] path = "../../../utilities" diff --git a/circuit/types/integers/Cargo.toml b/circuit/types/integers/Cargo.toml index e92db6bbf3..fae7ff67f7 100644 --- a/circuit/types/integers/Cargo.toml +++ b/circuit/types/integers/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-circuit-types-integers" -version = "0.16.17" +version = "0.16.18" authors = [ "The Aleo Team " ] description = "Integer circuit for a decentralized virtual machine" license = "Apache-2.0" @@ -9,24 +9,24 @@ edition = "2021" [dependencies.console] package = "snarkvm-console-types-integers" path = "../../../console/types/integers" -version = "=0.16.17" +version = "=0.16.18" optional = true [dependencies.snarkvm-circuit-environment] path = "../../environment" -version = "=0.16.17" +version = "=0.16.18" [dependencies.snarkvm-circuit-types-boolean] path = "../boolean" -version = "=0.16.17" +version = "=0.16.18" [dependencies.snarkvm-circuit-types-field] path = "../field" -version = "=0.16.17" +version = "=0.16.18" [dependencies.snarkvm-circuit-types-scalar] path = "../scalar" -version = "=0.16.17" +version = "=0.16.18" [dev-dependencies.snarkvm-utilities] path = "../../../utilities" diff --git a/circuit/types/scalar/Cargo.toml b/circuit/types/scalar/Cargo.toml index e9f3116827..d12a47c233 100644 --- a/circuit/types/scalar/Cargo.toml +++ b/circuit/types/scalar/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-circuit-types-scalar" -version = "0.16.17" +version = "0.16.18" authors = [ "The Aleo Team " ] description = "Scalar circuit for a decentralized virtual machine" license = "Apache-2.0" @@ -9,20 +9,20 @@ edition = "2021" [dependencies.console] package = "snarkvm-console-types-scalar" path = "../../../console/types/scalar" -version = "=0.16.17" +version = "=0.16.18" optional = true [dependencies.snarkvm-circuit-environment] path = "../../environment" -version = "=0.16.17" +version = "=0.16.18" [dependencies.snarkvm-circuit-types-boolean] path = "../boolean" -version = "=0.16.17" +version = "=0.16.18" [dependencies.snarkvm-circuit-types-field] path = "../field" -version = "=0.16.17" +version = "=0.16.18" [features] default = [ "enable_console" ] diff --git a/circuit/types/string/Cargo.toml b/circuit/types/string/Cargo.toml index 4fde7c5569..b6add60321 100644 --- a/circuit/types/string/Cargo.toml +++ b/circuit/types/string/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-circuit-types-string" -version = "0.16.17" +version = "0.16.18" authors = [ "The Aleo Team " ] description = "String circuit for a decentralized virtual machine" license = "Apache-2.0" @@ -9,24 +9,24 @@ edition = "2021" [dependencies.console] package = "snarkvm-console-types-string" path = "../../../console/types/string" -version = "=0.16.17" +version = "=0.16.18" optional = true [dependencies.snarkvm-circuit-environment] path = "../../environment" -version = "=0.16.17" +version = "=0.16.18" [dependencies.snarkvm-circuit-types-boolean] path = "../boolean" -version = "=0.16.17" +version = "=0.16.18" [dependencies.snarkvm-circuit-types-field] path = "../field" -version = "=0.16.17" +version = "=0.16.18" [dependencies.snarkvm-circuit-types-integers] path = "../integers" -version = "=0.16.17" +version = "=0.16.18" [dev-dependencies.snarkvm-utilities] path = "../../../utilities" diff --git a/console/Cargo.toml b/console/Cargo.toml index 2272d38ffe..3a16df2e95 100644 --- a/console/Cargo.toml +++ b/console/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-console" -version = "0.16.17" +version = "0.16.18" authors = [ "The Aleo Team " ] description = "Console environment for a decentralized virtual machine" license = "Apache-2.0" @@ -8,32 +8,32 @@ edition = "2021" [dependencies.snarkvm-console-account] path = "./account" -version = "=0.16.17" +version = "=0.16.18" optional = true [dependencies.snarkvm-console-algorithms] path = "./algorithms" -version = "=0.16.17" +version = "=0.16.18" optional = true [dependencies.snarkvm-console-collections] path = "./collections" -version = "=0.16.17" +version = "=0.16.18" optional = true [dependencies.snarkvm-console-network] path = "./network" -version = "=0.16.17" +version = "=0.16.18" optional = true [dependencies.snarkvm-console-program] path = "./program" -version = "=0.16.17" +version = "=0.16.18" optional = true [dependencies.snarkvm-console-types] path = "./types" -version = "=0.16.17" +version = "=0.16.18" optional = true [features] diff --git a/console/account/Cargo.toml b/console/account/Cargo.toml index 1985cb6d6e..c272bdf469 100644 --- a/console/account/Cargo.toml +++ b/console/account/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-console-account" -version = "0.16.17" +version = "0.16.18" authors = [ "The Aleo Team " ] description = "Account operations for a decentralized virtual machine" license = "Apache-2.0" @@ -13,11 +13,11 @@ harness = false [dependencies.snarkvm-console-network] path = "../network" -version = "=0.16.17" +version = "=0.16.18" [dependencies.snarkvm-console-types] path = "../types" -version = "=0.16.17" +version = "=0.16.18" default-features = false features = [ "address", "boolean", "field", "group", "scalar" ] diff --git a/console/algorithms/Cargo.toml b/console/algorithms/Cargo.toml index 652fcd458a..b64095593a 100644 --- a/console/algorithms/Cargo.toml +++ b/console/algorithms/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-console-algorithms" -version = "0.16.17" +version = "0.16.18" authors = [ "The Aleo Team " ] description = "Console algorithms for a decentralized virtual machine" license = "Apache-2.0" @@ -23,18 +23,18 @@ harness = false [dependencies.snarkvm-console-types] path = "../types" -version = "=0.16.17" +version = "=0.16.18" default-features = false features = [ "field", "group", "integers", "scalar" ] [dependencies.snarkvm-fields] path = "../../fields" -version = "=0.16.17" +version = "=0.16.18" default-features = false [dependencies.snarkvm-utilities] path = "../../utilities" -version = "=0.16.17" +version = "=0.16.18" [dependencies.blake2s_simd] version = "1.0" diff --git a/console/collections/Cargo.toml b/console/collections/Cargo.toml index 44aa529199..1bf72fb0d5 100644 --- a/console/collections/Cargo.toml +++ b/console/collections/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-console-collections" -version = "0.16.17" +version = "0.16.18" authors = [ "The Aleo Team " ] description = "Collections for a decentralized virtual machine" license = "Apache-2.0" @@ -18,11 +18,11 @@ harness = false [dependencies.snarkvm-console-algorithms] path = "../algorithms" -version = "=0.16.17" +version = "=0.16.18" [dependencies.snarkvm-console-types] path = "../types" -version = "=0.16.17" +version = "=0.16.18" default-features = false features = [ "field", "integers" ] diff --git a/console/network/Cargo.toml b/console/network/Cargo.toml index 1c7c906f31..0325d113a0 100644 --- a/console/network/Cargo.toml +++ b/console/network/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-console-network" -version = "0.16.17" +version = "0.16.18" authors = [ "The Aleo Team " ] description = "Network console library for a decentralized virtual machine" license = "Apache-2.0" @@ -15,45 +15,45 @@ wasm = [ [dependencies.snarkvm-algorithms] path = "../../algorithms" -version = "=0.16.17" +version = "=0.16.18" default-features = false features = [ "snark" ] [dependencies.snarkvm-console-algorithms] path = "../algorithms" -version = "=0.16.17" +version = "=0.16.18" [dependencies.snarkvm-console-collections] path = "../collections" -version = "=0.16.17" +version = "=0.16.18" [dependencies.snarkvm-console-network-environment] path = "./environment" -version = "=0.16.17" +version = "=0.16.18" [dependencies.snarkvm-console-types] path = "../types" -version = "=0.16.17" +version = "=0.16.18" default-features = false features = [ "field", "group", "scalar" ] [dependencies.snarkvm-curves] path = "../../curves" -version = "=0.16.17" +version = "=0.16.18" default-features = false [dependencies.snarkvm-fields] path = "../../fields" -version = "=0.16.17" +version = "=0.16.18" default-features = false [dependencies.snarkvm-parameters] path = "../../parameters" -version = "=0.16.17" +version = "=0.16.18" [dependencies.snarkvm-utilities] path = "../../utilities" -version = "=0.16.17" +version = "=0.16.18" [dependencies.anyhow] version = "1.0.73" diff --git a/console/network/environment/Cargo.toml b/console/network/environment/Cargo.toml index b91ccbd0d1..941f28b8ab 100644 --- a/console/network/environment/Cargo.toml +++ b/console/network/environment/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-console-network-environment" -version = "0.16.17" +version = "0.16.18" authors = [ "The Aleo Team " ] description = "Environment console library for a decentralized virtual machine" license = "Apache-2.0" @@ -8,17 +8,17 @@ edition = "2021" [dependencies.snarkvm-curves] path = "../../../curves" -version = "=0.16.17" +version = "=0.16.18" default-features = false [dependencies.snarkvm-fields] path = "../../../fields" -version = "=0.16.17" +version = "=0.16.18" default-features = false [dependencies.snarkvm-utilities] path = "../../../utilities" -version = "=0.16.17" +version = "=0.16.18" [dependencies.anyhow] version = "1.0.73" diff --git a/console/program/Cargo.toml b/console/program/Cargo.toml index 9476219c2f..c1d34522c1 100644 --- a/console/program/Cargo.toml +++ b/console/program/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-console-program" -version = "0.16.17" +version = "0.16.18" authors = [ "The Aleo Team " ] description = "Program operations for a decentralized virtual machine" license = "Apache-2.0" @@ -12,27 +12,27 @@ test = [ ] [dependencies.snarkvm-console-account] path = "../account" -version = "=0.16.17" +version = "=0.16.18" [dependencies.snarkvm-console-algorithms] path = "../algorithms" -version = "=0.16.17" +version = "=0.16.18" [dependencies.snarkvm-console-collections] path = "../collections" -version = "=0.16.17" +version = "=0.16.18" [dependencies.snarkvm-console-network] path = "../network" -version = "=0.16.17" +version = "=0.16.18" [dependencies.snarkvm-console-types] path = "../types" -version = "=0.16.17" +version = "=0.16.18" [dependencies.snarkvm-utilities] path = "../../utilities" -version = "=0.16.17" +version = "=0.16.18" [dependencies.enum_index] version = "0.2" diff --git a/console/types/Cargo.toml b/console/types/Cargo.toml index 852b456d88..3b91e1dcc7 100644 --- a/console/types/Cargo.toml +++ b/console/types/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-console-types" -version = "0.16.17" +version = "0.16.18" authors = [ "The Aleo Team " ] description = "Console types for a decentralized virtual machine" license = "Apache-2.0" @@ -13,41 +13,41 @@ harness = false [dependencies.snarkvm-console-network-environment] path = "../network/environment" -version = "=0.16.17" +version = "=0.16.18" [dependencies.snarkvm-console-types-address] path = "./address" -version = "=0.16.17" +version = "=0.16.18" optional = true [dependencies.snarkvm-console-types-boolean] path = "./boolean" -version = "=0.16.17" +version = "=0.16.18" optional = true [dependencies.snarkvm-console-types-field] path = "./field" -version = "=0.16.17" +version = "=0.16.18" optional = true [dependencies.snarkvm-console-types-group] path = "./group" -version = "=0.16.17" +version = "=0.16.18" optional = true [dependencies.snarkvm-console-types-integers] path = "./integers" -version = "=0.16.17" +version = "=0.16.18" optional = true [dependencies.snarkvm-console-types-scalar] path = "./scalar" -version = "=0.16.17" +version = "=0.16.18" optional = true [dependencies.snarkvm-console-types-string] path = "./string" -version = "=0.16.17" +version = "=0.16.18" optional = true [dev-dependencies.criterion] diff --git a/console/types/address/Cargo.toml b/console/types/address/Cargo.toml index 076f26702c..c2770c967e 100644 --- a/console/types/address/Cargo.toml +++ b/console/types/address/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-console-types-address" -version = "0.16.17" +version = "0.16.18" authors = [ "The Aleo Team " ] description = "Type operations for a decentralized virtual machine" license = "Apache-2.0" @@ -8,19 +8,19 @@ edition = "2021" [dependencies.snarkvm-console-network-environment] path = "../../network/environment" -version = "=0.16.17" +version = "=0.16.18" [dependencies.snarkvm-console-types-boolean] path = "../boolean" -version = "=0.16.17" +version = "=0.16.18" [dependencies.snarkvm-console-types-field] path = "../field" -version = "=0.16.17" +version = "=0.16.18" [dependencies.snarkvm-console-types-group] path = "../group" -version = "=0.16.17" +version = "=0.16.18" [dev-dependencies.bincode] version = "1.3" diff --git a/console/types/boolean/Cargo.toml b/console/types/boolean/Cargo.toml index 44882ba270..f5f3e0a34d 100644 --- a/console/types/boolean/Cargo.toml +++ b/console/types/boolean/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-console-types-boolean" -version = "0.16.17" +version = "0.16.18" authors = [ "The Aleo Team " ] description = "Type operations for a decentralized virtual machine" license = "Apache-2.0" @@ -8,7 +8,7 @@ edition = "2021" [dependencies.snarkvm-console-network-environment] path = "../../network/environment" -version = "=0.16.17" +version = "=0.16.18" [dev-dependencies.bincode] version = "1.3" diff --git a/console/types/field/Cargo.toml b/console/types/field/Cargo.toml index 94ae1d9f7b..2cea1f5697 100644 --- a/console/types/field/Cargo.toml +++ b/console/types/field/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-console-types-field" -version = "0.16.17" +version = "0.16.18" authors = [ "The Aleo Team " ] description = "Type operations for a decentralized virtual machine" license = "Apache-2.0" @@ -8,11 +8,11 @@ edition = "2021" [dependencies.snarkvm-console-network-environment] path = "../../network/environment" -version = "=0.16.17" +version = "=0.16.18" [dependencies.snarkvm-console-types-boolean] path = "../boolean" -version = "=0.16.17" +version = "=0.16.18" [dependencies.zeroize] version = "1" diff --git a/console/types/group/Cargo.toml b/console/types/group/Cargo.toml index e518874ba1..eb3ca891a3 100644 --- a/console/types/group/Cargo.toml +++ b/console/types/group/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-console-types-group" -version = "0.16.17" +version = "0.16.18" authors = [ "The Aleo Team " ] description = "Type operations for a decentralized virtual machine" license = "Apache-2.0" @@ -8,19 +8,19 @@ edition = "2021" [dependencies.snarkvm-console-network-environment] path = "../../network/environment" -version = "=0.16.17" +version = "=0.16.18" [dependencies.snarkvm-console-types-boolean] path = "../boolean" -version = "=0.16.17" +version = "=0.16.18" [dependencies.snarkvm-console-types-field] path = "../field" -version = "=0.16.17" +version = "=0.16.18" [dependencies.snarkvm-console-types-scalar] path = "../scalar" -version = "=0.16.17" +version = "=0.16.18" [dev-dependencies.bincode] version = "1.3" diff --git a/console/types/integers/Cargo.toml b/console/types/integers/Cargo.toml index 6fff38d551..3ae75686d7 100644 --- a/console/types/integers/Cargo.toml +++ b/console/types/integers/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-console-types-integers" -version = "0.16.17" +version = "0.16.18" authors = [ "The Aleo Team " ] description = "Type operations for a decentralized virtual machine" license = "Apache-2.0" @@ -8,19 +8,19 @@ edition = "2021" [dependencies.snarkvm-console-network-environment] path = "../../network/environment" -version = "=0.16.17" +version = "=0.16.18" [dependencies.snarkvm-console-types-boolean] path = "../boolean" -version = "=0.16.17" +version = "=0.16.18" [dependencies.snarkvm-console-types-field] path = "../field" -version = "=0.16.17" +version = "=0.16.18" [dependencies.snarkvm-console-types-scalar] path = "../scalar" -version = "=0.16.17" +version = "=0.16.18" [dev-dependencies.bincode] version = "1.3" diff --git a/console/types/scalar/Cargo.toml b/console/types/scalar/Cargo.toml index 39f56b2ad0..cc3e09c618 100644 --- a/console/types/scalar/Cargo.toml +++ b/console/types/scalar/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-console-types-scalar" -version = "0.16.17" +version = "0.16.18" authors = [ "The Aleo Team " ] description = "Type operations for a decentralized virtual machine" license = "Apache-2.0" @@ -8,15 +8,15 @@ edition = "2021" [dependencies.snarkvm-console-network-environment] path = "../../network/environment" -version = "=0.16.17" +version = "=0.16.18" [dependencies.snarkvm-console-types-boolean] path = "../boolean" -version = "=0.16.17" +version = "=0.16.18" [dependencies.snarkvm-console-types-field] path = "../field" -version = "=0.16.17" +version = "=0.16.18" [dependencies.zeroize] version = "1" diff --git a/console/types/string/Cargo.toml b/console/types/string/Cargo.toml index 4607049f07..aaab7be9a9 100644 --- a/console/types/string/Cargo.toml +++ b/console/types/string/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-console-types-string" -version = "0.16.17" +version = "0.16.18" authors = [ "The Aleo Team " ] description = "Type operations for a decentralized virtual machine" license = "Apache-2.0" @@ -8,19 +8,19 @@ edition = "2021" [dependencies.snarkvm-console-network-environment] path = "../../network/environment" -version = "=0.16.17" +version = "=0.16.18" [dependencies.snarkvm-console-types-boolean] path = "../boolean" -version = "=0.16.17" +version = "=0.16.18" [dependencies.snarkvm-console-types-field] path = "../field" -version = "=0.16.17" +version = "=0.16.18" [dependencies.snarkvm-console-types-integers] path = "../integers" -version = "=0.16.17" +version = "=0.16.18" [dev-dependencies.bincode] version = "1.3" diff --git a/curves/Cargo.toml b/curves/Cargo.toml index f4c6544f1c..f6d9a3a62d 100644 --- a/curves/Cargo.toml +++ b/curves/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-curves" -version = "0.16.17" +version = "0.16.18" authors = [ "The Aleo Team " ] description = "Curves for a decentralized virtual machine" homepage = "https://aleo.org" @@ -36,12 +36,12 @@ harness = false [dependencies.snarkvm-fields] path = "../fields" -version = "=0.16.17" +version = "=0.16.18" default-features = false [dependencies.snarkvm-utilities] path = "../utilities" -version = "=0.16.17" +version = "=0.16.18" default-features = false [dependencies.rand] diff --git a/fields/Cargo.toml b/fields/Cargo.toml index eec87a569b..dac4900487 100644 --- a/fields/Cargo.toml +++ b/fields/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-fields" -version = "0.16.17" +version = "0.16.18" authors = [ "The Aleo Team " ] description = "Fields for a decentralized virtual machine" homepage = "https://aleo.org" @@ -25,7 +25,7 @@ edition = "2021" [dependencies.snarkvm-utilities] path = "../utilities" -version = "=0.16.17" +version = "=0.16.18" default-features = false [dependencies.aleo-std] diff --git a/ledger/Cargo.toml b/ledger/Cargo.toml index d651593bca..e73022bcb3 100644 --- a/ledger/Cargo.toml +++ b/ledger/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-ledger" -version = "0.16.17" +version = "0.16.18" authors = [ "The Aleo Team " ] description = "A node ledger for a decentralized virtual machine" homepage = "https://aleo.org" @@ -57,54 +57,54 @@ timer = [ "aleo-std/timer" ] [dependencies.console] package = "snarkvm-console" path = "../console" -version = "=0.16.17" +version = "=0.16.18" [dependencies.ledger-authority] package = "snarkvm-ledger-authority" path = "./authority" -version = "=0.16.17" +version = "=0.16.18" [dependencies.ledger-block] package = "snarkvm-ledger-block" path = "./block" -version = "=0.16.17" +version = "=0.16.18" [dependencies.ledger-coinbase] package = "snarkvm-ledger-coinbase" path = "./coinbase" -version = "=0.16.17" +version = "=0.16.18" [dependencies.ledger-committee] package = "snarkvm-ledger-committee" path = "./committee" -version = "=0.16.17" +version = "=0.16.18" [dependencies.ledger-narwhal] package = "snarkvm-ledger-narwhal" path = "./narwhal" -version = "=0.16.17" +version = "=0.16.18" [dependencies.ledger-query] package = "snarkvm-ledger-query" path = "./query" -version = "=0.16.17" +version = "=0.16.18" features = [ "query" ] [dependencies.ledger-store] package = "snarkvm-ledger-store" path = "./store" -version = "=0.16.17" +version = "=0.16.18" [dependencies.ledger-test-helpers] package = "snarkvm-ledger-test-helpers" path = "./test-helpers" -version = "=0.16.17" +version = "=0.16.18" optional = true [dependencies.synthesizer] package = "snarkvm-synthesizer" path = "../synthesizer" -version = "=0.16.17" +version = "=0.16.18" [dependencies.aleo-std] version = "0.1.24" diff --git a/ledger/authority/Cargo.toml b/ledger/authority/Cargo.toml index d64629f014..bb72df314b 100644 --- a/ledger/authority/Cargo.toml +++ b/ledger/authority/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-ledger-authority" -version = "0.16.17" +version = "0.16.18" authors = [ "The Aleo Team " ] description = "Data structures for a block authority in a decentralized virtual machine" homepage = "https://aleo.org" @@ -32,12 +32,12 @@ test-helpers = [ "narwhal-subdag/test-helpers" ] [dependencies.console] package = "snarkvm-console" path = "../../console" -version = "=0.16.17" +version = "=0.16.18" [dependencies.narwhal-subdag] package = "snarkvm-ledger-narwhal-subdag" path = "../narwhal/subdag" -version = "=0.16.17" +version = "=0.16.18" [dependencies.anyhow] version = "1" diff --git a/ledger/block/Cargo.toml b/ledger/block/Cargo.toml index bd70df400f..2199c907fc 100644 --- a/ledger/block/Cargo.toml +++ b/ledger/block/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-ledger-block" -version = "0.16.17" +version = "0.16.18" authors = [ "The Aleo Team " ] description = "A block for a decentralized virtual machine" homepage = "https://aleo.org" @@ -39,47 +39,47 @@ test = [ ] [dependencies.console] package = "snarkvm-console" path = "../../console" -version = "=0.16.17" +version = "=0.16.18" [dependencies.ledger-authority] package = "snarkvm-ledger-authority" path = "../authority" -version = "=0.16.17" +version = "=0.16.18" [dependencies.ledger-coinbase] package = "snarkvm-ledger-coinbase" path = "../../ledger/coinbase" -version = "=0.16.17" +version = "=0.16.18" [dependencies.ledger-committee] package = "snarkvm-ledger-committee" path = "../../ledger/committee" -version = "=0.16.17" +version = "=0.16.18" [dependencies.ledger-narwhal-batch-header] package = "snarkvm-ledger-narwhal-batch-header" path = "../narwhal/batch-header" -version = "=0.16.17" +version = "=0.16.18" [dependencies.ledger-narwhal-subdag] package = "snarkvm-ledger-narwhal-subdag" path = "../narwhal/subdag" -version = "=0.16.17" +version = "=0.16.18" [dependencies.ledger-narwhal-transmission-id] package = "snarkvm-ledger-narwhal-transmission-id" path = "../narwhal/transmission-id" -version = "=0.16.17" +version = "=0.16.18" [dependencies.synthesizer-program] package = "snarkvm-synthesizer-program" path = "../../synthesizer/program" -version = "=0.16.17" +version = "=0.16.18" [dependencies.synthesizer-snark] package = "snarkvm-synthesizer-snark" path = "../../synthesizer/snark" -version = "=0.16.17" +version = "=0.16.18" [dependencies.indexmap] version = "2.0" diff --git a/ledger/coinbase/Cargo.toml b/ledger/coinbase/Cargo.toml index 3da45ecd4d..4b7fd4bc64 100644 --- a/ledger/coinbase/Cargo.toml +++ b/ledger/coinbase/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-ledger-coinbase" -version = "0.16.17" +version = "0.16.18" authors = [ "The Aleo Team " ] description = "Coinbase puzzle for a decentralized virtual machine" homepage = "https://aleo.org" @@ -50,27 +50,27 @@ wasm = [ [dependencies.console] package = "snarkvm-console" path = "../../console" -version = "=0.16.17" +version = "=0.16.18" [dependencies.snarkvm-algorithms] path = "../../algorithms" -version = "=0.16.17" +version = "=0.16.18" [dependencies.snarkvm-curves] path = "../../curves" -version = "=0.16.17" +version = "=0.16.18" [dependencies.snarkvm-fields] path = "../../fields" -version = "=0.16.17" +version = "=0.16.18" [dependencies.snarkvm-synthesizer-snark] path = "../../synthesizer/snark" -version = "=0.16.17" +version = "=0.16.18" [dependencies.snarkvm-utilities] path = "../../utilities" -version = "=0.16.17" +version = "=0.16.18" default-features = false [dependencies.aleo-std] diff --git a/ledger/committee/Cargo.toml b/ledger/committee/Cargo.toml index bcd07550ea..aa3226d74b 100644 --- a/ledger/committee/Cargo.toml +++ b/ledger/committee/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-ledger-committee" -version = "0.16.17" +version = "0.16.18" authors = [ "The Aleo Team " ] description = "A committee for a decentralized virtual machine" homepage = "https://aleo.org" @@ -34,7 +34,7 @@ test-helpers = [ "prop-tests", "rand_distr" ] [dependencies.console] package = "snarkvm-console" path = "../../console" -version = "=0.16.17" +version = "=0.16.18" [dependencies.indexmap] version = "2.0" @@ -43,7 +43,7 @@ features = [ "serde", "rayon" ] [dependencies.metrics] package = "snarkvm-metrics" path = "../../metrics" -version = "=0.16.17" +version = "=0.16.18" optional = true [dependencies.serde_json] diff --git a/ledger/narwhal/Cargo.toml b/ledger/narwhal/Cargo.toml index a149a660dc..e6b309c77e 100644 --- a/ledger/narwhal/Cargo.toml +++ b/ledger/narwhal/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-ledger-narwhal" -version = "0.16.17" +version = "0.16.18" authors = [ "The Aleo Team " ] description = "Data structures for a Narwhal-style memory pool in a decentralized virtual machine" homepage = "https://aleo.org" @@ -64,37 +64,37 @@ transmission-id = [ "narwhal-transmission-id" ] [dependencies.narwhal-batch-certificate] package = "snarkvm-ledger-narwhal-batch-certificate" path = "./batch-certificate" -version = "=0.16.17" +version = "=0.16.18" optional = true [dependencies.narwhal-batch-header] package = "snarkvm-ledger-narwhal-batch-header" path = "./batch-header" -version = "=0.16.17" +version = "=0.16.18" optional = true [dependencies.narwhal-data] package = "snarkvm-ledger-narwhal-data" path = "./data" -version = "=0.16.17" +version = "=0.16.18" optional = true [dependencies.narwhal-subdag] package = "snarkvm-ledger-narwhal-subdag" path = "./subdag" -version = "=0.16.17" +version = "=0.16.18" optional = true [dependencies.narwhal-transmission] package = "snarkvm-ledger-narwhal-transmission" path = "./transmission" -version = "=0.16.17" +version = "=0.16.18" optional = true [dependencies.narwhal-transmission-id] package = "snarkvm-ledger-narwhal-transmission-id" path = "./transmission-id" -version = "=0.16.17" +version = "=0.16.18" optional = true [dev-dependencies.snarkvm-ledger-narwhal] diff --git a/ledger/narwhal/batch-certificate/Cargo.toml b/ledger/narwhal/batch-certificate/Cargo.toml index 8393b9b6bb..45f793a39c 100644 --- a/ledger/narwhal/batch-certificate/Cargo.toml +++ b/ledger/narwhal/batch-certificate/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-ledger-narwhal-batch-certificate" -version = "0.16.17" +version = "0.16.18" authors = [ "The Aleo Team " ] description = "A batch certificate for a Narwhal-style memory pool in a decentralized virtual machine" homepage = "https://aleo.org" @@ -32,17 +32,17 @@ test-helpers = [ "narwhal-batch-header/test-helpers" ] [dependencies.console] package = "snarkvm-console" path = "../../../console" -version = "=0.16.17" +version = "=0.16.18" [dependencies.narwhal-batch-header] package = "snarkvm-ledger-narwhal-batch-header" path = "../batch-header" -version = "=0.16.17" +version = "=0.16.18" [dependencies.narwhal-transmission-id] package = "snarkvm-ledger-narwhal-transmission-id" path = "../transmission-id" -version = "=0.16.17" +version = "=0.16.18" [dependencies.indexmap] version = "2.0" diff --git a/ledger/narwhal/batch-header/Cargo.toml b/ledger/narwhal/batch-header/Cargo.toml index aa6d75ce06..17a0219208 100644 --- a/ledger/narwhal/batch-header/Cargo.toml +++ b/ledger/narwhal/batch-header/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-ledger-narwhal-batch-header" -version = "0.16.17" +version = "0.16.18" authors = [ "The Aleo Team " ] description = "A batch header for a Narwhal-style memory pool in a decentralized virtual machine" homepage = "https://aleo.org" @@ -32,12 +32,12 @@ test-helpers = [ "narwhal-transmission-id/test-helpers", "time" ] [dependencies.console] package = "snarkvm-console" path = "../../../console" -version = "=0.16.17" +version = "=0.16.18" [dependencies.narwhal-transmission-id] package = "snarkvm-ledger-narwhal-transmission-id" path = "../transmission-id" -version = "=0.16.17" +version = "=0.16.18" [dependencies.indexmap] version = "2.0" diff --git a/ledger/narwhal/data/Cargo.toml b/ledger/narwhal/data/Cargo.toml index a47b1ab8f6..dfe23281dd 100644 --- a/ledger/narwhal/data/Cargo.toml +++ b/ledger/narwhal/data/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-ledger-narwhal-data" -version = "0.16.17" +version = "0.16.18" authors = [ "The Aleo Team " ] description = "A batch certificate for a Narwhal-style memory pool in a decentralized virtual machine" homepage = "https://aleo.org" @@ -29,7 +29,7 @@ async = [ "tokio" ] [dependencies.console] package = "snarkvm-console" path = "../../../console" -version = "=0.16.17" +version = "=0.16.18" [dependencies.bytes] version = "1" diff --git a/ledger/narwhal/subdag/Cargo.toml b/ledger/narwhal/subdag/Cargo.toml index 9f7eebc578..1bb9144660 100644 --- a/ledger/narwhal/subdag/Cargo.toml +++ b/ledger/narwhal/subdag/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-ledger-narwhal-subdag" -version = "0.16.17" +version = "0.16.18" authors = [ "The Aleo Team " ] description = "A subdag for a Narwhal-style memory pool in a decentralized virtual machine" homepage = "https://aleo.org" @@ -32,22 +32,22 @@ test-helpers = [ "narwhal-batch-certificate/test-helpers" ] [dependencies.console] package = "snarkvm-console" path = "../../../console" -version = "=0.16.17" +version = "=0.16.18" [dependencies.narwhal-batch-certificate] package = "snarkvm-ledger-narwhal-batch-certificate" path = "../batch-certificate" -version = "=0.16.17" +version = "=0.16.18" [dependencies.narwhal-batch-header] package = "snarkvm-ledger-narwhal-batch-header" path = "../batch-header" -version = "=0.16.17" +version = "=0.16.18" [dependencies.narwhal-transmission-id] package = "snarkvm-ledger-narwhal-transmission-id" path = "../transmission-id" -version = "=0.16.17" +version = "=0.16.18" [dependencies.indexmap] version = "2.0" diff --git a/ledger/narwhal/transmission-id/Cargo.toml b/ledger/narwhal/transmission-id/Cargo.toml index a4011b8a7d..0ee14e6901 100644 --- a/ledger/narwhal/transmission-id/Cargo.toml +++ b/ledger/narwhal/transmission-id/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-ledger-narwhal-transmission-id" -version = "0.16.17" +version = "0.16.18" authors = [ "The Aleo Team " ] description = "A transmission ID for a Narwhal-style memory pool in a decentralized virtual machine" homepage = "https://aleo.org" @@ -32,12 +32,12 @@ test-helpers = [ ] [dependencies.console] package = "snarkvm-console" path = "../../../console" -version = "=0.16.17" +version = "=0.16.18" [dependencies.ledger-coinbase] package = "snarkvm-ledger-coinbase" path = "../../coinbase" -version = "=0.16.17" +version = "=0.16.18" [dev-dependencies.bincode] version = "1.3" diff --git a/ledger/narwhal/transmission/Cargo.toml b/ledger/narwhal/transmission/Cargo.toml index d370f98cba..11f9ef959e 100644 --- a/ledger/narwhal/transmission/Cargo.toml +++ b/ledger/narwhal/transmission/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-ledger-narwhal-transmission" -version = "0.16.17" +version = "0.16.18" authors = [ "The Aleo Team " ] description = "A transmission for a Narwhal-style memory pool in a decentralized virtual machine" homepage = "https://aleo.org" @@ -32,22 +32,22 @@ test-helpers = [ ] [dependencies.console] package = "snarkvm-console" path = "../../../console" -version = "=0.16.17" +version = "=0.16.18" [dependencies.ledger-block] package = "snarkvm-ledger-block" path = "../../block" -version = "=0.16.17" +version = "=0.16.18" [dependencies.ledger-coinbase] package = "snarkvm-ledger-coinbase" path = "../../coinbase" -version = "=0.16.17" +version = "=0.16.18" [dependencies.ledger-narwhal-data] package = "snarkvm-ledger-narwhal-data" path = "../data" -version = "=0.16.17" +version = "=0.16.18" [dependencies.bytes] version = "1" diff --git a/ledger/query/Cargo.toml b/ledger/query/Cargo.toml index 106b61e3a5..37aa050cff 100644 --- a/ledger/query/Cargo.toml +++ b/ledger/query/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-ledger-query" -version = "0.16.17" +version = "0.16.18" authors = [ "The Aleo Team " ] description = "A query for a decentralized virtual machine" homepage = "https://aleo.org" @@ -34,18 +34,18 @@ query = [ "ledger-store", "synthesizer-program", "ureq" ] [dependencies.console] package = "snarkvm-console" path = "../../console" -version = "=0.16.17" +version = "=0.16.18" [dependencies.ledger-store] package = "snarkvm-ledger-store" path = "../store" -version = "=0.16.17" +version = "=0.16.18" optional = true [dependencies.synthesizer-program] package = "snarkvm-synthesizer-program" path = "../../synthesizer/program" -version = "=0.16.17" +version = "=0.16.18" optional = true [dependencies.async-trait] diff --git a/ledger/store/Cargo.toml b/ledger/store/Cargo.toml index 6684dce041..50c50d1635 100644 --- a/ledger/store/Cargo.toml +++ b/ledger/store/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-ledger-store" -version = "0.16.17" +version = "0.16.18" authors = [ "The Aleo Team " ] description = "A data store for a decentralized virtual machine" homepage = "https://aleo.org" @@ -42,42 +42,42 @@ test = [ ] [dependencies.console] package = "snarkvm-console" path = "../../console" -version = "=0.16.17" +version = "=0.16.18" [dependencies.ledger-authority] package = "snarkvm-ledger-authority" path = "../authority" -version = "=0.16.17" +version = "=0.16.18" [dependencies.ledger-block] package = "snarkvm-ledger-block" path = "../block" -version = "=0.16.17" +version = "=0.16.18" [dependencies.ledger-coinbase] package = "snarkvm-ledger-coinbase" path = "../coinbase" -version = "=0.16.17" +version = "=0.16.18" [dependencies.ledger-committee] package = "snarkvm-ledger-committee" path = "../committee" -version = "=0.16.17" +version = "=0.16.18" [dependencies.ledger-narwhal-batch-certificate] package = "snarkvm-ledger-narwhal-batch-certificate" path = "../narwhal/batch-certificate" -version = "=0.16.17" +version = "=0.16.18" [dependencies.synthesizer-program] package = "snarkvm-synthesizer-program" path = "../../synthesizer/program" -version = "=0.16.17" +version = "=0.16.18" [dependencies.synthesizer-snark] package = "snarkvm-synthesizer-snark" path = "../../synthesizer/snark" -version = "=0.16.17" +version = "=0.16.18" [dependencies.aleo-std-storage] version = "0.1.7" diff --git a/ledger/test-helpers/Cargo.toml b/ledger/test-helpers/Cargo.toml index 8590b29ca3..a529d1519f 100644 --- a/ledger/test-helpers/Cargo.toml +++ b/ledger/test-helpers/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-ledger-test-helpers" -version = "0.16.17" +version = "0.16.18" authors = [ "The Aleo Team " ] description = "Test helpers for a decentralized virtual machine" homepage = "https://aleo.org" @@ -19,39 +19,39 @@ edition = "2021" [dependencies.console] package = "snarkvm-console" path = "../../console" -version = "=0.16.17" +version = "=0.16.18" [dependencies.circuit] package = "snarkvm-circuit" path = "../../circuit" -version = "=0.16.17" +version = "=0.16.18" [dependencies.ledger-block] package = "snarkvm-ledger-block" path = "../block" -version = "=0.16.17" +version = "=0.16.18" [dependencies.ledger-query] package = "snarkvm-ledger-query" path = "../query" -version = "=0.16.17" +version = "=0.16.18" default-features = false features = [ "query" ] [dependencies.ledger-store] package = "snarkvm-ledger-store" path = "../store" -version = "=0.16.17" +version = "=0.16.18" [dependencies.synthesizer-program] package = "snarkvm-synthesizer-program" path = "../../synthesizer/program" -version = "=0.16.17" +version = "=0.16.18" [dependencies.synthesizer-process] package = "snarkvm-synthesizer-process" path = "../../synthesizer/process" -version = "=0.16.17" +version = "=0.16.18" [dependencies.once_cell] version = "1.18" diff --git a/metrics/Cargo.toml b/metrics/Cargo.toml index 05440115c0..25b5135568 100644 --- a/metrics/Cargo.toml +++ b/metrics/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-metrics" -version = "0.16.17" +version = "0.16.18" authors = [ "The Aleo Team " ] description = "Metrics for a decentralized virtual machine" homepage = "https://aleo.org" diff --git a/parameters/Cargo.toml b/parameters/Cargo.toml index b4ed86b72d..d3e9644721 100644 --- a/parameters/Cargo.toml +++ b/parameters/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-parameters" -version = "0.16.17" +version = "0.16.18" authors = [ "The Aleo Team " ] description = "Parameters for a decentralized virtual machine" homepage = "https://aleo.org" @@ -31,12 +31,12 @@ wasm = [ "encoding", "js-sys", "web-sys" ] [dependencies.snarkvm-curves] path = "../curves" -version = "=0.16.17" +version = "=0.16.18" default-features = false [dependencies.snarkvm-utilities] path = "../utilities" -version = "=0.16.17" +version = "=0.16.18" [dependencies.aleo-std] version = "0.1.24" diff --git a/synthesizer/Cargo.toml b/synthesizer/Cargo.toml index 6265b3f9ec..37ea325dd3 100644 --- a/synthesizer/Cargo.toml +++ b/synthesizer/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-synthesizer" -version = "0.16.17" +version = "0.16.18" authors = [ "The Aleo Team " ] description = "Synthesizer for a decentralized virtual machine" homepage = "https://aleo.org" @@ -69,61 +69,61 @@ harness = false [dependencies.algorithms] package = "snarkvm-algorithms" path = "../algorithms" -version = "=0.16.17" +version = "=0.16.18" [dependencies.circuit] package = "snarkvm-circuit" path = "../circuit" -version = "=0.16.17" +version = "=0.16.18" [dependencies.console] package = "snarkvm-console" path = "../console" -version = "=0.16.17" +version = "=0.16.18" [dependencies.ledger-block] package = "snarkvm-ledger-block" path = "../ledger/block" -version = "=0.16.17" +version = "=0.16.18" [dependencies.ledger-coinbase] package = "snarkvm-ledger-coinbase" path = "../ledger/coinbase" -version = "=0.16.17" +version = "=0.16.18" [dependencies.ledger-committee] package = "snarkvm-ledger-committee" path = "../ledger/committee" -version = "=0.16.17" +version = "=0.16.18" [dependencies.ledger-query] package = "snarkvm-ledger-query" path = "../ledger/query" -version = "=0.16.17" +version = "=0.16.18" default-features = false features = [ "query" ] [dependencies.ledger-store] package = "snarkvm-ledger-store" path = "../ledger/store" -version = "=0.16.17" +version = "=0.16.18" [dependencies.synthesizer-process] package = "snarkvm-synthesizer-process" path = "./process" -version = "=0.16.17" +version = "=0.16.18" optional = true [dependencies.synthesizer-program] package = "snarkvm-synthesizer-program" path = "./program" -version = "=0.16.17" +version = "=0.16.18" optional = true [dependencies.synthesizer-snark] package = "snarkvm-synthesizer-snark" path = "./snark" -version = "=0.16.17" +version = "=0.16.18" optional = true [dependencies.aleo-std] diff --git a/synthesizer/process/Cargo.toml b/synthesizer/process/Cargo.toml index 5402fa95f1..8c2ad697aa 100644 --- a/synthesizer/process/Cargo.toml +++ b/synthesizer/process/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-synthesizer-process" -version = "0.16.17" +version = "0.16.18" authors = [ "The Aleo Team " ] description = "A process for a decentralized virtual machine" homepage = "https://aleo.org" @@ -48,45 +48,45 @@ timer = [ "aleo-std/timer" ] [dependencies.console] package = "snarkvm-console" path = "../../console" -version = "=0.16.17" +version = "=0.16.18" default-features = false features = [ "network", "program", "types" ] [dependencies.circuit] package = "snarkvm-circuit" path = "../../circuit" -version = "=0.16.17" +version = "=0.16.18" [dependencies.ledger-block] package = "snarkvm-ledger-block" path = "../../ledger/block" -version = "=0.16.17" +version = "=0.16.18" [dependencies.ledger-query] package = "snarkvm-ledger-query" path = "../../ledger/query" -version = "=0.16.17" +version = "=0.16.18" default-features = false [dependencies.ledger-store] package = "snarkvm-ledger-store" path = "../../ledger/store" -version = "=0.16.17" +version = "=0.16.18" [dependencies.synthesizer-program] package = "snarkvm-synthesizer-program" path = "../../synthesizer/program" -version = "=0.16.17" +version = "=0.16.18" [dependencies.synthesizer-snark] package = "snarkvm-synthesizer-snark" path = "../../synthesizer/snark" -version = "=0.16.17" +version = "=0.16.18" [dependencies.utilities] package = "snarkvm-utilities" path = "../../utilities" -version = "=0.16.17" +version = "=0.16.18" [dependencies.aleo-std] version = "0.1.24" diff --git a/synthesizer/program/Cargo.toml b/synthesizer/program/Cargo.toml index 96da3fb6e7..0200a43c59 100644 --- a/synthesizer/program/Cargo.toml +++ b/synthesizer/program/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-synthesizer-program" -version = "0.16.17" +version = "0.16.18" authors = [ "The Aleo Team " ] description = "Program for a decentralized virtual machine" homepage = "https://aleo.org" @@ -31,12 +31,12 @@ wasm = [ "console/wasm" ] [dependencies.circuit] package = "snarkvm-circuit" path = "../../circuit" -version = "=0.16.17" +version = "=0.16.18" [dependencies.console] package = "snarkvm-console" path = "../../console" -version = "=0.16.17" +version = "=0.16.18" default-features = false features = [ "account", "network", "program", "types" ] diff --git a/synthesizer/snark/Cargo.toml b/synthesizer/snark/Cargo.toml index ce56d1e5b3..53af02e057 100644 --- a/synthesizer/snark/Cargo.toml +++ b/synthesizer/snark/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-synthesizer-snark" -version = "0.16.17" +version = "0.16.18" authors = [ "The Aleo Team " ] description = "SNARK wrappers for a decentralized virtual machine" homepage = "https://aleo.org" @@ -33,18 +33,18 @@ wasm = [ "console/wasm", "snarkvm-algorithms/wasm" ] [dependencies.circuit] package = "snarkvm-circuit" path = "../../circuit" -version = "=0.16.17" +version = "=0.16.18" [dependencies.console] package = "snarkvm-console" path = "../../console" -version = "=0.16.17" +version = "=0.16.18" default-features = false features = [ "network" ] [dependencies.snarkvm-algorithms] path = "../../algorithms" -version = "=0.16.17" +version = "=0.16.18" [dependencies.bincode] version = "1" diff --git a/utilities/Cargo.toml b/utilities/Cargo.toml index 977bc93fb9..da8900e645 100644 --- a/utilities/Cargo.toml +++ b/utilities/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-utilities" -version = "0.16.17" +version = "0.16.18" authors = [ "The Aleo Team " ] description = "Utilities for a decentralized virtual machine" homepage = "https://aleo.org" @@ -25,7 +25,7 @@ edition = "2021" [dependencies.snarkvm-utilities-derives] path = "./derives" -version = "=0.16.17" +version = "=0.16.18" optional = true [dependencies.aleo-std] diff --git a/utilities/derives/Cargo.toml b/utilities/derives/Cargo.toml index cb87818787..0f83e64c5f 100644 --- a/utilities/derives/Cargo.toml +++ b/utilities/derives/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-utilities-derives" -version = "0.16.17" +version = "0.16.18" authors = [ "The Aleo Team " ] description = "Canonical serialization for a decentralized virtual machine" homepage = "https://aleo.org" diff --git a/wasm/Cargo.toml b/wasm/Cargo.toml index f95a4ff469..3e13327016 100644 --- a/wasm/Cargo.toml +++ b/wasm/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-wasm" -version = "0.16.17" +version = "0.16.18" authors = [ "The Aleo Team " ] description = "WASM for a decentralized virtual machine" homepage = "https://aleo.org" @@ -51,54 +51,54 @@ utilities = [ "snarkvm-utilities" ] [dependencies.snarkvm-circuit-network] path = "../circuit/network" -version = "=0.16.17" +version = "=0.16.18" features = [ "wasm" ] optional = true [dependencies.snarkvm-console] path = "../console" -version = "=0.16.17" +version = "=0.16.18" features = [ "wasm" ] optional = true [dependencies.snarkvm-curves] path = "../curves" -version = "=0.16.17" +version = "=0.16.18" optional = true [dependencies.snarkvm-fields] path = "../fields" -version = "=0.16.17" +version = "=0.16.18" optional = true [dependencies.snarkvm-ledger-block] path = "../ledger/block" -version = "=0.16.17" +version = "=0.16.18" features = [ "wasm" ] optional = true [dependencies.snarkvm-ledger-query] path = "../ledger/query" -version = "=0.16.17" +version = "=0.16.18" features = [ "async", "wasm" ] optional = true [dependencies.snarkvm-ledger-store] path = "../ledger/store" -version = "=0.16.17" +version = "=0.16.18" features = [ "wasm" ] optional = true [dependencies.snarkvm-synthesizer] path = "../synthesizer" -version = "=0.16.17" +version = "=0.16.18" default-features = false features = [ "async", "wasm" ] optional = true [dependencies.snarkvm-utilities] path = "../utilities" -version = "=0.16.17" +version = "=0.16.18" features = [ "wasm" ] optional = true From f9a77bd34ad0de511faf74ab9047323d5d0222d2 Mon Sep 17 00:00:00 2001 From: ljedrz Date: Mon, 29 Jan 2024 12:43:02 +0100 Subject: [PATCH 249/298] feat: allow the ledger to be loaded from a custom location Signed-off-by: ljedrz --- ledger/src/get.rs | 2 +- ledger/src/lib.rs | 16 ++++++++++------ ledger/src/tests.rs | 7 ++++--- 3 files changed, 15 insertions(+), 10 deletions(-) diff --git a/ledger/src/get.rs b/ledger/src/get.rs index 9058f89d4b..750b9f22f4 100644 --- a/ledger/src/get.rs +++ b/ledger/src/get.rs @@ -257,7 +257,7 @@ mod tests { let genesis = Block::from_bytes_le(CurrentNetwork::genesis_bytes()).unwrap(); // Initialize a new ledger. - let ledger = CurrentLedger::load(genesis.clone(), None).unwrap(); + let ledger = CurrentLedger::load(genesis.clone(), StorageMode::Production).unwrap(); // Retrieve the genesis block. let candidate = ledger.get_block(0).unwrap(); // Ensure the genesis block matches. diff --git a/ledger/src/lib.rs b/ledger/src/lib.rs index 175151bb46..c56fc67c69 100644 --- a/ledger/src/lib.rs +++ b/ledger/src/lib.rs @@ -62,7 +62,10 @@ use synthesizer::{ vm::VM, }; -use aleo_std::prelude::{finish, lap, timer}; +use aleo_std::{ + prelude::{finish, lap, timer}, + StorageMode, +}; use anyhow::Result; use core::ops::Range; use indexmap::IndexMap; @@ -108,13 +111,13 @@ pub struct Ledger> { impl> Ledger { /// Loads the ledger from storage. - pub fn load(genesis_block: Block, dev: Option) -> Result { + pub fn load(genesis_block: Block, storage_mode: StorageMode) -> Result { let timer = timer!("Ledger::load"); // Retrieve the genesis hash. let genesis_hash = genesis_block.hash(); // Initialize the ledger. - let ledger = Self::load_unchecked(genesis_block, dev)?; + let ledger = Self::load_unchecked(genesis_block, storage_mode)?; // Ensure the ledger contains the correct genesis block. if !ledger.contains_block_hash(&genesis_hash)? { @@ -140,12 +143,12 @@ impl> Ledger { } /// Loads the ledger from storage, without performing integrity checks. - pub fn load_unchecked(genesis_block: Block, dev: Option) -> Result { + pub fn load_unchecked(genesis_block: Block, storage_mode: StorageMode) -> Result { let timer = timer!("Ledger::load_unchecked"); info!("Loading the ledger from storage..."); // Initialize the consensus store. - let store = match ConsensusStore::::open(dev) { + let store = match ConsensusStore::::open(storage_mode) { Ok(store) => store, Err(e) => bail!("Failed to load ledger (run 'snarkos clean' and try again)\n\n{e}\n"), }; @@ -383,6 +386,7 @@ impl> Ledger { #[cfg(test)] pub(crate) mod test_helpers { use crate::Ledger; + use aleo_std::StorageMode; use console::{ account::{Address, PrivateKey, ViewKey}, network::Testnet3, @@ -439,7 +443,7 @@ pub(crate) mod test_helpers { // Create a genesis block. let genesis = VM::from(store).unwrap().genesis_beacon(&private_key, rng).unwrap(); // Initialize the ledger with the genesis block. - let ledger = CurrentLedger::load(genesis.clone(), None).unwrap(); + let ledger = CurrentLedger::load(genesis.clone(), StorageMode::Production).unwrap(); // Ensure the genesis block is correct. assert_eq!(genesis, ledger.get_block(0).unwrap()); // Return the ledger. diff --git a/ledger/src/tests.rs b/ledger/src/tests.rs index be9c3a9da7..bc60cfab8a 100644 --- a/ledger/src/tests.rs +++ b/ledger/src/tests.rs @@ -17,6 +17,7 @@ use crate::{ test_helpers::{CurrentLedger, CurrentNetwork}, RecordsFilter, }; +use aleo_std::StorageMode; use console::{ account::{Address, PrivateKey}, network::prelude::*, @@ -38,7 +39,7 @@ fn test_load() { let genesis = VM::from(store).unwrap().genesis_beacon(&private_key, rng).unwrap(); // Initialize the ledger with the genesis block. - let ledger = CurrentLedger::load(genesis.clone(), None).unwrap(); + let ledger = CurrentLedger::load(genesis.clone(), StorageMode::Production).unwrap(); assert_eq!(ledger.latest_hash(), genesis.hash()); assert_eq!(ledger.latest_height(), genesis.height()); assert_eq!(ledger.latest_round(), genesis.round()); @@ -51,14 +52,14 @@ fn test_load_unchecked() { let genesis = crate::test_helpers::sample_genesis_block(); // Initialize the ledger without checks. - let ledger = CurrentLedger::load_unchecked(genesis.clone(), None).unwrap(); + let ledger = CurrentLedger::load_unchecked(genesis.clone(), StorageMode::Production).unwrap(); assert_eq!(ledger.latest_hash(), genesis.hash()); assert_eq!(ledger.latest_height(), genesis.height()); assert_eq!(ledger.latest_round(), genesis.round()); assert_eq!(ledger.latest_block(), genesis); // Initialize the ledger with the genesis block. - let ledger = CurrentLedger::load(genesis.clone(), None).unwrap(); + let ledger = CurrentLedger::load(genesis.clone(), StorageMode::Production).unwrap(); assert_eq!(ledger.latest_hash(), genesis.hash()); assert_eq!(ledger.latest_height(), genesis.height()); assert_eq!(ledger.latest_round(), genesis.round()); From 2c5ddb17ca8279339fe71ac5442c2111066be1ac Mon Sep 17 00:00:00 2001 From: ljedrz Date: Mon, 22 Jan 2024 10:08:25 +0100 Subject: [PATCH 250/298] cleanup: fix compilation warnings Signed-off-by: ljedrz --- circuit/environment/src/lib.rs | 1 + circuit/environment/src/macros/mod.rs | 3 +++ fields/src/lib.rs | 1 + synthesizer/process/src/stack/call/mod.rs | 3 +-- utilities/src/serialize/impls.rs | 2 +- utilities/src/serialize/mod.rs | 1 + utilities/src/serialize/traits.rs | 7 +------ 7 files changed, 9 insertions(+), 9 deletions(-) diff --git a/circuit/environment/src/lib.rs b/circuit/environment/src/lib.rs index 01c93b598d..9443e5eabd 100644 --- a/circuit/environment/src/lib.rs +++ b/circuit/environment/src/lib.rs @@ -29,6 +29,7 @@ pub mod helpers; pub use helpers::*; pub mod macros; +#[allow(unused_imports)] pub use macros::*; pub mod traits; diff --git a/circuit/environment/src/macros/mod.rs b/circuit/environment/src/macros/mod.rs index 2aa1051a4a..bed7fb825f 100644 --- a/circuit/environment/src/macros/mod.rs +++ b/circuit/environment/src/macros/mod.rs @@ -13,10 +13,13 @@ // limitations under the License. mod metrics; +#[allow(unused_imports)] pub use metrics::*; mod scope; +#[allow(unused_imports)] pub use scope::*; mod witness; +#[allow(unused_imports)] pub use witness::*; diff --git a/fields/src/lib.rs b/fields/src/lib.rs index f2037076c9..52b1ac0c3d 100644 --- a/fields/src/lib.rs +++ b/fields/src/lib.rs @@ -42,6 +42,7 @@ mod legendre; pub use legendre::*; mod to_field_vec; +#[allow(unused_imports)] pub use to_field_vec::*; pub mod traits; diff --git a/synthesizer/process/src/stack/call/mod.rs b/synthesizer/process/src/stack/call/mod.rs index b44231295f..30f0a03506 100644 --- a/synthesizer/process/src/stack/call/mod.rs +++ b/synthesizer/process/src/stack/call/mod.rs @@ -66,8 +66,7 @@ impl CallTrait for Call { let timer = timer!("Call::evaluate"); // Load the operands values. - let inputs: Vec<_> = - self.operands().iter().map(|operand| registers.load(stack.deref(), operand)).try_collect()?; + let inputs: Vec<_> = self.operands().iter().map(|operand| registers.load(stack, operand)).try_collect()?; // Retrieve the substack and resource. let (substack, resource) = match self.operator() { diff --git a/utilities/src/serialize/impls.rs b/utilities/src/serialize/impls.rs index dccc02981e..ee09a23478 100644 --- a/utilities/src/serialize/impls.rs +++ b/utilities/src/serialize/impls.rs @@ -13,7 +13,7 @@ // limitations under the License. pub use crate::{ - io::{self, Read, Write}, + io::{Read, Write}, FromBytes, ToBytes, Vec, diff --git a/utilities/src/serialize/mod.rs b/utilities/src/serialize/mod.rs index 8147e6f1a7..00048a9ea2 100644 --- a/utilities/src/serialize/mod.rs +++ b/utilities/src/serialize/mod.rs @@ -19,6 +19,7 @@ mod helpers; pub use helpers::*; mod impls; +#[allow(unused_imports)] pub use impls::*; mod flags; diff --git a/utilities/src/serialize/traits.rs b/utilities/src/serialize/traits.rs index ae6ca9b58d..373ca02abd 100644 --- a/utilities/src/serialize/traits.rs +++ b/utilities/src/serialize/traits.rs @@ -12,13 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. +pub use crate::io::{Read, Write}; use crate::SerializationError; -pub use crate::{ - io::{self, Read, Write}, - FromBytes, - ToBytes, - Vec, -}; use serde::de::{self, DeserializeOwned, Deserializer}; From 71df26e33aef0318ba65f6fa4f9185c4b4c1497f Mon Sep 17 00:00:00 2001 From: randomsleep Date: Tue, 30 Jan 2024 23:18:13 +0800 Subject: [PATCH 251/298] fix: is_bond and is_unbond match credits.aleo --- ledger/block/src/transition/mod.rs | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/ledger/block/src/transition/mod.rs b/ledger/block/src/transition/mod.rs index 26ee80ac41..136b417e43 100644 --- a/ledger/block/src/transition/mod.rs +++ b/ledger/block/src/transition/mod.rs @@ -298,16 +298,22 @@ impl Transition { } impl Transition { - /// Returns `true` if this is a `bond` transition. + /// Returns `true` if this is a `bond_public` transition. #[inline] - pub fn is_bond(&self) -> bool { - self.program_id.to_string() == "credits.aleo" && self.function_name.to_string() == "bond" + pub fn is_bond_public(&self) -> bool { + self.inputs.len() == 2 + && self.outputs.is_empty() + && self.program_id.to_string() == "credits.aleo" + && self.function_name.to_string() == "bond_public" } - /// Returns `true` if this is an `unbond` transition. + /// Returns `true` if this is an `unbond_public` transition. #[inline] - pub fn is_unbond(&self) -> bool { - self.program_id.to_string() == "credits.aleo" && self.function_name.to_string() == "unbond" + pub fn is_unbond_public(&self) -> bool { + self.inputs.len() == 2 + && self.outputs.is_empty() + && self.program_id.to_string() == "credits.aleo" + && self.function_name.to_string() == "unbond_public" } /// Returns `true` if this is a `fee_private` transition. From cc87b9896d2fe71dc3d68505372536a435844169 Mon Sep 17 00:00:00 2001 From: evan-schott <53463459+evan-schott@users.noreply.github.com> Date: Tue, 30 Jan 2024 22:21:10 -0800 Subject: [PATCH 252/298] Remove redundant check --- synthesizer/process/src/stack/execute.rs | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/synthesizer/process/src/stack/execute.rs b/synthesizer/process/src/stack/execute.rs index b0c6a37a0d..11954e54f0 100644 --- a/synthesizer/process/src/stack/execute.rs +++ b/synthesizer/process/src/stack/execute.rs @@ -421,15 +421,7 @@ impl StackExecute for Stack { lap!(timer, "Save the transition"); } // If the circuit is in `CheckDeployment` mode, then save the assignment. - else if let CallStack::CheckDeployment(_, _, ref assignments, constraint_limit) = registers.call_stack() { - // Ensure the assignment matches the constraint limit. - if let Some(constraint_limit) = constraint_limit { - ensure!( - assignment.num_constraints() == constraint_limit, - "The synthesized number of constraints ({}) does not match the declared limit in the verifying key ({constraint_limit})", - assignment.num_constraints(), - ); - } + else if let CallStack::CheckDeployment(_, _, ref assignments, _) = registers.call_stack() { // Construct the call metrics. let metrics = CallMetrics { program_id: *self.program_id(), From 1b02d5c1784d400291029226c8bbb7f5e1144c7e Mon Sep 17 00:00:00 2001 From: evan-schott <53463459+evan-schott@users.noreply.github.com> Date: Tue, 30 Jan 2024 22:21:30 -0800 Subject: [PATCH 253/298] Revise tests --- synthesizer/src/vm/mod.rs | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-) diff --git a/synthesizer/src/vm/mod.rs b/synthesizer/src/vm/mod.rs index c4f8108981..622420beeb 100644 --- a/synthesizer/src/vm/mod.rs +++ b/synthesizer/src/vm/mod.rs @@ -1148,7 +1148,7 @@ function do: let transaction = vm.deploy(&private_key, &program, None, 0, None, rng).unwrap(); // Destructure the deployment transaction. - let Transaction::Deploy(txid, program_owner, deployment, fee) = transaction else { + let Transaction::Deploy(_, program_owner, deployment, fee) = transaction else { panic!("Expected a deployment transaction"); }; @@ -1161,8 +1161,8 @@ function do: vks_with_overreport.push((*id, (vk, cert.clone()))); } - // Compute the required fee. - let required_fee = *fee.base_amount().unwrap() + 1000; // TODO: calculate exact + // Each additional constraint costs 25 microcredits, so we need to increase the fee by 25 microcredits. + let required_fee = *fee.base_amount().unwrap() + 25; // Authorize a new fee. let fee_authorization = vm .authorize_fee_public(&private_key, required_fee, 0, deployment.as_ref().to_deployment_id().unwrap(), rng) @@ -1170,17 +1170,12 @@ function do: // Compute the fee. let fee = vm.execute_fee_authorization(fee_authorization, None, rng).unwrap(); - // Create a new deployment tranasction with the overreported verifying keys. + // Create a new deployment transaction with the overreported verifying keys. let adjusted_deployment = Deployment::new(deployment.edition(), deployment.program().clone(), vks_with_overreport).unwrap(); - let adjusted_transaction = Transaction::Deploy(txid, program_owner, Box::new(adjusted_deployment), fee); + let adjusted_transaction = Transaction::from_deployment(program_owner, adjusted_deployment, fee).unwrap(); - // Verify the deployment transaction. It should fail because the num_constraints in the vk are not correct. - let res = vm.check_transaction(&adjusted_transaction, None, rng); - println!("Result of check transaction: {:?}", res); assert!(vm.check_transaction(&adjusted_transaction, None, rng).is_err()); - - println!("Test if we reach this code"); } #[test] @@ -1227,17 +1222,13 @@ function do: vks_with_underreport.push((*id, (vk, cert.clone()))); } - // Create a new deployment tranasction with the underreported verifying keys. + // Create a new deployment transaction with the underreported verifying keys. let adjusted_deployment = Deployment::new(deployment.edition(), deployment.program().clone(), vks_with_underreport).unwrap(); let adjusted_transaction = Transaction::Deploy(txid, program_owner, Box::new(adjusted_deployment), fee); // Verify the deployment transaction. It should fail because the num_constraints in the vk are not correct. - let res = vm.check_transaction(&adjusted_transaction, None, rng); - println!("Result of check transaction: {:?}", res); assert!(vm.check_transaction(&adjusted_transaction, None, rng).is_err()); - - println!("Test if we reach this code"); } #[test] From 61b8de908c85e770196810d54a1a237baf49d381 Mon Sep 17 00:00:00 2001 From: ljedrz Date: Wed, 31 Jan 2024 11:01:52 +0100 Subject: [PATCH 254/298] cleanup: avoid deprecation warnings from indexmap Signed-off-by: ljedrz --- ledger/store/src/program/finalize.rs | 2 +- synthesizer/process/src/stack/mod.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ledger/store/src/program/finalize.rs b/ledger/store/src/program/finalize.rs index 972ed57397..994f89030d 100644 --- a/ledger/store/src/program/finalize.rs +++ b/ledger/store/src/program/finalize.rs @@ -314,7 +314,7 @@ pub trait FinalizeStorage: 'static + Clone + Send + Sync { None => bail!("Illegal operation: program ID '{program_id}' is not initialized - cannot remove mapping."), }; // Remove the mapping name. - if !mapping_names.remove(&mapping_name) { + if !mapping_names.swap_remove(&mapping_name) { bail!("Illegal operation: mapping '{mapping_name}' does not exist in storage - cannot remove mapping."); } diff --git a/synthesizer/process/src/stack/mod.rs b/synthesizer/process/src/stack/mod.rs index 3c8ec34874..9c00b3f899 100644 --- a/synthesizer/process/src/stack/mod.rs +++ b/synthesizer/process/src/stack/mod.rs @@ -418,13 +418,13 @@ impl Stack { /// Removes the proving key for the given function name. #[inline] pub fn remove_proving_key(&self, function_name: &Identifier) { - self.proving_keys.write().remove(function_name); + self.proving_keys.write().swap_remove(function_name); } /// Removes the verifying key for the given function name. #[inline] pub fn remove_verifying_key(&self, function_name: &Identifier) { - self.verifying_keys.write().remove(function_name); + self.verifying_keys.write().swap_remove(function_name); } } From 1ae6626c99de846445c45350b73678714f30e3ad Mon Sep 17 00:00:00 2001 From: evan-schott <53463459+evan-schott@users.noreply.github.com> Date: Thu, 1 Feb 2024 15:51:51 -0500 Subject: [PATCH 255/298] Modify constraint limit to account for the constraint added after synthesis that randomizes vars --- synthesizer/process/src/stack/deploy.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/synthesizer/process/src/stack/deploy.rs b/synthesizer/process/src/stack/deploy.rs index 230c3e5eaf..b61806b535 100644 --- a/synthesizer/process/src/stack/deploy.rs +++ b/synthesizer/process/src/stack/deploy.rs @@ -124,12 +124,20 @@ impl Stack { lap!(timer, "Compute the request for {}", function.name()); // Initialize the assignments. let assignments = Assignments::::default(); + // Initialize the constraint limit. Account for the constraint added after synthesis that randomizes vars. + let constraint_limit = match verifying_key.circuit_info.num_constraints.checked_sub(1) { + // Since a deployment must always pay non-zero fee, it must always have at least one constraint. + None => { + bail!("The constraint limit of 0 for function '{}' is invalid", function.name()); + } + Some(limit) => limit, + }; // Initialize the call stack. let call_stack = CallStack::CheckDeployment( vec![request], burner_private_key, assignments.clone(), - Some(verifying_key.circuit_info.num_constraints as u64), + Some(constraint_limit as u64), ); // Append the function name, callstack, and assignments. call_stacks.push((function.name(), call_stack, assignments)); From 32053f959b94610dc6b197609cbf927c9864ae57 Mon Sep 17 00:00:00 2001 From: evan-schott <53463459+evan-schott@users.noreply.github.com> Date: Thu, 1 Feb 2024 15:52:20 -0500 Subject: [PATCH 256/298] Add back synthesis check to catch overreports --- synthesizer/process/src/stack/execute.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/synthesizer/process/src/stack/execute.rs b/synthesizer/process/src/stack/execute.rs index 11954e54f0..b0c6a37a0d 100644 --- a/synthesizer/process/src/stack/execute.rs +++ b/synthesizer/process/src/stack/execute.rs @@ -421,7 +421,15 @@ impl StackExecute for Stack { lap!(timer, "Save the transition"); } // If the circuit is in `CheckDeployment` mode, then save the assignment. - else if let CallStack::CheckDeployment(_, _, ref assignments, _) = registers.call_stack() { + else if let CallStack::CheckDeployment(_, _, ref assignments, constraint_limit) = registers.call_stack() { + // Ensure the assignment matches the constraint limit. + if let Some(constraint_limit) = constraint_limit { + ensure!( + assignment.num_constraints() == constraint_limit, + "The synthesized number of constraints ({}) does not match the declared limit in the verifying key ({constraint_limit})", + assignment.num_constraints(), + ); + } // Construct the call metrics. let metrics = CallMetrics { program_id: *self.program_id(), From ff10297663a2da1f6cce24812982acb97a49e824 Mon Sep 17 00:00:00 2001 From: evan-schott <53463459+evan-schott@users.noreply.github.com> Date: Thu, 1 Feb 2024 15:53:04 -0500 Subject: [PATCH 257/298] tx id changes bc deploy fee increased w/ this PR --- synthesizer/src/vm/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/synthesizer/src/vm/mod.rs b/synthesizer/src/vm/mod.rs index 622420beeb..aaf5093874 100644 --- a/synthesizer/src/vm/mod.rs +++ b/synthesizer/src/vm/mod.rs @@ -951,7 +951,7 @@ function a: // Note: `deployment_transaction_ids` is sorted lexicographically by transaction ID, so the order may change if we update internal methods. assert_eq!( deployment_transaction_ids, - vec![deployment_4.id(), deployment_1.id(), deployment_2.id(), deployment_3.id()], + vec![deployment_4.id(), deployment_1.id(), deployment_3.id(), deployment_2.id()], "Update me if serialization has changed" ); } From 32d3ca457529ccbc4b7605ff9f026d66326965bf Mon Sep 17 00:00:00 2001 From: evan-schott <53463459+evan-schott@users.noreply.github.com> Date: Thu, 1 Feb 2024 15:53:42 -0500 Subject: [PATCH 258/298] revise new tests --- synthesizer/src/vm/mod.rs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/synthesizer/src/vm/mod.rs b/synthesizer/src/vm/mod.rs index aaf5093874..d9d28048c8 100644 --- a/synthesizer/src/vm/mod.rs +++ b/synthesizer/src/vm/mod.rs @@ -1175,10 +1175,13 @@ function do: Deployment::new(deployment.edition(), deployment.program().clone(), vks_with_overreport).unwrap(); let adjusted_transaction = Transaction::from_deployment(program_owner, adjusted_deployment, fee).unwrap(); - assert!(vm.check_transaction(&adjusted_transaction, None, rng).is_err()); + // Verify the deployment transaction. It should error during synthesis for constraint count mismatch. + let res = vm.check_transaction(&adjusted_transaction, None, rng); + assert!(res.is_err()); } #[test] + #[should_panic] fn test_deployment_synthesis_underreport() { let rng = &mut TestRng::default(); @@ -1227,8 +1230,8 @@ function do: Deployment::new(deployment.edition(), deployment.program().clone(), vks_with_underreport).unwrap(); let adjusted_transaction = Transaction::Deploy(txid, program_owner, Box::new(adjusted_deployment), fee); - // Verify the deployment transaction. It should fail because the num_constraints in the vk are not correct. - assert!(vm.check_transaction(&adjusted_transaction, None, rng).is_err()); + // Verify the deployment transaction. It should panic when enforcing the first constraint over the vk limit. + vm.check_transaction(&adjusted_transaction, None, rng); } #[test] From 7d443bc45246bcf8e93a9d60ef42ce441d32c8ea Mon Sep 17 00:00:00 2001 From: evan-schott <53463459+evan-schott@users.noreply.github.com> Date: Thu, 1 Feb 2024 16:03:10 -0500 Subject: [PATCH 259/298] clippy --- synthesizer/src/vm/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/synthesizer/src/vm/mod.rs b/synthesizer/src/vm/mod.rs index d9d28048c8..ce0e1db1af 100644 --- a/synthesizer/src/vm/mod.rs +++ b/synthesizer/src/vm/mod.rs @@ -1231,7 +1231,7 @@ function do: let adjusted_transaction = Transaction::Deploy(txid, program_owner, Box::new(adjusted_deployment), fee); // Verify the deployment transaction. It should panic when enforcing the first constraint over the vk limit. - vm.check_transaction(&adjusted_transaction, None, rng); + let _ = vm.check_transaction(&adjusted_transaction, None, rng); } #[test] From c05600f1e895a87de94045e945c6d201562f8aa7 Mon Sep 17 00:00:00 2001 From: Alessandro Coglio <> Date: Thu, 1 Feb 2024 21:12:12 -0800 Subject: [PATCH 260/298] Fix bug in Poseidon internal squeezing function. The permutation must be done unconditionally at that point of the code, which is reached if there are more field elements to squeeze than are left in the current state vector (i.e. `squeeze_index + remaining.len() > RATE` holds). Whether the remaining elements to squeeze happen to be the same number as the rate or not, is irrelevant here. --- circuit/algorithms/src/poseidon/hash_many.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/circuit/algorithms/src/poseidon/hash_many.rs b/circuit/algorithms/src/poseidon/hash_many.rs index 4d6dbc2ce5..d2baf7fcc5 100644 --- a/circuit/algorithms/src/poseidon/hash_many.rs +++ b/circuit/algorithms/src/poseidon/hash_many.rs @@ -130,10 +130,9 @@ impl Poseidon { let num_squeezed = RATE - squeeze_index; remaining[..num_squeezed].clone_from_slice(&state[start..(start + num_squeezed)]); - // Unless we are done with squeezing in this call, permute. - if remaining.len() != RATE { - self.permute(state); - } + // Permute. + self.permute(state); + // Repeat with the updated output slice and squeeze index. remaining = &mut remaining[num_squeezed..]; squeeze_index = 0; From 763d5fea5961854fd9a0122845bb62aef5d5cc63 Mon Sep 17 00:00:00 2001 From: evan-schott <53463459+evan-schott@users.noreply.github.com> Date: Fri, 2 Feb 2024 13:24:20 -0500 Subject: [PATCH 261/298] fixes --- circuit/environment/src/circuit.rs | 2 +- synthesizer/process/src/stack/deploy.rs | 2 +- synthesizer/process/src/stack/execute.rs | 10 +--------- synthesizer/src/vm/mod.rs | 2 +- 4 files changed, 4 insertions(+), 12 deletions(-) diff --git a/circuit/environment/src/circuit.rs b/circuit/environment/src/circuit.rs index 8e0788d01e..1fde647271 100644 --- a/circuit/environment/src/circuit.rs +++ b/circuit/environment/src/circuit.rs @@ -150,7 +150,7 @@ impl Environment for Circuit { // Ensure that we do not surpass the constraint limit for the circuit. CONSTRAINT_LIMIT.with(|constraint_limit| { if let Some(limit) = constraint_limit.get() { - if circuit.borrow().num_constraints() >= limit { + if circuit.borrow().num_constraints() > limit { Self::halt(format!("Surpassed the constraint limit ({limit})")) } } diff --git a/synthesizer/process/src/stack/deploy.rs b/synthesizer/process/src/stack/deploy.rs index b61806b535..36c6a5c708 100644 --- a/synthesizer/process/src/stack/deploy.rs +++ b/synthesizer/process/src/stack/deploy.rs @@ -124,7 +124,7 @@ impl Stack { lap!(timer, "Compute the request for {}", function.name()); // Initialize the assignments. let assignments = Assignments::::default(); - // Initialize the constraint limit. Account for the constraint added after synthesis that randomizes vars. + // Initialize the constraint limit. Account for the constraint added after synthesis that makes the Varuna zerocheck hiding. let constraint_limit = match verifying_key.circuit_info.num_constraints.checked_sub(1) { // Since a deployment must always pay non-zero fee, it must always have at least one constraint. None => { diff --git a/synthesizer/process/src/stack/execute.rs b/synthesizer/process/src/stack/execute.rs index b0c6a37a0d..11954e54f0 100644 --- a/synthesizer/process/src/stack/execute.rs +++ b/synthesizer/process/src/stack/execute.rs @@ -421,15 +421,7 @@ impl StackExecute for Stack { lap!(timer, "Save the transition"); } // If the circuit is in `CheckDeployment` mode, then save the assignment. - else if let CallStack::CheckDeployment(_, _, ref assignments, constraint_limit) = registers.call_stack() { - // Ensure the assignment matches the constraint limit. - if let Some(constraint_limit) = constraint_limit { - ensure!( - assignment.num_constraints() == constraint_limit, - "The synthesized number of constraints ({}) does not match the declared limit in the verifying key ({constraint_limit})", - assignment.num_constraints(), - ); - } + else if let CallStack::CheckDeployment(_, _, ref assignments, _) = registers.call_stack() { // Construct the call metrics. let metrics = CallMetrics { program_id: *self.program_id(), diff --git a/synthesizer/src/vm/mod.rs b/synthesizer/src/vm/mod.rs index ce0e1db1af..7e0756977a 100644 --- a/synthesizer/src/vm/mod.rs +++ b/synthesizer/src/vm/mod.rs @@ -1175,7 +1175,7 @@ function do: Deployment::new(deployment.edition(), deployment.program().clone(), vks_with_overreport).unwrap(); let adjusted_transaction = Transaction::from_deployment(program_owner, adjusted_deployment, fee).unwrap(); - // Verify the deployment transaction. It should error during synthesis for constraint count mismatch. + // Verify the deployment transaction. It should error when certificate checking for constraint count mismatch. let res = vm.check_transaction(&adjusted_transaction, None, rng); assert!(res.is_err()); } From 6adc557813eb87df59a9c0890cfd5cff549ab791 Mon Sep 17 00:00:00 2001 From: evan-schott <53463459+evan-schott@users.noreply.github.com> Date: Fri, 2 Feb 2024 14:00:32 -0500 Subject: [PATCH 262/298] fixes --- synthesizer/src/vm/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/synthesizer/src/vm/mod.rs b/synthesizer/src/vm/mod.rs index 7e0756977a..2f411b83f6 100644 --- a/synthesizer/src/vm/mod.rs +++ b/synthesizer/src/vm/mod.rs @@ -1220,7 +1220,7 @@ function do: let mut vks_with_underreport = Vec::with_capacity(deployment.verifying_keys().len()); for (id, (vk, cert)) in deployment.verifying_keys() { let mut vk = vk.deref().clone(); - vk.circuit_info.num_constraints -= 1; + vk.circuit_info.num_constraints -= 2; let vk = VerifyingKey::new(Arc::new(vk)); vks_with_underreport.push((*id, (vk, cert.clone()))); } From 73240fdef87b3bd54f9b680fc6435b4ca4a0cd71 Mon Sep 17 00:00:00 2001 From: randomsleep Date: Tue, 6 Feb 2024 16:29:40 +0800 Subject: [PATCH 263/298] update: add many_input_and_output.aleo for test --- .../many_input_and_output.out | 147 ++++++++++++ .../many_input_and_output.aleo | 226 ++++++++++++++++++ 2 files changed, 373 insertions(+) create mode 100644 synthesizer/tests/expectations/vm/execute_and_finalize/many_input_and_output.out create mode 100644 synthesizer/tests/tests/vm/execute_and_finalize/many_input_and_output.aleo diff --git a/synthesizer/tests/expectations/vm/execute_and_finalize/many_input_and_output.out b/synthesizer/tests/expectations/vm/execute_and_finalize/many_input_and_output.out new file mode 100644 index 0000000000..19abe30428 --- /dev/null +++ b/synthesizer/tests/expectations/vm/execute_and_finalize/many_input_and_output.out @@ -0,0 +1,147 @@ +errors: [] +outputs: +- verified: true + execute: + gas_dos.aleo/make_trash_empty: + outputs: [] + speculate: the execution was accepted + add_next_block: succeeded. +- verified: true + execute: + gas_dos.aleo/make_trash: + outputs: + - '{"type":"public","id":"7328454421185929158618031230606034593549261051339602553507241025154825176299field","value":"0u8"}' + - '{"type":"public","id":"5145134703139278195441792859006011532400644423433046212536736013174180642636field","value":"1u8"}' + - '{"type":"public","id":"4479131570657126987170312036920068454738210783609610183168698498586355634960field","value":"2u8"}' + - '{"type":"public","id":"6926788178616354544370363073675930466260780102185705396446528307557204966254field","value":"3u8"}' + - '{"type":"public","id":"507213451235696529330091255380102539497181688387097808723590767226256138002field","value":"4u8"}' + - '{"type":"public","id":"6710585889229359056970878174557972819881050693904886470290761564643350681439field","value":"5u8"}' + - '{"type":"public","id":"2198039663990554661027013328856492399590215636668825518497257481407294029866field","value":"6u8"}' + - '{"type":"public","id":"288798117536072394573543619144317389906590429832415617777655870783774307012field","value":"7u8"}' + - '{"type":"public","id":"1155702003412000992412931135598868113644122882557716381602003061253381471571field","value":"8u8"}' + - '{"type":"public","id":"3026344388965712201801712548965204124836140425527882670365396322199812932565field","value":"9u8"}' + - '{"type":"public","id":"5492615319027225479113405102986959595495416506208321009285333238882415298049field","value":"10u8"}' + - '{"type":"public","id":"6171840640899438157036020226640325134210483852414199464033845647392969714320field","value":"11u8"}' + - '{"type":"public","id":"6575356095090949853056361212638757233924047161146463958636818761079464552340field","value":"12u8"}' + - '{"type":"public","id":"2262771770811842021838463874286351493506275646051705307544569163192903096597field","value":"13u8"}' + - '{"type":"public","id":"174469374038614532963809815011040883121008467567144862148413520935353623648field","value":"14u8"}' + - '{"type":"public","id":"8090171018295599961208092852988350550956162709304897310609315247476998706602field","value":"15u8"}' + speculate: the execution was accepted + add_next_block: succeeded. +- verified: true + execute: + gas_dos.aleo/make_trash_private: + outputs: + - '{"type":"private","id":"2680622265102100041993406647937919090940301114770765059104962140226246981264field","value":"ciphertext1qyqtjrpzy7zwvfmsv0xesjl8rv3lh86pwsuvrm4ynyra7x20nzy0crs3t4uvz"}' + - '{"type":"private","id":"5202743622607685269012784963172580544281870231936627246866565403414033171808field","value":"ciphertext1qyqvl9yhzzu8trer3fwdkgu5ftej28swpajmfle2lmqrpdsrcqd4wpq8nq56z"}' + - '{"type":"private","id":"2174891821791598891325907948165991966270654154109515635412257676350776525858field","value":"ciphertext1qyqg7tcq3lk4lm357j85e04ntlx7tlq88g25s094m08ce3pvk9wzypgxc25tn"}' + - '{"type":"private","id":"3482962903872689804786042821343967741876935213235592724563470495245964507635field","value":"ciphertext1qyqd33cyvv2007td963cng7ex5qpeqa9g8aztsyf9l4cs59zl9ph2rs29hdd8"}' + - '{"type":"private","id":"4440477798685620135379247884803156497847423337761130118347611024035653635140field","value":"ciphertext1qyq0959tkr8jfunfgl5wy0wwm9zrzvzc2ktuny7j4f4ekqpecphryqqgnwplj"}' + - '{"type":"private","id":"3522752929186128924758141077706371690810713792036167644523972417246682200901field","value":"ciphertext1qyqzllfkgvvz303zgsduenn79ru5nx0ynjw2vk3zxgz8sp0096smuzcf6e7vu"}' + - '{"type":"private","id":"3625214038066625726053665609852864682693494709445484792903274142479081890567field","value":"ciphertext1qyq9nnzfv5w4ct5k9xny0uquyrulaclng6mv7puml3x3pnam3ttespg8gq9dl"}' + - '{"type":"private","id":"1637083100938265104763821696269236866552161155548506891159616654219004830174field","value":"ciphertext1qyqtp60mtkjkysf7z5uyaluq4z35m3hehqj39en0rpggy249vfnvszgkjpy7c"}' + - '{"type":"private","id":"1090493810202308287957198910474311328876918772204234621365178737170948657938field","value":"ciphertext1qyqvjyy8d40h9sqwppf8n3z4ejechz823crx9j723u0gtapzy69vqzc7p2pfj"}' + - '{"type":"private","id":"7261330284282876129032008102561419014693564205492131523999072056356722523811field","value":"ciphertext1qyqfd3fz5ugh5rt8vk5w2ugp7sn9777qq82v6yg5p059dgf57knakqqay57mf"}' + - '{"type":"private","id":"709959112982644896253271486987191411441663870818104439243630623545390950272field","value":"ciphertext1qyqpwt8sqmqfxs0sw0l8jghvqfjt3hddemmy30e6s0ms9fgrn50kjqcfs69st"}' + - '{"type":"private","id":"6872976021810691710027178488223982683034356995539047639261319076027494254123field","value":"ciphertext1qyqwg30pz7gzh4zuyhy0vgumfxfm2xlpyxucg4tvewdz6gpr60skyrgauuulp"}' + - '{"type":"private","id":"8359829191814664268280684613954596526781157368700496608365669690643643037289field","value":"ciphertext1qyqvedxm8alapcwlph5kkmffkvafuhld92n4y7588704ujk9l3mhspq4k2kct"}' + - '{"type":"private","id":"1001150914100589972693891478671980342979312932580439705453658330535336008271field","value":"ciphertext1qyqy369l9urha2a99j2krk6tjh5dtdwt9z0puu0vtgvznk53khs9kzsrppr29"}' + - '{"type":"private","id":"8131111517226123155050404356134943165771021461049467536204430056357254727422field","value":"ciphertext1qyq2hn2xnu4fadsmaf65edm4ftyvg6ns7t40g0urv5h47z93ywvcjzqvtcq8r"}' + - '{"type":"private","id":"2328882362753533354211206400408346026883181405850191907839548608694887338104field","value":"ciphertext1qyqfhe6jhjc5te9zcsyvhgvruj9w9vyppj30pvhy66lmznv76ar65ygk8yr0m"}' + speculate: the execution was accepted + add_next_block: succeeded. +- verified: true + execute: + gas_dos.aleo/make_trash_u64: + outputs: + - '{"type":"public","id":"233314312605276539760746524164528913386489041588301421249429696985329848667field","value":"0u64"}' + - '{"type":"public","id":"7253165205278696561637248715563783454858866842754893348214451169160975075162field","value":"1u64"}' + - '{"type":"public","id":"666939097876094162575352087643400561412645022883205904471672662199353196861field","value":"2u64"}' + - '{"type":"public","id":"2959578059337764023181618398408038082893247480135464562472793876696915418953field","value":"3u64"}' + - '{"type":"public","id":"5286500885730658616234188227770288757865520078231878645131318044650940638194field","value":"4u64"}' + - '{"type":"public","id":"401309491997177592892630556474302634099704960274828674430960726287457846708field","value":"5u64"}' + - '{"type":"public","id":"7229261133705147296171654244855097638797071371920816627026569900935444723448field","value":"6u64"}' + - '{"type":"public","id":"7027737111877338341363202916015365226405006640018027773526971193651872286885field","value":"7u64"}' + - '{"type":"public","id":"4666981060089167647321091227592661962035883124507120144471806069733189753569field","value":"8u64"}' + - '{"type":"public","id":"2583284904746797664182562260080251003054566015963712113670613392689300760365field","value":"9u64"}' + - '{"type":"public","id":"4173633873661312951955239283483355234732949685908187166831651838082162090913field","value":"10u64"}' + - '{"type":"public","id":"122754949824671565357841063528425764444260908941146272537546151624065033563field","value":"11u64"}' + - '{"type":"public","id":"2130918280550853922824431786128137523245004386377672896846147107787168219683field","value":"12u64"}' + - '{"type":"public","id":"4694456538004825214415037291190735375240715731300118040019913761431560071687field","value":"13u64"}' + - '{"type":"public","id":"470751660319309894868159463333651824468663657160136189167945482341411113760field","value":"14u64"}' + - '{"type":"public","id":"4249914125363520277067410046691598837483324524993280920898528402016941453480field","value":"15u64"}' + speculate: the execution was accepted + add_next_block: succeeded. +- verified: true + execute: + gas_dos.aleo/make_trash_call_inner: + outputs: [] + speculate: the execution was accepted + add_next_block: succeeded. +- verified: true + execute: + gas_dos.aleo/make_trash_call_inner_private: + outputs: [] + speculate: the execution was accepted + add_next_block: succeeded. +additional: +- child_outputs: + credits.aleo/fee_public: + outputs: + - '{"type":"future","id":"4460439047516495718073735439405487111536405512365343120714073673093841980496field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo10knkelvnd55fsaarm25wch7p9suf2tqlgwy5k4nxwms6d262xyfqm2tccr,\n 1153u64\n ]\n}"}' +- child_outputs: + credits.aleo/fee_public: + outputs: + - '{"type":"future","id":"8415028977876091761752724883671758688572237811988248476376341949695578218786field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo10knkelvnd55fsaarm25wch7p9suf2tqlgwy5k4nxwms6d262xyfqm2tccr,\n 2363u64\n ]\n}"}' +- child_outputs: + credits.aleo/fee_public: + outputs: + - '{"type":"future","id":"6955783271913968318412731377247340380831652777579800064049064878317952307153field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo10knkelvnd55fsaarm25wch7p9suf2tqlgwy5k4nxwms6d262xyfqm2tccr,\n 3331u64\n ]\n}"}' +- child_outputs: + credits.aleo/fee_public: + outputs: + - '{"type":"future","id":"6497372388862928104904790174065298189831176271028157197406452385672043799872field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo10knkelvnd55fsaarm25wch7p9suf2tqlgwy5k4nxwms6d262xyfqm2tccr,\n 2591u64\n ]\n}"}' +- child_outputs: + child.aleo/inner_trash: + outputs: + - '{"type":"public","id":"4289453696142715249689402741912245561443469314811952643858392482783244522724field","value":"0u8"}' + - '{"type":"public","id":"5996339838455228384518335132774934196611594954755346395054038050343103354395field","value":"1u8"}' + - '{"type":"public","id":"3358647378048771912605830105370148199260356999287873395305434987100537947367field","value":"2u8"}' + - '{"type":"public","id":"3561185473825389412729325762100699648338422087874903701388058185885064674548field","value":"3u8"}' + - '{"type":"public","id":"3989107665595226930217005016659525438354095241690887025362623017829393909086field","value":"4u8"}' + - '{"type":"public","id":"1015958412091382053251797862910077594839566070151006847448912156512885168244field","value":"5u8"}' + - '{"type":"public","id":"2567889317557457967764422538212118733579546499228855090594253956813932972072field","value":"6u8"}' + - '{"type":"public","id":"5738966943078846331986975383478175535362176248367077523225131270678347419252field","value":"7u8"}' + - '{"type":"public","id":"5051374977750131995628573872876580336294676313900512549961840473043598462489field","value":"8u8"}' + - '{"type":"public","id":"6246052362829258748286392424282967814827467657158490339715346793563788475395field","value":"9u8"}' + - '{"type":"public","id":"3137956905390822430675060441214691829333807921428930041891214885081618350759field","value":"10u8"}' + - '{"type":"public","id":"3954165324357671689980777474755501745352061261539083140319447666173245113194field","value":"11u8"}' + - '{"type":"public","id":"824411961835421718086912148073611074555830482874933344066928839715818180866field","value":"12u8"}' + - '{"type":"public","id":"3956987026475417071721267209248312177299219007429340821858712542495766818823field","value":"13u8"}' + - '{"type":"public","id":"2709313053745536114661259705416457664187223268321348433098736978752378149531field","value":"14u8"}' + - '{"type":"public","id":"6195248787047047065906932549716645015613025005664328197873983801878539808717field","value":"15u8"}' + credits.aleo/fee_public: + outputs: + - '{"type":"future","id":"4993318844385279622659406372029663957024103433727459966940237716301579651158field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo10knkelvnd55fsaarm25wch7p9suf2tqlgwy5k4nxwms6d262xyfqm2tccr,\n 7558u64\n ]\n}"}' +- child_outputs: + child.aleo/inner_trash_private: + outputs: + - '{"type":"private","id":"1690417811643581808096073580895773872435783139189560207201450077859617190194field","value":"ciphertext1qyqqq6ssunw42mxe8rvpgu5ep0vagrn8dklju850us04wnghvh0njqsqvr2yw"}' + - '{"type":"private","id":"1886046153841688110779792443332379168760253439921378427387264032458090200722field","value":"ciphertext1qyqttnazmxdpq7jptzzzrur7gnydv4266yrrkg8hnd7qmvph3jgk5rsnqcuh8"}' + - '{"type":"private","id":"6945085598979721763398156380753241304545404123616624832451856372265095265471field","value":"ciphertext1qyq9l5ru4w25cegepncrwp200d40gug4sx204nhff5l2874zhplmzrqrhz2p4"}' + - '{"type":"private","id":"4142368517252176157373208821260613486695598769131006201465716808814519857801field","value":"ciphertext1qyqt2nvvunh6eyr3uyzfpx0nlcc724snpv0yenhr0epg6nxn9uf9yrqe483na"}' + - '{"type":"private","id":"1120928326819667499163846513166443389126716487911614317777817493947758499240field","value":"ciphertext1qyqvez6t833qwtrekh95qd0p9ur5ze7zfcj586gj45e5tgrcdck3crc7tx99u"}' + - '{"type":"private","id":"6520628852176590483742399620632204000766376375298286587002994790769934792244field","value":"ciphertext1qyqycec6g3lvzaudt02704zgfg989h0nlk29t30vm3ccs49l3qs2yzcvrgffu"}' + - '{"type":"private","id":"1653566059245057918600614758625811774818934631158115642909983653207058134332field","value":"ciphertext1qyqgxpqwlme4h4x5nlljrjc43ffdrrjks6tukqutnfrh5e5mgqjvwqgk4lzej"}' + - '{"type":"private","id":"3125530302804834593185552768712989898348727954206124549854468299555811589311field","value":"ciphertext1qyqwyv767yj0qtlpj3e8afcg2fq7dqq2rph0agla0x3a0k7x75g6czqjxkmnc"}' + - '{"type":"private","id":"6653724285397119534364272198358009303219371121472302648376197869755877142457field","value":"ciphertext1qyqx79grpqzmaa6n8m2r6s0stg9ljhrrqwtvaesn3vdmazermzn8jzg3rphqk"}' + - '{"type":"private","id":"4306156319852057171767064704924666509745421179658746592641215257474382652393field","value":"ciphertext1qyqqp655v4g4dv32lflxcpw2075vkm6jlmeewkvl0r8as9kpjg2xsqgjh94yw"}' + - '{"type":"private","id":"862763398396949844010720017565280792516718591614353786919911043964654671911field","value":"ciphertext1qyq0nu20c928tylcadunqkhf8n2wsggp42qad55n52vzzn3ax9at6rg0y2z7d"}' + - '{"type":"private","id":"6115537416632677547733070126318384273659824508082312339839289007774031750910field","value":"ciphertext1qyqd4wdfkm5mk3gqrcpp6cy8v43qqn70n68xnhtajeegnwt03xf07zqst7s60"}' + - '{"type":"private","id":"1288760742755161344468854268135477208800345648264783432462324547157974963800field","value":"ciphertext1qyqd87aklz0vgfyzn5wg8zwwf3xevyhkxsfaj0hugz5u94we55fycysqmnghx"}' + - '{"type":"private","id":"4094529815608050570605871705117213797215439814194985582364462185707725973687field","value":"ciphertext1qyq8d80slfgjf4l76k40a6cgtpvg0dy2qzl7d0r5cy59dvglv8tewrgeh7ts4"}' + - '{"type":"private","id":"2813602845252947372312080494391108546455078881365658135103980463173542847486field","value":"ciphertext1qyq9t35rxns4t03u9uts467dc450vefn2r37p4g02kww88p5lqr2zpqy9m8l7"}' + - '{"type":"private","id":"4797712783560200923986301701874758524183619526850656800063565109797126046631field","value":"ciphertext1qyqr3c39tq9t3mh54z39vhuqc832peuvatlvk28ygjsnl04u3njksrc8w2arw"}' + credits.aleo/fee_public: + outputs: + - '{"type":"future","id":"3920528155218069690017755593796450711436583446509070220539016754499888750597field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo10knkelvnd55fsaarm25wch7p9suf2tqlgwy5k4nxwms6d262xyfqm2tccr,\n 11438u64\n ]\n}"}' diff --git a/synthesizer/tests/tests/vm/execute_and_finalize/many_input_and_output.aleo b/synthesizer/tests/tests/vm/execute_and_finalize/many_input_and_output.aleo new file mode 100644 index 0000000000..94f680ded5 --- /dev/null +++ b/synthesizer/tests/tests/vm/execute_and_finalize/many_input_and_output.aleo @@ -0,0 +1,226 @@ +/* +randomness: 12345 +cases: + - program: gas_dos.aleo + function: make_trash_empty + inputs: [] + - program: gas_dos.aleo + function: make_trash + inputs: [0u8, 1u8, 2u8, 3u8, 4u8, 5u8, 6u8, 7u8, 8u8, 9u8, 10u8, 11u8, 12u8, 13u8, 14u8, 15u8] + - program: gas_dos.aleo + function: make_trash_private + inputs: [0u8, 1u8, 2u8, 3u8, 4u8, 5u8, 6u8, 7u8, 8u8, 9u8, 10u8, 11u8, 12u8, 13u8, 14u8, 15u8] + - program: gas_dos.aleo + function: make_trash_u64 + inputs: [0u64, 1u64, 2u64, 3u64, 4u64, 5u64, 6u64, 7u64, 8u64, 9u64, 10u64, 11u64, 12u64, 13u64, 14u64, 15u64] + - program: gas_dos.aleo + function: make_trash_call_inner + inputs: [] + - program: gas_dos.aleo + function: make_trash_call_inner_private + inputs: [] +*/ + + +program child.aleo; + +function inner_trash_single: + input r0 as u8.public; + output r0 as u8.public; + +function inner_trash: + input r0 as u8.public; + input r1 as u8.public; + input r2 as u8.public; + input r3 as u8.public; + input r4 as u8.public; + input r5 as u8.public; + input r6 as u8.public; + input r7 as u8.public; + input r8 as u8.public; + input r9 as u8.public; + input r10 as u8.public; + input r11 as u8.public; + input r12 as u8.public; + input r13 as u8.public; + input r14 as u8.public; + input r15 as u8.public; + + output r0 as u8.public; + output r1 as u8.public; + output r2 as u8.public; + output r3 as u8.public; + output r4 as u8.public; + output r5 as u8.public; + output r6 as u8.public; + output r7 as u8.public; + output r8 as u8.public; + output r9 as u8.public; + output r10 as u8.public; + output r11 as u8.public; + output r12 as u8.public; + output r13 as u8.public; + output r14 as u8.public; + output r15 as u8.public; + +function inner_trash_private: + input r0 as u8.private; + input r1 as u8.private; + input r2 as u8.private; + input r3 as u8.private; + input r4 as u8.private; + input r5 as u8.private; + input r6 as u8.private; + input r7 as u8.private; + input r8 as u8.private; + input r9 as u8.private; + input r10 as u8.private; + input r11 as u8.private; + input r12 as u8.private; + input r13 as u8.private; + input r14 as u8.private; + input r15 as u8.private; + + output r0 as u8.private; + output r1 as u8.private; + output r2 as u8.private; + output r3 as u8.private; + output r4 as u8.private; + output r5 as u8.private; + output r6 as u8.private; + output r7 as u8.private; + output r8 as u8.private; + output r9 as u8.private; + output r10 as u8.private; + output r11 as u8.private; + output r12 as u8.private; + output r13 as u8.private; + output r14 as u8.private; + output r15 as u8.private; + + +///////////////////////////////////////////////// + +import child.aleo; + +program gas_dos.aleo; + +function make_trash_empty: + +function make_trash: + input r0 as u8.public; + input r1 as u8.public; + input r2 as u8.public; + input r3 as u8.public; + input r4 as u8.public; + input r5 as u8.public; + input r6 as u8.public; + input r7 as u8.public; + input r8 as u8.public; + input r9 as u8.public; + input r10 as u8.public; + input r11 as u8.public; + input r12 as u8.public; + input r13 as u8.public; + input r14 as u8.public; + input r15 as u8.public; + + output r0 as u8.public; + output r1 as u8.public; + output r2 as u8.public; + output r3 as u8.public; + output r4 as u8.public; + output r5 as u8.public; + output r6 as u8.public; + output r7 as u8.public; + output r8 as u8.public; + output r9 as u8.public; + output r10 as u8.public; + output r11 as u8.public; + output r12 as u8.public; + output r13 as u8.public; + output r14 as u8.public; + output r15 as u8.public; + +function make_trash_private: + input r0 as u8.private; + input r1 as u8.private; + input r2 as u8.private; + input r3 as u8.private; + input r4 as u8.private; + input r5 as u8.private; + input r6 as u8.private; + input r7 as u8.private; + input r8 as u8.private; + input r9 as u8.private; + input r10 as u8.private; + input r11 as u8.private; + input r12 as u8.private; + input r13 as u8.private; + input r14 as u8.private; + input r15 as u8.private; + + output r0 as u8.private; + output r1 as u8.private; + output r2 as u8.private; + output r3 as u8.private; + output r4 as u8.private; + output r5 as u8.private; + output r6 as u8.private; + output r7 as u8.private; + output r8 as u8.private; + output r9 as u8.private; + output r10 as u8.private; + output r11 as u8.private; + output r12 as u8.private; + output r13 as u8.private; + output r14 as u8.private; + output r15 as u8.private; + + +function make_trash_u64: + input r0 as u64.public; + input r1 as u64.public; + input r2 as u64.public; + input r3 as u64.public; + input r4 as u64.public; + input r5 as u64.public; + input r6 as u64.public; + input r7 as u64.public; + input r8 as u64.public; + input r9 as u64.public; + input r10 as u64.public; + input r11 as u64.public; + input r12 as u64.public; + input r13 as u64.public; + input r14 as u64.public; + input r15 as u64.public; + + output r0 as u64.public; + output r1 as u64.public; + output r2 as u64.public; + output r3 as u64.public; + output r4 as u64.public; + output r5 as u64.public; + output r6 as u64.public; + output r7 as u64.public; + output r8 as u64.public; + output r9 as u64.public; + output r10 as u64.public; + output r11 as u64.public; + output r12 as u64.public; + output r13 as u64.public; + output r14 as u64.public; + output r15 as u64.public; + +function make_trash_call_inner: + call child.aleo/inner_trash 0u8 1u8 2u8 3u8 4u8 5u8 6u8 7u8 8u8 9u8 10u8 11u8 12u8 13u8 14u8 15u8 into r0 r1 r2 r3 r4 r5 r6 r7 r8 r9 r10 r11 r12 r13 r14 r15; + call child.aleo/inner_trash 0u8 1u8 2u8 3u8 4u8 5u8 6u8 7u8 8u8 9u8 10u8 11u8 12u8 13u8 14u8 15u8 into r16 r17 r18 r19 r20 r21 r22 r23 r24 r25 r26 r27 r28 r29 r30 r31; + call child.aleo/inner_trash 0u8 1u8 2u8 3u8 4u8 5u8 6u8 7u8 8u8 9u8 10u8 11u8 12u8 13u8 14u8 15u8 into r32 r33 r34 r35 r36 r37 r38 r39 r40 r41 r42 r43 r44 r45 r46 r47; + call child.aleo/inner_trash 0u8 1u8 2u8 3u8 4u8 5u8 6u8 7u8 8u8 9u8 10u8 11u8 12u8 13u8 14u8 15u8 into r48 r49 r50 r51 r52 r53 r54 r55 r56 r57 r58 r59 r60 r61 r62 r63; + +function make_trash_call_inner_private: + call child.aleo/inner_trash_private 0u8 1u8 2u8 3u8 4u8 5u8 6u8 7u8 8u8 9u8 10u8 11u8 12u8 13u8 14u8 15u8 into r0 r1 r2 r3 r4 r5 r6 r7 r8 r9 r10 r11 r12 r13 r14 r15; + call child.aleo/inner_trash_private 0u8 1u8 2u8 3u8 4u8 5u8 6u8 7u8 8u8 9u8 10u8 11u8 12u8 13u8 14u8 15u8 into r16 r17 r18 r19 r20 r21 r22 r23 r24 r25 r26 r27 r28 r29 r30 r31; + call child.aleo/inner_trash_private 0u8 1u8 2u8 3u8 4u8 5u8 6u8 7u8 8u8 9u8 10u8 11u8 12u8 13u8 14u8 15u8 into r32 r33 r34 r35 r36 r37 r38 r39 r40 r41 r42 r43 r44 r45 r46 r47; + call child.aleo/inner_trash_private 0u8 1u8 2u8 3u8 4u8 5u8 6u8 7u8 8u8 9u8 10u8 11u8 12u8 13u8 14u8 15u8 into r48 r49 r50 r51 r52 r53 r54 r55 r56 r57 r58 r59 r60 r61 r62 r63; From 1e4c1881303b2f2461e4aace75516bbbe1abd0b7 Mon Sep 17 00:00:00 2001 From: raychu86 <14917648+raychu86@users.noreply.github.com> Date: Wed, 7 Feb 2024 14:11:11 -0800 Subject: [PATCH 264/298] Introduce committee round lag --- console/network/src/lib.rs | 3 +++ ledger/block/src/verify.rs | 22 +++++++++++----------- ledger/src/check_next_block.rs | 6 +++++- 3 files changed, 19 insertions(+), 12 deletions(-) diff --git a/console/network/src/lib.rs b/console/network/src/lib.rs index 717946cba2..cf5e33488e 100644 --- a/console/network/src/lib.rs +++ b/console/network/src/lib.rs @@ -156,6 +156,9 @@ pub trait Network: /// The maximum number of outputs per transition. const MAX_OUTPUTS: usize = 16; + /// The committee round lag. + const COMMITTEE_ROUND_LAG: u64 = 50; + /// The state root type. type StateRoot: Bech32ID>; /// The block hash type. diff --git a/ledger/block/src/verify.rs b/ledger/block/src/verify.rs index 87144f0329..e55c6508e9 100644 --- a/ledger/block/src/verify.rs +++ b/ledger/block/src/verify.rs @@ -30,7 +30,7 @@ impl Block { &self, previous_block: &Block, current_state_root: N::StateRoot, - current_committee: &Committee, + committee_with_lag: &Committee, current_puzzle: &CoinbasePuzzle, current_epoch_challenge: &EpochChallenge, current_timestamp: i64, @@ -46,7 +46,7 @@ impl Block { expected_timestamp, expected_existing_solution_ids, expected_existing_transaction_ids, - ) = self.verify_authority(previous_block.round(), previous_block.height(), current_committee)?; + ) = self.verify_authority(previous_block.round(), previous_block.height(), committee_with_lag)?; // Ensure the block solutions are correct. let ( @@ -143,7 +143,7 @@ impl Block { &self, previous_round: u64, previous_height: u32, - current_committee: &Committee, + committee_with_lag: &Committee, ) -> Result<(u64, u32, i64, Vec>, Vec)> { // Note: Do not remove this. This ensures that all blocks after genesis are quorum blocks. #[cfg(not(any(test, feature = "test")))] @@ -170,12 +170,12 @@ impl Block { subdag.anchor_round() } }; - // Ensure the block round is at least the starting round of the committee. + // Ensure the block round minus the committee round lag is at least the starting round of the committee with lag. ensure!( - expected_round >= current_committee.starting_round(), - "Block {} has an invalid round (found '{expected_round}', expected at least '{}')", - expected_height, - current_committee.starting_round() + expected_round.saturating_sub(N::COMMITTEE_ROUND_LAG) >= committee_with_lag.starting_round(), + "Block {expected_height} has an invalid round (found '{}', expected at least '{}')", + expected_round.saturating_sub(N::COMMITTEE_ROUND_LAG), + committee_with_lag.starting_round() ); // Ensure the block authority is correct. @@ -186,7 +186,7 @@ impl Block { let signer = signature.to_address(); // Ensure the block is signed by a committee member. ensure!( - current_committee.members().contains_key(&signer), + committee_with_lag.members().contains_key(&signer), "Beacon block {expected_height} has a signer not in the committee (found '{signer}')", ); // Ensure the signature is valid. @@ -199,7 +199,7 @@ impl Block { } Authority::Quorum(subdag) => { // Compute the expected leader. - let expected_leader = current_committee.get_leader(expected_round)?; + let expected_leader = committee_with_lag.get_leader(expected_round)?; // Ensure the block is authored by the expected leader. ensure!( subdag.leader_address() == expected_leader, @@ -222,7 +222,7 @@ impl Block { // Beacon blocks do not have a timestamp check. Authority::Beacon(..) => self.timestamp(), // Quorum blocks use the weighted median timestamp from the subdag. - Authority::Quorum(subdag) => subdag.timestamp(current_committee), + Authority::Quorum(subdag) => subdag.timestamp(committee_with_lag), }; // Return success. diff --git a/ledger/src/check_next_block.rs b/ledger/src/check_next_block.rs index 8203ccdaa1..df32938c74 100644 --- a/ledger/src/check_next_block.rs +++ b/ledger/src/check_next_block.rs @@ -83,10 +83,14 @@ impl> Ledger { self.vm.check_speculate(state, block.ratifications(), block.solutions(), block.transactions())?; // Ensure the block is correct. + let round_with_lag = self.latest_round().saturating_sub(N::COMMITTEE_ROUND_LAG); + let committee_with_lag = self + .get_committee_for_round(round_with_lag)? + .ok_or(anyhow!("Failed to fetch committee for round {round_with_lag}"))?; let (expected_existing_solution_ids, expected_existing_transaction_ids) = block.verify( &self.latest_block(), self.latest_state_root(), - &self.latest_committee()?, + &committee_with_lag, self.coinbase_puzzle(), &self.latest_epoch_challenge()?, OffsetDateTime::now_utc().unix_timestamp(), From 5b5c5593f5dd20817c6bb1e5e924ad684491be9a Mon Sep 17 00:00:00 2001 From: raychu86 <14917648+raychu86@users.noreply.github.com> Date: Wed, 7 Feb 2024 14:57:02 -0800 Subject: [PATCH 265/298] Update COMMITTEE_ROUND_LAG to match the MAX_GC_ROUNDS --- console/network/src/lib.rs | 2 +- ledger/narwhal/batch-header/src/lib.rs | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/console/network/src/lib.rs b/console/network/src/lib.rs index cf5e33488e..a1ac9afac4 100644 --- a/console/network/src/lib.rs +++ b/console/network/src/lib.rs @@ -157,7 +157,7 @@ pub trait Network: const MAX_OUTPUTS: usize = 16; /// The committee round lag. - const COMMITTEE_ROUND_LAG: u64 = 50; + const COMMITTEE_ROUND_LAG: u64 = 100; /// The state root type. type StateRoot: Bech32ID>; diff --git a/ledger/narwhal/batch-header/src/lib.rs b/ledger/narwhal/batch-header/src/lib.rs index e7a8de8c7a..9225c0f04a 100644 --- a/ledger/narwhal/batch-header/src/lib.rs +++ b/ledger/narwhal/batch-header/src/lib.rs @@ -332,3 +332,19 @@ pub mod test_helpers { sample } } + +#[cfg(test)] +mod tests { + use super::*; + + type CurrentNetwork = console::network::Testnet3; + + #[test] + fn test_max_gc_rounds() { + assert_eq!( + BatchHeader::::MAX_GC_ROUNDS as u64, + ::COMMITTEE_ROUND_LAG, + "The max GC rounds should be equal to the committee round lag" + ); + } +} From bef915a9e72583f1b57b265b7382b18abb73a4d8 Mon Sep 17 00:00:00 2001 From: raychu86 <14917648+raychu86@users.noreply.github.com> Date: Wed, 7 Feb 2024 16:16:25 -0800 Subject: [PATCH 266/298] Use the previous_round_with_lag --- ledger/src/check_next_block.rs | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/ledger/src/check_next_block.rs b/ledger/src/check_next_block.rs index df32938c74..9e995bd0c3 100644 --- a/ledger/src/check_next_block.rs +++ b/ledger/src/check_next_block.rs @@ -82,15 +82,24 @@ impl> Ledger { let ratified_finalize_operations = self.vm.check_speculate(state, block.ratifications(), block.solutions(), block.transactions())?; + // Get the round number for the previous committee. Note, we subtract 2 from odd rounds, + // because committees are updated in even rounds. + let previous_round = match block.round() % 2 == 0 { + true => block.round().saturating_sub(1), + false => block.round().saturating_sub(2), + }; + // Get the previous round with lag. + let previous_round_with_lag = previous_round.saturating_sub(N::COMMITTEE_ROUND_LAG); + // Retrieve the previous committee with lag. + let previous_committee_with_lag = self + .get_committee_for_round(previous_round_with_lag)? + .ok_or(anyhow!("Failed to fetch committee for round {previous_round_with_lag}"))?; + // Ensure the block is correct. - let round_with_lag = self.latest_round().saturating_sub(N::COMMITTEE_ROUND_LAG); - let committee_with_lag = self - .get_committee_for_round(round_with_lag)? - .ok_or(anyhow!("Failed to fetch committee for round {round_with_lag}"))?; let (expected_existing_solution_ids, expected_existing_transaction_ids) = block.verify( &self.latest_block(), self.latest_state_root(), - &committee_with_lag, + &previous_committee_with_lag, self.coinbase_puzzle(), &self.latest_epoch_challenge()?, OffsetDateTime::now_utc().unix_timestamp(), From 255c88dbe5a34f8fbe339ac65f26f892313daeb6 Mon Sep 17 00:00:00 2001 From: Howard Wu <9260812+howardwu@users.noreply.github.com> Date: Wed, 7 Feb 2024 20:58:38 -0800 Subject: [PATCH 267/298] Make Proof::new visibility public --- synthesizer/snark/src/proof/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/synthesizer/snark/src/proof/mod.rs b/synthesizer/snark/src/proof/mod.rs index 9bdebe464c..745e087c07 100644 --- a/synthesizer/snark/src/proof/mod.rs +++ b/synthesizer/snark/src/proof/mod.rs @@ -26,7 +26,7 @@ pub struct Proof { impl Proof { /// Initializes a new proof. - pub(super) const fn new(proof: varuna::Proof) -> Self { + pub const fn new(proof: varuna::Proof) -> Self { Self { proof } } } From 85b44a9434a6f4533acaebe9c63cfe2c8216ef74 Mon Sep 17 00:00:00 2001 From: Howard Wu <9260812+howardwu@users.noreply.github.com> Date: Wed, 7 Feb 2024 21:10:53 -0800 Subject: [PATCH 268/298] Fix version --- ledger/narwhal/subdag/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ledger/narwhal/subdag/Cargo.toml b/ledger/narwhal/subdag/Cargo.toml index 0f47ae8c3a..e785fb4fbc 100644 --- a/ledger/narwhal/subdag/Cargo.toml +++ b/ledger/narwhal/subdag/Cargo.toml @@ -47,7 +47,7 @@ version = "=0.16.18" [dependencies.ledger-committee] package = "snarkvm-ledger-committee" path = "../../committee" -version = "=0.16.17" +version = "=0.16.18" [dependencies.narwhal-transmission-id] package = "snarkvm-ledger-narwhal-transmission-id" From b746a196ed5d54c6f3616b4191419406c2667013 Mon Sep 17 00:00:00 2001 From: Victor Sint Nicolaas Date: Thu, 8 Feb 2024 08:17:12 +0100 Subject: [PATCH 269/298] Correct underreport test program name --- synthesizer/src/vm/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/synthesizer/src/vm/mod.rs b/synthesizer/src/vm/mod.rs index 2f411b83f6..977277f676 100644 --- a/synthesizer/src/vm/mod.rs +++ b/synthesizer/src/vm/mod.rs @@ -1199,7 +1199,7 @@ function do: // Deploy the base program. let program = Program::from_str( r" -program synthesis_overreport.aleo; +program synthesis_underreport.aleo; function do: input r0 as u32.private; From 58e6c391863b731d9110e2bcedcddaf77b1bb1e1 Mon Sep 17 00:00:00 2001 From: Victor Sint Nicolaas Date: Thu, 8 Feb 2024 09:52:39 +0100 Subject: [PATCH 270/298] Correct test expectations --- synthesizer/src/vm/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/synthesizer/src/vm/mod.rs b/synthesizer/src/vm/mod.rs index e3052d9434..a24d2c89c0 100644 --- a/synthesizer/src/vm/mod.rs +++ b/synthesizer/src/vm/mod.rs @@ -951,7 +951,7 @@ function a: // Note: `deployment_transaction_ids` is sorted lexicographically by transaction ID, so the order may change if we update internal methods. assert_eq!( deployment_transaction_ids, - vec![deployment_4.id(), deployment_1.id(), deployment_3.id(), deployment_2.id()], + vec![deployment_2.id(), deployment_1.id(), deployment_4.id(), deployment_3.id()], "Update me if serialization has changed" ); } From d52c7944cc27232956cc189dfae23566abd2913a Mon Sep 17 00:00:00 2001 From: ljedrz Date: Tue, 6 Feb 2024 17:35:12 +0100 Subject: [PATCH 271/298] benches: add field benchmarks Signed-off-by: ljedrz --- fields/Cargo.toml | 13 ++++ fields/benches/fields.rs | 163 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 176 insertions(+) create mode 100644 fields/benches/fields.rs diff --git a/fields/Cargo.toml b/fields/Cargo.toml index dac4900487..37440ec746 100644 --- a/fields/Cargo.toml +++ b/fields/Cargo.toml @@ -23,6 +23,11 @@ include = [ "Cargo.toml", "src", "README.md", "LICENSE.md" ] license = "Apache-2.0" edition = "2021" +[[bench]] +name = "fields" +path = "benches/fields.rs" +harness = false + [dependencies.snarkvm-utilities] path = "../utilities" version = "=0.16.18" @@ -60,6 +65,14 @@ version = "1.0" version = "1" features = [ "derive" ] +[dev-dependencies.criterion] +version = "0.5" + +[dev-dependencies.snarkvm-curves] +path = "../curves" +version = "=0.16.18" +default-features = false + [features] default = [ "snarkvm-utilities/default" ] profiler = [ "aleo-std/profiler" ] diff --git a/fields/benches/fields.rs b/fields/benches/fields.rs new file mode 100644 index 0000000000..f58e4f6a64 --- /dev/null +++ b/fields/benches/fields.rs @@ -0,0 +1,163 @@ +// Copyright (C) 2019-2023 Aleo Systems Inc. +// This file is part of the snarkVM library. + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at: +// http://www.apache.org/licenses/LICENSE-2.0 + +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Silences the false positives caused by black_box. +#![allow(clippy::unit_arg)] + +use snarkvm_fields::{Field, Fp256, Fp384, PrimeField}; +use snarkvm_utilities::TestRng; + +use criterion::*; +use rand::Rng; +use std::{ + hint::black_box, + ops::{AddAssign, MulAssign, SubAssign}, +}; + +fn fp256(c: &mut Criterion) { + let rng = &mut TestRng::default(); + + const N: usize = 1_000; + + let mut values = Vec::with_capacity(N); + let mut arr = [0u8; 32]; + + while values.len() < N { + rng.fill(&mut arr); + if let Some(v) = Fp256::::from_random_bytes(&arr) { + values.push(v); + } + } + + c.bench_function("fp256_add_assign", |b| { + b.iter(|| { + for (mut v1, v2) in values.iter().cloned().zip(values.iter().skip(1)) { + black_box(v1.add_assign(v2)); + } + }) + }); + + c.bench_function("fp256_sub_assign", |b| { + b.iter(|| { + for (mut v1, v2) in values.iter().cloned().zip(values.iter().skip(1)) { + black_box(v1.sub_assign(v2)); + } + }) + }); + + c.bench_function("fp256_mul_assign", |b| { + b.iter(|| { + for (mut v1, v2) in values.iter().cloned().zip(values.iter().skip(1)) { + black_box(v1.mul_assign(v2)); + } + }) + }); + + c.bench_function("fp256_inverse", |b| { + b.iter(|| { + for v in values.iter() { + black_box(v.inverse()); + } + }) + }); + + c.bench_function("fp256_square_in_place", |b| { + b.iter(|| { + for mut v in values.iter().cloned() { + black_box(v.square_in_place()); + } + }) + }); + + c.bench_function("fp256_to_bigint", |b| { + b.iter(|| { + for v in values.iter() { + black_box(v.to_bigint()); + } + }) + }); +} + +fn fp384(c: &mut Criterion) { + let rng = &mut TestRng::default(); + + const N: usize = 1_000; + + let mut values = Vec::with_capacity(N); + let mut arr = [0u8; 48]; + + while values.len() < N { + rng.fill(&mut arr[..32]); + rng.fill(&mut arr[32..]); + if let Some(v) = Fp384::::from_random_bytes(&arr) { + values.push(v); + } + } + + c.bench_function("fp384_add_assign", |b| { + b.iter(|| { + for (mut v1, v2) in values.iter().cloned().zip(values.iter().skip(1)) { + black_box(v1.add_assign(v2)); + } + }) + }); + + c.bench_function("fp384_sub_assign", |b| { + b.iter(|| { + for (mut v1, v2) in values.iter().cloned().zip(values.iter().skip(1)) { + black_box(v1.sub_assign(v2)); + } + }) + }); + + c.bench_function("fp384_mul_assign", |b| { + b.iter(|| { + for (mut v1, v2) in values.iter().cloned().zip(values.iter().skip(1)) { + black_box(v1.mul_assign(v2)); + } + }) + }); + + c.bench_function("fp384_inverse", |b| { + b.iter(|| { + for v in values.iter() { + black_box(v.inverse()); + } + }) + }); + + c.bench_function("fp384_square_in_place", |b| { + b.iter(|| { + for mut v in values.iter().cloned() { + black_box(v.square_in_place()); + } + }) + }); + + c.bench_function("fp384_to_bigint", |b| { + b.iter(|| { + for v in values.iter() { + black_box(v.to_bigint()); + } + }) + }); +} + +criterion_group! { + name = fields; + config = Criterion::default(); + targets = fp256, fp384 +} + +criterion_main!(fields); From bbf62f3224d8e0686d444bf4cf4f370e76ab5f6e Mon Sep 17 00:00:00 2001 From: ljedrz Date: Wed, 7 Feb 2024 12:46:22 +0100 Subject: [PATCH 272/298] cleanup: align the Fp256 and Fp384 impls Signed-off-by: ljedrz --- fields/src/fp_256.rs | 48 +++++++++++++++++++++----------------------- fields/src/fp_384.rs | 14 +++++++------ 2 files changed, 31 insertions(+), 31 deletions(-) diff --git a/fields/src/fp_256.rs b/fields/src/fp_256.rs index 641a5d0f20..80f69a635b 100644 --- a/fields/src/fp_256.rs +++ b/fields/src/fp_256.rs @@ -122,7 +122,7 @@ impl Fp256

{ impl Zero for Fp256

{ #[inline] fn zero() -> Self { - Fp256::

(BigInteger::from(0), PhantomData) + Self(BigInteger::from(0), PhantomData) } #[inline] @@ -134,12 +134,12 @@ impl Zero for Fp256

{ impl One for Fp256

{ #[inline] fn one() -> Self { - Fp256::

(P::R, PhantomData) + Self(P::R, PhantomData) } #[inline] fn is_one(&self) -> bool { - self == &Self::one() + self.0 == P::R } } @@ -299,7 +299,7 @@ impl Field for Fp256

{ let mut u = self.0; let mut v = P::MODULUS; - let mut b = Fp256::

(P::R2, PhantomData); // Avoids unnecessary reduction step. + let mut b = Self(P::R2, PhantomData); // Avoids unnecessary reduction step. let mut c = Self::zero(); while u != one && v != one { @@ -536,12 +536,25 @@ impl SquareRootField for Fp256

{ } fn sqrt_in_place(&mut self) -> Option<&mut Self> { - if let Some(sqrt) = self.sqrt() { + (*self).sqrt().map(|sqrt| { *self = sqrt; - Some(self) - } else { - None - } + self + }) + } +} + +/// `Fp` elements are ordered lexicographically. +impl Ord for Fp256

{ + #[inline(always)] + fn cmp(&self, other: &Self) -> Ordering { + self.to_bigint().cmp(&other.to_bigint()) + } +} + +impl PartialOrd for Fp256

{ + #[inline(always)] + fn partial_cmp(&self, other: &Self) -> Option { + Some(self.cmp(other)) } } @@ -593,21 +606,6 @@ impl FromBytes for Fp256

{ } } -/// `Fp` elements are ordered lexicographically. -impl Ord for Fp256

{ - #[inline(always)] - fn cmp(&self, other: &Self) -> Ordering { - self.to_bigint().cmp(&other.to_bigint()) - } -} - -impl PartialOrd for Fp256

{ - #[inline(always)] - fn partial_cmp(&self, other: &Self) -> Option { - Some(self.cmp(other)) - } -} - impl FromStr for Fp256

{ type Err = FieldError; @@ -677,7 +675,7 @@ impl Neg for Fp256

{ if !self.is_zero() { let mut tmp = P::MODULUS; tmp.sub_noborrow(&self.0); - Fp256::

(tmp, PhantomData) + Self(tmp, PhantomData) } else { self } diff --git a/fields/src/fp_384.rs b/fields/src/fp_384.rs index 9c74c0e336..1e60a18c2f 100644 --- a/fields/src/fp_384.rs +++ b/fields/src/fp_384.rs @@ -156,7 +156,7 @@ impl Fp384

{ impl Zero for Fp384

{ #[inline] fn zero() -> Self { - Fp384::

(BigInteger::from(0), PhantomData) + Self(BigInteger::from(0), PhantomData) } #[inline] @@ -168,7 +168,7 @@ impl Zero for Fp384

{ impl One for Fp384

{ #[inline] fn one() -> Self { - Fp384::

(P::R, PhantomData) + Self(P::R, PhantomData) } #[inline] @@ -357,7 +357,7 @@ impl Field for Fp384

{ let mut u = self.0; let mut v = P::MODULUS; - let mut b = Fp384::

(P::R2, PhantomData); // Avoids unnecessary reduction step. + let mut b = Self(P::R2, PhantomData); // Avoids unnecessary reduction step. let mut c = Self::zero(); while u != one && v != one { @@ -433,7 +433,6 @@ impl PrimeField for Fp384

{ let mut tmp = self.0; let mut r = tmp.0; // Montgomery Reduction - // Iteration 0 let k = r[0].wrapping_mul(P::INV); let mut carry = 0; fa::mac_with_carry(r[0], k, P::MODULUS.0[0], &mut carry); @@ -538,6 +537,7 @@ impl SquareRootField for Fp384

{ // s = self^((MODULUS - 1) // 2) let s = self.pow(P::MODULUS_MINUS_ONE_DIV_TWO); + if s.is_zero() { Zero } else if s.is_one() { @@ -560,6 +560,7 @@ impl SquareRootField for Fp384

{ } } +/// `Fp` elements are ordered lexicographically. impl Ord for Fp384

{ #[inline(always)] fn cmp(&self, other: &Self) -> Ordering { @@ -691,7 +692,7 @@ impl Neg for Fp384

{ if !self.is_zero() { let mut tmp = P::MODULUS; tmp.sub_noborrow(&self.0); - Fp384::

(tmp, PhantomData) + Self(tmp, PhantomData) } else { self } @@ -747,7 +748,7 @@ impl<'a, P: Fp384Parameters> AddAssign<&'a Self> for Fp384

{ fn add_assign(&mut self, other: &Self) { // This cannot exceed the backing capacity. self.0.add_nocarry(&other.0); - // However, it may need to be reduced + // However, it may need to be reduced. self.reduce(); } } @@ -771,6 +772,7 @@ impl<'a, P: Fp384Parameters> MulAssign<&'a Self> for Fp384

{ let mut carry1 = 0u64; let mut carry2 = 0u64; + // Iteration 0. r[0] = fa::mac(r[0], (self.0).0[0], (other.0).0[0], &mut carry1); let k = r[0].wrapping_mul(P::INV); fa::mac_discard(r[0], k, P::MODULUS.0[0], &mut carry2); From f53fddd2f4fba74aa211346bce27e308f5645921 Mon Sep 17 00:00:00 2001 From: ljedrz Date: Thu, 8 Feb 2024 15:52:55 +0100 Subject: [PATCH 273/298] chore: adjust the lockfile Signed-off-by: ljedrz --- Cargo.lock | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Cargo.lock b/Cargo.lock index 56251c9a48..f1c6e6abd0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3036,11 +3036,13 @@ version = "0.16.18" dependencies = [ "aleo-std", "anyhow", + "criterion", "itertools 0.11.0", "num-traits", "rand", "rayon", "serde", + "snarkvm-curves", "snarkvm-utilities", "thiserror", "zeroize", From 411218bff9d51ac1db4badfe5470203d0178320f Mon Sep 17 00:00:00 2001 From: Howard Wu <9260812+howardwu@users.noreply.github.com> Date: Thu, 8 Feb 2024 18:14:18 -0800 Subject: [PATCH 274/298] nit: use let-else syntax --- synthesizer/process/src/stack/deploy.rs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/synthesizer/process/src/stack/deploy.rs b/synthesizer/process/src/stack/deploy.rs index 534c8a2142..be662d134f 100644 --- a/synthesizer/process/src/stack/deploy.rs +++ b/synthesizer/process/src/stack/deploy.rs @@ -133,12 +133,9 @@ impl Stack { // Initialize the assignments. let assignments = Assignments::::default(); // Initialize the constraint limit. Account for the constraint added after synthesis that makes the Varuna zerocheck hiding. - let constraint_limit = match verifying_key.circuit_info.num_constraints.checked_sub(1) { + let Some(constraint_limit) = verifying_key.circuit_info.num_constraints.checked_sub(1) else { // Since a deployment must always pay non-zero fee, it must always have at least one constraint. - None => { - bail!("The constraint limit of 0 for function '{}' is invalid", function.name()); - } - Some(limit) => limit, + bail!("The constraint limit of 0 for function '{}' is invalid", function.name()); }; // Initialize the call stack. let call_stack = CallStack::CheckDeployment( From 06e929a9bdc8b41ab0c4a8708d75f6a2c806b395 Mon Sep 17 00:00:00 2001 From: Pranav Gaddamadugu <23022326+d0cd@users.noreply.github.com> Date: Thu, 8 Feb 2024 23:16:12 -0600 Subject: [PATCH 275/298] Ensure that the number of stakers is less than or equal to 100_000 --- .../program/src/resources/credits.aleo | 181 ++++++++++-------- 1 file changed, 100 insertions(+), 81 deletions(-) diff --git a/synthesizer/program/src/resources/credits.aleo b/synthesizer/program/src/resources/credits.aleo index 27da101cc0..296ee5a22a 100644 --- a/synthesizer/program/src/resources/credits.aleo +++ b/synthesizer/program/src/resources/credits.aleo @@ -36,11 +36,11 @@ struct committee_state: /// The `metadata` mapping stores: /// - The number of members in the committee. -/// - The number of delegators bonded to each validator. +/// - The number of stakers. mapping metadata: // The key represents the index at which the count is stored. - // - This address (aleo1qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq3ljyzc) stores the number of members in the committee. - // - This address (aleo1qgqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqanmpl0) stores the total number of **delegators**. + // - This address (aleo1qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq3ljyzc) stores the number of **members** in the committee. + // - This address (aleo1qgqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqanmpl0) stores the number of **stakers**. key as address.public; // The value represents the count. value as u32.public; @@ -141,6 +141,7 @@ finalize bond_public: contains committee[r1] into r4; // If the validator is already in the committee, jump to the `continue_bond_validator` logic. branch.eq r4 true to continue_bond_validator; + // Get the committee size. get.or_use metadata[aleo1qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq3ljyzc] 0u32 into r5; // Increment the committee size by one. @@ -152,57 +153,68 @@ finalize bond_public: // Set the new committee size. set r6 into metadata[aleo1qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq3ljyzc]; + // Get the number of stakers. + get.or_use metadata[aleo1qgqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqanmpl0] 0u32 into r8; + // Increment the number of stakers by one. + add r8 1u32 into r9; + // Determine if the number of stakers is less than or equal to 100_000. + lte r9 100_000u32 into r10; + // Enforce that the number of stakers is less than or equal to 100_000. + assert.eq r10 true; + // Set the new number of stakers. + set r9 into metadata[aleo1qgqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqanmpl0]; + // Continues the rest of the `bond_validator` logic. position continue_bond_validator; // Construct the initial committee state. // Note: We set the initial 'is_open' state to 'true'. - cast 0u64 true into r8 as committee_state; + cast 0u64 true into r11 as committee_state; // Retrieve the committee state of the specified validator. - get.or_use committee[r0] r8 into r9; + get.or_use committee[r0] r11 into r12; // Ensure that the validator is open to stakers. - assert.eq r9.is_open true; + assert.eq r12.is_open true; // Increment the stake for the specified validator. - add r9.microcredits r2 into r10; + add r12.microcredits r2 into r13; // Construct the updated committee state. - cast r10 r9.is_open into r11 as committee_state; + cast r13 r9.is_open into r14 as committee_state; /* Bonded */ // Construct the initial bond state. - cast r1 0u64 into r12 as bond_state; + cast r1 0u64 into r15 as bond_state; // Get the bond state for the caller, or default to the initial bond state. - get.or_use bonded[r0] r12 into r13; + get.or_use bonded[r0] r15 into r16; // Enforce the validator matches in the bond state. - assert.eq r13.validator r1; + assert.eq r16.validator r1; // Increment the microcredits in the bond state. - add r9.microcredits r2 into r14; + add r12.microcredits r2 into r17; // Determine if the amount is at least one million credits. - gte r14 1_000_000_000_000u64 into r15; + gte r17 1_000_000_000_000u64 into r18; // Enforce the amount is at least one million credits. - assert.eq r15 true; + assert.eq r18 true; // Construct the updated bond state. - cast r1 r14 into r16 as bond_state; + cast r1 r17 into r19 as bond_state; /* Account */ // Get the balance of the caller. // If the account does not exist, this finalize scope will fail. - get account[r0] into r17; + get account[r0] into r20; // Decrement the balance of the caller. - sub r17 r2 into r18; + sub r20 r2 into r21; /* Writes */ // Update the committee state of the specified validator. - set r11 into committee[r0]; + set r14 into committee[r0]; // Update the bond state for the caller. - set r16 into bonded[r0]; + set r19 into bonded[r0]; // Update the balance of the caller. - set r18 into account[r0]; + set r21 into account[r0]; // Ends the `bond_validator` logic. branch.eq true true to end; @@ -215,35 +227,35 @@ finalize bond_public: /* Committee */ // Check if the caller is a validator. - contains committee[r0] into r19; + contains committee[r0] into r22; // Enforce the caller is *not* a validator. - assert.eq r19 false; + assert.eq r22 false; // Get the stake for the specified validator. // If the validator does not exist, this finalize scope will fail. - get committee[r1] into r20; + get committee[r1] into r23; // Ensure that the validator is open to stakers. - assert.eq r20.is_open true; + assert.eq r23.is_open true; // Increment the stake for the specified validator. - add r20.microcredits r2 into r21; + add r23.microcredits r2 into r24; // Construct the updated committee state. - cast r21 r20.is_open into r22 as committee_state; + cast r24 r23.is_open into r25 as committee_state; // Check if the delegator is already bonded to the validator. - contains bonded[r0] into r23; + contains bonded[r0] into r26; // If the delegator is already bonded to the validator, jump to the `continue_bond_delegator` logic. - branch.eq r23 true to continue_bond_delegator; - // Get the total number of bonded delegators. - get.or_use metadata[aleo1qgqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqanmpl0] 0u32 into r24; + branch.eq r26 true to continue_bond_delegator; + // Get the number of stakers. + get.or_use metadata[aleo1qgqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqanmpl0] 0u32 into r27; // Increment the number of bonded delegators by one. - add r24 1u32 into r25; - // Determine if the number of bonded delegators is less than or equal to 1_000_000. - lte r25 1_000_000u32 into r26; - // Enforce that the number of bonded delegators is less than or equal to 1_000_000. - assert.eq r26 true; - // Set the new number of delegators bonded to the validator. - set r25 into metadata[aleo1qgqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqanmpl0]; + add r27 1u32 into r28; + // Determine if the number of stakers is less than or equal to 100_000. + lte r28 100_000u32 into r29; + // Enforce that the number of stakers is less than or equal to 100_000. + assert.eq r29 true; + // Set the new number of stakers. + set r28 into metadata[aleo1qgqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqanmpl0]; // Continues the rest of the `bond_delegator` logic. position continue_bond_delegator; @@ -251,38 +263,38 @@ finalize bond_public: /* Bonded */ // Construct the initial bond state. - cast r1 0u64 into r27 as bond_state; + cast r1 0u64 into r30 as bond_state; // Get the bond state for the caller, or default to the initial bond state. - get.or_use bonded[r0] r27 into r28; + get.or_use bonded[r0] r30 into r31; // Enforce the validator matches in the bond state. - assert.eq r28.validator r1; + assert.eq r31.validator r1; // Increment the microcredits in the bond state. - add r28.microcredits r2 into r29; + add r31.microcredits r2 into r32; // Determine if the amount is at least 10 credits. - gte r29 10_000_000u64 into r30; + gte r32 10_000_000u64 into r33; // Enforce the amount is at least 10 credits. - assert.eq r30 true; + assert.eq r33 true; // Construct the updated bond state. - cast r1 r29 into r31 as bond_state; + cast r1 r32 into r34 as bond_state; /* Account */ // Get the balance of the caller. // If the account does not exist, this finalize scope will fail. - get account[r0] into r32; + get account[r0] into r35; // Decrement the balance of the caller. - sub r32 r2 into r33; + sub r35 r2 into r36; /* Writes */ // Update the committee state for the specified validator. - set r22 into committee[r1]; + set r25 into committee[r1]; // Update the bond state for the caller. - set r31 into bonded[r0]; + set r34 into bonded[r0]; // Update the balance of the caller. - set r33 into account[r0]; + set r36 into account[r0]; // The terminus. position end; @@ -404,6 +416,13 @@ finalize unbond_public: // Set the new committee size. set r16 into metadata[aleo1qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq3ljyzc]; + // Get the number of stakers. + get metadata[aleo1qgqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqanmpl0] into r17; + // Decrement the number of stakers by one. + sub r17 1u32 into r18; + // Set the new number of stakers. + set r18 into metadata[aleo1qgqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqanmpl0]; + /* Bonded */ // Remove the bond state for the validator. @@ -412,12 +431,12 @@ finalize unbond_public: /* Unbonding */ // Increment the microcredits in the unbond state. - add r3.microcredits r8.microcredits into r17; + add r3.microcredits r8.microcredits into r19; // Construct the updated unbond state. - cast r17 r4 into r18 as unbond_state; + cast r19 r4 into r20 as unbond_state; // Update the unbond state for the caller. - set r18 into unbonding[r0]; + set r20 into unbonding[r0]; // Ends the `remove_validator` logic. branch.eq true true to end; @@ -428,17 +447,17 @@ finalize unbond_public: position unbond_delegator; // Get the bond state for the caller, or fail if it does not exist. - get bonded[r0] into r19; + get bonded[r0] into r21; // Decrement the microcredits in the bond state. - sub r19.microcredits r1 into r20; + sub r21.microcredits r1 into r22; // Determine if the remaining bond is at least 10 credits. - gte r20 10_000_000u64 into r21; + gte r22 10_000_000u64 into r23; // If the remaining balance is at least 10 credits, jump to the `decrement_delegator` logic. - branch.eq r21 true to decrement_delegator; + branch.eq r23 true to decrement_delegator; // If the remaining balance is less than 10 credits, jump to the `remove_delegator` logic. - branch.eq r21 false to remove_delegator; + branch.eq r23 false to remove_delegator; /*** Decrement Delegator ***/ @@ -449,30 +468,30 @@ finalize unbond_public: // Get the stake for the specified validator. // If the validator does not exist, this finalize scope will fail. - get committee[r19.validator] into r22; + get committee[r19.validator] into r24; // Decrement the stake for the specified validator. - sub r22.microcredits r1 into r23; + sub r24.microcredits r1 into r25; // Construct the updated committee state. - cast r23 r22.is_open into r24 as committee_state; + cast r25 r24.is_open into r26 as committee_state; // Update the stake for the specified validator. - set r24 into committee[r19.validator]; + set r26 into committee[r21.validator]; /* Bonded */ // Construct the updated bond state. - cast r19.validator r20 into r25 as bond_state; + cast r21.validator r22 into r27 as bond_state; // Update the bond state for the caller. - set r25 into bonded[r0]; + set r27 into bonded[r0]; /* Unbonding */ // Increment the microcredits in the unbond state. - add r3.microcredits r1 into r26; + add r3.microcredits r1 into r28; // Construct the updated unbond state. - cast r26 r4 into r27 as unbond_state; + cast r28 r4 into r29 as unbond_state; // Update the unbond state for the caller. - set r27 into unbonding[r0]; + set r29 into unbonding[r0]; // Ends the `decrement_delegator` logic. branch.eq true true to end; @@ -486,20 +505,20 @@ finalize unbond_public: // Get the stake for the specified validator. // If the validator does not exist, this finalize scope will fail. - get committee[r19.validator] into r28; + get committee[r21.validator] into r30; // Decrement the stake for the specified validator. - sub r28.microcredits r19.microcredits into r29; + sub r30.microcredits r21.microcredits into r31; // Construct the updated committee state. - cast r29 r28.is_open into r30 as committee_state; + cast r31 r30.is_open into r32 as committee_state; // Update the stake for the specified validator. - set r30 into committee[r19.validator]; + set r32 into committee[r21.validator]; - // Get the number of bonded delegators. - get metadata[aleo1qgqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqanmpl0] into r31; + // Get the number of stakers. + get metadata[aleo1qgqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqanmpl0] into r33; // Decrement the number of bonded delegators by one. - sub r31 1u32 into r32; - // Set the new number of bonded delegators. - set r32 into metadata[aleo1qgqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqanmpl0]; + sub r33 1u32 into r34; + // Set the new number of stakers. + set r34 into metadata[aleo1qgqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqanmpl0]; /* Bonded */ @@ -509,12 +528,12 @@ finalize unbond_public: /* Unbonding */ // Increment the microcredits in the unbond state. - add r3.microcredits r19.microcredits into r33; + add r3.microcredits r21.microcredits into r35; // Construct the updated unbond state. - cast r33 r4 into r34 as unbond_state; + cast r35 r4 into r36 as unbond_state; // Update the unbond state for the caller. - set r34 into unbonding[r0]; + set r36 into unbonding[r0]; // The terminus. position end; @@ -568,9 +587,9 @@ finalize unbond_delegator_as_validator: // Construct the updated committee state. cast r5 r2.is_open into r6 as committee_state; - // Get the number of bonded delegators. + // Get the number of stakers. get metadata[aleo1qgqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqanmpl0] into r7; - // Decrement the number of bonded delegators by one. + // Decrement the number of stakers by one. sub r7 1u32 into r8; /* End Committee */ @@ -601,7 +620,7 @@ finalize unbond_delegator_as_validator: remove bonded[r1]; // Update the unbond state for the delegator. set r13 into unbonding[r1]; - // Update the number of bonded delegators. + // Update the number of stakers. set r8 into metadata[aleo1qgqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqanmpl0]; /* End Writes */ From 5e277f67d2be9d1c68958ad060d6eac3500e7b65 Mon Sep 17 00:00:00 2001 From: Pranav Gaddamadugu <23022326+d0cd@users.noreply.github.com> Date: Thu, 8 Feb 2024 23:18:59 -0600 Subject: [PATCH 276/298] Genesis::Ratify updates metadata mappings --- ledger/committee/src/lib.rs | 2 ++ synthesizer/src/vm/finalize.rs | 29 +++++++++++++++++++++++++++++ 2 files changed, 31 insertions(+) diff --git a/ledger/committee/src/lib.rs b/ledger/committee/src/lib.rs index fd67bf9983..5dc85b6a66 100644 --- a/ledger/committee/src/lib.rs +++ b/ledger/committee/src/lib.rs @@ -36,6 +36,8 @@ use std::collections::HashSet; pub const MIN_VALIDATOR_STAKE: u64 = 1_000_000_000_000u64; // microcredits /// The minimum amount of stake required for a delegator to bond. pub const MIN_DELEGATOR_STAKE: u64 = 10_000_000u64; // microcredits +/// The maximum number of members in a committee. +pub const MAX_COMMITTEE_SIZE: u16 = 200; #[derive(Clone, PartialEq, Eq)] pub struct Committee { diff --git a/synthesizer/src/vm/finalize.rs b/synthesizer/src/vm/finalize.rs index de56082fb3..b6ea685284 100644 --- a/synthesizer/src/vm/finalize.rs +++ b/synthesizer/src/vm/finalize.rs @@ -758,6 +758,8 @@ impl> VM { let bonded_mapping = Identifier::from_str("bonded")?; // Construct the account mapping name. let account_mapping = Identifier::from_str("account")?; + // Construct the metadata mapping name. + let metadata_mapping = Identifier::from_str("metadata")?; // Initialize a list of finalize operations. let mut finalize_operations = Vec::new(); @@ -776,6 +778,11 @@ impl> VM { committee.starting_round() == 0, "Ratify::Genesis(..) expected a genesis committee round of 0" ); + // Ensure that the number of members in the committee does not exceed the maximum. + ensure!( + committee.members().len() <= Committee::::MAX_COMMITTEE_SIZE as usize, + "Ratify::Genesis(..) exceeds the maximum number of committee members" + ); // Ensure genesis has not been ratified yet. ensure!(!is_genesis_ratified, "Ratify::Genesis(..) has already been ratified"); @@ -813,6 +820,28 @@ impl> VM { store.replace_mapping(program_id, bonded_mapping, next_bonded_map)?, ]); + // Update the number of validators. + finalize_operations.extend(&[ + // Update the number of validators in the metadata mapping. + store.update_key_value( + program_id, + metadata_mapping, + Plaintext::from_str("aleo1qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq3ljyzc")?, + Value::from(Literal::U64(U64::new(committee.members().len() as u64))), + )?, + ]); + + // Update the number of stakers. + finalize_operations.extend(&[ + // Update the number of stakers in the metadata mapping. + store.update_key_value( + program_id, + metadata_mapping, + Plaintext::from_str("")?, + Value::from(Literal::U64(U64::new(stakers.len() as u64))), + )?, + ]); + // Iterate over the public balances. for (address, amount) in public_balances { // Construct the key. From 40d4c209bdef2bb650d2c73e91dca26cc845d632 Mon Sep 17 00:00:00 2001 From: Pranav Gaddamadugu <23022326+d0cd@users.noreply.github.com> Date: Fri, 9 Feb 2024 00:45:03 -0600 Subject: [PATCH 277/298] Add test and fix --- .../program/src/resources/credits.aleo | 4 +- synthesizer/src/vm/finalize.rs | 206 +++++++++++++++++- 2 files changed, 207 insertions(+), 3 deletions(-) diff --git a/synthesizer/program/src/resources/credits.aleo b/synthesizer/program/src/resources/credits.aleo index 296ee5a22a..7010a05d11 100644 --- a/synthesizer/program/src/resources/credits.aleo +++ b/synthesizer/program/src/resources/credits.aleo @@ -178,7 +178,7 @@ finalize bond_public: // Increment the stake for the specified validator. add r12.microcredits r2 into r13; // Construct the updated committee state. - cast r13 r9.is_open into r14 as committee_state; + cast r13 r12.is_open into r14 as committee_state; /* Bonded */ @@ -468,7 +468,7 @@ finalize unbond_public: // Get the stake for the specified validator. // If the validator does not exist, this finalize scope will fail. - get committee[r19.validator] into r24; + get committee[r21.validator] into r24; // Decrement the stake for the specified validator. sub r24.microcredits r1 into r25; // Construct the updated committee state. diff --git a/synthesizer/src/vm/finalize.rs b/synthesizer/src/vm/finalize.rs index b6ea685284..479c36c6f7 100644 --- a/synthesizer/src/vm/finalize.rs +++ b/synthesizer/src/vm/finalize.rs @@ -837,7 +837,7 @@ impl> VM { store.update_key_value( program_id, metadata_mapping, - Plaintext::from_str("")?, + Plaintext::from_str("aleo1qgqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqanmpl0")?, Value::from(Literal::U64(U64::new(stakers.len() as u64))), )?, ]); @@ -995,6 +995,7 @@ mod tests { types::Field, }; use ledger_block::{Block, Header, Metadata, Transaction, Transition}; + use ledger_committee::MIN_VALIDATOR_STAKE; use ledger_store::helpers::memory::ConsensusMemory; use synthesizer_program::Program; @@ -1779,4 +1780,207 @@ finalize compute: VM::>::MAXIMUM_CONFIRMED_TRANSACTIONS ); } + + #[test] + fn test_genesis_ratify_greater_than_max_committee_size() { + // Initialize an RNG. + let rng = &mut TestRng::default(); + + // Initialize the VM. + let vm = + VM::from(ConsensusStore::>::open(None).unwrap()).unwrap(); + + // Construct the validators, greater than the maximum committee size. + let validators = (0..(Committee::::MAX_COMMITTEE_SIZE + 1)) + .map(|_| { + let private_key = PrivateKey::::new(rng).unwrap(); + let amount = MIN_VALIDATOR_STAKE; + let is_open = true; + (private_key, (amount, is_open)) + }) + .collect::>(); + + // Construct the committee. + let mut committee_map = IndexMap::new(); + for (private_key, (amount, _)) in &validators { + let address = Address::try_from(private_key).unwrap(); + committee_map.insert(address, (*amount, true)); + } + + // Attempt to construct a `Committee` with more than the maximum committee size. + let result = Committee::new_genesis(committee_map); + assert!(result.is_err()); + + // Reset the validators. + let validators = (0..Committee::::MAX_COMMITTEE_SIZE) + .map(|_| { + let private_key = PrivateKey::new(rng).unwrap(); + let amount = MIN_VALIDATOR_STAKE; + let is_open = true; + (private_key, (amount, is_open)) + }) + .collect::>(); + + // Track the allocated amount. + let mut allocated_amount = 0; + + // Construct the committee. + let mut committee_map = IndexMap::new(); + for (private_key, (amount, _)) in &validators { + let address = Address::try_from(private_key).unwrap(); + committee_map.insert(address, (*amount, true)); + allocated_amount += *amount; + } + + // Construct the public balances, allocating the remaining supply. + let mut public_balances = IndexMap::new(); + let remaining_supply = ::STARTING_SUPPLY - allocated_amount; + for (private_key, _) in &validators { + let address = Address::try_from(private_key).unwrap(); + let amount = remaining_supply / validators.len() as u64; + allocated_amount += amount; + public_balances.insert(address, amount); + } + let remaining_supply = ::STARTING_SUPPLY - allocated_amount; + if remaining_supply > 0 { + let address = Address::try_from(&PrivateKey::::new(rng).unwrap()).unwrap(); + public_balances.insert(address, remaining_supply); + } + + // Construct the genesis block, which should pass. + let block = vm + .genesis_quorum( + validators.keys().next().unwrap(), + Committee::new_genesis(committee_map).unwrap(), + public_balances, + rng, + ) + .unwrap(); + + // Add the block. + vm.add_next_block(&block).unwrap(); + } + + #[test] + fn test_max_committee_limit_with_bonds() { + // Initialize an RNG. + let rng = &mut TestRng::default(); + + // Initialize the VM. + let vm = + VM::from(ConsensusStore::>::open(None).unwrap()).unwrap(); + + // Construct the validators, one less than the maximum committee size. + let validators = (0..Committee::::MAX_COMMITTEE_SIZE - 1) + .map(|_| { + let private_key = PrivateKey::::new(rng).unwrap(); + let amount = MIN_VALIDATOR_STAKE; + let is_open = true; + (private_key, (amount, is_open)) + }) + .collect::>(); + + // Track the allocated amount. + let mut allocated_amount = 0; + + // Construct the committee. + let mut committee_map = IndexMap::new(); + for (private_key, (amount, _)) in &validators { + let address = Address::try_from(private_key).unwrap(); + committee_map.insert(address, (*amount, true)); + allocated_amount += *amount; + } + + // Initialize two new validators. + let first_private_key = PrivateKey::::new(rng).unwrap(); + let first_address = Address::try_from(&first_private_key).unwrap(); + let second_private_key = PrivateKey::::new(rng).unwrap(); + let second_address = Address::try_from(&second_private_key).unwrap(); + + // Construct the public balances, allocating the remaining supply to the first validator and two new validators. + let mut public_balances = IndexMap::new(); + let remaining_supply = ::STARTING_SUPPLY - allocated_amount; + let amount = remaining_supply / 3; + public_balances.insert(Address::try_from(validators.keys().next().unwrap()).unwrap(), amount); + public_balances.insert(first_address.clone(), amount); + public_balances.insert(second_address.clone(), remaining_supply - 2 * amount); + + // Construct the genesis block, which should pass. + let genesis_block = vm + .genesis_quorum( + validators.keys().next().unwrap(), + Committee::new_genesis(committee_map).unwrap(), + public_balances, + rng, + ) + .unwrap(); + + // Add the block. + vm.add_next_block(&genesis_block).unwrap(); + + // Bond the first validator. + let bond_first_transaction = vm + .execute( + &first_private_key, + ("credits.aleo", "bond_public"), + vec![ + Value::::from_str(&first_address.to_string()).unwrap(), + Value::::from_str(&format!("{MIN_VALIDATOR_STAKE}u64")).unwrap(), + ] + .iter(), + None, + 0, + None, + rng, + ) + .unwrap(); + + // Construct the next block. + let next_block = sample_next_block( + &vm, + &validators.keys().next().unwrap(), + &[bond_first_transaction], + &genesis_block, + &mut vec![], + rng, + ) + .unwrap(); + + // Check that the transaction was accepted. + assert!(next_block.aborted_transaction_ids().is_empty()); + + // Add the next block to the VM. + vm.add_next_block(&next_block).unwrap(); + + // Attempt to bond the second validator. + let bond_second_transaction = vm + .execute( + &second_private_key, + ("credits.aleo", "bond_public"), + vec![ + Value::::from_str(&second_address.to_string()).unwrap(), + Value::::from_str(&format!("{MIN_VALIDATOR_STAKE}u64")).unwrap(), + ] + .iter(), + None, + 0, + None, + rng, + ) + .unwrap(); + + // Construct the next block. + let next_block = sample_next_block( + &vm, + &validators.keys().next().unwrap(), + &[bond_second_transaction], + &next_block, + &mut vec![], + rng, + ) + .unwrap(); + + // Check that the transaction was rejected. + assert!(next_block.transactions().iter().next().unwrap().is_rejected()); + } } From ac7b81cacffdb471926cb63ed82037a52ac7b41d Mon Sep 17 00:00:00 2001 From: Pranav Gaddamadugu <23022326+d0cd@users.noreply.github.com> Date: Fri, 9 Feb 2024 00:50:48 -0600 Subject: [PATCH 278/298] Clippy --- synthesizer/src/vm/finalize.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/synthesizer/src/vm/finalize.rs b/synthesizer/src/vm/finalize.rs index 479c36c6f7..3bb8d42a19 100644 --- a/synthesizer/src/vm/finalize.rs +++ b/synthesizer/src/vm/finalize.rs @@ -1902,8 +1902,8 @@ finalize compute: let remaining_supply = ::STARTING_SUPPLY - allocated_amount; let amount = remaining_supply / 3; public_balances.insert(Address::try_from(validators.keys().next().unwrap()).unwrap(), amount); - public_balances.insert(first_address.clone(), amount); - public_balances.insert(second_address.clone(), remaining_supply - 2 * amount); + public_balances.insert(first_address, amount); + public_balances.insert(second_address, remaining_supply - 2 * amount); // Construct the genesis block, which should pass. let genesis_block = vm @@ -1938,7 +1938,7 @@ finalize compute: // Construct the next block. let next_block = sample_next_block( &vm, - &validators.keys().next().unwrap(), + validators.keys().next().unwrap(), &[bond_first_transaction], &genesis_block, &mut vec![], @@ -1972,7 +1972,7 @@ finalize compute: // Construct the next block. let next_block = sample_next_block( &vm, - &validators.keys().next().unwrap(), + validators.keys().next().unwrap(), &[bond_second_transaction], &next_block, &mut vec![], From 0480e90ad08728d3631a66ba18dad5b21f4c5b87 Mon Sep 17 00:00:00 2001 From: Pranav Gaddamadugu <23022326+d0cd@users.noreply.github.com> Date: Fri, 9 Feb 2024 01:12:43 -0600 Subject: [PATCH 279/298] Regen expectations --- ledger/committee/src/lib.rs | 2 -- .../tests/expectations/vm/execute_and_finalize/test_rand.out | 4 ++-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/ledger/committee/src/lib.rs b/ledger/committee/src/lib.rs index 5dc85b6a66..fd67bf9983 100644 --- a/ledger/committee/src/lib.rs +++ b/ledger/committee/src/lib.rs @@ -36,8 +36,6 @@ use std::collections::HashSet; pub const MIN_VALIDATOR_STAKE: u64 = 1_000_000_000_000u64; // microcredits /// The minimum amount of stake required for a delegator to bond. pub const MIN_DELEGATOR_STAKE: u64 = 10_000_000u64; // microcredits -/// The maximum number of members in a committee. -pub const MAX_COMMITTEE_SIZE: u16 = 200; #[derive(Clone, PartialEq, Eq)] pub struct Committee { diff --git a/synthesizer/tests/expectations/vm/execute_and_finalize/test_rand.out b/synthesizer/tests/expectations/vm/execute_and_finalize/test_rand.out index 57dd18584c..6032cc07fc 100644 --- a/synthesizer/tests/expectations/vm/execute_and_finalize/test_rand.out +++ b/synthesizer/tests/expectations/vm/execute_and_finalize/test_rand.out @@ -19,14 +19,14 @@ outputs: test_rand.aleo/rand_chacha_check: outputs: - '{"type":"future","id":"488590592441422127997725386233571306457829570948543232762424611162021835080field","value":"{\n program_id: test_rand.aleo,\n function_name: rand_chacha_check,\n arguments: [\n 0field,\n false\n ]\n}"}' - speculate: the execution was rejected + speculate: the execution was accepted add_next_block: succeeded. - verified: true execute: test_rand.aleo/rand_chacha_check: outputs: - '{"type":"future","id":"884323248557348741020456011434839803868309861690594536593949575748229817915field","value":"{\n program_id: test_rand.aleo,\n function_name: rand_chacha_check,\n arguments: [\n 1field,\n true\n ]\n}"}' - speculate: the execution was rejected + speculate: the execution was accepted add_next_block: succeeded. additional: - child_outputs: From 4a99b94b1c1361230ec21d02670e7b6958913883 Mon Sep 17 00:00:00 2001 From: Victor Sint Nicolaas Date: Fri, 9 Feb 2024 09:30:55 +0100 Subject: [PATCH 280/298] Clarify constraint limit logic --- synthesizer/process/src/stack/call/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/synthesizer/process/src/stack/call/mod.rs b/synthesizer/process/src/stack/call/mod.rs index 69e7349685..030cd24410 100644 --- a/synthesizer/process/src/stack/call/mod.rs +++ b/synthesizer/process/src/stack/call/mod.rs @@ -382,7 +382,7 @@ impl CallTrait for Call { // Inject the existing circuit. A::inject_r1cs(r1cs); - // If in 'CheckDeployment' mode, set the expected constraint limit. + // If in 'CheckDeployment' mode, reset the constraint limit back to the parent circuit limit. if let CallStack::CheckDeployment(_, _, _, constraint_limit) = ®isters.call_stack() { A::set_constraint_limit(*constraint_limit); } From 6134aea9a8ce9c83c59391b2b57867e60128f7e5 Mon Sep 17 00:00:00 2001 From: Pranav Gaddamadugu <23022326+d0cd@users.noreply.github.com> Date: Fri, 9 Feb 2024 03:50:58 -0600 Subject: [PATCH 281/298] Fix --- .../program/src/resources/credits.aleo | 8 +++---- synthesizer/src/vm/finalize.rs | 22 +++++++++++++++---- 2 files changed, 22 insertions(+), 8 deletions(-) diff --git a/synthesizer/program/src/resources/credits.aleo b/synthesizer/program/src/resources/credits.aleo index 7010a05d11..e55d44edab 100644 --- a/synthesizer/program/src/resources/credits.aleo +++ b/synthesizer/program/src/resources/credits.aleo @@ -138,7 +138,7 @@ finalize bond_public: /* Committee */ // Check if the validator is already in the committee. - contains committee[r1] into r4; + contains committee[r0] into r4; // If the validator is already in the committee, jump to the `continue_bond_validator` logic. branch.eq r4 true to continue_bond_validator; @@ -183,11 +183,11 @@ finalize bond_public: /* Bonded */ // Construct the initial bond state. - cast r1 0u64 into r15 as bond_state; + cast r0 0u64 into r15 as bond_state; // Get the bond state for the caller, or default to the initial bond state. get.or_use bonded[r0] r15 into r16; // Enforce the validator matches in the bond state. - assert.eq r16.validator r1; + assert.eq r16.validator r0; // Increment the microcredits in the bond state. add r12.microcredits r2 into r17; @@ -197,7 +197,7 @@ finalize bond_public: assert.eq r18 true; // Construct the updated bond state. - cast r1 r17 into r19 as bond_state; + cast r0 r17 into r19 as bond_state; /* Account */ diff --git a/synthesizer/src/vm/finalize.rs b/synthesizer/src/vm/finalize.rs index 3bb8d42a19..8447400553 100644 --- a/synthesizer/src/vm/finalize.rs +++ b/synthesizer/src/vm/finalize.rs @@ -827,7 +827,7 @@ impl> VM { program_id, metadata_mapping, Plaintext::from_str("aleo1qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq3ljyzc")?, - Value::from(Literal::U64(U64::new(committee.members().len() as u64))), + Value::from_str(&format!("{}u32", committee.num_members()))?, )?, ]); @@ -838,7 +838,7 @@ impl> VM { program_id, metadata_mapping, Plaintext::from_str("aleo1qgqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqanmpl0")?, - Value::from(Literal::U64(U64::new(stakers.len() as u64))), + Value::from_str(&format!("{}u32", stakers.len()))?, )?, ]); @@ -921,6 +921,7 @@ impl> VM { let next_stakers = staking_rewards(¤t_stakers, ¤t_committee, *block_reward); // Compute the updated committee, using the stakers. let next_committee = to_next_committee(¤t_committee, state.block_round(), &next_stakers)?; + // Construct the next committee map and next bonded map. let (next_committee_map, next_bonded_map) = to_next_commitee_map_and_bonded_map(&next_committee, &next_stakers); @@ -1081,8 +1082,13 @@ finalize transfer_public: rng: &mut R, ) -> Result> { // Speculate on the candidate ratifications, solutions, and transactions. - let (ratifications, transactions, aborted_transaction_ids, ratified_finalize_operations) = - vm.speculate(sample_finalize_state(1), None, vec![], &None.into(), transactions.iter())?; + let (ratifications, transactions, aborted_transaction_ids, ratified_finalize_operations) = vm.speculate( + sample_finalize_state(previous_block.height() + 1), + Some(0), + vec![], + &None.into(), + transactions.iter(), + )?; // Construct the metadata associated with the block. let metadata = Metadata::new( @@ -1952,6 +1958,10 @@ finalize compute: // Add the next block to the VM. vm.add_next_block(&next_block).unwrap(); + // Check that the first validator was added to the committee. + let committee = vm.finalize_store().committee_store().current_committee().unwrap(); + assert!(committee.is_committee_member(first_address)); + // Attempt to bond the second validator. let bond_second_transaction = vm .execute( @@ -1982,5 +1992,9 @@ finalize compute: // Check that the transaction was rejected. assert!(next_block.transactions().iter().next().unwrap().is_rejected()); + + // Check that the second validator was not added to the committee. + let committee = vm.finalize_store().committee_store().current_committee().unwrap(); + assert!(!committee.is_committee_member(second_address)); } } From 8125818ae3d221944b5f9bf2ebaee23752d7cb17 Mon Sep 17 00:00:00 2001 From: ljedrz Date: Fri, 9 Feb 2024 11:20:54 +0100 Subject: [PATCH 282/298] tweak: apply review comments Signed-off-by: ljedrz --- ledger/store/src/program/finalize.rs | 2 +- synthesizer/process/src/stack/mod.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ledger/store/src/program/finalize.rs b/ledger/store/src/program/finalize.rs index 994f89030d..1e227b7bfb 100644 --- a/ledger/store/src/program/finalize.rs +++ b/ledger/store/src/program/finalize.rs @@ -314,7 +314,7 @@ pub trait FinalizeStorage: 'static + Clone + Send + Sync { None => bail!("Illegal operation: program ID '{program_id}' is not initialized - cannot remove mapping."), }; // Remove the mapping name. - if !mapping_names.swap_remove(&mapping_name) { + if !mapping_names.shift_remove(&mapping_name) { bail!("Illegal operation: mapping '{mapping_name}' does not exist in storage - cannot remove mapping."); } diff --git a/synthesizer/process/src/stack/mod.rs b/synthesizer/process/src/stack/mod.rs index 9c00b3f899..ae1a5b8f43 100644 --- a/synthesizer/process/src/stack/mod.rs +++ b/synthesizer/process/src/stack/mod.rs @@ -418,13 +418,13 @@ impl Stack { /// Removes the proving key for the given function name. #[inline] pub fn remove_proving_key(&self, function_name: &Identifier) { - self.proving_keys.write().swap_remove(function_name); + self.proving_keys.write().shift_remove(function_name); } /// Removes the verifying key for the given function name. #[inline] pub fn remove_verifying_key(&self, function_name: &Identifier) { - self.verifying_keys.write().swap_remove(function_name); + self.verifying_keys.write().shift_remove(function_name); } } From 82d20b2fe7fa697b74d05d7db764279e5be53592 Mon Sep 17 00:00:00 2001 From: Pranav Gaddamadugu <23022326+d0cd@users.noreply.github.com> Date: Fri, 9 Feb 2024 08:22:06 -0600 Subject: [PATCH 283/298] Switch back to tracking number of validators and delegators --- .../program/src/resources/credits.aleo | 178 ++++++++---------- synthesizer/src/vm/finalize.rs | 11 -- 2 files changed, 80 insertions(+), 109 deletions(-) diff --git a/synthesizer/program/src/resources/credits.aleo b/synthesizer/program/src/resources/credits.aleo index e55d44edab..980f9208ca 100644 --- a/synthesizer/program/src/resources/credits.aleo +++ b/synthesizer/program/src/resources/credits.aleo @@ -36,11 +36,11 @@ struct committee_state: /// The `metadata` mapping stores: /// - The number of members in the committee. -/// - The number of stakers. +/// - The number of delegators. mapping metadata: // The key represents the index at which the count is stored. // - This address (aleo1qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq3ljyzc) stores the number of **members** in the committee. - // - This address (aleo1qgqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqanmpl0) stores the number of **stakers**. + // - This address (aleo1qgqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqanmpl0) stores the number of **delegators**. key as address.public; // The value represents the count. value as u32.public; @@ -153,68 +153,57 @@ finalize bond_public: // Set the new committee size. set r6 into metadata[aleo1qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq3ljyzc]; - // Get the number of stakers. - get.or_use metadata[aleo1qgqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqanmpl0] 0u32 into r8; - // Increment the number of stakers by one. - add r8 1u32 into r9; - // Determine if the number of stakers is less than or equal to 100_000. - lte r9 100_000u32 into r10; - // Enforce that the number of stakers is less than or equal to 100_000. - assert.eq r10 true; - // Set the new number of stakers. - set r9 into metadata[aleo1qgqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqanmpl0]; - // Continues the rest of the `bond_validator` logic. position continue_bond_validator; // Construct the initial committee state. // Note: We set the initial 'is_open' state to 'true'. - cast 0u64 true into r11 as committee_state; + cast 0u64 true into r8 as committee_state; // Retrieve the committee state of the specified validator. - get.or_use committee[r0] r11 into r12; + get.or_use committee[r0] r8 into r9; // Ensure that the validator is open to stakers. - assert.eq r12.is_open true; + assert.eq r9.is_open true; // Increment the stake for the specified validator. - add r12.microcredits r2 into r13; + add r9.microcredits r2 into r10; // Construct the updated committee state. - cast r13 r12.is_open into r14 as committee_state; + cast r10 r9.is_open into r11 as committee_state; /* Bonded */ // Construct the initial bond state. - cast r0 0u64 into r15 as bond_state; + cast r0 0u64 into r12 as bond_state; // Get the bond state for the caller, or default to the initial bond state. - get.or_use bonded[r0] r15 into r16; + get.or_use bonded[r0] r12 into r13; // Enforce the validator matches in the bond state. - assert.eq r16.validator r0; + assert.eq r13.validator r0; // Increment the microcredits in the bond state. - add r12.microcredits r2 into r17; + add r9.microcredits r2 into r14; // Determine if the amount is at least one million credits. - gte r17 1_000_000_000_000u64 into r18; + gte r14 1_000_000_000_000u64 into r15; // Enforce the amount is at least one million credits. - assert.eq r18 true; + assert.eq r15 true; // Construct the updated bond state. - cast r0 r17 into r19 as bond_state; + cast r0 r14 into r16 as bond_state; /* Account */ // Get the balance of the caller. // If the account does not exist, this finalize scope will fail. - get account[r0] into r20; + get account[r0] into r17; // Decrement the balance of the caller. - sub r20 r2 into r21; + sub r17 r2 into r18; /* Writes */ // Update the committee state of the specified validator. - set r14 into committee[r0]; + set r11 into committee[r0]; // Update the bond state for the caller. - set r19 into bonded[r0]; + set r16 into bonded[r0]; // Update the balance of the caller. - set r21 into account[r0]; + set r18 into account[r0]; // Ends the `bond_validator` logic. branch.eq true true to end; @@ -227,35 +216,35 @@ finalize bond_public: /* Committee */ // Check if the caller is a validator. - contains committee[r0] into r22; + contains committee[r0] into r19; // Enforce the caller is *not* a validator. - assert.eq r22 false; + assert.eq r19 false; // Get the stake for the specified validator. // If the validator does not exist, this finalize scope will fail. - get committee[r1] into r23; + get committee[r1] into r20; // Ensure that the validator is open to stakers. - assert.eq r23.is_open true; + assert.eq r20.is_open true; // Increment the stake for the specified validator. - add r23.microcredits r2 into r24; + add r20.microcredits r2 into r21; // Construct the updated committee state. - cast r24 r23.is_open into r25 as committee_state; + cast r21 r20.is_open into r22 as committee_state; // Check if the delegator is already bonded to the validator. - contains bonded[r0] into r26; + contains bonded[r0] into r23; // If the delegator is already bonded to the validator, jump to the `continue_bond_delegator` logic. - branch.eq r26 true to continue_bond_delegator; - // Get the number of stakers. - get.or_use metadata[aleo1qgqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqanmpl0] 0u32 into r27; + branch.eq r23 true to continue_bond_delegator; + // Get the number of delegators. + get.or_use metadata[aleo1qgqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqanmpl0] 0u32 into r24; // Increment the number of bonded delegators by one. - add r27 1u32 into r28; - // Determine if the number of stakers is less than or equal to 100_000. - lte r28 100_000u32 into r29; - // Enforce that the number of stakers is less than or equal to 100_000. - assert.eq r29 true; - // Set the new number of stakers. - set r28 into metadata[aleo1qgqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqanmpl0]; + add r24 1u32 into r25; + // Determine if the number of delegators is less than or equal to 100_000. + lte r25 100_000u32 into r26; + // Enforce that the number of delegators is less than or equal to 100_000. + assert.eq r26 true; + // Set the new number of delegators. + set r25 into metadata[aleo1qgqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqanmpl0]; // Continues the rest of the `bond_delegator` logic. position continue_bond_delegator; @@ -263,38 +252,38 @@ finalize bond_public: /* Bonded */ // Construct the initial bond state. - cast r1 0u64 into r30 as bond_state; + cast r1 0u64 into r27 as bond_state; // Get the bond state for the caller, or default to the initial bond state. - get.or_use bonded[r0] r30 into r31; + get.or_use bonded[r0] r27 into r28; // Enforce the validator matches in the bond state. - assert.eq r31.validator r1; + assert.eq r28.validator r1; // Increment the microcredits in the bond state. - add r31.microcredits r2 into r32; + add r28.microcredits r2 into r29; // Determine if the amount is at least 10 credits. - gte r32 10_000_000u64 into r33; + gte r29 10_000_000u64 into r30; // Enforce the amount is at least 10 credits. - assert.eq r33 true; + assert.eq r30 true; // Construct the updated bond state. - cast r1 r32 into r34 as bond_state; + cast r1 r29 into r31 as bond_state; /* Account */ // Get the balance of the caller. // If the account does not exist, this finalize scope will fail. - get account[r0] into r35; + get account[r0] into r32; // Decrement the balance of the caller. - sub r35 r2 into r36; + sub r32 r2 into r33; /* Writes */ // Update the committee state for the specified validator. - set r25 into committee[r1]; + set r22 into committee[r1]; // Update the bond state for the caller. - set r34 into bonded[r0]; + set r31 into bonded[r0]; // Update the balance of the caller. - set r36 into account[r0]; + set r33 into account[r0]; // The terminus. position end; @@ -416,13 +405,6 @@ finalize unbond_public: // Set the new committee size. set r16 into metadata[aleo1qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq3ljyzc]; - // Get the number of stakers. - get metadata[aleo1qgqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqanmpl0] into r17; - // Decrement the number of stakers by one. - sub r17 1u32 into r18; - // Set the new number of stakers. - set r18 into metadata[aleo1qgqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqanmpl0]; - /* Bonded */ // Remove the bond state for the validator. @@ -431,12 +413,12 @@ finalize unbond_public: /* Unbonding */ // Increment the microcredits in the unbond state. - add r3.microcredits r8.microcredits into r19; + add r3.microcredits r8.microcredits into r17; // Construct the updated unbond state. - cast r19 r4 into r20 as unbond_state; + cast r17 r4 into r18 as unbond_state; // Update the unbond state for the caller. - set r20 into unbonding[r0]; + set r18 into unbonding[r0]; // Ends the `remove_validator` logic. branch.eq true true to end; @@ -447,17 +429,17 @@ finalize unbond_public: position unbond_delegator; // Get the bond state for the caller, or fail if it does not exist. - get bonded[r0] into r21; + get bonded[r0] into r19; // Decrement the microcredits in the bond state. - sub r21.microcredits r1 into r22; + sub r19.microcredits r1 into r20; // Determine if the remaining bond is at least 10 credits. - gte r22 10_000_000u64 into r23; + gte r20 10_000_000u64 into r21; // If the remaining balance is at least 10 credits, jump to the `decrement_delegator` logic. - branch.eq r23 true to decrement_delegator; + branch.eq r21 true to decrement_delegator; // If the remaining balance is less than 10 credits, jump to the `remove_delegator` logic. - branch.eq r23 false to remove_delegator; + branch.eq r21 false to remove_delegator; /*** Decrement Delegator ***/ @@ -468,30 +450,30 @@ finalize unbond_public: // Get the stake for the specified validator. // If the validator does not exist, this finalize scope will fail. - get committee[r21.validator] into r24; + get committee[r19.validator] into r22; // Decrement the stake for the specified validator. - sub r24.microcredits r1 into r25; + sub r22.microcredits r1 into r23; // Construct the updated committee state. - cast r25 r24.is_open into r26 as committee_state; + cast r23 r22.is_open into r24 as committee_state; // Update the stake for the specified validator. - set r26 into committee[r21.validator]; + set r24 into committee[r19.validator]; /* Bonded */ // Construct the updated bond state. - cast r21.validator r22 into r27 as bond_state; + cast r19.validator r20 into r25 as bond_state; // Update the bond state for the caller. - set r27 into bonded[r0]; + set r25 into bonded[r0]; /* Unbonding */ // Increment the microcredits in the unbond state. - add r3.microcredits r1 into r28; + add r3.microcredits r1 into r26; // Construct the updated unbond state. - cast r28 r4 into r29 as unbond_state; + cast r26 r4 into r27 as unbond_state; // Update the unbond state for the caller. - set r29 into unbonding[r0]; + set r27 into unbonding[r0]; // Ends the `decrement_delegator` logic. branch.eq true true to end; @@ -505,20 +487,20 @@ finalize unbond_public: // Get the stake for the specified validator. // If the validator does not exist, this finalize scope will fail. - get committee[r21.validator] into r30; + get committee[r19.validator] into r28; // Decrement the stake for the specified validator. - sub r30.microcredits r21.microcredits into r31; + sub r28.microcredits r19.microcredits into r29; // Construct the updated committee state. - cast r31 r30.is_open into r32 as committee_state; + cast r29 r28.is_open into r30 as committee_state; // Update the stake for the specified validator. - set r32 into committee[r21.validator]; + set r30 into committee[r19.validator]; - // Get the number of stakers. - get metadata[aleo1qgqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqanmpl0] into r33; + // Get the number of delegators. + get metadata[aleo1qgqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqanmpl0] into r31; // Decrement the number of bonded delegators by one. - sub r33 1u32 into r34; - // Set the new number of stakers. - set r34 into metadata[aleo1qgqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqanmpl0]; + sub r31 1u32 into r32; + // Set the new number of delegators. + set r32 into metadata[aleo1qgqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqanmpl0]; /* Bonded */ @@ -528,12 +510,12 @@ finalize unbond_public: /* Unbonding */ // Increment the microcredits in the unbond state. - add r3.microcredits r21.microcredits into r35; + add r3.microcredits r19.microcredits into r33; // Construct the updated unbond state. - cast r35 r4 into r36 as unbond_state; + cast r33 r4 into r34 as unbond_state; // Update the unbond state for the caller. - set r36 into unbonding[r0]; + set r34 into unbonding[r0]; // The terminus. position end; @@ -587,9 +569,9 @@ finalize unbond_delegator_as_validator: // Construct the updated committee state. cast r5 r2.is_open into r6 as committee_state; - // Get the number of stakers. + // Get the number of delegators. get metadata[aleo1qgqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqanmpl0] into r7; - // Decrement the number of stakers by one. + // Decrement the number of delegators by one. sub r7 1u32 into r8; /* End Committee */ @@ -620,7 +602,7 @@ finalize unbond_delegator_as_validator: remove bonded[r1]; // Update the unbond state for the delegator. set r13 into unbonding[r1]; - // Update the number of stakers. + // Update the number of delegators. set r8 into metadata[aleo1qgqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqanmpl0]; /* End Writes */ diff --git a/synthesizer/src/vm/finalize.rs b/synthesizer/src/vm/finalize.rs index 8447400553..8d759526dd 100644 --- a/synthesizer/src/vm/finalize.rs +++ b/synthesizer/src/vm/finalize.rs @@ -831,17 +831,6 @@ impl> VM { )?, ]); - // Update the number of stakers. - finalize_operations.extend(&[ - // Update the number of stakers in the metadata mapping. - store.update_key_value( - program_id, - metadata_mapping, - Plaintext::from_str("aleo1qgqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqanmpl0")?, - Value::from_str(&format!("{}u32", stakers.len()))?, - )?, - ]); - // Iterate over the public balances. for (address, amount) in public_balances { // Construct the key. From aafb584b09cf647fd4a13a5e3a8fe2e56f72543a Mon Sep 17 00:00:00 2001 From: Pranav Gaddamadugu <23022326+d0cd@users.noreply.github.com> Date: Fri, 9 Feb 2024 08:53:02 -0600 Subject: [PATCH 284/298] Regen expectations --- .../tests/expectations/vm/execute_and_finalize/test_rand.out | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/synthesizer/tests/expectations/vm/execute_and_finalize/test_rand.out b/synthesizer/tests/expectations/vm/execute_and_finalize/test_rand.out index 6032cc07fc..511c0af4b1 100644 --- a/synthesizer/tests/expectations/vm/execute_and_finalize/test_rand.out +++ b/synthesizer/tests/expectations/vm/execute_and_finalize/test_rand.out @@ -26,7 +26,7 @@ outputs: test_rand.aleo/rand_chacha_check: outputs: - '{"type":"future","id":"884323248557348741020456011434839803868309861690594536593949575748229817915field","value":"{\n program_id: test_rand.aleo,\n function_name: rand_chacha_check,\n arguments: [\n 1field,\n true\n ]\n}"}' - speculate: the execution was accepted + speculate: the execution was rejected add_next_block: succeeded. additional: - child_outputs: From 65579712d9d0ca82e48cfcd3da67e94fed25898f Mon Sep 17 00:00:00 2001 From: Victor Sint Nicolaas Date: Fri, 9 Feb 2024 22:06:04 +0100 Subject: [PATCH 285/298] Remove extraneous set_constraint_limit and clarify why --- synthesizer/process/src/stack/call/mod.rs | 5 ----- synthesizer/process/src/stack/execute.rs | 1 + 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/synthesizer/process/src/stack/call/mod.rs b/synthesizer/process/src/stack/call/mod.rs index 4acc81ed45..0dff0bbc18 100644 --- a/synthesizer/process/src/stack/call/mod.rs +++ b/synthesizer/process/src/stack/call/mod.rs @@ -381,11 +381,6 @@ impl CallTrait for Call { // Inject the existing circuit. A::inject_r1cs(r1cs); - // If in 'CheckDeployment' mode, reset the constraint limit back to the parent circuit limit. - if let CallStack::CheckDeployment(_, _, _, constraint_limit) = ®isters.call_stack() { - A::set_constraint_limit(*constraint_limit); - } - use circuit::Inject; // Inject the network ID as `Mode::Constant`. diff --git a/synthesizer/process/src/stack/execute.rs b/synthesizer/process/src/stack/execute.rs index 015dd57fb0..4a2936d910 100644 --- a/synthesizer/process/src/stack/execute.rs +++ b/synthesizer/process/src/stack/execute.rs @@ -144,6 +144,7 @@ impl StackExecute for Stack { A::reset(); // If in 'CheckDeployment' mode, set the constraint limit. + // We do not have to reset it after function calls because `CheckDeployment` mode does not execute those. if let CallStack::CheckDeployment(_, _, _, constraint_limit) = &call_stack { A::set_constraint_limit(*constraint_limit); } From d765691da9a829cba97aa58f10a5669323ee08e7 Mon Sep 17 00:00:00 2001 From: Howard Wu <9260812+howardwu@users.noreply.github.com> Date: Fri, 9 Feb 2024 17:20:18 -0800 Subject: [PATCH 286/298] Update terminology to committee lookback --- console/network/src/lib.rs | 4 ++-- ledger/block/src/verify.rs | 20 ++++++++++---------- ledger/committee/src/lib.rs | 9 +++++++++ ledger/narwhal/batch-header/src/lib.rs | 16 ---------------- ledger/src/check_next_block.rs | 14 +++++++------- 5 files changed, 28 insertions(+), 35 deletions(-) diff --git a/console/network/src/lib.rs b/console/network/src/lib.rs index a1ac9afac4..c7e07e422d 100644 --- a/console/network/src/lib.rs +++ b/console/network/src/lib.rs @@ -156,8 +156,8 @@ pub trait Network: /// The maximum number of outputs per transition. const MAX_OUTPUTS: usize = 16; - /// The committee round lag. - const COMMITTEE_ROUND_LAG: u64 = 100; + /// The committee lookback range. + const COMMITTEE_LOOKBACK_RANGE: u64 = 100; /// The state root type. type StateRoot: Bech32ID>; diff --git a/ledger/block/src/verify.rs b/ledger/block/src/verify.rs index e55c6508e9..b9ea81291a 100644 --- a/ledger/block/src/verify.rs +++ b/ledger/block/src/verify.rs @@ -30,7 +30,7 @@ impl Block { &self, previous_block: &Block, current_state_root: N::StateRoot, - committee_with_lag: &Committee, + current_committee_lookback: &Committee, current_puzzle: &CoinbasePuzzle, current_epoch_challenge: &EpochChallenge, current_timestamp: i64, @@ -46,7 +46,7 @@ impl Block { expected_timestamp, expected_existing_solution_ids, expected_existing_transaction_ids, - ) = self.verify_authority(previous_block.round(), previous_block.height(), committee_with_lag)?; + ) = self.verify_authority(previous_block.round(), previous_block.height(), current_committee_lookback)?; // Ensure the block solutions are correct. let ( @@ -143,7 +143,7 @@ impl Block { &self, previous_round: u64, previous_height: u32, - committee_with_lag: &Committee, + current_committee_lookback: &Committee, ) -> Result<(u64, u32, i64, Vec>, Vec)> { // Note: Do not remove this. This ensures that all blocks after genesis are quorum blocks. #[cfg(not(any(test, feature = "test")))] @@ -170,12 +170,12 @@ impl Block { subdag.anchor_round() } }; - // Ensure the block round minus the committee round lag is at least the starting round of the committee with lag. + // Ensure the block round minus the committee lookback range is at least the starting round of the committee lookback. ensure!( - expected_round.saturating_sub(N::COMMITTEE_ROUND_LAG) >= committee_with_lag.starting_round(), + expected_round.saturating_sub(N::COMMITTEE_LOOKBACK_RANGE) >= current_committee_lookback.starting_round(), "Block {expected_height} has an invalid round (found '{}', expected at least '{}')", - expected_round.saturating_sub(N::COMMITTEE_ROUND_LAG), - committee_with_lag.starting_round() + expected_round.saturating_sub(N::COMMITTEE_LOOKBACK_RANGE), + current_committee_lookback.starting_round() ); // Ensure the block authority is correct. @@ -186,7 +186,7 @@ impl Block { let signer = signature.to_address(); // Ensure the block is signed by a committee member. ensure!( - committee_with_lag.members().contains_key(&signer), + current_committee_lookback.members().contains_key(&signer), "Beacon block {expected_height} has a signer not in the committee (found '{signer}')", ); // Ensure the signature is valid. @@ -199,7 +199,7 @@ impl Block { } Authority::Quorum(subdag) => { // Compute the expected leader. - let expected_leader = committee_with_lag.get_leader(expected_round)?; + let expected_leader = current_committee_lookback.get_leader(expected_round)?; // Ensure the block is authored by the expected leader. ensure!( subdag.leader_address() == expected_leader, @@ -222,7 +222,7 @@ impl Block { // Beacon blocks do not have a timestamp check. Authority::Beacon(..) => self.timestamp(), // Quorum blocks use the weighted median timestamp from the subdag. - Authority::Quorum(subdag) => subdag.timestamp(committee_with_lag), + Authority::Quorum(subdag) => subdag.timestamp(current_committee_lookback), }; // Return success. diff --git a/ledger/committee/src/lib.rs b/ledger/committee/src/lib.rs index fd67bf9983..6f39f9146e 100644 --- a/ledger/committee/src/lib.rs +++ b/ledger/committee/src/lib.rs @@ -454,4 +454,13 @@ mod tests { fn test_maximum_committee_size() { assert_eq!(Committee::::MAX_COMMITTEE_SIZE, BatchHeader::::MAX_CERTIFICATES); } + + #[test] + fn test_committee_lookback_range() { + assert_eq!( + BatchHeader::::MAX_GC_ROUNDS as u64, + ::COMMITTEE_LOOKBACK_RANGE, + "The max GC rounds should be equal to the committee lookback range" + ); + } } diff --git a/ledger/narwhal/batch-header/src/lib.rs b/ledger/narwhal/batch-header/src/lib.rs index 9225c0f04a..e7a8de8c7a 100644 --- a/ledger/narwhal/batch-header/src/lib.rs +++ b/ledger/narwhal/batch-header/src/lib.rs @@ -332,19 +332,3 @@ pub mod test_helpers { sample } } - -#[cfg(test)] -mod tests { - use super::*; - - type CurrentNetwork = console::network::Testnet3; - - #[test] - fn test_max_gc_rounds() { - assert_eq!( - BatchHeader::::MAX_GC_ROUNDS as u64, - ::COMMITTEE_ROUND_LAG, - "The max GC rounds should be equal to the committee round lag" - ); - } -} diff --git a/ledger/src/check_next_block.rs b/ledger/src/check_next_block.rs index 9e995bd0c3..085b877dca 100644 --- a/ledger/src/check_next_block.rs +++ b/ledger/src/check_next_block.rs @@ -88,18 +88,18 @@ impl> Ledger { true => block.round().saturating_sub(1), false => block.round().saturating_sub(2), }; - // Get the previous round with lag. - let previous_round_with_lag = previous_round.saturating_sub(N::COMMITTEE_ROUND_LAG); - // Retrieve the previous committee with lag. - let previous_committee_with_lag = self - .get_committee_for_round(previous_round_with_lag)? - .ok_or(anyhow!("Failed to fetch committee for round {previous_round_with_lag}"))?; + // Get the committee lookback round. + let committee_lookback_round = previous_round.saturating_sub(N::COMMITTEE_LOOKBACK_RANGE); + // Retrieve the committee lookback. + let committee_lookback = self + .get_committee_for_round(committee_lookback_round)? + .ok_or(anyhow!("Failed to fetch committee for round {committee_lookback_round}"))?; // Ensure the block is correct. let (expected_existing_solution_ids, expected_existing_transaction_ids) = block.verify( &self.latest_block(), self.latest_state_root(), - &previous_committee_with_lag, + &committee_lookback, self.coinbase_puzzle(), &self.latest_epoch_challenge()?, OffsetDateTime::now_utc().unix_timestamp(), From eac267d447b8d6a6fd8c674e483f78a6d990a46f Mon Sep 17 00:00:00 2001 From: Howard Wu <9260812+howardwu@users.noreply.github.com> Date: Fri, 9 Feb 2024 17:23:30 -0800 Subject: [PATCH 287/298] Update constant usage --- console/network/src/lib.rs | 3 --- ledger/block/src/verify.rs | 5 +++-- ledger/committee/src/lib.rs | 11 ++--------- ledger/src/check_next_block.rs | 2 +- 4 files changed, 6 insertions(+), 15 deletions(-) diff --git a/console/network/src/lib.rs b/console/network/src/lib.rs index c7e07e422d..717946cba2 100644 --- a/console/network/src/lib.rs +++ b/console/network/src/lib.rs @@ -156,9 +156,6 @@ pub trait Network: /// The maximum number of outputs per transition. const MAX_OUTPUTS: usize = 16; - /// The committee lookback range. - const COMMITTEE_LOOKBACK_RANGE: u64 = 100; - /// The state root type. type StateRoot: Bech32ID>; /// The block hash type. diff --git a/ledger/block/src/verify.rs b/ledger/block/src/verify.rs index b9ea81291a..5517f81001 100644 --- a/ledger/block/src/verify.rs +++ b/ledger/block/src/verify.rs @@ -172,9 +172,10 @@ impl Block { }; // Ensure the block round minus the committee lookback range is at least the starting round of the committee lookback. ensure!( - expected_round.saturating_sub(N::COMMITTEE_LOOKBACK_RANGE) >= current_committee_lookback.starting_round(), + expected_round.saturating_sub(Committee::::COMMITTEE_LOOKBACK_RANGE) + >= current_committee_lookback.starting_round(), "Block {expected_height} has an invalid round (found '{}', expected at least '{}')", - expected_round.saturating_sub(N::COMMITTEE_LOOKBACK_RANGE), + expected_round.saturating_sub(Committee::::COMMITTEE_LOOKBACK_RANGE), current_committee_lookback.starting_round() ); diff --git a/ledger/committee/src/lib.rs b/ledger/committee/src/lib.rs index 6f39f9146e..9940c01e0e 100644 --- a/ledger/committee/src/lib.rs +++ b/ledger/committee/src/lib.rs @@ -48,6 +48,8 @@ pub struct Committee { } impl Committee { + /// The committee lookback range. + pub const COMMITTEE_LOOKBACK_RANGE: u64 = BatchHeader::::MAX_GC_ROUNDS as u64; /// The maximum number of members that may be in a committee. pub const MAX_COMMITTEE_SIZE: u16 = BatchHeader::::MAX_CERTIFICATES; @@ -454,13 +456,4 @@ mod tests { fn test_maximum_committee_size() { assert_eq!(Committee::::MAX_COMMITTEE_SIZE, BatchHeader::::MAX_CERTIFICATES); } - - #[test] - fn test_committee_lookback_range() { - assert_eq!( - BatchHeader::::MAX_GC_ROUNDS as u64, - ::COMMITTEE_LOOKBACK_RANGE, - "The max GC rounds should be equal to the committee lookback range" - ); - } } diff --git a/ledger/src/check_next_block.rs b/ledger/src/check_next_block.rs index 085b877dca..3f282f660b 100644 --- a/ledger/src/check_next_block.rs +++ b/ledger/src/check_next_block.rs @@ -89,7 +89,7 @@ impl> Ledger { false => block.round().saturating_sub(2), }; // Get the committee lookback round. - let committee_lookback_round = previous_round.saturating_sub(N::COMMITTEE_LOOKBACK_RANGE); + let committee_lookback_round = previous_round.saturating_sub(Committee::::COMMITTEE_LOOKBACK_RANGE); // Retrieve the committee lookback. let committee_lookback = self .get_committee_for_round(committee_lookback_round)? From 150a763408297624a869191b5454408cd6c2f5a1 Mon Sep 17 00:00:00 2001 From: Howard Wu <9260812+howardwu@users.noreply.github.com> Date: Fri, 9 Feb 2024 19:31:10 -0800 Subject: [PATCH 288/298] Reverts election certificates --- ledger/narwhal/batch-header/src/bytes.rs | 55 +----------- ledger/narwhal/batch-header/src/lib.rs | 92 ++------------------ ledger/narwhal/batch-header/src/serialize.rs | 23 +---- ledger/narwhal/batch-header/src/to_id.rs | 15 ---- ledger/narwhal/subdag/src/bytes.rs | 34 +------- ledger/narwhal/subdag/src/lib.rs | 27 +----- ledger/narwhal/subdag/src/serialize.rs | 9 +- 7 files changed, 18 insertions(+), 237 deletions(-) diff --git a/ledger/narwhal/batch-header/src/bytes.rs b/ledger/narwhal/batch-header/src/bytes.rs index a59e9cd89f..37474eb118 100644 --- a/ledger/narwhal/batch-header/src/bytes.rs +++ b/ledger/narwhal/batch-header/src/bytes.rs @@ -20,8 +20,7 @@ impl FromBytes for BatchHeader { // Read the version. let version = u8::read_le(&mut reader)?; // Ensure the version is valid. - // TODO (howardwu): For mainnet - Change the version back to 1. - if version != 1 && version != 2 { + if version != 1 { return Err(error("Invalid batch header version")); } @@ -66,44 +65,12 @@ impl FromBytes for BatchHeader { previous_certificate_ids.insert(Field::read_le(&mut reader)?); } - // TODO (howardwu): For mainnet - Change this to always encode the number of committed certificate IDs. - // We currently only encode the size and certificates in the new version, for backwards compatibility. - let num_last_election_certificate_ids = if version == 2 { - // Read the number of last election certificate IDs. - u16::read_le(&mut reader)? - } else { - // Set the number of last election certificate IDs to zero. - 0 - }; - // Ensure the number of last election certificate IDs is within bounds. - if num_last_election_certificate_ids > Self::MAX_CERTIFICATES { - return Err(error(format!( - "Number of last election certificate IDs ({num_last_election_certificate_ids}) exceeds the maximum ({})", - Self::MAX_CERTIFICATES - ))); - } - // Read the last election certificate IDs. - let mut last_election_certificate_ids = IndexSet::new(); - for _ in 0..num_last_election_certificate_ids { - // Read the certificate ID. - last_election_certificate_ids.insert(Field::read_le(&mut reader)?); - } - // Read the signature. let signature = Signature::read_le(&mut reader)?; // Construct the batch. - let batch = Self::from( - version, - author, - round, - timestamp, - transmission_ids, - previous_certificate_ids, - last_election_certificate_ids, - signature, - ) - .map_err(|e| error(e.to_string()))?; + let batch = Self::from(author, round, timestamp, transmission_ids, previous_certificate_ids, signature) + .map_err(error)?; // Return the batch. match batch.batch_id == batch_id { @@ -117,8 +84,7 @@ impl ToBytes for BatchHeader { /// Writes the batch header to the buffer. fn write_le(&self, mut writer: W) -> IoResult<()> { // Write the version. - // TODO (howardwu): For mainnet - Change this back to '1u8.write_le(&mut writer)?'; - self.version.write_le(&mut writer)?; + 1u8.write_le(&mut writer)?; // Write the batch ID. self.batch_id.write_le(&mut writer)?; // Write the author. @@ -141,19 +107,6 @@ impl ToBytes for BatchHeader { // Write the certificate ID. certificate_id.write_le(&mut writer)?; } - // TODO (howardwu): For mainnet - Change this to always encode the number of committed certificate IDs. - // We currently only encode the size and certificates in the new version, for backwards compatibility. - if self.version != 1 { - // Write the number of last election certificate IDs. - u16::try_from(self.last_election_certificate_ids.len()) - .map_err(|e| error(e.to_string()))? - .write_le(&mut writer)?; - // Write the last election certificate IDs. - for certificate_id in &self.last_election_certificate_ids { - // Write the certificate ID. - certificate_id.write_le(&mut writer)?; - } - } // Write the signature. self.signature.write_le(&mut writer) } diff --git a/ledger/narwhal/batch-header/src/lib.rs b/ledger/narwhal/batch-header/src/lib.rs index e7a8de8c7a..4389f696dc 100644 --- a/ledger/narwhal/batch-header/src/lib.rs +++ b/ledger/narwhal/batch-header/src/lib.rs @@ -31,10 +31,6 @@ use narwhal_transmission_id::TransmissionID; #[derive(Clone, PartialEq, Eq)] pub struct BatchHeader { - /// The version of the batch header. - /// TODO (howardwu): For mainnet - Remove this version from the struct, we only use it here for backwards compatibility. - /// NOTE: You must keep the version encoding in the byte serialization, just remove it from the struct in memory. - version: u8, /// The batch ID, defined as the hash of the author, round number, timestamp, transmission IDs, /// previous batch certificate IDs, and last election certificate IDs. batch_id: Field, @@ -48,8 +44,6 @@ pub struct BatchHeader { transmission_ids: IndexSet>, /// The batch certificate IDs of the previous round. previous_certificate_ids: IndexSet>, - /// The last election batch certificate IDs. - last_election_certificate_ids: IndexSet>, /// The signature of the batch ID from the creator. signature: Signature, } @@ -74,20 +68,12 @@ impl BatchHeader { timestamp: i64, transmission_ids: IndexSet>, previous_certificate_ids: IndexSet>, - last_election_certificate_ids: IndexSet>, rng: &mut R, ) -> Result { - // Set the version. - // TODO (howardwu): For mainnet - Remove this version from the struct, we only use it here for backwards compatibility. - // NOTE: You must keep the version encoding in the byte serialization, just remove it from the struct in memory. - let version = 2u8; - match round { 0 | 1 => { // If the round is zero or one, then there should be no previous certificate IDs. ensure!(previous_certificate_ids.is_empty(), "Invalid round number, must not have certificates"); - // If the round is zero or one, then there should be no last election certificate IDs. - ensure!(last_election_certificate_ids.is_empty(), "Invalid batch, contains election certificates"); } // If the round is not zero and not one, then there should be at least one previous certificate ID. _ => ensure!(!previous_certificate_ids.is_empty(), "Invalid round number, must have certificates"), @@ -105,58 +91,30 @@ impl BatchHeader { "Invalid number of previous certificate IDs ({})", previous_certificate_ids.len() ); - // Ensure the number of last election certificate IDs is within bounds. - ensure!( - last_election_certificate_ids.len() <= Self::MAX_CERTIFICATES as usize, - "Invalid number of last election certificate IDs ({})", - last_election_certificate_ids.len() - ); // Retrieve the address. let author = Address::try_from(private_key)?; // Compute the batch ID. - let batch_id = Self::compute_batch_id( - version, - author, - round, - timestamp, - &transmission_ids, - &previous_certificate_ids, - &last_election_certificate_ids, - )?; + let batch_id = Self::compute_batch_id(author, round, timestamp, &transmission_ids, &previous_certificate_ids)?; // Sign the preimage. let signature = private_key.sign(&[batch_id], rng)?; // Return the batch header. - Ok(Self { - version, - author, - batch_id, - round, - timestamp, - transmission_ids, - previous_certificate_ids, - last_election_certificate_ids, - signature, - }) + Ok(Self { author, batch_id, round, timestamp, transmission_ids, previous_certificate_ids, signature }) } /// Initializes a new batch header. pub fn from( - version: u8, author: Address, round: u64, timestamp: i64, transmission_ids: IndexSet>, previous_certificate_ids: IndexSet>, - last_election_certificate_ids: IndexSet>, signature: Signature, ) -> Result { match round { 0 | 1 => { // If the round is zero or one, then there should be no previous certificate IDs. ensure!(previous_certificate_ids.is_empty(), "Invalid round number, must not have certificates"); - // If the round is zero or one, then there should be no last election certificate IDs. - ensure!(last_election_certificate_ids.is_empty(), "Invalid batch, contains election certificates"); } // If the round is not zero and not one, then there should be at least one previous certificate ID. _ => ensure!(!previous_certificate_ids.is_empty(), "Invalid round number, must have certificates"), @@ -174,39 +132,15 @@ impl BatchHeader { "Invalid number of previous certificate IDs ({})", previous_certificate_ids.len() ); - // Ensure the number of last election certificate IDs is within bounds. - ensure!( - last_election_certificate_ids.len() <= Self::MAX_CERTIFICATES as usize, - "Invalid number of last election certificate IDs ({})", - last_election_certificate_ids.len() - ); // Compute the batch ID. - let batch_id = Self::compute_batch_id( - version, - author, - round, - timestamp, - &transmission_ids, - &previous_certificate_ids, - &last_election_certificate_ids, - )?; + let batch_id = Self::compute_batch_id(author, round, timestamp, &transmission_ids, &previous_certificate_ids)?; // Verify the signature. if !signature.verify(&author, &[batch_id]) { bail!("Invalid signature for the batch header"); } // Return the batch header. - Ok(Self { - version, - author, - batch_id, - round, - timestamp, - transmission_ids, - previous_certificate_ids, - last_election_certificate_ids, - signature, - }) + Ok(Self { author, batch_id, round, timestamp, transmission_ids, previous_certificate_ids, signature }) } } @@ -241,11 +175,6 @@ impl BatchHeader { &self.previous_certificate_ids } - /// Returns the last election batch certificate IDs. - pub const fn last_election_certificate_ids(&self) -> &IndexSet> { - &self.last_election_certificate_ids - } - /// Returns the signature. pub const fn signature(&self) -> &Signature { &self.signature @@ -304,19 +233,8 @@ pub mod test_helpers { narwhal_transmission_id::test_helpers::sample_transmission_ids(rng).into_iter().collect::>(); // Checkpoint the timestamp for the batch. let timestamp = OffsetDateTime::now_utc().unix_timestamp(); - // Sample the last election certificate IDs. - let last_election_certificate_ids = (0..5).map(|_| Field::::rand(rng)).collect::>(); // Return the batch header. - BatchHeader::new( - &private_key, - round, - timestamp, - transmission_ids, - previous_certificate_ids, - last_election_certificate_ids, - rng, - ) - .unwrap() + BatchHeader::new(&private_key, round, timestamp, transmission_ids, previous_certificate_ids, rng).unwrap() } /// Returns a list of sample batch headers, sampled at random. diff --git a/ledger/narwhal/batch-header/src/serialize.rs b/ledger/narwhal/batch-header/src/serialize.rs index 15cefd3a70..6acddaead2 100644 --- a/ledger/narwhal/batch-header/src/serialize.rs +++ b/ledger/narwhal/batch-header/src/serialize.rs @@ -19,16 +19,13 @@ impl Serialize for BatchHeader { fn serialize(&self, serializer: S) -> Result { match serializer.is_human_readable() { true => { - let mut header = serializer.serialize_struct("BatchHeader", 9)?; - // TODO (howardwu): For mainnet - Remove the version field, and update the 'len' above to 8. - header.serialize_field("version", &self.version)?; + let mut header = serializer.serialize_struct("BatchHeader", 7)?; header.serialize_field("batch_id", &self.batch_id)?; header.serialize_field("author", &self.author)?; header.serialize_field("round", &self.round)?; header.serialize_field("timestamp", &self.timestamp)?; header.serialize_field("transmission_ids", &self.transmission_ids)?; header.serialize_field("previous_certificate_ids", &self.previous_certificate_ids)?; - header.serialize_field("last_election_certificate_ids", &self.last_election_certificate_ids)?; header.serialize_field("signature", &self.signature)?; header.end() } @@ -45,31 +42,13 @@ impl<'de, N: Network> Deserialize<'de> for BatchHeader { let mut header = serde_json::Value::deserialize(deserializer)?; let batch_id: Field = DeserializeExt::take_from_value::(&mut header, "batch_id")?; - // TODO (howardwu): For mainnet - Remove the version parsing. - // If the version field is present, then parse the version. - let version = DeserializeExt::take_from_value::(&mut header, "version").unwrap_or(1); - // TODO (howardwu): For mainnet - Remove the version checking. - // Ensure the version is valid. - if version != 1 && version != 2 { - return Err(error("Invalid batch header version")).map_err(de::Error::custom); - } - // TODO (howardwu): For mainnet - Always take from the 'header', no need to use this match case anymore. - // If the version is not 1, then parse the last election certificate IDs. - let last_election_certificate_ids = match version { - 1 => IndexSet::new(), - 2 => DeserializeExt::take_from_value::(&mut header, "last_election_certificate_ids")?, - _ => unreachable!(), - }; - // Recover the header. let batch_header = Self::from( - version, DeserializeExt::take_from_value::(&mut header, "author")?, DeserializeExt::take_from_value::(&mut header, "round")?, DeserializeExt::take_from_value::(&mut header, "timestamp")?, DeserializeExt::take_from_value::(&mut header, "transmission_ids")?, DeserializeExt::take_from_value::(&mut header, "previous_certificate_ids")?, - last_election_certificate_ids, DeserializeExt::take_from_value::(&mut header, "signature")?, ) .map_err(de::Error::custom)?; diff --git a/ledger/narwhal/batch-header/src/to_id.rs b/ledger/narwhal/batch-header/src/to_id.rs index 1d3eea042b..1d99cbda77 100644 --- a/ledger/narwhal/batch-header/src/to_id.rs +++ b/ledger/narwhal/batch-header/src/to_id.rs @@ -18,13 +18,11 @@ impl BatchHeader { /// Returns the batch ID. pub fn to_id(&self) -> Result> { Self::compute_batch_id( - self.version, self.author, self.round, self.timestamp, &self.transmission_ids, &self.previous_certificate_ids, - &self.last_election_certificate_ids, ) } } @@ -32,13 +30,11 @@ impl BatchHeader { impl BatchHeader { /// Returns the batch ID. pub fn compute_batch_id( - version: u8, author: Address, round: u64, timestamp: i64, transmission_ids: &IndexSet>, previous_certificate_ids: &IndexSet>, - last_election_certificate_ids: &IndexSet>, ) -> Result> { let mut preimage = Vec::new(); // Insert the author. @@ -60,17 +56,6 @@ impl BatchHeader { // Insert the certificate ID. certificate_id.write_le(&mut preimage)?; } - // TODO (howardwu): For mainnet - Change this to always encode the number of committed certificate IDs. - // We currently only encode the size and certificates only in the new version, for backwards compatibility. - if version != 1 { - // Insert the number of last election certificate IDs. - u32::try_from(last_election_certificate_ids.len())?.write_le(&mut preimage)?; - // Insert the last election certificate IDs. - for certificate_id in last_election_certificate_ids { - // Insert the certificate ID. - certificate_id.write_le(&mut preimage)?; - } - } // Hash the preimage. N::hash_bhp1024(&preimage.to_bits_le()) } diff --git a/ledger/narwhal/subdag/src/bytes.rs b/ledger/narwhal/subdag/src/bytes.rs index 703f1c5ead..5b7aef35a9 100644 --- a/ledger/narwhal/subdag/src/bytes.rs +++ b/ledger/narwhal/subdag/src/bytes.rs @@ -20,8 +20,7 @@ impl FromBytes for Subdag { // Read the version. let version = u8::read_le(&mut reader)?; // Ensure the version is valid. - // TODO (howardwu): For mainnet - Change the version back to 1. - if version != 1 && version != 2 { + if version != 1 { return Err(error(format!("Invalid subdag version ({version})"))); } @@ -55,27 +54,8 @@ impl FromBytes for Subdag { subdag.insert(round, certificates); } - // Read the election certificate IDs. - let mut election_certificate_ids = IndexSet::new(); - // TODO (howardwu): For mainnet - Always attempt to deserialize the election certificate IDs. - if version != 1 { - // Read the number of election certificate IDs. - let num_election_certificate_ids = u16::read_le(&mut reader)?; - // Ensure the number of election certificate IDs is within bounds. - if num_election_certificate_ids > BatchHeader::::MAX_CERTIFICATES { - return Err(error(format!( - "Number of election certificate IDs ({num_election_certificate_ids}) exceeds the maximum ({})", - BatchHeader::::MAX_CERTIFICATES - ))); - } - for _ in 0..num_election_certificate_ids { - // Read the election certificate ID. - election_certificate_ids.insert(Field::read_le(&mut reader)?); - } - } - // Return the subdag. - Self::from(subdag, election_certificate_ids).map_err(error) + Self::from(subdag).map_err(error) } } @@ -83,8 +63,7 @@ impl ToBytes for Subdag { /// Writes the subdag to the buffer. fn write_le(&self, mut writer: W) -> IoResult<()> { // Write the version. - // TODO (howardwu): For mainnet - Change the version back to 1. - 2u8.write_le(&mut writer)?; + 1u8.write_le(&mut writer)?; // Write the number of rounds. u32::try_from(self.subdag.len()).map_err(error)?.write_le(&mut writer)?; // Write the round certificates. @@ -99,13 +78,6 @@ impl ToBytes for Subdag { certificate.write_le(&mut writer)?; } } - // Write the number of election certificate IDs. - u16::try_from(self.election_certificate_ids.len()).map_err(error)?.write_le(&mut writer)?; - // Write the election certificate IDs. - for election_certificate_id in &self.election_certificate_ids { - // Write the election certificate ID. - election_certificate_id.write_le(&mut writer)?; - } Ok(()) } } diff --git a/ledger/narwhal/subdag/src/lib.rs b/ledger/narwhal/subdag/src/lib.rs index f6858bfbdc..d699d07ecf 100644 --- a/ledger/narwhal/subdag/src/lib.rs +++ b/ledger/narwhal/subdag/src/lib.rs @@ -113,8 +113,6 @@ fn weighted_median(timestamps_and_stake: Vec<(i64, u64)>) -> i64 { pub struct Subdag { /// The subdag of round certificates. subdag: BTreeMap>>, - /// The election certificate IDs. - election_certificate_ids: IndexSet>, } impl PartialEq for Subdag { @@ -128,10 +126,7 @@ impl Eq for Subdag {} impl Subdag { /// Initializes a new subdag. - pub fn from( - subdag: BTreeMap>>, - election_certificate_ids: IndexSet>, - ) -> Result { + pub fn from(subdag: BTreeMap>>) -> Result { // Ensure the subdag is not empty. ensure!(!subdag.is_empty(), "Subdag cannot be empty"); // Ensure the subdag does not exceed the maximum number of rounds. @@ -143,17 +138,12 @@ impl Subdag { ensure!(subdag.iter().next_back().map_or(0, |(r, _)| *r) % 2 == 0, "Anchor round must be even"); // Ensure there is only one leader certificate. ensure!(subdag.iter().next_back().map_or(0, |(_, c)| c.len()) == 1, "Subdag cannot have multiple leaders"); - // Ensure the number of election certificate IDs is within bounds. - ensure!( - election_certificate_ids.len() <= usize::try_from(BatchHeader::::MAX_CERTIFICATES)?, - "Number of election certificate IDs exceeds the maximum" - ); // Ensure the rounds are sequential. ensure!(is_sequential(&subdag), "Subdag rounds must be sequential"); // Ensure the subdag structure matches the commit. ensure!(sanity_check_subdag_with_dfs(&subdag), "Subdag structure does not match commit"); // Ensure the leader certificate is an even round. - Ok(Self { subdag, election_certificate_ids }) + Ok(Self { subdag }) } } @@ -217,11 +207,6 @@ impl Subdag { } } - /// Returns the election certificate IDs. - pub fn election_certificate_ids(&self) -> &IndexSet> { - &self.election_certificate_ids - } - /// Returns the subdag root of the certificates. pub fn to_subdag_root(&self) -> Result> { // Prepare the leaves. @@ -300,14 +285,8 @@ pub mod test_helpers { ); subdag.insert(starting_round + 2, indexset![certificate]); - // Initialize the election certificate IDs. - let mut election_certificate_ids = IndexSet::new(); - for _ in 0..AVAILABILITY_THRESHOLD { - election_certificate_ids.insert(rng.gen()); - } - // Return the subdag. - Subdag::from(subdag, election_certificate_ids).unwrap() + Subdag::from(subdag).unwrap() } /// Returns a list of sample subdags, sampled at random. diff --git a/ledger/narwhal/subdag/src/serialize.rs b/ledger/narwhal/subdag/src/serialize.rs index fb73011d91..f02389871e 100644 --- a/ledger/narwhal/subdag/src/serialize.rs +++ b/ledger/narwhal/subdag/src/serialize.rs @@ -19,9 +19,8 @@ impl Serialize for Subdag { fn serialize(&self, serializer: S) -> Result { match serializer.is_human_readable() { true => { - let mut certificate = serializer.serialize_struct("Subdag", 2)?; + let mut certificate = serializer.serialize_struct("Subdag", 1)?; certificate.serialize_field("subdag", &self.subdag)?; - certificate.serialize_field("election_certificate_ids", &self.election_certificate_ids)?; certificate.end() } false => ToBytesSerializer::serialize_with_size_encoding(self, serializer), @@ -36,11 +35,7 @@ impl<'de, N: Network> Deserialize<'de> for Subdag { true => { let mut value = serde_json::Value::deserialize(deserializer)?; - // TODO (howardwu): For mainnet - Directly take the value, do not check if its missing. - let election_certificate_ids = - DeserializeExt::take_from_value::(&mut value, "election_certificate_ids").unwrap_or_default(); - - Ok(Self::from(DeserializeExt::take_from_value::(&mut value, "subdag")?, election_certificate_ids) + Ok(Self::from(DeserializeExt::take_from_value::(&mut value, "subdag")?) .map_err(de::Error::custom)?) } false => FromBytesDeserializer::::deserialize_with_size_encoding(deserializer, "subdag"), From 939c4ab8c409735eb5d73bf9f83c2e70429f17d0 Mon Sep 17 00:00:00 2001 From: Niklas Date: Sat, 10 Feb 2024 12:49:13 +0100 Subject: [PATCH 289/298] ci: fix windows build --- .circleci/config.yml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 0c7567f0d6..18c9b8d2f7 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,7 +1,7 @@ version: 2.1 orbs: - windows: circleci/windows@2.4.0 + windows: circleci/windows@5.0 commands: check_windows: @@ -17,11 +17,14 @@ commands: name: "Install Rust and run cargo check" command: | $ProgressPreference = "SilentlyContinue" + # Remove the circleci installed rustc. + choco uninstall rust + # Install rust with rustup. Invoke-WebRequest -Uri "https://win.rustup.rs/" -OutFile "C:\rustup-init.exe" & C:\rustup-init.exe -y --default-toolchain "stable-x86_64-pc-windows-msvc" --no-modify-path --profile minimal - $env:Path += ";C:\Users\circleci\.cargo\bin" - rustc -Vv - cargo --version + $Env:Path += ";$Env:USERPROFILE\.cargo\bin" + # Verify the installation. + cargo --version --verbose rustc --version | Out-File -FilePath "rust-version" if (!(Test-Path "Cargo.lock" -PathType Leaf)) { cargo generate-lockfile From c0e1ac9ea58936965aef8436d0f5122be68528e7 Mon Sep 17 00:00:00 2001 From: Howard Wu <9260812+howardwu@users.noreply.github.com> Date: Sat, 10 Feb 2024 10:59:37 -0800 Subject: [PATCH 290/298] Simplify header check in non-debug mode --- ledger/block/src/header/genesis.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/ledger/block/src/header/genesis.rs b/ledger/block/src/header/genesis.rs index 87952914d4..52c19e6ed8 100644 --- a/ledger/block/src/header/genesis.rs +++ b/ledger/block/src/header/genesis.rs @@ -22,9 +22,7 @@ impl Header { ratified_finalize_operations: Vec>, ) -> Result { #[cfg(not(debug_assertions))] - ensure!(!ratifications.is_empty(), "The genesis block must not contain ratifications"); - #[cfg(not(debug_assertions))] - ensure!(ratifications.len() == 1, "The genesis block must not contain 1 ratification"); + ensure!(ratifications.len() == 1, "The genesis block must contain exactly 1 ratification"); #[cfg(not(debug_assertions))] ensure!(!ratified_finalize_operations.is_empty(), "The genesis block must contain ratify-finalize operations"); From 8892f5305b465e9c2cd5177ea8180a1b16e92fb2 Mon Sep 17 00:00:00 2001 From: Howard Wu <9260812+howardwu@users.noreply.github.com> Date: Sat, 10 Feb 2024 12:20:36 -0800 Subject: [PATCH 291/298] chore(snarkvm): bump version for new release --- .cargo/release-version | 2 +- Cargo.lock | 120 ++++++++++---------- Cargo.toml | 24 ++-- algorithms/Cargo.toml | 12 +- algorithms/cuda/Cargo.toml | 2 +- circuit/Cargo.toml | 16 +-- circuit/account/Cargo.toml | 10 +- circuit/algorithms/Cargo.toml | 8 +- circuit/collections/Cargo.toml | 8 +- circuit/environment/Cargo.toml | 14 +-- circuit/environment/witness/Cargo.toml | 2 +- circuit/network/Cargo.toml | 10 +- circuit/program/Cargo.toml | 16 +-- circuit/types/Cargo.toml | 18 +-- circuit/types/address/Cargo.toml | 14 +-- circuit/types/boolean/Cargo.toml | 6 +- circuit/types/field/Cargo.toml | 8 +- circuit/types/group/Cargo.toml | 12 +- circuit/types/integers/Cargo.toml | 12 +- circuit/types/scalar/Cargo.toml | 10 +- circuit/types/string/Cargo.toml | 12 +- console/Cargo.toml | 14 +-- console/account/Cargo.toml | 6 +- console/algorithms/Cargo.toml | 8 +- console/collections/Cargo.toml | 6 +- console/network/Cargo.toml | 20 ++-- console/network/environment/Cargo.toml | 8 +- console/program/Cargo.toml | 14 +-- console/types/Cargo.toml | 18 +-- console/types/address/Cargo.toml | 10 +- console/types/boolean/Cargo.toml | 4 +- console/types/field/Cargo.toml | 6 +- console/types/group/Cargo.toml | 10 +- console/types/integers/Cargo.toml | 10 +- console/types/scalar/Cargo.toml | 8 +- console/types/string/Cargo.toml | 10 +- curves/Cargo.toml | 6 +- fields/Cargo.toml | 5 +- ledger/Cargo.toml | 22 ++-- ledger/authority/Cargo.toml | 6 +- ledger/block/Cargo.toml | 20 ++-- ledger/coinbase/Cargo.toml | 14 +-- ledger/committee/Cargo.toml | 6 +- ledger/narwhal/Cargo.toml | 14 +-- ledger/narwhal/batch-certificate/Cargo.toml | 8 +- ledger/narwhal/batch-header/Cargo.toml | 6 +- ledger/narwhal/data/Cargo.toml | 4 +- ledger/narwhal/subdag/Cargo.toml | 10 +- ledger/narwhal/transmission-id/Cargo.toml | 6 +- ledger/narwhal/transmission/Cargo.toml | 10 +- ledger/query/Cargo.toml | 8 +- ledger/store/Cargo.toml | 18 +-- ledger/test-helpers/Cargo.toml | 16 +-- metrics/Cargo.toml | 2 +- parameters/Cargo.toml | 6 +- synthesizer/Cargo.toml | 24 ++-- synthesizer/process/Cargo.toml | 18 +-- synthesizer/program/Cargo.toml | 6 +- synthesizer/snark/Cargo.toml | 8 +- utilities/Cargo.toml | 4 +- utilities/derives/Cargo.toml | 2 +- wasm/Cargo.toml | 20 ++-- 62 files changed, 378 insertions(+), 379 deletions(-) diff --git a/.cargo/release-version b/.cargo/release-version index d0b774899e..f08075098e 100644 --- a/.cargo/release-version +++ b/.cargo/release-version @@ -1 +1 @@ -v0.16.18 \ No newline at end of file +v0.16.19 \ No newline at end of file diff --git a/Cargo.lock b/Cargo.lock index f1c6e6abd0..40ffced9aa 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2522,7 +2522,7 @@ dependencies = [ [[package]] name = "snarkvm" -version = "0.16.18" +version = "0.16.19" dependencies = [ "anstyle", "anyhow", @@ -2558,7 +2558,7 @@ dependencies = [ [[package]] name = "snarkvm-algorithms" -version = "0.16.18" +version = "0.16.19" dependencies = [ "aleo-std", "anyhow", @@ -2597,7 +2597,7 @@ dependencies = [ [[package]] name = "snarkvm-algorithms-cuda" -version = "0.16.18" +version = "0.16.19" dependencies = [ "blst", "cc", @@ -2607,7 +2607,7 @@ dependencies = [ [[package]] name = "snarkvm-circuit" -version = "0.16.18" +version = "0.16.19" dependencies = [ "snarkvm-circuit-account", "snarkvm-circuit-algorithms", @@ -2620,7 +2620,7 @@ dependencies = [ [[package]] name = "snarkvm-circuit-account" -version = "0.16.18" +version = "0.16.19" dependencies = [ "anyhow", "snarkvm-circuit-algorithms", @@ -2632,7 +2632,7 @@ dependencies = [ [[package]] name = "snarkvm-circuit-algorithms" -version = "0.16.18" +version = "0.16.19" dependencies = [ "anyhow", "snarkvm-circuit-types", @@ -2644,7 +2644,7 @@ dependencies = [ [[package]] name = "snarkvm-circuit-collections" -version = "0.16.18" +version = "0.16.19" dependencies = [ "anyhow", "snarkvm-circuit-algorithms", @@ -2658,7 +2658,7 @@ dependencies = [ [[package]] name = "snarkvm-circuit-environment" -version = "0.16.18" +version = "0.16.19" dependencies = [ "criterion", "indexmap 2.1.0", @@ -2679,11 +2679,11 @@ dependencies = [ [[package]] name = "snarkvm-circuit-environment-witness" -version = "0.16.18" +version = "0.16.19" [[package]] name = "snarkvm-circuit-network" -version = "0.16.18" +version = "0.16.19" dependencies = [ "snarkvm-circuit-algorithms", "snarkvm-circuit-collections", @@ -2694,7 +2694,7 @@ dependencies = [ [[package]] name = "snarkvm-circuit-program" -version = "0.16.18" +version = "0.16.19" dependencies = [ "anyhow", "paste", @@ -2712,7 +2712,7 @@ dependencies = [ [[package]] name = "snarkvm-circuit-types" -version = "0.16.18" +version = "0.16.19" dependencies = [ "snarkvm-circuit-environment", "snarkvm-circuit-types-address", @@ -2727,7 +2727,7 @@ dependencies = [ [[package]] name = "snarkvm-circuit-types-address" -version = "0.16.18" +version = "0.16.19" dependencies = [ "snarkvm-circuit-environment", "snarkvm-circuit-types-boolean", @@ -2739,7 +2739,7 @@ dependencies = [ [[package]] name = "snarkvm-circuit-types-boolean" -version = "0.16.18" +version = "0.16.19" dependencies = [ "criterion", "snarkvm-circuit-environment", @@ -2748,7 +2748,7 @@ dependencies = [ [[package]] name = "snarkvm-circuit-types-field" -version = "0.16.18" +version = "0.16.19" dependencies = [ "snarkvm-circuit-environment", "snarkvm-circuit-types-boolean", @@ -2757,7 +2757,7 @@ dependencies = [ [[package]] name = "snarkvm-circuit-types-group" -version = "0.16.18" +version = "0.16.19" dependencies = [ "snarkvm-circuit-environment", "snarkvm-circuit-types-boolean", @@ -2769,7 +2769,7 @@ dependencies = [ [[package]] name = "snarkvm-circuit-types-integers" -version = "0.16.18" +version = "0.16.19" dependencies = [ "paste", "snarkvm-circuit-environment", @@ -2782,7 +2782,7 @@ dependencies = [ [[package]] name = "snarkvm-circuit-types-scalar" -version = "0.16.18" +version = "0.16.19" dependencies = [ "snarkvm-circuit-environment", "snarkvm-circuit-types-boolean", @@ -2792,7 +2792,7 @@ dependencies = [ [[package]] name = "snarkvm-circuit-types-string" -version = "0.16.18" +version = "0.16.19" dependencies = [ "rand", "snarkvm-circuit-environment", @@ -2805,7 +2805,7 @@ dependencies = [ [[package]] name = "snarkvm-console" -version = "0.16.18" +version = "0.16.19" dependencies = [ "snarkvm-console-account", "snarkvm-console-algorithms", @@ -2817,7 +2817,7 @@ dependencies = [ [[package]] name = "snarkvm-console-account" -version = "0.16.18" +version = "0.16.19" dependencies = [ "bincode", "bs58", @@ -2830,7 +2830,7 @@ dependencies = [ [[package]] name = "snarkvm-console-algorithms" -version = "0.16.18" +version = "0.16.19" dependencies = [ "blake2s_simd", "criterion", @@ -2848,7 +2848,7 @@ dependencies = [ [[package]] name = "snarkvm-console-collections" -version = "0.16.18" +version = "0.16.19" dependencies = [ "aleo-std", "criterion", @@ -2861,7 +2861,7 @@ dependencies = [ [[package]] name = "snarkvm-console-network" -version = "0.16.18" +version = "0.16.19" dependencies = [ "anyhow", "indexmap 2.1.0", @@ -2883,7 +2883,7 @@ dependencies = [ [[package]] name = "snarkvm-console-network-environment" -version = "0.16.18" +version = "0.16.19" dependencies = [ "anyhow", "bech32", @@ -2900,7 +2900,7 @@ dependencies = [ [[package]] name = "snarkvm-console-program" -version = "0.16.18" +version = "0.16.19" dependencies = [ "bincode", "enum_index", @@ -2921,7 +2921,7 @@ dependencies = [ [[package]] name = "snarkvm-console-types" -version = "0.16.18" +version = "0.16.19" dependencies = [ "criterion", "snarkvm-console-network", @@ -2937,7 +2937,7 @@ dependencies = [ [[package]] name = "snarkvm-console-types-address" -version = "0.16.18" +version = "0.16.19" dependencies = [ "bincode", "serde_json", @@ -2949,7 +2949,7 @@ dependencies = [ [[package]] name = "snarkvm-console-types-boolean" -version = "0.16.18" +version = "0.16.19" dependencies = [ "bincode", "serde_json", @@ -2958,7 +2958,7 @@ dependencies = [ [[package]] name = "snarkvm-console-types-field" -version = "0.16.18" +version = "0.16.19" dependencies = [ "bincode", "serde_json", @@ -2969,7 +2969,7 @@ dependencies = [ [[package]] name = "snarkvm-console-types-group" -version = "0.16.18" +version = "0.16.19" dependencies = [ "bincode", "serde_json", @@ -2981,7 +2981,7 @@ dependencies = [ [[package]] name = "snarkvm-console-types-integers" -version = "0.16.18" +version = "0.16.19" dependencies = [ "bincode", "serde_json", @@ -2993,7 +2993,7 @@ dependencies = [ [[package]] name = "snarkvm-console-types-scalar" -version = "0.16.18" +version = "0.16.19" dependencies = [ "bincode", "serde_json", @@ -3005,7 +3005,7 @@ dependencies = [ [[package]] name = "snarkvm-console-types-string" -version = "0.16.18" +version = "0.16.19" dependencies = [ "bincode", "serde_json", @@ -3017,7 +3017,7 @@ dependencies = [ [[package]] name = "snarkvm-curves" -version = "0.16.18" +version = "0.16.19" dependencies = [ "bincode", "criterion", @@ -3032,7 +3032,7 @@ dependencies = [ [[package]] name = "snarkvm-fields" -version = "0.16.18" +version = "0.16.19" dependencies = [ "aleo-std", "anyhow", @@ -3050,7 +3050,7 @@ dependencies = [ [[package]] name = "snarkvm-ledger" -version = "0.16.18" +version = "0.16.19" dependencies = [ "aleo-std", "anyhow", @@ -3077,7 +3077,7 @@ dependencies = [ [[package]] name = "snarkvm-ledger-authority" -version = "0.16.18" +version = "0.16.19" dependencies = [ "anyhow", "bincode", @@ -3090,7 +3090,7 @@ dependencies = [ [[package]] name = "snarkvm-ledger-block" -version = "0.16.18" +version = "0.16.19" dependencies = [ "bincode", "indexmap 2.1.0", @@ -3114,7 +3114,7 @@ dependencies = [ [[package]] name = "snarkvm-ledger-coinbase" -version = "0.16.18" +version = "0.16.19" dependencies = [ "aleo-std", "anyhow", @@ -3135,7 +3135,7 @@ dependencies = [ [[package]] name = "snarkvm-ledger-committee" -version = "0.16.18" +version = "0.16.19" dependencies = [ "anyhow", "bincode", @@ -3156,7 +3156,7 @@ dependencies = [ [[package]] name = "snarkvm-ledger-narwhal" -version = "0.16.18" +version = "0.16.19" dependencies = [ "snarkvm-ledger-narwhal", "snarkvm-ledger-narwhal-batch-certificate", @@ -3169,7 +3169,7 @@ dependencies = [ [[package]] name = "snarkvm-ledger-narwhal-batch-certificate" -version = "0.16.18" +version = "0.16.19" dependencies = [ "bincode", "indexmap 2.1.0", @@ -3183,7 +3183,7 @@ dependencies = [ [[package]] name = "snarkvm-ledger-narwhal-batch-header" -version = "0.16.18" +version = "0.16.19" dependencies = [ "bincode", "indexmap 2.1.0", @@ -3196,7 +3196,7 @@ dependencies = [ [[package]] name = "snarkvm-ledger-narwhal-data" -version = "0.16.18" +version = "0.16.19" dependencies = [ "bytes", "serde_json", @@ -3206,7 +3206,7 @@ dependencies = [ [[package]] name = "snarkvm-ledger-narwhal-subdag" -version = "0.16.18" +version = "0.16.19" dependencies = [ "bincode", "indexmap 2.1.0", @@ -3221,7 +3221,7 @@ dependencies = [ [[package]] name = "snarkvm-ledger-narwhal-transmission" -version = "0.16.18" +version = "0.16.19" dependencies = [ "bincode", "bytes", @@ -3234,7 +3234,7 @@ dependencies = [ [[package]] name = "snarkvm-ledger-narwhal-transmission-id" -version = "0.16.18" +version = "0.16.19" dependencies = [ "bincode", "serde_json", @@ -3244,7 +3244,7 @@ dependencies = [ [[package]] name = "snarkvm-ledger-query" -version = "0.16.18" +version = "0.16.19" dependencies = [ "async-trait", "reqwest", @@ -3256,7 +3256,7 @@ dependencies = [ [[package]] name = "snarkvm-ledger-store" -version = "0.16.18" +version = "0.16.19" dependencies = [ "aleo-std-storage", "anyhow", @@ -3284,7 +3284,7 @@ dependencies = [ [[package]] name = "snarkvm-ledger-test-helpers" -version = "0.16.18" +version = "0.16.19" dependencies = [ "once_cell", "snarkvm-circuit", @@ -3298,7 +3298,7 @@ dependencies = [ [[package]] name = "snarkvm-metrics" -version = "0.16.18" +version = "0.16.19" dependencies = [ "metrics", "metrics-exporter-prometheus", @@ -3306,7 +3306,7 @@ dependencies = [ [[package]] name = "snarkvm-parameters" -version = "0.16.18" +version = "0.16.19" dependencies = [ "aleo-std", "anyhow", @@ -3339,7 +3339,7 @@ dependencies = [ [[package]] name = "snarkvm-synthesizer" -version = "0.16.18" +version = "0.16.19" dependencies = [ "aleo-std", "anyhow", @@ -3370,7 +3370,7 @@ dependencies = [ [[package]] name = "snarkvm-synthesizer-process" -version = "0.16.18" +version = "0.16.19" dependencies = [ "aleo-std", "bincode", @@ -3396,7 +3396,7 @@ dependencies = [ [[package]] name = "snarkvm-synthesizer-program" -version = "0.16.18" +version = "0.16.19" dependencies = [ "bincode", "criterion", @@ -3412,7 +3412,7 @@ dependencies = [ [[package]] name = "snarkvm-synthesizer-snark" -version = "0.16.18" +version = "0.16.19" dependencies = [ "bincode", "colored", @@ -3425,7 +3425,7 @@ dependencies = [ [[package]] name = "snarkvm-utilities" -version = "0.16.18" +version = "0.16.19" dependencies = [ "aleo-std", "anyhow", @@ -3445,7 +3445,7 @@ dependencies = [ [[package]] name = "snarkvm-utilities-derives" -version = "0.16.18" +version = "0.16.19" dependencies = [ "proc-macro2", "quote 1.0.35", @@ -3454,7 +3454,7 @@ dependencies = [ [[package]] name = "snarkvm-wasm" -version = "0.16.18" +version = "0.16.19" dependencies = [ "getrandom", "snarkvm-circuit-network", diff --git a/Cargo.toml b/Cargo.toml index 669e053a09..4726092fa2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm" -version = "0.16.18" +version = "0.16.19" authors = [ "The Aleo Team " ] description = "A decentralized virtual machine" homepage = "https://aleo.org" @@ -150,58 +150,58 @@ wasm = [ "snarkvm-wasm" ] [dependencies.snarkvm-algorithms] path = "./algorithms" -version = "=0.16.18" +version = "=0.16.19" optional = true [dependencies.snarkvm-circuit] path = "./circuit" -version = "=0.16.18" +version = "=0.16.19" optional = true [dependencies.snarkvm-console] path = "./console" -version = "=0.16.18" +version = "=0.16.19" optional = true [dependencies.snarkvm-curves] path = "./curves" -version = "=0.16.18" +version = "=0.16.19" optional = true [dependencies.snarkvm-fields] path = "./fields" -version = "=0.16.18" +version = "=0.16.19" optional = true [dependencies.snarkvm-ledger] path = "./ledger" -version = "=0.16.18" +version = "=0.16.19" optional = true [dependencies.snarkvm-metrics] path = "./metrics" -version = "=0.16.18" +version = "=0.16.19" optional = true [dependencies.snarkvm-parameters] path = "./parameters" -version = "=0.16.18" +version = "=0.16.19" optional = true [dependencies.snarkvm-synthesizer] path = "./synthesizer" -version = "=0.16.18" +version = "=0.16.19" default-features = false optional = true [dependencies.snarkvm-utilities] path = "./utilities" -version = "=0.16.18" +version = "=0.16.19" optional = true [dependencies.snarkvm-wasm] path = "./wasm" -version = "=0.16.18" +version = "=0.16.19" optional = true [dependencies.anstyle] diff --git a/algorithms/Cargo.toml b/algorithms/Cargo.toml index d1a54ff9dc..fd8e78c5e1 100644 --- a/algorithms/Cargo.toml +++ b/algorithms/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-algorithms" -version = "0.16.18" +version = "0.16.19" authors = [ "The Aleo Team " ] description = "Algorithms for a decentralized virtual machine" homepage = "https://aleo.org" @@ -47,27 +47,27 @@ required-features = [ "test" ] [dependencies.snarkvm-curves] path = "../curves" -version = "=0.16.18" +version = "=0.16.19" default-features = false [dependencies.snarkvm-fields] path = "../fields" -version = "=0.16.18" +version = "=0.16.19" default-features = false [dependencies.snarkvm-parameters] path = "../parameters" -version = "=0.16.18" +version = "=0.16.19" optional = true [dependencies.snarkvm-utilities] path = "../utilities" -version = "=0.16.18" +version = "=0.16.19" default-features = false [dependencies.snarkvm-algorithms-cuda] path = "./cuda" -version = "=0.16.18" +version = "=0.16.19" optional = true [dependencies.aleo-std] diff --git a/algorithms/cuda/Cargo.toml b/algorithms/cuda/Cargo.toml index 43fafe8a32..3c1ff3f252 100644 --- a/algorithms/cuda/Cargo.toml +++ b/algorithms/cuda/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-algorithms-cuda" -version = "0.16.18" +version = "0.16.19" authors = [ "The Aleo Team " ] description = "Cuda optimizations for a decentralized virtual machine" homepage = "https://aleo.org" diff --git a/circuit/Cargo.toml b/circuit/Cargo.toml index 92171e3130..bfc0896c5f 100644 --- a/circuit/Cargo.toml +++ b/circuit/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-circuit" -version = "0.16.18" +version = "0.16.19" authors = [ "The Aleo Team " ] description = "Circuits for a decentralized virtual machine" homepage = "https://aleo.org" @@ -25,28 +25,28 @@ edition = "2021" [dependencies.snarkvm-circuit-account] path = "./account" -version = "=0.16.18" +version = "=0.16.19" [dependencies.snarkvm-circuit-algorithms] path = "./algorithms" -version = "=0.16.18" +version = "=0.16.19" [dependencies.snarkvm-circuit-collections] path = "./collections" -version = "=0.16.18" +version = "=0.16.19" [dependencies.snarkvm-circuit-environment] path = "./environment" -version = "=0.16.18" +version = "=0.16.19" [dependencies.snarkvm-circuit-network] path = "./network" -version = "=0.16.18" +version = "=0.16.19" [dependencies.snarkvm-circuit-program] path = "./program" -version = "=0.16.18" +version = "=0.16.19" [dependencies.snarkvm-circuit-types] path = "./types" -version = "=0.16.18" +version = "=0.16.19" diff --git a/circuit/account/Cargo.toml b/circuit/account/Cargo.toml index 27e9813102..8c493b19bc 100644 --- a/circuit/account/Cargo.toml +++ b/circuit/account/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-circuit-account" -version = "0.16.18" +version = "0.16.19" authors = [ "The Aleo Team " ] description = "Account circuit library for a decentralized virtual machine" license = "Apache-2.0" @@ -9,20 +9,20 @@ edition = "2021" [dependencies.console] package = "snarkvm-console-account" path = "../../console/account" -version = "=0.16.18" +version = "=0.16.19" optional = true [dependencies.snarkvm-circuit-algorithms] path = "../algorithms" -version = "=0.16.18" +version = "=0.16.19" [dependencies.snarkvm-circuit-network] path = "../network" -version = "=0.16.18" +version = "=0.16.19" [dependencies.snarkvm-circuit-types] path = "../types" -version = "=0.16.18" +version = "=0.16.19" [dev-dependencies.snarkvm-utilities] path = "../../utilities" diff --git a/circuit/algorithms/Cargo.toml b/circuit/algorithms/Cargo.toml index 1b082bbf65..8749d46f84 100644 --- a/circuit/algorithms/Cargo.toml +++ b/circuit/algorithms/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-circuit-algorithms" -version = "0.16.18" +version = "0.16.19" authors = [ "The Aleo Team " ] description = "Algorithm circuit library for a decentralized virtual machine" license = "Apache-2.0" @@ -9,16 +9,16 @@ edition = "2021" [dependencies.console] package = "snarkvm-console-algorithms" path = "../../console/algorithms" -version = "=0.16.18" +version = "=0.16.19" optional = true [dependencies.snarkvm-circuit-types] path = "../types" -version = "=0.16.18" +version = "=0.16.19" [dependencies.snarkvm-fields] path = "../../fields" -version = "=0.16.18" +version = "=0.16.19" default-features = false [dev-dependencies.anyhow] diff --git a/circuit/collections/Cargo.toml b/circuit/collections/Cargo.toml index c53db38a92..6cc949c5b9 100644 --- a/circuit/collections/Cargo.toml +++ b/circuit/collections/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-circuit-collections" -version = "0.16.18" +version = "0.16.19" authors = [ "The Aleo Team " ] description = "Collections circuit library for a decentralized virtual machine" license = "Apache-2.0" @@ -9,16 +9,16 @@ edition = "2021" [dependencies.console] package = "snarkvm-console-collections" path = "../../console/collections" -version = "=0.16.18" +version = "=0.16.19" optional = true [dependencies.snarkvm-circuit-algorithms] path = "../algorithms" -version = "=0.16.18" +version = "=0.16.19" [dependencies.snarkvm-circuit-types] path = "../types" -version = "=0.16.18" +version = "=0.16.19" [dev-dependencies.snarkvm-circuit-network] path = "../network" diff --git a/circuit/environment/Cargo.toml b/circuit/environment/Cargo.toml index 5fb3694fa1..894d81274c 100644 --- a/circuit/environment/Cargo.toml +++ b/circuit/environment/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-circuit-environment" -version = "0.16.18" +version = "0.16.19" authors = [ "The Aleo Team " ] description = "Circuit environment for a decentralized virtual machine" license = "Apache-2.0" @@ -14,32 +14,32 @@ harness = false [dependencies.console] package = "snarkvm-console-network" path = "../../console/network" -version = "=0.16.18" +version = "=0.16.19" [dependencies.snarkvm-algorithms] path = "../../algorithms" -version = "=0.16.18" +version = "=0.16.19" default-features = false features = [ "r1cs" ] [dependencies.snarkvm-circuit-environment-witness] path = "./witness" -version = "=0.16.18" +version = "=0.16.19" default-features = false [dependencies.snarkvm-curves] path = "../../curves" -version = "=0.16.18" +version = "=0.16.19" default-features = false [dependencies.snarkvm-fields] path = "../../fields" -version = "=0.16.18" +version = "=0.16.19" default-features = false [dependencies.snarkvm-utilities] path = "../../utilities" -version = "=0.16.18" +version = "=0.16.19" default-features = false [dependencies.indexmap] diff --git a/circuit/environment/witness/Cargo.toml b/circuit/environment/witness/Cargo.toml index 5665c4402f..a6660d0684 100644 --- a/circuit/environment/witness/Cargo.toml +++ b/circuit/environment/witness/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-circuit-environment-witness" -version = "0.16.18" +version = "0.16.19" authors = [ "The Aleo Team " ] description = "A procedural macro to construct a witness in an environment" license = "Apache-2.0" diff --git a/circuit/network/Cargo.toml b/circuit/network/Cargo.toml index e16e4e3b44..efd63a8cdc 100644 --- a/circuit/network/Cargo.toml +++ b/circuit/network/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-circuit-network" -version = "0.16.18" +version = "0.16.19" authors = [ "The Aleo Team " ] description = "Network circuit library for a decentralized virtual machine" license = "Apache-2.0" @@ -9,20 +9,20 @@ edition = "2021" [dependencies.console] package = "snarkvm-console-network" path = "../../console/network" -version = "=0.16.18" +version = "=0.16.19" optional = true [dependencies.snarkvm-circuit-algorithms] path = "../algorithms" -version = "=0.16.18" +version = "=0.16.19" [dependencies.snarkvm-circuit-collections] path = "../collections" -version = "=0.16.18" +version = "=0.16.19" [dependencies.snarkvm-circuit-types] path = "../types" -version = "=0.16.18" +version = "=0.16.19" [dev-dependencies.snarkvm-console-types] path = "../../console/types" diff --git a/circuit/program/Cargo.toml b/circuit/program/Cargo.toml index 968dea03e2..2a222e0093 100644 --- a/circuit/program/Cargo.toml +++ b/circuit/program/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-circuit-program" -version = "0.16.18" +version = "0.16.19" authors = [ "The Aleo Team " ] description = "Program circuit library for a decentralized virtual machine" license = "Apache-2.0" @@ -9,32 +9,32 @@ edition = "2021" [dependencies.console] package = "snarkvm-console-program" path = "../../console/program" -version = "=0.16.18" +version = "=0.16.19" optional = true [dependencies.snarkvm-circuit-account] path = "../account" -version = "=0.16.18" +version = "=0.16.19" [dependencies.snarkvm-circuit-algorithms] path = "../algorithms" -version = "=0.16.18" +version = "=0.16.19" [dependencies.snarkvm-circuit-collections] path = "../collections" -version = "=0.16.18" +version = "=0.16.19" [dependencies.snarkvm-circuit-network] path = "../network" -version = "=0.16.18" +version = "=0.16.19" [dependencies.snarkvm-circuit-types] path = "../types" -version = "=0.16.18" +version = "=0.16.19" [dependencies.snarkvm-utilities] path = "../../utilities" -version = "=0.16.18" +version = "=0.16.19" [dependencies.paste] version = "1.0" diff --git a/circuit/types/Cargo.toml b/circuit/types/Cargo.toml index b673f8c3d2..b2448c60b3 100644 --- a/circuit/types/Cargo.toml +++ b/circuit/types/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-circuit-types" -version = "0.16.18" +version = "0.16.19" authors = [ "The Aleo Team " ] description = "Primitive circuit for a decentralized virtual machine" license = "Apache-2.0" @@ -8,35 +8,35 @@ edition = "2021" [dependencies.snarkvm-circuit-environment] path = "../environment" -version = "=0.16.18" +version = "=0.16.19" [dependencies.snarkvm-circuit-types-address] path = "./address" -version = "=0.16.18" +version = "=0.16.19" [dependencies.snarkvm-circuit-types-boolean] path = "./boolean" -version = "=0.16.18" +version = "=0.16.19" [dependencies.snarkvm-circuit-types-field] path = "./field" -version = "=0.16.18" +version = "=0.16.19" [dependencies.snarkvm-circuit-types-group] path = "./group" -version = "=0.16.18" +version = "=0.16.19" [dependencies.snarkvm-circuit-types-integers] path = "./integers" -version = "=0.16.18" +version = "=0.16.19" [dependencies.snarkvm-circuit-types-scalar] path = "./scalar" -version = "=0.16.18" +version = "=0.16.19" [dependencies.snarkvm-circuit-types-string] path = "./string" -version = "=0.16.18" +version = "=0.16.19" [dev-dependencies.console] package = "snarkvm-console" diff --git a/circuit/types/address/Cargo.toml b/circuit/types/address/Cargo.toml index 3e2f9400d8..d859d594f7 100644 --- a/circuit/types/address/Cargo.toml +++ b/circuit/types/address/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-circuit-types-address" -version = "0.16.18" +version = "0.16.19" authors = [ "The Aleo Team " ] description = "Address circuit for a decentralized virtual machine" license = "Apache-2.0" @@ -9,28 +9,28 @@ edition = "2021" [dependencies.console] package = "snarkvm-console-types-address" path = "../../../console/types/address" -version = "=0.16.18" +version = "=0.16.19" optional = true [dependencies.snarkvm-circuit-environment] path = "../../environment" -version = "=0.16.18" +version = "=0.16.19" [dependencies.snarkvm-circuit-types-boolean] path = "../boolean" -version = "=0.16.18" +version = "=0.16.19" [dependencies.snarkvm-circuit-types-field] path = "../field" -version = "=0.16.18" +version = "=0.16.19" [dependencies.snarkvm-circuit-types-group] path = "../group" -version = "=0.16.18" +version = "=0.16.19" [dependencies.snarkvm-circuit-types-scalar] path = "../scalar" -version = "=0.16.18" +version = "=0.16.19" [features] default = [ "enable_console" ] diff --git a/circuit/types/boolean/Cargo.toml b/circuit/types/boolean/Cargo.toml index 323adca84c..6f9e9f2e3b 100644 --- a/circuit/types/boolean/Cargo.toml +++ b/circuit/types/boolean/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-circuit-types-boolean" -version = "0.16.18" +version = "0.16.19" authors = [ "The Aleo Team " ] description = "Boolean circuit for a decentralized virtual machine" license = "Apache-2.0" @@ -14,12 +14,12 @@ harness = false [dependencies.console] package = "snarkvm-console-types-boolean" path = "../../../console/types/boolean" -version = "=0.16.18" +version = "=0.16.19" optional = true [dependencies.snarkvm-circuit-environment] path = "../../environment" -version = "=0.16.18" +version = "=0.16.19" [dev-dependencies.criterion] version = "0.5" diff --git a/circuit/types/field/Cargo.toml b/circuit/types/field/Cargo.toml index c1a9df1876..acc1367886 100644 --- a/circuit/types/field/Cargo.toml +++ b/circuit/types/field/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-circuit-types-field" -version = "0.16.18" +version = "0.16.19" authors = [ "The Aleo Team " ] description = "Field circuit for a decentralized virtual machine" license = "Apache-2.0" @@ -9,16 +9,16 @@ edition = "2021" [dependencies.console] package = "snarkvm-console-types-field" path = "../../../console/types/field" -version = "=0.16.18" +version = "=0.16.19" optional = true [dependencies.snarkvm-circuit-environment] path = "../../environment" -version = "=0.16.18" +version = "=0.16.19" [dependencies.snarkvm-circuit-types-boolean] path = "../boolean" -version = "=0.16.18" +version = "=0.16.19" [features] default = [ "enable_console" ] diff --git a/circuit/types/group/Cargo.toml b/circuit/types/group/Cargo.toml index bf234c27b3..c633da70d9 100644 --- a/circuit/types/group/Cargo.toml +++ b/circuit/types/group/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-circuit-types-group" -version = "0.16.18" +version = "0.16.19" authors = [ "The Aleo Team " ] description = "Group circuit for a decentralized virtual machine" license = "Apache-2.0" @@ -9,24 +9,24 @@ edition = "2021" [dependencies.console] package = "snarkvm-console-types-group" path = "../../../console/types/group" -version = "=0.16.18" +version = "=0.16.19" optional = true [dependencies.snarkvm-circuit-environment] path = "../../environment" -version = "=0.16.18" +version = "=0.16.19" [dependencies.snarkvm-circuit-types-boolean] path = "../boolean" -version = "=0.16.18" +version = "=0.16.19" [dependencies.snarkvm-circuit-types-field] path = "../field" -version = "=0.16.18" +version = "=0.16.19" [dependencies.snarkvm-circuit-types-scalar] path = "../scalar" -version = "=0.16.18" +version = "=0.16.19" [dev-dependencies.snarkvm-utilities] path = "../../../utilities" diff --git a/circuit/types/integers/Cargo.toml b/circuit/types/integers/Cargo.toml index fae7ff67f7..5903640f3f 100644 --- a/circuit/types/integers/Cargo.toml +++ b/circuit/types/integers/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-circuit-types-integers" -version = "0.16.18" +version = "0.16.19" authors = [ "The Aleo Team " ] description = "Integer circuit for a decentralized virtual machine" license = "Apache-2.0" @@ -9,24 +9,24 @@ edition = "2021" [dependencies.console] package = "snarkvm-console-types-integers" path = "../../../console/types/integers" -version = "=0.16.18" +version = "=0.16.19" optional = true [dependencies.snarkvm-circuit-environment] path = "../../environment" -version = "=0.16.18" +version = "=0.16.19" [dependencies.snarkvm-circuit-types-boolean] path = "../boolean" -version = "=0.16.18" +version = "=0.16.19" [dependencies.snarkvm-circuit-types-field] path = "../field" -version = "=0.16.18" +version = "=0.16.19" [dependencies.snarkvm-circuit-types-scalar] path = "../scalar" -version = "=0.16.18" +version = "=0.16.19" [dev-dependencies.snarkvm-utilities] path = "../../../utilities" diff --git a/circuit/types/scalar/Cargo.toml b/circuit/types/scalar/Cargo.toml index d12a47c233..99e813f11b 100644 --- a/circuit/types/scalar/Cargo.toml +++ b/circuit/types/scalar/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-circuit-types-scalar" -version = "0.16.18" +version = "0.16.19" authors = [ "The Aleo Team " ] description = "Scalar circuit for a decentralized virtual machine" license = "Apache-2.0" @@ -9,20 +9,20 @@ edition = "2021" [dependencies.console] package = "snarkvm-console-types-scalar" path = "../../../console/types/scalar" -version = "=0.16.18" +version = "=0.16.19" optional = true [dependencies.snarkvm-circuit-environment] path = "../../environment" -version = "=0.16.18" +version = "=0.16.19" [dependencies.snarkvm-circuit-types-boolean] path = "../boolean" -version = "=0.16.18" +version = "=0.16.19" [dependencies.snarkvm-circuit-types-field] path = "../field" -version = "=0.16.18" +version = "=0.16.19" [features] default = [ "enable_console" ] diff --git a/circuit/types/string/Cargo.toml b/circuit/types/string/Cargo.toml index b6add60321..716f2593c2 100644 --- a/circuit/types/string/Cargo.toml +++ b/circuit/types/string/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-circuit-types-string" -version = "0.16.18" +version = "0.16.19" authors = [ "The Aleo Team " ] description = "String circuit for a decentralized virtual machine" license = "Apache-2.0" @@ -9,24 +9,24 @@ edition = "2021" [dependencies.console] package = "snarkvm-console-types-string" path = "../../../console/types/string" -version = "=0.16.18" +version = "=0.16.19" optional = true [dependencies.snarkvm-circuit-environment] path = "../../environment" -version = "=0.16.18" +version = "=0.16.19" [dependencies.snarkvm-circuit-types-boolean] path = "../boolean" -version = "=0.16.18" +version = "=0.16.19" [dependencies.snarkvm-circuit-types-field] path = "../field" -version = "=0.16.18" +version = "=0.16.19" [dependencies.snarkvm-circuit-types-integers] path = "../integers" -version = "=0.16.18" +version = "=0.16.19" [dev-dependencies.snarkvm-utilities] path = "../../../utilities" diff --git a/console/Cargo.toml b/console/Cargo.toml index 3a16df2e95..f3f029f135 100644 --- a/console/Cargo.toml +++ b/console/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-console" -version = "0.16.18" +version = "0.16.19" authors = [ "The Aleo Team " ] description = "Console environment for a decentralized virtual machine" license = "Apache-2.0" @@ -8,32 +8,32 @@ edition = "2021" [dependencies.snarkvm-console-account] path = "./account" -version = "=0.16.18" +version = "=0.16.19" optional = true [dependencies.snarkvm-console-algorithms] path = "./algorithms" -version = "=0.16.18" +version = "=0.16.19" optional = true [dependencies.snarkvm-console-collections] path = "./collections" -version = "=0.16.18" +version = "=0.16.19" optional = true [dependencies.snarkvm-console-network] path = "./network" -version = "=0.16.18" +version = "=0.16.19" optional = true [dependencies.snarkvm-console-program] path = "./program" -version = "=0.16.18" +version = "=0.16.19" optional = true [dependencies.snarkvm-console-types] path = "./types" -version = "=0.16.18" +version = "=0.16.19" optional = true [features] diff --git a/console/account/Cargo.toml b/console/account/Cargo.toml index c272bdf469..568551104a 100644 --- a/console/account/Cargo.toml +++ b/console/account/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-console-account" -version = "0.16.18" +version = "0.16.19" authors = [ "The Aleo Team " ] description = "Account operations for a decentralized virtual machine" license = "Apache-2.0" @@ -13,11 +13,11 @@ harness = false [dependencies.snarkvm-console-network] path = "../network" -version = "=0.16.18" +version = "=0.16.19" [dependencies.snarkvm-console-types] path = "../types" -version = "=0.16.18" +version = "=0.16.19" default-features = false features = [ "address", "boolean", "field", "group", "scalar" ] diff --git a/console/algorithms/Cargo.toml b/console/algorithms/Cargo.toml index b64095593a..575d0c8173 100644 --- a/console/algorithms/Cargo.toml +++ b/console/algorithms/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-console-algorithms" -version = "0.16.18" +version = "0.16.19" authors = [ "The Aleo Team " ] description = "Console algorithms for a decentralized virtual machine" license = "Apache-2.0" @@ -23,18 +23,18 @@ harness = false [dependencies.snarkvm-console-types] path = "../types" -version = "=0.16.18" +version = "=0.16.19" default-features = false features = [ "field", "group", "integers", "scalar" ] [dependencies.snarkvm-fields] path = "../../fields" -version = "=0.16.18" +version = "=0.16.19" default-features = false [dependencies.snarkvm-utilities] path = "../../utilities" -version = "=0.16.18" +version = "=0.16.19" [dependencies.blake2s_simd] version = "1.0" diff --git a/console/collections/Cargo.toml b/console/collections/Cargo.toml index 1bf72fb0d5..c853649f27 100644 --- a/console/collections/Cargo.toml +++ b/console/collections/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-console-collections" -version = "0.16.18" +version = "0.16.19" authors = [ "The Aleo Team " ] description = "Collections for a decentralized virtual machine" license = "Apache-2.0" @@ -18,11 +18,11 @@ harness = false [dependencies.snarkvm-console-algorithms] path = "../algorithms" -version = "=0.16.18" +version = "=0.16.19" [dependencies.snarkvm-console-types] path = "../types" -version = "=0.16.18" +version = "=0.16.19" default-features = false features = [ "field", "integers" ] diff --git a/console/network/Cargo.toml b/console/network/Cargo.toml index 0325d113a0..5ea82ad718 100644 --- a/console/network/Cargo.toml +++ b/console/network/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-console-network" -version = "0.16.18" +version = "0.16.19" authors = [ "The Aleo Team " ] description = "Network console library for a decentralized virtual machine" license = "Apache-2.0" @@ -15,45 +15,45 @@ wasm = [ [dependencies.snarkvm-algorithms] path = "../../algorithms" -version = "=0.16.18" +version = "=0.16.19" default-features = false features = [ "snark" ] [dependencies.snarkvm-console-algorithms] path = "../algorithms" -version = "=0.16.18" +version = "=0.16.19" [dependencies.snarkvm-console-collections] path = "../collections" -version = "=0.16.18" +version = "=0.16.19" [dependencies.snarkvm-console-network-environment] path = "./environment" -version = "=0.16.18" +version = "=0.16.19" [dependencies.snarkvm-console-types] path = "../types" -version = "=0.16.18" +version = "=0.16.19" default-features = false features = [ "field", "group", "scalar" ] [dependencies.snarkvm-curves] path = "../../curves" -version = "=0.16.18" +version = "=0.16.19" default-features = false [dependencies.snarkvm-fields] path = "../../fields" -version = "=0.16.18" +version = "=0.16.19" default-features = false [dependencies.snarkvm-parameters] path = "../../parameters" -version = "=0.16.18" +version = "=0.16.19" [dependencies.snarkvm-utilities] path = "../../utilities" -version = "=0.16.18" +version = "=0.16.19" [dependencies.anyhow] version = "1.0.73" diff --git a/console/network/environment/Cargo.toml b/console/network/environment/Cargo.toml index 941f28b8ab..63b459700f 100644 --- a/console/network/environment/Cargo.toml +++ b/console/network/environment/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-console-network-environment" -version = "0.16.18" +version = "0.16.19" authors = [ "The Aleo Team " ] description = "Environment console library for a decentralized virtual machine" license = "Apache-2.0" @@ -8,17 +8,17 @@ edition = "2021" [dependencies.snarkvm-curves] path = "../../../curves" -version = "=0.16.18" +version = "=0.16.19" default-features = false [dependencies.snarkvm-fields] path = "../../../fields" -version = "=0.16.18" +version = "=0.16.19" default-features = false [dependencies.snarkvm-utilities] path = "../../../utilities" -version = "=0.16.18" +version = "=0.16.19" [dependencies.anyhow] version = "1.0.73" diff --git a/console/program/Cargo.toml b/console/program/Cargo.toml index c1d34522c1..23df63249a 100644 --- a/console/program/Cargo.toml +++ b/console/program/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-console-program" -version = "0.16.18" +version = "0.16.19" authors = [ "The Aleo Team " ] description = "Program operations for a decentralized virtual machine" license = "Apache-2.0" @@ -12,27 +12,27 @@ test = [ ] [dependencies.snarkvm-console-account] path = "../account" -version = "=0.16.18" +version = "=0.16.19" [dependencies.snarkvm-console-algorithms] path = "../algorithms" -version = "=0.16.18" +version = "=0.16.19" [dependencies.snarkvm-console-collections] path = "../collections" -version = "=0.16.18" +version = "=0.16.19" [dependencies.snarkvm-console-network] path = "../network" -version = "=0.16.18" +version = "=0.16.19" [dependencies.snarkvm-console-types] path = "../types" -version = "=0.16.18" +version = "=0.16.19" [dependencies.snarkvm-utilities] path = "../../utilities" -version = "=0.16.18" +version = "=0.16.19" [dependencies.enum_index] version = "0.2" diff --git a/console/types/Cargo.toml b/console/types/Cargo.toml index 3b91e1dcc7..f2b0d934ed 100644 --- a/console/types/Cargo.toml +++ b/console/types/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-console-types" -version = "0.16.18" +version = "0.16.19" authors = [ "The Aleo Team " ] description = "Console types for a decentralized virtual machine" license = "Apache-2.0" @@ -13,41 +13,41 @@ harness = false [dependencies.snarkvm-console-network-environment] path = "../network/environment" -version = "=0.16.18" +version = "=0.16.19" [dependencies.snarkvm-console-types-address] path = "./address" -version = "=0.16.18" +version = "=0.16.19" optional = true [dependencies.snarkvm-console-types-boolean] path = "./boolean" -version = "=0.16.18" +version = "=0.16.19" optional = true [dependencies.snarkvm-console-types-field] path = "./field" -version = "=0.16.18" +version = "=0.16.19" optional = true [dependencies.snarkvm-console-types-group] path = "./group" -version = "=0.16.18" +version = "=0.16.19" optional = true [dependencies.snarkvm-console-types-integers] path = "./integers" -version = "=0.16.18" +version = "=0.16.19" optional = true [dependencies.snarkvm-console-types-scalar] path = "./scalar" -version = "=0.16.18" +version = "=0.16.19" optional = true [dependencies.snarkvm-console-types-string] path = "./string" -version = "=0.16.18" +version = "=0.16.19" optional = true [dev-dependencies.criterion] diff --git a/console/types/address/Cargo.toml b/console/types/address/Cargo.toml index c2770c967e..92fa744b6d 100644 --- a/console/types/address/Cargo.toml +++ b/console/types/address/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-console-types-address" -version = "0.16.18" +version = "0.16.19" authors = [ "The Aleo Team " ] description = "Type operations for a decentralized virtual machine" license = "Apache-2.0" @@ -8,19 +8,19 @@ edition = "2021" [dependencies.snarkvm-console-network-environment] path = "../../network/environment" -version = "=0.16.18" +version = "=0.16.19" [dependencies.snarkvm-console-types-boolean] path = "../boolean" -version = "=0.16.18" +version = "=0.16.19" [dependencies.snarkvm-console-types-field] path = "../field" -version = "=0.16.18" +version = "=0.16.19" [dependencies.snarkvm-console-types-group] path = "../group" -version = "=0.16.18" +version = "=0.16.19" [dev-dependencies.bincode] version = "1.3" diff --git a/console/types/boolean/Cargo.toml b/console/types/boolean/Cargo.toml index f5f3e0a34d..7403db92e6 100644 --- a/console/types/boolean/Cargo.toml +++ b/console/types/boolean/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-console-types-boolean" -version = "0.16.18" +version = "0.16.19" authors = [ "The Aleo Team " ] description = "Type operations for a decentralized virtual machine" license = "Apache-2.0" @@ -8,7 +8,7 @@ edition = "2021" [dependencies.snarkvm-console-network-environment] path = "../../network/environment" -version = "=0.16.18" +version = "=0.16.19" [dev-dependencies.bincode] version = "1.3" diff --git a/console/types/field/Cargo.toml b/console/types/field/Cargo.toml index 2cea1f5697..c8be7daf1d 100644 --- a/console/types/field/Cargo.toml +++ b/console/types/field/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-console-types-field" -version = "0.16.18" +version = "0.16.19" authors = [ "The Aleo Team " ] description = "Type operations for a decentralized virtual machine" license = "Apache-2.0" @@ -8,11 +8,11 @@ edition = "2021" [dependencies.snarkvm-console-network-environment] path = "../../network/environment" -version = "=0.16.18" +version = "=0.16.19" [dependencies.snarkvm-console-types-boolean] path = "../boolean" -version = "=0.16.18" +version = "=0.16.19" [dependencies.zeroize] version = "1" diff --git a/console/types/group/Cargo.toml b/console/types/group/Cargo.toml index eb3ca891a3..fd4bfc7611 100644 --- a/console/types/group/Cargo.toml +++ b/console/types/group/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-console-types-group" -version = "0.16.18" +version = "0.16.19" authors = [ "The Aleo Team " ] description = "Type operations for a decentralized virtual machine" license = "Apache-2.0" @@ -8,19 +8,19 @@ edition = "2021" [dependencies.snarkvm-console-network-environment] path = "../../network/environment" -version = "=0.16.18" +version = "=0.16.19" [dependencies.snarkvm-console-types-boolean] path = "../boolean" -version = "=0.16.18" +version = "=0.16.19" [dependencies.snarkvm-console-types-field] path = "../field" -version = "=0.16.18" +version = "=0.16.19" [dependencies.snarkvm-console-types-scalar] path = "../scalar" -version = "=0.16.18" +version = "=0.16.19" [dev-dependencies.bincode] version = "1.3" diff --git a/console/types/integers/Cargo.toml b/console/types/integers/Cargo.toml index 3ae75686d7..1da2502c68 100644 --- a/console/types/integers/Cargo.toml +++ b/console/types/integers/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-console-types-integers" -version = "0.16.18" +version = "0.16.19" authors = [ "The Aleo Team " ] description = "Type operations for a decentralized virtual machine" license = "Apache-2.0" @@ -8,19 +8,19 @@ edition = "2021" [dependencies.snarkvm-console-network-environment] path = "../../network/environment" -version = "=0.16.18" +version = "=0.16.19" [dependencies.snarkvm-console-types-boolean] path = "../boolean" -version = "=0.16.18" +version = "=0.16.19" [dependencies.snarkvm-console-types-field] path = "../field" -version = "=0.16.18" +version = "=0.16.19" [dependencies.snarkvm-console-types-scalar] path = "../scalar" -version = "=0.16.18" +version = "=0.16.19" [dev-dependencies.bincode] version = "1.3" diff --git a/console/types/scalar/Cargo.toml b/console/types/scalar/Cargo.toml index cc3e09c618..944a20d5d4 100644 --- a/console/types/scalar/Cargo.toml +++ b/console/types/scalar/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-console-types-scalar" -version = "0.16.18" +version = "0.16.19" authors = [ "The Aleo Team " ] description = "Type operations for a decentralized virtual machine" license = "Apache-2.0" @@ -8,15 +8,15 @@ edition = "2021" [dependencies.snarkvm-console-network-environment] path = "../../network/environment" -version = "=0.16.18" +version = "=0.16.19" [dependencies.snarkvm-console-types-boolean] path = "../boolean" -version = "=0.16.18" +version = "=0.16.19" [dependencies.snarkvm-console-types-field] path = "../field" -version = "=0.16.18" +version = "=0.16.19" [dependencies.zeroize] version = "1" diff --git a/console/types/string/Cargo.toml b/console/types/string/Cargo.toml index aaab7be9a9..aea2da4af3 100644 --- a/console/types/string/Cargo.toml +++ b/console/types/string/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-console-types-string" -version = "0.16.18" +version = "0.16.19" authors = [ "The Aleo Team " ] description = "Type operations for a decentralized virtual machine" license = "Apache-2.0" @@ -8,19 +8,19 @@ edition = "2021" [dependencies.snarkvm-console-network-environment] path = "../../network/environment" -version = "=0.16.18" +version = "=0.16.19" [dependencies.snarkvm-console-types-boolean] path = "../boolean" -version = "=0.16.18" +version = "=0.16.19" [dependencies.snarkvm-console-types-field] path = "../field" -version = "=0.16.18" +version = "=0.16.19" [dependencies.snarkvm-console-types-integers] path = "../integers" -version = "=0.16.18" +version = "=0.16.19" [dev-dependencies.bincode] version = "1.3" diff --git a/curves/Cargo.toml b/curves/Cargo.toml index f6d9a3a62d..8d4c7c3dd0 100644 --- a/curves/Cargo.toml +++ b/curves/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-curves" -version = "0.16.18" +version = "0.16.19" authors = [ "The Aleo Team " ] description = "Curves for a decentralized virtual machine" homepage = "https://aleo.org" @@ -36,12 +36,12 @@ harness = false [dependencies.snarkvm-fields] path = "../fields" -version = "=0.16.18" +version = "=0.16.19" default-features = false [dependencies.snarkvm-utilities] path = "../utilities" -version = "=0.16.18" +version = "=0.16.19" default-features = false [dependencies.rand] diff --git a/fields/Cargo.toml b/fields/Cargo.toml index 37440ec746..df9474d09e 100644 --- a/fields/Cargo.toml +++ b/fields/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-fields" -version = "0.16.18" +version = "0.16.19" authors = [ "The Aleo Team " ] description = "Fields for a decentralized virtual machine" homepage = "https://aleo.org" @@ -30,7 +30,7 @@ harness = false [dependencies.snarkvm-utilities] path = "../utilities" -version = "=0.16.18" +version = "=0.16.19" default-features = false [dependencies.aleo-std] @@ -70,7 +70,6 @@ version = "0.5" [dev-dependencies.snarkvm-curves] path = "../curves" -version = "=0.16.18" default-features = false [features] diff --git a/ledger/Cargo.toml b/ledger/Cargo.toml index e73022bcb3..6451d7b364 100644 --- a/ledger/Cargo.toml +++ b/ledger/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-ledger" -version = "0.16.18" +version = "0.16.19" authors = [ "The Aleo Team " ] description = "A node ledger for a decentralized virtual machine" homepage = "https://aleo.org" @@ -57,54 +57,54 @@ timer = [ "aleo-std/timer" ] [dependencies.console] package = "snarkvm-console" path = "../console" -version = "=0.16.18" +version = "=0.16.19" [dependencies.ledger-authority] package = "snarkvm-ledger-authority" path = "./authority" -version = "=0.16.18" +version = "=0.16.19" [dependencies.ledger-block] package = "snarkvm-ledger-block" path = "./block" -version = "=0.16.18" +version = "=0.16.19" [dependencies.ledger-coinbase] package = "snarkvm-ledger-coinbase" path = "./coinbase" -version = "=0.16.18" +version = "=0.16.19" [dependencies.ledger-committee] package = "snarkvm-ledger-committee" path = "./committee" -version = "=0.16.18" +version = "=0.16.19" [dependencies.ledger-narwhal] package = "snarkvm-ledger-narwhal" path = "./narwhal" -version = "=0.16.18" +version = "=0.16.19" [dependencies.ledger-query] package = "snarkvm-ledger-query" path = "./query" -version = "=0.16.18" +version = "=0.16.19" features = [ "query" ] [dependencies.ledger-store] package = "snarkvm-ledger-store" path = "./store" -version = "=0.16.18" +version = "=0.16.19" [dependencies.ledger-test-helpers] package = "snarkvm-ledger-test-helpers" path = "./test-helpers" -version = "=0.16.18" +version = "=0.16.19" optional = true [dependencies.synthesizer] package = "snarkvm-synthesizer" path = "../synthesizer" -version = "=0.16.18" +version = "=0.16.19" [dependencies.aleo-std] version = "0.1.24" diff --git a/ledger/authority/Cargo.toml b/ledger/authority/Cargo.toml index bb72df314b..bf1ce00d77 100644 --- a/ledger/authority/Cargo.toml +++ b/ledger/authority/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-ledger-authority" -version = "0.16.18" +version = "0.16.19" authors = [ "The Aleo Team " ] description = "Data structures for a block authority in a decentralized virtual machine" homepage = "https://aleo.org" @@ -32,12 +32,12 @@ test-helpers = [ "narwhal-subdag/test-helpers" ] [dependencies.console] package = "snarkvm-console" path = "../../console" -version = "=0.16.18" +version = "=0.16.19" [dependencies.narwhal-subdag] package = "snarkvm-ledger-narwhal-subdag" path = "../narwhal/subdag" -version = "=0.16.18" +version = "=0.16.19" [dependencies.anyhow] version = "1" diff --git a/ledger/block/Cargo.toml b/ledger/block/Cargo.toml index 2199c907fc..7174c09fbc 100644 --- a/ledger/block/Cargo.toml +++ b/ledger/block/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-ledger-block" -version = "0.16.18" +version = "0.16.19" authors = [ "The Aleo Team " ] description = "A block for a decentralized virtual machine" homepage = "https://aleo.org" @@ -39,47 +39,47 @@ test = [ ] [dependencies.console] package = "snarkvm-console" path = "../../console" -version = "=0.16.18" +version = "=0.16.19" [dependencies.ledger-authority] package = "snarkvm-ledger-authority" path = "../authority" -version = "=0.16.18" +version = "=0.16.19" [dependencies.ledger-coinbase] package = "snarkvm-ledger-coinbase" path = "../../ledger/coinbase" -version = "=0.16.18" +version = "=0.16.19" [dependencies.ledger-committee] package = "snarkvm-ledger-committee" path = "../../ledger/committee" -version = "=0.16.18" +version = "=0.16.19" [dependencies.ledger-narwhal-batch-header] package = "snarkvm-ledger-narwhal-batch-header" path = "../narwhal/batch-header" -version = "=0.16.18" +version = "=0.16.19" [dependencies.ledger-narwhal-subdag] package = "snarkvm-ledger-narwhal-subdag" path = "../narwhal/subdag" -version = "=0.16.18" +version = "=0.16.19" [dependencies.ledger-narwhal-transmission-id] package = "snarkvm-ledger-narwhal-transmission-id" path = "../narwhal/transmission-id" -version = "=0.16.18" +version = "=0.16.19" [dependencies.synthesizer-program] package = "snarkvm-synthesizer-program" path = "../../synthesizer/program" -version = "=0.16.18" +version = "=0.16.19" [dependencies.synthesizer-snark] package = "snarkvm-synthesizer-snark" path = "../../synthesizer/snark" -version = "=0.16.18" +version = "=0.16.19" [dependencies.indexmap] version = "2.0" diff --git a/ledger/coinbase/Cargo.toml b/ledger/coinbase/Cargo.toml index 4b7fd4bc64..dbb5b6ce3f 100644 --- a/ledger/coinbase/Cargo.toml +++ b/ledger/coinbase/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-ledger-coinbase" -version = "0.16.18" +version = "0.16.19" authors = [ "The Aleo Team " ] description = "Coinbase puzzle for a decentralized virtual machine" homepage = "https://aleo.org" @@ -50,27 +50,27 @@ wasm = [ [dependencies.console] package = "snarkvm-console" path = "../../console" -version = "=0.16.18" +version = "=0.16.19" [dependencies.snarkvm-algorithms] path = "../../algorithms" -version = "=0.16.18" +version = "=0.16.19" [dependencies.snarkvm-curves] path = "../../curves" -version = "=0.16.18" +version = "=0.16.19" [dependencies.snarkvm-fields] path = "../../fields" -version = "=0.16.18" +version = "=0.16.19" [dependencies.snarkvm-synthesizer-snark] path = "../../synthesizer/snark" -version = "=0.16.18" +version = "=0.16.19" [dependencies.snarkvm-utilities] path = "../../utilities" -version = "=0.16.18" +version = "=0.16.19" default-features = false [dependencies.aleo-std] diff --git a/ledger/committee/Cargo.toml b/ledger/committee/Cargo.toml index aa3226d74b..787714e5ac 100644 --- a/ledger/committee/Cargo.toml +++ b/ledger/committee/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-ledger-committee" -version = "0.16.18" +version = "0.16.19" authors = [ "The Aleo Team " ] description = "A committee for a decentralized virtual machine" homepage = "https://aleo.org" @@ -34,7 +34,7 @@ test-helpers = [ "prop-tests", "rand_distr" ] [dependencies.console] package = "snarkvm-console" path = "../../console" -version = "=0.16.18" +version = "=0.16.19" [dependencies.indexmap] version = "2.0" @@ -43,7 +43,7 @@ features = [ "serde", "rayon" ] [dependencies.metrics] package = "snarkvm-metrics" path = "../../metrics" -version = "=0.16.18" +version = "=0.16.19" optional = true [dependencies.serde_json] diff --git a/ledger/narwhal/Cargo.toml b/ledger/narwhal/Cargo.toml index e6b309c77e..f1b5238232 100644 --- a/ledger/narwhal/Cargo.toml +++ b/ledger/narwhal/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-ledger-narwhal" -version = "0.16.18" +version = "0.16.19" authors = [ "The Aleo Team " ] description = "Data structures for a Narwhal-style memory pool in a decentralized virtual machine" homepage = "https://aleo.org" @@ -64,37 +64,37 @@ transmission-id = [ "narwhal-transmission-id" ] [dependencies.narwhal-batch-certificate] package = "snarkvm-ledger-narwhal-batch-certificate" path = "./batch-certificate" -version = "=0.16.18" +version = "=0.16.19" optional = true [dependencies.narwhal-batch-header] package = "snarkvm-ledger-narwhal-batch-header" path = "./batch-header" -version = "=0.16.18" +version = "=0.16.19" optional = true [dependencies.narwhal-data] package = "snarkvm-ledger-narwhal-data" path = "./data" -version = "=0.16.18" +version = "=0.16.19" optional = true [dependencies.narwhal-subdag] package = "snarkvm-ledger-narwhal-subdag" path = "./subdag" -version = "=0.16.18" +version = "=0.16.19" optional = true [dependencies.narwhal-transmission] package = "snarkvm-ledger-narwhal-transmission" path = "./transmission" -version = "=0.16.18" +version = "=0.16.19" optional = true [dependencies.narwhal-transmission-id] package = "snarkvm-ledger-narwhal-transmission-id" path = "./transmission-id" -version = "=0.16.18" +version = "=0.16.19" optional = true [dev-dependencies.snarkvm-ledger-narwhal] diff --git a/ledger/narwhal/batch-certificate/Cargo.toml b/ledger/narwhal/batch-certificate/Cargo.toml index 45f793a39c..63d18a6237 100644 --- a/ledger/narwhal/batch-certificate/Cargo.toml +++ b/ledger/narwhal/batch-certificate/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-ledger-narwhal-batch-certificate" -version = "0.16.18" +version = "0.16.19" authors = [ "The Aleo Team " ] description = "A batch certificate for a Narwhal-style memory pool in a decentralized virtual machine" homepage = "https://aleo.org" @@ -32,17 +32,17 @@ test-helpers = [ "narwhal-batch-header/test-helpers" ] [dependencies.console] package = "snarkvm-console" path = "../../../console" -version = "=0.16.18" +version = "=0.16.19" [dependencies.narwhal-batch-header] package = "snarkvm-ledger-narwhal-batch-header" path = "../batch-header" -version = "=0.16.18" +version = "=0.16.19" [dependencies.narwhal-transmission-id] package = "snarkvm-ledger-narwhal-transmission-id" path = "../transmission-id" -version = "=0.16.18" +version = "=0.16.19" [dependencies.indexmap] version = "2.0" diff --git a/ledger/narwhal/batch-header/Cargo.toml b/ledger/narwhal/batch-header/Cargo.toml index 17a0219208..8ec3fd22cd 100644 --- a/ledger/narwhal/batch-header/Cargo.toml +++ b/ledger/narwhal/batch-header/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-ledger-narwhal-batch-header" -version = "0.16.18" +version = "0.16.19" authors = [ "The Aleo Team " ] description = "A batch header for a Narwhal-style memory pool in a decentralized virtual machine" homepage = "https://aleo.org" @@ -32,12 +32,12 @@ test-helpers = [ "narwhal-transmission-id/test-helpers", "time" ] [dependencies.console] package = "snarkvm-console" path = "../../../console" -version = "=0.16.18" +version = "=0.16.19" [dependencies.narwhal-transmission-id] package = "snarkvm-ledger-narwhal-transmission-id" path = "../transmission-id" -version = "=0.16.18" +version = "=0.16.19" [dependencies.indexmap] version = "2.0" diff --git a/ledger/narwhal/data/Cargo.toml b/ledger/narwhal/data/Cargo.toml index dfe23281dd..a8172b12d9 100644 --- a/ledger/narwhal/data/Cargo.toml +++ b/ledger/narwhal/data/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-ledger-narwhal-data" -version = "0.16.18" +version = "0.16.19" authors = [ "The Aleo Team " ] description = "A batch certificate for a Narwhal-style memory pool in a decentralized virtual machine" homepage = "https://aleo.org" @@ -29,7 +29,7 @@ async = [ "tokio" ] [dependencies.console] package = "snarkvm-console" path = "../../../console" -version = "=0.16.18" +version = "=0.16.19" [dependencies.bytes] version = "1" diff --git a/ledger/narwhal/subdag/Cargo.toml b/ledger/narwhal/subdag/Cargo.toml index 1bb9144660..1f0191d3c9 100644 --- a/ledger/narwhal/subdag/Cargo.toml +++ b/ledger/narwhal/subdag/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-ledger-narwhal-subdag" -version = "0.16.18" +version = "0.16.19" authors = [ "The Aleo Team " ] description = "A subdag for a Narwhal-style memory pool in a decentralized virtual machine" homepage = "https://aleo.org" @@ -32,22 +32,22 @@ test-helpers = [ "narwhal-batch-certificate/test-helpers" ] [dependencies.console] package = "snarkvm-console" path = "../../../console" -version = "=0.16.18" +version = "=0.16.19" [dependencies.narwhal-batch-certificate] package = "snarkvm-ledger-narwhal-batch-certificate" path = "../batch-certificate" -version = "=0.16.18" +version = "=0.16.19" [dependencies.narwhal-batch-header] package = "snarkvm-ledger-narwhal-batch-header" path = "../batch-header" -version = "=0.16.18" +version = "=0.16.19" [dependencies.narwhal-transmission-id] package = "snarkvm-ledger-narwhal-transmission-id" path = "../transmission-id" -version = "=0.16.18" +version = "=0.16.19" [dependencies.indexmap] version = "2.0" diff --git a/ledger/narwhal/transmission-id/Cargo.toml b/ledger/narwhal/transmission-id/Cargo.toml index 0ee14e6901..9ab29797eb 100644 --- a/ledger/narwhal/transmission-id/Cargo.toml +++ b/ledger/narwhal/transmission-id/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-ledger-narwhal-transmission-id" -version = "0.16.18" +version = "0.16.19" authors = [ "The Aleo Team " ] description = "A transmission ID for a Narwhal-style memory pool in a decentralized virtual machine" homepage = "https://aleo.org" @@ -32,12 +32,12 @@ test-helpers = [ ] [dependencies.console] package = "snarkvm-console" path = "../../../console" -version = "=0.16.18" +version = "=0.16.19" [dependencies.ledger-coinbase] package = "snarkvm-ledger-coinbase" path = "../../coinbase" -version = "=0.16.18" +version = "=0.16.19" [dev-dependencies.bincode] version = "1.3" diff --git a/ledger/narwhal/transmission/Cargo.toml b/ledger/narwhal/transmission/Cargo.toml index 11f9ef959e..c209403679 100644 --- a/ledger/narwhal/transmission/Cargo.toml +++ b/ledger/narwhal/transmission/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-ledger-narwhal-transmission" -version = "0.16.18" +version = "0.16.19" authors = [ "The Aleo Team " ] description = "A transmission for a Narwhal-style memory pool in a decentralized virtual machine" homepage = "https://aleo.org" @@ -32,22 +32,22 @@ test-helpers = [ ] [dependencies.console] package = "snarkvm-console" path = "../../../console" -version = "=0.16.18" +version = "=0.16.19" [dependencies.ledger-block] package = "snarkvm-ledger-block" path = "../../block" -version = "=0.16.18" +version = "=0.16.19" [dependencies.ledger-coinbase] package = "snarkvm-ledger-coinbase" path = "../../coinbase" -version = "=0.16.18" +version = "=0.16.19" [dependencies.ledger-narwhal-data] package = "snarkvm-ledger-narwhal-data" path = "../data" -version = "=0.16.18" +version = "=0.16.19" [dependencies.bytes] version = "1" diff --git a/ledger/query/Cargo.toml b/ledger/query/Cargo.toml index 37aa050cff..979555c7e4 100644 --- a/ledger/query/Cargo.toml +++ b/ledger/query/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-ledger-query" -version = "0.16.18" +version = "0.16.19" authors = [ "The Aleo Team " ] description = "A query for a decentralized virtual machine" homepage = "https://aleo.org" @@ -34,18 +34,18 @@ query = [ "ledger-store", "synthesizer-program", "ureq" ] [dependencies.console] package = "snarkvm-console" path = "../../console" -version = "=0.16.18" +version = "=0.16.19" [dependencies.ledger-store] package = "snarkvm-ledger-store" path = "../store" -version = "=0.16.18" +version = "=0.16.19" optional = true [dependencies.synthesizer-program] package = "snarkvm-synthesizer-program" path = "../../synthesizer/program" -version = "=0.16.18" +version = "=0.16.19" optional = true [dependencies.async-trait] diff --git a/ledger/store/Cargo.toml b/ledger/store/Cargo.toml index 50c50d1635..2491a5ae1b 100644 --- a/ledger/store/Cargo.toml +++ b/ledger/store/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-ledger-store" -version = "0.16.18" +version = "0.16.19" authors = [ "The Aleo Team " ] description = "A data store for a decentralized virtual machine" homepage = "https://aleo.org" @@ -42,42 +42,42 @@ test = [ ] [dependencies.console] package = "snarkvm-console" path = "../../console" -version = "=0.16.18" +version = "=0.16.19" [dependencies.ledger-authority] package = "snarkvm-ledger-authority" path = "../authority" -version = "=0.16.18" +version = "=0.16.19" [dependencies.ledger-block] package = "snarkvm-ledger-block" path = "../block" -version = "=0.16.18" +version = "=0.16.19" [dependencies.ledger-coinbase] package = "snarkvm-ledger-coinbase" path = "../coinbase" -version = "=0.16.18" +version = "=0.16.19" [dependencies.ledger-committee] package = "snarkvm-ledger-committee" path = "../committee" -version = "=0.16.18" +version = "=0.16.19" [dependencies.ledger-narwhal-batch-certificate] package = "snarkvm-ledger-narwhal-batch-certificate" path = "../narwhal/batch-certificate" -version = "=0.16.18" +version = "=0.16.19" [dependencies.synthesizer-program] package = "snarkvm-synthesizer-program" path = "../../synthesizer/program" -version = "=0.16.18" +version = "=0.16.19" [dependencies.synthesizer-snark] package = "snarkvm-synthesizer-snark" path = "../../synthesizer/snark" -version = "=0.16.18" +version = "=0.16.19" [dependencies.aleo-std-storage] version = "0.1.7" diff --git a/ledger/test-helpers/Cargo.toml b/ledger/test-helpers/Cargo.toml index a529d1519f..eba63ce2ee 100644 --- a/ledger/test-helpers/Cargo.toml +++ b/ledger/test-helpers/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-ledger-test-helpers" -version = "0.16.18" +version = "0.16.19" authors = [ "The Aleo Team " ] description = "Test helpers for a decentralized virtual machine" homepage = "https://aleo.org" @@ -19,39 +19,39 @@ edition = "2021" [dependencies.console] package = "snarkvm-console" path = "../../console" -version = "=0.16.18" +version = "=0.16.19" [dependencies.circuit] package = "snarkvm-circuit" path = "../../circuit" -version = "=0.16.18" +version = "=0.16.19" [dependencies.ledger-block] package = "snarkvm-ledger-block" path = "../block" -version = "=0.16.18" +version = "=0.16.19" [dependencies.ledger-query] package = "snarkvm-ledger-query" path = "../query" -version = "=0.16.18" +version = "=0.16.19" default-features = false features = [ "query" ] [dependencies.ledger-store] package = "snarkvm-ledger-store" path = "../store" -version = "=0.16.18" +version = "=0.16.19" [dependencies.synthesizer-program] package = "snarkvm-synthesizer-program" path = "../../synthesizer/program" -version = "=0.16.18" +version = "=0.16.19" [dependencies.synthesizer-process] package = "snarkvm-synthesizer-process" path = "../../synthesizer/process" -version = "=0.16.18" +version = "=0.16.19" [dependencies.once_cell] version = "1.18" diff --git a/metrics/Cargo.toml b/metrics/Cargo.toml index 25b5135568..457d43f039 100644 --- a/metrics/Cargo.toml +++ b/metrics/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-metrics" -version = "0.16.18" +version = "0.16.19" authors = [ "The Aleo Team " ] description = "Metrics for a decentralized virtual machine" homepage = "https://aleo.org" diff --git a/parameters/Cargo.toml b/parameters/Cargo.toml index d3e9644721..d735149b19 100644 --- a/parameters/Cargo.toml +++ b/parameters/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-parameters" -version = "0.16.18" +version = "0.16.19" authors = [ "The Aleo Team " ] description = "Parameters for a decentralized virtual machine" homepage = "https://aleo.org" @@ -31,12 +31,12 @@ wasm = [ "encoding", "js-sys", "web-sys" ] [dependencies.snarkvm-curves] path = "../curves" -version = "=0.16.18" +version = "=0.16.19" default-features = false [dependencies.snarkvm-utilities] path = "../utilities" -version = "=0.16.18" +version = "=0.16.19" [dependencies.aleo-std] version = "0.1.24" diff --git a/synthesizer/Cargo.toml b/synthesizer/Cargo.toml index 37ea325dd3..4371953852 100644 --- a/synthesizer/Cargo.toml +++ b/synthesizer/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-synthesizer" -version = "0.16.18" +version = "0.16.19" authors = [ "The Aleo Team " ] description = "Synthesizer for a decentralized virtual machine" homepage = "https://aleo.org" @@ -69,61 +69,61 @@ harness = false [dependencies.algorithms] package = "snarkvm-algorithms" path = "../algorithms" -version = "=0.16.18" +version = "=0.16.19" [dependencies.circuit] package = "snarkvm-circuit" path = "../circuit" -version = "=0.16.18" +version = "=0.16.19" [dependencies.console] package = "snarkvm-console" path = "../console" -version = "=0.16.18" +version = "=0.16.19" [dependencies.ledger-block] package = "snarkvm-ledger-block" path = "../ledger/block" -version = "=0.16.18" +version = "=0.16.19" [dependencies.ledger-coinbase] package = "snarkvm-ledger-coinbase" path = "../ledger/coinbase" -version = "=0.16.18" +version = "=0.16.19" [dependencies.ledger-committee] package = "snarkvm-ledger-committee" path = "../ledger/committee" -version = "=0.16.18" +version = "=0.16.19" [dependencies.ledger-query] package = "snarkvm-ledger-query" path = "../ledger/query" -version = "=0.16.18" +version = "=0.16.19" default-features = false features = [ "query" ] [dependencies.ledger-store] package = "snarkvm-ledger-store" path = "../ledger/store" -version = "=0.16.18" +version = "=0.16.19" [dependencies.synthesizer-process] package = "snarkvm-synthesizer-process" path = "./process" -version = "=0.16.18" +version = "=0.16.19" optional = true [dependencies.synthesizer-program] package = "snarkvm-synthesizer-program" path = "./program" -version = "=0.16.18" +version = "=0.16.19" optional = true [dependencies.synthesizer-snark] package = "snarkvm-synthesizer-snark" path = "./snark" -version = "=0.16.18" +version = "=0.16.19" optional = true [dependencies.aleo-std] diff --git a/synthesizer/process/Cargo.toml b/synthesizer/process/Cargo.toml index 8c2ad697aa..86336cae5d 100644 --- a/synthesizer/process/Cargo.toml +++ b/synthesizer/process/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-synthesizer-process" -version = "0.16.18" +version = "0.16.19" authors = [ "The Aleo Team " ] description = "A process for a decentralized virtual machine" homepage = "https://aleo.org" @@ -48,45 +48,45 @@ timer = [ "aleo-std/timer" ] [dependencies.console] package = "snarkvm-console" path = "../../console" -version = "=0.16.18" +version = "=0.16.19" default-features = false features = [ "network", "program", "types" ] [dependencies.circuit] package = "snarkvm-circuit" path = "../../circuit" -version = "=0.16.18" +version = "=0.16.19" [dependencies.ledger-block] package = "snarkvm-ledger-block" path = "../../ledger/block" -version = "=0.16.18" +version = "=0.16.19" [dependencies.ledger-query] package = "snarkvm-ledger-query" path = "../../ledger/query" -version = "=0.16.18" +version = "=0.16.19" default-features = false [dependencies.ledger-store] package = "snarkvm-ledger-store" path = "../../ledger/store" -version = "=0.16.18" +version = "=0.16.19" [dependencies.synthesizer-program] package = "snarkvm-synthesizer-program" path = "../../synthesizer/program" -version = "=0.16.18" +version = "=0.16.19" [dependencies.synthesizer-snark] package = "snarkvm-synthesizer-snark" path = "../../synthesizer/snark" -version = "=0.16.18" +version = "=0.16.19" [dependencies.utilities] package = "snarkvm-utilities" path = "../../utilities" -version = "=0.16.18" +version = "=0.16.19" [dependencies.aleo-std] version = "0.1.24" diff --git a/synthesizer/program/Cargo.toml b/synthesizer/program/Cargo.toml index 0200a43c59..9c1515671c 100644 --- a/synthesizer/program/Cargo.toml +++ b/synthesizer/program/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-synthesizer-program" -version = "0.16.18" +version = "0.16.19" authors = [ "The Aleo Team " ] description = "Program for a decentralized virtual machine" homepage = "https://aleo.org" @@ -31,12 +31,12 @@ wasm = [ "console/wasm" ] [dependencies.circuit] package = "snarkvm-circuit" path = "../../circuit" -version = "=0.16.18" +version = "=0.16.19" [dependencies.console] package = "snarkvm-console" path = "../../console" -version = "=0.16.18" +version = "=0.16.19" default-features = false features = [ "account", "network", "program", "types" ] diff --git a/synthesizer/snark/Cargo.toml b/synthesizer/snark/Cargo.toml index 53af02e057..1d63ac19fb 100644 --- a/synthesizer/snark/Cargo.toml +++ b/synthesizer/snark/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-synthesizer-snark" -version = "0.16.18" +version = "0.16.19" authors = [ "The Aleo Team " ] description = "SNARK wrappers for a decentralized virtual machine" homepage = "https://aleo.org" @@ -33,18 +33,18 @@ wasm = [ "console/wasm", "snarkvm-algorithms/wasm" ] [dependencies.circuit] package = "snarkvm-circuit" path = "../../circuit" -version = "=0.16.18" +version = "=0.16.19" [dependencies.console] package = "snarkvm-console" path = "../../console" -version = "=0.16.18" +version = "=0.16.19" default-features = false features = [ "network" ] [dependencies.snarkvm-algorithms] path = "../../algorithms" -version = "=0.16.18" +version = "=0.16.19" [dependencies.bincode] version = "1" diff --git a/utilities/Cargo.toml b/utilities/Cargo.toml index da8900e645..0614b4f1f9 100644 --- a/utilities/Cargo.toml +++ b/utilities/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-utilities" -version = "0.16.18" +version = "0.16.19" authors = [ "The Aleo Team " ] description = "Utilities for a decentralized virtual machine" homepage = "https://aleo.org" @@ -25,7 +25,7 @@ edition = "2021" [dependencies.snarkvm-utilities-derives] path = "./derives" -version = "=0.16.18" +version = "=0.16.19" optional = true [dependencies.aleo-std] diff --git a/utilities/derives/Cargo.toml b/utilities/derives/Cargo.toml index 0f83e64c5f..560b7cfdff 100644 --- a/utilities/derives/Cargo.toml +++ b/utilities/derives/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-utilities-derives" -version = "0.16.18" +version = "0.16.19" authors = [ "The Aleo Team " ] description = "Canonical serialization for a decentralized virtual machine" homepage = "https://aleo.org" diff --git a/wasm/Cargo.toml b/wasm/Cargo.toml index 3e13327016..4183bbf38c 100644 --- a/wasm/Cargo.toml +++ b/wasm/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "snarkvm-wasm" -version = "0.16.18" +version = "0.16.19" authors = [ "The Aleo Team " ] description = "WASM for a decentralized virtual machine" homepage = "https://aleo.org" @@ -51,54 +51,54 @@ utilities = [ "snarkvm-utilities" ] [dependencies.snarkvm-circuit-network] path = "../circuit/network" -version = "=0.16.18" +version = "=0.16.19" features = [ "wasm" ] optional = true [dependencies.snarkvm-console] path = "../console" -version = "=0.16.18" +version = "=0.16.19" features = [ "wasm" ] optional = true [dependencies.snarkvm-curves] path = "../curves" -version = "=0.16.18" +version = "=0.16.19" optional = true [dependencies.snarkvm-fields] path = "../fields" -version = "=0.16.18" +version = "=0.16.19" optional = true [dependencies.snarkvm-ledger-block] path = "../ledger/block" -version = "=0.16.18" +version = "=0.16.19" features = [ "wasm" ] optional = true [dependencies.snarkvm-ledger-query] path = "../ledger/query" -version = "=0.16.18" +version = "=0.16.19" features = [ "async", "wasm" ] optional = true [dependencies.snarkvm-ledger-store] path = "../ledger/store" -version = "=0.16.18" +version = "=0.16.19" features = [ "wasm" ] optional = true [dependencies.snarkvm-synthesizer] path = "../synthesizer" -version = "=0.16.18" +version = "=0.16.19" default-features = false features = [ "async", "wasm" ] optional = true [dependencies.snarkvm-utilities] path = "../utilities" -version = "=0.16.18" +version = "=0.16.19" features = [ "wasm" ] optional = true From fa5f4250874203af80ebc461b0a3d659b3c32f04 Mon Sep 17 00:00:00 2001 From: Howard Wu <9260812+howardwu@users.noreply.github.com> Date: Sat, 10 Feb 2024 17:49:12 -0800 Subject: [PATCH 292/298] Updates Testnet3 to MainnetV0 --- .github/workflows/benchmarks.yml | 2 +- README.md | 2 +- .../src/polycommit/kzg10/data_structures.rs | 2 +- circuit/environment/src/circuit.rs | 8 +- circuit/network/src/v0.rs | 8 +- .../program/src/data/literal/cast/boolean.rs | 96 +- .../program/src/data/literal/cast/field.rs | 100 +- .../program/src/data/literal/cast/integer.rs | 984 +++++++------- .../program/src/data/literal/cast/scalar.rs | 100 +- .../src/data/literal/cast_lossy/boolean.rs | 111 +- .../src/data/literal/cast_lossy/field.rs | 115 +- .../src/data/literal/cast_lossy/integer.rs | 1194 ++++++++++------- .../src/data/literal/cast_lossy/scalar.rs | 118 +- console/account/benches/account.rs | 4 +- console/account/src/address/try_from.rs | 4 +- console/account/src/compute_key/bytes.rs | 4 +- console/account/src/compute_key/from_bits.rs | 4 +- console/account/src/compute_key/serialize.rs | 4 +- console/account/src/compute_key/to_address.rs | 4 +- console/account/src/compute_key/to_bits.rs | 4 +- console/account/src/compute_key/try_from.rs | 4 +- console/account/src/graph_key/bytes.rs | 4 +- console/account/src/graph_key/serialize.rs | 4 +- console/account/src/graph_key/string.rs | 4 +- console/account/src/graph_key/try_from.rs | 4 +- console/account/src/lib.rs | 4 +- console/account/src/private_key/bytes.rs | 4 +- console/account/src/private_key/serialize.rs | 4 +- console/account/src/private_key/sign.rs | 4 +- console/account/src/private_key/string.rs | 4 +- console/account/src/signature/bytes.rs | 4 +- console/account/src/signature/from_bits.rs | 4 +- console/account/src/signature/mod.rs | 4 +- console/account/src/signature/parse.rs | 4 +- console/account/src/signature/to_bits.rs | 4 +- console/account/src/signature/verify.rs | 4 +- console/account/src/view_key/bytes.rs | 4 +- console/account/src/view_key/mod.rs | 4 +- console/account/src/view_key/serialize.rs | 4 +- console/account/src/view_key/string.rs | 4 +- console/account/src/view_key/to_address.rs | 4 +- console/account/src/view_key/try_from.rs | 4 +- .../collections/benches/kary_merkle_tree.rs | 4 +- console/collections/benches/merkle_tree.rs | 14 +- console/network/src/lib.rs | 4 +- .../src/{testnet3.rs => mainnet_v0.rs} | 50 +- console/program/src/data/access/bytes.rs | 4 +- console/program/src/data/access/parse.rs | 4 +- console/program/src/data/access/serialize.rs | 4 +- console/program/src/data/ciphertext/bytes.rs | 4 +- .../program/src/data/ciphertext/decrypt.rs | 4 +- console/program/src/data/ciphertext/parse.rs | 4 +- .../program/src/data/ciphertext/serialize.rs | 4 +- console/program/src/data/future/bytes.rs | 4 +- console/program/src/data/future/parse.rs | 4 +- console/program/src/data/identifier/bytes.rs | 4 +- .../program/src/data/identifier/from_bits.rs | 4 +- .../program/src/data/identifier/from_field.rs | 4 +- console/program/src/data/identifier/mod.rs | 4 +- console/program/src/data/identifier/parse.rs | 4 +- .../program/src/data/identifier/serialize.rs | 4 +- .../src/data/identifier/size_in_bits.rs | 4 +- .../program/src/data/identifier/to_bits.rs | 4 +- .../program/src/data/identifier/to_field.rs | 4 +- console/program/src/data/literal/bytes.rs | 4 +- console/program/src/data/literal/from_bits.rs | 4 +- console/program/src/data/literal/parse.rs | 4 +- console/program/src/data/literal/serialize.rs | 4 +- console/program/src/data/plaintext/bytes.rs | 4 +- console/program/src/data/plaintext/equal.rs | 4 +- console/program/src/data/plaintext/mod.rs | 4 +- console/program/src/data/plaintext/parse.rs | 4 +- .../program/src/data/plaintext/serialize.rs | 4 +- console/program/src/data/record/bytes.rs | 4 +- console/program/src/data/record/decrypt.rs | 4 +- .../program/src/data/record/entry/parse.rs | 4 +- console/program/src/data/record/equal.rs | 4 +- console/program/src/data/record/is_owner.rs | 4 +- .../src/data/record/parse_plaintext.rs | 4 +- console/program/src/data/record/serialize.rs | 4 +- console/program/src/data/register/mod.rs | 4 +- console/program/src/data/register/parse.rs | 4 +- .../program/src/data/register/serialize.rs | 4 +- console/program/src/data/value/bytes.rs | 4 +- console/program/src/data/value/parse.rs | 4 +- console/program/src/data/value/serialize.rs | 4 +- .../src/data_types/array_type/bytes.rs | 2 +- .../program/src/data_types/array_type/mod.rs | 4 +- .../src/data_types/array_type/serialize.rs | 6 +- .../src/data_types/finalize_type/parse.rs | 4 +- .../src/data_types/finalize_type/serialize.rs | 4 +- .../src/data_types/plaintext_type/parse.rs | 4 +- .../data_types/plaintext_type/serialize.rs | 4 +- .../src/data_types/record_type/bytes.rs | 4 +- .../record_type/entry_type/parse.rs | 4 +- .../record_type/entry_type/serialize.rs | 4 +- .../src/data_types/record_type/parse.rs | 4 +- .../src/data_types/record_type/serialize.rs | 4 +- .../src/data_types/register_type/parse.rs | 4 +- .../src/data_types/register_type/serialize.rs | 4 +- .../src/data_types/struct_type/bytes.rs | 4 +- .../src/data_types/struct_type/parse.rs | 4 +- .../src/data_types/struct_type/serialize.rs | 4 +- .../src/data_types/value_type/parse.rs | 4 +- .../src/data_types/value_type/serialize.rs | 4 +- console/program/src/id/mod.rs | 4 +- console/program/src/id/parse.rs | 4 +- console/program/src/id/serialize.rs | 4 +- console/program/src/id/to_bits.rs | 4 +- console/program/src/locator/parse.rs | 4 +- console/program/src/locator/serialize.rs | 4 +- console/program/src/owner/bytes.rs | 4 +- console/program/src/owner/mod.rs | 4 +- .../program/src/request/input_id/serialize.rs | 4 +- console/program/src/request/mod.rs | 4 +- console/program/src/request/verify.rs | 4 +- console/program/src/state_path/bytes.rs | 4 +- .../src/state_path/configuration/mod.rs | 2 +- .../program/src/state_path/header_leaf/mod.rs | 4 +- console/program/src/state_path/parse.rs | 4 +- console/program/src/state_path/serialize.rs | 4 +- .../src/state_path/transaction_leaf/mod.rs | 4 +- .../src/state_path/transition_leaf/mod.rs | 4 +- console/program/src/state_path/verify.rs | 4 +- console/types/benches/group.rs | 4 +- ledger/authority/src/lib.rs | 2 +- ledger/benches/block.rs | 4 +- ledger/benches/transaction.rs | 26 +- ledger/block/src/bytes.rs | 4 +- ledger/block/src/genesis.rs | 4 +- ledger/block/src/header/bytes.rs | 4 +- ledger/block/src/header/genesis.rs | 4 +- ledger/block/src/header/merkle.rs | 4 +- ledger/block/src/header/metadata/bytes.rs | 4 +- ledger/block/src/header/metadata/genesis.rs | 4 +- ledger/block/src/header/metadata/mod.rs | 2 +- ledger/block/src/header/mod.rs | 2 +- ledger/block/src/helpers/target.rs | 4 +- ledger/block/src/lib.rs | 2 +- ledger/block/src/ratifications/merkle.rs | 4 +- ledger/block/src/ratifications/mod.rs | 2 +- ledger/block/src/ratifications/serialize.rs | 4 +- ledger/block/src/ratify/mod.rs | 4 +- ledger/block/src/serialize.rs | 4 +- ledger/block/src/solutions/serialize.rs | 2 +- .../block/src/transaction/deployment/mod.rs | 4 +- ledger/block/src/transaction/execution/mod.rs | 2 +- ledger/block/src/transaction/fee/mod.rs | 2 +- ledger/block/src/transaction/mod.rs | 4 +- .../block/src/transactions/confirmed/mod.rs | 6 +- ledger/block/src/transactions/merkle.rs | 4 +- ledger/block/src/transactions/mod.rs | 4 +- ledger/block/src/transactions/rejected/mod.rs | 4 +- ledger/block/src/transactions/serialize.rs | 4 +- ledger/block/src/transition/input/mod.rs | 4 +- ledger/block/src/transition/merkle.rs | 4 +- ledger/block/src/transition/mod.rs | 2 +- ledger/block/src/transition/output/mod.rs | 4 +- ledger/coinbase/benches/coinbase_puzzle.rs | 18 +- .../helpers/coinbase_solution/serialize.rs | 2 +- .../src/helpers/epoch_challenge/bytes.rs | 4 +- .../src/helpers/partial_solution/bytes.rs | 4 +- .../src/helpers/partial_solution/serialize.rs | 4 +- .../src/helpers/partial_solution/string.rs | 4 +- .../src/helpers/prover_solution/bytes.rs | 4 +- .../src/helpers/prover_solution/serialize.rs | 4 +- .../src/helpers/prover_solution/string.rs | 4 +- .../src/helpers/puzzle_commitment/bytes.rs | 4 +- .../helpers/puzzle_commitment/serialize.rs | 4 +- .../src/helpers/puzzle_commitment/string.rs | 4 +- ledger/coinbase/src/tests.rs | 26 +- ledger/committee/src/lib.rs | 4 +- ledger/committee/src/prop_tests.rs | 2 +- ledger/narwhal/batch-certificate/src/lib.rs | 6 +- ledger/narwhal/batch-header/src/lib.rs | 4 +- ledger/narwhal/subdag/src/lib.rs | 6 +- ledger/narwhal/transmission-id/src/lib.rs | 4 +- ledger/narwhal/transmission-id/src/string.rs | 4 +- ledger/narwhal/transmission/src/lib.rs | 4 +- ledger/src/get.rs | 4 +- ledger/src/lib.rs | 4 +- ledger/store/src/block/mod.rs | 2 +- .../store/src/helpers/memory/internal/map.rs | 4 +- .../src/helpers/memory/internal/nested_map.rs | 4 +- .../store/src/helpers/rocksdb/internal/map.rs | 4 +- .../helpers/rocksdb/internal/nested_map.rs | 4 +- .../src/helpers/rocksdb/internal/tests.rs | 4 +- ledger/store/src/program/committee.rs | 2 +- ledger/store/src/program/finalize.rs | 4 +- ledger/store/src/transaction/execution.rs | 2 +- ledger/test-helpers/src/lib.rs | 2 +- parameters/examples/inclusion.rs | 6 +- parameters/examples/setup.rs | 6 +- .../scripts/{testnet3 => mainnet}/credits.sh | 4 +- parameters/scripts/mainnet/inclusion.sh | 9 + parameters/scripts/testnet3/inclusion.sh | 9 - parameters/src/lib.rs | 2 +- .../src/{testnet3 => mainnet}/genesis.rs | 0 parameters/src/{testnet3 => mainnet}/mod.rs | 26 +- .../src/{testnet3 => mainnet}/powers.rs | 0 .../resources/beta-h.metadata | 0 .../resources/beta-h.usrs | Bin .../resources/block.genesis | Bin .../resources/bond_public.metadata | 0 .../resources/bond_public.verifier | Bin .../resources/claim_unbond_public.metadata | 0 .../resources/claim_unbond_public.verifier | Bin .../resources/fee_private.metadata | 0 .../resources/fee_private.verifier | Bin .../resources/fee_public.metadata | 0 .../resources/fee_public.verifier | Bin .../resources/genesis.metadata | 0 .../resources/inclusion.metadata | 0 .../resources/inclusion.verifier | Bin .../resources/join.metadata | 0 .../resources/join.verifier | Bin .../resources/mint.metadata | 0 .../resources/neg-powers-of-beta.metadata | 0 .../resources/neg-powers-of-beta.usrs | Bin .../resources/powers-of-beta-15.metadata | 0 .../resources/powers-of-beta-15.usrs | Bin .../resources/powers-of-beta-16.metadata | 0 .../resources/powers-of-beta-16.usrs | Bin .../resources/powers-of-beta-17.metadata | 0 .../resources/powers-of-beta-18.metadata | 0 .../resources/powers-of-beta-19.metadata | 0 .../resources/powers-of-beta-20.metadata | 0 .../resources/powers-of-beta-21.metadata | 0 .../resources/powers-of-beta-22.metadata | 0 .../resources/powers-of-beta-23.metadata | 0 .../resources/powers-of-beta-24.metadata | 0 .../resources/powers-of-beta-25.metadata | 0 .../resources/powers-of-beta-26.metadata | 0 .../resources/powers-of-beta-27.metadata | 0 .../resources/powers-of-beta-28.metadata | 0 .../resources/powers-of-beta-gamma.metadata | 0 .../resources/powers-of-beta-gamma.usrs | Bin .../resources/set_validator_state.metadata | 0 .../resources/set_validator_state.verifier | Bin .../shifted-powers-of-beta-15.metadata | 0 .../resources/shifted-powers-of-beta-15.usrs | Bin .../shifted-powers-of-beta-16.metadata | 0 .../resources/shifted-powers-of-beta-16.usrs | Bin .../shifted-powers-of-beta-17.metadata | 0 .../shifted-powers-of-beta-18.metadata | 0 .../shifted-powers-of-beta-19.metadata | 0 .../shifted-powers-of-beta-20.metadata | 0 .../shifted-powers-of-beta-21.metadata | 0 .../shifted-powers-of-beta-22.metadata | 0 .../shifted-powers-of-beta-23.metadata | 0 .../shifted-powers-of-beta-24.metadata | 0 .../shifted-powers-of-beta-25.metadata | 0 .../shifted-powers-of-beta-26.metadata | 0 .../shifted-powers-of-beta-27.metadata | 0 .../shifted-powers-of-beta-28.metadata | 0 .../resources/split.metadata | 0 .../resources/split.verifier | Bin .../resources/transfer_private.metadata | 0 .../resources/transfer_private.verifier | Bin .../transfer_private_to_public.metadata | 0 .../transfer_private_to_public.verifier | Bin .../resources/transfer_public.metadata | 0 .../resources/transfer_public.verifier | Bin .../transfer_public_to_private.metadata | 0 .../transfer_public_to_private.verifier | Bin .../unbond_delegator_as_validator.metadata | 0 .../unbond_delegator_as_validator.verifier | Bin .../resources/unbond_public.metadata | 0 .../resources/unbond_public.verifier | Bin synthesizer/benches/kary_merkle_tree.rs | 6 +- synthesizer/process/src/execute.rs | 2 +- synthesizer/process/src/finalize.rs | 2 +- synthesizer/process/src/lib.rs | 4 +- .../process/src/stack/authorization/mod.rs | 2 +- synthesizer/process/src/tests/test_credits.rs | 4 +- synthesizer/process/src/tests/test_execute.rs | 26 +- synthesizer/program/benches/instruction.rs | 342 ++--- synthesizer/program/src/bytes.rs | 4 +- synthesizer/program/src/closure/bytes.rs | 4 +- synthesizer/program/src/closure/input/mod.rs | 4 +- .../program/src/closure/input/parse.rs | 4 +- synthesizer/program/src/closure/mod.rs | 2 +- synthesizer/program/src/closure/output/mod.rs | 4 +- .../program/src/closure/output/parse.rs | 4 +- synthesizer/program/src/closure/parse.rs | 4 +- synthesizer/program/src/finalize/bytes.rs | 4 +- synthesizer/program/src/finalize/input/mod.rs | 4 +- .../program/src/finalize/input/parse.rs | 4 +- synthesizer/program/src/finalize/mod.rs | 2 +- synthesizer/program/src/finalize/parse.rs | 4 +- synthesizer/program/src/function/bytes.rs | 4 +- synthesizer/program/src/function/input/mod.rs | 4 +- .../program/src/function/input/parse.rs | 4 +- synthesizer/program/src/function/mod.rs | 2 +- .../program/src/function/output/mod.rs | 4 +- .../program/src/function/output/parse.rs | 4 +- synthesizer/program/src/function/parse.rs | 4 +- synthesizer/program/src/import/mod.rs | 4 +- synthesizer/program/src/import/parse.rs | 4 +- synthesizer/program/src/lib.rs | 4 +- .../program/src/logic/command/await_.rs | 4 +- .../program/src/logic/command/branch.rs | 4 +- .../program/src/logic/command/contains.rs | 4 +- synthesizer/program/src/logic/command/get.rs | 4 +- .../program/src/logic/command/get_or_use.rs | 4 +- synthesizer/program/src/logic/command/mod.rs | 4 +- .../program/src/logic/command/position.rs | 4 +- .../program/src/logic/command/rand_chacha.rs | 4 +- .../program/src/logic/command/remove.rs | 4 +- synthesizer/program/src/logic/command/set.rs | 4 +- .../src/logic/finalize_operation/mod.rs | 4 +- .../program/src/logic/instruction/bytes.rs | 4 +- .../program/src/logic/instruction/mod.rs | 4 +- .../src/logic/instruction/operand/mod.rs | 4 +- .../src/logic/instruction/operand/parse.rs | 4 +- .../src/logic/instruction/operation/assert.rs | 4 +- .../src/logic/instruction/operation/async_.rs | 4 +- .../src/logic/instruction/operation/call.rs | 4 +- .../src/logic/instruction/operation/cast.rs | 4 +- .../src/logic/instruction/operation/commit.rs | 4 +- .../src/logic/instruction/operation/hash.rs | 4 +- .../src/logic/instruction/operation/is.rs | 4 +- .../src/logic/instruction/operation/macros.rs | 4 +- .../instruction/operation/sign_verify.rs | 4 +- .../program/src/logic/instruction/parse.rs | 4 +- synthesizer/program/src/mapping/bytes.rs | 4 +- synthesizer/program/src/mapping/key/mod.rs | 4 +- synthesizer/program/src/mapping/key/parse.rs | 4 +- synthesizer/program/src/mapping/parse.rs | 4 +- synthesizer/program/src/mapping/value/mod.rs | 4 +- .../program/src/mapping/value/parse.rs | 4 +- synthesizer/program/src/parse.rs | 4 +- synthesizer/program/src/serialize.rs | 4 +- synthesizer/program/tests/helpers/sample.rs | 4 +- .../program/tests/instruction/assert.rs | 4 +- .../program/tests/instruction/commit.rs | 4 +- synthesizer/program/tests/instruction/hash.rs | 4 +- synthesizer/program/tests/instruction/is.rs | 4 +- synthesizer/snark/src/certificate/parse.rs | 4 +- synthesizer/snark/src/lib.rs | 8 +- synthesizer/snark/src/proof/parse.rs | 4 +- synthesizer/src/vm/execute.rs | 4 +- synthesizer/src/vm/helpers/macros.rs | 16 +- synthesizer/src/vm/helpers/rewards.rs | 2 +- synthesizer/src/vm/mod.rs | 30 +- synthesizer/tests/utilities/mod.rs | 2 +- vm/cli/commands/mod.rs | 2 +- vm/cli/helpers/env.rs | 2 +- vm/file/aleo.rs | 2 +- vm/file/avm.rs | 2 +- vm/file/prover.rs | 2 +- vm/file/verifier.rs | 2 +- vm/package/clean.rs | 2 +- vm/package/deploy.rs | 2 +- vm/package/is_build_required.rs | 8 +- vm/package/mod.rs | 10 +- wasm/src/tests.rs | 6 +- 357 files changed, 2379 insertions(+), 2059 deletions(-) rename console/network/src/{testnet3.rs => mainnet_v0.rs} (89%) rename parameters/scripts/{testnet3 => mainnet}/credits.sh (62%) create mode 100755 parameters/scripts/mainnet/inclusion.sh delete mode 100755 parameters/scripts/testnet3/inclusion.sh rename parameters/src/{testnet3 => mainnet}/genesis.rs (100%) rename parameters/src/{testnet3 => mainnet}/mod.rs (90%) rename parameters/src/{testnet3 => mainnet}/powers.rs (100%) rename parameters/src/{testnet3 => mainnet}/resources/beta-h.metadata (100%) rename parameters/src/{testnet3 => mainnet}/resources/beta-h.usrs (100%) rename parameters/src/{testnet3 => mainnet}/resources/block.genesis (100%) rename parameters/src/{testnet3 => mainnet}/resources/bond_public.metadata (100%) rename parameters/src/{testnet3 => mainnet}/resources/bond_public.verifier (100%) rename parameters/src/{testnet3 => mainnet}/resources/claim_unbond_public.metadata (100%) rename parameters/src/{testnet3 => mainnet}/resources/claim_unbond_public.verifier (100%) rename parameters/src/{testnet3 => mainnet}/resources/fee_private.metadata (100%) rename parameters/src/{testnet3 => mainnet}/resources/fee_private.verifier (100%) rename parameters/src/{testnet3 => mainnet}/resources/fee_public.metadata (100%) rename parameters/src/{testnet3 => mainnet}/resources/fee_public.verifier (100%) rename parameters/src/{testnet3 => mainnet}/resources/genesis.metadata (100%) rename parameters/src/{testnet3 => mainnet}/resources/inclusion.metadata (100%) rename parameters/src/{testnet3 => mainnet}/resources/inclusion.verifier (100%) rename parameters/src/{testnet3 => mainnet}/resources/join.metadata (100%) rename parameters/src/{testnet3 => mainnet}/resources/join.verifier (100%) rename parameters/src/{testnet3 => mainnet}/resources/mint.metadata (100%) rename parameters/src/{testnet3 => mainnet}/resources/neg-powers-of-beta.metadata (100%) rename parameters/src/{testnet3 => mainnet}/resources/neg-powers-of-beta.usrs (100%) rename parameters/src/{testnet3 => mainnet}/resources/powers-of-beta-15.metadata (100%) rename parameters/src/{testnet3 => mainnet}/resources/powers-of-beta-15.usrs (100%) rename parameters/src/{testnet3 => mainnet}/resources/powers-of-beta-16.metadata (100%) rename parameters/src/{testnet3 => mainnet}/resources/powers-of-beta-16.usrs (100%) rename parameters/src/{testnet3 => mainnet}/resources/powers-of-beta-17.metadata (100%) rename parameters/src/{testnet3 => mainnet}/resources/powers-of-beta-18.metadata (100%) rename parameters/src/{testnet3 => mainnet}/resources/powers-of-beta-19.metadata (100%) rename parameters/src/{testnet3 => mainnet}/resources/powers-of-beta-20.metadata (100%) rename parameters/src/{testnet3 => mainnet}/resources/powers-of-beta-21.metadata (100%) rename parameters/src/{testnet3 => mainnet}/resources/powers-of-beta-22.metadata (100%) rename parameters/src/{testnet3 => mainnet}/resources/powers-of-beta-23.metadata (100%) rename parameters/src/{testnet3 => mainnet}/resources/powers-of-beta-24.metadata (100%) rename parameters/src/{testnet3 => mainnet}/resources/powers-of-beta-25.metadata (100%) rename parameters/src/{testnet3 => mainnet}/resources/powers-of-beta-26.metadata (100%) rename parameters/src/{testnet3 => mainnet}/resources/powers-of-beta-27.metadata (100%) rename parameters/src/{testnet3 => mainnet}/resources/powers-of-beta-28.metadata (100%) rename parameters/src/{testnet3 => mainnet}/resources/powers-of-beta-gamma.metadata (100%) rename parameters/src/{testnet3 => mainnet}/resources/powers-of-beta-gamma.usrs (100%) rename parameters/src/{testnet3 => mainnet}/resources/set_validator_state.metadata (100%) rename parameters/src/{testnet3 => mainnet}/resources/set_validator_state.verifier (100%) rename parameters/src/{testnet3 => mainnet}/resources/shifted-powers-of-beta-15.metadata (100%) rename parameters/src/{testnet3 => mainnet}/resources/shifted-powers-of-beta-15.usrs (100%) rename parameters/src/{testnet3 => mainnet}/resources/shifted-powers-of-beta-16.metadata (100%) rename parameters/src/{testnet3 => mainnet}/resources/shifted-powers-of-beta-16.usrs (100%) rename parameters/src/{testnet3 => mainnet}/resources/shifted-powers-of-beta-17.metadata (100%) rename parameters/src/{testnet3 => mainnet}/resources/shifted-powers-of-beta-18.metadata (100%) rename parameters/src/{testnet3 => mainnet}/resources/shifted-powers-of-beta-19.metadata (100%) rename parameters/src/{testnet3 => mainnet}/resources/shifted-powers-of-beta-20.metadata (100%) rename parameters/src/{testnet3 => mainnet}/resources/shifted-powers-of-beta-21.metadata (100%) rename parameters/src/{testnet3 => mainnet}/resources/shifted-powers-of-beta-22.metadata (100%) rename parameters/src/{testnet3 => mainnet}/resources/shifted-powers-of-beta-23.metadata (100%) rename parameters/src/{testnet3 => mainnet}/resources/shifted-powers-of-beta-24.metadata (100%) rename parameters/src/{testnet3 => mainnet}/resources/shifted-powers-of-beta-25.metadata (100%) rename parameters/src/{testnet3 => mainnet}/resources/shifted-powers-of-beta-26.metadata (100%) rename parameters/src/{testnet3 => mainnet}/resources/shifted-powers-of-beta-27.metadata (100%) rename parameters/src/{testnet3 => mainnet}/resources/shifted-powers-of-beta-28.metadata (100%) rename parameters/src/{testnet3 => mainnet}/resources/split.metadata (100%) rename parameters/src/{testnet3 => mainnet}/resources/split.verifier (100%) rename parameters/src/{testnet3 => mainnet}/resources/transfer_private.metadata (100%) rename parameters/src/{testnet3 => mainnet}/resources/transfer_private.verifier (100%) rename parameters/src/{testnet3 => mainnet}/resources/transfer_private_to_public.metadata (100%) rename parameters/src/{testnet3 => mainnet}/resources/transfer_private_to_public.verifier (100%) rename parameters/src/{testnet3 => mainnet}/resources/transfer_public.metadata (100%) rename parameters/src/{testnet3 => mainnet}/resources/transfer_public.verifier (100%) rename parameters/src/{testnet3 => mainnet}/resources/transfer_public_to_private.metadata (100%) rename parameters/src/{testnet3 => mainnet}/resources/transfer_public_to_private.verifier (100%) rename parameters/src/{testnet3 => mainnet}/resources/unbond_delegator_as_validator.metadata (100%) rename parameters/src/{testnet3 => mainnet}/resources/unbond_delegator_as_validator.verifier (100%) rename parameters/src/{testnet3 => mainnet}/resources/unbond_public.metadata (100%) rename parameters/src/{testnet3 => mainnet}/resources/unbond_public.verifier (100%) diff --git a/.github/workflows/benchmarks.yml b/.github/workflows/benchmarks.yml index 32054890db..c2e1481726 100644 --- a/.github/workflows/benchmarks.yml +++ b/.github/workflows/benchmarks.yml @@ -3,7 +3,7 @@ name: Run snarkVM Benchmarks on: push: branches: - - 'testnet3' + - 'mainnet' jobs: # Run benchmarks and stores the output to a file diff --git a/README.md b/README.md index 81bf265b44..142fa532db 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@

- + diff --git a/algorithms/src/polycommit/kzg10/data_structures.rs b/algorithms/src/polycommit/kzg10/data_structures.rs index 495e817788..0ceae0b654 100644 --- a/algorithms/src/polycommit/kzg10/data_structures.rs +++ b/algorithms/src/polycommit/kzg10/data_structures.rs @@ -18,7 +18,7 @@ use crate::{ }; use snarkvm_curves::{AffineCurve, PairingCurve, PairingEngine, ProjectiveCurve}; use snarkvm_fields::{ConstraintFieldError, ToConstraintField, Zero}; -use snarkvm_parameters::testnet3::PowersOfG; +use snarkvm_parameters::mainnet::PowersOfG; use snarkvm_utilities::{ borrow::Cow, error, diff --git a/circuit/environment/src/circuit.rs b/circuit/environment/src/circuit.rs index 1fde647271..56ff721b0c 100644 --- a/circuit/environment/src/circuit.rs +++ b/circuit/environment/src/circuit.rs @@ -19,7 +19,7 @@ use core::{ fmt, }; -type Field = ::Field; +type Field = ::Field; thread_local! { pub(super) static CONSTRAINT_LIMIT: Cell> = Cell::new(None); @@ -33,10 +33,10 @@ thread_local! { pub struct Circuit; impl Environment for Circuit { - type Affine = ::Affine; + type Affine = ::Affine; type BaseField = Field; - type Network = console::Testnet3; - type ScalarField = ::Scalar; + type Network = console::MainnetV0; + type ScalarField = ::Scalar; /// Returns the `zero` constant. fn zero() -> LinearCombination { diff --git a/circuit/network/src/v0.rs b/circuit/network/src/v0.rs index 936e1e581c..26bda8513c 100644 --- a/circuit/network/src/v0.rs +++ b/circuit/network/src/v0.rs @@ -52,14 +52,14 @@ type E = Circuit; thread_local! { /// The group bases for the Aleo signature and encryption schemes. - static GENERATOR_G: Vec> = Vec::constant(::g_powers().to_vec()); + static GENERATOR_G: Vec> = Vec::constant(::g_powers().to_vec()); /// The encryption domain as a constant field element. - static ENCRYPTION_DOMAIN: Field = Field::constant(::encryption_domain()); + static ENCRYPTION_DOMAIN: Field = Field::constant(::encryption_domain()); /// The graph key domain as a constant field element. - static GRAPH_KEY_DOMAIN: Field = Field::constant(::graph_key_domain()); + static GRAPH_KEY_DOMAIN: Field = Field::constant(::graph_key_domain()); /// The serial number domain as a constant field element. - static SERIAL_NUMBER_DOMAIN: Field = Field::constant(::serial_number_domain()); + static SERIAL_NUMBER_DOMAIN: Field = Field::constant(::serial_number_domain()); /// The BHP hash function, which can take an input of up to 256 bits. static BHP_256: BHP256 = BHP256::::constant(console::BHP_256.clone()); diff --git a/circuit/program/src/data/literal/cast/boolean.rs b/circuit/program/src/data/literal/cast/boolean.rs index 955df86b40..6753261ca3 100644 --- a/circuit/program/src/data/literal/cast/boolean.rs +++ b/circuit/program/src/data/literal/cast/boolean.rs @@ -66,7 +66,7 @@ impl Cast> for Boolean { mod tests { use super::*; use console::Cast as _; - use console_root::{network::Testnet3, prelude::TestRng}; + use console_root::{network::MainnetV0, prelude::TestRng}; use snarkvm_circuit_types::environment::{count_is, Circuit, Eject, Inject, Mode, UpdatableCount}; use std::fmt::Debug; @@ -77,114 +77,114 @@ mod tests { i: usize, mode: Mode, _: &mut TestRng, - ) -> (console_root::types::Boolean, Boolean) { + ) -> (console_root::types::Boolean, Boolean) { (console_root::types::Boolean::new(i % 2 == 0), Boolean::new(mode, i % 2 == 0)) } - impl_check_cast!(cast, Boolean, console_root::types::Boolean::); + impl_check_cast!(cast, Boolean, console_root::types::Boolean::); #[test] fn test_boolean_to_address() { - check_cast::, console_root::types::Address>(Mode::Constant, count_is!(10, 0, 0, 0)); - check_cast::, console_root::types::Address>(Mode::Public, count_is!(10, 0, 0, 0)); - check_cast::, console_root::types::Address>(Mode::Private, count_is!(10, 0, 0, 0)); + check_cast::, console_root::types::Address>(Mode::Constant, count_is!(10, 0, 0, 0)); + check_cast::, console_root::types::Address>(Mode::Public, count_is!(10, 0, 0, 0)); + check_cast::, console_root::types::Address>(Mode::Private, count_is!(10, 0, 0, 0)); } #[test] fn test_boolean_to_boolean() { - check_cast::, console_root::types::Boolean>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast::, console_root::types::Boolean>(Mode::Public, count_is!(0, 0, 0, 0)); - check_cast::, console_root::types::Boolean>(Mode::Private, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::Boolean>(Mode::Constant, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::Boolean>(Mode::Public, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::Boolean>(Mode::Private, count_is!(0, 0, 0, 0)); } #[test] fn test_boolean_to_field() { - check_cast::, console_root::types::Field>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast::, console_root::types::Field>(Mode::Public, count_is!(0, 0, 0, 0)); - check_cast::, console_root::types::Field>(Mode::Private, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::Field>(Mode::Constant, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::Field>(Mode::Public, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::Field>(Mode::Private, count_is!(0, 0, 0, 0)); } #[test] fn test_boolean_to_group() { - check_cast::, console_root::types::Group>(Mode::Constant, count_is!(10, 0, 0, 0)); - check_cast::, console_root::types::Group>(Mode::Public, count_is!(10, 0, 0, 0)); - check_cast::, console_root::types::Group>(Mode::Private, count_is!(10, 0, 0, 0)); + check_cast::, console_root::types::Group>(Mode::Constant, count_is!(10, 0, 0, 0)); + check_cast::, console_root::types::Group>(Mode::Public, count_is!(10, 0, 0, 0)); + check_cast::, console_root::types::Group>(Mode::Private, count_is!(10, 0, 0, 0)); } #[test] fn test_boolean_to_i8() { - check_cast::, console_root::types::I8>(Mode::Constant, count_is!(16, 0, 0, 0)); - check_cast::, console_root::types::I8>(Mode::Public, count_is!(16, 0, 0, 0)); - check_cast::, console_root::types::I8>(Mode::Private, count_is!(16, 0, 0, 0)); + check_cast::, console_root::types::I8>(Mode::Constant, count_is!(16, 0, 0, 0)); + check_cast::, console_root::types::I8>(Mode::Public, count_is!(16, 0, 0, 0)); + check_cast::, console_root::types::I8>(Mode::Private, count_is!(16, 0, 0, 0)); } #[test] fn test_boolean_to_i16() { - check_cast::, console_root::types::I16>(Mode::Constant, count_is!(32, 0, 0, 0)); - check_cast::, console_root::types::I16>(Mode::Public, count_is!(32, 0, 0, 0)); - check_cast::, console_root::types::I16>(Mode::Private, count_is!(32, 0, 0, 0)); + check_cast::, console_root::types::I16>(Mode::Constant, count_is!(32, 0, 0, 0)); + check_cast::, console_root::types::I16>(Mode::Public, count_is!(32, 0, 0, 0)); + check_cast::, console_root::types::I16>(Mode::Private, count_is!(32, 0, 0, 0)); } #[test] fn test_boolean_to_i32() { - check_cast::, console_root::types::I32>(Mode::Constant, count_is!(64, 0, 0, 0)); - check_cast::, console_root::types::I32>(Mode::Public, count_is!(64, 0, 0, 0)); - check_cast::, console_root::types::I32>(Mode::Private, count_is!(64, 0, 0, 0)); + check_cast::, console_root::types::I32>(Mode::Constant, count_is!(64, 0, 0, 0)); + check_cast::, console_root::types::I32>(Mode::Public, count_is!(64, 0, 0, 0)); + check_cast::, console_root::types::I32>(Mode::Private, count_is!(64, 0, 0, 0)); } #[test] fn test_boolean_to_i64() { - check_cast::, console_root::types::I64>(Mode::Constant, count_is!(128, 0, 0, 0)); - check_cast::, console_root::types::I64>(Mode::Public, count_is!(128, 0, 0, 0)); - check_cast::, console_root::types::I64>(Mode::Private, count_is!(128, 0, 0, 0)); + check_cast::, console_root::types::I64>(Mode::Constant, count_is!(128, 0, 0, 0)); + check_cast::, console_root::types::I64>(Mode::Public, count_is!(128, 0, 0, 0)); + check_cast::, console_root::types::I64>(Mode::Private, count_is!(128, 0, 0, 0)); } #[test] fn test_boolean_to_i128() { - check_cast::, console_root::types::I128>(Mode::Constant, count_is!(256, 0, 0, 0)); - check_cast::, console_root::types::I128>(Mode::Public, count_is!(256, 0, 0, 0)); - check_cast::, console_root::types::I128>(Mode::Private, count_is!(256, 0, 0, 0)); + check_cast::, console_root::types::I128>(Mode::Constant, count_is!(256, 0, 0, 0)); + check_cast::, console_root::types::I128>(Mode::Public, count_is!(256, 0, 0, 0)); + check_cast::, console_root::types::I128>(Mode::Private, count_is!(256, 0, 0, 0)); } #[test] fn test_boolean_to_scalar() { - check_cast::, console_root::types::Scalar>(Mode::Constant, count_is!(2, 0, 0, 0)); - check_cast::, console_root::types::Scalar>(Mode::Public, count_is!(2, 0, 0, 0)); - check_cast::, console_root::types::Scalar>(Mode::Private, count_is!(2, 0, 0, 0)); + check_cast::, console_root::types::Scalar>(Mode::Constant, count_is!(2, 0, 0, 0)); + check_cast::, console_root::types::Scalar>(Mode::Public, count_is!(2, 0, 0, 0)); + check_cast::, console_root::types::Scalar>(Mode::Private, count_is!(2, 0, 0, 0)); } #[test] fn test_boolean_to_u8() { - check_cast::, console_root::types::U8>(Mode::Constant, count_is!(16, 0, 0, 0)); - check_cast::, console_root::types::U8>(Mode::Public, count_is!(16, 0, 0, 0)); - check_cast::, console_root::types::U8>(Mode::Private, count_is!(16, 0, 0, 0)); + check_cast::, console_root::types::U8>(Mode::Constant, count_is!(16, 0, 0, 0)); + check_cast::, console_root::types::U8>(Mode::Public, count_is!(16, 0, 0, 0)); + check_cast::, console_root::types::U8>(Mode::Private, count_is!(16, 0, 0, 0)); } #[test] fn test_boolean_to_u16() { - check_cast::, console_root::types::U16>(Mode::Constant, count_is!(32, 0, 0, 0)); - check_cast::, console_root::types::U16>(Mode::Public, count_is!(32, 0, 0, 0)); - check_cast::, console_root::types::U16>(Mode::Private, count_is!(32, 0, 0, 0)); + check_cast::, console_root::types::U16>(Mode::Constant, count_is!(32, 0, 0, 0)); + check_cast::, console_root::types::U16>(Mode::Public, count_is!(32, 0, 0, 0)); + check_cast::, console_root::types::U16>(Mode::Private, count_is!(32, 0, 0, 0)); } #[test] fn test_boolean_to_u32() { - check_cast::, console_root::types::U32>(Mode::Constant, count_is!(64, 0, 0, 0)); - check_cast::, console_root::types::U32>(Mode::Public, count_is!(64, 0, 0, 0)); - check_cast::, console_root::types::U32>(Mode::Private, count_is!(64, 0, 0, 0)); + check_cast::, console_root::types::U32>(Mode::Constant, count_is!(64, 0, 0, 0)); + check_cast::, console_root::types::U32>(Mode::Public, count_is!(64, 0, 0, 0)); + check_cast::, console_root::types::U32>(Mode::Private, count_is!(64, 0, 0, 0)); } #[test] fn test_boolean_to_u64() { - check_cast::, console_root::types::U64>(Mode::Constant, count_is!(128, 0, 0, 0)); - check_cast::, console_root::types::U64>(Mode::Public, count_is!(128, 0, 0, 0)); - check_cast::, console_root::types::U64>(Mode::Private, count_is!(128, 0, 0, 0)); + check_cast::, console_root::types::U64>(Mode::Constant, count_is!(128, 0, 0, 0)); + check_cast::, console_root::types::U64>(Mode::Public, count_is!(128, 0, 0, 0)); + check_cast::, console_root::types::U64>(Mode::Private, count_is!(128, 0, 0, 0)); } #[test] fn test_boolean_to_u128() { - check_cast::, console_root::types::U128>(Mode::Constant, count_is!(256, 0, 0, 0)); - check_cast::, console_root::types::U128>(Mode::Public, count_is!(256, 0, 0, 0)); - check_cast::, console_root::types::U128>(Mode::Private, count_is!(256, 0, 0, 0)); + check_cast::, console_root::types::U128>(Mode::Constant, count_is!(256, 0, 0, 0)); + check_cast::, console_root::types::U128>(Mode::Public, count_is!(256, 0, 0, 0)); + check_cast::, console_root::types::U128>(Mode::Private, count_is!(256, 0, 0, 0)); } } diff --git a/circuit/program/src/data/literal/cast/field.rs b/circuit/program/src/data/literal/cast/field.rs index 9c515ab930..9331231a68 100644 --- a/circuit/program/src/data/literal/cast/field.rs +++ b/circuit/program/src/data/literal/cast/field.rs @@ -85,7 +85,7 @@ mod tests { use super::*; use console::Cast as _; use console_root::{ - network::Testnet3, + network::MainnetV0, prelude::{One, TestRng, Uniform, Zero}, }; use snarkvm_circuit_types::environment::{count_is, count_less_than, Circuit, Eject, Inject, Mode, UpdatableCount}; @@ -98,126 +98,126 @@ mod tests { i: usize, mode: Mode, rng: &mut TestRng, - ) -> (console_root::types::Field, Field) { + ) -> (console_root::types::Field, Field) { let console_value = match i { - 0 => console_root::types::Field::::zero(), - 1 => console_root::types::Field::::one(), + 0 => console_root::types::Field::::zero(), + 1 => console_root::types::Field::::one(), _ => Uniform::rand(rng), }; let circuit_value = Field::::new(mode, console_value); (console_value, circuit_value) } - impl_check_cast!(cast, Field, console_root::types::Field::); + impl_check_cast!(cast, Field, console_root::types::Field::); #[test] fn test_field_to_address() { - check_cast::, console_root::types::Address>( + check_cast::, console_root::types::Address>( Mode::Constant, count_less_than!(11, 0, 0, 0), ); - check_cast::, console_root::types::Address>(Mode::Public, count_is!(4, 0, 13, 13)); - check_cast::, console_root::types::Address>(Mode::Private, count_is!(4, 0, 13, 13)); + check_cast::, console_root::types::Address>(Mode::Public, count_is!(4, 0, 13, 13)); + check_cast::, console_root::types::Address>(Mode::Private, count_is!(4, 0, 13, 13)); } #[test] fn test_field_to_boolean() { - check_cast::, console_root::types::Boolean>(Mode::Constant, count_is!(2, 0, 0, 0)); - check_cast::, console_root::types::Boolean>(Mode::Public, count_is!(0, 0, 5, 6)); - check_cast::, console_root::types::Boolean>(Mode::Private, count_is!(0, 0, 5, 6)); + check_cast::, console_root::types::Boolean>(Mode::Constant, count_is!(2, 0, 0, 0)); + check_cast::, console_root::types::Boolean>(Mode::Public, count_is!(0, 0, 5, 6)); + check_cast::, console_root::types::Boolean>(Mode::Private, count_is!(0, 0, 5, 6)); } #[test] fn test_field_to_field() { - check_cast::, console_root::types::Field>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast::, console_root::types::Field>(Mode::Public, count_is!(0, 0, 0, 0)); - check_cast::, console_root::types::Field>(Mode::Private, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::Field>(Mode::Constant, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::Field>(Mode::Public, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::Field>(Mode::Private, count_is!(0, 0, 0, 0)); } #[test] fn test_field_to_group() { - check_cast::, console_root::types::Group>( + check_cast::, console_root::types::Group>( Mode::Constant, count_less_than!(11, 0, 0, 0), ); - check_cast::, console_root::types::Group>(Mode::Public, count_is!(4, 0, 13, 13)); - check_cast::, console_root::types::Group>(Mode::Private, count_is!(4, 0, 13, 13)); + check_cast::, console_root::types::Group>(Mode::Public, count_is!(4, 0, 13, 13)); + check_cast::, console_root::types::Group>(Mode::Private, count_is!(4, 0, 13, 13)); } #[test] fn test_field_to_i8() { - check_cast::, console_root::types::I8>(Mode::Constant, count_is!(8, 0, 0, 0)); - check_cast::, console_root::types::I8>(Mode::Public, count_is!(0, 0, 8, 9)); - check_cast::, console_root::types::I8>(Mode::Private, count_is!(0, 0, 8, 9)); + check_cast::, console_root::types::I8>(Mode::Constant, count_is!(8, 0, 0, 0)); + check_cast::, console_root::types::I8>(Mode::Public, count_is!(0, 0, 8, 9)); + check_cast::, console_root::types::I8>(Mode::Private, count_is!(0, 0, 8, 9)); } #[test] fn test_field_to_i16() { - check_cast::, console_root::types::I16>(Mode::Constant, count_is!(16, 0, 0, 0)); - check_cast::, console_root::types::I16>(Mode::Public, count_is!(0, 0, 16, 17)); - check_cast::, console_root::types::I16>(Mode::Private, count_is!(0, 0, 16, 17)); + check_cast::, console_root::types::I16>(Mode::Constant, count_is!(16, 0, 0, 0)); + check_cast::, console_root::types::I16>(Mode::Public, count_is!(0, 0, 16, 17)); + check_cast::, console_root::types::I16>(Mode::Private, count_is!(0, 0, 16, 17)); } #[test] fn test_field_to_i32() { - check_cast::, console_root::types::I32>(Mode::Constant, count_is!(32, 0, 0, 0)); - check_cast::, console_root::types::I32>(Mode::Public, count_is!(0, 0, 32, 33)); - check_cast::, console_root::types::I32>(Mode::Private, count_is!(0, 0, 32, 33)); + check_cast::, console_root::types::I32>(Mode::Constant, count_is!(32, 0, 0, 0)); + check_cast::, console_root::types::I32>(Mode::Public, count_is!(0, 0, 32, 33)); + check_cast::, console_root::types::I32>(Mode::Private, count_is!(0, 0, 32, 33)); } #[test] fn test_field_to_i64() { - check_cast::, console_root::types::I64>(Mode::Constant, count_is!(64, 0, 0, 0)); - check_cast::, console_root::types::I64>(Mode::Public, count_is!(0, 0, 64, 65)); - check_cast::, console_root::types::I64>(Mode::Private, count_is!(0, 0, 64, 65)); + check_cast::, console_root::types::I64>(Mode::Constant, count_is!(64, 0, 0, 0)); + check_cast::, console_root::types::I64>(Mode::Public, count_is!(0, 0, 64, 65)); + check_cast::, console_root::types::I64>(Mode::Private, count_is!(0, 0, 64, 65)); } #[test] fn test_field_to_i128() { - check_cast::, console_root::types::I128>(Mode::Constant, count_is!(128, 0, 0, 0)); - check_cast::, console_root::types::I128>(Mode::Public, count_is!(0, 0, 128, 129)); - check_cast::, console_root::types::I128>(Mode::Private, count_is!(0, 0, 128, 129)); + check_cast::, console_root::types::I128>(Mode::Constant, count_is!(128, 0, 0, 0)); + check_cast::, console_root::types::I128>(Mode::Public, count_is!(0, 0, 128, 129)); + check_cast::, console_root::types::I128>(Mode::Private, count_is!(0, 0, 128, 129)); } #[test] fn test_field_to_scalar() { - check_cast::, console_root::types::Scalar>(Mode::Constant, count_is!(253, 0, 0, 0)); - check_cast::, console_root::types::Scalar>(Mode::Public, count_is!(0, 0, 755, 759)); - check_cast::, console_root::types::Scalar>(Mode::Private, count_is!(0, 0, 755, 759)); + check_cast::, console_root::types::Scalar>(Mode::Constant, count_is!(253, 0, 0, 0)); + check_cast::, console_root::types::Scalar>(Mode::Public, count_is!(0, 0, 755, 759)); + check_cast::, console_root::types::Scalar>(Mode::Private, count_is!(0, 0, 755, 759)); } #[test] fn test_field_to_u8() { - check_cast::, console_root::types::U8>(Mode::Constant, count_is!(8, 0, 0, 0)); - check_cast::, console_root::types::U8>(Mode::Public, count_is!(0, 0, 8, 9)); - check_cast::, console_root::types::U8>(Mode::Private, count_is!(0, 0, 8, 9)); + check_cast::, console_root::types::U8>(Mode::Constant, count_is!(8, 0, 0, 0)); + check_cast::, console_root::types::U8>(Mode::Public, count_is!(0, 0, 8, 9)); + check_cast::, console_root::types::U8>(Mode::Private, count_is!(0, 0, 8, 9)); } #[test] fn test_field_to_u16() { - check_cast::, console_root::types::U16>(Mode::Constant, count_is!(16, 0, 0, 0)); - check_cast::, console_root::types::U16>(Mode::Public, count_is!(0, 0, 16, 17)); - check_cast::, console_root::types::U16>(Mode::Private, count_is!(0, 0, 16, 17)); + check_cast::, console_root::types::U16>(Mode::Constant, count_is!(16, 0, 0, 0)); + check_cast::, console_root::types::U16>(Mode::Public, count_is!(0, 0, 16, 17)); + check_cast::, console_root::types::U16>(Mode::Private, count_is!(0, 0, 16, 17)); } #[test] fn test_field_to_u32() { - check_cast::, console_root::types::U32>(Mode::Constant, count_is!(32, 0, 0, 0)); - check_cast::, console_root::types::U32>(Mode::Public, count_is!(0, 0, 32, 33)); - check_cast::, console_root::types::U32>(Mode::Private, count_is!(0, 0, 32, 33)); + check_cast::, console_root::types::U32>(Mode::Constant, count_is!(32, 0, 0, 0)); + check_cast::, console_root::types::U32>(Mode::Public, count_is!(0, 0, 32, 33)); + check_cast::, console_root::types::U32>(Mode::Private, count_is!(0, 0, 32, 33)); } #[test] fn test_field_to_u64() { - check_cast::, console_root::types::U64>(Mode::Constant, count_is!(64, 0, 0, 0)); - check_cast::, console_root::types::U64>(Mode::Public, count_is!(0, 0, 64, 65)); - check_cast::, console_root::types::U64>(Mode::Private, count_is!(0, 0, 64, 65)); + check_cast::, console_root::types::U64>(Mode::Constant, count_is!(64, 0, 0, 0)); + check_cast::, console_root::types::U64>(Mode::Public, count_is!(0, 0, 64, 65)); + check_cast::, console_root::types::U64>(Mode::Private, count_is!(0, 0, 64, 65)); } #[test] fn test_field_to_u128() { - check_cast::, console_root::types::U128>(Mode::Constant, count_is!(128, 0, 0, 0)); - check_cast::, console_root::types::U128>(Mode::Public, count_is!(0, 0, 128, 129)); - check_cast::, console_root::types::U128>(Mode::Private, count_is!(0, 0, 128, 129)); + check_cast::, console_root::types::U128>(Mode::Constant, count_is!(128, 0, 0, 0)); + check_cast::, console_root::types::U128>(Mode::Public, count_is!(0, 0, 128, 129)); + check_cast::, console_root::types::U128>(Mode::Private, count_is!(0, 0, 128, 129)); } } diff --git a/circuit/program/src/data/literal/cast/integer.rs b/circuit/program/src/data/literal/cast/integer.rs index 78655df65d..c25eab04a5 100644 --- a/circuit/program/src/data/literal/cast/integer.rs +++ b/circuit/program/src/data/literal/cast/integer.rs @@ -143,7 +143,7 @@ mod tests { use super::*; use console::Cast as _; use console_root::{ - network::Testnet3, + network::MainnetV0, prelude::{One, TestRng, Uniform, Zero}, }; use snarkvm_circuit_types::environment::{count_is, count_less_than, Circuit, Eject, Inject, Mode, UpdatableCount}; @@ -156,13 +156,13 @@ mod tests { i: usize, mode: Mode, rng: &mut TestRng, - ) -> (console_root::types::integers::Integer, Integer) { + ) -> (console_root::types::integers::Integer, Integer) { let console_value = match i { - 0 => console_root::types::integers::Integer::::zero(), - 1 => console_root::types::integers::Integer::::one(), - 2 => console_root::types::integers::Integer::::new(I::MAX), - 3 => console_root::types::integers::Integer::::new(I::MIN), - 4 if I::is_signed() => -console_root::types::integers::Integer::::one(), + 0 => console_root::types::integers::Integer::::zero(), + 1 => console_root::types::integers::Integer::::one(), + 2 => console_root::types::integers::Integer::::new(I::MAX), + 3 => console_root::types::integers::Integer::::new(I::MIN), + 4 if I::is_signed() => -console_root::types::integers::Integer::::one(), _ => Uniform::rand(rng), }; let circuit_value = Integer::::new(mode, console_value); @@ -172,23 +172,23 @@ mod tests { mod i8 { use super::*; - fn sample_values(i: usize, mode: Mode, rng: &mut TestRng) -> (console_root::types::I8, I8) { + fn sample_values(i: usize, mode: Mode, rng: &mut TestRng) -> (console_root::types::I8, I8) { super::sample_values(i, mode, rng) } - impl_check_cast!(cast, I8, console_root::types::I8); + impl_check_cast!(cast, I8, console_root::types::I8); #[test] fn test_i8_to_address() { - check_cast::, console_root::types::Address>( + check_cast::, console_root::types::Address>( Mode::Constant, count_less_than!(11, 0, 0, 0), ); - check_cast::, console_root::types::Address>( + check_cast::, console_root::types::Address>( Mode::Public, count_is!(4, 0, 13, 13), ); - check_cast::, console_root::types::Address>( + check_cast::, console_root::types::Address>( Mode::Private, count_is!(4, 0, 13, 13), ); @@ -196,15 +196,15 @@ mod tests { #[test] fn test_i8_to_boolean() { - check_cast::, console_root::types::Boolean>( + check_cast::, console_root::types::Boolean>( Mode::Constant, count_is!(16, 0, 0, 0), ); - check_cast::, console_root::types::Boolean>( + check_cast::, console_root::types::Boolean>( Mode::Public, count_is!(16, 0, 5, 6), ); - check_cast::, console_root::types::Boolean>( + check_cast::, console_root::types::Boolean>( Mode::Private, count_is!(16, 0, 5, 6), ); @@ -212,96 +212,99 @@ mod tests { #[test] fn test_i8_to_field() { - check_cast::, console_root::types::Field>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast::, console_root::types::Field>(Mode::Public, count_is!(0, 0, 0, 0)); - check_cast::, console_root::types::Field>(Mode::Private, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::Field>(Mode::Constant, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::Field>(Mode::Public, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::Field>(Mode::Private, count_is!(0, 0, 0, 0)); } #[test] fn test_i8_to_group() { - check_cast::, console_root::types::Group>( + check_cast::, console_root::types::Group>( Mode::Constant, count_less_than!(11, 0, 0, 0), ); - check_cast::, console_root::types::Group>(Mode::Public, count_is!(4, 0, 13, 13)); - check_cast::, console_root::types::Group>(Mode::Private, count_is!(4, 0, 13, 13)); + check_cast::, console_root::types::Group>(Mode::Public, count_is!(4, 0, 13, 13)); + check_cast::, console_root::types::Group>(Mode::Private, count_is!(4, 0, 13, 13)); } #[test] fn test_i8_to_i8() { - check_cast::, console_root::types::I8>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast::, console_root::types::I8>(Mode::Public, count_is!(0, 0, 0, 0)); - check_cast::, console_root::types::I8>(Mode::Private, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::I8>(Mode::Constant, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::I8>(Mode::Public, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::I8>(Mode::Private, count_is!(0, 0, 0, 0)); } #[test] fn test_i8_to_i16() { - check_cast::, console_root::types::I16>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast::, console_root::types::I16>(Mode::Public, count_is!(0, 0, 0, 0)); - check_cast::, console_root::types::I16>(Mode::Private, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::I16>(Mode::Constant, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::I16>(Mode::Public, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::I16>(Mode::Private, count_is!(0, 0, 0, 0)); } #[test] fn test_i8_to_i32() { - check_cast::, console_root::types::I32>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast::, console_root::types::I32>(Mode::Public, count_is!(0, 0, 0, 0)); - check_cast::, console_root::types::I32>(Mode::Private, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::I32>(Mode::Constant, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::I32>(Mode::Public, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::I32>(Mode::Private, count_is!(0, 0, 0, 0)); } #[test] fn test_i8_to_i64() { - check_cast::, console_root::types::I64>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast::, console_root::types::I64>(Mode::Public, count_is!(0, 0, 0, 0)); - check_cast::, console_root::types::I64>(Mode::Private, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::I64>(Mode::Constant, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::I64>(Mode::Public, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::I64>(Mode::Private, count_is!(0, 0, 0, 0)); } #[test] fn test_i8_to_i128() { - check_cast::, console_root::types::I128>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast::, console_root::types::I128>(Mode::Public, count_is!(0, 0, 0, 0)); - check_cast::, console_root::types::I128>(Mode::Private, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::I128>(Mode::Constant, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::I128>(Mode::Public, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::I128>(Mode::Private, count_is!(0, 0, 0, 0)); } #[test] fn test_i8_to_scalar() { - check_cast::, console_root::types::Scalar>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast::, console_root::types::Scalar>(Mode::Public, count_is!(0, 0, 0, 0)); - check_cast::, console_root::types::Scalar>(Mode::Private, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::Scalar>( + Mode::Constant, + count_is!(0, 0, 0, 0), + ); + check_cast::, console_root::types::Scalar>(Mode::Public, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::Scalar>(Mode::Private, count_is!(0, 0, 0, 0)); } #[test] fn test_i8_to_u8() { - check_cast::, console_root::types::U8>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast::, console_root::types::U8>(Mode::Public, count_is!(0, 0, 0, 1)); - check_cast::, console_root::types::U8>(Mode::Private, count_is!(0, 0, 0, 1)); + check_cast::, console_root::types::U8>(Mode::Constant, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::U8>(Mode::Public, count_is!(0, 0, 0, 1)); + check_cast::, console_root::types::U8>(Mode::Private, count_is!(0, 0, 0, 1)); } #[test] fn test_i8_to_u16() { - check_cast::, console_root::types::U16>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast::, console_root::types::U16>(Mode::Public, count_is!(0, 0, 0, 1)); - check_cast::, console_root::types::U16>(Mode::Private, count_is!(0, 0, 0, 1)); + check_cast::, console_root::types::U16>(Mode::Constant, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::U16>(Mode::Public, count_is!(0, 0, 0, 1)); + check_cast::, console_root::types::U16>(Mode::Private, count_is!(0, 0, 0, 1)); } #[test] fn test_i8_to_u32() { - check_cast::, console_root::types::U32>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast::, console_root::types::U32>(Mode::Public, count_is!(0, 0, 0, 1)); - check_cast::, console_root::types::U32>(Mode::Private, count_is!(0, 0, 0, 1)); + check_cast::, console_root::types::U32>(Mode::Constant, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::U32>(Mode::Public, count_is!(0, 0, 0, 1)); + check_cast::, console_root::types::U32>(Mode::Private, count_is!(0, 0, 0, 1)); } #[test] fn test_i8_to_u64() { - check_cast::, console_root::types::U64>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast::, console_root::types::U64>(Mode::Public, count_is!(0, 0, 0, 1)); - check_cast::, console_root::types::U64>(Mode::Private, count_is!(0, 0, 0, 1)); + check_cast::, console_root::types::U64>(Mode::Constant, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::U64>(Mode::Public, count_is!(0, 0, 0, 1)); + check_cast::, console_root::types::U64>(Mode::Private, count_is!(0, 0, 0, 1)); } #[test] fn test_i8_to_u128() { - check_cast::, console_root::types::U128>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast::, console_root::types::U128>(Mode::Public, count_is!(0, 0, 0, 1)); - check_cast::, console_root::types::U128>(Mode::Private, count_is!(0, 0, 0, 1)); + check_cast::, console_root::types::U128>(Mode::Constant, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::U128>(Mode::Public, count_is!(0, 0, 0, 1)); + check_cast::, console_root::types::U128>(Mode::Private, count_is!(0, 0, 0, 1)); } } @@ -312,23 +315,23 @@ mod tests { i: usize, mode: Mode, rng: &mut TestRng, - ) -> (console_root::types::I16, I16) { + ) -> (console_root::types::I16, I16) { super::sample_values(i, mode, rng) } - impl_check_cast!(cast, I16, console_root::types::I16); + impl_check_cast!(cast, I16, console_root::types::I16); #[test] fn test_i16_to_address() { - check_cast::, console_root::types::Address>( + check_cast::, console_root::types::Address>( Mode::Constant, count_less_than!(11, 0, 0, 0), ); - check_cast::, console_root::types::Address>( + check_cast::, console_root::types::Address>( Mode::Public, count_is!(4, 0, 13, 13), ); - check_cast::, console_root::types::Address>( + check_cast::, console_root::types::Address>( Mode::Private, count_is!(4, 0, 13, 13), ); @@ -336,15 +339,15 @@ mod tests { #[test] fn test_i16_to_boolean() { - check_cast::, console_root::types::Boolean>( + check_cast::, console_root::types::Boolean>( Mode::Constant, count_is!(32, 0, 0, 0), ); - check_cast::, console_root::types::Boolean>( + check_cast::, console_root::types::Boolean>( Mode::Public, count_is!(32, 0, 5, 6), ); - check_cast::, console_root::types::Boolean>( + check_cast::, console_root::types::Boolean>( Mode::Private, count_is!(32, 0, 5, 6), ); @@ -352,96 +355,99 @@ mod tests { #[test] fn test_i16_to_field() { - check_cast::, console_root::types::Field>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast::, console_root::types::Field>(Mode::Public, count_is!(0, 0, 0, 0)); - check_cast::, console_root::types::Field>(Mode::Private, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::Field>(Mode::Constant, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::Field>(Mode::Public, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::Field>(Mode::Private, count_is!(0, 0, 0, 0)); } #[test] fn test_i16_to_group() { - check_cast::, console_root::types::Group>( + check_cast::, console_root::types::Group>( Mode::Constant, count_less_than!(11, 0, 0, 0), ); - check_cast::, console_root::types::Group>(Mode::Public, count_is!(4, 0, 13, 13)); - check_cast::, console_root::types::Group>(Mode::Private, count_is!(4, 0, 13, 13)); + check_cast::, console_root::types::Group>(Mode::Public, count_is!(4, 0, 13, 13)); + check_cast::, console_root::types::Group>(Mode::Private, count_is!(4, 0, 13, 13)); } #[test] fn test_i16_to_i8() { - check_cast::, console_root::types::I8>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast::, console_root::types::I8>(Mode::Public, count_is!(0, 0, 0, 8)); - check_cast::, console_root::types::I8>(Mode::Private, count_is!(0, 0, 0, 8)); + check_cast::, console_root::types::I8>(Mode::Constant, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::I8>(Mode::Public, count_is!(0, 0, 0, 8)); + check_cast::, console_root::types::I8>(Mode::Private, count_is!(0, 0, 0, 8)); } #[test] fn test_i16_to_i16() { - check_cast::, console_root::types::I16>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast::, console_root::types::I16>(Mode::Public, count_is!(0, 0, 0, 0)); - check_cast::, console_root::types::I16>(Mode::Private, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::I16>(Mode::Constant, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::I16>(Mode::Public, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::I16>(Mode::Private, count_is!(0, 0, 0, 0)); } #[test] fn test_i16_to_i32() { - check_cast::, console_root::types::I32>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast::, console_root::types::I32>(Mode::Public, count_is!(0, 0, 0, 0)); - check_cast::, console_root::types::I32>(Mode::Private, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::I32>(Mode::Constant, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::I32>(Mode::Public, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::I32>(Mode::Private, count_is!(0, 0, 0, 0)); } #[test] fn test_i16_to_i64() { - check_cast::, console_root::types::I64>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast::, console_root::types::I64>(Mode::Public, count_is!(0, 0, 0, 0)); - check_cast::, console_root::types::I64>(Mode::Private, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::I64>(Mode::Constant, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::I64>(Mode::Public, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::I64>(Mode::Private, count_is!(0, 0, 0, 0)); } #[test] fn test_i16_to_i128() { - check_cast::, console_root::types::I128>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast::, console_root::types::I128>(Mode::Public, count_is!(0, 0, 0, 0)); - check_cast::, console_root::types::I128>(Mode::Private, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::I128>(Mode::Constant, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::I128>(Mode::Public, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::I128>(Mode::Private, count_is!(0, 0, 0, 0)); } #[test] fn test_i16_to_scalar() { - check_cast::, console_root::types::Scalar>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast::, console_root::types::Scalar>(Mode::Public, count_is!(0, 0, 0, 0)); - check_cast::, console_root::types::Scalar>(Mode::Private, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::Scalar>( + Mode::Constant, + count_is!(0, 0, 0, 0), + ); + check_cast::, console_root::types::Scalar>(Mode::Public, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::Scalar>(Mode::Private, count_is!(0, 0, 0, 0)); } #[test] fn test_i16_to_u8() { - check_cast::, console_root::types::U8>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast::, console_root::types::U8>(Mode::Public, count_is!(0, 0, 0, 1)); - check_cast::, console_root::types::U8>(Mode::Private, count_is!(0, 0, 0, 1)); + check_cast::, console_root::types::U8>(Mode::Constant, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::U8>(Mode::Public, count_is!(0, 0, 0, 1)); + check_cast::, console_root::types::U8>(Mode::Private, count_is!(0, 0, 0, 1)); } #[test] fn test_i16_to_u16() { - check_cast::, console_root::types::U16>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast::, console_root::types::U16>(Mode::Public, count_is!(0, 0, 0, 1)); - check_cast::, console_root::types::U16>(Mode::Private, count_is!(0, 0, 0, 1)); + check_cast::, console_root::types::U16>(Mode::Constant, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::U16>(Mode::Public, count_is!(0, 0, 0, 1)); + check_cast::, console_root::types::U16>(Mode::Private, count_is!(0, 0, 0, 1)); } #[test] fn test_i16_to_u32() { - check_cast::, console_root::types::U32>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast::, console_root::types::U32>(Mode::Public, count_is!(0, 0, 0, 1)); - check_cast::, console_root::types::U32>(Mode::Private, count_is!(0, 0, 0, 1)); + check_cast::, console_root::types::U32>(Mode::Constant, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::U32>(Mode::Public, count_is!(0, 0, 0, 1)); + check_cast::, console_root::types::U32>(Mode::Private, count_is!(0, 0, 0, 1)); } #[test] fn test_i16_to_u64() { - check_cast::, console_root::types::U64>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast::, console_root::types::U64>(Mode::Public, count_is!(0, 0, 0, 1)); - check_cast::, console_root::types::U64>(Mode::Private, count_is!(0, 0, 0, 1)); + check_cast::, console_root::types::U64>(Mode::Constant, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::U64>(Mode::Public, count_is!(0, 0, 0, 1)); + check_cast::, console_root::types::U64>(Mode::Private, count_is!(0, 0, 0, 1)); } #[test] fn test_i16_to_u128() { - check_cast::, console_root::types::U128>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast::, console_root::types::U128>(Mode::Public, count_is!(0, 0, 0, 1)); - check_cast::, console_root::types::U128>(Mode::Private, count_is!(0, 0, 0, 1)); + check_cast::, console_root::types::U128>(Mode::Constant, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::U128>(Mode::Public, count_is!(0, 0, 0, 1)); + check_cast::, console_root::types::U128>(Mode::Private, count_is!(0, 0, 0, 1)); } } @@ -452,23 +458,23 @@ mod tests { i: usize, mode: Mode, rng: &mut TestRng, - ) -> (console_root::types::I32, I32) { + ) -> (console_root::types::I32, I32) { super::sample_values(i, mode, rng) } - impl_check_cast!(cast, I32, console_root::types::I32); + impl_check_cast!(cast, I32, console_root::types::I32); #[test] fn test_i32_to_address() { - check_cast::, console_root::types::Address>( + check_cast::, console_root::types::Address>( Mode::Constant, count_less_than!(11, 0, 0, 0), ); - check_cast::, console_root::types::Address>( + check_cast::, console_root::types::Address>( Mode::Public, count_is!(4, 0, 13, 13), ); - check_cast::, console_root::types::Address>( + check_cast::, console_root::types::Address>( Mode::Private, count_is!(4, 0, 13, 13), ); @@ -476,15 +482,15 @@ mod tests { #[test] fn test_i32_to_boolean() { - check_cast::, console_root::types::Boolean>( + check_cast::, console_root::types::Boolean>( Mode::Constant, count_is!(64, 0, 0, 0), ); - check_cast::, console_root::types::Boolean>( + check_cast::, console_root::types::Boolean>( Mode::Public, count_is!(64, 0, 5, 6), ); - check_cast::, console_root::types::Boolean>( + check_cast::, console_root::types::Boolean>( Mode::Private, count_is!(64, 0, 5, 6), ); @@ -492,96 +498,99 @@ mod tests { #[test] fn test_i32_to_field() { - check_cast::, console_root::types::Field>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast::, console_root::types::Field>(Mode::Public, count_is!(0, 0, 0, 0)); - check_cast::, console_root::types::Field>(Mode::Private, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::Field>(Mode::Constant, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::Field>(Mode::Public, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::Field>(Mode::Private, count_is!(0, 0, 0, 0)); } #[test] fn test_i32_to_group() { - check_cast::, console_root::types::Group>( + check_cast::, console_root::types::Group>( Mode::Constant, count_less_than!(11, 0, 0, 0), ); - check_cast::, console_root::types::Group>(Mode::Public, count_is!(4, 0, 13, 13)); - check_cast::, console_root::types::Group>(Mode::Private, count_is!(4, 0, 13, 13)); + check_cast::, console_root::types::Group>(Mode::Public, count_is!(4, 0, 13, 13)); + check_cast::, console_root::types::Group>(Mode::Private, count_is!(4, 0, 13, 13)); } #[test] fn test_i32_to_i8() { - check_cast::, console_root::types::I8>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast::, console_root::types::I8>(Mode::Public, count_is!(0, 0, 0, 24)); - check_cast::, console_root::types::I8>(Mode::Private, count_is!(0, 0, 0, 24)); + check_cast::, console_root::types::I8>(Mode::Constant, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::I8>(Mode::Public, count_is!(0, 0, 0, 24)); + check_cast::, console_root::types::I8>(Mode::Private, count_is!(0, 0, 0, 24)); } #[test] fn test_i32_to_i16() { - check_cast::, console_root::types::I16>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast::, console_root::types::I16>(Mode::Public, count_is!(0, 0, 0, 16)); - check_cast::, console_root::types::I16>(Mode::Private, count_is!(0, 0, 0, 16)); + check_cast::, console_root::types::I16>(Mode::Constant, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::I16>(Mode::Public, count_is!(0, 0, 0, 16)); + check_cast::, console_root::types::I16>(Mode::Private, count_is!(0, 0, 0, 16)); } #[test] fn test_i32_to_i32() { - check_cast::, console_root::types::I32>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast::, console_root::types::I32>(Mode::Public, count_is!(0, 0, 0, 0)); - check_cast::, console_root::types::I32>(Mode::Private, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::I32>(Mode::Constant, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::I32>(Mode::Public, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::I32>(Mode::Private, count_is!(0, 0, 0, 0)); } #[test] fn test_i32_to_i64() { - check_cast::, console_root::types::I64>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast::, console_root::types::I64>(Mode::Public, count_is!(0, 0, 0, 0)); - check_cast::, console_root::types::I64>(Mode::Private, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::I64>(Mode::Constant, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::I64>(Mode::Public, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::I64>(Mode::Private, count_is!(0, 0, 0, 0)); } #[test] fn test_i32_to_i128() { - check_cast::, console_root::types::I128>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast::, console_root::types::I128>(Mode::Public, count_is!(0, 0, 0, 0)); - check_cast::, console_root::types::I128>(Mode::Private, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::I128>(Mode::Constant, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::I128>(Mode::Public, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::I128>(Mode::Private, count_is!(0, 0, 0, 0)); } #[test] fn test_i32_to_scalar() { - check_cast::, console_root::types::Scalar>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast::, console_root::types::Scalar>(Mode::Public, count_is!(0, 0, 0, 0)); - check_cast::, console_root::types::Scalar>(Mode::Private, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::Scalar>( + Mode::Constant, + count_is!(0, 0, 0, 0), + ); + check_cast::, console_root::types::Scalar>(Mode::Public, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::Scalar>(Mode::Private, count_is!(0, 0, 0, 0)); } #[test] fn test_i32_to_u8() { - check_cast::, console_root::types::U8>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast::, console_root::types::U8>(Mode::Public, count_is!(0, 0, 0, 1)); - check_cast::, console_root::types::U8>(Mode::Private, count_is!(0, 0, 0, 1)); + check_cast::, console_root::types::U8>(Mode::Constant, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::U8>(Mode::Public, count_is!(0, 0, 0, 1)); + check_cast::, console_root::types::U8>(Mode::Private, count_is!(0, 0, 0, 1)); } #[test] fn test_i32_to_u16() { - check_cast::, console_root::types::U16>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast::, console_root::types::U16>(Mode::Public, count_is!(0, 0, 0, 1)); - check_cast::, console_root::types::U16>(Mode::Private, count_is!(0, 0, 0, 1)); + check_cast::, console_root::types::U16>(Mode::Constant, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::U16>(Mode::Public, count_is!(0, 0, 0, 1)); + check_cast::, console_root::types::U16>(Mode::Private, count_is!(0, 0, 0, 1)); } #[test] fn test_i32_to_u32() { - check_cast::, console_root::types::U32>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast::, console_root::types::U32>(Mode::Public, count_is!(0, 0, 0, 1)); - check_cast::, console_root::types::U32>(Mode::Private, count_is!(0, 0, 0, 1)); + check_cast::, console_root::types::U32>(Mode::Constant, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::U32>(Mode::Public, count_is!(0, 0, 0, 1)); + check_cast::, console_root::types::U32>(Mode::Private, count_is!(0, 0, 0, 1)); } #[test] fn test_i32_to_u64() { - check_cast::, console_root::types::U64>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast::, console_root::types::U64>(Mode::Public, count_is!(0, 0, 0, 1)); - check_cast::, console_root::types::U64>(Mode::Private, count_is!(0, 0, 0, 1)); + check_cast::, console_root::types::U64>(Mode::Constant, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::U64>(Mode::Public, count_is!(0, 0, 0, 1)); + check_cast::, console_root::types::U64>(Mode::Private, count_is!(0, 0, 0, 1)); } #[test] fn test_i32_to_u128() { - check_cast::, console_root::types::U128>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast::, console_root::types::U128>(Mode::Public, count_is!(0, 0, 0, 1)); - check_cast::, console_root::types::U128>(Mode::Private, count_is!(0, 0, 0, 1)); + check_cast::, console_root::types::U128>(Mode::Constant, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::U128>(Mode::Public, count_is!(0, 0, 0, 1)); + check_cast::, console_root::types::U128>(Mode::Private, count_is!(0, 0, 0, 1)); } } @@ -592,23 +601,23 @@ mod tests { i: usize, mode: Mode, rng: &mut TestRng, - ) -> (console_root::types::I64, I64) { + ) -> (console_root::types::I64, I64) { super::sample_values(i, mode, rng) } - impl_check_cast!(cast, I64, console_root::types::I64); + impl_check_cast!(cast, I64, console_root::types::I64); #[test] fn test_i64_to_address() { - check_cast::, console_root::types::Address>( + check_cast::, console_root::types::Address>( Mode::Constant, count_less_than!(11, 0, 0, 0), ); - check_cast::, console_root::types::Address>( + check_cast::, console_root::types::Address>( Mode::Public, count_is!(4, 0, 13, 13), ); - check_cast::, console_root::types::Address>( + check_cast::, console_root::types::Address>( Mode::Private, count_is!(4, 0, 13, 13), ); @@ -616,15 +625,15 @@ mod tests { #[test] fn test_i64_to_boolean() { - check_cast::, console_root::types::Boolean>( + check_cast::, console_root::types::Boolean>( Mode::Constant, count_is!(128, 0, 0, 0), ); - check_cast::, console_root::types::Boolean>( + check_cast::, console_root::types::Boolean>( Mode::Public, count_is!(128, 0, 5, 6), ); - check_cast::, console_root::types::Boolean>( + check_cast::, console_root::types::Boolean>( Mode::Private, count_is!(128, 0, 5, 6), ); @@ -632,96 +641,99 @@ mod tests { #[test] fn test_i64_to_field() { - check_cast::, console_root::types::Field>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast::, console_root::types::Field>(Mode::Public, count_is!(0, 0, 0, 0)); - check_cast::, console_root::types::Field>(Mode::Private, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::Field>(Mode::Constant, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::Field>(Mode::Public, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::Field>(Mode::Private, count_is!(0, 0, 0, 0)); } #[test] fn test_i64_to_group() { - check_cast::, console_root::types::Group>( + check_cast::, console_root::types::Group>( Mode::Constant, count_less_than!(11, 0, 0, 0), ); - check_cast::, console_root::types::Group>(Mode::Public, count_is!(4, 0, 13, 13)); - check_cast::, console_root::types::Group>(Mode::Private, count_is!(4, 0, 13, 13)); + check_cast::, console_root::types::Group>(Mode::Public, count_is!(4, 0, 13, 13)); + check_cast::, console_root::types::Group>(Mode::Private, count_is!(4, 0, 13, 13)); } #[test] fn test_i64_to_i8() { - check_cast::, console_root::types::I8>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast::, console_root::types::I8>(Mode::Public, count_is!(0, 0, 0, 56)); - check_cast::, console_root::types::I8>(Mode::Private, count_is!(0, 0, 0, 56)); + check_cast::, console_root::types::I8>(Mode::Constant, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::I8>(Mode::Public, count_is!(0, 0, 0, 56)); + check_cast::, console_root::types::I8>(Mode::Private, count_is!(0, 0, 0, 56)); } #[test] fn test_i64_to_i16() { - check_cast::, console_root::types::I16>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast::, console_root::types::I16>(Mode::Public, count_is!(0, 0, 0, 48)); - check_cast::, console_root::types::I16>(Mode::Private, count_is!(0, 0, 0, 48)); + check_cast::, console_root::types::I16>(Mode::Constant, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::I16>(Mode::Public, count_is!(0, 0, 0, 48)); + check_cast::, console_root::types::I16>(Mode::Private, count_is!(0, 0, 0, 48)); } #[test] fn test_i64_to_i32() { - check_cast::, console_root::types::I32>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast::, console_root::types::I32>(Mode::Public, count_is!(0, 0, 0, 32)); - check_cast::, console_root::types::I32>(Mode::Private, count_is!(0, 0, 0, 32)); + check_cast::, console_root::types::I32>(Mode::Constant, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::I32>(Mode::Public, count_is!(0, 0, 0, 32)); + check_cast::, console_root::types::I32>(Mode::Private, count_is!(0, 0, 0, 32)); } #[test] fn test_i64_to_i64() { - check_cast::, console_root::types::I64>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast::, console_root::types::I64>(Mode::Public, count_is!(0, 0, 0, 0)); - check_cast::, console_root::types::I64>(Mode::Private, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::I64>(Mode::Constant, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::I64>(Mode::Public, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::I64>(Mode::Private, count_is!(0, 0, 0, 0)); } #[test] fn test_i64_to_i128() { - check_cast::, console_root::types::I128>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast::, console_root::types::I128>(Mode::Public, count_is!(0, 0, 0, 0)); - check_cast::, console_root::types::I128>(Mode::Private, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::I128>(Mode::Constant, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::I128>(Mode::Public, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::I128>(Mode::Private, count_is!(0, 0, 0, 0)); } #[test] fn test_i64_to_scalar() { - check_cast::, console_root::types::Scalar>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast::, console_root::types::Scalar>(Mode::Public, count_is!(0, 0, 0, 0)); - check_cast::, console_root::types::Scalar>(Mode::Private, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::Scalar>( + Mode::Constant, + count_is!(0, 0, 0, 0), + ); + check_cast::, console_root::types::Scalar>(Mode::Public, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::Scalar>(Mode::Private, count_is!(0, 0, 0, 0)); } #[test] fn test_i64_to_u8() { - check_cast::, console_root::types::U8>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast::, console_root::types::U8>(Mode::Public, count_is!(0, 0, 0, 1)); - check_cast::, console_root::types::U8>(Mode::Private, count_is!(0, 0, 0, 1)); + check_cast::, console_root::types::U8>(Mode::Constant, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::U8>(Mode::Public, count_is!(0, 0, 0, 1)); + check_cast::, console_root::types::U8>(Mode::Private, count_is!(0, 0, 0, 1)); } #[test] fn test_i64_to_u16() { - check_cast::, console_root::types::U16>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast::, console_root::types::U16>(Mode::Public, count_is!(0, 0, 0, 1)); - check_cast::, console_root::types::U16>(Mode::Private, count_is!(0, 0, 0, 1)); + check_cast::, console_root::types::U16>(Mode::Constant, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::U16>(Mode::Public, count_is!(0, 0, 0, 1)); + check_cast::, console_root::types::U16>(Mode::Private, count_is!(0, 0, 0, 1)); } #[test] fn test_i64_to_u32() { - check_cast::, console_root::types::U32>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast::, console_root::types::U32>(Mode::Public, count_is!(0, 0, 0, 1)); - check_cast::, console_root::types::U32>(Mode::Private, count_is!(0, 0, 0, 1)); + check_cast::, console_root::types::U32>(Mode::Constant, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::U32>(Mode::Public, count_is!(0, 0, 0, 1)); + check_cast::, console_root::types::U32>(Mode::Private, count_is!(0, 0, 0, 1)); } #[test] fn test_i64_to_u64() { - check_cast::, console_root::types::U64>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast::, console_root::types::U64>(Mode::Public, count_is!(0, 0, 0, 1)); - check_cast::, console_root::types::U64>(Mode::Private, count_is!(0, 0, 0, 1)); + check_cast::, console_root::types::U64>(Mode::Constant, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::U64>(Mode::Public, count_is!(0, 0, 0, 1)); + check_cast::, console_root::types::U64>(Mode::Private, count_is!(0, 0, 0, 1)); } #[test] fn test_i64_to_u128() { - check_cast::, console_root::types::U128>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast::, console_root::types::U128>(Mode::Public, count_is!(0, 0, 0, 1)); - check_cast::, console_root::types::U128>(Mode::Private, count_is!(0, 0, 0, 1)); + check_cast::, console_root::types::U128>(Mode::Constant, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::U128>(Mode::Public, count_is!(0, 0, 0, 1)); + check_cast::, console_root::types::U128>(Mode::Private, count_is!(0, 0, 0, 1)); } } @@ -732,23 +744,23 @@ mod tests { i: usize, mode: Mode, rng: &mut TestRng, - ) -> (console_root::types::I128, I128) { + ) -> (console_root::types::I128, I128) { super::sample_values(i, mode, rng) } - impl_check_cast!(cast, I128, console_root::types::I128); + impl_check_cast!(cast, I128, console_root::types::I128); #[test] fn test_i128_to_address() { - check_cast::, console_root::types::Address>( + check_cast::, console_root::types::Address>( Mode::Constant, count_less_than!(11, 0, 0, 0), ); - check_cast::, console_root::types::Address>( + check_cast::, console_root::types::Address>( Mode::Public, count_is!(4, 0, 13, 13), ); - check_cast::, console_root::types::Address>( + check_cast::, console_root::types::Address>( Mode::Private, count_is!(4, 0, 13, 13), ); @@ -756,15 +768,15 @@ mod tests { #[test] fn test_i128_to_boolean() { - check_cast::, console_root::types::Boolean>( + check_cast::, console_root::types::Boolean>( Mode::Constant, count_is!(256, 0, 0, 0), ); - check_cast::, console_root::types::Boolean>( + check_cast::, console_root::types::Boolean>( Mode::Public, count_is!(256, 0, 5, 6), ); - check_cast::, console_root::types::Boolean>( + check_cast::, console_root::types::Boolean>( Mode::Private, count_is!(256, 0, 5, 6), ); @@ -772,119 +784,122 @@ mod tests { #[test] fn test_i128_to_field() { - check_cast::, console_root::types::Field>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast::, console_root::types::Field>(Mode::Public, count_is!(0, 0, 0, 0)); - check_cast::, console_root::types::Field>(Mode::Private, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::Field>(Mode::Constant, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::Field>(Mode::Public, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::Field>(Mode::Private, count_is!(0, 0, 0, 0)); } #[test] fn test_i128_to_group() { - check_cast::, console_root::types::Group>( + check_cast::, console_root::types::Group>( Mode::Constant, count_less_than!(11, 0, 0, 0), ); - check_cast::, console_root::types::Group>(Mode::Public, count_is!(4, 0, 13, 13)); - check_cast::, console_root::types::Group>(Mode::Private, count_is!(4, 0, 13, 13)); + check_cast::, console_root::types::Group>(Mode::Public, count_is!(4, 0, 13, 13)); + check_cast::, console_root::types::Group>(Mode::Private, count_is!(4, 0, 13, 13)); } #[test] fn test_i128_to_i8() { - check_cast::, console_root::types::I8>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast::, console_root::types::I8>(Mode::Public, count_is!(0, 0, 0, 120)); - check_cast::, console_root::types::I8>(Mode::Private, count_is!(0, 0, 0, 120)); + check_cast::, console_root::types::I8>(Mode::Constant, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::I8>(Mode::Public, count_is!(0, 0, 0, 120)); + check_cast::, console_root::types::I8>(Mode::Private, count_is!(0, 0, 0, 120)); } #[test] fn test_i128_to_i16() { - check_cast::, console_root::types::I16>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast::, console_root::types::I16>(Mode::Public, count_is!(0, 0, 0, 112)); - check_cast::, console_root::types::I16>(Mode::Private, count_is!(0, 0, 0, 112)); + check_cast::, console_root::types::I16>(Mode::Constant, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::I16>(Mode::Public, count_is!(0, 0, 0, 112)); + check_cast::, console_root::types::I16>(Mode::Private, count_is!(0, 0, 0, 112)); } #[test] fn test_i128_to_i32() { - check_cast::, console_root::types::I32>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast::, console_root::types::I32>(Mode::Public, count_is!(0, 0, 0, 96)); - check_cast::, console_root::types::I32>(Mode::Private, count_is!(0, 0, 0, 96)); + check_cast::, console_root::types::I32>(Mode::Constant, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::I32>(Mode::Public, count_is!(0, 0, 0, 96)); + check_cast::, console_root::types::I32>(Mode::Private, count_is!(0, 0, 0, 96)); } #[test] fn test_i128_to_i64() { - check_cast::, console_root::types::I64>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast::, console_root::types::I64>(Mode::Public, count_is!(0, 0, 0, 64)); - check_cast::, console_root::types::I64>(Mode::Private, count_is!(0, 0, 0, 64)); + check_cast::, console_root::types::I64>(Mode::Constant, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::I64>(Mode::Public, count_is!(0, 0, 0, 64)); + check_cast::, console_root::types::I64>(Mode::Private, count_is!(0, 0, 0, 64)); } #[test] fn test_i128_to_i128() { - check_cast::, console_root::types::I128>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast::, console_root::types::I128>(Mode::Public, count_is!(0, 0, 0, 0)); - check_cast::, console_root::types::I128>(Mode::Private, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::I128>(Mode::Constant, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::I128>(Mode::Public, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::I128>(Mode::Private, count_is!(0, 0, 0, 0)); } #[test] fn test_i128_to_scalar() { - check_cast::, console_root::types::Scalar>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast::, console_root::types::Scalar>(Mode::Public, count_is!(0, 0, 0, 0)); - check_cast::, console_root::types::Scalar>(Mode::Private, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::Scalar>( + Mode::Constant, + count_is!(0, 0, 0, 0), + ); + check_cast::, console_root::types::Scalar>(Mode::Public, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::Scalar>(Mode::Private, count_is!(0, 0, 0, 0)); } #[test] fn test_i128_to_u8() { - check_cast::, console_root::types::U8>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast::, console_root::types::U8>(Mode::Public, count_is!(0, 0, 0, 1)); - check_cast::, console_root::types::U8>(Mode::Private, count_is!(0, 0, 0, 1)); + check_cast::, console_root::types::U8>(Mode::Constant, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::U8>(Mode::Public, count_is!(0, 0, 0, 1)); + check_cast::, console_root::types::U8>(Mode::Private, count_is!(0, 0, 0, 1)); } #[test] fn test_i128_to_u16() { - check_cast::, console_root::types::U16>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast::, console_root::types::U16>(Mode::Public, count_is!(0, 0, 0, 1)); - check_cast::, console_root::types::U16>(Mode::Private, count_is!(0, 0, 0, 1)); + check_cast::, console_root::types::U16>(Mode::Constant, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::U16>(Mode::Public, count_is!(0, 0, 0, 1)); + check_cast::, console_root::types::U16>(Mode::Private, count_is!(0, 0, 0, 1)); } #[test] fn test_i128_to_u32() { - check_cast::, console_root::types::U32>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast::, console_root::types::U32>(Mode::Public, count_is!(0, 0, 0, 1)); - check_cast::, console_root::types::U32>(Mode::Private, count_is!(0, 0, 0, 1)); + check_cast::, console_root::types::U32>(Mode::Constant, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::U32>(Mode::Public, count_is!(0, 0, 0, 1)); + check_cast::, console_root::types::U32>(Mode::Private, count_is!(0, 0, 0, 1)); } #[test] fn test_i128_to_u64() { - check_cast::, console_root::types::U64>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast::, console_root::types::U64>(Mode::Public, count_is!(0, 0, 0, 1)); - check_cast::, console_root::types::U64>(Mode::Private, count_is!(0, 0, 0, 1)); + check_cast::, console_root::types::U64>(Mode::Constant, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::U64>(Mode::Public, count_is!(0, 0, 0, 1)); + check_cast::, console_root::types::U64>(Mode::Private, count_is!(0, 0, 0, 1)); } #[test] fn test_i128_to_u128() { - check_cast::, console_root::types::U128>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast::, console_root::types::U128>(Mode::Public, count_is!(0, 0, 0, 1)); - check_cast::, console_root::types::U128>(Mode::Private, count_is!(0, 0, 0, 1)); + check_cast::, console_root::types::U128>(Mode::Constant, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::U128>(Mode::Public, count_is!(0, 0, 0, 1)); + check_cast::, console_root::types::U128>(Mode::Private, count_is!(0, 0, 0, 1)); } } mod u8 { use super::*; - fn sample_values(i: usize, mode: Mode, rng: &mut TestRng) -> (console_root::types::U8, U8) { + fn sample_values(i: usize, mode: Mode, rng: &mut TestRng) -> (console_root::types::U8, U8) { super::sample_values(i, mode, rng) } - impl_check_cast!(cast, U8, console_root::types::U8); + impl_check_cast!(cast, U8, console_root::types::U8); #[test] fn test_u8_to_address() { - check_cast::, console_root::types::Address>( + check_cast::, console_root::types::Address>( Mode::Constant, count_less_than!(11, 0, 0, 0), ); - check_cast::, console_root::types::Address>( + check_cast::, console_root::types::Address>( Mode::Public, count_is!(4, 0, 13, 13), ); - check_cast::, console_root::types::Address>( + check_cast::, console_root::types::Address>( Mode::Private, count_is!(4, 0, 13, 13), ); @@ -892,15 +907,15 @@ mod tests { #[test] fn test_u8_to_boolean() { - check_cast::, console_root::types::Boolean>( + check_cast::, console_root::types::Boolean>( Mode::Constant, count_is!(16, 0, 0, 0), ); - check_cast::, console_root::types::Boolean>( + check_cast::, console_root::types::Boolean>( Mode::Public, count_is!(16, 0, 5, 6), ); - check_cast::, console_root::types::Boolean>( + check_cast::, console_root::types::Boolean>( Mode::Private, count_is!(16, 0, 5, 6), ); @@ -908,96 +923,99 @@ mod tests { #[test] fn test_u8_to_field() { - check_cast::, console_root::types::Field>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast::, console_root::types::Field>(Mode::Public, count_is!(0, 0, 0, 0)); - check_cast::, console_root::types::Field>(Mode::Private, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::Field>(Mode::Constant, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::Field>(Mode::Public, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::Field>(Mode::Private, count_is!(0, 0, 0, 0)); } #[test] fn test_u8_to_group() { - check_cast::, console_root::types::Group>( + check_cast::, console_root::types::Group>( Mode::Constant, count_less_than!(11, 0, 0, 0), ); - check_cast::, console_root::types::Group>(Mode::Public, count_is!(4, 0, 13, 13)); - check_cast::, console_root::types::Group>(Mode::Private, count_is!(4, 0, 13, 13)); + check_cast::, console_root::types::Group>(Mode::Public, count_is!(4, 0, 13, 13)); + check_cast::, console_root::types::Group>(Mode::Private, count_is!(4, 0, 13, 13)); } #[test] fn test_u8_to_i8() { - check_cast::, console_root::types::I8>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast::, console_root::types::I8>(Mode::Public, count_is!(0, 0, 0, 1)); - check_cast::, console_root::types::I8>(Mode::Private, count_is!(0, 0, 0, 1)); + check_cast::, console_root::types::I8>(Mode::Constant, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::I8>(Mode::Public, count_is!(0, 0, 0, 1)); + check_cast::, console_root::types::I8>(Mode::Private, count_is!(0, 0, 0, 1)); } #[test] fn test_u8_to_i16() { - check_cast::, console_root::types::I16>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast::, console_root::types::I16>(Mode::Public, count_is!(0, 0, 0, 0)); - check_cast::, console_root::types::I16>(Mode::Private, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::I16>(Mode::Constant, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::I16>(Mode::Public, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::I16>(Mode::Private, count_is!(0, 0, 0, 0)); } #[test] fn test_u8_to_i32() { - check_cast::, console_root::types::I32>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast::, console_root::types::I32>(Mode::Public, count_is!(0, 0, 0, 0)); - check_cast::, console_root::types::I32>(Mode::Private, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::I32>(Mode::Constant, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::I32>(Mode::Public, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::I32>(Mode::Private, count_is!(0, 0, 0, 0)); } #[test] fn test_u8_to_i64() { - check_cast::, console_root::types::I64>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast::, console_root::types::I64>(Mode::Public, count_is!(0, 0, 0, 0)); - check_cast::, console_root::types::I64>(Mode::Private, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::I64>(Mode::Constant, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::I64>(Mode::Public, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::I64>(Mode::Private, count_is!(0, 0, 0, 0)); } #[test] fn test_u8_to_i128() { - check_cast::, console_root::types::I128>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast::, console_root::types::I128>(Mode::Public, count_is!(0, 0, 0, 0)); - check_cast::, console_root::types::I128>(Mode::Private, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::I128>(Mode::Constant, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::I128>(Mode::Public, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::I128>(Mode::Private, count_is!(0, 0, 0, 0)); } #[test] fn test_u8_to_scalar() { - check_cast::, console_root::types::Scalar>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast::, console_root::types::Scalar>(Mode::Public, count_is!(0, 0, 0, 0)); - check_cast::, console_root::types::Scalar>(Mode::Private, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::Scalar>( + Mode::Constant, + count_is!(0, 0, 0, 0), + ); + check_cast::, console_root::types::Scalar>(Mode::Public, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::Scalar>(Mode::Private, count_is!(0, 0, 0, 0)); } #[test] fn test_u8_to_u8() { - check_cast::, console_root::types::U8>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast::, console_root::types::U8>(Mode::Public, count_is!(0, 0, 0, 0)); - check_cast::, console_root::types::U8>(Mode::Private, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::U8>(Mode::Constant, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::U8>(Mode::Public, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::U8>(Mode::Private, count_is!(0, 0, 0, 0)); } #[test] fn test_u8_to_u16() { - check_cast::, console_root::types::U16>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast::, console_root::types::U16>(Mode::Public, count_is!(0, 0, 0, 0)); - check_cast::, console_root::types::U16>(Mode::Private, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::U16>(Mode::Constant, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::U16>(Mode::Public, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::U16>(Mode::Private, count_is!(0, 0, 0, 0)); } #[test] fn test_u8_to_u32() { - check_cast::, console_root::types::U32>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast::, console_root::types::U32>(Mode::Public, count_is!(0, 0, 0, 0)); - check_cast::, console_root::types::U32>(Mode::Private, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::U32>(Mode::Constant, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::U32>(Mode::Public, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::U32>(Mode::Private, count_is!(0, 0, 0, 0)); } #[test] fn test_u8_to_u64() { - check_cast::, console_root::types::U64>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast::, console_root::types::U64>(Mode::Public, count_is!(0, 0, 0, 0)); - check_cast::, console_root::types::U64>(Mode::Private, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::U64>(Mode::Constant, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::U64>(Mode::Public, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::U64>(Mode::Private, count_is!(0, 0, 0, 0)); } #[test] fn test_u8_to_u128() { - check_cast::, console_root::types::U128>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast::, console_root::types::U128>(Mode::Public, count_is!(0, 0, 0, 0)); - check_cast::, console_root::types::U128>(Mode::Private, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::U128>(Mode::Constant, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::U128>(Mode::Public, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::U128>(Mode::Private, count_is!(0, 0, 0, 0)); } } @@ -1008,23 +1026,23 @@ mod tests { i: usize, mode: Mode, rng: &mut TestRng, - ) -> (console_root::types::U16, U16) { + ) -> (console_root::types::U16, U16) { super::sample_values(i, mode, rng) } - impl_check_cast!(cast, U16, console_root::types::U16); + impl_check_cast!(cast, U16, console_root::types::U16); #[test] fn test_u16_to_address() { - check_cast::, console_root::types::Address>( + check_cast::, console_root::types::Address>( Mode::Constant, count_less_than!(11, 0, 0, 0), ); - check_cast::, console_root::types::Address>( + check_cast::, console_root::types::Address>( Mode::Public, count_is!(4, 0, 13, 13), ); - check_cast::, console_root::types::Address>( + check_cast::, console_root::types::Address>( Mode::Private, count_is!(4, 0, 13, 13), ); @@ -1032,15 +1050,15 @@ mod tests { #[test] fn test_u16_to_boolean() { - check_cast::, console_root::types::Boolean>( + check_cast::, console_root::types::Boolean>( Mode::Constant, count_is!(32, 0, 0, 0), ); - check_cast::, console_root::types::Boolean>( + check_cast::, console_root::types::Boolean>( Mode::Public, count_is!(32, 0, 5, 6), ); - check_cast::, console_root::types::Boolean>( + check_cast::, console_root::types::Boolean>( Mode::Private, count_is!(32, 0, 5, 6), ); @@ -1048,96 +1066,99 @@ mod tests { #[test] fn test_u16_to_field() { - check_cast::, console_root::types::Field>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast::, console_root::types::Field>(Mode::Public, count_is!(0, 0, 0, 0)); - check_cast::, console_root::types::Field>(Mode::Private, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::Field>(Mode::Constant, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::Field>(Mode::Public, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::Field>(Mode::Private, count_is!(0, 0, 0, 0)); } #[test] fn test_u16_to_group() { - check_cast::, console_root::types::Group>( + check_cast::, console_root::types::Group>( Mode::Constant, count_less_than!(11, 0, 0, 0), ); - check_cast::, console_root::types::Group>(Mode::Public, count_is!(4, 0, 13, 13)); - check_cast::, console_root::types::Group>(Mode::Private, count_is!(4, 0, 13, 13)); + check_cast::, console_root::types::Group>(Mode::Public, count_is!(4, 0, 13, 13)); + check_cast::, console_root::types::Group>(Mode::Private, count_is!(4, 0, 13, 13)); } #[test] fn test_u16_to_i8() { - check_cast::, console_root::types::I8>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast::, console_root::types::I8>(Mode::Public, count_is!(0, 0, 0, 1)); - check_cast::, console_root::types::I8>(Mode::Private, count_is!(0, 0, 0, 1)); + check_cast::, console_root::types::I8>(Mode::Constant, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::I8>(Mode::Public, count_is!(0, 0, 0, 1)); + check_cast::, console_root::types::I8>(Mode::Private, count_is!(0, 0, 0, 1)); } #[test] fn test_u16_to_i16() { - check_cast::, console_root::types::I16>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast::, console_root::types::I16>(Mode::Public, count_is!(0, 0, 0, 1)); - check_cast::, console_root::types::I16>(Mode::Private, count_is!(0, 0, 0, 1)); + check_cast::, console_root::types::I16>(Mode::Constant, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::I16>(Mode::Public, count_is!(0, 0, 0, 1)); + check_cast::, console_root::types::I16>(Mode::Private, count_is!(0, 0, 0, 1)); } #[test] fn test_u16_to_i32() { - check_cast::, console_root::types::I32>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast::, console_root::types::I32>(Mode::Public, count_is!(0, 0, 0, 0)); - check_cast::, console_root::types::I32>(Mode::Private, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::I32>(Mode::Constant, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::I32>(Mode::Public, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::I32>(Mode::Private, count_is!(0, 0, 0, 0)); } #[test] fn test_u16_to_i64() { - check_cast::, console_root::types::I64>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast::, console_root::types::I64>(Mode::Public, count_is!(0, 0, 0, 0)); - check_cast::, console_root::types::I64>(Mode::Private, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::I64>(Mode::Constant, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::I64>(Mode::Public, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::I64>(Mode::Private, count_is!(0, 0, 0, 0)); } #[test] fn test_u16_to_i128() { - check_cast::, console_root::types::I128>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast::, console_root::types::I128>(Mode::Public, count_is!(0, 0, 0, 0)); - check_cast::, console_root::types::I128>(Mode::Private, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::I128>(Mode::Constant, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::I128>(Mode::Public, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::I128>(Mode::Private, count_is!(0, 0, 0, 0)); } #[test] fn test_u16_to_scalar() { - check_cast::, console_root::types::Scalar>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast::, console_root::types::Scalar>(Mode::Public, count_is!(0, 0, 0, 0)); - check_cast::, console_root::types::Scalar>(Mode::Private, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::Scalar>( + Mode::Constant, + count_is!(0, 0, 0, 0), + ); + check_cast::, console_root::types::Scalar>(Mode::Public, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::Scalar>(Mode::Private, count_is!(0, 0, 0, 0)); } #[test] fn test_u16_to_u8() { - check_cast::, console_root::types::U8>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast::, console_root::types::U8>(Mode::Public, count_is!(0, 0, 0, 1)); - check_cast::, console_root::types::U8>(Mode::Private, count_is!(0, 0, 0, 1)); + check_cast::, console_root::types::U8>(Mode::Constant, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::U8>(Mode::Public, count_is!(0, 0, 0, 1)); + check_cast::, console_root::types::U8>(Mode::Private, count_is!(0, 0, 0, 1)); } #[test] fn test_u16_to_u16() { - check_cast::, console_root::types::U16>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast::, console_root::types::U16>(Mode::Public, count_is!(0, 0, 0, 0)); - check_cast::, console_root::types::U16>(Mode::Private, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::U16>(Mode::Constant, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::U16>(Mode::Public, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::U16>(Mode::Private, count_is!(0, 0, 0, 0)); } #[test] fn test_u16_to_u32() { - check_cast::, console_root::types::U32>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast::, console_root::types::U32>(Mode::Public, count_is!(0, 0, 0, 0)); - check_cast::, console_root::types::U32>(Mode::Private, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::U32>(Mode::Constant, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::U32>(Mode::Public, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::U32>(Mode::Private, count_is!(0, 0, 0, 0)); } #[test] fn test_u16_to_u64() { - check_cast::, console_root::types::U64>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast::, console_root::types::U64>(Mode::Public, count_is!(0, 0, 0, 0)); - check_cast::, console_root::types::U64>(Mode::Private, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::U64>(Mode::Constant, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::U64>(Mode::Public, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::U64>(Mode::Private, count_is!(0, 0, 0, 0)); } #[test] fn test_u16_to_u128() { - check_cast::, console_root::types::U128>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast::, console_root::types::U128>(Mode::Public, count_is!(0, 0, 0, 0)); - check_cast::, console_root::types::U128>(Mode::Private, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::U128>(Mode::Constant, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::U128>(Mode::Public, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::U128>(Mode::Private, count_is!(0, 0, 0, 0)); } } @@ -1148,23 +1169,23 @@ mod tests { i: usize, mode: Mode, rng: &mut TestRng, - ) -> (console_root::types::U32, U32) { + ) -> (console_root::types::U32, U32) { super::sample_values(i, mode, rng) } - impl_check_cast!(cast, U32, console_root::types::U32); + impl_check_cast!(cast, U32, console_root::types::U32); #[test] fn test_u32_to_address() { - check_cast::, console_root::types::Address>( + check_cast::, console_root::types::Address>( Mode::Constant, count_less_than!(11, 0, 0, 0), ); - check_cast::, console_root::types::Address>( + check_cast::, console_root::types::Address>( Mode::Public, count_is!(4, 0, 13, 13), ); - check_cast::, console_root::types::Address>( + check_cast::, console_root::types::Address>( Mode::Private, count_is!(4, 0, 13, 13), ); @@ -1172,15 +1193,15 @@ mod tests { #[test] fn test_u32_to_boolean() { - check_cast::, console_root::types::Boolean>( + check_cast::, console_root::types::Boolean>( Mode::Constant, count_is!(64, 0, 0, 0), ); - check_cast::, console_root::types::Boolean>( + check_cast::, console_root::types::Boolean>( Mode::Public, count_is!(64, 0, 5, 6), ); - check_cast::, console_root::types::Boolean>( + check_cast::, console_root::types::Boolean>( Mode::Private, count_is!(64, 0, 5, 6), ); @@ -1188,96 +1209,99 @@ mod tests { #[test] fn test_u32_to_field() { - check_cast::, console_root::types::Field>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast::, console_root::types::Field>(Mode::Public, count_is!(0, 0, 0, 0)); - check_cast::, console_root::types::Field>(Mode::Private, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::Field>(Mode::Constant, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::Field>(Mode::Public, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::Field>(Mode::Private, count_is!(0, 0, 0, 0)); } #[test] fn test_u32_to_group() { - check_cast::, console_root::types::Group>( + check_cast::, console_root::types::Group>( Mode::Constant, count_less_than!(11, 0, 0, 0), ); - check_cast::, console_root::types::Group>(Mode::Public, count_is!(4, 0, 13, 13)); - check_cast::, console_root::types::Group>(Mode::Private, count_is!(4, 0, 13, 13)); + check_cast::, console_root::types::Group>(Mode::Public, count_is!(4, 0, 13, 13)); + check_cast::, console_root::types::Group>(Mode::Private, count_is!(4, 0, 13, 13)); } #[test] fn test_u32_to_i8() { - check_cast::, console_root::types::I8>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast::, console_root::types::I8>(Mode::Public, count_is!(0, 0, 0, 1)); - check_cast::, console_root::types::I8>(Mode::Private, count_is!(0, 0, 0, 1)); + check_cast::, console_root::types::I8>(Mode::Constant, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::I8>(Mode::Public, count_is!(0, 0, 0, 1)); + check_cast::, console_root::types::I8>(Mode::Private, count_is!(0, 0, 0, 1)); } #[test] fn test_u32_to_i16() { - check_cast::, console_root::types::I16>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast::, console_root::types::I16>(Mode::Public, count_is!(0, 0, 0, 1)); - check_cast::, console_root::types::I16>(Mode::Private, count_is!(0, 0, 0, 1)); + check_cast::, console_root::types::I16>(Mode::Constant, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::I16>(Mode::Public, count_is!(0, 0, 0, 1)); + check_cast::, console_root::types::I16>(Mode::Private, count_is!(0, 0, 0, 1)); } #[test] fn test_u32_to_i32() { - check_cast::, console_root::types::I32>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast::, console_root::types::I32>(Mode::Public, count_is!(0, 0, 0, 1)); - check_cast::, console_root::types::I32>(Mode::Private, count_is!(0, 0, 0, 1)); + check_cast::, console_root::types::I32>(Mode::Constant, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::I32>(Mode::Public, count_is!(0, 0, 0, 1)); + check_cast::, console_root::types::I32>(Mode::Private, count_is!(0, 0, 0, 1)); } #[test] fn test_u32_to_i64() { - check_cast::, console_root::types::I64>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast::, console_root::types::I64>(Mode::Public, count_is!(0, 0, 0, 0)); - check_cast::, console_root::types::I64>(Mode::Private, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::I64>(Mode::Constant, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::I64>(Mode::Public, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::I64>(Mode::Private, count_is!(0, 0, 0, 0)); } #[test] fn test_u32_to_i128() { - check_cast::, console_root::types::I128>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast::, console_root::types::I128>(Mode::Public, count_is!(0, 0, 0, 0)); - check_cast::, console_root::types::I128>(Mode::Private, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::I128>(Mode::Constant, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::I128>(Mode::Public, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::I128>(Mode::Private, count_is!(0, 0, 0, 0)); } #[test] fn test_u32_to_scalar() { - check_cast::, console_root::types::Scalar>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast::, console_root::types::Scalar>(Mode::Public, count_is!(0, 0, 0, 0)); - check_cast::, console_root::types::Scalar>(Mode::Private, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::Scalar>( + Mode::Constant, + count_is!(0, 0, 0, 0), + ); + check_cast::, console_root::types::Scalar>(Mode::Public, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::Scalar>(Mode::Private, count_is!(0, 0, 0, 0)); } #[test] fn test_u32_to_u8() { - check_cast::, console_root::types::U8>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast::, console_root::types::U8>(Mode::Public, count_is!(0, 0, 0, 1)); - check_cast::, console_root::types::U8>(Mode::Private, count_is!(0, 0, 0, 1)); + check_cast::, console_root::types::U8>(Mode::Constant, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::U8>(Mode::Public, count_is!(0, 0, 0, 1)); + check_cast::, console_root::types::U8>(Mode::Private, count_is!(0, 0, 0, 1)); } #[test] fn test_u32_to_u16() { - check_cast::, console_root::types::U16>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast::, console_root::types::U16>(Mode::Public, count_is!(0, 0, 0, 1)); - check_cast::, console_root::types::U16>(Mode::Private, count_is!(0, 0, 0, 1)); + check_cast::, console_root::types::U16>(Mode::Constant, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::U16>(Mode::Public, count_is!(0, 0, 0, 1)); + check_cast::, console_root::types::U16>(Mode::Private, count_is!(0, 0, 0, 1)); } #[test] fn test_u32_to_u32() { - check_cast::, console_root::types::U32>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast::, console_root::types::U32>(Mode::Public, count_is!(0, 0, 0, 0)); - check_cast::, console_root::types::U32>(Mode::Private, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::U32>(Mode::Constant, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::U32>(Mode::Public, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::U32>(Mode::Private, count_is!(0, 0, 0, 0)); } #[test] fn test_u32_to_u64() { - check_cast::, console_root::types::U64>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast::, console_root::types::U64>(Mode::Public, count_is!(0, 0, 0, 0)); - check_cast::, console_root::types::U64>(Mode::Private, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::U64>(Mode::Constant, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::U64>(Mode::Public, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::U64>(Mode::Private, count_is!(0, 0, 0, 0)); } #[test] fn test_u32_to_u128() { - check_cast::, console_root::types::U128>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast::, console_root::types::U128>(Mode::Public, count_is!(0, 0, 0, 0)); - check_cast::, console_root::types::U128>(Mode::Private, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::U128>(Mode::Constant, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::U128>(Mode::Public, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::U128>(Mode::Private, count_is!(0, 0, 0, 0)); } } @@ -1288,23 +1312,23 @@ mod tests { i: usize, mode: Mode, rng: &mut TestRng, - ) -> (console_root::types::U64, U64) { + ) -> (console_root::types::U64, U64) { super::sample_values(i, mode, rng) } - impl_check_cast!(cast, U64, console_root::types::U64); + impl_check_cast!(cast, U64, console_root::types::U64); #[test] fn test_u64_to_address() { - check_cast::, console_root::types::Address>( + check_cast::, console_root::types::Address>( Mode::Constant, count_less_than!(11, 0, 0, 0), ); - check_cast::, console_root::types::Address>( + check_cast::, console_root::types::Address>( Mode::Public, count_is!(4, 0, 13, 13), ); - check_cast::, console_root::types::Address>( + check_cast::, console_root::types::Address>( Mode::Private, count_is!(4, 0, 13, 13), ); @@ -1312,15 +1336,15 @@ mod tests { #[test] fn test_u64_to_boolean() { - check_cast::, console_root::types::Boolean>( + check_cast::, console_root::types::Boolean>( Mode::Constant, count_is!(128, 0, 0, 0), ); - check_cast::, console_root::types::Boolean>( + check_cast::, console_root::types::Boolean>( Mode::Public, count_is!(128, 0, 5, 6), ); - check_cast::, console_root::types::Boolean>( + check_cast::, console_root::types::Boolean>( Mode::Private, count_is!(128, 0, 5, 6), ); @@ -1328,96 +1352,99 @@ mod tests { #[test] fn test_u64_to_field() { - check_cast::, console_root::types::Field>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast::, console_root::types::Field>(Mode::Public, count_is!(0, 0, 0, 0)); - check_cast::, console_root::types::Field>(Mode::Private, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::Field>(Mode::Constant, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::Field>(Mode::Public, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::Field>(Mode::Private, count_is!(0, 0, 0, 0)); } #[test] fn test_u64_to_group() { - check_cast::, console_root::types::Group>( + check_cast::, console_root::types::Group>( Mode::Constant, count_less_than!(11, 0, 0, 0), ); - check_cast::, console_root::types::Group>(Mode::Public, count_is!(4, 0, 13, 13)); - check_cast::, console_root::types::Group>(Mode::Private, count_is!(4, 0, 13, 13)); + check_cast::, console_root::types::Group>(Mode::Public, count_is!(4, 0, 13, 13)); + check_cast::, console_root::types::Group>(Mode::Private, count_is!(4, 0, 13, 13)); } #[test] fn test_u64_to_i8() { - check_cast::, console_root::types::I8>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast::, console_root::types::I8>(Mode::Public, count_is!(0, 0, 0, 1)); - check_cast::, console_root::types::I8>(Mode::Private, count_is!(0, 0, 0, 1)); + check_cast::, console_root::types::I8>(Mode::Constant, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::I8>(Mode::Public, count_is!(0, 0, 0, 1)); + check_cast::, console_root::types::I8>(Mode::Private, count_is!(0, 0, 0, 1)); } #[test] fn test_u64_to_i16() { - check_cast::, console_root::types::I16>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast::, console_root::types::I16>(Mode::Public, count_is!(0, 0, 0, 1)); - check_cast::, console_root::types::I16>(Mode::Private, count_is!(0, 0, 0, 1)); + check_cast::, console_root::types::I16>(Mode::Constant, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::I16>(Mode::Public, count_is!(0, 0, 0, 1)); + check_cast::, console_root::types::I16>(Mode::Private, count_is!(0, 0, 0, 1)); } #[test] fn test_u64_to_i32() { - check_cast::, console_root::types::I32>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast::, console_root::types::I32>(Mode::Public, count_is!(0, 0, 0, 1)); - check_cast::, console_root::types::I32>(Mode::Private, count_is!(0, 0, 0, 1)); + check_cast::, console_root::types::I32>(Mode::Constant, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::I32>(Mode::Public, count_is!(0, 0, 0, 1)); + check_cast::, console_root::types::I32>(Mode::Private, count_is!(0, 0, 0, 1)); } #[test] fn test_u64_to_i64() { - check_cast::, console_root::types::I64>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast::, console_root::types::I64>(Mode::Public, count_is!(0, 0, 0, 1)); - check_cast::, console_root::types::I64>(Mode::Private, count_is!(0, 0, 0, 1)); + check_cast::, console_root::types::I64>(Mode::Constant, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::I64>(Mode::Public, count_is!(0, 0, 0, 1)); + check_cast::, console_root::types::I64>(Mode::Private, count_is!(0, 0, 0, 1)); } #[test] fn test_u64_to_i128() { - check_cast::, console_root::types::I128>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast::, console_root::types::I128>(Mode::Public, count_is!(0, 0, 0, 0)); - check_cast::, console_root::types::I128>(Mode::Private, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::I128>(Mode::Constant, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::I128>(Mode::Public, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::I128>(Mode::Private, count_is!(0, 0, 0, 0)); } #[test] fn test_u64_to_scalar() { - check_cast::, console_root::types::Scalar>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast::, console_root::types::Scalar>(Mode::Public, count_is!(0, 0, 0, 0)); - check_cast::, console_root::types::Scalar>(Mode::Private, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::Scalar>( + Mode::Constant, + count_is!(0, 0, 0, 0), + ); + check_cast::, console_root::types::Scalar>(Mode::Public, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::Scalar>(Mode::Private, count_is!(0, 0, 0, 0)); } #[test] fn test_u64_to_u8() { - check_cast::, console_root::types::U8>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast::, console_root::types::U8>(Mode::Public, count_is!(0, 0, 0, 1)); - check_cast::, console_root::types::U8>(Mode::Private, count_is!(0, 0, 0, 1)); + check_cast::, console_root::types::U8>(Mode::Constant, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::U8>(Mode::Public, count_is!(0, 0, 0, 1)); + check_cast::, console_root::types::U8>(Mode::Private, count_is!(0, 0, 0, 1)); } #[test] fn test_u64_to_u16() { - check_cast::, console_root::types::U16>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast::, console_root::types::U16>(Mode::Public, count_is!(0, 0, 0, 1)); - check_cast::, console_root::types::U16>(Mode::Private, count_is!(0, 0, 0, 1)); + check_cast::, console_root::types::U16>(Mode::Constant, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::U16>(Mode::Public, count_is!(0, 0, 0, 1)); + check_cast::, console_root::types::U16>(Mode::Private, count_is!(0, 0, 0, 1)); } #[test] fn test_u64_to_u32() { - check_cast::, console_root::types::U32>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast::, console_root::types::U32>(Mode::Public, count_is!(0, 0, 0, 1)); - check_cast::, console_root::types::U32>(Mode::Private, count_is!(0, 0, 0, 1)); + check_cast::, console_root::types::U32>(Mode::Constant, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::U32>(Mode::Public, count_is!(0, 0, 0, 1)); + check_cast::, console_root::types::U32>(Mode::Private, count_is!(0, 0, 0, 1)); } #[test] fn test_u64_to_u64() { - check_cast::, console_root::types::U64>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast::, console_root::types::U64>(Mode::Public, count_is!(0, 0, 0, 0)); - check_cast::, console_root::types::U64>(Mode::Private, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::U64>(Mode::Constant, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::U64>(Mode::Public, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::U64>(Mode::Private, count_is!(0, 0, 0, 0)); } #[test] fn test_u64_to_u128() { - check_cast::, console_root::types::U128>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast::, console_root::types::U128>(Mode::Public, count_is!(0, 0, 0, 0)); - check_cast::, console_root::types::U128>(Mode::Private, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::U128>(Mode::Constant, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::U128>(Mode::Public, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::U128>(Mode::Private, count_is!(0, 0, 0, 0)); } } @@ -1428,23 +1455,23 @@ mod tests { i: usize, mode: Mode, rng: &mut TestRng, - ) -> (console_root::types::U128, U128) { + ) -> (console_root::types::U128, U128) { super::sample_values(i, mode, rng) } - impl_check_cast!(cast, U128, console_root::types::U128); + impl_check_cast!(cast, U128, console_root::types::U128); #[test] fn test_u128_to_address() { - check_cast::, console_root::types::Address>( + check_cast::, console_root::types::Address>( Mode::Constant, count_less_than!(11, 0, 0, 0), ); - check_cast::, console_root::types::Address>( + check_cast::, console_root::types::Address>( Mode::Public, count_is!(4, 0, 13, 13), ); - check_cast::, console_root::types::Address>( + check_cast::, console_root::types::Address>( Mode::Private, count_is!(4, 0, 13, 13), ); @@ -1452,15 +1479,15 @@ mod tests { #[test] fn test_u128_to_boolean() { - check_cast::, console_root::types::Boolean>( + check_cast::, console_root::types::Boolean>( Mode::Constant, count_is!(256, 0, 0, 0), ); - check_cast::, console_root::types::Boolean>( + check_cast::, console_root::types::Boolean>( Mode::Public, count_is!(256, 0, 5, 6), ); - check_cast::, console_root::types::Boolean>( + check_cast::, console_root::types::Boolean>( Mode::Private, count_is!(256, 0, 5, 6), ); @@ -1468,96 +1495,99 @@ mod tests { #[test] fn test_u128_to_field() { - check_cast::, console_root::types::Field>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast::, console_root::types::Field>(Mode::Public, count_is!(0, 0, 0, 0)); - check_cast::, console_root::types::Field>(Mode::Private, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::Field>(Mode::Constant, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::Field>(Mode::Public, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::Field>(Mode::Private, count_is!(0, 0, 0, 0)); } #[test] fn test_u128_to_group() { - check_cast::, console_root::types::Group>( + check_cast::, console_root::types::Group>( Mode::Constant, count_less_than!(11, 0, 0, 0), ); - check_cast::, console_root::types::Group>(Mode::Public, count_is!(4, 0, 13, 13)); - check_cast::, console_root::types::Group>(Mode::Private, count_is!(4, 0, 13, 13)); + check_cast::, console_root::types::Group>(Mode::Public, count_is!(4, 0, 13, 13)); + check_cast::, console_root::types::Group>(Mode::Private, count_is!(4, 0, 13, 13)); } #[test] fn test_u128_to_i8() { - check_cast::, console_root::types::I8>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast::, console_root::types::I8>(Mode::Public, count_is!(0, 0, 0, 1)); - check_cast::, console_root::types::I8>(Mode::Private, count_is!(0, 0, 0, 1)); + check_cast::, console_root::types::I8>(Mode::Constant, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::I8>(Mode::Public, count_is!(0, 0, 0, 1)); + check_cast::, console_root::types::I8>(Mode::Private, count_is!(0, 0, 0, 1)); } #[test] fn test_u128_to_i16() { - check_cast::, console_root::types::I16>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast::, console_root::types::I16>(Mode::Public, count_is!(0, 0, 0, 1)); - check_cast::, console_root::types::I16>(Mode::Private, count_is!(0, 0, 0, 1)); + check_cast::, console_root::types::I16>(Mode::Constant, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::I16>(Mode::Public, count_is!(0, 0, 0, 1)); + check_cast::, console_root::types::I16>(Mode::Private, count_is!(0, 0, 0, 1)); } #[test] fn test_u128_to_i32() { - check_cast::, console_root::types::I32>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast::, console_root::types::I32>(Mode::Public, count_is!(0, 0, 0, 1)); - check_cast::, console_root::types::I32>(Mode::Private, count_is!(0, 0, 0, 1)); + check_cast::, console_root::types::I32>(Mode::Constant, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::I32>(Mode::Public, count_is!(0, 0, 0, 1)); + check_cast::, console_root::types::I32>(Mode::Private, count_is!(0, 0, 0, 1)); } #[test] fn test_u128_to_i64() { - check_cast::, console_root::types::I64>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast::, console_root::types::I64>(Mode::Public, count_is!(0, 0, 0, 1)); - check_cast::, console_root::types::I64>(Mode::Private, count_is!(0, 0, 0, 1)); + check_cast::, console_root::types::I64>(Mode::Constant, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::I64>(Mode::Public, count_is!(0, 0, 0, 1)); + check_cast::, console_root::types::I64>(Mode::Private, count_is!(0, 0, 0, 1)); } #[test] fn test_u128_to_i128() { - check_cast::, console_root::types::I128>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast::, console_root::types::I128>(Mode::Public, count_is!(0, 0, 0, 1)); - check_cast::, console_root::types::I128>(Mode::Private, count_is!(0, 0, 0, 1)); + check_cast::, console_root::types::I128>(Mode::Constant, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::I128>(Mode::Public, count_is!(0, 0, 0, 1)); + check_cast::, console_root::types::I128>(Mode::Private, count_is!(0, 0, 0, 1)); } #[test] fn test_u128_to_scalar() { - check_cast::, console_root::types::Scalar>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast::, console_root::types::Scalar>(Mode::Public, count_is!(0, 0, 0, 0)); - check_cast::, console_root::types::Scalar>(Mode::Private, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::Scalar>( + Mode::Constant, + count_is!(0, 0, 0, 0), + ); + check_cast::, console_root::types::Scalar>(Mode::Public, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::Scalar>(Mode::Private, count_is!(0, 0, 0, 0)); } #[test] fn test_u128_to_u8() { - check_cast::, console_root::types::U8>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast::, console_root::types::U8>(Mode::Public, count_is!(0, 0, 0, 1)); - check_cast::, console_root::types::U8>(Mode::Private, count_is!(0, 0, 0, 1)); + check_cast::, console_root::types::U8>(Mode::Constant, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::U8>(Mode::Public, count_is!(0, 0, 0, 1)); + check_cast::, console_root::types::U8>(Mode::Private, count_is!(0, 0, 0, 1)); } #[test] fn test_u128_to_u16() { - check_cast::, console_root::types::U16>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast::, console_root::types::U16>(Mode::Public, count_is!(0, 0, 0, 1)); - check_cast::, console_root::types::U16>(Mode::Private, count_is!(0, 0, 0, 1)); + check_cast::, console_root::types::U16>(Mode::Constant, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::U16>(Mode::Public, count_is!(0, 0, 0, 1)); + check_cast::, console_root::types::U16>(Mode::Private, count_is!(0, 0, 0, 1)); } #[test] fn test_u128_to_u32() { - check_cast::, console_root::types::U32>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast::, console_root::types::U32>(Mode::Public, count_is!(0, 0, 0, 1)); - check_cast::, console_root::types::U32>(Mode::Private, count_is!(0, 0, 0, 1)); + check_cast::, console_root::types::U32>(Mode::Constant, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::U32>(Mode::Public, count_is!(0, 0, 0, 1)); + check_cast::, console_root::types::U32>(Mode::Private, count_is!(0, 0, 0, 1)); } #[test] fn test_u128_to_u64() { - check_cast::, console_root::types::U64>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast::, console_root::types::U64>(Mode::Public, count_is!(0, 0, 0, 1)); - check_cast::, console_root::types::U64>(Mode::Private, count_is!(0, 0, 0, 1)); + check_cast::, console_root::types::U64>(Mode::Constant, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::U64>(Mode::Public, count_is!(0, 0, 0, 1)); + check_cast::, console_root::types::U64>(Mode::Private, count_is!(0, 0, 0, 1)); } #[test] fn test_u128_to_u128() { - check_cast::, console_root::types::U128>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast::, console_root::types::U128>(Mode::Public, count_is!(0, 0, 0, 0)); - check_cast::, console_root::types::U128>(Mode::Private, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::U128>(Mode::Constant, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::U128>(Mode::Public, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::U128>(Mode::Private, count_is!(0, 0, 0, 0)); } } } diff --git a/circuit/program/src/data/literal/cast/scalar.rs b/circuit/program/src/data/literal/cast/scalar.rs index 39e3b440b9..e9b0e53819 100644 --- a/circuit/program/src/data/literal/cast/scalar.rs +++ b/circuit/program/src/data/literal/cast/scalar.rs @@ -87,7 +87,7 @@ mod tests { use super::*; use console::Cast as _; use console_root::{ - network::Testnet3, + network::MainnetV0, prelude::{One, TestRng, Uniform, Zero}, }; use snarkvm_circuit_types::environment::{count_is, count_less_than, Circuit, Eject, Inject, Mode, UpdatableCount}; @@ -100,126 +100,126 @@ mod tests { i: usize, mode: Mode, rng: &mut TestRng, - ) -> (console_root::types::Scalar, Scalar) { + ) -> (console_root::types::Scalar, Scalar) { let console_value = match i { - 0 => console_root::types::Scalar::::zero(), - 1 => console_root::types::Scalar::::one(), + 0 => console_root::types::Scalar::::zero(), + 1 => console_root::types::Scalar::::one(), _ => Uniform::rand(rng), }; let circuit_value = Scalar::::new(mode, console_value); (console_value, circuit_value) } - impl_check_cast!(cast, Scalar, console_root::types::Scalar::); + impl_check_cast!(cast, Scalar, console_root::types::Scalar::); #[test] fn test_scalar_to_address() { - check_cast::, console_root::types::Address>( + check_cast::, console_root::types::Address>( Mode::Constant, count_less_than!(11, 0, 0, 0), ); - check_cast::, console_root::types::Address>(Mode::Public, count_is!(4, 0, 13, 13)); - check_cast::, console_root::types::Address>(Mode::Private, count_is!(4, 0, 13, 13)); + check_cast::, console_root::types::Address>(Mode::Public, count_is!(4, 0, 13, 13)); + check_cast::, console_root::types::Address>(Mode::Private, count_is!(4, 0, 13, 13)); } #[test] fn test_scalar_to_boolean() { - check_cast::, console_root::types::Boolean>(Mode::Constant, count_is!(4, 0, 0, 0)); - check_cast::, console_root::types::Boolean>(Mode::Public, count_is!(2, 0, 5, 6)); - check_cast::, console_root::types::Boolean>(Mode::Private, count_is!(2, 0, 5, 6)); + check_cast::, console_root::types::Boolean>(Mode::Constant, count_is!(4, 0, 0, 0)); + check_cast::, console_root::types::Boolean>(Mode::Public, count_is!(2, 0, 5, 6)); + check_cast::, console_root::types::Boolean>(Mode::Private, count_is!(2, 0, 5, 6)); } #[test] fn test_scalar_to_field() { - check_cast::, console_root::types::Field>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast::, console_root::types::Field>(Mode::Public, count_is!(0, 0, 0, 0)); - check_cast::, console_root::types::Field>(Mode::Private, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::Field>(Mode::Constant, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::Field>(Mode::Public, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::Field>(Mode::Private, count_is!(0, 0, 0, 0)); } #[test] fn test_scalar_to_group() { - check_cast::, console_root::types::Group>( + check_cast::, console_root::types::Group>( Mode::Constant, count_less_than!(11, 0, 0, 0), ); - check_cast::, console_root::types::Group>(Mode::Public, count_is!(4, 0, 13, 13)); - check_cast::, console_root::types::Group>(Mode::Private, count_is!(4, 0, 13, 13)); + check_cast::, console_root::types::Group>(Mode::Public, count_is!(4, 0, 13, 13)); + check_cast::, console_root::types::Group>(Mode::Private, count_is!(4, 0, 13, 13)); } #[test] fn test_scalar_to_i8() { - check_cast::, console_root::types::I8>(Mode::Constant, count_is!(251, 0, 0, 0)); - check_cast::, console_root::types::I8>(Mode::Public, count_is!(0, 0, 501, 504)); - check_cast::, console_root::types::I8>(Mode::Private, count_is!(0, 0, 501, 504)); + check_cast::, console_root::types::I8>(Mode::Constant, count_is!(251, 0, 0, 0)); + check_cast::, console_root::types::I8>(Mode::Public, count_is!(0, 0, 501, 504)); + check_cast::, console_root::types::I8>(Mode::Private, count_is!(0, 0, 501, 504)); } #[test] fn test_scalar_to_i16() { - check_cast::, console_root::types::I16>(Mode::Constant, count_is!(251, 0, 0, 0)); - check_cast::, console_root::types::I16>(Mode::Public, count_is!(0, 0, 501, 504)); - check_cast::, console_root::types::I16>(Mode::Private, count_is!(0, 0, 501, 504)); + check_cast::, console_root::types::I16>(Mode::Constant, count_is!(251, 0, 0, 0)); + check_cast::, console_root::types::I16>(Mode::Public, count_is!(0, 0, 501, 504)); + check_cast::, console_root::types::I16>(Mode::Private, count_is!(0, 0, 501, 504)); } #[test] fn test_scalar_to_i32() { - check_cast::, console_root::types::I32>(Mode::Constant, count_is!(251, 0, 0, 0)); - check_cast::, console_root::types::I32>(Mode::Public, count_is!(0, 0, 501, 504)); - check_cast::, console_root::types::I32>(Mode::Private, count_is!(0, 0, 501, 504)); + check_cast::, console_root::types::I32>(Mode::Constant, count_is!(251, 0, 0, 0)); + check_cast::, console_root::types::I32>(Mode::Public, count_is!(0, 0, 501, 504)); + check_cast::, console_root::types::I32>(Mode::Private, count_is!(0, 0, 501, 504)); } #[test] fn test_scalar_to_i64() { - check_cast::, console_root::types::I64>(Mode::Constant, count_is!(251, 0, 0, 0)); - check_cast::, console_root::types::I64>(Mode::Public, count_is!(0, 0, 501, 504)); - check_cast::, console_root::types::I64>(Mode::Private, count_is!(0, 0, 501, 504)); + check_cast::, console_root::types::I64>(Mode::Constant, count_is!(251, 0, 0, 0)); + check_cast::, console_root::types::I64>(Mode::Public, count_is!(0, 0, 501, 504)); + check_cast::, console_root::types::I64>(Mode::Private, count_is!(0, 0, 501, 504)); } #[test] fn test_scalar_to_i128() { - check_cast::, console_root::types::I128>(Mode::Constant, count_is!(251, 0, 0, 0)); - check_cast::, console_root::types::I128>(Mode::Public, count_is!(0, 0, 501, 504)); - check_cast::, console_root::types::I128>(Mode::Private, count_is!(0, 0, 501, 504)); + check_cast::, console_root::types::I128>(Mode::Constant, count_is!(251, 0, 0, 0)); + check_cast::, console_root::types::I128>(Mode::Public, count_is!(0, 0, 501, 504)); + check_cast::, console_root::types::I128>(Mode::Private, count_is!(0, 0, 501, 504)); } #[test] fn test_scalar_to_scalar() { - check_cast::, console_root::types::Scalar>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast::, console_root::types::Scalar>(Mode::Public, count_is!(0, 0, 0, 0)); - check_cast::, console_root::types::Scalar>(Mode::Private, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::Scalar>(Mode::Constant, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::Scalar>(Mode::Public, count_is!(0, 0, 0, 0)); + check_cast::, console_root::types::Scalar>(Mode::Private, count_is!(0, 0, 0, 0)); } #[test] fn test_scalar_to_u8() { - check_cast::, console_root::types::U8>(Mode::Constant, count_is!(251, 0, 0, 0)); - check_cast::, console_root::types::U8>(Mode::Public, count_is!(0, 0, 501, 504)); - check_cast::, console_root::types::U8>(Mode::Private, count_is!(0, 0, 501, 504)); + check_cast::, console_root::types::U8>(Mode::Constant, count_is!(251, 0, 0, 0)); + check_cast::, console_root::types::U8>(Mode::Public, count_is!(0, 0, 501, 504)); + check_cast::, console_root::types::U8>(Mode::Private, count_is!(0, 0, 501, 504)); } #[test] fn test_scalar_to_u16() { - check_cast::, console_root::types::U16>(Mode::Constant, count_is!(251, 0, 0, 0)); - check_cast::, console_root::types::U16>(Mode::Public, count_is!(0, 0, 501, 504)); - check_cast::, console_root::types::U16>(Mode::Private, count_is!(0, 0, 501, 504)); + check_cast::, console_root::types::U16>(Mode::Constant, count_is!(251, 0, 0, 0)); + check_cast::, console_root::types::U16>(Mode::Public, count_is!(0, 0, 501, 504)); + check_cast::, console_root::types::U16>(Mode::Private, count_is!(0, 0, 501, 504)); } #[test] fn test_scalar_to_u32() { - check_cast::, console_root::types::U32>(Mode::Constant, count_is!(251, 0, 0, 0)); - check_cast::, console_root::types::U32>(Mode::Public, count_is!(0, 0, 501, 504)); - check_cast::, console_root::types::U32>(Mode::Private, count_is!(0, 0, 501, 504)); + check_cast::, console_root::types::U32>(Mode::Constant, count_is!(251, 0, 0, 0)); + check_cast::, console_root::types::U32>(Mode::Public, count_is!(0, 0, 501, 504)); + check_cast::, console_root::types::U32>(Mode::Private, count_is!(0, 0, 501, 504)); } #[test] fn test_scalar_to_u64() { - check_cast::, console_root::types::U64>(Mode::Constant, count_is!(251, 0, 0, 0)); - check_cast::, console_root::types::U64>(Mode::Public, count_is!(0, 0, 501, 504)); - check_cast::, console_root::types::U64>(Mode::Private, count_is!(0, 0, 501, 504)); + check_cast::, console_root::types::U64>(Mode::Constant, count_is!(251, 0, 0, 0)); + check_cast::, console_root::types::U64>(Mode::Public, count_is!(0, 0, 501, 504)); + check_cast::, console_root::types::U64>(Mode::Private, count_is!(0, 0, 501, 504)); } #[test] fn test_scalar_to_u128() { - check_cast::, console_root::types::U128>(Mode::Constant, count_is!(251, 0, 0, 0)); - check_cast::, console_root::types::U128>(Mode::Public, count_is!(0, 0, 501, 504)); - check_cast::, console_root::types::U128>(Mode::Private, count_is!(0, 0, 501, 504)); + check_cast::, console_root::types::U128>(Mode::Constant, count_is!(251, 0, 0, 0)); + check_cast::, console_root::types::U128>(Mode::Public, count_is!(0, 0, 501, 504)); + check_cast::, console_root::types::U128>(Mode::Private, count_is!(0, 0, 501, 504)); } } diff --git a/circuit/program/src/data/literal/cast_lossy/boolean.rs b/circuit/program/src/data/literal/cast_lossy/boolean.rs index f2017d9857..64ac477894 100644 --- a/circuit/program/src/data/literal/cast_lossy/boolean.rs +++ b/circuit/program/src/data/literal/cast_lossy/boolean.rs @@ -77,7 +77,7 @@ impl CastLossy> for Boolean { mod tests { use super::*; use console::CastLossy as _; - use console_root::{network::Testnet3, prelude::TestRng}; + use console_root::{network::MainnetV0, prelude::TestRng}; use snarkvm_circuit_types::environment::{count_is, Circuit, Eject, Inject, Mode, UpdatableCount}; use std::fmt::Debug; @@ -88,23 +88,23 @@ mod tests { i: usize, mode: Mode, _: &mut TestRng, - ) -> (console_root::types::Boolean, Boolean) { + ) -> (console_root::types::Boolean, Boolean) { (console_root::types::Boolean::new(i % 2 == 0), Boolean::new(mode, i % 2 == 0)) } - check_cast_lossy!(cast_lossy, Boolean, console_root::types::Boolean::); + check_cast_lossy!(cast_lossy, Boolean, console_root::types::Boolean::); #[test] fn test_boolean_to_address() { - check_cast_lossy::, console_root::types::Address>( + check_cast_lossy::, console_root::types::Address>( Mode::Constant, count_is!(10, 0, 0, 0), ); - check_cast_lossy::, console_root::types::Address>( + check_cast_lossy::, console_root::types::Address>( Mode::Public, count_is!(10, 0, 0, 0), ); - check_cast_lossy::, console_root::types::Address>( + check_cast_lossy::, console_root::types::Address>( Mode::Private, count_is!(10, 0, 0, 0), ); @@ -112,15 +112,15 @@ mod tests { #[test] fn test_boolean_to_boolean() { - check_cast_lossy::, console_root::types::Boolean>( + check_cast_lossy::, console_root::types::Boolean>( Mode::Constant, count_is!(0, 0, 0, 0), ); - check_cast_lossy::, console_root::types::Boolean>( + check_cast_lossy::, console_root::types::Boolean>( Mode::Public, count_is!(0, 0, 0, 0), ); - check_cast_lossy::, console_root::types::Boolean>( + check_cast_lossy::, console_root::types::Boolean>( Mode::Private, count_is!(0, 0, 0, 0), ); @@ -128,64 +128,76 @@ mod tests { #[test] fn test_boolean_to_field() { - check_cast_lossy::, console_root::types::Field>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast_lossy::, console_root::types::Field>(Mode::Public, count_is!(0, 0, 0, 0)); - check_cast_lossy::, console_root::types::Field>(Mode::Private, count_is!(0, 0, 0, 0)); + check_cast_lossy::, console_root::types::Field>( + Mode::Constant, + count_is!(0, 0, 0, 0), + ); + check_cast_lossy::, console_root::types::Field>(Mode::Public, count_is!(0, 0, 0, 0)); + check_cast_lossy::, console_root::types::Field>(Mode::Private, count_is!(0, 0, 0, 0)); } #[test] fn test_boolean_to_group() { - check_cast_lossy::, console_root::types::Group>( + check_cast_lossy::, console_root::types::Group>( Mode::Constant, count_is!(10, 0, 0, 0), ); - check_cast_lossy::, console_root::types::Group>(Mode::Public, count_is!(10, 0, 0, 0)); - check_cast_lossy::, console_root::types::Group>(Mode::Private, count_is!(10, 0, 0, 0)); + check_cast_lossy::, console_root::types::Group>(Mode::Public, count_is!(10, 0, 0, 0)); + check_cast_lossy::, console_root::types::Group>( + Mode::Private, + count_is!(10, 0, 0, 0), + ); } #[test] fn test_boolean_to_i8() { - check_cast_lossy::, console_root::types::I8>(Mode::Constant, count_is!(16, 0, 0, 0)); - check_cast_lossy::, console_root::types::I8>(Mode::Public, count_is!(16, 0, 0, 0)); - check_cast_lossy::, console_root::types::I8>(Mode::Private, count_is!(16, 0, 0, 0)); + check_cast_lossy::, console_root::types::I8>(Mode::Constant, count_is!(16, 0, 0, 0)); + check_cast_lossy::, console_root::types::I8>(Mode::Public, count_is!(16, 0, 0, 0)); + check_cast_lossy::, console_root::types::I8>(Mode::Private, count_is!(16, 0, 0, 0)); } #[test] fn test_boolean_to_i16() { - check_cast_lossy::, console_root::types::I16>(Mode::Constant, count_is!(32, 0, 0, 0)); - check_cast_lossy::, console_root::types::I16>(Mode::Public, count_is!(32, 0, 0, 0)); - check_cast_lossy::, console_root::types::I16>(Mode::Private, count_is!(32, 0, 0, 0)); + check_cast_lossy::, console_root::types::I16>(Mode::Constant, count_is!(32, 0, 0, 0)); + check_cast_lossy::, console_root::types::I16>(Mode::Public, count_is!(32, 0, 0, 0)); + check_cast_lossy::, console_root::types::I16>(Mode::Private, count_is!(32, 0, 0, 0)); } #[test] fn test_boolean_to_i32() { - check_cast_lossy::, console_root::types::I32>(Mode::Constant, count_is!(64, 0, 0, 0)); - check_cast_lossy::, console_root::types::I32>(Mode::Public, count_is!(64, 0, 0, 0)); - check_cast_lossy::, console_root::types::I32>(Mode::Private, count_is!(64, 0, 0, 0)); + check_cast_lossy::, console_root::types::I32>(Mode::Constant, count_is!(64, 0, 0, 0)); + check_cast_lossy::, console_root::types::I32>(Mode::Public, count_is!(64, 0, 0, 0)); + check_cast_lossy::, console_root::types::I32>(Mode::Private, count_is!(64, 0, 0, 0)); } #[test] fn test_boolean_to_i64() { - check_cast_lossy::, console_root::types::I64>(Mode::Constant, count_is!(128, 0, 0, 0)); - check_cast_lossy::, console_root::types::I64>(Mode::Public, count_is!(128, 0, 0, 0)); - check_cast_lossy::, console_root::types::I64>(Mode::Private, count_is!(128, 0, 0, 0)); + check_cast_lossy::, console_root::types::I64>(Mode::Constant, count_is!(128, 0, 0, 0)); + check_cast_lossy::, console_root::types::I64>(Mode::Public, count_is!(128, 0, 0, 0)); + check_cast_lossy::, console_root::types::I64>(Mode::Private, count_is!(128, 0, 0, 0)); } #[test] fn test_boolean_to_i128() { - check_cast_lossy::, console_root::types::I128>(Mode::Constant, count_is!(256, 0, 0, 0)); - check_cast_lossy::, console_root::types::I128>(Mode::Public, count_is!(256, 0, 0, 0)); - check_cast_lossy::, console_root::types::I128>(Mode::Private, count_is!(256, 0, 0, 0)); + check_cast_lossy::, console_root::types::I128>( + Mode::Constant, + count_is!(256, 0, 0, 0), + ); + check_cast_lossy::, console_root::types::I128>(Mode::Public, count_is!(256, 0, 0, 0)); + check_cast_lossy::, console_root::types::I128>(Mode::Private, count_is!(256, 0, 0, 0)); } #[test] fn test_boolean_to_scalar() { - check_cast_lossy::, console_root::types::Scalar>( + check_cast_lossy::, console_root::types::Scalar>( Mode::Constant, count_is!(2, 0, 0, 0), ); - check_cast_lossy::, console_root::types::Scalar>(Mode::Public, count_is!(2, 0, 0, 0)); - check_cast_lossy::, console_root::types::Scalar>( + check_cast_lossy::, console_root::types::Scalar>( + Mode::Public, + count_is!(2, 0, 0, 0), + ); + check_cast_lossy::, console_root::types::Scalar>( Mode::Private, count_is!(2, 0, 0, 0), ); @@ -193,36 +205,39 @@ mod tests { #[test] fn test_boolean_to_u8() { - check_cast_lossy::, console_root::types::U8>(Mode::Constant, count_is!(16, 0, 0, 0)); - check_cast_lossy::, console_root::types::U8>(Mode::Public, count_is!(16, 0, 0, 0)); - check_cast_lossy::, console_root::types::U8>(Mode::Private, count_is!(16, 0, 0, 0)); + check_cast_lossy::, console_root::types::U8>(Mode::Constant, count_is!(16, 0, 0, 0)); + check_cast_lossy::, console_root::types::U8>(Mode::Public, count_is!(16, 0, 0, 0)); + check_cast_lossy::, console_root::types::U8>(Mode::Private, count_is!(16, 0, 0, 0)); } #[test] fn test_boolean_to_u16() { - check_cast_lossy::, console_root::types::U16>(Mode::Constant, count_is!(32, 0, 0, 0)); - check_cast_lossy::, console_root::types::U16>(Mode::Public, count_is!(32, 0, 0, 0)); - check_cast_lossy::, console_root::types::U16>(Mode::Private, count_is!(32, 0, 0, 0)); + check_cast_lossy::, console_root::types::U16>(Mode::Constant, count_is!(32, 0, 0, 0)); + check_cast_lossy::, console_root::types::U16>(Mode::Public, count_is!(32, 0, 0, 0)); + check_cast_lossy::, console_root::types::U16>(Mode::Private, count_is!(32, 0, 0, 0)); } #[test] fn test_boolean_to_u32() { - check_cast_lossy::, console_root::types::U32>(Mode::Constant, count_is!(64, 0, 0, 0)); - check_cast_lossy::, console_root::types::U32>(Mode::Public, count_is!(64, 0, 0, 0)); - check_cast_lossy::, console_root::types::U32>(Mode::Private, count_is!(64, 0, 0, 0)); + check_cast_lossy::, console_root::types::U32>(Mode::Constant, count_is!(64, 0, 0, 0)); + check_cast_lossy::, console_root::types::U32>(Mode::Public, count_is!(64, 0, 0, 0)); + check_cast_lossy::, console_root::types::U32>(Mode::Private, count_is!(64, 0, 0, 0)); } #[test] fn test_boolean_to_u64() { - check_cast_lossy::, console_root::types::U64>(Mode::Constant, count_is!(128, 0, 0, 0)); - check_cast_lossy::, console_root::types::U64>(Mode::Public, count_is!(128, 0, 0, 0)); - check_cast_lossy::, console_root::types::U64>(Mode::Private, count_is!(128, 0, 0, 0)); + check_cast_lossy::, console_root::types::U64>(Mode::Constant, count_is!(128, 0, 0, 0)); + check_cast_lossy::, console_root::types::U64>(Mode::Public, count_is!(128, 0, 0, 0)); + check_cast_lossy::, console_root::types::U64>(Mode::Private, count_is!(128, 0, 0, 0)); } #[test] fn test_boolean_to_u128() { - check_cast_lossy::, console_root::types::U128>(Mode::Constant, count_is!(256, 0, 0, 0)); - check_cast_lossy::, console_root::types::U128>(Mode::Public, count_is!(256, 0, 0, 0)); - check_cast_lossy::, console_root::types::U128>(Mode::Private, count_is!(256, 0, 0, 0)); + check_cast_lossy::, console_root::types::U128>( + Mode::Constant, + count_is!(256, 0, 0, 0), + ); + check_cast_lossy::, console_root::types::U128>(Mode::Public, count_is!(256, 0, 0, 0)); + check_cast_lossy::, console_root::types::U128>(Mode::Private, count_is!(256, 0, 0, 0)); } } diff --git a/circuit/program/src/data/literal/cast_lossy/field.rs b/circuit/program/src/data/literal/cast_lossy/field.rs index 310ec630cc..705443d022 100644 --- a/circuit/program/src/data/literal/cast_lossy/field.rs +++ b/circuit/program/src/data/literal/cast_lossy/field.rs @@ -116,7 +116,7 @@ mod tests { use super::*; use console::CastLossy as _; use console_root::{ - network::Testnet3, + network::MainnetV0, prelude::{One, TestRng, Uniform, Zero}, }; use snarkvm_circuit_types::environment::{count_is, count_less_than, Circuit, Eject, Inject, Mode, UpdatableCount}; @@ -129,29 +129,29 @@ mod tests { i: usize, mode: Mode, rng: &mut TestRng, - ) -> (console_root::types::Field, Field) { + ) -> (console_root::types::Field, Field) { let console_value = match i { - 0 => console_root::types::Field::::zero(), - 1 => console_root::types::Field::::one(), + 0 => console_root::types::Field::::zero(), + 1 => console_root::types::Field::::one(), _ => Uniform::rand(rng), }; let circuit_value = Field::::new(mode, console_value); (console_value, circuit_value) } - check_cast_lossy!(cast_lossy, Field, console_root::types::Field::); + check_cast_lossy!(cast_lossy, Field, console_root::types::Field::); #[test] fn test_field_to_address() { - check_cast_lossy::, console_root::types::Address>( + check_cast_lossy::, console_root::types::Address>( Mode::Constant, count_less_than!(4303, 0, 0, 0), ); - check_cast_lossy::, console_root::types::Address>( + check_cast_lossy::, console_root::types::Address>( Mode::Public, count_is!(2029, 0, 6745, 6750), ); - check_cast_lossy::, console_root::types::Address>( + check_cast_lossy::, console_root::types::Address>( Mode::Private, count_is!(2029, 0, 6745, 6750), ); @@ -159,15 +159,15 @@ mod tests { #[test] fn test_field_to_boolean() { - check_cast_lossy::, console_root::types::Boolean>( + check_cast_lossy::, console_root::types::Boolean>( Mode::Constant, count_is!(253, 0, 0, 0), ); - check_cast_lossy::, console_root::types::Boolean>( + check_cast_lossy::, console_root::types::Boolean>( Mode::Public, count_is!(0, 0, 505, 507), ); - check_cast_lossy::, console_root::types::Boolean>( + check_cast_lossy::, console_root::types::Boolean>( Mode::Private, count_is!(0, 0, 505, 507), ); @@ -175,22 +175,25 @@ mod tests { #[test] fn test_field_to_field() { - check_cast_lossy::, console_root::types::Field>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast_lossy::, console_root::types::Field>(Mode::Public, count_is!(0, 0, 0, 0)); - check_cast_lossy::, console_root::types::Field>(Mode::Private, count_is!(0, 0, 0, 0)); + check_cast_lossy::, console_root::types::Field>( + Mode::Constant, + count_is!(0, 0, 0, 0), + ); + check_cast_lossy::, console_root::types::Field>(Mode::Public, count_is!(0, 0, 0, 0)); + check_cast_lossy::, console_root::types::Field>(Mode::Private, count_is!(0, 0, 0, 0)); } #[test] fn test_field_to_group() { - check_cast_lossy::, console_root::types::Group>( + check_cast_lossy::, console_root::types::Group>( Mode::Constant, count_less_than!(4303, 0, 0, 0), ); - check_cast_lossy::, console_root::types::Group>( + check_cast_lossy::, console_root::types::Group>( Mode::Public, count_is!(2029, 0, 6745, 6750), ); - check_cast_lossy::, console_root::types::Group>( + check_cast_lossy::, console_root::types::Group>( Mode::Private, count_is!(2029, 0, 6745, 6750), ); @@ -198,37 +201,43 @@ mod tests { #[test] fn test_field_to_i8() { - check_cast_lossy::, console_root::types::I8>(Mode::Constant, count_is!(253, 0, 0, 0)); - check_cast_lossy::, console_root::types::I8>(Mode::Public, count_is!(0, 0, 505, 507)); - check_cast_lossy::, console_root::types::I8>(Mode::Private, count_is!(0, 0, 505, 507)); + check_cast_lossy::, console_root::types::I8>(Mode::Constant, count_is!(253, 0, 0, 0)); + check_cast_lossy::, console_root::types::I8>(Mode::Public, count_is!(0, 0, 505, 507)); + check_cast_lossy::, console_root::types::I8>(Mode::Private, count_is!(0, 0, 505, 507)); } #[test] fn test_field_to_i16() { - check_cast_lossy::, console_root::types::I16>(Mode::Constant, count_is!(253, 0, 0, 0)); - check_cast_lossy::, console_root::types::I16>(Mode::Public, count_is!(0, 0, 505, 507)); - check_cast_lossy::, console_root::types::I16>(Mode::Private, count_is!(0, 0, 505, 507)); + check_cast_lossy::, console_root::types::I16>(Mode::Constant, count_is!(253, 0, 0, 0)); + check_cast_lossy::, console_root::types::I16>(Mode::Public, count_is!(0, 0, 505, 507)); + check_cast_lossy::, console_root::types::I16>(Mode::Private, count_is!(0, 0, 505, 507)); } #[test] fn test_field_to_i32() { - check_cast_lossy::, console_root::types::I32>(Mode::Constant, count_is!(253, 0, 0, 0)); - check_cast_lossy::, console_root::types::I32>(Mode::Public, count_is!(0, 0, 505, 507)); - check_cast_lossy::, console_root::types::I32>(Mode::Private, count_is!(0, 0, 505, 507)); + check_cast_lossy::, console_root::types::I32>(Mode::Constant, count_is!(253, 0, 0, 0)); + check_cast_lossy::, console_root::types::I32>(Mode::Public, count_is!(0, 0, 505, 507)); + check_cast_lossy::, console_root::types::I32>(Mode::Private, count_is!(0, 0, 505, 507)); } #[test] fn test_field_to_i64() { - check_cast_lossy::, console_root::types::I64>(Mode::Constant, count_is!(253, 0, 0, 0)); - check_cast_lossy::, console_root::types::I64>(Mode::Public, count_is!(0, 0, 505, 507)); - check_cast_lossy::, console_root::types::I64>(Mode::Private, count_is!(0, 0, 505, 507)); + check_cast_lossy::, console_root::types::I64>(Mode::Constant, count_is!(253, 0, 0, 0)); + check_cast_lossy::, console_root::types::I64>(Mode::Public, count_is!(0, 0, 505, 507)); + check_cast_lossy::, console_root::types::I64>(Mode::Private, count_is!(0, 0, 505, 507)); } #[test] fn test_field_to_i128() { - check_cast_lossy::, console_root::types::I128>(Mode::Constant, count_is!(253, 0, 0, 0)); - check_cast_lossy::, console_root::types::I128>(Mode::Public, count_is!(0, 0, 505, 507)); - check_cast_lossy::, console_root::types::I128>( + check_cast_lossy::, console_root::types::I128>( + Mode::Constant, + count_is!(253, 0, 0, 0), + ); + check_cast_lossy::, console_root::types::I128>( + Mode::Public, + count_is!(0, 0, 505, 507), + ); + check_cast_lossy::, console_root::types::I128>( Mode::Private, count_is!(0, 0, 505, 507), ); @@ -236,15 +245,15 @@ mod tests { #[test] fn test_field_to_scalar() { - check_cast_lossy::, console_root::types::Scalar>( + check_cast_lossy::, console_root::types::Scalar>( Mode::Constant, count_is!(253, 0, 0, 0), ); - check_cast_lossy::, console_root::types::Scalar>( + check_cast_lossy::, console_root::types::Scalar>( Mode::Public, count_is!(0, 0, 505, 507), ); - check_cast_lossy::, console_root::types::Scalar>( + check_cast_lossy::, console_root::types::Scalar>( Mode::Private, count_is!(0, 0, 505, 507), ); @@ -252,37 +261,43 @@ mod tests { #[test] fn test_field_to_u8() { - check_cast_lossy::, console_root::types::U8>(Mode::Constant, count_is!(253, 0, 0, 0)); - check_cast_lossy::, console_root::types::U8>(Mode::Public, count_is!(0, 0, 505, 507)); - check_cast_lossy::, console_root::types::U8>(Mode::Private, count_is!(0, 0, 505, 507)); + check_cast_lossy::, console_root::types::U8>(Mode::Constant, count_is!(253, 0, 0, 0)); + check_cast_lossy::, console_root::types::U8>(Mode::Public, count_is!(0, 0, 505, 507)); + check_cast_lossy::, console_root::types::U8>(Mode::Private, count_is!(0, 0, 505, 507)); } #[test] fn test_field_to_u16() { - check_cast_lossy::, console_root::types::U16>(Mode::Constant, count_is!(253, 0, 0, 0)); - check_cast_lossy::, console_root::types::U16>(Mode::Public, count_is!(0, 0, 505, 507)); - check_cast_lossy::, console_root::types::U16>(Mode::Private, count_is!(0, 0, 505, 507)); + check_cast_lossy::, console_root::types::U16>(Mode::Constant, count_is!(253, 0, 0, 0)); + check_cast_lossy::, console_root::types::U16>(Mode::Public, count_is!(0, 0, 505, 507)); + check_cast_lossy::, console_root::types::U16>(Mode::Private, count_is!(0, 0, 505, 507)); } #[test] fn test_field_to_u32() { - check_cast_lossy::, console_root::types::U32>(Mode::Constant, count_is!(253, 0, 0, 0)); - check_cast_lossy::, console_root::types::U32>(Mode::Public, count_is!(0, 0, 505, 507)); - check_cast_lossy::, console_root::types::U32>(Mode::Private, count_is!(0, 0, 505, 507)); + check_cast_lossy::, console_root::types::U32>(Mode::Constant, count_is!(253, 0, 0, 0)); + check_cast_lossy::, console_root::types::U32>(Mode::Public, count_is!(0, 0, 505, 507)); + check_cast_lossy::, console_root::types::U32>(Mode::Private, count_is!(0, 0, 505, 507)); } #[test] fn test_field_to_u64() { - check_cast_lossy::, console_root::types::U64>(Mode::Constant, count_is!(253, 0, 0, 0)); - check_cast_lossy::, console_root::types::U64>(Mode::Public, count_is!(0, 0, 505, 507)); - check_cast_lossy::, console_root::types::U64>(Mode::Private, count_is!(0, 0, 505, 507)); + check_cast_lossy::, console_root::types::U64>(Mode::Constant, count_is!(253, 0, 0, 0)); + check_cast_lossy::, console_root::types::U64>(Mode::Public, count_is!(0, 0, 505, 507)); + check_cast_lossy::, console_root::types::U64>(Mode::Private, count_is!(0, 0, 505, 507)); } #[test] fn test_field_to_u128() { - check_cast_lossy::, console_root::types::U128>(Mode::Constant, count_is!(253, 0, 0, 0)); - check_cast_lossy::, console_root::types::U128>(Mode::Public, count_is!(0, 0, 505, 507)); - check_cast_lossy::, console_root::types::U128>( + check_cast_lossy::, console_root::types::U128>( + Mode::Constant, + count_is!(253, 0, 0, 0), + ); + check_cast_lossy::, console_root::types::U128>( + Mode::Public, + count_is!(0, 0, 505, 507), + ); + check_cast_lossy::, console_root::types::U128>( Mode::Private, count_is!(0, 0, 505, 507), ); diff --git a/circuit/program/src/data/literal/cast_lossy/integer.rs b/circuit/program/src/data/literal/cast_lossy/integer.rs index 7d2244c7ff..1a50e3e8ca 100644 --- a/circuit/program/src/data/literal/cast_lossy/integer.rs +++ b/circuit/program/src/data/literal/cast_lossy/integer.rs @@ -91,7 +91,7 @@ mod tests { use super::*; use console::CastLossy as _; use console_root::{ - network::Testnet3, + network::MainnetV0, prelude::{One, TestRng, Uniform, Zero}, }; use snarkvm_circuit_types::environment::{count_is, count_less_than, Circuit, Eject, Inject, Mode, UpdatableCount}; @@ -104,13 +104,13 @@ mod tests { i: usize, mode: Mode, rng: &mut TestRng, - ) -> (console_root::types::integers::Integer, Integer) { + ) -> (console_root::types::integers::Integer, Integer) { let console_value = match i { - 0 => console_root::types::integers::Integer::::zero(), - 1 => console_root::types::integers::Integer::::one(), - 2 => console_root::types::integers::Integer::::new(I::MAX), - 3 => console_root::types::integers::Integer::::new(I::MIN), - 4 if I::is_signed() => -console_root::types::integers::Integer::::one(), + 0 => console_root::types::integers::Integer::::zero(), + 1 => console_root::types::integers::Integer::::one(), + 2 => console_root::types::integers::Integer::::new(I::MAX), + 3 => console_root::types::integers::Integer::::new(I::MIN), + 4 if I::is_signed() => -console_root::types::integers::Integer::::one(), _ => Uniform::rand(rng), }; let circuit_value = Integer::::new(mode, console_value); @@ -120,23 +120,23 @@ mod tests { mod i8 { use super::*; - fn sample_values(i: usize, mode: Mode, rng: &mut TestRng) -> (console_root::types::I8, I8) { + fn sample_values(i: usize, mode: Mode, rng: &mut TestRng) -> (console_root::types::I8, I8) { super::sample_values(i, mode, rng) } - check_cast_lossy!(cast_lossy, I8, console_root::types::I8); + check_cast_lossy!(cast_lossy, I8, console_root::types::I8); #[test] fn test_i8_to_address() { - check_cast_lossy::, console_root::types::Address>( + check_cast_lossy::, console_root::types::Address>( Mode::Constant, count_less_than!(4303, 0, 0, 0), ); - check_cast_lossy::, console_root::types::Address>( + check_cast_lossy::, console_root::types::Address>( Mode::Public, count_is!(2029, 0, 6745, 6750), ); - check_cast_lossy::, console_root::types::Address>( + check_cast_lossy::, console_root::types::Address>( Mode::Private, count_is!(2029, 0, 6745, 6750), ); @@ -144,15 +144,15 @@ mod tests { #[test] fn test_i8_to_boolean() { - check_cast_lossy::, console_root::types::Boolean>( + check_cast_lossy::, console_root::types::Boolean>( Mode::Constant, count_is!(0, 0, 0, 0), ); - check_cast_lossy::, console_root::types::Boolean>( + check_cast_lossy::, console_root::types::Boolean>( Mode::Public, count_is!(0, 0, 0, 0), ); - check_cast_lossy::, console_root::types::Boolean>( + check_cast_lossy::, console_root::types::Boolean>( Mode::Private, count_is!(0, 0, 0, 0), ); @@ -160,15 +160,15 @@ mod tests { #[test] fn test_i8_to_field() { - check_cast_lossy::, console_root::types::Field>( + check_cast_lossy::, console_root::types::Field>( Mode::Constant, count_is!(0, 0, 0, 0), ); - check_cast_lossy::, console_root::types::Field>( + check_cast_lossy::, console_root::types::Field>( Mode::Public, count_is!(0, 0, 0, 0), ); - check_cast_lossy::, console_root::types::Field>( + check_cast_lossy::, console_root::types::Field>( Mode::Private, count_is!(0, 0, 0, 0), ); @@ -176,15 +176,15 @@ mod tests { #[test] fn test_i8_to_group() { - check_cast_lossy::, console_root::types::Group>( + check_cast_lossy::, console_root::types::Group>( Mode::Constant, count_less_than!(4303, 0, 0, 0), ); - check_cast_lossy::, console_root::types::Group>( + check_cast_lossy::, console_root::types::Group>( Mode::Public, count_is!(2029, 0, 6745, 6750), ); - check_cast_lossy::, console_root::types::Group>( + check_cast_lossy::, console_root::types::Group>( Mode::Private, count_is!(2029, 0, 6745, 6750), ); @@ -192,40 +192,52 @@ mod tests { #[test] fn test_i8_to_i8() { - check_cast_lossy::, console_root::types::I8>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast_lossy::, console_root::types::I8>(Mode::Public, count_is!(0, 0, 0, 0)); - check_cast_lossy::, console_root::types::I8>(Mode::Private, count_is!(0, 0, 0, 0)); + check_cast_lossy::, console_root::types::I8>(Mode::Constant, count_is!(0, 0, 0, 0)); + check_cast_lossy::, console_root::types::I8>(Mode::Public, count_is!(0, 0, 0, 0)); + check_cast_lossy::, console_root::types::I8>(Mode::Private, count_is!(0, 0, 0, 0)); } #[test] fn test_i8_to_i16() { - check_cast_lossy::, console_root::types::I16>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast_lossy::, console_root::types::I16>(Mode::Public, count_is!(0, 0, 0, 0)); - check_cast_lossy::, console_root::types::I16>(Mode::Private, count_is!(0, 0, 0, 0)); + check_cast_lossy::, console_root::types::I16>( + Mode::Constant, + count_is!(0, 0, 0, 0), + ); + check_cast_lossy::, console_root::types::I16>(Mode::Public, count_is!(0, 0, 0, 0)); + check_cast_lossy::, console_root::types::I16>(Mode::Private, count_is!(0, 0, 0, 0)); } #[test] fn test_i8_to_i32() { - check_cast_lossy::, console_root::types::I32>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast_lossy::, console_root::types::I32>(Mode::Public, count_is!(0, 0, 0, 0)); - check_cast_lossy::, console_root::types::I32>(Mode::Private, count_is!(0, 0, 0, 0)); + check_cast_lossy::, console_root::types::I32>( + Mode::Constant, + count_is!(0, 0, 0, 0), + ); + check_cast_lossy::, console_root::types::I32>(Mode::Public, count_is!(0, 0, 0, 0)); + check_cast_lossy::, console_root::types::I32>(Mode::Private, count_is!(0, 0, 0, 0)); } #[test] fn test_i8_to_i64() { - check_cast_lossy::, console_root::types::I64>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast_lossy::, console_root::types::I64>(Mode::Public, count_is!(0, 0, 0, 0)); - check_cast_lossy::, console_root::types::I64>(Mode::Private, count_is!(0, 0, 0, 0)); + check_cast_lossy::, console_root::types::I64>( + Mode::Constant, + count_is!(0, 0, 0, 0), + ); + check_cast_lossy::, console_root::types::I64>(Mode::Public, count_is!(0, 0, 0, 0)); + check_cast_lossy::, console_root::types::I64>(Mode::Private, count_is!(0, 0, 0, 0)); } #[test] fn test_i8_to_i128() { - check_cast_lossy::, console_root::types::I128>( + check_cast_lossy::, console_root::types::I128>( Mode::Constant, count_is!(0, 0, 0, 0), ); - check_cast_lossy::, console_root::types::I128>(Mode::Public, count_is!(0, 0, 0, 0)); - check_cast_lossy::, console_root::types::I128>( + check_cast_lossy::, console_root::types::I128>( + Mode::Public, + count_is!(0, 0, 0, 0), + ); + check_cast_lossy::, console_root::types::I128>( Mode::Private, count_is!(0, 0, 0, 0), ); @@ -233,15 +245,15 @@ mod tests { #[test] fn test_i8_to_scalar() { - check_cast_lossy::, console_root::types::Scalar>( + check_cast_lossy::, console_root::types::Scalar>( Mode::Constant, count_is!(0, 0, 0, 0), ); - check_cast_lossy::, console_root::types::Scalar>( + check_cast_lossy::, console_root::types::Scalar>( Mode::Public, count_is!(0, 0, 0, 0), ); - check_cast_lossy::, console_root::types::Scalar>( + check_cast_lossy::, console_root::types::Scalar>( Mode::Private, count_is!(0, 0, 0, 0), ); @@ -249,40 +261,52 @@ mod tests { #[test] fn test_i8_to_u8() { - check_cast_lossy::, console_root::types::U8>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast_lossy::, console_root::types::U8>(Mode::Public, count_is!(0, 0, 0, 0)); - check_cast_lossy::, console_root::types::U8>(Mode::Private, count_is!(0, 0, 0, 0)); + check_cast_lossy::, console_root::types::U8>(Mode::Constant, count_is!(0, 0, 0, 0)); + check_cast_lossy::, console_root::types::U8>(Mode::Public, count_is!(0, 0, 0, 0)); + check_cast_lossy::, console_root::types::U8>(Mode::Private, count_is!(0, 0, 0, 0)); } #[test] fn test_i8_to_u16() { - check_cast_lossy::, console_root::types::U16>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast_lossy::, console_root::types::U16>(Mode::Public, count_is!(0, 0, 0, 0)); - check_cast_lossy::, console_root::types::U16>(Mode::Private, count_is!(0, 0, 0, 0)); + check_cast_lossy::, console_root::types::U16>( + Mode::Constant, + count_is!(0, 0, 0, 0), + ); + check_cast_lossy::, console_root::types::U16>(Mode::Public, count_is!(0, 0, 0, 0)); + check_cast_lossy::, console_root::types::U16>(Mode::Private, count_is!(0, 0, 0, 0)); } #[test] fn test_i8_to_u32() { - check_cast_lossy::, console_root::types::U32>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast_lossy::, console_root::types::U32>(Mode::Public, count_is!(0, 0, 0, 0)); - check_cast_lossy::, console_root::types::U32>(Mode::Private, count_is!(0, 0, 0, 0)); + check_cast_lossy::, console_root::types::U32>( + Mode::Constant, + count_is!(0, 0, 0, 0), + ); + check_cast_lossy::, console_root::types::U32>(Mode::Public, count_is!(0, 0, 0, 0)); + check_cast_lossy::, console_root::types::U32>(Mode::Private, count_is!(0, 0, 0, 0)); } #[test] fn test_i8_to_u64() { - check_cast_lossy::, console_root::types::U64>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast_lossy::, console_root::types::U64>(Mode::Public, count_is!(0, 0, 0, 0)); - check_cast_lossy::, console_root::types::U64>(Mode::Private, count_is!(0, 0, 0, 0)); + check_cast_lossy::, console_root::types::U64>( + Mode::Constant, + count_is!(0, 0, 0, 0), + ); + check_cast_lossy::, console_root::types::U64>(Mode::Public, count_is!(0, 0, 0, 0)); + check_cast_lossy::, console_root::types::U64>(Mode::Private, count_is!(0, 0, 0, 0)); } #[test] fn test_i8_to_u128() { - check_cast_lossy::, console_root::types::U128>( + check_cast_lossy::, console_root::types::U128>( Mode::Constant, count_is!(0, 0, 0, 0), ); - check_cast_lossy::, console_root::types::U128>(Mode::Public, count_is!(0, 0, 0, 0)); - check_cast_lossy::, console_root::types::U128>( + check_cast_lossy::, console_root::types::U128>( + Mode::Public, + count_is!(0, 0, 0, 0), + ); + check_cast_lossy::, console_root::types::U128>( Mode::Private, count_is!(0, 0, 0, 0), ); @@ -296,23 +320,23 @@ mod tests { i: usize, mode: Mode, rng: &mut TestRng, - ) -> (console_root::types::I16, I16) { + ) -> (console_root::types::I16, I16) { super::sample_values(i, mode, rng) } - check_cast_lossy!(cast_lossy, I16, console_root::types::I16); + check_cast_lossy!(cast_lossy, I16, console_root::types::I16); #[test] fn test_i16_to_address() { - check_cast_lossy::, console_root::types::Address>( + check_cast_lossy::, console_root::types::Address>( Mode::Constant, count_less_than!(4303, 0, 0, 0), ); - check_cast_lossy::, console_root::types::Address>( + check_cast_lossy::, console_root::types::Address>( Mode::Public, count_is!(2029, 0, 6745, 6750), ); - check_cast_lossy::, console_root::types::Address>( + check_cast_lossy::, console_root::types::Address>( Mode::Private, count_is!(2029, 0, 6745, 6750), ); @@ -320,15 +344,15 @@ mod tests { #[test] fn test_i16_to_boolean() { - check_cast_lossy::, console_root::types::Boolean>( + check_cast_lossy::, console_root::types::Boolean>( Mode::Constant, count_is!(0, 0, 0, 0), ); - check_cast_lossy::, console_root::types::Boolean>( + check_cast_lossy::, console_root::types::Boolean>( Mode::Public, count_is!(0, 0, 0, 0), ); - check_cast_lossy::, console_root::types::Boolean>( + check_cast_lossy::, console_root::types::Boolean>( Mode::Private, count_is!(0, 0, 0, 0), ); @@ -336,15 +360,15 @@ mod tests { #[test] fn test_i16_to_field() { - check_cast_lossy::, console_root::types::Field>( + check_cast_lossy::, console_root::types::Field>( Mode::Constant, count_is!(0, 0, 0, 0), ); - check_cast_lossy::, console_root::types::Field>( + check_cast_lossy::, console_root::types::Field>( Mode::Public, count_is!(0, 0, 0, 0), ); - check_cast_lossy::, console_root::types::Field>( + check_cast_lossy::, console_root::types::Field>( Mode::Private, count_is!(0, 0, 0, 0), ); @@ -352,15 +376,15 @@ mod tests { #[test] fn test_i16_to_group() { - check_cast_lossy::, console_root::types::Group>( + check_cast_lossy::, console_root::types::Group>( Mode::Constant, count_less_than!(4303, 0, 0, 0), ); - check_cast_lossy::, console_root::types::Group>( + check_cast_lossy::, console_root::types::Group>( Mode::Public, count_is!(2029, 0, 6745, 6750), ); - check_cast_lossy::, console_root::types::Group>( + check_cast_lossy::, console_root::types::Group>( Mode::Private, count_is!(2029, 0, 6745, 6750), ); @@ -368,40 +392,52 @@ mod tests { #[test] fn test_i16_to_i8() { - check_cast_lossy::, console_root::types::I8>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast_lossy::, console_root::types::I8>(Mode::Public, count_is!(0, 0, 0, 0)); - check_cast_lossy::, console_root::types::I8>(Mode::Private, count_is!(0, 0, 0, 0)); + check_cast_lossy::, console_root::types::I8>(Mode::Constant, count_is!(0, 0, 0, 0)); + check_cast_lossy::, console_root::types::I8>(Mode::Public, count_is!(0, 0, 0, 0)); + check_cast_lossy::, console_root::types::I8>(Mode::Private, count_is!(0, 0, 0, 0)); } #[test] fn test_i16_to_i16() { - check_cast_lossy::, console_root::types::I16>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast_lossy::, console_root::types::I16>(Mode::Public, count_is!(0, 0, 0, 0)); - check_cast_lossy::, console_root::types::I16>(Mode::Private, count_is!(0, 0, 0, 0)); + check_cast_lossy::, console_root::types::I16>( + Mode::Constant, + count_is!(0, 0, 0, 0), + ); + check_cast_lossy::, console_root::types::I16>(Mode::Public, count_is!(0, 0, 0, 0)); + check_cast_lossy::, console_root::types::I16>(Mode::Private, count_is!(0, 0, 0, 0)); } #[test] fn test_i16_to_i32() { - check_cast_lossy::, console_root::types::I32>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast_lossy::, console_root::types::I32>(Mode::Public, count_is!(0, 0, 0, 0)); - check_cast_lossy::, console_root::types::I32>(Mode::Private, count_is!(0, 0, 0, 0)); + check_cast_lossy::, console_root::types::I32>( + Mode::Constant, + count_is!(0, 0, 0, 0), + ); + check_cast_lossy::, console_root::types::I32>(Mode::Public, count_is!(0, 0, 0, 0)); + check_cast_lossy::, console_root::types::I32>(Mode::Private, count_is!(0, 0, 0, 0)); } #[test] fn test_i16_to_i64() { - check_cast_lossy::, console_root::types::I64>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast_lossy::, console_root::types::I64>(Mode::Public, count_is!(0, 0, 0, 0)); - check_cast_lossy::, console_root::types::I64>(Mode::Private, count_is!(0, 0, 0, 0)); + check_cast_lossy::, console_root::types::I64>( + Mode::Constant, + count_is!(0, 0, 0, 0), + ); + check_cast_lossy::, console_root::types::I64>(Mode::Public, count_is!(0, 0, 0, 0)); + check_cast_lossy::, console_root::types::I64>(Mode::Private, count_is!(0, 0, 0, 0)); } #[test] fn test_i16_to_i128() { - check_cast_lossy::, console_root::types::I128>( + check_cast_lossy::, console_root::types::I128>( Mode::Constant, count_is!(0, 0, 0, 0), ); - check_cast_lossy::, console_root::types::I128>(Mode::Public, count_is!(0, 0, 0, 0)); - check_cast_lossy::, console_root::types::I128>( + check_cast_lossy::, console_root::types::I128>( + Mode::Public, + count_is!(0, 0, 0, 0), + ); + check_cast_lossy::, console_root::types::I128>( Mode::Private, count_is!(0, 0, 0, 0), ); @@ -409,15 +445,15 @@ mod tests { #[test] fn test_i16_to_scalar() { - check_cast_lossy::, console_root::types::Scalar>( + check_cast_lossy::, console_root::types::Scalar>( Mode::Constant, count_is!(0, 0, 0, 0), ); - check_cast_lossy::, console_root::types::Scalar>( + check_cast_lossy::, console_root::types::Scalar>( Mode::Public, count_is!(0, 0, 0, 0), ); - check_cast_lossy::, console_root::types::Scalar>( + check_cast_lossy::, console_root::types::Scalar>( Mode::Private, count_is!(0, 0, 0, 0), ); @@ -425,40 +461,52 @@ mod tests { #[test] fn test_i16_to_u8() { - check_cast_lossy::, console_root::types::U8>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast_lossy::, console_root::types::U8>(Mode::Public, count_is!(0, 0, 0, 0)); - check_cast_lossy::, console_root::types::U8>(Mode::Private, count_is!(0, 0, 0, 0)); + check_cast_lossy::, console_root::types::U8>(Mode::Constant, count_is!(0, 0, 0, 0)); + check_cast_lossy::, console_root::types::U8>(Mode::Public, count_is!(0, 0, 0, 0)); + check_cast_lossy::, console_root::types::U8>(Mode::Private, count_is!(0, 0, 0, 0)); } #[test] fn test_i16_to_u16() { - check_cast_lossy::, console_root::types::U16>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast_lossy::, console_root::types::U16>(Mode::Public, count_is!(0, 0, 0, 0)); - check_cast_lossy::, console_root::types::U16>(Mode::Private, count_is!(0, 0, 0, 0)); + check_cast_lossy::, console_root::types::U16>( + Mode::Constant, + count_is!(0, 0, 0, 0), + ); + check_cast_lossy::, console_root::types::U16>(Mode::Public, count_is!(0, 0, 0, 0)); + check_cast_lossy::, console_root::types::U16>(Mode::Private, count_is!(0, 0, 0, 0)); } #[test] fn test_i16_to_u32() { - check_cast_lossy::, console_root::types::U32>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast_lossy::, console_root::types::U32>(Mode::Public, count_is!(0, 0, 0, 0)); - check_cast_lossy::, console_root::types::U32>(Mode::Private, count_is!(0, 0, 0, 0)); + check_cast_lossy::, console_root::types::U32>( + Mode::Constant, + count_is!(0, 0, 0, 0), + ); + check_cast_lossy::, console_root::types::U32>(Mode::Public, count_is!(0, 0, 0, 0)); + check_cast_lossy::, console_root::types::U32>(Mode::Private, count_is!(0, 0, 0, 0)); } #[test] fn test_i16_to_u64() { - check_cast_lossy::, console_root::types::U64>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast_lossy::, console_root::types::U64>(Mode::Public, count_is!(0, 0, 0, 0)); - check_cast_lossy::, console_root::types::U64>(Mode::Private, count_is!(0, 0, 0, 0)); + check_cast_lossy::, console_root::types::U64>( + Mode::Constant, + count_is!(0, 0, 0, 0), + ); + check_cast_lossy::, console_root::types::U64>(Mode::Public, count_is!(0, 0, 0, 0)); + check_cast_lossy::, console_root::types::U64>(Mode::Private, count_is!(0, 0, 0, 0)); } #[test] fn test_i16_to_u128() { - check_cast_lossy::, console_root::types::U128>( + check_cast_lossy::, console_root::types::U128>( Mode::Constant, count_is!(0, 0, 0, 0), ); - check_cast_lossy::, console_root::types::U128>(Mode::Public, count_is!(0, 0, 0, 0)); - check_cast_lossy::, console_root::types::U128>( + check_cast_lossy::, console_root::types::U128>( + Mode::Public, + count_is!(0, 0, 0, 0), + ); + check_cast_lossy::, console_root::types::U128>( Mode::Private, count_is!(0, 0, 0, 0), ); @@ -472,23 +520,23 @@ mod tests { i: usize, mode: Mode, rng: &mut TestRng, - ) -> (console_root::types::I32, I32) { + ) -> (console_root::types::I32, I32) { super::sample_values(i, mode, rng) } - check_cast_lossy!(cast_lossy, I32, console_root::types::I32); + check_cast_lossy!(cast_lossy, I32, console_root::types::I32); #[test] fn test_i32_to_address() { - check_cast_lossy::, console_root::types::Address>( + check_cast_lossy::, console_root::types::Address>( Mode::Constant, count_less_than!(4303, 0, 0, 0), ); - check_cast_lossy::, console_root::types::Address>( + check_cast_lossy::, console_root::types::Address>( Mode::Public, count_is!(2029, 0, 6745, 6750), ); - check_cast_lossy::, console_root::types::Address>( + check_cast_lossy::, console_root::types::Address>( Mode::Private, count_is!(2029, 0, 6745, 6750), ); @@ -496,15 +544,15 @@ mod tests { #[test] fn test_i32_to_boolean() { - check_cast_lossy::, console_root::types::Boolean>( + check_cast_lossy::, console_root::types::Boolean>( Mode::Constant, count_is!(0, 0, 0, 0), ); - check_cast_lossy::, console_root::types::Boolean>( + check_cast_lossy::, console_root::types::Boolean>( Mode::Public, count_is!(0, 0, 0, 0), ); - check_cast_lossy::, console_root::types::Boolean>( + check_cast_lossy::, console_root::types::Boolean>( Mode::Private, count_is!(0, 0, 0, 0), ); @@ -512,15 +560,15 @@ mod tests { #[test] fn test_i32_to_field() { - check_cast_lossy::, console_root::types::Field>( + check_cast_lossy::, console_root::types::Field>( Mode::Constant, count_is!(0, 0, 0, 0), ); - check_cast_lossy::, console_root::types::Field>( + check_cast_lossy::, console_root::types::Field>( Mode::Public, count_is!(0, 0, 0, 0), ); - check_cast_lossy::, console_root::types::Field>( + check_cast_lossy::, console_root::types::Field>( Mode::Private, count_is!(0, 0, 0, 0), ); @@ -528,15 +576,15 @@ mod tests { #[test] fn test_i32_to_group() { - check_cast_lossy::, console_root::types::Group>( + check_cast_lossy::, console_root::types::Group>( Mode::Constant, count_less_than!(4303, 0, 0, 0), ); - check_cast_lossy::, console_root::types::Group>( + check_cast_lossy::, console_root::types::Group>( Mode::Public, count_is!(2029, 0, 6745, 6750), ); - check_cast_lossy::, console_root::types::Group>( + check_cast_lossy::, console_root::types::Group>( Mode::Private, count_is!(2029, 0, 6745, 6750), ); @@ -544,40 +592,52 @@ mod tests { #[test] fn test_i32_to_i8() { - check_cast_lossy::, console_root::types::I8>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast_lossy::, console_root::types::I8>(Mode::Public, count_is!(0, 0, 0, 0)); - check_cast_lossy::, console_root::types::I8>(Mode::Private, count_is!(0, 0, 0, 0)); + check_cast_lossy::, console_root::types::I8>(Mode::Constant, count_is!(0, 0, 0, 0)); + check_cast_lossy::, console_root::types::I8>(Mode::Public, count_is!(0, 0, 0, 0)); + check_cast_lossy::, console_root::types::I8>(Mode::Private, count_is!(0, 0, 0, 0)); } #[test] fn test_i32_to_i16() { - check_cast_lossy::, console_root::types::I16>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast_lossy::, console_root::types::I16>(Mode::Public, count_is!(0, 0, 0, 0)); - check_cast_lossy::, console_root::types::I16>(Mode::Private, count_is!(0, 0, 0, 0)); + check_cast_lossy::, console_root::types::I16>( + Mode::Constant, + count_is!(0, 0, 0, 0), + ); + check_cast_lossy::, console_root::types::I16>(Mode::Public, count_is!(0, 0, 0, 0)); + check_cast_lossy::, console_root::types::I16>(Mode::Private, count_is!(0, 0, 0, 0)); } #[test] fn test_i32_to_i32() { - check_cast_lossy::, console_root::types::I32>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast_lossy::, console_root::types::I32>(Mode::Public, count_is!(0, 0, 0, 0)); - check_cast_lossy::, console_root::types::I32>(Mode::Private, count_is!(0, 0, 0, 0)); + check_cast_lossy::, console_root::types::I32>( + Mode::Constant, + count_is!(0, 0, 0, 0), + ); + check_cast_lossy::, console_root::types::I32>(Mode::Public, count_is!(0, 0, 0, 0)); + check_cast_lossy::, console_root::types::I32>(Mode::Private, count_is!(0, 0, 0, 0)); } #[test] fn test_i32_to_i64() { - check_cast_lossy::, console_root::types::I64>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast_lossy::, console_root::types::I64>(Mode::Public, count_is!(0, 0, 0, 0)); - check_cast_lossy::, console_root::types::I64>(Mode::Private, count_is!(0, 0, 0, 0)); + check_cast_lossy::, console_root::types::I64>( + Mode::Constant, + count_is!(0, 0, 0, 0), + ); + check_cast_lossy::, console_root::types::I64>(Mode::Public, count_is!(0, 0, 0, 0)); + check_cast_lossy::, console_root::types::I64>(Mode::Private, count_is!(0, 0, 0, 0)); } #[test] fn test_i32_to_i128() { - check_cast_lossy::, console_root::types::I128>( + check_cast_lossy::, console_root::types::I128>( Mode::Constant, count_is!(0, 0, 0, 0), ); - check_cast_lossy::, console_root::types::I128>(Mode::Public, count_is!(0, 0, 0, 0)); - check_cast_lossy::, console_root::types::I128>( + check_cast_lossy::, console_root::types::I128>( + Mode::Public, + count_is!(0, 0, 0, 0), + ); + check_cast_lossy::, console_root::types::I128>( Mode::Private, count_is!(0, 0, 0, 0), ); @@ -585,15 +645,15 @@ mod tests { #[test] fn test_i32_to_scalar() { - check_cast_lossy::, console_root::types::Scalar>( + check_cast_lossy::, console_root::types::Scalar>( Mode::Constant, count_is!(0, 0, 0, 0), ); - check_cast_lossy::, console_root::types::Scalar>( + check_cast_lossy::, console_root::types::Scalar>( Mode::Public, count_is!(0, 0, 0, 0), ); - check_cast_lossy::, console_root::types::Scalar>( + check_cast_lossy::, console_root::types::Scalar>( Mode::Private, count_is!(0, 0, 0, 0), ); @@ -601,40 +661,52 @@ mod tests { #[test] fn test_i32_to_u8() { - check_cast_lossy::, console_root::types::U8>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast_lossy::, console_root::types::U8>(Mode::Public, count_is!(0, 0, 0, 0)); - check_cast_lossy::, console_root::types::U8>(Mode::Private, count_is!(0, 0, 0, 0)); + check_cast_lossy::, console_root::types::U8>(Mode::Constant, count_is!(0, 0, 0, 0)); + check_cast_lossy::, console_root::types::U8>(Mode::Public, count_is!(0, 0, 0, 0)); + check_cast_lossy::, console_root::types::U8>(Mode::Private, count_is!(0, 0, 0, 0)); } #[test] fn test_i32_to_u16() { - check_cast_lossy::, console_root::types::U16>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast_lossy::, console_root::types::U16>(Mode::Public, count_is!(0, 0, 0, 0)); - check_cast_lossy::, console_root::types::U16>(Mode::Private, count_is!(0, 0, 0, 0)); + check_cast_lossy::, console_root::types::U16>( + Mode::Constant, + count_is!(0, 0, 0, 0), + ); + check_cast_lossy::, console_root::types::U16>(Mode::Public, count_is!(0, 0, 0, 0)); + check_cast_lossy::, console_root::types::U16>(Mode::Private, count_is!(0, 0, 0, 0)); } #[test] fn test_i32_to_u32() { - check_cast_lossy::, console_root::types::U32>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast_lossy::, console_root::types::U32>(Mode::Public, count_is!(0, 0, 0, 0)); - check_cast_lossy::, console_root::types::U32>(Mode::Private, count_is!(0, 0, 0, 0)); + check_cast_lossy::, console_root::types::U32>( + Mode::Constant, + count_is!(0, 0, 0, 0), + ); + check_cast_lossy::, console_root::types::U32>(Mode::Public, count_is!(0, 0, 0, 0)); + check_cast_lossy::, console_root::types::U32>(Mode::Private, count_is!(0, 0, 0, 0)); } #[test] fn test_i32_to_u64() { - check_cast_lossy::, console_root::types::U64>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast_lossy::, console_root::types::U64>(Mode::Public, count_is!(0, 0, 0, 0)); - check_cast_lossy::, console_root::types::U64>(Mode::Private, count_is!(0, 0, 0, 0)); + check_cast_lossy::, console_root::types::U64>( + Mode::Constant, + count_is!(0, 0, 0, 0), + ); + check_cast_lossy::, console_root::types::U64>(Mode::Public, count_is!(0, 0, 0, 0)); + check_cast_lossy::, console_root::types::U64>(Mode::Private, count_is!(0, 0, 0, 0)); } #[test] fn test_i32_to_u128() { - check_cast_lossy::, console_root::types::U128>( + check_cast_lossy::, console_root::types::U128>( Mode::Constant, count_is!(0, 0, 0, 0), ); - check_cast_lossy::, console_root::types::U128>(Mode::Public, count_is!(0, 0, 0, 0)); - check_cast_lossy::, console_root::types::U128>( + check_cast_lossy::, console_root::types::U128>( + Mode::Public, + count_is!(0, 0, 0, 0), + ); + check_cast_lossy::, console_root::types::U128>( Mode::Private, count_is!(0, 0, 0, 0), ); @@ -648,23 +720,23 @@ mod tests { i: usize, mode: Mode, rng: &mut TestRng, - ) -> (console_root::types::I64, I64) { + ) -> (console_root::types::I64, I64) { super::sample_values(i, mode, rng) } - check_cast_lossy!(cast_lossy, I64, console_root::types::I64); + check_cast_lossy!(cast_lossy, I64, console_root::types::I64); #[test] fn test_i64_to_address() { - check_cast_lossy::, console_root::types::Address>( + check_cast_lossy::, console_root::types::Address>( Mode::Constant, count_less_than!(4303, 0, 0, 0), ); - check_cast_lossy::, console_root::types::Address>( + check_cast_lossy::, console_root::types::Address>( Mode::Public, count_is!(2029, 0, 6745, 6750), ); - check_cast_lossy::, console_root::types::Address>( + check_cast_lossy::, console_root::types::Address>( Mode::Private, count_is!(2029, 0, 6745, 6750), ); @@ -672,15 +744,15 @@ mod tests { #[test] fn test_i64_to_boolean() { - check_cast_lossy::, console_root::types::Boolean>( + check_cast_lossy::, console_root::types::Boolean>( Mode::Constant, count_is!(0, 0, 0, 0), ); - check_cast_lossy::, console_root::types::Boolean>( + check_cast_lossy::, console_root::types::Boolean>( Mode::Public, count_is!(0, 0, 0, 0), ); - check_cast_lossy::, console_root::types::Boolean>( + check_cast_lossy::, console_root::types::Boolean>( Mode::Private, count_is!(0, 0, 0, 0), ); @@ -688,15 +760,15 @@ mod tests { #[test] fn test_i64_to_field() { - check_cast_lossy::, console_root::types::Field>( + check_cast_lossy::, console_root::types::Field>( Mode::Constant, count_is!(0, 0, 0, 0), ); - check_cast_lossy::, console_root::types::Field>( + check_cast_lossy::, console_root::types::Field>( Mode::Public, count_is!(0, 0, 0, 0), ); - check_cast_lossy::, console_root::types::Field>( + check_cast_lossy::, console_root::types::Field>( Mode::Private, count_is!(0, 0, 0, 0), ); @@ -704,15 +776,15 @@ mod tests { #[test] fn test_i64_to_group() { - check_cast_lossy::, console_root::types::Group>( + check_cast_lossy::, console_root::types::Group>( Mode::Constant, count_less_than!(4303, 0, 0, 0), ); - check_cast_lossy::, console_root::types::Group>( + check_cast_lossy::, console_root::types::Group>( Mode::Public, count_is!(2029, 0, 6745, 6750), ); - check_cast_lossy::, console_root::types::Group>( + check_cast_lossy::, console_root::types::Group>( Mode::Private, count_is!(2029, 0, 6745, 6750), ); @@ -720,40 +792,52 @@ mod tests { #[test] fn test_i64_to_i8() { - check_cast_lossy::, console_root::types::I8>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast_lossy::, console_root::types::I8>(Mode::Public, count_is!(0, 0, 0, 0)); - check_cast_lossy::, console_root::types::I8>(Mode::Private, count_is!(0, 0, 0, 0)); + check_cast_lossy::, console_root::types::I8>(Mode::Constant, count_is!(0, 0, 0, 0)); + check_cast_lossy::, console_root::types::I8>(Mode::Public, count_is!(0, 0, 0, 0)); + check_cast_lossy::, console_root::types::I8>(Mode::Private, count_is!(0, 0, 0, 0)); } #[test] fn test_i64_to_i16() { - check_cast_lossy::, console_root::types::I16>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast_lossy::, console_root::types::I16>(Mode::Public, count_is!(0, 0, 0, 0)); - check_cast_lossy::, console_root::types::I16>(Mode::Private, count_is!(0, 0, 0, 0)); + check_cast_lossy::, console_root::types::I16>( + Mode::Constant, + count_is!(0, 0, 0, 0), + ); + check_cast_lossy::, console_root::types::I16>(Mode::Public, count_is!(0, 0, 0, 0)); + check_cast_lossy::, console_root::types::I16>(Mode::Private, count_is!(0, 0, 0, 0)); } #[test] fn test_i64_to_i32() { - check_cast_lossy::, console_root::types::I32>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast_lossy::, console_root::types::I32>(Mode::Public, count_is!(0, 0, 0, 0)); - check_cast_lossy::, console_root::types::I32>(Mode::Private, count_is!(0, 0, 0, 0)); + check_cast_lossy::, console_root::types::I32>( + Mode::Constant, + count_is!(0, 0, 0, 0), + ); + check_cast_lossy::, console_root::types::I32>(Mode::Public, count_is!(0, 0, 0, 0)); + check_cast_lossy::, console_root::types::I32>(Mode::Private, count_is!(0, 0, 0, 0)); } #[test] fn test_i64_to_i64() { - check_cast_lossy::, console_root::types::I64>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast_lossy::, console_root::types::I64>(Mode::Public, count_is!(0, 0, 0, 0)); - check_cast_lossy::, console_root::types::I64>(Mode::Private, count_is!(0, 0, 0, 0)); + check_cast_lossy::, console_root::types::I64>( + Mode::Constant, + count_is!(0, 0, 0, 0), + ); + check_cast_lossy::, console_root::types::I64>(Mode::Public, count_is!(0, 0, 0, 0)); + check_cast_lossy::, console_root::types::I64>(Mode::Private, count_is!(0, 0, 0, 0)); } #[test] fn test_i64_to_i128() { - check_cast_lossy::, console_root::types::I128>( + check_cast_lossy::, console_root::types::I128>( Mode::Constant, count_is!(0, 0, 0, 0), ); - check_cast_lossy::, console_root::types::I128>(Mode::Public, count_is!(0, 0, 0, 0)); - check_cast_lossy::, console_root::types::I128>( + check_cast_lossy::, console_root::types::I128>( + Mode::Public, + count_is!(0, 0, 0, 0), + ); + check_cast_lossy::, console_root::types::I128>( Mode::Private, count_is!(0, 0, 0, 0), ); @@ -761,15 +845,15 @@ mod tests { #[test] fn test_i64_to_scalar() { - check_cast_lossy::, console_root::types::Scalar>( + check_cast_lossy::, console_root::types::Scalar>( Mode::Constant, count_is!(0, 0, 0, 0), ); - check_cast_lossy::, console_root::types::Scalar>( + check_cast_lossy::, console_root::types::Scalar>( Mode::Public, count_is!(0, 0, 0, 0), ); - check_cast_lossy::, console_root::types::Scalar>( + check_cast_lossy::, console_root::types::Scalar>( Mode::Private, count_is!(0, 0, 0, 0), ); @@ -777,40 +861,52 @@ mod tests { #[test] fn test_i64_to_u8() { - check_cast_lossy::, console_root::types::U8>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast_lossy::, console_root::types::U8>(Mode::Public, count_is!(0, 0, 0, 0)); - check_cast_lossy::, console_root::types::U8>(Mode::Private, count_is!(0, 0, 0, 0)); + check_cast_lossy::, console_root::types::U8>(Mode::Constant, count_is!(0, 0, 0, 0)); + check_cast_lossy::, console_root::types::U8>(Mode::Public, count_is!(0, 0, 0, 0)); + check_cast_lossy::, console_root::types::U8>(Mode::Private, count_is!(0, 0, 0, 0)); } #[test] fn test_i64_to_u16() { - check_cast_lossy::, console_root::types::U16>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast_lossy::, console_root::types::U16>(Mode::Public, count_is!(0, 0, 0, 0)); - check_cast_lossy::, console_root::types::U16>(Mode::Private, count_is!(0, 0, 0, 0)); + check_cast_lossy::, console_root::types::U16>( + Mode::Constant, + count_is!(0, 0, 0, 0), + ); + check_cast_lossy::, console_root::types::U16>(Mode::Public, count_is!(0, 0, 0, 0)); + check_cast_lossy::, console_root::types::U16>(Mode::Private, count_is!(0, 0, 0, 0)); } #[test] fn test_i64_to_u32() { - check_cast_lossy::, console_root::types::U32>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast_lossy::, console_root::types::U32>(Mode::Public, count_is!(0, 0, 0, 0)); - check_cast_lossy::, console_root::types::U32>(Mode::Private, count_is!(0, 0, 0, 0)); + check_cast_lossy::, console_root::types::U32>( + Mode::Constant, + count_is!(0, 0, 0, 0), + ); + check_cast_lossy::, console_root::types::U32>(Mode::Public, count_is!(0, 0, 0, 0)); + check_cast_lossy::, console_root::types::U32>(Mode::Private, count_is!(0, 0, 0, 0)); } #[test] fn test_i64_to_u64() { - check_cast_lossy::, console_root::types::U64>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast_lossy::, console_root::types::U64>(Mode::Public, count_is!(0, 0, 0, 0)); - check_cast_lossy::, console_root::types::U64>(Mode::Private, count_is!(0, 0, 0, 0)); + check_cast_lossy::, console_root::types::U64>( + Mode::Constant, + count_is!(0, 0, 0, 0), + ); + check_cast_lossy::, console_root::types::U64>(Mode::Public, count_is!(0, 0, 0, 0)); + check_cast_lossy::, console_root::types::U64>(Mode::Private, count_is!(0, 0, 0, 0)); } #[test] fn test_i64_to_u128() { - check_cast_lossy::, console_root::types::U128>( + check_cast_lossy::, console_root::types::U128>( Mode::Constant, count_is!(0, 0, 0, 0), ); - check_cast_lossy::, console_root::types::U128>(Mode::Public, count_is!(0, 0, 0, 0)); - check_cast_lossy::, console_root::types::U128>( + check_cast_lossy::, console_root::types::U128>( + Mode::Public, + count_is!(0, 0, 0, 0), + ); + check_cast_lossy::, console_root::types::U128>( Mode::Private, count_is!(0, 0, 0, 0), ); @@ -824,23 +920,23 @@ mod tests { i: usize, mode: Mode, rng: &mut TestRng, - ) -> (console_root::types::I128, I128) { + ) -> (console_root::types::I128, I128) { super::sample_values(i, mode, rng) } - check_cast_lossy!(cast_lossy, I128, console_root::types::I128); + check_cast_lossy!(cast_lossy, I128, console_root::types::I128); #[test] fn test_i128_to_address() { - check_cast_lossy::, console_root::types::Address>( + check_cast_lossy::, console_root::types::Address>( Mode::Constant, count_less_than!(4303, 0, 0, 0), ); - check_cast_lossy::, console_root::types::Address>( + check_cast_lossy::, console_root::types::Address>( Mode::Public, count_is!(2029, 0, 6745, 6750), ); - check_cast_lossy::, console_root::types::Address>( + check_cast_lossy::, console_root::types::Address>( Mode::Private, count_is!(2029, 0, 6745, 6750), ); @@ -848,15 +944,15 @@ mod tests { #[test] fn test_i128_to_boolean() { - check_cast_lossy::, console_root::types::Boolean>( + check_cast_lossy::, console_root::types::Boolean>( Mode::Constant, count_is!(0, 0, 0, 0), ); - check_cast_lossy::, console_root::types::Boolean>( + check_cast_lossy::, console_root::types::Boolean>( Mode::Public, count_is!(0, 0, 0, 0), ); - check_cast_lossy::, console_root::types::Boolean>( + check_cast_lossy::, console_root::types::Boolean>( Mode::Private, count_is!(0, 0, 0, 0), ); @@ -864,15 +960,15 @@ mod tests { #[test] fn test_i128_to_field() { - check_cast_lossy::, console_root::types::Field>( + check_cast_lossy::, console_root::types::Field>( Mode::Constant, count_is!(0, 0, 0, 0), ); - check_cast_lossy::, console_root::types::Field>( + check_cast_lossy::, console_root::types::Field>( Mode::Public, count_is!(0, 0, 0, 0), ); - check_cast_lossy::, console_root::types::Field>( + check_cast_lossy::, console_root::types::Field>( Mode::Private, count_is!(0, 0, 0, 0), ); @@ -880,15 +976,15 @@ mod tests { #[test] fn test_i128_to_group() { - check_cast_lossy::, console_root::types::Group>( + check_cast_lossy::, console_root::types::Group>( Mode::Constant, count_less_than!(4303, 0, 0, 0), ); - check_cast_lossy::, console_root::types::Group>( + check_cast_lossy::, console_root::types::Group>( Mode::Public, count_is!(2029, 0, 6745, 6750), ); - check_cast_lossy::, console_root::types::Group>( + check_cast_lossy::, console_root::types::Group>( Mode::Private, count_is!(2029, 0, 6745, 6750), ); @@ -896,40 +992,52 @@ mod tests { #[test] fn test_i128_to_i8() { - check_cast_lossy::, console_root::types::I8>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast_lossy::, console_root::types::I8>(Mode::Public, count_is!(0, 0, 0, 0)); - check_cast_lossy::, console_root::types::I8>(Mode::Private, count_is!(0, 0, 0, 0)); + check_cast_lossy::, console_root::types::I8>(Mode::Constant, count_is!(0, 0, 0, 0)); + check_cast_lossy::, console_root::types::I8>(Mode::Public, count_is!(0, 0, 0, 0)); + check_cast_lossy::, console_root::types::I8>(Mode::Private, count_is!(0, 0, 0, 0)); } #[test] fn test_i128_to_i16() { - check_cast_lossy::, console_root::types::I16>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast_lossy::, console_root::types::I16>(Mode::Public, count_is!(0, 0, 0, 0)); - check_cast_lossy::, console_root::types::I16>(Mode::Private, count_is!(0, 0, 0, 0)); + check_cast_lossy::, console_root::types::I16>( + Mode::Constant, + count_is!(0, 0, 0, 0), + ); + check_cast_lossy::, console_root::types::I16>(Mode::Public, count_is!(0, 0, 0, 0)); + check_cast_lossy::, console_root::types::I16>(Mode::Private, count_is!(0, 0, 0, 0)); } #[test] fn test_i128_to_i32() { - check_cast_lossy::, console_root::types::I32>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast_lossy::, console_root::types::I32>(Mode::Public, count_is!(0, 0, 0, 0)); - check_cast_lossy::, console_root::types::I32>(Mode::Private, count_is!(0, 0, 0, 0)); + check_cast_lossy::, console_root::types::I32>( + Mode::Constant, + count_is!(0, 0, 0, 0), + ); + check_cast_lossy::, console_root::types::I32>(Mode::Public, count_is!(0, 0, 0, 0)); + check_cast_lossy::, console_root::types::I32>(Mode::Private, count_is!(0, 0, 0, 0)); } #[test] fn test_i128_to_i64() { - check_cast_lossy::, console_root::types::I64>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast_lossy::, console_root::types::I64>(Mode::Public, count_is!(0, 0, 0, 0)); - check_cast_lossy::, console_root::types::I64>(Mode::Private, count_is!(0, 0, 0, 0)); + check_cast_lossy::, console_root::types::I64>( + Mode::Constant, + count_is!(0, 0, 0, 0), + ); + check_cast_lossy::, console_root::types::I64>(Mode::Public, count_is!(0, 0, 0, 0)); + check_cast_lossy::, console_root::types::I64>(Mode::Private, count_is!(0, 0, 0, 0)); } #[test] fn test_i128_to_i128() { - check_cast_lossy::, console_root::types::I128>( + check_cast_lossy::, console_root::types::I128>( Mode::Constant, count_is!(0, 0, 0, 0), ); - check_cast_lossy::, console_root::types::I128>(Mode::Public, count_is!(0, 0, 0, 0)); - check_cast_lossy::, console_root::types::I128>( + check_cast_lossy::, console_root::types::I128>( + Mode::Public, + count_is!(0, 0, 0, 0), + ); + check_cast_lossy::, console_root::types::I128>( Mode::Private, count_is!(0, 0, 0, 0), ); @@ -937,15 +1045,15 @@ mod tests { #[test] fn test_i128_to_scalar() { - check_cast_lossy::, console_root::types::Scalar>( + check_cast_lossy::, console_root::types::Scalar>( Mode::Constant, count_is!(0, 0, 0, 0), ); - check_cast_lossy::, console_root::types::Scalar>( + check_cast_lossy::, console_root::types::Scalar>( Mode::Public, count_is!(0, 0, 0, 0), ); - check_cast_lossy::, console_root::types::Scalar>( + check_cast_lossy::, console_root::types::Scalar>( Mode::Private, count_is!(0, 0, 0, 0), ); @@ -953,40 +1061,52 @@ mod tests { #[test] fn test_i128_to_u8() { - check_cast_lossy::, console_root::types::U8>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast_lossy::, console_root::types::U8>(Mode::Public, count_is!(0, 0, 0, 0)); - check_cast_lossy::, console_root::types::U8>(Mode::Private, count_is!(0, 0, 0, 0)); + check_cast_lossy::, console_root::types::U8>(Mode::Constant, count_is!(0, 0, 0, 0)); + check_cast_lossy::, console_root::types::U8>(Mode::Public, count_is!(0, 0, 0, 0)); + check_cast_lossy::, console_root::types::U8>(Mode::Private, count_is!(0, 0, 0, 0)); } #[test] fn test_i128_to_u16() { - check_cast_lossy::, console_root::types::U16>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast_lossy::, console_root::types::U16>(Mode::Public, count_is!(0, 0, 0, 0)); - check_cast_lossy::, console_root::types::U16>(Mode::Private, count_is!(0, 0, 0, 0)); + check_cast_lossy::, console_root::types::U16>( + Mode::Constant, + count_is!(0, 0, 0, 0), + ); + check_cast_lossy::, console_root::types::U16>(Mode::Public, count_is!(0, 0, 0, 0)); + check_cast_lossy::, console_root::types::U16>(Mode::Private, count_is!(0, 0, 0, 0)); } #[test] fn test_i128_to_u32() { - check_cast_lossy::, console_root::types::U32>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast_lossy::, console_root::types::U32>(Mode::Public, count_is!(0, 0, 0, 0)); - check_cast_lossy::, console_root::types::U32>(Mode::Private, count_is!(0, 0, 0, 0)); + check_cast_lossy::, console_root::types::U32>( + Mode::Constant, + count_is!(0, 0, 0, 0), + ); + check_cast_lossy::, console_root::types::U32>(Mode::Public, count_is!(0, 0, 0, 0)); + check_cast_lossy::, console_root::types::U32>(Mode::Private, count_is!(0, 0, 0, 0)); } #[test] fn test_i128_to_u64() { - check_cast_lossy::, console_root::types::U64>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast_lossy::, console_root::types::U64>(Mode::Public, count_is!(0, 0, 0, 0)); - check_cast_lossy::, console_root::types::U64>(Mode::Private, count_is!(0, 0, 0, 0)); + check_cast_lossy::, console_root::types::U64>( + Mode::Constant, + count_is!(0, 0, 0, 0), + ); + check_cast_lossy::, console_root::types::U64>(Mode::Public, count_is!(0, 0, 0, 0)); + check_cast_lossy::, console_root::types::U64>(Mode::Private, count_is!(0, 0, 0, 0)); } #[test] fn test_i128_to_u128() { - check_cast_lossy::, console_root::types::U128>( + check_cast_lossy::, console_root::types::U128>( Mode::Constant, count_is!(0, 0, 0, 0), ); - check_cast_lossy::, console_root::types::U128>(Mode::Public, count_is!(0, 0, 0, 0)); - check_cast_lossy::, console_root::types::U128>( + check_cast_lossy::, console_root::types::U128>( + Mode::Public, + count_is!(0, 0, 0, 0), + ); + check_cast_lossy::, console_root::types::U128>( Mode::Private, count_is!(0, 0, 0, 0), ); @@ -996,23 +1116,23 @@ mod tests { mod u8 { use super::*; - fn sample_values(i: usize, mode: Mode, rng: &mut TestRng) -> (console_root::types::U8, U8) { + fn sample_values(i: usize, mode: Mode, rng: &mut TestRng) -> (console_root::types::U8, U8) { super::sample_values(i, mode, rng) } - check_cast_lossy!(cast_lossy, U8, console_root::types::U8); + check_cast_lossy!(cast_lossy, U8, console_root::types::U8); #[test] fn test_u8_to_address() { - check_cast_lossy::, console_root::types::Address>( + check_cast_lossy::, console_root::types::Address>( Mode::Constant, count_less_than!(4303, 0, 0, 0), ); - check_cast_lossy::, console_root::types::Address>( + check_cast_lossy::, console_root::types::Address>( Mode::Public, count_is!(2029, 0, 6745, 6750), ); - check_cast_lossy::, console_root::types::Address>( + check_cast_lossy::, console_root::types::Address>( Mode::Private, count_is!(2029, 0, 6745, 6750), ); @@ -1020,15 +1140,15 @@ mod tests { #[test] fn test_u8_to_boolean() { - check_cast_lossy::, console_root::types::Boolean>( + check_cast_lossy::, console_root::types::Boolean>( Mode::Constant, count_is!(0, 0, 0, 0), ); - check_cast_lossy::, console_root::types::Boolean>( + check_cast_lossy::, console_root::types::Boolean>( Mode::Public, count_is!(0, 0, 0, 0), ); - check_cast_lossy::, console_root::types::Boolean>( + check_cast_lossy::, console_root::types::Boolean>( Mode::Private, count_is!(0, 0, 0, 0), ); @@ -1036,15 +1156,15 @@ mod tests { #[test] fn test_u8_to_field() { - check_cast_lossy::, console_root::types::Field>( + check_cast_lossy::, console_root::types::Field>( Mode::Constant, count_is!(0, 0, 0, 0), ); - check_cast_lossy::, console_root::types::Field>( + check_cast_lossy::, console_root::types::Field>( Mode::Public, count_is!(0, 0, 0, 0), ); - check_cast_lossy::, console_root::types::Field>( + check_cast_lossy::, console_root::types::Field>( Mode::Private, count_is!(0, 0, 0, 0), ); @@ -1052,15 +1172,15 @@ mod tests { #[test] fn test_u8_to_group() { - check_cast_lossy::, console_root::types::Group>( + check_cast_lossy::, console_root::types::Group>( Mode::Constant, count_less_than!(4303, 0, 0, 0), ); - check_cast_lossy::, console_root::types::Group>( + check_cast_lossy::, console_root::types::Group>( Mode::Public, count_is!(2029, 0, 6745, 6750), ); - check_cast_lossy::, console_root::types::Group>( + check_cast_lossy::, console_root::types::Group>( Mode::Private, count_is!(2029, 0, 6745, 6750), ); @@ -1068,40 +1188,52 @@ mod tests { #[test] fn test_u8_to_i8() { - check_cast_lossy::, console_root::types::I8>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast_lossy::, console_root::types::I8>(Mode::Public, count_is!(0, 0, 0, 0)); - check_cast_lossy::, console_root::types::I8>(Mode::Private, count_is!(0, 0, 0, 0)); + check_cast_lossy::, console_root::types::I8>(Mode::Constant, count_is!(0, 0, 0, 0)); + check_cast_lossy::, console_root::types::I8>(Mode::Public, count_is!(0, 0, 0, 0)); + check_cast_lossy::, console_root::types::I8>(Mode::Private, count_is!(0, 0, 0, 0)); } #[test] fn test_u8_to_i16() { - check_cast_lossy::, console_root::types::I16>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast_lossy::, console_root::types::I16>(Mode::Public, count_is!(0, 0, 0, 0)); - check_cast_lossy::, console_root::types::I16>(Mode::Private, count_is!(0, 0, 0, 0)); + check_cast_lossy::, console_root::types::I16>( + Mode::Constant, + count_is!(0, 0, 0, 0), + ); + check_cast_lossy::, console_root::types::I16>(Mode::Public, count_is!(0, 0, 0, 0)); + check_cast_lossy::, console_root::types::I16>(Mode::Private, count_is!(0, 0, 0, 0)); } #[test] fn test_u8_to_i32() { - check_cast_lossy::, console_root::types::I32>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast_lossy::, console_root::types::I32>(Mode::Public, count_is!(0, 0, 0, 0)); - check_cast_lossy::, console_root::types::I32>(Mode::Private, count_is!(0, 0, 0, 0)); + check_cast_lossy::, console_root::types::I32>( + Mode::Constant, + count_is!(0, 0, 0, 0), + ); + check_cast_lossy::, console_root::types::I32>(Mode::Public, count_is!(0, 0, 0, 0)); + check_cast_lossy::, console_root::types::I32>(Mode::Private, count_is!(0, 0, 0, 0)); } #[test] fn test_u8_to_i64() { - check_cast_lossy::, console_root::types::I64>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast_lossy::, console_root::types::I64>(Mode::Public, count_is!(0, 0, 0, 0)); - check_cast_lossy::, console_root::types::I64>(Mode::Private, count_is!(0, 0, 0, 0)); + check_cast_lossy::, console_root::types::I64>( + Mode::Constant, + count_is!(0, 0, 0, 0), + ); + check_cast_lossy::, console_root::types::I64>(Mode::Public, count_is!(0, 0, 0, 0)); + check_cast_lossy::, console_root::types::I64>(Mode::Private, count_is!(0, 0, 0, 0)); } #[test] fn test_u8_to_i128() { - check_cast_lossy::, console_root::types::I128>( + check_cast_lossy::, console_root::types::I128>( Mode::Constant, count_is!(0, 0, 0, 0), ); - check_cast_lossy::, console_root::types::I128>(Mode::Public, count_is!(0, 0, 0, 0)); - check_cast_lossy::, console_root::types::I128>( + check_cast_lossy::, console_root::types::I128>( + Mode::Public, + count_is!(0, 0, 0, 0), + ); + check_cast_lossy::, console_root::types::I128>( Mode::Private, count_is!(0, 0, 0, 0), ); @@ -1109,15 +1241,15 @@ mod tests { #[test] fn test_u8_to_scalar() { - check_cast_lossy::, console_root::types::Scalar>( + check_cast_lossy::, console_root::types::Scalar>( Mode::Constant, count_is!(0, 0, 0, 0), ); - check_cast_lossy::, console_root::types::Scalar>( + check_cast_lossy::, console_root::types::Scalar>( Mode::Public, count_is!(0, 0, 0, 0), ); - check_cast_lossy::, console_root::types::Scalar>( + check_cast_lossy::, console_root::types::Scalar>( Mode::Private, count_is!(0, 0, 0, 0), ); @@ -1125,40 +1257,52 @@ mod tests { #[test] fn test_u8_to_u8() { - check_cast_lossy::, console_root::types::U8>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast_lossy::, console_root::types::U8>(Mode::Public, count_is!(0, 0, 0, 0)); - check_cast_lossy::, console_root::types::U8>(Mode::Private, count_is!(0, 0, 0, 0)); + check_cast_lossy::, console_root::types::U8>(Mode::Constant, count_is!(0, 0, 0, 0)); + check_cast_lossy::, console_root::types::U8>(Mode::Public, count_is!(0, 0, 0, 0)); + check_cast_lossy::, console_root::types::U8>(Mode::Private, count_is!(0, 0, 0, 0)); } #[test] fn test_u8_to_u16() { - check_cast_lossy::, console_root::types::U16>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast_lossy::, console_root::types::U16>(Mode::Public, count_is!(0, 0, 0, 0)); - check_cast_lossy::, console_root::types::U16>(Mode::Private, count_is!(0, 0, 0, 0)); + check_cast_lossy::, console_root::types::U16>( + Mode::Constant, + count_is!(0, 0, 0, 0), + ); + check_cast_lossy::, console_root::types::U16>(Mode::Public, count_is!(0, 0, 0, 0)); + check_cast_lossy::, console_root::types::U16>(Mode::Private, count_is!(0, 0, 0, 0)); } #[test] fn test_u8_to_u32() { - check_cast_lossy::, console_root::types::U32>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast_lossy::, console_root::types::U32>(Mode::Public, count_is!(0, 0, 0, 0)); - check_cast_lossy::, console_root::types::U32>(Mode::Private, count_is!(0, 0, 0, 0)); + check_cast_lossy::, console_root::types::U32>( + Mode::Constant, + count_is!(0, 0, 0, 0), + ); + check_cast_lossy::, console_root::types::U32>(Mode::Public, count_is!(0, 0, 0, 0)); + check_cast_lossy::, console_root::types::U32>(Mode::Private, count_is!(0, 0, 0, 0)); } #[test] fn test_u8_to_u64() { - check_cast_lossy::, console_root::types::U64>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast_lossy::, console_root::types::U64>(Mode::Public, count_is!(0, 0, 0, 0)); - check_cast_lossy::, console_root::types::U64>(Mode::Private, count_is!(0, 0, 0, 0)); + check_cast_lossy::, console_root::types::U64>( + Mode::Constant, + count_is!(0, 0, 0, 0), + ); + check_cast_lossy::, console_root::types::U64>(Mode::Public, count_is!(0, 0, 0, 0)); + check_cast_lossy::, console_root::types::U64>(Mode::Private, count_is!(0, 0, 0, 0)); } #[test] fn test_u8_to_u128() { - check_cast_lossy::, console_root::types::U128>( + check_cast_lossy::, console_root::types::U128>( Mode::Constant, count_is!(0, 0, 0, 0), ); - check_cast_lossy::, console_root::types::U128>(Mode::Public, count_is!(0, 0, 0, 0)); - check_cast_lossy::, console_root::types::U128>( + check_cast_lossy::, console_root::types::U128>( + Mode::Public, + count_is!(0, 0, 0, 0), + ); + check_cast_lossy::, console_root::types::U128>( Mode::Private, count_is!(0, 0, 0, 0), ); @@ -1172,23 +1316,23 @@ mod tests { i: usize, mode: Mode, rng: &mut TestRng, - ) -> (console_root::types::U16, U16) { + ) -> (console_root::types::U16, U16) { super::sample_values(i, mode, rng) } - check_cast_lossy!(cast_lossy, U16, console_root::types::U16); + check_cast_lossy!(cast_lossy, U16, console_root::types::U16); #[test] fn test_u16_to_address() { - check_cast_lossy::, console_root::types::Address>( + check_cast_lossy::, console_root::types::Address>( Mode::Constant, count_less_than!(4303, 0, 0, 0), ); - check_cast_lossy::, console_root::types::Address>( + check_cast_lossy::, console_root::types::Address>( Mode::Public, count_is!(2029, 0, 6745, 6750), ); - check_cast_lossy::, console_root::types::Address>( + check_cast_lossy::, console_root::types::Address>( Mode::Private, count_is!(2029, 0, 6745, 6750), ); @@ -1196,15 +1340,15 @@ mod tests { #[test] fn test_u16_to_boolean() { - check_cast_lossy::, console_root::types::Boolean>( + check_cast_lossy::, console_root::types::Boolean>( Mode::Constant, count_is!(0, 0, 0, 0), ); - check_cast_lossy::, console_root::types::Boolean>( + check_cast_lossy::, console_root::types::Boolean>( Mode::Public, count_is!(0, 0, 0, 0), ); - check_cast_lossy::, console_root::types::Boolean>( + check_cast_lossy::, console_root::types::Boolean>( Mode::Private, count_is!(0, 0, 0, 0), ); @@ -1212,15 +1356,15 @@ mod tests { #[test] fn test_u16_to_field() { - check_cast_lossy::, console_root::types::Field>( + check_cast_lossy::, console_root::types::Field>( Mode::Constant, count_is!(0, 0, 0, 0), ); - check_cast_lossy::, console_root::types::Field>( + check_cast_lossy::, console_root::types::Field>( Mode::Public, count_is!(0, 0, 0, 0), ); - check_cast_lossy::, console_root::types::Field>( + check_cast_lossy::, console_root::types::Field>( Mode::Private, count_is!(0, 0, 0, 0), ); @@ -1228,15 +1372,15 @@ mod tests { #[test] fn test_u16_to_group() { - check_cast_lossy::, console_root::types::Group>( + check_cast_lossy::, console_root::types::Group>( Mode::Constant, count_less_than!(4303, 0, 0, 0), ); - check_cast_lossy::, console_root::types::Group>( + check_cast_lossy::, console_root::types::Group>( Mode::Public, count_is!(2029, 0, 6745, 6750), ); - check_cast_lossy::, console_root::types::Group>( + check_cast_lossy::, console_root::types::Group>( Mode::Private, count_is!(2029, 0, 6745, 6750), ); @@ -1244,40 +1388,52 @@ mod tests { #[test] fn test_u16_to_i8() { - check_cast_lossy::, console_root::types::I8>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast_lossy::, console_root::types::I8>(Mode::Public, count_is!(0, 0, 0, 0)); - check_cast_lossy::, console_root::types::I8>(Mode::Private, count_is!(0, 0, 0, 0)); + check_cast_lossy::, console_root::types::I8>(Mode::Constant, count_is!(0, 0, 0, 0)); + check_cast_lossy::, console_root::types::I8>(Mode::Public, count_is!(0, 0, 0, 0)); + check_cast_lossy::, console_root::types::I8>(Mode::Private, count_is!(0, 0, 0, 0)); } #[test] fn test_u16_to_i16() { - check_cast_lossy::, console_root::types::I16>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast_lossy::, console_root::types::I16>(Mode::Public, count_is!(0, 0, 0, 0)); - check_cast_lossy::, console_root::types::I16>(Mode::Private, count_is!(0, 0, 0, 0)); + check_cast_lossy::, console_root::types::I16>( + Mode::Constant, + count_is!(0, 0, 0, 0), + ); + check_cast_lossy::, console_root::types::I16>(Mode::Public, count_is!(0, 0, 0, 0)); + check_cast_lossy::, console_root::types::I16>(Mode::Private, count_is!(0, 0, 0, 0)); } #[test] fn test_u16_to_i32() { - check_cast_lossy::, console_root::types::I32>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast_lossy::, console_root::types::I32>(Mode::Public, count_is!(0, 0, 0, 0)); - check_cast_lossy::, console_root::types::I32>(Mode::Private, count_is!(0, 0, 0, 0)); + check_cast_lossy::, console_root::types::I32>( + Mode::Constant, + count_is!(0, 0, 0, 0), + ); + check_cast_lossy::, console_root::types::I32>(Mode::Public, count_is!(0, 0, 0, 0)); + check_cast_lossy::, console_root::types::I32>(Mode::Private, count_is!(0, 0, 0, 0)); } #[test] fn test_u16_to_i64() { - check_cast_lossy::, console_root::types::I64>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast_lossy::, console_root::types::I64>(Mode::Public, count_is!(0, 0, 0, 0)); - check_cast_lossy::, console_root::types::I64>(Mode::Private, count_is!(0, 0, 0, 0)); + check_cast_lossy::, console_root::types::I64>( + Mode::Constant, + count_is!(0, 0, 0, 0), + ); + check_cast_lossy::, console_root::types::I64>(Mode::Public, count_is!(0, 0, 0, 0)); + check_cast_lossy::, console_root::types::I64>(Mode::Private, count_is!(0, 0, 0, 0)); } #[test] fn test_u16_to_i128() { - check_cast_lossy::, console_root::types::I128>( + check_cast_lossy::, console_root::types::I128>( Mode::Constant, count_is!(0, 0, 0, 0), ); - check_cast_lossy::, console_root::types::I128>(Mode::Public, count_is!(0, 0, 0, 0)); - check_cast_lossy::, console_root::types::I128>( + check_cast_lossy::, console_root::types::I128>( + Mode::Public, + count_is!(0, 0, 0, 0), + ); + check_cast_lossy::, console_root::types::I128>( Mode::Private, count_is!(0, 0, 0, 0), ); @@ -1285,15 +1441,15 @@ mod tests { #[test] fn test_u16_to_scalar() { - check_cast_lossy::, console_root::types::Scalar>( + check_cast_lossy::, console_root::types::Scalar>( Mode::Constant, count_is!(0, 0, 0, 0), ); - check_cast_lossy::, console_root::types::Scalar>( + check_cast_lossy::, console_root::types::Scalar>( Mode::Public, count_is!(0, 0, 0, 0), ); - check_cast_lossy::, console_root::types::Scalar>( + check_cast_lossy::, console_root::types::Scalar>( Mode::Private, count_is!(0, 0, 0, 0), ); @@ -1301,40 +1457,52 @@ mod tests { #[test] fn test_u16_to_u8() { - check_cast_lossy::, console_root::types::U8>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast_lossy::, console_root::types::U8>(Mode::Public, count_is!(0, 0, 0, 0)); - check_cast_lossy::, console_root::types::U8>(Mode::Private, count_is!(0, 0, 0, 0)); + check_cast_lossy::, console_root::types::U8>(Mode::Constant, count_is!(0, 0, 0, 0)); + check_cast_lossy::, console_root::types::U8>(Mode::Public, count_is!(0, 0, 0, 0)); + check_cast_lossy::, console_root::types::U8>(Mode::Private, count_is!(0, 0, 0, 0)); } #[test] fn test_u16_to_u16() { - check_cast_lossy::, console_root::types::U16>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast_lossy::, console_root::types::U16>(Mode::Public, count_is!(0, 0, 0, 0)); - check_cast_lossy::, console_root::types::U16>(Mode::Private, count_is!(0, 0, 0, 0)); + check_cast_lossy::, console_root::types::U16>( + Mode::Constant, + count_is!(0, 0, 0, 0), + ); + check_cast_lossy::, console_root::types::U16>(Mode::Public, count_is!(0, 0, 0, 0)); + check_cast_lossy::, console_root::types::U16>(Mode::Private, count_is!(0, 0, 0, 0)); } #[test] fn test_u16_to_u32() { - check_cast_lossy::, console_root::types::U32>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast_lossy::, console_root::types::U32>(Mode::Public, count_is!(0, 0, 0, 0)); - check_cast_lossy::, console_root::types::U32>(Mode::Private, count_is!(0, 0, 0, 0)); + check_cast_lossy::, console_root::types::U32>( + Mode::Constant, + count_is!(0, 0, 0, 0), + ); + check_cast_lossy::, console_root::types::U32>(Mode::Public, count_is!(0, 0, 0, 0)); + check_cast_lossy::, console_root::types::U32>(Mode::Private, count_is!(0, 0, 0, 0)); } #[test] fn test_u16_to_u64() { - check_cast_lossy::, console_root::types::U64>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast_lossy::, console_root::types::U64>(Mode::Public, count_is!(0, 0, 0, 0)); - check_cast_lossy::, console_root::types::U64>(Mode::Private, count_is!(0, 0, 0, 0)); + check_cast_lossy::, console_root::types::U64>( + Mode::Constant, + count_is!(0, 0, 0, 0), + ); + check_cast_lossy::, console_root::types::U64>(Mode::Public, count_is!(0, 0, 0, 0)); + check_cast_lossy::, console_root::types::U64>(Mode::Private, count_is!(0, 0, 0, 0)); } #[test] fn test_u16_to_u128() { - check_cast_lossy::, console_root::types::U128>( + check_cast_lossy::, console_root::types::U128>( Mode::Constant, count_is!(0, 0, 0, 0), ); - check_cast_lossy::, console_root::types::U128>(Mode::Public, count_is!(0, 0, 0, 0)); - check_cast_lossy::, console_root::types::U128>( + check_cast_lossy::, console_root::types::U128>( + Mode::Public, + count_is!(0, 0, 0, 0), + ); + check_cast_lossy::, console_root::types::U128>( Mode::Private, count_is!(0, 0, 0, 0), ); @@ -1348,23 +1516,23 @@ mod tests { i: usize, mode: Mode, rng: &mut TestRng, - ) -> (console_root::types::U32, U32) { + ) -> (console_root::types::U32, U32) { super::sample_values(i, mode, rng) } - check_cast_lossy!(cast_lossy, U32, console_root::types::U32); + check_cast_lossy!(cast_lossy, U32, console_root::types::U32); #[test] fn test_u32_to_address() { - check_cast_lossy::, console_root::types::Address>( + check_cast_lossy::, console_root::types::Address>( Mode::Constant, count_less_than!(4303, 0, 0, 0), ); - check_cast_lossy::, console_root::types::Address>( + check_cast_lossy::, console_root::types::Address>( Mode::Public, count_is!(2029, 0, 6745, 6750), ); - check_cast_lossy::, console_root::types::Address>( + check_cast_lossy::, console_root::types::Address>( Mode::Private, count_is!(2029, 0, 6745, 6750), ); @@ -1372,15 +1540,15 @@ mod tests { #[test] fn test_u32_to_boolean() { - check_cast_lossy::, console_root::types::Boolean>( + check_cast_lossy::, console_root::types::Boolean>( Mode::Constant, count_is!(0, 0, 0, 0), ); - check_cast_lossy::, console_root::types::Boolean>( + check_cast_lossy::, console_root::types::Boolean>( Mode::Public, count_is!(0, 0, 0, 0), ); - check_cast_lossy::, console_root::types::Boolean>( + check_cast_lossy::, console_root::types::Boolean>( Mode::Private, count_is!(0, 0, 0, 0), ); @@ -1388,15 +1556,15 @@ mod tests { #[test] fn test_u32_to_field() { - check_cast_lossy::, console_root::types::Field>( + check_cast_lossy::, console_root::types::Field>( Mode::Constant, count_is!(0, 0, 0, 0), ); - check_cast_lossy::, console_root::types::Field>( + check_cast_lossy::, console_root::types::Field>( Mode::Public, count_is!(0, 0, 0, 0), ); - check_cast_lossy::, console_root::types::Field>( + check_cast_lossy::, console_root::types::Field>( Mode::Private, count_is!(0, 0, 0, 0), ); @@ -1404,15 +1572,15 @@ mod tests { #[test] fn test_u32_to_group() { - check_cast_lossy::, console_root::types::Group>( + check_cast_lossy::, console_root::types::Group>( Mode::Constant, count_less_than!(4303, 0, 0, 0), ); - check_cast_lossy::, console_root::types::Group>( + check_cast_lossy::, console_root::types::Group>( Mode::Public, count_is!(2029, 0, 6745, 6750), ); - check_cast_lossy::, console_root::types::Group>( + check_cast_lossy::, console_root::types::Group>( Mode::Private, count_is!(2029, 0, 6745, 6750), ); @@ -1420,40 +1588,52 @@ mod tests { #[test] fn test_u32_to_i8() { - check_cast_lossy::, console_root::types::I8>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast_lossy::, console_root::types::I8>(Mode::Public, count_is!(0, 0, 0, 0)); - check_cast_lossy::, console_root::types::I8>(Mode::Private, count_is!(0, 0, 0, 0)); + check_cast_lossy::, console_root::types::I8>(Mode::Constant, count_is!(0, 0, 0, 0)); + check_cast_lossy::, console_root::types::I8>(Mode::Public, count_is!(0, 0, 0, 0)); + check_cast_lossy::, console_root::types::I8>(Mode::Private, count_is!(0, 0, 0, 0)); } #[test] fn test_u32_to_i16() { - check_cast_lossy::, console_root::types::I16>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast_lossy::, console_root::types::I16>(Mode::Public, count_is!(0, 0, 0, 0)); - check_cast_lossy::, console_root::types::I16>(Mode::Private, count_is!(0, 0, 0, 0)); + check_cast_lossy::, console_root::types::I16>( + Mode::Constant, + count_is!(0, 0, 0, 0), + ); + check_cast_lossy::, console_root::types::I16>(Mode::Public, count_is!(0, 0, 0, 0)); + check_cast_lossy::, console_root::types::I16>(Mode::Private, count_is!(0, 0, 0, 0)); } #[test] fn test_u32_to_i32() { - check_cast_lossy::, console_root::types::I32>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast_lossy::, console_root::types::I32>(Mode::Public, count_is!(0, 0, 0, 0)); - check_cast_lossy::, console_root::types::I32>(Mode::Private, count_is!(0, 0, 0, 0)); + check_cast_lossy::, console_root::types::I32>( + Mode::Constant, + count_is!(0, 0, 0, 0), + ); + check_cast_lossy::, console_root::types::I32>(Mode::Public, count_is!(0, 0, 0, 0)); + check_cast_lossy::, console_root::types::I32>(Mode::Private, count_is!(0, 0, 0, 0)); } #[test] fn test_u32_to_i64() { - check_cast_lossy::, console_root::types::I64>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast_lossy::, console_root::types::I64>(Mode::Public, count_is!(0, 0, 0, 0)); - check_cast_lossy::, console_root::types::I64>(Mode::Private, count_is!(0, 0, 0, 0)); + check_cast_lossy::, console_root::types::I64>( + Mode::Constant, + count_is!(0, 0, 0, 0), + ); + check_cast_lossy::, console_root::types::I64>(Mode::Public, count_is!(0, 0, 0, 0)); + check_cast_lossy::, console_root::types::I64>(Mode::Private, count_is!(0, 0, 0, 0)); } #[test] fn test_u32_to_i128() { - check_cast_lossy::, console_root::types::I128>( + check_cast_lossy::, console_root::types::I128>( Mode::Constant, count_is!(0, 0, 0, 0), ); - check_cast_lossy::, console_root::types::I128>(Mode::Public, count_is!(0, 0, 0, 0)); - check_cast_lossy::, console_root::types::I128>( + check_cast_lossy::, console_root::types::I128>( + Mode::Public, + count_is!(0, 0, 0, 0), + ); + check_cast_lossy::, console_root::types::I128>( Mode::Private, count_is!(0, 0, 0, 0), ); @@ -1461,15 +1641,15 @@ mod tests { #[test] fn test_u32_to_scalar() { - check_cast_lossy::, console_root::types::Scalar>( + check_cast_lossy::, console_root::types::Scalar>( Mode::Constant, count_is!(0, 0, 0, 0), ); - check_cast_lossy::, console_root::types::Scalar>( + check_cast_lossy::, console_root::types::Scalar>( Mode::Public, count_is!(0, 0, 0, 0), ); - check_cast_lossy::, console_root::types::Scalar>( + check_cast_lossy::, console_root::types::Scalar>( Mode::Private, count_is!(0, 0, 0, 0), ); @@ -1477,40 +1657,52 @@ mod tests { #[test] fn test_u32_to_u8() { - check_cast_lossy::, console_root::types::U8>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast_lossy::, console_root::types::U8>(Mode::Public, count_is!(0, 0, 0, 0)); - check_cast_lossy::, console_root::types::U8>(Mode::Private, count_is!(0, 0, 0, 0)); + check_cast_lossy::, console_root::types::U8>(Mode::Constant, count_is!(0, 0, 0, 0)); + check_cast_lossy::, console_root::types::U8>(Mode::Public, count_is!(0, 0, 0, 0)); + check_cast_lossy::, console_root::types::U8>(Mode::Private, count_is!(0, 0, 0, 0)); } #[test] fn test_u32_to_u16() { - check_cast_lossy::, console_root::types::U16>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast_lossy::, console_root::types::U16>(Mode::Public, count_is!(0, 0, 0, 0)); - check_cast_lossy::, console_root::types::U16>(Mode::Private, count_is!(0, 0, 0, 0)); + check_cast_lossy::, console_root::types::U16>( + Mode::Constant, + count_is!(0, 0, 0, 0), + ); + check_cast_lossy::, console_root::types::U16>(Mode::Public, count_is!(0, 0, 0, 0)); + check_cast_lossy::, console_root::types::U16>(Mode::Private, count_is!(0, 0, 0, 0)); } #[test] fn test_u32_to_u32() { - check_cast_lossy::, console_root::types::U32>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast_lossy::, console_root::types::U32>(Mode::Public, count_is!(0, 0, 0, 0)); - check_cast_lossy::, console_root::types::U32>(Mode::Private, count_is!(0, 0, 0, 0)); + check_cast_lossy::, console_root::types::U32>( + Mode::Constant, + count_is!(0, 0, 0, 0), + ); + check_cast_lossy::, console_root::types::U32>(Mode::Public, count_is!(0, 0, 0, 0)); + check_cast_lossy::, console_root::types::U32>(Mode::Private, count_is!(0, 0, 0, 0)); } #[test] fn test_u32_to_u64() { - check_cast_lossy::, console_root::types::U64>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast_lossy::, console_root::types::U64>(Mode::Public, count_is!(0, 0, 0, 0)); - check_cast_lossy::, console_root::types::U64>(Mode::Private, count_is!(0, 0, 0, 0)); + check_cast_lossy::, console_root::types::U64>( + Mode::Constant, + count_is!(0, 0, 0, 0), + ); + check_cast_lossy::, console_root::types::U64>(Mode::Public, count_is!(0, 0, 0, 0)); + check_cast_lossy::, console_root::types::U64>(Mode::Private, count_is!(0, 0, 0, 0)); } #[test] fn test_u32_to_u128() { - check_cast_lossy::, console_root::types::U128>( + check_cast_lossy::, console_root::types::U128>( Mode::Constant, count_is!(0, 0, 0, 0), ); - check_cast_lossy::, console_root::types::U128>(Mode::Public, count_is!(0, 0, 0, 0)); - check_cast_lossy::, console_root::types::U128>( + check_cast_lossy::, console_root::types::U128>( + Mode::Public, + count_is!(0, 0, 0, 0), + ); + check_cast_lossy::, console_root::types::U128>( Mode::Private, count_is!(0, 0, 0, 0), ); @@ -1524,23 +1716,23 @@ mod tests { i: usize, mode: Mode, rng: &mut TestRng, - ) -> (console_root::types::U64, U64) { + ) -> (console_root::types::U64, U64) { super::sample_values(i, mode, rng) } - check_cast_lossy!(cast_lossy, U64, console_root::types::U64); + check_cast_lossy!(cast_lossy, U64, console_root::types::U64); #[test] fn test_u64_to_address() { - check_cast_lossy::, console_root::types::Address>( + check_cast_lossy::, console_root::types::Address>( Mode::Constant, count_less_than!(4303, 0, 0, 0), ); - check_cast_lossy::, console_root::types::Address>( + check_cast_lossy::, console_root::types::Address>( Mode::Public, count_is!(2029, 0, 6745, 6750), ); - check_cast_lossy::, console_root::types::Address>( + check_cast_lossy::, console_root::types::Address>( Mode::Private, count_is!(2029, 0, 6745, 6750), ); @@ -1548,15 +1740,15 @@ mod tests { #[test] fn test_u64_to_boolean() { - check_cast_lossy::, console_root::types::Boolean>( + check_cast_lossy::, console_root::types::Boolean>( Mode::Constant, count_is!(0, 0, 0, 0), ); - check_cast_lossy::, console_root::types::Boolean>( + check_cast_lossy::, console_root::types::Boolean>( Mode::Public, count_is!(0, 0, 0, 0), ); - check_cast_lossy::, console_root::types::Boolean>( + check_cast_lossy::, console_root::types::Boolean>( Mode::Private, count_is!(0, 0, 0, 0), ); @@ -1564,15 +1756,15 @@ mod tests { #[test] fn test_u64_to_field() { - check_cast_lossy::, console_root::types::Field>( + check_cast_lossy::, console_root::types::Field>( Mode::Constant, count_is!(0, 0, 0, 0), ); - check_cast_lossy::, console_root::types::Field>( + check_cast_lossy::, console_root::types::Field>( Mode::Public, count_is!(0, 0, 0, 0), ); - check_cast_lossy::, console_root::types::Field>( + check_cast_lossy::, console_root::types::Field>( Mode::Private, count_is!(0, 0, 0, 0), ); @@ -1580,15 +1772,15 @@ mod tests { #[test] fn test_u64_to_group() { - check_cast_lossy::, console_root::types::Group>( + check_cast_lossy::, console_root::types::Group>( Mode::Constant, count_less_than!(4303, 0, 0, 0), ); - check_cast_lossy::, console_root::types::Group>( + check_cast_lossy::, console_root::types::Group>( Mode::Public, count_is!(2029, 0, 6745, 6750), ); - check_cast_lossy::, console_root::types::Group>( + check_cast_lossy::, console_root::types::Group>( Mode::Private, count_is!(2029, 0, 6745, 6750), ); @@ -1596,40 +1788,52 @@ mod tests { #[test] fn test_u64_to_i8() { - check_cast_lossy::, console_root::types::I8>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast_lossy::, console_root::types::I8>(Mode::Public, count_is!(0, 0, 0, 0)); - check_cast_lossy::, console_root::types::I8>(Mode::Private, count_is!(0, 0, 0, 0)); + check_cast_lossy::, console_root::types::I8>(Mode::Constant, count_is!(0, 0, 0, 0)); + check_cast_lossy::, console_root::types::I8>(Mode::Public, count_is!(0, 0, 0, 0)); + check_cast_lossy::, console_root::types::I8>(Mode::Private, count_is!(0, 0, 0, 0)); } #[test] fn test_u64_to_i16() { - check_cast_lossy::, console_root::types::I16>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast_lossy::, console_root::types::I16>(Mode::Public, count_is!(0, 0, 0, 0)); - check_cast_lossy::, console_root::types::I16>(Mode::Private, count_is!(0, 0, 0, 0)); + check_cast_lossy::, console_root::types::I16>( + Mode::Constant, + count_is!(0, 0, 0, 0), + ); + check_cast_lossy::, console_root::types::I16>(Mode::Public, count_is!(0, 0, 0, 0)); + check_cast_lossy::, console_root::types::I16>(Mode::Private, count_is!(0, 0, 0, 0)); } #[test] fn test_u64_to_i32() { - check_cast_lossy::, console_root::types::I32>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast_lossy::, console_root::types::I32>(Mode::Public, count_is!(0, 0, 0, 0)); - check_cast_lossy::, console_root::types::I32>(Mode::Private, count_is!(0, 0, 0, 0)); + check_cast_lossy::, console_root::types::I32>( + Mode::Constant, + count_is!(0, 0, 0, 0), + ); + check_cast_lossy::, console_root::types::I32>(Mode::Public, count_is!(0, 0, 0, 0)); + check_cast_lossy::, console_root::types::I32>(Mode::Private, count_is!(0, 0, 0, 0)); } #[test] fn test_u64_to_i64() { - check_cast_lossy::, console_root::types::I64>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast_lossy::, console_root::types::I64>(Mode::Public, count_is!(0, 0, 0, 0)); - check_cast_lossy::, console_root::types::I64>(Mode::Private, count_is!(0, 0, 0, 0)); + check_cast_lossy::, console_root::types::I64>( + Mode::Constant, + count_is!(0, 0, 0, 0), + ); + check_cast_lossy::, console_root::types::I64>(Mode::Public, count_is!(0, 0, 0, 0)); + check_cast_lossy::, console_root::types::I64>(Mode::Private, count_is!(0, 0, 0, 0)); } #[test] fn test_u64_to_i128() { - check_cast_lossy::, console_root::types::I128>( + check_cast_lossy::, console_root::types::I128>( Mode::Constant, count_is!(0, 0, 0, 0), ); - check_cast_lossy::, console_root::types::I128>(Mode::Public, count_is!(0, 0, 0, 0)); - check_cast_lossy::, console_root::types::I128>( + check_cast_lossy::, console_root::types::I128>( + Mode::Public, + count_is!(0, 0, 0, 0), + ); + check_cast_lossy::, console_root::types::I128>( Mode::Private, count_is!(0, 0, 0, 0), ); @@ -1637,15 +1841,15 @@ mod tests { #[test] fn test_u64_to_scalar() { - check_cast_lossy::, console_root::types::Scalar>( + check_cast_lossy::, console_root::types::Scalar>( Mode::Constant, count_is!(0, 0, 0, 0), ); - check_cast_lossy::, console_root::types::Scalar>( + check_cast_lossy::, console_root::types::Scalar>( Mode::Public, count_is!(0, 0, 0, 0), ); - check_cast_lossy::, console_root::types::Scalar>( + check_cast_lossy::, console_root::types::Scalar>( Mode::Private, count_is!(0, 0, 0, 0), ); @@ -1653,40 +1857,52 @@ mod tests { #[test] fn test_u64_to_u8() { - check_cast_lossy::, console_root::types::U8>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast_lossy::, console_root::types::U8>(Mode::Public, count_is!(0, 0, 0, 0)); - check_cast_lossy::, console_root::types::U8>(Mode::Private, count_is!(0, 0, 0, 0)); + check_cast_lossy::, console_root::types::U8>(Mode::Constant, count_is!(0, 0, 0, 0)); + check_cast_lossy::, console_root::types::U8>(Mode::Public, count_is!(0, 0, 0, 0)); + check_cast_lossy::, console_root::types::U8>(Mode::Private, count_is!(0, 0, 0, 0)); } #[test] fn test_u64_to_u16() { - check_cast_lossy::, console_root::types::U16>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast_lossy::, console_root::types::U16>(Mode::Public, count_is!(0, 0, 0, 0)); - check_cast_lossy::, console_root::types::U16>(Mode::Private, count_is!(0, 0, 0, 0)); + check_cast_lossy::, console_root::types::U16>( + Mode::Constant, + count_is!(0, 0, 0, 0), + ); + check_cast_lossy::, console_root::types::U16>(Mode::Public, count_is!(0, 0, 0, 0)); + check_cast_lossy::, console_root::types::U16>(Mode::Private, count_is!(0, 0, 0, 0)); } #[test] fn test_u64_to_u32() { - check_cast_lossy::, console_root::types::U32>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast_lossy::, console_root::types::U32>(Mode::Public, count_is!(0, 0, 0, 0)); - check_cast_lossy::, console_root::types::U32>(Mode::Private, count_is!(0, 0, 0, 0)); + check_cast_lossy::, console_root::types::U32>( + Mode::Constant, + count_is!(0, 0, 0, 0), + ); + check_cast_lossy::, console_root::types::U32>(Mode::Public, count_is!(0, 0, 0, 0)); + check_cast_lossy::, console_root::types::U32>(Mode::Private, count_is!(0, 0, 0, 0)); } #[test] fn test_u64_to_u64() { - check_cast_lossy::, console_root::types::U64>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast_lossy::, console_root::types::U64>(Mode::Public, count_is!(0, 0, 0, 0)); - check_cast_lossy::, console_root::types::U64>(Mode::Private, count_is!(0, 0, 0, 0)); + check_cast_lossy::, console_root::types::U64>( + Mode::Constant, + count_is!(0, 0, 0, 0), + ); + check_cast_lossy::, console_root::types::U64>(Mode::Public, count_is!(0, 0, 0, 0)); + check_cast_lossy::, console_root::types::U64>(Mode::Private, count_is!(0, 0, 0, 0)); } #[test] fn test_u64_to_u128() { - check_cast_lossy::, console_root::types::U128>( + check_cast_lossy::, console_root::types::U128>( Mode::Constant, count_is!(0, 0, 0, 0), ); - check_cast_lossy::, console_root::types::U128>(Mode::Public, count_is!(0, 0, 0, 0)); - check_cast_lossy::, console_root::types::U128>( + check_cast_lossy::, console_root::types::U128>( + Mode::Public, + count_is!(0, 0, 0, 0), + ); + check_cast_lossy::, console_root::types::U128>( Mode::Private, count_is!(0, 0, 0, 0), ); @@ -1700,23 +1916,23 @@ mod tests { i: usize, mode: Mode, rng: &mut TestRng, - ) -> (console_root::types::U128, U128) { + ) -> (console_root::types::U128, U128) { super::sample_values(i, mode, rng) } - check_cast_lossy!(cast_lossy, U128, console_root::types::U128); + check_cast_lossy!(cast_lossy, U128, console_root::types::U128); #[test] fn test_u128_to_address() { - check_cast_lossy::, console_root::types::Address>( + check_cast_lossy::, console_root::types::Address>( Mode::Constant, count_less_than!(4303, 0, 0, 0), ); - check_cast_lossy::, console_root::types::Address>( + check_cast_lossy::, console_root::types::Address>( Mode::Public, count_is!(2029, 0, 6745, 6750), ); - check_cast_lossy::, console_root::types::Address>( + check_cast_lossy::, console_root::types::Address>( Mode::Private, count_is!(2029, 0, 6745, 6750), ); @@ -1724,15 +1940,15 @@ mod tests { #[test] fn test_u128_to_boolean() { - check_cast_lossy::, console_root::types::Boolean>( + check_cast_lossy::, console_root::types::Boolean>( Mode::Constant, count_is!(0, 0, 0, 0), ); - check_cast_lossy::, console_root::types::Boolean>( + check_cast_lossy::, console_root::types::Boolean>( Mode::Public, count_is!(0, 0, 0, 0), ); - check_cast_lossy::, console_root::types::Boolean>( + check_cast_lossy::, console_root::types::Boolean>( Mode::Private, count_is!(0, 0, 0, 0), ); @@ -1740,15 +1956,15 @@ mod tests { #[test] fn test_u128_to_field() { - check_cast_lossy::, console_root::types::Field>( + check_cast_lossy::, console_root::types::Field>( Mode::Constant, count_is!(0, 0, 0, 0), ); - check_cast_lossy::, console_root::types::Field>( + check_cast_lossy::, console_root::types::Field>( Mode::Public, count_is!(0, 0, 0, 0), ); - check_cast_lossy::, console_root::types::Field>( + check_cast_lossy::, console_root::types::Field>( Mode::Private, count_is!(0, 0, 0, 0), ); @@ -1756,15 +1972,15 @@ mod tests { #[test] fn test_u128_to_group() { - check_cast_lossy::, console_root::types::Group>( + check_cast_lossy::, console_root::types::Group>( Mode::Constant, count_less_than!(4303, 0, 0, 0), ); - check_cast_lossy::, console_root::types::Group>( + check_cast_lossy::, console_root::types::Group>( Mode::Public, count_is!(2029, 0, 6745, 6750), ); - check_cast_lossy::, console_root::types::Group>( + check_cast_lossy::, console_root::types::Group>( Mode::Private, count_is!(2029, 0, 6745, 6750), ); @@ -1772,40 +1988,52 @@ mod tests { #[test] fn test_u128_to_i8() { - check_cast_lossy::, console_root::types::I8>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast_lossy::, console_root::types::I8>(Mode::Public, count_is!(0, 0, 0, 0)); - check_cast_lossy::, console_root::types::I8>(Mode::Private, count_is!(0, 0, 0, 0)); + check_cast_lossy::, console_root::types::I8>(Mode::Constant, count_is!(0, 0, 0, 0)); + check_cast_lossy::, console_root::types::I8>(Mode::Public, count_is!(0, 0, 0, 0)); + check_cast_lossy::, console_root::types::I8>(Mode::Private, count_is!(0, 0, 0, 0)); } #[test] fn test_u128_to_i16() { - check_cast_lossy::, console_root::types::I16>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast_lossy::, console_root::types::I16>(Mode::Public, count_is!(0, 0, 0, 0)); - check_cast_lossy::, console_root::types::I16>(Mode::Private, count_is!(0, 0, 0, 0)); + check_cast_lossy::, console_root::types::I16>( + Mode::Constant, + count_is!(0, 0, 0, 0), + ); + check_cast_lossy::, console_root::types::I16>(Mode::Public, count_is!(0, 0, 0, 0)); + check_cast_lossy::, console_root::types::I16>(Mode::Private, count_is!(0, 0, 0, 0)); } #[test] fn test_u128_to_i32() { - check_cast_lossy::, console_root::types::I32>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast_lossy::, console_root::types::I32>(Mode::Public, count_is!(0, 0, 0, 0)); - check_cast_lossy::, console_root::types::I32>(Mode::Private, count_is!(0, 0, 0, 0)); + check_cast_lossy::, console_root::types::I32>( + Mode::Constant, + count_is!(0, 0, 0, 0), + ); + check_cast_lossy::, console_root::types::I32>(Mode::Public, count_is!(0, 0, 0, 0)); + check_cast_lossy::, console_root::types::I32>(Mode::Private, count_is!(0, 0, 0, 0)); } #[test] fn test_u128_to_i64() { - check_cast_lossy::, console_root::types::I64>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast_lossy::, console_root::types::I64>(Mode::Public, count_is!(0, 0, 0, 0)); - check_cast_lossy::, console_root::types::I64>(Mode::Private, count_is!(0, 0, 0, 0)); + check_cast_lossy::, console_root::types::I64>( + Mode::Constant, + count_is!(0, 0, 0, 0), + ); + check_cast_lossy::, console_root::types::I64>(Mode::Public, count_is!(0, 0, 0, 0)); + check_cast_lossy::, console_root::types::I64>(Mode::Private, count_is!(0, 0, 0, 0)); } #[test] fn test_u128_to_i128() { - check_cast_lossy::, console_root::types::I128>( + check_cast_lossy::, console_root::types::I128>( Mode::Constant, count_is!(0, 0, 0, 0), ); - check_cast_lossy::, console_root::types::I128>(Mode::Public, count_is!(0, 0, 0, 0)); - check_cast_lossy::, console_root::types::I128>( + check_cast_lossy::, console_root::types::I128>( + Mode::Public, + count_is!(0, 0, 0, 0), + ); + check_cast_lossy::, console_root::types::I128>( Mode::Private, count_is!(0, 0, 0, 0), ); @@ -1813,15 +2041,15 @@ mod tests { #[test] fn test_u128_to_scalar() { - check_cast_lossy::, console_root::types::Scalar>( + check_cast_lossy::, console_root::types::Scalar>( Mode::Constant, count_is!(0, 0, 0, 0), ); - check_cast_lossy::, console_root::types::Scalar>( + check_cast_lossy::, console_root::types::Scalar>( Mode::Public, count_is!(0, 0, 0, 0), ); - check_cast_lossy::, console_root::types::Scalar>( + check_cast_lossy::, console_root::types::Scalar>( Mode::Private, count_is!(0, 0, 0, 0), ); @@ -1829,40 +2057,52 @@ mod tests { #[test] fn test_u128_to_u8() { - check_cast_lossy::, console_root::types::U8>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast_lossy::, console_root::types::U8>(Mode::Public, count_is!(0, 0, 0, 0)); - check_cast_lossy::, console_root::types::U8>(Mode::Private, count_is!(0, 0, 0, 0)); + check_cast_lossy::, console_root::types::U8>(Mode::Constant, count_is!(0, 0, 0, 0)); + check_cast_lossy::, console_root::types::U8>(Mode::Public, count_is!(0, 0, 0, 0)); + check_cast_lossy::, console_root::types::U8>(Mode::Private, count_is!(0, 0, 0, 0)); } #[test] fn test_u128_to_u16() { - check_cast_lossy::, console_root::types::U16>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast_lossy::, console_root::types::U16>(Mode::Public, count_is!(0, 0, 0, 0)); - check_cast_lossy::, console_root::types::U16>(Mode::Private, count_is!(0, 0, 0, 0)); + check_cast_lossy::, console_root::types::U16>( + Mode::Constant, + count_is!(0, 0, 0, 0), + ); + check_cast_lossy::, console_root::types::U16>(Mode::Public, count_is!(0, 0, 0, 0)); + check_cast_lossy::, console_root::types::U16>(Mode::Private, count_is!(0, 0, 0, 0)); } #[test] fn test_u128_to_u32() { - check_cast_lossy::, console_root::types::U32>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast_lossy::, console_root::types::U32>(Mode::Public, count_is!(0, 0, 0, 0)); - check_cast_lossy::, console_root::types::U32>(Mode::Private, count_is!(0, 0, 0, 0)); + check_cast_lossy::, console_root::types::U32>( + Mode::Constant, + count_is!(0, 0, 0, 0), + ); + check_cast_lossy::, console_root::types::U32>(Mode::Public, count_is!(0, 0, 0, 0)); + check_cast_lossy::, console_root::types::U32>(Mode::Private, count_is!(0, 0, 0, 0)); } #[test] fn test_u128_to_u64() { - check_cast_lossy::, console_root::types::U64>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast_lossy::, console_root::types::U64>(Mode::Public, count_is!(0, 0, 0, 0)); - check_cast_lossy::, console_root::types::U64>(Mode::Private, count_is!(0, 0, 0, 0)); + check_cast_lossy::, console_root::types::U64>( + Mode::Constant, + count_is!(0, 0, 0, 0), + ); + check_cast_lossy::, console_root::types::U64>(Mode::Public, count_is!(0, 0, 0, 0)); + check_cast_lossy::, console_root::types::U64>(Mode::Private, count_is!(0, 0, 0, 0)); } #[test] fn test_u128_to_u128() { - check_cast_lossy::, console_root::types::U128>( + check_cast_lossy::, console_root::types::U128>( Mode::Constant, count_is!(0, 0, 0, 0), ); - check_cast_lossy::, console_root::types::U128>(Mode::Public, count_is!(0, 0, 0, 0)); - check_cast_lossy::, console_root::types::U128>( + check_cast_lossy::, console_root::types::U128>( + Mode::Public, + count_is!(0, 0, 0, 0), + ); + check_cast_lossy::, console_root::types::U128>( Mode::Private, count_is!(0, 0, 0, 0), ); diff --git a/circuit/program/src/data/literal/cast_lossy/scalar.rs b/circuit/program/src/data/literal/cast_lossy/scalar.rs index 1b3d77475c..2913265440 100644 --- a/circuit/program/src/data/literal/cast_lossy/scalar.rs +++ b/circuit/program/src/data/literal/cast_lossy/scalar.rs @@ -89,7 +89,7 @@ mod tests { use super::*; use console::CastLossy as _; use console_root::{ - network::Testnet3, + network::MainnetV0, prelude::{One, TestRng, Uniform, Zero}, }; use snarkvm_circuit_types::environment::{count_is, count_less_than, Circuit, Eject, Inject, Mode, UpdatableCount}; @@ -102,29 +102,29 @@ mod tests { i: usize, mode: Mode, rng: &mut TestRng, - ) -> (console_root::types::Scalar, Scalar) { + ) -> (console_root::types::Scalar, Scalar) { let console_value = match i { - 0 => console_root::types::Scalar::::zero(), - 1 => console_root::types::Scalar::::one(), + 0 => console_root::types::Scalar::::zero(), + 1 => console_root::types::Scalar::::one(), _ => Uniform::rand(rng), }; let circuit_value = Scalar::::new(mode, console_value); (console_value, circuit_value) } - check_cast_lossy!(cast_lossy, Scalar, console_root::types::Scalar::); + check_cast_lossy!(cast_lossy, Scalar, console_root::types::Scalar::); #[test] fn test_scalar_to_address() { - check_cast_lossy::, console_root::types::Address>( + check_cast_lossy::, console_root::types::Address>( Mode::Constant, count_less_than!(4303, 0, 0, 0), ); - check_cast_lossy::, console_root::types::Address>( + check_cast_lossy::, console_root::types::Address>( Mode::Public, count_is!(2029, 0, 6745, 6750), ); - check_cast_lossy::, console_root::types::Address>( + check_cast_lossy::, console_root::types::Address>( Mode::Private, count_is!(2029, 0, 6745, 6750), ); @@ -132,15 +132,15 @@ mod tests { #[test] fn test_scalar_to_boolean() { - check_cast_lossy::, console_root::types::Boolean>( + check_cast_lossy::, console_root::types::Boolean>( Mode::Constant, count_is!(251, 0, 0, 0), ); - check_cast_lossy::, console_root::types::Boolean>( + check_cast_lossy::, console_root::types::Boolean>( Mode::Public, count_is!(0, 0, 501, 503), ); - check_cast_lossy::, console_root::types::Boolean>( + check_cast_lossy::, console_root::types::Boolean>( Mode::Private, count_is!(0, 0, 501, 503), ); @@ -148,22 +148,25 @@ mod tests { #[test] fn test_scalar_to_field() { - check_cast_lossy::, console_root::types::Field>(Mode::Constant, count_is!(0, 0, 0, 0)); - check_cast_lossy::, console_root::types::Field>(Mode::Public, count_is!(0, 0, 0, 0)); - check_cast_lossy::, console_root::types::Field>(Mode::Private, count_is!(0, 0, 0, 0)); + check_cast_lossy::, console_root::types::Field>( + Mode::Constant, + count_is!(0, 0, 0, 0), + ); + check_cast_lossy::, console_root::types::Field>(Mode::Public, count_is!(0, 0, 0, 0)); + check_cast_lossy::, console_root::types::Field>(Mode::Private, count_is!(0, 0, 0, 0)); } #[test] fn test_scalar_to_group() { - check_cast_lossy::, console_root::types::Group>( + check_cast_lossy::, console_root::types::Group>( Mode::Constant, count_less_than!(4303, 0, 0, 0), ); - check_cast_lossy::, console_root::types::Group>( + check_cast_lossy::, console_root::types::Group>( Mode::Public, count_is!(2029, 0, 6745, 6750), ); - check_cast_lossy::, console_root::types::Group>( + check_cast_lossy::, console_root::types::Group>( Mode::Private, count_is!(2029, 0, 6745, 6750), ); @@ -171,37 +174,43 @@ mod tests { #[test] fn test_scalar_to_i8() { - check_cast_lossy::, console_root::types::I8>(Mode::Constant, count_is!(251, 0, 0, 0)); - check_cast_lossy::, console_root::types::I8>(Mode::Public, count_is!(0, 0, 501, 503)); - check_cast_lossy::, console_root::types::I8>(Mode::Private, count_is!(0, 0, 501, 503)); + check_cast_lossy::, console_root::types::I8>(Mode::Constant, count_is!(251, 0, 0, 0)); + check_cast_lossy::, console_root::types::I8>(Mode::Public, count_is!(0, 0, 501, 503)); + check_cast_lossy::, console_root::types::I8>(Mode::Private, count_is!(0, 0, 501, 503)); } #[test] fn test_scalar_to_i16() { - check_cast_lossy::, console_root::types::I16>(Mode::Constant, count_is!(251, 0, 0, 0)); - check_cast_lossy::, console_root::types::I16>(Mode::Public, count_is!(0, 0, 501, 503)); - check_cast_lossy::, console_root::types::I16>(Mode::Private, count_is!(0, 0, 501, 503)); + check_cast_lossy::, console_root::types::I16>(Mode::Constant, count_is!(251, 0, 0, 0)); + check_cast_lossy::, console_root::types::I16>(Mode::Public, count_is!(0, 0, 501, 503)); + check_cast_lossy::, console_root::types::I16>(Mode::Private, count_is!(0, 0, 501, 503)); } #[test] fn test_scalar_to_i32() { - check_cast_lossy::, console_root::types::I32>(Mode::Constant, count_is!(251, 0, 0, 0)); - check_cast_lossy::, console_root::types::I32>(Mode::Public, count_is!(0, 0, 501, 503)); - check_cast_lossy::, console_root::types::I32>(Mode::Private, count_is!(0, 0, 501, 503)); + check_cast_lossy::, console_root::types::I32>(Mode::Constant, count_is!(251, 0, 0, 0)); + check_cast_lossy::, console_root::types::I32>(Mode::Public, count_is!(0, 0, 501, 503)); + check_cast_lossy::, console_root::types::I32>(Mode::Private, count_is!(0, 0, 501, 503)); } #[test] fn test_scalar_to_i64() { - check_cast_lossy::, console_root::types::I64>(Mode::Constant, count_is!(251, 0, 0, 0)); - check_cast_lossy::, console_root::types::I64>(Mode::Public, count_is!(0, 0, 501, 503)); - check_cast_lossy::, console_root::types::I64>(Mode::Private, count_is!(0, 0, 501, 503)); + check_cast_lossy::, console_root::types::I64>(Mode::Constant, count_is!(251, 0, 0, 0)); + check_cast_lossy::, console_root::types::I64>(Mode::Public, count_is!(0, 0, 501, 503)); + check_cast_lossy::, console_root::types::I64>(Mode::Private, count_is!(0, 0, 501, 503)); } #[test] fn test_scalar_to_i128() { - check_cast_lossy::, console_root::types::I128>(Mode::Constant, count_is!(251, 0, 0, 0)); - check_cast_lossy::, console_root::types::I128>(Mode::Public, count_is!(0, 0, 501, 503)); - check_cast_lossy::, console_root::types::I128>( + check_cast_lossy::, console_root::types::I128>( + Mode::Constant, + count_is!(251, 0, 0, 0), + ); + check_cast_lossy::, console_root::types::I128>( + Mode::Public, + count_is!(0, 0, 501, 503), + ); + check_cast_lossy::, console_root::types::I128>( Mode::Private, count_is!(0, 0, 501, 503), ); @@ -209,12 +218,15 @@ mod tests { #[test] fn test_scalar_to_scalar() { - check_cast_lossy::, console_root::types::Scalar>( + check_cast_lossy::, console_root::types::Scalar>( Mode::Constant, count_is!(0, 0, 0, 0), ); - check_cast_lossy::, console_root::types::Scalar>(Mode::Public, count_is!(0, 0, 0, 0)); - check_cast_lossy::, console_root::types::Scalar>( + check_cast_lossy::, console_root::types::Scalar>( + Mode::Public, + count_is!(0, 0, 0, 0), + ); + check_cast_lossy::, console_root::types::Scalar>( Mode::Private, count_is!(0, 0, 0, 0), ); @@ -222,37 +234,43 @@ mod tests { #[test] fn test_scalar_to_u8() { - check_cast_lossy::, console_root::types::U8>(Mode::Constant, count_is!(251, 0, 0, 0)); - check_cast_lossy::, console_root::types::U8>(Mode::Public, count_is!(0, 0, 501, 503)); - check_cast_lossy::, console_root::types::U8>(Mode::Private, count_is!(0, 0, 501, 503)); + check_cast_lossy::, console_root::types::U8>(Mode::Constant, count_is!(251, 0, 0, 0)); + check_cast_lossy::, console_root::types::U8>(Mode::Public, count_is!(0, 0, 501, 503)); + check_cast_lossy::, console_root::types::U8>(Mode::Private, count_is!(0, 0, 501, 503)); } #[test] fn test_scalar_to_u16() { - check_cast_lossy::, console_root::types::U16>(Mode::Constant, count_is!(251, 0, 0, 0)); - check_cast_lossy::, console_root::types::U16>(Mode::Public, count_is!(0, 0, 501, 503)); - check_cast_lossy::, console_root::types::U16>(Mode::Private, count_is!(0, 0, 501, 503)); + check_cast_lossy::, console_root::types::U16>(Mode::Constant, count_is!(251, 0, 0, 0)); + check_cast_lossy::, console_root::types::U16>(Mode::Public, count_is!(0, 0, 501, 503)); + check_cast_lossy::, console_root::types::U16>(Mode::Private, count_is!(0, 0, 501, 503)); } #[test] fn test_scalar_to_u32() { - check_cast_lossy::, console_root::types::U32>(Mode::Constant, count_is!(251, 0, 0, 0)); - check_cast_lossy::, console_root::types::U32>(Mode::Public, count_is!(0, 0, 501, 503)); - check_cast_lossy::, console_root::types::U32>(Mode::Private, count_is!(0, 0, 501, 503)); + check_cast_lossy::, console_root::types::U32>(Mode::Constant, count_is!(251, 0, 0, 0)); + check_cast_lossy::, console_root::types::U32>(Mode::Public, count_is!(0, 0, 501, 503)); + check_cast_lossy::, console_root::types::U32>(Mode::Private, count_is!(0, 0, 501, 503)); } #[test] fn test_scalar_to_u64() { - check_cast_lossy::, console_root::types::U64>(Mode::Constant, count_is!(251, 0, 0, 0)); - check_cast_lossy::, console_root::types::U64>(Mode::Public, count_is!(0, 0, 501, 503)); - check_cast_lossy::, console_root::types::U64>(Mode::Private, count_is!(0, 0, 501, 503)); + check_cast_lossy::, console_root::types::U64>(Mode::Constant, count_is!(251, 0, 0, 0)); + check_cast_lossy::, console_root::types::U64>(Mode::Public, count_is!(0, 0, 501, 503)); + check_cast_lossy::, console_root::types::U64>(Mode::Private, count_is!(0, 0, 501, 503)); } #[test] fn test_scalar_to_u128() { - check_cast_lossy::, console_root::types::U128>(Mode::Constant, count_is!(251, 0, 0, 0)); - check_cast_lossy::, console_root::types::U128>(Mode::Public, count_is!(0, 0, 501, 503)); - check_cast_lossy::, console_root::types::U128>( + check_cast_lossy::, console_root::types::U128>( + Mode::Constant, + count_is!(251, 0, 0, 0), + ); + check_cast_lossy::, console_root::types::U128>( + Mode::Public, + count_is!(0, 0, 501, 503), + ); + check_cast_lossy::, console_root::types::U128>( Mode::Private, count_is!(0, 0, 501, 503), ); diff --git a/console/account/benches/account.rs b/console/account/benches/account.rs index 5f3df699c1..ce8b6d7500 100644 --- a/console/account/benches/account.rs +++ b/console/account/benches/account.rs @@ -16,11 +16,11 @@ extern crate criterion; use snarkvm_console_account::{Address, PrivateKey, ViewKey}; -use snarkvm_console_network::{environment::prelude::*, Testnet3}; +use snarkvm_console_network::{environment::prelude::*, MainnetV0}; use criterion::Criterion; -type CurrentNetwork = Testnet3; +type CurrentNetwork = MainnetV0; fn account_private_key(c: &mut Criterion) { let rng = &mut TestRng::default(); diff --git a/console/account/src/address/try_from.rs b/console/account/src/address/try_from.rs index 299e09b72e..6080a5009e 100644 --- a/console/account/src/address/try_from.rs +++ b/console/account/src/address/try_from.rs @@ -77,9 +77,9 @@ impl TryFrom<&ViewKey> for Address { #[cfg(test)] mod tests { use super::*; - use snarkvm_console_network::Testnet3; + use snarkvm_console_network::MainnetV0; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; const ITERATIONS: u64 = 1_000; diff --git a/console/account/src/compute_key/bytes.rs b/console/account/src/compute_key/bytes.rs index 1e064c8951..cd0e64edec 100644 --- a/console/account/src/compute_key/bytes.rs +++ b/console/account/src/compute_key/bytes.rs @@ -37,9 +37,9 @@ impl ToBytes for ComputeKey { #[cfg(test)] mod tests { use super::*; - use snarkvm_console_network::Testnet3; + use snarkvm_console_network::MainnetV0; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; const ITERATIONS: u64 = 1000; diff --git a/console/account/src/compute_key/from_bits.rs b/console/account/src/compute_key/from_bits.rs index fa1f73e576..923689ddc3 100644 --- a/console/account/src/compute_key/from_bits.rs +++ b/console/account/src/compute_key/from_bits.rs @@ -53,9 +53,9 @@ impl FromBits for ComputeKey { #[cfg(test)] mod tests { use super::*; - use snarkvm_console_network::Testnet3; + use snarkvm_console_network::MainnetV0; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; const ITERATIONS: usize = 100; diff --git a/console/account/src/compute_key/serialize.rs b/console/account/src/compute_key/serialize.rs index 78f809bdb0..9089c77a9d 100644 --- a/console/account/src/compute_key/serialize.rs +++ b/console/account/src/compute_key/serialize.rs @@ -35,9 +35,9 @@ impl<'de, N: Network> Deserialize<'de> for ComputeKey { #[cfg(test)] mod tests { use super::*; - use snarkvm_console_network::Testnet3; + use snarkvm_console_network::MainnetV0; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; const ITERATIONS: u64 = 1000; diff --git a/console/account/src/compute_key/to_address.rs b/console/account/src/compute_key/to_address.rs index 3dc6eae1af..fc18b59910 100644 --- a/console/account/src/compute_key/to_address.rs +++ b/console/account/src/compute_key/to_address.rs @@ -27,9 +27,9 @@ impl ComputeKey { #[cfg(test)] mod tests { use super::*; - use snarkvm_console_network::Testnet3; + use snarkvm_console_network::MainnetV0; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; const ITERATIONS: u64 = 1000; diff --git a/console/account/src/compute_key/to_bits.rs b/console/account/src/compute_key/to_bits.rs index 2a742b1c9e..78536394d4 100644 --- a/console/account/src/compute_key/to_bits.rs +++ b/console/account/src/compute_key/to_bits.rs @@ -35,9 +35,9 @@ impl ToBits for ComputeKey { #[cfg(test)] mod tests { use super::*; - use snarkvm_console_network::Testnet3; + use snarkvm_console_network::MainnetV0; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; const ITERATIONS: u64 = 1_000; diff --git a/console/account/src/compute_key/try_from.rs b/console/account/src/compute_key/try_from.rs index e652ca8323..591452f87e 100644 --- a/console/account/src/compute_key/try_from.rs +++ b/console/account/src/compute_key/try_from.rs @@ -63,9 +63,9 @@ impl TryFrom<&(Group, Group)> for ComputeKey { #[cfg(test)] mod tests { use super::*; - use snarkvm_console_network::Testnet3; + use snarkvm_console_network::MainnetV0; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; const ITERATIONS: u64 = 1000; diff --git a/console/account/src/graph_key/bytes.rs b/console/account/src/graph_key/bytes.rs index a6b3efb71c..8637453dea 100644 --- a/console/account/src/graph_key/bytes.rs +++ b/console/account/src/graph_key/bytes.rs @@ -34,9 +34,9 @@ impl ToBytes for GraphKey { mod tests { use super::*; use crate::PrivateKey; - use snarkvm_console_network::Testnet3; + use snarkvm_console_network::MainnetV0; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; const ITERATIONS: u64 = 1000; diff --git a/console/account/src/graph_key/serialize.rs b/console/account/src/graph_key/serialize.rs index 74739f8dbb..9592af6f03 100644 --- a/console/account/src/graph_key/serialize.rs +++ b/console/account/src/graph_key/serialize.rs @@ -32,9 +32,9 @@ impl<'de, N: Network> Deserialize<'de> for GraphKey { mod tests { use super::*; use crate::PrivateKey; - use snarkvm_console_network::Testnet3; + use snarkvm_console_network::MainnetV0; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; const ITERATIONS: u64 = 1000; diff --git a/console/account/src/graph_key/string.rs b/console/account/src/graph_key/string.rs index 5378a28d13..57198c01e6 100644 --- a/console/account/src/graph_key/string.rs +++ b/console/account/src/graph_key/string.rs @@ -49,9 +49,9 @@ impl fmt::Display for GraphKey { mod tests { use super::*; use crate::PrivateKey; - use snarkvm_console_network::Testnet3; + use snarkvm_console_network::MainnetV0; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; const ITERATIONS: u64 = 10_000; diff --git a/console/account/src/graph_key/try_from.rs b/console/account/src/graph_key/try_from.rs index 61a124f5c9..13d95c65be 100644 --- a/console/account/src/graph_key/try_from.rs +++ b/console/account/src/graph_key/try_from.rs @@ -60,9 +60,9 @@ impl TryFrom<&Field> for GraphKey { mod tests { use super::*; use crate::PrivateKey; - use snarkvm_console_network::Testnet3; + use snarkvm_console_network::MainnetV0; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; const ITERATIONS: u64 = 1000; diff --git a/console/account/src/lib.rs b/console/account/src/lib.rs index 77e5874bbf..c06cea96e5 100644 --- a/console/account/src/lib.rs +++ b/console/account/src/lib.rs @@ -49,9 +49,9 @@ pub use view_key::*; #[cfg(test)] mod tests { use crate::{Address, ComputeKey, PrivateKey, Signature, ViewKey}; - use snarkvm_console_network::{prelude::*, Testnet3}; + use snarkvm_console_network::{prelude::*, MainnetV0}; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; const ALEO_PRIVATE_KEY: &str = "APrivateKey1zkp8cC4jgHEBnbtu3xxs1Ndja2EMizcvTRDq5Nikdkukg1p"; const ALEO_VIEW_KEY: &str = "AViewKey1n1n3ZbnVEtXVe3La2xWkUvY3EY7XaCG6RZJJ3tbvrrrD"; diff --git a/console/account/src/private_key/bytes.rs b/console/account/src/private_key/bytes.rs index 291720c277..14fe867ef9 100644 --- a/console/account/src/private_key/bytes.rs +++ b/console/account/src/private_key/bytes.rs @@ -31,9 +31,9 @@ impl ToBytes for PrivateKey { #[cfg(test)] mod tests { use super::*; - use snarkvm_console_network::Testnet3; + use snarkvm_console_network::MainnetV0; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; const ITERATIONS: u64 = 1000; diff --git a/console/account/src/private_key/serialize.rs b/console/account/src/private_key/serialize.rs index 3aeda9f436..44fdf3611f 100644 --- a/console/account/src/private_key/serialize.rs +++ b/console/account/src/private_key/serialize.rs @@ -41,9 +41,9 @@ impl<'de, N: Network> Deserialize<'de> for PrivateKey { #[cfg(test)] mod tests { use super::*; - use snarkvm_console_network::Testnet3; + use snarkvm_console_network::MainnetV0; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; const ITERATIONS: u64 = 1000; diff --git a/console/account/src/private_key/sign.rs b/console/account/src/private_key/sign.rs index c330e50b23..3ced01a359 100644 --- a/console/account/src/private_key/sign.rs +++ b/console/account/src/private_key/sign.rs @@ -36,9 +36,9 @@ impl PrivateKey { mod tests { use super::*; use crate::Address; - use snarkvm_console_network::Testnet3; + use snarkvm_console_network::MainnetV0; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; const ITERATIONS: u64 = 100; diff --git a/console/account/src/private_key/string.rs b/console/account/src/private_key/string.rs index 766178a079..f9a9705152 100644 --- a/console/account/src/private_key/string.rs +++ b/console/account/src/private_key/string.rs @@ -48,9 +48,9 @@ impl fmt::Display for PrivateKey { #[cfg(test)] mod tests { use super::*; - use snarkvm_console_network::Testnet3; + use snarkvm_console_network::MainnetV0; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; const ITERATIONS: u64 = 1000; diff --git a/console/account/src/signature/bytes.rs b/console/account/src/signature/bytes.rs index bb7da60881..9f3714a7d6 100644 --- a/console/account/src/signature/bytes.rs +++ b/console/account/src/signature/bytes.rs @@ -38,9 +38,9 @@ impl ToBytes for Signature { #[cfg(test)] mod tests { use super::*; - use snarkvm_console_network::Testnet3; + use snarkvm_console_network::MainnetV0; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; const ITERATIONS: u64 = 100; diff --git a/console/account/src/signature/from_bits.rs b/console/account/src/signature/from_bits.rs index 5892bbfc7c..83eebac6ae 100644 --- a/console/account/src/signature/from_bits.rs +++ b/console/account/src/signature/from_bits.rs @@ -71,9 +71,9 @@ impl FromBits for Signature { #[cfg(test)] mod tests { use super::*; - use snarkvm_console_network::Testnet3; + use snarkvm_console_network::MainnetV0; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; const ITERATIONS: usize = 100; diff --git a/console/account/src/signature/mod.rs b/console/account/src/signature/mod.rs index 1225af3b38..efa92938a6 100644 --- a/console/account/src/signature/mod.rs +++ b/console/account/src/signature/mod.rs @@ -114,9 +114,9 @@ impl Signature { #[cfg(test)] mod test_helpers { use super::*; - use snarkvm_console_network::Testnet3; + use snarkvm_console_network::MainnetV0; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; /// Samples a random signature. pub(super) fn sample_signature(num_fields: u64, rng: &mut TestRng) -> Signature { diff --git a/console/account/src/signature/parse.rs b/console/account/src/signature/parse.rs index 78b69e7771..161054709c 100644 --- a/console/account/src/signature/parse.rs +++ b/console/account/src/signature/parse.rs @@ -74,9 +74,9 @@ impl Display for Signature { #[cfg(test)] mod tests { use super::*; - use snarkvm_console_network::Testnet3; + use snarkvm_console_network::MainnetV0; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; const ITERATIONS: u64 = 1_000; diff --git a/console/account/src/signature/to_bits.rs b/console/account/src/signature/to_bits.rs index 0c4512c516..d7da5ab2ca 100644 --- a/console/account/src/signature/to_bits.rs +++ b/console/account/src/signature/to_bits.rs @@ -39,9 +39,9 @@ impl ToBits for Signature { #[cfg(test)] mod tests { use super::*; - use snarkvm_console_network::Testnet3; + use snarkvm_console_network::MainnetV0; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; const ITERATIONS: u64 = 1_000; diff --git a/console/account/src/signature/verify.rs b/console/account/src/signature/verify.rs index c0b97bb2e4..65247213ab 100644 --- a/console/account/src/signature/verify.rs +++ b/console/account/src/signature/verify.rs @@ -80,9 +80,9 @@ impl Signature { #[cfg(feature = "private_key")] mod tests { use super::*; - use snarkvm_console_network::Testnet3; + use snarkvm_console_network::MainnetV0; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; const ITERATIONS: u64 = 100; diff --git a/console/account/src/view_key/bytes.rs b/console/account/src/view_key/bytes.rs index 9592de8231..61631562d6 100644 --- a/console/account/src/view_key/bytes.rs +++ b/console/account/src/view_key/bytes.rs @@ -31,9 +31,9 @@ impl ToBytes for ViewKey { #[cfg(test)] mod tests { use super::*; - use snarkvm_console_network::Testnet3; + use snarkvm_console_network::MainnetV0; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; const ITERATIONS: u64 = 1000; diff --git a/console/account/src/view_key/mod.rs b/console/account/src/view_key/mod.rs index ed7421d101..28a02c5d1a 100644 --- a/console/account/src/view_key/mod.rs +++ b/console/account/src/view_key/mod.rs @@ -51,9 +51,9 @@ impl Deref for ViewKey { #[cfg(test)] mod tests { use super::*; - use snarkvm_console_network::Testnet3; + use snarkvm_console_network::MainnetV0; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; const ITERATIONS: u64 = 1000; diff --git a/console/account/src/view_key/serialize.rs b/console/account/src/view_key/serialize.rs index 03a6f28078..a49ebf3fea 100644 --- a/console/account/src/view_key/serialize.rs +++ b/console/account/src/view_key/serialize.rs @@ -41,9 +41,9 @@ impl<'de, N: Network> Deserialize<'de> for ViewKey { #[cfg(test)] mod tests { use super::*; - use snarkvm_console_network::Testnet3; + use snarkvm_console_network::MainnetV0; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; const ITERATIONS: u64 = 1000; diff --git a/console/account/src/view_key/string.rs b/console/account/src/view_key/string.rs index cf7c93a56a..a341c0067d 100644 --- a/console/account/src/view_key/string.rs +++ b/console/account/src/view_key/string.rs @@ -48,9 +48,9 @@ impl fmt::Display for ViewKey { #[cfg(test)] mod tests { use super::*; - use snarkvm_console_network::Testnet3; + use snarkvm_console_network::MainnetV0; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; const ITERATIONS: u64 = 1000; diff --git a/console/account/src/view_key/to_address.rs b/console/account/src/view_key/to_address.rs index 892064946c..055a040c84 100644 --- a/console/account/src/view_key/to_address.rs +++ b/console/account/src/view_key/to_address.rs @@ -24,9 +24,9 @@ impl ViewKey { #[cfg(test)] mod tests { use super::*; - use snarkvm_console_network::Testnet3; + use snarkvm_console_network::MainnetV0; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; const ITERATIONS: u64 = 1000; diff --git a/console/account/src/view_key/try_from.rs b/console/account/src/view_key/try_from.rs index 6f11378a93..df148f0c66 100644 --- a/console/account/src/view_key/try_from.rs +++ b/console/account/src/view_key/try_from.rs @@ -51,9 +51,9 @@ impl TryFrom<(&PrivateKey, &ComputeKey)> for ViewKey { #[cfg(test)] mod tests { use super::*; - use snarkvm_console_network::Testnet3; + use snarkvm_console_network::MainnetV0; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; const ITERATIONS: u64 = 1000; diff --git a/console/collections/benches/kary_merkle_tree.rs b/console/collections/benches/kary_merkle_tree.rs index f3610a0681..0ce72772c8 100644 --- a/console/collections/benches/kary_merkle_tree.rs +++ b/console/collections/benches/kary_merkle_tree.rs @@ -19,7 +19,7 @@ use snarkvm_console_algorithms::Sha3_256; use snarkvm_console_collections::kary_merkle_tree::KaryMerkleTree; use snarkvm_console_network::{ prelude::{TestRng, ToBits, Uniform}, - Testnet3, + MainnetV0, }; use snarkvm_console_types::Field; @@ -30,7 +30,7 @@ const ARITY: u8 = 8; /// Generates the specified number of random Merkle tree leaves. macro_rules! generate_leaves { - ($num_leaves:expr, $rng:expr) => {{ (0..$num_leaves).map(|_| Field::::rand($rng).to_bits_le()).collect::>() }}; + ($num_leaves:expr, $rng:expr) => {{ (0..$num_leaves).map(|_| Field::::rand($rng).to_bits_le()).collect::>() }}; } fn new(c: &mut Criterion) { diff --git a/console/collections/benches/merkle_tree.rs b/console/collections/benches/merkle_tree.rs index 01baa7fdbc..ec15aee461 100644 --- a/console/collections/benches/merkle_tree.rs +++ b/console/collections/benches/merkle_tree.rs @@ -17,8 +17,8 @@ extern crate criterion; use snarkvm_console_network::{ prelude::{TestRng, ToBits, Uniform}, + MainnetV0, Network, - Testnet3, }; use snarkvm_console_types::Field; @@ -34,7 +34,7 @@ const UPDATE_SIZES: &[usize] = &[1, 10, 100, 1_000, 10_000]; /// Generates the specified number of random Merkle tree leaves. macro_rules! generate_leaves { - ($num_leaves:expr, $rng:expr) => {{ (0..$num_leaves).map(|_| Field::::rand($rng).to_bits_le()).collect::>() }}; + ($num_leaves:expr, $rng:expr) => {{ (0..$num_leaves).map(|_| Field::::rand($rng).to_bits_le()).collect::>() }}; } fn new(c: &mut Criterion) { @@ -45,7 +45,7 @@ fn new(c: &mut Criterion) { // Benchmark the creation of a Merkle tree with the specified number of leaves. c.bench_function(&format!("MerkleTree/new/{num_leaves}"), |b| { b.iter(|| { - let _tree = Testnet3::merkle_tree_bhp::(&leaves[0..*num_leaves]).unwrap(); + let _tree = MainnetV0::merkle_tree_bhp::(&leaves[0..*num_leaves]).unwrap(); }) }); } @@ -61,7 +61,7 @@ fn append(c: &mut Criterion) { for num_leaves in NUM_LEAVES { for num_new_leaves in APPEND_SIZES { // Construct a Merkle tree with the specified number of leaves. - let merkle_tree = Testnet3::merkle_tree_bhp::(&leaves[..*num_leaves]).unwrap(); + let merkle_tree = MainnetV0::merkle_tree_bhp::(&leaves[..*num_leaves]).unwrap(); c.bench_function(&format!("MerkleTree/append/{num_leaves}/{num_new_leaves}"), |b| { b.iter_batched( || merkle_tree.clone(), @@ -93,7 +93,7 @@ fn update(c: &mut Criterion) { for num_new_leaves in UPDATE_SIZES { // Construct a Merkle tree with the specified number of leaves. - let merkle_tree = Testnet3::merkle_tree_bhp::(&leaves[..*num_leaves]).unwrap(); + let merkle_tree = MainnetV0::merkle_tree_bhp::(&leaves[..*num_leaves]).unwrap(); c.bench_function(&format!("MerkleTree/update/{num_leaves}/{num_new_leaves}"), |b| { b.iter_batched( @@ -131,7 +131,7 @@ fn update_many(c: &mut Criterion) { for num_new_leaves in UPDATE_SIZES { // Construct a Merkle tree with the specified number of leaves. - let merkle_tree = Testnet3::merkle_tree_bhp::(&leaves[..*num_leaves]).unwrap(); + let merkle_tree = MainnetV0::merkle_tree_bhp::(&leaves[..*num_leaves]).unwrap(); let num_new_leaves = std::cmp::min(*num_new_leaves, updates.len()); let updates = BTreeMap::from_iter(updates[..num_new_leaves].iter().cloned()); c.bench_function(&format!("MerkleTree/update_many/{num_leaves}/{num_new_leaves}",), |b| { @@ -157,7 +157,7 @@ fn update_vs_update_many(c: &mut Criterion) { // Compute the number of leaves at this depth. let num_leaves = 2usize.saturating_pow(depth as u32); // Construct a Merkle tree with the specified number of leaves. - let tree = Testnet3::merkle_tree_bhp::(&leaves[..num_leaves]).unwrap(); + let tree = MainnetV0::merkle_tree_bhp::(&leaves[..num_leaves]).unwrap(); // Generate a new leaf and select a random index to update. let index: usize = Uniform::rand(&mut rng); let index = index % num_leaves; diff --git a/console/network/src/lib.rs b/console/network/src/lib.rs index 4995a5f577..aa03a7cdfd 100644 --- a/console/network/src/lib.rs +++ b/console/network/src/lib.rs @@ -25,8 +25,8 @@ pub use snarkvm_console_network_environment::*; mod helpers; pub use helpers::*; -mod testnet3; -pub use testnet3::*; +mod mainnet_v0; +pub use mainnet_v0::*; pub mod prelude { pub use crate::{environment::prelude::*, Network}; diff --git a/console/network/src/testnet3.rs b/console/network/src/mainnet_v0.rs similarity index 89% rename from console/network/src/testnet3.rs rename to console/network/src/mainnet_v0.rs index e4f47594ca..21ad90a8e6 100644 --- a/console/network/src/testnet3.rs +++ b/console/network/src/mainnet_v0.rs @@ -34,38 +34,38 @@ use snarkvm_console_algorithms::{ lazy_static! { /// The group bases for the Aleo signature and encryption schemes. - pub static ref GENERATOR_G: Vec> = Testnet3::new_bases("AleoAccountEncryptionAndSignatureScheme0"); + pub static ref GENERATOR_G: Vec> = MainnetV0::new_bases("AleoAccountEncryptionAndSignatureScheme0"); /// The Varuna sponge parameters. - pub static ref VARUNA_FS_PARAMETERS: FiatShamirParameters = FiatShamir::::sample_parameters(); + pub static ref VARUNA_FS_PARAMETERS: FiatShamirParameters = FiatShamir::::sample_parameters(); /// The encryption domain as a constant field element. - pub static ref ENCRYPTION_DOMAIN: Field = Field::::new_domain_separator("AleoSymmetricEncryption0"); + pub static ref ENCRYPTION_DOMAIN: Field = Field::::new_domain_separator("AleoSymmetricEncryption0"); /// The graph key domain as a constant field element. - pub static ref GRAPH_KEY_DOMAIN: Field = Field::::new_domain_separator("AleoGraphKey0"); + pub static ref GRAPH_KEY_DOMAIN: Field = Field::::new_domain_separator("AleoGraphKey0"); /// The serial number domain as a constant field element. - pub static ref SERIAL_NUMBER_DOMAIN: Field = Field::::new_domain_separator("AleoSerialNumber0"); + pub static ref SERIAL_NUMBER_DOMAIN: Field = Field::::new_domain_separator("AleoSerialNumber0"); /// The BHP hash function, which can take an input of up to 256 bits. - pub static ref BHP_256: BHP256 = BHP256::::setup("AleoBHP256").expect("Failed to setup BHP256"); + pub static ref BHP_256: BHP256 = BHP256::::setup("AleoBHP256").expect("Failed to setup BHP256"); /// The BHP hash function, which can take an input of up to 512 bits. - pub static ref BHP_512: BHP512 = BHP512::::setup("AleoBHP512").expect("Failed to setup BHP512"); + pub static ref BHP_512: BHP512 = BHP512::::setup("AleoBHP512").expect("Failed to setup BHP512"); /// The BHP hash function, which can take an input of up to 768 bits. - pub static ref BHP_768: BHP768 = BHP768::::setup("AleoBHP768").expect("Failed to setup BHP768"); + pub static ref BHP_768: BHP768 = BHP768::::setup("AleoBHP768").expect("Failed to setup BHP768"); /// The BHP hash function, which can take an input of up to 1024 bits. - pub static ref BHP_1024: BHP1024 = BHP1024::::setup("AleoBHP1024").expect("Failed to setup BHP1024"); + pub static ref BHP_1024: BHP1024 = BHP1024::::setup("AleoBHP1024").expect("Failed to setup BHP1024"); /// The Pedersen hash function, which can take an input of up to 64 bits. - pub static ref PEDERSEN_64: Pedersen64 = Pedersen64::::setup("AleoPedersen64"); + pub static ref PEDERSEN_64: Pedersen64 = Pedersen64::::setup("AleoPedersen64"); /// The Pedersen hash function, which can take an input of up to 128 bits. - pub static ref PEDERSEN_128: Pedersen128 = Pedersen128::::setup("AleoPedersen128"); + pub static ref PEDERSEN_128: Pedersen128 = Pedersen128::::setup("AleoPedersen128"); /// The Poseidon hash function, using a rate of 2. - pub static ref POSEIDON_2: Poseidon2 = Poseidon2::::setup("AleoPoseidon2").expect("Failed to setup Poseidon2"); + pub static ref POSEIDON_2: Poseidon2 = Poseidon2::::setup("AleoPoseidon2").expect("Failed to setup Poseidon2"); /// The Poseidon hash function, using a rate of 4. - pub static ref POSEIDON_4: Poseidon4 = Poseidon4::::setup("AleoPoseidon4").expect("Failed to setup Poseidon4"); + pub static ref POSEIDON_4: Poseidon4 = Poseidon4::::setup("AleoPoseidon4").expect("Failed to setup Poseidon4"); /// The Poseidon hash function, using a rate of 8. - pub static ref POSEIDON_8: Poseidon8 = Poseidon8::::setup("AleoPoseidon8").expect("Failed to setup Poseidon8"); + pub static ref POSEIDON_8: Poseidon8 = Poseidon8::::setup("AleoPoseidon8").expect("Failed to setup Poseidon8"); pub static ref CREDITS_PROVING_KEYS: IndexMap>> = { let mut map = IndexMap::new(); @@ -82,9 +82,9 @@ lazy_static! { pub const TRANSACTION_PREFIX: &str = "at"; #[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)] -pub struct Testnet3; +pub struct MainnetV0; -impl Testnet3 { +impl MainnetV0 { /// Initializes a new instance of group bases from a given input domain message. fn new_bases(message: &str) -> Vec> { // Hash the given message to a point on the curve, to initialize the starting base. @@ -101,7 +101,7 @@ impl Testnet3 { } } -impl Environment for Testnet3 { +impl Environment for MainnetV0 { type Affine = ::Affine; type BigInteger = ::BigInteger; type Field = ::Field; @@ -119,7 +119,7 @@ impl Environment for Testnet3 { const MONTGOMERY_B: Self::Field = Console::MONTGOMERY_B; } -impl Network for Testnet3 { +impl Network for MainnetV0 { /// The block hash type. type BlockHash = AleoID, { hrp2!("ab") }>; /// The ratification ID type. @@ -134,15 +134,15 @@ impl Network for Testnet3 { /// The network edition. const EDITION: u16 = 0; /// The network ID. - const ID: u16 = 3; + const ID: u16 = 0; /// The function name for the inclusion circuit. - const INCLUSION_FUNCTION_NAME: &'static str = snarkvm_parameters::testnet3::TESTNET3_INCLUSION_FUNCTION_NAME; + const INCLUSION_FUNCTION_NAME: &'static str = snarkvm_parameters::mainnet::TESTNET3_INCLUSION_FUNCTION_NAME; /// The network name. - const NAME: &'static str = "Aleo Testnet 3"; + const NAME: &'static str = "Aleo Mainnet (v0)"; /// Returns the genesis block bytes. fn genesis_bytes() -> &'static [u8] { - snarkvm_parameters::testnet3::GenesisBytes::load_bytes() + snarkvm_parameters::mainnet::GenesisBytes::load_bytes() } /// Returns the proving key for the given function name in `credits.aleo`. @@ -165,7 +165,7 @@ impl Network for Testnet3 { INSTANCE.get_or_init(|| { // Skipping the first byte, which is the encoded version. Arc::new( - CircuitProvingKey::from_bytes_le(&snarkvm_parameters::testnet3::INCLUSION_PROVING_KEY[1..]) + CircuitProvingKey::from_bytes_le(&snarkvm_parameters::mainnet::INCLUSION_PROVING_KEY[1..]) .expect("Failed to load inclusion proving key."), ) }) @@ -177,7 +177,7 @@ impl Network for Testnet3 { INSTANCE.get_or_init(|| { // Skipping the first byte, which is the encoded version. Arc::new( - CircuitVerifyingKey::from_bytes_le(&snarkvm_parameters::testnet3::INCLUSION_VERIFYING_KEY[1..]) + CircuitVerifyingKey::from_bytes_le(&snarkvm_parameters::mainnet::INCLUSION_VERIFYING_KEY[1..]) .expect("Failed to load inclusion verifying key."), ) }) @@ -485,7 +485,7 @@ impl Network for Testnet3 { mod tests { use super::*; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; #[test] fn test_g_scalar_multiply() { diff --git a/console/program/src/data/access/bytes.rs b/console/program/src/data/access/bytes.rs index f2a560b148..561c4c04e1 100644 --- a/console/program/src/data/access/bytes.rs +++ b/console/program/src/data/access/bytes.rs @@ -46,9 +46,9 @@ impl ToBytes for Access { mod tests { use super::*; use crate::data::identifier::tests::sample_identifier; - use snarkvm_console_network::Testnet3; + use snarkvm_console_network::MainnetV0; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; const ITERATIONS: u32 = 1000; diff --git a/console/program/src/data/access/parse.rs b/console/program/src/data/access/parse.rs index 4d5801e336..8c5ff6c3a3 100644 --- a/console/program/src/data/access/parse.rs +++ b/console/program/src/data/access/parse.rs @@ -63,9 +63,9 @@ impl Display for Access { #[cfg(test)] mod tests { use super::*; - use snarkvm_console_network::Testnet3; + use snarkvm_console_network::MainnetV0; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; #[test] fn test_parse() -> Result<()> { diff --git a/console/program/src/data/access/serialize.rs b/console/program/src/data/access/serialize.rs index 461f8c6d0c..8a48e236ea 100644 --- a/console/program/src/data/access/serialize.rs +++ b/console/program/src/data/access/serialize.rs @@ -37,9 +37,9 @@ impl<'de, N: Network> Deserialize<'de> for Access { #[cfg(test)] mod tests { use super::*; - use snarkvm_console_network::Testnet3; + use snarkvm_console_network::MainnetV0; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; fn check_serde_json< T: Serialize + for<'a> Deserialize<'a> + Debug + Display + PartialEq + Eq + FromStr + ToBytes + FromBytes, diff --git a/console/program/src/data/ciphertext/bytes.rs b/console/program/src/data/ciphertext/bytes.rs index d983d9bb71..80b0c2d6d8 100644 --- a/console/program/src/data/ciphertext/bytes.rs +++ b/console/program/src/data/ciphertext/bytes.rs @@ -49,9 +49,9 @@ impl ToBytes for Ciphertext { #[cfg(test)] mod tests { use super::*; - use snarkvm_console_network::Testnet3; + use snarkvm_console_network::MainnetV0; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; const ITERATIONS: u32 = 1000; diff --git a/console/program/src/data/ciphertext/decrypt.rs b/console/program/src/data/ciphertext/decrypt.rs index 1de811c4dc..5b10d4a9be 100644 --- a/console/program/src/data/ciphertext/decrypt.rs +++ b/console/program/src/data/ciphertext/decrypt.rs @@ -51,9 +51,9 @@ mod tests { use super::*; use crate::Literal; use snarkvm_console_account::{Address, PrivateKey}; - use snarkvm_console_network::Testnet3; + use snarkvm_console_network::MainnetV0; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; const ITERATIONS: u64 = 100; diff --git a/console/program/src/data/ciphertext/parse.rs b/console/program/src/data/ciphertext/parse.rs index c3ca3f9b0a..185a8b2c29 100644 --- a/console/program/src/data/ciphertext/parse.rs +++ b/console/program/src/data/ciphertext/parse.rs @@ -74,9 +74,9 @@ impl Display for Ciphertext { #[cfg(test)] mod tests { use super::*; - use snarkvm_console_network::Testnet3; + use snarkvm_console_network::MainnetV0; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; const ITERATIONS: u64 = 1_000; diff --git a/console/program/src/data/ciphertext/serialize.rs b/console/program/src/data/ciphertext/serialize.rs index 30070ead75..318fe2998b 100644 --- a/console/program/src/data/ciphertext/serialize.rs +++ b/console/program/src/data/ciphertext/serialize.rs @@ -37,9 +37,9 @@ impl<'de, N: Network> Deserialize<'de> for Ciphertext { #[cfg(test)] mod tests { use super::*; - use snarkvm_console_network::Testnet3; + use snarkvm_console_network::MainnetV0; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; const ITERATIONS: u64 = 1000; diff --git a/console/program/src/data/future/bytes.rs b/console/program/src/data/future/bytes.rs index aa6122b4a4..b60b2ede0c 100644 --- a/console/program/src/data/future/bytes.rs +++ b/console/program/src/data/future/bytes.rs @@ -72,9 +72,9 @@ impl ToBytes for Future { #[cfg(test)] mod tests { use super::*; - use snarkvm_console_network::Testnet3; + use snarkvm_console_network::MainnetV0; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; #[test] fn test_bytes() -> Result<()> { diff --git a/console/program/src/data/future/parse.rs b/console/program/src/data/future/parse.rs index c54356afed..6fd88bf6c2 100644 --- a/console/program/src/data/future/parse.rs +++ b/console/program/src/data/future/parse.rs @@ -213,9 +213,9 @@ impl Future { #[cfg(test)] mod tests { use super::*; - use snarkvm_console_network::Testnet3; + use snarkvm_console_network::MainnetV0; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; #[test] fn test_parse_future() -> Result<()> { diff --git a/console/program/src/data/identifier/bytes.rs b/console/program/src/data/identifier/bytes.rs index 757f27ba40..967feee7cc 100644 --- a/console/program/src/data/identifier/bytes.rs +++ b/console/program/src/data/identifier/bytes.rs @@ -56,9 +56,9 @@ impl ToBytes for Identifier { mod tests { use super::*; use crate::data::identifier::tests::sample_identifier; - use snarkvm_console_network::Testnet3; + use snarkvm_console_network::MainnetV0; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; const ITERATIONS: u64 = 1000; diff --git a/console/program/src/data/identifier/from_bits.rs b/console/program/src/data/identifier/from_bits.rs index e4a81c7811..c0c7e1d098 100644 --- a/console/program/src/data/identifier/from_bits.rs +++ b/console/program/src/data/identifier/from_bits.rs @@ -46,9 +46,9 @@ impl FromBits for Identifier { mod tests { use super::*; use crate::data::identifier::tests::sample_identifier; - use snarkvm_console_network::Testnet3; + use snarkvm_console_network::MainnetV0; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; const ITERATIONS: usize = 100; diff --git a/console/program/src/data/identifier/from_field.rs b/console/program/src/data/identifier/from_field.rs index f5b597b37f..e5ea3bede8 100644 --- a/console/program/src/data/identifier/from_field.rs +++ b/console/program/src/data/identifier/from_field.rs @@ -28,9 +28,9 @@ impl FromField for Identifier { mod tests { use super::*; use crate::data::identifier::tests::sample_identifier; - use snarkvm_console_network::Testnet3; + use snarkvm_console_network::MainnetV0; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; const ITERATIONS: usize = 100; diff --git a/console/program/src/data/identifier/mod.rs b/console/program/src/data/identifier/mod.rs index 22a1bec117..0dde199981 100644 --- a/console/program/src/data/identifier/mod.rs +++ b/console/program/src/data/identifier/mod.rs @@ -74,9 +74,9 @@ impl TryFrom<&str> for Identifier { #[cfg(test)] pub(crate) mod tests { use super::*; - use snarkvm_console_network::Testnet3; + use snarkvm_console_network::MainnetV0; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; const ITERATIONS: usize = 100; diff --git a/console/program/src/data/identifier/parse.rs b/console/program/src/data/identifier/parse.rs index 4d2673dd1f..daf02185fb 100644 --- a/console/program/src/data/identifier/parse.rs +++ b/console/program/src/data/identifier/parse.rs @@ -99,9 +99,9 @@ impl Display for Identifier { mod tests { use super::*; use crate::data::identifier::tests::{sample_identifier, sample_identifier_as_string}; - use snarkvm_console_network::Testnet3; + use snarkvm_console_network::MainnetV0; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; const ITERATIONS: usize = 100; diff --git a/console/program/src/data/identifier/serialize.rs b/console/program/src/data/identifier/serialize.rs index eadddc2a9d..0d2e4ee766 100644 --- a/console/program/src/data/identifier/serialize.rs +++ b/console/program/src/data/identifier/serialize.rs @@ -38,9 +38,9 @@ impl<'de, N: Network> Deserialize<'de> for Identifier { mod tests { use super::*; use crate::data::identifier::tests::sample_identifier; - use snarkvm_console_network::Testnet3; + use snarkvm_console_network::MainnetV0; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; const ITERATIONS: u64 = 1000; diff --git a/console/program/src/data/identifier/size_in_bits.rs b/console/program/src/data/identifier/size_in_bits.rs index 506b253ae4..ec3c113b47 100644 --- a/console/program/src/data/identifier/size_in_bits.rs +++ b/console/program/src/data/identifier/size_in_bits.rs @@ -28,9 +28,9 @@ impl Identifier { mod tests { use super::*; use crate::data::identifier::tests::sample_identifier_as_string; - use snarkvm_console_network::Testnet3; + use snarkvm_console_network::MainnetV0; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; const ITERATIONS: usize = 100; diff --git a/console/program/src/data/identifier/to_bits.rs b/console/program/src/data/identifier/to_bits.rs index 2a22dc3234..efe0520ca7 100644 --- a/console/program/src/data/identifier/to_bits.rs +++ b/console/program/src/data/identifier/to_bits.rs @@ -46,9 +46,9 @@ impl ToBits for &Identifier { mod tests { use super::*; use crate::data::identifier::tests::sample_identifier_as_string; - use snarkvm_console_network::Testnet3; + use snarkvm_console_network::MainnetV0; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; const ITERATIONS: usize = 100; diff --git a/console/program/src/data/identifier/to_field.rs b/console/program/src/data/identifier/to_field.rs index 5eb11072b2..815e79d7b2 100644 --- a/console/program/src/data/identifier/to_field.rs +++ b/console/program/src/data/identifier/to_field.rs @@ -36,9 +36,9 @@ impl ToField for &Identifier { mod tests { use super::*; use crate::data::identifier::tests::sample_identifier_as_string; - use snarkvm_console_network::Testnet3; + use snarkvm_console_network::MainnetV0; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; const ITERATIONS: usize = 100; diff --git a/console/program/src/data/literal/bytes.rs b/console/program/src/data/literal/bytes.rs index 1f77bf3430..d5386a2aa2 100644 --- a/console/program/src/data/literal/bytes.rs +++ b/console/program/src/data/literal/bytes.rs @@ -122,9 +122,9 @@ impl ToBytes for Literal { #[cfg(test)] mod tests { use super::*; - use snarkvm_console_network::Testnet3; + use snarkvm_console_network::MainnetV0; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; const ITERATIONS: u32 = 1000; diff --git a/console/program/src/data/literal/from_bits.rs b/console/program/src/data/literal/from_bits.rs index e7b26f5f95..57bdbe1111 100644 --- a/console/program/src/data/literal/from_bits.rs +++ b/console/program/src/data/literal/from_bits.rs @@ -95,9 +95,9 @@ impl Literal { #[cfg(test)] mod tests { use super::*; - use snarkvm_console_network::Testnet3; + use snarkvm_console_network::MainnetV0; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; const ITERATIONS: u32 = 1000; diff --git a/console/program/src/data/literal/parse.rs b/console/program/src/data/literal/parse.rs index 0a02b7200d..bada3c011b 100644 --- a/console/program/src/data/literal/parse.rs +++ b/console/program/src/data/literal/parse.rs @@ -93,9 +93,9 @@ impl Display for Literal { #[cfg(test)] mod tests { use super::*; - use snarkvm_console_network::Testnet3; + use snarkvm_console_network::MainnetV0; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; #[test] fn test_parse_program_id() -> Result<()> { diff --git a/console/program/src/data/literal/serialize.rs b/console/program/src/data/literal/serialize.rs index 2bf01a9154..5bad54669a 100644 --- a/console/program/src/data/literal/serialize.rs +++ b/console/program/src/data/literal/serialize.rs @@ -37,9 +37,9 @@ impl<'de, N: Network> Deserialize<'de> for Literal { #[cfg(test)] mod tests { use super::*; - use snarkvm_console_network::Testnet3; + use snarkvm_console_network::MainnetV0; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; const ITERATIONS: u64 = 1000; diff --git a/console/program/src/data/plaintext/bytes.rs b/console/program/src/data/plaintext/bytes.rs index 8fa2f1dba1..73a4e7670e 100644 --- a/console/program/src/data/plaintext/bytes.rs +++ b/console/program/src/data/plaintext/bytes.rs @@ -123,9 +123,9 @@ impl ToBytes for Plaintext { #[cfg(test)] mod tests { use super::*; - use snarkvm_console_network::Testnet3; + use snarkvm_console_network::MainnetV0; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; const ITERATIONS: u32 = 1000; diff --git a/console/program/src/data/plaintext/equal.rs b/console/program/src/data/plaintext/equal.rs index 3432735d10..323feb8d84 100644 --- a/console/program/src/data/plaintext/equal.rs +++ b/console/program/src/data/plaintext/equal.rs @@ -84,9 +84,9 @@ impl Equal for Plaintext { #[cfg(test)] mod tests { use super::*; - use snarkvm_console_network::Testnet3; + use snarkvm_console_network::MainnetV0; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; fn sample_plaintext() -> Plaintext { Plaintext::::from_str( diff --git a/console/program/src/data/plaintext/mod.rs b/console/program/src/data/plaintext/mod.rs index aea42f16b9..8080557e4a 100644 --- a/console/program/src/data/plaintext/mod.rs +++ b/console/program/src/data/plaintext/mod.rs @@ -59,12 +59,12 @@ impl From<&Literal> for Plaintext { #[cfg(test)] mod tests { use super::*; - use snarkvm_console_network::Testnet3; + use snarkvm_console_network::MainnetV0; use snarkvm_console_types::Field; use core::str::FromStr; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; #[test] fn test_plaintext() -> Result<()> { diff --git a/console/program/src/data/plaintext/parse.rs b/console/program/src/data/plaintext/parse.rs index 7a395f4291..594e38ce68 100644 --- a/console/program/src/data/plaintext/parse.rs +++ b/console/program/src/data/plaintext/parse.rs @@ -205,9 +205,9 @@ impl Plaintext { #[cfg(test)] mod tests { use super::*; - use snarkvm_console_network::Testnet3; + use snarkvm_console_network::MainnetV0; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; #[test] fn test_parse_literal() -> Result<()> { diff --git a/console/program/src/data/plaintext/serialize.rs b/console/program/src/data/plaintext/serialize.rs index 0ad4131272..82e7ac0b1c 100644 --- a/console/program/src/data/plaintext/serialize.rs +++ b/console/program/src/data/plaintext/serialize.rs @@ -37,9 +37,9 @@ impl<'de, N: Network> Deserialize<'de> for Plaintext { #[cfg(test)] mod tests { use super::*; - use snarkvm_console_network::Testnet3; + use snarkvm_console_network::MainnetV0; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; const ITERATIONS: u64 = 2; diff --git a/console/program/src/data/record/bytes.rs b/console/program/src/data/record/bytes.rs index 6b4bcc0687..4e06c3abbf 100644 --- a/console/program/src/data/record/bytes.rs +++ b/console/program/src/data/record/bytes.rs @@ -82,9 +82,9 @@ impl ToBytes for Record { #[cfg(test)] mod tests { use super::*; - use snarkvm_console_network::Testnet3; + use snarkvm_console_network::MainnetV0; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; #[test] fn test_bytes() -> Result<()> { diff --git a/console/program/src/data/record/decrypt.rs b/console/program/src/data/record/decrypt.rs index 31fb963db2..d5d0f37b7f 100644 --- a/console/program/src/data/record/decrypt.rs +++ b/console/program/src/data/record/decrypt.rs @@ -96,10 +96,10 @@ mod tests { use super::*; use crate::Literal; use snarkvm_console_account::PrivateKey; - use snarkvm_console_network::Testnet3; + use snarkvm_console_network::MainnetV0; use snarkvm_console_types::Field; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; const ITERATIONS: u64 = 1000; diff --git a/console/program/src/data/record/entry/parse.rs b/console/program/src/data/record/entry/parse.rs index ec7a125da3..8ab61f6fa5 100644 --- a/console/program/src/data/record/entry/parse.rs +++ b/console/program/src/data/record/entry/parse.rs @@ -288,9 +288,9 @@ impl Entry> { #[cfg(test)] mod tests { use super::*; - use snarkvm_console_network::Testnet3; + use snarkvm_console_network::MainnetV0; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; #[test] fn test_parse() -> Result<()> { diff --git a/console/program/src/data/record/equal.rs b/console/program/src/data/record/equal.rs index 61bf58b714..c830b42b50 100644 --- a/console/program/src/data/record/equal.rs +++ b/console/program/src/data/record/equal.rs @@ -60,9 +60,9 @@ impl>> Equal for Reco #[cfg(test)] mod tests { use super::*; - use snarkvm_console_network::Testnet3; + use snarkvm_console_network::MainnetV0; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; fn sample_record() -> Record> { Record::>::from_str( diff --git a/console/program/src/data/record/is_owner.rs b/console/program/src/data/record/is_owner.rs index 54df9c6958..06381ff9aa 100644 --- a/console/program/src/data/record/is_owner.rs +++ b/console/program/src/data/record/is_owner.rs @@ -62,10 +62,10 @@ mod tests { use super::*; use crate::Literal; use snarkvm_console_account::PrivateKey; - use snarkvm_console_network::Testnet3; + use snarkvm_console_network::MainnetV0; use snarkvm_console_types::Field; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; const ITERATIONS: u64 = 1_000; diff --git a/console/program/src/data/record/parse_plaintext.rs b/console/program/src/data/record/parse_plaintext.rs index 0dfcdc4aa1..6179ac24a7 100644 --- a/console/program/src/data/record/parse_plaintext.rs +++ b/console/program/src/data/record/parse_plaintext.rs @@ -178,9 +178,9 @@ impl Record> { #[cfg(test)] mod tests { use super::*; - use snarkvm_console_network::Testnet3; + use snarkvm_console_network::MainnetV0; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; #[test] fn test_parse_without_data_entries() -> Result<()> { diff --git a/console/program/src/data/record/serialize.rs b/console/program/src/data/record/serialize.rs index 00f4331007..c5da3d5670 100644 --- a/console/program/src/data/record/serialize.rs +++ b/console/program/src/data/record/serialize.rs @@ -57,9 +57,9 @@ impl<'de, N: Network> Deserialize<'de> for Record> { #[cfg(test)] mod tests { use super::*; - use snarkvm_console_network::Testnet3; + use snarkvm_console_network::MainnetV0; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; const ITERATIONS: u64 = 1; diff --git a/console/program/src/data/register/mod.rs b/console/program/src/data/register/mod.rs index 7b17c38b90..d0839dffef 100644 --- a/console/program/src/data/register/mod.rs +++ b/console/program/src/data/register/mod.rs @@ -57,9 +57,9 @@ impl PartialOrd for Register { mod tests { use super::*; use crate::{Identifier, U32}; - use snarkvm_console_network::Testnet3; + use snarkvm_console_network::MainnetV0; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; #[test] fn test_register_partial_ord() -> Result<()> { diff --git a/console/program/src/data/register/parse.rs b/console/program/src/data/register/parse.rs index 714bf0a700..d40a26a396 100644 --- a/console/program/src/data/register/parse.rs +++ b/console/program/src/data/register/parse.rs @@ -88,9 +88,9 @@ impl Display for Register { mod tests { use super::*; use crate::{Identifier, U32}; - use snarkvm_console_network::Testnet3; + use snarkvm_console_network::MainnetV0; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; #[test] fn test_register_display() -> Result<()> { // Register::Locator diff --git a/console/program/src/data/register/serialize.rs b/console/program/src/data/register/serialize.rs index a2835884ff..f5efb62e6f 100644 --- a/console/program/src/data/register/serialize.rs +++ b/console/program/src/data/register/serialize.rs @@ -37,9 +37,9 @@ impl<'de, N: Network> Deserialize<'de> for Register { #[cfg(test)] mod tests { use super::*; - use snarkvm_console_network::Testnet3; + use snarkvm_console_network::MainnetV0; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; fn check_serde_json< T: Serialize + for<'a> Deserialize<'a> + Debug + Display + PartialEq + Eq + FromStr + ToBytes + FromBytes, diff --git a/console/program/src/data/value/bytes.rs b/console/program/src/data/value/bytes.rs index 50e8567f05..c4f673d89c 100644 --- a/console/program/src/data/value/bytes.rs +++ b/console/program/src/data/value/bytes.rs @@ -53,9 +53,9 @@ impl ToBytes for Value { #[cfg(test)] mod tests { use super::*; - use snarkvm_console_network::Testnet3; + use snarkvm_console_network::MainnetV0; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; #[test] fn test_value_plaintext_bytes() -> Result<()> { diff --git a/console/program/src/data/value/parse.rs b/console/program/src/data/value/parse.rs index 9186c5bae4..9c5dddf1f8 100644 --- a/console/program/src/data/value/parse.rs +++ b/console/program/src/data/value/parse.rs @@ -66,9 +66,9 @@ impl Display for Value { #[cfg(test)] mod tests { use super::*; - use snarkvm_console_network::Testnet3; + use snarkvm_console_network::MainnetV0; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; #[test] fn test_value_plaintext_parse() { diff --git a/console/program/src/data/value/serialize.rs b/console/program/src/data/value/serialize.rs index ed8d175b2c..61b94f0cba 100644 --- a/console/program/src/data/value/serialize.rs +++ b/console/program/src/data/value/serialize.rs @@ -37,9 +37,9 @@ impl<'de, N: Network> Deserialize<'de> for Value { #[cfg(test)] mod tests { use super::*; - use snarkvm_console_network::Testnet3; + use snarkvm_console_network::MainnetV0; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; #[test] fn test_serde_json() -> Result<()> { diff --git a/console/program/src/data_types/array_type/bytes.rs b/console/program/src/data_types/array_type/bytes.rs index b01482ad4d..3030b11635 100644 --- a/console/program/src/data_types/array_type/bytes.rs +++ b/console/program/src/data_types/array_type/bytes.rs @@ -103,7 +103,7 @@ impl ToBytes for ArrayType { mod tests { use super::*; - type CurrentNetwork = snarkvm_console_network::Testnet3; + type CurrentNetwork = snarkvm_console_network::MainnetV0; #[test] fn test_array_maximum_depth() { diff --git a/console/program/src/data_types/array_type/mod.rs b/console/program/src/data_types/array_type/mod.rs index 9680c28517..b3c781b744 100644 --- a/console/program/src/data_types/array_type/mod.rs +++ b/console/program/src/data_types/array_type/mod.rs @@ -91,11 +91,11 @@ impl ArrayType { mod tests { use super::*; use crate::{Identifier, LiteralType}; - use snarkvm_console_network::Testnet3; + use snarkvm_console_network::MainnetV0; use core::str::FromStr; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; #[test] fn test_array_type() -> Result<()> { diff --git a/console/program/src/data_types/array_type/serialize.rs b/console/program/src/data_types/array_type/serialize.rs index 425b243f58..72869ae263 100644 --- a/console/program/src/data_types/array_type/serialize.rs +++ b/console/program/src/data_types/array_type/serialize.rs @@ -37,7 +37,7 @@ impl<'de, N: Network> Deserialize<'de> for ArrayType { #[cfg(test)] pub(crate) mod tests { use super::*; - use snarkvm_console_network::Testnet3; + use snarkvm_console_network::MainnetV0; /// Add test cases here to be checked for serialization. pub(crate) const TEST_CASES: &[&str] = &[ @@ -100,14 +100,14 @@ pub(crate) mod tests { #[test] fn test_serde_json() { for case in TEST_CASES.iter() { - check_serde_json(ArrayType::::from_str(case).unwrap()); + check_serde_json(ArrayType::::from_str(case).unwrap()); } } #[test] fn test_bincode() { for case in TEST_CASES.iter() { - check_bincode(ArrayType::::from_str(case).unwrap()); + check_bincode(ArrayType::::from_str(case).unwrap()); } } } diff --git a/console/program/src/data_types/finalize_type/parse.rs b/console/program/src/data_types/finalize_type/parse.rs index 7ab5ef9421..a60a7a3462 100644 --- a/console/program/src/data_types/finalize_type/parse.rs +++ b/console/program/src/data_types/finalize_type/parse.rs @@ -65,9 +65,9 @@ impl Display for FinalizeType { #[cfg(test)] mod tests { use super::*; - use snarkvm_console_network::Testnet3; + use snarkvm_console_network::MainnetV0; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; #[test] fn test_parse() -> Result<()> { diff --git a/console/program/src/data_types/finalize_type/serialize.rs b/console/program/src/data_types/finalize_type/serialize.rs index db0e58dfd1..ef4794f47a 100644 --- a/console/program/src/data_types/finalize_type/serialize.rs +++ b/console/program/src/data_types/finalize_type/serialize.rs @@ -37,9 +37,9 @@ impl<'de, N: Network> Deserialize<'de> for FinalizeType { #[cfg(test)] mod tests { use super::*; - use snarkvm_console_network::Testnet3; + use snarkvm_console_network::MainnetV0; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; /// Add test cases here to be checked for serialization. const TEST_CASES: &[&str] = &[ diff --git a/console/program/src/data_types/plaintext_type/parse.rs b/console/program/src/data_types/plaintext_type/parse.rs index d1a0634019..4e55c6498b 100644 --- a/console/program/src/data_types/plaintext_type/parse.rs +++ b/console/program/src/data_types/plaintext_type/parse.rs @@ -68,9 +68,9 @@ impl Display for PlaintextType { #[cfg(test)] mod tests { use super::*; - use snarkvm_console_network::Testnet3; + use snarkvm_console_network::MainnetV0; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; #[test] fn test_parse() -> Result<()> { diff --git a/console/program/src/data_types/plaintext_type/serialize.rs b/console/program/src/data_types/plaintext_type/serialize.rs index c9d602016c..f80a3862a8 100644 --- a/console/program/src/data_types/plaintext_type/serialize.rs +++ b/console/program/src/data_types/plaintext_type/serialize.rs @@ -37,9 +37,9 @@ impl<'de, N: Network> Deserialize<'de> for PlaintextType { #[cfg(test)] mod tests { use super::*; - use snarkvm_console_network::Testnet3; + use snarkvm_console_network::MainnetV0; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; /// Add test cases here to be checked for serialization. const TEST_CASES: &[&str] = &[ diff --git a/console/program/src/data_types/record_type/bytes.rs b/console/program/src/data_types/record_type/bytes.rs index 0848fd93ef..172c41c631 100644 --- a/console/program/src/data_types/record_type/bytes.rs +++ b/console/program/src/data_types/record_type/bytes.rs @@ -88,9 +88,9 @@ impl ToBytes for RecordType { #[cfg(test)] mod tests { use super::*; - use snarkvm_console_network::Testnet3; + use snarkvm_console_network::MainnetV0; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; #[test] fn test_bytes() -> Result<()> { diff --git a/console/program/src/data_types/record_type/entry_type/parse.rs b/console/program/src/data_types/record_type/entry_type/parse.rs index 587517b1f0..36b153bdbc 100644 --- a/console/program/src/data_types/record_type/entry_type/parse.rs +++ b/console/program/src/data_types/record_type/entry_type/parse.rs @@ -65,9 +65,9 @@ impl Display for EntryType { #[cfg(test)] mod tests { use super::*; - use snarkvm_console_network::Testnet3; + use snarkvm_console_network::MainnetV0; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; #[test] fn test_parse() -> Result<()> { diff --git a/console/program/src/data_types/record_type/entry_type/serialize.rs b/console/program/src/data_types/record_type/entry_type/serialize.rs index a042781a7f..00884ef302 100644 --- a/console/program/src/data_types/record_type/entry_type/serialize.rs +++ b/console/program/src/data_types/record_type/entry_type/serialize.rs @@ -37,9 +37,9 @@ impl<'de, N: Network> Deserialize<'de> for EntryType { #[cfg(test)] mod tests { use super::*; - use snarkvm_console_network::Testnet3; + use snarkvm_console_network::MainnetV0; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; /// Add test cases here to be checked for serialization. const TEST_CASES: &[&str] = &[ diff --git a/console/program/src/data_types/record_type/parse.rs b/console/program/src/data_types/record_type/parse.rs index fae51218c2..d995622e7c 100644 --- a/console/program/src/data_types/record_type/parse.rs +++ b/console/program/src/data_types/record_type/parse.rs @@ -134,9 +134,9 @@ impl Display for RecordType { #[cfg(test)] mod tests { use super::*; - use snarkvm_console_network::Testnet3; + use snarkvm_console_network::MainnetV0; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; #[test] fn test_parse() -> Result<()> { diff --git a/console/program/src/data_types/record_type/serialize.rs b/console/program/src/data_types/record_type/serialize.rs index ea56b08bee..40c94d2149 100644 --- a/console/program/src/data_types/record_type/serialize.rs +++ b/console/program/src/data_types/record_type/serialize.rs @@ -37,9 +37,9 @@ impl<'de, N: Network> Deserialize<'de> for RecordType { #[cfg(test)] mod tests { use super::*; - use snarkvm_console_network::Testnet3; + use snarkvm_console_network::MainnetV0; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; /// Add test cases here to be checked for serialization. const TEST_CASES: &[&str] = diff --git a/console/program/src/data_types/register_type/parse.rs b/console/program/src/data_types/register_type/parse.rs index 9b70a48ecf..6cd6f5b4fc 100644 --- a/console/program/src/data_types/register_type/parse.rs +++ b/console/program/src/data_types/register_type/parse.rs @@ -71,9 +71,9 @@ impl Display for RegisterType { #[cfg(test)] mod tests { use super::*; - use snarkvm_console_network::Testnet3; + use snarkvm_console_network::MainnetV0; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; #[test] fn test_parse() -> Result<()> { diff --git a/console/program/src/data_types/register_type/serialize.rs b/console/program/src/data_types/register_type/serialize.rs index b4b526ef36..919e750256 100644 --- a/console/program/src/data_types/register_type/serialize.rs +++ b/console/program/src/data_types/register_type/serialize.rs @@ -37,9 +37,9 @@ impl<'de, N: Network> Deserialize<'de> for RegisterType { #[cfg(test)] mod tests { use super::*; - use snarkvm_console_network::Testnet3; + use snarkvm_console_network::MainnetV0; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; /// Add test cases here to be checked for serialization. const TEST_CASES: &[&str] = &[ diff --git a/console/program/src/data_types/struct_type/bytes.rs b/console/program/src/data_types/struct_type/bytes.rs index e7b9c31856..cdee12b982 100644 --- a/console/program/src/data_types/struct_type/bytes.rs +++ b/console/program/src/data_types/struct_type/bytes.rs @@ -73,9 +73,9 @@ impl ToBytes for StructType { #[cfg(test)] mod tests { use super::*; - use snarkvm_console_network::Testnet3; + use snarkvm_console_network::MainnetV0; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; #[test] fn test_bytes() -> Result<()> { diff --git a/console/program/src/data_types/struct_type/parse.rs b/console/program/src/data_types/struct_type/parse.rs index 1b606a749f..42ad3b7ca0 100644 --- a/console/program/src/data_types/struct_type/parse.rs +++ b/console/program/src/data_types/struct_type/parse.rs @@ -114,9 +114,9 @@ impl Display for StructType { #[cfg(test)] mod tests { use super::*; - use snarkvm_console_network::Testnet3; + use snarkvm_console_network::MainnetV0; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; #[test] fn test_parse() -> Result<()> { diff --git a/console/program/src/data_types/struct_type/serialize.rs b/console/program/src/data_types/struct_type/serialize.rs index 4d813a02f7..b5e0c2065c 100644 --- a/console/program/src/data_types/struct_type/serialize.rs +++ b/console/program/src/data_types/struct_type/serialize.rs @@ -37,9 +37,9 @@ impl<'de, N: Network> Deserialize<'de> for StructType { #[cfg(test)] mod tests { use super::*; - use snarkvm_console_network::Testnet3; + use snarkvm_console_network::MainnetV0; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; /// Add test cases here to be checked for serialization. const TEST_CASES: &[&str] = &["struct message: owner as address; is_new as boolean; total_supply as u64;"]; diff --git a/console/program/src/data_types/value_type/parse.rs b/console/program/src/data_types/value_type/parse.rs index 6b98fd2b49..e7ce5402a8 100644 --- a/console/program/src/data_types/value_type/parse.rs +++ b/console/program/src/data_types/value_type/parse.rs @@ -72,9 +72,9 @@ impl Display for ValueType { #[cfg(test)] mod tests { use super::*; - use snarkvm_console_network::Testnet3; + use snarkvm_console_network::MainnetV0; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; #[test] fn test_parse() -> Result<()> { diff --git a/console/program/src/data_types/value_type/serialize.rs b/console/program/src/data_types/value_type/serialize.rs index d57c7c170f..fc6f779555 100644 --- a/console/program/src/data_types/value_type/serialize.rs +++ b/console/program/src/data_types/value_type/serialize.rs @@ -37,9 +37,9 @@ impl<'de, N: Network> Deserialize<'de> for ValueType { #[cfg(test)] mod tests { use super::*; - use snarkvm_console_network::Testnet3; + use snarkvm_console_network::MainnetV0; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; /// Add test cases here to be checked for serialization. const TEST_CASES: &[&str] = &[ diff --git a/console/program/src/id/mod.rs b/console/program/src/id/mod.rs index 4bab9a0886..da40170dda 100644 --- a/console/program/src/id/mod.rs +++ b/console/program/src/id/mod.rs @@ -151,9 +151,9 @@ impl Equal for ProgramID { #[cfg(test)] mod tests { use super::*; - use snarkvm_console_network::Testnet3; + use snarkvm_console_network::MainnetV0; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; #[test] fn test_partial_ord() -> Result<()> { diff --git a/console/program/src/id/parse.rs b/console/program/src/id/parse.rs index 86e3498fc0..8fa8a7f613 100644 --- a/console/program/src/id/parse.rs +++ b/console/program/src/id/parse.rs @@ -61,9 +61,9 @@ impl Display for ProgramID { #[cfg(test)] mod tests { use super::*; - use snarkvm_console_network::Testnet3; + use snarkvm_console_network::MainnetV0; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; #[test] fn test_parse() -> Result<()> { diff --git a/console/program/src/id/serialize.rs b/console/program/src/id/serialize.rs index 76180a25a7..7857a201e1 100644 --- a/console/program/src/id/serialize.rs +++ b/console/program/src/id/serialize.rs @@ -37,9 +37,9 @@ impl<'de, N: Network> Deserialize<'de> for ProgramID { #[cfg(test)] mod tests { use super::*; - use snarkvm_console_network::Testnet3; + use snarkvm_console_network::MainnetV0; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; /// Add test cases here to be checked for serialization. const TEST_CASES: &[&str] = &["testing.aleo", "hello.aleo", "abc_def.aleo", "a1234.aleo"]; diff --git a/console/program/src/id/to_bits.rs b/console/program/src/id/to_bits.rs index a34dcd689d..3817a537f1 100644 --- a/console/program/src/id/to_bits.rs +++ b/console/program/src/id/to_bits.rs @@ -44,9 +44,9 @@ impl ToBits for &ProgramID { mod tests { use super::*; use crate::data::identifier::tests::sample_lowercase_identifier_as_string; - use snarkvm_console_network::Testnet3; + use snarkvm_console_network::MainnetV0; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; const ITERATIONS: usize = 100; diff --git a/console/program/src/locator/parse.rs b/console/program/src/locator/parse.rs index 129bd89e0f..9f787423d1 100644 --- a/console/program/src/locator/parse.rs +++ b/console/program/src/locator/parse.rs @@ -62,9 +62,9 @@ impl Display for Locator { #[cfg(test)] mod tests { use super::*; - use snarkvm_console_network::Testnet3; + use snarkvm_console_network::MainnetV0; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; #[test] fn test_import_parse() -> Result<()> { diff --git a/console/program/src/locator/serialize.rs b/console/program/src/locator/serialize.rs index ab25677216..82dd9acb66 100644 --- a/console/program/src/locator/serialize.rs +++ b/console/program/src/locator/serialize.rs @@ -37,9 +37,9 @@ impl<'de, N: Network> Deserialize<'de> for Locator { #[cfg(test)] mod tests { use super::*; - use snarkvm_console_network::Testnet3; + use snarkvm_console_network::MainnetV0; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; /// Add test cases here to be checked for serialization. const TEST_CASES: &[&str] = &["testing.aleo/abc", "hello.aleo/u1r02r", "hello_world.aleo/foo", "foo123.aleo/run"]; diff --git a/console/program/src/owner/bytes.rs b/console/program/src/owner/bytes.rs index edffec5844..c827ccfb64 100644 --- a/console/program/src/owner/bytes.rs +++ b/console/program/src/owner/bytes.rs @@ -49,9 +49,9 @@ impl ToBytes for ProgramOwner { #[cfg(test)] mod tests { use super::*; - use snarkvm_console_network::Testnet3; + use snarkvm_console_network::MainnetV0; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; #[test] fn test_bytes() -> Result<()> { diff --git a/console/program/src/owner/mod.rs b/console/program/src/owner/mod.rs index 96a532cd4c..4e7899b44d 100644 --- a/console/program/src/owner/mod.rs +++ b/console/program/src/owner/mod.rs @@ -63,11 +63,11 @@ impl ProgramOwner { #[cfg(test)] pub(crate) mod test_helpers { use super::*; - use snarkvm_console_network::Testnet3; + use snarkvm_console_network::MainnetV0; use once_cell::sync::OnceCell; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; pub(crate) fn sample_program_owner() -> ProgramOwner { static INSTANCE: OnceCell> = OnceCell::new(); diff --git a/console/program/src/request/input_id/serialize.rs b/console/program/src/request/input_id/serialize.rs index 0a74b0874e..c4961f18a4 100644 --- a/console/program/src/request/input_id/serialize.rs +++ b/console/program/src/request/input_id/serialize.rs @@ -93,9 +93,9 @@ impl<'de, N: Network> Deserialize<'de> for InputID { #[cfg(test)] mod tests { use super::*; - use snarkvm_console_network::Testnet3; + use snarkvm_console_network::MainnetV0; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; /// Add test cases here to be checked for serialization. const TEST_CASES: &[&str] = &[ diff --git a/console/program/src/request/mod.rs b/console/program/src/request/mod.rs index 41b2e8097a..a04784b76b 100644 --- a/console/program/src/request/mod.rs +++ b/console/program/src/request/mod.rs @@ -164,9 +164,9 @@ impl Request { #[cfg(test)] mod test_helpers { use super::*; - use snarkvm_console_network::Testnet3; + use snarkvm_console_network::MainnetV0; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; const ITERATIONS: u64 = 1000; diff --git a/console/program/src/request/verify.rs b/console/program/src/request/verify.rs index 9b0d25f647..d2f1f6739a 100644 --- a/console/program/src/request/verify.rs +++ b/console/program/src/request/verify.rs @@ -211,9 +211,9 @@ impl Request { mod tests { use super::*; use snarkvm_console_account::PrivateKey; - use snarkvm_console_network::Testnet3; + use snarkvm_console_network::MainnetV0; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; pub(crate) const ITERATIONS: usize = 1000; diff --git a/console/program/src/state_path/bytes.rs b/console/program/src/state_path/bytes.rs index 13a42f96ff..4b4334fadd 100644 --- a/console/program/src/state_path/bytes.rs +++ b/console/program/src/state_path/bytes.rs @@ -94,9 +94,9 @@ impl ToBytes for StatePath { #[cfg(test)] mod tests { use super::*; - use snarkvm_console_network::Testnet3; + use snarkvm_console_network::MainnetV0; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; const ITERATIONS: usize = 100; diff --git a/console/program/src/state_path/configuration/mod.rs b/console/program/src/state_path/configuration/mod.rs index fac6225f8f..80b920510f 100644 --- a/console/program/src/state_path/configuration/mod.rs +++ b/console/program/src/state_path/configuration/mod.rs @@ -71,7 +71,7 @@ mod tests { use super::*; use snarkvm_console_network::Network; - type CurrentNetwork = snarkvm_console_network::Testnet3; + type CurrentNetwork = snarkvm_console_network::MainnetV0; #[test] fn test_transaction_depth_is_correct() { diff --git a/console/program/src/state_path/header_leaf/mod.rs b/console/program/src/state_path/header_leaf/mod.rs index 1768af8046..ecfc8fc53f 100644 --- a/console/program/src/state_path/header_leaf/mod.rs +++ b/console/program/src/state_path/header_leaf/mod.rs @@ -49,9 +49,9 @@ impl HeaderLeaf { #[cfg(test)] mod test_helpers { use super::*; - use snarkvm_console_network::Testnet3; + use snarkvm_console_network::MainnetV0; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; pub(super) fn sample_leaf(rng: &mut TestRng) -> HeaderLeaf { // Construct a new leaf. diff --git a/console/program/src/state_path/parse.rs b/console/program/src/state_path/parse.rs index de701da6b7..cff85c3bdd 100644 --- a/console/program/src/state_path/parse.rs +++ b/console/program/src/state_path/parse.rs @@ -74,9 +74,9 @@ impl Display for StatePath { #[cfg(test)] mod tests { use super::*; - use snarkvm_console_network::Testnet3; + use snarkvm_console_network::MainnetV0; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; const ITERATIONS: usize = 100; diff --git a/console/program/src/state_path/serialize.rs b/console/program/src/state_path/serialize.rs index 119104105a..6ec1821db4 100644 --- a/console/program/src/state_path/serialize.rs +++ b/console/program/src/state_path/serialize.rs @@ -37,9 +37,9 @@ impl<'de, N: Network> Deserialize<'de> for StatePath { #[cfg(test)] mod tests { use super::*; - use snarkvm_console_network::Testnet3; + use snarkvm_console_network::MainnetV0; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; const ITERATIONS: usize = 100; diff --git a/console/program/src/state_path/transaction_leaf/mod.rs b/console/program/src/state_path/transaction_leaf/mod.rs index 1f3da92793..ef824af4d2 100644 --- a/console/program/src/state_path/transaction_leaf/mod.rs +++ b/console/program/src/state_path/transaction_leaf/mod.rs @@ -71,9 +71,9 @@ impl TransactionLeaf { #[cfg(test)] mod test_helpers { use super::*; - use snarkvm_console_network::Testnet3; + use snarkvm_console_network::MainnetV0; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; pub(super) fn sample_leaf(rng: &mut TestRng) -> TransactionLeaf { // Construct a new leaf. diff --git a/console/program/src/state_path/transition_leaf/mod.rs b/console/program/src/state_path/transition_leaf/mod.rs index 53e84eac0b..edd79d5e61 100644 --- a/console/program/src/state_path/transition_leaf/mod.rs +++ b/console/program/src/state_path/transition_leaf/mod.rs @@ -71,9 +71,9 @@ impl TransitionLeaf { #[cfg(test)] mod test_helpers { use super::*; - use snarkvm_console_network::Testnet3; + use snarkvm_console_network::MainnetV0; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; pub(super) fn sample_leaf(rng: &mut TestRng) -> TransitionLeaf { // Construct a new leaf. diff --git a/console/program/src/state_path/verify.rs b/console/program/src/state_path/verify.rs index fe44638b89..8b93397e2d 100644 --- a/console/program/src/state_path/verify.rs +++ b/console/program/src/state_path/verify.rs @@ -133,9 +133,9 @@ impl StatePath { #[cfg(test)] mod tests { use super::*; - use snarkvm_console_network::{prelude::TestRng, Testnet3}; + use snarkvm_console_network::{prelude::TestRng, MainnetV0}; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; const ITERATIONS: usize = 100; diff --git a/console/types/benches/group.rs b/console/types/benches/group.rs index 97782f3881..4bd36e6b31 100644 --- a/console/types/benches/group.rs +++ b/console/types/benches/group.rs @@ -16,10 +16,10 @@ extern crate criterion; use criterion::Criterion; -use snarkvm_console_network::{environment::prelude::*, Testnet3}; +use snarkvm_console_network::{environment::prelude::*, MainnetV0}; use snarkvm_console_types::{Field, Group}; -type CurrentNetwork = Testnet3; +type CurrentNetwork = MainnetV0; fn group_from_field(c: &mut Criterion) { let rng = &mut TestRng::default(); diff --git a/ledger/authority/src/lib.rs b/ledger/authority/src/lib.rs index a3fcf38adf..5d6c8e5736 100644 --- a/ledger/authority/src/lib.rs +++ b/ledger/authority/src/lib.rs @@ -119,7 +119,7 @@ pub mod test_helpers { use super::*; use console::prelude::{TestRng, Uniform}; - pub type CurrentNetwork = console::network::Testnet3; + pub type CurrentNetwork = console::network::MainnetV0; /// Returns a sample beacon authority. pub fn sample_beacon_authority(rng: &mut TestRng) -> Authority { diff --git a/ledger/benches/block.rs b/ledger/benches/block.rs index 1ddacaf8ad..710c96661f 100644 --- a/ledger/benches/block.rs +++ b/ledger/benches/block.rs @@ -15,12 +15,12 @@ #[macro_use] extern crate criterion; -use console::{network::Testnet3, prelude::*}; +use console::{network::MainnetV0, prelude::*}; use ledger_block::Block; use criterion::Criterion; -type CurrentNetwork = Testnet3; +type CurrentNetwork = MainnetV0; /// Loads the genesis block. fn load_genesis_block() -> Block { diff --git a/ledger/benches/transaction.rs b/ledger/benches/transaction.rs index 233e15aa37..17f241f99c 100644 --- a/ledger/benches/transaction.rs +++ b/ledger/benches/transaction.rs @@ -19,7 +19,7 @@ extern crate criterion; use console::{ account::*, - network::Testnet3, + network::MainnetV0, program::{Plaintext, Record, Value}, }; use ledger_block::Transition; @@ -30,9 +30,9 @@ use criterion::Criterion; use indexmap::IndexMap; fn initialize_vm( - private_key: &PrivateKey, + private_key: &PrivateKey, rng: &mut R, -) -> (VM>, Vec>>) { +) -> (VM>, Vec>>) { let vm = VM::from(ConsensusStore::open(None).unwrap()).unwrap(); // Initialize the genesis block. @@ -55,13 +55,13 @@ fn deploy(c: &mut Criterion) { let rng = &mut TestRng::default(); // Sample a new private key and address. - let private_key = PrivateKey::::new(rng).unwrap(); + let private_key = PrivateKey::::new(rng).unwrap(); // Initialize the VM. let (vm, records) = initialize_vm(&private_key, rng); // Create a sample program. - let program = Program::::from_str( + let program = Program::::from_str( r" program helloworld.aleo; @@ -88,7 +88,7 @@ fn execute(c: &mut Criterion) { let rng = &mut TestRng::default(); // Sample a new private key and address. - let private_key = PrivateKey::::new(rng).unwrap(); + let private_key = PrivateKey::::new(rng).unwrap(); let address = Address::try_from(&private_key).unwrap(); // Initialize the VM. @@ -96,9 +96,11 @@ fn execute(c: &mut Criterion) { { // Prepare the inputs. - let inputs = - [Value::::from_str(&address.to_string()).unwrap(), Value::::from_str("1u64").unwrap()] - .into_iter(); + let inputs = [ + Value::::from_str(&address.to_string()).unwrap(), + Value::::from_str("1u64").unwrap(), + ] + .into_iter(); // Authorize the execution. let execute_authorization = vm.authorize(&private_key, "credits.aleo", "transfer_public", inputs, rng).unwrap(); @@ -131,9 +133,9 @@ fn execute(c: &mut Criterion) { { // Prepare the inputs. let inputs = [ - Value::::Record(records[0].clone()), - Value::::from_str(&address.to_string()).unwrap(), - Value::::from_str("1u64").unwrap(), + Value::::Record(records[0].clone()), + Value::::from_str(&address.to_string()).unwrap(), + Value::::from_str("1u64").unwrap(), ] .into_iter(); diff --git a/ledger/block/src/bytes.rs b/ledger/block/src/bytes.rs index 6a2ced7743..9a33f1f2d2 100644 --- a/ledger/block/src/bytes.rs +++ b/ledger/block/src/bytes.rs @@ -128,9 +128,9 @@ impl ToBytes for Block { #[cfg(test)] mod tests { use super::*; - use console::network::Testnet3; + use console::network::MainnetV0; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; #[test] fn test_bytes() -> Result<()> { diff --git a/ledger/block/src/genesis.rs b/ledger/block/src/genesis.rs index b14156fd43..1370598a08 100644 --- a/ledger/block/src/genesis.rs +++ b/ledger/block/src/genesis.rs @@ -44,9 +44,9 @@ impl Block { #[cfg(test)] mod tests { use super::*; - use console::network::Testnet3; + use console::network::MainnetV0; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; #[test] fn test_genesis() { diff --git a/ledger/block/src/header/bytes.rs b/ledger/block/src/header/bytes.rs index 3ea781cfc2..a906e6a4ab 100644 --- a/ledger/block/src/header/bytes.rs +++ b/ledger/block/src/header/bytes.rs @@ -69,9 +69,9 @@ impl ToBytes for Header { #[cfg(test)] mod tests { use super::*; - use console::network::Testnet3; + use console::network::MainnetV0; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; #[test] fn test_bytes() -> Result<()> { diff --git a/ledger/block/src/header/genesis.rs b/ledger/block/src/header/genesis.rs index 52c19e6ed8..5d653b4671 100644 --- a/ledger/block/src/header/genesis.rs +++ b/ledger/block/src/header/genesis.rs @@ -69,9 +69,9 @@ impl Header { #[cfg(test)] mod tests { use super::*; - use console::network::Testnet3; + use console::network::MainnetV0; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; /// Returns the expected block header size by summing its subcomponent sizes. /// Update this method if the contents of a block header have changed. diff --git a/ledger/block/src/header/merkle.rs b/ledger/block/src/header/merkle.rs index bef088944f..0c8f1c1ac1 100644 --- a/ledger/block/src/header/merkle.rs +++ b/ledger/block/src/header/merkle.rs @@ -89,9 +89,9 @@ impl Header { #[cfg(test)] mod tests { use super::*; - use console::network::Testnet3; + use console::network::MainnetV0; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; const ITERATIONS: u64 = 1_000; diff --git a/ledger/block/src/header/metadata/bytes.rs b/ledger/block/src/header/metadata/bytes.rs index f89a9046e3..f458935906 100644 --- a/ledger/block/src/header/metadata/bytes.rs +++ b/ledger/block/src/header/metadata/bytes.rs @@ -78,9 +78,9 @@ impl ToBytes for Metadata { #[cfg(test)] mod tests { use super::*; - use console::network::Testnet3; + use console::network::MainnetV0; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; #[test] fn test_bytes() -> Result<()> { diff --git a/ledger/block/src/header/metadata/genesis.rs b/ledger/block/src/header/metadata/genesis.rs index a3a107b228..dc34250c0c 100644 --- a/ledger/block/src/header/metadata/genesis.rs +++ b/ledger/block/src/header/metadata/genesis.rs @@ -72,9 +72,9 @@ impl Metadata { #[cfg(test)] mod tests { use super::*; - use console::network::Testnet3; + use console::network::MainnetV0; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; /// Returns the expected metadata size by summing its subcomponent sizes. /// Update this method if the contents of the metadata have changed. diff --git a/ledger/block/src/header/metadata/mod.rs b/ledger/block/src/header/metadata/mod.rs index 842ecdccf7..9bb7e2dcab 100644 --- a/ledger/block/src/header/metadata/mod.rs +++ b/ledger/block/src/header/metadata/mod.rs @@ -172,7 +172,7 @@ impl Metadata { pub mod test_helpers { use super::*; - type CurrentNetwork = console::network::Testnet3; + type CurrentNetwork = console::network::MainnetV0; /// Samples a block metadata. pub(crate) fn sample_block_metadata(rng: &mut TestRng) -> Metadata { diff --git a/ledger/block/src/header/mod.rs b/ledger/block/src/header/mod.rs index 0d29c81721..2f963090d3 100644 --- a/ledger/block/src/header/mod.rs +++ b/ledger/block/src/header/mod.rs @@ -186,7 +186,7 @@ impl Header { pub mod test_helpers { use super::*; - type CurrentNetwork = console::network::Testnet3; + type CurrentNetwork = console::network::MainnetV0; /// Samples a block header. pub(crate) fn sample_block_header(rng: &mut TestRng) -> Header { diff --git a/ledger/block/src/helpers/target.rs b/ledger/block/src/helpers/target.rs index ffb6265bd2..40b2c9f461 100644 --- a/ledger/block/src/helpers/target.rs +++ b/ledger/block/src/helpers/target.rs @@ -226,9 +226,9 @@ fn retarget( #[cfg(test)] mod tests { use super::*; - use console::network::{prelude::*, Testnet3}; + use console::network::{prelude::*, MainnetV0}; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; const ITERATIONS: u32 = 1000; diff --git a/ledger/block/src/lib.rs b/ledger/block/src/lib.rs index d7e9bfd1ce..f3ca6b3323 100644 --- a/ledger/block/src/lib.rs +++ b/ledger/block/src/lib.rs @@ -611,7 +611,7 @@ pub mod test_helpers { use once_cell::sync::OnceCell; - type CurrentNetwork = console::network::Testnet3; + type CurrentNetwork = console::network::MainnetV0; type CurrentAleo = circuit::network::AleoV0; /// Samples a random genesis block. diff --git a/ledger/block/src/ratifications/merkle.rs b/ledger/block/src/ratifications/merkle.rs index 806e4eb7ad..6d229abed2 100644 --- a/ledger/block/src/ratifications/merkle.rs +++ b/ledger/block/src/ratifications/merkle.rs @@ -54,9 +54,9 @@ impl Ratifications { #[cfg(test)] mod tests { use super::*; - use console::network::Testnet3; + use console::network::MainnetV0; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; #[test] fn test_ratifications_depth() { diff --git a/ledger/block/src/ratifications/mod.rs b/ledger/block/src/ratifications/mod.rs index bb11fe0951..4e6778e26e 100644 --- a/ledger/block/src/ratifications/mod.rs +++ b/ledger/block/src/ratifications/mod.rs @@ -137,7 +137,7 @@ impl Ratifications { pub mod test_helpers { use super::*; - type CurrentNetwork = console::network::Testnet3; + type CurrentNetwork = console::network::MainnetV0; /// Samples a block ratifications. pub(crate) fn sample_block_ratifications(rng: &mut TestRng) -> Ratifications { diff --git a/ledger/block/src/ratifications/serialize.rs b/ledger/block/src/ratifications/serialize.rs index df252a8bbd..7322772076 100644 --- a/ledger/block/src/ratifications/serialize.rs +++ b/ledger/block/src/ratifications/serialize.rs @@ -66,9 +66,9 @@ impl<'de, N: Network> Deserialize<'de> for Ratifications { #[cfg(test)] mod tests { use super::*; - use console::network::Testnet3; + use console::network::MainnetV0; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; const ITERATIONS: u32 = 100; diff --git a/ledger/block/src/ratify/mod.rs b/ledger/block/src/ratify/mod.rs index c9a468c229..0cc1c6f377 100644 --- a/ledger/block/src/ratify/mod.rs +++ b/ledger/block/src/ratify/mod.rs @@ -45,9 +45,9 @@ impl Ratify { #[cfg(test)] pub(crate) mod test_helpers { use super::*; - use console::network::Testnet3; + use console::network::MainnetV0; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; pub(crate) fn sample_ratifications(rng: &mut TestRng) -> Vec> { let committee = ledger_committee::test_helpers::sample_committee(rng); diff --git a/ledger/block/src/serialize.rs b/ledger/block/src/serialize.rs index 595a218a78..d440b450b6 100644 --- a/ledger/block/src/serialize.rs +++ b/ledger/block/src/serialize.rs @@ -71,9 +71,9 @@ impl<'de, N: Network> Deserialize<'de> for Block { #[cfg(test)] mod tests { use super::*; - use console::network::Testnet3; + use console::network::MainnetV0; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; #[test] fn test_serde_json() -> Result<()> { diff --git a/ledger/block/src/solutions/serialize.rs b/ledger/block/src/solutions/serialize.rs index a682e1f99d..712d624e91 100644 --- a/ledger/block/src/solutions/serialize.rs +++ b/ledger/block/src/solutions/serialize.rs @@ -65,7 +65,7 @@ pub(super) mod tests { use console::account::{Address, PrivateKey}; use ledger_coinbase::{PartialSolution, ProverSolution, PuzzleCommitment, PuzzleProof}; - type CurrentNetwork = console::network::Testnet3; + type CurrentNetwork = console::network::MainnetV0; pub(crate) fn sample_solutions(rng: &mut TestRng) -> Solutions { // Sample a new solutions. diff --git a/ledger/block/src/transaction/deployment/mod.rs b/ledger/block/src/transaction/deployment/mod.rs index fbea825444..bf898b41ba 100644 --- a/ledger/block/src/transaction/deployment/mod.rs +++ b/ledger/block/src/transaction/deployment/mod.rs @@ -150,12 +150,12 @@ impl Deployment { #[cfg(test)] pub mod test_helpers { use super::*; - use console::network::Testnet3; + use console::network::MainnetV0; use synthesizer_process::Process; use once_cell::sync::OnceCell; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; type CurrentAleo = circuit::network::AleoV0; pub(crate) fn sample_deployment(rng: &mut TestRng) -> Deployment { diff --git a/ledger/block/src/transaction/execution/mod.rs b/ledger/block/src/transaction/execution/mod.rs index cfcbb26c51..7bd7d34ef2 100644 --- a/ledger/block/src/transaction/execution/mod.rs +++ b/ledger/block/src/transaction/execution/mod.rs @@ -147,7 +147,7 @@ impl Execution { pub mod test_helpers { use super::*; - type CurrentNetwork = console::network::Testnet3; + type CurrentNetwork = console::network::MainnetV0; /// Samples a random execution. pub(crate) fn sample_execution(rng: &mut TestRng) -> Execution { diff --git a/ledger/block/src/transaction/fee/mod.rs b/ledger/block/src/transaction/fee/mod.rs index 233704fca4..5bd90737ee 100644 --- a/ledger/block/src/transaction/fee/mod.rs +++ b/ledger/block/src/transaction/fee/mod.rs @@ -207,7 +207,7 @@ pub mod test_helpers { use once_cell::sync::OnceCell; - type CurrentNetwork = console::network::Testnet3; + type CurrentNetwork = console::network::MainnetV0; type CurrentAleo = circuit::network::AleoV0; /// Samples a random hardcoded private fee. diff --git a/ledger/block/src/transaction/mod.rs b/ledger/block/src/transaction/mod.rs index fe1ace4c76..3115d7a866 100644 --- a/ledger/block/src/transaction/mod.rs +++ b/ledger/block/src/transaction/mod.rs @@ -407,9 +407,9 @@ impl Transaction { #[cfg(test)] pub mod test_helpers { use super::*; - use console::{account::PrivateKey, network::Testnet3, program::ProgramOwner}; + use console::{account::PrivateKey, network::MainnetV0, program::ProgramOwner}; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; /// Samples a random deployment transaction with a private or public fee. pub fn sample_deployment_transaction(is_fee_private: bool, rng: &mut TestRng) -> Transaction { diff --git a/ledger/block/src/transactions/confirmed/mod.rs b/ledger/block/src/transactions/confirmed/mod.rs index c617c1b3f4..b1d4164d9a 100644 --- a/ledger/block/src/transactions/confirmed/mod.rs +++ b/ledger/block/src/transactions/confirmed/mod.rs @@ -338,9 +338,9 @@ impl Deref for ConfirmedTransaction { #[cfg(test)] pub mod test_helpers { use super::*; - use console::network::Testnet3; + use console::network::MainnetV0; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; /// Samples an accepted deploy transaction at the given index. pub(crate) fn sample_accepted_deploy( @@ -449,7 +449,7 @@ mod test { use super::*; use crate::transactions::confirmed::test_helpers; - type CurrentNetwork = console::network::Testnet3; + type CurrentNetwork = console::network::MainnetV0; #[test] fn test_accepted_execute() { diff --git a/ledger/block/src/transactions/merkle.rs b/ledger/block/src/transactions/merkle.rs index 7f666f4ff5..74c4fd9006 100644 --- a/ledger/block/src/transactions/merkle.rs +++ b/ledger/block/src/transactions/merkle.rs @@ -77,9 +77,9 @@ impl Transactions { #[cfg(test)] mod tests { use super::*; - use console::network::Testnet3; + use console::network::MainnetV0; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; #[test] fn test_transactions_depth() { diff --git a/ledger/block/src/transactions/mod.rs b/ledger/block/src/transactions/mod.rs index ef2f3a60f5..90bd1ec721 100644 --- a/ledger/block/src/transactions/mod.rs +++ b/ledger/block/src/transactions/mod.rs @@ -339,7 +339,7 @@ impl Transactions { pub mod test_helpers { use super::*; - type CurrentNetwork = console::network::Testnet3; + type CurrentNetwork = console::network::MainnetV0; /// Samples a block transactions. pub(crate) fn sample_block_transactions(rng: &mut TestRng) -> Transactions { @@ -352,7 +352,7 @@ mod tests { use super::*; use ledger_narwhal_batch_header::BatchHeader; - type CurrentNetwork = console::network::Testnet3; + type CurrentNetwork = console::network::MainnetV0; #[test] fn test_max_transmissions() { diff --git a/ledger/block/src/transactions/rejected/mod.rs b/ledger/block/src/transactions/rejected/mod.rs index c730935c4d..6ce9886201 100644 --- a/ledger/block/src/transactions/rejected/mod.rs +++ b/ledger/block/src/transactions/rejected/mod.rs @@ -94,9 +94,9 @@ impl Rejected { #[cfg(test)] pub mod test_helpers { use super::*; - use console::{account::PrivateKey, network::Testnet3}; + use console::{account::PrivateKey, network::MainnetV0}; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; /// Samples a rejected deployment. pub(crate) fn sample_rejected_deployment(is_fee_private: bool, rng: &mut TestRng) -> Rejected { diff --git a/ledger/block/src/transactions/serialize.rs b/ledger/block/src/transactions/serialize.rs index f1a264e611..a1e5d3b92e 100644 --- a/ledger/block/src/transactions/serialize.rs +++ b/ledger/block/src/transactions/serialize.rs @@ -65,9 +65,9 @@ impl<'de, N: Network> Deserialize<'de> for Transactions { #[cfg(test)] mod tests { use super::*; - use console::network::Testnet3; + use console::network::MainnetV0; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; const ITERATIONS: u32 = 6; diff --git a/ledger/block/src/transition/input/mod.rs b/ledger/block/src/transition/input/mod.rs index 284af88f76..c49beb2c11 100644 --- a/ledger/block/src/transition/input/mod.rs +++ b/ledger/block/src/transition/input/mod.rs @@ -180,9 +180,9 @@ impl Input { #[cfg(test)] pub(crate) mod test_helpers { use super::*; - use console::{network::Testnet3, program::Literal}; + use console::{network::MainnetV0, program::Literal}; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; /// Sample the transition inputs. pub(crate) fn sample_inputs() -> Vec<(::TransitionID, Input)> { diff --git a/ledger/block/src/transition/merkle.rs b/ledger/block/src/transition/merkle.rs index e2f05de05b..4874a675e0 100644 --- a/ledger/block/src/transition/merkle.rs +++ b/ledger/block/src/transition/merkle.rs @@ -97,9 +97,9 @@ impl Transition { #[cfg(test)] mod tests { use super::*; - use console::network::Testnet3; + use console::network::MainnetV0; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; #[test] fn test_transition_depth() { diff --git a/ledger/block/src/transition/mod.rs b/ledger/block/src/transition/mod.rs index 9e93fc16a7..0856e20cf4 100644 --- a/ledger/block/src/transition/mod.rs +++ b/ledger/block/src/transition/mod.rs @@ -481,7 +481,7 @@ pub mod test_helpers { use super::*; use crate::Transaction; - type CurrentNetwork = console::network::Testnet3; + type CurrentNetwork = console::network::MainnetV0; /// Samples a random transition. pub(crate) fn sample_transition(rng: &mut TestRng) -> Transition { diff --git a/ledger/block/src/transition/output/mod.rs b/ledger/block/src/transition/output/mod.rs index 3f0f5ff7a4..84a7b5c594 100644 --- a/ledger/block/src/transition/output/mod.rs +++ b/ledger/block/src/transition/output/mod.rs @@ -257,9 +257,9 @@ impl Output { #[cfg(test)] pub(crate) mod test_helpers { use super::*; - use console::{network::Testnet3, program::Literal}; + use console::{network::MainnetV0, program::Literal}; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; /// Sample the transition outputs. pub(crate) fn sample_outputs() -> Vec<(::TransitionID, Output)> { diff --git a/ledger/coinbase/benches/coinbase_puzzle.rs b/ledger/coinbase/benches/coinbase_puzzle.rs index fe8c86c4ca..d48757930a 100644 --- a/ledger/coinbase/benches/coinbase_puzzle.rs +++ b/ledger/coinbase/benches/coinbase_puzzle.rs @@ -19,29 +19,29 @@ extern crate criterion; use console::{ account::*, - network::{Network, Testnet3}, + network::{MainnetV0, Network}, }; use snarkvm_ledger_coinbase::{CoinbasePuzzle, CoinbaseSolution, EpochChallenge, PuzzleConfig}; use criterion::Criterion; use rand::{self, thread_rng, CryptoRng, RngCore}; -type CoinbasePuzzleInst = CoinbasePuzzle; +type CoinbasePuzzleInst = CoinbasePuzzle; fn sample_inputs( degree: u32, rng: &mut (impl CryptoRng + RngCore), -) -> (EpochChallenge, Address, u64) { +) -> (EpochChallenge, Address, u64) { let epoch_challenge = sample_epoch_challenge(degree, rng); let (address, nonce) = sample_address_and_nonce(rng); (epoch_challenge, address, nonce) } -fn sample_epoch_challenge(degree: u32, rng: &mut (impl CryptoRng + RngCore)) -> EpochChallenge { +fn sample_epoch_challenge(degree: u32, rng: &mut (impl CryptoRng + RngCore)) -> EpochChallenge { EpochChallenge::new(rng.next_u32(), Default::default(), degree).unwrap() } -fn sample_address_and_nonce(rng: &mut (impl CryptoRng + RngCore)) -> (Address, u64) { +fn sample_address_and_nonce(rng: &mut (impl CryptoRng + RngCore)) -> (Address, u64) { let private_key = PrivateKey::new(rng).unwrap(); let address = Address::try_from(private_key).unwrap(); let nonce = rng.next_u64(); @@ -52,7 +52,7 @@ fn sample_address_and_nonce(rng: &mut (impl CryptoRng + RngCore)) -> (Address::setup(max_config).unwrap(); + let universal_srs = CoinbasePuzzle::::setup(max_config).unwrap(); for degree in [(1 << 13) - 1] { let config = PuzzleConfig { degree }; @@ -69,7 +69,7 @@ fn coinbase_puzzle_prove(c: &mut Criterion) { let max_degree = 1 << 15; let max_config = PuzzleConfig { degree: max_degree }; - let universal_srs = CoinbasePuzzle::::setup(max_config).unwrap(); + let universal_srs = CoinbasePuzzle::::setup(max_config).unwrap(); for degree in [(1 << 13) - 1] { let config = PuzzleConfig { degree }; @@ -88,14 +88,14 @@ fn coinbase_puzzle_verify(c: &mut Criterion) { let max_degree = 1 << 15; let max_config = PuzzleConfig { degree: max_degree }; - let universal_srs = CoinbasePuzzle::::setup(max_config).unwrap(); + let universal_srs = CoinbasePuzzle::::setup(max_config).unwrap(); for degree in [(1 << 13) - 1] { let config = PuzzleConfig { degree }; let puzzle = CoinbasePuzzleInst::trim(&universal_srs, config).unwrap(); let epoch_challenge = sample_epoch_challenge(degree, rng); - for batch_size in [10, 100, ::MAX_SOLUTIONS] { + for batch_size in [10, 100, ::MAX_SOLUTIONS] { let solutions = (0..batch_size) .map(|_| { let (address, nonce) = sample_address_and_nonce(rng); diff --git a/ledger/coinbase/src/helpers/coinbase_solution/serialize.rs b/ledger/coinbase/src/helpers/coinbase_solution/serialize.rs index ac973aee78..ab461e7023 100644 --- a/ledger/coinbase/src/helpers/coinbase_solution/serialize.rs +++ b/ledger/coinbase/src/helpers/coinbase_solution/serialize.rs @@ -48,7 +48,7 @@ pub(super) mod tests { use super::*; use console::account::PrivateKey; - type CurrentNetwork = console::network::Testnet3; + type CurrentNetwork = console::network::MainnetV0; pub(crate) fn sample_solutions(rng: &mut TestRng) -> CoinbaseSolution { // Sample a new solutions. diff --git a/ledger/coinbase/src/helpers/epoch_challenge/bytes.rs b/ledger/coinbase/src/helpers/epoch_challenge/bytes.rs index e9e250ca9f..45398c0956 100644 --- a/ledger/coinbase/src/helpers/epoch_challenge/bytes.rs +++ b/ledger/coinbase/src/helpers/epoch_challenge/bytes.rs @@ -43,11 +43,11 @@ impl ToBytes for EpochChallenge { #[cfg(test)] mod tests { use super::*; - use console::network::Testnet3; + use console::network::MainnetV0; use rand::RngCore; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; const ITERATIONS: usize = 100; diff --git a/ledger/coinbase/src/helpers/partial_solution/bytes.rs b/ledger/coinbase/src/helpers/partial_solution/bytes.rs index 7b919d93d5..57ef315034 100644 --- a/ledger/coinbase/src/helpers/partial_solution/bytes.rs +++ b/ledger/coinbase/src/helpers/partial_solution/bytes.rs @@ -37,9 +37,9 @@ impl ToBytes for PartialSolution { #[cfg(test)] mod tests { use super::*; - use console::{account::PrivateKey, network::Testnet3}; + use console::{account::PrivateKey, network::MainnetV0}; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; #[test] fn test_bytes() -> Result<()> { diff --git a/ledger/coinbase/src/helpers/partial_solution/serialize.rs b/ledger/coinbase/src/helpers/partial_solution/serialize.rs index 322b0b155a..c71cfdb89e 100644 --- a/ledger/coinbase/src/helpers/partial_solution/serialize.rs +++ b/ledger/coinbase/src/helpers/partial_solution/serialize.rs @@ -52,9 +52,9 @@ impl<'de, N: Network> Deserialize<'de> for PartialSolution { #[cfg(test)] mod tests { use super::*; - use console::{account::PrivateKey, network::Testnet3}; + use console::{account::PrivateKey, network::MainnetV0}; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; #[test] fn test_serde_json() -> Result<()> { diff --git a/ledger/coinbase/src/helpers/partial_solution/string.rs b/ledger/coinbase/src/helpers/partial_solution/string.rs index 4b21975538..d194cc2121 100644 --- a/ledger/coinbase/src/helpers/partial_solution/string.rs +++ b/ledger/coinbase/src/helpers/partial_solution/string.rs @@ -40,9 +40,9 @@ impl Display for PartialSolution { #[cfg(test)] mod tests { use super::*; - use console::{account::PrivateKey, network::Testnet3}; + use console::{account::PrivateKey, network::MainnetV0}; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; #[test] fn test_string() -> Result<()> { diff --git a/ledger/coinbase/src/helpers/prover_solution/bytes.rs b/ledger/coinbase/src/helpers/prover_solution/bytes.rs index f5c5bdacf8..20e846b5f5 100644 --- a/ledger/coinbase/src/helpers/prover_solution/bytes.rs +++ b/ledger/coinbase/src/helpers/prover_solution/bytes.rs @@ -35,9 +35,9 @@ impl ToBytes for ProverSolution { #[cfg(test)] mod tests { use super::*; - use console::{account::PrivateKey, network::Testnet3}; + use console::{account::PrivateKey, network::MainnetV0}; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; #[test] fn test_bytes() -> Result<()> { diff --git a/ledger/coinbase/src/helpers/prover_solution/serialize.rs b/ledger/coinbase/src/helpers/prover_solution/serialize.rs index 564cba8bed..0b737310b0 100644 --- a/ledger/coinbase/src/helpers/prover_solution/serialize.rs +++ b/ledger/coinbase/src/helpers/prover_solution/serialize.rs @@ -60,9 +60,9 @@ impl<'de, N: Network> Deserialize<'de> for ProverSolution { #[cfg(test)] mod tests { use super::*; - use console::{account::PrivateKey, network::Testnet3}; + use console::{account::PrivateKey, network::MainnetV0}; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; #[test] fn test_serde_json() -> Result<()> { diff --git a/ledger/coinbase/src/helpers/prover_solution/string.rs b/ledger/coinbase/src/helpers/prover_solution/string.rs index 66f6a79275..1c96dcb4ed 100644 --- a/ledger/coinbase/src/helpers/prover_solution/string.rs +++ b/ledger/coinbase/src/helpers/prover_solution/string.rs @@ -40,9 +40,9 @@ impl Display for ProverSolution { #[cfg(test)] mod tests { use super::*; - use console::{account::PrivateKey, network::Testnet3}; + use console::{account::PrivateKey, network::MainnetV0}; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; #[test] fn test_string() -> Result<()> { diff --git a/ledger/coinbase/src/helpers/puzzle_commitment/bytes.rs b/ledger/coinbase/src/helpers/puzzle_commitment/bytes.rs index 1f83beb97d..f76cca0553 100644 --- a/ledger/coinbase/src/helpers/puzzle_commitment/bytes.rs +++ b/ledger/coinbase/src/helpers/puzzle_commitment/bytes.rs @@ -33,9 +33,9 @@ impl ToBytes for PuzzleCommitment { #[cfg(test)] mod tests { use super::*; - use console::network::Testnet3; + use console::network::MainnetV0; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; #[test] fn test_bytes() -> Result<()> { diff --git a/ledger/coinbase/src/helpers/puzzle_commitment/serialize.rs b/ledger/coinbase/src/helpers/puzzle_commitment/serialize.rs index 3f753fc143..61283b5551 100644 --- a/ledger/coinbase/src/helpers/puzzle_commitment/serialize.rs +++ b/ledger/coinbase/src/helpers/puzzle_commitment/serialize.rs @@ -37,9 +37,9 @@ impl<'de, N: Network> Deserialize<'de> for PuzzleCommitment { #[cfg(test)] mod tests { use super::*; - use console::network::Testnet3; + use console::network::MainnetV0; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; #[test] fn test_serde_json() -> Result<()> { diff --git a/ledger/coinbase/src/helpers/puzzle_commitment/string.rs b/ledger/coinbase/src/helpers/puzzle_commitment/string.rs index d01cac5802..3560889e60 100644 --- a/ledger/coinbase/src/helpers/puzzle_commitment/string.rs +++ b/ledger/coinbase/src/helpers/puzzle_commitment/string.rs @@ -57,9 +57,9 @@ impl Display for PuzzleCommitment { #[cfg(test)] mod tests { use super::*; - use console::network::Testnet3; + use console::network::MainnetV0; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; const ITERATIONS: u64 = 1_000; diff --git a/ledger/coinbase/src/tests.rs b/ledger/coinbase/src/tests.rs index 15a39fc6a3..54311253e4 100644 --- a/ledger/coinbase/src/tests.rs +++ b/ledger/coinbase/src/tests.rs @@ -13,7 +13,7 @@ // limitations under the License. use super::*; -use console::{account::*, network::Testnet3}; +use console::{account::*, network::MainnetV0}; use snarkvm_utilities::Uniform; use rand::RngCore; @@ -26,18 +26,18 @@ fn test_coinbase_puzzle() { let max_degree = 1 << 15; let max_config = PuzzleConfig { degree: max_degree }; - let srs = CoinbasePuzzle::::setup(max_config).unwrap(); + let srs = CoinbasePuzzle::::setup(max_config).unwrap(); for log_degree in 5..10 { let degree = (1 << log_degree) - 1; let config = PuzzleConfig { degree }; - let puzzle = CoinbasePuzzle::::trim(&srs, config).unwrap(); + let puzzle = CoinbasePuzzle::::trim(&srs, config).unwrap(); let epoch_challenge = EpochChallenge::new(rng.next_u32(), Default::default(), degree).unwrap(); for batch_size in 1..10 { let solutions = (0..batch_size) .map(|_| { - let private_key = PrivateKey::::new(&mut rng).unwrap(); + let private_key = PrivateKey::::new(&mut rng).unwrap(); let address = Address::try_from(private_key).unwrap(); let nonce = u64::rand(&mut rng); puzzle.prove(&epoch_challenge, address, nonce, None).unwrap() @@ -58,16 +58,16 @@ fn test_prover_solution_minimum_target() { let max_degree = 1 << 15; let max_config = PuzzleConfig { degree: max_degree }; - let srs = CoinbasePuzzle::::setup(max_config).unwrap(); + let srs = CoinbasePuzzle::::setup(max_config).unwrap(); for log_degree in 5..10 { let degree = (1 << log_degree) - 1; let config = PuzzleConfig { degree }; - let puzzle = CoinbasePuzzle::::trim(&srs, config).unwrap(); + let puzzle = CoinbasePuzzle::::trim(&srs, config).unwrap(); let epoch_challenge = EpochChallenge::new(rng.next_u32(), Default::default(), degree).unwrap(); for _ in 0..ITERATIONS { - let private_key = PrivateKey::::new(&mut rng).unwrap(); + let private_key = PrivateKey::::new(&mut rng).unwrap(); let address = Address::try_from(private_key).unwrap(); let nonce = u64::rand(&mut rng); @@ -90,14 +90,14 @@ fn test_edge_case_for_degree() { // Generate srs. let max_degree = 1 << 15; let max_config = PuzzleConfig { degree: max_degree }; - let srs = CoinbasePuzzle::::setup(max_config).unwrap(); + let srs = CoinbasePuzzle::::setup(max_config).unwrap(); // Generate PK and VK. let degree = (1 << 13) - 1; - let puzzle = CoinbasePuzzle::::trim(&srs, PuzzleConfig { degree }).unwrap(); + let puzzle = CoinbasePuzzle::::trim(&srs, PuzzleConfig { degree }).unwrap(); // Generate proof inputs - let private_key = PrivateKey::::new(&mut rng).unwrap(); + let private_key = PrivateKey::::new(&mut rng).unwrap(); let address = Address::try_from(private_key).unwrap(); let epoch_challenge = EpochChallenge::new(rng.gen(), Default::default(), degree).unwrap(); @@ -111,7 +111,7 @@ fn test_edge_case_for_degree() { #[ignore] #[test] fn test_profiler() -> Result<()> { - fn sample_address_and_nonce(rng: &mut (impl CryptoRng + RngCore)) -> (Address, u64) { + fn sample_address_and_nonce(rng: &mut (impl CryptoRng + RngCore)) -> (Address, u64) { let private_key = PrivateKey::new(rng).unwrap(); let address = Address::try_from(private_key).unwrap(); let nonce = rng.next_u64(); @@ -123,7 +123,7 @@ fn test_profiler() -> Result<()> { // Generate srs. let max_degree = 1 << 15; let max_config = PuzzleConfig { degree: max_degree }; - let universal_srs = CoinbasePuzzle::::setup(max_config).unwrap(); + let universal_srs = CoinbasePuzzle::::setup(max_config).unwrap(); // Generate PK and VK. let degree = (1 << 13) - 1; @@ -133,7 +133,7 @@ fn test_profiler() -> Result<()> { // Generate proof inputs let epoch_challenge = EpochChallenge::new(rng.next_u32(), Default::default(), degree).unwrap(); - for batch_size in [10, 100, ::MAX_SOLUTIONS] { + for batch_size in [10, 100, ::MAX_SOLUTIONS] { // Generate the solutions. let solutions = (0..batch_size) .map(|_| { diff --git a/ledger/committee/src/lib.rs b/ledger/committee/src/lib.rs index 9940c01e0e..b360cf3e29 100644 --- a/ledger/committee/src/lib.rs +++ b/ledger/committee/src/lib.rs @@ -237,7 +237,7 @@ pub mod test_helpers { use indexmap::IndexMap; use rand_distr::{Distribution, Exp}; - type CurrentNetwork = console::network::Testnet3; + type CurrentNetwork = console::network::MainnetV0; /// Samples a list of random committees. pub fn sample_committees(rng: &mut TestRng) -> Vec> { @@ -344,7 +344,7 @@ mod tests { use rayon::prelude::*; use std::sync::Arc; - type CurrentNetwork = console::network::Testnet3; + type CurrentNetwork = console::network::MainnetV0; /// Checks the leader distribution. fn check_leader_distribution(committee: Committee, num_rounds: u64, tolerance_percent: f64) { diff --git a/ledger/committee/src/prop_tests.rs b/ledger/committee/src/prop_tests.rs index f0aa2e7bb2..992be5e216 100644 --- a/ledger/committee/src/prop_tests.rs +++ b/ledger/committee/src/prop_tests.rs @@ -29,7 +29,7 @@ use std::{ }; use test_strategy::proptest; -type CurrentNetwork = console::network::Testnet3; +type CurrentNetwork = console::network::MainnetV0; #[derive(Debug, Clone)] pub struct Validator { diff --git a/ledger/narwhal/batch-certificate/src/lib.rs b/ledger/narwhal/batch-certificate/src/lib.rs index c4c9c7194e..f3d8d42dca 100644 --- a/ledger/narwhal/batch-certificate/src/lib.rs +++ b/ledger/narwhal/batch-certificate/src/lib.rs @@ -226,11 +226,11 @@ impl BatchCertificate { #[cfg(any(test, feature = "test-helpers"))] pub mod test_helpers { use super::*; - use console::{account::PrivateKey, network::Testnet3, prelude::TestRng, types::Field}; + use console::{account::PrivateKey, network::MainnetV0, prelude::TestRng, types::Field}; use indexmap::IndexSet; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; /// Returns a sample batch certificate, sampled at random. pub fn sample_batch_certificate(rng: &mut TestRng) -> BatchCertificate { @@ -317,7 +317,7 @@ pub mod test_helpers { mod tests { use super::*; - type CurrentNetwork = console::network::Testnet3; + type CurrentNetwork = console::network::MainnetV0; #[test] fn test_maximum_signatures() { diff --git a/ledger/narwhal/batch-header/src/lib.rs b/ledger/narwhal/batch-header/src/lib.rs index 4389f696dc..d50ea0f7f3 100644 --- a/ledger/narwhal/batch-header/src/lib.rs +++ b/ledger/narwhal/batch-header/src/lib.rs @@ -201,11 +201,11 @@ impl BatchHeader { #[cfg(any(test, feature = "test-helpers"))] pub mod test_helpers { use super::*; - use console::{account::PrivateKey, network::Testnet3, prelude::TestRng}; + use console::{account::PrivateKey, network::MainnetV0, prelude::TestRng}; use time::OffsetDateTime; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; /// Returns a sample batch header, sampled at random. pub fn sample_batch_header(rng: &mut TestRng) -> BatchHeader { diff --git a/ledger/narwhal/subdag/src/lib.rs b/ledger/narwhal/subdag/src/lib.rs index d699d07ecf..5bb62b203f 100644 --- a/ledger/narwhal/subdag/src/lib.rs +++ b/ledger/narwhal/subdag/src/lib.rs @@ -233,11 +233,11 @@ impl Deref for Subdag { #[cfg(any(test, feature = "test-helpers"))] pub mod test_helpers { use super::*; - use console::{network::Testnet3, prelude::TestRng}; + use console::{network::MainnetV0, prelude::TestRng}; use indexmap::{indexset, IndexSet}; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; /// Returns a sample subdag, sampled at random. pub fn sample_subdag(rng: &mut TestRng) -> Subdag { @@ -307,7 +307,7 @@ mod tests { use super::*; use narwhal_batch_header::BatchHeader; - type CurrentNetwork = console::network::Testnet3; + type CurrentNetwork = console::network::MainnetV0; const ITERATIONS: u64 = 100; diff --git a/ledger/narwhal/transmission-id/src/lib.rs b/ledger/narwhal/transmission-id/src/lib.rs index 43ffea0191..285b58ff53 100644 --- a/ledger/narwhal/transmission-id/src/lib.rs +++ b/ledger/narwhal/transmission-id/src/lib.rs @@ -68,12 +68,12 @@ impl TransmissionID { pub mod test_helpers { use super::*; use console::{ - network::Testnet3, + network::MainnetV0, prelude::{Rng, TestRng, Uniform}, types::Field, }; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; /// Returns a list of sample transmission IDs, sampled at random. pub fn sample_transmission_ids(rng: &mut TestRng) -> Vec> { diff --git a/ledger/narwhal/transmission-id/src/string.rs b/ledger/narwhal/transmission-id/src/string.rs index 167ad781ef..e2e0b8ce86 100644 --- a/ledger/narwhal/transmission-id/src/string.rs +++ b/ledger/narwhal/transmission-id/src/string.rs @@ -52,9 +52,9 @@ impl Display for TransmissionID { #[cfg(test)] mod tests { use super::*; - use console::network::Testnet3; + use console::network::MainnetV0; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; #[test] fn test_string() { diff --git a/ledger/narwhal/transmission/src/lib.rs b/ledger/narwhal/transmission/src/lib.rs index a18d096241..a7e7950c21 100644 --- a/ledger/narwhal/transmission/src/lib.rs +++ b/ledger/narwhal/transmission/src/lib.rs @@ -68,13 +68,13 @@ impl From>> for Transmission { pub mod test_helpers { use super::*; use console::{ - network::Testnet3, + network::MainnetV0, prelude::{Rng, TestRng}, }; use ::bytes::Bytes; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; /// Returns a list of sample transmissions, sampled at random. pub fn sample_transmissions(rng: &mut TestRng) -> Vec> { diff --git a/ledger/src/get.rs b/ledger/src/get.rs index fcd03e604c..06263a4841 100644 --- a/ledger/src/get.rs +++ b/ledger/src/get.rs @@ -247,9 +247,9 @@ impl> Ledger { mod tests { use super::*; use crate::test_helpers::CurrentLedger; - use console::network::Testnet3; + use console::network::MainnetV0; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; #[test] fn test_get_block() { diff --git a/ledger/src/lib.rs b/ledger/src/lib.rs index c56fc67c69..d7928b9581 100644 --- a/ledger/src/lib.rs +++ b/ledger/src/lib.rs @@ -389,14 +389,14 @@ pub(crate) mod test_helpers { use aleo_std::StorageMode; use console::{ account::{Address, PrivateKey, ViewKey}, - network::Testnet3, + network::MainnetV0, prelude::*, }; use ledger_block::Block; use ledger_store::ConsensusStore; use synthesizer::vm::VM; - pub(crate) type CurrentNetwork = Testnet3; + pub(crate) type CurrentNetwork = MainnetV0; #[cfg(not(feature = "rocks"))] pub(crate) type CurrentLedger = diff --git a/ledger/store/src/block/mod.rs b/ledger/store/src/block/mod.rs index 8e79fadaaa..38d67af76d 100644 --- a/ledger/store/src/block/mod.rs +++ b/ledger/store/src/block/mod.rs @@ -1401,7 +1401,7 @@ mod tests { use super::*; use crate::helpers::memory::BlockMemory; - type CurrentNetwork = console::network::Testnet3; + type CurrentNetwork = console::network::MainnetV0; #[test] fn test_insert_get_remove() { diff --git a/ledger/store/src/helpers/memory/internal/map.rs b/ledger/store/src/helpers/memory/internal/map.rs index 211d7e11a1..892555f27d 100644 --- a/ledger/store/src/helpers/memory/internal/map.rs +++ b/ledger/store/src/helpers/memory/internal/map.rs @@ -365,9 +365,9 @@ impl< mod tests { use super::*; use crate::{atomic_batch_scope, atomic_finalize, FinalizeMode}; - use console::{account::Address, network::Testnet3}; + use console::{account::Address, network::MainnetV0}; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; #[test] fn test_contains_key_sanity_check() { diff --git a/ledger/store/src/helpers/memory/internal/nested_map.rs b/ledger/store/src/helpers/memory/internal/nested_map.rs index 2ad1ccdaf2..11d265ce21 100644 --- a/ledger/store/src/helpers/memory/internal/nested_map.rs +++ b/ledger/store/src/helpers/memory/internal/nested_map.rs @@ -591,9 +591,9 @@ fn to_map_key(m: &[u8], k: &[u8]) -> Vec { mod tests { use super::*; use crate::{atomic_batch_scope, atomic_finalize, FinalizeMode}; - use console::{account::Address, network::Testnet3}; + use console::{account::Address, network::MainnetV0}; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; #[test] fn test_contains_key_sanity_check() { diff --git a/ledger/store/src/helpers/rocksdb/internal/map.rs b/ledger/store/src/helpers/rocksdb/internal/map.rs index 105d220121..558559f97d 100644 --- a/ledger/store/src/helpers/rocksdb/internal/map.rs +++ b/ledger/store/src/helpers/rocksdb/internal/map.rs @@ -538,14 +538,14 @@ mod tests { }; use console::{ account::{Address, FromStr}, - network::Testnet3, + network::MainnetV0, }; use anyhow::anyhow; use serial_test::serial; use tracing_test::traced_test; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; // Below are a few objects that mimic the way our DataMaps are organized, // in order to provide a more accurate test setup for some scenarios. diff --git a/ledger/store/src/helpers/rocksdb/internal/nested_map.rs b/ledger/store/src/helpers/rocksdb/internal/nested_map.rs index a86e64d97e..057a6acab7 100644 --- a/ledger/store/src/helpers/rocksdb/internal/nested_map.rs +++ b/ledger/store/src/helpers/rocksdb/internal/nested_map.rs @@ -763,14 +763,14 @@ mod tests { }; use console::{ account::{Address, FromStr}, - network::Testnet3, + network::MainnetV0, }; use anyhow::anyhow; use serial_test::serial; use tracing_test::traced_test; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; // Below are a few objects that mimic the way our NestedDataMaps are organized, // in order to provide a more accurate test setup for some scenarios. diff --git a/ledger/store/src/helpers/rocksdb/internal/tests.rs b/ledger/store/src/helpers/rocksdb/internal/tests.rs index d45466a256..2b59a232fc 100644 --- a/ledger/store/src/helpers/rocksdb/internal/tests.rs +++ b/ledger/store/src/helpers/rocksdb/internal/tests.rs @@ -18,7 +18,7 @@ use crate::helpers::{ MapRead, }; use console::{ - network::{Network, Testnet3}, + network::{MainnetV0, Network}, prelude::{TestRng, Uniform}, types::Scalar, }; @@ -154,7 +154,7 @@ fn test_insert_and_values() { #[test] #[serial] fn test_scalar_mul() { - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; let rng = &mut TestRng::default(); diff --git a/ledger/store/src/program/committee.rs b/ledger/store/src/program/committee.rs index aad82c6c34..3e7d70dc78 100644 --- a/ledger/store/src/program/committee.rs +++ b/ledger/store/src/program/committee.rs @@ -413,7 +413,7 @@ mod tests { use super::*; use crate::helpers::memory::CommitteeMemory; - type CurrentNetwork = console::network::Testnet3; + type CurrentNetwork = console::network::MainnetV0; #[test] fn test_insert_get_remove() { diff --git a/ledger/store/src/program/finalize.rs b/ledger/store/src/program/finalize.rs index ac99850f57..a9608ea420 100644 --- a/ledger/store/src/program/finalize.rs +++ b/ledger/store/src/program/finalize.rs @@ -769,9 +769,9 @@ impl> FinalizeStore { mod tests { use super::*; use crate::helpers::memory::FinalizeMemory; - use console::{network::Testnet3, program::Literal, types::U64}; + use console::{network::MainnetV0, program::Literal, types::U64}; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; /// Checks `initialize_mapping`, `insert_key_value`, `remove_key_value`, and `remove_mapping`. fn check_initialize_insert_remove( diff --git a/ledger/store/src/transaction/execution.rs b/ledger/store/src/transaction/execution.rs index 39c11f4c79..1ebfaa9d95 100644 --- a/ledger/store/src/transaction/execution.rs +++ b/ledger/store/src/transaction/execution.rs @@ -394,7 +394,7 @@ mod tests { use super::*; use crate::{helpers::memory::ExecutionMemory, TransitionStore}; - type CurrentNetwork = console::network::Testnet3; + type CurrentNetwork = console::network::MainnetV0; fn insert_get_remove(transaction: Transaction) -> Result<()> { let transaction_id = transaction.id(); diff --git a/ledger/test-helpers/src/lib.rs b/ledger/test-helpers/src/lib.rs index a9da8df767..7bcf84440a 100644 --- a/ledger/test-helpers/src/lib.rs +++ b/ledger/test-helpers/src/lib.rs @@ -39,7 +39,7 @@ use synthesizer_program::Program; use once_cell::sync::OnceCell; -type CurrentNetwork = console::network::Testnet3; +type CurrentNetwork = console::network::MainnetV0; type CurrentAleo = circuit::network::AleoV0; /****************************************** Transition ********************************************/ diff --git a/parameters/examples/inclusion.rs b/parameters/examples/inclusion.rs index e7d0812197..40845d8739 100644 --- a/parameters/examples/inclusion.rs +++ b/parameters/examples/inclusion.rs @@ -16,7 +16,7 @@ use snarkvm_algorithms::crypto_hash::sha256::sha256; use snarkvm_circuit::{Aleo, Assignment}; use snarkvm_console::{ account::PrivateKey, - network::{Network, Testnet3}, + network::{MainnetV0, Network}, prelude::{One, ToBytes, Zero}, program::{Plaintext, Record, StatePath}, types::Field, @@ -170,8 +170,8 @@ pub fn main() -> Result<()> { } match args[1].as_str() { - "testnet3" => { - inclusion::()?; + "mainnet" => { + inclusion::()?; } _ => panic!("Invalid network"), }; diff --git a/parameters/examples/setup.rs b/parameters/examples/setup.rs index b7c5765652..86849715fb 100644 --- a/parameters/examples/setup.rs +++ b/parameters/examples/setup.rs @@ -14,7 +14,7 @@ use snarkvm_algorithms::crypto_hash::sha256::sha256; use snarkvm_circuit::Aleo; -use snarkvm_console::network::{prelude::ToBytes, Network, Testnet3}; +use snarkvm_console::network::{prelude::ToBytes, MainnetV0, Network}; use snarkvm_synthesizer::{Process, Program}; use anyhow::Result; @@ -60,7 +60,7 @@ fn write_metadata(filename: &str, metadata: &Value) -> Result<()> { /// (Do not use) Writes the metadata files. (cargo run --release --example setup usrs) pub fn usrs() -> Result<()> { - let paths = fs::read_dir("../src/testnet3/resources/").unwrap(); + let paths = fs::read_dir("../src/mainnet/resources/").unwrap(); for path in paths { let path = path?.path(); if let Some("usrs") = path.extension().and_then(|s| s.to_str()) { @@ -149,7 +149,7 @@ pub fn main() -> Result<()> { match args[1].as_str() { "usrs" => usrs()?, - "credits" => credits_program::()?, + "credits" => credits_program::()?, _ => panic!("Invalid parameter"), }; diff --git a/parameters/scripts/testnet3/credits.sh b/parameters/scripts/mainnet/credits.sh similarity index 62% rename from parameters/scripts/testnet3/credits.sh rename to parameters/scripts/mainnet/credits.sh index df8a1a68d0..9a9526350b 100755 --- a/parameters/scripts/testnet3/credits.sh +++ b/parameters/scripts/mainnet/credits.sh @@ -4,6 +4,6 @@ cargo run --release --example setup credits -- --nocapture || exit -mv *.metadata ../../src/testnet3/resources || exit +mv *.metadata ../../src/mainnet/resources || exit mv *.prover.* ~/.aleo/resources || exit -mv *.verifier ../../src/testnet3/resources || exit +mv *.verifier ../../src/mainnet/resources || exit diff --git a/parameters/scripts/mainnet/inclusion.sh b/parameters/scripts/mainnet/inclusion.sh new file mode 100755 index 0000000000..f9f6d7797e --- /dev/null +++ b/parameters/scripts/mainnet/inclusion.sh @@ -0,0 +1,9 @@ +# Generates the inclusion proving and verifying key. + +# Inputs: network + +cargo run --release --example inclusion mainnet -- --nocapture || exit + +mv inclusion.metadata ../../src/mainnet/resources || exit +mv inclusion.prover.* ~/.aleo/resources || exit +mv inclusion.verifier ../../src/mainnet/resources || exit diff --git a/parameters/scripts/testnet3/inclusion.sh b/parameters/scripts/testnet3/inclusion.sh deleted file mode 100755 index 3472647ec5..0000000000 --- a/parameters/scripts/testnet3/inclusion.sh +++ /dev/null @@ -1,9 +0,0 @@ -# Generates the inclusion proving and verifying key. - -# Inputs: network - -cargo run --release --example inclusion testnet3 -- --nocapture || exit - -mv inclusion.metadata ../../src/testnet3/resources || exit -mv inclusion.prover.* ~/.aleo/resources || exit -mv inclusion.verifier ../../src/testnet3/resources || exit diff --git a/parameters/src/lib.rs b/parameters/src/lib.rs index 7dcf27c5f0..7959ca1b5a 100644 --- a/parameters/src/lib.rs +++ b/parameters/src/lib.rs @@ -30,7 +30,7 @@ pub mod macros; pub mod errors; pub use errors::*; -pub mod testnet3; +pub mod mainnet; pub mod prelude { pub use crate::errors::*; diff --git a/parameters/src/testnet3/genesis.rs b/parameters/src/mainnet/genesis.rs similarity index 100% rename from parameters/src/testnet3/genesis.rs rename to parameters/src/mainnet/genesis.rs diff --git a/parameters/src/testnet3/mod.rs b/parameters/src/mainnet/mod.rs similarity index 90% rename from parameters/src/testnet3/mod.rs rename to parameters/src/mainnet/mod.rs index 5233242d83..5112f329c6 100644 --- a/parameters/src/testnet3/mod.rs +++ b/parameters/src/mainnet/mod.rs @@ -115,19 +115,19 @@ macro_rules! insert_credit_keys { ($map:ident, $type:ident<$network:ident>, $variant:ident) => {{ paste::paste! { let string = stringify!([<$variant:lower>]); - $crate::insert_key!($map, string, $type<$network>, ("bond_public", $crate::testnet3::[]::load_bytes())); - $crate::insert_key!($map, string, $type<$network>, ("unbond_public", $crate::testnet3::[]::load_bytes())); - $crate::insert_key!($map, string, $type<$network>, ("unbond_delegator_as_validator", $crate::testnet3::[]::load_bytes())); - $crate::insert_key!($map, string, $type<$network>, ("claim_unbond_public", $crate::testnet3::[]::load_bytes())); - $crate::insert_key!($map, string, $type<$network>, ("set_validator_state", $crate::testnet3::[]::load_bytes())); - $crate::insert_key!($map, string, $type<$network>, ("transfer_private", $crate::testnet3::[]::load_bytes())); - $crate::insert_key!($map, string, $type<$network>, ("transfer_public", $crate::testnet3::[]::load_bytes())); - $crate::insert_key!($map, string, $type<$network>, ("transfer_private_to_public", $crate::testnet3::[]::load_bytes())); - $crate::insert_key!($map, string, $type<$network>, ("transfer_public_to_private", $crate::testnet3::[]::load_bytes())); - $crate::insert_key!($map, string, $type<$network>, ("join", $crate::testnet3::[]::load_bytes())); - $crate::insert_key!($map, string, $type<$network>, ("split", $crate::testnet3::[]::load_bytes())); - $crate::insert_key!($map, string, $type<$network>, ("fee_private", $crate::testnet3::[]::load_bytes())); - $crate::insert_key!($map, string, $type<$network>, ("fee_public", $crate::testnet3::[]::load_bytes())); + $crate::insert_key!($map, string, $type<$network>, ("bond_public", $crate::mainnet::[]::load_bytes())); + $crate::insert_key!($map, string, $type<$network>, ("unbond_public", $crate::mainnet::[]::load_bytes())); + $crate::insert_key!($map, string, $type<$network>, ("unbond_delegator_as_validator", $crate::mainnet::[]::load_bytes())); + $crate::insert_key!($map, string, $type<$network>, ("claim_unbond_public", $crate::mainnet::[]::load_bytes())); + $crate::insert_key!($map, string, $type<$network>, ("set_validator_state", $crate::mainnet::[]::load_bytes())); + $crate::insert_key!($map, string, $type<$network>, ("transfer_private", $crate::mainnet::[]::load_bytes())); + $crate::insert_key!($map, string, $type<$network>, ("transfer_public", $crate::mainnet::[]::load_bytes())); + $crate::insert_key!($map, string, $type<$network>, ("transfer_private_to_public", $crate::mainnet::[]::load_bytes())); + $crate::insert_key!($map, string, $type<$network>, ("transfer_public_to_private", $crate::mainnet::[]::load_bytes())); + $crate::insert_key!($map, string, $type<$network>, ("join", $crate::mainnet::[]::load_bytes())); + $crate::insert_key!($map, string, $type<$network>, ("split", $crate::mainnet::[]::load_bytes())); + $crate::insert_key!($map, string, $type<$network>, ("fee_private", $crate::mainnet::[]::load_bytes())); + $crate::insert_key!($map, string, $type<$network>, ("fee_public", $crate::mainnet::[]::load_bytes())); } }}; } diff --git a/parameters/src/testnet3/powers.rs b/parameters/src/mainnet/powers.rs similarity index 100% rename from parameters/src/testnet3/powers.rs rename to parameters/src/mainnet/powers.rs diff --git a/parameters/src/testnet3/resources/beta-h.metadata b/parameters/src/mainnet/resources/beta-h.metadata similarity index 100% rename from parameters/src/testnet3/resources/beta-h.metadata rename to parameters/src/mainnet/resources/beta-h.metadata diff --git a/parameters/src/testnet3/resources/beta-h.usrs b/parameters/src/mainnet/resources/beta-h.usrs similarity index 100% rename from parameters/src/testnet3/resources/beta-h.usrs rename to parameters/src/mainnet/resources/beta-h.usrs diff --git a/parameters/src/testnet3/resources/block.genesis b/parameters/src/mainnet/resources/block.genesis similarity index 100% rename from parameters/src/testnet3/resources/block.genesis rename to parameters/src/mainnet/resources/block.genesis diff --git a/parameters/src/testnet3/resources/bond_public.metadata b/parameters/src/mainnet/resources/bond_public.metadata similarity index 100% rename from parameters/src/testnet3/resources/bond_public.metadata rename to parameters/src/mainnet/resources/bond_public.metadata diff --git a/parameters/src/testnet3/resources/bond_public.verifier b/parameters/src/mainnet/resources/bond_public.verifier similarity index 100% rename from parameters/src/testnet3/resources/bond_public.verifier rename to parameters/src/mainnet/resources/bond_public.verifier diff --git a/parameters/src/testnet3/resources/claim_unbond_public.metadata b/parameters/src/mainnet/resources/claim_unbond_public.metadata similarity index 100% rename from parameters/src/testnet3/resources/claim_unbond_public.metadata rename to parameters/src/mainnet/resources/claim_unbond_public.metadata diff --git a/parameters/src/testnet3/resources/claim_unbond_public.verifier b/parameters/src/mainnet/resources/claim_unbond_public.verifier similarity index 100% rename from parameters/src/testnet3/resources/claim_unbond_public.verifier rename to parameters/src/mainnet/resources/claim_unbond_public.verifier diff --git a/parameters/src/testnet3/resources/fee_private.metadata b/parameters/src/mainnet/resources/fee_private.metadata similarity index 100% rename from parameters/src/testnet3/resources/fee_private.metadata rename to parameters/src/mainnet/resources/fee_private.metadata diff --git a/parameters/src/testnet3/resources/fee_private.verifier b/parameters/src/mainnet/resources/fee_private.verifier similarity index 100% rename from parameters/src/testnet3/resources/fee_private.verifier rename to parameters/src/mainnet/resources/fee_private.verifier diff --git a/parameters/src/testnet3/resources/fee_public.metadata b/parameters/src/mainnet/resources/fee_public.metadata similarity index 100% rename from parameters/src/testnet3/resources/fee_public.metadata rename to parameters/src/mainnet/resources/fee_public.metadata diff --git a/parameters/src/testnet3/resources/fee_public.verifier b/parameters/src/mainnet/resources/fee_public.verifier similarity index 100% rename from parameters/src/testnet3/resources/fee_public.verifier rename to parameters/src/mainnet/resources/fee_public.verifier diff --git a/parameters/src/testnet3/resources/genesis.metadata b/parameters/src/mainnet/resources/genesis.metadata similarity index 100% rename from parameters/src/testnet3/resources/genesis.metadata rename to parameters/src/mainnet/resources/genesis.metadata diff --git a/parameters/src/testnet3/resources/inclusion.metadata b/parameters/src/mainnet/resources/inclusion.metadata similarity index 100% rename from parameters/src/testnet3/resources/inclusion.metadata rename to parameters/src/mainnet/resources/inclusion.metadata diff --git a/parameters/src/testnet3/resources/inclusion.verifier b/parameters/src/mainnet/resources/inclusion.verifier similarity index 100% rename from parameters/src/testnet3/resources/inclusion.verifier rename to parameters/src/mainnet/resources/inclusion.verifier diff --git a/parameters/src/testnet3/resources/join.metadata b/parameters/src/mainnet/resources/join.metadata similarity index 100% rename from parameters/src/testnet3/resources/join.metadata rename to parameters/src/mainnet/resources/join.metadata diff --git a/parameters/src/testnet3/resources/join.verifier b/parameters/src/mainnet/resources/join.verifier similarity index 100% rename from parameters/src/testnet3/resources/join.verifier rename to parameters/src/mainnet/resources/join.verifier diff --git a/parameters/src/testnet3/resources/mint.metadata b/parameters/src/mainnet/resources/mint.metadata similarity index 100% rename from parameters/src/testnet3/resources/mint.metadata rename to parameters/src/mainnet/resources/mint.metadata diff --git a/parameters/src/testnet3/resources/neg-powers-of-beta.metadata b/parameters/src/mainnet/resources/neg-powers-of-beta.metadata similarity index 100% rename from parameters/src/testnet3/resources/neg-powers-of-beta.metadata rename to parameters/src/mainnet/resources/neg-powers-of-beta.metadata diff --git a/parameters/src/testnet3/resources/neg-powers-of-beta.usrs b/parameters/src/mainnet/resources/neg-powers-of-beta.usrs similarity index 100% rename from parameters/src/testnet3/resources/neg-powers-of-beta.usrs rename to parameters/src/mainnet/resources/neg-powers-of-beta.usrs diff --git a/parameters/src/testnet3/resources/powers-of-beta-15.metadata b/parameters/src/mainnet/resources/powers-of-beta-15.metadata similarity index 100% rename from parameters/src/testnet3/resources/powers-of-beta-15.metadata rename to parameters/src/mainnet/resources/powers-of-beta-15.metadata diff --git a/parameters/src/testnet3/resources/powers-of-beta-15.usrs b/parameters/src/mainnet/resources/powers-of-beta-15.usrs similarity index 100% rename from parameters/src/testnet3/resources/powers-of-beta-15.usrs rename to parameters/src/mainnet/resources/powers-of-beta-15.usrs diff --git a/parameters/src/testnet3/resources/powers-of-beta-16.metadata b/parameters/src/mainnet/resources/powers-of-beta-16.metadata similarity index 100% rename from parameters/src/testnet3/resources/powers-of-beta-16.metadata rename to parameters/src/mainnet/resources/powers-of-beta-16.metadata diff --git a/parameters/src/testnet3/resources/powers-of-beta-16.usrs b/parameters/src/mainnet/resources/powers-of-beta-16.usrs similarity index 100% rename from parameters/src/testnet3/resources/powers-of-beta-16.usrs rename to parameters/src/mainnet/resources/powers-of-beta-16.usrs diff --git a/parameters/src/testnet3/resources/powers-of-beta-17.metadata b/parameters/src/mainnet/resources/powers-of-beta-17.metadata similarity index 100% rename from parameters/src/testnet3/resources/powers-of-beta-17.metadata rename to parameters/src/mainnet/resources/powers-of-beta-17.metadata diff --git a/parameters/src/testnet3/resources/powers-of-beta-18.metadata b/parameters/src/mainnet/resources/powers-of-beta-18.metadata similarity index 100% rename from parameters/src/testnet3/resources/powers-of-beta-18.metadata rename to parameters/src/mainnet/resources/powers-of-beta-18.metadata diff --git a/parameters/src/testnet3/resources/powers-of-beta-19.metadata b/parameters/src/mainnet/resources/powers-of-beta-19.metadata similarity index 100% rename from parameters/src/testnet3/resources/powers-of-beta-19.metadata rename to parameters/src/mainnet/resources/powers-of-beta-19.metadata diff --git a/parameters/src/testnet3/resources/powers-of-beta-20.metadata b/parameters/src/mainnet/resources/powers-of-beta-20.metadata similarity index 100% rename from parameters/src/testnet3/resources/powers-of-beta-20.metadata rename to parameters/src/mainnet/resources/powers-of-beta-20.metadata diff --git a/parameters/src/testnet3/resources/powers-of-beta-21.metadata b/parameters/src/mainnet/resources/powers-of-beta-21.metadata similarity index 100% rename from parameters/src/testnet3/resources/powers-of-beta-21.metadata rename to parameters/src/mainnet/resources/powers-of-beta-21.metadata diff --git a/parameters/src/testnet3/resources/powers-of-beta-22.metadata b/parameters/src/mainnet/resources/powers-of-beta-22.metadata similarity index 100% rename from parameters/src/testnet3/resources/powers-of-beta-22.metadata rename to parameters/src/mainnet/resources/powers-of-beta-22.metadata diff --git a/parameters/src/testnet3/resources/powers-of-beta-23.metadata b/parameters/src/mainnet/resources/powers-of-beta-23.metadata similarity index 100% rename from parameters/src/testnet3/resources/powers-of-beta-23.metadata rename to parameters/src/mainnet/resources/powers-of-beta-23.metadata diff --git a/parameters/src/testnet3/resources/powers-of-beta-24.metadata b/parameters/src/mainnet/resources/powers-of-beta-24.metadata similarity index 100% rename from parameters/src/testnet3/resources/powers-of-beta-24.metadata rename to parameters/src/mainnet/resources/powers-of-beta-24.metadata diff --git a/parameters/src/testnet3/resources/powers-of-beta-25.metadata b/parameters/src/mainnet/resources/powers-of-beta-25.metadata similarity index 100% rename from parameters/src/testnet3/resources/powers-of-beta-25.metadata rename to parameters/src/mainnet/resources/powers-of-beta-25.metadata diff --git a/parameters/src/testnet3/resources/powers-of-beta-26.metadata b/parameters/src/mainnet/resources/powers-of-beta-26.metadata similarity index 100% rename from parameters/src/testnet3/resources/powers-of-beta-26.metadata rename to parameters/src/mainnet/resources/powers-of-beta-26.metadata diff --git a/parameters/src/testnet3/resources/powers-of-beta-27.metadata b/parameters/src/mainnet/resources/powers-of-beta-27.metadata similarity index 100% rename from parameters/src/testnet3/resources/powers-of-beta-27.metadata rename to parameters/src/mainnet/resources/powers-of-beta-27.metadata diff --git a/parameters/src/testnet3/resources/powers-of-beta-28.metadata b/parameters/src/mainnet/resources/powers-of-beta-28.metadata similarity index 100% rename from parameters/src/testnet3/resources/powers-of-beta-28.metadata rename to parameters/src/mainnet/resources/powers-of-beta-28.metadata diff --git a/parameters/src/testnet3/resources/powers-of-beta-gamma.metadata b/parameters/src/mainnet/resources/powers-of-beta-gamma.metadata similarity index 100% rename from parameters/src/testnet3/resources/powers-of-beta-gamma.metadata rename to parameters/src/mainnet/resources/powers-of-beta-gamma.metadata diff --git a/parameters/src/testnet3/resources/powers-of-beta-gamma.usrs b/parameters/src/mainnet/resources/powers-of-beta-gamma.usrs similarity index 100% rename from parameters/src/testnet3/resources/powers-of-beta-gamma.usrs rename to parameters/src/mainnet/resources/powers-of-beta-gamma.usrs diff --git a/parameters/src/testnet3/resources/set_validator_state.metadata b/parameters/src/mainnet/resources/set_validator_state.metadata similarity index 100% rename from parameters/src/testnet3/resources/set_validator_state.metadata rename to parameters/src/mainnet/resources/set_validator_state.metadata diff --git a/parameters/src/testnet3/resources/set_validator_state.verifier b/parameters/src/mainnet/resources/set_validator_state.verifier similarity index 100% rename from parameters/src/testnet3/resources/set_validator_state.verifier rename to parameters/src/mainnet/resources/set_validator_state.verifier diff --git a/parameters/src/testnet3/resources/shifted-powers-of-beta-15.metadata b/parameters/src/mainnet/resources/shifted-powers-of-beta-15.metadata similarity index 100% rename from parameters/src/testnet3/resources/shifted-powers-of-beta-15.metadata rename to parameters/src/mainnet/resources/shifted-powers-of-beta-15.metadata diff --git a/parameters/src/testnet3/resources/shifted-powers-of-beta-15.usrs b/parameters/src/mainnet/resources/shifted-powers-of-beta-15.usrs similarity index 100% rename from parameters/src/testnet3/resources/shifted-powers-of-beta-15.usrs rename to parameters/src/mainnet/resources/shifted-powers-of-beta-15.usrs diff --git a/parameters/src/testnet3/resources/shifted-powers-of-beta-16.metadata b/parameters/src/mainnet/resources/shifted-powers-of-beta-16.metadata similarity index 100% rename from parameters/src/testnet3/resources/shifted-powers-of-beta-16.metadata rename to parameters/src/mainnet/resources/shifted-powers-of-beta-16.metadata diff --git a/parameters/src/testnet3/resources/shifted-powers-of-beta-16.usrs b/parameters/src/mainnet/resources/shifted-powers-of-beta-16.usrs similarity index 100% rename from parameters/src/testnet3/resources/shifted-powers-of-beta-16.usrs rename to parameters/src/mainnet/resources/shifted-powers-of-beta-16.usrs diff --git a/parameters/src/testnet3/resources/shifted-powers-of-beta-17.metadata b/parameters/src/mainnet/resources/shifted-powers-of-beta-17.metadata similarity index 100% rename from parameters/src/testnet3/resources/shifted-powers-of-beta-17.metadata rename to parameters/src/mainnet/resources/shifted-powers-of-beta-17.metadata diff --git a/parameters/src/testnet3/resources/shifted-powers-of-beta-18.metadata b/parameters/src/mainnet/resources/shifted-powers-of-beta-18.metadata similarity index 100% rename from parameters/src/testnet3/resources/shifted-powers-of-beta-18.metadata rename to parameters/src/mainnet/resources/shifted-powers-of-beta-18.metadata diff --git a/parameters/src/testnet3/resources/shifted-powers-of-beta-19.metadata b/parameters/src/mainnet/resources/shifted-powers-of-beta-19.metadata similarity index 100% rename from parameters/src/testnet3/resources/shifted-powers-of-beta-19.metadata rename to parameters/src/mainnet/resources/shifted-powers-of-beta-19.metadata diff --git a/parameters/src/testnet3/resources/shifted-powers-of-beta-20.metadata b/parameters/src/mainnet/resources/shifted-powers-of-beta-20.metadata similarity index 100% rename from parameters/src/testnet3/resources/shifted-powers-of-beta-20.metadata rename to parameters/src/mainnet/resources/shifted-powers-of-beta-20.metadata diff --git a/parameters/src/testnet3/resources/shifted-powers-of-beta-21.metadata b/parameters/src/mainnet/resources/shifted-powers-of-beta-21.metadata similarity index 100% rename from parameters/src/testnet3/resources/shifted-powers-of-beta-21.metadata rename to parameters/src/mainnet/resources/shifted-powers-of-beta-21.metadata diff --git a/parameters/src/testnet3/resources/shifted-powers-of-beta-22.metadata b/parameters/src/mainnet/resources/shifted-powers-of-beta-22.metadata similarity index 100% rename from parameters/src/testnet3/resources/shifted-powers-of-beta-22.metadata rename to parameters/src/mainnet/resources/shifted-powers-of-beta-22.metadata diff --git a/parameters/src/testnet3/resources/shifted-powers-of-beta-23.metadata b/parameters/src/mainnet/resources/shifted-powers-of-beta-23.metadata similarity index 100% rename from parameters/src/testnet3/resources/shifted-powers-of-beta-23.metadata rename to parameters/src/mainnet/resources/shifted-powers-of-beta-23.metadata diff --git a/parameters/src/testnet3/resources/shifted-powers-of-beta-24.metadata b/parameters/src/mainnet/resources/shifted-powers-of-beta-24.metadata similarity index 100% rename from parameters/src/testnet3/resources/shifted-powers-of-beta-24.metadata rename to parameters/src/mainnet/resources/shifted-powers-of-beta-24.metadata diff --git a/parameters/src/testnet3/resources/shifted-powers-of-beta-25.metadata b/parameters/src/mainnet/resources/shifted-powers-of-beta-25.metadata similarity index 100% rename from parameters/src/testnet3/resources/shifted-powers-of-beta-25.metadata rename to parameters/src/mainnet/resources/shifted-powers-of-beta-25.metadata diff --git a/parameters/src/testnet3/resources/shifted-powers-of-beta-26.metadata b/parameters/src/mainnet/resources/shifted-powers-of-beta-26.metadata similarity index 100% rename from parameters/src/testnet3/resources/shifted-powers-of-beta-26.metadata rename to parameters/src/mainnet/resources/shifted-powers-of-beta-26.metadata diff --git a/parameters/src/testnet3/resources/shifted-powers-of-beta-27.metadata b/parameters/src/mainnet/resources/shifted-powers-of-beta-27.metadata similarity index 100% rename from parameters/src/testnet3/resources/shifted-powers-of-beta-27.metadata rename to parameters/src/mainnet/resources/shifted-powers-of-beta-27.metadata diff --git a/parameters/src/testnet3/resources/shifted-powers-of-beta-28.metadata b/parameters/src/mainnet/resources/shifted-powers-of-beta-28.metadata similarity index 100% rename from parameters/src/testnet3/resources/shifted-powers-of-beta-28.metadata rename to parameters/src/mainnet/resources/shifted-powers-of-beta-28.metadata diff --git a/parameters/src/testnet3/resources/split.metadata b/parameters/src/mainnet/resources/split.metadata similarity index 100% rename from parameters/src/testnet3/resources/split.metadata rename to parameters/src/mainnet/resources/split.metadata diff --git a/parameters/src/testnet3/resources/split.verifier b/parameters/src/mainnet/resources/split.verifier similarity index 100% rename from parameters/src/testnet3/resources/split.verifier rename to parameters/src/mainnet/resources/split.verifier diff --git a/parameters/src/testnet3/resources/transfer_private.metadata b/parameters/src/mainnet/resources/transfer_private.metadata similarity index 100% rename from parameters/src/testnet3/resources/transfer_private.metadata rename to parameters/src/mainnet/resources/transfer_private.metadata diff --git a/parameters/src/testnet3/resources/transfer_private.verifier b/parameters/src/mainnet/resources/transfer_private.verifier similarity index 100% rename from parameters/src/testnet3/resources/transfer_private.verifier rename to parameters/src/mainnet/resources/transfer_private.verifier diff --git a/parameters/src/testnet3/resources/transfer_private_to_public.metadata b/parameters/src/mainnet/resources/transfer_private_to_public.metadata similarity index 100% rename from parameters/src/testnet3/resources/transfer_private_to_public.metadata rename to parameters/src/mainnet/resources/transfer_private_to_public.metadata diff --git a/parameters/src/testnet3/resources/transfer_private_to_public.verifier b/parameters/src/mainnet/resources/transfer_private_to_public.verifier similarity index 100% rename from parameters/src/testnet3/resources/transfer_private_to_public.verifier rename to parameters/src/mainnet/resources/transfer_private_to_public.verifier diff --git a/parameters/src/testnet3/resources/transfer_public.metadata b/parameters/src/mainnet/resources/transfer_public.metadata similarity index 100% rename from parameters/src/testnet3/resources/transfer_public.metadata rename to parameters/src/mainnet/resources/transfer_public.metadata diff --git a/parameters/src/testnet3/resources/transfer_public.verifier b/parameters/src/mainnet/resources/transfer_public.verifier similarity index 100% rename from parameters/src/testnet3/resources/transfer_public.verifier rename to parameters/src/mainnet/resources/transfer_public.verifier diff --git a/parameters/src/testnet3/resources/transfer_public_to_private.metadata b/parameters/src/mainnet/resources/transfer_public_to_private.metadata similarity index 100% rename from parameters/src/testnet3/resources/transfer_public_to_private.metadata rename to parameters/src/mainnet/resources/transfer_public_to_private.metadata diff --git a/parameters/src/testnet3/resources/transfer_public_to_private.verifier b/parameters/src/mainnet/resources/transfer_public_to_private.verifier similarity index 100% rename from parameters/src/testnet3/resources/transfer_public_to_private.verifier rename to parameters/src/mainnet/resources/transfer_public_to_private.verifier diff --git a/parameters/src/testnet3/resources/unbond_delegator_as_validator.metadata b/parameters/src/mainnet/resources/unbond_delegator_as_validator.metadata similarity index 100% rename from parameters/src/testnet3/resources/unbond_delegator_as_validator.metadata rename to parameters/src/mainnet/resources/unbond_delegator_as_validator.metadata diff --git a/parameters/src/testnet3/resources/unbond_delegator_as_validator.verifier b/parameters/src/mainnet/resources/unbond_delegator_as_validator.verifier similarity index 100% rename from parameters/src/testnet3/resources/unbond_delegator_as_validator.verifier rename to parameters/src/mainnet/resources/unbond_delegator_as_validator.verifier diff --git a/parameters/src/testnet3/resources/unbond_public.metadata b/parameters/src/mainnet/resources/unbond_public.metadata similarity index 100% rename from parameters/src/testnet3/resources/unbond_public.metadata rename to parameters/src/mainnet/resources/unbond_public.metadata diff --git a/parameters/src/testnet3/resources/unbond_public.verifier b/parameters/src/mainnet/resources/unbond_public.verifier similarity index 100% rename from parameters/src/testnet3/resources/unbond_public.verifier rename to parameters/src/mainnet/resources/unbond_public.verifier diff --git a/synthesizer/benches/kary_merkle_tree.rs b/synthesizer/benches/kary_merkle_tree.rs index 8a79e27201..3b41f8a460 100644 --- a/synthesizer/benches/kary_merkle_tree.rs +++ b/synthesizer/benches/kary_merkle_tree.rs @@ -21,7 +21,7 @@ use console::{ collections::kary_merkle_tree::KaryMerkleTree, network::{ prelude::{TestRng, ToBits, Uniform}, - Testnet3, + MainnetV0, }, types::Field, }; @@ -29,7 +29,7 @@ use synthesizer_snark::{ProvingKey, UniversalSRS}; use criterion::Criterion; -type CurrentNetwork = Testnet3; +type CurrentNetwork = MainnetV0; type CurrentAleo = AleoV0; type NativePathHasher = Sha3_256; @@ -42,7 +42,7 @@ const ARITY: u8 = 8; /// Generates the specified number of random Merkle tree leaves. macro_rules! generate_leaves { - ($num_leaves:expr, $rng:expr) => {{ (0..$num_leaves).map(|_| Field::::rand($rng).to_bits_le()).collect::>() }}; + ($num_leaves:expr, $rng:expr) => {{ (0..$num_leaves).map(|_| Field::::rand($rng).to_bits_le()).collect::>() }}; } fn batch_prove(c: &mut Criterion) { diff --git a/synthesizer/process/src/execute.rs b/synthesizer/process/src/execute.rs index 46b3db0363..5340eb402c 100644 --- a/synthesizer/process/src/execute.rs +++ b/synthesizer/process/src/execute.rs @@ -63,7 +63,7 @@ mod tests { use super::*; use console::types::Address; - type CurrentNetwork = console::network::Testnet3; + type CurrentNetwork = console::network::MainnetV0; type CurrentAleo = circuit::AleoV0; #[test] diff --git a/synthesizer/process/src/finalize.rs b/synthesizer/process/src/finalize.rs index 974ed1e158..ee1c28906f 100644 --- a/synthesizer/process/src/finalize.rs +++ b/synthesizer/process/src/finalize.rs @@ -448,7 +448,7 @@ mod tests { BlockStore, }; - type CurrentNetwork = console::network::Testnet3; + type CurrentNetwork = console::network::MainnetV0; type CurrentAleo = circuit::network::AleoV0; #[test] diff --git a/synthesizer/process/src/lib.rs b/synthesizer/process/src/lib.rs index 866130a523..53953ecad6 100644 --- a/synthesizer/process/src/lib.rs +++ b/synthesizer/process/src/lib.rs @@ -283,7 +283,7 @@ impl Process { #[cfg(any(test, feature = "test"))] pub mod test_helpers { use super::*; - use console::{account::PrivateKey, network::Testnet3, program::Identifier}; + use console::{account::PrivateKey, network::MainnetV0, program::Identifier}; use ledger_block::Transition; use ledger_query::Query; use ledger_store::{helpers::memory::BlockMemory, BlockStore}; @@ -291,7 +291,7 @@ pub mod test_helpers { use once_cell::sync::OnceCell; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; type CurrentAleo = circuit::network::AleoV0; pub fn sample_key() -> (Identifier, ProvingKey, VerifyingKey) { diff --git a/synthesizer/process/src/stack/authorization/mod.rs b/synthesizer/process/src/stack/authorization/mod.rs index 6a510f3814..89637fb8d8 100644 --- a/synthesizer/process/src/stack/authorization/mod.rs +++ b/synthesizer/process/src/stack/authorization/mod.rs @@ -254,7 +254,7 @@ pub(crate) mod test_helpers { use crate::Process; use console::account::PrivateKey; - type CurrentNetwork = console::network::Testnet3; + type CurrentNetwork = console::network::MainnetV0; type CurrentAleo = circuit::AleoV0; /// Returns a sample authorization. diff --git a/synthesizer/process/src/tests/test_credits.rs b/synthesizer/process/src/tests/test_credits.rs index d18259e6cb..201a9a7313 100644 --- a/synthesizer/process/src/tests/test_credits.rs +++ b/synthesizer/process/src/tests/test_credits.rs @@ -16,7 +16,7 @@ use crate::Process; use circuit::network::AleoV0; use console::{ account::{Address, PrivateKey}, - network::{prelude::*, Testnet3}, + network::{prelude::*, MainnetV0}, program::{Identifier, Literal, Plaintext, ProgramID, Value}, types::U64, }; @@ -34,7 +34,7 @@ use synthesizer_program::{FinalizeGlobalState, FinalizeStoreTrait, Program}; use indexmap::IndexMap; -type CurrentNetwork = Testnet3; +type CurrentNetwork = MainnetV0; type CurrentAleo = AleoV0; const NUM_BLOCKS_TO_UNLOCK: u32 = 360; diff --git a/synthesizer/process/src/tests/test_execute.rs b/synthesizer/process/src/tests/test_execute.rs index 1d182315e3..61b80a33ff 100644 --- a/synthesizer/process/src/tests/test_execute.rs +++ b/synthesizer/process/src/tests/test_execute.rs @@ -21,7 +21,7 @@ use crate::{ use circuit::{network::AleoV0, Aleo}; use console::{ account::{Address, PrivateKey, ViewKey}, - network::{prelude::*, Testnet3}, + network::{prelude::*, MainnetV0}, program::{Identifier, Literal, Plaintext, ProgramID, Record, Value}, types::{Field, U64}, }; @@ -41,7 +41,7 @@ use indexmap::IndexMap; use parking_lot::RwLock; use std::sync::Arc; -type CurrentNetwork = Testnet3; +type CurrentNetwork = MainnetV0; type CurrentAleo = AleoV0; /// Samples a new finalize state. @@ -1926,7 +1926,7 @@ function a: // Construct the expected transition order. let expected_order = [ - (program0.id(), Identifier::::from_str("c").unwrap()), + (program0.id(), Identifier::::from_str("c").unwrap()), (program1.id(), Identifier::from_str("b").unwrap()), (program2.id(), Identifier::from_str("a").unwrap()), ]; @@ -2108,16 +2108,16 @@ fn test_complex_execution_order() { // Construct the expected execution order. let expected_order = [ - (program0.id(), Identifier::::from_str("c").unwrap()), - (program1.id(), Identifier::::from_str("d").unwrap()), - (program2.id(), Identifier::::from_str("b").unwrap()), - (program0.id(), Identifier::::from_str("c").unwrap()), - (program1.id(), Identifier::::from_str("d").unwrap()), - (program2.id(), Identifier::::from_str("b").unwrap()), - (program1.id(), Identifier::::from_str("d").unwrap()), - (program0.id(), Identifier::::from_str("c").unwrap()), - (program3.id(), Identifier::::from_str("e").unwrap()), - (program4.id(), Identifier::::from_str("a").unwrap()), + (program0.id(), Identifier::::from_str("c").unwrap()), + (program1.id(), Identifier::::from_str("d").unwrap()), + (program2.id(), Identifier::::from_str("b").unwrap()), + (program0.id(), Identifier::::from_str("c").unwrap()), + (program1.id(), Identifier::::from_str("d").unwrap()), + (program2.id(), Identifier::::from_str("b").unwrap()), + (program1.id(), Identifier::::from_str("d").unwrap()), + (program0.id(), Identifier::::from_str("c").unwrap()), + (program3.id(), Identifier::::from_str("e").unwrap()), + (program4.id(), Identifier::::from_str("a").unwrap()), ]; for (transition, (expected_program_id, expected_function_name)) in trace.transitions().iter().zip_eq(expected_order.iter()) diff --git a/synthesizer/program/benches/instruction.rs b/synthesizer/program/benches/instruction.rs index 7940c49261..fcf76c4e44 100644 --- a/synthesizer/program/benches/instruction.rs +++ b/synthesizer/program/benches/instruction.rs @@ -18,7 +18,7 @@ // extern crate criterion; // // use console::{ -// network::{Testnet3, Network}, +// network::{MainnetV0, Network}, // prelude::{TestRng, Uniform, Zero}, // program::{ // Identifier, @@ -62,10 +62,10 @@ // // /// A helper function to construct a set of `FinalizeRegisters` with the given arguments. // fn setup_finalize_registers( -// stack: &Stack, +// stack: &Stack, // finalize_body: impl Display, -// args: &[Value], -// ) -> FinalizeRegisters { +// args: &[Value], +// ) -> FinalizeRegisters { // // Initialize a `Finalize` block with the benchmark arguments as inputs. // let mut finalize_string = "finalize foo:".to_string(); // for (i, arg) in args.iter().enumerate() { @@ -75,11 +75,11 @@ // })); // } // finalize_string.push_str(&finalize_body.to_string()); -// let finalize = Finalize::::from_str(&finalize_string).unwrap(); +// let finalize = Finalize::::from_str(&finalize_string).unwrap(); // // Construct the finalize state. -// let state = FinalizeGlobalState::new::(0, 0, 0, 0, ::BlockHash::default()).unwrap(); +// let state = FinalizeGlobalState::new::(0, 0, 0, 0, ::BlockHash::default()).unwrap(); // // Initialize a fresh set of finalize registers. -// let mut registers = FinalizeRegisters::new(state, ::TransitionID::default(), Identifier::from_str("test").unwrap(), FinalizeTypes::from_finalize(stack, &finalize).unwrap()); +// let mut registers = FinalizeRegisters::new(state, ::TransitionID::default(), Identifier::from_str("test").unwrap(), FinalizeTypes::from_finalize(stack, &finalize).unwrap()); // // Add the arguments into the registers. // for (i, arg) in args.iter().enumerate() { // registers.store(stack, &Register::Locator(i as u64), arg.clone()).unwrap(); @@ -92,7 +92,7 @@ // // Initialize an RNG. // let rng = &mut TestRng::default(); // // Initialize a process. -// let process = Process::::load().unwrap(); +// let process = Process::::load().unwrap(); // // Get the stack for the credits program. // // Note that this is not used for anything other than to satisfy the function signature for `finalize`. // // This is because `Stack`s are only used in finalize contexts to check that structs are well-formed. @@ -104,7 +104,7 @@ // { // use snarkvm_synthesizer_program::$instruction; // let name = concat!(stringify!($instruction), "/", stringify!($input)); -// let instruction = Instruction::::$instruction($instruction::from_str(&format!("{} r0 into r1", $instruction::::opcode().to_string())).unwrap()); +// let instruction = Instruction::::$instruction($instruction::from_str(&format!("{} r0 into r1", $instruction::::opcode().to_string())).unwrap()); // c.bench_function(&format!("{name}/instruction"), |b| { // b.iter_batched( // || { @@ -122,7 +122,7 @@ // { // use snarkvm_synthesizer_program::$instruction; // let name = concat!(stringify!($instruction), "/", stringify!($input)); -// let instruction = Instruction::::$instruction($instruction::from_str(&format!("{} r0 into r1 as {}", $instruction::::opcode().to_string(), $as_type)).unwrap()); +// let instruction = Instruction::::$instruction($instruction::from_str(&format!("{} r0 into r1 as {}", $instruction::::opcode().to_string(), $as_type)).unwrap()); // c.bench_function(&format!("{name}/instruction"), |b| { // b.iter_batched( // || { @@ -140,7 +140,7 @@ // { // use snarkvm_synthesizer_program::$instruction; // let name = concat!(stringify!($instruction), "/", stringify!($input_a), "_", stringify!($input_b)); -// let instruction = Instruction::::$instruction($instruction::from_str(&format!("{} r0 r1 into r2", $instruction::::opcode().to_string())).unwrap()); +// let instruction = Instruction::::$instruction($instruction::from_str(&format!("{} r0 r1 into r2", $instruction::::opcode().to_string())).unwrap()); // c.bench_function(&format!("{name}/instruction"), |b| { // b.iter_batched( // || { @@ -158,7 +158,7 @@ // { // use snarkvm_synthesizer_program::$instruction; // let name = concat!(stringify!($instruction), "/", stringify!($input_a), "_", stringify!($input_b), "_", stringify!($input_c)); -// let instruction = Instruction::::$instruction($instruction::from_str(&format!("{} r0 r1 r2 into r3", $instruction::::opcode().to_string())).unwrap()); +// let instruction = Instruction::::$instruction($instruction::from_str(&format!("{} r0 r1 r2 into r3", $instruction::::opcode().to_string())).unwrap()); // c.bench_function(&format!("{name}/instruction"), |b| { // b.iter_batched( // || { @@ -179,7 +179,7 @@ // $({ // // Define the default sampling method. // let mut samples = iter::repeat_with(|| { -// let mut arg: $input:: = Uniform::rand(rng); +// let mut arg: $input:: = Uniform::rand(rng); // while (std::panic::catch_unwind(|| arg.$operation())).is_err() { // arg = Uniform::rand(rng); // } @@ -203,7 +203,7 @@ // $({ // // Define the default sampling method. // let mut samples = iter::repeat_with(|| { -// let mut arg: $input:: = Uniform::rand(rng); +// let mut arg: $input:: = Uniform::rand(rng); // while (std::panic::catch_unwind(|| arg.$operation().unwrap())).is_err() { // arg = Uniform::rand(rng); // } @@ -227,8 +227,8 @@ // $({ // // Define the default sampling method. // let mut samples = iter::repeat_with(|| { -// let mut first: $input_a:: = Uniform::rand(rng); -// let mut second: $input_b:: = Uniform::rand(rng); +// let mut first: $input_a:: = Uniform::rand(rng); +// let mut second: $input_b:: = Uniform::rand(rng); // while (std::panic::catch_unwind(|| first.$operation(&second))).is_err() { // first = Uniform::rand(rng); // second = Uniform::rand(rng); @@ -252,9 +252,9 @@ // ($operation:tt, $instruction:ident { $( ($input_a:ident, $input_b:ident, $input_c:ident), )+ }) => { // $({ // let mut samples = iter::repeat_with(|| { -// let mut first: $input_a:: = Uniform::rand(rng); -// let mut second: $input_b:: = Uniform::rand(rng); -// let mut third: $input_c:: = Uniform::rand(rng); +// let mut first: $input_a:: = Uniform::rand(rng); +// let mut second: $input_b:: = Uniform::rand(rng); +// let mut third: $input_c:: = Uniform::rand(rng); // while (std::panic::catch_unwind(|| $input_b::ternary(&first, &second, &third))).is_err() { // first = Uniform::rand(rng); // second = Uniform::rand(rng); @@ -314,13 +314,13 @@ // macro_rules! bench_assert { // ($typ:tt) => { // let mut samples = iter::repeat_with(|| { -// let result = $typ::::rand(rng); +// let result = $typ::::rand(rng); // (result.clone(), result) // }); // { // use snarkvm_synthesizer_program::AssertEq; // let name = concat!("AssertEq/", stringify!($typ), "_", stringify!($typ)); -// let instruction = Instruction::::AssertEq(AssertEq::from_str(&format!("{} r0 r1", AssertEq::::opcode().to_string())).unwrap()); +// let instruction = Instruction::::AssertEq(AssertEq::from_str(&format!("{} r0 r1", AssertEq::::opcode().to_string())).unwrap()); // c.bench_function(&format!("{name}/instruction"), |b| { // b.iter_batched( // || { @@ -333,17 +333,17 @@ // }); // }; // let mut samples = iter::repeat_with(|| { -// let first = $typ::::rand(rng); -// let mut second = $typ::::rand(rng); +// let first = $typ::::rand(rng); +// let mut second = $typ::::rand(rng); // while first == second { -// second = $typ::::rand(rng); +// second = $typ::::rand(rng); // } // (first, second) // }); // { // use snarkvm_synthesizer_program::AssertNeq; // let name = concat!("AssertNeq/", stringify!($typ), "_", stringify!($typ)); -// let instruction = Instruction::::AssertNeq(AssertNeq::from_str(&format!("{} r0 r1", AssertNeq::::opcode().to_string())).unwrap()); +// let instruction = Instruction::::AssertNeq(AssertNeq::from_str(&format!("{} r0 r1", AssertNeq::::opcode().to_string())).unwrap()); // c.bench_function(&format!("{name}/instruction"), |b| { // b.iter_batched( // || { @@ -390,19 +390,19 @@ // // macro_rules! bench_ped64_commit_instruction { // ($instruction:tt) => { -// let mut samples = iter::repeat_with(|| { (Boolean::::rand(rng), Scalar::::rand(rng)) }); +// let mut samples = iter::repeat_with(|| { (Boolean::::rand(rng), Scalar::::rand(rng)) }); // bench_instruction!(samples, $instruction { (Boolean, Scalar), }); -// let mut samples = iter::repeat_with(|| { (I8::::rand(rng), Scalar::::rand(rng)) }); +// let mut samples = iter::repeat_with(|| { (I8::::rand(rng), Scalar::::rand(rng)) }); // bench_instruction!(samples, $instruction { (I8, Scalar), }); -// let mut samples = iter::repeat_with(|| { (I16::::rand(rng), Scalar::::rand(rng)) }); +// let mut samples = iter::repeat_with(|| { (I16::::rand(rng), Scalar::::rand(rng)) }); // bench_instruction!(samples, $instruction { (I16, Scalar), }); -// let mut samples = iter::repeat_with(|| { (I32::::rand(rng), Scalar::::rand(rng)) }); +// let mut samples = iter::repeat_with(|| { (I32::::rand(rng), Scalar::::rand(rng)) }); // bench_instruction!(samples, $instruction { (I32, Scalar), }); -// let mut samples = iter::repeat_with(|| { (U8::::rand(rng), Scalar::::rand(rng)) }); +// let mut samples = iter::repeat_with(|| { (U8::::rand(rng), Scalar::::rand(rng)) }); // bench_instruction!(samples, $instruction { (U8, Scalar), }); -// let mut samples = iter::repeat_with(|| { (U16::::rand(rng), Scalar::::rand(rng)) }); +// let mut samples = iter::repeat_with(|| { (U16::::rand(rng), Scalar::::rand(rng)) }); // bench_instruction!(samples, $instruction { (U16, Scalar), }); -// let mut samples = iter::repeat_with(|| { (U32::::rand(rng), Scalar::::rand(rng)) }); +// let mut samples = iter::repeat_with(|| { (U32::::rand(rng), Scalar::::rand(rng)) }); // bench_instruction!(samples, $instruction { (U32, Scalar), }); // } // } @@ -410,19 +410,19 @@ // macro_rules! bench_commit_instruction { // ($instruction:tt) => { // bench_ped64_commit_instruction!($instruction); -// let mut samples = iter::repeat_with(|| { (Field::::rand(rng), Scalar::::rand(rng)) }); +// let mut samples = iter::repeat_with(|| { (Field::::rand(rng), Scalar::::rand(rng)) }); // bench_instruction!(samples, $instruction { (Field, Scalar), }); -// let mut samples = iter::repeat_with(|| { (Group::::rand(rng), Scalar::::rand(rng)) }); +// let mut samples = iter::repeat_with(|| { (Group::::rand(rng), Scalar::::rand(rng)) }); // bench_instruction!(samples, $instruction { (Group, Scalar), }); -// let mut samples = iter::repeat_with(|| { (I64::::rand(rng), Scalar::::rand(rng)) }); +// let mut samples = iter::repeat_with(|| { (I64::::rand(rng), Scalar::::rand(rng)) }); // bench_instruction!(samples, $instruction { (I64, Scalar), }); -// let mut samples = iter::repeat_with(|| { (I128::::rand(rng), Scalar::::rand(rng)) }); +// let mut samples = iter::repeat_with(|| { (I128::::rand(rng), Scalar::::rand(rng)) }); // bench_instruction!(samples, $instruction { (I128, Scalar), }); -// let mut samples = iter::repeat_with(|| { (U64::::rand(rng), Scalar::::rand(rng)) }); +// let mut samples = iter::repeat_with(|| { (U64::::rand(rng), Scalar::::rand(rng)) }); // bench_instruction!(samples, $instruction { (U64, Scalar), }); -// let mut samples = iter::repeat_with(|| { (U128::::rand(rng), Scalar::::rand(rng)) }); +// let mut samples = iter::repeat_with(|| { (U128::::rand(rng), Scalar::::rand(rng)) }); // bench_instruction!(samples, $instruction { (U128, Scalar), }); -// let mut samples = iter::repeat_with(|| { (Scalar::::rand(rng), Scalar::::rand(rng)) }); +// let mut samples = iter::repeat_with(|| { (Scalar::::rand(rng), Scalar::::rand(rng)) }); // bench_instruction!(samples, $instruction { (Scalar, Scalar), }); // } // } @@ -435,9 +435,9 @@ // bench_ped64_commit_instruction!(CommitPED64); // // bench_ped64_commit_instruction!(CommitPED128); -// let mut samples = iter::repeat_with(|| { (I64::::rand(rng), Scalar::::rand(rng)) }); +// let mut samples = iter::repeat_with(|| { (I64::::rand(rng), Scalar::::rand(rng)) }); // bench_instruction!(samples, CommitPED128 { (I64, Scalar), }); -// let mut samples = iter::repeat_with(|| { (U64::::rand(rng), Scalar::::rand(rng)) }); +// let mut samples = iter::repeat_with(|| { (U64::::rand(rng), Scalar::::rand(rng)) }); // bench_instruction!(samples, CommitPED128 { (U64, Scalar), }); // // use console::prelude::Div; @@ -505,19 +505,19 @@ // // macro_rules! bench_ped64_hash_instruction { // ($instruction:tt) => { -// let mut samples = iter::repeat_with(|| { Boolean::::rand(rng) }); +// let mut samples = iter::repeat_with(|| { Boolean::::rand(rng) }); // bench_instruction!(samples, $instruction { Boolean, }, "group"); -// let mut samples = iter::repeat_with(|| { I8::::rand(rng) }); +// let mut samples = iter::repeat_with(|| { I8::::rand(rng) }); // bench_instruction!(samples, $instruction { I8, }, "group"); -// let mut samples = iter::repeat_with(|| { I16::::rand(rng) }); +// let mut samples = iter::repeat_with(|| { I16::::rand(rng) }); // bench_instruction!(samples, $instruction { I16, }, "group"); -// let mut samples = iter::repeat_with(|| { I32::::rand(rng) }); +// let mut samples = iter::repeat_with(|| { I32::::rand(rng) }); // bench_instruction!(samples, $instruction { I32, }, "group"); -// let mut samples = iter::repeat_with(|| { U8::::rand(rng) }); +// let mut samples = iter::repeat_with(|| { U8::::rand(rng) }); // bench_instruction!(samples, $instruction { U8, }, "group"); -// let mut samples = iter::repeat_with(|| { U16::::rand(rng) }); +// let mut samples = iter::repeat_with(|| { U16::::rand(rng) }); // bench_instruction!(samples, $instruction { U16, }, "group"); -// let mut samples = iter::repeat_with(|| { U32::::rand(rng) }); +// let mut samples = iter::repeat_with(|| { U32::::rand(rng) }); // bench_instruction!(samples, $instruction { U32, }, "group"); // } // } @@ -525,19 +525,19 @@ // macro_rules! bench_hash_instruction { // ($instruction:tt) => { // bench_ped64_hash_instruction!($instruction); -// let mut samples = iter::repeat_with(|| { Field::::rand(rng) }); +// let mut samples = iter::repeat_with(|| { Field::::rand(rng) }); // bench_instruction!(samples, $instruction { Field, }, "group"); -// let mut samples = iter::repeat_with(|| { Group::::rand(rng) }); +// let mut samples = iter::repeat_with(|| { Group::::rand(rng) }); // bench_instruction!(samples, $instruction { Group, }, "group"); -// let mut samples = iter::repeat_with(|| { I64::::rand(rng) }); +// let mut samples = iter::repeat_with(|| { I64::::rand(rng) }); // bench_instruction!(samples, $instruction { I64, }, "group"); -// let mut samples = iter::repeat_with(|| { I128::::rand(rng) }); +// let mut samples = iter::repeat_with(|| { I128::::rand(rng) }); // bench_instruction!(samples, $instruction { I128, }, "group"); -// let mut samples = iter::repeat_with(|| { U64::::rand(rng) }); +// let mut samples = iter::repeat_with(|| { U64::::rand(rng) }); // bench_instruction!(samples, $instruction { U64, }, "group"); -// let mut samples = iter::repeat_with(|| { U128::::rand(rng) }); +// let mut samples = iter::repeat_with(|| { U128::::rand(rng) }); // bench_instruction!(samples, $instruction { U128, }, "group"); -// let mut samples = iter::repeat_with(|| { Scalar::::rand(rng) }); +// let mut samples = iter::repeat_with(|| { Scalar::::rand(rng) }); // bench_instruction!(samples, $instruction { Scalar, }, "group"); // } // } @@ -550,9 +550,9 @@ // bench_ped64_hash_instruction!(HashPED64); // // bench_ped64_hash_instruction!(HashPED128); -// let mut samples = iter::repeat_with(|| { I64::::rand(rng) }); +// let mut samples = iter::repeat_with(|| { I64::::rand(rng) }); // bench_instruction!(samples, HashPED128 { I64, }, "group"); -// let mut samples = iter::repeat_with(|| { U64::::rand(rng) }); +// let mut samples = iter::repeat_with(|| { U64::::rand(rng) }); // bench_instruction!(samples, HashPED128 { U64, }, "group"); // // bench_hash_instruction!(HashPSD2); @@ -562,46 +562,46 @@ // use console::prelude::Inverse; // bench_instruction_with_default!(inverse?, Inv { Field, }); // -// let mut samples = iter::repeat_with(|| { (Boolean::::rand(rng), Boolean::::rand(rng)) }); +// let mut samples = iter::repeat_with(|| { (Boolean::::rand(rng), Boolean::::rand(rng)) }); // bench_instruction!(samples, IsEq { (Boolean, Boolean), }); // bench_instruction!(samples, IsNeq { (Boolean, Boolean), }); -// let mut samples = iter::repeat_with(|| { (Field::::rand(rng), Field::::rand(rng)) }); +// let mut samples = iter::repeat_with(|| { (Field::::rand(rng), Field::::rand(rng)) }); // bench_instruction!(samples, IsEq { (Field, Field), }); // bench_instruction!(samples, IsNeq { (Field, Field), }); -// let mut samples = iter::repeat_with(|| { (Group::::rand(rng), Group::::rand(rng)) }); +// let mut samples = iter::repeat_with(|| { (Group::::rand(rng), Group::::rand(rng)) }); // bench_instruction!(samples, IsEq { (Group, Group), }); // bench_instruction!(samples, IsNeq { (Group, Group), }); -// let mut samples = iter::repeat_with(|| { (I8::::rand(rng), I8::::rand(rng)) }); +// let mut samples = iter::repeat_with(|| { (I8::::rand(rng), I8::::rand(rng)) }); // bench_instruction!(samples, IsEq { (I8, I8), }); // bench_instruction!(samples, IsNeq { (I8, I8), }); -// let mut samples = iter::repeat_with(|| { (I16::::rand(rng), I16::::rand(rng)) }); +// let mut samples = iter::repeat_with(|| { (I16::::rand(rng), I16::::rand(rng)) }); // bench_instruction!(samples, IsEq { (I16, I16), }); // bench_instruction!(samples, IsNeq { (I16, I16), }); -// let mut samples = iter::repeat_with(|| { (I32::::rand(rng), I32::::rand(rng)) }); +// let mut samples = iter::repeat_with(|| { (I32::::rand(rng), I32::::rand(rng)) }); // bench_instruction!(samples, IsEq { (I32, I32), }); // bench_instruction!(samples, IsNeq { (I32, I32), }); -// let mut samples = iter::repeat_with(|| { (I64::::rand(rng), I64::::rand(rng)) }); +// let mut samples = iter::repeat_with(|| { (I64::::rand(rng), I64::::rand(rng)) }); // bench_instruction!(samples, IsEq { (I64, I64), }); // bench_instruction!(samples, IsNeq { (I64, I64), }); -// let mut samples = iter::repeat_with(|| { (I128::::rand(rng), I128::::rand(rng)) }); +// let mut samples = iter::repeat_with(|| { (I128::::rand(rng), I128::::rand(rng)) }); // bench_instruction!(samples, IsEq { (I128, I128), }); // bench_instruction!(samples, IsNeq { (I128, I128), }); -// let mut samples = iter::repeat_with(|| { (Scalar::::rand(rng), Scalar::::rand(rng)) }); +// let mut samples = iter::repeat_with(|| { (Scalar::::rand(rng), Scalar::::rand(rng)) }); // bench_instruction!(samples, IsEq { (Scalar, Scalar), }); // bench_instruction!(samples, IsNeq { (Scalar, Scalar), }); -// let mut samples = iter::repeat_with(|| { (U8::::rand(rng), U8::::rand(rng)) }); +// let mut samples = iter::repeat_with(|| { (U8::::rand(rng), U8::::rand(rng)) }); // bench_instruction!(samples, IsEq { (U8, U8), }); // bench_instruction!(samples, IsNeq { (U8, U8), }); -// let mut samples = iter::repeat_with(|| { (U16::::rand(rng), U16::::rand(rng)) }); +// let mut samples = iter::repeat_with(|| { (U16::::rand(rng), U16::::rand(rng)) }); // bench_instruction!(samples, IsEq { (U16, U16), }); // bench_instruction!(samples, IsNeq { (U16, U16), }); -// let mut samples = iter::repeat_with(|| { (U32::::rand(rng), U32::::rand(rng)) }); +// let mut samples = iter::repeat_with(|| { (U32::::rand(rng), U32::::rand(rng)) }); // bench_instruction!(samples, IsEq { (U32, U32), }); // bench_instruction!(samples, IsNeq { (U32, U32), }); -// let mut samples = iter::repeat_with(|| { (U64::::rand(rng), U64::::rand(rng)) }); +// let mut samples = iter::repeat_with(|| { (U64::::rand(rng), U64::::rand(rng)) }); // bench_instruction!(samples, IsEq { (U64, U64), }); // bench_instruction!(samples, IsNeq { (U64, U64), }); -// let mut samples = iter::repeat_with(|| { (U128::::rand(rng), U128::::rand(rng)) }); +// let mut samples = iter::repeat_with(|| { (U128::::rand(rng), U128::::rand(rng)) }); // bench_instruction!(samples, IsEq { (U128, U128), }); // bench_instruction!(samples, IsNeq { (U128, U128), }); // @@ -651,25 +651,25 @@ // (Scalar, Group), // }); // // Use a custom sampling method for integer multiplication, since there is a high chance of overflow. -// let mut samples = iter::repeat((I8::::zero(), I8::::zero())); +// let mut samples = iter::repeat((I8::::zero(), I8::::zero())); // bench_instruction!(samples, Mul { (I8, I8), }); -// let mut samples = iter::repeat((I16::::zero(), I16::::zero())); +// let mut samples = iter::repeat((I16::::zero(), I16::::zero())); // bench_instruction!(samples, Mul { (I16, I16), }); -// let mut samples = iter::repeat((I32::::zero(), I32::::zero())); +// let mut samples = iter::repeat((I32::::zero(), I32::::zero())); // bench_instruction!(samples, Mul { (I32, I32), }); -// let mut samples = iter::repeat((I64::::zero(), I64::::zero())); +// let mut samples = iter::repeat((I64::::zero(), I64::::zero())); // bench_instruction!(samples, Mul { (I64, I64), }); -// let mut samples = iter::repeat((I128::::zero(), I128::::zero())); +// let mut samples = iter::repeat((I128::::zero(), I128::::zero())); // bench_instruction!(samples, Mul { (I128, I128), }); -// let mut samples = iter::repeat((U8::::zero(), U8::::zero())); +// let mut samples = iter::repeat((U8::::zero(), U8::::zero())); // bench_instruction!(samples, Mul { (U8, U8), }); -// let mut samples = iter::repeat((U16::::zero(), U16::::zero())); +// let mut samples = iter::repeat((U16::::zero(), U16::::zero())); // bench_instruction!(samples, Mul { (U16, U16), }); -// let mut samples = iter::repeat((U32::::zero(), U32::::zero())); +// let mut samples = iter::repeat((U32::::zero(), U32::::zero())); // bench_instruction!(samples, Mul { (U32, U32), }); -// let mut samples = iter::repeat((U64::::zero(), U64::::zero())); +// let mut samples = iter::repeat((U64::::zero(), U64::::zero())); // bench_instruction!(samples, Mul { (U64, U64), }); -// let mut samples = iter::repeat((U128::::zero(), U128::::zero())); +// let mut samples = iter::repeat((U128::::zero(), U128::::zero())); // bench_instruction!(samples, Mul { (U128, U128), }); // // use console::prelude::MulWrapped; @@ -721,65 +721,65 @@ // (Field, Field), // }); // // Use a custom sampling method for integer exponentiation, since there is a high chance of overflow. -// let mut samples = iter::repeat((I8::::zero(), U8::::zero())); +// let mut samples = iter::repeat((I8::::zero(), U8::::zero())); // bench_instruction!(samples, Pow { (I8, U8), }); -// let mut samples = iter::repeat((I8::::zero(), U16::::zero())); +// let mut samples = iter::repeat((I8::::zero(), U16::::zero())); // bench_instruction!(samples, Pow { (I8, U16), }); -// let mut samples = iter::repeat((I8::::zero(), U32::::zero())); +// let mut samples = iter::repeat((I8::::zero(), U32::::zero())); // bench_instruction!(samples, Pow { (I8, U32), }); -// let mut samples = iter::repeat((I16::::zero(), U8::::zero())); +// let mut samples = iter::repeat((I16::::zero(), U8::::zero())); // bench_instruction!(samples, Pow { (I16, U8), }); -// let mut samples = iter::repeat((I16::::zero(), U16::::zero())); +// let mut samples = iter::repeat((I16::::zero(), U16::::zero())); // bench_instruction!(samples, Pow { (I16, U16), }); -// let mut samples = iter::repeat((I16::::zero(), U32::::zero())); +// let mut samples = iter::repeat((I16::::zero(), U32::::zero())); // bench_instruction!(samples, Pow { (I16, U32), }); -// let mut samples = iter::repeat((I32::::zero(), U8::::zero())); +// let mut samples = iter::repeat((I32::::zero(), U8::::zero())); // bench_instruction!(samples, Pow { (I32, U8), }); -// let mut samples = iter::repeat((I32::::zero(), U16::::zero())); +// let mut samples = iter::repeat((I32::::zero(), U16::::zero())); // bench_instruction!(samples, Pow { (I32, U16), }); -// let mut samples = iter::repeat((I32::::zero(), U32::::zero())); +// let mut samples = iter::repeat((I32::::zero(), U32::::zero())); // bench_instruction!(samples, Pow { (I32, U32), }); -// let mut samples = iter::repeat((I64::::zero(), U8::::zero())); +// let mut samples = iter::repeat((I64::::zero(), U8::::zero())); // bench_instruction!(samples, Pow { (I64, U8), }); -// let mut samples = iter::repeat((I64::::zero(), U16::::zero())); +// let mut samples = iter::repeat((I64::::zero(), U16::::zero())); // bench_instruction!(samples, Pow { (I64, U16), }); -// let mut samples = iter::repeat((I64::::zero(), U32::::zero())); +// let mut samples = iter::repeat((I64::::zero(), U32::::zero())); // bench_instruction!(samples, Pow { (I64, U32), }); -// let mut samples = iter::repeat((I128::::zero(), U8::::zero())); +// let mut samples = iter::repeat((I128::::zero(), U8::::zero())); // bench_instruction!(samples, Pow { (I128, U8), }); -// let mut samples = iter::repeat((I128::::zero(), U16::::zero())); +// let mut samples = iter::repeat((I128::::zero(), U16::::zero())); // bench_instruction!(samples, Pow { (I128, U16), }); -// let mut samples = iter::repeat((I128::::zero(), U32::::zero())); +// let mut samples = iter::repeat((I128::::zero(), U32::::zero())); // bench_instruction!(samples, Pow { (I128, U32), }); -// let mut samples = iter::repeat((U8::::zero(), U8::::zero())); +// let mut samples = iter::repeat((U8::::zero(), U8::::zero())); // bench_instruction!(samples, Pow { (U8, U8), }); -// let mut samples = iter::repeat((U8::::zero(), U16::::zero())); +// let mut samples = iter::repeat((U8::::zero(), U16::::zero())); // bench_instruction!(samples, Pow { (U8, U16), }); -// let mut samples = iter::repeat((U8::::zero(), U32::::zero())); +// let mut samples = iter::repeat((U8::::zero(), U32::::zero())); // bench_instruction!(samples, Pow { (U8, U32), }); -// let mut samples = iter::repeat((U16::::zero(), U8::::zero())); +// let mut samples = iter::repeat((U16::::zero(), U8::::zero())); // bench_instruction!(samples, Pow { (U16, U8), }); -// let mut samples = iter::repeat((U16::::zero(), U16::::zero())); +// let mut samples = iter::repeat((U16::::zero(), U16::::zero())); // bench_instruction!(samples, Pow { (U16, U16), }); -// let mut samples = iter::repeat((U16::::zero(), U32::::zero())); +// let mut samples = iter::repeat((U16::::zero(), U32::::zero())); // bench_instruction!(samples, Pow { (U16, U32), }); -// let mut samples = iter::repeat((U32::::zero(), U8::::zero())); +// let mut samples = iter::repeat((U32::::zero(), U8::::zero())); // bench_instruction!(samples, Pow { (U32, U8), }); -// let mut samples = iter::repeat((U32::::zero(), U16::::zero())); +// let mut samples = iter::repeat((U32::::zero(), U16::::zero())); // bench_instruction!(samples, Pow { (U32, U16), }); -// let mut samples = iter::repeat((U32::::zero(), U32::::zero())); +// let mut samples = iter::repeat((U32::::zero(), U32::::zero())); // bench_instruction!(samples, Pow { (U32, U32), }); -// let mut samples = iter::repeat((U64::::zero(), U8::::zero())); +// let mut samples = iter::repeat((U64::::zero(), U8::::zero())); // bench_instruction!(samples, Pow { (U64, U8), }); -// let mut samples = iter::repeat((U64::::zero(), U16::::zero())); +// let mut samples = iter::repeat((U64::::zero(), U16::::zero())); // bench_instruction!(samples, Pow { (U64, U16), }); -// let mut samples = iter::repeat((U64::::zero(), U32::::zero())); +// let mut samples = iter::repeat((U64::::zero(), U32::::zero())); // bench_instruction!(samples, Pow { (U64, U32), }); -// let mut samples = iter::repeat((U128::::zero(), U8::::zero())); +// let mut samples = iter::repeat((U128::::zero(), U8::::zero())); // bench_instruction!(samples, Pow { (U128, U8), }); -// let mut samples = iter::repeat((U128::::zero(), U16::::zero())); +// let mut samples = iter::repeat((U128::::zero(), U16::::zero())); // bench_instruction!(samples, Pow { (U128, U16), }); -// let mut samples = iter::repeat((U128::::zero(), U32::::zero())); +// let mut samples = iter::repeat((U128::::zero(), U32::::zero())); // bench_instruction!(samples, Pow { (U128, U32), }); // // use console::prelude::PowWrapped; @@ -845,65 +845,65 @@ // }); // // // Use a custom sampling method for left-shift, since there is a high chance of overflow. -// let mut samples = iter::repeat((I8::::zero(), U8::::zero())); +// let mut samples = iter::repeat((I8::::zero(), U8::::zero())); // bench_instruction!(samples, Shl { (I8, U8), }); -// let mut samples = iter::repeat((I8::::zero(), U16::::zero())); +// let mut samples = iter::repeat((I8::::zero(), U16::::zero())); // bench_instruction!(samples, Shl { (I8, U16), }); -// let mut samples = iter::repeat((I8::::zero(), U32::::zero())); +// let mut samples = iter::repeat((I8::::zero(), U32::::zero())); // bench_instruction!(samples, Shl { (I8, U32), }); -// let mut samples = iter::repeat((I16::::zero(), U8::::zero())); +// let mut samples = iter::repeat((I16::::zero(), U8::::zero())); // bench_instruction!(samples, Shl { (I16, U8), }); -// let mut samples = iter::repeat((I16::::zero(), U16::::zero())); +// let mut samples = iter::repeat((I16::::zero(), U16::::zero())); // bench_instruction!(samples, Shl { (I16, U16), }); -// let mut samples = iter::repeat((I16::::zero(), U32::::zero())); +// let mut samples = iter::repeat((I16::::zero(), U32::::zero())); // bench_instruction!(samples, Shl { (I16, U32), }); -// let mut samples = iter::repeat((I32::::zero(), U8::::zero())); +// let mut samples = iter::repeat((I32::::zero(), U8::::zero())); // bench_instruction!(samples, Shl { (I32, U8), }); -// let mut samples = iter::repeat((I32::::zero(), U16::::zero())); +// let mut samples = iter::repeat((I32::::zero(), U16::::zero())); // bench_instruction!(samples, Shl { (I32, U16), }); -// let mut samples = iter::repeat((I32::::zero(), U32::::zero())); +// let mut samples = iter::repeat((I32::::zero(), U32::::zero())); // bench_instruction!(samples, Shl { (I32, U32), }); -// let mut samples = iter::repeat((I64::::zero(), U8::::zero())); +// let mut samples = iter::repeat((I64::::zero(), U8::::zero())); // bench_instruction!(samples, Shl { (I64, U8), }); -// let mut samples = iter::repeat((I64::::zero(), U16::::zero())); +// let mut samples = iter::repeat((I64::::zero(), U16::::zero())); // bench_instruction!(samples, Shl { (I64, U16), }); -// let mut samples = iter::repeat((I64::::zero(), U32::::zero())); +// let mut samples = iter::repeat((I64::::zero(), U32::::zero())); // bench_instruction!(samples, Shl { (I64, U32), }); -// let mut samples = iter::repeat((I128::::zero(), U8::::zero())); +// let mut samples = iter::repeat((I128::::zero(), U8::::zero())); // bench_instruction!(samples, Shl { (I128, U8), }); -// let mut samples = iter::repeat((I128::::zero(), U16::::zero())); +// let mut samples = iter::repeat((I128::::zero(), U16::::zero())); // bench_instruction!(samples, Shl { (I128, U16), }); -// let mut samples = iter::repeat((I128::::zero(), U32::::zero())); +// let mut samples = iter::repeat((I128::::zero(), U32::::zero())); // bench_instruction!(samples, Shl { (I128, U32), }); -// let mut samples = iter::repeat((U8::::zero(), U8::::zero())); +// let mut samples = iter::repeat((U8::::zero(), U8::::zero())); // bench_instruction!(samples, Shl { (U8, U8), }); -// let mut samples = iter::repeat((U8::::zero(), U16::::zero())); +// let mut samples = iter::repeat((U8::::zero(), U16::::zero())); // bench_instruction!(samples, Shl { (U8, U16), }); -// let mut samples = iter::repeat((U8::::zero(), U32::::zero())); +// let mut samples = iter::repeat((U8::::zero(), U32::::zero())); // bench_instruction!(samples, Shl { (U8, U32), }); -// let mut samples = iter::repeat((U16::::zero(), U8::::zero())); +// let mut samples = iter::repeat((U16::::zero(), U8::::zero())); // bench_instruction!(samples, Shl { (U16, U8), }); -// let mut samples = iter::repeat((U16::::zero(), U16::::zero())); +// let mut samples = iter::repeat((U16::::zero(), U16::::zero())); // bench_instruction!(samples, Shl { (U16, U16), }); -// let mut samples = iter::repeat((U16::::zero(), U32::::zero())); +// let mut samples = iter::repeat((U16::::zero(), U32::::zero())); // bench_instruction!(samples, Shl { (U16, U32), }); -// let mut samples = iter::repeat((U32::::zero(), U8::::zero())); +// let mut samples = iter::repeat((U32::::zero(), U8::::zero())); // bench_instruction!(samples, Shl { (U32, U8), }); -// let mut samples = iter::repeat((U32::::zero(), U16::::zero())); +// let mut samples = iter::repeat((U32::::zero(), U16::::zero())); // bench_instruction!(samples, Shl { (U32, U16), }); -// let mut samples = iter::repeat((U32::::zero(), U32::::zero())); +// let mut samples = iter::repeat((U32::::zero(), U32::::zero())); // bench_instruction!(samples, Shl { (U32, U32), }); -// let mut samples = iter::repeat((U64::::zero(), U8::::zero())); +// let mut samples = iter::repeat((U64::::zero(), U8::::zero())); // bench_instruction!(samples, Shl { (U64, U8), }); -// let mut samples = iter::repeat((U64::::zero(), U16::::zero())); +// let mut samples = iter::repeat((U64::::zero(), U16::::zero())); // bench_instruction!(samples, Shl { (U64, U16), }); -// let mut samples = iter::repeat((U64::::zero(), U32::::zero())); +// let mut samples = iter::repeat((U64::::zero(), U32::::zero())); // bench_instruction!(samples, Shl { (U64, U32), }); -// let mut samples = iter::repeat((U128::::zero(), U8::::zero())); +// let mut samples = iter::repeat((U128::::zero(), U8::::zero())); // bench_instruction!(samples, Shl { (U128, U8), }); -// let mut samples = iter::repeat((U128::::zero(), U16::::zero())); +// let mut samples = iter::repeat((U128::::zero(), U16::::zero())); // bench_instruction!(samples, Shl { (U128, U16), }); -// let mut samples = iter::repeat((U128::::zero(), U32::::zero())); +// let mut samples = iter::repeat((U128::::zero(), U32::::zero())); // bench_instruction!(samples, Shl { (U128, U32), }); // // use console::prelude::ShlWrapped; @@ -941,65 +941,65 @@ // }); // // // Use a custom sampling method for left-shift, since there is a high chance of overflow. -// let mut samples = iter::repeat((I8::::zero(), U8::::zero())); +// let mut samples = iter::repeat((I8::::zero(), U8::::zero())); // bench_instruction!(samples, Shr { (I8, U8), }); -// let mut samples = iter::repeat((I8::::zero(), U16::::zero())); +// let mut samples = iter::repeat((I8::::zero(), U16::::zero())); // bench_instruction!(samples, Shr { (I8, U16), }); -// let mut samples = iter::repeat((I8::::zero(), U32::::zero())); +// let mut samples = iter::repeat((I8::::zero(), U32::::zero())); // bench_instruction!(samples, Shr { (I8, U32), }); -// let mut samples = iter::repeat((I16::::zero(), U8::::zero())); +// let mut samples = iter::repeat((I16::::zero(), U8::::zero())); // bench_instruction!(samples, Shr { (I16, U8), }); -// let mut samples = iter::repeat((I16::::zero(), U16::::zero())); +// let mut samples = iter::repeat((I16::::zero(), U16::::zero())); // bench_instruction!(samples, Shr { (I16, U16), }); -// let mut samples = iter::repeat((I16::::zero(), U32::::zero())); +// let mut samples = iter::repeat((I16::::zero(), U32::::zero())); // bench_instruction!(samples, Shr { (I16, U32), }); -// let mut samples = iter::repeat((I32::::zero(), U8::::zero())); +// let mut samples = iter::repeat((I32::::zero(), U8::::zero())); // bench_instruction!(samples, Shr { (I32, U8), }); -// let mut samples = iter::repeat((I32::::zero(), U16::::zero())); +// let mut samples = iter::repeat((I32::::zero(), U16::::zero())); // bench_instruction!(samples, Shr { (I32, U16), }); -// let mut samples = iter::repeat((I32::::zero(), U32::::zero())); +// let mut samples = iter::repeat((I32::::zero(), U32::::zero())); // bench_instruction!(samples, Shr { (I32, U32), }); -// let mut samples = iter::repeat((I64::::zero(), U8::::zero())); +// let mut samples = iter::repeat((I64::::zero(), U8::::zero())); // bench_instruction!(samples, Shr { (I64, U8), }); -// let mut samples = iter::repeat((I64::::zero(), U16::::zero())); +// let mut samples = iter::repeat((I64::::zero(), U16::::zero())); // bench_instruction!(samples, Shr { (I64, U16), }); -// let mut samples = iter::repeat((I64::::zero(), U32::::zero())); +// let mut samples = iter::repeat((I64::::zero(), U32::::zero())); // bench_instruction!(samples, Shr { (I64, U32), }); -// let mut samples = iter::repeat((I128::::zero(), U8::::zero())); +// let mut samples = iter::repeat((I128::::zero(), U8::::zero())); // bench_instruction!(samples, Shr { (I128, U8), }); -// let mut samples = iter::repeat((I128::::zero(), U16::::zero())); +// let mut samples = iter::repeat((I128::::zero(), U16::::zero())); // bench_instruction!(samples, Shr { (I128, U16), }); -// let mut samples = iter::repeat((I128::::zero(), U32::::zero())); +// let mut samples = iter::repeat((I128::::zero(), U32::::zero())); // bench_instruction!(samples, Shr { (I128, U32), }); -// let mut samples = iter::repeat((U8::::zero(), U8::::zero())); +// let mut samples = iter::repeat((U8::::zero(), U8::::zero())); // bench_instruction!(samples, Shr { (U8, U8), }); -// let mut samples = iter::repeat((U8::::zero(), U16::::zero())); +// let mut samples = iter::repeat((U8::::zero(), U16::::zero())); // bench_instruction!(samples, Shr { (U8, U16), }); -// let mut samples = iter::repeat((U8::::zero(), U32::::zero())); +// let mut samples = iter::repeat((U8::::zero(), U32::::zero())); // bench_instruction!(samples, Shr { (U8, U32), }); -// let mut samples = iter::repeat((U16::::zero(), U8::::zero())); +// let mut samples = iter::repeat((U16::::zero(), U8::::zero())); // bench_instruction!(samples, Shr { (U16, U8), }); -// let mut samples = iter::repeat((U16::::zero(), U16::::zero())); +// let mut samples = iter::repeat((U16::::zero(), U16::::zero())); // bench_instruction!(samples, Shr { (U16, U16), }); -// let mut samples = iter::repeat((U16::::zero(), U32::::zero())); +// let mut samples = iter::repeat((U16::::zero(), U32::::zero())); // bench_instruction!(samples, Shr { (U16, U32), }); -// let mut samples = iter::repeat((U32::::zero(), U8::::zero())); +// let mut samples = iter::repeat((U32::::zero(), U8::::zero())); // bench_instruction!(samples, Shr { (U32, U8), }); -// let mut samples = iter::repeat((U32::::zero(), U16::::zero())); +// let mut samples = iter::repeat((U32::::zero(), U16::::zero())); // bench_instruction!(samples, Shr { (U32, U16), }); -// let mut samples = iter::repeat((U32::::zero(), U32::::zero())); +// let mut samples = iter::repeat((U32::::zero(), U32::::zero())); // bench_instruction!(samples, Shr { (U32, U32), }); -// let mut samples = iter::repeat((U64::::zero(), U8::::zero())); +// let mut samples = iter::repeat((U64::::zero(), U8::::zero())); // bench_instruction!(samples, Shr { (U64, U8), }); -// let mut samples = iter::repeat((U64::::zero(), U16::::zero())); +// let mut samples = iter::repeat((U64::::zero(), U16::::zero())); // bench_instruction!(samples, Shr { (U64, U16), }); -// let mut samples = iter::repeat((U64::::zero(), U32::::zero())); +// let mut samples = iter::repeat((U64::::zero(), U32::::zero())); // bench_instruction!(samples, Shr { (U64, U32), }); -// let mut samples = iter::repeat((U128::::zero(), U8::::zero())); +// let mut samples = iter::repeat((U128::::zero(), U8::::zero())); // bench_instruction!(samples, Shr { (U128, U8), }); -// let mut samples = iter::repeat((U128::::zero(), U16::::zero())); +// let mut samples = iter::repeat((U128::::zero(), U16::::zero())); // bench_instruction!(samples, Shr { (U128, U16), }); -// let mut samples = iter::repeat((U128::::zero(), U32::::zero())); +// let mut samples = iter::repeat((U128::::zero(), U32::::zero())); // bench_instruction!(samples, Shr { (U128, U32), }); // // use console::prelude::ShrWrapped; diff --git a/synthesizer/program/src/bytes.rs b/synthesizer/program/src/bytes.rs index a8f9b0e544..555df50c64 100644 --- a/synthesizer/program/src/bytes.rs +++ b/synthesizer/program/src/bytes.rs @@ -142,9 +142,9 @@ impl, Command: CommandTrait> ToB mod tests { use super::*; use crate::Program; - use console::network::Testnet3; + use console::network::MainnetV0; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; #[test] fn test_bytes() -> Result<()> { diff --git a/synthesizer/program/src/closure/bytes.rs b/synthesizer/program/src/closure/bytes.rs index 60d717bf30..da3b8d7264 100644 --- a/synthesizer/program/src/closure/bytes.rs +++ b/synthesizer/program/src/closure/bytes.rs @@ -118,9 +118,9 @@ impl> ToBytes for ClosureCore Result<()> { diff --git a/synthesizer/program/src/closure/input/mod.rs b/synthesizer/program/src/closure/input/mod.rs index bbf9d4d0e4..927a089ed2 100644 --- a/synthesizer/program/src/closure/input/mod.rs +++ b/synthesizer/program/src/closure/input/mod.rs @@ -69,9 +69,9 @@ impl PartialOrd for Input { #[cfg(test)] mod tests { use super::*; - use console::network::Testnet3; + use console::network::MainnetV0; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; #[test] fn test_input_type_name() -> Result<()> { diff --git a/synthesizer/program/src/closure/input/parse.rs b/synthesizer/program/src/closure/input/parse.rs index 5a0f7c2481..c233d74d8c 100644 --- a/synthesizer/program/src/closure/input/parse.rs +++ b/synthesizer/program/src/closure/input/parse.rs @@ -94,9 +94,9 @@ impl Display for Input { #[cfg(test)] mod tests { use super::*; - use console::network::Testnet3; + use console::network::MainnetV0; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; #[test] fn test_input_parse() -> Result<()> { diff --git a/synthesizer/program/src/closure/mod.rs b/synthesizer/program/src/closure/mod.rs index 0cd26c267f..be54fddb4a 100644 --- a/synthesizer/program/src/closure/mod.rs +++ b/synthesizer/program/src/closure/mod.rs @@ -154,7 +154,7 @@ mod tests { use crate::{Closure, Instruction}; - type CurrentNetwork = console::network::Testnet3; + type CurrentNetwork = console::network::MainnetV0; #[test] fn test_add_input() { diff --git a/synthesizer/program/src/closure/output/mod.rs b/synthesizer/program/src/closure/output/mod.rs index c886fab747..2a07177a1b 100644 --- a/synthesizer/program/src/closure/output/mod.rs +++ b/synthesizer/program/src/closure/output/mod.rs @@ -54,9 +54,9 @@ impl TypeName for Output { #[cfg(test)] mod tests { use super::*; - use console::network::Testnet3; + use console::network::MainnetV0; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; #[test] fn test_output_type_name() { diff --git a/synthesizer/program/src/closure/output/parse.rs b/synthesizer/program/src/closure/output/parse.rs index b9e7fd444a..bf2f4290cd 100644 --- a/synthesizer/program/src/closure/output/parse.rs +++ b/synthesizer/program/src/closure/output/parse.rs @@ -86,11 +86,11 @@ impl Display for Output { mod tests { use super::*; use console::{ - network::Testnet3, + network::MainnetV0, program::{Literal, Register, U8}, }; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; #[test] fn test_output_parse() -> Result<()> { diff --git a/synthesizer/program/src/closure/parse.rs b/synthesizer/program/src/closure/parse.rs index 4d9894b0d7..9560dfc924 100644 --- a/synthesizer/program/src/closure/parse.rs +++ b/synthesizer/program/src/closure/parse.rs @@ -88,9 +88,9 @@ impl> Display for ClosureCore> ToBytes for FinalizeCore mod tests { use super::*; use crate::Finalize; - use console::network::Testnet3; + use console::network::MainnetV0; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; #[test] fn test_finalize_bytes() -> Result<()> { diff --git a/synthesizer/program/src/finalize/input/mod.rs b/synthesizer/program/src/finalize/input/mod.rs index 88848caedc..1081768a45 100644 --- a/synthesizer/program/src/finalize/input/mod.rs +++ b/synthesizer/program/src/finalize/input/mod.rs @@ -69,9 +69,9 @@ impl PartialOrd for Input { #[cfg(test)] mod tests { use super::*; - use console::network::Testnet3; + use console::network::MainnetV0; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; #[test] fn test_input_type_name() -> Result<()> { diff --git a/synthesizer/program/src/finalize/input/parse.rs b/synthesizer/program/src/finalize/input/parse.rs index e2601c9a26..7cbe05e80d 100644 --- a/synthesizer/program/src/finalize/input/parse.rs +++ b/synthesizer/program/src/finalize/input/parse.rs @@ -88,9 +88,9 @@ impl Display for Input { #[cfg(test)] mod tests { use super::*; - use console::network::Testnet3; + use console::network::MainnetV0; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; #[test] fn test_input_parse() -> Result<()> { diff --git a/synthesizer/program/src/finalize/mod.rs b/synthesizer/program/src/finalize/mod.rs index 4404c34b05..d376e4554a 100644 --- a/synthesizer/program/src/finalize/mod.rs +++ b/synthesizer/program/src/finalize/mod.rs @@ -168,7 +168,7 @@ mod tests { use crate::{Command, Finalize}; - type CurrentNetwork = console::network::Testnet3; + type CurrentNetwork = console::network::MainnetV0; #[test] fn test_add_input() { diff --git a/synthesizer/program/src/finalize/parse.rs b/synthesizer/program/src/finalize/parse.rs index ba60af4d33..79ca7ac9c5 100644 --- a/synthesizer/program/src/finalize/parse.rs +++ b/synthesizer/program/src/finalize/parse.rs @@ -90,9 +90,9 @@ impl> Display for FinalizeCore mod tests { use super::*; use crate::Finalize; - use console::network::Testnet3; + use console::network::MainnetV0; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; #[test] fn test_finalize_parse() { diff --git a/synthesizer/program/src/function/bytes.rs b/synthesizer/program/src/function/bytes.rs index 64ddf4938c..50dbe7fb18 100644 --- a/synthesizer/program/src/function/bytes.rs +++ b/synthesizer/program/src/function/bytes.rs @@ -135,9 +135,9 @@ impl, Command: CommandTrait> ToB mod tests { use super::*; use crate::Function; - use console::network::Testnet3; + use console::network::MainnetV0; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; #[test] fn test_function_bytes() -> Result<()> { diff --git a/synthesizer/program/src/function/input/mod.rs b/synthesizer/program/src/function/input/mod.rs index 193ae71141..8e6887826e 100644 --- a/synthesizer/program/src/function/input/mod.rs +++ b/synthesizer/program/src/function/input/mod.rs @@ -69,9 +69,9 @@ impl PartialOrd for Input { #[cfg(test)] mod tests { use super::*; - use console::network::Testnet3; + use console::network::MainnetV0; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; #[test] fn test_input_type_name() -> Result<()> { diff --git a/synthesizer/program/src/function/input/parse.rs b/synthesizer/program/src/function/input/parse.rs index 991e6efbc8..31a8cb50e4 100644 --- a/synthesizer/program/src/function/input/parse.rs +++ b/synthesizer/program/src/function/input/parse.rs @@ -94,9 +94,9 @@ impl Display for Input { #[cfg(test)] mod tests { use super::*; - use console::network::Testnet3; + use console::network::MainnetV0; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; #[test] fn test_input_parse() -> Result<()> { diff --git a/synthesizer/program/src/function/mod.rs b/synthesizer/program/src/function/mod.rs index 28e5aa9cd2..24674e9777 100644 --- a/synthesizer/program/src/function/mod.rs +++ b/synthesizer/program/src/function/mod.rs @@ -208,7 +208,7 @@ mod tests { use crate::{Function, Instruction}; - type CurrentNetwork = console::network::Testnet3; + type CurrentNetwork = console::network::MainnetV0; #[test] fn test_add_input() { diff --git a/synthesizer/program/src/function/output/mod.rs b/synthesizer/program/src/function/output/mod.rs index 864affe4cf..1b5fb50581 100644 --- a/synthesizer/program/src/function/output/mod.rs +++ b/synthesizer/program/src/function/output/mod.rs @@ -54,9 +54,9 @@ impl TypeName for Output { #[cfg(test)] mod tests { use super::*; - use console::network::Testnet3; + use console::network::MainnetV0; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; #[test] fn test_output_type_name() { diff --git a/synthesizer/program/src/function/output/parse.rs b/synthesizer/program/src/function/output/parse.rs index 9f9328581f..b157beb175 100644 --- a/synthesizer/program/src/function/output/parse.rs +++ b/synthesizer/program/src/function/output/parse.rs @@ -86,11 +86,11 @@ impl Display for Output { mod tests { use super::*; use console::{ - network::Testnet3, + network::MainnetV0, program::{Literal, Register, U8}, }; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; #[test] fn test_output_parse() -> Result<()> { diff --git a/synthesizer/program/src/function/parse.rs b/synthesizer/program/src/function/parse.rs index 7f65dc6fb2..48258a3e0b 100644 --- a/synthesizer/program/src/function/parse.rs +++ b/synthesizer/program/src/function/parse.rs @@ -123,9 +123,9 @@ impl, Command: CommandTrait> Dis mod tests { use super::*; use crate::Function; - use console::network::Testnet3; + use console::network::MainnetV0; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; #[test] fn test_function_parse() { diff --git a/synthesizer/program/src/import/mod.rs b/synthesizer/program/src/import/mod.rs index f7baec62d5..46082a0e4d 100644 --- a/synthesizer/program/src/import/mod.rs +++ b/synthesizer/program/src/import/mod.rs @@ -73,9 +73,9 @@ impl PartialOrd for Import { #[cfg(test)] mod tests { use super::*; - use console::network::Testnet3; + use console::network::MainnetV0; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; #[test] fn test_import_type_name() -> Result<()> { diff --git a/synthesizer/program/src/import/parse.rs b/synthesizer/program/src/import/parse.rs index 0f4e749e98..ad53f31e7c 100644 --- a/synthesizer/program/src/import/parse.rs +++ b/synthesizer/program/src/import/parse.rs @@ -71,9 +71,9 @@ impl Display for Import { #[cfg(test)] mod tests { use super::*; - use console::network::Testnet3; + use console::network::MainnetV0; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; #[test] fn test_import_parse() -> Result<()> { diff --git a/synthesizer/program/src/lib.rs b/synthesizer/program/src/lib.rs index 556d9ed922..39daab2ceb 100644 --- a/synthesizer/program/src/lib.rs +++ b/synthesizer/program/src/lib.rs @@ -661,11 +661,11 @@ impl, Command: CommandTrait> Typ mod tests { use super::*; use console::{ - network::Testnet3, + network::MainnetV0, program::{Locator, ValueType}, }; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; #[test] fn test_program_mapping() -> Result<()> { diff --git a/synthesizer/program/src/logic/command/await_.rs b/synthesizer/program/src/logic/command/await_.rs index f7c43803ef..5fc745c11e 100644 --- a/synthesizer/program/src/logic/command/await_.rs +++ b/synthesizer/program/src/logic/command/await_.rs @@ -114,9 +114,9 @@ impl ToBytes for Await { #[cfg(test)] mod tests { use super::*; - use console::{network::Testnet3, program::Register}; + use console::{network::MainnetV0, program::Register}; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; #[test] fn test_parse() { diff --git a/synthesizer/program/src/logic/command/branch.rs b/synthesizer/program/src/logic/command/branch.rs index a6ac651627..7efc86c665 100644 --- a/synthesizer/program/src/logic/command/branch.rs +++ b/synthesizer/program/src/logic/command/branch.rs @@ -167,11 +167,11 @@ impl ToBytes for Branch { mod tests { use super::*; use console::{ - network::Testnet3, + network::MainnetV0, program::{Identifier, Register}, }; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; #[test] fn test_parse() { diff --git a/synthesizer/program/src/logic/command/contains.rs b/synthesizer/program/src/logic/command/contains.rs index 14e1618d89..a3b0479c2e 100644 --- a/synthesizer/program/src/logic/command/contains.rs +++ b/synthesizer/program/src/logic/command/contains.rs @@ -202,9 +202,9 @@ impl ToBytes for Contains { #[cfg(test)] mod tests { use super::*; - use console::{network::Testnet3, program::Register}; + use console::{network::MainnetV0, program::Register}; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; #[test] fn test_parse() { diff --git a/synthesizer/program/src/logic/command/get.rs b/synthesizer/program/src/logic/command/get.rs index ac56eb92c0..84b355e945 100644 --- a/synthesizer/program/src/logic/command/get.rs +++ b/synthesizer/program/src/logic/command/get.rs @@ -352,9 +352,9 @@ impl ToBytes for Get { #[cfg(test)] mod tests { use super::*; - use console::{network::Testnet3, program::Register}; + use console::{network::MainnetV0, program::Register}; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; struct OldGet { mapping: Identifier, diff --git a/synthesizer/program/src/logic/command/get_or_use.rs b/synthesizer/program/src/logic/command/get_or_use.rs index 7c2ef6d7d7..a4ef7cc080 100644 --- a/synthesizer/program/src/logic/command/get_or_use.rs +++ b/synthesizer/program/src/logic/command/get_or_use.rs @@ -275,9 +275,9 @@ impl ToBytes for GetOrUse { #[cfg(test)] mod tests { use super::*; - use console::{network::Testnet3, program::Register}; + use console::{network::MainnetV0, program::Register}; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; pub struct OldGetOrUse { pub mapping: Identifier, diff --git a/synthesizer/program/src/logic/command/mod.rs b/synthesizer/program/src/logic/command/mod.rs index 5e5aa7c750..187683c640 100644 --- a/synthesizer/program/src/logic/command/mod.rs +++ b/synthesizer/program/src/logic/command/mod.rs @@ -357,9 +357,9 @@ impl Display for Command { #[cfg(test)] mod tests { use super::*; - use console::network::Testnet3; + use console::network::MainnetV0; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; #[test] fn test_command_bytes() { diff --git a/synthesizer/program/src/logic/command/position.rs b/synthesizer/program/src/logic/command/position.rs index d0fb251a43..a8b738954c 100644 --- a/synthesizer/program/src/logic/command/position.rs +++ b/synthesizer/program/src/logic/command/position.rs @@ -125,9 +125,9 @@ impl ToBytes for Position { #[cfg(test)] mod tests { use super::*; - use console::network::Testnet3; + use console::network::MainnetV0; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; #[test] fn test_parse() { diff --git a/synthesizer/program/src/logic/command/rand_chacha.rs b/synthesizer/program/src/logic/command/rand_chacha.rs index 829bab7373..caf7ce6eab 100644 --- a/synthesizer/program/src/logic/command/rand_chacha.rs +++ b/synthesizer/program/src/logic/command/rand_chacha.rs @@ -288,9 +288,9 @@ impl ToBytes for RandChaCha { #[cfg(test)] mod tests { use super::*; - use console::{network::Testnet3, program::Register}; + use console::{network::MainnetV0, program::Register}; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; fn valid_destination_types() -> &'static [LiteralType] { &[ diff --git a/synthesizer/program/src/logic/command/remove.rs b/synthesizer/program/src/logic/command/remove.rs index 52ce26629f..134a278c81 100644 --- a/synthesizer/program/src/logic/command/remove.rs +++ b/synthesizer/program/src/logic/command/remove.rs @@ -167,9 +167,9 @@ impl ToBytes for Remove { #[cfg(test)] mod tests { use super::*; - use console::{network::Testnet3, program::Register}; + use console::{network::MainnetV0, program::Register}; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; #[test] fn test_parse() { diff --git a/synthesizer/program/src/logic/command/set.rs b/synthesizer/program/src/logic/command/set.rs index 83d187dde7..9b687f5e90 100644 --- a/synthesizer/program/src/logic/command/set.rs +++ b/synthesizer/program/src/logic/command/set.rs @@ -199,9 +199,9 @@ impl ToBytes for Set { #[cfg(test)] mod tests { use super::*; - use console::{network::Testnet3, program::Register}; + use console::{network::MainnetV0, program::Register}; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; #[test] fn test_parse() { diff --git a/synthesizer/program/src/logic/finalize_operation/mod.rs b/synthesizer/program/src/logic/finalize_operation/mod.rs index 15de98767d..03f25cb2e5 100644 --- a/synthesizer/program/src/logic/finalize_operation/mod.rs +++ b/synthesizer/program/src/logic/finalize_operation/mod.rs @@ -42,9 +42,9 @@ pub enum FinalizeOperation { #[cfg(test)] pub(crate) mod test_helpers { use super::*; - use console::network::Testnet3; + use console::network::MainnetV0; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; /// Samples a random `InitializeMapping`. pub(crate) fn sample_initialize_mapping(rng: &mut TestRng) -> FinalizeOperation { diff --git a/synthesizer/program/src/logic/instruction/bytes.rs b/synthesizer/program/src/logic/instruction/bytes.rs index 0c0c35954a..61fede6a78 100644 --- a/synthesizer/program/src/logic/instruction/bytes.rs +++ b/synthesizer/program/src/logic/instruction/bytes.rs @@ -79,9 +79,9 @@ impl ToBytes for Instruction { #[cfg(test)] mod tests { use super::*; - use console::network::Testnet3; + use console::network::MainnetV0; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; #[test] fn test_bytes() -> Result<()> { diff --git a/synthesizer/program/src/logic/instruction/mod.rs b/synthesizer/program/src/logic/instruction/mod.rs index 930920ca5e..91c09fae9e 100644 --- a/synthesizer/program/src/logic/instruction/mod.rs +++ b/synthesizer/program/src/logic/instruction/mod.rs @@ -461,9 +461,9 @@ impl Display for Instruction { #[cfg(test)] mod tests { use super::*; - use console::network::Testnet3; + use console::network::MainnetV0; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; #[test] fn test_opcodes() { diff --git a/synthesizer/program/src/logic/instruction/operand/mod.rs b/synthesizer/program/src/logic/instruction/operand/mod.rs index c7f180d4c9..e0b503e4fc 100644 --- a/synthesizer/program/src/logic/instruction/operand/mod.rs +++ b/synthesizer/program/src/logic/instruction/operand/mod.rs @@ -77,9 +77,9 @@ impl From<&Register> for Operand { #[cfg(test)] mod tests { use super::*; - use console::network::Testnet3; + use console::network::MainnetV0; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; #[test] fn test_operand_from_literal() -> Result<()> { diff --git a/synthesizer/program/src/logic/instruction/operand/parse.rs b/synthesizer/program/src/logic/instruction/operand/parse.rs index ccc699ee60..7c54e2cd6b 100644 --- a/synthesizer/program/src/logic/instruction/operand/parse.rs +++ b/synthesizer/program/src/logic/instruction/operand/parse.rs @@ -83,9 +83,9 @@ impl Display for Operand { #[cfg(test)] mod tests { use super::*; - use console::network::Testnet3; + use console::network::MainnetV0; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; #[test] fn test_operand_parse() -> Result<()> { diff --git a/synthesizer/program/src/logic/instruction/operation/assert.rs b/synthesizer/program/src/logic/instruction/operation/assert.rs index ee9a36b7ba..769eaa789e 100644 --- a/synthesizer/program/src/logic/instruction/operation/assert.rs +++ b/synthesizer/program/src/logic/instruction/operation/assert.rs @@ -263,9 +263,9 @@ impl ToBytes for AssertInstruction { #[cfg(test)] mod tests { use super::*; - use console::network::Testnet3; + use console::network::MainnetV0; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; #[test] fn test_parse() { diff --git a/synthesizer/program/src/logic/instruction/operation/async_.rs b/synthesizer/program/src/logic/instruction/operation/async_.rs index 194fa8a5f9..35fa6b07ec 100644 --- a/synthesizer/program/src/logic/instruction/operation/async_.rs +++ b/synthesizer/program/src/logic/instruction/operation/async_.rs @@ -348,9 +348,9 @@ impl ToBytes for Async { mod tests { use super::*; // use circuit::AleoV0; - use console::network::Testnet3; + use console::network::MainnetV0; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; // type CurrentAleo = AleoV0; // // /// Samples the stack. Note: Do not replicate this for real program use, it is insecure. diff --git a/synthesizer/program/src/logic/instruction/operation/call.rs b/synthesizer/program/src/logic/instruction/operation/call.rs index 12cc42168d..627e0b32ac 100644 --- a/synthesizer/program/src/logic/instruction/operation/call.rs +++ b/synthesizer/program/src/logic/instruction/operation/call.rs @@ -444,11 +444,11 @@ impl ToBytes for Call { mod tests { use super::*; use console::{ - network::Testnet3, + network::MainnetV0, program::{Access, Address, Identifier, Literal, U64}, }; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; const TEST_CASES: &[&str] = &[ "call foo", diff --git a/synthesizer/program/src/logic/instruction/operation/cast.rs b/synthesizer/program/src/logic/instruction/operation/cast.rs index 2cf60e79a8..87c45a3a80 100644 --- a/synthesizer/program/src/logic/instruction/operation/cast.rs +++ b/synthesizer/program/src/logic/instruction/operation/cast.rs @@ -1125,11 +1125,11 @@ impl ToBytes for CastOperation { mod tests { use super::*; use console::{ - network::Testnet3, + network::MainnetV0, program::{Access, Identifier}, }; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; #[test] fn test_parse() { diff --git a/synthesizer/program/src/logic/instruction/operation/commit.rs b/synthesizer/program/src/logic/instruction/operation/commit.rs index ffc3320cd0..35904c2a94 100644 --- a/synthesizer/program/src/logic/instruction/operation/commit.rs +++ b/synthesizer/program/src/logic/instruction/operation/commit.rs @@ -349,9 +349,9 @@ impl ToBytes for CommitInstruction { #[cfg(test)] mod tests { use super::*; - use console::network::Testnet3; + use console::network::MainnetV0; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; /// **Attention**: When changing this, also update in `tests/instruction/commit.rs`. fn valid_destination_types() -> &'static [LiteralType] { diff --git a/synthesizer/program/src/logic/instruction/operation/hash.rs b/synthesizer/program/src/logic/instruction/operation/hash.rs index cd7954e887..21acdd04ab 100644 --- a/synthesizer/program/src/logic/instruction/operation/hash.rs +++ b/synthesizer/program/src/logic/instruction/operation/hash.rs @@ -497,9 +497,9 @@ impl ToBytes for HashInstruction { #[cfg(test)] mod tests { use super::*; - use console::network::Testnet3; + use console::network::MainnetV0; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; /// **Attention**: When changing this, also update in `tests/instruction/hash.rs`. fn valid_destination_types() -> &'static [PlaintextType] { diff --git a/synthesizer/program/src/logic/instruction/operation/is.rs b/synthesizer/program/src/logic/instruction/operation/is.rs index aa56e93757..21ee23905a 100644 --- a/synthesizer/program/src/logic/instruction/operation/is.rs +++ b/synthesizer/program/src/logic/instruction/operation/is.rs @@ -275,9 +275,9 @@ impl ToBytes for IsInstruction { #[cfg(test)] mod tests { use super::*; - use console::network::Testnet3; + use console::network::MainnetV0; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; #[test] fn test_parse() { diff --git a/synthesizer/program/src/logic/instruction/operation/macros.rs b/synthesizer/program/src/logic/instruction/operation/macros.rs index e283e0945b..46ced3ebbe 100644 --- a/synthesizer/program/src/logic/instruction/operation/macros.rs +++ b/synthesizer/program/src/logic/instruction/operation/macros.rs @@ -95,7 +95,7 @@ macro_rules! operation { use console::types::*; // Prepare the environment. - type CurrentNetwork = console::network::Testnet3; + type CurrentNetwork = console::network::MainnetV0; type CurrentAleo = circuit::network::AleoV0; // Prepare the operator. @@ -150,7 +150,7 @@ macro_rules! operation { use console::types::*; // Prepare the environment. - type CurrentNetwork = console::network::Testnet3; + type CurrentNetwork = console::network::MainnetV0; type CurrentAleo = circuit::network::AleoV0; // Prepare the operator. diff --git a/synthesizer/program/src/logic/instruction/operation/sign_verify.rs b/synthesizer/program/src/logic/instruction/operation/sign_verify.rs index 22a9fb480a..34b1e3feec 100644 --- a/synthesizer/program/src/logic/instruction/operation/sign_verify.rs +++ b/synthesizer/program/src/logic/instruction/operation/sign_verify.rs @@ -274,9 +274,9 @@ impl ToBytes for SignVerify { #[cfg(test)] mod tests { use super::*; - use console::network::Testnet3; + use console::network::MainnetV0; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; #[test] fn test_parse() { diff --git a/synthesizer/program/src/logic/instruction/parse.rs b/synthesizer/program/src/logic/instruction/parse.rs index 7eba572702..0212d13166 100644 --- a/synthesizer/program/src/logic/instruction/parse.rs +++ b/synthesizer/program/src/logic/instruction/parse.rs @@ -85,9 +85,9 @@ impl FromStr for Instruction { #[cfg(test)] mod tests { use super::*; - use console::network::Testnet3; + use console::network::MainnetV0; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; #[test] fn test_parse() -> Result<()> { diff --git a/synthesizer/program/src/mapping/bytes.rs b/synthesizer/program/src/mapping/bytes.rs index 323fdbc64f..9f38c621b4 100644 --- a/synthesizer/program/src/mapping/bytes.rs +++ b/synthesizer/program/src/mapping/bytes.rs @@ -45,9 +45,9 @@ impl ToBytes for Mapping { #[cfg(test)] mod tests { use super::*; - use console::network::Testnet3; + use console::network::MainnetV0; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; #[test] fn test_mapping_bytes() -> Result<()> { diff --git a/synthesizer/program/src/mapping/key/mod.rs b/synthesizer/program/src/mapping/key/mod.rs index 3132c8a251..ed1f4005fd 100644 --- a/synthesizer/program/src/mapping/key/mod.rs +++ b/synthesizer/program/src/mapping/key/mod.rs @@ -43,9 +43,9 @@ impl TypeName for MapKey { #[cfg(test)] mod tests { use super::*; - use console::network::Testnet3; + use console::network::MainnetV0; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; #[test] fn test_key_type_name() -> Result<()> { diff --git a/synthesizer/program/src/mapping/key/parse.rs b/synthesizer/program/src/mapping/key/parse.rs index 607a8f6c70..5438873b93 100644 --- a/synthesizer/program/src/mapping/key/parse.rs +++ b/synthesizer/program/src/mapping/key/parse.rs @@ -79,9 +79,9 @@ impl Display for MapKey { #[cfg(test)] mod tests { use super::*; - use console::network::Testnet3; + use console::network::MainnetV0; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; #[test] fn test_key_parse() -> Result<()> { diff --git a/synthesizer/program/src/mapping/parse.rs b/synthesizer/program/src/mapping/parse.rs index e2dd389f8f..4f25ed546c 100644 --- a/synthesizer/program/src/mapping/parse.rs +++ b/synthesizer/program/src/mapping/parse.rs @@ -78,9 +78,9 @@ impl Display for Mapping { #[cfg(test)] mod tests { use super::*; - use console::network::Testnet3; + use console::network::MainnetV0; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; #[test] fn test_mapping_parse() { diff --git a/synthesizer/program/src/mapping/value/mod.rs b/synthesizer/program/src/mapping/value/mod.rs index c32207fdf6..b62104c6b8 100644 --- a/synthesizer/program/src/mapping/value/mod.rs +++ b/synthesizer/program/src/mapping/value/mod.rs @@ -43,9 +43,9 @@ impl TypeName for MapValue { #[cfg(test)] mod tests { use super::*; - use console::network::Testnet3; + use console::network::MainnetV0; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; #[test] fn test_value_type_name() { diff --git a/synthesizer/program/src/mapping/value/parse.rs b/synthesizer/program/src/mapping/value/parse.rs index 280bf71788..787aed922b 100644 --- a/synthesizer/program/src/mapping/value/parse.rs +++ b/synthesizer/program/src/mapping/value/parse.rs @@ -79,9 +79,9 @@ impl Display for MapValue { #[cfg(test)] mod tests { use super::*; - use console::network::Testnet3; + use console::network::MainnetV0; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; #[test] fn test_value_parse() -> Result<()> { diff --git a/synthesizer/program/src/parse.rs b/synthesizer/program/src/parse.rs index 22d6cfa5bb..aeb6822dd1 100644 --- a/synthesizer/program/src/parse.rs +++ b/synthesizer/program/src/parse.rs @@ -184,9 +184,9 @@ impl, Command: CommandTrait> Dis mod tests { use super::*; use crate::Program; - use console::network::Testnet3; + use console::network::MainnetV0; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; #[test] fn test_program_parse() -> Result<()> { diff --git a/synthesizer/program/src/serialize.rs b/synthesizer/program/src/serialize.rs index 4e23a291a4..764c74965c 100644 --- a/synthesizer/program/src/serialize.rs +++ b/synthesizer/program/src/serialize.rs @@ -42,9 +42,9 @@ impl<'de, N: Network, Instruction: InstructionTrait, Command: CommandTrait mod tests { use super::*; use crate::Program; - use console::network::Testnet3; + use console::network::MainnetV0; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; #[test] fn test_serde_json() -> Result<()> { diff --git a/synthesizer/program/tests/helpers/sample.rs b/synthesizer/program/tests/helpers/sample.rs index c7587d03ea..066e6c8b60 100644 --- a/synthesizer/program/tests/helpers/sample.rs +++ b/synthesizer/program/tests/helpers/sample.rs @@ -14,7 +14,7 @@ use circuit::AleoV0; use console::{ - network::Testnet3, + network::MainnetV0, prelude::*, program::{Identifier, Literal, Plaintext, Register, Value}, }; @@ -24,7 +24,7 @@ use snarkvm_synthesizer_program::{ }; use synthesizer_process::{Authorization, CallStack, FinalizeRegisters, Registers, Stack, StackProgramTypes}; -type CurrentNetwork = Testnet3; +type CurrentNetwork = MainnetV0; type CurrentAleo = AleoV0; /// Samples the registers. Note: Do not replicate this for real program use, it is insecure. diff --git a/synthesizer/program/tests/instruction/assert.rs b/synthesizer/program/tests/instruction/assert.rs index bd3216a7c7..61811eaef4 100644 --- a/synthesizer/program/tests/instruction/assert.rs +++ b/synthesizer/program/tests/instruction/assert.rs @@ -18,14 +18,14 @@ use crate::helpers::sample::{sample_finalize_registers, sample_registers}; use circuit::AleoV0; use console::{ - network::Testnet3, + network::MainnetV0, prelude::*, program::{Identifier, Literal, LiteralType, Register}, }; use snarkvm_synthesizer_program::{AssertEq, AssertInstruction, AssertNeq, Opcode, Operand, Program}; use synthesizer_process::{Process, Stack}; -type CurrentNetwork = Testnet3; +type CurrentNetwork = MainnetV0; type CurrentAleo = AleoV0; const ITERATIONS: usize = 100; diff --git a/synthesizer/program/tests/instruction/commit.rs b/synthesizer/program/tests/instruction/commit.rs index 22bd82fdae..abdc6f6cb3 100644 --- a/synthesizer/program/tests/instruction/commit.rs +++ b/synthesizer/program/tests/instruction/commit.rs @@ -18,7 +18,7 @@ use crate::helpers::sample::{sample_finalize_registers, sample_registers}; use circuit::{AleoV0, Eject}; use console::{ - network::Testnet3, + network::MainnetV0, prelude::*, program::{Identifier, Literal, LiteralType, Plaintext, Register, Value}, }; @@ -38,7 +38,7 @@ use snarkvm_synthesizer_program::{ }; use synthesizer_process::{Process, Stack}; -type CurrentNetwork = Testnet3; +type CurrentNetwork = MainnetV0; type CurrentAleo = AleoV0; const ITERATIONS: usize = 50; diff --git a/synthesizer/program/tests/instruction/hash.rs b/synthesizer/program/tests/instruction/hash.rs index bef9a9d312..46f0caf732 100644 --- a/synthesizer/program/tests/instruction/hash.rs +++ b/synthesizer/program/tests/instruction/hash.rs @@ -18,7 +18,7 @@ use crate::helpers::sample::{sample_finalize_registers, sample_registers}; use circuit::{AleoV0, Eject}; use console::{ - network::Testnet3, + network::MainnetV0, prelude::*, program::{Identifier, Literal, LiteralType, Plaintext, PlaintextType, Register, Value}, }; @@ -47,7 +47,7 @@ use snarkvm_synthesizer_program::{ }; use synthesizer_process::{Process, Stack}; -type CurrentNetwork = Testnet3; +type CurrentNetwork = MainnetV0; type CurrentAleo = AleoV0; const ITERATIONS: usize = 50; diff --git a/synthesizer/program/tests/instruction/is.rs b/synthesizer/program/tests/instruction/is.rs index ba22a6e01c..a60121da9b 100644 --- a/synthesizer/program/tests/instruction/is.rs +++ b/synthesizer/program/tests/instruction/is.rs @@ -18,7 +18,7 @@ use crate::helpers::sample::{sample_finalize_registers, sample_registers}; use circuit::AleoV0; use console::{ - network::Testnet3, + network::MainnetV0, prelude::*, program::{Identifier, Literal, LiteralType, Register}, }; @@ -34,7 +34,7 @@ use snarkvm_synthesizer_program::{ }; use synthesizer_process::{Process, Stack}; -type CurrentNetwork = Testnet3; +type CurrentNetwork = MainnetV0; type CurrentAleo = AleoV0; const ITERATIONS: usize = 100; diff --git a/synthesizer/snark/src/certificate/parse.rs b/synthesizer/snark/src/certificate/parse.rs index 40aa1414d2..cc22051156 100644 --- a/synthesizer/snark/src/certificate/parse.rs +++ b/synthesizer/snark/src/certificate/parse.rs @@ -74,9 +74,9 @@ impl Display for Certificate { #[cfg(test)] mod tests { use super::*; - use console::network::Testnet3; + use console::network::MainnetV0; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; #[test] fn test_parse() -> Result<()> { diff --git a/synthesizer/snark/src/lib.rs b/synthesizer/snark/src/lib.rs index c5063edf4f..10aea5eb5b 100644 --- a/synthesizer/snark/src/lib.rs +++ b/synthesizer/snark/src/lib.rs @@ -50,11 +50,11 @@ pub(crate) mod test_helpers { environment::{Assignment, Circuit, Eject, Environment, Inject, Mode, One}, types::Field, }; - use console::{network::Testnet3, prelude::One as _}; + use console::{network::MainnetV0, prelude::One as _}; use once_cell::sync::OnceCell; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; /// Compute 2^EXPONENT - 1, in a purposefully constraint-inefficient manner for testing. fn create_example_circuit() -> Field { @@ -138,9 +138,9 @@ pub(crate) mod test_helpers { mod test { use super::*; use circuit::environment::{Circuit, Environment}; - use console::network::Testnet3; + use console::network::MainnetV0; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; #[test] fn test_varuna() { diff --git a/synthesizer/snark/src/proof/parse.rs b/synthesizer/snark/src/proof/parse.rs index 9ce603dfc0..9fc9fdd3a0 100644 --- a/synthesizer/snark/src/proof/parse.rs +++ b/synthesizer/snark/src/proof/parse.rs @@ -72,9 +72,9 @@ impl Display for Proof { #[cfg(test)] mod tests { use super::*; - use console::network::Testnet3; + use console::network::MainnetV0; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; #[test] fn test_parse() -> Result<()> { diff --git a/synthesizer/src/vm/execute.rs b/synthesizer/src/vm/execute.rs index 7d9231ade8..b27626504d 100644 --- a/synthesizer/src/vm/execute.rs +++ b/synthesizer/src/vm/execute.rs @@ -208,7 +208,7 @@ mod tests { use super::*; use console::{ account::{Address, ViewKey}, - network::Testnet3, + network::MainnetV0, program::{Ciphertext, Value}, types::Field, }; @@ -217,7 +217,7 @@ mod tests { use indexmap::IndexMap; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; fn prepare_vm( rng: &mut TestRng, diff --git a/synthesizer/src/vm/helpers/macros.rs b/synthesizer/src/vm/helpers/macros.rs index 16911566e3..e0c67c08c4 100644 --- a/synthesizer/src/vm/helpers/macros.rs +++ b/synthesizer/src/vm/helpers/macros.rs @@ -15,19 +15,19 @@ /// A helper macro to downcast a `$variable` to `$object<$network>`. #[macro_export] macro_rules! cast_ref { - // Example: cast_ref!((foo.bar()) as Bar) + // Example: cast_ref!((foo.bar()) as Bar) (($variable:expr) as $object:ident<$($traits:path),+>) => {{ (&$variable as &dyn std::any::Any) .downcast_ref::<$object<$($traits),+>>() .ok_or_else(|| anyhow!("Failed to downcast {}", stringify!($variable)))? }}; - // Example: cast_ref!(bar as Bar) + // Example: cast_ref!(bar as Bar) ($variable:ident as $object:ident<$($traits:path),+>) => {{ (&$variable as &dyn std::any::Any) .downcast_ref::<$object<$($traits),+>>() .ok_or_else(|| anyhow!("Failed to downcast {}", stringify!($variable)))? }}; - // Example: cast_ref!(&bar as Bar) + // Example: cast_ref!(&bar as Bar) (&$variable:ident as $object:ident<$($traits:path),+>) => {{ ($variable as &dyn std::any::Any) .downcast_ref::<$object<$($traits),+>>() @@ -38,13 +38,13 @@ macro_rules! cast_ref { /// A helper macro to downcast a `$variable` to `&mut $object<$network>`. #[macro_export] macro_rules! cast_mut_ref { - // Example: cast_mut_ref!((foo.bar()) as Bar) + // Example: cast_mut_ref!((foo.bar()) as Bar) (($variable:expr) as $object:ident<$($traits:path),+>) => {{ (&mut $variable as &mut dyn std::any::Any) .downcast_mut::<$object<$($traits),+>>() .ok_or_else(|| anyhow!("Failed to downcast mut {}", stringify!($variable)))? }}; - // Example: cast_mut_ref!(bar as Bar) + // Example: cast_mut_ref!(bar as Bar) ($variable:ident as $object:ident<$($traits:path),+>) => {{ (&mut $variable as &mut dyn std::any::Any) .downcast_mut::<$object<$($traits),+>>() @@ -58,13 +58,13 @@ macro_rules! process { // Example: process!(self, logic) ($self:ident, $logic:ident) => {{ match N::ID { - console::network::Testnet3::ID => { + console::network::MainnetV0::ID => { // Cast the process. let process = (&$self.process as &dyn std::any::Any) - .downcast_ref::>>>() + .downcast_ref::>>>() .ok_or_else(|| anyhow!("Failed to downcast {}", stringify!($self.process)))?; // Process the logic. - $logic!(process.read(), console::network::Testnet3, circuit::AleoV0) + $logic!(process.read(), console::network::MainnetV0, circuit::AleoV0) } _ => bail!("Unsupported VM configuration for network: {}", N::ID), } diff --git a/synthesizer/src/vm/helpers/rewards.rs b/synthesizer/src/vm/helpers/rewards.rs index ae5f9d4fba..8395643012 100644 --- a/synthesizer/src/vm/helpers/rewards.rs +++ b/synthesizer/src/vm/helpers/rewards.rs @@ -131,7 +131,7 @@ mod tests { use indexmap::indexmap; - type CurrentNetwork = console::network::Testnet3; + type CurrentNetwork = console::network::MainnetV0; const ITERATIONS: usize = 1000; diff --git a/synthesizer/src/vm/mod.rs b/synthesizer/src/vm/mod.rs index a24d2c89c0..998092b7ff 100644 --- a/synthesizer/src/vm/mod.rs +++ b/synthesizer/src/vm/mod.rs @@ -363,7 +363,7 @@ pub(crate) mod test_helpers { use super::*; use console::{ account::{Address, ViewKey}, - network::Testnet3, + network::MainnetV0, program::Value, types::Field, }; @@ -376,7 +376,7 @@ pub(crate) mod test_helpers { use std::borrow::Borrow; use synthesizer_snark::VerifyingKey; - pub(crate) type CurrentNetwork = Testnet3; + pub(crate) type CurrentNetwork = MainnetV0; /// Samples a new finalize state. pub(crate) fn sample_finalize_state(block_height: u32) -> FinalizeGlobalState { @@ -641,11 +641,11 @@ function compute: } pub fn sample_next_block( - vm: &VM>, - private_key: &PrivateKey, - transactions: &[Transaction], + vm: &VM>, + private_key: &PrivateKey, + transactions: &[Transaction], rng: &mut R, - ) -> Result> { + ) -> Result> { // Get the most recent block. let block_hash = vm.block_store().get_block_hash(*vm.block_store().heights().max().unwrap().borrow()).unwrap().unwrap(); @@ -658,16 +658,16 @@ function compute: // Construct the metadata associated with the block. let metadata = Metadata::new( - Testnet3::ID, + MainnetV0::ID, previous_block.round() + 1, previous_block.height() + 1, 0, 0, - Testnet3::GENESIS_COINBASE_TARGET, - Testnet3::GENESIS_PROOF_TARGET, + MainnetV0::GENESIS_COINBASE_TARGET, + MainnetV0::GENESIS_PROOF_TARGET, previous_block.last_coinbase_target(), previous_block.last_coinbase_timestamp(), - Testnet3::GENESIS_TIMESTAMP + 1, + MainnetV0::GENESIS_TIMESTAMP + 1, )?; let header = Header::from( @@ -820,7 +820,7 @@ finalize getter: .execute( &caller_private_key, ("test_program_1.aleo", "init"), - Vec::>::new().iter(), + Vec::>::new().iter(), Some(third_record), 1, None, @@ -831,7 +831,7 @@ finalize getter: .execute( &caller_private_key, ("test_program_2.aleo", "init"), - Vec::>::new().iter(), + Vec::>::new().iter(), Some(fourth_record), 1, None, @@ -1009,9 +1009,9 @@ function multitransfer: // Execute the programs. let inputs = [ - Value::::Record(record_1), - Value::::from_str(&address.to_string()).unwrap(), - Value::::from_str("10u64").unwrap(), + Value::::Record(record_1), + Value::::from_str(&address.to_string()).unwrap(), + Value::::from_str("10u64").unwrap(), ]; let execution = vm .execute( diff --git a/synthesizer/tests/utilities/mod.rs b/synthesizer/tests/utilities/mod.rs index 36bbebaadc..665327b579 100644 --- a/synthesizer/tests/utilities/mod.rs +++ b/synthesizer/tests/utilities/mod.rs @@ -25,7 +25,7 @@ #![allow(unused)] pub type CurrentAleo = circuit::network::AleoV0; -pub type CurrentNetwork = console::network::Testnet3; +pub type CurrentNetwork = console::network::MainnetV0; pub mod expectation; pub use expectation::*; diff --git a/vm/cli/commands/mod.rs b/vm/cli/commands/mod.rs index 68f71186e3..93475a3e48 100644 --- a/vm/cli/commands/mod.rs +++ b/vm/cli/commands/mod.rs @@ -44,5 +44,5 @@ use std::collections::HashMap; pub const LOCALE: &num_format::Locale = &num_format::Locale::en; -pub(crate) type CurrentNetwork = crate::prelude::Testnet3; +pub(crate) type CurrentNetwork = crate::prelude::MainnetV0; pub(crate) type Aleo = crate::circuit::AleoV0; diff --git a/vm/cli/helpers/env.rs b/vm/cli/helpers/env.rs index ed41cafc72..8e8c725ac0 100644 --- a/vm/cli/helpers/env.rs +++ b/vm/cli/helpers/env.rs @@ -18,7 +18,7 @@ use anyhow::{anyhow, Result}; fn env_template() -> String { r#" -NETWORK=testnet3 +NETWORK=mainnet PRIVATE_KEY={{PASTE_YOUR_PRIVATE_KEY_HERE}} "# .to_string() diff --git a/vm/file/aleo.rs b/vm/file/aleo.rs index bae28c6b2c..4d22626117 100644 --- a/vm/file/aleo.rs +++ b/vm/file/aleo.rs @@ -241,7 +241,7 @@ mod tests { use super::*; use crate::prelude::Parser; - type CurrentNetwork = snarkvm_console::network::Testnet3; + type CurrentNetwork = snarkvm_console::network::MainnetV0; fn temp_dir() -> std::path::PathBuf { tempfile::tempdir().expect("Failed to open temporary directory").into_path() diff --git a/vm/file/avm.rs b/vm/file/avm.rs index ac252d87ed..2fbdd1af40 100644 --- a/vm/file/avm.rs +++ b/vm/file/avm.rs @@ -181,7 +181,7 @@ mod tests { use super::*; use crate::prelude::Parser; - type CurrentNetwork = snarkvm_console::network::Testnet3; + type CurrentNetwork = snarkvm_console::network::MainnetV0; fn temp_dir() -> std::path::PathBuf { tempfile::tempdir().expect("Failed to open temporary directory").into_path() diff --git a/vm/file/prover.rs b/vm/file/prover.rs index 69d4ad8369..740971849d 100644 --- a/vm/file/prover.rs +++ b/vm/file/prover.rs @@ -198,7 +198,7 @@ mod tests { synthesizer::Process, }; - type CurrentNetwork = snarkvm_console::network::Testnet3; + type CurrentNetwork = snarkvm_console::network::MainnetV0; type CurrentAleo = snarkvm_circuit::AleoV0; fn temp_dir() -> std::path::PathBuf { diff --git a/vm/file/verifier.rs b/vm/file/verifier.rs index aaa664bd43..2def859ed1 100644 --- a/vm/file/verifier.rs +++ b/vm/file/verifier.rs @@ -198,7 +198,7 @@ mod tests { synthesizer::Process, }; - type CurrentNetwork = snarkvm_console::network::Testnet3; + type CurrentNetwork = snarkvm_console::network::MainnetV0; type CurrentAleo = snarkvm_circuit::AleoV0; fn temp_dir() -> std::path::PathBuf { diff --git a/vm/package/clean.rs b/vm/package/clean.rs index 561041c6d1..0d1859a78c 100644 --- a/vm/package/clean.rs +++ b/vm/package/clean.rs @@ -49,7 +49,7 @@ impl Package { mod tests { use super::*; - type CurrentNetwork = snarkvm_console::network::Testnet3; + type CurrentNetwork = snarkvm_console::network::MainnetV0; type CurrentAleo = snarkvm_circuit::network::AleoV0; #[test] diff --git a/vm/package/deploy.rs b/vm/package/deploy.rs index cc3ec45644..ebc04a447e 100644 --- a/vm/package/deploy.rs +++ b/vm/package/deploy.rs @@ -168,7 +168,7 @@ impl Package { mod tests { use super::*; - type CurrentNetwork = snarkvm_console::network::Testnet3; + type CurrentNetwork = snarkvm_console::network::MainnetV0; type CurrentAleo = snarkvm_circuit::network::AleoV0; #[test] diff --git a/vm/package/is_build_required.rs b/vm/package/is_build_required.rs index 0ce4a9253f..a7cec05183 100644 --- a/vm/package/is_build_required.rs +++ b/vm/package/is_build_required.rs @@ -65,17 +65,17 @@ impl Package { #[cfg(test)] mod tests { use super::*; - use snarkvm_console::network::Testnet3; + use snarkvm_console::network::MainnetV0; use std::{fs::File, io::Write}; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; type Aleo = crate::circuit::AleoV0; fn temp_dir() -> PathBuf { tempfile::tempdir().expect("Failed to open temporary directory").into_path() } - fn initialize_unbuilt_package(valid: bool) -> Result> { + fn initialize_unbuilt_package(valid: bool) -> Result> { // Initialize a temporary directory. let directory = temp_dir(); @@ -99,7 +99,7 @@ mod tests { std::fs::create_dir_all(build_directory).unwrap(); // Open the package at the temporary directory. - Package::::open(&directory) + Package::::open(&directory) } fn program_with_id(id: &str) -> String { diff --git a/vm/package/mod.rs b/vm/package/mod.rs index 87f383df83..7568a01e5a 100644 --- a/vm/package/mod.rs +++ b/vm/package/mod.rs @@ -180,11 +180,11 @@ impl Package { #[cfg(test)] pub(crate) mod test_helpers { use super::*; - use snarkvm_console::{account::Address, network::Testnet3, prelude::TestRng}; + use snarkvm_console::{account::Address, network::MainnetV0, prelude::TestRng}; use std::{fs::File, io::Write}; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; fn temp_dir() -> PathBuf { tempfile::tempdir().expect("Failed to open temporary directory").into_path() @@ -389,7 +389,7 @@ function main: let _manifest_file = Manifest::create(&directory, main_program_id).unwrap(); // Open the package at the temporary directory. - let package = Package::::open(&directory).unwrap(); + let package = Package::::open(&directory).unwrap(); assert_eq!(package.program_id(), main_program_id); // Return the temporary directory and the package. @@ -465,11 +465,11 @@ function main: #[cfg(test)] mod tests { use super::*; - use crate::prelude::Testnet3; + use crate::prelude::MainnetV0; use snarkvm_utilities::TestRng; type CurrentAleo = snarkvm_circuit::network::AleoV0; - type CurrentNetwork = Testnet3; + type CurrentNetwork = MainnetV0; #[test] fn test_imports_directory() { diff --git a/wasm/src/tests.rs b/wasm/src/tests.rs index 8cdc5e17f8..5610df5b39 100644 --- a/wasm/src/tests.rs +++ b/wasm/src/tests.rs @@ -14,7 +14,7 @@ use snarkvm_console::{ account::{Address, PrivateKey, ViewKey}, - network::Testnet3, + network::MainnetV0, }; use snarkvm_utilities::TestRng; @@ -29,7 +29,7 @@ fn test_account() { const ALEO_VIEW_KEY: &str = "AViewKey1n1n3ZbnVEtXVe3La2xWkUvY3EY7XaCG6RZJJ3tbvrrrD"; const ALEO_ADDRESS: &str = "aleo1wvgwnqvy46qq0zemj0k6sfp3zv0mp77rw97khvwuhac05yuwscxqmfyhwf"; - let private_key = PrivateKey::::from_str(ALEO_PRIVATE_KEY).unwrap(); + let private_key = PrivateKey::::from_str(ALEO_PRIVATE_KEY).unwrap(); assert_eq!(ALEO_PRIVATE_KEY, private_key.to_string()); let view_key = ViewKey::try_from(&private_key).unwrap(); @@ -45,7 +45,7 @@ fn test_account_sign() { for _ in 0..ITERATIONS { // Sample a new private key and address. - let private_key = PrivateKey::::new(&mut rng).unwrap(); + let private_key = PrivateKey::::new(&mut rng).unwrap(); let address = Address::try_from(&private_key).unwrap(); // Sign a message with the account private key. From 62bce0440360e2a58838795bfd1d6afa17a6acdf Mon Sep 17 00:00:00 2001 From: Howard Wu <9260812+howardwu@users.noreply.github.com> Date: Sat, 10 Feb 2024 18:06:14 -0800 Subject: [PATCH 293/298] Update block --- .../src/mainnet/resources/block.genesis | Bin 13989 -> 13989 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/parameters/src/mainnet/resources/block.genesis b/parameters/src/mainnet/resources/block.genesis index c0b70008f2a92015b92e27c553c3f262cd95c718..8bf59e26b4130ec3950e2e8c0aa97e077fd04a07 100644 GIT binary patch delta 11312 zcmZwN1yfwzwl3gq+-clBxNFeh0fM_b1PJa&$;J*Q$E!neP|{_67D-Ko7zNde<&;e=7A0`9||Md$&Pyt^YBFvZ#_GEVpx`9N!kf-_z6z)MV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81OSat$_vO#0fq#};Wf(DE{Qm)b Cx9_|F From 5ed8c5362a79e9373a1f1dca58eb50245c097b0c Mon Sep 17 00:00:00 2001 From: Howard Wu <9260812+howardwu@users.noreply.github.com> Date: Sat, 10 Feb 2024 18:12:38 -0800 Subject: [PATCH 294/298] Update URL pathways --- console/network/src/mainnet_v0.rs | 2 +- ledger/query/src/query.rs | 12 ++++++------ parameters/src/mainnet/mod.rs | 2 +- vm/cli/commands/build.rs | 2 +- vm/package/execute.rs | 2 +- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/console/network/src/mainnet_v0.rs b/console/network/src/mainnet_v0.rs index 21ad90a8e6..edada2f3a0 100644 --- a/console/network/src/mainnet_v0.rs +++ b/console/network/src/mainnet_v0.rs @@ -136,7 +136,7 @@ impl Network for MainnetV0 { /// The network ID. const ID: u16 = 0; /// The function name for the inclusion circuit. - const INCLUSION_FUNCTION_NAME: &'static str = snarkvm_parameters::mainnet::TESTNET3_INCLUSION_FUNCTION_NAME; + const INCLUSION_FUNCTION_NAME: &'static str = snarkvm_parameters::mainnet::NETWORK_INCLUSION_FUNCTION_NAME; /// The network name. const NAME: &'static str = "Aleo Mainnet (v0)"; diff --git a/ledger/query/src/query.rs b/ledger/query/src/query.rs index e4fbfd29e3..f925c51b39 100644 --- a/ledger/query/src/query.rs +++ b/ledger/query/src/query.rs @@ -66,7 +66,7 @@ impl> QueryTrait for Query { match self { Self::VM(block_store) => Ok(block_store.current_state_root()), Self::REST(url) => match N::ID { - 3 => Ok(Self::get_request(&format!("{url}/testnet3/latest/stateRoot"))?.into_json()?), + 3 => Ok(Self::get_request(&format!("{url}/mainnet/latest/stateRoot"))?.into_json()?), _ => bail!("Unsupported network ID in inclusion query"), }, } @@ -78,7 +78,7 @@ impl> QueryTrait for Query { match self { Self::VM(block_store) => Ok(block_store.current_state_root()), Self::REST(url) => match N::ID { - 3 => Ok(Self::get_request_async(&format!("{url}/testnet3/latest/stateRoot")).await?.json().await?), + 3 => Ok(Self::get_request_async(&format!("{url}/mainnet/latest/stateRoot")).await?.json().await?), _ => bail!("Unsupported network ID in inclusion query"), }, } @@ -89,7 +89,7 @@ impl> QueryTrait for Query { match self { Self::VM(block_store) => block_store.get_state_path_for_commitment(commitment), Self::REST(url) => match N::ID { - 3 => Ok(Self::get_request(&format!("{url}/testnet3/statePath/{commitment}"))?.into_json()?), + 3 => Ok(Self::get_request(&format!("{url}/mainnet/statePath/{commitment}"))?.into_json()?), _ => bail!("Unsupported network ID in inclusion query"), }, } @@ -102,7 +102,7 @@ impl> QueryTrait for Query { Self::VM(block_store) => block_store.get_state_path_for_commitment(commitment), Self::REST(url) => match N::ID { 3 => { - Ok(Self::get_request_async(&format!("{url}/testnet3/statePath/{commitment}")).await?.json().await?) + Ok(Self::get_request_async(&format!("{url}/mainnet/statePath/{commitment}")).await?.json().await?) } _ => bail!("Unsupported network ID in inclusion query"), }, @@ -118,7 +118,7 @@ impl> Query { block_store.get_program(program_id)?.ok_or_else(|| anyhow!("Program {program_id} not found in storage")) } Self::REST(url) => match N::ID { - 3 => Ok(Self::get_request(&format!("{url}/testnet3/program/{program_id}"))?.into_json()?), + 3 => Ok(Self::get_request(&format!("{url}/mainnet/program/{program_id}"))?.into_json()?), _ => bail!("Unsupported network ID in inclusion query"), }, } @@ -132,7 +132,7 @@ impl> Query { block_store.get_program(program_id)?.ok_or_else(|| anyhow!("Program {program_id} not found in storage")) } Self::REST(url) => match N::ID { - 3 => Ok(Self::get_request_async(&format!("{url}/testnet3/program/{program_id}")).await?.json().await?), + 3 => Ok(Self::get_request_async(&format!("{url}/mainnet/program/{program_id}")).await?.json().await?), _ => bail!("Unsupported network ID in inclusion query"), }, } diff --git a/parameters/src/mainnet/mod.rs b/parameters/src/mainnet/mod.rs index 5112f329c6..dfb2db50d6 100644 --- a/parameters/src/mainnet/mod.rs +++ b/parameters/src/mainnet/mod.rs @@ -149,7 +149,7 @@ impl_remote!(InclusionProver, REMOTE_URL, "resources/", "inclusion", "prover"); impl_local!(InclusionVerifier, "resources/", "inclusion", "verifier"); /// The function name for the inclusion circuit. -pub const TESTNET3_INCLUSION_FUNCTION_NAME: &str = "inclusion"; +pub const NETWORK_INCLUSION_FUNCTION_NAME: &str = "inclusion"; lazy_static! { pub static ref INCLUSION_PROVING_KEY: Vec = diff --git a/vm/cli/commands/build.rs b/vm/cli/commands/build.rs index 671ca61554..ac72b101f8 100644 --- a/vm/cli/commands/build.rs +++ b/vm/cli/commands/build.rs @@ -41,7 +41,7 @@ impl Build { // package.build::(match self.offline { // true => None, - // false => Some(endpoint.unwrap_or("https://vm.aleo.org/testnet3/build".to_string())), + // false => Some(endpoint.unwrap_or("https://api.explorer.aleo.org/v0/mainnet/build".to_string())), // })?; // Prepare the path string. diff --git a/vm/package/execute.rs b/vm/package/execute.rs index e075e8de86..190ef66199 100644 --- a/vm/package/execute.rs +++ b/vm/package/execute.rs @@ -117,7 +117,7 @@ mod tests { type CurrentAleo = snarkvm_circuit::network::AleoV0; - // TODO: Re-enable this test after `staging` is merged into `testnet3` for the October 18, 2023 calibration reset. + // TODO: Re-enable this test after `mainnet`. #[test] #[ignore] fn test_execute() { From b08c6fcb6dc672b0e808562c5eb2325339fd5033 Mon Sep 17 00:00:00 2001 From: Howard Wu <9260812+howardwu@users.noreply.github.com> Date: Sat, 10 Feb 2024 18:55:50 -0800 Subject: [PATCH 295/298] Update parameters --- SECURITY.md | 10 ++-------- parameters/scripts/README.md | 2 +- parameters/src/mainnet/mod.rs | 2 +- .../src/mainnet/resources/block.genesis | Bin 13989 -> 13989 bytes .../mainnet/resources/bond_public.metadata | 4 ++-- .../mainnet/resources/bond_public.verifier | Bin 665 -> 665 bytes .../resources/claim_unbond_public.metadata | 4 ++-- .../resources/claim_unbond_public.verifier | Bin 665 -> 665 bytes .../mainnet/resources/fee_private.metadata | 4 ++-- .../mainnet/resources/fee_private.verifier | Bin 665 -> 665 bytes .../src/mainnet/resources/fee_public.metadata | 4 ++-- .../src/mainnet/resources/fee_public.verifier | Bin 665 -> 665 bytes .../src/mainnet/resources/join.metadata | 4 ++-- .../src/mainnet/resources/join.verifier | Bin 665 -> 665 bytes .../resources/set_validator_state.metadata | 4 ++-- .../resources/set_validator_state.verifier | Bin 665 -> 665 bytes .../src/mainnet/resources/split.metadata | 4 ++-- .../src/mainnet/resources/split.verifier | Bin 665 -> 665 bytes .../resources/transfer_private.metadata | 4 ++-- .../resources/transfer_private.verifier | Bin 665 -> 665 bytes .../transfer_private_to_public.metadata | 4 ++-- .../transfer_private_to_public.verifier | Bin 665 -> 665 bytes .../resources/transfer_public.metadata | 4 ++-- .../resources/transfer_public.verifier | Bin 665 -> 665 bytes .../transfer_public_to_private.metadata | 4 ++-- .../transfer_public_to_private.verifier | Bin 665 -> 665 bytes .../unbond_delegator_as_validator.metadata | 4 ++-- .../unbond_delegator_as_validator.verifier | Bin 665 -> 665 bytes .../mainnet/resources/unbond_public.metadata | 4 ++-- .../mainnet/resources/unbond_public.verifier | Bin 665 -> 665 bytes synthesizer/process/src/verify_fee.rs | 8 ++++---- 31 files changed, 34 insertions(+), 40 deletions(-) diff --git a/SECURITY.md b/SECURITY.md index 57be86957f..9111a21e49 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -2,16 +2,10 @@ The following describes our procedure for addressing major and minor security concerns in snarkVM. -## Testnet - -As Aleo is currently in the prototype stage and does not operate a platform intended for production use, -our security procedures are designed to promote public disclosure and quick security resolution. - -In preparation for the production stage, we will release new security guidelines and -issue new procedures for addressing the disclosure of sensitive security vulnerabilities. +Our security procedures are designed to promote public disclosure and quick security resolution. ### Reporting a Bug -During Testnet, all software bugs should be reported by filing a Github issue. +All software bugs should be reported by filing a Github issue. If you are unsure and would like to reach out to us directly, please email security \_at\_ aleo.org to elaborate on the issue. diff --git a/parameters/scripts/README.md b/parameters/scripts/README.md index 12185721de..02dd421eb7 100644 --- a/parameters/scripts/README.md +++ b/parameters/scripts/README.md @@ -1,6 +1,6 @@ # Parameter Scripts These scripts will run the parameter setup programs in the `examples` folder and move the resulting `.params` -and `.checksum` files to `testnet*` folder under the `src` directory. +and `.checksum` files to `mainnet*` folder under the `src` directory. If the parameter size has changed, you will need to manually update these in each corresponding struct. diff --git a/parameters/src/mainnet/mod.rs b/parameters/src/mainnet/mod.rs index dfb2db50d6..23fdd63c72 100644 --- a/parameters/src/mainnet/mod.rs +++ b/parameters/src/mainnet/mod.rs @@ -18,7 +18,7 @@ pub use genesis::*; pub mod powers; pub use powers::*; -const REMOTE_URL: &str = "https://s3-us-west-1.amazonaws.com/testnet3.parameters"; +const REMOTE_URL: &str = "https://s3-us-west-1.amazonaws.com/mainnet.parameters"; // Degrees #[cfg(not(feature = "wasm"))] diff --git a/parameters/src/mainnet/resources/block.genesis b/parameters/src/mainnet/resources/block.genesis index 8bf59e26b4130ec3950e2e8c0aa97e077fd04a07..a18eb8c0527cd572d0b6a6eaec2b75c78f6095b0 100644 GIT binary patch delta 11270 zcmZwNV{}}5!2bQ27!#X~ZL_h_*lKJyPG(}GVPhMOZ8vrrHb$eyXz=gpS?5{z{j7Ul z?>Dp8Uf=y$*Zvhd6g!XuxzyN5PrU-LA_29s)F~&(^}`?MK6_fs@C|*Be(mgq`%ErI zmIZQ`x1=gzZGj&jII^&g(5X8VUU@&67wlg*0a;-LeGd9Asw!|}pX@#*BobxU1{X4Q8;pNyp?qPW+M>%Y+63fhu&Y^EckVhYtAh$~eC# z3HOB^y84R=HxnyDmIQ}L5tHJf8NiuH^NOXkI3plSf0AZRSby^tjn~<|R!xSCMUy?A z93&tVV48&7;G3Z#(8v1_eVL?8Tt$+|w7s0WTC!7_NsnM2K|2=NzMh+mwF%nd-j>|N zfH-t<-sEZf+ms7L}#l< ze(iZM{-RjQnO6zZvZ?pvA&tC`BmEksFjGqf!A00E`i5GGblCI#HRdId} zA&|(taza1=f*fqjT%FA9T`kOQ+}$VvP(XkIR``+H67NK74yPLG3S9(&J0-?%N`)gy zMii7%);g$BX8A{AI@7XZOa+u-969=qYA6QQUQ6GM_Oc@gGYv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XuyInS zjvN!`L<_?z=gi{+Wd@g|p%Lm)6PQM53yVz_7`#q71|-lGx9+^~qE7@N6rIGHTx9sK zNMkvj(Xg(H4UsGBz4-^4$BI+^vF{wl_q`-^vX}w>3${*qA|sTC!6~X2U?GVl$_#om z`hy|{(K(+2?e@M<+i_TJd^5e!GBbbEs+bpuK%`4QN@jkS>vT2ZO|EG%e#1T>OLUi; zm*KY9v`56Ocfa*zk;{RI|G7Z0cUclLFF<$Ivf-8C*4-!4xZbLAV6Y&d(A2Q&mLV_` zBD5bOlTR$$8}o4h~U;^!_l0ekRuVUGz`DybWyj^JhgL-TbGa zdq#!fs2~*9b@o3zgni%);D>$lkGF;d*72||CW2JesnI%h_j!=n&G0 zg4R3;<%{d$6L~5bTxn7a^{>H!x%d5)v>_s3kO8|QVMKMuCJJXUSbCXPVgmNhtTaov z6*BtX&KC|EMNlqgwusR3KiKB1s+li z5wPH7r>MmI@#Zy8z#P8~lSTQ*_7cNaO83;S{;kXhmq%yAG@Xp6tB0(O|0*mY}h z*nQ;+L_8zLA8oU|KJ?el!fr7ieB+6I! O4ooB`RZJx0i~c`6@wL_f diff --git a/parameters/src/mainnet/resources/bond_public.metadata b/parameters/src/mainnet/resources/bond_public.metadata index 66d68b2599..d6e3d20801 100644 --- a/parameters/src/mainnet/resources/bond_public.metadata +++ b/parameters/src/mainnet/resources/bond_public.metadata @@ -1,6 +1,6 @@ { - "prover_checksum": "65098917d1ab18982d0dd2eb1cc84d90e9a454d9e19a2b0997221303996b8e95", + "prover_checksum": "81d3f2b91a7c9c1e788edefedef4ac136be4f1d65bb05c9675e59e6d6da843c2", "prover_size": 28928250, - "verifier_checksum": "7b2d0c51c6405e485335315f1290817b9d65a847b9262f303f8cb277328761c3", + "verifier_checksum": "26790f191f07b5814f5f324e417603e79cae78cd986a8bb98c248ac5816b48cc", "verifier_size": 665 } \ No newline at end of file diff --git a/parameters/src/mainnet/resources/bond_public.verifier b/parameters/src/mainnet/resources/bond_public.verifier index 38ec524663b803e82707d6d768a412f4178ded07..0adbec27db9a021af6184fa6cfa6005b9b643417 100644 GIT binary patch delta 141 zcmV;80CNAC1(^k~=>cG9jczsj@4gUtHZZhLfuAi2RhN4Vy}<{ zqMdte;7VKq5Uh vP_$B!U||81Ndhn+#-e=IbV6y>0^*Fz9d{*GLU8p0^i(KArzQ^mZx$Ejez8Em delta 141 zcmV;80CNAC1(^k~=>cH6NXWKJ0sEpwqp3zZhDHe386TDAZZ|n4dRf_eHF{fM_yQ*s z`++bUbJ~LG5e)#kOsSVnR^|0{xfi24^WEcG9w8<_`Rme$I2eyKVI7A-1MD))uG?g3gJe!8_9Mg>20W=w_ zp$JCRtxoMyIEDc(K~zefFJjV0Dcf^X%{V&)?8%(jg%>!kE2;k_N@EUN*!dE(q#$T5 vY`}@^n}mRqNdhn+Z94RcF#WOPP-+gOKSffE6K6dr=u{C9FW3yN_)g(U1G*a)?0c diff --git a/parameters/src/mainnet/resources/fee_private.metadata b/parameters/src/mainnet/resources/fee_private.metadata index a89e55dc6c..ae797e9eae 100644 --- a/parameters/src/mainnet/resources/fee_private.metadata +++ b/parameters/src/mainnet/resources/fee_private.metadata @@ -1,6 +1,6 @@ { - "prover_checksum": "5c772cfef2162bab617896279a8501da1783c99707c727e5ed56c8d18f5d6402", + "prover_checksum": "27b72ed5e8086127f8cfcfc94b8c63543e5901a368a3f782aedcb51f9ace738e", "prover_size": 66297972, - "verifier_checksum": "1075880f54492556fe8fc728dba26029a2888dd7672d15630c463a0bdc7e95c4", + "verifier_checksum": "099648c5dcbb0eb8c7f1031195273f5e1375831cda977711f487fbed7e33bb20", "verifier_size": 665 } \ No newline at end of file diff --git a/parameters/src/mainnet/resources/fee_private.verifier b/parameters/src/mainnet/resources/fee_private.verifier index 7ba5fbe39a8fdf138dae5aae40cde2eed97bf91e..7756de8de887b0ac450d17c79644aca9008647b5 100644 GIT binary patch delta 141 zcmV;80CNAC1(^k~=>cGmTf{6tL8Y36GSz+r0(c_1OU?0O6hH=TM0u&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(m-%mxNgF@5)&@iWX50OaT{z_1D}Ee;-iUw8P~) v0u0P#1ZDw~Ndhn+D;2(OIDeETE-K33rIKHV1w?Xviku3(MdC?ua_9kw)PqBV diff --git a/parameters/src/mainnet/resources/transfer_private_to_public.metadata b/parameters/src/mainnet/resources/transfer_private_to_public.metadata index 5b45c362e5..ed72b09d1b 100644 --- a/parameters/src/mainnet/resources/transfer_private_to_public.metadata +++ b/parameters/src/mainnet/resources/transfer_private_to_public.metadata @@ -1,6 +1,6 @@ { - "prover_checksum": "a7b14687479d6b7bd46de7787f622b94c3e8cf581750384ed88ec1afdf1be7f1", + "prover_checksum": "4c0561cf4342c601ccd49eee4c039711c2e2cf92a01b0b3a58b7f1242e902ceb", "prover_size": 66299476, - "verifier_checksum": "17570750a8b64b839b77b07ed95a963f0d57b7a322945833e0b45b6593f2942a", + "verifier_checksum": "be9a2abeeb2c9c5dcea11582f1869e0b1447b45ebfad5582604903ce338da405", "verifier_size": 665 } \ No newline at end of file diff --git a/parameters/src/mainnet/resources/transfer_private_to_public.verifier b/parameters/src/mainnet/resources/transfer_private_to_public.verifier index 607ec3cc1e9fe90ed1d1ac5249848338046b42af..77b4ab602b3ebc9aa3dbb6a0386372d5aacbd59c 100644 GIT binary patch delta 141 zcmV;80CNAC1(^k~=>cG{#EP1zX<~x7^~b&61&Hzt>|d_MqY@d?D3>e{&ryCHw`Qjh z`OzS(|Lcn`RE{6G@hq_}DAn;2RUHQ1Q?*>QULQcTPBtzezBNmCDT vvH3xM!f%0-Ndhn+R|Gpuv@LELz|@25;{5ajWvhk_Ux`7JMNxw>@Cqg)84yL} delta 141 zcmV;80CNAC1(^k~=>cG+KDP}|mus8R31!Eek;iIdYO@}@ElbUR;Q~1*yg?~iCa2gU z<=hfsmZRmI@^%2MXFO_VBKAr1>fMO)hB#j`y`@?jAjgTBM4q|7bx?0`a$e=+%5JbY vN`CJzJct34Ndhn+mDV0=>~e@2rU!m3iwlWW3utuI*ywUyOy%BdSt=-8g@i&U diff --git a/parameters/src/mainnet/resources/transfer_public.metadata b/parameters/src/mainnet/resources/transfer_public.metadata index 3aa747f944..876e221125 100644 --- a/parameters/src/mainnet/resources/transfer_public.metadata +++ b/parameters/src/mainnet/resources/transfer_public.metadata @@ -1,6 +1,6 @@ { - "prover_checksum": "f71fbfb10baa00a009b88bea8ca75106672dbf701ed65bf180dc538f832ae9a7", + "prover_checksum": "f8e5f6437b945174b62313ece8a1c9dcbeac5dfff5b0fef2e968c9b92f86da06", "prover_size": 28913482, - "verifier_checksum": "0ac9e58c93e3f2cdf2fc652a412ca963a78c08f3d1e4abc1abbfd758e1a62940", + "verifier_checksum": "5facdc35d2205f3a90a7a2eb89fa1418beabc6f6393e18d6498c60f02a3185e3", "verifier_size": 665 } \ No newline at end of file diff --git a/parameters/src/mainnet/resources/transfer_public.verifier b/parameters/src/mainnet/resources/transfer_public.verifier index 774b18f54814bcd3672c7dcbb833a696dfe8c3d0..1089392f46578aa6e08374dde5f9b841c8a1c609 100644 GIT binary patch delta 141 zcmV;80CNAC1(^k~=>cG^RI+LI8Tj%b`ypCnu%a4AXc*4K!;-CAQ?Sx`Me59Zr3@Z5 z3=tG(0amofM2i3oS&ZEI!81a$9uu|?Muq4tH(8i3)sjSt#Kw!AjAmbUsgMj40@5ko v=3m?_!JmMWNdhn+g>)>8Q_x`tUt0|dh3PE$tI+1Tu_`ltrVSU5+c3sI_FzCT delta 141 zcmV;80CNAC1(^k~=>cGk7Ji}?!H{2gHs3ei^GpTz{MG`xBRi$cb&BJ{`6OE`+^2SC zJ`NbW-)DU?MHhjRAA@3=I{J;&sEg5d^Hn@wO{A)^F1s<}TyGFJ(K>vCHcNdhn+7-odlOtowH$m$puTC%oK(&R<%jJ#cF>Z$qV39>eS|>YiSVYImhZan!?NsWzUd`~$}E71$8GYKi>` z$_?wNRg5G6erEu2&q38j&w&93D$A{VH=gF0t=0eN@E(T=*;?#=$1VOvs%dkpNiDp% v#gTvZ8H)jvNdhn+f+=oeUsO=a0tI7=$jW9~2-+~>hbK!i8bx9$uE}_d5YIxz delta 141 zcmV;80CNAC1(^k~=>cH-IN`Ker8<1dpOKJ4RMD-wUrzFs9M4?S@_u6hM^QwV1O@oM zcL#$BZ7R~|GgtwH;dn_)?_<|b_s1H%P+w(;D=)#$4{Rrb?PQ>?b~o+m+-%vHG7}eA vZWk@!UOoVmNdhn+9qfaMb`)8Qlf3?|vI0FYt3Gz+wL#j~HW6d|SUNKJt3yIT diff --git a/parameters/src/mainnet/resources/unbond_delegator_as_validator.metadata b/parameters/src/mainnet/resources/unbond_delegator_as_validator.metadata index 54e91fdd4f..d1e5ca6e66 100644 --- a/parameters/src/mainnet/resources/unbond_delegator_as_validator.metadata +++ b/parameters/src/mainnet/resources/unbond_delegator_as_validator.metadata @@ -1,6 +1,6 @@ { - "prover_checksum": "17aeeb53b8d1eb53ce30662a83ae9889a86fbbc8af09015f0f0af972c9041720", + "prover_checksum": "785f2318f0c12b883b99ff1649cf401d2f1d024fe2dd30916a276cd8c199f757", "prover_size": 27062250, - "verifier_checksum": "cdea9c3350d6f9059769782e3c3d41ca651633a9a0cd874195a298f4d20fa684", + "verifier_checksum": "34f8fb353c7c1a4e590b52000d78bf28100328f6250eb6c9ef11c9dc0a2bb066", "verifier_size": 665 } \ No newline at end of file diff --git a/parameters/src/mainnet/resources/unbond_delegator_as_validator.verifier b/parameters/src/mainnet/resources/unbond_delegator_as_validator.verifier index 4be3dc30102d8e35f5c204934cbdccab71b269ec..2f245c62d33e7ea025e799d959287c973565bb7b 100644 GIT binary patch delta 141 zcmV;80CNAC1(^k~=>cHJFab^XnC;QtYKc-&=`YG4y3KjSwgTt2$JNWu4ut?6I`FtG zRfcNqss;E*W&(idnd`etr5YNgwJn^+cH%_~k8_RTbgw)`QcJ$wy6jmPI{@0(S2HLi;gFN`FWm@4j{8 z2oI(EJd!3F$AAFQ&C*s%i1BKE4+(pSvxNYli<_9BA=Khr2RPHZrk6L95x*NJsZ}A) vVes4;f_{LLNdhn+4{?Cr5=|ww`}+SCR4(j#A$Y;_uw>A$eD>CuNWKsYPcE{!xTFcc#oa$Pz+3n$YiP%n9=WR#c0!R%<^wvv-n`$5ys8? zj19BW94L0h$8G>UqHgE6pE8bb;}zhewsaqh#~n#;GQ)csx_8kgiR%;cCMu60g=UK= v9au6AC=r2^Ndhn+8i?A|-Zm>HEcAnLPhJU=0U+ZE!~y#)hOYNWjE9hfpiMy1 delta 141 zcmV;80CNAC1(^k~=>cHXA2NM3d}0QKS;*^-wv3J_SDoM@|1O|80wJa4vVFap78xM9 z3(ZR$D7rXxq~!olg8rEX^qa4elgA1{9!^|3oW~z7+zV>#x9J`2ry@&v#SpMSJ@{0W vtmtaIm4gA3Ndhn+!%pTaPJ{J6^=viL9ivKOm;mY^Gr4U};9=cS0p_2g%x*zl diff --git a/synthesizer/process/src/verify_fee.rs b/synthesizer/process/src/verify_fee.rs index dc3a18bf74..71b92dafc5 100644 --- a/synthesizer/process/src/verify_fee.rs +++ b/synthesizer/process/src/verify_fee.rs @@ -239,17 +239,17 @@ mod tests { // Compute the deployment ID. let deployment_id = deployment.to_deployment_id().unwrap(); // Verify the fee. - assert!(process.verify_fee(&fee, deployment_id).is_ok()); + process.verify_fee(&fee, deployment_id).unwrap(); } Transaction::Execute(_, execution, fee) => { // Compute the execution ID. let execution_id = execution.to_execution_id().unwrap(); // Verify the fee. - assert!(process.verify_fee(&fee.unwrap(), execution_id).is_ok()); + process.verify_fee(&fee.unwrap(), execution_id).unwrap(); } Transaction::Fee(_, fee) => match fee.is_fee_private() { - true => assert!(process.verify_fee_private(&&fee).is_ok()), - false => assert!(process.verify_fee_public(&&fee).is_ok()), + true => process.verify_fee_private(&&fee).unwrap(), + false => process.verify_fee_public(&&fee).unwrap(), }, } } From 0987894bdda6eab77a1b42a77a81e75a45b7ff79 Mon Sep 17 00:00:00 2001 From: Howard Wu <9260812+howardwu@users.noreply.github.com> Date: Sat, 10 Feb 2024 19:14:52 -0800 Subject: [PATCH 296/298] Add conditional on aborted --- ledger/block/src/lib.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ledger/block/src/lib.rs b/ledger/block/src/lib.rs index d7e9bfd1ce..fb91937c93 100644 --- a/ledger/block/src/lib.rs +++ b/ledger/block/src/lib.rs @@ -160,7 +160,10 @@ impl Block { } // Ensure the block contains transactions. - ensure!(!transactions.is_empty(), "Cannot create a block with zero transactions"); + ensure!( + !transactions.is_empty() || !aborted_transaction_ids.is_empty(), + "Cannot create a block with zero transactions" + ); // Ensure the number of transactions is within the allowed range. if transactions.len() > Transactions::::MAX_TRANSACTIONS { From e6734324bb3363f8cf0f4a7f8985cd9c747e2204 Mon Sep 17 00:00:00 2001 From: Howard Wu <9260812+howardwu@users.noreply.github.com> Date: Sat, 10 Feb 2024 20:09:41 -0800 Subject: [PATCH 297/298] Update serialization and expectations --- synthesizer/src/vm/mod.rs | 2 +- .../arrays_in_finalize.out | 12 +- .../execute_and_finalize/child_and_parent.out | 20 +- .../complex_finalization.out | 12 +- .../vm/execute_and_finalize/count_usages.out | 14 +- .../vm/execute_and_finalize/hello.out | 20 +- .../many_input_and_output.out | 172 +++++++++--------- .../mapping_operations.out | 16 +- .../execute_and_finalize/mint_and_split.out | 2 +- .../execute_and_finalize/program_callable.out | 14 +- .../vm/execute_and_finalize/public_wallet.out | 6 +- .../read_external_mapping.out | 24 +-- .../vm/execute_and_finalize/test_branch.out | 12 +- .../vm/execute_and_finalize/test_rand.out | 20 +- .../vm/execute_and_finalize/timelock.out | 8 +- .../execute_and_finalize/unused_position.out | 4 +- .../vm/execute_and_finalize/user_callable.out | 6 +- 17 files changed, 182 insertions(+), 182 deletions(-) diff --git a/synthesizer/src/vm/mod.rs b/synthesizer/src/vm/mod.rs index 998092b7ff..1d7a2280cb 100644 --- a/synthesizer/src/vm/mod.rs +++ b/synthesizer/src/vm/mod.rs @@ -951,7 +951,7 @@ function a: // Note: `deployment_transaction_ids` is sorted lexicographically by transaction ID, so the order may change if we update internal methods. assert_eq!( deployment_transaction_ids, - vec![deployment_2.id(), deployment_1.id(), deployment_4.id(), deployment_3.id()], + vec![deployment_1.id(), deployment_2.id(), deployment_3.id(), deployment_4.id()], "Update me if serialization has changed" ); } diff --git a/synthesizer/tests/expectations/vm/execute_and_finalize/arrays_in_finalize.out b/synthesizer/tests/expectations/vm/execute_and_finalize/arrays_in_finalize.out index c824f27366..8217a54a60 100644 --- a/synthesizer/tests/expectations/vm/execute_and_finalize/arrays_in_finalize.out +++ b/synthesizer/tests/expectations/vm/execute_and_finalize/arrays_in_finalize.out @@ -4,15 +4,15 @@ outputs: execute: arrays_in_finalize.aleo/test_arrays: outputs: - - '{"type":"public","id":"7051868022199538281983484726334868585120214850709506400685648463568311074059field","value":"[\n [\n true,\n false,\n true,\n false\n ]\n]"}' - - '{"type":"public","id":"2698854010946894280403857018674102550683827066821274282398230616068613628761field","value":"[\n [\n false,\n true,\n false,\n true\n ]\n]"}' - - '{"type":"public","id":"6734503747161420974974766078278270196733130665586322841403208897932027830291field","value":"[\n [\n false,\n false,\n false,\n false\n ]\n]"}' - - '{"type":"private","id":"5168391188395506111029592681206431247443904847166129464977071139926165416103field","value":"ciphertext1qvqrg9enxaw2x8xm8ce0c8xz80envgf2p4hyfr9p2rx0mqfjm303spra4893t20aekwz55slyz7y9j3pln2ul2qx5qmtsxhut9vg0yf2q59xuu5fr3x6pczq932km4n476v2arehnst66ppuxkghhwtdsz8qqpdkmdl"}' - - '{"type":"future","id":"4517957061576175622472518204577133206661336185041169936924799458890521883925field","value":"{\n program_id: arrays_in_finalize.aleo,\n function_name: test_arrays,\n arguments: [\n [\n [\n true,\n false,\n true,\n false\n ]\n],\n [\n [\n false,\n true,\n false,\n true\n ]\n]\n ]\n}"}' + - '{"type":"public","id":"4191132437526469726810078556702976385142790887134762205329564706486407091452field","value":"[\n [\n true,\n false,\n true,\n false\n ]\n]"}' + - '{"type":"public","id":"7732313354599796556273728553000823036918857772412470351533433477903799198179field","value":"[\n [\n false,\n true,\n false,\n true\n ]\n]"}' + - '{"type":"public","id":"5608636510680839107900624676979657593964288488498543523280649635497192868408field","value":"[\n [\n false,\n false,\n false,\n false\n ]\n]"}' + - '{"type":"private","id":"17838117880873163791217811658586530829235665776709065547754152530705294791field","value":"ciphertext1qvqgms88ec4yhlndrj62c2eupwvd4u3efn4u2dtgl6gd29ll52y87z7ncynzwv9ntktucne95h0mvgdstwsqejzhv5klrg9cn2se2g7xqhlr94w0j6h7m0nt2l0deyg2c7hfud0s8r8euldthva35k4k7u0sc44p593"}' + - '{"type":"future","id":"1297781464149960028797060285986265412679573504857528613822702946616595852889field","value":"{\n program_id: arrays_in_finalize.aleo,\n function_name: test_arrays,\n arguments: [\n [\n [\n true,\n false,\n true,\n false\n ]\n],\n [\n [\n false,\n true,\n false,\n true\n ]\n]\n ]\n}"}' speculate: the execution was accepted add_next_block: succeeded. additional: - child_outputs: credits.aleo/fee_public: outputs: - - '{"type":"future","id":"4377505400197346320325166594762058980060035444514726670451291598609377642278field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1y9t0y4lvhm43qdzlfjmfzh8985vfnx9ms368p07x5lsemet5ey8qt0ssjn,\n 7030u64\n ]\n}"}' + - '{"type":"future","id":"2715104495799396615741890969708845641129834494989002430629962063572161077357field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1y9t0y4lvhm43qdzlfjmfzh8985vfnx9ms368p07x5lsemet5ey8qt0ssjn,\n 7030u64\n ]\n}"}' diff --git a/synthesizer/tests/expectations/vm/execute_and_finalize/child_and_parent.out b/synthesizer/tests/expectations/vm/execute_and_finalize/child_and_parent.out index 476d6d637d..5e175be82e 100644 --- a/synthesizer/tests/expectations/vm/execute_and_finalize/child_and_parent.out +++ b/synthesizer/tests/expectations/vm/execute_and_finalize/child_and_parent.out @@ -4,30 +4,30 @@ outputs: execute: child.aleo/foo: outputs: - - '{"type":"public","id":"8257993261519343122023101166480151323931323787055034156941189634399210202459field","value":"aleo1qr2ha4pfs5l28aze88yn6fhleeythklkczrule2v838uwj65n5gqxt9djx"}' - - '{"type":"public","id":"188190518969019844021095872841035661635298121101628545721182533596213107162field","value":"aleo1qr2ha4pfs5l28aze88yn6fhleeythklkczrule2v838uwj65n5gqxt9djx"}' + - '{"type":"public","id":"5080102022926418909778330219071921101316828719441748927127931330249058015974field","value":"aleo1qr2ha4pfs5l28aze88yn6fhleeythklkczrule2v838uwj65n5gqxt9djx"}' + - '{"type":"public","id":"5521854961454308608590219862110836142563484399396636760251296039833599837132field","value":"aleo1qr2ha4pfs5l28aze88yn6fhleeythklkczrule2v838uwj65n5gqxt9djx"}' speculate: the execution was accepted add_next_block: succeeded. - verified: true execute: parent.aleo/foo: outputs: - - '{"type":"public","id":"5659858974486313466575226260845503816979591587276786620624467407599116914038field","value":"aleo16w8t56s7v6ud7vu33fr388ph0dq0c7yhp597cyjt88rr3nultcyqcyk9yy"}' - - '{"type":"public","id":"2284865988687012438785552090811369628576124923682194722522318003600012047529field","value":"aleo1qr2ha4pfs5l28aze88yn6fhleeythklkczrule2v838uwj65n5gqxt9djx"}' - - '{"type":"public","id":"8179726172313399939265670838540366852175382310921990612683156165949485580171field","value":"aleo1qr2ha4pfs5l28aze88yn6fhleeythklkczrule2v838uwj65n5gqxt9djx"}' - - '{"type":"public","id":"6136647598927890396739645454509256562231663381292425428013956117563111804111field","value":"aleo1qr2ha4pfs5l28aze88yn6fhleeythklkczrule2v838uwj65n5gqxt9djx"}' + - '{"type":"public","id":"2180349836718516623986527660803091459313965700848712055858720506742956053113field","value":"aleo16w8t56s7v6ud7vu33fr388ph0dq0c7yhp597cyjt88rr3nultcyqcyk9yy"}' + - '{"type":"public","id":"2306297960481221498781231131707036686317070776613275725765479488798926222971field","value":"aleo1qr2ha4pfs5l28aze88yn6fhleeythklkczrule2v838uwj65n5gqxt9djx"}' + - '{"type":"public","id":"629884147589344887679757377742438552594075704621211994352632325954728373873field","value":"aleo1qr2ha4pfs5l28aze88yn6fhleeythklkczrule2v838uwj65n5gqxt9djx"}' + - '{"type":"public","id":"7179043812459822888643137487185719660290943898185113409588571501637751887110field","value":"aleo1qr2ha4pfs5l28aze88yn6fhleeythklkczrule2v838uwj65n5gqxt9djx"}' speculate: the execution was accepted add_next_block: succeeded. additional: - child_outputs: credits.aleo/fee_public: outputs: - - '{"type":"future","id":"4193852777105201569735062214533514773129433748132976330865503683138607715780field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1qr2ha4pfs5l28aze88yn6fhleeythklkczrule2v838uwj65n5gqxt9djx,\n 1276u64\n ]\n}"}' + - '{"type":"future","id":"3347872470791009142460537022787342626917524637524821339588032366241763021507field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1qr2ha4pfs5l28aze88yn6fhleeythklkczrule2v838uwj65n5gqxt9djx,\n 1276u64\n ]\n}"}' - child_outputs: child.aleo/foo: outputs: - - '{"type":"public","id":"8198940315425398645135948347803651217596158581421876066209083610850686200351field","value":"aleo16w8t56s7v6ud7vu33fr388ph0dq0c7yhp597cyjt88rr3nultcyqcyk9yy"}' - - '{"type":"public","id":"3917485763512771512439229660054620197118945473924338831496641922296791545909field","value":"aleo1qr2ha4pfs5l28aze88yn6fhleeythklkczrule2v838uwj65n5gqxt9djx"}' + - '{"type":"public","id":"2143480774914597553325855510339405850073067321902916033740995314914236889071field","value":"aleo16w8t56s7v6ud7vu33fr388ph0dq0c7yhp597cyjt88rr3nultcyqcyk9yy"}' + - '{"type":"public","id":"1500133418795634855889959966479039744505030118146228739798986109415104921004field","value":"aleo1qr2ha4pfs5l28aze88yn6fhleeythklkczrule2v838uwj65n5gqxt9djx"}' credits.aleo/fee_public: outputs: - - '{"type":"future","id":"4709277201101508382627424837739523940171678083116221637642206810066192947343field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1qr2ha4pfs5l28aze88yn6fhleeythklkczrule2v838uwj65n5gqxt9djx,\n 2187u64\n ]\n}"}' + - '{"type":"future","id":"7038990688216256894209117299702421152482248481717682799780559802515876924307field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1qr2ha4pfs5l28aze88yn6fhleeythklkczrule2v838uwj65n5gqxt9djx,\n 2187u64\n ]\n}"}' diff --git a/synthesizer/tests/expectations/vm/execute_and_finalize/complex_finalization.out b/synthesizer/tests/expectations/vm/execute_and_finalize/complex_finalization.out index 0a3673e69a..9c615c77fa 100644 --- a/synthesizer/tests/expectations/vm/execute_and_finalize/complex_finalization.out +++ b/synthesizer/tests/expectations/vm/execute_and_finalize/complex_finalization.out @@ -4,23 +4,23 @@ outputs: execute: four_program.aleo/a: outputs: - - '{"type":"future","id":"6998380252357500798386967612861409092158524423455257610860233087309437860154field","value":"{\n program_id: four_program.aleo,\n function_name: a,\n arguments: [\n {\n program_id: two_program.aleo,\n function_name: b,\n arguments: [\n {\n program_id: zero_program.aleo,\n function_name: c,\n arguments: [\n aleo1kw4knandael9qcpxs6g36rr6h7dwvjz6q25ueah6zz9v57zjlvxsx5llq8\n ]\n },\n {\n program_id: one_program.aleo,\n function_name: d,\n arguments: [\n aleo1kw4knandael9qcpxs6g36rr6h7dwvjz6q25ueah6zz9v57zjlvxsx5llq8\n ]\n },\n aleo1kw4knandael9qcpxs6g36rr6h7dwvjz6q25ueah6zz9v57zjlvxsx5llq8\n ]\n },\n {\n program_id: three_program.aleo,\n function_name: e,\n arguments: [\n {\n program_id: two_program.aleo,\n function_name: b,\n arguments: [\n {\n program_id: zero_program.aleo,\n function_name: c,\n arguments: [\n aleo1kw4knandael9qcpxs6g36rr6h7dwvjz6q25ueah6zz9v57zjlvxsx5llq8\n ]\n },\n {\n program_id: one_program.aleo,\n function_name: d,\n arguments: [\n aleo1kw4knandael9qcpxs6g36rr6h7dwvjz6q25ueah6zz9v57zjlvxsx5llq8\n ]\n },\n aleo1kw4knandael9qcpxs6g36rr6h7dwvjz6q25ueah6zz9v57zjlvxsx5llq8\n ]\n },\n {\n program_id: one_program.aleo,\n function_name: d,\n arguments: [\n aleo1kw4knandael9qcpxs6g36rr6h7dwvjz6q25ueah6zz9v57zjlvxsx5llq8\n ]\n },\n {\n program_id: zero_program.aleo,\n function_name: c,\n arguments: [\n aleo1kw4knandael9qcpxs6g36rr6h7dwvjz6q25ueah6zz9v57zjlvxsx5llq8\n ]\n },\n aleo1kw4knandael9qcpxs6g36rr6h7dwvjz6q25ueah6zz9v57zjlvxsx5llq8\n ]\n },\n aleo1kw4knandael9qcpxs6g36rr6h7dwvjz6q25ueah6zz9v57zjlvxsx5llq8\n ]\n}"}' + - '{"type":"future","id":"8073961850697502005201723808473879821579356096451187824496987505478189255390field","value":"{\n program_id: four_program.aleo,\n function_name: a,\n arguments: [\n {\n program_id: two_program.aleo,\n function_name: b,\n arguments: [\n {\n program_id: zero_program.aleo,\n function_name: c,\n arguments: [\n aleo1kw4knandael9qcpxs6g36rr6h7dwvjz6q25ueah6zz9v57zjlvxsx5llq8\n ]\n },\n {\n program_id: one_program.aleo,\n function_name: d,\n arguments: [\n aleo1kw4knandael9qcpxs6g36rr6h7dwvjz6q25ueah6zz9v57zjlvxsx5llq8\n ]\n },\n aleo1kw4knandael9qcpxs6g36rr6h7dwvjz6q25ueah6zz9v57zjlvxsx5llq8\n ]\n },\n {\n program_id: three_program.aleo,\n function_name: e,\n arguments: [\n {\n program_id: two_program.aleo,\n function_name: b,\n arguments: [\n {\n program_id: zero_program.aleo,\n function_name: c,\n arguments: [\n aleo1kw4knandael9qcpxs6g36rr6h7dwvjz6q25ueah6zz9v57zjlvxsx5llq8\n ]\n },\n {\n program_id: one_program.aleo,\n function_name: d,\n arguments: [\n aleo1kw4knandael9qcpxs6g36rr6h7dwvjz6q25ueah6zz9v57zjlvxsx5llq8\n ]\n },\n aleo1kw4knandael9qcpxs6g36rr6h7dwvjz6q25ueah6zz9v57zjlvxsx5llq8\n ]\n },\n {\n program_id: one_program.aleo,\n function_name: d,\n arguments: [\n aleo1kw4knandael9qcpxs6g36rr6h7dwvjz6q25ueah6zz9v57zjlvxsx5llq8\n ]\n },\n {\n program_id: zero_program.aleo,\n function_name: c,\n arguments: [\n aleo1kw4knandael9qcpxs6g36rr6h7dwvjz6q25ueah6zz9v57zjlvxsx5llq8\n ]\n },\n aleo1kw4knandael9qcpxs6g36rr6h7dwvjz6q25ueah6zz9v57zjlvxsx5llq8\n ]\n },\n aleo1kw4knandael9qcpxs6g36rr6h7dwvjz6q25ueah6zz9v57zjlvxsx5llq8\n ]\n}"}' speculate: the execution was accepted add_next_block: succeeded. additional: - child_outputs: zero_program.aleo/c: outputs: - - '{"type":"future","id":"6474810957906539673522536973574444941819182578686500986059184970228567776990field","value":"{\n program_id: zero_program.aleo,\n function_name: c,\n arguments: [\n aleo1kw4knandael9qcpxs6g36rr6h7dwvjz6q25ueah6zz9v57zjlvxsx5llq8\n ]\n}"}' + - '{"type":"future","id":"2137985455651054628126680275240269432054325301779207101612589772241739981165field","value":"{\n program_id: zero_program.aleo,\n function_name: c,\n arguments: [\n aleo1kw4knandael9qcpxs6g36rr6h7dwvjz6q25ueah6zz9v57zjlvxsx5llq8\n ]\n}"}' one_program.aleo/d: outputs: - - '{"type":"future","id":"2284370192295255845302224777470466828981075133309722155924689750590667987972field","value":"{\n program_id: one_program.aleo,\n function_name: d,\n arguments: [\n aleo1kw4knandael9qcpxs6g36rr6h7dwvjz6q25ueah6zz9v57zjlvxsx5llq8\n ]\n}"}' + - '{"type":"future","id":"5357241693223765542321433170179413948506257034844568471556820282679708829796field","value":"{\n program_id: one_program.aleo,\n function_name: d,\n arguments: [\n aleo1kw4knandael9qcpxs6g36rr6h7dwvjz6q25ueah6zz9v57zjlvxsx5llq8\n ]\n}"}' two_program.aleo/b: outputs: - - '{"type":"future","id":"7683124799914168846002043533287386527848546597477854511743024652449265994214field","value":"{\n program_id: two_program.aleo,\n function_name: b,\n arguments: [\n {\n program_id: zero_program.aleo,\n function_name: c,\n arguments: [\n aleo1kw4knandael9qcpxs6g36rr6h7dwvjz6q25ueah6zz9v57zjlvxsx5llq8\n ]\n },\n {\n program_id: one_program.aleo,\n function_name: d,\n arguments: [\n aleo1kw4knandael9qcpxs6g36rr6h7dwvjz6q25ueah6zz9v57zjlvxsx5llq8\n ]\n },\n aleo1kw4knandael9qcpxs6g36rr6h7dwvjz6q25ueah6zz9v57zjlvxsx5llq8\n ]\n}"}' + - '{"type":"future","id":"237175359371682654344610765795273369747408298587655173055205899746835808177field","value":"{\n program_id: two_program.aleo,\n function_name: b,\n arguments: [\n {\n program_id: zero_program.aleo,\n function_name: c,\n arguments: [\n aleo1kw4knandael9qcpxs6g36rr6h7dwvjz6q25ueah6zz9v57zjlvxsx5llq8\n ]\n },\n {\n program_id: one_program.aleo,\n function_name: d,\n arguments: [\n aleo1kw4knandael9qcpxs6g36rr6h7dwvjz6q25ueah6zz9v57zjlvxsx5llq8\n ]\n },\n aleo1kw4knandael9qcpxs6g36rr6h7dwvjz6q25ueah6zz9v57zjlvxsx5llq8\n ]\n}"}' three_program.aleo/e: outputs: - - '{"type":"future","id":"1924141467746445803895332427121150983883397442046587101238781615037989484141field","value":"{\n program_id: three_program.aleo,\n function_name: e,\n arguments: [\n {\n program_id: two_program.aleo,\n function_name: b,\n arguments: [\n {\n program_id: zero_program.aleo,\n function_name: c,\n arguments: [\n aleo1kw4knandael9qcpxs6g36rr6h7dwvjz6q25ueah6zz9v57zjlvxsx5llq8\n ]\n },\n {\n program_id: one_program.aleo,\n function_name: d,\n arguments: [\n aleo1kw4knandael9qcpxs6g36rr6h7dwvjz6q25ueah6zz9v57zjlvxsx5llq8\n ]\n },\n aleo1kw4knandael9qcpxs6g36rr6h7dwvjz6q25ueah6zz9v57zjlvxsx5llq8\n ]\n },\n {\n program_id: one_program.aleo,\n function_name: d,\n arguments: [\n aleo1kw4knandael9qcpxs6g36rr6h7dwvjz6q25ueah6zz9v57zjlvxsx5llq8\n ]\n },\n {\n program_id: zero_program.aleo,\n function_name: c,\n arguments: [\n aleo1kw4knandael9qcpxs6g36rr6h7dwvjz6q25ueah6zz9v57zjlvxsx5llq8\n ]\n },\n aleo1kw4knandael9qcpxs6g36rr6h7dwvjz6q25ueah6zz9v57zjlvxsx5llq8\n ]\n}"}' + - '{"type":"future","id":"3616852843624887241027320225932142757072575594346925293061443696405638714355field","value":"{\n program_id: three_program.aleo,\n function_name: e,\n arguments: [\n {\n program_id: two_program.aleo,\n function_name: b,\n arguments: [\n {\n program_id: zero_program.aleo,\n function_name: c,\n arguments: [\n aleo1kw4knandael9qcpxs6g36rr6h7dwvjz6q25ueah6zz9v57zjlvxsx5llq8\n ]\n },\n {\n program_id: one_program.aleo,\n function_name: d,\n arguments: [\n aleo1kw4knandael9qcpxs6g36rr6h7dwvjz6q25ueah6zz9v57zjlvxsx5llq8\n ]\n },\n aleo1kw4knandael9qcpxs6g36rr6h7dwvjz6q25ueah6zz9v57zjlvxsx5llq8\n ]\n },\n {\n program_id: one_program.aleo,\n function_name: d,\n arguments: [\n aleo1kw4knandael9qcpxs6g36rr6h7dwvjz6q25ueah6zz9v57zjlvxsx5llq8\n ]\n },\n {\n program_id: zero_program.aleo,\n function_name: c,\n arguments: [\n aleo1kw4knandael9qcpxs6g36rr6h7dwvjz6q25ueah6zz9v57zjlvxsx5llq8\n ]\n },\n aleo1kw4knandael9qcpxs6g36rr6h7dwvjz6q25ueah6zz9v57zjlvxsx5llq8\n ]\n}"}' credits.aleo/fee_public: outputs: - - '{"type":"future","id":"7684699263458955489500469434952154401333918354263231036610964274134089849729field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1kw4knandael9qcpxs6g36rr6h7dwvjz6q25ueah6zz9v57zjlvxsx5llq8,\n 264403u64\n ]\n}"}' + - '{"type":"future","id":"3688989155399268747449856447722119301454464433397170543411114503201565062667field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1kw4knandael9qcpxs6g36rr6h7dwvjz6q25ueah6zz9v57zjlvxsx5llq8,\n 264403u64\n ]\n}"}' diff --git a/synthesizer/tests/expectations/vm/execute_and_finalize/count_usages.out b/synthesizer/tests/expectations/vm/execute_and_finalize/count_usages.out index b24c3cd022..15b34329e9 100644 --- a/synthesizer/tests/expectations/vm/execute_and_finalize/count_usages.out +++ b/synthesizer/tests/expectations/vm/execute_and_finalize/count_usages.out @@ -4,20 +4,20 @@ outputs: execute: count_usages.aleo/add_and_subtract: outputs: - - '{"type":"private","id":"5995165900489236048724189329217011788885182262230664342189030052523170979761field","value":"ciphertext1qyq9fpp2wkapda6cfaprteayg2gjzn66n5nxtfje93r83crs2zmv2qcsx08xs"}' - - '{"type":"future","id":"6684150603764937916097990120387351299053371864904660697581502582495528413682field","value":"{\n program_id: count_usages.aleo,\n function_name: add_and_subtract,\n arguments: [\n {\n program_id: basic_math.aleo,\n function_name: add_and_count,\n arguments: [\n aleo1mrughg5ssadd9fc2uwve7l6u24xn76kyz24zsjtzta03vgkq4vpqggl6fg\n ]\n },\n {\n program_id: basic_math.aleo,\n function_name: sub_and_count,\n arguments: [\n aleo1mrughg5ssadd9fc2uwve7l6u24xn76kyz24zsjtzta03vgkq4vpqggl6fg\n ]\n }\n \n ]\n}"}' + - '{"type":"private","id":"2417893162182175688334393632212980126051692937961342515862782307223843642037field","value":"ciphertext1qyqrdme34cnf0dd08er9nelae88tnvs8g4f3pgpp43pf6j0t75kjvqslqv9d7"}' + - '{"type":"future","id":"705166902367251294198915856269600161357499171183853434375951230037519647203field","value":"{\n program_id: count_usages.aleo,\n function_name: add_and_subtract,\n arguments: [\n {\n program_id: basic_math.aleo,\n function_name: add_and_count,\n arguments: [\n aleo1mrughg5ssadd9fc2uwve7l6u24xn76kyz24zsjtzta03vgkq4vpqggl6fg\n ]\n },\n {\n program_id: basic_math.aleo,\n function_name: sub_and_count,\n arguments: [\n aleo1mrughg5ssadd9fc2uwve7l6u24xn76kyz24zsjtzta03vgkq4vpqggl6fg\n ]\n }\n \n ]\n}"}' speculate: the execution was accepted add_next_block: succeeded. additional: - child_outputs: basic_math.aleo/add_and_count: outputs: - - '{"type":"private","id":"2931416906152139217500676601684895559278058810555470402379383863215944694889field","value":"ciphertext1qyqvksr0mn8etdpt5ud8esh45ux7kwpkt3xe4c6wslz2egz38kdcvyg8lsc2w"}' - - '{"type":"future","id":"5218930982418005953215765906617041537918799720819403880991199101629363614321field","value":"{\n program_id: basic_math.aleo,\n function_name: add_and_count,\n arguments: [\n aleo1mrughg5ssadd9fc2uwve7l6u24xn76kyz24zsjtzta03vgkq4vpqggl6fg\n ]\n}"}' + - '{"type":"private","id":"399020463587132384720173345030999750182171151859286922026595618170323893845field","value":"ciphertext1qyq0ec250xje9hyr36a6256sajhjgypznc0ckq9rckcx9hvqqe6expcfm3th0"}' + - '{"type":"future","id":"7862022176391501831567513125389433398315612742902989311778410598142695342538field","value":"{\n program_id: basic_math.aleo,\n function_name: add_and_count,\n arguments: [\n aleo1mrughg5ssadd9fc2uwve7l6u24xn76kyz24zsjtzta03vgkq4vpqggl6fg\n ]\n}"}' basic_math.aleo/sub_and_count: outputs: - - '{"type":"private","id":"3488605564553623263445079384158588906615626998185976594325667750922281211548field","value":"ciphertext1qyqdgjwlgtweqah8dzgelyhzpk0jsxckr28n2tdtwfzmnzjj7d2zwzqms26nn"}' - - '{"type":"future","id":"8376420147018709384724335862198143063714524641135069419096866845262064600524field","value":"{\n program_id: basic_math.aleo,\n function_name: sub_and_count,\n arguments: [\n aleo1mrughg5ssadd9fc2uwve7l6u24xn76kyz24zsjtzta03vgkq4vpqggl6fg\n ]\n}"}' + - '{"type":"private","id":"2166485610255156621966882910457223948921992536665120764477666903342640510503field","value":"ciphertext1qyqy23z6n3fnm773zq9y4c5syrppp0c28fs2a0wh7t49wljydkjr5ygdylh70"}' + - '{"type":"future","id":"6356013747296129460342419348497415908695385595173072937771394894236053328119field","value":"{\n program_id: basic_math.aleo,\n function_name: sub_and_count,\n arguments: [\n aleo1mrughg5ssadd9fc2uwve7l6u24xn76kyz24zsjtzta03vgkq4vpqggl6fg\n ]\n}"}' credits.aleo/fee_public: outputs: - - '{"type":"future","id":"1938790837765091012488580924817661279880431670012907855909045111976774319119field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1kw4knandael9qcpxs6g36rr6h7dwvjz6q25ueah6zz9v57zjlvxsx5llq8,\n 54628u64\n ]\n}"}' + - '{"type":"future","id":"1585223826336342113009963588330628410761295667183024829434599712242938930728field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1kw4knandael9qcpxs6g36rr6h7dwvjz6q25ueah6zz9v57zjlvxsx5llq8,\n 54628u64\n ]\n}"}' diff --git a/synthesizer/tests/expectations/vm/execute_and_finalize/hello.out b/synthesizer/tests/expectations/vm/execute_and_finalize/hello.out index ece9240964..6d1c9d0566 100644 --- a/synthesizer/tests/expectations/vm/execute_and_finalize/hello.out +++ b/synthesizer/tests/expectations/vm/execute_and_finalize/hello.out @@ -4,46 +4,46 @@ outputs: execute: hello.aleo/hello: outputs: - - '{"type":"private","id":"5614495356603750498135893718149497613043561511832919802810225365170046755923field","value":"ciphertext1qyq88y70cav8grzelac7neap9xpazde4c2l32nqc3k4lvghxtpvegzgzg4k77"}' + - '{"type":"private","id":"3176121404187786053742476608354607969269791944150504812747549421863574954935field","value":"ciphertext1qyqwch85jv880t8dxlr9xs9crgjgp4ksn8kkeln2kz9qph7ahyyngpcda2dye"}' speculate: the execution was accepted add_next_block: succeeded. - verified: true execute: hello.aleo/hello: outputs: - - '{"type":"private","id":"5846203644134005241685407588279763961599502145912037616385648077427742296434field","value":"ciphertext1qyqthzxggdnrwyymmgkv8slllxrq8tmtltunsrf4dcrhgcdwt4dnqqqysj50a"}' + - '{"type":"private","id":"1150202079184853991998868214382005296145686294524629420497502839491280451550field","value":"ciphertext1qyqqh50g4ajk2j5ql8kgfkmqslyvddqrr3e54q7me8l8s2nm04zh6pcpyyud3"}' speculate: the execution was accepted add_next_block: succeeded. - verified: true execute: hello.aleo/goodbye: outputs: - - '{"type":"public","id":"2642075470205745915437917544815624260503750815963975814259588973697216004583field","value":"1u32"}' - - '{"type":"future","id":"361930204229325680459927289502858977396610521545960746195272244038942015328field","value":"{\n program_id: hello.aleo,\n function_name: goodbye,\n arguments: [\n 1u32,\n 1u32\n ]\n}"}' + - '{"type":"public","id":"3480118852870382894144865857822175070946589099724278834594029902836667201534field","value":"1u32"}' + - '{"type":"future","id":"5509833946703133090359961819746633556337352648574994721286932795133496169216field","value":"{\n program_id: hello.aleo,\n function_name: goodbye,\n arguments: [\n 1u32,\n 1u32\n ]\n}"}' speculate: the execution was accepted add_next_block: succeeded. - verified: true execute: hello.aleo/goodbye: outputs: - - '{"type":"public","id":"550576093903942253365649001372853409216678285833302653743507502904817079079field","value":"1u32"}' - - '{"type":"future","id":"1100347856065732999293020778220654433001118051401564613677868274591240788877field","value":"{\n program_id: hello.aleo,\n function_name: goodbye,\n arguments: [\n 0u32,\n 1u32\n ]\n}"}' + - '{"type":"public","id":"6056606855582681195495740332496796887918173012819660623567958555764517366236field","value":"1u32"}' + - '{"type":"future","id":"1191890728151228917136236794360467496329820983929439085349301662870546796031field","value":"{\n program_id: hello.aleo,\n function_name: goodbye,\n arguments: [\n 0u32,\n 1u32\n ]\n}"}' speculate: the execution was rejected add_next_block: succeeded. additional: - child_outputs: credits.aleo/fee_public: outputs: - - '{"type":"future","id":"723398708416943965679286433509907489867610392336969928855182538567932233441field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo10knkelvnd55fsaarm25wch7p9suf2tqlgwy5k4nxwms6d262xyfqm2tccr,\n 1317u64\n ]\n}"}' + - '{"type":"future","id":"4794226115128098661953863457300334535735190584732192888559305107927143173518field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo10knkelvnd55fsaarm25wch7p9suf2tqlgwy5k4nxwms6d262xyfqm2tccr,\n 1317u64\n ]\n}"}' - child_outputs: credits.aleo/fee_public: outputs: - - '{"type":"future","id":"7500061893088709501926458874103429937756473156907366818228322418371799987083field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo10knkelvnd55fsaarm25wch7p9suf2tqlgwy5k4nxwms6d262xyfqm2tccr,\n 1317u64\n ]\n}"}' + - '{"type":"future","id":"1739624830440070888681272394177400670284937130272704360430655837962148942436field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo10knkelvnd55fsaarm25wch7p9suf2tqlgwy5k4nxwms6d262xyfqm2tccr,\n 1317u64\n ]\n}"}' - child_outputs: credits.aleo/fee_public: outputs: - - '{"type":"future","id":"693105314299332215857089088059023707332082928469565896605175974356642396813field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo10knkelvnd55fsaarm25wch7p9suf2tqlgwy5k4nxwms6d262xyfqm2tccr,\n 2366u64\n ]\n}"}' + - '{"type":"future","id":"5590731974465655998543157332935394974986899946419756918684085895219128822776field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo10knkelvnd55fsaarm25wch7p9suf2tqlgwy5k4nxwms6d262xyfqm2tccr,\n 2366u64\n ]\n}"}' - child_outputs: credits.aleo/fee_public: outputs: - - '{"type":"future","id":"1441674302389531937522747153756222779025502860728835603548501000282337153942field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo10knkelvnd55fsaarm25wch7p9suf2tqlgwy5k4nxwms6d262xyfqm2tccr,\n 2366u64\n ]\n}"}' + - '{"type":"future","id":"432042030880064849076909676849286813284474825415060505835239570887258317130field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo10knkelvnd55fsaarm25wch7p9suf2tqlgwy5k4nxwms6d262xyfqm2tccr,\n 2366u64\n ]\n}"}' diff --git a/synthesizer/tests/expectations/vm/execute_and_finalize/many_input_and_output.out b/synthesizer/tests/expectations/vm/execute_and_finalize/many_input_and_output.out index 19abe30428..21cdc80309 100644 --- a/synthesizer/tests/expectations/vm/execute_and_finalize/many_input_and_output.out +++ b/synthesizer/tests/expectations/vm/execute_and_finalize/many_input_and_output.out @@ -10,66 +10,66 @@ outputs: execute: gas_dos.aleo/make_trash: outputs: - - '{"type":"public","id":"7328454421185929158618031230606034593549261051339602553507241025154825176299field","value":"0u8"}' - - '{"type":"public","id":"5145134703139278195441792859006011532400644423433046212536736013174180642636field","value":"1u8"}' - - '{"type":"public","id":"4479131570657126987170312036920068454738210783609610183168698498586355634960field","value":"2u8"}' - - '{"type":"public","id":"6926788178616354544370363073675930466260780102185705396446528307557204966254field","value":"3u8"}' - - '{"type":"public","id":"507213451235696529330091255380102539497181688387097808723590767226256138002field","value":"4u8"}' - - '{"type":"public","id":"6710585889229359056970878174557972819881050693904886470290761564643350681439field","value":"5u8"}' - - '{"type":"public","id":"2198039663990554661027013328856492399590215636668825518497257481407294029866field","value":"6u8"}' - - '{"type":"public","id":"288798117536072394573543619144317389906590429832415617777655870783774307012field","value":"7u8"}' - - '{"type":"public","id":"1155702003412000992412931135598868113644122882557716381602003061253381471571field","value":"8u8"}' - - '{"type":"public","id":"3026344388965712201801712548965204124836140425527882670365396322199812932565field","value":"9u8"}' - - '{"type":"public","id":"5492615319027225479113405102986959595495416506208321009285333238882415298049field","value":"10u8"}' - - '{"type":"public","id":"6171840640899438157036020226640325134210483852414199464033845647392969714320field","value":"11u8"}' - - '{"type":"public","id":"6575356095090949853056361212638757233924047161146463958636818761079464552340field","value":"12u8"}' - - '{"type":"public","id":"2262771770811842021838463874286351493506275646051705307544569163192903096597field","value":"13u8"}' - - '{"type":"public","id":"174469374038614532963809815011040883121008467567144862148413520935353623648field","value":"14u8"}' - - '{"type":"public","id":"8090171018295599961208092852988350550956162709304897310609315247476998706602field","value":"15u8"}' + - '{"type":"public","id":"6747157736748603480590286328272166026792595420044415085985565949658486836640field","value":"0u8"}' + - '{"type":"public","id":"649973566147243409550290245203382623458718713926298287005827875227629101586field","value":"1u8"}' + - '{"type":"public","id":"4715184471484114421621316918068835569036773074904095137588387911996155207218field","value":"2u8"}' + - '{"type":"public","id":"6010118718732002261351810375013950678580303457924654867349009010796624699379field","value":"3u8"}' + - '{"type":"public","id":"6333722332192433030784808291116138880151228199115059689497917707786299191732field","value":"4u8"}' + - '{"type":"public","id":"5888245555064288391430977044838182586435070649131417859369280771113057190243field","value":"5u8"}' + - '{"type":"public","id":"2705380664623532047544469249146152090862016550891767685765285532434095990009field","value":"6u8"}' + - '{"type":"public","id":"5519628389319624879328309620830309237982407537738349566389273882401739294201field","value":"7u8"}' + - '{"type":"public","id":"7997534825149575584899781068011514298311850117701142304696407678330173846824field","value":"8u8"}' + - '{"type":"public","id":"8351421848133987949134108689305992851517388701279810208886613680610063838811field","value":"9u8"}' + - '{"type":"public","id":"1040364973741132984216208872045302650189239516982574815007069482884664919083field","value":"10u8"}' + - '{"type":"public","id":"653656632487021611433829850348345841758372491630426780843163907813480449226field","value":"11u8"}' + - '{"type":"public","id":"1593623190274459185231022493182745978048719576581716602188209609143075467430field","value":"12u8"}' + - '{"type":"public","id":"7294419130461631769356218452308251405322881405358069999008200992226082717233field","value":"13u8"}' + - '{"type":"public","id":"1924392335704798525876601513574376180904631637832561294379847655890585101681field","value":"14u8"}' + - '{"type":"public","id":"5010979078364274103068904287124840185727981251110897531184800275512425378069field","value":"15u8"}' speculate: the execution was accepted add_next_block: succeeded. - verified: true execute: gas_dos.aleo/make_trash_private: outputs: - - '{"type":"private","id":"2680622265102100041993406647937919090940301114770765059104962140226246981264field","value":"ciphertext1qyqtjrpzy7zwvfmsv0xesjl8rv3lh86pwsuvrm4ynyra7x20nzy0crs3t4uvz"}' - - '{"type":"private","id":"5202743622607685269012784963172580544281870231936627246866565403414033171808field","value":"ciphertext1qyqvl9yhzzu8trer3fwdkgu5ftej28swpajmfle2lmqrpdsrcqd4wpq8nq56z"}' - - '{"type":"private","id":"2174891821791598891325907948165991966270654154109515635412257676350776525858field","value":"ciphertext1qyqg7tcq3lk4lm357j85e04ntlx7tlq88g25s094m08ce3pvk9wzypgxc25tn"}' - - '{"type":"private","id":"3482962903872689804786042821343967741876935213235592724563470495245964507635field","value":"ciphertext1qyqd33cyvv2007td963cng7ex5qpeqa9g8aztsyf9l4cs59zl9ph2rs29hdd8"}' - - '{"type":"private","id":"4440477798685620135379247884803156497847423337761130118347611024035653635140field","value":"ciphertext1qyq0959tkr8jfunfgl5wy0wwm9zrzvzc2ktuny7j4f4ekqpecphryqqgnwplj"}' - - '{"type":"private","id":"3522752929186128924758141077706371690810713792036167644523972417246682200901field","value":"ciphertext1qyqzllfkgvvz303zgsduenn79ru5nx0ynjw2vk3zxgz8sp0096smuzcf6e7vu"}' - - '{"type":"private","id":"3625214038066625726053665609852864682693494709445484792903274142479081890567field","value":"ciphertext1qyq9nnzfv5w4ct5k9xny0uquyrulaclng6mv7puml3x3pnam3ttespg8gq9dl"}' - - '{"type":"private","id":"1637083100938265104763821696269236866552161155548506891159616654219004830174field","value":"ciphertext1qyqtp60mtkjkysf7z5uyaluq4z35m3hehqj39en0rpggy249vfnvszgkjpy7c"}' - - '{"type":"private","id":"1090493810202308287957198910474311328876918772204234621365178737170948657938field","value":"ciphertext1qyqvjyy8d40h9sqwppf8n3z4ejechz823crx9j723u0gtapzy69vqzc7p2pfj"}' - - '{"type":"private","id":"7261330284282876129032008102561419014693564205492131523999072056356722523811field","value":"ciphertext1qyqfd3fz5ugh5rt8vk5w2ugp7sn9777qq82v6yg5p059dgf57knakqqay57mf"}' - - '{"type":"private","id":"709959112982644896253271486987191411441663870818104439243630623545390950272field","value":"ciphertext1qyqpwt8sqmqfxs0sw0l8jghvqfjt3hddemmy30e6s0ms9fgrn50kjqcfs69st"}' - - '{"type":"private","id":"6872976021810691710027178488223982683034356995539047639261319076027494254123field","value":"ciphertext1qyqwg30pz7gzh4zuyhy0vgumfxfm2xlpyxucg4tvewdz6gpr60skyrgauuulp"}' - - '{"type":"private","id":"8359829191814664268280684613954596526781157368700496608365669690643643037289field","value":"ciphertext1qyqvedxm8alapcwlph5kkmffkvafuhld92n4y7588704ujk9l3mhspq4k2kct"}' - - '{"type":"private","id":"1001150914100589972693891478671980342979312932580439705453658330535336008271field","value":"ciphertext1qyqy369l9urha2a99j2krk6tjh5dtdwt9z0puu0vtgvznk53khs9kzsrppr29"}' - - '{"type":"private","id":"8131111517226123155050404356134943165771021461049467536204430056357254727422field","value":"ciphertext1qyq2hn2xnu4fadsmaf65edm4ftyvg6ns7t40g0urv5h47z93ywvcjzqvtcq8r"}' - - '{"type":"private","id":"2328882362753533354211206400408346026883181405850191907839548608694887338104field","value":"ciphertext1qyqfhe6jhjc5te9zcsyvhgvruj9w9vyppj30pvhy66lmznv76ar65ygk8yr0m"}' + - '{"type":"private","id":"3178675254300275843383623280462721192133283660421872326577156508145365668480field","value":"ciphertext1qyqr72l9jxzmxy9grsl272ud24lq4de7pa36zww2c8n6sdt8ft3n2rsktrhcl"}' + - '{"type":"private","id":"3592370700431980549398591027926102431719057246222545849949554376480536512418field","value":"ciphertext1qyqp9mhjastjmtqppl0us4h0s9hwm2udk6sl7z8kmwxx0rjak0xl6rgrhdfp9"}' + - '{"type":"private","id":"5015190936906056906946595445486950479313140539015689642403600858320056079439field","value":"ciphertext1qyq2g4a6rkuzfs8x70r6zwyudgpn6rng0kv7l008nz52tzjjuyxscysn9k37c"}' + - '{"type":"private","id":"6455178200979974567545886653888837738198208830988894675846651316126562112600field","value":"ciphertext1qyqwk37q9hh34pyu5pqf4dqpkx62ct93u8eg503d3xdumxvgz24kzzs8xh5xf"}' + - '{"type":"private","id":"441578724655724425378862348205143575014108836933091743264908377416536569902field","value":"ciphertext1qyqx373jlfqlp8wk0z8d03w92aj5q6arcw5fa7crsln6je7ckufy2rs440p2r"}' + - '{"type":"private","id":"6727562409363713712272278253770938277290531703671883963721201766296710559416field","value":"ciphertext1qyqdrq9fmpxuvu637fzzevfj8k9p9twwt3skkakks43gjg3wxlmtvrcc2p8tg"}' + - '{"type":"private","id":"5900765846499883782656717755603787007957422075389964372791436651348006857224field","value":"ciphertext1qyqv8d0puv5lruc00xprqgfs3hql2jc7g0ku3usuxsqy4usz0l96ypgy9ur3s"}' + - '{"type":"private","id":"8295226756217200209959596718098054063884309676582306399212247817727537167993field","value":"ciphertext1qyqq2du67uasu2glt9kdhec7j7vct2rtdcnll3t8mpcrx02s0u0sxqsge3tlk"}' + - '{"type":"private","id":"8181394151926143042727606222080968091219514666973681831838802634723910704807field","value":"ciphertext1qyqxra6lnwkx3y8klf2vaud8keuk7jj4vd0k0kqgz8n26f3p97mrwrq0cq04s"}' + - '{"type":"private","id":"6734729083449209300118471016891853097724739272233592697735883274736165821640field","value":"ciphertext1qyqth22n052v2gungdh5nyngegq4sh874nruytkew5zq7kf2nnycjqgz37js7"}' + - '{"type":"private","id":"7500972475236275747881588151814005362695655417811301105586042430933060611422field","value":"ciphertext1qyq9nzmelc5zpuvchxr5m77enr4guj7ruv86xsdk2vx4ku3kwpxx2zsmw4usj"}' + - '{"type":"private","id":"8130977734223629619959263278616285929176363729398376780604587589091569071181field","value":"ciphertext1qyqgh960exm7dn5p3vvtvvnpscyd3g62efr78a3syxzcnu3lzvyv2ygq2e3nn"}' + - '{"type":"private","id":"1342233169177097654860453461670823088901477819542643899134838957080640297291field","value":"ciphertext1qyq2u4kvkuqkw9s0wegyczzul8s59mayjgaz0fzhtaemku6da6y5kpgxfu7sq"}' + - '{"type":"private","id":"7391399596647972354386735773625796963369050508605780615676837486755007451180field","value":"ciphertext1qyqr7uqs6wayrttlxd333lat5xxhhqcphkkylpknkg5dy4gunyx6jygdeqlfm"}' + - '{"type":"private","id":"154135336790998671754023870224163576051523380853463012393717687730220473648field","value":"ciphertext1qyqdehj5yytts6ldaa8ntgj8s695e73zhzg8gnv23kyr8zhzf3ftgqgsdeal0"}' + - '{"type":"private","id":"920095085577843523152461784092653536941316929806000265061076826661821648007field","value":"ciphertext1qyqysgfylsuh23tvrszlzzdswkant3vkjgx3v8ljhnfqqsuyk23pgqguzd940"}' speculate: the execution was accepted add_next_block: succeeded. - verified: true execute: gas_dos.aleo/make_trash_u64: outputs: - - '{"type":"public","id":"233314312605276539760746524164528913386489041588301421249429696985329848667field","value":"0u64"}' - - '{"type":"public","id":"7253165205278696561637248715563783454858866842754893348214451169160975075162field","value":"1u64"}' - - '{"type":"public","id":"666939097876094162575352087643400561412645022883205904471672662199353196861field","value":"2u64"}' - - '{"type":"public","id":"2959578059337764023181618398408038082893247480135464562472793876696915418953field","value":"3u64"}' - - '{"type":"public","id":"5286500885730658616234188227770288757865520078231878645131318044650940638194field","value":"4u64"}' - - '{"type":"public","id":"401309491997177592892630556474302634099704960274828674430960726287457846708field","value":"5u64"}' - - '{"type":"public","id":"7229261133705147296171654244855097638797071371920816627026569900935444723448field","value":"6u64"}' - - '{"type":"public","id":"7027737111877338341363202916015365226405006640018027773526971193651872286885field","value":"7u64"}' - - '{"type":"public","id":"4666981060089167647321091227592661962035883124507120144471806069733189753569field","value":"8u64"}' - - '{"type":"public","id":"2583284904746797664182562260080251003054566015963712113670613392689300760365field","value":"9u64"}' - - '{"type":"public","id":"4173633873661312951955239283483355234732949685908187166831651838082162090913field","value":"10u64"}' - - '{"type":"public","id":"122754949824671565357841063528425764444260908941146272537546151624065033563field","value":"11u64"}' - - '{"type":"public","id":"2130918280550853922824431786128137523245004386377672896846147107787168219683field","value":"12u64"}' - - '{"type":"public","id":"4694456538004825214415037291190735375240715731300118040019913761431560071687field","value":"13u64"}' - - '{"type":"public","id":"470751660319309894868159463333651824468663657160136189167945482341411113760field","value":"14u64"}' - - '{"type":"public","id":"4249914125363520277067410046691598837483324524993280920898528402016941453480field","value":"15u64"}' + - '{"type":"public","id":"730906278716886736214549186867912071216789907293619372995407182276178840902field","value":"0u64"}' + - '{"type":"public","id":"1575109245045429171368494780502083018941818963548716389294319521981302512311field","value":"1u64"}' + - '{"type":"public","id":"6542553720898513549147617785580217609728476848281216612038612053165479658830field","value":"2u64"}' + - '{"type":"public","id":"2050986609566910687002825879266223498079680553920166082503745042337551889897field","value":"3u64"}' + - '{"type":"public","id":"5975522125347992543144304600529534160726915753978735389103069215924086929065field","value":"4u64"}' + - '{"type":"public","id":"865214254461360763975319846771214299246126238769524047937335685873932972656field","value":"5u64"}' + - '{"type":"public","id":"7413677619876125297107923298740333237653602847707462889560217756108381577856field","value":"6u64"}' + - '{"type":"public","id":"3818658792814943441144259826962247349479763887533450194755382563551975295868field","value":"7u64"}' + - '{"type":"public","id":"5817474403061562864597825794761190001190072641318722371536768830410804482446field","value":"8u64"}' + - '{"type":"public","id":"7395071954794891679353516576003699033961561851951923345976907792327399116690field","value":"9u64"}' + - '{"type":"public","id":"3874311404551080002723926693546895057089037571699882905239093422478187649242field","value":"10u64"}' + - '{"type":"public","id":"2652544184779857036613378232899309079255075769671475608097048618116099520983field","value":"11u64"}' + - '{"type":"public","id":"6123105630472453276102467379726848248248111229924666892960235071928063826451field","value":"12u64"}' + - '{"type":"public","id":"7303341187590343154113254059959784526630864495886820459905858622304002827944field","value":"13u64"}' + - '{"type":"public","id":"2387756980249753394206100863037748629623359320692766913121732736054762620163field","value":"14u64"}' + - '{"type":"public","id":"3697673160058841840452855423974362417429421748522565469691462360008980535628field","value":"15u64"}' speculate: the execution was accepted add_next_block: succeeded. - verified: true @@ -88,60 +88,60 @@ additional: - child_outputs: credits.aleo/fee_public: outputs: - - '{"type":"future","id":"4460439047516495718073735439405487111536405512365343120714073673093841980496field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo10knkelvnd55fsaarm25wch7p9suf2tqlgwy5k4nxwms6d262xyfqm2tccr,\n 1153u64\n ]\n}"}' + - '{"type":"future","id":"1233502016375300540052185048988005014879973125955662939200057677097020855469field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo10knkelvnd55fsaarm25wch7p9suf2tqlgwy5k4nxwms6d262xyfqm2tccr,\n 1153u64\n ]\n}"}' - child_outputs: credits.aleo/fee_public: outputs: - - '{"type":"future","id":"8415028977876091761752724883671758688572237811988248476376341949695578218786field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo10knkelvnd55fsaarm25wch7p9suf2tqlgwy5k4nxwms6d262xyfqm2tccr,\n 2363u64\n ]\n}"}' + - '{"type":"future","id":"7949043185167856339065705832481459070786322851203345196375864651473234929294field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo10knkelvnd55fsaarm25wch7p9suf2tqlgwy5k4nxwms6d262xyfqm2tccr,\n 2363u64\n ]\n}"}' - child_outputs: credits.aleo/fee_public: outputs: - - '{"type":"future","id":"6955783271913968318412731377247340380831652777579800064049064878317952307153field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo10knkelvnd55fsaarm25wch7p9suf2tqlgwy5k4nxwms6d262xyfqm2tccr,\n 3331u64\n ]\n}"}' + - '{"type":"future","id":"7618522776601875506220555979247223944774138673406542519145196068858902991539field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo10knkelvnd55fsaarm25wch7p9suf2tqlgwy5k4nxwms6d262xyfqm2tccr,\n 3331u64\n ]\n}"}' - child_outputs: credits.aleo/fee_public: outputs: - - '{"type":"future","id":"6497372388862928104904790174065298189831176271028157197406452385672043799872field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo10knkelvnd55fsaarm25wch7p9suf2tqlgwy5k4nxwms6d262xyfqm2tccr,\n 2591u64\n ]\n}"}' + - '{"type":"future","id":"4128578215055107219586693676580863389042669274675087117576661936356041869384field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo10knkelvnd55fsaarm25wch7p9suf2tqlgwy5k4nxwms6d262xyfqm2tccr,\n 2591u64\n ]\n}"}' - child_outputs: child.aleo/inner_trash: outputs: - - '{"type":"public","id":"4289453696142715249689402741912245561443469314811952643858392482783244522724field","value":"0u8"}' - - '{"type":"public","id":"5996339838455228384518335132774934196611594954755346395054038050343103354395field","value":"1u8"}' - - '{"type":"public","id":"3358647378048771912605830105370148199260356999287873395305434987100537947367field","value":"2u8"}' - - '{"type":"public","id":"3561185473825389412729325762100699648338422087874903701388058185885064674548field","value":"3u8"}' - - '{"type":"public","id":"3989107665595226930217005016659525438354095241690887025362623017829393909086field","value":"4u8"}' - - '{"type":"public","id":"1015958412091382053251797862910077594839566070151006847448912156512885168244field","value":"5u8"}' - - '{"type":"public","id":"2567889317557457967764422538212118733579546499228855090594253956813932972072field","value":"6u8"}' - - '{"type":"public","id":"5738966943078846331986975383478175535362176248367077523225131270678347419252field","value":"7u8"}' - - '{"type":"public","id":"5051374977750131995628573872876580336294676313900512549961840473043598462489field","value":"8u8"}' - - '{"type":"public","id":"6246052362829258748286392424282967814827467657158490339715346793563788475395field","value":"9u8"}' - - '{"type":"public","id":"3137956905390822430675060441214691829333807921428930041891214885081618350759field","value":"10u8"}' - - '{"type":"public","id":"3954165324357671689980777474755501745352061261539083140319447666173245113194field","value":"11u8"}' - - '{"type":"public","id":"824411961835421718086912148073611074555830482874933344066928839715818180866field","value":"12u8"}' - - '{"type":"public","id":"3956987026475417071721267209248312177299219007429340821858712542495766818823field","value":"13u8"}' - - '{"type":"public","id":"2709313053745536114661259705416457664187223268321348433098736978752378149531field","value":"14u8"}' - - '{"type":"public","id":"6195248787047047065906932549716645015613025005664328197873983801878539808717field","value":"15u8"}' + - '{"type":"public","id":"5904883560300066031961888185189024338105163106003115127107355735397565233528field","value":"0u8"}' + - '{"type":"public","id":"3346629042065382701229893557344247189765599789097218570622975043609670798803field","value":"1u8"}' + - '{"type":"public","id":"4114234764478642651067432258613060895246418822635359350223568880016900828568field","value":"2u8"}' + - '{"type":"public","id":"791622446349226962179035220266689816431702156005686036773793811267759407217field","value":"3u8"}' + - '{"type":"public","id":"5861572462574962129911421840478714197449959818033666853831901127764956991974field","value":"4u8"}' + - '{"type":"public","id":"8295750733030242931291044435301453040050673845774859044070421871333808089231field","value":"5u8"}' + - '{"type":"public","id":"7955491755960271872467489555522237713927603213194488061987008083541383124742field","value":"6u8"}' + - '{"type":"public","id":"3352141292834455276753576005850851253061340486572425616164757702636471923178field","value":"7u8"}' + - '{"type":"public","id":"1454778745521830463882613773299218996297033423719881562973503668404270532584field","value":"8u8"}' + - '{"type":"public","id":"7214833348890557492438630005734195060401225319633334274543131178468025949410field","value":"9u8"}' + - '{"type":"public","id":"8070255258837127839579827105984137383669983211953015519516297263152741166622field","value":"10u8"}' + - '{"type":"public","id":"6658033481790040965433203990044877190888249483767740626424900263358580479885field","value":"11u8"}' + - '{"type":"public","id":"4634805450592919107424233434549539397856300586736332530027446614793085861610field","value":"12u8"}' + - '{"type":"public","id":"6465237487036414684746876776225050063026228756956149581569485610341137167883field","value":"13u8"}' + - '{"type":"public","id":"539780083557878421637523477938110313145014901324462713310417688577608340204field","value":"14u8"}' + - '{"type":"public","id":"3032526681684647445570962976764436225697368058525256456212480567401674887679field","value":"15u8"}' credits.aleo/fee_public: outputs: - - '{"type":"future","id":"4993318844385279622659406372029663957024103433727459966940237716301579651158field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo10knkelvnd55fsaarm25wch7p9suf2tqlgwy5k4nxwms6d262xyfqm2tccr,\n 7558u64\n ]\n}"}' + - '{"type":"future","id":"4334081886835801940971123206469013415987775305601578551344205766751953038292field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo10knkelvnd55fsaarm25wch7p9suf2tqlgwy5k4nxwms6d262xyfqm2tccr,\n 7558u64\n ]\n}"}' - child_outputs: child.aleo/inner_trash_private: outputs: - - '{"type":"private","id":"1690417811643581808096073580895773872435783139189560207201450077859617190194field","value":"ciphertext1qyqqq6ssunw42mxe8rvpgu5ep0vagrn8dklju850us04wnghvh0njqsqvr2yw"}' - - '{"type":"private","id":"1886046153841688110779792443332379168760253439921378427387264032458090200722field","value":"ciphertext1qyqttnazmxdpq7jptzzzrur7gnydv4266yrrkg8hnd7qmvph3jgk5rsnqcuh8"}' - - '{"type":"private","id":"6945085598979721763398156380753241304545404123616624832451856372265095265471field","value":"ciphertext1qyq9l5ru4w25cegepncrwp200d40gug4sx204nhff5l2874zhplmzrqrhz2p4"}' - - '{"type":"private","id":"4142368517252176157373208821260613486695598769131006201465716808814519857801field","value":"ciphertext1qyqt2nvvunh6eyr3uyzfpx0nlcc724snpv0yenhr0epg6nxn9uf9yrqe483na"}' - - '{"type":"private","id":"1120928326819667499163846513166443389126716487911614317777817493947758499240field","value":"ciphertext1qyqvez6t833qwtrekh95qd0p9ur5ze7zfcj586gj45e5tgrcdck3crc7tx99u"}' - - '{"type":"private","id":"6520628852176590483742399620632204000766376375298286587002994790769934792244field","value":"ciphertext1qyqycec6g3lvzaudt02704zgfg989h0nlk29t30vm3ccs49l3qs2yzcvrgffu"}' - - '{"type":"private","id":"1653566059245057918600614758625811774818934631158115642909983653207058134332field","value":"ciphertext1qyqgxpqwlme4h4x5nlljrjc43ffdrrjks6tukqutnfrh5e5mgqjvwqgk4lzej"}' - - '{"type":"private","id":"3125530302804834593185552768712989898348727954206124549854468299555811589311field","value":"ciphertext1qyqwyv767yj0qtlpj3e8afcg2fq7dqq2rph0agla0x3a0k7x75g6czqjxkmnc"}' - - '{"type":"private","id":"6653724285397119534364272198358009303219371121472302648376197869755877142457field","value":"ciphertext1qyqx79grpqzmaa6n8m2r6s0stg9ljhrrqwtvaesn3vdmazermzn8jzg3rphqk"}' - - '{"type":"private","id":"4306156319852057171767064704924666509745421179658746592641215257474382652393field","value":"ciphertext1qyqqp655v4g4dv32lflxcpw2075vkm6jlmeewkvl0r8as9kpjg2xsqgjh94yw"}' - - '{"type":"private","id":"862763398396949844010720017565280792516718591614353786919911043964654671911field","value":"ciphertext1qyq0nu20c928tylcadunqkhf8n2wsggp42qad55n52vzzn3ax9at6rg0y2z7d"}' - - '{"type":"private","id":"6115537416632677547733070126318384273659824508082312339839289007774031750910field","value":"ciphertext1qyqd4wdfkm5mk3gqrcpp6cy8v43qqn70n68xnhtajeegnwt03xf07zqst7s60"}' - - '{"type":"private","id":"1288760742755161344468854268135477208800345648264783432462324547157974963800field","value":"ciphertext1qyqd87aklz0vgfyzn5wg8zwwf3xevyhkxsfaj0hugz5u94we55fycysqmnghx"}' - - '{"type":"private","id":"4094529815608050570605871705117213797215439814194985582364462185707725973687field","value":"ciphertext1qyq8d80slfgjf4l76k40a6cgtpvg0dy2qzl7d0r5cy59dvglv8tewrgeh7ts4"}' - - '{"type":"private","id":"2813602845252947372312080494391108546455078881365658135103980463173542847486field","value":"ciphertext1qyq9t35rxns4t03u9uts467dc450vefn2r37p4g02kww88p5lqr2zpqy9m8l7"}' - - '{"type":"private","id":"4797712783560200923986301701874758524183619526850656800063565109797126046631field","value":"ciphertext1qyqr3c39tq9t3mh54z39vhuqc832peuvatlvk28ygjsnl04u3njksrc8w2arw"}' + - '{"type":"private","id":"8032697161240434925553233719907517361847178466961641830077911060008789447796field","value":"ciphertext1qyq8v9hksgs9z5n96m4rruzc5f8m25vshdtkh3ckwvtm6gzzpe827qs08fqhe"}' + - '{"type":"private","id":"4738943134012647945226268068877749848128824814436419950647824307962508386185field","value":"ciphertext1qyqx9zgse0u8pmlawdjw4yhsvc4ncluft34zm4h84wa49qjjdhx9upq9sasx4"}' + - '{"type":"private","id":"2635959015923564697286885588132564920865099194175958790989055258375639564872field","value":"ciphertext1qyq009lapuqdrxltqk24dh7lxqgscqecraejsk5fsdem5c9cpn99jrqachjfa"}' + - '{"type":"private","id":"3529010997203471228727679630176343425830488200535857454220765551756642894632field","value":"ciphertext1qyqxxrkc6ky6qr2gahmh3fdx86sx3zd340kq93ypljef9lcyvj2qcrcj2675k"}' + - '{"type":"private","id":"6665382644452199312390682569471698177901671090003591136674026014712215787440field","value":"ciphertext1qyqppt0twxta22kpkxltpmrjjrcc9awhw3d7hygwmmhplc9ctw067pqyg7995"}' + - '{"type":"private","id":"2748689820460604776985274040581262596018845354312291444007836420267464829488field","value":"ciphertext1qyqdhvdkfjcpmgm8fk4uxdxwquf09a723pqp3pvpm8g6y0ljjkk5uqgq9kc0k"}' + - '{"type":"private","id":"1447383371184268978767488566872720862633397185953221781947866349229014585162field","value":"ciphertext1qyqpw5fvuhvxav9maerk5apz4vy7kwww7fasgx5gaemtuagukqh2yzgv8dg5w"}' + - '{"type":"private","id":"6382890757397621046591645619235381972287595253748882780507077881390244013680field","value":"ciphertext1qyqdu79dm6p7p2g9xysnlsgphtk9tar73c7vpfwd8udque73vpz3krqj97u8z"}' + - '{"type":"private","id":"4316066373532442556231595467086777858030760464465764712503159356773410694734field","value":"ciphertext1qyqpuhrw5jdds2pdfve74272zyzp8dmhts57cydw6gzn75d226r2kpc9fuckz"}' + - '{"type":"private","id":"3681815417015076292682872513235796496265803403295723825838200685480906340815field","value":"ciphertext1qyqwxufrfqkp9utdtrwu0nqrvtgnxqppnwga9fp5nv50hrrsqylpyyg546fam"}' + - '{"type":"private","id":"7239731187052707524355678559194102714131401220844799996252791084924098866449field","value":"ciphertext1qyqdha7v553khg0dlca7zqrav2y32qgxzpwexu3pk4lh00uah8dcuqq9l3svw"}' + - '{"type":"private","id":"6915938306677382285025362060620239528744510612859529413977898404015795221508field","value":"ciphertext1qyqfkm26ec8hs6vdpfcppkktwy76msdlwfg8euat9enwew4rcqtlkqqxnzg6r"}' + - '{"type":"private","id":"4660065728032854412381748795889622379272314801373174547945776152533312518220field","value":"ciphertext1qyqqg7rt8p74zyweshpsa7rwfadvz5wrx50heqxjucxs9nynuv58gpgvpeeka"}' + - '{"type":"private","id":"6730070339834180050058900303293497953058084638877897827327393536891839946788field","value":"ciphertext1qyqzsy5xlnj9av5jdy379lm89za69ecjzgtcn3hcc3z42r3h2rkdjqczey6p4"}' + - '{"type":"private","id":"3905598913166472693352955825211180882338391772928515609728936680972478660573field","value":"ciphertext1qyqfpea03nqftwz4rlr9tym4azz26985stv0z8xuu9gzwclyee7ygqqgjcp3k"}' + - '{"type":"private","id":"7215693369984008673223118085891715586218466956518910943400085339158665270425field","value":"ciphertext1qyqqmqcfmqrals8ajt564w6s3lau2dmxn09lgjdx8s3a2ugdnuqh6rgkw6ywd"}' credits.aleo/fee_public: outputs: - - '{"type":"future","id":"3920528155218069690017755593796450711436583446509070220539016754499888750597field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo10knkelvnd55fsaarm25wch7p9suf2tqlgwy5k4nxwms6d262xyfqm2tccr,\n 11438u64\n ]\n}"}' + - '{"type":"future","id":"5813903071441008439034377261900917439453188395995082500140988193573411054956field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo10knkelvnd55fsaarm25wch7p9suf2tqlgwy5k4nxwms6d262xyfqm2tccr,\n 11438u64\n ]\n}"}' diff --git a/synthesizer/tests/expectations/vm/execute_and_finalize/mapping_operations.out b/synthesizer/tests/expectations/vm/execute_and_finalize/mapping_operations.out index cf0ee56ebb..0cec3ce62d 100644 --- a/synthesizer/tests/expectations/vm/execute_and_finalize/mapping_operations.out +++ b/synthesizer/tests/expectations/vm/execute_and_finalize/mapping_operations.out @@ -4,44 +4,44 @@ outputs: execute: mapping_operations.aleo/empty_remove: outputs: - - '{"type":"future","id":"513976670430165590671975854207176640474722360754218511139582421307363127239field","value":"{\n program_id: mapping_operations.aleo,\n function_name: empty_remove,\n arguments: [\n 10u8\n ]\n}"}' + - '{"type":"future","id":"528917916050546693969666750679371761292623528001587956260557894521828605078field","value":"{\n program_id: mapping_operations.aleo,\n function_name: empty_remove,\n arguments: [\n 10u8\n ]\n}"}' speculate: the execution was accepted add_next_block: succeeded. - verified: true execute: mapping_operations.aleo/insert_contains_remove: outputs: - - '{"type":"future","id":"4694759841672908832036638375867859148189802436433991047332612043424830909025field","value":"{\n program_id: mapping_operations.aleo,\n function_name: insert_contains_remove,\n arguments: [\n 0u8,\n 0u8\n ]\n}"}' + - '{"type":"future","id":"1878591124600593274844632247963154904652598107721964702057358386743661676785field","value":"{\n program_id: mapping_operations.aleo,\n function_name: insert_contains_remove,\n arguments: [\n 0u8,\n 0u8\n ]\n}"}' speculate: the execution was accepted add_next_block: succeeded. - verified: true execute: mapping_operations.aleo/insert_contains_remove: outputs: - - '{"type":"future","id":"853544788270499381306658592151445821754762116076336414387883404121303374960field","value":"{\n program_id: mapping_operations.aleo,\n function_name: insert_contains_remove,\n arguments: [\n 0u8,\n 0u8\n ]\n}"}' + - '{"type":"future","id":"4691407840608871888428340061515213816979609712949925756564814279452199679886field","value":"{\n program_id: mapping_operations.aleo,\n function_name: insert_contains_remove,\n arguments: [\n 0u8,\n 0u8\n ]\n}"}' speculate: the execution was accepted add_next_block: succeeded. - verified: true execute: mapping_operations.aleo/insert_contains_remove: outputs: - - '{"type":"future","id":"2512373776423473614600491202863965271515634672166785663979141185347250398174field","value":"{\n program_id: mapping_operations.aleo,\n function_name: insert_contains_remove,\n arguments: [\n 0u8,\n 1u8\n ]\n}"}' + - '{"type":"future","id":"1376837211363430068653312021356042012328839054002272482440237208239311509555field","value":"{\n program_id: mapping_operations.aleo,\n function_name: insert_contains_remove,\n arguments: [\n 0u8,\n 1u8\n ]\n}"}' speculate: the execution was accepted add_next_block: succeeded. additional: - child_outputs: credits.aleo/fee_public: outputs: - - '{"type":"future","id":"4231981562230118887771148803779105717607845231959193592368421734187691782226field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1eakarna6a70pg9r0l9qal20faejwctgur5xt7lnc2a42wj2yssfqc89rk8,\n 11277u64\n ]\n}"}' + - '{"type":"future","id":"765274853018791932597982874333036008771579256261317466733767488861755463898field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1eakarna6a70pg9r0l9qal20faejwctgur5xt7lnc2a42wj2yssfqc89rk8,\n 11277u64\n ]\n}"}' - child_outputs: credits.aleo/fee_public: outputs: - - '{"type":"future","id":"3819478822099171120366229999148101503444113586997605769708785149006145735527field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1eakarna6a70pg9r0l9qal20faejwctgur5xt7lnc2a42wj2yssfqc89rk8,\n 53072u64\n ]\n}"}' + - '{"type":"future","id":"3702624994201751869571637613043506547844907566047297879155547309912750338743field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1eakarna6a70pg9r0l9qal20faejwctgur5xt7lnc2a42wj2yssfqc89rk8,\n 53072u64\n ]\n}"}' - child_outputs: credits.aleo/fee_public: outputs: - - '{"type":"future","id":"4954497220272524572712674911495917535980779254032408121375814942204186632211field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1eakarna6a70pg9r0l9qal20faejwctgur5xt7lnc2a42wj2yssfqc89rk8,\n 53072u64\n ]\n}"}' + - '{"type":"future","id":"2880164867086873472928666458045989541371543910520545574666913914061154311961field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1eakarna6a70pg9r0l9qal20faejwctgur5xt7lnc2a42wj2yssfqc89rk8,\n 53072u64\n ]\n}"}' - child_outputs: credits.aleo/fee_public: outputs: - - '{"type":"future","id":"4374767356370294298106071783882769062590961601732098604265421591312847844881field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1eakarna6a70pg9r0l9qal20faejwctgur5xt7lnc2a42wj2yssfqc89rk8,\n 53072u64\n ]\n}"}' + - '{"type":"future","id":"731712670790521506884462270784414260536578431010638989688535042138119508642field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1eakarna6a70pg9r0l9qal20faejwctgur5xt7lnc2a42wj2yssfqc89rk8,\n 53072u64\n ]\n}"}' diff --git a/synthesizer/tests/expectations/vm/execute_and_finalize/mint_and_split.out b/synthesizer/tests/expectations/vm/execute_and_finalize/mint_and_split.out index f791a869ad..00b684d244 100644 --- a/synthesizer/tests/expectations/vm/execute_and_finalize/mint_and_split.out +++ b/synthesizer/tests/expectations/vm/execute_and_finalize/mint_and_split.out @@ -13,6 +13,6 @@ additional: - child_outputs: credits.aleo/fee_public: outputs: - - '{"type":"future","id":"2158022471677595094455860012302752744522806829113696165327761361044312438720field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo19e6k5ferx3k8a9k79xtj4uuaztt2jl4eza7k43pygsu977yazypqqwdmw6,\n 1446u64\n ]\n}"}' + - '{"type":"future","id":"8141932365338593422680862019466751805702849444320820698860516208562395953506field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo19e6k5ferx3k8a9k79xtj4uuaztt2jl4eza7k43pygsu977yazypqqwdmw6,\n 1446u64\n ]\n}"}' - {} - {} diff --git a/synthesizer/tests/expectations/vm/execute_and_finalize/program_callable.out b/synthesizer/tests/expectations/vm/execute_and_finalize/program_callable.out index 2281c70427..2d1c6b81e8 100644 --- a/synthesizer/tests/expectations/vm/execute_and_finalize/program_callable.out +++ b/synthesizer/tests/expectations/vm/execute_and_finalize/program_callable.out @@ -5,10 +5,10 @@ outputs: execute: parent.aleo/foo: outputs: - - '{"type":"public","id":"2829372819390311696617873264162840896896355516010956180339946389772514775851field","value":"aleo16w8t56s7v6ud7vu33fr388ph0dq0c7yhp597cyjt88rr3nultcyqcyk9yy"}' - - '{"type":"public","id":"1736075082696400606624473443797902938087287553141844508580140047297945071102field","value":"aleo1qr2ha4pfs5l28aze88yn6fhleeythklkczrule2v838uwj65n5gqxt9djx"}' - - '{"type":"public","id":"7619233453435555778275297717545549202007972760925283159360438287135601699719field","value":"aleo1qr2ha4pfs5l28aze88yn6fhleeythklkczrule2v838uwj65n5gqxt9djx"}' - - '{"type":"public","id":"2597622858524047689013532072932839576642557752380297062291865581619628741782field","value":"aleo1qr2ha4pfs5l28aze88yn6fhleeythklkczrule2v838uwj65n5gqxt9djx"}' + - '{"type":"public","id":"3132791686827287921440743324738703114146701102235145323661431442511856217971field","value":"aleo16w8t56s7v6ud7vu33fr388ph0dq0c7yhp597cyjt88rr3nultcyqcyk9yy"}' + - '{"type":"public","id":"1169777204608013233991632187841309149325186451415097502721101984905963139305field","value":"aleo1qr2ha4pfs5l28aze88yn6fhleeythklkczrule2v838uwj65n5gqxt9djx"}' + - '{"type":"public","id":"1665319193117753448377121751627813108743655828484762770917631655878172393186field","value":"aleo1qr2ha4pfs5l28aze88yn6fhleeythklkczrule2v838uwj65n5gqxt9djx"}' + - '{"type":"public","id":"7758205965922928181208860399725493314521642846958858098822310042398374724396field","value":"aleo1qr2ha4pfs5l28aze88yn6fhleeythklkczrule2v838uwj65n5gqxt9djx"}' speculate: the execution was accepted add_next_block: succeeded. additional: @@ -16,8 +16,8 @@ additional: - child_outputs: child.aleo/foo: outputs: - - '{"type":"public","id":"1555680711885329781325907130562266430447024930714573248890624102518741752917field","value":"aleo16w8t56s7v6ud7vu33fr388ph0dq0c7yhp597cyjt88rr3nultcyqcyk9yy"}' - - '{"type":"public","id":"1098600096063596467886239395047240422541419832572815880494064602469155799505field","value":"aleo1qr2ha4pfs5l28aze88yn6fhleeythklkczrule2v838uwj65n5gqxt9djx"}' + - '{"type":"public","id":"2993170113733308844367597166852726630975295024179214931455119604247188877620field","value":"aleo16w8t56s7v6ud7vu33fr388ph0dq0c7yhp597cyjt88rr3nultcyqcyk9yy"}' + - '{"type":"public","id":"1950496274064567059462280897914917860554722224455576030212114387721626639734field","value":"aleo1qr2ha4pfs5l28aze88yn6fhleeythklkczrule2v838uwj65n5gqxt9djx"}' credits.aleo/fee_public: outputs: - - '{"type":"future","id":"501793283007282228322391938555677583342117982886938779668675863727551099142field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1qr2ha4pfs5l28aze88yn6fhleeythklkczrule2v838uwj65n5gqxt9djx,\n 2187u64\n ]\n}"}' + - '{"type":"future","id":"2599746364993747569854355360180642623041829224356671742496735219392179674498field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1qr2ha4pfs5l28aze88yn6fhleeythklkczrule2v838uwj65n5gqxt9djx,\n 2187u64\n ]\n}"}' diff --git a/synthesizer/tests/expectations/vm/execute_and_finalize/public_wallet.out b/synthesizer/tests/expectations/vm/execute_and_finalize/public_wallet.out index 97dfd95336..5a64cda820 100644 --- a/synthesizer/tests/expectations/vm/execute_and_finalize/public_wallet.out +++ b/synthesizer/tests/expectations/vm/execute_and_finalize/public_wallet.out @@ -4,14 +4,14 @@ outputs: execute: public_wallet.aleo/init: outputs: - - '{"type":"future","id":"4464942226841699051231230836770437274733784749720398875079497729457972358531field","value":"{\n program_id: public_wallet.aleo,\n function_name: init,\n arguments: [\n {\n program_id: token.aleo,\n function_name: mint_public,\n arguments: [\n aleo1sry3pke49ykrf0aeshf889tr98r4c86p5f4ms766795ssdwfdyqq9jdg0j,\n 10u64\n ]\n }\n \n ]\n}"}' + - '{"type":"future","id":"3857172901441947534526418517380975227797871553595911987239461419522452545082field","value":"{\n program_id: public_wallet.aleo,\n function_name: init,\n arguments: [\n {\n program_id: token.aleo,\n function_name: mint_public,\n arguments: [\n aleo1sry3pke49ykrf0aeshf889tr98r4c86p5f4ms766795ssdwfdyqq9jdg0j,\n 10u64\n ]\n }\n \n ]\n}"}' speculate: the execution was accepted add_next_block: succeeded. additional: - child_outputs: token.aleo/mint_public: outputs: - - '{"type":"future","id":"6870476253411913047431672168259118946802015453568356666196082705096404310887field","value":"{\n program_id: token.aleo,\n function_name: mint_public,\n arguments: [\n aleo1sry3pke49ykrf0aeshf889tr98r4c86p5f4ms766795ssdwfdyqq9jdg0j,\n 10u64\n ]\n}"}' + - '{"type":"future","id":"1631423278608052853768107395089521617081238671575890493962924098384161856776field","value":"{\n program_id: token.aleo,\n function_name: mint_public,\n arguments: [\n aleo1sry3pke49ykrf0aeshf889tr98r4c86p5f4ms766795ssdwfdyqq9jdg0j,\n 10u64\n ]\n}"}' credits.aleo/fee_public: outputs: - - '{"type":"future","id":"8242741303045788366029769877408013430285170870359415275077024518285491239453field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1d3e2je2m2hsxwdsvntvf4jnnlj459ywfry6ch2qwrpy6l6r6yvpq8e88h5,\n 27585u64\n ]\n}"}' + - '{"type":"future","id":"7334131816336578548207468749349798727140016102586366303966330861449690845886field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1d3e2je2m2hsxwdsvntvf4jnnlj459ywfry6ch2qwrpy6l6r6yvpq8e88h5,\n 27585u64\n ]\n}"}' diff --git a/synthesizer/tests/expectations/vm/execute_and_finalize/read_external_mapping.out b/synthesizer/tests/expectations/vm/execute_and_finalize/read_external_mapping.out index 51f9402e04..0844e497c6 100644 --- a/synthesizer/tests/expectations/vm/execute_and_finalize/read_external_mapping.out +++ b/synthesizer/tests/expectations/vm/execute_and_finalize/read_external_mapping.out @@ -5,7 +5,7 @@ outputs: relay.aleo/send: outputs: - '{"type":"record","id":"5505341694097720023583674648027312667621444458172921945164834002648638744768field","checksum":"4170712463954366904268628656227022271867279479485549214633981747772705648157field","value":"record1qyqsp358e054av498aavwel28wr36tg0ay27k4fc539ffmwz2nddl8gqqyzxgct5vy3sqqspqpfgwnp3rnwprhd2q3h8gmxcnldlczrvszade4vzxlu7dmfeg6j3rd8mwuzysqtgl6603ey2zzry8hjwmn3pt3twclpkkvssc4l4jzsvd6lxar"}' - - '{"type":"future","id":"5442196731199501033516997315536802286771381654648404072656864347298151743003field","value":"{\n program_id: relay.aleo,\n function_name: send,\n arguments: [\n aleo1f6eg623knp66cwx0926w3plgdgzcmfpgyrzgnjz90mucgs3z7s9qls4upm\n ]\n}"}' + - '{"type":"future","id":"5717025369252791268307518245044265589645500853607154349985983366013693165029field","value":"{\n program_id: relay.aleo,\n function_name: send,\n arguments: [\n aleo1f6eg623knp66cwx0926w3plgdgzcmfpgyrzgnjz90mucgs3z7s9qls4upm\n ]\n}"}' speculate: the execution was rejected add_next_block: succeeded. - verified: true @@ -13,14 +13,14 @@ outputs: relay.aleo/send_without_check: outputs: - '{"type":"record","id":"4755207731349921544198839760105069860415948248486655350742993041864954064196field","checksum":"7848435433502532569425287419063381736913355859517668180377091558079541996646field","value":"record1qyqsp83ncqrtrev57v03h3j8qcysfgef256zh7pmh7zgj83h6g7tfkq0qyzxgct5vy3sqqspqzx4ww05zz3grf6hxgr46csu2vmzr2lgq0f48kxp4j383l68ufqsq45f8wqk6jxfnkm6v92cq48xea0tfrg0fwwr249m95t4eka6jkgv0c5y7k"}' - - '{"type":"future","id":"7096105927658574358527187665040993539615241837502198163087038919436093048144field","value":"{\n program_id: relay.aleo,\n function_name: send_without_check,\n arguments: [\n aleo1f6eg623knp66cwx0926w3plgdgzcmfpgyrzgnjz90mucgs3z7s9qls4upm\n ]\n}"}' + - '{"type":"future","id":"7550940621112069147305499283447693470949248949646948758584545929055098614021field","value":"{\n program_id: relay.aleo,\n function_name: send_without_check,\n arguments: [\n aleo1f6eg623knp66cwx0926w3plgdgzcmfpgyrzgnjz90mucgs3z7s9qls4upm\n ]\n}"}' speculate: the execution was accepted add_next_block: succeeded. - verified: true execute: registry.aleo/register: outputs: - - '{"type":"future","id":"5446972737672342654865490167952496634158426704624044659644067337703357547983field","value":"{\n program_id: registry.aleo,\n function_name: register,\n arguments: [\n aleo1f6eg623knp66cwx0926w3plgdgzcmfpgyrzgnjz90mucgs3z7s9qls4upm\n ]\n}"}' + - '{"type":"future","id":"420928543522275050479077069598359906893359132913160778313607215088435256404field","value":"{\n program_id: registry.aleo,\n function_name: register,\n arguments: [\n aleo1f6eg623knp66cwx0926w3plgdgzcmfpgyrzgnjz90mucgs3z7s9qls4upm\n ]\n}"}' speculate: the execution was accepted add_next_block: succeeded. - verified: true @@ -28,14 +28,14 @@ outputs: relay.aleo/send: outputs: - '{"type":"record","id":"2277384653342632398532359071690090462344215994043547853708800775056671259572field","checksum":"3071210942562837171924171313096615835242397071199450951002063969440885822680field","value":"record1qyqspfwaru0f2lj0s2k6p9jfmmkzyvkzl5qpagt00edyuf9qn3gnu5g9qyzxgct5vy3sqqspqrncgctd3wfmz2ggx0v7l5cggxxad49wcmtlyrjnk8fqulmkg3h3rleuqh8nmwn5d9z8cpf6z75sy880xenua6hu9wk6ptzwh9vnzps3l7743a"}' - - '{"type":"future","id":"4556110991549826207824540984103632227024449543743135915491677376919472371272field","value":"{\n program_id: relay.aleo,\n function_name: send,\n arguments: [\n aleo1f6eg623knp66cwx0926w3plgdgzcmfpgyrzgnjz90mucgs3z7s9qls4upm\n ]\n}"}' + - '{"type":"future","id":"7335072283454266955486193272021538348385359506102454702232503952941871822416field","value":"{\n program_id: relay.aleo,\n function_name: send,\n arguments: [\n aleo1f6eg623knp66cwx0926w3plgdgzcmfpgyrzgnjz90mucgs3z7s9qls4upm\n ]\n}"}' speculate: the execution was accepted add_next_block: succeeded. - verified: true execute: registry.aleo/unregister: outputs: - - '{"type":"future","id":"3937468794217695767514352020825733704009053357618910412289449201022528183129field","value":"{\n program_id: registry.aleo,\n function_name: unregister,\n arguments: [\n aleo1f6eg623knp66cwx0926w3plgdgzcmfpgyrzgnjz90mucgs3z7s9qls4upm\n ]\n}"}' + - '{"type":"future","id":"679464137653274742839187887301618622489786113106422850487639713737535385053field","value":"{\n program_id: registry.aleo,\n function_name: unregister,\n arguments: [\n aleo1f6eg623knp66cwx0926w3plgdgzcmfpgyrzgnjz90mucgs3z7s9qls4upm\n ]\n}"}' speculate: the execution was accepted add_next_block: succeeded. - verified: true @@ -43,31 +43,31 @@ outputs: relay.aleo/send: outputs: - '{"type":"record","id":"6497977440830787207175874226764101265608813002804421333613230199582364410758field","checksum":"319323911748946858530605909565888788506340329996151513367076865761846915611field","value":"record1qyqsqnajqear5neee3l8fykp4vcq35sgwreyz7hz3png3cn2yyljdscfqyzxgct5vy3sqqspqzu6lezptk9xjpx35xdrv5tztz0v9qs9xx803pyqury2j47x2d5seymhf3xa2wefz7mkas7r7m3uf4kte7fdwm00ral53q2mhclx95qte8mpvc"}' - - '{"type":"future","id":"3229366919318219679638161067381792227991045093986357075456487847991962063680field","value":"{\n program_id: relay.aleo,\n function_name: send,\n arguments: [\n aleo1f6eg623knp66cwx0926w3plgdgzcmfpgyrzgnjz90mucgs3z7s9qls4upm\n ]\n}"}' + - '{"type":"future","id":"884722454089253418562221490807303959161101695210458740892906535295075161672field","value":"{\n program_id: relay.aleo,\n function_name: send,\n arguments: [\n aleo1f6eg623knp66cwx0926w3plgdgzcmfpgyrzgnjz90mucgs3z7s9qls4upm\n ]\n}"}' speculate: the execution was rejected add_next_block: succeeded. additional: - child_outputs: credits.aleo/fee_public: outputs: - - '{"type":"future","id":"2460846645005462366786666390638662805054402091600049454074156831399214194828field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1xe2fps8f9xpdas2q0fqy22uraenk84tvvzetrsyxgnwy6445h59s6wv78x,\n 12331u64\n ]\n}"}' + - '{"type":"future","id":"7648175304675096026780640150249050430126313932796261601585627346676503665056field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1xe2fps8f9xpdas2q0fqy22uraenk84tvvzetrsyxgnwy6445h59s6wv78x,\n 12331u64\n ]\n}"}' - child_outputs: credits.aleo/fee_public: outputs: - - '{"type":"future","id":"6275256556950672117831015896650227423786495892079094886222239210235424203607field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1xe2fps8f9xpdas2q0fqy22uraenk84tvvzetrsyxgnwy6445h59s6wv78x,\n 12359u64\n ]\n}"}' + - '{"type":"future","id":"2705483676500556524709771070827454100315478149315997882559815259752103335543field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1xe2fps8f9xpdas2q0fqy22uraenk84tvvzetrsyxgnwy6445h59s6wv78x,\n 12359u64\n ]\n}"}' - child_outputs: credits.aleo/fee_public: outputs: - - '{"type":"future","id":"8372199321635126203021619457748641319234355407813689190122379673577134950885field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1f6eg623knp66cwx0926w3plgdgzcmfpgyrzgnjz90mucgs3z7s9qls4upm,\n 14542u64\n ]\n}"}' + - '{"type":"future","id":"1411848222023701190996666942616875099282931632258684196395264413190693640893field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1f6eg623knp66cwx0926w3plgdgzcmfpgyrzgnjz90mucgs3z7s9qls4upm,\n 14542u64\n ]\n}"}' - child_outputs: credits.aleo/fee_public: outputs: - - '{"type":"future","id":"610670209921538255900619170127761975836076634836989613464070279109494487943field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1xe2fps8f9xpdas2q0fqy22uraenk84tvvzetrsyxgnwy6445h59s6wv78x,\n 12331u64\n ]\n}"}' + - '{"type":"future","id":"1868190452431317368813291334581792128122726398918592355342406544035130142983field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1xe2fps8f9xpdas2q0fqy22uraenk84tvvzetrsyxgnwy6445h59s6wv78x,\n 12331u64\n ]\n}"}' - child_outputs: credits.aleo/fee_public: outputs: - - '{"type":"future","id":"7567328850021607310717103237149585492311011209064307935458393135932696315699field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1f6eg623knp66cwx0926w3plgdgzcmfpgyrzgnjz90mucgs3z7s9qls4upm,\n 14546u64\n ]\n}"}' + - '{"type":"future","id":"4477898748688807061769744441075637584405202918505613760790829764406622025408field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1f6eg623knp66cwx0926w3plgdgzcmfpgyrzgnjz90mucgs3z7s9qls4upm,\n 14546u64\n ]\n}"}' - child_outputs: credits.aleo/fee_public: outputs: - - '{"type":"future","id":"1006453709257039404896819728350834886286831571018854714236513706501168842517field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1xe2fps8f9xpdas2q0fqy22uraenk84tvvzetrsyxgnwy6445h59s6wv78x,\n 12331u64\n ]\n}"}' + - '{"type":"future","id":"1737368985169748291589889371295386187060392770099481900284782778606372269731field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1xe2fps8f9xpdas2q0fqy22uraenk84tvvzetrsyxgnwy6445h59s6wv78x,\n 12331u64\n ]\n}"}' diff --git a/synthesizer/tests/expectations/vm/execute_and_finalize/test_branch.out b/synthesizer/tests/expectations/vm/execute_and_finalize/test_branch.out index a92ddf6b41..31eb448b63 100644 --- a/synthesizer/tests/expectations/vm/execute_and_finalize/test_branch.out +++ b/synthesizer/tests/expectations/vm/execute_and_finalize/test_branch.out @@ -4,33 +4,33 @@ outputs: execute: test_branch.aleo/run_test: outputs: - - '{"type":"future","id":"3591346548818546005072841126926165574136175856345199266519780799284817280600field","value":"{\n program_id: test_branch.aleo,\n function_name: run_test,\n arguments: [\n 1u8,\n 1u8\n ]\n}"}' + - '{"type":"future","id":"1689952277818654979661096150540017106084479583953159794693528941821121629614field","value":"{\n program_id: test_branch.aleo,\n function_name: run_test,\n arguments: [\n 1u8,\n 1u8\n ]\n}"}' speculate: the execution was rejected add_next_block: succeeded. - verified: true execute: test_branch.aleo/run_test: outputs: - - '{"type":"future","id":"7814101611196855827915898756837844994575969450427591648084996663195531996561field","value":"{\n program_id: test_branch.aleo,\n function_name: run_test,\n arguments: [\n 0u8,\n 1u8\n ]\n}"}' + - '{"type":"future","id":"114586048401498509272352737885171154770908861875852471025917693936087877358field","value":"{\n program_id: test_branch.aleo,\n function_name: run_test,\n arguments: [\n 0u8,\n 1u8\n ]\n}"}' speculate: the execution was rejected add_next_block: succeeded. - verified: true execute: test_branch.aleo/run_test: outputs: - - '{"type":"future","id":"2097297249273458526117790667287124784692256429234303674845630058419196175092field","value":"{\n program_id: test_branch.aleo,\n function_name: run_test,\n arguments: [\n 0u8,\n 0u8\n ]\n}"}' + - '{"type":"future","id":"7964420694372645950494297905013826833581925240887409965219568939973404172743field","value":"{\n program_id: test_branch.aleo,\n function_name: run_test,\n arguments: [\n 0u8,\n 0u8\n ]\n}"}' speculate: the execution was accepted add_next_block: succeeded. additional: - child_outputs: credits.aleo/fee_public: outputs: - - '{"type":"future","id":"7173480694908809256108540320075206508452674100243861581665566642817871381991field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1x3r205zqql5ywy0cqqt74k0r0htuusn0d037ycxe8ftt9ep8hyzsmqz4dh,\n 3500u64\n ]\n}"}' + - '{"type":"future","id":"3742811441854740995256946025007048836334179975183225882601152681493528561258field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1x3r205zqql5ywy0cqqt74k0r0htuusn0d037ycxe8ftt9ep8hyzsmqz4dh,\n 3500u64\n ]\n}"}' - child_outputs: credits.aleo/fee_public: outputs: - - '{"type":"future","id":"8282914561152876827019335440647738942468939906336223802339463037044326143146field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1x3r205zqql5ywy0cqqt74k0r0htuusn0d037ycxe8ftt9ep8hyzsmqz4dh,\n 3500u64\n ]\n}"}' + - '{"type":"future","id":"1647838761417122485573508821828299068832334922165753903144172080083427769077field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1x3r205zqql5ywy0cqqt74k0r0htuusn0d037ycxe8ftt9ep8hyzsmqz4dh,\n 3500u64\n ]\n}"}' - child_outputs: credits.aleo/fee_public: outputs: - - '{"type":"future","id":"5334579863811891704545979925237596250682151556306514860044024145517585546947field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1x3r205zqql5ywy0cqqt74k0r0htuusn0d037ycxe8ftt9ep8hyzsmqz4dh,\n 3500u64\n ]\n}"}' + - '{"type":"future","id":"4675644920916319507815616171226090209472553004231457948189653255466652728990field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1x3r205zqql5ywy0cqqt74k0r0htuusn0d037ycxe8ftt9ep8hyzsmqz4dh,\n 3500u64\n ]\n}"}' diff --git a/synthesizer/tests/expectations/vm/execute_and_finalize/test_rand.out b/synthesizer/tests/expectations/vm/execute_and_finalize/test_rand.out index 511c0af4b1..eb372e7191 100644 --- a/synthesizer/tests/expectations/vm/execute_and_finalize/test_rand.out +++ b/synthesizer/tests/expectations/vm/execute_and_finalize/test_rand.out @@ -4,44 +4,44 @@ outputs: execute: test_rand.aleo/rand_chacha_with_literals: outputs: - - '{"type":"future","id":"1765454680055977470133663998792825807893959339496402455206491781821113014267field","value":"{\n program_id: test_rand.aleo,\n function_name: rand_chacha_with_literals,\n arguments: [\n 0scalar,\n 0group,\n 0u8,\n 2i16,\n 4u32,\n 7i64,\n 8u128,\n 10field\n ]\n}"}' + - '{"type":"future","id":"5851936379967939919363011317470385211925863001600978824282354802243328225531field","value":"{\n program_id: test_rand.aleo,\n function_name: rand_chacha_with_literals,\n arguments: [\n 0scalar,\n 0group,\n 0u8,\n 2i16,\n 4u32,\n 7i64,\n 8u128,\n 10field\n ]\n}"}' speculate: the execution was accepted add_next_block: succeeded. - verified: true execute: test_rand.aleo/rand_chacha_with_struct: outputs: - - '{"type":"future","id":"1342337531921565545247998733341343470047235865406486394533997372459329935477field","value":"{\n program_id: test_rand.aleo,\n function_name: rand_chacha_with_struct,\n arguments: [\n {\n first: 0field,\n second: 0field,\n third: 0field,\n fourth: 0field,\n fifth: 0field\n}\n ]\n}"}' + - '{"type":"future","id":"3255218993644156872910307787306139629497029688077777497819797270383136364567field","value":"{\n program_id: test_rand.aleo,\n function_name: rand_chacha_with_struct,\n arguments: [\n {\n first: 0field,\n second: 0field,\n third: 0field,\n fourth: 0field,\n fifth: 0field\n}\n ]\n}"}' speculate: the execution was accepted add_next_block: succeeded. - verified: true execute: test_rand.aleo/rand_chacha_check: outputs: - - '{"type":"future","id":"488590592441422127997725386233571306457829570948543232762424611162021835080field","value":"{\n program_id: test_rand.aleo,\n function_name: rand_chacha_check,\n arguments: [\n 0field,\n false\n ]\n}"}' - speculate: the execution was accepted + - '{"type":"future","id":"5655280628674362392666464396476127281186411758739892961608160465159658100070field","value":"{\n program_id: test_rand.aleo,\n function_name: rand_chacha_check,\n arguments: [\n 0field,\n false\n ]\n}"}' + speculate: the execution was rejected add_next_block: succeeded. - verified: true execute: test_rand.aleo/rand_chacha_check: outputs: - - '{"type":"future","id":"884323248557348741020456011434839803868309861690594536593949575748229817915field","value":"{\n program_id: test_rand.aleo,\n function_name: rand_chacha_check,\n arguments: [\n 1field,\n true\n ]\n}"}' - speculate: the execution was rejected + - '{"type":"future","id":"4722955375376605065432422068493514420613444220803270858286854080465504837613field","value":"{\n program_id: test_rand.aleo,\n function_name: rand_chacha_check,\n arguments: [\n 1field,\n true\n ]\n}"}' + speculate: the execution was accepted add_next_block: succeeded. additional: - child_outputs: credits.aleo/fee_public: outputs: - - '{"type":"future","id":"688232565550074479957237991079250189610291259825289272252652272917330731838field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1uchf7kruskpp8thlnfeya9qeklcjss27j6rtu74zz7ch559neqystgslsp,\n 601838u64\n ]\n}"}' + - '{"type":"future","id":"1076527458106564529544533915951069356470950455466294891378581697395577060805field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1uchf7kruskpp8thlnfeya9qeklcjss27j6rtu74zz7ch559neqystgslsp,\n 601838u64\n ]\n}"}' - child_outputs: credits.aleo/fee_public: outputs: - - '{"type":"future","id":"4312563321279759209886042118500602385599041356791262942076841476719411110110field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1uchf7kruskpp8thlnfeya9qeklcjss27j6rtu74zz7ch559neqystgslsp,\n 26711u64\n ]\n}"}' + - '{"type":"future","id":"934509585235432931388992469492403334986771615715266644075656706577708720438field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1uchf7kruskpp8thlnfeya9qeklcjss27j6rtu74zz7ch559neqystgslsp,\n 26711u64\n ]\n}"}' - child_outputs: credits.aleo/fee_public: outputs: - - '{"type":"future","id":"1282129350700700594940680024596897867110148414308708700842921386046440366011field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1uchf7kruskpp8thlnfeya9qeklcjss27j6rtu74zz7ch559neqystgslsp,\n 26876u64\n ]\n}"}' + - '{"type":"future","id":"767895526948156364168904176257724171019709225591085577083318751394796758059field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1uchf7kruskpp8thlnfeya9qeklcjss27j6rtu74zz7ch559neqystgslsp,\n 26876u64\n ]\n}"}' - child_outputs: credits.aleo/fee_public: outputs: - - '{"type":"future","id":"2838401481340464124610411329302176081664394080829994051209644145406827373864field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1uchf7kruskpp8thlnfeya9qeklcjss27j6rtu74zz7ch559neqystgslsp,\n 26876u64\n ]\n}"}' + - '{"type":"future","id":"1572717739089618491430428262128578066213813186803348335138976241594053199721field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1uchf7kruskpp8thlnfeya9qeklcjss27j6rtu74zz7ch559neqystgslsp,\n 26876u64\n ]\n}"}' diff --git a/synthesizer/tests/expectations/vm/execute_and_finalize/timelock.out b/synthesizer/tests/expectations/vm/execute_and_finalize/timelock.out index bddb3741aa..6d3296cf33 100644 --- a/synthesizer/tests/expectations/vm/execute_and_finalize/timelock.out +++ b/synthesizer/tests/expectations/vm/execute_and_finalize/timelock.out @@ -4,22 +4,22 @@ outputs: execute: timelock.aleo/lock: outputs: - - '{"type":"future","id":"7519916640716130495448528557347618353867911739810990318131281151848970103498field","value":"{\n program_id: timelock.aleo,\n function_name: lock,\n arguments: []\n}"}' + - '{"type":"future","id":"5672658027601092821150632972624132536122029882218363630138745076773379462255field","value":"{\n program_id: timelock.aleo,\n function_name: lock,\n arguments: []\n}"}' speculate: the execution was rejected add_next_block: succeeded. - verified: true execute: timelock.aleo/lock: outputs: - - '{"type":"future","id":"1692329568288717165704659211644970574488153730247332824408199047029733666363field","value":"{\n program_id: timelock.aleo,\n function_name: lock,\n arguments: []\n}"}' + - '{"type":"future","id":"1309583359781052742370984261699469991508636898906015087862071776472698441892field","value":"{\n program_id: timelock.aleo,\n function_name: lock,\n arguments: []\n}"}' speculate: the execution was rejected add_next_block: succeeded. additional: - child_outputs: credits.aleo/fee_public: outputs: - - '{"type":"future","id":"945360682200179475934660913543316288826823363735980525242738043528572749037field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo12tksdptp7hvxly8tkm3um08fvf53qpehsgdgqfvy9pe3sewcq5ysjg5myy,\n 2196u64\n ]\n}"}' + - '{"type":"future","id":"651337484339032269160121054560086838303223967284342562550571699484082802926field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo12tksdptp7hvxly8tkm3um08fvf53qpehsgdgqfvy9pe3sewcq5ysjg5myy,\n 2196u64\n ]\n}"}' - child_outputs: credits.aleo/fee_public: outputs: - - '{"type":"future","id":"4407865525570721713881622682558869732652022922248324986891224724282763545029field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo12tksdptp7hvxly8tkm3um08fvf53qpehsgdgqfvy9pe3sewcq5ysjg5myy,\n 2196u64\n ]\n}"}' + - '{"type":"future","id":"7443982931975690101989710049485828676544650952612755258270206826459548145627field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo12tksdptp7hvxly8tkm3um08fvf53qpehsgdgqfvy9pe3sewcq5ysjg5myy,\n 2196u64\n ]\n}"}' diff --git a/synthesizer/tests/expectations/vm/execute_and_finalize/unused_position.out b/synthesizer/tests/expectations/vm/execute_and_finalize/unused_position.out index 3c78b6e8a7..7acc9e1b28 100644 --- a/synthesizer/tests/expectations/vm/execute_and_finalize/unused_position.out +++ b/synthesizer/tests/expectations/vm/execute_and_finalize/unused_position.out @@ -4,11 +4,11 @@ outputs: execute: unused_position.aleo/foo: outputs: - - '{"type":"future","id":"5049235690692170805152663732952500738215296477247651613244805919801146018013field","value":"{\n program_id: unused_position.aleo,\n function_name: foo,\n arguments: []\n}"}' + - '{"type":"future","id":"5408452314004637538444583211608650550215632668705730253710414606897907094286field","value":"{\n program_id: unused_position.aleo,\n function_name: foo,\n arguments: []\n}"}' speculate: the execution was accepted add_next_block: succeeded. additional: - child_outputs: credits.aleo/fee_public: outputs: - - '{"type":"future","id":"4500648057971642536326023581723419344508470174070904810378001320229962188845field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo12tksdptp7hvxly8tkm3um08fvf53qpehsgdgqfvy9pe3sewcq5ysjg5myy,\n 1308u64\n ]\n}"}' + - '{"type":"future","id":"1846547935819125611375261116748293171392625542993437934741572770467926190067field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo12tksdptp7hvxly8tkm3um08fvf53qpehsgdgqfvy9pe3sewcq5ysjg5myy,\n 1308u64\n ]\n}"}' diff --git a/synthesizer/tests/expectations/vm/execute_and_finalize/user_callable.out b/synthesizer/tests/expectations/vm/execute_and_finalize/user_callable.out index 6bbde6d251..72c6cdb93e 100644 --- a/synthesizer/tests/expectations/vm/execute_and_finalize/user_callable.out +++ b/synthesizer/tests/expectations/vm/execute_and_finalize/user_callable.out @@ -4,8 +4,8 @@ outputs: execute: child.aleo/foo: outputs: - - '{"type":"public","id":"8257993261519343122023101166480151323931323787055034156941189634399210202459field","value":"aleo1qr2ha4pfs5l28aze88yn6fhleeythklkczrule2v838uwj65n5gqxt9djx"}' - - '{"type":"public","id":"188190518969019844021095872841035661635298121101628545721182533596213107162field","value":"aleo1qr2ha4pfs5l28aze88yn6fhleeythklkczrule2v838uwj65n5gqxt9djx"}' + - '{"type":"public","id":"5080102022926418909778330219071921101316828719441748927127931330249058015974field","value":"aleo1qr2ha4pfs5l28aze88yn6fhleeythklkczrule2v838uwj65n5gqxt9djx"}' + - '{"type":"public","id":"5521854961454308608590219862110836142563484399396636760251296039833599837132field","value":"aleo1qr2ha4pfs5l28aze88yn6fhleeythklkczrule2v838uwj65n5gqxt9djx"}' speculate: the execution was accepted add_next_block: succeeded. - execute: 'Failed to evaluate instruction (call child.aleo/foo into r0 r1;): Failed to evaluate instruction (assert.eq self.caller self.signer ;): ''assert.eq'' failed: ''aleo16w8t56s7v6ud7vu33fr388ph0dq0c7yhp597cyjt88rr3nultcyqcyk9yy'' is not equal to ''aleo1qr2ha4pfs5l28aze88yn6fhleeythklkczrule2v838uwj65n5gqxt9djx'' (should be equal)' @@ -13,5 +13,5 @@ additional: - child_outputs: credits.aleo/fee_public: outputs: - - '{"type":"future","id":"4193852777105201569735062214533514773129433748132976330865503683138607715780field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1qr2ha4pfs5l28aze88yn6fhleeythklkczrule2v838uwj65n5gqxt9djx,\n 1276u64\n ]\n}"}' + - '{"type":"future","id":"3347872470791009142460537022787342626917524637524821339588032366241763021507field","value":"{\n program_id: credits.aleo,\n function_name: fee_public,\n arguments: [\n aleo1qr2ha4pfs5l28aze88yn6fhleeythklkczrule2v838uwj65n5gqxt9djx,\n 1276u64\n ]\n}"}' - {} From 7eeb3537edb1415931b7599de4df19b0dc43c25d Mon Sep 17 00:00:00 2001 From: Howard Wu <9260812+howardwu@users.noreply.github.com> Date: Sat, 10 Feb 2024 22:25:28 -0800 Subject: [PATCH 298/298] Reduce threshold for block validity --- ledger/block/src/lib.rs | 6 ------ 1 file changed, 6 deletions(-) diff --git a/ledger/block/src/lib.rs b/ledger/block/src/lib.rs index 927083e2f1..596de24a6c 100644 --- a/ledger/block/src/lib.rs +++ b/ledger/block/src/lib.rs @@ -159,12 +159,6 @@ impl Block { ); } - // Ensure the block contains transactions. - ensure!( - !transactions.is_empty() || !aborted_transaction_ids.is_empty(), - "Cannot create a block with zero transactions" - ); - // Ensure the number of transactions is within the allowed range. if transactions.len() > Transactions::::MAX_TRANSACTIONS { bail!(